]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithQCumulants.cxx
Mass bins settable from outside (Francesco)
[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),
115 fApplyCorrectionForNUA(kTRUE),
116 fReQ(NULL),
117 fImQ(NULL),
118 fSMpk(NULL),
119 fIntFlowCorrelationsEBE(NULL),
120 fIntFlowEventWeightsForCorrelationsEBE(NULL),
121 fIntFlowCorrelationsAllEBE(NULL),
122 fAvMultiplicity(NULL),
123 fIntFlowCorrelationsPro(NULL),
124 fIntFlowCorrelationsAllPro(NULL),
125 fIntFlowExtraCorrelationsPro(NULL),
126 fIntFlowProductOfCorrelationsPro(NULL),
0328db2d 127 fIntFlowProductOfCorrectionTermsForNUAPro(NULL),
489d5531 128 fIntFlowCorrelationsHist(NULL),
129 fIntFlowCorrelationsAllHist(NULL),
130 fIntFlowCovariances(NULL),
131 fIntFlowSumOfProductOfEventWeights(NULL),
0328db2d 132 fIntFlowCovariancesNUA(NULL),
133 fIntFlowSumOfProductOfEventWeightsNUA(NULL),
489d5531 134 fIntFlowQcumulants(NULL),
135 fIntFlow(NULL),
136 // 4.) differential flow:
137 fDiffFlowList(NULL),
138 fDiffFlowProfiles(NULL),
139 fDiffFlowResults(NULL),
140 fDiffFlowFlags(NULL),
141 fCalculate2DFlow(kFALSE),
142 // 5.) distributions:
57340a27 143 fDistributionsList(NULL),
144 fDistributionsFlags(NULL),
489d5531 145 fStoreDistributions(kFALSE),
146 // x.) debugging and cross-checking:
147 fNestedLoopsList(NULL),
148 fEvaluateIntFlowNestedLoops(kFALSE),
149 fEvaluateDiffFlowNestedLoops(kFALSE),
150 fMaxAllowedMultiplicity(10),
151 fEvaluateNestedLoops(NULL),
152 fIntFlowDirectCorrelations(NULL),
153 fIntFlowExtraDirectCorrelations(NULL),
154 fCrossCheckInPtBinNo(10),
3b552efe 155 fCrossCheckInEtaBinNo(20),
489d5531 156 fNoOfParticlesInBin(NULL)
157 {
158 // constructor
159
160 // base list to hold all output objects:
161 fHistList = new TList();
162 fHistList->SetName("cobjQC");
163 fHistList->SetOwner(kTRUE);
164
165 // list to hold histograms with phi, pt and eta weights:
166 fWeightsList = new TList();
167
168 // multiplicity weight:
169 fMultiplicityWeight = new TString("combinations");
170
171 // analysis label;
172 fAnalysisLabel = new TString();
173
174 // initialize all arrays:
175 this->InitializeArraysForIntFlow();
176 this->InitializeArraysForDiffFlow();
177 this->InitializeArraysForDistributions();
178 this->InitializeArraysForNestedLoops();
179
180 } // end of constructor
181
182
183//================================================================================================================
184
185
186AliFlowAnalysisWithQCumulants::~AliFlowAnalysisWithQCumulants()
187{
188 // destructor
189
190 delete fHistList;
191
192} // end of AliFlowAnalysisWithQCumulants::~AliFlowAnalysisWithQCumulants()
193
194
195//================================================================================================================
196
197
198void AliFlowAnalysisWithQCumulants::Init()
199{
3b552efe 200 // a) Cross check if the settings make sense before starting the QC adventure;
489d5531 201 // b) Access all common constants;
202 // c) Book all objects;
3b552efe 203 // d) Store flags for integrated and differential flow;
489d5531 204 // e) Store flags for distributions of corelations;
205 // f) Store harmonic which will be estimated.
3b552efe 206
489d5531 207 //save old value and prevent histograms from being added to directory
208 //to avoid name clashes in case multiple analaysis objects are used
209 //in an analysis
210 Bool_t oldHistAddStatus = TH1::AddDirectoryStatus();
211 TH1::AddDirectory(kFALSE);
212
3b552efe 213 // a) Cross check if the settings make sense before starting the QC adventure;
489d5531 214 this->CrossCheckSettings();
215 // b) Access all common constants:
216 this->AccessConstants();
217 // c) Book all objects:
218 this->BookAndFillWeightsHistograms();
219 this->BookAndNestAllLists();
220 this->BookCommonHistograms();
221 this->BookEverythingForIntegratedFlow();
222 this->BookEverythingForDifferentialFlow();
223 this->BookEverythingForDistributions();
224 this->BookEverythingForNestedLoops();
225 // d) Store flags for integrated and differential flow:
226 this->StoreIntFlowFlags();
3b552efe 227 this->StoreDiffFlowFlags();
489d5531 228 // e) Store flags for distributions of corelations:
229 this->StoreFlagsForDistributions();
230 // f) Store harmonic which will be estimated:
231 this->StoreHarmonic();
232
233 TH1::AddDirectory(oldHistAddStatus);
234} // end of void AliFlowAnalysisWithQCumulants::Init()
235
236
237//================================================================================================================
238
239
240void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
241{
242 // Running over data only in this method.
243
244 // a) Fill the common control histograms and call the method to fill fAvMultiplicity;
245 // b) Loop over data and calculate e-b-e quantities;
246 // c) Call all the methods;
247 // d) Debugging and cross-checking (evaluate nested loops);
248 // e) Reset all event by event quantities.
249
250 Double_t dPhi = 0.; // azimuthal angle in the laboratory frame
251 Double_t dPt = 0.; // transverse momentum
252 Double_t dEta = 0.; // pseudorapidity
253
254 Double_t wPhi = 1.; // phi weight
255 Double_t wPt = 1.; // pt weight
256 Double_t wEta = 1.; // eta weight
257
258 Int_t nRP = anEvent->GetEventNSelTracksRP(); // number of RPs (i.e. number of particles used to determine the reaction plane)
259
260 // a) Fill the common control histograms and call the method to fill fAvMultiplicity:
261 this->FillCommonControlHistograms(anEvent);
262 this->FillAverageMultiplicities(nRP);
263
264 // b) Loop over data and calculate e-b-e quantities:
265 Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = total number of primary tracks, i.e. nPrim = nRP + nPOI + rest, where:
266 // nRP = # of particles used to determine the reaction plane;
267 // nPOI = # of particles of interest for a detailed flow analysis;
268 // rest = # of particles which are not niether RPs nor POIs.
269
270 AliFlowTrackSimple *aftsTrack = NULL;
271
272 for(Int_t i=0;i<nPrim;i++)
273 {
274 aftsTrack=anEvent->GetTrack(i);
275 if(aftsTrack)
276 {
277 if(!(aftsTrack->InRPSelection() || aftsTrack->InPOISelection())) continue; // consider only tracks which are RPs or POIs
278 Int_t n = fHarmonic; // shortcut for the harmonic
279 if(aftsTrack->InRPSelection()) // RP condition:
280 {
281 dPhi = aftsTrack->Phi();
282 dPt = aftsTrack->Pt();
283 dEta = aftsTrack->Eta();
284 if(fUsePhiWeights && fPhiWeights && fnBinsPhi) // determine phi weight for this particle:
285 {
286 wPhi = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*fnBinsPhi/TMath::TwoPi())));
287 }
288 if(fUsePtWeights && fPtWeights && fnBinsPt) // determine pt weight for this particle:
289 {
290 wPt = fPtWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/fPtBinWidth)));
291 }
292 if(fUseEtaWeights && fEtaWeights && fEtaBinWidth) // determine eta weight for this particle:
293 {
294 wEta = fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/fEtaBinWidth)));
295 }
296
297 // integrated flow:
298 // calculate Re[Q_{m*n,k}] and Im[Q_{m*n,k}], m = 1,2,3,4, for this event:
299 for(Int_t m=0;m<4;m++)
300 {
301 for(Int_t k=0;k<9;k++)
302 {
303 (*fReQ)(m,k)+=pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1)*n*dPhi);
304 (*fImQ)(m,k)+=pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1)*n*dPhi);
305 }
306 }
307 // calculate S^{M}_{p,k} for this event
308 // Remark: final calculation of S^{M}_{p,k} follows after the loop over data bellow:
309 for(Int_t p=0;p<8;p++)
310 {
311 for(Int_t k=0;k<9;k++)
312 {
313 (*fSMpk)(p,k)+=pow(wPhi*wPt*wEta,k);
314 }
315 }
316
317 // differential flow:
318 // 1D (pt):
319 // (r_{m*m,k}(pt)):
320 for(Int_t m=0;m<4;m++)
321 {
322 for(Int_t k=0;k<9;k++)
323 {
324 fReRPQ1dEBE[0][0][m][k]->Fill(dPt,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
325 fImRPQ1dEBE[0][0][m][k]->Fill(dPt,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
326 }
327 }
328
329 // s_{k}(pt) for RPs // to be improved (clarified)
330 // Remark: final calculation of s_{p,k}(pt) follows after the loop over data bellow:
331 for(Int_t k=0;k<9;k++)
332 {
333 fs1dEBE[0][0][k]->Fill(dPt,pow(wPhi*wPt*wEta,k),1.);
334 }
335 // 1D (eta):
336 // (r_{m*m,k}(eta)):
337 for(Int_t m=0;m<4;m++)
338 {
339 for(Int_t k=0;k<9;k++)
340 {
341 fReRPQ1dEBE[0][1][m][k]->Fill(dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
342 fImRPQ1dEBE[0][1][m][k]->Fill(dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
343 }
344 }
345 // s_{k}(eta) for RPs // to be improved (clarified)
346 // Remark: final calculation of s_{p,k}(eta) follows after the loop over data bellow:
347 for(Int_t k=0;k<9;k++)
348 {
349 fs1dEBE[0][1][k]->Fill(dEta,pow(wPhi*wPt*wEta,k),1.);
350 }
351
352
353
354 /*
355 // 2D (pt,eta):
356 if(fCalculate2DFlow)
357 {
358 // (r_{m*m,k}(pt,eta)):
359 for(Int_t m=0;m<4;m++)
360 {
361 for(Int_t k=0;k<9;k++)
362 {
363 fReRPQ2dEBE[0][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
364 fImRPQ2dEBE[0][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
365 }
366 }
367 // s_{k}(pt,eta) for RPs // to be improved (clarified)
368 // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:
369 for(Int_t k=0;k<9;k++)
370 {
371 fs2dEBE[0][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k),1.);
372 }
373 } // end of if(fCalculate2DFlow)
374 */
375
376
377
378 if(aftsTrack->InPOISelection())
379 {
380 // 1D (pt):
381 // (q_{m*m,k}(pt)):
382 for(Int_t m=0;m<4;m++)
383 {
384 for(Int_t k=0;k<9;k++)
385 {
386 fReRPQ1dEBE[2][0][m][k]->Fill(dPt,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
387 fImRPQ1dEBE[2][0][m][k]->Fill(dPt,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
388 }
389 }
390 // s_{k}(pt) for RP&&POIs // to be improved (clarified)
391 // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:
392 for(Int_t k=0;k<9;k++)
393 {
394 fs1dEBE[2][0][k]->Fill(dPt,pow(wPhi*wPt*wEta,k),1.);
395 }
396 // 1D (eta):
397 // (q_{m*m,k}(eta)):
398 for(Int_t m=0;m<4;m++)
399 {
400 for(Int_t k=0;k<9;k++)
401 {
402 fReRPQ1dEBE[2][1][m][k]->Fill(dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
403 fImRPQ1dEBE[2][1][m][k]->Fill(dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
404 }
405 }
406 // s_{k}(eta) for RP&&POIs // to be improved (clarified)
407 // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:
408 for(Int_t k=0;k<9;k++)
409 {
410 fs1dEBE[2][1][k]->Fill(dEta,pow(wPhi*wPt*wEta,k),1.);
411 }
412
413 /*
414 // 2D (pt,eta)
415 if(fCalculate2DFlow)
416 {
417 // (q_{m*m,k}(pt,eta)):
418 for(Int_t m=0;m<4;m++)
419 {
420 for(Int_t k=0;k<9;k++)
421 {
422 fReRPQ2dEBE[2][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
423 fImRPQ2dEBE[2][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
424 }
425 }
426 // s_{k}(pt,eta) for RP&&POIs // to be improved (clarified)
427 // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:
428 for(Int_t k=0;k<9;k++)
429 {
430 fs2dEBE[2][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k),1.);
431 }
432 } // end of if(fCalculate2DFlow)
433 */
434
435 } // end of if(aftsTrack->InPOISelection())
436
437
438
439 } // end of if(pTrack->InRPSelection())
440
441
442
443 if(aftsTrack->InPOISelection())
444 {
445 dPhi = aftsTrack->Phi();
446 dPt = aftsTrack->Pt();
447 dEta = aftsTrack->Eta();
448
449 // 1D (pt)
450 // p_n(m*n,0):
451 for(Int_t m=0;m<4;m++)
452 {
453 fReRPQ1dEBE[1][0][m][0]->Fill(dPt,TMath::Cos((m+1.)*n*dPhi),1.);
454 fImRPQ1dEBE[1][0][m][0]->Fill(dPt,TMath::Sin((m+1.)*n*dPhi),1.);
455 }
456 // 1D (eta)
457 // p_n(m*n,0):
458 for(Int_t m=0;m<4;m++)
459 {
460 fReRPQ1dEBE[1][1][m][0]->Fill(dEta,TMath::Cos((m+1.)*n*dPhi),1.);
461 fImRPQ1dEBE[1][1][m][0]->Fill(dEta,TMath::Sin((m+1.)*n*dPhi),1.);
462 }
463
464
465 /*
466 // 2D (pt,eta):
467 if(fCalculate2DFlow)
468 {
469 // p_n(m*n,0):
470 for(Int_t m=0;m<4;m++)
471 {
472 fReRPQ2dEBE[1][m][0]->Fill(dPt,dEta,TMath::Cos((m+1.)*n*dPhi),1.);
473 fImRPQ2dEBE[1][m][0]->Fill(dPt,dEta,TMath::Sin((m+1.)*n*dPhi),1.);
474 }
475 } // end of if(fCalculate2DFlow)
476 */
477
478
479 } // end of if(pTrack->InPOISelection() )
480
481
482 } else // to if(aftsTrack)
483 {
484 cout<<endl;
485 cout<<" WARNING: no particle! (i.e. aftsTrack is a NULL pointer in AFAWQC::Make().)"<<endl;
486 cout<<endl;
487 }
488 } // end of for(Int_t i=0;i<nPrim;i++)
489
490 // calculate the final expressions for S^{M}_{p,k}:
491 for(Int_t p=0;p<8;p++)
492 {
493 for(Int_t k=0;k<9;k++)
494 {
495 (*fSMpk)(p,k)=pow((*fSMpk)(p,k),p+1);
496 }
497 }
498
499 // *****************************
500 // **** CALL THE METHODS *******
501 // *****************************
502 // integrated flow:
503 if(!fEvaluateIntFlowNestedLoops)
504 {
505 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
506 {
507 if(nRP>1) this->CalculateIntFlowCorrelations(); // without using particle weights
0328db2d 508 } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
489d5531 509 {
510 if(nRP>1) this->CalculateIntFlowCorrelationsUsingParticleWeights(); // with using particle weights
511 }
512
513 if(nRP>3) this->CalculateIntFlowProductOfCorrelations();
514 if(nRP>1) this->CalculateIntFlowSumOfEventWeights();
515 if(nRP>1) this->CalculateIntFlowSumOfProductOfEventWeights();
516 if(fApplyCorrectionForNUA)
517 {
57340a27 518 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
519 {
489d5531 520 if(nRP>0) this->CalculateIntFlowCorrectionsForNUASinTerms();
521 if(nRP>0) this->CalculateIntFlowCorrectionsForNUACosTerms();
57340a27 522 } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
523 {
489d5531 524 if(nRP>0) this->CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights();
57340a27 525 if(nRP>0) this->CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights();
526 }
0328db2d 527
528 if(nRP>0) this->CalculateIntFlowProductOfCorrectionTermsForNUA();
529 if(nRP>0) this->CalculateIntFlowSumOfEventWeightsNUA();
530 if(nRP>0) this->CalculateIntFlowSumOfProductOfEventWeightsNUA();
489d5531 531 } // end of if(fApplyCorrectionForNUA)
532 } // end of if(!fEvaluateIntFlowNestedLoops)
533
534 // differential flow:
535 if(!fEvaluateDiffFlowNestedLoops)
536 {
537 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
538 {
539 // without using particle weights:
540 this->CalculateDiffFlowCorrelations("RP","Pt");
541 this->CalculateDiffFlowCorrelations("RP","Eta");
542 this->CalculateDiffFlowCorrelations("POI","Pt");
57340a27 543 this->CalculateDiffFlowCorrelations("POI","Eta");
544 if(fApplyCorrectionForNUA)
545 {
489d5531 546 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Pt");
547 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Eta");
548 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Pt");
549 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Eta");
550 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Pt");
551 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Eta");
552 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Pt");
57340a27 553 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Eta");
489d5531 554 } // end of if(fApplyCorrectionForNUA)
555 } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
556 {
557 // with using particle weights:
558 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Pt");
559 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Eta");
560 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Pt");
561 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Eta");
57340a27 562 if(fApplyCorrectionForNUA)
563 {
489d5531 564 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Pt");
565 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Eta");
566 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Pt");
567 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Eta");
568 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Pt");
569 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Eta");
570 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Pt");
57340a27 571 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Eta");
489d5531 572 } // end of if(fApplyCorrectionForNUA)
573 }
57340a27 574
489d5531 575 // whether or not using particle weights the following is calculated in the same way:
576 this->CalculateDiffFlowProductOfCorrelations("RP","Pt");
577 this->CalculateDiffFlowProductOfCorrelations("RP","Eta");
578 this->CalculateDiffFlowProductOfCorrelations("POI","Pt");
579 this->CalculateDiffFlowProductOfCorrelations("POI","Eta");
580 this->CalculateDiffFlowSumOfEventWeights("RP","Pt");
581 this->CalculateDiffFlowSumOfEventWeights("RP","Eta");
582 this->CalculateDiffFlowSumOfEventWeights("POI","Pt");
583 this->CalculateDiffFlowSumOfEventWeights("POI","Eta");
584 this->CalculateDiffFlowSumOfProductOfEventWeights("RP","Pt");
585 this->CalculateDiffFlowSumOfProductOfEventWeights("RP","Eta");
586 this->CalculateDiffFlowSumOfProductOfEventWeights("POI","Pt");
587 this->CalculateDiffFlowSumOfProductOfEventWeights("POI","Eta");
588 } // end of if(!fEvaluateDiffFlowNestedLoops)
589
590
591
592 // with weights:
593 // ...
594
595 /*
596 // 2D differential flow
597 if(fCalculate2DFlow)
598 {
599 // without weights:
600 if(nRP>1) this->CalculateCorrelationsForDifferentialFlow2D("RP");
601 if(nRP>1) this->CalculateCorrelationsForDifferentialFlow2D("POI");
602
603 // with weights:
604 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
605 {
606 if(nRP>1) this->CalculateWeightedCorrelationsForDifferentialFlow2D("RP");
607 if(nRP>1) this->CalculateWeightedCorrelationsForDifferentialFlow2D("POI");
608 }
609 } // end of if(fCalculate2DFlow)
610 */
57340a27 611
612 // distributions of correlations:
613 if(fStoreDistributions)
614 {
615 this->StoreDistributionsOfCorrelations();
616 }
489d5531 617
618 // d) Debugging and cross-checking (evaluate nested loops):
619 // d1) cross-checking results for integrated flow:
620 if(fEvaluateIntFlowNestedLoops)
621 {
622 if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10
623 {
624 // without using particle weights:
625 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
626 {
627 // correlations:
628 this->CalculateIntFlowCorrelations(); // from Q-vectors
629 this->EvaluateIntFlowCorrelationsWithNestedLoops(anEvent); // from nested loops (to be improved: do I have to pass here anEvent or not?)
630 // correction for non-uniform acceptance:
631 this->CalculateIntFlowCorrectionsForNUASinTerms(); // from Q-vectors (sin terms)
632 this->CalculateIntFlowCorrectionsForNUACosTerms(); // from Q-vectors (cos terms)
633 this->EvaluateIntFlowCorrectionsForNUAWithNestedLoops(anEvent); // from nested loops (both sin and cos terms)
634 }
635 // using particle weights:
636 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
637 {
638 // correlations:
639 this->CalculateIntFlowCorrelationsUsingParticleWeights(); // from Q-vectors
640 this->EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent); // from nested loops (to be improved: do I have to pass here anEvent or not?)
641 // correction for non-uniform acceptance:
642 this->CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights(); // from Q-vectors (sin terms)
643 this->CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights(); // from Q-vectors (cos terms)
57340a27 644 this->EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(anEvent); // from nested loops (both sin and cos terms)
489d5531 645 }
646 } else if (nPrim>fMaxAllowedMultiplicity) // to if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity)
647 {
648 cout<<endl;
649 cout<<"Skipping the event because multiplicity is "<<nPrim<<". Too high to evaluate nested loops!"<<endl;
650 } else
651 {
652 cout<<endl;
653 cout<<"Skipping the event because multiplicity is "<<nPrim<<"."<<endl;
654 }
655 } // end of if(fEvaluateIntFlowNestedLoops)
656
657 // d2) cross-checking results for differential flow:
658 if(fEvaluateDiffFlowNestedLoops)
659 {
660 if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10
661 {
662 // without using particle weights:
663 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
664 {
665 // reduced correlations:
666 // Q-vectors:
667 this->CalculateDiffFlowCorrelations("RP","Pt");
668 this->CalculateDiffFlowCorrelations("RP","Eta");
669 this->CalculateDiffFlowCorrelations("POI","Pt");
670 this->CalculateDiffFlowCorrelations("POI","Eta");
671 // nested loops:
672 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"RP","Pt");
673 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"RP","Eta");
674 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"POI","Pt");
675 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"POI","Eta");
676 // reduced corrections for non-uniform acceptance:
677 // Q-vectors:
678 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Pt");
679 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Eta");
680 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Pt");
681 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Eta");
682 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Pt");
683 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Eta");
684 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Pt");
685 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Eta");
686 // nested loops:
687 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"RP","Pt");
688 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"RP","Eta");
689 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"POI","Pt");
690 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"POI","Eta");
691 } // end of if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
692 // using particle weights:
693 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
694 {
695 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Pt");
696 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Eta");
697 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Pt");
698 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Eta");
699 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Pt");
700 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Eta");
701 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Pt");
702 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Eta");
703 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Pt");
704 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Eta");
705 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Pt");
706 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Eta");
707 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"RP","Pt");
708 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"RP","Eta");
709 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"POI","Pt");
3b552efe 710 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"POI","Eta");
489d5531 711 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"RP","Pt");
712 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"RP","Eta");
713 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"POI","Pt");
714 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"POI","Eta");
715 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
716 } // end of if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10
717 } // end of if(fEvaluateDiffFlowNestedLoops)
718
719 // e) Reset all event by event quantities:
720 this->ResetEventByEventQuantities();
721
722} // end of AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
723
724
725//================================================================================================================================
726
727
728void AliFlowAnalysisWithQCumulants::Finish()
729{
730 // Calculate the final results.
731 // a) acces the constants;
732 // b) access the flags;
733 // c) calculate the final results for integrated flow (without and with weights);
734 // d) store in AliFlowCommonHistResults and print the final results for integrated flow;
735 // e) calculate the final results for differential flow (without and with weights);
736 // f) print the final results for integrated flow obtained from differential flow (to be improved (terminology));
737 // g) cross-check the results: results from Q-vectors vs results from nested loops
738
739 // ******************************
740 // **** ACCESS THE CONSTANTS ****
741 // ******************************
742
743 this->AccessConstants();
744
745 if(fCommonHists && fCommonHists->GetHarmonic())
746 {
747 fHarmonic = (Int_t)(fCommonHists->GetHarmonic())->GetBinContent(1); // to be improved (moved somewhere else)
748 }
749
750 // **************************
ff70ca91 751 // **** ACCESS THE FLAGS **** // to be improved (moved somewhere else)
489d5531 752 // **************************
753 fUsePhiWeights = (Int_t)fUseParticleWeights->GetBinContent(1);
754 fUsePtWeights = (Int_t)fUseParticleWeights->GetBinContent(2);
755 fUseEtaWeights = (Int_t)fUseParticleWeights->GetBinContent(3);
3b552efe 756 fApplyCorrectionForNUA = (Int_t)fIntFlowFlags->GetBinContent(3);
489d5531 757 fPrintFinalResults[0] = (Int_t)fIntFlowFlags->GetBinContent(4);
758 fPrintFinalResults[1] = (Int_t)fIntFlowFlags->GetBinContent(5);
759 fPrintFinalResults[2] = (Int_t)fIntFlowFlags->GetBinContent(6);
760 fEvaluateIntFlowNestedLoops = (Int_t)fEvaluateNestedLoops->GetBinContent(1);
761 fEvaluateDiffFlowNestedLoops = (Int_t)fEvaluateNestedLoops->GetBinContent(2);
762 fCrossCheckInPtBinNo = (Int_t)fEvaluateNestedLoops->GetBinContent(3);
763 fCrossCheckInEtaBinNo = (Int_t)fEvaluateNestedLoops->GetBinContent(4);
764
765 // *********************************************************
766 // **** CALCULATE THE FINAL RESULTS FOR INTEGRATED FLOW ****
767 // *********************************************************
768
769 this->FinalizeCorrelationsIntFlow();
770 this->CalculateCovariancesIntFlow();
771 this->CalculateCumulantsIntFlow();
772 this->CalculateIntFlow();
773
774 if(fApplyCorrectionForNUA) // to be improved (reorganized, etc)
775 {
776 this->FinalizeCorrectionTermsForNUAIntFlow();
0328db2d 777 this->CalculateCovariancesNUAIntFlow();
489d5531 778 this->CalculateQcumulantsCorrectedForNUAIntFlow();
779 this->CalculateIntFlowCorrectedForNUA();
780 }
781
782 // ***************************************************************
783 // **** STORE AND PRINT THE FINAL RESULTS FOR INTEGRATED FLOW ****
784 // ***************************************************************
785
786 this->FillCommonHistResultsIntFlow();
787
3b552efe 788 if(fPrintFinalResults[0])
789 {
489d5531 790 this->PrintFinalResultsForIntegratedFlow("NONAME"); // to be improved (name)
791 }
792
793 // ***********************************************************
794 // **** CALCULATE THE FINAL RESULTS FOR DIFFERENTIAL FLOW ****
795 // ***********************************************************
796
797 this->FinalizeReducedCorrelations("RP","Pt");
798 this->FinalizeReducedCorrelations("RP","Eta");
799 this->FinalizeReducedCorrelations("POI","Pt");
800 this->FinalizeReducedCorrelations("POI","Eta");
801 this->CalculateDiffFlowCovariances("RP","Pt");
802 this->CalculateDiffFlowCovariances("RP","Eta");
803 this->CalculateDiffFlowCovariances("POI","Pt");
804 this->CalculateDiffFlowCovariances("POI","Eta");
805 this->CalculateDiffFlowCumulants("RP","Pt");
806 this->CalculateDiffFlowCumulants("RP","Eta");
807 this->CalculateDiffFlowCumulants("POI","Pt");
808 this->CalculateDiffFlowCumulants("POI","Eta");
809 this->CalculateDiffFlow("RP","Pt");
810 this->CalculateDiffFlow("RP","Eta");
811 this->CalculateDiffFlow("POI","Pt");
812 this->CalculateDiffFlow("POI","Eta");
813
814 if(fApplyCorrectionForNUA) // to be improved (reorganized, etc)
815 {
816 this->FinalizeCorrectionTermsForNUADiffFlow("RP","Pt");
817 this->FinalizeCorrectionTermsForNUADiffFlow("RP","Eta");
818 this->FinalizeCorrectionTermsForNUADiffFlow("POI","Pt");
819 this->FinalizeCorrectionTermsForNUADiffFlow("POI","Eta");
820 this->CalculateDiffFlowCumulantsCorrectedForNUA("RP","Pt");
821 this->CalculateDiffFlowCumulantsCorrectedForNUA("RP","Eta");
822 this->CalculateDiffFlowCumulantsCorrectedForNUA("POI","Pt");
823 this->CalculateDiffFlowCumulantsCorrectedForNUA("POI","Eta");
824 this->CalculateDiffFlowCorrectedForNUA("RP","Pt");
825 this->CalculateDiffFlowCorrectedForNUA("RP","Eta");
826 this->CalculateDiffFlowCorrectedForNUA("POI","Pt");
827 this->CalculateDiffFlowCorrectedForNUA("POI","Eta");
3b552efe 828 }
489d5531 829
830 this->CalculateFinalResultsForRPandPOIIntegratedFlow("RP");
831 this->CalculateFinalResultsForRPandPOIIntegratedFlow("POI");
832
833 // *****************************************************************
834 // **** STORE AND PRINT THE FINAL RESULTS FOR DIFFERENTIAL FLOW ****
835 // *****************************************************************
836 this->FillCommonHistResultsDiffFlow("RP");
837 this->FillCommonHistResultsDiffFlow("POI");
838
3b552efe 839 if(fPrintFinalResults[1])
840 {
489d5531 841 this->PrintFinalResultsForIntegratedFlow("RP");
3b552efe 842 }
843 if(fPrintFinalResults[2])
844 {
489d5531 845 this->PrintFinalResultsForIntegratedFlow("POI");
846 }
847 // g) cross-check the results: results from Q-vectors vs results from nested loops
848
849 // g1) integrated flow:
850 if(fEvaluateIntFlowNestedLoops)
851 {
852 this->CrossCheckIntFlowCorrelations();
853 this->CrossCheckIntFlowCorrectionTermsForNUA();
854 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights) this->CrossCheckIntFlowExtraCorrelations();
855 } // end of if(fEvaluateIntFlowNestedLoops)
856
857 // g2) differential flow:
858 if(fEvaluateDiffFlowNestedLoops)
859 {
3b552efe 860 // correlations:
489d5531 861 this->PrintNumberOfParticlesInSelectedBin();
862 this->CrossCheckDiffFlowCorrelations("RP","Pt");
863 this->CrossCheckDiffFlowCorrelations("RP","Eta");
864 this->CrossCheckDiffFlowCorrelations("POI","Pt");
865 this->CrossCheckDiffFlowCorrelations("POI","Eta");
866 // correction terms for non-uniform acceptance:
867 this->CrossCheckDiffFlowCorrectionTermsForNUA("RP","Pt");
868 this->CrossCheckDiffFlowCorrectionTermsForNUA("RP","Eta");
869 this->CrossCheckDiffFlowCorrectionTermsForNUA("POI","Pt");
870 this->CrossCheckDiffFlowCorrectionTermsForNUA("POI","Eta");
871 } // end of if(fEvaluateDiffFlowNestedLoops)
872
873} // end of AliFlowAnalysisWithQCumulants::Finish()
874
875
876//================================================================================================================================
877
878
879void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTerms()
880{
881 // calculate corrections for non-uniform acceptance of the detector for no-name integrated flow (cos terms)
882
883 // multiplicity:
884 Double_t dMult = (*fSMpk)(0,0);
885
886 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
887 Double_t dReQ1n = (*fReQ)(0,0);
888 Double_t dReQ2n = (*fReQ)(1,0);
889 //Double_t dReQ3n = (*fReQ)(2,0);
890 //Double_t dReQ4n = (*fReQ)(3,0);
891 Double_t dImQ1n = (*fImQ)(0,0);
892 Double_t dImQ2n = (*fImQ)(1,0);
893 //Double_t dImQ3n = (*fImQ)(2,0);
894 //Double_t dImQ4n = (*fImQ)(3,0);
895
896 // *************************************************************
897 // **** corrections for non-uniform acceptance (cos terms): ****
898 // *************************************************************
899 //
900 // Remark 1: corrections for non-uniform acceptance (cos terms) calculated with non-weighted Q-vectors
901 // are stored in 1D profile fQCorrectionsCos.
902 // Remark 2: binning of fIntFlowCorrectionTermsForNUAPro[1] is organized as follows:
903 // --------------------------------------------------------------------------------------------------------------------
904 // 1st bin: <<cos(n*(phi1))>> = cosP1n
905 // 2nd bin: <<cos(n*(phi1+phi2))>> = cosP1nP1n
906 // 3rd bin: <<cos(n*(phi1-phi2-phi3))>> = cosP1nM1nM1n
907 // 4th bin: <<cos(n*(2phi1-phi2))>> = cosP2nM1n
908 // --------------------------------------------------------------------------------------------------------------------
909
910 // 1-particle:
911 Double_t cosP1n = 0.; // <<cos(n*(phi1))>>
912
913 if(dMult>0)
914 {
915 cosP1n = dReQ1n/dMult;
916
917 // average non-weighted 1-particle correction (cos terms) for non-uniform acceptance for single event:
918 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(1,cosP1n);
0328db2d 919 // event weights for NUA terms:
920 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(1,dMult);
489d5531 921
922 // final average non-weighted 1-particle correction (cos terms) for non-uniform acceptance for all events:
923 fIntFlowCorrectionTermsForNUAPro[1]->Fill(0.5,cosP1n,dMult);
924 }
925
926 // 2-particle:
3b552efe 927 Double_t cosP1nP1n = 0.; // <<cos(n*(phi1+phi2))>>
489d5531 928 Double_t cosP2nM1n = 0.; // <<cos(n*(2phi1-phi2))>>
929
930 if(dMult>1)
931 {
932 cosP1nP1n = (pow(dReQ1n,2)-pow(dImQ1n,2)-dReQ2n)/(dMult*(dMult-1));
933 cosP2nM1n = (dReQ2n*dReQ1n+dImQ2n*dImQ1n-dReQ1n)/(dMult*(dMult-1));
934
935 // average non-weighted 2-particle correction (cos terms) for non-uniform acceptance for single event:
3b552efe 936 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(2,cosP1nP1n);
489d5531 937 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(4,cosP2nM1n);
0328db2d 938 // event weights for NUA terms:
939 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(2,dMult*(dMult-1));
940 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(4,dMult*(dMult-1));
941
489d5531 942 // final average non-weighted 2-particle correction (cos terms) for non-uniform acceptance for all events:
3b552efe 943 fIntFlowCorrectionTermsForNUAPro[1]->Fill(1.5,cosP1nP1n,dMult*(dMult-1));
489d5531 944 fIntFlowCorrectionTermsForNUAPro[1]->Fill(3.5,cosP2nM1n,dMult*(dMult-1));
945 }
946
947 // 3-particle:
948 Double_t cosP1nM1nM1n = 0.; // <<cos(n*(phi1-phi2-phi3))>>
949
950 if(dMult>2)
951 {
952 cosP1nM1nM1n = (dReQ1n*(pow(dReQ1n,2)+pow(dImQ1n,2))-dReQ1n*dReQ2n-dImQ1n*dImQ2n-2.*(dMult-1)*dReQ1n)
953 / (dMult*(dMult-1)*(dMult-2));
954
955 // average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for single event:
956 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(3,cosP1nM1nM1n);
0328db2d 957 // event weights for NUA terms:
958 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(3,dMult*(dMult-1)*(dMult-2));
489d5531 959
960 // final average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for all events:
961 fIntFlowCorrectionTermsForNUAPro[1]->Fill(2.5,cosP1nM1nM1n,dMult*(dMult-1)*(dMult-2));
962 }
963
964} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTerms()
965
966
967//================================================================================================================================
968
969
970void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTerms()
971{
972 // calculate corrections for non-uniform acceptance of the detector for no-name integrated flow (sin terms)
973
974 // multiplicity:
975 Double_t dMult = (*fSMpk)(0,0);
976
977 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
978 Double_t dReQ1n = (*fReQ)(0,0);
979 Double_t dReQ2n = (*fReQ)(1,0);
980 //Double_t dReQ3n = (*fReQ)(2,0);
981 //Double_t dReQ4n = (*fReQ)(3,0);
982 Double_t dImQ1n = (*fImQ)(0,0);
983 Double_t dImQ2n = (*fImQ)(1,0);
984 //Double_t dImQ3n = (*fImQ)(2,0);
985 //Double_t dImQ4n = (*fImQ)(3,0);
986
987 // *************************************************************
988 // **** corrections for non-uniform acceptance (sin terms): ****
989 // *************************************************************
990 //
991 // Remark 1: corrections for non-uniform acceptance (sin terms) calculated with non-weighted Q-vectors
992 // are stored in 1D profile fQCorrectionsSin.
993 // Remark 2: binning of fIntFlowCorrectionTermsForNUAPro[0] is organized as follows:
994 // --------------------------------------------------------------------------------------------------------------------
995 // 1st bin: <<sin(n*(phi1))>> = sinP1n
996 // 2nd bin: <<sin(n*(phi1+phi2))>> = sinP1nP1n
997 // 3rd bin: <<sin(n*(phi1-phi2-phi3))>> = sinP1nM1nM1n
998 // 4th bin: <<sin(n*(2phi1-phi2))>> = sinP2nM1n
999 // --------------------------------------------------------------------------------------------------------------------
1000
1001 // 1-particle:
1002 Double_t sinP1n = 0.; // <sin(n*(phi1))>
1003
1004 if(dMult>0)
1005 {
1006 sinP1n = dImQ1n/dMult;
1007
1008 // average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for single event:
0328db2d 1009 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(1,sinP1n);
1010 // event weights for NUA terms:
1011 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(1,dMult);
489d5531 1012
1013 // final average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
1014 fIntFlowCorrectionTermsForNUAPro[0]->Fill(0.5,sinP1n,dMult);
1015 }
1016
1017 // 2-particle:
1018 Double_t sinP1nP1n = 0.; // <<sin(n*(phi1+phi2))>>
1019 Double_t sinP2nM1n = 0.; // <<sin(n*(2phi1-phi2))>>
1020 if(dMult>1)
1021 {
3b552efe 1022 sinP1nP1n = (2.*dReQ1n*dImQ1n-dImQ2n)/(dMult*(dMult-1));
489d5531 1023 sinP2nM1n = (dImQ2n*dReQ1n-dReQ2n*dImQ1n-dImQ1n)/(dMult*(dMult-1));
1024
1025 // average non-weighted 2-particle correction (sin terms) for non-uniform acceptance for single event:
1026 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(2,sinP1nP1n);
3b552efe 1027 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(4,sinP2nM1n);
0328db2d 1028 // event weights for NUA terms:
1029 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(2,dMult*(dMult-1));
1030 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(4,dMult*(dMult-1));
489d5531 1031
1032 // final average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
1033 fIntFlowCorrectionTermsForNUAPro[0]->Fill(1.5,sinP1nP1n,dMult*(dMult-1));
1034 fIntFlowCorrectionTermsForNUAPro[0]->Fill(3.5,sinP2nM1n,dMult*(dMult-1));
1035 }
1036
1037 // 3-particle:
1038 Double_t sinP1nM1nM1n = 0.; // <<sin(n*(phi1-phi2-phi3))>>
1039
1040 if(dMult>2)
1041 {
1042 sinP1nM1nM1n = (-dImQ1n*(pow(dReQ1n,2)+pow(dImQ1n,2))+dReQ1n*dImQ2n-dImQ1n*dReQ2n+2.*(dMult-1)*dImQ1n)
1043 / (dMult*(dMult-1)*(dMult-2));
1044
1045 // average non-weighted 3-particle correction (sin terms) for non-uniform acceptance for single event:
1046 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(3,sinP1nM1nM1n);
0328db2d 1047 // event weights for NUA terms:
1048 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(3,dMult*(dMult-1)*(dMult-2));
489d5531 1049
1050 // final average non-weighted 3-particle correction (sin terms) for non-uniform acceptance for all events:
1051 fIntFlowCorrectionTermsForNUAPro[0]->Fill(2.5,sinP1nM1nM1n,dMult*(dMult-1)*(dMult-2));
1052 }
1053
1054} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTerms()
1055
1056
1057//================================================================================================================================
1058
1059
1060void AliFlowAnalysisWithQCumulants::GetOutputHistograms(TList *outputListHistos)
1061{
1062 // a) Get pointers for common control and common result histograms and profiles.
1063 // b) Get pointers for histograms with particle weights.
1064 // c) Get pointers for histograms and profiles relevant for integrated flow.
1065 // d) Get pointers for histograms and profiles relevant for differental flow.
1066 // e) Get pointers for histograms and profiles holding results obtained with nested loops.
1067
1068 if(outputListHistos)
3b552efe 1069 {
1070 this->SetHistList(outputListHistos);
1071 if(!fHistList)
1072 {
1073 cout<<endl;
1074 cout<<" WARNING (QC): fHistList is NULL in AFAWQC::GOH() !!!!"<<endl;
1075 cout<<endl;
1076 exit(0);
489d5531 1077 }
1078 this->GetPointersForCommonHistograms();
1079 this->GetPointersForParticleWeightsHistograms();
1080 this->GetPointersForIntFlowHistograms();
1081 this->GetPointersForDiffFlowHistograms();
1082 this->GetPointersForNestedLoopsHistograms();
3b552efe 1083 } else
1084 {
1085 cout<<endl;
1086 cout<<" WARNING (QC): outputListHistos is NULL in AFAWQC::GOH() !!!!"<<endl;
1087 cout<<endl;
1088 exit(0);
489d5531 1089 }
1090
1091} // end of void AliFlowAnalysisWithQCumulants::GetOutputHistograms(TList *outputListHistos)
ad87ae62 1092
1093
489d5531 1094//================================================================================================================================
1095
1096
1097TProfile* AliFlowAnalysisWithQCumulants::MakePtProjection(TProfile2D *profilePtEta) const
ad87ae62 1098{
489d5531 1099 // project 2D profile onto pt axis to get 1D profile
1100
1101 Int_t nBinsPt = profilePtEta->GetNbinsX();
1102 Double_t dPtMin = (profilePtEta->GetXaxis())->GetXmin();
1103 Double_t dPtMax = (profilePtEta->GetXaxis())->GetXmax();
1104
1105 Int_t nBinsEta = profilePtEta->GetNbinsY();
1106
1107 TProfile *profilePt = new TProfile("","",nBinsPt,dPtMin,dPtMax);
1108
1109 for(Int_t p=1;p<=nBinsPt;p++)
1110 {
1111 Double_t contentPt = 0.;
1112 Double_t entryPt = 0.;
1113 Double_t spreadPt = 0.;
1114 Double_t sum1 = 0.;
1115 Double_t sum2 = 0.;
1116 Double_t sum3 = 0.;
1117 for(Int_t e=1;e<=nBinsEta;e++)
1118 {
1119 contentPt += (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)))
1120 * (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1121 entryPt += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1122
1123 sum1 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)))
1124 * (pow(profilePtEta->GetBinError(profilePtEta->GetBin(p,e)),2.)
1125 + pow(profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)),2.));
1126 sum2 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1127 sum3 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)))
1128 * (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)));
1129 }
1130 if(sum2>0. && sum1/sum2-pow(sum3/sum2,2.) > 0.)
1131 {
1132 spreadPt = pow(sum1/sum2-pow(sum3/sum2,2.),0.5);
1133 }
1134 profilePt->SetBinContent(p,contentPt);
1135 profilePt->SetBinEntries(p,entryPt);
1136 {
1137 profilePt->SetBinError(p,spreadPt);
1138 }
1139
1140 }
1141
1142 return profilePt;
1143
1144} // end of TProfile* AliFlowAnalysisWithQCumulants::MakePtProjection(TProfile2D *profilePtEta)
1145
1146
1147//================================================================================================================================
1148
1149
1150TProfile* AliFlowAnalysisWithQCumulants::MakeEtaProjection(TProfile2D *profilePtEta) const
1151{
1152 // project 2D profile onto eta axis to get 1D profile
1153
1154 Int_t nBinsEta = profilePtEta->GetNbinsY();
1155 Double_t dEtaMin = (profilePtEta->GetYaxis())->GetXmin();
1156 Double_t dEtaMax = (profilePtEta->GetYaxis())->GetXmax();
1157
1158 Int_t nBinsPt = profilePtEta->GetNbinsX();
1159
1160 TProfile *profileEta = new TProfile("","",nBinsEta,dEtaMin,dEtaMax);
1161
1162 for(Int_t e=1;e<=nBinsEta;e++)
1163 {
1164 Double_t contentEta = 0.;
1165 Double_t entryEta = 0.;
1166 for(Int_t p=1;p<=nBinsPt;p++)
1167 {
1168 contentEta += (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)))
1169 * (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1170 entryEta += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1171 }
1172 profileEta->SetBinContent(e,contentEta);
1173 profileEta->SetBinEntries(e,entryEta);
1174 }
1175
1176 return profileEta;
1177
1178} // end of TProfile* AliFlowAnalysisWithQCumulants::MakeEtaProjection(TProfile2D *profilePtEta)
1179
1180
1181//================================================================================================================================
1182
1183
1184void AliFlowAnalysisWithQCumulants::PrintFinalResultsForIntegratedFlow(TString type)
1185{
1186 // printing on the screen the final results for integrated flow (NONAME, POI and RP) // to be improved (NONAME)
1187
1188 Int_t n = fHarmonic;
1189
1190 if(type == "NONAME" || type == "RP" || type == "POI")
1191 {
1192 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
1193 {
1194 cout<<"WARNING: fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th"<<endl;
1195 cout<<" is NULL in AFAWQC::PFRFIF() !!!!"<<endl;
1196 }
1197 } else
1198 {
1199 cout<<"WARNING: type in not from {NONAME, RP, POI} in AFAWQC::PFRFIF() !!!!"<<endl;
1200 exit(0);
1201 }
1202
1203 Double_t dVn[4] = {0.}; // array to hold Vn{2}, Vn{4}, Vn{6} and Vn{8}
1204 Double_t dVnErr[4] = {0.}; // array to hold errors of Vn{2}, Vn{4}, Vn{6} and Vn{8}
1205
1206 if(type == "NONAME")
1207 {
1208 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinContent(1);
1209 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinError(1);
1210 dVn[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinContent(1);
1211 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinError(1);
1212 dVn[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinContent(1);
1213 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinError(1);
1214 dVn[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinContent(1);
1215 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinError(1);
1216 } else if(type == "RP")
1217 {
1218 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinContent(1);
1219 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinError(1);
1220 dVn[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinContent(1);
1221 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinError(1);
1222 dVn[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinContent(1);
1223 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinError(1);
1224 dVn[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinContent(1);
1225 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinError(1);
1226 } else if(type == "POI")
1227 {
1228 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinContent(1);
1229 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinError(1);
1230 dVn[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinContent(1);
1231 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinError(1);
1232 dVn[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinContent(1);
1233 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinError(1);
1234 dVn[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinContent(1);
1235 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinError(1);
1236 }
1237
1238 TString title = " flow estimates from Q-cumulants";
1239 TString subtitle = " (";
1240
1241 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
1242 {
1243 subtitle.Append(type);
1244 subtitle.Append(", without weights)");
1245 } else
1246 {
1247 subtitle.Append(type);
1248 subtitle.Append(", with weights)");
1249 }
1250
1251 cout<<endl;
1252 cout<<"*************************************"<<endl;
1253 cout<<"*************************************"<<endl;
1254 cout<<title.Data()<<endl;
1255 cout<<subtitle.Data()<<endl;
1256 cout<<endl;
1257
1258 for(Int_t i=0;i<4;i++)
1259 {
1260 if(dVn[i]>=0.)
1261 {
1262 cout<<" v_"<<n<<"{"<<2*(i+1)<<"} = "<<dVn[i]<<" +/- "<<dVnErr[i]<<endl;
1263 }
1264 else
1265 {
1266 cout<<" v_"<<n<<"{"<<2*(i+1)<<"} = Im"<<endl;
1267 }
1268 }
1269
1270 cout<<endl;
1271 /*
1272 if(type == "NONAME")
1273 {
1274 cout<<" nEvts = "<<nEvtsNoName<<", AvM = "<<dMultNoName<<endl; // to be improved
1275 }
1276 else if (type == "RP")
1277 {
1278 cout<<" nEvts = "<<nEvtsRP<<", AvM = "<<dMultRP<<endl; // to be improved
1279 }
1280 else if (type == "POI")
1281 {
1282 cout<<" nEvts = "<<nEvtsPOI<<", AvM = "<<dMultPOI<<endl; // to be improved
1283 }
1284 */
1285 cout<<"*************************************"<<endl;
1286 cout<<"*************************************"<<endl;
1287 cout<<endl;
1288
1289}// end of AliFlowAnalysisWithQCumulants::PrintFinalResultsForIntegratedFlow(TString type="NONAME");
1290
1291
1292//================================================================================================================================
1293
1294
1295void AliFlowAnalysisWithQCumulants::WriteHistograms(TString outputFileName)
1296{
1297 //store the final results in output .root file
1298 TFile *output = new TFile(outputFileName.Data(),"RECREATE");
1299 //output->WriteObject(fHistList, "cobjQC","SingleKey");
1300 fHistList->Write(fHistList->GetName(), TObject::kSingleKey);
1301 delete output;
1302}
1303
1304
1305//================================================================================================================================
1306
1307
1308void AliFlowAnalysisWithQCumulants::WriteHistograms(TDirectoryFile *outputFileName)
1309{
1310 //store the final results in output .root file
1311 fHistList->SetName("cobjQC");
1312 fHistList->SetOwner(kTRUE);
1313 outputFileName->Add(fHistList);
1314 outputFileName->Write(outputFileName->GetName(), TObject::kSingleKey);
1315}
1316
1317
1318//================================================================================================================================
1319
1320
1321void AliFlowAnalysisWithQCumulants::BookCommonHistograms()
1322{
1323 // Book common control histograms and common histograms for final results.
1324 // common control histogram (ALL events)
1325 TString commonHistsName = "AliFlowCommonHistQC";
1326 commonHistsName += fAnalysisLabel->Data();
1327 fCommonHists = new AliFlowCommonHist(commonHistsName.Data());
1328 fHistList->Add(fCommonHists);
1329 // common control histogram (for events with 2 and more particles)
1330 TString commonHists2ndOrderName = "AliFlowCommonHist2ndOrderQC";
1331 commonHists2ndOrderName += fAnalysisLabel->Data();
1332 fCommonHists2nd = new AliFlowCommonHist(commonHists2ndOrderName.Data());
1333 fHistList->Add(fCommonHists2nd);
1334 // common control histogram (for events with 4 and more particles)
1335 TString commonHists4thOrderName = "AliFlowCommonHist4thOrderQC";
1336 commonHists4thOrderName += fAnalysisLabel->Data();
1337 fCommonHists4th = new AliFlowCommonHist(commonHists4thOrderName.Data());
1338 fHistList->Add(fCommonHists4th);
1339 // common control histogram (for events with 6 and more particles)
1340 TString commonHists6thOrderName = "AliFlowCommonHist6thOrderQC";
1341 commonHists6thOrderName += fAnalysisLabel->Data();
1342 fCommonHists6th = new AliFlowCommonHist(commonHists6thOrderName.Data());
1343 fHistList->Add(fCommonHists6th);
1344 // common control histogram (for events with 8 and more particles)
1345 TString commonHists8thOrderName = "AliFlowCommonHist8thOrderQC";
1346 commonHists8thOrderName += fAnalysisLabel->Data();
1347 fCommonHists8th = new AliFlowCommonHist(commonHists8thOrderName.Data());
1348 fHistList->Add(fCommonHists8th);
1349 // common histograms for final results (calculated for events with 2 and more particles)
1350 TString commonHistResults2ndOrderName = "AliFlowCommonHistResults2ndOrderQC";
1351 commonHistResults2ndOrderName += fAnalysisLabel->Data();
1352 fCommonHistsResults2nd = new AliFlowCommonHistResults(commonHistResults2ndOrderName.Data());
1353 fHistList->Add(fCommonHistsResults2nd);
1354 // common histograms for final results (calculated for events with 4 and more particles)
1355 TString commonHistResults4thOrderName = "AliFlowCommonHistResults4thOrderQC";
1356 commonHistResults4thOrderName += fAnalysisLabel->Data();
1357 fCommonHistsResults4th = new AliFlowCommonHistResults(commonHistResults4thOrderName.Data());
1358 fHistList->Add(fCommonHistsResults4th);
1359 // common histograms for final results (calculated for events with 6 and more particles)
1360 TString commonHistResults6thOrderName = "AliFlowCommonHistResults6thOrderQC";
1361 commonHistResults6thOrderName += fAnalysisLabel->Data();
1362 fCommonHistsResults6th = new AliFlowCommonHistResults(commonHistResults6thOrderName.Data());
1363 fHistList->Add(fCommonHistsResults6th);
1364 // common histograms for final results (calculated for events with 8 and more particles)
1365 TString commonHistResults8thOrderName = "AliFlowCommonHistResults8thOrderQC";
1366 commonHistResults8thOrderName += fAnalysisLabel->Data();
1367 fCommonHistsResults8th = new AliFlowCommonHistResults(commonHistResults8thOrderName.Data());
1368 fHistList->Add(fCommonHistsResults8th);
1369
1370} // end of void AliFlowAnalysisWithQCumulants::BookCommonHistograms()
1371
1372
1373//================================================================================================================================
1374
1375
1376void AliFlowAnalysisWithQCumulants::BookAndFillWeightsHistograms()
1377{
1378 // book and fill histograms which hold phi, pt and eta weights
1379
1380 if(!fWeightsList)
1381 {
1382 cout<<"WARNING: fWeightsList is NULL in AFAWQC::BAFWH() !!!!"<<endl;
1383 exit(0);
1384 }
1385
1386 TString fUseParticleWeightsName = "fUseParticleWeightsQC";
1387 fUseParticleWeightsName += fAnalysisLabel->Data();
1388 fUseParticleWeights = new TProfile(fUseParticleWeightsName.Data(),"0 = particle weight not used, 1 = particle weight used ",3,0,3);
1389 fUseParticleWeights->SetLabelSize(0.06);
1390 (fUseParticleWeights->GetXaxis())->SetBinLabel(1,"w_{#phi}");
1391 (fUseParticleWeights->GetXaxis())->SetBinLabel(2,"w_{p_{T}}");
1392 (fUseParticleWeights->GetXaxis())->SetBinLabel(3,"w_{#eta}");
1393 fUseParticleWeights->Fill(0.5,(Int_t)fUsePhiWeights);
1394 fUseParticleWeights->Fill(1.5,(Int_t)fUsePtWeights);
1395 fUseParticleWeights->Fill(2.5,(Int_t)fUseEtaWeights);
1396 fWeightsList->Add(fUseParticleWeights);
1397
1398 if(fUsePhiWeights)
1399 {
1400 if(fWeightsList->FindObject("phi_weights"))
1401 {
1402 fPhiWeights = dynamic_cast<TH1F*>(fWeightsList->FindObject("phi_weights"));
1403 if(TMath::Abs(fPhiWeights->GetBinWidth(1)-fPhiBinWidth)>pow(10.,-6.))
1404 {
1405 cout<<endl;
1406 cout<<"WARNING (QC): Inconsistent binning in histograms for phi-weights throughout the code."<<endl;
1407 cout<<endl;
1408 exit(0);
1409 }
1410 } else
1411 {
1412 cout<<"WARNING: fWeightsList->FindObject(\"phi_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
1413 exit(0);
1414 }
1415 } // end of if(fUsePhiWeights)
1416
1417 if(fUsePtWeights)
1418 {
1419 if(fWeightsList->FindObject("pt_weights"))
1420 {
1421 fPtWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("pt_weights"));
1422 if(TMath::Abs(fPtWeights->GetBinWidth(1)-fPtBinWidth)>pow(10.,-6.))
1423 {
1424 cout<<endl;
1425 cout<<"WARNING (QC): Inconsistent binning in histograms for pt-weights throughout the code."<<endl;
1426 cout<<endl;
1427 exit(0);
1428 }
1429 } else
1430 {
1431 cout<<"WARNING: fWeightsList->FindObject(\"pt_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
1432 exit(0);
1433 }
1434 } // end of if(fUsePtWeights)
1435
1436 if(fUseEtaWeights)
1437 {
1438 if(fWeightsList->FindObject("eta_weights"))
1439 {
1440 fEtaWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("eta_weights"));
1441 if(TMath::Abs(fEtaWeights->GetBinWidth(1)-fEtaBinWidth)>pow(10.,-6.))
1442 {
1443 cout<<endl;
1444 cout<<"WARNING (QC): Inconsistent binning in histograms for eta-weights throughout the code."<<endl;
1445 cout<<endl;
1446 exit(0);
1447 }
1448 } else
1449 {
1450 cout<<"WARNING: fUseEtaWeights && fWeightsList->FindObject(\"eta_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
1451 exit(0);
1452 }
1453 } // end of if(fUseEtaWeights)
1454
1455} // end of AliFlowAnalysisWithQCumulants::BookAndFillWeightsHistograms()
1456
1457
1458//================================================================================================================================
1459
1460
1461void AliFlowAnalysisWithQCumulants::BookEverythingForIntegratedFlow()
1462{
1463 // Book all objects for integrated flow:
1464 // a) Book profile to hold all flags for integrated flow.
1465 // b) Book event-by-event quantities.
1466 // c) Book profiles. // to be improved (comment)
1467 // d) Book histograms holding the final results.
1468
1469 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)
1470 TString powerFlag[2] = {"linear","quadratic"}; // to be improved (should I promote this to data members?)
1471
1472 // a) Book profile to hold all flags for integrated flow:
1473 TString intFlowFlagsName = "fIntFlowFlags";
1474 intFlowFlagsName += fAnalysisLabel->Data();
1475 fIntFlowFlags = new TProfile(intFlowFlagsName.Data(),"Flags for Integrated Flow",6,0,6);
1476 fIntFlowFlags->SetTickLength(-0.01,"Y");
1477 fIntFlowFlags->SetMarkerStyle(25);
1478 fIntFlowFlags->SetLabelSize(0.05);
1479 fIntFlowFlags->SetLabelOffset(0.02,"Y");
1480 fIntFlowFlags->GetXaxis()->SetBinLabel(1,"Particle Weights");
1481 fIntFlowFlags->GetXaxis()->SetBinLabel(2,"Event Weights");
1482 fIntFlowFlags->GetXaxis()->SetBinLabel(3,"Corrected for NUA?");
1483 fIntFlowFlags->GetXaxis()->SetBinLabel(4,"Print NONAME results");
1484 fIntFlowFlags->GetXaxis()->SetBinLabel(5,"Print RP results");
3b552efe 1485 fIntFlowFlags->GetXaxis()->SetBinLabel(6,"Print POI results");
489d5531 1486 fIntFlowList->Add(fIntFlowFlags);
1487
1488 // b) Book event-by-event quantities:
1489 // Re[Q_{m*n,k}], Im[Q_{m*n,k}] and S_{p,k}^M:
1490 fReQ = new TMatrixD(4,9);
1491 fImQ = new TMatrixD(4,9);
1492 fSMpk = new TMatrixD(8,9);
1493 // average correlations <2>, <4>, <6> and <8> for single event (bining is the same as in fIntFlowCorrelationsPro and fIntFlowCorrelationsHist):
1494 TString intFlowCorrelationsEBEName = "fIntFlowCorrelationsEBE";
1495 intFlowCorrelationsEBEName += fAnalysisLabel->Data();
1496 fIntFlowCorrelationsEBE = new TH1D(intFlowCorrelationsEBEName.Data(),intFlowCorrelationsEBEName.Data(),4,0,4);
1497 // weights for average correlations <2>, <4>, <6> and <8> for single event:
1498 TString intFlowEventWeightsForCorrelationsEBEName = "fIntFlowEventWeightsForCorrelationsEBE";
1499 intFlowEventWeightsForCorrelationsEBEName += fAnalysisLabel->Data();
1500 fIntFlowEventWeightsForCorrelationsEBE = new TH1D(intFlowEventWeightsForCorrelationsEBEName.Data(),intFlowEventWeightsForCorrelationsEBEName.Data(),4,0,4);
1501 // average all correlations for single event (bining is the same as in fIntFlowCorrelationsAllPro and fIntFlowCorrelationsAllHist):
1502 TString intFlowCorrelationsAllEBEName = "fIntFlowCorrelationsAllEBE";
1503 intFlowCorrelationsAllEBEName += fAnalysisLabel->Data();
1504 fIntFlowCorrelationsAllEBE = new TH1D(intFlowCorrelationsAllEBEName.Data(),intFlowCorrelationsAllEBEName.Data(),32,0,32);
1505 // average correction terms for non-uniform acceptance for single event
1506 // (binning is the same as in fIntFlowCorrectionTermsForNUAPro[2] and fIntFlowCorrectionTermsForNUAHist[2]):
1507 TString fIntFlowCorrectionTermsForNUAEBEName = "fIntFlowCorrectionTermsForNUAEBE";
1508 fIntFlowCorrectionTermsForNUAEBEName += fAnalysisLabel->Data();
1509 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1510 {
1511 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);
1512 }
0328db2d 1513 // event weights for terms for non-uniform acceptance:
1514 TString fIntFlowEventWeightForCorrectionTermsForNUAEBEName = "fIntFlowEventWeightForCorrectionTermsForNUAEBE";
1515 fIntFlowEventWeightForCorrectionTermsForNUAEBEName += fAnalysisLabel->Data();
1516 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1517 {
1518 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);
1519 }
489d5531 1520 // c) Book profiles: // to be improved (comment)
1521 // profile to hold average multiplicities and number of events for events with nRP>=0, nRP>=1, ... , and nRP>=8:
1522 TString avMultiplicityName = "fAvMultiplicity";
1523 avMultiplicityName += fAnalysisLabel->Data();
1524 fAvMultiplicity = new TProfile(avMultiplicityName.Data(),"Average Multiplicities of RPs",9,0,9);
1525 fAvMultiplicity->SetTickLength(-0.01,"Y");
1526 fAvMultiplicity->SetMarkerStyle(25);
1527 fAvMultiplicity->SetLabelSize(0.05);
1528 fAvMultiplicity->SetLabelOffset(0.02,"Y");
1529 fAvMultiplicity->SetYTitle("Average Multiplicity");
1530 (fAvMultiplicity->GetXaxis())->SetBinLabel(1,"all evts");
1531 (fAvMultiplicity->GetXaxis())->SetBinLabel(2,"n_{RP} #geq 1");
1532 (fAvMultiplicity->GetXaxis())->SetBinLabel(3,"n_{RP} #geq 2");
1533 (fAvMultiplicity->GetXaxis())->SetBinLabel(4,"n_{RP} #geq 3");
1534 (fAvMultiplicity->GetXaxis())->SetBinLabel(5,"n_{RP} #geq 4");
1535 (fAvMultiplicity->GetXaxis())->SetBinLabel(6,"n_{RP} #geq 5");
1536 (fAvMultiplicity->GetXaxis())->SetBinLabel(7,"n_{RP} #geq 6");
1537 (fAvMultiplicity->GetXaxis())->SetBinLabel(8,"n_{RP} #geq 7");
1538 (fAvMultiplicity->GetXaxis())->SetBinLabel(9,"n_{RP} #geq 8");
1539 fIntFlowProfiles->Add(fAvMultiplicity);
1540 // average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with wrong errors!):
1541 TString intFlowCorrelationsProName = "fIntFlowCorrelationsPro";
1542 intFlowCorrelationsProName += fAnalysisLabel->Data();
1543 fIntFlowCorrelationsPro = new TProfile(intFlowCorrelationsProName.Data(),"Average correlations for all events",4,0,4,"s");
1544 fIntFlowCorrelationsPro->SetTickLength(-0.01,"Y");
1545 fIntFlowCorrelationsPro->SetMarkerStyle(25);
1546 fIntFlowCorrelationsPro->SetLabelSize(0.06);
1547 fIntFlowCorrelationsPro->SetLabelOffset(0.01,"Y");
1548 (fIntFlowCorrelationsPro->GetXaxis())->SetBinLabel(1,"<<2>>");
1549 (fIntFlowCorrelationsPro->GetXaxis())->SetBinLabel(2,"<<4>>");
1550 (fIntFlowCorrelationsPro->GetXaxis())->SetBinLabel(3,"<<6>>");
1551 (fIntFlowCorrelationsPro->GetXaxis())->SetBinLabel(4,"<<8>>");
1552 fIntFlowProfiles->Add(fIntFlowCorrelationsPro);
ff70ca91 1553 // average correlations <<2>>, <<4>>, <<6>> and <<8>> versus multiplicity for all events (error is biased estimator):
1554 TString correlationFlag[4] = {"<<2>>","<<4>>","<<6>>","<<8>>"};
1555 Int_t fMinMultiplicity = 0; // to be improved (setter to this?)
1556 Int_t fMaxMultiplicity = 100; // to be improved (setter to this?)
1557 for(Int_t ci=0;ci<4;ci++) // correlation index
1558 {
1559 TString intFlowCorrelationsVsMProName = "fIntFlowCorrelationsVsMPro";
1560 intFlowCorrelationsVsMProName += fAnalysisLabel->Data();
1561 fIntFlowCorrelationsVsMPro[ci] = new TProfile(Form("%s, %s",intFlowCorrelationsVsMProName.Data(),correlationFlag[ci].Data()),
1562 Form("%s vs multiplicity",correlationFlag[ci].Data()),
1563 fMaxMultiplicity-fMinMultiplicity,fMinMultiplicity,fMaxMultiplicity,"s");
1564 fIntFlowCorrelationsVsMPro[ci]->GetYaxis()->SetTitle(correlationFlag[ci].Data());
1565 fIntFlowCorrelationsVsMPro[ci]->GetXaxis()->SetTitle("M");
1566 fIntFlowProfiles->Add(fIntFlowCorrelationsVsMPro[ci]);
1567 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
489d5531 1568 // averaged all correlations for all events (with wrong errors!):
1569 TString intFlowCorrelationsAllProName = "fIntFlowCorrelationsAllPro";
1570 intFlowCorrelationsAllProName += fAnalysisLabel->Data();
1571 fIntFlowCorrelationsAllPro = new TProfile(intFlowCorrelationsAllProName.Data(),"Average correlations for all events",32,0,32,"s");
1572 fIntFlowCorrelationsAllPro->SetTickLength(-0.01,"Y");
1573 fIntFlowCorrelationsAllPro->SetMarkerStyle(25);
1574 fIntFlowCorrelationsAllPro->SetLabelSize(0.03);
1575 fIntFlowCorrelationsAllPro->SetLabelOffset(0.01,"Y");
1576 // 2-p correlations:
1577 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(1,"<<2>>_{n|n}");
1578 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(2,"<<2>>_{2n|2n}");
1579 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(3,"<<2>>_{3n|3n}");
1580 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(4,"<<2>>_{4n|4n}");
1581 // 3-p correlations:
1582 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(6,"<<3>>_{2n|n,n}");
1583 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(7,"<<3>>_{3n|2n,n}");
1584 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(8,"<<3>>_{4n|2n,2n}");
1585 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(9,"<<3>>_{4n|3n,n}");
1586 // 4-p correlations:
1587 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(11,"<<4>>_{n,n|n,n}");
1588 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(12,"<<4>>_{2n,n|2n,n}");
1589 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(13,"<<4>>_{2n,2n|2n,2n}");
1590 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(14,"<<4>>_{3n|n,n,n}");
1591 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(15,"<<4>>_{3n,n|3n,n}");
1592 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(16,"<<4>>_{3n,n|2n,2n}");
1593 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(17,"<<4>>_{4n|2n,n,n}");
1594 // 5-p correlations:
1595 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(19,"<<5>>_{2n|n,n,n,n}");
1596 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(20,"<<5>>_{2n,2n|2n,n,n}");
1597 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(21,"<<5>>_{3n,n|2n,n,n}");
1598 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(22,"<<5>>_{4n|n,n,n,n}");
1599 // 6-p correlations:
1600 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(24,"<<6>>_{n,n,n|n,n,n}");
1601 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(25,"<<6>>_{2n,n,n|2n,n,n}");
1602 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(26,"<<6>>_{2n,2n|n,n,n,n}");
1603 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(27,"<<6>>_{3n,n|n,n,n,n}");
1604 // 7-p correlations:
1605 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(29,"<<7>>_{2n,n,n|n,n,n,n}");
1606 // 8-p correlations:
1607 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(31,"<<8>>_{n,n,n,n|n,n,n,n}");
1608 fIntFlowProfiles->Add(fIntFlowCorrelationsAllPro);
1609 // when particle weights are used some extra correlations appear:
1610 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
1611 {
1612 TString intFlowExtraCorrelationsProName = "fIntFlowExtraCorrelationsPro";
1613 intFlowExtraCorrelationsProName += fAnalysisLabel->Data();
1614 fIntFlowExtraCorrelationsPro = new TProfile(intFlowExtraCorrelationsProName.Data(),"Average extra correlations for all events",100,0,100,"s");
1615 fIntFlowExtraCorrelationsPro->SetTickLength(-0.01,"Y");
1616 fIntFlowExtraCorrelationsPro->SetMarkerStyle(25);
1617 fIntFlowExtraCorrelationsPro->SetLabelSize(0.03);
1618 fIntFlowExtraCorrelationsPro->SetLabelOffset(0.01,"Y");
1619 // extra 2-p correlations:
1620 (fIntFlowExtraCorrelationsPro->GetXaxis())->SetBinLabel(1,"<<w1^3 w2 cos(n*(phi1-phi2))>>");
1621 (fIntFlowExtraCorrelationsPro->GetXaxis())->SetBinLabel(2,"<<w1 w2 w3^2 cos(n*(phi1-phi2))>>");
1622 fIntFlowProfiles->Add(fIntFlowExtraCorrelationsPro);
1623 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
1624 // average product of correlations <2>, <4>, <6> and <8>:
1625 TString intFlowProductOfCorrelationsProName = "fIntFlowProductOfCorrelationsPro";
1626 intFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
1627 fIntFlowProductOfCorrelationsPro = new TProfile(intFlowProductOfCorrelationsProName.Data(),"Average products of correlations",6,0,6);
1628 fIntFlowProductOfCorrelationsPro->SetTickLength(-0.01,"Y");
1629 fIntFlowProductOfCorrelationsPro->SetMarkerStyle(25);
1630 fIntFlowProductOfCorrelationsPro->SetLabelSize(0.05);
1631 fIntFlowProductOfCorrelationsPro->SetLabelOffset(0.01,"Y");
1632 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(1,"<<2><4>>");
1633 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(2,"<<2><6>>");
1634 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(3,"<<2><8>>");
1635 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(4,"<<4><6>>");
1636 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(5,"<<4><8>>");
1637 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(6,"<<6><8>>");
1638 fIntFlowProfiles->Add(fIntFlowProductOfCorrelationsPro);
ff70ca91 1639 // average product of correlations <2>, <4>, <6> and <8> versus multiplicity
1640 // [0=<<2><4>>,1=<<2><6>>,2=<<2><8>>,3=<<4><6>>,4=<<4><8>>,5=<<6><8>>]
1641 TString intFlowProductOfCorrelationsVsMProName = "fIntFlowProductOfCorrelationsVsMPro";
1642 intFlowProductOfCorrelationsVsMProName += fAnalysisLabel->Data();
1643 TString productFlag[6] = {"<<2><4>>","<<2><6>>","<<2><8>>","<<4><6>>","<<4><8>>","<<6><8>>"};
1644 for(Int_t pi=0;pi<6;pi++)
1645 {
1646 fIntFlowProductOfCorrelationsVsMPro[pi] = new TProfile(Form("%s, %s",intFlowProductOfCorrelationsVsMProName.Data(),productFlag[pi].Data()),
1647 Form("%s versus multiplicity",productFlag[pi].Data()),
1648 fMaxMultiplicity-fMinMultiplicity,fMinMultiplicity,fMaxMultiplicity);
1649 fIntFlowProductOfCorrelationsVsMPro[pi]->GetXaxis()->SetTitle("M");
1650 fIntFlowProfiles->Add(fIntFlowProductOfCorrelationsVsMPro[pi]);
1651 } // end of for(Int_t pi=0;pi<6;pi++)
0328db2d 1652 // average product of correction terms for NUA:
1653 TString intFlowProductOfCorrectionTermsForNUAProName = "fIntFlowProductOfCorrectionTermsForNUAPro";
1654 intFlowProductOfCorrectionTermsForNUAProName += fAnalysisLabel->Data();
1655 fIntFlowProductOfCorrectionTermsForNUAPro = new TProfile(intFlowProductOfCorrectionTermsForNUAProName.Data(),"Average products of correction terms for NUA",27,0,27);
1656 fIntFlowProductOfCorrectionTermsForNUAPro->SetTickLength(-0.01,"Y");
1657 fIntFlowProductOfCorrectionTermsForNUAPro->SetMarkerStyle(25);
1658 fIntFlowProductOfCorrectionTermsForNUAPro->SetLabelSize(0.05);
1659 fIntFlowProductOfCorrectionTermsForNUAPro->SetLabelOffset(0.01,"Y");
1660 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(1,"<<2><cos(#phi)>>");
1661 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(2,"<<2><sin(#phi)>>");
1662 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(3,"<<cos(#phi)><sin(#phi)>>");
1663 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(4,"Cov(<2>,<cos(#phi_{1}+#phi_{2})>)");
1664 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(5,"Cov(<2>,<sin(#phi_{1}+#phi_{2})>)");
1665 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(6,"Cov(<2>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1666 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(7,"Cov(<2>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1667 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(8,"Cov(<4>,<cos(#phi)>)");
1668 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(9,"Cov(<4>,<sin(#phi)>)");
1669 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(10,"Cov(<4>,<cos(#phi_{1}+#phi_{2})>)");
1670 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(11,"Cov(<4>,<sin(#phi_{1}+#phi_{2})>)");
1671 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(12,"Cov(<4>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>>)");
1672 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(13,"Cov(<4>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>>)");
1673 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(14,"Cov(<cos(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
1674 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(15,"Cov(<cos(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
1675 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(16,"Cov(<cos(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1676 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(17,"Cov(<cos(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1677 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(18,"Cov(<sin(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
1678 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(19,"Cov(<sin(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
1679 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(20,"Cov(<sin(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1680 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(21,"Cov(<sin(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1681 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(22,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}+#phi_{2})>)");
1682 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(23,"Cov(<cos(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1683 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(24,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1684 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(25,"Cov(<sin(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1685 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(26,"Cov(<sin(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1686 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(27,"Cov(<cos(#phi_{1}-#phi_{2}-#phi_{3}>,<sin(#phi_{1}-#phi_{2}-#phi_{3}>)");
1687 fIntFlowProfiles->Add(fIntFlowProductOfCorrectionTermsForNUAPro);
489d5531 1688 // average correction terms for non-uniform acceptance (with wrong errors!):
1689 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1690 {
1691 TString intFlowCorrectionTermsForNUAProName = "fIntFlowCorrectionTermsForNUAPro";
1692 intFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
1693 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");
1694 fIntFlowCorrectionTermsForNUAPro[sc]->SetTickLength(-0.01,"Y");
1695 fIntFlowCorrectionTermsForNUAPro[sc]->SetMarkerStyle(25);
1696 fIntFlowCorrectionTermsForNUAPro[sc]->SetLabelSize(0.03);
1697 fIntFlowCorrectionTermsForNUAPro[sc]->SetLabelOffset(0.01,"Y");
1698 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(1,Form("<<%s(n(phi1))>>",sinCosFlag[sc].Data()));
1699 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(2,Form("<<%s(n(phi1+phi2))>>",sinCosFlag[sc].Data()));
1700 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(3,Form("<<%s(n(phi1-phi2-phi3))>>",sinCosFlag[sc].Data()));
1701 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(4,Form("<<%s(n(2phi1-phi2))>>",sinCosFlag[sc].Data()));
1702 fIntFlowProfiles->Add(fIntFlowCorrectionTermsForNUAPro[sc]);
1703 } // end of for(Int_t sc=0;sc<2;sc++)
1704
1705 // d) Book histograms holding the final results:
1706 // average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with correct errors!):
1707 TString intFlowCorrelationsHistName = "fIntFlowCorrelationsHist";
1708 intFlowCorrelationsHistName += fAnalysisLabel->Data();
1709 fIntFlowCorrelationsHist = new TH1D(intFlowCorrelationsHistName.Data(),"Average correlations for all events",4,0,4);
1710 fIntFlowCorrelationsHist->SetTickLength(-0.01,"Y");
1711 fIntFlowCorrelationsHist->SetMarkerStyle(25);
1712 fIntFlowCorrelationsHist->SetLabelSize(0.06);
1713 fIntFlowCorrelationsHist->SetLabelOffset(0.01,"Y");
1714 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(1,"<<2>>");
1715 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(2,"<<4>>");
1716 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(3,"<<6>>");
1717 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(4,"<<8>>");
1718 fIntFlowResults->Add(fIntFlowCorrelationsHist);
ff70ca91 1719 // average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with correct errors!) vs M:
1720 for(Int_t ci=0;ci<4;ci++) // correlation index
1721 {
1722 TString intFlowCorrelationsVsMHistName = "fIntFlowCorrelationsVsMHist";
1723 intFlowCorrelationsVsMHistName += fAnalysisLabel->Data();
1724 fIntFlowCorrelationsVsMHist[ci] = new TH1D(Form("%s, %s",intFlowCorrelationsVsMHistName.Data(),correlationFlag[ci].Data()),
1725 Form("%s vs multiplicity",correlationFlag[ci].Data()),
1726 fMaxMultiplicity-fMinMultiplicity,fMinMultiplicity,fMaxMultiplicity);
1727 fIntFlowCorrelationsVsMHist[ci]->GetYaxis()->SetTitle(correlationFlag[ci].Data());
1728 fIntFlowCorrelationsVsMHist[ci]->GetXaxis()->SetTitle("M");
1729 fIntFlowResults->Add(fIntFlowCorrelationsVsMHist[ci]);
1730 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
489d5531 1731 // average all correlations for all events (with correct errors!):
1732 TString intFlowCorrelationsAllHistName = "fIntFlowCorrelationsAllHist";
1733 intFlowCorrelationsAllHistName += fAnalysisLabel->Data();
1734 fIntFlowCorrelationsAllHist = new TH1D(intFlowCorrelationsAllHistName.Data(),"Average correlations for all events",32,0,32);
1735 fIntFlowCorrelationsAllHist->SetTickLength(-0.01,"Y");
1736 fIntFlowCorrelationsAllHist->SetMarkerStyle(25);
1737 fIntFlowCorrelationsAllHist->SetLabelSize(0.03);
1738 fIntFlowCorrelationsAllHist->SetLabelOffset(0.01,"Y");
1739 // 2-p correlations:
1740 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(1,"<<2>>_{n|n}");
1741 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(2,"<<2>>_{2n|2n}");
1742 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(3,"<<2>>_{3n|3n}");
1743 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(4,"<<2>>_{4n|4n}");
1744 // 3-p correlations:
1745 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(6,"<<3>>_{2n|n,n}");
1746 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(7,"<<3>>_{3n|2n,n}");
1747 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(8,"<<3>>_{4n|2n,2n}");
1748 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(9,"<<3>>_{4n|3n,n}");
1749 // 4-p correlations:
1750 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(11,"<<4>>_{n,n|n,n}");
1751 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(12,"<<4>>_{2n,n|2n,n}");
1752 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(13,"<<4>>_{2n,2n|2n,2n}");
1753 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(14,"<<4>>_{3n|n,n,n}");
1754 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(15,"<<4>>_{3n,n|3n,n}");
1755 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(16,"<<4>>_{3n,n|2n,2n}");
1756 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(17,"<<4>>_{4n|2n,n,n}");
1757 // 5-p correlations:
1758 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(19,"<<5>>_{2n|n,n,n,n}");
1759 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(20,"<<5>>_{2n,2n|2n,n,n}");
1760 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(21,"<<5>>_{3n,n|2n,n,n}");
1761 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(22,"<<5>>_{4n|n,n,n,n}");
1762 // 6-p correlations:
1763 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(24,"<<6>>_{n,n,n|n,n,n}");
1764 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(25,"<<6>>_{2n,n,n|2n,n,n}");
1765 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(26,"<<6>>_{2n,2n|n,n,n,n}");
1766 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(27,"<<6>>_{3n,n|n,n,n,n}");
1767 // 7-p correlations:
1768 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(29,"<<7>>_{2n,n,n|n,n,n,n}");
1769 // 8-p correlations:
1770 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(31,"<<8>>_{n,n,n,n|n,n,n,n}");
1771 fIntFlowResults->Add(fIntFlowCorrelationsAllHist);
1772 // average correction terms for non-uniform acceptance (with correct errors!):
1773 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1774 {
1775 TString intFlowCorrectionTermsForNUAHistName = "fIntFlowCorrectionTermsForNUAHist";
1776 intFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
1777 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);
1778 fIntFlowCorrectionTermsForNUAHist[sc]->SetTickLength(-0.01,"Y");
1779 fIntFlowCorrectionTermsForNUAHist[sc]->SetMarkerStyle(25);
1780 fIntFlowCorrectionTermsForNUAHist[sc]->SetLabelSize(0.03);
1781 fIntFlowCorrectionTermsForNUAHist[sc]->SetLabelOffset(0.01,"Y");
1782 // .........................................................................
1783 // 1-p terms:
1784 (fIntFlowCorrectionTermsForNUAHist[sc]->GetXaxis())->SetBinLabel(1,Form("%s(n(#phi_{1}))>",sinCosFlag[sc].Data()));
1785 // 2-p terms:
1786 // 3-p terms:
1787 // ...
1788 // .........................................................................
1789 fIntFlowResults->Add(fIntFlowCorrectionTermsForNUAHist[sc]);
1790 } // end of for(Int_t sc=0;sc<2;sc++)
1791 // covariances (multiplied with weight dependent prefactor):
1792 TString intFlowCovariancesName = "fIntFlowCovariances";
1793 intFlowCovariancesName += fAnalysisLabel->Data();
1794 fIntFlowCovariances = new TH1D(intFlowCovariancesName.Data(),"Covariances (multiplied with weight dependent prefactor)",6,0,6);
1795 fIntFlowCovariances->SetLabelSize(0.04);
1796 fIntFlowCovariances->SetMarkerStyle(25);
1797 (fIntFlowCovariances->GetXaxis())->SetBinLabel(1,"Cov(<2>,<4>)");
1798 (fIntFlowCovariances->GetXaxis())->SetBinLabel(2,"Cov(<2>,<6>)");
1799 (fIntFlowCovariances->GetXaxis())->SetBinLabel(3,"Cov(<2>,<8>)");
1800 (fIntFlowCovariances->GetXaxis())->SetBinLabel(4,"Cov(<4>,<6>)");
1801 (fIntFlowCovariances->GetXaxis())->SetBinLabel(5,"Cov(<4>,<8>)");
1802 (fIntFlowCovariances->GetXaxis())->SetBinLabel(6,"Cov(<6>,<8>)");
1803 fIntFlowResults->Add(fIntFlowCovariances);
1804 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8>:
1805 TString intFlowSumOfEventWeightsName = "fIntFlowSumOfEventWeights";
1806 intFlowSumOfEventWeightsName += fAnalysisLabel->Data();
1807 for(Int_t power=0;power<2;power++)
1808 {
1809 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);
1810 fIntFlowSumOfEventWeights[power]->SetLabelSize(0.05);
1811 fIntFlowSumOfEventWeights[power]->SetMarkerStyle(25);
1812 if(power == 0)
1813 {
1814 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>}");
1815 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<4>}");
1816 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<6>}");
1817 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<8>}");
1818 } else if (power == 1)
1819 {
1820 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>}^{2}");
1821 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<4>}^{2}");
1822 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<6>}^{2}");
1823 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<8>}^{2}");
1824 }
1825 fIntFlowResults->Add(fIntFlowSumOfEventWeights[power]);
1826 }
1827 // sum of products of event weights for correlations <2>, <4>, <6> and <8>:
1828 TString intFlowSumOfProductOfEventWeightsName = "fIntFlowSumOfProductOfEventWeights";
1829 intFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
1830 fIntFlowSumOfProductOfEventWeights = new TH1D(intFlowSumOfProductOfEventWeightsName.Data(),"Sum of product of event weights for correlations",6,0,6);
1831 fIntFlowSumOfProductOfEventWeights->SetLabelSize(0.05);
1832 fIntFlowSumOfProductOfEventWeights->SetMarkerStyle(25);
1833 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>} w_{<4>}");
1834 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<2>} w_{<6>}");
1835 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<2>} w_{<8>}");
1836 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<4>} w_{<6>}");
1837 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(5,"#sum_{i=1}^{N} w_{<4>} w_{<8>}");
1838 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(6,"#sum_{i=1}^{N} w_{<6>} w_{<8>}");
1839 fIntFlowResults->Add(fIntFlowSumOfProductOfEventWeights);
ff70ca91 1840 // final result for covariances of correlations (multiplied with weight dependent prefactor) versus M
1841 // [0=Cov(2,4),1=Cov(2,6),2=Cov(2,8),3=Cov(4,6),4=Cov(4,8),5=Cov(6,8)]:
1842 TString intFlowCovariancesVsMName = "fIntFlowCovariancesVsM";
1843 intFlowCovariancesVsMName += fAnalysisLabel->Data();
1844 TString covarianceFlag[6] = {"Cov(<2>,<4>)","Cov(<2>,<6>)","Cov(<2>,<8>)","Cov(<4>,<6>)","Cov(<4>,<8>)","Cov(<6>,<8>)"};
1845 for(Int_t ci=0;ci<6;ci++)
1846 {
1847 fIntFlowCovariancesVsM[ci] = new TH1D(Form("%s, %s",intFlowCovariancesVsMName.Data(),covarianceFlag[ci].Data()),
1848 Form("%s vs multiplicity",covarianceFlag[ci].Data()),
1849 fMaxMultiplicity-fMinMultiplicity,fMinMultiplicity,fMaxMultiplicity);
1850 fIntFlowCovariancesVsM[ci]->GetYaxis()->SetTitle(covarianceFlag[ci].Data());
1851 fIntFlowCovariancesVsM[ci]->GetXaxis()->SetTitle("M");
1852 fIntFlowResults->Add(fIntFlowCovariancesVsM[ci]);
1853 }
1854 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8> versus multiplicity
1855 // [0=sum{w_{<2>}},1=sum{w_{<4>}},2=sum{w_{<6>}},3=sum{w_{<8>}}][0=linear 1,1=quadratic]:
1856 TString intFlowSumOfEventWeightsVsMName = "fIntFlowSumOfEventWeightsVsM";
1857 intFlowSumOfEventWeightsVsMName += fAnalysisLabel->Data();
1858 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>}"},
1859 {"#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}"}};
1860 for(Int_t si=0;si<4;si++)
1861 {
1862 for(Int_t power=0;power<2;power++)
1863 {
1864 fIntFlowSumOfEventWeightsVsM[si][power] = new TH1D(Form("%s, %s",intFlowSumOfEventWeightsVsMName.Data(),sumFlag[power][si].Data()),
1865 Form("%s vs multiplicity",sumFlag[power][si].Data()),
1866 fMaxMultiplicity-fMinMultiplicity,fMinMultiplicity,fMaxMultiplicity);
1867 fIntFlowSumOfEventWeightsVsM[si][power]->GetYaxis()->SetTitle(sumFlag[power][si].Data());
1868 fIntFlowSumOfEventWeightsVsM[si][power]->GetXaxis()->SetTitle("M");
1869 fIntFlowResults->Add(fIntFlowSumOfEventWeightsVsM[si][power]);
1870 } // end of for(Int_t power=0;power<2;power++)
1871 } // end of for(Int_t si=0;si<4;si++)
1872 // sum of products of event weights for correlations <2>, <4>, <6> and <8> vs M
1873 // [0=sum{w_{<2>}w_{<4>}},1=sum{w_{<2>}w_{<6>}},2=sum{w_{<2>}w_{<8>}},
1874 // 3=sum{w_{<4>}w_{<6>}},4=sum{w_{<4>}w_{<8>}},5=sum{w_{<6>}w_{<8>}}]:
1875 TString intFlowSumOfProductOfEventWeightsVsMName = "fIntFlowSumOfProductOfEventWeightsVsM";
1876 intFlowSumOfProductOfEventWeightsVsMName += fAnalysisLabel->Data();
1877 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>}",
1878 "#sum_{i=1}^{N} w_{<4>} w_{<6>}","#sum_{i=1}^{N} w_{<4>} w_{<8>}","#sum_{i=1}^{N} w_{<6>} w_{<8>}"};
1879 for(Int_t pi=0;pi<6;pi++)
1880 {
1881 fIntFlowSumOfProductOfEventWeightsVsM[pi] = new TH1D(Form("%s, %s",intFlowSumOfProductOfEventWeightsVsMName.Data(),sopowFlag[pi].Data()),
1882 Form("%s versus multiplicity",sopowFlag[pi].Data()),
1883 fMaxMultiplicity-fMinMultiplicity,fMinMultiplicity,fMaxMultiplicity);
1884 fIntFlowSumOfProductOfEventWeightsVsM[pi]->GetXaxis()->SetTitle("M");
1885 fIntFlowSumOfProductOfEventWeightsVsM[pi]->GetYaxis()->SetTitle(sopowFlag[pi].Data());
1886 fIntFlowResults->Add(fIntFlowSumOfProductOfEventWeightsVsM[pi]);
1887 } // end of for(Int_t pi=0;pi<6;pi++)
0328db2d 1888 // covariances of NUA terms (multiplied with weight dependent prefactor):
1889 TString intFlowCovariancesNUAName = "fIntFlowCovariancesNUA";
1890 intFlowCovariancesNUAName += fAnalysisLabel->Data();
1891 fIntFlowCovariancesNUA = new TH1D(intFlowCovariancesNUAName.Data(),"Covariances for NUA (multiplied with weight dependent prefactor)",27,0,27);
1892 fIntFlowCovariancesNUA->SetLabelSize(0.04);
1893 fIntFlowCovariancesNUA->SetMarkerStyle(25);
1894 fIntFlowCovariancesNUA->GetXaxis()->SetLabelSize(0.02);
1895 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(1,"Cov(<2>,<cos(#phi)>");
1896 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(2,"Cov(<2>,<sin(#phi)>)");
1897 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(3,"Cov(<cos(#phi)>,<sin(#phi)>)");
1898 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(4,"Cov(<2>,<cos(#phi_{1}+#phi_{2})>)");
1899 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(5,"Cov(<2>,<sin(#phi_{1}+#phi_{2})>)");
1900 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(6,"Cov(<2>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1901 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(7,"Cov(<2>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1902 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(8,"Cov(<4>,<cos(#phi)>)");
1903 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(9,"Cov(<4>,<sin(#phi)>)");
1904 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(10,"Cov(<4>,<cos(#phi_{1}+#phi_{2})>)");
1905 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(11,"Cov(<4>,<sin(#phi_{1}+#phi_{2})>)");
1906 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(12,"Cov(<4>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>>)");
1907 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(13,"Cov(<4>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>>)");
1908 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(14,"Cov(<cos(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
1909 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(15,"Cov(<cos(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
1910 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(16,"Cov(<cos(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1911 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(17,"Cov(<cos(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1912 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(18,"Cov(<sin(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
1913 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(19,"Cov(<sin(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
1914 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(20,"Cov(<sin(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1915 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(21,"Cov(<sin(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1916 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(22,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}+#phi_{2})>)");
1917 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(23,"Cov(<cos(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1918 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(24,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1919 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(25,"Cov(<sin(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1920 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(26,"Cov(<sin(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1921 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(27,"Cov(<cos(#phi_{1}-#phi_{2}-#phi_{3}>,<sin(#phi_{1}-#phi_{2}-#phi_{3}>)");
1922 fIntFlowResults->Add(fIntFlowCovariancesNUA);
1923 // sum of linear and quadratic event weights for NUA terms:
1924 TString intFlowSumOfEventWeightsNUAName = "fIntFlowSumOfEventWeightsNUA";
1925 intFlowSumOfEventWeightsNUAName += fAnalysisLabel->Data();
1926 for(Int_t sc=0;sc<2;sc++)
1927 {
1928 for(Int_t power=0;power<2;power++)
1929 {
1930 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);
1931 fIntFlowSumOfEventWeightsNUA[sc][power]->SetLabelSize(0.05);
1932 fIntFlowSumOfEventWeightsNUA[sc][power]->SetMarkerStyle(25);
1933 if(power == 0)
1934 {
1935 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(1,Form("#sum_{i=1}^{N} w_{<%s(#phi)>}",sinCosFlag[sc].Data()));
1936 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(2,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}+#phi_{2})>}",sinCosFlag[sc].Data()));
1937 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(3,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}-#phi_{2}-#phi_{3})>}",sinCosFlag[sc].Data()));
1938 } else if(power == 1)
1939 {
1940 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(1,Form("#sum_{i=1}^{N} w_{<%s(#phi)>}^{2}",sinCosFlag[sc].Data()));
1941 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(2,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}+#phi_{2})>}^{2}",sinCosFlag[sc].Data()));
1942 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(3,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}-#phi_{2}-#phi_{3})>}^{2}",sinCosFlag[sc].Data()));
1943 }
1944 fIntFlowResults->Add(fIntFlowSumOfEventWeightsNUA[sc][power]);
1945 }
1946 }
1947 // sum of products of event weights for NUA terms:
1948 TString intFlowSumOfProductOfEventWeightsNUAName = "fIntFlowSumOfProductOfEventWeightsNUA";
1949 intFlowSumOfProductOfEventWeightsNUAName += fAnalysisLabel->Data();
1950 fIntFlowSumOfProductOfEventWeightsNUA = new TH1D(intFlowSumOfProductOfEventWeightsNUAName.Data(),"Sum of product of event weights for NUA terms",27,0,27);
1951 fIntFlowSumOfProductOfEventWeightsNUA->SetLabelSize(0.05);
1952 fIntFlowSumOfProductOfEventWeightsNUA->SetMarkerStyle(25);
1953 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>} w_{<cos(#phi)>}");
1954 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<2>} w_{<sin(#phi)>}");
1955 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<cos(#phi)>} w_{<sin(#phi)>}");
1956 // ....
1957 // to be improved - add labels for remaining bins
1958 // ....
1959 fIntFlowResults->Add(fIntFlowSumOfProductOfEventWeightsNUA);
489d5531 1960 // final results for integrated Q-cumulants:
1961 TString intFlowQcumulantsName = "fIntFlowQcumulants";
1962 intFlowQcumulantsName += fAnalysisLabel->Data();
1963 fIntFlowQcumulants = new TH1D(intFlowQcumulantsName.Data(),"Integrated Q-cumulants",4,0,4);
1964 fIntFlowQcumulants->SetLabelSize(0.05);
1965 fIntFlowQcumulants->SetMarkerStyle(25);
1966 (fIntFlowQcumulants->GetXaxis())->SetBinLabel(1,"QC{2}");
1967 (fIntFlowQcumulants->GetXaxis())->SetBinLabel(2,"QC{4}");
1968 (fIntFlowQcumulants->GetXaxis())->SetBinLabel(3,"QC{6}");
1969 (fIntFlowQcumulants->GetXaxis())->SetBinLabel(4,"QC{8}");
1970 fIntFlowResults->Add(fIntFlowQcumulants);
ff70ca91 1971 // final results for integrated Q-cumulants versus multiplicity:
1972 TString intFlowQcumulantsVsMName = "fIntFlowQcumulantsVsM";
1973 intFlowQcumulantsVsMName += fAnalysisLabel->Data();
1974 TString cumulantFlag[4] = {"QC{2}","QC{4}","QC{6}","QC{8}"};
1975 for(Int_t co=0;co<4;co++) // cumulant order
1976 {
1977 fIntFlowQcumulantsVsM[co] = new TH1D(Form("%s, %s",intFlowQcumulantsVsMName.Data(),cumulantFlag[co].Data()),
1978 Form("%s vs multipicity",cumulantFlag[co].Data()),
1979 fMaxMultiplicity-fMinMultiplicity,fMinMultiplicity,fMaxMultiplicity);
1980 fIntFlowQcumulantsVsM[co]->GetXaxis()->SetTitle("M");
1981 fIntFlowQcumulantsVsM[co]->GetYaxis()->SetTitle(cumulantFlag[co].Data());
1982 fIntFlowResults->Add(fIntFlowQcumulantsVsM[co]);
1983 } // end of for(Int_t co=0;co<4;co++) // cumulant order
489d5531 1984 // final integrated flow estimates from Q-cumulants:
1985 TString intFlowName = "fIntFlow";
1986 intFlowName += fAnalysisLabel->Data();
1987 // integrated flow from Q-cumulants:
1988 fIntFlow = new TH1D(intFlowName.Data(),"Integrated flow estimates from Q-cumulants",4,0,4);
1989 fIntFlow->SetLabelSize(0.05);
1990 fIntFlow->SetMarkerStyle(25);
ff70ca91 1991 (fIntFlow->GetXaxis())->SetBinLabel(1,"v_{2}{2,QC}"); // to be improved (harwired harmonic)
1992 (fIntFlow->GetXaxis())->SetBinLabel(2,"v_{2}{4,QC}"); // to be improved (harwired harmonic)
1993 (fIntFlow->GetXaxis())->SetBinLabel(3,"v_{2}{6,QC}"); // to be improved (harwired harmonic)
1994 (fIntFlow->GetXaxis())->SetBinLabel(4,"v_{2}{8,QC}"); // to be improved (harwired harmonic)
1995 fIntFlowResults->Add(fIntFlow);
1996 // integrated flow from Q-cumulants: versus multiplicity:
1997 TString intFlowVsMName = "fIntFlowVsM";
1998 intFlowVsMName += fAnalysisLabel->Data();
1999 TString flowFlag[4] = {"v_{2}{2,QC}","v_{2}{4,QC}","v_{2}{6,QC}","v_{2}{8,QC}"}; // to be improved (harwired harmonic)
2000 for(Int_t co=0;co<4;co++) // cumulant order
2001 {
2002 fIntFlowVsM[co] = new TH1D(Form("%s, %s",intFlowVsMName.Data(),flowFlag[co].Data()),
2003 Form("%s vs multipicity",flowFlag[co].Data()),
2004 fMaxMultiplicity-fMinMultiplicity,fMinMultiplicity,fMaxMultiplicity);
2005 fIntFlowVsM[co]->GetXaxis()->SetTitle("M");
2006 fIntFlowVsM[co]->GetYaxis()->SetTitle(flowFlag[co].Data());
2007 fIntFlowResults->Add(fIntFlowVsM[co]);
2008 } // end of for(Int_t co=0;co<4;co++) // cumulant order
489d5531 2009
2010 /* // to be improved (removed):
2011 // final average weighted multi-particle correlations for all events calculated from Q-vectors
2012 fQCorrelations[1] = new TProfile("Weighted correlations","final average multi-particle correlations from weighted Q-vectors",200,0,200,"s");
2013 fQCorrelations[1]->SetTickLength(-0.01,"Y");
2014 fQCorrelations[1]->SetMarkerStyle(25);
2015 fQCorrelations[1]->SetLabelSize(0.03);
2016 fQCorrelations[1]->SetLabelOffset(0.01,"Y");
2017 // 2-particle correlations:
2018 (fQCorrelations[1]->GetXaxis())->SetBinLabel(1,"<w_{1}w_{2}cos(n(#phi_{1}-#phi_{2}))>");
2019 (fQCorrelations[1]->GetXaxis())->SetBinLabel(2,"<w_{1}^{2}w_{2}^{2}cos(2n(#phi_{1}-#phi_{2}))>");
2020 (fQCorrelations[1]->GetXaxis())->SetBinLabel(3,"<w_{1}^{3}w_{2}^{3}cos(3n(#phi_{1}-#phi_{2}))>");
2021 (fQCorrelations[1]->GetXaxis())->SetBinLabel(4,"<w_{1}^{4}w_{2}^{4}cos(4n(#phi_{1}-#phi_{2}))>");
2022 (fQCorrelations[1]->GetXaxis())->SetBinLabel(5,"<w_{1}^{3}w_{2}cos(n(#phi_{1}-#phi_{2}))>");
2023 (fQCorrelations[1]->GetXaxis())->SetBinLabel(6,"<w_{1}^{2}w_{2}w_{3}cos(n(#phi_{1}-#phi_{2}))>");
2024 // 3-particle correlations:
2025 (fQCorrelations[1]->GetXaxis())->SetBinLabel(21,"<w_{1}w_{2}w_{3}^{2}cos(n(2#phi_{1}-#phi_{2}-#phi_{3}))>");
2026 // 4-particle correlations:
2027 (fQCorrelations[1]->GetXaxis())->SetBinLabel(41,"<w_{1}w_{2}w_{3}w_{4}cos(n(#phi_{1}+#phi_{2}-#phi_{3}-#phi_{4}))>");
2028 // add fQCorrelations[1] to the list fIntFlowList:
2029 fIntFlowList->Add(fQCorrelations[1]);
2030 */
2031
2032} // end of AliFlowAnalysisWithQCumulants::BookEverythingForIntegratedFlow()
2033
2034
2035//================================================================================================================================
2036
2037
2038void AliFlowAnalysisWithQCumulants::InitializeArraysForNestedLoops()
2039{
2040 // Initialize arrays of all objects relevant for calculations with nested loops.
2041
2042 // integrated flow:
2043 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2044 {
2045 fIntFlowDirectCorrectionTermsForNUA[sc] = NULL;
2046 }
2047
2048 // differential flow:
2049 // correlations:
2050 for(Int_t t=0;t<2;t++) // type: RP or POI
2051 {
2052 for(Int_t pe=0;pe<2;pe++) // pt or eta
2053 {
2054 for(Int_t ci=0;ci<4;ci++) // correlation index
2055 {
2056 fDiffFlowDirectCorrelations[t][pe][ci] = NULL;
2057 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
2058 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
2059 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
2060 // correction terms for non-uniform acceptance:
2061 for(Int_t t=0;t<2;t++) // type: RP or POI
2062 {
2063 for(Int_t pe=0;pe<2;pe++) // pt or eta
2064 {
2065 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2066 {
2067 for(Int_t cti=0;cti<9;cti++) // correction term index
2068 {
2069 fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti] = NULL;
2070 }
2071 }
2072 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
2073 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
2074
2075
2076} // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForNestedLoops()
2077
2078
2079//================================================================================================================================
2080
2081
2082void AliFlowAnalysisWithQCumulants::BookEverythingForNestedLoops()
2083{
2084 // Book all objects relevant for calculations with nested loops.
2085
2086 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)
2087 TString typeFlag[2] = {"RP","POI"}; // to be improved (should I promote this to data members?)
2088 TString ptEtaFlag[2] = {"p_{T}","#eta"}; // to be improved (should I promote this to data members?)
2089 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"}; // to be improved (should I promote this to data members?)
2090 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
2091 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
2092
2093 TString evaluateNestedLoopsName = "fEvaluateNestedLoops";
2094 evaluateNestedLoopsName += fAnalysisLabel->Data();
2095 fEvaluateNestedLoops = new TProfile(evaluateNestedLoopsName.Data(),"Flags for nested loops",4,0,4);
2096 fEvaluateNestedLoops->SetLabelSize(0.03);
2097 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(1,"fEvaluateIntFlowNestedLoops");
2098 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(2,"fEvaluateDiffFlowNestedLoops");
2099 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(3,"fCrossCheckInPtBinNo");
2100 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(4,"fCrossCheckInEtaBinNo");
2101 fEvaluateNestedLoops->Fill(0.5,(Int_t)fEvaluateIntFlowNestedLoops);
2102 fEvaluateNestedLoops->Fill(1.5,(Int_t)fEvaluateDiffFlowNestedLoops);
2103 fEvaluateNestedLoops->Fill(2.5,fCrossCheckInPtBinNo);
2104 fEvaluateNestedLoops->Fill(3.5,fCrossCheckInEtaBinNo);
2105 fNestedLoopsList->Add(fEvaluateNestedLoops);
2106 // nested loops for integrated flow:
2107 if(fEvaluateIntFlowNestedLoops)
2108 {
2109 // correlations:
2110 TString intFlowDirectCorrelationsName = "fIntFlowDirectCorrelations";
2111 intFlowDirectCorrelationsName += fAnalysisLabel->Data();
2112 fIntFlowDirectCorrelations = new TProfile(intFlowDirectCorrelationsName.Data(),"Multiparticle correlations calculated with nested loops (for int. flow)",32,0,32,"s");
2113 fNestedLoopsList->Add(fIntFlowDirectCorrelations);
2114 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
2115 {
2116 TString intFlowExtraDirectCorrelationsName = "fIntFlowExtraDirectCorrelations";
2117 intFlowExtraDirectCorrelationsName += fAnalysisLabel->Data();
2118 fIntFlowExtraDirectCorrelations = new TProfile(intFlowExtraDirectCorrelationsName.Data(),"Extra multiparticle correlations calculated with nested loops (for int. flow)",100,0,100,"s");
2119 fNestedLoopsList->Add(fIntFlowExtraDirectCorrelations);
2120 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
2121 // correction terms for non-uniform acceptance:
2122 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2123 {
2124 TString intFlowDirectCorrectionTermsForNUAName = "fIntFlowDirectCorrectionTermsForNUA";
2125 intFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
2126 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");
2127 fNestedLoopsList->Add(fIntFlowDirectCorrectionTermsForNUA[sc]);
2128 } // end of for(Int_t sc=0;sc<2;sc++)
2129 } // end of if(fEvaluateIntFlowNestedLoops)
2130
2131 // nested loops for differential flow:
2132 if(fEvaluateDiffFlowNestedLoops)
2133 {
2134 // reduced correlations:
2135 TString diffFlowDirectCorrelationsName = "fDiffFlowDirectCorrelations";
2136 diffFlowDirectCorrelationsName += fAnalysisLabel->Data();
2137 for(Int_t t=0;t<2;t++) // type: RP or POI
2138 {
2139 for(Int_t pe=0;pe<2;pe++) // pt or eta
2140 {
2141 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
2142 {
2143 // reduced correlations:
2144 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");
2145 fDiffFlowDirectCorrelations[t][pe][rci]->SetXTitle(ptEtaFlag[pe].Data());
2146 fNestedLoopsList->Add(fDiffFlowDirectCorrelations[t][pe][rci]); // to be improved (add dedicated list to hold reduced correlations)
2147 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
2148 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
2149 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
2150 // correction terms for non-uniform acceptance:
2151 TString diffFlowDirectCorrectionTermsForNUAName = "fDiffFlowDirectCorrectionTermsForNUA";
2152 diffFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
2153 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
2154 {
2155 for(Int_t pe=0;pe<2;pe++) // pt or eta
2156 {
2157 for(Int_t sc=0;sc<2;sc++) // sin or cos
2158 {
2159 for(Int_t cti=0;cti<9;cti++) // correction term index
2160 {
2161 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");
2162 fNestedLoopsList->Add(fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti]);
2163 }
2164 }
2165 }
3b552efe 2166 }
2167 // number of RPs and POIs in selected pt and eta bins for cross-checkings:
2168 TString noOfParticlesInBinName = "fNoOfParticlesInBin";
2169 fNoOfParticlesInBin = new TH1D(noOfParticlesInBinName.Data(),"Number of RPs and POIs in selected p_{T} and #eta bin",4,0,4);
489d5531 2170 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(1,"# of RPs in p_{T} bin");
2171 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(2,"# of RPs in #eta bin");
2172 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(3,"# of POIs in p_{T} bin");
3b552efe 2173 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(4,"# of POIs in #eta bin");
489d5531 2174 fNestedLoopsList->Add(fNoOfParticlesInBin);
2175 } // end of if(fEvaluateDiffFlowNestedLoops)
2176
2177} // end of AliFlowAnalysisWithQCumulants::BookEverythingForNestedLoops()
2178
2179
2180//================================================================================================================================
2181
2182
2183void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelations()
2184{
2185 // calculate all correlations needed for integrated flow
57340a27 2186
489d5531 2187 // multiplicity:
2188 Double_t dMult = (*fSMpk)(0,0);
57340a27 2189
489d5531 2190 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
2191 Double_t dReQ1n = (*fReQ)(0,0);
2192 Double_t dReQ2n = (*fReQ)(1,0);
2193 Double_t dReQ3n = (*fReQ)(2,0);
2194 Double_t dReQ4n = (*fReQ)(3,0);
2195 Double_t dImQ1n = (*fImQ)(0,0);
2196 Double_t dImQ2n = (*fImQ)(1,0);
2197 Double_t dImQ3n = (*fImQ)(2,0);
2198 Double_t dImQ4n = (*fImQ)(3,0);
2199
2200 // real and imaginary parts of some expressions involving various combinations of Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
2201 // (these expression appear in the Eqs. for the multi-particle correlations bellow)
2202
2203 // Re[Q_{2n} Q_{n}^* Q_{n}^*]
2204 Double_t reQ2nQ1nstarQ1nstar = pow(dReQ1n,2.)*dReQ2n + 2.*dReQ1n*dImQ1n*dImQ2n - pow(dImQ1n,2.)*dReQ2n;
2205
2206 // Im[Q_{2n} Q_{n}^* Q_{n}^*]
2207 //Double_t imQ2nQ1nstarQ1nstar = pow(dReQ1n,2.)*dImQ2n-2.*dReQ1n*dImQ1n*dReQ2n-pow(dImQ1n,2.)*dImQ2n;
2208
2209 // Re[Q_{n} Q_{n} Q_{2n}^*] = Re[Q_{2n} Q_{n}^* Q_{n}^*]
2210 Double_t reQ1nQ1nQ2nstar = reQ2nQ1nstarQ1nstar;
2211
2212 // Re[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]
2213 Double_t reQ3nQ1nQ2nstarQ2nstar = (pow(dReQ2n,2.)-pow(dImQ2n,2.))*(dReQ3n*dReQ1n-dImQ3n*dImQ1n)
2214 + 2.*dReQ2n*dImQ2n*(dReQ3n*dImQ1n+dImQ3n*dReQ1n);
2215
2216 // Im[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]
2217 //Double_t imQ3nQ1nQ2nstarQ2nstar = calculate and implement this (deleteMe)
2218
2219 // Re[Q_{2n} Q_{2n} Q_{3n}^* Q_{1n}^*] = Re[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]
2220 Double_t reQ2nQ2nQ3nstarQ1nstar = reQ3nQ1nQ2nstarQ2nstar;
2221
2222 // Re[Q_{4n} Q_{2n}^* Q_{2n}^*]
2223 Double_t reQ4nQ2nstarQ2nstar = pow(dReQ2n,2.)*dReQ4n+2.*dReQ2n*dImQ2n*dImQ4n-pow(dImQ2n,2.)*dReQ4n;
2224
2225 // Im[Q_{4n} Q_{2n}^* Q_{2n}^*]
2226 //Double_t imQ4nQ2nstarQ2nstar = calculate and implement this (deleteMe)
2227
2228 // Re[Q_{2n} Q_{2n} Q_{4n}^*] = Re[Q_{4n} Q_{2n}^* Q_{2n}^*]
2229 Double_t reQ2nQ2nQ4nstar = reQ4nQ2nstarQ2nstar;
2230
2231 // Re[Q_{4n} Q_{3n}^* Q_{n}^*]
2232 Double_t reQ4nQ3nstarQ1nstar = dReQ4n*(dReQ3n*dReQ1n-dImQ3n*dImQ1n)+dImQ4n*(dReQ3n*dImQ1n+dImQ3n*dReQ1n);
2233
2234 // Re[Q_{3n} Q_{n} Q_{4n}^*] = Re[Q_{4n} Q_{3n}^* Q_{n}^*]
2235 Double_t reQ3nQ1nQ4nstar = reQ4nQ3nstarQ1nstar;
2236
2237 // Im[Q_{4n} Q_{3n}^* Q_{n}^*]
2238 //Double_t imQ4nQ3nstarQ1nstar = calculate and implement this (deleteMe)
2239
2240 // Re[Q_{3n} Q_{2n}^* Q_{n}^*]
2241 Double_t reQ3nQ2nstarQ1nstar = dReQ3n*dReQ2n*dReQ1n-dReQ3n*dImQ2n*dImQ1n+dImQ3n*dReQ2n*dImQ1n
2242 + dImQ3n*dImQ2n*dReQ1n;
2243
2244 // Re[Q_{2n} Q_{n} Q_{3n}^*] = Re[Q_{3n} Q_{2n}^* Q_{n}^*]
2245 Double_t reQ2nQ1nQ3nstar = reQ3nQ2nstarQ1nstar;
2246
2247 // Im[Q_{3n} Q_{2n}^* Q_{n}^*]
2248 //Double_t imQ3nQ2nstarQ1nstar; //calculate and implement this (deleteMe)
2249
2250 // Re[Q_{3n} Q_{n}^* Q_{n}^* Q_{n}^*]
2251 Double_t reQ3nQ1nstarQ1nstarQ1nstar = dReQ3n*pow(dReQ1n,3)-3.*dReQ1n*dReQ3n*pow(dImQ1n,2)
2252 + 3.*dImQ1n*dImQ3n*pow(dReQ1n,2)-dImQ3n*pow(dImQ1n,3);
2253
2254 // Im[Q_{3n} Q_{n}^* Q_{n}^* Q_{n}^*]
2255 //Double_t imQ3nQ1nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)
2256
2257 // |Q_{2n}|^2 |Q_{n}|^2
2258 Double_t dQ2nQ1nQ2nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.));
2259
2260 // Re[Q_{4n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2261 Double_t reQ4nQ2nstarQ1nstarQ1nstar = (dReQ4n*dReQ2n+dImQ4n*dImQ2n)*(pow(dReQ1n,2)-pow(dImQ1n,2))
2262 + 2.*dReQ1n*dImQ1n*(dImQ4n*dReQ2n-dReQ4n*dImQ2n);
2263
2264 // Im[Q_{4n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2265 //Double_t imQ4nQ2nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)
2266
2267 // Re[Q_{2n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^*]
2268 Double_t reQ2nQ1nQ1nstarQ1nstarQ1nstar = (dReQ2n*dReQ1n-dImQ2n*dImQ1n)*(pow(dReQ1n,3)-3.*dReQ1n*pow(dImQ1n,2))
2269 + (dReQ2n*dImQ1n+dReQ1n*dImQ2n)*(3.*dImQ1n*pow(dReQ1n,2)-pow(dImQ1n,3));
2270
2271 // Im[Q_{2n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^*]
2272 //Double_t imQ2nQ1nQ1nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)
2273
2274 // Re[Q_{2n} Q_{2n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2275 Double_t reQ2nQ2nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))
2276 * (dReQ2n*(pow(dReQ1n,2.)-pow(dImQ1n,2.)) + 2.*dImQ2n*dReQ1n*dImQ1n);
2277
2278 // Im[Q_{2n} Q_{2n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2279 //Double_t imQ2nQ2nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))
2280 // * (dImQ2n*(pow(dReQ1n,2.)-pow(dImQ1n,2.)) - 2.*dReQ2n*dReQ1n*dImQ1n);
2281
2282 // Re[Q_{4n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2283 Double_t reQ4nQ1nstarQ1nstarQ1nstarQ1nstar = pow(dReQ1n,4.)*dReQ4n-6.*pow(dReQ1n,2.)*dReQ4n*pow(dImQ1n,2.)
2284 + pow(dImQ1n,4.)*dReQ4n+4.*pow(dReQ1n,3.)*dImQ1n*dImQ4n
2285 - 4.*pow(dImQ1n,3.)*dReQ1n*dImQ4n;
2286
2287 // Im[Q_{4n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2288 //Double_t imQ4nQ1nstarQ1nstarQ1nstarQ1nstar = pow(dReQ1n,4.)*dImQ4n-6.*pow(dReQ1n,2.)*dImQ4n*pow(dImQ1n,2.)
2289 // + pow(dImQ1n,4.)*dImQ4n+4.*pow(dImQ1n,3.)*dReQ1n*dReQ4n
2290 // - 4.*pow(dReQ1n,3.)*dImQ1n*dReQ4n;
2291
2292 // Re[Q_{3n} Q_{n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2293 Double_t reQ3nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
2294 * (dReQ1n*dReQ2n*dReQ3n-dReQ3n*dImQ1n*dImQ2n+dReQ2n*dImQ1n*dImQ3n+dReQ1n*dImQ2n*dImQ3n);
2295
2296 // Im[Q_{3n} Q_{n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2297 //Double_t imQ3nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
2298 // * (-dReQ2n*dReQ3n*dImQ1n-dReQ1n*dReQ3n*dImQ2n+dReQ1n*dReQ2n*dImQ3n-dImQ1n*dImQ2n*dImQ3n);
2299
2300
2301 // Re[Q_{2n} Q_{2n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2302 Double_t reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)*dReQ2n-2.*dReQ1n*dReQ2n*dImQ1n-dReQ2n*pow(dImQ1n,2.)
2303 + dImQ2n*pow(dReQ1n,2.)+2.*dReQ1n*dImQ1n*dImQ2n-pow(dImQ1n,2.)*dImQ2n)
2304 * (pow(dReQ1n,2.)*dReQ2n+2.*dReQ1n*dReQ2n*dImQ1n-dReQ2n*pow(dImQ1n,2.)
2305 - dImQ2n*pow(dReQ1n,2.)+2.*dReQ1n*dImQ1n*dImQ2n+pow(dImQ1n,2.)*dImQ2n);
2306
2307 // Im[Q_{2n} Q_{2n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2308 //Double_t imQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar = 2.*(pow(dReQ1n,2.)*dReQ2n-dReQ2n*pow(dImQ1n,2.)
2309 // + 2.*dReQ1n*dImQ1n*dImQ2n)*(pow(dReQ1n,2.)*dImQ2n
2310 // - 2.*dReQ1n*dImQ1n*dReQ2n-pow(dImQ1n,2.)*dImQ2n);
2311
2312 // Re[Q_{3n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2313 Double_t reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
2314 * (pow(dReQ1n,3.)*dReQ3n-3.*dReQ1n*dReQ3n*pow(dImQ1n,2.)
2315 + 3.*pow(dReQ1n,2.)*dImQ1n*dImQ3n-pow(dImQ1n,3.)*dImQ3n);
2316
2317 // Im[Q_{3n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2318 //Double_t imQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
2319 // * (pow(dImQ1n,3.)*dReQ3n-3.*dImQ1n*dReQ3n*pow(dReQ1n,2.)
2320 // - 3.*pow(dImQ1n,2.)*dReQ1n*dImQ3n+pow(dReQ1n,3.)*dImQ3n);
2321
2322 // |Q_{2n}|^2 |Q_{n}|^4
2323 Double_t dQ2nQ1nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))*pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.);
2324
2325 // Re[Q_{2n} Q_{n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2326 Double_t reQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
2327 * (pow(dReQ1n,2.)*dReQ2n-dReQ2n*pow(dImQ1n,2.)
2328 + 2.*dReQ1n*dImQ1n*dImQ2n);
2329
2330 // Im[Q_{2n} Q_{n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2331 //Double_t imQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
2332 // * (pow(dReQ1n,2.)*dImQ2n-dImQ2n*pow(dImQ1n,2.)
2333 // - 2.*dReQ1n*dReQ2n*dImQ1n);
2334
2335
2336
2337
2338 // **************************************
2339 // **** multi-particle correlations: ****
2340 // **************************************
2341 //
2342 // Remark 1: multi-particle correlations calculated with non-weighted Q-vectors are stored in 1D profile fQCorrelations[0]. // to be improved (wrong profiles)
2343 // Remark 2: binning of fQCorrelations[0] is organized as follows: // to be improved (wrong profiles)
2344 // --------------------------------------------------------------------------------------------------------------------
2345 // 1st bin: <2>_{1n|1n} = two1n1n = cos(n*(phi1-phi2))>
2346 // 2nd bin: <2>_{2n|2n} = two2n2n = cos(2n*(phi1-phi2))>
2347 // 3rd bin: <2>_{3n|3n} = two3n3n = cos(3n*(phi1-phi2))>
2348 // 4th bin: <2>_{4n|4n} = two4n4n = cos(4n*(phi1-phi2))>
2349 // 5th bin: ---- EMPTY ----
2350 // 6th bin: <3>_{2n|1n,1n} = three2n1n1n = <cos(n*(2.*phi1-phi2-phi3))>
2351 // 7th bin: <3>_{3n|2n,1n} = three3n2n1n = <cos(n*(3.*phi1-2.*phi2-phi3))>
2352 // 8th bin: <3>_{4n|2n,2n} = three4n2n2n = <cos(n*(4.*phi1-2.*phi2-2.*phi3))>
2353 // 9th bin: <3>_{4n|3n,1n} = three4n3n1n = <cos(n*(4.*phi1-3.*phi2-phi3))>
2354 // 10th bin: ---- EMPTY ----
2355 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1n = <cos(n*(phi1+phi2-phi3-phi4))>
2356 // 12th bin: <4>_{2n,1n|2n,1n} = four2n1n2n1n = <cos(2.*n*(phi1+phi2-phi3-phi4))>
2357 // 13th bin: <4>_{2n,2n|2n,2n} = four2n2n2n2n = <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>
2358 // 14th bin: <4>_{3n|1n,1n,1n} = four3n1n1n1n = <cos(n*(3.*phi1-phi2-phi3-phi4))>
2359 // 15th bin: <4>_{3n,1n|3n,1n} = four3n1n3n1n = <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>
2360 // 16th bin: <4>_{3n,1n|2n,2n} = four3n1n2n2n = <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>
2361 // 17th bin: <4>_{4n|2n,1n,1n} = four4n2n1n1n = <cos(n*(3.*phi1+phi2-3.*phi3-phi4))>
2362 // 18th bin: ---- EMPTY ----
2363 // 19th bin: <5>_{2n|1n,1n,1n,1n} = five2n1n1n1n1n = <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>
2364 // 20th bin: <5>_{2n,2n|2n,1n,1n} = five2n2n2n1n1n = <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>
2365 // 21st bin: <5>_{3n,1n|2n,1n,1n} = five3n1n2n1n1n = <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>
2366 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = five4n1n1n1n1n = <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>
2367 // 23rd bin: ---- EMPTY ----
2368 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = six1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
2369 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = six2n1n1n2n1n1n = <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>
2370 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = six2n2n1n1n1n1n = <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>
2371 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = six3n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>
2372 // 28th bin: ---- EMPTY ----
2373 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = seven2n1n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
2374 // 30th bin: ---- EMPTY ----
2375 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = eight1n1n1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
2376 // --------------------------------------------------------------------------------------------------------------------
2377
2378 // 2-particle:
2379 Double_t two1n1n = 0.; // <cos(n*(phi1-phi2))>
2380 Double_t two2n2n = 0.; // <cos(2n*(phi1-phi2))>
2381 Double_t two3n3n = 0.; // <cos(3n*(phi1-phi2))>
2382 Double_t two4n4n = 0.; // <cos(4n*(phi1-phi2))>
2383
2384 if(dMult>1)
2385 {
2386 two1n1n = (pow(dReQ1n,2.)+pow(dImQ1n,2.)-dMult)/(dMult*(dMult-1.));
2387 two2n2n = (pow(dReQ2n,2.)+pow(dImQ2n,2.)-dMult)/(dMult*(dMult-1.));
2388 two3n3n = (pow(dReQ3n,2.)+pow(dImQ3n,2.)-dMult)/(dMult*(dMult-1.));
2389 two4n4n = (pow(dReQ4n,2.)+pow(dImQ4n,2.)-dMult)/(dMult*(dMult-1.));
2390
2391 // average 2-particle correlations for single event:
2392 fIntFlowCorrelationsAllEBE->SetBinContent(1,two1n1n);
2393 fIntFlowCorrelationsAllEBE->SetBinContent(2,two2n2n);
2394 fIntFlowCorrelationsAllEBE->SetBinContent(3,two3n3n);
2395 fIntFlowCorrelationsAllEBE->SetBinContent(4,two4n4n);
2396
2397 // average 2-particle correlations for all events:
2398 fIntFlowCorrelationsAllPro->Fill(0.5,two1n1n,dMult*(dMult-1.));
2399 fIntFlowCorrelationsAllPro->Fill(1.5,two2n2n,dMult*(dMult-1.));
2400 fIntFlowCorrelationsAllPro->Fill(2.5,two3n3n,dMult*(dMult-1.));
2401 fIntFlowCorrelationsAllPro->Fill(3.5,two4n4n,dMult*(dMult-1.));
2402
2403 // store separetately <2> (to be improved: do I really need this?)
2404 fIntFlowCorrelationsEBE->SetBinContent(1,two1n1n); // <2>
2405
2406 // to be improved (this can be implemented better):
2407 Double_t mWeight2p = 0.;
2408 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
2409 {
2410 mWeight2p = dMult*(dMult-1.);
2411 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
2412 {
2413 mWeight2p = 1.;
2414 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2415 {
2416 mWeight2p = dMult;
2417 }
2418
2419 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(1,mWeight2p); // eW_<2>
2420 fIntFlowCorrelationsPro->Fill(0.5,two1n1n,mWeight2p);
ff70ca91 2421 fIntFlowCorrelationsVsMPro[0]->Fill(dMult+0.5,two1n1n,mWeight2p);
489d5531 2422
2423 // distribution of <cos(n*(phi1-phi2))>:
2424 //f2pDistribution->Fill(two1n1n,dMult*(dMult-1.));
2425 } // end of if(dMult>1)
2426
2427 // 3-particle:
2428 Double_t three2n1n1n = 0.; // <cos(n*(2.*phi1-phi2-phi3))>
2429 Double_t three3n2n1n = 0.; // <cos(n*(3.*phi1-2.*phi2-phi3))>
2430 Double_t three4n2n2n = 0.; // <cos(n*(4.*phi1-2.*phi2-2.*phi3))>
2431 Double_t three4n3n1n = 0.; // <cos(n*(4.*phi1-3.*phi2-phi3))>
2432
2433 if(dMult>2)
2434 {
2435 three2n1n1n = (reQ2nQ1nstarQ1nstar-2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
2436 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))+2.*dMult)
2437 / (dMult*(dMult-1.)*(dMult-2.));
2438 three3n2n1n = (reQ3nQ2nstarQ1nstar-(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2439 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))
2440 - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)
2441 / (dMult*(dMult-1.)*(dMult-2.));
2442 three4n2n2n = (reQ4nQ2nstarQ2nstar-2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2443 - (pow(dReQ4n,2.)+pow(dImQ4n,2.))+2.*dMult)
2444 / (dMult*(dMult-1.)*(dMult-2.));
2445 three4n3n1n = (reQ4nQ3nstarQ1nstar-(pow(dReQ4n,2.)+pow(dImQ4n,2.))
2446 - (pow(dReQ3n,2.)+pow(dImQ3n,2.))
2447 - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)
2448 / (dMult*(dMult-1.)*(dMult-2.));
2449
2450 // average 3-particle correlations for single event:
2451 fIntFlowCorrelationsAllEBE->SetBinContent(6,three2n1n1n);
2452 fIntFlowCorrelationsAllEBE->SetBinContent(7,three3n2n1n);
2453 fIntFlowCorrelationsAllEBE->SetBinContent(8,three4n2n2n);
2454 fIntFlowCorrelationsAllEBE->SetBinContent(9,three4n3n1n);
2455
2456 // average 3-particle correlations for all events:
2457 fIntFlowCorrelationsAllPro->Fill(5.5,three2n1n1n,dMult*(dMult-1.)*(dMult-2.));
2458 fIntFlowCorrelationsAllPro->Fill(6.5,three3n2n1n,dMult*(dMult-1.)*(dMult-2.));
2459 fIntFlowCorrelationsAllPro->Fill(7.5,three4n2n2n,dMult*(dMult-1.)*(dMult-2.));
2460 fIntFlowCorrelationsAllPro->Fill(8.5,three4n3n1n,dMult*(dMult-1.)*(dMult-2.));
2461 } // end of if(dMult>2)
2462
2463 // 4-particle:
2464 Double_t four1n1n1n1n = 0.; // <cos(n*(phi1+phi2-phi3-phi4))>
2465 Double_t four2n2n2n2n = 0.; // <cos(2.*n*(phi1+phi2-phi3-phi4))>
2466 Double_t four2n1n2n1n = 0.; // <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>
2467 Double_t four3n1n1n1n = 0.; // <cos(n*(3.*phi1-phi2-phi3-phi4))>
2468 Double_t four4n2n1n1n = 0.; // <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>
2469 Double_t four3n1n2n2n = 0.; // <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>
2470 Double_t four3n1n3n1n = 0.; // <cos(n*(3.*phi1+phi2-3.*phi3-phi4))>
2471
2472 if(dMult>3)
2473 {
2474 four1n1n1n1n = (2.*dMult*(dMult-3.)+pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)-4.*(dMult-2.)*(pow(dReQ1n,2.)
2475 + pow(dImQ1n,2.))-2.*reQ2nQ1nstarQ1nstar+(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
2476 / (dMult*(dMult-1)*(dMult-2.)*(dMult-3.));
2477 four2n2n2n2n = (2.*dMult*(dMult-3.)+pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)-4.*(dMult-2.)*(pow(dReQ2n,2.)
2478 + pow(dImQ2n,2.))-2.*reQ4nQ2nstarQ2nstar+(pow(dReQ4n,2.)+pow(dImQ4n,2.)))
2479 / (dMult*(dMult-1)*(dMult-2.)*(dMult-3.));
2480 four2n1n2n1n = (dQ2nQ1nQ2nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar-2.*reQ2nQ1nstarQ1nstar)
2481 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2482 - ((dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
2483 + (dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-(pow(dReQ3n,2.)+pow(dImQ3n,2.)))
2484 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2485 + (dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.));
2486 four3n1n1n1n = (reQ3nQ1nstarQ1nstarQ1nstar-3.*reQ3nQ2nstarQ1nstar-3.*reQ2nQ1nstarQ1nstar)
2487 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2488 + (2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+3.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2489 + 6.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-6.*dMult)
2490 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2491 four4n2n1n1n = (reQ4nQ2nstarQ1nstarQ1nstar-2.*reQ4nQ3nstarQ1nstar-reQ4nQ2nstarQ2nstar-2.*reQ3nQ2nstarQ1nstar)
2492 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2493 - (reQ2nQ1nstarQ1nstar-2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2494 - 3.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2495 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2496 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
2497 four3n1n2n2n = (reQ3nQ1nQ2nstarQ2nstar-reQ4nQ2nstarQ2nstar-reQ3nQ1nQ4nstar-2.*reQ3nQ2nstarQ1nstar)
2498 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2499 - (2.*reQ1nQ1nQ2nstar-(pow(dReQ4n,2.)+pow(dImQ4n,2.))-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2500 - 4.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2501 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2502 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
2503 four3n1n3n1n = ((pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
2504 - 2.*reQ4nQ3nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar)
2505 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2506 + ((pow(dReQ4n,2.)+pow(dImQ4n,2.))-(dMult-4.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2507 + (pow(dReQ2n,2.)+pow(dImQ2n,2.))-(dMult-4.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2508 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2509 + (dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.));
2510
2511 // average 4-particle correlations for single event:
2512 fIntFlowCorrelationsAllEBE->SetBinContent(11,four1n1n1n1n);
2513 fIntFlowCorrelationsAllEBE->SetBinContent(12,four2n1n2n1n);
2514 fIntFlowCorrelationsAllEBE->SetBinContent(13,four2n2n2n2n);
2515 fIntFlowCorrelationsAllEBE->SetBinContent(14,four3n1n1n1n);
2516 fIntFlowCorrelationsAllEBE->SetBinContent(15,four3n1n3n1n);
2517 fIntFlowCorrelationsAllEBE->SetBinContent(16,four3n1n2n2n);
2518 fIntFlowCorrelationsAllEBE->SetBinContent(17,four4n2n1n1n);
2519
2520 // average 4-particle correlations for all events:
2521 fIntFlowCorrelationsAllPro->Fill(10.5,four1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2522 fIntFlowCorrelationsAllPro->Fill(11.5,four2n1n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2523 fIntFlowCorrelationsAllPro->Fill(12.5,four2n2n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2524 fIntFlowCorrelationsAllPro->Fill(13.5,four3n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2525 fIntFlowCorrelationsAllPro->Fill(14.5,four3n1n3n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2526 fIntFlowCorrelationsAllPro->Fill(15.5,four3n1n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2527 fIntFlowCorrelationsAllPro->Fill(16.5,four4n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2528
2529 // store separetately <4> (to be improved: do I really need this?)
2530 fIntFlowCorrelationsEBE->SetBinContent(2,four1n1n1n1n); // <4>
2531
2532 // to be improved (this can be implemented better):
2533 Double_t mWeight4p = 0.;
2534 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
2535 {
2536 mWeight4p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.);
2537 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
2538 {
2539 mWeight4p = 1.;
2540 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2541 {
2542 mWeight4p = dMult;
2543 }
2544
2545 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(2,mWeight4p); // eW_<4>
2546 fIntFlowCorrelationsPro->Fill(1.5,four1n1n1n1n,mWeight4p);
ff70ca91 2547 fIntFlowCorrelationsVsMPro[1]->Fill(dMult+0.5,four1n1n1n1n,mWeight4p);
489d5531 2548
2549 // distribution of <cos(n*(phi1+phi2-phi3-phi4))>
2550 //f4pDistribution->Fill(four1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2551
2552 } // end of if(dMult>3)
2553
2554 // 5-particle:
2555 Double_t five2n1n1n1n1n = 0.; // <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>
2556 Double_t five2n2n2n1n1n = 0.; // <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>
2557 Double_t five3n1n2n1n1n = 0.; // <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>
2558 Double_t five4n1n1n1n1n = 0.; // <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>
2559
2560 if(dMult>4)
2561 {
2562 five2n1n1n1n1n = (reQ2nQ1nQ1nstarQ1nstarQ1nstar-reQ3nQ1nstarQ1nstarQ1nstar+6.*reQ3nQ2nstarQ1nstar)
2563 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2564 - (reQ2nQ1nQ3nstar+3.*(dMult-6.)*reQ2nQ1nstarQ1nstar+3.*reQ1nQ1nQ2nstar)
2565 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2566 - (2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2567 + 3.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2568 - 3.*(dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
2569 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2570 - 3.*(pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
2571 - 2.*(2*dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult*(dMult-4.))
2572 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2573
2574 five2n2n2n1n1n = (reQ2nQ2nQ2nstarQ1nstarQ1nstar-reQ4nQ2nstarQ1nstarQ1nstar-2.*reQ2nQ2nQ3nstarQ1nstar)
2575 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2576 + 2.*(reQ4nQ2nstarQ2nstar+4.*reQ3nQ2nstarQ1nstar+reQ3nQ1nQ4nstar)
2577 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2578 + (reQ2nQ2nQ4nstar-2.*(dMult-5.)*reQ2nQ1nstarQ1nstar+2.*reQ1nQ1nQ2nstar)
2579 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2580 - (2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+4.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2581 + 1.*pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)
2582 - 2.*(3.*dMult-10.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
2583 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2584 - (4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2585 - 4.*(dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))+4.*dMult*(dMult-6.))
2586 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2587
2588 five4n1n1n1n1n = (reQ4nQ1nstarQ1nstarQ1nstarQ1nstar-6.*reQ4nQ2nstarQ1nstarQ1nstar-4.*reQ3nQ1nstarQ1nstarQ1nstar)
2589 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2590 + (8.*reQ4nQ3nstarQ1nstar+3.*reQ4nQ2nstarQ2nstar+12.*reQ3nQ2nstarQ1nstar+12.*reQ2nQ1nstarQ1nstar)
2591 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2592 - (6.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+8.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2593 + 12.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))+24.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-24.*dMult)
2594 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2595
2596 five3n1n2n1n1n = (reQ3nQ1nQ2nstarQ1nstarQ1nstar-reQ4nQ2nstarQ1nstarQ1nstar-reQ3nQ1nstarQ1nstarQ1nstar)
2597 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2598 - (reQ3nQ1nQ2nstarQ2nstar-3.*reQ4nQ3nstarQ1nstar-reQ4nQ2nstarQ2nstar)
2599 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2600 - ((2.*dMult-13.)*reQ3nQ2nstarQ1nstar-reQ3nQ1nQ4nstar-9.*reQ2nQ1nstarQ1nstar)
2601 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2602 - (2.*reQ1nQ1nQ2nstar+2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
2603 - 2.*(dMult-5.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+2.*(pow(dReQ3n,2.)
2604 + pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2605 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2606 + (2.*(dMult-6.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2607 - 2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
2608 - pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
2609 + 2.*(3.*dMult-11.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2610 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2611 - 4.*(dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2612
2613 // average 5-particle correlations for single event:
2614 fIntFlowCorrelationsAllEBE->SetBinContent(19,five2n1n1n1n1n);
2615 fIntFlowCorrelationsAllEBE->SetBinContent(20,five2n2n2n1n1n);
2616 fIntFlowCorrelationsAllEBE->SetBinContent(21,five3n1n2n1n1n);
2617 fIntFlowCorrelationsAllEBE->SetBinContent(22,five4n1n1n1n1n);
2618
2619 // average 5-particle correlations for all events:
2620 fIntFlowCorrelationsAllPro->Fill(18.5,five2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2621 fIntFlowCorrelationsAllPro->Fill(19.5,five2n2n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2622 fIntFlowCorrelationsAllPro->Fill(20.5,five3n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2623 fIntFlowCorrelationsAllPro->Fill(21.5,five4n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2624 } // end of if(dMult>4)
2625
2626 // 6-particle:
2627 Double_t six1n1n1n1n1n1n = 0.; // <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
2628 Double_t six2n2n1n1n1n1n = 0.; // <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>
2629 Double_t six3n1n1n1n1n1n = 0.; // <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>
2630 Double_t six2n1n1n2n1n1n = 0.; // <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>
2631
2632 if(dMult>5)
2633 {
2634 six1n1n1n1n1n1n = (pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),3.)+9.*dQ2nQ1nQ2nstarQ1nstar-6.*reQ2nQ1nQ1nstarQ1nstarQ1nstar)
2635 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))
2636 + 4.*(reQ3nQ1nstarQ1nstarQ1nstar-3.*reQ3nQ2nstarQ1nstar)
2637 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))
2638 + 2.*(9.*(dMult-4.)*reQ2nQ1nstarQ1nstar+2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.)))
2639 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))
2640 - 9.*(pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)+(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
2641 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-5.))
2642 + (18.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2643 / (dMult*(dMult-1)*(dMult-3)*(dMult-4))
2644 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
2645
2646 six2n1n1n2n1n1n = (dQ2nQ1nQ1nQ2nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)
2647 * (2.*five2n2n2n1n1n+4.*five2n1n1n1n1n+4.*five3n1n2n1n1n+4.*four2n1n2n1n+1.*four1n1n1n1n)
2648 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four1n1n1n1n+4.*two1n1n
2649 + 2.*three2n1n1n+2.*three2n1n1n+4.*four3n1n1n1n+8.*three2n1n1n+2.*four4n2n1n1n
2650 + 4.*four2n1n2n1n+2.*two2n2n+8.*four2n1n2n1n+4.*four3n1n3n1n+8.*three3n2n1n
2651 + 4.*four3n1n2n2n+4.*four1n1n1n1n+4.*four2n1n2n1n+1.*four2n2n2n2n)
2652 - dMult*(dMult-1.)*(dMult-2.)*(2.*three2n1n1n+8.*two1n1n+4.*two1n1n+2.
2653 + 4.*two1n1n+4.*three2n1n1n+2.*two2n2n+4.*three2n1n1n+8.*three3n2n1n
2654 + 8.*two2n2n+4.*three4n3n1n+4.*two3n3n+4.*three3n2n1n+4.*two1n1n
2655 + 8.*three2n1n1n+4.*two1n1n+4.*three3n2n1n+4.*three2n1n1n+2.*two2n2n
2656 + 4.*three3n2n1n+2.*three4n2n2n)-dMult*(dMult-1.)
2657 * (4.*two1n1n+4.+4.*two1n1n+2.*two2n2n+1.+4.*two1n1n+4.*two2n2n+4.*two3n3n
2658 + 1.+2.*two2n2n+1.*two4n4n)-dMult)
2659 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)
2660
2661 six2n2n1n1n1n1n = (reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)
2662 * (five4n1n1n1n1n+8.*five2n1n1n1n1n+6.*five2n2n2n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)
2663 * (4.*four3n1n1n1n+6.*four4n2n1n1n+12.*three2n1n1n+12.*four1n1n1n1n+24.*four2n1n2n1n
2664 + 4.*four3n1n2n2n+3.*four2n2n2n2n)-dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+12.*three3n2n1n
2665 + 4.*three4n3n1n+3.*three4n2n2n+8.*three2n1n1n+24.*two1n1n+12.*two2n2n+12.*three2n1n1n+8.*three3n2n1n
2666 + 1.*three4n2n2n)-dMult*(dMult-1.)*(4.*two1n1n+6.*two2n2n+4.*two3n3n+1.*two4n4n+2.*two2n2n+8.*two1n1n+6.)-dMult)
2667 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)
2668
2669 six3n1n1n1n1n1n = (reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)
2670 * (five4n1n1n1n1n+4.*five2n1n1n1n1n+6.*five3n1n2n1n1n+4.*four3n1n1n1n)
2671 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four3n1n1n1n+6.*four4n2n1n1n+6.*four1n1n1n1n
2672 + 12.*three2n1n1n+12.*four2n1n2n1n+6.*four3n1n1n1n+12.*three3n2n1n+4.*four3n1n3n1n+3.*four3n1n2n2n)
2673 - dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+12.*three3n2n1n+4.*three4n3n1n+3.*three4n2n2n+4.*two1n1n
2674 + 12.*two1n1n+6.*three2n1n1n+12.*three2n1n1n+4.*three3n2n1n+12.*two2n2n+4.*three3n2n1n+4.*two3n3n+1.*three4n3n1n
2675 + 6.*three3n2n1n)-dMult*(dMult-1.)*(4.*two1n1n+6.*two2n2n+4.*two3n3n+1.*two4n4n+1.*two1n1n+4.+6.*two1n1n+4.*two2n2n
2676 + 1.*two3n3n)-dMult)/(dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)
2677
2678 // average 6-particle correlations for single event:
2679 fIntFlowCorrelationsAllEBE->SetBinContent(24,six1n1n1n1n1n1n);
2680 fIntFlowCorrelationsAllEBE->SetBinContent(25,six2n1n1n2n1n1n);
2681 fIntFlowCorrelationsAllEBE->SetBinContent(26,six2n2n1n1n1n1n);
2682 fIntFlowCorrelationsAllEBE->SetBinContent(27,six3n1n1n1n1n1n);
2683
2684 // average 6-particle correlations for all events:
2685 fIntFlowCorrelationsAllPro->Fill(23.5,six1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2686 fIntFlowCorrelationsAllPro->Fill(24.5,six2n1n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2687 fIntFlowCorrelationsAllPro->Fill(25.5,six2n2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2688 fIntFlowCorrelationsAllPro->Fill(26.5,six3n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2689
2690 // store separetately <6> (to be improved: do I really need this?)
2691 fIntFlowCorrelationsEBE->SetBinContent(3,six1n1n1n1n1n1n); // <6>
2692
2693 // to be improved (this can be implemented better):
2694 Double_t mWeight6p = 0.;
2695 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
2696 {
2697 mWeight6p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.);
2698 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
2699 {
2700 mWeight6p = 1.;
2701 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2702 {
2703 mWeight6p = dMult;
2704 }
2705
2706 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(3,mWeight6p); // eW_<6>
2707 fIntFlowCorrelationsPro->Fill(2.5,six1n1n1n1n1n1n,mWeight6p);
ff70ca91 2708 fIntFlowCorrelationsVsMPro[2]->Fill(dMult+0.5,six1n1n1n1n1n1n,mWeight6p);
489d5531 2709
2710 // distribution of <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
2711 //f6pDistribution->Fill(six1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2712 } // end of if(dMult>5)
2713
2714 // 7-particle:
2715 Double_t seven2n1n1n1n1n1n1n = 0.; // <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
2716
2717 if(dMult>6)
2718 {
2719 seven2n1n1n1n1n1n1n = (reQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)
2720 * (2.*six3n1n1n1n1n1n+4.*six1n1n1n1n1n1n+1.*six2n2n1n1n1n1n+6.*six2n1n1n2n1n1n+8.*five2n1n1n1n1n)
2721 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(1.*five4n1n1n1n1n +8.*five2n1n1n1n1n+8.*four3n1n1n1n
2722 + 12.*five3n1n2n1n1n+4.*five2n1n1n1n1n+3.*five2n2n2n1n1n+6.*five2n2n2n1n1n+6.*four1n1n1n1n+24.*four1n1n1n1n
2723 + 12.*five2n1n1n1n1n+12.*five2n1n1n1n1n+12.*three2n1n1n+24.*four2n1n2n1n+4.*five3n1n2n1n1n+4.*five2n1n1n1n1n)
2724 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four3n1n1n1n+6.*four4n2n1n1n+12.*four1n1n1n1n+24.*three2n1n1n
2725 + 24.*four2n1n2n1n+12.*four3n1n1n1n+24.*three3n2n1n+8.*four3n1n3n1n+6.*four3n1n2n2n+6.*three2n1n1n+12.*four1n1n1n1n
2726 + 12.*four2n1n2n1n+6.*three2n1n1n+12.*four2n1n2n1n+4.*four3n1n2n2n+3.*four2n2n2n2n+4.*four1n1n1n1n+6.*three2n1n1n
2727 + 24.*two1n1n+24.*four1n1n1n1n+4.*four3n1n1n1n+24.*two1n1n+24.*three2n1n1n+12.*two2n2n+24.*three2n1n1n+12.*four2n1n2n1n
2728 + 8.*three3n2n1n+8.*four2n1n2n1n+1.*four4n2n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+1.*three2n1n1n+8.*two1n1n
2729 + 12.*three3n2n1n+24.*two1n1n+12.*three2n1n1n+4.*three2n1n1n+8.*two1n1n+4.*three4n3n1n+24.*three2n1n1n+8.*three3n2n1n
2730 + 12.*two1n1n+12.*two1n1n+3.*three4n2n2n+24.*two2n2n+6.*two2n2n+12.+12.*three3n2n1n+8.*two3n3n+12.*three2n1n1n+24.*two1n1n
2731 + 4.*three3n2n1n+8.*three3n2n1n+2.*three4n3n1n+12.*two1n1n+8.*three2n1n1n+4.*three2n1n1n+2.*three3n2n1n+6.*two2n2n+8.*two2n2n
2732 + 1.*three4n2n2n+4.*three3n2n1n+6.*three2n1n1n)-dMult*(dMult-1.)*(4.*two1n1n+2.*two1n1n+6.*two2n2n+8.+1.*two2n2n+4.*two3n3n
2733 + 12.*two1n1n+4.*two1n1n+1.*two4n4n+8.*two2n2n+6.+2.*two3n3n+4.*two1n1n+1.*two2n2n)-dMult)
2734 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)); // to be improved (direct formula needed)
2735
2736 // average 7-particle correlations for single event:
2737 fIntFlowCorrelationsAllEBE->SetBinContent(29,seven2n1n1n1n1n1n1n);
2738
2739 // average 7-particle correlations for all events:
2740 fIntFlowCorrelationsAllPro->Fill(28.5,seven2n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.));
2741 } // end of if(dMult>6)
2742
2743 // 8-particle:
2744 Double_t eight1n1n1n1n1n1n1n1n = 0.; // <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
2745 if(dMult>7)
2746 {
2747 eight1n1n1n1n1n1n1n1n = (pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),4.)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)
2748 * (12.*seven2n1n1n1n1n1n1n+16.*six1n1n1n1n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)
2749 * (8.*six3n1n1n1n1n1n+48.*six1n1n1n1n1n1n+6.*six2n2n1n1n1n1n+96.*five2n1n1n1n1n+72.*four1n1n1n1n+36.*six2n1n1n2n1n1n)
2750 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(2.*five4n1n1n1n1n+32.*five2n1n1n1n1n+36.*four1n1n1n1n
2751 + 32.*four3n1n1n1n+48.*five2n1n1n1n1n+48.*five3n1n2n1n1n+144.*five2n1n1n1n1n+288.*four1n1n1n1n+36.*five2n2n2n1n1n
2752 + 144.*three2n1n1n+96.*two1n1n+144.*four2n1n2n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)
2753 * (8.*four3n1n1n1n+48.*four1n1n1n1n+12.*four4n2n1n1n+96.*four2n1n2n1n+96.*three2n1n1n+72.*three2n1n1n+144.*two1n1n
2754 + 16.*four3n1n3n1n+48.*four3n1n1n1n+144.*four1n1n1n1n+72.*four1n1n1n1n+96.*three3n2n1n+24.*four3n1n2n2n+144.*four2n1n2n1n
2755 + 288.*two1n1n+288.*three2n1n1n+9.*four2n2n2n2n+72.*two2n2n+24.)-dMult*(dMult-1.)*(dMult-2.)*(12.*three2n1n1n+16.*two1n1n
2756 + 24.*three3n2n1n+48.*three2n1n1n+96.*two1n1n+8.*three4n3n1n+32.*three3n2n1n+96.*three2n1n1n+144.*two1n1n+6.*three4n2n2n
2757 + 96.*two2n2n+36.*two2n2n+72.+48.*three3n2n1n+16.*two3n3n+72.*three2n1n1n+144.*two1n1n)-dMult*(dMult-1.)*(8.*two1n1n
2758 + 12.*two2n2n+16.+8.*two3n3n+48.*two1n1n+1.*two4n4n+16.*two2n2n+18.)-dMult)
2759 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.)); // to be improved (direct formula needed)
2760
2761 // average 8-particle correlations for single event:
2762 fIntFlowCorrelationsAllEBE->SetBinContent(31,eight1n1n1n1n1n1n1n1n);
2763
2764 // average 8-particle correlations for all events:
2765 fIntFlowCorrelationsAllPro->Fill(30.5,eight1n1n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.));
2766
2767 // store separetately <8> (to be improved: do I really need this?)
2768 fIntFlowCorrelationsEBE->SetBinContent(4,eight1n1n1n1n1n1n1n1n); // <8>
2769
2770 // to be improved (this can be implemented better):
2771 Double_t mWeight8p = 0.;
2772 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
2773 {
2774 mWeight8p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.);
2775 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
2776 {
2777 mWeight8p = 1.;
2778 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2779 {
2780 mWeight8p = dMult;
2781 }
2782
2783 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(4,mWeight8p); // eW_<8>
2784 fIntFlowCorrelationsPro->Fill(3.5,eight1n1n1n1n1n1n1n1n,mWeight8p);
ff70ca91 2785 fIntFlowCorrelationsVsMPro[3]->Fill(dMult+0.5,eight1n1n1n1n1n1n1n1n,mWeight8p);
489d5531 2786
2787 // distribution of <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
2788 //f8pDistribution->Fill(eight1n1n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.));
2789 } // end of if(dMult>7)
2790
2791} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelations()
2792
2793
2794//================================================================================================================================
2795
2796
2797void AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrelations()
2798{
0328db2d 2799 // Calculate averages of products of correlations for integrated flow.
489d5531 2800
ff70ca91 2801 // multiplicity:
2802 Double_t dMult = (*fSMpk)(0,0);
2803
489d5531 2804 Int_t counter = 0;
2805
2806 for(Int_t ci1=1;ci1<4;ci1++)
2807 {
2808 for(Int_t ci2=ci1+1;ci2<=4;ci2++)
2809 {
ff70ca91 2810 fIntFlowProductOfCorrelationsPro->Fill(0.5+counter,
2811 fIntFlowCorrelationsEBE->GetBinContent(ci1)*
2812 fIntFlowCorrelationsEBE->GetBinContent(ci2),
2813 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
2814 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
2815 // products versus multiplicity: // [0=<<2><4>>,1=<<2><6>>,2=<<2><8>>,3=<<4><6>>,4=<<4><8>>,5=<<6><8>>]
2816 fIntFlowProductOfCorrelationsVsMPro[counter]->Fill(dMult+0.5,
2817 fIntFlowCorrelationsEBE->GetBinContent(ci1)*
2818 fIntFlowCorrelationsEBE->GetBinContent(ci2),
2819 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
2820 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
2821 counter++;
489d5531 2822 }
2823 }
2824
2825} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrelations()
2826
2827
2828//================================================================================================================================
2829
2830
0328db2d 2831void AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrectionTermsForNUA()
2832{
2833 // Calculate averages of products of correction terms for NUA.
2834
2835 // a) Binning of fIntFlowProductOfCorrectionTermsForNUAPro is organized as follows:
2836 // 1st bin: <<2><cos(phi)>>
2837 // 2nd bin: <<2><sin(phi)>>
2838 // 3rd bin: <<cos(phi)><sin(phi)>>
2839 // 4th bin: <<2><cos(phi1+phi2)>>
2840 // 5th bin: <<2><sin(phi1+phi2)>>
2841 // 6th bin: <<2><cos(phi1-phi2-phi3)>>
2842 // 7th bin: <<2><sin(phi1-phi2-phi3)>>
2843 // 8th bin: <<4><cos(phi1)>>
2844 // 9th bin: <<4><sin(phi1)>>
2845 // 10th bin: <<4><cos(phi1+phi2)>>
2846 // 11th bin: <<4><sin(phi1+phi2)>>
2847 // 12th bin: <<4><cos(phi1-phi2-phi3)>>
2848 // 13th bin: <<4><sin(phi1-phi2-phi3)>>
2849 // 14th bin: <<cos(phi1)><cos(phi1+phi2)>>
2850 // 15th bin: <<cos(phi1)><sin(phi1+phi2)>>
2851 // 16th bin: <<cos(phi1)><cos(phi1-phi2-phi3)>>
2852 // 17th bin: <<cos(phi1)><sin(phi1-phi2-phi3)>>
2853 // 18th bin: <<sin(phi1)><cos(phi1+phi2)>>
2854 // 19th bin: <<sin(phi1)><sin(phi1+phi2)>>
2855 // 20th bin: <<sin(phi1)><cos(phi1-phi2-phi3)>>
2856 // 21st bin: <<sin(phi1)><sin(phi1-phi2-phi3)>>
2857 // 22nd bin: <<cos(phi1+phi2)><sin(phi1+phi2)>>
2858 // 23rd bin: <<cos(phi1+phi2)><cos(phi1-phi2-phi3)>>
2859 // 24th bin: <<cos(phi1+phi2)><sin(phi1-phi2-phi3)>>
2860 // 25th bin: <<sin(phi1+phi2)><cos(phi1-phi2-phi3)>>
2861 // 26th bin: <<sin(phi1+phi2)><sin(phi1-phi2-phi3)>>
2862 // 27th bin: <<cos(phi1-phi2-phi3)><sin(phi1-phi2-phi3)>>
2863
2864 // <<2><cos(phi)>>:
2865 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(0.5,
2866 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1),
2867 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
2868 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
2869 // <<2><sin(phi)>>:
2870 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(1.5,
2871 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1),
2872 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
2873 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
2874 // <<cos(phi)><sin(phi)>>:
2875 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(2.5,
2876 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1),
2877 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
2878 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
2879 // <<2><cos(phi1+phi2)>>:
2880 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(3.5,
2881 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
2882 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
2883 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
2884 // <<2><sin(phi1+phi2)>>:
2885 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(4.5,
2886 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
2887 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
2888 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
2889 // <<2><cos(phi1-phi2-phi3)>>:
2890 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(5.5,
2891 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
2892 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
2893 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
2894 // <<2><sin(phi1-phi2-phi3)>>:
2895 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(6.5,
2896 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
2897 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
2898 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
2899 // <<4><cos(phi1)>>:
2900 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(7.5,
2901 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1),
2902 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
2903 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
2904 // <<4><sin(phi1)>>:
2905 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(8.5,
2906 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1),
2907 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
2908 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
2909 // <<4><cos(phi1+phi2)>>:
2910 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(9.5,
2911 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
2912 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
2913 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
2914 // <<4><sin(phi1+phi2)>>:
2915 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(10.5,
2916 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
2917 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
2918 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
2919 // <<4><cos(phi1-phi2-phi3)>>:
2920 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(11.5,
2921 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
2922 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
2923 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
2924 // <<4><sin(phi1-phi2-phi3)>>:
2925 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(12.5,
2926 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
2927 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
2928 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
2929 // <<cos(phi1)><cos(phi1+phi2)>>:
2930 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(13.5,
2931 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
2932 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
2933 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
2934 // <<cos(phi1)><sin(phi1+phi2)>>:
2935 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(14.5,
2936 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
2937 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
2938 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
2939 // <<cos(phi1)><cos(phi1-phi2-phi3)>>:
2940 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(15.5,
2941 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
2942 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
2943 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
2944 // <<cos(phi1)><sin(phi1-phi2-phi3)>>:
2945 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(16.5,
2946 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
2947 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
2948 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
2949 // <<sin(phi1)><cos(phi1+phi2)>>:
2950 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(17.5,
2951 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
2952 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
2953 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
2954 // <<sin(phi1)><sin(phi1+phi2)>>:
2955 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(18.5,
2956 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
2957 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
2958 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
2959 // <<sin(phi1)><cos(phi1-phi2-phi3)>>:
2960 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(19.5,
2961 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
2962 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
2963 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
2964 // <<sin(phi1)><sin(phi1-phi2-phi3)>>:
2965 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(20.5,
2966 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
2967 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
2968 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
2969 // <<cos(phi1+phi2)><sin(phi1+phi2)>>:
2970 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(21.5,
2971 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
2972 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)
2973 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
2974 // <<cos(phi1+phi2)><cos(phi1-phi2-phi3)>>:
2975 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(22.5,
2976 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
2977 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)
2978 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
2979 // <<cos(phi1+phi2)><sin(phi1-phi2-phi3)>>:
2980 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(23.5,
2981 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
2982 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)
2983 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
2984 // <<sin(phi1+phi2)><cos(phi1-phi2-phi3)>>:
2985 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(24.5,
2986 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
2987 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)
2988 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
2989 // <<sin(phi1+phi2)><sin(phi1-phi2-phi3)>>:
2990 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(25.5,
2991 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
2992 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)
2993 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
2994 // <<cos(phi1-phi2-phi3)><sin(phi1-phi2-phi3)>>:
2995 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(26.5,
2996 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
2997 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3)
2998 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
2999
3000} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrectionTermsForNUA()
3001
3002
3003//================================================================================================================================
3004
3005
489d5531 3006void AliFlowAnalysisWithQCumulants::CalculateCovariancesIntFlow()
3007{
3008 // a) Calculate unbiased estimators Cov(<2>,<4>), Cov(<2>,<6>), Cov(<2>,<8>), Cov(<4>,<6>), Cov(<4>,<8>) and Cov(<6>,<8>)
3009 // for covariances V_(<2>,<4>), V_(<2>,<6>), V_(<2>,<8>), V_(<4>,<6>), V_(<4>,<8>) and V_(<6>,<8>).
3010 // b) Store in histogram fIntFlowCovariances for instance the following:
3011 //
3012 // 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)]
3013 //
3014 // where N is the number of events, w_{<2>} is event weight for <2> and w_{<4>} is event weight for <4>.
3015 // c) Binning of fIntFlowCovariances is organized as follows:
3016 //
3017 // 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)]
3018 // 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)]
3019 // 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)]
3020 // 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)]
3021 // 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)]
3022 // 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)]
3023
3024 for(Int_t power=0;power<2;power++)
3025 {
3026 if(!(fIntFlowCorrelationsPro && fIntFlowProductOfCorrelationsPro
3027 && fIntFlowSumOfEventWeights[power] && fIntFlowSumOfProductOfEventWeights
3028 && fIntFlowCovariances))
3029 {
3030 cout<<"WARNING: fIntFlowCorrelationsPro && fIntFlowProductOfCorrelationsPro "<<endl;
3031 cout<<" && fIntFlowSumOfEventWeights[power] && fIntFlowSumOfProductOfEventWeights"<<endl;
3032 cout<<" && fIntFlowCovariances is NULL in AFAWQC::FCIF() !!!!"<<endl;
3033 cout<<"power = "<<power<<endl;
3034 exit(0);
3035 }
3036 }
3037
3038 // average 2-, 4-, 6- and 8-particle correlations for all events:
3039 Double_t correlation[4] = {0.};
3040 for(Int_t ci=0;ci<4;ci++)
3041 {
3042 correlation[ci] = fIntFlowCorrelationsPro->GetBinContent(ci+1);
3043 }
3044 // average products of 2-, 4-, 6- and 8-particle correlations:
3045 Double_t productOfCorrelations[4][4] = {{0.}};
3046 Int_t productOfCorrelationsLabel = 1;
3047 // denominators in the expressions for the unbiased estimator for covariance:
3048 Double_t denominator[4][4] = {{0.}};
3049 Int_t sumOfProductOfEventWeightsLabel1 = 1;
3050 // weight dependent prefactor which multiply unbiased estimators for covariances:
3051 Double_t wPrefactor[4][4] = {{0.}};
3052 Int_t sumOfProductOfEventWeightsLabel2 = 1;
3053 for(Int_t c1=0;c1<4;c1++)
3054 {
3055 for(Int_t c2=c1+1;c2<4;c2++)
3056 {
3057 productOfCorrelations[c1][c2] = fIntFlowProductOfCorrelationsPro->GetBinContent(productOfCorrelationsLabel);
3058 if(fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1) && fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1))
3059 {
3060 denominator[c1][c2] = 1.-(fIntFlowSumOfProductOfEventWeights->GetBinContent(sumOfProductOfEventWeightsLabel1))/
3061 (fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1)
3062 * fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1));
3063
3064 wPrefactor[c1][c2] = fIntFlowSumOfProductOfEventWeights->GetBinContent(sumOfProductOfEventWeightsLabel2)/
3065 (fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1)
3066 * fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1));
3067
3068
3069 }
3070 productOfCorrelationsLabel++;
3071 sumOfProductOfEventWeightsLabel1++;
3072 sumOfProductOfEventWeightsLabel2++;
3073 }
3074 }
3075
3076 // covariance label:
3077 Int_t covarianceLabel = 1;
3078 for(Int_t c1=0;c1<4;c1++)
3079 {
3080 for(Int_t c2=c1+1;c2<4;c2++)
3081 {
3082 if(denominator[c1][c2])
3083 {
3084 // covariances:
3085 Double_t cov = (productOfCorrelations[c1][c2]-correlation[c1]*correlation[c2])/denominator[c1][c2];
3086 // covarianced multiplied with weight dependent prefactor:
3087 Double_t wCov = cov * wPrefactor[c1][c2];
3088 fIntFlowCovariances->SetBinContent(covarianceLabel,wCov);
3089 }
3090 covarianceLabel++;
3091 }
3092 }
3093
3094} // end of AliFlowAnalysisWithQCumulants::CalculateCovariancesIntFlow()
3095
3096
3097//================================================================================================================================
3098
3099
0328db2d 3100void AliFlowAnalysisWithQCumulants::CalculateCovariancesNUAIntFlow()
3101{
3102 // a) Calculate unbiased estimators Cov(*,*) for true covariances V_(*,*) for NUA terms.
3103 // b) Store in histogram fIntFlowCovariancesNUA for instance the following:
3104 //
3105 // 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)]
3106 //
3107 // where N is the number of events, w_{<2>} is event weight for <2> and w_{<cos(phi)>} is event weight for <cos(phi)>.
3108 // c) Binning of fIntFlowCovariancesNUA is organized as follows:
3109 //
3110 // 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)]
3111 // 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)]
3112 // 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)]
3113 // ...
3114
3115 // Cov(<2>,<cos(phi)>):
3116 Double_t product1 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(1); // <<2><cos(phi)>>
3117 Double_t term1st1 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3118 Double_t term2nd1 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi)>>
3119 Double_t sumOfW1st1 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3120 Double_t sumOfW2nd1 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi)>}
3121 Double_t sumOfWW1 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(1); // W_{<2>} * W_{<cos(phi)>}
3122 // numerator in the expression for the the unbiased estimator for covariance:
3123 Double_t numerator1 = product1 - term1st1*term2nd1;
3124 // denominator in the expression for the the unbiased estimator for covariance:
3125 Double_t denominator1 = 1.-sumOfWW1/(sumOfW1st1*sumOfW2nd1);
3126 // covariance:
3127 Double_t covariance1 = numerator1/denominator1;
3128 // weight dependent prefactor for covariance:
3129 Double_t wPrefactor1 = sumOfWW1/(sumOfW1st1*sumOfW2nd1);
3130 // finally, store "weighted" covariance:
3131 fIntFlowCovariancesNUA->SetBinContent(1,wPrefactor1*covariance1);
3132
3133 // Cov(<2>,<sin(phi)>):
3134 Double_t product2 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(2); // <<2><sin(phi)>>
3135 Double_t term1st2 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3136 Double_t term2nd2 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi)>>
3137 Double_t sumOfW1st2 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3138 Double_t sumOfW2nd2 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi)>}
3139 Double_t sumOfWW2 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(2); // W_{<2>} * W_{<sin(phi)>}
3140 // numerator in the expression for the the unbiased estimator for covariance:
3141 Double_t numerator2 = product2 - term1st2*term2nd2;
3142 // denominator in the expression for the the unbiased estimator for covariance:
3143 Double_t denominator2 = 1.-sumOfWW2/(sumOfW1st2*sumOfW2nd2);
3144 // covariance:
3145 Double_t covariance2 = numerator2/denominator2;
3146 // weight dependent prefactor for covariance:
3147 Double_t wPrefactor2 = sumOfWW2/(sumOfW1st2*sumOfW2nd2);
3148 // finally, store "weighted" covariance:
3149 fIntFlowCovariancesNUA->SetBinContent(2,wPrefactor2*covariance2);
3150
3151 // Cov(<cos(phi)>,<sin(phi)>):
3152 Double_t product3 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(3); // <<cos(phi)><sin(phi)>>
3153 Double_t term1st3 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi)>>
3154 Double_t term2nd3 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi)>>
3155 Double_t sumOfW1st3 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi)>}
3156 Double_t sumOfW2nd3 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi)>}
3157 Double_t sumOfWW3 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(3); // W_{<cos(phi)>} * W_{<sin(phi)>}
3158 // numerator in the expression for the the unbiased estimator for covariance:
3159 Double_t numerator3 = product3 - term1st3*term2nd3;
3160 // denominator in the expression for the the unbiased estimator for covariance:
3161 Double_t denominator3 = 1.-sumOfWW3/(sumOfW1st3*sumOfW2nd3);
3162 // covariance:
3163 Double_t covariance3 = numerator3/denominator3;
3164 // weight dependent prefactor for covariance:
3165 Double_t wPrefactor3 = sumOfWW3/(sumOfW1st3*sumOfW2nd3);
3166 // finally, store "weighted" covariance:
3167 fIntFlowCovariancesNUA->SetBinContent(3,wPrefactor3*covariance3);
3168
3169 // Cov(<2>,<cos(phi1+phi2)>):
3170 Double_t product4 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(4); // <<2><cos(phi1+phi2)>>
3171 Double_t term1st4 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3172 Double_t term2nd4 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3173 Double_t sumOfW1st4 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3174 Double_t sumOfW2nd4 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3175 Double_t sumOfWW4 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(4); // W_{<2>} * W_{<cos(phi1+phi2)>}
3176 // numerator in the expression for the the unbiased estimator for covariance:
3177 Double_t numerator4 = product4 - term1st4*term2nd4;
3178 // denominator in the expression for the the unbiased estimator for covariance:
3179 Double_t denominator4 = 1.-sumOfWW4/(sumOfW1st4*sumOfW2nd4);
3180 // covariance:
3181 Double_t covariance4 = numerator4/denominator4;
3182 // weight dependent prefactor for covariance:
3183 Double_t wPrefactor4 = sumOfWW4/(sumOfW1st4*sumOfW2nd4);
3184 // finally, store "weighted" covariance:
3185 fIntFlowCovariancesNUA->SetBinContent(4,wPrefactor4*covariance4);
3186
3187 // Cov(<2>,<sin(phi1+phi2)>):
3188 Double_t product5 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(5); // <<2><sin(phi1+phi2)>>
3189 Double_t term1st5 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3190 Double_t term2nd5 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3191 Double_t sumOfW1st5 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3192 Double_t sumOfW2nd5 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3193 Double_t sumOfWW5 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(5); // W_{<2>} * W_{<sin(phi1+phi2)>}
3194 // numerator in the expression for the the unbiased estimator for covariance:
3195 Double_t numerator5 = product5 - term1st5*term2nd5;
3196 // denominator in the expression for the the unbiased estimator for covariance:
3197 Double_t denominator5 = 1.-sumOfWW5/(sumOfW1st5*sumOfW2nd5);
3198 // covariance:
3199 Double_t covariance5 = numerator5/denominator5;
3200 // weight dependent prefactor for covariance:
3201 Double_t wPrefactor5 = sumOfWW5/(sumOfW1st5*sumOfW2nd5);
3202 // finally, store "weighted" covariance:
3203 fIntFlowCovariancesNUA->SetBinContent(5,wPrefactor5*covariance5);
3204
3205 // Cov(<2>,<cos(phi1-phi2-phi3)>):
3206 Double_t product6 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(6); // <<2><cos(phi1-phi2-phi3)>>
3207 Double_t term1st6 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3208 Double_t term2nd6 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3209 Double_t sumOfW1st6 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3210 Double_t sumOfW2nd6 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3211 Double_t sumOfWW6 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(6); // W_{<2>} * W_{<cos(phi1-phi2-phi3)>}
3212 // numerator in the expression for the the unbiased estimator for covariance:
3213 Double_t numerator6 = product6 - term1st6*term2nd6;
3214 // denominator in the expression for the the unbiased estimator for covariance:
3215 Double_t denominator6 = 1.-sumOfWW6/(sumOfW1st6*sumOfW2nd6);
3216 // covariance:
3217 Double_t covariance6 = numerator6/denominator6;
3218 // weight dependent prefactor for covariance:
3219 Double_t wPrefactor6 = sumOfWW6/(sumOfW1st6*sumOfW2nd6);
3220 // finally, store "weighted" covariance:
3221 fIntFlowCovariancesNUA->SetBinContent(6,wPrefactor6*covariance6);
3222
3223 // Cov(<2>,<sin(phi1-phi2-phi3)>):
3224 Double_t product7 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(7); // <<2><sin(phi1-phi2-phi3)>>
3225 Double_t term1st7 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3226 Double_t term2nd7 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3227 Double_t sumOfW1st7 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3228 Double_t sumOfW2nd7 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3229 Double_t sumOfWW7 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(7); // W_{<2>} * W_{<sin(phi1-phi2-phi3)>}
3230 // numerator in the expression for the the unbiased estimator for covariance:
3231 Double_t numerator7 = product7 - term1st7*term2nd7;
3232 // denominator in the expression for the the unbiased estimator for covariance:
3233 Double_t denominator7 = 1.-sumOfWW7/(sumOfW1st7*sumOfW2nd7);
3234 // covariance:
3235 Double_t covariance7 = numerator7/denominator7;
3236 // weight dependent prefactor for covariance:
3237 Double_t wPrefactor7 = sumOfWW7/(sumOfW1st7*sumOfW2nd7);
3238 // finally, store "weighted" covariance:
3239 fIntFlowCovariancesNUA->SetBinContent(7,wPrefactor7*covariance7);
3240
3241 // Cov(<4>,<cos(phi1>):
3242 Double_t product8 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(8); // <<4><cos(phi1)>>
3243 Double_t term1st8 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3244 Double_t term2nd8 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
3245 Double_t sumOfW1st8 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3246 Double_t sumOfW2nd8 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
3247 Double_t sumOfWW8 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(8); // W_{<4>} * W_{<cos(phi1)>}
3248 // numerator in the expression for the the unbiased estimator for covariance:
3249 Double_t numerator8 = product8 - term1st8*term2nd8;
3250 // denominator in the expression for the the unbiased estimator for covariance:
3251 Double_t denominator8 = 1.-sumOfWW8/(sumOfW1st8*sumOfW2nd8);
3252 // covariance:
3253 Double_t covariance8 = numerator8/denominator8;
3254 // weight dependent prefactor for covariance:
3255 Double_t wPrefactor8 = sumOfWW8/(sumOfW1st8*sumOfW2nd8);
3256 // finally, store "weighted" covariance:
3257 fIntFlowCovariancesNUA->SetBinContent(8,wPrefactor8*covariance8);
3258
3259 // Cov(<4>,<sin(phi1)>):
3260 Double_t product9 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(9); // <<4><sin(phi1)>>
3261 Double_t term1st9 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3262 Double_t term2nd9 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
3263 Double_t sumOfW1st9 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3264 Double_t sumOfW2nd9 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
3265 Double_t sumOfWW9 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(9); // W_{<4>} * W_{<sin(phi1)>}
3266 // numerator in the expression for the the unbiased estimator for covariance:
3267 Double_t numerator9 = product9 - term1st9*term2nd9;
3268 // denominator in the expression for the the unbiased estimator for covariance:
3269 Double_t denominator9 = 1.-sumOfWW9/(sumOfW1st9*sumOfW2nd9);
3270 // covariance:
3271 Double_t covariance9 = numerator9/denominator9;
3272 // weight dependent prefactor for covariance:
3273 Double_t wPrefactor9 = sumOfWW9/(sumOfW1st9*sumOfW2nd9);
3274 // finally, store "weighted" covariance:
3275 fIntFlowCovariancesNUA->SetBinContent(9,wPrefactor9*covariance9);
3276
3277 // Cov(<4>,<cos(phi1+phi2)>):
3278 Double_t product10 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(10); // <<4><cos(phi1+phi2)>>
3279 Double_t term1st10 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3280 Double_t term2nd10 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3281 Double_t sumOfW1st10 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3282 Double_t sumOfW2nd10 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3283 Double_t sumOfWW10 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(10); // W_{<4>} * W_{<cos(phi1+phi2)>}
3284 // numerator in the expression for the the unbiased estimator for covariance:
3285 Double_t numerator10 = product10 - term1st10*term2nd10;
3286 // denominator in the expression for the the unbiased estimator for covariance:
3287 Double_t denominator10 = 1.-sumOfWW10/(sumOfW1st10*sumOfW2nd10);
3288 // covariance:
3289 Double_t covariance10 = numerator10/denominator10;
3290 // weight dependent prefactor for covariance:
3291 Double_t wPrefactor10 = sumOfWW10/(sumOfW1st10*sumOfW2nd10);
3292 // finally, store "weighted" covariance:
3293 fIntFlowCovariancesNUA->SetBinContent(10,wPrefactor10*covariance10);
3294
3295 // Cov(<4>,<sin(phi1+phi2)>):
3296 Double_t product11 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(11); // <<4><sin(phi1+phi2)>>
3297 Double_t term1st11 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3298 Double_t term2nd11 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3299 Double_t sumOfW1st11 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3300 Double_t sumOfW2nd11 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3301 Double_t sumOfWW11 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(11); // W_{<4>} * W_{<sin(phi1+phi2)>}
3302 // numerator in the expression for the the unbiased estimator for covariance:
3303 Double_t numerator11 = product11 - term1st11*term2nd11;
3304 // denominator in the expression for the the unbiased estimator for covariance:
3305 Double_t denominator11 = 1.-sumOfWW11/(sumOfW1st11*sumOfW2nd11);
3306 // covariance:
3307 Double_t covariance11 = numerator11/denominator11;
3308 // weight dependent prefactor for covariance:
3309 Double_t wPrefactor11 = sumOfWW11/(sumOfW1st11*sumOfW2nd11);
3310 // finally, store "weighted" covariance:
3311 fIntFlowCovariancesNUA->SetBinContent(11,wPrefactor11*covariance11);
3312
3313 // Cov(<4>,<cos(phi1-phi2-phi3)>):
3314 Double_t product12 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(12); // <<4><cos(phi1-phi2-phi3)>>
3315 Double_t term1st12 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3316 Double_t term2nd12 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3317 Double_t sumOfW1st12 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3318 Double_t sumOfW2nd12 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3319 Double_t sumOfWW12 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(12); // W_{<4>} * W_{<cos(phi1-phi2-phi3)>}
3320 // numerator in the expression for the the unbiased estimator for covariance:
3321 Double_t numerator12 = product12 - term1st12*term2nd12;
3322 // denominator in the expression for the the unbiased estimator for covariance:
3323 Double_t denominator12 = 1.-sumOfWW12/(sumOfW1st12*sumOfW2nd12);
3324 // covariance:
3325 Double_t covariance12 = numerator12/denominator12;
3326 // weight dependent prefactor for covariance:
3327 Double_t wPrefactor12 = sumOfWW12/(sumOfW1st12*sumOfW2nd12);
3328 // finally, store "weighted" covariance:
3329 fIntFlowCovariancesNUA->SetBinContent(12,wPrefactor12*covariance12);
3330
3331 // Cov(<4>,<sin(phi1-phi2-phi3)>):
3332 Double_t product13 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(13); // <<4><sin(phi1-phi2-phi3)>>
3333 Double_t term1st13 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3334 Double_t term2nd13 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3335 Double_t sumOfW1st13 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3336 Double_t sumOfW2nd13 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3337 Double_t sumOfWW13 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(13); // W_{<4>} * W_{<sin(phi1-phi2-phi3)>}
3338 // numerator in the expression for the the unbiased estimator for covariance:
3339 Double_t numerator13 = product13 - term1st13*term2nd13;
3340 // denominator in the expression for the the unbiased estimator for covariance:
3341 Double_t denominator13 = 1.-sumOfWW13/(sumOfW1st13*sumOfW2nd13);
3342 // covariance:
3343 Double_t covariance13 = numerator13/denominator13;
3344 // weight dependent prefactor for covariance:
3345 Double_t wPrefactor13 = sumOfWW13/(sumOfW1st13*sumOfW2nd13);
3346 // finally, store "weighted" covariance:
3347 fIntFlowCovariancesNUA->SetBinContent(13,wPrefactor13*covariance13);
3348
3349 // Cov(<cos(phi1)>,<cos(phi1+phi2)>):
3350 Double_t product14 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(14); // <<cos(phi1)><cos(phi1+phi2)>>
3351 Double_t term1st14 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
3352 Double_t term2nd14 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3353 Double_t sumOfW1st14 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
3354 Double_t sumOfW2nd14 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3355 Double_t sumOfWW14 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(14); // W_{<cos(phi1)>} * W_{<cos(phi1+phi2)>}
3356 // numerator in the expression for the the unbiased estimator for covariance:
3357 Double_t numerator14 = product14 - term1st14*term2nd14;
3358 // denominator in the expression for the the unbiased estimator for covariance:
3359 Double_t denominator14 = 1.-sumOfWW14/(sumOfW1st14*sumOfW2nd14);
3360 // covariance:
3361 Double_t covariance14 = numerator14/denominator14;
3362 // weight dependent prefactor for covariance:
3363 Double_t wPrefactor14 = sumOfWW14/(sumOfW1st14*sumOfW2nd14);
3364 // finally, store "weighted" covariance:
3365 fIntFlowCovariancesNUA->SetBinContent(14,wPrefactor14*covariance14);
3366
3367 // Cov(<cos(phi1)>,<sin(phi1+phi2)>):
3368 Double_t product15 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(15); // <<cos(phi1)><sin(phi1+phi2)>>
3369 Double_t term1st15 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
3370 Double_t term2nd15 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3371 Double_t sumOfW1st15 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
3372 Double_t sumOfW2nd15 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3373 Double_t sumOfWW15 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(15); // W_{<cos(phi1)>} * W_{<sin(phi1+phi2)>}
3374 // numerator in the expression for the the unbiased estimator for covariance:
3375 Double_t numerator15 = product15 - term1st15*term2nd15;
3376 // denominator in the expression for the the unbiased estimator for covariance:
3377 Double_t denominator15 = 1.-sumOfWW15/(sumOfW1st15*sumOfW2nd15);
3378 // covariance:
3379 Double_t covariance15 = numerator15/denominator15;
3380 // weight dependent prefactor for covariance:
3381 Double_t wPrefactor15 = sumOfWW15/(sumOfW1st15*sumOfW2nd15);
3382 // finally, store "weighted" covariance:
3383 fIntFlowCovariancesNUA->SetBinContent(15,wPrefactor15*covariance15);
3384
3385 // Cov(<cos(phi1)>,<cos(phi1-phi2-phi3)>):
3386 Double_t product16 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(16); // <<cos(phi1)><cos(phi1-phi2-phi3)>>
3387 Double_t term1st16 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
3388 Double_t term2nd16 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3389 Double_t sumOfW1st16 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
3390 Double_t sumOfW2nd16 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3391 Double_t sumOfWW16 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(16); // W_{<cos(phi1)>} * W_{<cos(phi1-phi2-phi3)>}
3392 // numerator in the expression for the the unbiased estimator for covariance:
3393 Double_t numerator16 = product16 - term1st16*term2nd16;
3394 // denominator in the expression for the the unbiased estimator for covariance:
3395 Double_t denominator16 = 1.-sumOfWW16/(sumOfW1st16*sumOfW2nd16);
3396 // covariance:
3397 Double_t covariance16 = numerator16/denominator16;
3398 // weight dependent prefactor for covariance:
3399 Double_t wPrefactor16 = sumOfWW16/(sumOfW1st16*sumOfW2nd16);
3400 // finally, store "weighted" covariance:
3401 fIntFlowCovariancesNUA->SetBinContent(16,wPrefactor16*covariance16);
3402
3403 // Cov(<cos(phi1)>,<sin(phi1-phi2-phi3)>):
3404 Double_t product17 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(17); // <<cos(phi1)><sin(phi1-phi2-phi3)>>
3405 Double_t term1st17 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
3406 Double_t term2nd17 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3407 Double_t sumOfW1st17 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
3408 Double_t sumOfW2nd17 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3409 Double_t sumOfWW17 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(17); // W_{<cos(phi1)>} * W_{<sin(phi1-phi2-phi3)>}
3410 // numerator in the expression for the the unbiased estimator for covariance:
3411 Double_t numerator17 = product17 - term1st17*term2nd17;
3412 // denominator in the expression for the the unbiased estimator for covariance:
3413 Double_t denominator17 = 1.-sumOfWW17/(sumOfW1st17*sumOfW2nd17);
3414 // covariance:
3415 Double_t covariance17 = numerator17/denominator17;
3416 // weight dependent prefactor for covariance:
3417 Double_t wPrefactor17 = sumOfWW17/(sumOfW1st17*sumOfW2nd17);
3418 // finally, store "weighted" covariance:
3419 fIntFlowCovariancesNUA->SetBinContent(17,wPrefactor17*covariance17);
3420
3421 // Cov(<sin(phi1)>,<cos(phi1+phi2)>):
3422 Double_t product18 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(18); // <<sin(phi1)><cos(phi1+phi2)>>
3423 Double_t term1st18 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
3424 Double_t term2nd18 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3425 Double_t sumOfW1st18 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
3426 Double_t sumOfW2nd18 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3427 Double_t sumOfWW18 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(18); // W_{<sin(phi1)>} * W_{<cos(phi1+phi2)>}
3428 // numerator in the expression for the the unbiased estimator for covariance:
3429 Double_t numerator18 = product18 - term1st18*term2nd18;
3430 // denominator in the expression for the the unbiased estimator for covariance:
3431 Double_t denominator18 = 1.-sumOfWW18/(sumOfW1st18*sumOfW2nd18);
3432 // covariance:
3433 Double_t covariance18 = numerator18/denominator18;
3434 // weight dependent prefactor for covariance:
3435 Double_t wPrefactor18 = sumOfWW18/(sumOfW1st18*sumOfW2nd18);
3436 // finally, store "weighted" covariance:
3437 fIntFlowCovariancesNUA->SetBinContent(18,wPrefactor18*covariance18);
3438
3439 // Cov(<sin(phi1)>,<sin(phi1+phi2)>):
3440 Double_t product19 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(19); // <<sin(phi1)><sin(phi1+phi2)>>
3441 Double_t term1st19 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
3442 Double_t term2nd19 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3443 Double_t sumOfW1st19 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
3444 Double_t sumOfW2nd19 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3445 Double_t sumOfWW19 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(19); // W_{<sin(phi1)>} * W_{<sin(phi1+phi2)>}
3446 // numerator in the expression for the the unbiased estimator for covariance:
3447 Double_t numerator19 = product19 - term1st19*term2nd19;
3448 // denominator in the expression for the the unbiased estimator for covariance:
3449 Double_t denominator19 = 1.-sumOfWW19/(sumOfW1st19*sumOfW2nd19);
3450 // covariance:
3451 Double_t covariance19 = numerator19/denominator19;
3452 // weight dependent prefactor for covariance:
3453 Double_t wPrefactor19 = sumOfWW19/(sumOfW1st19*sumOfW2nd19);
3454 // finally, store "weighted" covariance:
3455 fIntFlowCovariancesNUA->SetBinContent(19,wPrefactor19*covariance19);
3456
3457 // Cov(<sin(phi1)>,<cos(phi1-phi2-phi3)>):
3458 Double_t product20 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(20); // <<sin(phi1)><cos(phi1-phi2-phi3)>>
3459 Double_t term1st20 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
3460 Double_t term2nd20 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3461 Double_t sumOfW1st20 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
3462 Double_t sumOfW2nd20 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3463 Double_t sumOfWW20 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(20); // W_{<sin(phi1)>} * W_{<cos(phi1-phi2-phi3)>}
3464 // numerator in the expression for the the unbiased estimator for covariance:
3465 Double_t numerator20 = product20 - term1st20*term2nd20;
3466 // denominator in the expression for the the unbiased estimator for covariance:
3467 Double_t denominator20 = 1.-sumOfWW20/(sumOfW1st20*sumOfW2nd20);
3468 // covariance:
3469 Double_t covariance20 = numerator20/denominator20;
3470 // weight dependent prefactor for covariance:
3471 Double_t wPrefactor20 = sumOfWW20/(sumOfW1st20*sumOfW2nd20);
3472 // finally, store "weighted" covariance:
3473 fIntFlowCovariancesNUA->SetBinContent(20,wPrefactor20*covariance20);
3474
3475 // Cov(<sin(phi1)>,<sin(phi1-phi2-phi3)>):
3476 Double_t product21 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(21); // <<sin(phi1)><sin(phi1-phi2-phi3)>>
3477 Double_t term1st21 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
3478 Double_t term2nd21 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3479 Double_t sumOfW1st21 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
3480 Double_t sumOfW2nd21 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3481 Double_t sumOfWW21 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(21); // W_{<sin(phi1)>} * W_{<sin(phi1-phi2-phi3)>}
3482 // numerator in the expression for the the unbiased estimator for covariance:
3483 Double_t numerator21 = product21 - term1st21*term2nd21;
3484 // denominator in the expression for the the unbiased estimator for covariance:
3485 Double_t denominator21 = 1.-sumOfWW21/(sumOfW1st21*sumOfW2nd21);
3486 // covariance:
3487 Double_t covariance21 = numerator21/denominator21;
3488 // weight dependent prefactor for covariance:
3489 Double_t wPrefactor21 = sumOfWW21/(sumOfW1st21*sumOfW2nd21);
3490 // finally, store "weighted" covariance:
3491 fIntFlowCovariancesNUA->SetBinContent(21,wPrefactor21*covariance21);
3492
3493 // Cov(<cos(phi1+phi2)>,<sin(phi1+phi2)>):
3494 Double_t product22 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(22); // <<cos(phi1+phi2)><sin(phi1+phi2)>>
3495 Double_t term1st22 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3496 Double_t term2nd22 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3497 Double_t sumOfW1st22 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3498 Double_t sumOfW2nd22 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3499 Double_t sumOfWW22 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(22); // W_{<cos(phi1+phi2)>} * W_{<sin(phi1+phi2)>}
3500 // numerator in the expression for the the unbiased estimator for covariance:
3501 Double_t numerator22 = product22 - term1st22*term2nd22;
3502 // denominator in the expression for the the unbiased estimator for covariance:
3503 Double_t denominator22 = 1.-sumOfWW22/(sumOfW1st22*sumOfW2nd22);
3504 // covariance:
3505 Double_t covariance22 = numerator22/denominator22;
3506 // weight dependent prefactor for covariance:
3507 Double_t wPrefactor22 = sumOfWW22/(sumOfW1st22*sumOfW2nd22);
3508 // finally, store "weighted" covariance:
3509 fIntFlowCovariancesNUA->SetBinContent(22,wPrefactor22*covariance22);
3510
3511 // Cov(<cos(phi1+phi2)>,<cos(phi1-phi2-phi3)>):
3512 Double_t product23 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(23); // <<cos(phi1+phi2)><cos(phi1-phi2-phi3)>>
3513 Double_t term1st23 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3514 Double_t term2nd23 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3515 Double_t sumOfW1st23 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3516 Double_t sumOfW2nd23 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3517 Double_t sumOfWW23 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(23); // W_{<cos(phi1+phi2)>} * W_{<cos(phi1-phi2-phi3)>}
3518 // numerator in the expression for the the unbiased estimator for covariance:
3519 Double_t numerator23 = product23 - term1st23*term2nd23;
3520 // denominator in the expression for the the unbiased estimator for covariance:
3521 Double_t denominator23 = 1.-sumOfWW23/(sumOfW1st23*sumOfW2nd23);
3522 // covariance:
3523 Double_t covariance23 = numerator23/denominator23;
3524 // weight dependent prefactor for covariance:
3525 Double_t wPrefactor23 = sumOfWW23/(sumOfW1st23*sumOfW2nd23);
3526 // finally, store "weighted" covariance:
3527 fIntFlowCovariancesNUA->SetBinContent(23,wPrefactor23*covariance23);
3528
3529 // Cov(<cos(phi1+phi2)>,<sin(phi1-phi2-phi3)>):
3530 Double_t product24 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(24); // <<cos(phi1+phi2)><sin(phi1-phi2-phi3)>>
3531 Double_t term1st24 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3532 Double_t term2nd24 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3533 Double_t sumOfW1st24 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3534 Double_t sumOfW2nd24 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3535 Double_t sumOfWW24 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(24); // W_{<cos(phi1+phi2)>} * W_{<sin(phi1-phi2-phi3)>}
3536 // numerator in the expression for the the unbiased estimator for covariance:
3537 Double_t numerator24 = product24 - term1st24*term2nd24;
3538 // denominator in the expression for the the unbiased estimator for covariance:
3539 Double_t denominator24 = 1.-sumOfWW24/(sumOfW1st24*sumOfW2nd24);
3540 // covariance:
3541 Double_t covariance24 = numerator24/denominator24;
3542 // weight dependent prefactor for covariance:
3543 Double_t wPrefactor24 = sumOfWW24/(sumOfW1st24*sumOfW2nd24);
3544 // finally, store "weighted" covariance:
3545 fIntFlowCovariancesNUA->SetBinContent(24,wPrefactor24*covariance24);
3546
3547 // Cov(<sin(phi1+phi2)>,<cos(phi1-phi2-phi3)>):
3548 Double_t product25 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(25); // <<sin(phi1+phi2)><cos(phi1-phi2-phi3)>>
3549 Double_t term1st25 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3550 Double_t term2nd25 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3551 Double_t sumOfW1st25 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3552 Double_t sumOfW2nd25 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3553 Double_t sumOfWW25 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(25); // W_{<sin(phi1+phi2)>} * W_{<cos(phi1-phi2-phi3)>}
3554 // numerator in the expression for the the unbiased estimator for covariance:
3555 Double_t numerator25 = product25 - term1st25*term2nd25;
3556 // denominator in the expression for the the unbiased estimator for covariance:
3557 Double_t denominator25 = 1.-sumOfWW25/(sumOfW1st25*sumOfW2nd25);
3558 // covariance:
3559 Double_t covariance25 = numerator25/denominator25;
3560 // weight dependent prefactor for covariance:
3561 Double_t wPrefactor25 = sumOfWW25/(sumOfW1st25*sumOfW2nd25);
3562 // finally, store "weighted" covariance:
3563 fIntFlowCovariancesNUA->SetBinContent(25,wPrefactor25*covariance25);
3564
3565 // Cov(<sin(phi1+phi2)>,<sin(phi1-phi2-phi3)>):
3566 Double_t product26 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(26); // <<sin(phi1+phi2)><sin(phi1-phi2-phi3)>>
3567 Double_t term1st26 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3568 Double_t term2nd26 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3569 Double_t sumOfW1st26 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3570 Double_t sumOfW2nd26 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3571 Double_t sumOfWW26 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(26); // W_{<sin(phi1+phi2)>} * W_{<sin(phi1-phi2-phi3)>}
3572 // numerator in the expression for the the unbiased estimator for covariance:
3573 Double_t numerator26 = product26 - term1st26*term2nd26;
3574 // denominator in the expression for the the unbiased estimator for covariance:
3575 Double_t denominator26 = 1.-sumOfWW26/(sumOfW1st26*sumOfW2nd26);
3576 // covariance:
3577 Double_t covariance26 = numerator26/denominator26;
3578 // weight dependent prefactor for covariance:
3579 Double_t wPrefactor26 = sumOfWW26/(sumOfW1st26*sumOfW2nd26);
3580 // finally, store "weighted" covariance:
3581 fIntFlowCovariancesNUA->SetBinContent(26,wPrefactor26*covariance26);
3582
3583 // Cov(<cos(phi1-phi2-phi3)>,<sin(phi1-phi2-phi3)>):
3584 Double_t product27 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(27); // <<cos(phi1-phi2-phi3)><sin(phi1-phi2-phi3)>>
3585 Double_t term1st27 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1-phi2-phi3)>>
3586 Double_t term2nd27 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3587 Double_t sumOfW1st27 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1-phi2-phi3)>}
3588 Double_t sumOfW2nd27 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3589 Double_t sumOfWW27 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(27); // W_{<cos(phi1-phi2-phi3)>} * W_{<sin(phi1-phi2-phi3)>}
3590 // numerator in the expression for the the unbiased estimator for covariance:
3591 Double_t numerator27 = product27 - term1st27*term2nd27;
3592 // denominator in the expression for the the unbiased estimator for covariance:
3593 Double_t denominator27 = 1.-sumOfWW27/(sumOfW1st27*sumOfW2nd27);
3594 // covariance:
3595 Double_t covariance27 = numerator27/denominator27;
3596 // weight dependent prefactor for covariance:
3597 Double_t wPrefactor27 = sumOfWW27/(sumOfW1st27*sumOfW2nd27);
3598 // finally, store "weighted" covariance:
3599 fIntFlowCovariancesNUA->SetBinContent(27,wPrefactor27*covariance27);
3600
3601} // end of AliFlowAnalysisWithQCumulants::CalculateCovariancesNUAIntFlow()
3602
3603
3604//================================================================================================================================
3605
3606
489d5531 3607void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsIntFlow()
3608{
3609 // From profile fIntFlowCorrelationsPro access measured correlations and spread,
3610 // correctly calculate the statistical errors and store the final results and
3611 // statistical errors for correlations in histogram fIntFlowCorrelationsHist.
3612 //
3613 // Remark: Statistical error of correlation is calculated as:
3614 //
3615 // statistical error = termA * spread * termB:
3616 // termA = sqrt{sum_{i=1}^{N} w^2}/(sum_{i=1}^{N} w)
3617 // termB = 1/sqrt(1-termA^2)
3618
3619 for(Int_t power=0;power<2;power++)
3620 {
3621 if(!(fIntFlowCorrelationsHist && fIntFlowCorrelationsPro && fIntFlowSumOfEventWeights[power]))
3622 {
3623 cout<<"WARNING: fIntFlowCorrelationsHist && fIntFlowCorrelationsPro && fIntFlowSumOfEventWeights[power] is NULL in AFAWQC::FCIF() !!!!"<<endl;
3624 cout<<"power = "<<power<<endl;
3625 exit(0);
3626 }
3627 }
3628
3629 for(Int_t ci=1;ci<=4;ci++) // correlation index
3630 {
3631 Double_t correlation = fIntFlowCorrelationsPro->GetBinContent(ci);
3632 Double_t spread = fIntFlowCorrelationsPro->GetBinError(ci);
3633 Double_t sumOfLinearEventWeights = fIntFlowSumOfEventWeights[0]->GetBinContent(ci);
3634 Double_t sumOfQuadraticEventWeights = fIntFlowSumOfEventWeights[1]->GetBinContent(ci);
3635 Double_t termA = 0.;
3636 Double_t termB = 0.;
3637 if(sumOfLinearEventWeights)
3638 {
3639 termA = pow(sumOfQuadraticEventWeights,0.5)/sumOfLinearEventWeights;
3640 } else
3641 {
3642 cout<<"WARNING: sumOfLinearEventWeights == 0 in AFAWQC::FCIF() !!!!"<<endl;
3643 cout<<" (for "<<2*ci<<"-particle correlation)"<<endl;
3644 }
3645 if(1.-pow(termA,2.) > 0.)
3646 {
3647 termB = 1./pow(1-pow(termA,2.),0.5);
3648 } else
3649 {
3650 cout<<"WARNING: 1.-pow(termA,2.) <= 0 in AFAWQC::FCIF() !!!!"<<endl;
3651 cout<<" (for "<<2*ci<<"-particle correlation)"<<endl;
3652 }
3653 Double_t statisticalError = termA * spread * termB;
3654 fIntFlowCorrelationsHist->SetBinContent(ci,correlation);
3655 fIntFlowCorrelationsHist->SetBinError(ci,statisticalError);
ff70ca91 3656 } // end of for(Int_t ci=1;ci<=4;ci++) // correlation index
3657
3658 // versus multiplicity:
3659 for(Int_t ci=0;ci<=3;ci++) // correlation index
3660 {
3661 Int_t nBins = fIntFlowCorrelationsVsMPro[ci]->GetNbinsX();
3662 for(Int_t b=1;b<=nBins;b++) // looping over multiplicity bins
3663 {
3664 Double_t correlationVsM = fIntFlowCorrelationsVsMPro[ci]->GetBinContent(b);
3665 Double_t spreadVsM = fIntFlowCorrelationsVsMPro[ci]->GetBinError(b);
3666 Double_t sumOfLinearEventWeightsVsM = fIntFlowSumOfEventWeightsVsM[ci][0]->GetBinContent(b);
3667 Double_t sumOfQuadraticEventWeightsVsM = fIntFlowSumOfEventWeightsVsM[ci][1]->GetBinContent(b);
3668 Double_t termAVsM = 0.;
3669 Double_t termBVsM = 0.;
3670 if(sumOfLinearEventWeightsVsM)
3671 {
3672 termAVsM = pow(sumOfQuadraticEventWeightsVsM,0.5)/sumOfLinearEventWeightsVsM;
3673 } else
3674 {
3675 cout<<"WARNING: sumOfLinearEventWeightsVsM == 0 in AFAWQC::FCIF() !!!!"<<endl;
3676 cout<<" (for "<<2*ci<<"-particle correlation versus multiplicity)"<<endl;
3677 }
3678 if(1.-pow(termAVsM,2.) > 0.)
3679 {
3680 termBVsM = 1./pow(1-pow(termAVsM,2.),0.5);
3681 } else
3682 {
3683 cout<<"WARNING: 1.-pow(termAVsM,2.) <= 0 in AFAWQC::FCIF() !!!!"<<endl;
3684 cout<<" (for "<<2*ci<<"-particle correlation versus multiplicity)"<<endl;
3685 }
3686 Double_t statisticalErrorVsM = termAVsM * spreadVsM * termBVsM;
3687 fIntFlowCorrelationsVsMHist[ci]->SetBinContent(b,correlationVsM);
3688 fIntFlowCorrelationsVsMHist[ci]->SetBinError(b,statisticalErrorVsM);
3689 } // end of for(Int_t b=1;b<=nBins;b++)
3690 } // end of for(Int_t ci=1;ci<=4;ci++) // correlation index
3691
489d5531 3692} // end of AliFlowAnalysisWithQCumulants::FinalizeCorrelationsIntFlow()
3693
489d5531 3694//================================================================================================================================
3695
489d5531 3696void AliFlowAnalysisWithQCumulants::FillAverageMultiplicities(Int_t nRP)
3697{
3698 // Fill profile fAverageMultiplicity to hold average multiplicities and number of events for events with nRP>=0, nRP>=1, ... , and nRP>=8
3699
3700 // Binning of fAverageMultiplicity is organized as follows:
3701 // 1st bin: all events (including the empty ones)
3702 // 2nd bin: event with # of RPs greater or equal to 1
3703 // 3rd bin: event with # of RPs greater or equal to 2
3704 // 4th bin: event with # of RPs greater or equal to 3
3705 // 5th bin: event with # of RPs greater or equal to 4
3706 // 6th bin: event with # of RPs greater or equal to 5
3707 // 7th bin: event with # of RPs greater or equal to 6
3708 // 8th bin: event with # of RPs greater or equal to 7
3709 // 9th bin: event with # of RPs greater or equal to 8
3710
3711 if(!fAvMultiplicity)
3712 {
3713 cout<<"WARNING: fAvMultiplicity is NULL in AFAWQC::FAM() !!!!"<<endl;
3714 exit(0);
3715 }
3716
3717 if(nRP<0)
3718 {
3719 cout<<"WARNING: nRP<0 in in AFAWQC::FAM() !!!!"<<endl;
3720 exit(0);
3721 }
3722
3723 for(Int_t i=0;i<9;i++)
3724 {
3725 if(nRP>=i) fAvMultiplicity->Fill(i+0.5,nRP,1);
3726 }
3727
3728} // end of AliFlowAnalysisWithQCumulants::FillAverageMultiplicities(nRP)
3729
3730
3731//================================================================================================================================
3732
3733
3734void AliFlowAnalysisWithQCumulants::CalculateCumulantsIntFlow()
3735{
3736 // a) Calculate Q-cumulants from the measured multiparticle correlations.
3737 // b) Propagate the statistical errors of measured multiparticle correlations to statistical errors of Q-cumulants.
3738 // c) REMARK: Q-cumulants calculated in this method are biased by non-uniform acceptance of detector !!!!
3739 // Method ApplyCorrectionForNonUniformAcceptance* (to be improved: finalize the name here)
3740 // is called afterwards to correct for this bias.
3741 // d) Store the results and statistical error of Q-cumulants in histogram fCumulants.
3742 // Binning of fCumulants is organized as follows:
3743 //
3744 // 1st bin: QC{2}
3745 // 2nd bin: QC{4}
3746 // 3rd bin: QC{6}
3747 // 4th bin: QC{8}
3748
3749 if(!(fIntFlowCorrelationsHist && fIntFlowCovariances && fIntFlowQcumulants))
3750 {
3751 cout<<"WARNING: fIntFlowCorrelationsHist && fIntFlowCovariances && fIntFlowQcumulants is NULL in AFAWQC::CCIF() !!!!"<<endl;
3752 exit(0);
3753 }
3754
3755 // correlations:
3756 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
3757 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
3758 Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
3759 Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
3760
3761 // statistical errors of average 2-, 4-, 6- and 8-particle azimuthal correlations:
3762 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <2>
3763 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <4>
3764 Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <6>
3765 Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <8>
3766
3767 // covariances (multiplied by prefactor depending on weights - see comments in CalculateCovariancesIntFlow()):
3768 Double_t wCov24 = fIntFlowCovariances->GetBinContent(1); // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
3769 Double_t wCov26 = fIntFlowCovariances->GetBinContent(2); // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)
3770 Double_t wCov28 = fIntFlowCovariances->GetBinContent(3); // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)
3771 Double_t wCov46 = fIntFlowCovariances->GetBinContent(4); // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)
3772 Double_t wCov48 = fIntFlowCovariances->GetBinContent(5); // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)
3773 Double_t wCov68 = fIntFlowCovariances->GetBinContent(6); // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)
3774
3775 // Q-cumulants:
3776 Double_t qc2 = 0.; // QC{2}
3777 Double_t qc4 = 0.; // QC{4}
3778 Double_t qc6 = 0.; // QC{6}
3779 Double_t qc8 = 0.; // QC{8}
3780 if(two) qc2 = two;
3781 if(four) qc4 = four-2.*pow(two,2.);
3782 if(six) qc6 = six-9.*two*four+12.*pow(two,3.);
3783 if(eight) qc8 = eight-16.*two*six-18.*pow(four,2.)+144.*pow(two,2.)*four-144.*pow(two,4.);
3784
3785 // statistical errors of Q-cumulants:
3786 Double_t qc2Error = 0.;
3787 Double_t qc4Error = 0.;
3788 Double_t qc6Error = 0.;
3789 Double_t qc8Error = 0.;
3790
3791 // squared statistical errors of Q-cumulants:
3792 //Double_t qc2ErrorSquared = 0.;
3793 Double_t qc4ErrorSquared = 0.;
3794 Double_t qc6ErrorSquared = 0.;
3795 Double_t qc8ErrorSquared = 0.;
3796
3797 // statistical error of QC{2}:
3798 qc2Error = twoError;
3799
3800 // statistical error of QC{4}:
3801 qc4ErrorSquared = 16.*pow(two,2.)*pow(twoError,2)+pow(fourError,2.)
3802 - 8.*two*wCov24;
3803 if(qc4ErrorSquared>0.)
3804 {
3805 qc4Error = pow(qc4ErrorSquared,0.5);
3806 } else
3807 {
3808 cout<<"WARNING: Statistical error of QC{4} is imaginary !!!!"<<endl;
3809 }
3810
3811 // statistical error of QC{6}:
3812 qc6ErrorSquared = 81.*pow(4.*pow(two,2.)-four,2.)*pow(twoError,2.)
3813 + 81.*pow(two,2.)*pow(fourError,2.)
3814 + pow(sixError,2.)
3815 - 162.*two*(4.*pow(two,2.)-four)*wCov24
3816 + 18.*(4.*pow(two,2.)-four)*wCov26
3817 - 18.*two*wCov46;
3818
3819 if(qc6ErrorSquared>0.)
3820 {
3821 qc6Error = pow(qc6ErrorSquared,0.5);
3822 } else
3823 {
3824 cout<<"WARNING: Statistical error of QC{6} is imaginary !!!!"<<endl;
3825 }
3826
3827 // statistical error of QC{8}:
3828 qc8ErrorSquared = 256.*pow(36.*pow(two,3.)-18.*four*two+six,2.)*pow(twoError,2.)
3829 + 1296.*pow(4.*pow(two,2.)-four,2.)*pow(fourError,2.)
3830 + 256.*pow(two,2.)*pow(sixError,2.)
3831 + pow(eightError,2.)
3832 - 1152.*(36.*pow(two,3.)-18.*four*two+six)*(4.*pow(two,2.)-four)*wCov24
3833 + 512.*two*(36.*pow(two,3.)-18.*four*two+six)*wCov26
3834 - 32.*(36.*pow(two,3.)-18.*four*two+six)*wCov28
3835 - 1152.*two*(4.*pow(two,2.)-four)*wCov46
3836 + 72.*(4.*pow(two,2.)-four)*wCov48
3837 - 32.*two*wCov68;
3838 if(qc8ErrorSquared>0.)
3839 {
3840 qc8Error = pow(qc8ErrorSquared,0.5);
3841 } else
3842 {
3843 cout<<"WARNING: Statistical error of QC{8} is imaginary !!!!"<<endl;
3844 }
3845
3846 // store the results and statistical errors for Q-cumulants:
3847 fIntFlowQcumulants->SetBinContent(1,qc2);
3848 fIntFlowQcumulants->SetBinError(1,qc2Error);
3849 fIntFlowQcumulants->SetBinContent(2,qc4);
3850 fIntFlowQcumulants->SetBinError(2,qc4Error);
3851 fIntFlowQcumulants->SetBinContent(3,qc6);
3852 fIntFlowQcumulants->SetBinError(3,qc6Error);
3853 fIntFlowQcumulants->SetBinContent(4,qc8);
3854 fIntFlowQcumulants->SetBinError(4,qc8Error);
3855
3856} // end of AliFlowAnalysisWithQCumulants::CalculateCumulantsIntFlow()
3857
3858
3859//================================================================================================================================
3860
3861
3862void AliFlowAnalysisWithQCumulants::CalculateIntFlow()
3863{
0328db2d 3864 // a) Calculate the final results for reference flow estimates from Q-cumulants.
3865 // b) Propagate the statistical errors of measured multiparticle correlations to statistical errors of reference flow estimates.
3866 // c) Store the results and statistical errors of reference flow estimates in histogram fIntFlow.
489d5531 3867 // Binning of fIntFlow is organized as follows:
3868 //
3869 // 1st bin: v{2,QC}
3870 // 2nd bin: v{4,QC}
3871 // 3rd bin: v{6,QC}
3872 // 4th bin: v{8,QC}
3873
3874 if(!(fIntFlowCorrelationsHist && fIntFlowCovariances && fIntFlowQcumulants && fIntFlow))
3875 {
3876 cout<<"WARNING: fIntFlowCorrelationsHist && fIntFlowCovariances && fIntFlowQcumulants && fIntFlow is NULL in AFAWQC::CCIF() !!!!"<<endl;
3877 exit(0);
3878 }
3879
3880 // Q-cumulants:
3881 Double_t qc2 = fIntFlowQcumulants->GetBinContent(1); // QC{2}
3882 Double_t qc4 = fIntFlowQcumulants->GetBinContent(2); // QC{4}
3883 Double_t qc6 = fIntFlowQcumulants->GetBinContent(3); // QC{6}
3884 Double_t qc8 = fIntFlowQcumulants->GetBinContent(4); // QC{8}
3885
3886 // correlations:
3887 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
3888 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
3889 Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
3890 Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
3891
3892 // statistical errors of average 2-, 4-, 6- and 8-particle azimuthal correlations:
3893 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <2>
3894 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <4>
3895 Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <6>
3896 Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <8>
3897
3898 // covariances (multiplied by prefactor depending on weights - see comments in CalculateCovariancesIntFlow()):
3899 Double_t wCov24 = fIntFlowCovariances->GetBinContent(1); // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
3900 Double_t wCov26 = fIntFlowCovariances->GetBinContent(2); // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)
3901 Double_t wCov28 = fIntFlowCovariances->GetBinContent(3); // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)
3902 Double_t wCov46 = fIntFlowCovariances->GetBinContent(4); // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)
3903 Double_t wCov48 = fIntFlowCovariances->GetBinContent(5); // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)
3904 Double_t wCov68 = fIntFlowCovariances->GetBinContent(6); // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)
3905
3906 // integrated flow estimates:
3907 Double_t v2 = 0.; // v{2,QC}
3908 Double_t v4 = 0.; // v{4,QC}
3909 Double_t v6 = 0.; // v{6,QC}
3910 Double_t v8 = 0.; // v{8,QC}
3911
3912 // calculate integrated flow estimates from Q-cumulants:
3913 if(qc2>=0.) v2 = pow(qc2,1./2.);
3914 if(qc4<=0.) v4 = pow(-1.*qc4,1./4.);
3915 if(qc6>=0.) v6 = pow((1./4.)*qc6,1./6.);
3916 if(qc8<=0.) v8 = pow((-1./33.)*qc8,1./8.);
3917
3918 // statistical errors of integrated flow estimates:
3919 Double_t v2Error = 0.; // statistical error of v{2,QC}
3920 Double_t v4Error = 0.; // statistical error of v{4,QC}
3921 Double_t v6Error = 0.; // statistical error of v{6,QC}
3922 Double_t v8Error = 0.; // statistical error of v{8,QC}
3923
3924 // squares of statistical errors of integrated flow estimates:
3925 Double_t v2ErrorSquared = 0.; // squared statistical error of v{2,QC}
3926 Double_t v4ErrorSquared = 0.; // squared statistical error of v{4,QC}
3927 Double_t v6ErrorSquared = 0.; // squared statistical error of v{6,QC}
3928 Double_t v8ErrorSquared = 0.; // squared statistical error of v{8,QC}
3929
3930 // calculate squared statistical errors of integrated flow estimates:
3931 if(two > 0.)
3932 {
3933 v2ErrorSquared = (1./(4.*two))*pow(twoError,2.);
3934 }
3935 if(2.*pow(two,2.)-four > 0.)
3936 {
3937 v4ErrorSquared = (1./pow(2.*pow(two,2.)-four,3./2.))*
3938 (pow(two,2.)*pow(twoError,2.)+(1./16.)*pow(fourError,2.)-(1./2.)*two*wCov24);
3939 }
3940 if(six-9.*four*two+12.*pow(two,3.) > 0.)
3941 {
3942 v6ErrorSquared = ((1./2.)*(1./pow(2.,2./3.))*(1./pow(six-9.*four*two+12.*pow(two,3.),5./3.)))*
3943 ((9./2.)*pow(4.*pow(two,2.)-four,2.)*pow(twoError,2.)
3944 + (9./2.)*pow(two,2.)*pow(fourError,2.)+(1./18.)*pow(sixError,2.)
3945 - 9.*two*(4.*pow(two,2.)-four)*wCov24+(4.*pow(two,2.)-four)*wCov26-two*wCov46);
3946 }
3947 if(-1.*eight+16.*six*two+18.*pow(four,2.)-144.*four*pow(two,2.)+144.*pow(two,4.) > 0.)
3948 {
3949 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.))*
3950 (pow(36.*pow(two,3.)-18.*four*two+six,2.)*pow(twoError,2.)
3951 + (81./16.)*pow(4.*pow(two,2.)-four,2.)*pow(fourError,2.)
3952 + pow(two,2.)*pow(sixError,2.)
3953 + (1./256.)*pow(eightError,2.)
3954 - (9./2.)*(36.*pow(two,3.)-18.*four*two+six)*(4.*pow(two,2.)-four)*wCov24
3955 + 2.*two*(36.*pow(two,3.)-18.*four*two+six)*wCov26
3956 - (1./8.)*(36.*pow(two,3.)-18.*four*two+six)*wCov28
3957 - (9./2.)*two*(4.*pow(two,2.)-four)*wCov46
3958 + (9./32.)*(4.*pow(two,2.)-four)*wCov48
3959 - (1./8.)*two*wCov68);
3960 }
3961
3962 // calculate statistical errors of integrated flow estimates:
3963 if(v2ErrorSquared > 0.)
3964 {
3965 v2Error = pow(v2ErrorSquared,0.5);
3966 } else
3967 {
3968 cout<<"WARNING: Statistical error of v{2,QC} is imaginary !!!!"<<endl;
3969 }
3970 if(v4ErrorSquared > 0.)
3971 {
3972 v4Error = pow(v4ErrorSquared,0.5);
3973 } else
3974 {
3975 cout<<"WARNING: Statistical error of v{4,QC} is imaginary !!!!"<<endl;
3976 }
3977 if(v6ErrorSquared > 0.)
3978 {
3979 v6Error = pow(v6ErrorSquared,0.5);
3980 } else
3981 {
3982 cout<<"WARNING: Statistical error of v{6,QC} is imaginary !!!!"<<endl;
3983 }
3984 if(v8ErrorSquared > 0.)
3985 {
3986 v8Error = pow(v8ErrorSquared,0.5);
3987 } else
3988 {
3989 cout<<"WARNING: Statistical error of v{8,QC} is imaginary !!!!"<<endl;
3990 }
3991
3992 // store the results and statistical errors of integrated flow estimates:
3993 fIntFlow->SetBinContent(1,v2);
3994 fIntFlow->SetBinError(1,v2Error);
3995 fIntFlow->SetBinContent(2,v4);
3996 fIntFlow->SetBinError(2,v4Error);
3997 fIntFlow->SetBinContent(3,v6);
3998 fIntFlow->SetBinError(3,v6Error);
3999 fIntFlow->SetBinContent(4,v8);
4000 fIntFlow->SetBinError(4,v8Error);
4001
4002} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlow()
4003
4004
4005//================================================================================================================================
4006
4007
4008void AliFlowAnalysisWithQCumulants::FillCommonHistResultsIntFlow()
4009{
4010 // Fill in AliFlowCommonHistResults histograms relevant for 'NONAME' integrated flow (to be improved (name))
4011
4012 if(!fIntFlow)
4013 {
4014 cout<<"WARNING: fIntFlow is NULL in AFAWQC::FCHRIF() !!!!"<<endl;
4015 exit(0);
4016 }
4017
4018 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
4019 {
4020 cout<<"WARNING: fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th"<<endl;
4021 cout<<" is NULL in AFAWQC::FCHRIF() !!!!"<<endl;
4022 exit(0);
4023 }
4024
4025 Double_t v2 = fIntFlow->GetBinContent(1);
4026 Double_t v4 = fIntFlow->GetBinContent(2);
4027 Double_t v6 = fIntFlow->GetBinContent(3);
4028 Double_t v8 = fIntFlow->GetBinContent(4);
4029
4030 Double_t v2Error = fIntFlow->GetBinError(1);
4031 Double_t v4Error = fIntFlow->GetBinError(2);
4032 Double_t v6Error = fIntFlow->GetBinError(3);
4033 Double_t v8Error = fIntFlow->GetBinError(4);
4034
4035 fCommonHistsResults2nd->FillIntegratedFlow(v2,v2Error); // to be improved (hardwired 2nd in the name)
4036 fCommonHistsResults4th->FillIntegratedFlow(v4,v4Error); // to be improved (hardwired 4th in the name)
4037 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)) // to be improved (calculate also 6th and 8th order)
4038 {
4039 fCommonHistsResults6th->FillIntegratedFlow(v6,v6Error); // to be improved (hardwired 6th in the name)
4040 fCommonHistsResults8th->FillIntegratedFlow(v8,v8Error); // to be improved (hardwired 8th in the name)
4041 }
4042
4043} // end of AliFlowAnalysisWithQCumulants::FillCommonHistResultsIntFlow()
4044
4045
4046//================================================================================================================================
4047
4048
4049/*
4050void AliFlowAnalysisWithQCumulants::ApplyCorrectionForNonUniformAcceptanceToCumulantsForIntFlow(Bool_t useParticleWeights, TString eventWeights)
4051{
4052 // apply correction for non-uniform acceptance to cumulants for integrated flow
4053 // (Remark: non-corrected cumulants are accessed from fCumulants[pW][0], corrected cumulants are stored in fCumulants[pW][1])
4054
4055 // shortcuts for the flags:
4056 Int_t pW = (Int_t)(useParticleWeights); // 0=pWeights not used, 1=pWeights used
4057 Int_t eW = -1;
4058
4059 if(eventWeights == "exact")
4060 {
4061 eW = 0;
4062 }
4063
4064 if(!(fCumulants[pW][eW][0] && fCumulants[pW][eW][1] && fCorrections[pW][eW]))
4065 {
4066 cout<<"WARNING: fCumulants[pW][eW][0] && fCumulants[pW][eW][1] && fCorrections[pW][eW] is NULL in AFAWQC::ACFNUATCFIF() !!!!"<<endl;
4067 cout<<"pW = "<<pW<<endl;
4068 cout<<"eW = "<<eW<<endl;
4069 exit(0);
4070 }
4071
4072 // non-corrected cumulants:
4073 Double_t qc2 = fCumulants[pW][eW][0]->GetBinContent(1);
4074 Double_t qc4 = fCumulants[pW][eW][0]->GetBinContent(2);
4075 Double_t qc6 = fCumulants[pW][eW][0]->GetBinContent(3);
4076 Double_t qc8 = fCumulants[pW][eW][0]->GetBinContent(4);
4077 // statistical error of non-corrected cumulants:
4078 Double_t qc2Error = fCumulants[pW][eW][0]->GetBinError(1);
4079 Double_t qc4Error = fCumulants[pW][eW][0]->GetBinError(2);
4080 Double_t qc6Error = fCumulants[pW][eW][0]->GetBinError(3);
4081 Double_t qc8Error = fCumulants[pW][eW][0]->GetBinError(4);
4082 // corrections for non-uniform acceptance:
4083 Double_t qc2Correction = fCorrections[pW][eW]->GetBinContent(1);
4084 Double_t qc4Correction = fCorrections[pW][eW]->GetBinContent(2);
4085 Double_t qc6Correction = fCorrections[pW][eW]->GetBinContent(3);
4086 Double_t qc8Correction = fCorrections[pW][eW]->GetBinContent(4);
4087 // corrected cumulants:
4088 Double_t qc2Corrected = qc2 + qc2Correction;
4089 Double_t qc4Corrected = qc4 + qc4Correction;
4090 Double_t qc6Corrected = qc6 + qc6Correction;
4091 Double_t qc8Corrected = qc8 + qc8Correction;
4092
4093 // ... to be improved (I need here also to correct error of QCs for NUA.
4094 // For simplicity sake I assume at the moment that this correction is negliglible, but it will be added eventually...)
4095
4096 // store corrected results and statistical errors for cumulants:
4097 fCumulants[pW][eW][1]->SetBinContent(1,qc2Corrected);
4098 fCumulants[pW][eW][1]->SetBinContent(2,qc4Corrected);
4099 fCumulants[pW][eW][1]->SetBinContent(3,qc6Corrected);
4100 fCumulants[pW][eW][1]->SetBinContent(4,qc8Corrected);
4101 fCumulants[pW][eW][1]->SetBinError(1,qc2Error); // to be improved (correct also qc2Error for NUA)
4102 fCumulants[pW][eW][1]->SetBinError(2,qc4Error); // to be improved (correct also qc4Error for NUA)
4103 fCumulants[pW][eW][1]->SetBinError(3,qc6Error); // to be improved (correct also qc6Error for NUA)
4104 fCumulants[pW][eW][1]->SetBinError(4,qc8Error); // to be improved (correct also qc8Error for NUA)
4105
4106} // end of AliFlowAnalysisWithQCumulants::ApplyCorrectionForNonUniformAcceptanceToCumulantsForIntFlow(Bool_t useParticleWeights, TString eventWeights)
4107*/
4108
4109
4110//================================================================================================================================
4111
4112
4113/*
4114void AliFlowAnalysisWithQCumulants::PrintQuantifyingCorrectionsForNonUniformAcceptance(Bool_t useParticleWeights, TString eventWeights)
4115{
4116 // print on the screen QC{n,biased}/QC{n,corrected}
4117
4118 // shortcuts for the flags:
4119 Int_t pW = (Int_t)(useParticleWeights); // 0=pWeights not used, 1=pWeights used
4120
4121 Int_t eW = -1;
4122
4123 if(eventWeights == "exact")
4124 {
4125 eW = 0;
4126 }
4127
4128 if(!(fCumulants[pW][eW][0] && fCumulants[pW][eW][1]))
4129 {
4130 cout<<"WARNING: fCumulants[pW][eW][0] && fCumulants[pW][eW][1] is NULL in AFAWQC::PQCFNUA() !!!!"<<endl;
4131 cout<<"pW = "<<pW<<endl;
4132 cout<<"eW = "<<eW<<endl;
4133 exit(0);
4134 }
4135
4136 cout<<endl;
4137 cout<<" Quantifying the bias to Q-cumulants from"<<endl;
4138 cout<<" non-uniform acceptance of the detector:"<<endl;
4139 cout<<endl;
4140
4141 if(fCumulants[pW][eW][1]->GetBinContent(1))
4142 {
4143 cout<<" QC{2,biased}/QC{2,corrected} = "<<(fCumulants[pW][eW][0]->GetBinContent(1))/(fCumulants[pW][eW][1]->GetBinContent(1))<<endl;
4144 }
4145 if(fCumulants[pW][eW][1]->GetBinContent(2))
4146 {
4147 cout<<" QC{4,biased}/QC{4,corrected} = "<<fCumulants[pW][eW][0]->GetBinContent(2)/fCumulants[pW][eW][1]->GetBinContent(2)<<endl;
4148 }
4149
4150 cout<<endl;
4151
4152} // end of AliFlowAnalysisWithQCumulants::PrintQuantifyingCorrectionsForNonUniformAcceptance(Bool_t useParticleWeights, TString eventWeights)
4153*/
4154
4155
4156//================================================================================================================================
4157
4158
4159void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelationsUsingParticleWeights()
4160{
4161 // Calculate all correlations needed for integrated flow using particle weights.
4162
4163 // Remark 1: When particle weights are used the binning of fIntFlowCorrelationAllPro is organized as follows:
4164 //
4165 // 1st bin: <2>_{1n|1n} = two1n1nW1W1 = <w1 w2 cos(n*(phi1-phi2))>
4166 // 2nd bin: <2>_{2n|2n} = two2n2nW2W2 = <w1^2 w2^2 cos(2n*(phi1-phi2))>
4167 // 3rd bin: <2>_{3n|3n} = two3n3nW3W3 = <w1^3 w2^3 cos(3n*(phi1-phi2))>
4168 // 4th bin: <2>_{4n|4n} = two4n4nW4W4 = <w1^4 w2^4 cos(4n*(phi1-phi2))>
4169 // 5th bin: ---- EMPTY ----
4170 // 6th bin: <3>_{2n|1n,1n} = three2n1n1nW2W1W1 = <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
4171 // 7th bin: <3>_{3n|2n,1n} = ...
4172 // 8th bin: <3>_{4n|2n,2n} = ...
4173 // 9th bin: <3>_{4n|3n,1n} = ...
4174 // 10th bin: ---- EMPTY ----
4175 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1nW1W1W1W1 = <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
4176 // 12th bin: <4>_{2n,1n|2n,1n} = ...
4177 // 13th bin: <4>_{2n,2n|2n,2n} = ...
4178 // 14th bin: <4>_{3n|1n,1n,1n} = ...
4179 // 15th bin: <4>_{3n,1n|3n,1n} = ...
4180 // 16th bin: <4>_{3n,1n|2n,2n} = ...
4181 // 17th bin: <4>_{4n|2n,1n,1n} = ...
4182 // 18th bin: ---- EMPTY ----
4183 // 19th bin: <5>_{2n|1n,1n,1n,1n} = ...
4184 // 20th bin: <5>_{2n,2n|2n,1n,1n} = ...
4185 // 21st bin: <5>_{3n,1n|2n,1n,1n} = ...
4186 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = ...
4187 // 23rd bin: ---- EMPTY ----
4188 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = ...
4189 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = ...
4190 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = ...
4191 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = ...
4192 // 28th bin: ---- EMPTY ----
4193 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = ...
4194 // 30th bin: ---- EMPTY ----
4195 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = ...
4196
4197 // Remark 2: When particle weights are used there are some extra correlations. They are stored in
4198 // fIntFlowExtraCorrelationsPro binning of which is organized as follows:
4199
4200 // 1st bin: two1n1nW3W1 = <w1^3 w2 cos(n*(phi1-phi2))>
4201 // 2nd bin: two1n1nW1W1W2 = <w1 w2 w3^2 cos(n*(phi1-phi2))>
4202
4203 // multiplicity (number of particles used to determine the reaction plane)
4204 Double_t dMult = (*fSMpk)(0,0);
4205
4206 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
4207 Double_t dReQ1n1k = (*fReQ)(0,1);
4208 Double_t dReQ2n2k = (*fReQ)(1,2);
4209 Double_t dReQ3n3k = (*fReQ)(2,3);
4210 Double_t dReQ4n4k = (*fReQ)(3,4);
4211 Double_t dReQ1n3k = (*fReQ)(0,3);
4212 Double_t dImQ1n1k = (*fImQ)(0,1);
4213 Double_t dImQ2n2k = (*fImQ)(1,2);
4214 Double_t dImQ3n3k = (*fImQ)(2,3);
4215 Double_t dImQ4n4k = (*fImQ)(3,4);
4216 Double_t dImQ1n3k = (*fImQ)(0,3);
4217
4218 // dMs are variables introduced in order to simplify some Eqs. bellow:
4219 //..............................................................................................
4220 Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
4221 Double_t dM22 = (*fSMpk)(1,2)-(*fSMpk)(0,4); // dM22 = sum_{i,j=1,i!=j}^M w_i^2 w_j^2
4222 Double_t dM33 = (*fSMpk)(1,3)-(*fSMpk)(0,6); // dM33 = sum_{i,j=1,i!=j}^M w_i^3 w_j^3
4223 Double_t dM44 = (*fSMpk)(1,4)-(*fSMpk)(0,8); // dM44 = sum_{i,j=1,i!=j}^M w_i^4 w_j^4
4224 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
4225 Double_t dM211 = (*fSMpk)(0,2)*(*fSMpk)(1,1)-2.*(*fSMpk)(0,3)*(*fSMpk)(0,1)
4226 - (*fSMpk)(1,2)+2.*(*fSMpk)(0,4); // dM211 = sum_{i,j,k=1,i!=j!=k}^M w_i^2 w_j w_k
4227 Double_t dM1111 = (*fSMpk)(3,1)-6.*(*fSMpk)(0,2)*(*fSMpk)(1,1)
4228 + 8.*(*fSMpk)(0,3)*(*fSMpk)(0,1)
4229 + 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
4230 //..............................................................................................
4231
4232 // 2-particle correlations:
4233 Double_t two1n1nW1W1 = 0.; // <w1 w2 cos(n*(phi1-phi2))>
4234 Double_t two2n2nW2W2 = 0.; // <w1^2 w2^2 cos(2n*(phi1-phi2))>
4235 Double_t two3n3nW3W3 = 0.; // <w1^3 w2^3 cos(3n*(phi1-phi2))>
4236 Double_t two4n4nW4W4 = 0.; // <w1^4 w2^4 cos(4n*(phi1-phi2))>
4237 if(dMult>1)
4238 {
4239 if(dM11)
4240 {
4241 two1n1nW1W1 = (pow(dReQ1n1k,2)+pow(dImQ1n1k,2)-(*fSMpk)(0,2))/dM11;
4242 // average correlation <w1 w2 cos(n*(phi1-phi2))> for single event:
4243 fIntFlowCorrelationsEBE->SetBinContent(1,two1n1nW1W1);
4244 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(1,dM11);
4245 // average correlation <w1 w2 cos(n*(phi1-phi2))> for all events:
4246 fIntFlowCorrelationsPro->Fill(0.5,two1n1nW1W1,dM11);
4247 fIntFlowCorrelationsAllPro->Fill(0.5,two1n1nW1W1,dM11);
4248 }
4249 if(dM22)
4250 {
4251 two2n2nW2W2 = (pow(dReQ2n2k,2)+pow(dImQ2n2k,2)-(*fSMpk)(0,4))/dM22;
4252 // ...
4253 // average correlation <w1^2 w2^2 cos(2n*(phi1-phi2))> for all events:
4254 fIntFlowCorrelationsAllPro->Fill(1.5,two2n2nW2W2,dM22);
4255 }
4256 if(dM33)
4257 {
4258 two3n3nW3W3 = (pow(dReQ3n3k,2)+pow(dImQ3n3k,2)-(*fSMpk)(0,6))/dM33;
4259 // ...
4260 // average correlation <w1^3 w2^3 cos(3n*(phi1-phi2))> for all events:
4261 fIntFlowCorrelationsAllPro->Fill(2.5,two3n3nW3W3,dM33);
4262 }
4263 if(dM44)
4264 {
4265 two4n4nW4W4 = (pow(dReQ4n4k,2)+pow(dImQ4n4k,2)-(*fSMpk)(0,8))/dM44;
4266 // ...
4267 // average correlation <w1^4 w2^4 cos(4n*(phi1-phi2))> for all events:
4268 fIntFlowCorrelationsAllPro->Fill(3.5,two4n4nW4W4,dM44);
4269 }
4270 } // end of if(dMult>1)
4271
4272 // extra 2-particle correlations:
4273 Double_t two1n1nW3W1 = 0.; // <w1^3 w2 cos(n*(phi1-phi2))>
4274 Double_t two1n1nW1W1W2 = 0.; // <w1 w2 w3^2 cos(n*(phi1-phi2))>
4275 if(dMult>1)
4276 {
4277 if(dM31)
4278 {
4279 two1n1nW3W1 = (dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k-(*fSMpk)(0,4))/dM31;
4280 fIntFlowExtraCorrelationsPro->Fill(0.5,two1n1nW3W1,dM31);
4281 }
4282 if(dM211)
4283 {
4284 two1n1nW1W1W2 = ((*fSMpk)(0,2)*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2)-(*fSMpk)(0,2))
4285 - 2.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k
4286 - (*fSMpk)(0,4)))/dM211;
4287 fIntFlowExtraCorrelationsPro->Fill(1.5,two1n1nW1W1W2,dM211);
4288 }
4289 } // end of if(dMult>1)
4290 //..............................................................................................
4291
4292 //..............................................................................................
4293 // 3-particle correlations:
4294 Double_t three2n1n1nW2W1W1 = 0.; // <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
4295
4296 if(dMult>2)
4297 {
4298 if(dM211)
4299 {
4300 three2n1n1nW2W1W1 = (pow(dReQ1n1k,2.)*dReQ2n2k+2.*dReQ1n1k*dImQ1n1k*dImQ2n2k-pow(dImQ1n1k,2.)*dReQ2n2k
4301 - 2.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k)
4302 - pow(dReQ2n2k,2)-pow(dImQ2n2k,2)
4303 + 2.*(*fSMpk)(0,4))/dM211;
4304 fIntFlowCorrelationsAllPro->Fill(5.5,three2n1n1nW2W1W1,dM211);
4305 }
4306 } // end of if(dMult>2)
4307 //..............................................................................................
4308
4309 //..............................................................................................
4310 // 4-particle correlations:
4311 Double_t four1n1n1n1nW1W1W1W1 = 0.; // <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
4312 if(dMult>3)
4313 {
4314 if(dM1111)
4315 {
4316 four1n1n1n1nW1W1W1W1 = (pow(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.),2)
4317 - 2.*(pow(dReQ1n1k,2.)*dReQ2n2k+2.*dReQ1n1k*dImQ1n1k*dImQ2n2k-pow(dImQ1n1k,2.)*dReQ2n2k)
4318 + 8.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k)
4319 + (pow(dReQ2n2k,2)+pow(dImQ2n2k,2))
4320 - 4.*(*fSMpk)(0,2)*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
4321 - 6.*(*fSMpk)(0,4)+2.*(*fSMpk)(1,2))/dM1111;
4322
4323 // average correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for single event:
4324 fIntFlowCorrelationsEBE->SetBinContent(2,four1n1n1n1nW1W1W1W1);
4325 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(2,dM1111);
4326 // average correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for all events:
4327 fIntFlowCorrelationsPro->Fill(1.5,four1n1n1n1nW1W1W1W1,dM1111);
4328 fIntFlowCorrelationsAllPro->Fill(10.5,four1n1n1n1nW1W1W1W1,dM1111);
4329 }
4330 } // end of if(dMult>3)
4331 //..............................................................................................
4332
4333} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelationsUsingParticleWeights()
4334
4335
4336//================================================================================================================================
4337
4338
4339void AliFlowAnalysisWithQCumulants::CalculateWeightedQProductsForIntFlow() // to be improved (completed)
4340{
4341 // calculate averages like <<2><4>>, <<2><6>>, <<4><6>>, etc. which are needed to calculate covariances
4342 // Remark: here we take weighted correlations!
4343
4344 /*
4345
4346 // binning of fQProductsW is organized as follows:
4347 //
4348 // 1st bin: <2><4>
4349 // 2nd bin: <2><6>
4350 // 3rd bin: <2><8>
4351 // 4th bin: <4><6>
4352 // 5th bin: <4><8>
4353 // 6th bin: <6><8>
4354
4355 Double_t dMult = (*fSMpk)(0,0); // multiplicity (number of particles used to determine the reaction plane)
4356
4357 Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
4358 Double_t dM1111 = (*fSMpk)(3,1)-6.*(*fSMpk)(0,2)*(*fSMpk)(1,1)
4359 + 8.*(*fSMpk)(0,3)*(*fSMpk)(0,1)
4360 + 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
4361
4362 Double_t twoEBEW = 0.; // <2>
4363 Double_t fourEBEW = 0.; // <4>
4364
4365 twoEBEW = fQCorrelationsEBE[1]->GetBinContent(1);
4366 fourEBEW = fQCorrelationsEBE[1]->GetBinContent(11);
4367
4368 // <2><4>
4369 if(dMult>3)
4370 {
4371 fQProducts[1][0]->Fill(0.5,twoEBEW*fourEBEW,dM11*dM1111);
4372 }
4373
4374 */
4375
4376} // end of AliFlowAnalysisWithQCumulants::CalculateWeightedQProductsForIntFlow()
4377
4378
4379//================================================================================================================================
4380
4381
4382void AliFlowAnalysisWithQCumulants::InitializeArraysForIntFlow()
4383{
4384 // Initialize all arrays used to calculate integrated flow.
4385
4386 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
4387 {
4388 fIntFlowCorrectionTermsForNUAEBE[sc] = NULL;
0328db2d 4389 fIntFlowEventWeightForCorrectionTermsForNUAEBE[sc] = NULL;
489d5531 4390 fIntFlowCorrectionTermsForNUAPro[sc] = NULL;
4391 fIntFlowCorrectionTermsForNUAHist[sc] = NULL;
0328db2d 4392 for(Int_t power=0;power<2;power++) // linear or quadratic
4393 {
4394 fIntFlowSumOfEventWeightsNUA[sc][power] = NULL;
4395 }
489d5531 4396 }
4397 for(Int_t power=0;power<2;power++) // linear or quadratic
4398 {
4399 fIntFlowSumOfEventWeights[power] = NULL;
4400 }
4401 for(Int_t i=0;i<3;i++) // print on the screen the final results (0=NONAME, 1=RP, 2=POI)
4402 {
4403 fPrintFinalResults[i] = kTRUE;
4404 }
ff70ca91 4405 for(Int_t ci=0;ci<4;ci++) // correlation index or cumulant order
4406 {
4407 fIntFlowCorrelationsVsMPro[ci] = NULL;
4408 fIntFlowCorrelationsVsMHist[ci] = NULL;
4409 fIntFlowQcumulantsVsM[ci] = NULL;
4410 fIntFlowVsM[ci] = NULL;
4411 for(Int_t lc=0;lc<2;lc++)
4412 {
4413 fIntFlowSumOfEventWeightsVsM[ci][lc] = NULL;
4414 }
4415 }
4416 for(Int_t pi=0;pi<6;pi++) // product or covariance index
4417 {
4418 fIntFlowProductOfCorrelationsVsMPro[pi] = NULL;
4419 fIntFlowCovariancesVsM[pi] = NULL;
4420 fIntFlowSumOfProductOfEventWeightsVsM[pi] = NULL;
4421 }
4422
489d5531 4423} // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForIntFlow()
4424
489d5531 4425//================================================================================================================================
4426
489d5531 4427void AliFlowAnalysisWithQCumulants::InitializeArraysForDiffFlow()
4428{
4429 // Initialize all arrays needed to calculate differential flow.
4430 // a) Initialize lists holding profiles;
4431 // b) Initialize lists holding histograms;
4432 // c) Initialize event-by-event quantities;
4433 // d) Initialize profiles;
4434 // e) Initialize histograms holding final results.
4435
4436 // a) Initialize lists holding profiles;
4437 for(Int_t t=0;t<2;t++) // type (RP, POI)
4438 {
4439 for(Int_t pe=0;pe<2;pe++) // pt or eta
4440 {
4441 fDiffFlowCorrelationsProList[t][pe] = NULL;
4442 fDiffFlowProductOfCorrelationsProList[t][pe] = NULL;
4443 fDiffFlowCorrectionsProList[t][pe] = NULL;
4444 }
4445 }
4446
4447 // b) Initialize lists holding histograms;
4448 for(Int_t t=0;t<2;t++) // type (RP, POI)
4449 {
4450 for(Int_t pe=0;pe<2;pe++) // pt or eta
4451 {
4452 fDiffFlowCorrelationsHistList[t][pe] = NULL;
4453 for(Int_t power=0;power<2;power++)
4454 {
4455 fDiffFlowSumOfEventWeightsHistList[t][pe][power] = NULL;
4456 } // end of for(Int_t power=0;power<2;power++)
4457 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe] = NULL;
4458 fDiffFlowCorrectionsHistList[t][pe] = NULL;
4459 fDiffFlowCovariancesHistList[t][pe] = NULL;
4460 fDiffFlowCumulantsHistList[t][pe] = NULL;
4461 fDiffFlowHistList[t][pe] = NULL;
4462 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
4463 } // enf of for(Int_t t=0;t<2;t++) // type (RP, POI)
4464
4465 // c) Initialize event-by-event quantities:
4466 // 1D:
4467 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
4468 {
4469 for(Int_t pe=0;pe<2;pe++) // pt or eta
4470 {
4471 for(Int_t m=0;m<4;m++) // multiple of harmonic
4472 {
4473 for(Int_t k=0;k<9;k++) // power of weight
4474 {
4475 fReRPQ1dEBE[t][pe][m][k] = NULL;
4476 fImRPQ1dEBE[t][pe][m][k] = NULL;
4477 fs1dEBE[t][pe][k] = NULL; // to be improved (this doesn't need to be within loop over m)
4478 }
4479 }
4480 }
4481 }
4482 // 1D:
4483 for(Int_t t=0;t<2;t++) // type (RP or POI)
4484 {
4485 for(Int_t pe=0;pe<2;pe++) // pt or eta
4486 {
4487 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
4488 {
4489 for(Int_t cti=0;cti<9;cti++) // correction term index
4490 {
4491 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti] = NULL;
4492 }
4493 }
4494 }
4495 }
4496 // 2D:
4497 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
4498 {
4499 for(Int_t m=0;m<4;m++) // multiple of harmonic
4500 {
4501 for(Int_t k=0;k<9;k++) // power of weight
4502 {
4503 fReRPQ2dEBE[t][m][k] = NULL;
4504 fImRPQ2dEBE[t][m][k] = NULL;
4505 fs2dEBE[t][k] = NULL; // to be improved (this doesn't need to be within loop over m)
4506 }
4507 }
4508 }
4509
4510 // d) Initialize profiles:
4511 for(Int_t t=0;t<2;t++) // type: RP or POI
4512 {
4513 for(Int_t pe=0;pe<2;pe++) // pt or eta
4514 {
4515 for(Int_t ci=0;ci<4;ci++) // correlation index
4516 {
4517 fDiffFlowCorrelationsPro[t][pe][ci] = NULL;
4518 } // end of for(Int_t ci=0;ci<4;ci++)
4519 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
4520 {
4521 for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index
4522 {
4523 fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2] = NULL;
4524 } // end of for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index
4525 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
4526 // correction terms for nua:
4527 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
4528 {
4529 for(Int_t cti=0;cti<9;cti++) // correction term index
4530 {
4531 fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti] = NULL;
4532 }
4533 }
4534 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
4535 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
4536
4537 // e) Initialize histograms holding final results.
4538 for(Int_t t=0;t<2;t++) // type: RP or POI
4539 {
4540 for(Int_t pe=0;pe<2;pe++) // pt or eta
4541 {
4542 for(Int_t ci=0;ci<4;ci++) // correlation index
4543 {
4544 fDiffFlowCorrelationsHist[t][pe][ci] = NULL;
4545 fDiffFlowCumulants[t][pe][ci] = NULL;
4546 fDiffFlow[t][pe][ci] = NULL;
4547 } // end of for(Int_t ci=0;ci<4;ci++)
4548 for(Int_t covarianceIndex=0;covarianceIndex<5;covarianceIndex++)
4549 {
4550 fDiffFlowCovariances[t][pe][covarianceIndex] = NULL;
4551 } // end of for(Int_t covarianceIndex=0;covarianceIndex<5;covarianceIndex++)
4552 // correction terms for nua:
4553 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
4554 {
4555 for(Int_t cti=0;cti<9;cti++) // correction term index
4556 {
4557 fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti] = NULL;
4558 }
4559 }
4560 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
4561 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
4562
4563 // sum of event weights for reduced correlations:
4564 for(Int_t t=0;t<2;t++) // type = RP or POI
4565 {
4566 for(Int_t pe=0;pe<2;pe++) // pt or eta
4567 {
4568 for(Int_t p=0;p<2;p++) // power of weight is 1 or 2
4569 {
4570 for(Int_t ew=0;ew<4;ew++) // event weight index for reduced correlations
4571 {
4572 fDiffFlowSumOfEventWeights[t][pe][p][ew] = NULL;
4573 }
4574 }
4575 }
4576 }
4577 // product of event weights for both types of correlations:
4578 for(Int_t t=0;t<2;t++) // type = RP or POI
4579 {
4580 for(Int_t pe=0;pe<2;pe++) // pt or eta
4581 {
4582 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
4583 {
4584 for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index
4585 {
4586 fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2] = NULL;
4587 }
4588 }
4589 }
4590 }
4591
4592
4593
4594
4595 /*
4596
4597 // nested lists in fDiffFlowProfiles:
4598 for(Int_t t=0;t<2;t++)
4599 {
4600 fDFPType[t] = NULL;
4601 for(Int_t pW=0;pW<2;pW++) // particle weights not used (0) or used (1)
4602 {
4603 fDFPParticleWeights[t][pW] = NULL;
4604 for(Int_t eW=0;eW<2;eW++)
4605 {
4606 fDFPEventWeights[t][pW][eW] = NULL;
4607 fDiffFlowCorrelations[t][pW][eW] = NULL;
4608 fDiffFlowProductsOfCorrelations[t][pW][eW] = NULL;
4609 for(Int_t sc=0;sc<2;sc++)
4610 {
4611 fDiffFlowCorrectionTerms[t][pW][eW][sc] = NULL;
4612 }
4613 }
4614 }
4615 }
4616
4617
4618 */
4619
4620
4621
4622 /*
4623 for(Int_t pW=0;pW<2;pW++) // particle weights not used (0) or used (1)
4624 {
4625 for(Int_t eW=0;eW<2;eW++)
4626 {
4627 // correlations:
4628 for(Int_t correlationIndex=0;correlationIndex<4;correlationIndex++)
4629 {
4630 fCorrelationsPro[t][pW][eW][correlationIndex] = NULL;
4631 }
4632 // products of correlations:
4633 for(Int_t productOfCorrelationsIndex=0;productOfCorrelationsIndex<6;productOfCorrelationsIndex++)
4634 {
4635 fProductsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex] = NULL;
4636 }
4637 // correction terms:
4638 for(Int_t sc=0;sc<2;sc++)
4639 {
4640 for(Int_t correctionsIndex=0;correctionsIndex<2;correctionsIndex++)
4641 {
4642 fCorrectionTermsPro[t][pW][eW][sc][correctionsIndex] = NULL;
4643 }
4644 }
4645 }
4646 }
4647 */
4648
4649} // end of AliFlowAnalysisWithQCumulants::InitializeArraysForDiffFlow()
4650
4651
4652//================================================================================================================================
4653 /*
4654
4655
4656void AliFlowAnalysisWithQCumulants::CalculateCorrelationsForDifferentialFlow2D(TString type)
4657{
4658 // calculate all reduced correlations needed for differential flow for each (pt,eta) bin:
4659
4660 if(type == "RP") // to be improved (removed)
4661 {
4662 cout<<endl;
4663 }
4664 // ...
4665
4666
4667 Int_t typeFlag = -1;
4668
4669 // reduced correlations ares stored in fCorrelationsPro[t][pW][index] and are indexed as follows:
4670 // index:
4671 // 0: <2'>
4672 // 1: <4'>
4673
4674 // multiplicity:
4675 Double_t dMult = (*fSMpk)(0,0);
4676
4677 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
4678 Double_t dReQ1n = (*fReQ)(0,0);
4679 Double_t dReQ2n = (*fReQ)(1,0);
4680 //Double_t dReQ3n = (*fReQ)(2,0);
4681 //Double_t dReQ4n = (*fReQ)(3,0);
4682 Double_t dImQ1n = (*fImQ)(0,0);
4683 Double_t dImQ2n = (*fImQ)(1,0);
4684 //Double_t dImQ3n = (*fImQ)(2,0);
4685 //Double_t dImQ4n = (*fImQ)(3,0);
4686
4687 // looping over all (pt,eta) bins and calculating correlations needed for differential flow:
4688 for(Int_t p=1;p<=fnBinsPt;p++)
4689 {
4690 for(Int_t e=1;e<=fnBinsEta;e++)
4691 {
4692 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin):
4693 Double_t p1n0kRe = 0.;
4694 Double_t p1n0kIm = 0.;
4695
4696 // number of POIs in particular (pt,eta) bin:
4697 Double_t mp = 0.;
4698
4699 // 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):
4700 Double_t q1n0kRe = 0.;
4701 Double_t q1n0kIm = 0.;
4702 Double_t q2n0kRe = 0.;
4703 Double_t q2n0kIm = 0.;
4704
4705 // number of particles which are both RPs and POIs in particular (pt,eta) bin:
4706 Double_t mq = 0.;
4707
4708 // q_{m*n,0}:
4709 q1n0kRe = fReEBE2D[2][0][0]->GetBinContent(fReEBE2D[2][0][0]->GetBin(p,e))
4710 * fReEBE2D[2][0][0]->GetBinEntries(fReEBE2D[2][0][0]->GetBin(p,e));
4711 q1n0kIm = fImEBE2D[2][0][0]->GetBinContent(fImEBE2D[2][0][0]->GetBin(p,e))
4712 * fImEBE2D[2][0][0]->GetBinEntries(fImEBE2D[2][0][0]->GetBin(p,e));
4713 q2n0kRe = fReEBE2D[2][1][0]->GetBinContent(fReEBE2D[2][1][0]->GetBin(p,e))
4714 * fReEBE2D[2][1][0]->GetBinEntries(fReEBE2D[2][1][0]->GetBin(p,e));
4715 q2n0kIm = fImEBE2D[2][1][0]->GetBinContent(fImEBE2D[2][1][0]->GetBin(p,e))
4716 * fImEBE2D[2][1][0]->GetBinEntries(fImEBE2D[2][1][0]->GetBin(p,e));
4717
4718 mq = fReEBE2D[2][0][0]->GetBinEntries(fReEBE2D[2][0][0]->GetBin(p,e)); // to be improved (cross-checked by accessing other profiles here)
4719
4720 if(type == "POI")
4721 {
4722 // p_{m*n,0}:
4723 p1n0kRe = fReEBE2D[1][0][0]->GetBinContent(fReEBE2D[1][0][0]->GetBin(p,e))
4724 * fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e));
4725 p1n0kIm = fImEBE2D[1][0][0]->GetBinContent(fImEBE2D[1][0][0]->GetBin(p,e))
4726 * fImEBE2D[1][0][0]->GetBinEntries(fImEBE2D[1][0][0]->GetBin(p,e));
4727
4728 mp = fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e)); // to be improved (cross-checked by accessing other profiles here)
4729
4730 typeFlag = 1;
4731 }
4732 else if(type == "RP")
4733 {
4734 // p_{m*n,0} = q_{m*n,0}:
4735 p1n0kRe = q1n0kRe;
4736 p1n0kIm = q1n0kIm;
4737 mp = mq;
4738
4739 typeFlag = 0;
4740 }
4741
4742 // count events with non-empty (pt,eta) bin:
4743 if(mp>0)
4744 {
4745 fNonEmptyBins2D[typeFlag]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,1);
4746 }
4747
4748 // 2'-particle correlation for particular (pt,eta) bin:
4749 Double_t two1n1nPtEta = 0.;
4750 if(mp*dMult-mq)
4751 {
4752 two1n1nPtEta = (p1n0kRe*dReQ1n+p1n0kIm*dImQ1n-mq)
4753 / (mp*dMult-mq);
4754
4755 // fill the 2D profile to get the average correlation for each (pt,eta) bin:
4756 if(type == "POI")
4757 {
4758 //f2pPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);
4759
4760 fCorrelationsPro[1][0][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);
4761 }
4762 else if(type == "RP")
4763 {
4764 //f2pPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);
4765 fCorrelationsPro[0][0][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);
4766 }
4767 } // end of if(mp*dMult-mq)
4768
4769 // 4'-particle correlation:
4770 Double_t four1n1n1n1nPtEta = 0.;
4771 if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
4772 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)
4773 {
4774 four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
4775 - q2n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))
4776 - 2.*q2n0kIm*dReQ1n*dImQ1n
4777 - p1n0kRe*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)
4778 + p1n0kIm*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)
4779 - 2.*dMult*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
4780 - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*mq
4781 + 6.*(q1n0kRe*dReQ1n+q1n0kIm*dImQ1n)
4782 + 1.*(q2n0kRe*dReQ2n+q2n0kIm*dImQ2n)
4783 + 2.*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
4784 + 2.*mq*dMult
4785 - 6.*mq)
4786 / ((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
4787 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
4788
4789 // fill the 2D profile to get the average correlation for each (pt, eta) bin:
4790 if(type == "POI")
4791 {
4792 //f4pPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
4793 // (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
4794 // + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
4795
4796 fCorrelationsPro[1][0][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
4797 (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
4798 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
4799 }
4800 else if(type == "RP")
4801 {
4802 //f4pPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
4803 // (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
4804 // + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
4805
4806 fCorrelationsPro[0][0][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
4807 (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
4808 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
4809 }
4810 } // end of if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
4811 // +mq*(dMult-1.)*(dMult-2.)*(dMult-3.))
4812
4813 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
4814 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
4815
4816
4817
4818
4819
4820} // end of AliFlowAnalysisWithQCumulants::CalculateCorrelationsForDifferentialFlow2D()
4821
4822
4823
4824
4825
4826
4827//================================================================================================================================
4828
4829
4830void AliFlowAnalysisWithQCumulants::CalculateWeightedCorrelationsForDifferentialFlow2D(TString type)
4831{
4832 // calculate all weighted correlations needed for differential flow
4833
4834 if(type == "RP") // to be improved (removed)
4835 {
4836 cout<<endl;
4837 }
4838 // ...
4839
4840
4841
4842
4843 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
4844 Double_t dReQ1n1k = (*fReQ)(0,1);
4845 Double_t dReQ2n2k = (*fReQ)(1,2);
4846 Double_t dReQ1n3k = (*fReQ)(0,3);
4847 //Double_t dReQ4n4k = (*fReQ)(3,4);
4848 Double_t dImQ1n1k = (*fImQ)(0,1);
4849 Double_t dImQ2n2k = (*fImQ)(1,2);
4850 Double_t dImQ1n3k = (*fImQ)(0,3);
4851 //Double_t dImQ4n4k = (*fImQ)(3,4);
4852
4853 // S^M_{p,k} (see .h file for the definition of fSMpk):
4854 Double_t dSM1p1k = (*fSMpk)(0,1);
4855 Double_t dSM1p2k = (*fSMpk)(0,2);
4856 Double_t dSM1p3k = (*fSMpk)(0,3);
4857 Double_t dSM2p1k = (*fSMpk)(1,1);
4858 Double_t dSM3p1k = (*fSMpk)(2,1);
4859
4860 // looping over all (pt,eta) bins and calculating weighted correlations needed for differential flow:
4861 for(Int_t p=1;p<=fnBinsPt;p++)
4862 {
4863 for(Int_t e=1;e<=fnBinsEta;e++)
4864 {
4865 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin):
4866 Double_t p1n0kRe = 0.;
4867 Double_t p1n0kIm = 0.;
4868
4869 // number of POIs in particular (pt,eta) bin):
4870 Double_t mp = 0.;
4871
4872 // real and imaginary parts of q_{m*n,k}:
4873 // (weighted Q-vector evaluated for particles which are both RPs and POIs in particular (pt,eta) bin)
4874 Double_t q1n2kRe = 0.;
4875 Double_t q1n2kIm = 0.;
4876 Double_t q2n1kRe = 0.;
4877 Double_t q2n1kIm = 0.;
4878
4879 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
4880 Double_t s1p1k = 0.;
4881 Double_t s1p2k = 0.;
4882 Double_t s1p3k = 0.;
4883
4884 // M0111 from Eq. (118) in QC2c (to be improved (notation))
4885 Double_t dM0111 = 0.;
4886
4887 if(type == "POI")
4888 {
4889 // p_{m*n,0}:
4890 p1n0kRe = fReEBE2D[1][0][0]->GetBinContent(fReEBE2D[1][0][0]->GetBin(p,e))
4891 * fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e));
4892 p1n0kIm = fImEBE2D[1][0][0]->GetBinContent(fImEBE2D[1][0][0]->GetBin(p,e))
4893 * fImEBE2D[1][0][0]->GetBinEntries(fImEBE2D[1][0][0]->GetBin(p,e));
4894
4895 mp = fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e));
4896
4897 // q_{m*n,k}:
4898 q1n2kRe = fReEBE2D[2][0][2]->GetBinContent(fReEBE2D[2][0][2]->GetBin(p,e))
4899 * fReEBE2D[2][0][2]->GetBinEntries(fReEBE2D[2][0][2]->GetBin(p,e));
4900 q1n2kIm = fImEBE2D[2][0][2]->GetBinContent(fImEBE2D[2][0][2]->GetBin(p,e))
4901 * fImEBE2D[2][0][2]->GetBinEntries(fImEBE2D[2][0][2]->GetBin(p,e));
4902 q2n1kRe = fReEBE2D[2][1][1]->GetBinContent(fReEBE2D[2][1][1]->GetBin(p,e))
4903 * fReEBE2D[2][1][1]->GetBinEntries(fReEBE2D[2][1][1]->GetBin(p,e));
4904 q2n1kIm = fImEBE2D[2][1][1]->GetBinContent(fImEBE2D[2][1][1]->GetBin(p,e))
4905 * fImEBE2D[2][1][1]->GetBinEntries(fImEBE2D[2][1][1]->GetBin(p,e));
4906
4907 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
4908 s1p1k = pow(fs2D[2][1]->GetBinContent(fs2D[2][1]->GetBin(p,e)),1.);
4909 s1p2k = pow(fs2D[2][2]->GetBinContent(fs2D[2][2]->GetBin(p,e)),1.);
4910 s1p3k = pow(fs2D[2][3]->GetBinContent(fs2D[2][3]->GetBin(p,e)),1.);
4911
4912 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
4913 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
4914 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
4915 + 2.*(s1p3k-s1p2k*dSM1p1k));
4916 }
4917 else if(type == "RP")
4918 {
4919 p1n0kRe = fReEBE2D[0][0][0]->GetBinContent(fReEBE2D[0][0][0]->GetBin(p,e))
4920 * fReEBE2D[0][0][0]->GetBinEntries(fReEBE2D[0][0][0]->GetBin(p,e));
4921 p1n0kIm = fImEBE2D[0][0][0]->GetBinContent(fImEBE2D[0][0][0]->GetBin(p,e))
4922 * fImEBE2D[0][0][0]->GetBinEntries(fImEBE2D[0][0][0]->GetBin(p,e));
4923
4924 mp = fReEBE2D[0][0][0]->GetBinEntries(fReEBE2D[0][0][0]->GetBin(p,e));
4925
4926 // q_{m*n,k}:
4927 q1n2kRe = fReEBE2D[0][0][2]->GetBinContent(fReEBE2D[0][0][2]->GetBin(p,e))
4928 * fReEBE2D[0][0][2]->GetBinEntries(fReEBE2D[0][0][2]->GetBin(p,e));
4929 q1n2kIm = fImEBE2D[0][0][2]->GetBinContent(fImEBE2D[0][0][2]->GetBin(p,e))
4930 * fImEBE2D[0][0][2]->GetBinEntries(fImEBE2D[0][0][2]->GetBin(p,e));
4931 q2n1kRe = fReEBE2D[0][1][1]->GetBinContent(fReEBE2D[0][1][1]->GetBin(p,e))
4932 * fReEBE2D[0][1][1]->GetBinEntries(fReEBE2D[0][1][1]->GetBin(p,e));
4933 q2n1kIm = fImEBE2D[0][1][1]->GetBinContent(fImEBE2D[0][1][1]->GetBin(p,e))
4934 * fImEBE2D[0][1][1]->GetBinEntries(fImEBE2D[0][1][1]->GetBin(p,e));
4935
4936 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
4937 s1p1k = pow(fs2D[0][1]->GetBinContent(fs2D[0][1]->GetBin(p,e)),1.);
4938 s1p2k = pow(fs2D[0][2]->GetBinContent(fs2D[0][2]->GetBin(p,e)),1.);
4939 s1p3k = pow(fs2D[0][3]->GetBinContent(fs2D[0][3]->GetBin(p,e)),1.);
4940
4941 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
4942 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
4943 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
4944 + 2.*(s1p3k-s1p2k*dSM1p1k));
4945 //...............................................................................................
4946 }
4947
4948 // 2'-particle correlation:
4949 Double_t two1n1nW0W1PtEta = 0.;
4950 if(mp*dSM1p1k-s1p1k)
4951 {
4952 two1n1nW0W1PtEta = (p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k-s1p1k)
4953 / (mp*dSM1p1k-s1p1k);
4954
4955 // fill the 2D profile to get the average correlation for each (pt, eta) bin:
4956 if(type == "POI")
4957 {
4958 //f2pPtEtaPOIW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,
4959 // mp*dSM1p1k-s1p1k);
4960 fCorrelationsPro[1][1][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,mp*dSM1p1k-s1p1k);
4961 }
4962 else if(type == "RP")
4963 {
4964 //f2pPtEtaRPW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,
4965 // mp*dSM1p1k-s1p1k);
4966 fCorrelationsPro[0][1][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,mp*dSM1p1k-s1p1k);
4967 }
4968 } // end of if(mp*dMult-dmPrimePrimePtEta)
4969
4970 // 4'-particle correlation:
4971 Double_t four1n1n1n1nW0W1W1W1PtEta = 0.;
4972 if(dM0111)
4973 {
4974 four1n1n1n1nW0W1W1W1PtEta = ((pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
4975 - q2n1kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))
4976 - 2.*q2n1kIm*dReQ1n1k*dImQ1n1k
4977 - p1n0kRe*(dReQ1n1k*dReQ2n2k+dImQ1n1k*dImQ2n2k)
4978 + p1n0kIm*(dImQ1n1k*dReQ2n2k-dReQ1n1k*dImQ2n2k)
4979 - 2.*dSM1p2k*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
4980 - 2.*(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*s1p1k
4981 + 6.*(q1n2kRe*dReQ1n1k+q1n2kIm*dImQ1n1k)
4982 + 1.*(q2n1kRe*dReQ2n2k+q2n1kIm*dImQ2n2k)
4983 + 2.*(p1n0kRe*dReQ1n3k+p1n0kIm*dImQ1n3k)
4984 + 2.*s1p1k*dSM1p2k
4985 - 6.*s1p3k)
4986 / dM0111; // to be imropoved (notation of dM0111)
4987
4988 // fill the 2D profile to get the average correlation for each (pt, eta) bin:
4989 if(type == "POI")
4990 {
4991 //f4pPtEtaPOIW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);
4992 fCorrelationsPro[1][1][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);
4993 }
4994 else if(type == "RP")
4995 {
4996 //f4pPtEtaRPW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);
4997 fCorrelationsPro[0][1][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);
4998 }
4999 } // end of if(dM0111)
5000
5001 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
5002 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5003
5004
5005
5006
5007} // end of AliFlowAnalysisWithQCumulants::CalculateWeightedCorrelationsForDifferentialFlow2D(TString type)
5008
5009
5010//================================================================================================================================
5011
5012 */
5013
5014/*
5015void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsForDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights)
5016{
5017 // 1.) Access average for 2D correlations from profiles and store them in 2D final results histograms;
5018 // 2.) Access spread for 2D correlations from profiles, calculate error and store it in 2D final results histograms;
5019 // 3.) Make projections along pt and eta axis and store results and errors in 1D final results histograms.
5020
5021 Int_t typeFlag = -1;
5022 Int_t pWeightsFlag = -1;
5023 Int_t eWeightsFlag = -1;
5024
5025 if(type == "RP")
5026 {
5027 typeFlag = 0;
5028 } else if(type == "POI")
5029 {
5030 typeFlag = 1;
5031 } else
5032 {
5033 cout<<"WARNING: type must be either RP or POI in AFAWQC::FCFDF() !!!!"<<endl;
5034 exit(0);
5035 }
5036
5037 if(!useParticleWeights)
5038 {
5039 pWeightsFlag = 0;
5040 } else
5041 {
5042 pWeightsFlag = 1;
5043 }
5044
5045 if(eventWeights == "exact")
5046 {
5047 eWeightsFlag = 0;
5048 }
5049
5050 // shortcuts:
5051 Int_t t = typeFlag;
5052 Int_t pW = pWeightsFlag;
5053 Int_t eW = eWeightsFlag;
5054
5055 // from 2D histogram fNonEmptyBins2D make two 1D histograms fNonEmptyBins1D in pt and eta (to be improved (i.e. moved somewhere else))
5056 // pt:
5057 for(Int_t p=1;p<fnBinsPt;p++)
5058 {
5059 Double_t contentPt = 0.;
5060 for(Int_t e=1;e<=fnBinsEta;e++)
5061 {
5062 contentPt += (fNonEmptyBins2D[t]->GetBinContent(fNonEmptyBins2D[t]->GetBin(p,e)));
5063 }
5064 fNonEmptyBins1D[t][0]->SetBinContent(p,contentPt);
5065 }
5066 // eta:
5067 for(Int_t e=1;e<fnBinsEta;e++)
5068 {
5069 Double_t contentEta = 0.;
5070 for(Int_t p=1;p<=fnBinsPt;p++)
5071 {
5072 contentEta += (fNonEmptyBins2D[t]->GetBinContent(fNonEmptyBins2D[t]->GetBin(p,e)));
5073 }
5074 fNonEmptyBins1D[t][1]->SetBinContent(e,contentEta);
5075 }
5076
5077 // from 2D profile in (pt,eta) make two 1D profiles in (pt) and (eta):
5078 TProfile *profile[2][4]; // [0=pt,1=eta][correlation index] // to be improved (do not hardwire the correlation index)
5079
5080 for(Int_t pe=0;pe<2;pe++) // pt or eta
5081 {
5082 for(Int_t ci=0;ci<4;ci++) // correlation index
5083 {
5084 if(pe==0) profile[pe][ci] = this->MakePtProjection(fCorrelationsPro[t][pW][eW][ci]);
5085 if(pe==1) profile[pe][ci] = this->MakeEtaProjection(fCorrelationsPro[t][pW][eW][ci]);
5086 }
5087 }
5088
5089 // transfer 2D profile into 2D histogram:
5090 // to be improved (see in documentation if there is a method to transfer values from 2D profile into 2D histogram)
5091 for(Int_t ci=0;ci<4;ci++)
5092 {
5093 for(Int_t p=1;p<=fnBinsPt;p++)
5094 {
5095 for(Int_t e=1;e<=fnBinsEta;e++)
5096 {
5097 Double_t correlation = fCorrelationsPro[t][pW][eW][ci]->GetBinContent(fCorrelationsPro[t][pW][eW][ci]->GetBin(p,e));
5098 Double_t spread = fCorrelationsPro[t][pW][eW][ci]->GetBinError(fCorrelationsPro[t][pW][eW][ci]->GetBin(p,e));
5099 Double_t nEvts = fNonEmptyBins2D[t]->GetBinContent(fNonEmptyBins2D[t]->GetBin(p,e));
5100 Double_t error = 0.;
5101 fFinalCorrelations2D[t][pW][eW][ci]->SetBinContent(fFinalCorrelations2D[t][pW][eW][ci]->GetBin(p,e),correlation);
5102 if(nEvts>0)
5103 {
5104 error = spread/pow(nEvts,0.5);
5105 fFinalCorrelations2D[t][pW][eW][ci]->SetBinError(fFinalCorrelations2D[t][pW][eW][ci]->GetBin(p,e),error);
5106 }
5107 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
5108 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5109 } // end of for(Int_t ci=0;ci<4;ci++)
5110
5111 // transfer 1D profile into 1D histogram (pt):
5112 // to be improved (see in documentation if there is a method to transfer values from 1D profile into 1D histogram)
5113 for(Int_t ci=0;ci<4;ci++)
5114 {
5115 for(Int_t p=1;p<=fnBinsPt;p++)
5116 {
5117 if(profile[0][ci])
5118 {
5119 Double_t correlation = profile[0][ci]->GetBinContent(p);
5120 Double_t spread = profile[0][ci]->GetBinError(p);
5121 Double_t nEvts = fNonEmptyBins1D[t][0]->GetBinContent(p);
5122 Double_t error = 0.;
5123 fFinalCorrelations1D[t][pW][eW][0][ci]->SetBinContent(p,correlation);
5124 if(nEvts>0)
5125 {
5126 error = spread/pow(nEvts,0.5);
5127 fFinalCorrelations1D[t][pW][eW][0][ci]->SetBinError(p,error);
5128 }
5129 }
5130 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5131 } // end of for(Int_t ci=0;ci<4;ci++)
5132
5133 // transfer 1D profile into 1D histogram (eta):
5134 // to be improved (see in documentation if there is a method to transfer values from 1D profile into 1D histogram)
5135 for(Int_t ci=0;ci<4;ci++)
5136 {
5137 for(Int_t e=1;e<=fnBinsEta;e++)
5138 {
5139 if(profile[1][ci])
5140 {
5141 Double_t correlation = profile[1][ci]->GetBinContent(e);
5142 fFinalCorrelations1D[t][pW][eW][1][ci]->SetBinContent(e,correlation);
5143 }
5144 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
5145 } // end of for(Int_t ci=0;ci<4;ci++)
5146
5147} // end of void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsForDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights)
5148*/
5149
5150
5151//================================================================================================================================
5152
5153
5154void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulants(TString type, TString ptOrEta)
5155{
5156 // calcualate cumulants for differential flow from measured correlations
5157 // Remark: cumulants calculated here are NOT corrected for non-uniform acceptance. This correction is applied in the method ...
5158 // to be improved (description)
5159
5160 Int_t typeFlag = -1;
5161 Int_t ptEtaFlag = -1;
5162
5163 if(type == "RP")
5164 {
5165 typeFlag = 0;
5166 } else if(type == "POI")
5167 {
5168 typeFlag = 1;
5169 }
5170
5171 if(ptOrEta == "Pt")
5172 {
5173 ptEtaFlag = 0;
5174 } else if(ptOrEta == "Eta")
5175 {
5176 ptEtaFlag = 1;
5177 }
5178
5179 // shortcuts:
5180 Int_t t = typeFlag;
5181 Int_t pe = ptEtaFlag;
5182
5183 // common:
5184 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
5185
5186 // correlation <<2>>:
5187 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1);
5188
5189 // 1D:
5190 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
5191 {
5192 // reduced correlations:
5193 Double_t twoPrime = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b); // <<2'>>(pt)
5194 Double_t fourPrime = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b); // <<4'>>(pt)
5195 // final statistical error of reduced correlations:
5196 //Double_t twoPrimeError = fFinalCorrelations1D[t][pW][eW][0][0]->GetBinError(p);
5197 // QC{2'}:
5198 Double_t qc2Prime = twoPrime; // QC{2'}
5199 //Double_t qc2PrimeError = twoPrimeError; // final stat. error of QC{2'}
5200 fDiffFlowCumulants[t][pe][0]->SetBinContent(b,qc2Prime);
5201 //fFinalCumulantsPt[t][pW][eW][nua][0]->SetBinError(p,qc2PrimeError);
5202 // QC{4'}:
5203 Double_t qc4Prime = fourPrime - 2.*twoPrime*two; // QC{4'} = <<4'>> - 2*<<2'>><<2>>
5204 fDiffFlowCumulants[t][pe][1]->SetBinContent(b,qc4Prime);
5205 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5206
5207
5208 /*
5209 // 2D (pt,eta):
5210 // to be improved (see documentation if I can do all this without looping)
5211 for(Int_t p=1;p<=fnBinsPt;p++)
5212 {
5213 for(Int_t e=1;e<=fnBinsEta;e++)
5214 {
5215 // reduced correlations:
5216 Double_t twoPrime = fFinalCorrelations2D[t][pW][eW][0]->GetBinContent(fFinalCorrelations2D[t][pW][eW][0]->GetBin(p,e)); // <<2'>>(pt,eta)
5217 Double_t fourPrime = fFinalCorrelations2D[t][pW][eW][1]->GetBinContent(fFinalCorrelations2D[t][pW][eW][1]->GetBin(p,e)); // <<4'>>(pt,eta)
5218 for(Int_t nua=0;nua<2;nua++)
5219 {
5220 // QC{2'}:
5221 Double_t qc2Prime = twoPrime; // QC{2'} = <<2'>>
5222 fFinalCumulants2D[t][pW][eW][nua][0]->SetBinContent(fFinalCumulants2D[t][pW][eW][nua][0]->GetBin(p,e),qc2Prime);
5223 // QC{4'}:
5224 Double_t qc4Prime = fourPrime - 2.*twoPrime*two; // QC{4'} = <<4'>> - 2*<<2'>><<2>>
5225 fFinalCumulants2D[t][pW][eW][nua][1]->SetBinContent(fFinalCumulants2D[t][pW][eW][nua][1]->GetBin(p,e),qc4Prime);
5226 } // end of for(Int_t nua=0;nua<2;nua++)
5227 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
5228 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5229 */
5230
5231} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulants(TString type, Bool_t useParticleWeights, TString eventWeights);
5232
5233
5234//================================================================================================================================
5235
5236
5237void AliFlowAnalysisWithQCumulants::CalculateFinalResultsForRPandPOIIntegratedFlow(TString type)
5238{
5239 // calculate final results for integrated flow of RPs and POIs
5240
5241 Int_t typeFlag = -1;
5242
5243 if(type == "RP")
5244 {
5245 typeFlag = 0;
5246 } else if(type == "POI")
5247 {
5248 typeFlag = 1;
5249 } else
5250 {
5251 cout<<"WARNING: type must be either RP or POI in AFAWQC::CDF() !!!!"<<endl;
5252 exit(0);
5253 }
5254
5255 // shortcuts:
5256 Int_t t = typeFlag;
5257
5258 // pt yield:
5259 TH1F *yield2ndPt = NULL;
5260 TH1F *yield4thPt = NULL;
5261 TH1F *yield6thPt = NULL;
5262 TH1F *yield8thPt = NULL;
5263
5264 if(type == "POI")
5265 {
5266 yield2ndPt = (TH1F*)(fCommonHists2nd->GetHistPtPOI())->Clone();
5267 yield4thPt = (TH1F*)(fCommonHists4th->GetHistPtPOI())->Clone();
5268 yield6thPt = (TH1F*)(fCommonHists6th->GetHistPtPOI())->Clone();
5269 yield8thPt = (TH1F*)(fCommonHists8th->GetHistPtPOI())->Clone();
5270 }
5271 else if(type == "RP")
5272 {
5273 yield2ndPt = (TH1F*)(fCommonHists2nd->GetHistPtRP())->Clone();
5274 yield4thPt = (TH1F*)(fCommonHists4th->GetHistPtRP())->Clone();
5275 yield6thPt = (TH1F*)(fCommonHists6th->GetHistPtRP())->Clone();
5276 yield8thPt = (TH1F*)(fCommonHists8th->GetHistPtRP())->Clone();
5277 }
5278
5279 Int_t nBinsPt = yield2ndPt->GetNbinsX();
5280
5281 TH1D *flow2ndPt = NULL;
5282 TH1D *flow4thPt = NULL;
5283 TH1D *flow6thPt = NULL;
5284 TH1D *flow8thPt = NULL;
5285
5286 // to be improved (hardwired pt index)
5287 flow2ndPt = (TH1D*)fDiffFlow[t][0][0]->Clone();
5288 flow4thPt = (TH1D*)fDiffFlow[t][0][1]->Clone();
5289 flow6thPt = (TH1D*)fDiffFlow[t][0][2]->Clone();
5290 flow8thPt = (TH1D*)fDiffFlow[t][0][3]->Clone();
5291
5292 Double_t dvn2nd = 0., dvn4th = 0., dvn6th = 0., dvn8th = 0.; // differential flow
5293 Double_t dErrvn2nd = 0., dErrvn4th = 0., dErrvn6th = 0., dErrvn8th = 0.; // error on differential flow
5294
5295 Double_t dVn2nd = 0., dVn4th = 0., dVn6th = 0., dVn8th = 0.; // integrated flow
5296 Double_t dErrVn2nd = 0., dErrVn4th = 0., dErrVn6th = 0., dErrVn8th = 0.; // error on integrated flow
5297
5298 Double_t dYield2nd = 0., dYield4th = 0., dYield6th = 0., dYield8th = 0.; // pt yield
5299 Double_t dSum2nd = 0., dSum4th = 0., dSum6th = 0., dSum8th = 0.; // needed for normalizing integrated flow
5300
5301 // looping over pt bins:
5302 for(Int_t p=1;p<nBinsPt+1;p++)
5303 {
5304 dvn2nd = flow2ndPt->GetBinContent(p);
5305 dvn4th = flow4thPt->GetBinContent(p);
5306 dvn6th = flow6thPt->GetBinContent(p);
5307 dvn8th = flow8thPt->GetBinContent(p);
5308
5309 dErrvn2nd = flow2ndPt->GetBinError(p);
5310 dErrvn4th = flow4thPt->GetBinError(p);
5311 dErrvn6th = flow6thPt->GetBinError(p);
5312 dErrvn8th = flow8thPt->GetBinError(p);
5313
5314 dYield2nd = yield2ndPt->GetBinContent(p);
5315 dYield4th = yield4thPt->GetBinContent(p);
5316 dYield6th = yield6thPt->GetBinContent(p);
5317 dYield8th = yield8thPt->GetBinContent(p);
5318
5319 dVn2nd += dvn2nd*dYield2nd;
5320 dVn4th += dvn4th*dYield4th;
5321 dVn6th += dvn6th*dYield6th;
5322 dVn8th += dvn8th*dYield8th;
5323
5324 dSum2nd += dYield2nd;
5325 dSum4th += dYield4th;
5326 dSum6th += dYield6th;
5327 dSum8th += dYield8th;
5328
5329 dErrVn2nd += dYield2nd*dYield2nd*dErrvn2nd*dErrvn2nd; // ro be improved (check this relation)
5330 dErrVn4th += dYield4th*dYield4th*dErrvn4th*dErrvn4th;
5331 dErrVn6th += dYield6th*dYield6th*dErrvn6th*dErrvn6th;
5332 dErrVn8th += dYield8th*dYield8th*dErrvn8th*dErrvn8th;
5333
5334 } // end of for(Int_t p=1;p<nBinsPt+1;p++)
5335
5336 // normalizing the results for integrated flow:
5337 if(dSum2nd)
5338 {
5339 dVn2nd /= dSum2nd;
5340 dErrVn2nd /= (dSum2nd*dSum2nd);
5341 dErrVn2nd = TMath::Sqrt(dErrVn2nd);
5342 }
5343 if(dSum4th)
5344 {
5345 dVn4th /= dSum4th;
5346 dErrVn4th /= (dSum4th*dSum4th);
5347 dErrVn4th = TMath::Sqrt(dErrVn4th);
5348 }
5349 //if(dSum6th) dVn6th/=dSum6th;
5350 //if(dSum8th) dVn8th/=dSum8th;
5351
5352 // storing the results for integrated flow in common histos: (to be improved: new method for this?)
5353 if(type == "POI")
5354 {
5355 fCommonHistsResults2nd->FillIntegratedFlowPOI(dVn2nd,dErrVn2nd);
5356 fCommonHistsResults4th->FillIntegratedFlowPOI(dVn4th,dErrVn4th);
5357 fCommonHistsResults6th->FillIntegratedFlowPOI(dVn6th,0.); // to be improved (errors)
5358 fCommonHistsResults8th->FillIntegratedFlowPOI(dVn8th,0.); // to be improved (errors)
5359 }
5360 else if (type == "RP")
5361 {
5362 fCommonHistsResults2nd->FillIntegratedFlowRP(dVn2nd,dErrVn2nd);
5363 fCommonHistsResults4th->FillIntegratedFlowRP(dVn4th,dErrVn4th);
5364 fCommonHistsResults6th->FillIntegratedFlowRP(dVn6th,0.); // to be improved (errors)
5365 fCommonHistsResults8th->FillIntegratedFlowRP(dVn8th,0.); // to be improved (errors)
5366 }
5367
5368 delete flow2ndPt;
5369 delete flow4thPt;
5370 //delete flow6thPt;
5371 //delete flow8thPt;
5372
5373 delete yield2ndPt;
5374 delete yield4thPt;
5375 delete yield6thPt;
5376 delete yield8thPt;
5377
5378} // end of AliFlowAnalysisWithQCumulants::CalculateFinalResultsForRPandPOIIntegratedFlow(TString type)
5379
5380
5381//================================================================================================================================
5382
5383
5384void AliFlowAnalysisWithQCumulants::InitializeArraysForDistributions()
5385{
5386 // Initialize all arrays used for distributions.
5387
5388 // a) Initialize arrays of histograms used to hold distributions of correlations;
5389 // b) Initialize array to hold min and max values of correlations.
5390
5391 // a) Initialize arrays of histograms used to hold distributions of correlations:
5392 for(Int_t di=0;di<4;di++) // distribution index
5393 {
5394 fDistributions[di] = NULL;
5395 }
5396
5397 // b) Initialize default min and max values of correlations:
5398 // (Remark: The default values bellow were chosen for v2=5% and M=500)
5399 fMinValueOfCorrelation[0] = -0.01; // <2>_min
5400 fMaxValueOfCorrelation[0] = 0.04; // <2>_max
5401 fMinValueOfCorrelation[1] = -0.00002; // <4>_min
5402 fMaxValueOfCorrelation[1] = 0.00015; // <4>_max
5403 fMinValueOfCorrelation[2] = -0.0000003; // <6>_min
5404 fMaxValueOfCorrelation[2] = 0.0000006; // <6>_max
5405 fMinValueOfCorrelation[3] = -0.000000006; // <8>_min
5406 fMaxValueOfCorrelation[3] = 0.000000003; // <8>_max
5407
5408} // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForDistributions()
5409
5410
5411//================================================================================================================================
5412
5413
5414void AliFlowAnalysisWithQCumulants::BookEverythingForDistributions()
5415{
5416 // a) Book profile to hold all flags for distributions of correlations;
5417 // b) Book all histograms to hold distributions of correlations.
5418
5419 TString correlationIndex[4] = {"<2>","<4>","<6>","<8>"}; // to be improved (should I promote this to data members?)
5420
5421 // a) Book profile to hold all flags for distributions of correlations:
5422 TString distributionsFlagsName = "fDistributionsFlags";
5423 distributionsFlagsName += fAnalysisLabel->Data();
5424 fDistributionsFlags = new TProfile(distributionsFlagsName.Data(),"Flags for Distributions of Correlations",9,0,9);
5425 fDistributionsFlags->SetTickLength(-0.01,"Y");
5426 fDistributionsFlags->SetMarkerStyle(25);
5427 fDistributionsFlags->SetLabelSize(0.05);
5428 fDistributionsFlags->SetLabelOffset(0.02,"Y");
5429 fDistributionsFlags->GetXaxis()->SetBinLabel(1,"Store or not?");
5430 fDistributionsFlags->GetXaxis()->SetBinLabel(2,"<2>_{min}");
5431 fDistributionsFlags->GetXaxis()->SetBinLabel(3,"<2>_{max}");
5432 fDistributionsFlags->GetXaxis()->SetBinLabel(4,"<4>_{min}");
5433 fDistributionsFlags->GetXaxis()->SetBinLabel(5,"<4>_{max}");
5434 fDistributionsFlags->GetXaxis()->SetBinLabel(6,"<6>_{min}");
5435 fDistributionsFlags->GetXaxis()->SetBinLabel(7,"<6>_{max}");
5436 fDistributionsFlags->GetXaxis()->SetBinLabel(8,"<8>_{min}");
5437 fDistributionsFlags->GetXaxis()->SetBinLabel(9,"<8>_{max}");
5438 fDistributionsList->Add(fDistributionsFlags);
5439
5440 // b) Book all histograms to hold distributions of correlations.
5441 if(fStoreDistributions)
5442 {
5443 TString distributionsName = "fDistributions";
5444 distributionsName += fAnalysisLabel->Data();
5445 for(Int_t di=0;di<4;di++) // distribution index
5446 {
5447 fDistributions[di] = new TH1D(Form("Distribution of %s",correlationIndex[di].Data()),Form("Distribution of %s",correlationIndex[di].Data()),10000,fMinValueOfCorrelation[di],fMaxValueOfCorrelation[di]);
5448 fDistributions[di]->SetXTitle(correlationIndex[di].Data());
5449 fDistributionsList->Add(fDistributions[di]);
5450 } // end of for(Int_t di=0;di<4;di++) // distribution index
5451 } // end of if(fStoreDistributions)
5452
5453} // end of void AliFlowAnalysisWithQCumulants::BookEverythingForDistributions()
5454
5455
5456//================================================================================================================================
5457
5458
5459void AliFlowAnalysisWithQCumulants::StoreFlagsForDistributions()
5460{
5461 // Store all flags for distributiuons of correlations in profile fDistributionsFlags.
5462
5463 if(!fDistributionsFlags)
5464 {
5465 cout<<"WARNING: fDistributionsFlags is NULL in AFAWQC::SDF() !!!!"<<endl;
5466 exit(0);
5467 }
5468
5469 fDistributionsFlags->Fill(0.5,(Int_t)fStoreDistributions); // histos with distributions of correlations stored or not in the output file
5470 // store min and max values of correlations:
5471 for(Int_t di=0;di<4;di++) // distribution index
5472 {
5473 fDistributionsFlags->Fill(1.5+2.*(Double_t)di,fMinValueOfCorrelation[di]);
5474 fDistributionsFlags->Fill(2.5+2.*(Double_t)di,fMaxValueOfCorrelation[di]);
5475 }
5476
5477} // end of void AliFlowAnalysisWithQCumulants::StoreFlagsForDistributions()
5478
5479
5480//================================================================================================================================
5481
5482
5483void AliFlowAnalysisWithQCumulants::StoreDistributionsOfCorrelations()
5484{
5485 // Store distributions of correlations.
5486
5487 if(!(fIntFlowCorrelationsEBE && fIntFlowEventWeightsForCorrelationsEBE))
5488 {
5489 cout<<"WARNING: fIntFlowCorrelationsEBE && fIntFlowEventWeightsForCorrelationsEBE"<<endl;
5490 cout<<" is NULL in AFAWQC::SDOC() !!!!"<<endl;
5491 exit(0);
5492 }
5493
5494 for(Int_t di=0;di<4;di++) // distribution index
5495 {
5496 if(!fDistributions[di])
5497 {
5498 cout<<"WARNING: fDistributions[di] is NULL in AFAWQC::SDOC() !!!!"<<endl;
5499 cout<<"di = "<<di<<endl;
5500 exit(0);
5501 } else
5502 {
5503 fDistributions[di]->Fill(fIntFlowCorrelationsEBE->GetBinContent(di+1),fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(di+1));
5504 }
5505 } // end of for(Int_t di=0;di<4;di++) // distribution index
5506
5507} // end of void AliFlowAnalysisWithQCumulants::StoreDistributionsOfCorrelations()
5508
5509
5510//================================================================================================================================
5511
5512
5513void AliFlowAnalysisWithQCumulants::BookAndNestAllLists()
5514{
5515 // Book and nest all lists nested in the base list fHistList.
5516 // a) Book and nest lists for integrated flow;
5517 // b) Book and nest lists for differential flow;
5518 // c) Book and nest list for particle weights;
5519 // d) Book and nest list for distributions;
5520 // e) Book and nest list for nested loops;
5521
5522 // a) Book and nest all lists for integrated flow:
5523 // base list for integrated flow:
5524 fIntFlowList = new TList();
5525 fIntFlowList->SetName("Integrated Flow");
5526 fIntFlowList->SetOwner(kTRUE);
5527 fHistList->Add(fIntFlowList);
5528 // list holding profiles:
5529 fIntFlowProfiles = new TList();
5530 fIntFlowProfiles->SetName("Profiles");
5531 fIntFlowProfiles->SetOwner(kTRUE);
5532 fIntFlowList->Add(fIntFlowProfiles);
5533 // list holding histograms with results:
5534 fIntFlowResults = new TList();
5535 fIntFlowResults->SetName("Results");
5536 fIntFlowResults->SetOwner(kTRUE);
5537 fIntFlowList->Add(fIntFlowResults);
5538
5539 // b) Book and nest lists for differential flow;
5540 fDiffFlowList = new TList();
5541 fDiffFlowList->SetName("Differential Flow");
5542 fDiffFlowList->SetOwner(kTRUE);
5543 fHistList->Add(fDiffFlowList);
5544 // list holding profiles:
5545 fDiffFlowProfiles = new TList();
5546 fDiffFlowProfiles->SetName("Profiles");
5547 fDiffFlowProfiles->SetOwner(kTRUE);
5548 fDiffFlowList->Add(fDiffFlowProfiles);
5549 // list holding histograms with results:
5550 fDiffFlowResults = new TList();
5551 fDiffFlowResults->SetName("Results");
5552 fDiffFlowResults->SetOwner(kTRUE);
5553 fDiffFlowList->Add(fDiffFlowResults);
5554 // flags used for naming nested lists in list fDiffFlowProfiles and fDiffFlowResults:
5555 TList list;
5556 list.SetOwner(kTRUE);
5557 TString typeFlag[2] = {"RP","POI"};
5558 TString ptEtaFlag[2] = {"p_{T}","#eta"};
5559 TString powerFlag[2] = {"linear","quadratic"};
5560 // nested lists in fDiffFlowProfiles (~/Differential Flow/Profiles):
5561 for(Int_t t=0;t<2;t++) // type: RP or POI
5562 {
5563 for(Int_t pe=0;pe<2;pe++) // pt or eta
5564 {
5565 // list holding profiles with correlations:
5566 fDiffFlowCorrelationsProList[t][pe] = (TList*)list.Clone();
5567 fDiffFlowCorrelationsProList[t][pe]->SetName(Form("Profiles with correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5568 fDiffFlowProfiles->Add(fDiffFlowCorrelationsProList[t][pe]);
5569 // list holding profiles with products of correlations:
5570 fDiffFlowProductOfCorrelationsProList[t][pe] = (TList*)list.Clone();
5571 fDiffFlowProductOfCorrelationsProList[t][pe]->SetName(Form("Profiles with products of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5572 fDiffFlowProfiles->Add(fDiffFlowProductOfCorrelationsProList[t][pe]);
5573 // list holding profiles with corrections:
5574 fDiffFlowCorrectionsProList[t][pe] = (TList*)list.Clone();
5575 fDiffFlowCorrectionsProList[t][pe]->SetName(Form("Profiles with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5576 fDiffFlowProfiles->Add(fDiffFlowCorrectionsProList[t][pe]);
5577 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
5578 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
5579 // nested lists in fDiffFlowResults (~/Differential Flow/Results):
5580 for(Int_t t=0;t<2;t++) // type: RP or POI
5581 {
5582 for(Int_t pe=0;pe<2;pe++) // pt or eta
5583 {
5584 // list holding histograms with correlations:
5585 fDiffFlowCorrelationsHistList[t][pe] = (TList*)list.Clone();
5586 fDiffFlowCorrelationsHistList[t][pe]->SetName(Form("Correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5587 fDiffFlowResults->Add(fDiffFlowCorrelationsHistList[t][pe]);
5588 // list holding histograms with corrections:
5589 fDiffFlowCorrectionsHistList[t][pe] = (TList*)list.Clone();
5590 fDiffFlowCorrectionsHistList[t][pe]->SetName(Form("Histograms with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5591 fDiffFlowResults->Add(fDiffFlowCorrectionsHistList[t][pe]);
5592 for(Int_t power=0;power<2;power++)
5593 {
5594 // list holding histograms with sums of event weights:
5595 fDiffFlowSumOfEventWeightsHistList[t][pe][power] = (TList*)list.Clone();
5596 fDiffFlowSumOfEventWeightsHistList[t][pe][power]->SetName(Form("Sum of %s event weights (%s, %s)",powerFlag[power].Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5597 fDiffFlowResults->Add(fDiffFlowSumOfEventWeightsHistList[t][pe][power]);
5598 } // end of for(Int_t power=0;power<2;power++)
5599 // list holding histograms with sums of products of event weights:
5600 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe] = (TList*)list.Clone();
5601 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]->SetName(Form("Sum of products of event weights (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5602 fDiffFlowResults->Add(fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]);
5603 // list holding histograms with covariances of correlations:
5604 fDiffFlowCovariancesHistList[t][pe] = (TList*)list.Clone();
5605 fDiffFlowCovariancesHistList[t][pe]->SetName(Form("Covariances of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5606 fDiffFlowResults->Add(fDiffFlowCovariancesHistList[t][pe]);
5607 // list holding histograms with differential Q-cumulants:
5608 fDiffFlowCumulantsHistList[t][pe] = (TList*)list.Clone();
5609 fDiffFlowCumulantsHistList[t][pe]->SetName(Form("Differential Q-cumulants (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5610 fDiffFlowResults->Add(fDiffFlowCumulantsHistList[t][pe]);
5611 // list holding histograms with differential flow estimates from Q-cumulants:
5612 fDiffFlowHistList[t][pe] = (TList*)list.Clone();
5613 fDiffFlowHistList[t][pe]->SetName(Form("Differential flow (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5614 fDiffFlowResults->Add(fDiffFlowHistList[t][pe]);
5615 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
5616 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
5617
5618 // c) Book and nest list for particle weights:
5619 fWeightsList->SetName("Weights");
5620 fWeightsList->SetOwner(kTRUE);
5621 fHistList->Add(fWeightsList);
5622
5623 // d) Book and nest list for distributions:
5624 fDistributionsList = new TList();
5625 fDistributionsList->SetName("Distributions");
5626 fDistributionsList->SetOwner(kTRUE);
5627 fHistList->Add(fDistributionsList);
5628
5629 // e) Book and nest list for nested loops:
5630 fNestedLoopsList = new TList();
5631 fNestedLoopsList->SetName("Nested Loops");
5632 fNestedLoopsList->SetOwner(kTRUE);
5633 fHistList->Add(fNestedLoopsList);
5634
5635} // end of void AliFlowAnalysisWithQCumulants::BookAndNestAllLists()
5636
5637
5638//================================================================================================================================
5639
5640
5641void AliFlowAnalysisWithQCumulants::FillCommonHistResultsDiffFlow(TString type)
5642{
5643 // fill common result histograms for differential flow
5644
5645 Int_t typeFlag = -1;
5646 //Int_t ptEtaFlag = -1;
5647
5648 if(type == "RP")
5649 {
5650 typeFlag = 0;
5651 } else if(type == "POI")
5652 {
5653 typeFlag = 1;
5654 }
5655
5656 // shortcuts:
5657 Int_t t = typeFlag;
5658 //Int_t pe = ptEtaFlag;
5659
5660 // to be improved (implement protection here)
5661
5662 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
5663 {
5664 cout<<"WARNING: fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th"<<endl;
5665 cout<<" is NULL in AFAWQC::FCHRIF() !!!!"<<endl;
5666 exit(0);
5667 }
5668
5669 // pt:
5670 for(Int_t p=1;p<=fnBinsPt;p++)
5671 {
5672 Double_t v2 = fDiffFlow[t][0][0]->GetBinContent(p);
5673 Double_t v4 = fDiffFlow[t][0][1]->GetBinContent(p);
5674 Double_t v6 = fDiffFlow[t][0][2]->GetBinContent(p);
5675 Double_t v8 = fDiffFlow[t][0][3]->GetBinContent(p);
5676
5677 Double_t v2Error = fDiffFlow[t][0][0]->GetBinError(p);
5678 Double_t v4Error = fDiffFlow[t][0][1]->GetBinError(p);
5679 //Double_t v6Error = fFinalFlow1D[t][pW][nua][0][2]->GetBinError(p);
5680 //Double_t v8Error = fFinalFlow1D[t][pW][nua][0][3]->GetBinError(p);
5681
5682 if(type == "RP")
5683 {
5684 fCommonHistsResults2nd->FillDifferentialFlowPtRP(p,v2,v2Error);
5685 fCommonHistsResults4th->FillDifferentialFlowPtRP(p,v4,v4Error);
5686 fCommonHistsResults6th->FillDifferentialFlowPtRP(p,v6,0.);
5687 fCommonHistsResults8th->FillDifferentialFlowPtRP(p,v8,0.);
5688 } else if(type == "POI")
5689 {
5690 fCommonHistsResults2nd->FillDifferentialFlowPtPOI(p,v2,v2Error);
5691 fCommonHistsResults4th->FillDifferentialFlowPtPOI(p,v4,v4Error);
5692 fCommonHistsResults6th->FillDifferentialFlowPtPOI(p,v6,0.);
5693 fCommonHistsResults8th->FillDifferentialFlowPtPOI(p,v8,0.);
5694 }
5695 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5696
5697 // eta:
5698 for(Int_t e=1;e<=fnBinsEta;e++)
5699 {
5700 Double_t v2 = fDiffFlow[t][1][0]->GetBinContent(e);
5701 Double_t v4 = fDiffFlow[t][1][1]->GetBinContent(e);
5702 Double_t v6 = fDiffFlow[t][1][2]->GetBinContent(e);
5703 Double_t v8 = fDiffFlow[t][1][3]->GetBinContent(e);
5704
5705 Double_t v2Error = fDiffFlow[t][1][0]->GetBinError(e);
5706 Double_t v4Error = fDiffFlow[t][1][1]->GetBinError(e);
5707 //Double_t v6Error = fDiffFlow[t][1][2]->GetBinError(e);
5708 //Double_t v8Error = fDiffFlow[t][1][3]->GetBinError(e);
5709
5710 if(type == "RP")
5711 {
5712 fCommonHistsResults2nd->FillDifferentialFlowEtaRP(e,v2,v2Error);
5713 fCommonHistsResults4th->FillDifferentialFlowEtaRP(e,v4,v4Error);
5714 fCommonHistsResults6th->FillDifferentialFlowEtaRP(e,v6,0.);
5715 fCommonHistsResults8th->FillDifferentialFlowEtaRP(e,v8,0.);
5716 } else if(type == "POI")
5717 {
5718 fCommonHistsResults2nd->FillDifferentialFlowEtaPOI(e,v2,v2Error);
5719 fCommonHistsResults4th->FillDifferentialFlowEtaPOI(e,v4,v4Error);
5720 fCommonHistsResults6th->FillDifferentialFlowEtaPOI(e,v6,0.);
5721 fCommonHistsResults8th->FillDifferentialFlowEtaPOI(e,v8,0.);
5722 }
5723 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
5724
5725} // end of void AliFlowAnalysisWithQCumulants::FillCommonHistResultsDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights, Bool_t correctedForNUA)
5726
5727
5728//================================================================================================================================
5729
5730
5731void AliFlowAnalysisWithQCumulants::AccessConstants()
5732{
5733 // Access needed common constants from AliFlowCommonConstants
5734
5735 fnBinsPhi = AliFlowCommonConstants::GetMaster()->GetNbinsPhi();
5736 fPhiMin = AliFlowCommonConstants::GetMaster()->GetPhiMin();
5737 fPhiMax = AliFlowCommonConstants::GetMaster()->GetPhiMax();
5738 if(fnBinsPhi) fPhiBinWidth = (fPhiMax-fPhiMin)/fnBinsPhi;
5739 fnBinsPt = AliFlowCommonConstants::GetMaster()->GetNbinsPt();
5740 fPtMin = AliFlowCommonConstants::GetMaster()->GetPtMin();
5741 fPtMax = AliFlowCommonConstants::GetMaster()->GetPtMax();
5742 if(fnBinsPt) fPtBinWidth = (fPtMax-fPtMin)/fnBinsPt;
5743 fnBinsEta = AliFlowCommonConstants::GetMaster()->GetNbinsEta();
5744 fEtaMin = AliFlowCommonConstants::GetMaster()->GetEtaMin();
5745 fEtaMax = AliFlowCommonConstants::GetMaster()->GetEtaMax();
5746 if(fnBinsEta) fEtaBinWidth = (fEtaMax-fEtaMin)/fnBinsEta;
5747
5748} // end of void AliFlowAnalysisWithQCumulants::AccessConstants()
5749
5750
5751//================================================================================================================================
5752
5753
5754void AliFlowAnalysisWithQCumulants::CrossCheckSettings()
5755{
5756 // a) Cross check if the choice for multiplicity weights make sense;
5757
5758 // a) Cross check if the choice for multiplicity weights make sense:
5759 if(strcmp(fMultiplicityWeight->Data(),"combinations") &&
5760 strcmp(fMultiplicityWeight->Data(),"unit") &&
5761 strcmp(fMultiplicityWeight->Data(),"multiplicity"))
5762 {
5763 cout<<"WARNING (QC): Multiplicity weight can be either \"combinations\", \"unit\""<<endl;
5764 cout<<" or \"multiplicity\". Certainly not \""<<fMultiplicityWeight->Data()<<"\"."<<endl;
5765 exit(0);
5766 }
5767
5768} // end of void AliFlowAnalysisWithQCumulants::CrossCheckSettings()
5769
489d5531 5770//================================================================================================================================
5771
489d5531 5772void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeights()
5773{
0328db2d 5774 // Calculate sum of linear and quadratic event weights for correlations.
ff70ca91 5775
5776 // multiplicity:
5777 Double_t dMult = (*fSMpk)(0,0);
0328db2d 5778
489d5531 5779 for(Int_t p=0;p<2;p++) // power-1
5780 {
5781 for(Int_t ci=0;ci<4;ci++) // correlation index
5782 {
5783 fIntFlowSumOfEventWeights[p]->Fill(ci+0.5,pow(fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci+1),p+1));
ff70ca91 5784 fIntFlowSumOfEventWeightsVsM[ci][p]->Fill(dMult+0.5,pow(fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci+1),p+1));
489d5531 5785 }
5786 }
5787
5788} // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeights()
5789
489d5531 5790//================================================================================================================================
5791
0328db2d 5792void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeightsNUA()
489d5531 5793{
0328db2d 5794 // Calculate sum of linear and quadratic event weights for NUA terms.
5795
5796 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
489d5531 5797 {
0328db2d 5798 for(Int_t p=0;p<2;p++) // power-1
5799 {
5800 for(Int_t ci=0;ci<3;ci++) // nua term index
5801 {
5802 fIntFlowSumOfEventWeightsNUA[sc][p]->Fill(ci+0.5,pow(fIntFlowEventWeightForCorrectionTermsForNUAEBE[sc]->GetBinContent(ci+1),p+1));
489d5531 5803 }
0328db2d 5804 }
5805 }
5806
5807} // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeightsNUA()
489d5531 5808
0328db2d 5809//================================================================================================================================
5810
0328db2d 5811void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfProductOfEventWeights()
5812{
ff70ca91 5813 // Calculate sum of product of event weights for correlations.
5814
5815 // multiplicity:
5816 Double_t dMult = (*fSMpk)(0,0);
489d5531 5817
489d5531 5818 Int_t counter = 0;
5819
5820 for(Int_t ci1=1;ci1<4;ci1++)
5821 {
5822 for(Int_t ci2=ci1+1;ci2<=4;ci2++)
5823 {
ff70ca91 5824 fIntFlowSumOfProductOfEventWeights->Fill(0.5+counter,
5825 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
5826 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
5827 fIntFlowSumOfProductOfEventWeightsVsM[counter]->Fill(dMult+0.5,
5828 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
5829 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
5830 counter++;
489d5531 5831 }
5832 }
5833
0328db2d 5834} // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfProductOfEventWeights()
5835
0328db2d 5836//================================================================================================================================
5837
0328db2d 5838void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfProductOfEventWeightsNUA()
5839{
5840 // Calculate sum of product of event weights for NUA terms.
5841
5842 // w_{<2>} * w_{<cos(#phi)>}:
5843 fIntFlowSumOfProductOfEventWeightsNUA->Fill(0.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
5844 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
5845 // w_{<2>} * w_{<sin(#phi)>}:
5846 fIntFlowSumOfProductOfEventWeightsNUA->Fill(1.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
5847 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
5848 // w_{<cos(#phi)> * w_{<sin(#phi)>}:
5849 fIntFlowSumOfProductOfEventWeightsNUA->Fill(2.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
5850 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
5851 // w_{<2>} * w{<cos(phi1+phi2)>}
5852 fIntFlowSumOfProductOfEventWeightsNUA->Fill(3.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
5853 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
5854 // w_{<2>} * w{<sin(phi1+phi2)>}
5855 fIntFlowSumOfProductOfEventWeightsNUA->Fill(4.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
5856 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
5857 // w_{<2>} * w{<cos(phi1-phi2-phi3)>}
5858 fIntFlowSumOfProductOfEventWeightsNUA->Fill(5.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
5859 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
5860 // w_{<2>} * w{<sin(phi1-phi2-phi3)>}
5861 fIntFlowSumOfProductOfEventWeightsNUA->Fill(6.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
5862 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
5863 // w_{<4>} * w{<cos(phi1)>}
5864 fIntFlowSumOfProductOfEventWeightsNUA->Fill(7.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
5865 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
5866 // w_{<4>} * w{<sin(phi1)>}
5867 fIntFlowSumOfProductOfEventWeightsNUA->Fill(8.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
5868 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
5869 // w_{<4>} * w{<cos(phi1+phi2)>}
5870 fIntFlowSumOfProductOfEventWeightsNUA->Fill(9.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
5871 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
5872 // w_{<4>} * w{<sin(phi1+phi2)>}
5873 fIntFlowSumOfProductOfEventWeightsNUA->Fill(10.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
5874 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
5875 // w_{<4>} * w{<cos(phi1-phi2-phi3)>}
5876 fIntFlowSumOfProductOfEventWeightsNUA->Fill(11.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
5877 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
5878 // w_{<4>} * w{<sin(phi1-phi2-phi3)>}
5879 fIntFlowSumOfProductOfEventWeightsNUA->Fill(12.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
5880 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
5881 // w_{<cos(phi1)>} * w{<cos(phi1+phi2)>}
5882 fIntFlowSumOfProductOfEventWeightsNUA->Fill(13.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
5883 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
5884 // w_{<cos(phi1)>} * w{<sin(phi1+phi2)>}
5885 fIntFlowSumOfProductOfEventWeightsNUA->Fill(14.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
5886 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
5887 // w_{<cos(phi1)>} * w{<cos(phi1-phi2-phi3)>}
5888 fIntFlowSumOfProductOfEventWeightsNUA->Fill(15.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
5889 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
5890 // w_{<cos(phi1)>} * w{<sin(phi1-phi2-phi3)>}
5891 fIntFlowSumOfProductOfEventWeightsNUA->Fill(16.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
5892 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
5893 // w_{<sin(phi1)>} * w{<cos(phi1+phi2)>}
5894 fIntFlowSumOfProductOfEventWeightsNUA->Fill(17.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
5895 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
5896 // w_{<sin(phi1)>} * w{<sin(phi1+phi2)>}
5897 fIntFlowSumOfProductOfEventWeightsNUA->Fill(18.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
5898 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
5899 // w_{<sin(phi1)>} * w{<cos(phi1-phi2-phi3)>}
5900 fIntFlowSumOfProductOfEventWeightsNUA->Fill(19.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
5901 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
5902 // w_{<sin(phi1)>} * w{<sin(phi1-phi2-phi3)>}
5903 fIntFlowSumOfProductOfEventWeightsNUA->Fill(20.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
5904 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
5905 // w_{<cos(phi1+phi2)>} * w{<sin(phi1+phi2))>}
5906 fIntFlowSumOfProductOfEventWeightsNUA->Fill(21.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)*
5907 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
5908 // w_{<cos(phi1+phi2)>} * w{<cos(phi1-phi2-phi3)>}
5909 fIntFlowSumOfProductOfEventWeightsNUA->Fill(22.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)*
5910 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
5911 // w_{<cos(phi1+phi2)>} * w{<sin(phi1-phi2-phi3)>}
5912 fIntFlowSumOfProductOfEventWeightsNUA->Fill(23.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)*
5913 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
5914 // w_{<sin(phi1+phi2)>} * w{<cos(phi1-phi2-phi3)>}
5915 fIntFlowSumOfProductOfEventWeightsNUA->Fill(24.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)*
5916 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
5917 // w_{<sin(phi1+phi2)>} * w{<sin(phi1-phi2-phi3)>}
5918 fIntFlowSumOfProductOfEventWeightsNUA->Fill(25.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)*
5919 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
5920 // w_{<cos(phi1-phi2-phi3)>} * w{<sin(phi1-phi2-phi3)>}
5921 fIntFlowSumOfProductOfEventWeightsNUA->Fill(26.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3)*
5922 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
5923
5924} // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowIntFlowSumOfProductOfEventWeightsNUA()
489d5531 5925
5926
5927//================================================================================================================================
5928
5929
5930void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelations(TString type, TString ptOrEta)
5931{
5932 // calculate reduced correlations for RPs or POIs in pt or eta bins
5933
5934 // multiplicity:
5935 Double_t dMult = (*fSMpk)(0,0);
5936
5937 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
5938 Double_t dReQ1n = (*fReQ)(0,0);
5939 Double_t dReQ2n = (*fReQ)(1,0);
5940 //Double_t dReQ3n = (*fReQ)(2,0);
5941 //Double_t dReQ4n = (*fReQ)(3,0);
5942 Double_t dImQ1n = (*fImQ)(0,0);
5943 Double_t dImQ2n = (*fImQ)(1,0);
5944 //Double_t dImQ3n = (*fImQ)(2,0);
5945 //Double_t dImQ4n = (*fImQ)(3,0);
5946
5947 // reduced correlations are stored in fDiffFlowCorrelationsPro[0=RP,1=POI][0=pt,1=eta][correlation index]. Correlation index runs as follows:
5948 //
5949 // 0: <<2'>>
5950 // 1: <<4'>>
5951 // 2: <<6'>>
5952 // 3: <<8'>>
5953
5954 Int_t t = -1; // type flag
5955 Int_t pe = -1; // ptEta flag
5956
5957 if(type == "RP")
5958 {
5959 t = 0;
5960 } else if(type == "POI")
5961 {
5962 t = 1;
5963 }
5964
5965 if(ptOrEta == "Pt")
5966 {
5967 pe = 0;
5968 } else if(ptOrEta == "Eta")
5969 {
5970 pe = 1;
5971 }
5972
5973 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
5974 Double_t minPtEta[2] = {fPtMin,fEtaMin};
5975 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
5976 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
5977
5978 // looping over all bins and calculating reduced correlations:
5979 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
5980 {
5981 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
5982 Double_t p1n0kRe = 0.;
5983 Double_t p1n0kIm = 0.;
5984
5985 // number of POIs in particular pt or eta bin:
5986 Double_t mp = 0.;
5987
5988 // 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):
5989 Double_t q1n0kRe = 0.;
5990 Double_t q1n0kIm = 0.;
5991 Double_t q2n0kRe = 0.;
5992 Double_t q2n0kIm = 0.;
5993
5994 // number of particles which are both RPs and POIs in particular pt or eta bin:
5995 Double_t mq = 0.;
5996
5997 if(type == "POI")
5998 {
5999 // q_{m*n,0}:
6000 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))
6001 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));
6002 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))
6003 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));
6004 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))
6005 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));
6006 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))
6007 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b));
6008
6009 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
6010 }
6011 else if(type == "RP")
6012 {
6013 // q_{m*n,0}:
6014 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
6015 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
6016 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
6017 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
6018 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))
6019 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));
6020 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))
6021 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b));
6022
6023 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
6024 }
6025
6026 if(type == "POI")
6027 {
6028 // p_{m*n,0}:
6029 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
6030 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
6031 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
6032 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
6033
6034 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
6035
6036 t = 1; // typeFlag = RP or POI
6037 }
6038 else if(type == "RP")
6039 {
6040 // p_{m*n,0} = q_{m*n,0}:
6041 p1n0kRe = q1n0kRe;
6042 p1n0kIm = q1n0kIm;
6043
6044 mp = mq;
6045
6046 t = 0; // typeFlag = RP or POI
6047 }
6048
6049 // 2'-particle correlation for particular (pt,eta) bin:
6050 Double_t two1n1nPtEta = 0.;
6051 if(mp*dMult-mq)
6052 {
6053 two1n1nPtEta = (p1n0kRe*dReQ1n+p1n0kIm*dImQ1n-mq)
6054 / (mp*dMult-mq);
6055
6056 if(type == "POI") // to be improved (I do not this if)
6057 {
6058 // fill profile to get <<2'>> for POIs
6059 fDiffFlowCorrelationsPro[1][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta,mp*dMult-mq);
6060 // histogram to store <2'> for POIs e-b-e (needed in some other methods):
6061 fDiffFlowCorrelationsEBE[1][pe][0]->SetBinContent(b,two1n1nPtEta);
6062 fDiffFlowEventWeightsForCorrelationsEBE[1][pe][0]->SetBinContent(b,mp*dMult-mq);
6063 }
6064 else if(type == "RP") // to be improved (I do not this if)
6065 {
6066 // profile to get <<2'>> for RPs:
6067 fDiffFlowCorrelationsPro[0][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta,mp*dMult-mq);
6068 // histogram to store <2'> for RPs e-b-e (needed in some other methods):
6069 fDiffFlowCorrelationsEBE[0][pe][0]->SetBinContent(b,two1n1nPtEta);
6070 fDiffFlowEventWeightsForCorrelationsEBE[0][pe][0]->SetBinContent(b,mp*dMult-mq);
6071 }
6072 } // end of if(mp*dMult-mq)
6073
6074 // 4'-particle correlation:
6075 Double_t four1n1n1n1nPtEta = 0.;
6076 if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6077 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)
6078 {
6079 four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6080 - q2n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))
6081 - 2.*q2n0kIm*dReQ1n*dImQ1n
6082 - p1n0kRe*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)
6083 + p1n0kIm*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)
6084 - 2.*dMult*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6085 - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*mq
6086 + 6.*(q1n0kRe*dReQ1n+q1n0kIm*dImQ1n)
6087 + 1.*(q2n0kRe*dReQ2n+q2n0kIm*dImQ2n)
6088 + 2.*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6089 + 2.*mq*dMult
6090 - 6.*mq)
6091 / ((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6092 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
6093
6094 if(type == "POI")
6095 {
6096 // profile to get <<4'>> for POIs:
6097 fDiffFlowCorrelationsPro[1][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta,
6098 (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6099 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
6100 // histogram to store <4'> for POIs e-b-e (needed in some other methods):
6101 fDiffFlowCorrelationsEBE[1][pe][1]->SetBinContent(b,four1n1n1n1nPtEta);
6102 fDiffFlowEventWeightsForCorrelationsEBE[1][pe][1]->SetBinContent(b,(mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6103 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
6104 }
6105 else if(type == "RP")
6106 {
6107 // profile to get <<4'>> for RPs:
6108 fDiffFlowCorrelationsPro[0][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta,
6109 (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6110 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
6111 // histogram to store <4'> for RPs e-b-e (needed in some other methods):
6112 fDiffFlowCorrelationsEBE[0][pe][1]->SetBinContent(b,four1n1n1n1nPtEta);
6113 fDiffFlowEventWeightsForCorrelationsEBE[0][pe][1]->SetBinContent(b,(mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6114 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
6115 }
6116 } // end of if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6117 // +mq*(dMult-1.)*(dMult-2.)*(dMult-3.))
6118
6119 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6120
6121
6122} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelations(TString type, TString ptOrEta);
6123
6124
6125//================================================================================================================================
6126
6127
6128void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfEventWeights(TString type, TString ptOrEta)
6129{
6130 // Calculate sums of various event weights for reduced correlations.
6131 // (These quantitites are needed in expressions for unbiased estimators relevant for the statistical errors.)
6132
6133 Int_t typeFlag = -1;
6134 Int_t ptEtaFlag = -1;
6135
6136 if(type == "RP")
6137 {
6138 typeFlag = 0;
6139 } else if(type == "POI")
6140 {
6141 typeFlag = 1;
6142 }
6143
6144 if(ptOrEta == "Pt")
6145 {
6146 ptEtaFlag = 0;
6147 } else if(ptOrEta == "Eta")
6148 {
6149 ptEtaFlag = 1;
6150 }
6151
6152 // shortcuts:
6153 Int_t t = typeFlag;
6154 Int_t pe = ptEtaFlag;
6155
6156 // binning:
6157 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6158 Double_t minPtEta[2] = {fPtMin,fEtaMin};
6159 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
6160 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
6161
6162 for(Int_t rpq=0;rpq<3;rpq++)
6163 {
6164 for(Int_t m=0;m<4;m++)
6165 {
6166 for(Int_t k=0;k<9;k++)
6167 {
6168 if(!fReRPQ1dEBE[rpq][pe][m][k])
6169 {
6170 cout<<"WARNING: fReRPQ1dEBE[rpq][pe][m][k] is NULL in AFAWQC::CSAPOEWFDF() !!!!"<<endl;
6171 cout<<"pe = "<<pe<<endl;
6172 cout<<"rpq = "<<rpq<<endl;
6173 cout<<"m = "<<m<<endl;
6174 cout<<"k = "<<k<<endl;
6175 exit(0);
6176 }
6177 }
6178 }
6179 }
6180
6181 // multiplicities:
6182 Double_t dMult = (*fSMpk)(0,0); // total event multiplicity
6183 //Double_t mr = 0.; // number of RPs in particular pt or eta bin
6184 Double_t mp = 0.; // number of POIs in particular pt or eta bin
6185 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin
6186
6187 // event weights for reduced correlations:
6188 Double_t dw2 = 0.; // event weight for <2'>
6189 Double_t dw4 = 0.; // event weight for <4'>
6190 //Double_t dw6 = 0.; // event weight for <6'>
6191 //Double_t dw8 = 0.; // event weight for <8'>
6192
6193 // looping over bins:
6194 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6195 {
6196 if(type == "RP")
6197 {
6198 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);
6199 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
6200 } else if(type == "POI")
6201 {
6202 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);
6203 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b);
6204 }
6205
6206 // event weight for <2'>:
6207 dw2 = mp*dMult-mq;
6208 fDiffFlowSumOfEventWeights[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2);
6209 fDiffFlowSumOfEventWeights[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw2,2.));
6210
6211 // event weight for <4'>:
6212 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6213 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.);
6214 fDiffFlowSumOfEventWeights[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4);
6215 fDiffFlowSumOfEventWeights[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw4,2.));
6216
6217 // event weight for <6'>:
6218 //dw6 = ...;
6219 //fDiffFlowSumOfEventWeights[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6);
6220 //fDiffFlowSumOfEventWeights[t][pe][t][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw6,2.));
6221
6222 // event weight for <8'>:
6223 //dw8 = ...;
6224 //fDiffFlowSumOfEventWeights[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw8);
6225 //fDiffFlowSumOfEventWeights[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw8,2.));
6226 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6227
6228} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfEventWeights()
6229
6230
6231//================================================================================================================================
6232
6233
6234void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfProductOfEventWeights(TString type, TString ptOrEta)
6235{
6236 // Calculate sum of products of various event weights for both types of correlations (the ones for int. and diff. flow).
6237 // (These quantitites are needed in expressions for unbiased estimators relevant for the statistical errors.)
6238 //
6239 // Important: To fill fDiffFlowSumOfProductOfEventWeights[][][][] use bellow table (i,j) with following constraints:
6240 // 1.) i<j
6241 // 2.) do not store terms which DO NOT include reduced correlations;
6242 // Table:
6243 // [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'>]
6244
6245 Int_t typeFlag = -1;
6246 Int_t ptEtaFlag = -1;
6247
6248 if(type == "RP")
6249 {
6250 typeFlag = 0;
6251 } else if(type == "POI")
6252 {
6253 typeFlag = 1;
6254 }
6255
6256 if(ptOrEta == "Pt")
6257 {
6258 ptEtaFlag = 0;
6259 } else if(ptOrEta == "Eta")
6260 {
6261 ptEtaFlag = 1;
6262 }
6263
6264 // shortcuts:
6265 Int_t t = typeFlag;
6266 Int_t pe = ptEtaFlag;
6267
6268 // binning:
6269 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6270 Double_t minPtEta[2] = {fPtMin,fEtaMin};
6271 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
6272 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
6273
6274 // protection:
6275 for(Int_t rpq=0;rpq<3;rpq++)
6276 {
6277 for(Int_t m=0;m<4;m++)
6278 {
6279 for(Int_t k=0;k<9;k++)
6280 {
6281 if(!fReRPQ1dEBE[rpq][pe][m][k])
6282 {
6283 cout<<"WARNING: fReRPQ1dEBE[rpq][pe][m][k] is NULL in AFAWQC::CSAPOEWFDF() !!!!"<<endl;
6284 cout<<"pe = "<<pe<<endl;
6285 cout<<"rpq = "<<rpq<<endl;
6286 cout<<"m = "<<m<<endl;
6287 cout<<"k = "<<k<<endl;
6288 exit(0);
6289 }
6290 }
6291 }
6292 }
6293
6294 // multiplicities:
6295 Double_t dMult = (*fSMpk)(0,0); // total event multiplicity
6296 //Double_t mr = 0.; // number of RPs in particular pt or eta bin
6297 Double_t mp = 0.; // number of POIs in particular pt or eta bin
6298 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin
6299
6300 // event weights for correlations:
6301 Double_t dW2 = dMult*(dMult-1); // event weight for <2>
6302 Double_t dW4 = dMult*(dMult-1)*(dMult-2)*(dMult-3); // event weight for <4>
6303 Double_t dW6 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5); // event weight for <6>
6304 Double_t dW8 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7); // event weight for <8>
6305
6306 // event weights for reduced correlations:
6307 Double_t dw2 = 0.; // event weight for <2'>
6308 Double_t dw4 = 0.; // event weight for <4'>
6309 //Double_t dw6 = 0.; // event weight for <6'>
6310 //Double_t dw8 = 0.; // event weight for <8'>
6311
6312 // looping over bins:
6313 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6314 {
6315 if(type == "RP")
6316 {
6317 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);
6318 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
6319 } else if(type == "POI")
6320 {
6321 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);
6322 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b);
6323 }
6324
6325 // event weight for <2'>:
6326 dw2 = mp*dMult-mq;
6327 fDiffFlowSumOfProductOfEventWeights[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw2); // storing product of even weights for <2> and <2'>
6328 fDiffFlowSumOfProductOfEventWeights[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW4); // storing product of even weights for <4> and <2'>
6329 fDiffFlowSumOfProductOfEventWeights[t][pe][1][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW6); // storing product of even weights for <6> and <2'>
6330 fDiffFlowSumOfProductOfEventWeights[t][pe][1][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW8); // storing product of even weights for <8> and <2'>
6331
6332 // event weight for <4'>:
6333 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6334 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.);
6335 fDiffFlowSumOfProductOfEventWeights[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw4); // storing product of even weights for <2> and <4'>
6336 fDiffFlowSumOfProductOfEventWeights[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw4); // storing product of even weights for <2'> and <4'>
6337 fDiffFlowSumOfProductOfEventWeights[t][pe][2][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw4); // storing product of even weights for <4> and <4'>
6338 fDiffFlowSumOfProductOfEventWeights[t][pe][3][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dW6); // storing product of even weights for <6> and <4'>
6339 fDiffFlowSumOfProductOfEventWeights[t][pe][3][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dW8); // storing product of even weights for <8> and <4'>
6340
6341 // event weight for <6'>:
6342 //dw6 = ...;
6343 //fDiffFlowSumOfProductOfEventWeights[t][pe][0][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw6); // storing product of even weights for <2> and <6'>
6344 //fDiffFlowSumOfProductOfEventWeights[t][pe][1][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw6); // storing product of even weights for <2'> and <6'>
6345 //fDiffFlowSumOfProductOfEventWeights[t][pe][2][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw6); // storing product of even weights for <4> and <6'>
6346 //fDiffFlowSumOfProductOfEventWeights[t][pe][3][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dw6); // storing product of even weights for <4'> and <6'>
6347 //fDiffFlowSumOfProductOfEventWeights[t][pe][4][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW6*dw6); // storing product of even weights for <6> and <6'>
6348 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dW8); // storing product of even weights for <6'> and <8>
6349 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dw8); // storing product of even weights for <6'> and <8'>
6350
6351 // event weight for <8'>:
6352 //dw8 = ...;
6353 //fDiffFlowSumOfProductOfEventWeights[t][pe][0][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw8); // storing product of even weights for <2> and <8'>
6354 //fDiffFlowSumOfProductOfEventWeights[t][pe][1][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw8); // storing product of even weights for <2'> and <8'>
6355 //fDiffFlowSumOfProductOfEventWeights[t][pe][2][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw8); // storing product of even weights for <4> and <8'>
6356 //fDiffFlowSumOfProductOfEventWeights[t][pe][3][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dw8); // storing product of even weights for <4'> and <8'>
6357 //fDiffFlowSumOfProductOfEventWeights[t][pe][4][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW6*dw8); // storing product of even weights for <6> and <8'>
6358 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dw8); // storing product of even weights for <6'> and <8'>
6359 //fDiffFlowSumOfProductOfEventWeights[t][pe][6][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW8*dw8); // storing product of even weights for <8> and <8'>
6360
6361 // Table:
6362 // [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'>]
6363
6364 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6365
6366
6367
6368} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfProductOfEventWeights(TString type, TString ptOrEta)
6369
6370
6371//================================================================================================================================
6372
6373
6374void AliFlowAnalysisWithQCumulants::FinalizeReducedCorrelations(TString type, TString ptOrEta)
6375{
6376 // Transfer profiles into histograms and calculate statistical errors correctly.
6377
6378 Int_t typeFlag = -1;
6379 Int_t ptEtaFlag = -1;
6380
6381 if(type == "RP")
6382 {
6383 typeFlag = 0;
6384 } else if(type == "POI")
6385 {
6386 typeFlag = 1;
6387 }
6388
6389 if(ptOrEta == "Pt")
6390 {
6391 ptEtaFlag = 0;
6392 } else if(ptOrEta == "Eta")
6393 {
6394 ptEtaFlag = 1;
6395 }
6396
6397 // shortcuts:
6398 Int_t t = typeFlag;
6399 Int_t pe = ptEtaFlag;
6400
6401 for(Int_t rci=0;rci<4;rci++)
6402 {
6403 if(!fDiffFlowCorrelationsPro[t][pe][rci])
6404 {
6405 cout<<"WARNING: fDiffFlowCorrelationsPro[t][pe][rci] is NULL in AFAWQC::FRC() !!!!"<<endl;
6406 cout<<"t = "<<t<<endl;
6407 cout<<"pe = "<<pe<<endl;
6408 cout<<"rci = "<<rci<<endl;
6409 exit(0);
6410 }
6411 for(Int_t power=0;power<2;power++)
6412 {
6413 if(!fDiffFlowSumOfEventWeights[t][pe][power][rci])
6414 {
6415 cout<<"WARNING: fDiffFlowSumOfEventWeights[t][pe][power][rci] is NULL in AFAWQC::FRC() !!!!"<<endl;
6416 cout<<"t = "<<t<<endl;
6417 cout<<"pe = "<<pe<<endl;
6418 cout<<"power = "<<power<<endl;
6419 cout<<"rci = "<<rci<<endl;
6420 exit(0);
6421 }
6422 } // end of for(Int_t power=0;power<2;power++)
6423 } // end of for(Int_t rci=0;rci<4;rci++)
6424
6425 // common:
6426 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6427
6428 // transfer 1D profile into 1D histogram:
6429 Double_t correlation = 0.;
6430 Double_t spread = 0.;
6431 Double_t sumOfWeights = 0.; // sum of weights for particular reduced correlations for particular pt or eta bin
6432 Double_t sumOfSquaredWeights = 0.; // sum of squared weights for particular reduced correlations for particular pt or eta bin
6433 Double_t error = 0.; // error = termA * spread * termB
6434 // termA = (sqrt(sumOfSquaredWeights)/sumOfWeights)
6435 // termB = 1/pow(1-termA^2,0.5)
6436 Double_t termA = 0.;
6437 Double_t termB = 0.;
6438 for(Int_t rci=0;rci<4;rci++) // index of reduced correlation
6439 {
6440 for(Int_t b=1;b<=nBinsPtEta[pe];b++) // number of pt or eta bins
6441 {
6442 correlation = fDiffFlowCorrelationsPro[t][pe][rci]->GetBinContent(b);
6443 spread = fDiffFlowCorrelationsPro[t][pe][rci]->GetBinError(b);
6444 sumOfWeights = fDiffFlowSumOfEventWeights[t][pe][0][rci]->GetBinContent(b);
6445 sumOfSquaredWeights = fDiffFlowSumOfEventWeights[t][pe][1][rci]->GetBinContent(b);
6446 if(sumOfWeights) termA = (pow(sumOfSquaredWeights,0.5)/sumOfWeights);
6447 if(1.-pow(termA,2.)>0.) termB = 1./pow(1.-pow(termA,2.),0.5);
6448 error = termA*spread*termB; // final error (unbiased estimator for standard deviation)
6449 fDiffFlowCorrelationsHist[t][pe][rci]->SetBinContent(b,correlation);
6450 fDiffFlowCorrelationsHist[t][pe][rci]->SetBinError(b,error);
6451 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6452 } // end of for(Int_t rci=0;rci<4;rci++)
6453
6454} // end of void AliFlowAnalysisWithQCumulants::FinalizeReducedCorrelations(TString type, TString ptOrEta)
6455
6456
6457//================================================================================================================================
6458
6459
6460void AliFlowAnalysisWithQCumulants::CalculateDiffFlowProductOfCorrelations(TString type, TString ptOrEta)
6461{
6462 // store products: <2><2'>, <2><4'>, <2><6'>, <2><8'>, <2'><4>,
6463 // <2'><4'>, <2'><6>, <2'><6'>, <2'><8>, <2'><8'>,
6464 // <4><4'>, <4><6'>, <4><8'>, <4'><6>, <4'><6'>,
6465 // <4'><8>, <4'><8'>, <6><6'>, <6><8'>, <6'><8>,
6466 // <6'><8'>, <8><8'>.
6467
6468 Int_t typeFlag = -1;
6469 Int_t ptEtaFlag = -1;
6470
6471 if(type == "RP")
6472 {
6473 typeFlag = 0;
6474 } else if(type == "POI")
6475 {
6476 typeFlag = 1;
6477 }
6478
6479 if(ptOrEta == "Pt")
6480 {
6481 ptEtaFlag = 0;
6482 } else if(ptOrEta == "Eta")
6483 {
6484 ptEtaFlag = 1;
6485 }
6486
6487 // shortcuts:
6488 Int_t t = typeFlag;
6489 Int_t pe = ptEtaFlag;
6490
6491 // common:
6492 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6493 Double_t minPtEta[2] = {fPtMin,fEtaMin};
6494 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
6495
6496 // protections // to be improved (add protection for all pointers in this method)
6497 if(!fIntFlowCorrelationsEBE)
6498 {
6499 cout<<"WARNING: fIntFlowCorrelationsEBE is NULL in AFAWQC::CDFPOC() !!!!"<<endl;
6500 exit(0);
6501 }
6502
6503 /*
6504 Double_t dMult = (*fSMpk)(0,0); // multiplicity (number of particles used to determine the reaction plane)
6505 //Double_t mr = 0.; // number of RPs in particular pt or eta bin
6506 Double_t mp = 0.; // number of POIs in particular pt or eta bin
6507 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin
6508 */
6509
6510 // e-b-e correlations:
6511 Double_t twoEBE = fIntFlowCorrelationsEBE->GetBinContent(1); // <2>
6512 Double_t fourEBE = fIntFlowCorrelationsEBE->GetBinContent(2); // <4>
6513 Double_t sixEBE = fIntFlowCorrelationsEBE->GetBinContent(3); // <6>
6514 Double_t eightEBE = fIntFlowCorrelationsEBE->GetBinContent(4); // <8>
6515
6516 // event weights for correlations:
6517 Double_t dW2 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1); // event weight for <2>
6518 Double_t dW4 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2); // event weight for <4>
6519 Double_t dW6 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(3); // event weight for <6>
6520 Double_t dW8 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(4); // event weight for <8>
6521
6522 // e-b-e reduced correlations:
6523 Double_t twoReducedEBE = 0.; // <2'>
6524 Double_t fourReducedEBE = 0.; // <4'>
6525 Double_t sixReducedEBE = 0.; // <6'>
6526 Double_t eightReducedEBE = 0.; // <8'>
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 // e-b-e reduced correlations:
6538 twoReducedEBE = fDiffFlowCorrelationsEBE[t][pe][0]->GetBinContent(b);
6539 fourReducedEBE = fDiffFlowCorrelationsEBE[t][pe][1]->GetBinContent(b);
6540 sixReducedEBE = fDiffFlowCorrelationsEBE[t][pe][2]->GetBinContent(b);
6541 eightReducedEBE = fDiffFlowCorrelationsEBE[t][pe][3]->GetBinContent(b);
6542
6543 /*
6544 // to be improved (I should not do this here again)
6545 if(type == "RP")
6546 {
6547 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);
6548 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
6549 } else if(type == "POI")
6550 {
6551 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);
6552 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b);
6553 }
6554
6555 // event weights for reduced correlations:
6556 dw2 = mp*dMult-mq; // weight for <2'>
6557 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6558 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.); // weight for <4'>
6559 //dw6 = ...
6560 //dw8 = ...
6561
6562 */
6563
6564 dw2 = fDiffFlowEventWeightsForCorrelationsEBE[t][pe][0]->GetBinContent(b);
6565 dw4 = fDiffFlowEventWeightsForCorrelationsEBE[t][pe][1]->GetBinContent(b);
6566
6567 // storing all products:
6568 fDiffFlowProductOfCorrelationsPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*twoReducedEBE,dW2*dw2); // storing <2><2'>
6569 fDiffFlowProductOfCorrelationsPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*twoReducedEBE,dW4*dw2); // storing <4><2'>
6570 fDiffFlowProductOfCorrelationsPro[t][pe][1][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*twoReducedEBE,dW6*dw2); // storing <6><2'>
6571 fDiffFlowProductOfCorrelationsPro[t][pe][1][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*twoReducedEBE,dW8*dw2); // storing <8><2'>
6572
6573 // event weight for <4'>:
6574 fDiffFlowProductOfCorrelationsPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*fourReducedEBE,dW2*dw4); // storing <2><4'>
6575 fDiffFlowProductOfCorrelationsPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*fourReducedEBE,dw2*dw4); // storing <2'><4'>
6576 fDiffFlowProductOfCorrelationsPro[t][pe][2][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*fourReducedEBE,dW4*dw4); // storing <4><4'>
6577 fDiffFlowProductOfCorrelationsPro[t][pe][3][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*fourReducedEBE,dW6*dw4); // storing <6><4'>
6578 fDiffFlowProductOfCorrelationsPro[t][pe][3][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*fourReducedEBE,dW8*dw4); // storing <8><4'>
6579
6580 // event weight for <6'>:
6581 //dw6 = ...;
6582 //fDiffFlowProductOfCorrelationsPro[t][pe][0][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*sixReducedEBE,dW2*dw6); // storing <2><6'>
6583 //fDiffFlowProductOfCorrelationsPro[t][pe][1][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*sixReducedEBE,dw2*dw6); // storing <2'><6'>
6584 //fDiffFlowProductOfCorrelationsPro[t][pe][2][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*sixReducedEBE,dW4*dw6); // storing <4><6'>
6585 //fDiffFlowProductOfCorrelationsPro[t][pe][3][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourReducedEBE*sixReducedEBE,dw4*dw6); // storing <4'><6'>
6586 //fDiffFlowProductOfCorrelationsPro[t][pe][4][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*sixReducedEBE,dW6*dw6); // storing <6><6'>
6587 //fDiffFlowProductOfCorrelationsPro[t][pe][5][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightEBE,dw6*dW8); // storing <6'><8>
6588 //fDiffFlowProductOfCorrelationsPro[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightReducedEBE,dw6*dw8); // storing <6'><8'>
6589
6590 // event weight for <8'>:
6591 //dw8 = ...;
6592 //fDiffFlowProductOfCorrelationsPro[t][pe][0][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*eightReducedEBE,dW2*dw8); // storing <2><8'>
6593 //fDiffFlowProductOfCorrelationsPro[t][pe][1][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*eightReducedEBE,dw2*dw8); // storing <2'><8'>
6594 //fDiffFlowProductOfCorrelationsPro[t][pe][2][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*eightReducedEBE,dW4*dw8); // storing <4><8'>
6595 //fDiffFlowProductOfCorrelationsPro[t][pe][3][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourReducedEBE*eightReducedEBE,dw4*dw8); // storing <4'><8'>
6596 //fDiffFlowProductOfCorrelationsPro[t][pe][4][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*eightReducedEBE,dW6*dw8); // storing <6><8'>
6597 //fDiffFlowProductOfCorrelationsPro[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightReducedEBE,dw6*dw8); // storing <6'><8'>
6598 //fDiffFlowProductOfCorrelationsPro[t][pe][6][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*eightReducedEBE,dW8*dw8); // storing <8><8'>
6599 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++
6600
6601} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowProductOfCorrelations(TString type, TString ptOrEta)
6602
6603
6604//================================================================================================================================
6605
6606
6607void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCovariances(TString type, TString ptOrEta) // to be improved (reimplemented)
6608{
6609 // a) Calculate unbiased estimators Cov(<2>,<2'>), Cov(<2>,<4'>), Cov(<4>,<2'>), Cov(<4>,<4'>) and Cov(<2'>,<4'>)
6610 // for covariances V(<2>,<2'>), V(<2>,<4'>), V(<4>,<2'>), V(<4>,<4'>) and V(<2'>,<4'>).
6611 // b) Store in histogram fDiffFlowCovariances[t][pe][index] for instance the following:
6612 //
6613 // 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)]
6614 //
6615 // where N is the number of events, w_{<2>} is event weight for <2> and w_{<2'>} is event weight for <2'>.
6616 // c) Binning of fDiffFlowCovariances[t][pe][index] is organized as follows:
6617 //
6618 // 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)]
6619 // 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)]
6620 // 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)]
6621 // 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)]
6622 // 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)]
6623 // ...
6624
6625 Int_t typeFlag = -1;
6626 Int_t ptEtaFlag = -1;
6627
6628 if(type == "RP")
6629 {
6630 typeFlag = 0;
6631 } else if(type == "POI")
6632 {
6633 typeFlag = 1;
6634 }
6635
6636 if(ptOrEta == "Pt")
6637 {
6638 ptEtaFlag = 0;
6639 } else if(ptOrEta == "Eta")
6640 {
6641 ptEtaFlag = 1;
6642 }
6643
6644 // shortcuts:
6645 Int_t t = typeFlag;
6646 Int_t pe = ptEtaFlag;
6647
6648 // common:
6649 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6650 //Double_t minPtEta[2] = {fPtMin,fEtaMin};
6651 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
6652 //Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
6653
6654 // average correlations:
6655 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
6656 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
6657 //Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
6658 //Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
6659
6660 // sum of weights for correlation:
6661 Double_t sumOfWeightsForTwo = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // sum_{i=1}^{N} w_{<2>}
6662 Double_t sumOfWeightsForFour = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // sum_{i=1}^{N} w_{<4>}
6663 //Double_t sumOfWeightsForSix = fIntFlowSumOfEventWeights[0]->GetBinContent(3); // sum_{i=1}^{N} w_{<6>}
6664 //Double_t sumOfWeightsForEight = fIntFlowSumOfEventWeights[0]->GetBinContent(4); // sum_{i=1}^{N} w_{<8>}
6665
6666 // average reduced correlations:
6667 Double_t twoReduced = 0.; // <<2'>>
6668 Double_t fourReduced = 0.; // <<4'>>
6669 //Double_t sixReduced = 0.; // <<6'>>
6670 //Double_t eightReduced = 0.; // <<8'>>
6671
6672 // sum of weights for reduced correlation:
6673 Double_t sumOfWeightsForTwoReduced = 0.; // sum_{i=1}^{N} w_{<2'>}
6674 Double_t sumOfWeightsForFourReduced = 0.; // sum_{i=1}^{N} w_{<4'>}
6675 //Double_t sumOfWeightsForSixReduced = 0.; // sum_{i=1}^{N} w_{<6'>}
6676 //Double_t sumOfWeightsForEightReduced = 0.; // sum_{i=1}^{N} w_{<8'>}
6677
6678 // product of weights for reduced correlation:
6679 Double_t productOfWeightsForTwoTwoReduced = 0.; // sum_{i=1}^{N} w_{<2>}w_{<2'>}
6680 Double_t productOfWeightsForTwoFourReduced = 0.; // sum_{i=1}^{N} w_{<2>}w_{<4'>}
6681 Double_t productOfWeightsForFourTwoReduced = 0.; // sum_{i=1}^{N} w_{<4>}w_{<2'>}
6682 Double_t productOfWeightsForFourFourReduced = 0.; // sum_{i=1}^{N} w_{<4>}w_{<4'>}
6683 Double_t productOfWeightsForTwoReducedFourReduced = 0.; // sum_{i=1}^{N} w_{<2'>}w_{<4'>}
6684 // ...
6685
6686 // products for differential flow:
6687 Double_t twoTwoReduced = 0; // <<2><2'>>
6688 Double_t twoFourReduced = 0; // <<2><4'>>
6689 Double_t fourTwoReduced = 0; // <<4><2'>>
6690 Double_t fourFourReduced = 0; // <<4><4'>>
6691 Double_t twoReducedFourReduced = 0; // <<2'><4'>>
6692
6693 // denominators in the expressions for the unbiased estimators for covariances:
6694 // denominator = 1 - term1/(term2*term3)
6695 // prefactor = term1/(term2*term3)
6696 Double_t denominator = 0.;
6697 Double_t prefactor = 0.;
6698 Double_t term1 = 0.;
6699 Double_t term2 = 0.;
6700 Double_t term3 = 0.;
6701
6702 // unbiased estimators for covariances for differential flow:
6703 Double_t covTwoTwoReduced = 0.; // Cov(<2>,<2'>)
6704 Double_t wCovTwoTwoReduced = 0.; // Cov(<2>,<2'>) * prefactor(w_{<2>},w_{<2'>})
6705 Double_t covTwoFourReduced = 0.; // Cov(<2>,<4'>)
6706 Double_t wCovTwoFourReduced = 0.; // Cov(<2>,<4'>) * prefactor(w_{<2>},w_{<4'>})
6707 Double_t covFourTwoReduced = 0.; // Cov(<4>,<2'>)
6708 Double_t wCovFourTwoReduced = 0.; // Cov(<4>,<2'>) * prefactor(w_{<4>},w_{<2'>})
6709 Double_t covFourFourReduced = 0.; // Cov(<4>,<4'>)
6710 Double_t wCovFourFourReduced = 0.; // Cov(<4>,<4'>) * prefactor(w_{<4>},w_{<4'>})
6711 Double_t covTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>)
6712 Double_t wCovTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>) * prefactor(w_{<2'>},w_{<4'>})
6713
6714 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6715 {
6716 // average reduced corelations:
6717 twoReduced = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b);
6718 fourReduced = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b);
6719 // average products:
6720 twoTwoReduced = fDiffFlowProductOfCorrelationsPro[t][pe][0][1]->GetBinContent(b);
6721 twoFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][0][3]->GetBinContent(b);
6722 fourTwoReduced = fDiffFlowProductOfCorrelationsPro[t][pe][1][2]->GetBinContent(b);
6723 fourFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][2][3]->GetBinContent(b);
6724 twoReducedFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][1][3]->GetBinContent(b);
6725 // sum of weights for reduced correlations:
6726 sumOfWeightsForTwoReduced = fDiffFlowSumOfEventWeights[t][pe][0][0]->GetBinContent(b);
6727 sumOfWeightsForFourReduced = fDiffFlowSumOfEventWeights[t][pe][0][1]->GetBinContent(b);
6728 // products of weights for correlations:
6729 productOfWeightsForTwoTwoReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][0][1]->GetBinContent(b);
6730 productOfWeightsForTwoFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][0][3]->GetBinContent(b);
6731 productOfWeightsForFourTwoReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][1][2]->GetBinContent(b);
6732 productOfWeightsForFourFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][2][3]->GetBinContent(b);
6733 productOfWeightsForTwoReducedFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][1][3]->GetBinContent(b);
6734 // denominator for the unbiased estimator for covariances: 1 - term1/(term2*term3)
6735 // prefactor (multiplies Cov's) = term1/(term2*term3)
6736 // <2>,<2'>:
6737 term1 = productOfWeightsForTwoTwoReduced;
6738 term2 = sumOfWeightsForTwo;
6739 term3 = sumOfWeightsForTwoReduced;
6740 if(term2*term3>0.)
6741 {
6742 denominator = 1.-term1/(term2*term3);
6743 prefactor = term1/(term2*term3);
0328db2d 6744 if(TMath::Abs(denominator)>1e-6)
489d5531 6745 {
6746 covTwoTwoReduced = (twoTwoReduced-two*twoReduced)/denominator;
6747 wCovTwoTwoReduced = covTwoTwoReduced*prefactor;
6748 fDiffFlowCovariances[t][pe][0]->SetBinContent(b,wCovTwoTwoReduced);
6749 }
6750 }
6751 // <2>,<4'>:
6752 term1 = productOfWeightsForTwoFourReduced;
6753 term2 = sumOfWeightsForTwo;
6754 term3 = sumOfWeightsForFourReduced;
6755 if(term2*term3>0.)
6756 {
6757 denominator = 1.-term1/(term2*term3);
6758 prefactor = term1/(term2*term3);
0328db2d 6759 if(TMath::Abs(denominator)>1e-6)
489d5531 6760 {
6761 covTwoFourReduced = (twoFourReduced-two*fourReduced)/denominator;
6762 wCovTwoFourReduced = covTwoFourReduced*prefactor;
6763 fDiffFlowCovariances[t][pe][1]->SetBinContent(b,wCovTwoFourReduced);
6764 }
6765 }
6766 // <4>,<2'>:
6767 term1 = productOfWeightsForFourTwoReduced;
6768 term2 = sumOfWeightsForFour;
6769 term3 = sumOfWeightsForTwoReduced;
6770 if(term2*term3>0.)
6771 {
6772 denominator = 1.-term1/(term2*term3);
6773 prefactor = term1/(term2*term3);
0328db2d 6774 if(TMath::Abs(denominator)>1e-6)
489d5531 6775 {
6776 covFourTwoReduced = (fourTwoReduced-four*twoReduced)/denominator;
6777 wCovFourTwoReduced = covFourTwoReduced*prefactor;
6778 fDiffFlowCovariances[t][pe][2]->SetBinContent(b,wCovFourTwoReduced);
6779 }
6780 }
6781 // <4>,<4'>:
6782 term1 = productOfWeightsForFourFourReduced;
6783 term2 = sumOfWeightsForFour;
6784 term3 = sumOfWeightsForFourReduced;
6785 if(term2*term3>0.)
6786 {
6787 denominator = 1.-term1/(term2*term3);
6788 prefactor = term1/(term2*term3);
0328db2d 6789 if(TMath::Abs(denominator)>1e-6)
489d5531 6790 {
6791 covFourFourReduced = (fourFourReduced-four*fourReduced)/denominator;
6792 wCovFourFourReduced = covFourFourReduced*prefactor;
6793 fDiffFlowCovariances[t][pe][3]->SetBinContent(b,wCovFourFourReduced);
6794 }
6795 }
6796 // <2'>,<4'>:
6797 term1 = productOfWeightsForTwoReducedFourReduced;
6798 term2 = sumOfWeightsForTwoReduced;
6799 term3 = sumOfWeightsForFourReduced;
6800 if(term2*term3>0.)
6801 {
6802 denominator = 1.-term1/(term2*term3);
6803 prefactor = term1/(term2*term3);
0328db2d 6804 if(TMath::Abs(denominator)>1e-6)
489d5531 6805 {
6806 covTwoReducedFourReduced = (twoReducedFourReduced-twoReduced*fourReduced)/denominator;
6807 wCovTwoReducedFourReduced = covTwoReducedFourReduced*prefactor;
6808 fDiffFlowCovariances[t][pe][4]->SetBinContent(b,wCovTwoReducedFourReduced);
6809 }
6810 }
6811 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6812
6813} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCovariances(TString type, TString ptOrEta)
6814
6815
6816//================================================================================================================================
6817
6818
6819void AliFlowAnalysisWithQCumulants::CalculateDiffFlow(TString type, TString ptOrEta)
6820{
6821 // calculate differential flow from differential cumulants and previously obtained integrated flow: (to be improved: description)
6822
6823 Int_t typeFlag = -1;
6824 Int_t ptEtaFlag = -1;
6825
6826 if(type == "RP")
6827 {
6828 typeFlag = 0;
6829 } else if(type == "POI")
6830 {
6831 typeFlag = 1;
6832 }
6833
6834 if(ptOrEta == "Pt")
6835 {
6836 ptEtaFlag = 0;
6837 } else if(ptOrEta == "Eta")
6838 {
6839 ptEtaFlag = 1;
6840 }
6841
6842 // shortcuts:
6843 Int_t t = typeFlag;
6844 Int_t pe = ptEtaFlag;
6845
6846 // common:
6847 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6848
6849 // correlations:
6850 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
6851 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
6852
6853 // statistical errors of correlations:
6854 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1);
6855 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2);
6856
6857 // reduced correlations:
6858 Double_t twoReduced = 0.; // <<2'>>
6859 Double_t fourReduced = 0.; // <<4'>>
6860
6861 // statistical errors of reduced correlations:
6862 Double_t twoReducedError = 0.;
6863 Double_t fourReducedError = 0.;
6864
6865 // covariances:
6866 Double_t wCovTwoFour = fIntFlowCovariances->GetBinContent(1);// // Cov(<2>,<4>) * prefactor(<2>,<4>)
6867 Double_t wCovTwoTwoReduced = 0.; // Cov(<2>,<2'>) * prefactor(<2>,<2'>)
6868 Double_t wCovTwoFourReduced = 0.; // Cov(<2>,<4'>) * prefactor(<2>,<4'>)
6869 Double_t wCovFourTwoReduced = 0.; // Cov(<4>,<2'>) * prefactor(<4>,<2'>)
6870 Double_t wCovFourFourReduced = 0.; // Cov(<4>,<4'>) * prefactor(<4>,<4'>)
6871 Double_t wCovTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>) * prefactor(<2'>,<4'>)
6872
6873 // differential flow:
6874 Double_t v2Prime = 0.; // v'{2}
6875 Double_t v4Prime = 0.; // v'{4}
6876
6877 // statistical error of differential flow:
6878 Double_t v2PrimeError = 0.;
6879 Double_t v4PrimeError = 0.;
6880
6881 // squared statistical error of differential flow:
6882 Double_t v2PrimeErrorSquared = 0.;
6883 Double_t v4PrimeErrorSquared = 0.;
6884
6885 // loop over pt or eta bins:
6886 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6887 {
6888 // reduced correlations and statistical errors:
6889 twoReduced = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b);
6890 twoReducedError = fDiffFlowCorrelationsHist[t][pe][0]->GetBinError(b);
6891 fourReduced = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b);
6892 fourReducedError = fDiffFlowCorrelationsHist[t][pe][1]->GetBinError(b);
6893 // covariances:
6894 wCovTwoTwoReduced = fDiffFlowCovariances[t][pe][0]->GetBinContent(b);
6895 wCovTwoFourReduced = fDiffFlowCovariances[t][pe][1]->GetBinContent(b);
6896 wCovFourTwoReduced = fDiffFlowCovariances[t][pe][2]->GetBinContent(b);
6897 wCovFourFourReduced = fDiffFlowCovariances[t][pe][3]->GetBinContent(b);
6898 wCovTwoReducedFourReduced = fDiffFlowCovariances[t][pe][4]->GetBinContent(b);
6899 // differential flow:
6900 // v'{2}:
6901 if(two>0.)
6902 {
6903 v2Prime = twoReduced/pow(two,0.5);
6904 v2PrimeErrorSquared = (1./4.)*pow(two,-3.)*
6905 (pow(twoReduced,2.)*pow(twoError,2.)
6906 + 4.*pow(two,2.)*pow(twoReducedError,2.)
6907 - 4.*two*twoReduced*wCovTwoTwoReduced);
6908
6909
6910 if(v2PrimeErrorSquared>0.) v2PrimeError = pow(v2PrimeErrorSquared,0.5);
6911 fDiffFlow[t][pe][0]->SetBinContent(b,v2Prime);
60694576 6912 if(TMath::Abs(v2Prime)>1.e-44)fDiffFlow[t][pe][0]->SetBinError(b,v2PrimeError);
489d5531 6913 }
6914 // differential flow:
6915 // v'{4}
6916 if(2.*pow(two,2.)-four > 0.)
6917 {
6918 v4Prime = (2.*two*twoReduced-fourReduced)/pow(2.*pow(two,2.)-four,3./4.);
6919 v4PrimeErrorSquared = pow(2.*pow(two,2.)-four,-7./2.)*
6920 (pow(2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced,2.)*pow(twoError,2.)
6921 + (9./16.)*pow(2.*two*twoReduced-fourReduced,2.)*pow(fourError,2.)
6922 + 4.*pow(two,2.)*pow(2.*pow(two,2.)-four,2.)*pow(twoReducedError,2.)
6923 + pow(2.*pow(two,2.)-four,2.)*pow(fourReducedError,2.)
6924 - (3./2.)*(2.*two*twoReduced-fourReduced)
6925 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoFour
6926 - 4.*two*(2.*pow(two,2.)-four)
6927 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoTwoReduced
6928 + 2.*(2.*pow(two,2.)-four)
6929 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoFourReduced
6930 + 3.*two*(2.*pow(two,2.)-four)*(2.*two*twoReduced-fourReduced)*wCovFourTwoReduced
6931 - (3./2.)*(2.*pow(two,2.)-four)*(2.*two*twoReduced-fourReduced)*wCovFourFourReduced
6932 - 4.*two*pow(2.*pow(two,2.)-four,2.)*wCovTwoReducedFourReduced);
6933 if(v4PrimeErrorSquared>0.) v4PrimeError = pow(v4PrimeErrorSquared,0.5);
6934 fDiffFlow[t][pe][1]->SetBinContent(b,v4Prime);
60694576 6935 if(TMath::Abs(v4Prime)>1.e-44)fDiffFlow[t][pe][1]->SetBinError(b,v4PrimeError);
489d5531 6936 }
6937
6938 } // end of for(Int_t b=1;b<=fnBinsPtEta[pe];b++)
6939
6940
6941
6942
6943 /*
6944 // 2D:
6945 for(Int_t nua=0;nua<2;nua++)
6946 {
6947 for(Int_t p=1;p<=fnBinsPt;p++)
6948 {
6949 for(Int_t e=1;e<=fnBinsEta;e++)
6950 {
6951 // differential cumulants:
6952 Double_t qc2Prime = fFinalCumulants2D[t][pW][eW][nua][0]->GetBinContent(fFinalCumulants2D[t][pW][eW][nua][0]->GetBin(p,e)); // QC{2'}
6953 Double_t qc4Prime = fFinalCumulants2D[t][pW][eW][nua][1]->GetBinContent(fFinalCumulants2D[t][pW][eW][nua][1]->GetBin(p,e)); // QC{4'}
6954 // differential flow:
6955 Double_t v2Prime = 0.;
6956 Double_t v4Prime = 0.;
6957 if(v2)
6958 {
6959 v2Prime = qc2Prime/v2;
6960 fFinalFlow2D[t][pW][eW][nua][0]->SetBinContent(fFinalFlow2D[t][pW][eW][nua][0]->GetBin(p,e),v2Prime);
6961 }
6962 if(v4)
6963 {
6964 v4Prime = -qc4Prime/pow(v4,3.);
6965 fFinalFlow2D[t][pW][eW][nua][1]->SetBinContent(fFinalFlow2D[t][pW][eW][nua][1]->GetBin(p,e),v4Prime);
6966 }
6967 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
6968 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
6969 } // end of for(Int_t nua=0;nua<2;nua++)
6970 */
6971
6972} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlow(TString type, Bool_t useParticleWeights)
6973
6974
6975//================================================================================================================================
6976
6977
6978void AliFlowAnalysisWithQCumulants::StoreIntFlowFlags()
6979{
6980 // a) Store all flags for integrated flow in profile fIntFlowFlags.
6981
6982 if(!fIntFlowFlags)
6983 {
6984 cout<<"WARNING: fIntFlowFlags is NULL in AFAWQC::SFFIF() !!!!"<<endl;
6985 exit(0);
6986 }
6987
6988 // particle weights used or not:
6989 fIntFlowFlags->Fill(0.5,(Int_t)fUsePhiWeights||fUsePtWeights||fUseEtaWeights);
6990 // which event weights were used:
6991 if(strcmp(fMultiplicityWeight->Data(),"combinations"))
6992 {
6993 fIntFlowFlags->Fill(1.5,0); // 0 = "combinations" (default)
6994 } else if(strcmp(fMultiplicityWeight->Data(),"unit"))
6995 {
6996 fIntFlowFlags->Fill(1.5,1); // 1 = "unit"
6997 } else if(strcmp(fMultiplicityWeight->Data(),"multiplicity"))
6998 {
6999 fIntFlowFlags->Fill(1.5,2); // 2 = "multiplicity"
7000 }
7001 // corrected for non-uniform acceptance or not:
7002 fIntFlowFlags->Fill(2.5,(Int_t)fApplyCorrectionForNUA);
7003 fIntFlowFlags->Fill(3.5,(Int_t)fPrintFinalResults[0]);
7004 fIntFlowFlags->Fill(4.5,(Int_t)fPrintFinalResults[1]);
7005 fIntFlowFlags->Fill(5.5,(Int_t)fPrintFinalResults[2]);
7006
7007} // end of void AliFlowAnalysisWithQCumulants::StoreIntFlowFlags()
7008
7009
7010//================================================================================================================================
7011
7012
7013void AliFlowAnalysisWithQCumulants::StoreDiffFlowFlags()
7014{
7015 // Store all flags for differential flow in the profile fDiffFlowFlags.
7016
7017 if(!fDiffFlowFlags)
7018 {
7019 cout<<"WARNING: fDiffFlowFlags is NULL in AFAWQC::SFFDF() !!!!"<<endl;
7020 exit(0);
7021 }
7022
7023 fDiffFlowFlags->Fill(0.5,fUsePhiWeights||fUsePtWeights||fUseEtaWeights); // particle weights used or not
7024 //fDiffFlowFlags->Fill(1.5,""); // which event weight was used? // to be improved
7025 fDiffFlowFlags->Fill(2.5,fApplyCorrectionForNUA); // corrected for non-uniform acceptance or not
7026 fDiffFlowFlags->Fill(3.5,fCalculate2DFlow); // calculate also 2D differential flow in (pt,eta) or not
7027
7028} // end of void AliFlowAnalysisWithQCumulants::StoreDiffFlowFlags()
7029
7030
7031//================================================================================================================================
7032
7033
7034void AliFlowAnalysisWithQCumulants::GetPointersForCommonHistograms()
7035{
7036 // Access all pointers to common control and common result histograms and profiles.
7037
7038 TString commonHistsName = "AliFlowCommonHistQC";
7039 commonHistsName += fAnalysisLabel->Data();
7040 AliFlowCommonHist *commonHist = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHistsName.Data()));
7041 if(commonHist) this->SetCommonHists(commonHist);
7042 TString commonHists2ndOrderName = "AliFlowCommonHist2ndOrderQC";
7043 commonHists2ndOrderName += fAnalysisLabel->Data();
7044 AliFlowCommonHist *commonHist2nd = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists2ndOrderName.Data()));
7045 if(commonHist2nd) this->SetCommonHists2nd(commonHist2nd);
7046 TString commonHists4thOrderName = "AliFlowCommonHist4thOrderQC";
7047 commonHists4thOrderName += fAnalysisLabel->Data();
7048 AliFlowCommonHist *commonHist4th = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists4thOrderName.Data()));
7049 if(commonHist4th) this->SetCommonHists4th(commonHist4th);
7050 TString commonHists6thOrderName = "AliFlowCommonHist6thOrderQC";
7051 commonHists6thOrderName += fAnalysisLabel->Data();
7052 AliFlowCommonHist *commonHist6th = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists6thOrderName.Data()));
7053 if(commonHist6th) this->SetCommonHists6th(commonHist6th);
7054 TString commonHists8thOrderName = "AliFlowCommonHist8thOrderQC";
7055 commonHists8thOrderName += fAnalysisLabel->Data();
7056 AliFlowCommonHist *commonHist8th = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists8thOrderName.Data()));
7057 if(commonHist8th) this->SetCommonHists8th(commonHist8th);
7058 TString commonHistResults2ndOrderName = "AliFlowCommonHistResults2ndOrderQC";
7059 commonHistResults2ndOrderName += fAnalysisLabel->Data();
ecac11c2 7060 AliFlowCommonHistResults *commonHistRes2nd = dynamic_cast<AliFlowCommonHistResults*> (fHistList->FindObject(commonHistResults2ndOrderName.Data()));
489d5531 7061 if(commonHistRes2nd) this->SetCommonHistsResults2nd(commonHistRes2nd);
7062 TString commonHistResults4thOrderName = "AliFlowCommonHistResults4thOrderQC";
7063 commonHistResults4thOrderName += fAnalysisLabel->Data();
7064 AliFlowCommonHistResults *commonHistRes4th = dynamic_cast<AliFlowCommonHistResults*>
7065 (fHistList->FindObject(commonHistResults4thOrderName.Data()));
7066 if(commonHistRes4th) this->SetCommonHistsResults4th(commonHistRes4th);
7067 TString commonHistResults6thOrderName = "AliFlowCommonHistResults6thOrderQC";
7068 commonHistResults6thOrderName += fAnalysisLabel->Data();
7069 AliFlowCommonHistResults *commonHistRes6th = dynamic_cast<AliFlowCommonHistResults*>
7070 (fHistList->FindObject(commonHistResults6thOrderName.Data()));
7071 if(commonHistRes6th) this->SetCommonHistsResults6th(commonHistRes6th);
7072 TString commonHistResults8thOrderName = "AliFlowCommonHistResults8thOrderQC";
7073 commonHistResults8thOrderName += fAnalysisLabel->Data();
7074 AliFlowCommonHistResults *commonHistRes8th = dynamic_cast<AliFlowCommonHistResults*>
7075 (fHistList->FindObject(commonHistResults8thOrderName.Data()));
7076 if(commonHistRes8th) this->SetCommonHistsResults8th(commonHistRes8th);
7077
7078} // end of void AliFlowAnalysisWithQCumulants::GetPointersForCommonHistograms()
7079
7080
7081//================================================================================================================================
7082
7083
7084void AliFlowAnalysisWithQCumulants::GetPointersForParticleWeightsHistograms()
7085{
7086 // Get pointers for histograms with particle weights.
7087
7088 TList *weightsList = dynamic_cast<TList*>(fHistList->FindObject("Weights"));
7089 if(weightsList) this->SetWeightsList(weightsList);
7090 TString fUseParticleWeightsName = "fUseParticleWeightsQC"; // to be improved (hirdwired label QC)
7091 fUseParticleWeightsName += fAnalysisLabel->Data();
7092 TProfile *useParticleWeights = dynamic_cast<TProfile*>(weightsList->FindObject(fUseParticleWeightsName.Data()));
7093 if(useParticleWeights)
7094 {
7095 this->SetUseParticleWeights(useParticleWeights);
7096 fUsePhiWeights = (Int_t)fUseParticleWeights->GetBinContent(1);
7097 fUsePtWeights = (Int_t)fUseParticleWeights->GetBinContent(2);
7098 fUseEtaWeights = (Int_t)fUseParticleWeights->GetBinContent(3);
7099 }
7100} // end of void AliFlowAnalysisWithQCumulants::GetPointersForParticleWeightsHistograms();
7101
7102
7103//================================================================================================================================
7104
7105
7106void AliFlowAnalysisWithQCumulants::GetPointersForIntFlowHistograms()
7107{
7108 // Get pointers for histograms and profiles relevant for integrated flow:
7109 // a) Get pointer to base list for integrated flow holding profile fIntFlowFlags and lists fIntFlowProfiles and fIntFlowResults.
7110 // b) Get pointer to profile fIntFlowFlags holding all flags for integrated flow.
7111 // c) Get pointer to list fIntFlowProfiles and pointers to all objects that she holds.
7112 // d) Get pointer to list fIntFlowResults and pointers to all objects that she holds.
7113
7114 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data member?)
7115 TString powerFlag[2] = {"linear","quadratic"}; // to be improved (should I promote this to data member?)
ff70ca91 7116 TString correlationFlag[4] = {"<<2>>","<<4>>","<<6>>","<<8>>"}; // to be improved (should I promote this to data member?)
489d5531 7117
7118 // a) Get pointer to base list for integrated flow holding profile fIntFlowFlags and lists fIntFlowProfiles and fIntFlowResults:
7119 TList *intFlowList = NULL;
7120 intFlowList = dynamic_cast<TList*>(fHistList->FindObject("Integrated Flow"));
7121 if(!intFlowList)
7122 {
7123 cout<<"WARNING: intFlowList is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7124 exit(0);
7125 }
7126
7127 // b) Get pointer to profile fIntFlowFlags holding all flags for integrated flow:
7128 TString intFlowFlagsName = "fIntFlowFlags";
7129 intFlowFlagsName += fAnalysisLabel->Data();
7130 TProfile *intFlowFlags = dynamic_cast<TProfile*>(intFlowList->FindObject(intFlowFlagsName.Data()));
7131 Bool_t bApplyCorrectionForNUA = kFALSE;
7132 if(intFlowFlags)
7133 {
7134 this->SetIntFlowFlags(intFlowFlags);
7135 bApplyCorrectionForNUA = (Int_t)intFlowFlags->GetBinContent(3);
7136 this->SetApplyCorrectionForNUA(bApplyCorrectionForNUA);
7137 } else
7138 {
7139 cout<<"WARNING: intFlowFlags is NULL in FAWQC::GPFIFH() !!!!"<<endl;
7140 }
7141
7142 // c) Get pointer to list fIntFlowProfiles and pointers to all objects that she holds:
7143 TList *intFlowProfiles = NULL;
7144 intFlowProfiles = dynamic_cast<TList*>(intFlowList->FindObject("Profiles"));
7145 if(intFlowProfiles)
7146 {
7147 // average multiplicities:
7148 TString avMultiplicityName = "fAvMultiplicity";
7149 avMultiplicityName += fAnalysisLabel->Data();
7150 TProfile *avMultiplicity = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(avMultiplicityName.Data()));
7151 if(avMultiplicity)
7152 {
7153 this->SetAvMultiplicity(avMultiplicity);
7154 } else
7155 {
7156 cout<<"WARNING: avMultiplicity is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7157 }
7158 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with wrong errors!):
7159 TString intFlowCorrelationsProName = "fIntFlowCorrelationsPro";
7160 intFlowCorrelationsProName += fAnalysisLabel->Data();
7161 TProfile *intFlowCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowCorrelationsProName.Data()));
7162 if(intFlowCorrelationsPro)
7163 {
7164 this->SetIntFlowCorrelationsPro(intFlowCorrelationsPro);
7165 } else
7166 {
7167 cout<<"WARNING: intFlowCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
ff70ca91 7168 }
7169 // average correlations <<2>>, <<4>>, <<6>> and <<8>> versus multiplicity for all events (error is wrong here):
7170 TString intFlowCorrelationsVsMProName = "fIntFlowCorrelationsVsMPro";
7171 intFlowCorrelationsVsMProName += fAnalysisLabel->Data();
7172 for(Int_t ci=0;ci<4;ci++) // correlation index
7173 {
7174 TProfile *intFlowCorrelationsVsMPro = dynamic_cast<TProfile*>
7175 (intFlowProfiles->FindObject(Form("%s, %s",intFlowCorrelationsVsMProName.Data(),correlationFlag[ci].Data())));
7176 if(intFlowCorrelationsVsMPro)
7177 {
7178 this->SetIntFlowCorrelationsVsMPro(intFlowCorrelationsVsMPro,ci);
7179 } else
7180 {
7181 cout<<"WARNING: "<<Form("intFlowCorrelationsVsMPro[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7182 }
7183 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
489d5531 7184 // average all correlations for integrated flow (with wrong errors!):
7185 TString intFlowCorrelationsAllProName = "fIntFlowCorrelationsAllPro";
7186 intFlowCorrelationsAllProName += fAnalysisLabel->Data();
7187 TProfile *intFlowCorrelationsAllPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowCorrelationsAllProName.Data()));
7188 if(intFlowCorrelationsAllPro)
7189 {
7190 this->SetIntFlowCorrelationsAllPro(intFlowCorrelationsAllPro);
7191 } else
7192 {
7193 cout<<"WARNING: intFlowCorrelationsAllPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7194 }
7195 // average extra correlations for integrated flow (which appear only when particle weights are used):
7196 // (to be improved: Weak point in implementation, I am assuming here that method GetPointersForParticleWeightsHistograms() was called)
7197 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
7198 {
7199 TString intFlowExtraCorrelationsProName = "fIntFlowExtraCorrelationsPro";
7200 intFlowExtraCorrelationsProName += fAnalysisLabel->Data();
7201 TProfile *intFlowExtraCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowExtraCorrelationsProName.Data()));
7202 if(intFlowExtraCorrelationsPro)
7203 {
7204 this->SetIntFlowExtraCorrelationsPro(intFlowExtraCorrelationsPro);
7205 } else
7206 {
7207 cout<<"WARNING: intFlowExtraCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7208 }
7209 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
7210 // average products of correlations <2>, <4>, <6> and <8>:
7211 TString intFlowProductOfCorrelationsProName = "fIntFlowProductOfCorrelationsPro";
7212 intFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
7213 TProfile *intFlowProductOfCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowProductOfCorrelationsProName.Data()));
7214 if(intFlowProductOfCorrelationsPro)
7215 {
7216 this->SetIntFlowProductOfCorrelationsPro(intFlowProductOfCorrelationsPro);
7217 } else
7218 {
7219 cout<<"WARNING: intFlowProductOfCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
ff70ca91 7220 }
7221 // average product of correlations <2>, <4>, <6> and <8> versus multiplicity
7222 // [0=<<2><4>>,1=<<2><6>>,2=<<2><8>>,3=<<4><6>>,4=<<4><8>>,5=<<6><8>>]
7223 TString intFlowProductOfCorrelationsVsMProName = "fIntFlowProductOfCorrelationsVsMPro";
7224 intFlowProductOfCorrelationsVsMProName += fAnalysisLabel->Data();
7225 TString productFlag[6] = {"<<2><4>>","<<2><6>>","<<2><8>>","<<4><6>>","<<4><8>>","<<6><8>>"};
7226 for(Int_t pi=0;pi<6;pi++)
7227 {
7228 TProfile *intFlowProductOfCorrelationsVsMPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(Form("%s, %s",intFlowProductOfCorrelationsVsMProName.Data(),productFlag[pi].Data())));
7229 if(intFlowProductOfCorrelationsVsMPro)
7230 {
7231 this->SetIntFlowProductOfCorrelationsVsMPro(intFlowProductOfCorrelationsVsMPro,pi);
7232 } else
7233 {
7234 cout<<"WARNING: "<<Form("intFlowProductOfCorrelationsVsMPro[%d]",pi)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7235 }
7236 } // end of for(Int_t pi=0;pi<6;pi++)
489d5531 7237 // average correction terms for non-uniform acceptance (with wrong errors!):
7238 for(Int_t sc=0;sc<2;sc++)
7239 {
7240 TString intFlowCorrectionTermsForNUAProName = "fIntFlowCorrectionTermsForNUAPro";
7241 intFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
7242 TProfile *intFlowCorrectionTermsForNUAPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject((Form("%s: %s terms",intFlowCorrectionTermsForNUAProName.Data(),sinCosFlag[sc].Data()))));
7243 if(intFlowCorrectionTermsForNUAPro)
7244 {
7245 this->SetIntFlowCorrectionTermsForNUAPro(intFlowCorrectionTermsForNUAPro,sc);
7246 } else
7247 {
7248 cout<<"WARNING: intFlowCorrectionTermsForNUAPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7249 cout<<"sc = "<<sc<<endl;
7250 }
7251 } // end of for(Int_t sc=0;sc<2;sc++)
0328db2d 7252 // average products of correction terms for NUA:
7253 TString intFlowProductOfCorrectionTermsForNUAProName = "fIntFlowProductOfCorrectionTermsForNUAPro";
7254 intFlowProductOfCorrectionTermsForNUAProName += fAnalysisLabel->Data();
7255 TProfile *intFlowProductOfCorrectionTermsForNUAPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowProductOfCorrectionTermsForNUAProName.Data()));
7256 if(intFlowProductOfCorrectionTermsForNUAPro)
7257 {
7258 this->SetIntFlowProductOfCorrectionTermsForNUAPro(intFlowProductOfCorrectionTermsForNUAPro);
7259 } else
7260 {
7261 cout<<"WARNING: intFlowProductOfCorrectionTermsForNUAPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7262 }
489d5531 7263 } else // to if(intFlowProfiles)
7264 {
7265 cout<<"WARNING: intFlowProfiles is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7266 }
7267
7268 // d) Get pointer to list fIntFlowResults and pointers to all objects that she holds.
7269 TList *intFlowResults = NULL;
7270 intFlowResults = dynamic_cast<TList*>(intFlowList->FindObject("Results"));
7271 if(intFlowResults)
7272 {
7273 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with correct errors!):
7274 TString intFlowCorrelationsHistName = "fIntFlowCorrelationsHist";
7275 intFlowCorrelationsHistName += fAnalysisLabel->Data();
7276 TH1D *intFlowCorrelationsHist = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCorrelationsHistName.Data()));
7277 if(intFlowCorrelationsHist)
7278 {
7279 this->SetIntFlowCorrelationsHist(intFlowCorrelationsHist);
7280 } else
7281 {
7282 cout<<"WARNING: intFlowCorrelationsHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7283 }
ff70ca91 7284 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with correct errors!) vs M:
7285 TString intFlowCorrelationsVsMHistName = "fIntFlowCorrelationsVsMHist";
7286 intFlowCorrelationsVsMHistName += fAnalysisLabel->Data();
7287 for(Int_t ci=0;ci<4;ci++) // correlation index
7288 {
7289 TH1D *intFlowCorrelationsVsMHist = dynamic_cast<TH1D*>
7290 (intFlowResults->FindObject(Form("%s, %s",intFlowCorrelationsVsMHistName.Data(),correlationFlag[ci].Data())));
7291 if(intFlowCorrelationsVsMHist)
7292 {
7293 this->SetIntFlowCorrelationsVsMHist(intFlowCorrelationsVsMHist,ci);
7294 } else
7295 {
7296 cout<<"WARNING: "<<Form("intFlowCorrelationsVsMHist[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7297 }
7298 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
489d5531 7299 // average all correlations for integrated flow (with correct errors!):
7300 TString intFlowCorrelationsAllHistName = "fIntFlowCorrelationsAllHist";
7301 intFlowCorrelationsAllHistName += fAnalysisLabel->Data();
7302 TH1D *intFlowCorrelationsAllHist = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCorrelationsAllHistName.Data()));
7303 if(intFlowCorrelationsAllHist)
7304 {
7305 this->SetIntFlowCorrelationsAllHist(intFlowCorrelationsAllHist);
7306 } else
7307 {
7308 cout<<"WARNING: intFlowCorrelationsAllHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7309 }
7310 // average correction terms for non-uniform acceptance (with correct errors!):
7311 TString intFlowCorrectionTermsForNUAHistName = "fIntFlowCorrectionTermsForNUAHist";
7312 intFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
7313 for(Int_t sc=0;sc<2;sc++)
7314 {
7315 TH1D *intFlowCorrectionTermsForNUAHist = dynamic_cast<TH1D*>(intFlowResults->FindObject((Form("%s: %s terms",intFlowCorrectionTermsForNUAHistName.Data(),sinCosFlag[sc].Data()))));
7316 if(intFlowCorrectionTermsForNUAHist)
7317 {
7318 this->SetIntFlowCorrectionTermsForNUAHist(intFlowCorrectionTermsForNUAHist,sc);
7319 } else
7320 {
7321 cout<<"WARNING: intFlowCorrectionTermsForNUAHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7322 cout<<"sc = "<<sc<<endl;
7323 }
7324 } // end of for(Int_t sc=0;sc<2;sc++)
7325 // covariances (multiplied with weight dependent prefactor):
7326 TString intFlowCovariancesName = "fIntFlowCovariances";
7327 intFlowCovariancesName += fAnalysisLabel->Data();
7328 TH1D *intFlowCovariances = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCovariancesName.Data()));
7329 if(intFlowCovariances)
7330 {
7331 this->SetIntFlowCovariances(intFlowCovariances);
7332 } else
7333 {
7334 cout<<"WARNING: intFlowCovariances is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7335 }
7336 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8>:
7337 TString intFlowSumOfEventWeightsName = "fIntFlowSumOfEventWeights";
7338 intFlowSumOfEventWeightsName += fAnalysisLabel->Data();
7339 for(Int_t power=0;power<2;power++)
7340 {
7341 TH1D *intFlowSumOfEventWeights = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s: %s",intFlowSumOfEventWeightsName.Data(),powerFlag[power].Data())));
7342 if(intFlowSumOfEventWeights)
7343 {
7344 this->SetIntFlowSumOfEventWeights(intFlowSumOfEventWeights,power);
7345 } else
7346 {
7347 cout<<"WARNING: intFlowSumOfEventWeights is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7348 cout<<"power = "<<power<<endl;
7349 }
7350 } // end of for(Int_t power=0;power<2;power++)
7351 // sum of products of event weights for correlations <2>, <4>, <6> and <8>:
7352 TString intFlowSumOfProductOfEventWeightsName = "fIntFlowSumOfProductOfEventWeights";
7353 intFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
7354 TH1D *intFlowSumOfProductOfEventWeights = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowSumOfProductOfEventWeightsName.Data()));
7355 if(intFlowSumOfProductOfEventWeights)
7356 {
7357 this->SetIntFlowSumOfProductOfEventWeights(intFlowSumOfProductOfEventWeights);
7358 } else
7359 {
7360 cout<<"WARNING: intFlowSumOfProductOfEventWeights is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7361 }
ff70ca91 7362 // final result for covariances of correlations (multiplied with weight dependent prefactor) versus M
7363 // [0=Cov(2,4),1=Cov(2,6),2=Cov(2,8),3=Cov(4,6),4=Cov(4,8),5=Cov(6,8)]:
7364 TString intFlowCovariancesVsMName = "fIntFlowCovariancesVsM";
7365 intFlowCovariancesVsMName += fAnalysisLabel->Data();
7366 TString covarianceFlag[6] = {"Cov(<2>,<4>)","Cov(<2>,<6>)","Cov(<2>,<8>)","Cov(<4>,<6>)","Cov(<4>,<8>)","Cov(<6>,<8>)"};
7367 for(Int_t ci=0;ci<6;ci++)
7368 {
7369 TH1D *intFlowCovariancesVsM = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s, %s",intFlowCovariancesVsMName.Data(),covarianceFlag[ci].Data())));
7370 if(intFlowCovariancesVsM)
7371 {
7372 this->SetIntFlowCovariancesVsM(intFlowCovariancesVsM,ci);
7373 } else
7374 {
7375 cout<<"WARNING: "<<Form("intFlowCovariancesVsM[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7376 }
7377 } // end of for(Int_t ci=0;ci<6;ci++)
7378 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8> versus multiplicity
7379 // [0=sum{w_{<2>}},1=sum{w_{<4>}},2=sum{w_{<6>}},3=sum{w_{<8>}}][0=linear 1,1=quadratic]:
7380 TString intFlowSumOfEventWeightsVsMName = "fIntFlowSumOfEventWeightsVsM";
7381 intFlowSumOfEventWeightsVsMName += fAnalysisLabel->Data();
7382 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>}"},
7383 {"#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}"}};
7384 for(Int_t si=0;si<4;si++)
7385 {
7386 for(Int_t power=0;power<2;power++)
7387 {
7388 TH1D *intFlowSumOfEventWeightsVsM = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s, %s",intFlowSumOfEventWeightsVsMName.Data(),sumFlag[power][si].Data())));
7389 if(intFlowSumOfEventWeightsVsM)
7390 {
7391 this->SetIntFlowSumOfEventWeightsVsM(intFlowSumOfEventWeightsVsM,si,power);
7392 } else
7393 {
7394 cout<<"WARNING: "<<Form("intFlowSumOfEventWeightsVsM[%d][%d]",si,power)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7395 }
7396 } // end of for(Int_t power=0;power<2;power++)
7397 } // end of for(Int_t si=0;si<4;si++)
7398 // sum of products of event weights for correlations <2>, <4>, <6> and <8> vs M
7399 // [0=sum{w_{<2>}w_{<4>}},1=sum{w_{<2>}w_{<6>}},2=sum{w_{<2>}w_{<8>}},
7400 // 3=sum{w_{<4>}w_{<6>}},4=sum{w_{<4>}w_{<8>}},5=sum{w_{<6>}w_{<8>}}]:
7401 TString intFlowSumOfProductOfEventWeightsVsMName = "fIntFlowSumOfProductOfEventWeightsVsM";
7402 intFlowSumOfProductOfEventWeightsVsMName += fAnalysisLabel->Data();
7403 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>}",
7404 "#sum_{i=1}^{N} w_{<4>} w_{<6>}","#sum_{i=1}^{N} w_{<4>} w_{<8>}","#sum_{i=1}^{N} w_{<6>} w_{<8>}"};
7405 for(Int_t pi=0;pi<6;pi++)
7406 {
7407 TH1D *intFlowSumOfProductOfEventWeightsVsM = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s, %s",intFlowSumOfProductOfEventWeightsVsMName.Data(),sopowFlag[pi].Data())));
7408 if(intFlowSumOfProductOfEventWeightsVsM)
7409 {
7410 this->SetIntFlowSumOfProductOfEventWeightsVsM(intFlowSumOfProductOfEventWeightsVsM,pi);
7411 } else
7412 {
7413 cout<<"WARNING: "<<Form("intFlowSumOfProductOfEventWeightsVsM[%d]",pi)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7414 }
7415 } // end of for(Int_t pi=0;pi<6;pi++)
0328db2d 7416 // covariances for NUA (multiplied with weight dependent prefactor):
7417 TString intFlowCovariancesNUAName = "fIntFlowCovariancesNUA";
7418 intFlowCovariancesNUAName += fAnalysisLabel->Data();
7419 TH1D *intFlowCovariancesNUA = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCovariancesNUAName.Data()));
7420 if(intFlowCovariancesNUA)
7421 {
7422 this->SetIntFlowCovariancesNUA(intFlowCovariancesNUA);
7423 } else
7424 {
7425 cout<<"WARNING: intFlowCovariancesNUA is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7426 }
7427 // sum of linear and quadratic event weights NUA terms:
7428 TString intFlowSumOfEventWeightsNUAName = "fIntFlowSumOfEventWeightsNUA";
7429 intFlowSumOfEventWeightsNUAName += fAnalysisLabel->Data();
7430 for(Int_t sc=0;sc<2;sc++)
7431 {
7432 for(Int_t power=0;power<2;power++)
7433 {
7434 TH1D *intFlowSumOfEventWeightsNUA = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s: %s, %s",intFlowSumOfEventWeightsNUAName.Data(),powerFlag[power].Data(),sinCosFlag[sc].Data())));
7435 if(intFlowSumOfEventWeightsNUA)
7436 {
7437 this->SetIntFlowSumOfEventWeightsNUA(intFlowSumOfEventWeightsNUA,sc,power);
7438 } else
7439 {
7440 cout<<"WARNING: intFlowSumOfEventWeightsNUA is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7441 cout<<"sc = "<<sc<<endl;
7442 cout<<"power = "<<power<<endl;
7443 }
7444 } // end of for(Int_t power=0;power<2;power++)
7445 } // end of for(Int_t sc=0;sc<2;sc++)
7446 // sum of products of event weights for NUA terms:
7447 TString intFlowSumOfProductOfEventWeightsNUAName = "fIntFlowSumOfProductOfEventWeightsNUA";
7448 intFlowSumOfProductOfEventWeightsNUAName += fAnalysisLabel->Data();
7449 TH1D *intFlowSumOfProductOfEventWeightsNUA = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowSumOfProductOfEventWeightsNUAName.Data()));
7450 if(intFlowSumOfProductOfEventWeightsNUA)
7451 {
7452 this->SetIntFlowSumOfProductOfEventWeightsNUA(intFlowSumOfProductOfEventWeightsNUA);
7453 } else
7454 {
7455 cout<<"WARNING: intFlowSumOfProductOfEventWeightsNUA is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7456 }
489d5531 7457 // final results for integrated Q-cumulants:
7458 TString intFlowQcumulantsName = "fIntFlowQcumulants";
7459 intFlowQcumulantsName += fAnalysisLabel->Data();
7460 TH1D *intFlowQcumulants = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowQcumulantsName.Data()));
7461 if(intFlowQcumulants)
7462 {
7463 this->SetIntFlowQcumulants(intFlowQcumulants);
7464 } else
7465 {
7466 cout<<"WARNING: intFlowQcumulants is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7467 }
ff70ca91 7468 // final results for integrated Q-cumulants versus multiplicity:
7469 TString intFlowQcumulantsVsMName = "fIntFlowQcumulantsVsM";
7470 intFlowQcumulantsVsMName += fAnalysisLabel->Data();
7471 TString cumulantFlag[4] = {"QC{2}","QC{4}","QC{6}","QC{8}"};
7472 for(Int_t co=0;co<4;co++) // cumulant order
7473 {
7474 TH1D *intFlowQcumulantsVsM = dynamic_cast<TH1D*>
7475 (intFlowResults->FindObject(Form("%s, %s",intFlowQcumulantsVsMName.Data(),cumulantFlag[co].Data())));
7476 if(intFlowQcumulantsVsM)
7477 {
7478 this->SetIntFlowQcumulantsVsM(intFlowQcumulantsVsM,co);
7479 } else
7480 {
7481 cout<<"WARNING: "<<Form("intFlowQcumulantsVsM[%d]",co)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7482 }
7483 } // end of for(Int_t co=0;co<4;co++) // cumulant order
489d5531 7484 // final integrated flow estimates from Q-cumulants:
7485 TString intFlowName = "fIntFlow";
7486 intFlowName += fAnalysisLabel->Data();
7487 TH1D *intFlow = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowName.Data()));
7488 if(intFlow)
7489 {
7490 this->SetIntFlow(intFlow);
7491 } else
7492 {
7493 cout<<"WARNING: intFlow is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
ff70ca91 7494 }
7495 // integrated flow from Q-cumulants versus multiplicity:
7496 TString intFlowVsMName = "fIntFlowVsM";
7497 intFlowVsMName += fAnalysisLabel->Data();
7498 TString flowFlag[4] = {"v_{2}{2,QC}","v_{2}{4,QC}","v_{2}{6,QC}","v_{2}{8,QC}"}; // to be improved (harwired harmonic)
7499 for(Int_t co=0;co<4;co++) // cumulant order
7500 {
7501 TH1D *intFlowVsM = dynamic_cast<TH1D*>
7502 (intFlowResults->FindObject(Form("%s, %s",intFlowVsMName.Data(),flowFlag[co].Data())));
7503 if(intFlowVsM)
7504 {
7505 this->SetIntFlowVsM(intFlowVsM,co);
7506 } else
7507 {
7508 cout<<"WARNING: "<<Form("intFlowVsM[%d]",co)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7509 }
7510 } // end of for(Int_t co=0;co<4;co++) // cumulant order
489d5531 7511 } else // to if(intFlowResults)
7512 {
7513 cout<<"WARNING: intFlowResults is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7514 }
ff70ca91 7515
489d5531 7516} // end of void AliFlowAnalysisWithQCumulants::GetPointersForIntFlowHistograms()
7517
489d5531 7518//================================================================================================================================
7519
489d5531 7520void AliFlowAnalysisWithQCumulants::GetPointersForDiffFlowHistograms()
7521{
7522 // Get pointer to all objects relevant for differential flow.
7523 // a) Define flags locally (to be improved: should I promote flags to data members?);
7524 // b) Get pointer to base list for differential flow fDiffFlowList and nested lists fDiffFlowListProfiles and fDiffFlowListResults;
7525 // c) Get pointer to profile fDiffFlowFlags holding all flags for differential flow;
7526 // d) Get pointers to all nested lists in fDiffFlowListProfiles and to profiles which they hold;
7527 // e) Get pointers to all nested lists in fDiffFlowListResults and to histograms which they hold.
7528
7529 // a) Define flags locally (to be improved: should I promote flags to data members?):
7530 TString typeFlag[2] = {"RP","POI"};
7531 TString ptEtaFlag[2] = {"p_{T}","#eta"};
7532 TString powerFlag[2] = {"linear","quadratic"};
7533 TString sinCosFlag[2] = {"sin","cos"};
7534 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
7535 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
7536 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};
7537 TString mixedCorrelationIndex[8] = {"<2>","<2'>","<4>","<4'>","<6>","<6'>","<8>","<8'>"};
7538 TString covarianceName[5] = {"Cov(<2>,<2'>)","Cov(<2>,<4'>)","Cov(<4>,<2'>)","Cov(<4>,<4'>)","Cov(<2'>,<4'>)"};
7539
7540 // b) Get pointer to base list for differential flow fDiffFlowList and nested lists fDiffFlowListProfiles and fDiffFlowListResults:
7541 TList *diffFlowList = NULL;
7542 diffFlowList = dynamic_cast<TList*>(fHistList->FindObject("Differential Flow"));
7543 if(!diffFlowList)
7544 {
7545 cout<<"WARNING: diffFlowList is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
7546 exit(0);
7547 }
7548 // list holding nested lists containing profiles:
7549 TList *diffFlowListProfiles = NULL;
7550 diffFlowListProfiles = dynamic_cast<TList*>(diffFlowList->FindObject("Profiles"));
7551 if(!diffFlowListProfiles)
7552 {
7553 cout<<"WARNING: diffFlowListProfiles is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
7554 exit(0);
7555 }
7556 // list holding nested lists containing 2D and 1D histograms with final results:
7557 TList *diffFlowListResults = NULL;
7558 diffFlowListResults = dynamic_cast<TList*>(diffFlowList->FindObject("Results"));
7559 if(!diffFlowListResults)
7560 {
7561 cout<<"WARNING: diffFlowListResults is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
7562 exit(0);
7563 }
7564
7565 // c) Get pointer to profile holding all flags for differential flow;
7566 TString diffFlowFlagsName = "fDiffFlowFlags";
7567 diffFlowFlagsName += fAnalysisLabel->Data();
7568 TProfile *diffFlowFlags = dynamic_cast<TProfile*>(diffFlowList->FindObject(diffFlowFlagsName.Data()));
7569 Bool_t bCalculate2DFlow = kFALSE;
7570 if(diffFlowFlags)
7571 {
7572 this->SetDiffFlowFlags(diffFlowFlags);
7573 bCalculate2DFlow = (Int_t)diffFlowFlags->GetBinContent(4);
7574 this->SetCalculate2DFlow(bCalculate2DFlow); // to be improved (shoul I call this setter somewhere else?)
7575 }
7576
7577 // d) Get pointers to all nested lists in fDiffFlowListProfiles and to profiles which they hold;
7578 // correlations:
7579 TList *diffFlowCorrelationsProList[2][2] = {{NULL}};
7580 TString diffFlowCorrelationsProName = "fDiffFlowCorrelationsPro";
7581 diffFlowCorrelationsProName += fAnalysisLabel->Data();
7582 TProfile *diffFlowCorrelationsPro[2][2][4] = {{{NULL}}};
7583 // products of correlations:
7584 TList *diffFlowProductOfCorrelationsProList[2][2] = {{NULL}};
7585 TString diffFlowProductOfCorrelationsProName = "fDiffFlowProductOfCorrelationsPro";
7586 diffFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
7587 TProfile *diffFlowProductOfCorrelationsPro[2][2][8][8] = {{{{NULL}}}};
7588 // corrections:
7589 TList *diffFlowCorrectionsProList[2][2] = {{NULL}};
7590 TString diffFlowCorrectionTermsForNUAProName = "fDiffFlowCorrectionTermsForNUAPro";
7591 diffFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
7592 TProfile *diffFlowCorrectionTermsForNUAPro[2][2][2][10] = {{{{NULL}}}};
7593 for(Int_t t=0;t<2;t++)
7594 {
7595 for(Int_t pe=0;pe<2;pe++)
7596 {
7597 diffFlowCorrelationsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
7598 if(!diffFlowCorrelationsProList[t][pe])
7599 {
7600 cout<<"WARNING: diffFlowCorrelationsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
7601 cout<<"t = "<<t<<endl;
7602 cout<<"pe = "<<pe<<endl;
7603 exit(0);
7604 }
7605 for(Int_t ci=0;ci<4;ci++) // correlation index
7606 {
7607 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())));
7608 if(diffFlowCorrelationsPro[t][pe][ci])
7609 {
7610 this->SetDiffFlowCorrelationsPro(diffFlowCorrelationsPro[t][pe][ci],t,pe,ci);
7611 } else
7612 {
7613 cout<<"WARNING: diffFlowCorrelationsPro[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
7614 cout<<"t = "<<t<<endl;
7615 cout<<"pe = "<<pe<<endl;
7616 cout<<"ci = "<<ci<<endl;
7617 }
7618 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
7619 // products of correlations:
7620 diffFlowProductOfCorrelationsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with products of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
7621 if(!diffFlowProductOfCorrelationsProList[t][pe])
7622 {
7623 cout<<"WARNING: ddiffFlowProductOfCorrelationsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
7624 cout<<"t = "<<t<<endl;
7625 cout<<"pe = "<<pe<<endl;
7626 exit(0);
7627 }
7628 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
7629 {
7630 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
7631 {
7632 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())));
7633 if(diffFlowProductOfCorrelationsPro[t][pe][mci1][mci2])
7634 {
7635 this->SetDiffFlowProductOfCorrelationsPro(diffFlowProductOfCorrelationsPro[t][pe][mci1][mci2],t,pe,mci1,mci2);
7636 } else
7637 {
7638 cout<<"WARNING: diffFlowCorrelationsPro[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
7639 cout<<"t = "<<t<<endl;
7640 cout<<"pe = "<<pe<<endl;
7641 cout<<"mci1 = "<<mci1<<endl;
7642 cout<<"mci2 = "<<mci2<<endl;
7643 }
7644 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
7645 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
7646 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
7647 // corrections:
7648 diffFlowCorrectionsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
7649 if(!diffFlowCorrectionsProList[t][pe])
7650 {
7651 cout<<"WARNING: diffFlowCorrectionsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
7652 cout<<"t = "<<t<<endl;
7653 cout<<"pe = "<<pe<<endl;
7654 exit(0);
7655 }
7656 // correction terms for NUA:
7657 for(Int_t sc=0;sc<2;sc++) // sin or cos
7658 {
7659 for(Int_t cti=0;cti<9;cti++) // correction term index
7660 {
7661 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)));
7662 if(diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti])
7663 {
7664 this->SetDiffFlowCorrectionTermsForNUAPro(diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti],t,pe,sc,cti);
7665 } else
7666 {
7667 cout<<"WARNING: diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
7668 cout<<"t = "<<t<<endl;
7669 cout<<"pe = "<<pe<<endl;
7670 cout<<"sc = "<<sc<<endl;
7671 cout<<"cti = "<<cti<<endl;
7672 }
7673 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index
7674 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
7675 // ...
7676 } // end of for(Int_t pe=0;pe<2;pe++)
7677 } // end of for(Int_t t=0;t<2;t++)
7678
7679 // e) Get pointers to all nested lists in fDiffFlowListResults and to histograms which they hold.
7680 // reduced correlations:
7681 TList *diffFlowCorrelationsHistList[2][2] = {{NULL}};
7682 TString diffFlowCorrelationsHistName = "fDiffFlowCorrelationsHist";
7683 diffFlowCorrelationsHistName += fAnalysisLabel->Data();
7684 TH1D *diffFlowCorrelationsHist[2][2][4] = {{{NULL}}};
7685 // corrections for NUA:
7686 TList *diffFlowCorrectionsHistList[2][2] = {{NULL}};
7687 TString diffFlowCorrectionTermsForNUAHistName = "fDiffFlowCorrectionTermsForNUAHist";
7688 diffFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
7689 TH1D *diffFlowCorrectionTermsForNUAHist[2][2][2][10] = {{{{NULL}}}};
7690 // differential Q-cumulants:
7691 TList *diffFlowCumulantsHistList[2][2] = {{NULL}};
7692 TString diffFlowCumulantsName = "fDiffFlowCumulants";
7693 diffFlowCumulantsName += fAnalysisLabel->Data();
7694 TH1D *diffFlowCumulants[2][2][4] = {{{NULL}}};
7695 // differential flow estimates from Q-cumulants:
7696 TList *diffFlowHistList[2][2] = {{NULL}};
7697 TString diffFlowName = "fDiffFlow";
7698 diffFlowName += fAnalysisLabel->Data();
7699 TH1D *diffFlow[2][2][4] = {{{NULL}}};
7700 // differential covariances:
7701 TList *diffFlowCovariancesHistList[2][2] = {{NULL}};
7702 TString diffFlowCovariancesName = "fDiffFlowCovariances";
7703 diffFlowCovariancesName += fAnalysisLabel->Data();
7704 TH1D *diffFlowCovariances[2][2][5] = {{{NULL}}};
7705 for(Int_t t=0;t<2;t++) // type: RP or POI
7706 {
7707 for(Int_t pe=0;pe<2;pe++) // pt or eta
7708 {
7709 // reduced correlations:
7710 diffFlowCorrelationsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
7711 if(!diffFlowCorrelationsHistList[t][pe])
7712 {
7713 cout<<"WARNING: diffFlowCorrelationsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
7714 cout<<"t = "<<t<<endl;
7715 cout<<"pe = "<<pe<<endl;
7716 exit(0);
7717 }
7718 for(Int_t index=0;index<4;index++)
7719 {
7720 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())));
7721 if(diffFlowCorrelationsHist[t][pe][index])
7722 {
7723 this->SetDiffFlowCorrelationsHist(diffFlowCorrelationsHist[t][pe][index],t,pe,index);
7724 } else
7725 {
7726 cout<<"WARNING: diffFlowCorrelationsHist[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
7727 cout<<"t = "<<t<<endl;
7728 cout<<"pe = "<<pe<<endl;
7729 cout<<"index = "<<index<<endl;
7730 exit(0);
7731 }
7732 } // end of for(Int_t index=0;index<4;index++)
7733 // corrections:
7734 diffFlowCorrectionsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Histograms with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
7735 if(!diffFlowCorrectionsHistList[t][pe])
7736 {
7737 cout<<"WARNING: diffFlowCorrectionsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
7738 cout<<"t = "<<t<<endl;
7739 cout<<"pe = "<<pe<<endl;
7740 exit(0);
7741 }
7742 // correction terms for NUA:
7743 for(Int_t sc=0;sc<2;sc++) // sin or cos
7744 {
7745 for(Int_t cti=0;cti<9;cti++) // correction term index
7746 {
7747 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)));
7748 if(diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti])
7749 {
7750 this->SetDiffFlowCorrectionTermsForNUAHist(diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti],t,pe,sc,cti);
7751 } else
7752 {
7753 cout<<"WARNING: diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
7754 cout<<"t = "<<t<<endl;
7755 cout<<"pe = "<<pe<<endl;
7756 cout<<"sc = "<<sc<<endl;
7757 cout<<"cti = "<<cti<<endl;
7758 }
7759 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index
7760 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
7761 // ...
7762 // differential Q-cumulants:
7763 diffFlowCumulantsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Differential Q-cumulants (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
7764 if(!diffFlowCumulantsHistList[t][pe])
7765 {
7766 cout<<"WARNING: diffFlowCumulantsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
7767 cout<<"t = "<<t<<endl;
7768 cout<<"pe = "<<pe<<endl;
7769 exit(0);
7770 }
7771 for(Int_t index=0;index<4;index++)
7772 {
7773 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())));
7774 if(diffFlowCumulants[t][pe][index])
7775 {
7776 this->SetDiffFlowCumulants(diffFlowCumulants[t][pe][index],t,pe,index);
7777 } else
7778 {
7779 cout<<"WARNING: diffFlowCumulants[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
7780 cout<<"t = "<<t<<endl;
7781 cout<<"pe = "<<pe<<endl;
7782 cout<<"index = "<<index<<endl;
7783 exit(0);
7784 }
7785 } // end of for(Int_t index=0;index<4;index++)
7786 // differential flow estimates from Q-cumulants:
7787 diffFlowHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Differential flow (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
7788 if(!diffFlowHistList[t][pe])
7789 {
7790 cout<<"WARNING: diffFlowHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
7791 cout<<"t = "<<t<<endl;
7792 cout<<"pe = "<<pe<<endl;
7793 exit(0);
7794 }
7795 for(Int_t index=0;index<4;index++)
7796 {
7797 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())));
7798 if(diffFlow[t][pe][index])
7799 {
7800 this->SetDiffFlow(diffFlow[t][pe][index],t,pe,index);
7801 } else
7802 {
7803 cout<<"WARNING: diffFlow[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
7804 cout<<"t = "<<t<<endl;
7805 cout<<"pe = "<<pe<<endl;
7806 cout<<"index = "<<index<<endl;
7807 exit(0);
7808 }
7809 } // end of for(Int_t index=0;index<4;index++)
7810 // differential covariances:
7811 diffFlowCovariancesHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Covariances of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
7812 if(!diffFlowCovariancesHistList[t][pe])
7813 {
7814 cout<<"WARNING: diffFlowCovariancesHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
7815 cout<<"t = "<<t<<endl;
7816 cout<<"pe = "<<pe<<endl;
7817 exit(0);
7818 }
7819 for(Int_t covIndex=0;covIndex<5;covIndex++)
7820 {
7821 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())));
7822 if(diffFlowCovariances[t][pe][covIndex])
7823 {
7824 this->SetDiffFlowCovariances(diffFlowCovariances[t][pe][covIndex],t,pe,covIndex);
7825 } else
7826 {
7827 cout<<"WARNING: diffFlowCovariances[t][pe][covIndex] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
7828 cout<<"t = "<<t<<endl;
7829 cout<<"pe = "<<pe<<endl;
7830 cout<<"covIndex = "<<covIndex<<endl;
7831 exit(0);
7832 }
7833 } // end of for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index
7834 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
7835 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
7836 // sum of event weights for reduced correlations:
7837 TList *diffFlowSumOfEventWeightsHistList[2][2][2] = {{{NULL}}};
7838 TString diffFlowSumOfEventWeightsName = "fDiffFlowSumOfEventWeights";
7839 diffFlowSumOfEventWeightsName += fAnalysisLabel->Data();
7840 TH1D *diffFlowSumOfEventWeights[2][2][2][4] = {{{{NULL}}}};
7841 for(Int_t t=0;t<2;t++) // type is RP or POI
7842 {
7843 for(Int_t pe=0;pe<2;pe++) // pt or eta
7844 {
7845 for(Int_t p=0;p<2;p++) // power of event weights is either 1 or 2
7846 {
7847 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())));
7848 if(!diffFlowSumOfEventWeightsHistList[t][pe][p])
7849 {
7850 cout<<"WARNING: diffFlowSumOfEventWeightsHistList[t][pe][p] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
7851 cout<<"t = "<<t<<endl;
7852 cout<<"pe = "<<pe<<endl;
7853 cout<<"power = "<<p<<endl;
7854 exit(0);
7855 }
7856 for(Int_t ew=0;ew<4;ew++) // index of reduced correlation
7857 {
7858 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())));
7859 if(diffFlowSumOfEventWeights[t][pe][p][ew])
7860 {
7861 this->SetDiffFlowSumOfEventWeights(diffFlowSumOfEventWeights[t][pe][p][ew],t,pe,p,ew);
7862 } else
7863 {
7864 cout<<"WARNING: diffFlowSumOfEventWeights[t][pe][p][ew] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
7865 cout<<"t = "<<t<<endl;
7866 cout<<"pe = "<<pe<<endl;
7867 cout<<"power = "<<p<<endl;
7868 cout<<"ew = "<<ew<<endl;
7869 exit(0);
7870 }
7871 }
7872 } // end of for(Int_t p=0;p<2;p++) // power of event weights is either 1 or 2
7873 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
7874 } // end of for(Int_t t=0;t<2;t++) // type is RP or POI
7875 //
7876 TList *diffFlowSumOfProductOfEventWeightsHistList[2][2] = {{NULL}};
7877 TString diffFlowSumOfProductOfEventWeightsName = "fDiffFlowSumOfProductOfEventWeights";
7878 diffFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
7879 TH1D *diffFlowSumOfProductOfEventWeights[2][2][8][8] = {{{{NULL}}}};
7880 for(Int_t t=0;t<2;t++) // type is RP or POI
7881 {
7882 for(Int_t pe=0;pe<2;pe++) // pt or eta
7883 {
7884 diffFlowSumOfProductOfEventWeightsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Sum of products of event weights (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
7885 if(!diffFlowSumOfProductOfEventWeightsHistList[t][pe])
7886 {
7887 cout<<"WARNING: diffFlowSumOfProductOfEventWeightsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
7888 cout<<"t = "<<t<<endl;
7889 cout<<"pe = "<<pe<<endl;
7890 exit(0);
7891 }
7892 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
7893 {
7894 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
7895 {
7896 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())));
7897 if(diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2])
7898 {
7899 this->SetDiffFlowSumOfProductOfEventWeights(diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2],t,pe,mci1,mci2);
7900 } else
7901 {
7902 cout<<"WARNING: diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
7903 cout<<"t = "<<t<<endl;
7904 cout<<"pe = "<<pe<<endl;
7905 cout<<"mci1 = "<<mci1<<endl;
7906 cout<<"mci2 = "<<mci2<<endl;
7907 exit(0);
7908 }
7909 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
7910 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
7911 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
7912 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
7913 } // end of for(Int_t t=0;t<2;t++) // type is RP or POI
7914
7915} // end void AliFlowAnalysisWithQCumulants::GetPointersForDiffFlowHistograms()
7916
7917
7918//================================================================================================================================
7919
7920
7921void AliFlowAnalysisWithQCumulants::BookEverythingForDifferentialFlow()
7922{
7923 // Book all histograms and profiles needed for differential flow.
7924 // a) Define flags locally (to be improved: should I promote flags to data members?);
7925 // b) Book profile to hold all flags for differential flow;
7926 // c) Book e-b-e quantities;
7927 // d) Book profiles;
7928 // e) Book histograms holding final results.
7929
7930 // a) Define flags locally (to be improved: should I promote flags to data members?):
7931 TString typeFlag[2] = {"RP","POI"};
7932 TString ptEtaFlag[2] = {"p_{T}","#eta"};
7933 TString powerFlag[2] = {"linear","quadratic"};
7934 TString sinCosFlag[2] = {"sin","cos"};
7935 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
7936 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
7937 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};
7938 TString mixedCorrelationIndex[8] = {"<2>","<2'>","<4>","<4'>","<6>","<6'>","<8>","<8'>"};
7939 TString covarianceName[5] = {"Cov(<2>,<2'>)","Cov(<2>,<4'>)","Cov(<4>,<2'>)","Cov(<4>,<4'>)","Cov(<2'>,<4'>)"};
7940 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
7941 Double_t minPtEta[2] = {fPtMin,fEtaMin};
7942 Double_t maxPtEta[2] = {fPtMax,fEtaMax};
7943
7944 // b) Book profile to hold all flags for differential flow:
7945 TString diffFlowFlagsName = "fDiffFlowFlags";
7946 diffFlowFlagsName += fAnalysisLabel->Data();
7947 fDiffFlowFlags = new TProfile(diffFlowFlagsName.Data(),"Flags for Differential Flow",4,0,4);
7948 fDiffFlowFlags->SetTickLength(-0.01,"Y");
7949 fDiffFlowFlags->SetMarkerStyle(25);
7950 fDiffFlowFlags->SetLabelSize(0.05);
7951 fDiffFlowFlags->SetLabelOffset(0.02,"Y");
7952 (fDiffFlowFlags->GetXaxis())->SetBinLabel(1,"Particle Weights");
7953 (fDiffFlowFlags->GetXaxis())->SetBinLabel(2,"Event Weights");
7954 (fDiffFlowFlags->GetXaxis())->SetBinLabel(3,"Corrected for NUA?");
7955 (fDiffFlowFlags->GetXaxis())->SetBinLabel(4,"Calculated 2D flow?");
7956 fDiffFlowList->Add(fDiffFlowFlags);
7957
7958 // c) Book e-b-e quantities:
7959 // Event-by-event r_{m*n,k}(pt,eta), p_{m*n,k}(pt,eta) and q_{m*n,k}(pt,eta)
7960 // Explanantion of notation:
7961 // 1.) n is harmonic, m is multiple of harmonic;
7962 // 2.) k is power of particle weight;
7963 // 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);
7964 // 4.) p_{m*n,k}(pt,eta) = Q-vector evaluated in harmonic m*n for POIs in particular (pt,eta) bin
7965 // (if i-th POI is also RP, than it is weighted with w_i^k);
7966 // 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
7967 // (i-th RP&&POI is weighted with w_i^k)
7968
7969 // 1D:
7970 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP && POI )
7971 {
7972 for(Int_t pe=0;pe<2;pe++) // pt or eta
7973 {
7974 for(Int_t m=0;m<4;m++) // multiple of harmonic
7975 {
7976 for(Int_t k=0;k<9;k++) // power of particle weight
7977 {
7978 fReRPQ1dEBE[t][pe][m][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%dpower%dRe",t,pe,m,k),
7979 Form("TypeFlag%dpteta%dmultiple%dpower%dRe",t,pe,m,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
7980 fImRPQ1dEBE[t][pe][m][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%dpower%dIm",t,pe,m,k),
7981 Form("TypeFlag%dpteta%dmultiple%dpower%dIm",t,pe,m,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
7982 }
7983 }
7984 }
7985 }
7986 // to be improved (add explanation of fs1dEBE[t][pe][k]):
7987 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
7988 {
7989 for(Int_t pe=0;pe<2;pe++) // pt or eta
7990 {
7991 for(Int_t k=0;k<9;k++) // power of particle weight
7992 {
7993 fs1dEBE[t][pe][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%d",t,pe,k),
7994 Form("TypeFlag%dpteta%dmultiple%d",t,pe,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
7995 }
7996 }
7997 }
7998 // correction terms for nua:
7999 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
8000 {
8001 for(Int_t pe=0;pe<2;pe++) // pt or eta
8002 {
8003 for(Int_t sc=0;sc<2;sc++) // sin or cos
8004 {
8005 for(Int_t cti=0;cti<9;cti++) // correction term index
8006 {
8007 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti] = new TH1D(Form("typeFlag%d pteta%d sincos%d cti%d",t,pe,sc,cti),
8008 Form("typeFlag%d pteta%d sincos%d cti%d",t,pe,sc,cti),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8009 }
8010 }
8011 }
8012 }
8013 // 2D:
8014 TProfile2D styleRe("typeMultiplePowerRe","typeMultiplePowerRe",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
8015 TProfile2D styleIm("typeMultiplePowerIm","typeMultiplePowerIm",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
8016 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
8017 {
8018 for(Int_t m=0;m<4;m++)
8019 {
8020 for(Int_t k=0;k<9;k++)
8021 {
8022 fReRPQ2dEBE[t][m][k] = (TProfile2D*)styleRe.Clone(Form("typeFlag%dmultiple%dpower%dRe",t,m,k));
8023 fImRPQ2dEBE[t][m][k] = (TProfile2D*)styleIm.Clone(Form("typeFlag%dmultiple%dpower%dIm",t,m,k));
8024 }
8025 }
8026 }
8027 TProfile2D styleS("typePower","typePower",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
8028 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
8029 {
8030 for(Int_t k=0;k<9;k++)
8031 {
8032 fs2dEBE[t][k] = (TProfile2D*)styleS.Clone(Form("typeFlag%dpower%d",t,k));
8033 }
8034 }
8035 // reduced correlations e-b-e:
8036 TString diffFlowCorrelationsEBEName = "fDiffFlowCorrelationsEBE";
8037 diffFlowCorrelationsEBEName += fAnalysisLabel->Data();
8038 for(Int_t t=0;t<2;t++) // type: RP or POI
8039 {
8040 for(Int_t pe=0;pe<2;pe++) // pt or eta
8041 {
8042 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8043 {
8044 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]);
8045 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
8046 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8047 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8048 // event weights for reduced correlations e-b-e:
8049 TString diffFlowEventWeightsForCorrelationsEBEName = "fDiffFlowEventWeightsForCorrelationsEBE";
8050 diffFlowEventWeightsForCorrelationsEBEName += fAnalysisLabel->Data();
8051 for(Int_t t=0;t<2;t++) // type: RP or POI
8052 {
8053 for(Int_t pe=0;pe<2;pe++) // pt or eta
8054 {
8055 for(Int_t rci=0;rci<4;rci++) // event weight for reduced correlation index
8056 {
8057 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]);
8058 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
8059 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8060 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8061
8062 // d) Book profiles;
8063 // reduced correlations:
8064 TString diffFlowCorrelationsProName = "fDiffFlowCorrelationsPro";
8065 diffFlowCorrelationsProName += fAnalysisLabel->Data();
8066 // corrections terms:
8067 TString diffFlowCorrectionTermsForNUAProName = "fDiffFlowCorrectionTermsForNUAPro";
8068 diffFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
8069 for(Int_t t=0;t<2;t++) // type: RP or POI
8070 {
8071 for(Int_t pe=0;pe<2;pe++) // pt or eta
8072 {
8073 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8074 {
8075 // reduced correlations:
8076 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");
8077 fDiffFlowCorrelationsPro[t][pe][rci]->SetXTitle(ptEtaFlag[pe].Data());
8078 fDiffFlowCorrelationsProList[t][pe]->Add(fDiffFlowCorrelationsPro[t][pe][rci]); // to be improved (add dedicated list to hold reduced correlations)
8079 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
8080 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8081 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8082 // correction terms for nua:
8083 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
8084 {
8085 for(Int_t pe=0;pe<2;pe++) // pt or eta
8086 {
8087 for(Int_t sc=0;sc<2;sc++) // sin or cos
8088 {
8089 for(Int_t cti=0;cti<9;cti++) // correction term index
8090 {
8091 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]);
8092 fDiffFlowCorrectionsProList[t][pe]->Add(fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]);
8093 }
8094 }
8095 }
8096 }
8097 // e) Book histograms holding final results.
8098 // reduced correlations:
8099 TString diffFlowCorrelationsHistName = "fDiffFlowCorrelationsHist";
8100 diffFlowCorrelationsHistName += fAnalysisLabel->Data();
8101 // corrections terms:
8102 TString diffFlowCorrectionTermsForNUAHistName = "fDiffFlowCorrectionTermsForNUAHist";
8103 diffFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
8104 // differential covariances:
8105 TString diffFlowCovariancesName = "fDiffFlowCovariances";
8106 diffFlowCovariancesName += fAnalysisLabel->Data();
8107 // differential Q-cumulants:
8108 TString diffFlowCumulantsName = "fDiffFlowCumulants";
8109 diffFlowCumulantsName += fAnalysisLabel->Data();
8110 // differential flow:
8111 TString diffFlowName = "fDiffFlow";
8112 diffFlowName += fAnalysisLabel->Data();
8113 for(Int_t t=0;t<2;t++) // type: RP or POI
8114 {
8115 for(Int_t pe=0;pe<2;pe++) // pt or eta
8116 {
8117 for(Int_t index=0;index<4;index++)
8118 {
8119 // reduced correlations:
8120 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]);
8121 fDiffFlowCorrelationsHist[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
8122 fDiffFlowCorrelationsHistList[t][pe]->Add(fDiffFlowCorrelationsHist[t][pe][index]);
8123 // differential Q-cumulants:
8124 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]);
8125 fDiffFlowCumulants[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
8126 fDiffFlowCumulantsHistList[t][pe]->Add(fDiffFlowCumulants[t][pe][index]);
8127 // differential flow estimates from Q-cumulants:
8128 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]);
8129 fDiffFlow[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
8130 fDiffFlowHistList[t][pe]->Add(fDiffFlow[t][pe][index]);
8131 } // end of for(Int_t index=0;index<4;index++)
8132 for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index
8133 {
8134 // differential covariances:
8135 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]);
8136 fDiffFlowCovariances[t][pe][covIndex]->SetXTitle(ptEtaFlag[pe].Data());
8137 fDiffFlowCovariancesHistList[t][pe]->Add(fDiffFlowCovariances[t][pe][covIndex]);
8138 } // end of for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index
8139 // products of both types of correlations:
8140 TString diffFlowProductOfCorrelationsProName = "fDiffFlowProductOfCorrelationsPro";
8141 diffFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
8142 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8143 {
8144 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8145 {
8146 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]);
8147 fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2]->SetXTitle(ptEtaFlag[pe].Data());
8148 fDiffFlowProductOfCorrelationsProList[t][pe]->Add(fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2]);
8149 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
8150 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8151 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8152 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8153 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8154 // sums of event weights for reduced correlations:
8155 TString diffFlowSumOfEventWeightsName = "fDiffFlowSumOfEventWeights";
8156 diffFlowSumOfEventWeightsName += fAnalysisLabel->Data();
8157 for(Int_t t=0;t<2;t++) // type is RP or POI
8158 {
8159 for(Int_t pe=0;pe<2;pe++) // pt or eta
8160 {
8161 for(Int_t p=0;p<2;p++) // power of weights is either 1 or 2
8162 {
8163 for(Int_t ew=0;ew<4;ew++) // index of reduced correlation
8164 {
8165 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]);
8166 fDiffFlowSumOfEventWeights[t][pe][p][ew]->SetXTitle(ptEtaFlag[pe].Data());
8167 fDiffFlowSumOfEventWeightsHistList[t][pe][p]->Add(fDiffFlowSumOfEventWeights[t][pe][p][ew]); // to be improved (add dedicated list to hold all this)
8168 }
8169 }
8170 }
8171 }
8172 // sum of products of event weights for both types of correlations:
8173 TString diffFlowSumOfProductOfEventWeightsName = "fDiffFlowSumOfProductOfEventWeights";
8174 diffFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
8175 for(Int_t t=0;t<2;t++) // type is RP or POI
8176 {
8177 for(Int_t pe=0;pe<2;pe++) // pt or eta
8178 {
8179 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8180 {
8181 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8182 {
8183 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]);
8184 fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2]->SetXTitle(ptEtaFlag[pe].Data());
8185 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]->Add(fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2]);
8186 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
8187 }
8188 }
8189 }
8190 }
8191 // correction terms for nua:
8192 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
8193 {
8194 for(Int_t pe=0;pe<2;pe++) // pt or eta
8195 {
8196 for(Int_t sc=0;sc<2;sc++) // sin or cos
8197 {
8198 for(Int_t cti=0;cti<9;cti++) // correction term index
8199 {
8200 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]);
8201 fDiffFlowCorrectionsHistList[t][pe]->Add(fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti]);
8202 }
8203 }
8204 }
8205 }
8206
8207} // end of AliFlowAnalysisWithQCumulants::BookEverythingForDifferentialFlow()
8208
8209
8210//================================================================================================================================
8211
8212/*
8213void AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNUAForIntQcumulants() // to be improved (do I really need this method?)
8214{
8215 // Calculate final corrections for non-uniform acceptance for Q-cumulants.
8216
8217 // Corrections for non-uniform acceptance are stored in histogram fCorrectionsForNUA,
8218 // binning of fCorrectionsForNUA is organized as follows:
8219 //
8220 // 1st bin: correction to QC{2}
8221 // 2nd bin: correction to QC{4}
8222 // 3rd bin: correction to QC{6}
8223 // 4th bin: correction to QC{8}
8224
8225 // shortcuts flags:
8226 Int_t pW = (Int_t)(useParticleWeights);
8227
8228 Int_t eW = -1;
8229
8230 if(eventWeights == "exact")
8231 {
8232 eW = 0;
8233 }
8234
8235 for(Int_t sc=0;sc<2;sc++) // sin or cos terms flag
8236 {
8237 if(!(fQCorrelations[pW][eW] && fQCorrections[pW][eW][sc] && fCorrections[pW][eW]))
8238 {
8239 cout<<"WARNING: fQCorrelations[pW][eW] && fQCorrections[pW][eW][sc] && fCorrections[pW][eW] is NULL in AFAWQC::CFCFNUAFIF() !!!!"<<endl;
8240 cout<<"pW = "<<pW<<endl;
8241 cout<<"eW = "<<eW<<endl;
8242 cout<<"sc = "<<sc<<endl;
8243 exit(0);
8244 }
8245 }
8246
8247 // measured 2-, 4-, 6- and 8-particle azimuthal correlations (biased with non-uniform acceptance!):
8248 Double_t two = fQCorrelations[pW][eW]->GetBinContent(1); // <<2>>
8249 //Double_t four = fQCorrelations[pW][eW]->GetBinContent(11); // <<4>>
8250 //Double_t six = fQCorrelations[pW][eW]->GetBinContent(24); // <<6>>
8251 //Double_t eight = fQCorrelations[pW][eW]->GetBinContent(31); // <<8>>
8252
8253 // correction terms to QC{2}:
8254 // <<cos(n*phi1)>>^2
8255 Double_t two1stTerm = pow(fQCorrections[pW][eW][1]->GetBinContent(1),2);
8256 // <<sin(n*phi1)>>^2
8257 Double_t two2ndTerm = pow(fQCorrections[pW][eW][0]->GetBinContent(1),2);
8258 // final corrections for non-uniform acceptance to QC{2}:
8259 Double_t correctionQC2 = -1.*two1stTerm-1.*two2ndTerm;
8260 fCorrections[pW][eW]->SetBinContent(1,correctionQC2);
8261
8262 // correction terms to QC{4}:
8263 // <<cos(n*phi1)>> <<cos(n*(phi1-phi2-phi3))>>
8264 Double_t four1stTerm = fQCorrections[pW][eW][1]->GetBinContent(1)*fQCorrections[pW][eW][1]->GetBinContent(3);
8265 // <<sin(n*phi1)>> <<sin(n*(phi1-phi2-phi3))>>
8266 Double_t four2ndTerm = fQCorrections[pW][eW][0]->GetBinContent(1)*fQCorrections[pW][eW][0]->GetBinContent(3);
8267 // <<cos(n*(phi1+phi2))>>^2
8268 Double_t four3rdTerm = pow(fQCorrections[pW][eW][1]->GetBinContent(2),2);
8269 // <<sin(n*(phi1+phi2))>>^2
8270 Double_t four4thTerm = pow(fQCorrections[pW][eW][0]->GetBinContent(2),2);
8271 // <<cos(n*(phi1+phi2))>> (<<cos(n*phi1)>>^2 - <<sin(n*phi1)>>^2)
8272 Double_t four5thTerm = fQCorrections[pW][eW][1]->GetBinContent(2)
8273 * (pow(fQCorrections[pW][eW][1]->GetBinContent(1),2)-pow(fQCorrections[pW][eW][0]->GetBinContent(1),2));
8274 // <<sin(n*(phi1+phi2))>> <<cos(n*phi1)>> <<sin(n*phi1)>>
8275 Double_t four6thTerm = fQCorrections[pW][eW][0]->GetBinContent(2)
8276 * fQCorrections[pW][eW][1]->GetBinContent(1)
8277 * fQCorrections[pW][eW][0]->GetBinContent(1);
8278 // <<cos(n*(phi1-phi2))>> (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2)
8279 Double_t four7thTerm = two*(pow(fQCorrections[pW][eW][1]->GetBinContent(1),2)+pow(fQCorrections[pW][eW][0]->GetBinContent(1),2));
8280 // (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2)^2
8281 Double_t four8thTerm = pow(pow(fQCorrections[pW][eW][1]->GetBinContent(1),2)+pow(fQCorrections[pW][eW][0]->GetBinContent(1),2),2);
8282 // final correction to QC{4}:
8283 Double_t correctionQC4 = -4.*four1stTerm+4.*four2ndTerm-four3rdTerm-four4thTerm
8284 + 4.*four5thTerm+8.*four6thTerm+8.*four7thTerm-6.*four8thTerm;
8285 fCorrections[pW][eW]->SetBinContent(2,correctionQC4);
8286
8287 // ... to be improved (continued for 6th and 8th order)
8288
8289
8290} // end of AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNUAForIntQcumulants()
8291*/
8292
8293//================================================================================================================================
8294
8295
8296void AliFlowAnalysisWithQCumulants::CalculateQcumulantsCorrectedForNUAIntFlow()
8297{
8298 // Calculate generalized Q-cumulants (cumulants corrected for non-unifom acceptance).
8299
8300 // measured 2-, 4-, 6- and 8-particle correlations (biased by non-uniform acceptance!):
8301 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
8302 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
8303 //Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
8304 //Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
8305
8306 // statistical error of measured 2-, 4-, 6- and 8-particle correlations:
8307 //Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <<2>>
8308 //Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <<4>>
8309 //Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <<6>>
8310 //Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <<8>>
8311
8312 // QC{2}:
8313 // <<cos(n*phi1)>>^2
8314 Double_t two1stTerm = pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1),2);
8315 //Double_t two1stTermErrorSquared = pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(1),2);
8316 // <<sin(n*phi1)>>^2
8317 Double_t two2ndTerm = pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1),2);
8318 //Double_t two2ndTermErrorSquared = pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(1),2);
8319 // generalized QC{2}:
8320 Double_t gQC2 = two - two1stTerm - two2ndTerm; // to be improved (terminology, notation)
8321 fIntFlowQcumulants->SetBinContent(1,gQC2);
8322 //fIntFlowQcumulants->SetBinError(1,0.); // to be improved (propagate error)
8323
8324 // QC{4}:
8325 // <<cos(n*phi1)>> <<cos(n*(phi1-phi2-phi3))>>
8326 Double_t four1stTerm = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1)
8327 * fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(3);
8328 // <<sin(n*phi1)>> <<sin(n*(phi1-phi2-phi3))>>
8329 Double_t four2ndTerm = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1)
8330 * fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(3);
8331 // <<cos(n*(phi1+phi2))>>^2
8332 Double_t four3rdTerm = pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2),2);
8333 // <<sin(n*(phi1+phi2))>>^2
8334 Double_t four4thTerm = pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2),2);
8335 // <<cos(n*(phi1+phi2))>> (<<cos(n*phi1)>>^2 - <<sin(n*phi1)>>^2)
8336 Double_t four5thTerm = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2)
8337 * (pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1),2)
8338 - pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1),2));
8339 // <<sin(n*(phi1+phi2))>> <<cos(n*phi1)>> <<sin(n*phi1)>>
8340 Double_t four6thTerm = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2)
8341 * fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1)
8342 * fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1);
8343 // <<cos(n*(phi1-phi2))>> (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2)
8344 Double_t four7thTerm = two*(pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1),2)
8345 + pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1),2));
8346 // (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2)^2
8347 Double_t four8thTerm = pow(pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1),2)
8348 + pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1),2),2);
8349 // generalized QC{4}:
8350 Double_t gQC4 = four-2.*pow(two,2.)-4.*four1stTerm+4.*four2ndTerm-four3rdTerm
8351 - four4thTerm+4.*four5thTerm+8.*four6thTerm+8.*four7thTerm-6.*four8thTerm;
8352 fIntFlowQcumulants->SetBinContent(2,gQC4);
8353 //fIntFlowQcumulants->SetBinError(2,0.); // to be improved (propagate error)
8354
8355 // ... to be improved (continued for 6th and 8th order)
8356
8357} // end of void AliFlowAnalysisWithQCumulants::CalculateQcumulantsCorrectedForNUAIntFlow()
8358
8359
8360//================================================================================================================================
8361
8362
8363void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectedForNUA()
8364{
8365 // Calculate integrated flow from generalized Q-cumulants (corrected for non-uniform acceptance).
8366
8367 // to be improved: add protection for NULL pointers, propagate statistical errors from
8368 // measured correlations and correction terms
8369
8370 // generalized Q-cumulants:
8371 Double_t qc2 = fIntFlowQcumulants->GetBinContent(1); // QC{2}
8372 Double_t qc4 = fIntFlowQcumulants->GetBinContent(2); // QC{4}
8373 //Double_t qc6 = fIntFlowQcumulants->GetBinContent(3); // QC{6}
8374 //Double_t qc8 = fIntFlowQcumulants->GetBinContent(4); // QC{8}
8375
8376 // integrated flow estimates:
8377 Double_t v2 = 0.; // v{2,QC}
8378 Double_t v4 = 0.; // v{4,QC}
8379 //Double_t v6 = 0.; // v{6,QC}
8380 //Double_t v8 = 0.; // v{8,QC}
8381
8382 // calculate integrated flow estimates from generalized Q-cumulants:
8383 if(qc2>=0.) v2 = pow(qc2,1./2.);
8384 if(qc4<=0.) v4 = pow(-1.*qc4,1./4.);
8385 //if(qc6>=0.) v6 = pow((1./4.)*qc6,1./6.);
8386 //if(qc8<=0.) v8 = pow((-1./33.)*qc8,1./8.);
8387
8388 // store integrated flow estimates from generalized Q-cumulants:
8389 fIntFlow->SetBinContent(1,v2);
8390 fIntFlow->SetBinContent(2,v4);
8391 //fIntFlow->SetBinContent(3,v6);
8392 //fIntFlow->SetBinContent(4,v8);
0328db2d 8393
8394 /*
8395 // propagate correctly error by including non-isotropic terms (to be improved - moved somewhere else):
8396 // correlations:
8397 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
8398 //Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
8399 //Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
8400 //Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
8401 // statistical errors of average 2-, 4-, 6- and 8-particle azimuthal correlations:
8402 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <2>
8403 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <4>
8404 //Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <6>
8405 //Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <8>
8406 // nua terms:
8407 Double_t c1 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1); // <<cos(phi1)>>
8408 Double_t c2 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
8409 Double_t c3 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
8410 Double_t s1 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1); // <<sin(phi1)>>
8411 Double_t s2 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
8412 Double_t s3 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
8413 // statistical errors of nua terms:
8414 Double_t c1Error = fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(1); // statistical error of <cos(phi1)>
8415 Double_t c2Error = fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(2); // statistical error of <cos(phi1+phi2)>
8416 Double_t c3Error = fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(3); // statistical error of <cos(phi1-phi2-phi3)>
8417 Double_t s1Error = fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(1); // statistical error of <sin(phi1)>
8418 Double_t s2Error = fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(2); // statistical error of <sin(phi1+phi2)>
8419 Double_t s3Error = fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(3); // statistical error of <sin(phi1-phi2-phi3)>
8420
8421 // covariances for nua:
8422 Double_t wCov24 = fIntFlowCovariances->GetBinContent(1); // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
8423 Double_t wCov2c1 = fIntFlowCovariancesNUA->GetBinContent(1);
8424 Double_t wCov2s1 = fIntFlowCovariancesNUA->GetBinContent(2);
8425 Double_t wCovc1s1 = fIntFlowCovariancesNUA->GetBinContent(3);
8426 Double_t wCov2c2 = fIntFlowCovariancesNUA->GetBinContent(4);
8427 Double_t wCov2s2 = fIntFlowCovariancesNUA->GetBinContent(5);
8428 Double_t wCov2c3 = fIntFlowCovariancesNUA->GetBinContent(6);
8429 Double_t wCov2s3 = fIntFlowCovariancesNUA->GetBinContent(7);
8430 Double_t wCov4c1 = fIntFlowCovariancesNUA->GetBinContent(8);
8431 Double_t wCov4s1 = fIntFlowCovariancesNUA->GetBinContent(9);
8432 Double_t wCov4c2 = fIntFlowCovariancesNUA->GetBinContent(10);
8433 Double_t wCov4s2 = fIntFlowCovariancesNUA->GetBinContent(11);
8434 Double_t wCov4c3 = fIntFlowCovariancesNUA->GetBinContent(12);
8435 Double_t wCov4s3 = fIntFlowCovariancesNUA->GetBinContent(13);
8436 Double_t wCovc1c2 = fIntFlowCovariancesNUA->GetBinContent(14);
8437 Double_t wCovc1s2 = fIntFlowCovariancesNUA->GetBinContent(15);
8438 Double_t wCovc1c3 = fIntFlowCovariancesNUA->GetBinContent(16);
8439 Double_t wCovc1s3 = fIntFlowCovariancesNUA->GetBinContent(17);
8440 Double_t wCovs1c2 = fIntFlowCovariancesNUA->GetBinContent(18);
8441 Double_t wCovs1s2 = fIntFlowCovariancesNUA->GetBinContent(19);
8442 Double_t wCovs1c3 = fIntFlowCovariancesNUA->GetBinContent(20);
8443 Double_t wCovs1s3 = fIntFlowCovariancesNUA->GetBinContent(21);
8444 Double_t wCovc2s2 = fIntFlowCovariancesNUA->GetBinContent(22);
8445 Double_t wCovc2c3 = fIntFlowCovariancesNUA->GetBinContent(23);
8446 Double_t wCovc2s3 = fIntFlowCovariancesNUA->GetBinContent(24);
8447 Double_t wCovs2c3 = fIntFlowCovariancesNUA->GetBinContent(25);
8448 Double_t wCovs2s3 = fIntFlowCovariancesNUA->GetBinContent(26);
8449 Double_t wCovc3s3 = fIntFlowCovariancesNUA->GetBinContent(27);
8450 */
8451
8452 /*
8453 // 2nd order:
8454 Double_t err2ndSquared = (1./(4.*pow(v2,2.)))
8455 * (pow(twoError,2.)+4.*pow(s1*s1Error,2.)+4.*pow(c1*c1Error,2.)
8456 // to be improved (add eventually also covariance terms)
8457 //- 4.*c1*wCov2c1-4.*s1*wCov2s1+8.*c1*s1*wCovc1s1
8458 );
8459 if(err2ndSquared>=0.)
8460 {
8461 fIntFlow->SetBinError(1,pow(err2ndSquared,0.5)); // to be improved (enabled eventually)
8462 } else
8463 {
8464 cout<<"WARNING: Statistical error of v{2,QC} (with non-isotropic terms included) is imaginary !!!! "<<endl;
8465 }
8466 // 4th order:
8467 Double_t err4thSquared = (1./(16.*pow(v4,6.)))
8468 * (pow(4.*pow(two,2.)-8.*(pow(c1,2.)+pow(s1,2.)),2.)*pow(twoError,2.)
8469 + pow(fourError,2.)
8470 + 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.)
8471 + 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.)
8472 + 4.*pow(c2-2.*(pow(c1,2.)-pow(s1,2.)),2.)*pow(c2Error,2.)
8473 + 4.*pow(4*c1*s1-s2,2.)*pow(s2Error,2.)
8474 + 16.*pow(c1,2.)*pow(c3Error,2.)
8475 + 16.*pow(s1,2.)*pow(s3Error,2.)
8476 // to be improved (add eventually also covariance terms)
8477 // ...
8478 );
8479 if(err4thSquared>=0.)
8480 {
8481 fIntFlow->SetBinError(2,pow(err4thSquared,0.5)); // to be improved (enabled eventually)
8482 } else
8483 {
8484 cout<<"WARNING: Statistical error of v{4,QC} (with non-isotropic terms included) is imaginary !!!! "<<endl;
8485 }
8486 */
8487
489d5531 8488} // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectedForNUA()
8489
8490
8491//================================================================================================================================
8492
8493
8494void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUAIntFlow()
8495{
0328db2d 8496 // From profile fIntFlowCorrectionTermsForNUAPro[sc] access measured correction terms for NUA
489d5531 8497 // and their spread, correctly calculate the statistical errors and store the final
0328db2d 8498 // results and statistical errors for correction terms for NUA in histogram fIntFlowCorrectionTermsForNUAHist[sc].
489d5531 8499 //
8500 // Remark: Statistical error of correction temrs is calculated as:
8501 //
8502 // statistical error = termA * spread * termB:
8503 // termA = sqrt{sum_{i=1}^{N} w^2}/(sum_{i=1}^{N} w)
8504 // termB = 1/sqrt(1-termA^2)
8505
489d5531 8506 for(Int_t sc=0;sc<2;sc++) // sin or cos correction terms
8507 {
0328db2d 8508 for(Int_t ci=1;ci<=3;ci++) // correction term index
489d5531 8509 {
8510 Double_t correction = fIntFlowCorrectionTermsForNUAPro[sc]->GetBinContent(ci);
0328db2d 8511 Double_t spread = fIntFlowCorrectionTermsForNUAPro[sc]->GetBinError(ci);
8512 Double_t sumOfLinearEventWeights = fIntFlowSumOfEventWeightsNUA[sc][0]->GetBinContent(ci);
8513 Double_t sumOfQuadraticEventWeights = fIntFlowSumOfEventWeightsNUA[sc][1]->GetBinContent(ci);
8514 Double_t termA = 0.;
8515 Double_t termB = 0.;
8516 if(sumOfLinearEventWeights)
8517 {
8518 termA = pow(sumOfQuadraticEventWeights,0.5)/sumOfLinearEventWeights;
8519 } else
8520 {
8521 cout<<"WARNING: sumOfLinearEventWeights == 0 in AFAWQC::FCTFNIF() !!!!"<<endl;
8522 cout<<" (for "<<ci<<"-th correction term)"<<endl;
8523 }
489d5531 8524 if(1.-pow(termA,2.) > 0.)
8525 {
8526 termB = 1./pow(1-pow(termA,2.),0.5);
8527 } else
8528 {
0328db2d 8529 cout<<"WARNING: 1.-pow(termA,2.) <= 0 in AFAWQC::FCTFNIF() !!!!"<<endl;
8530 cout<<" (for "<<ci<<"-th correction term)"<<endl;
489d5531 8531 }
8532 Double_t statisticalError = termA * spread * termB;
489d5531 8533 fIntFlowCorrectionTermsForNUAHist[sc]->SetBinContent(ci,correction);
0328db2d 8534 fIntFlowCorrectionTermsForNUAHist[sc]->SetBinError(ci,statisticalError);
489d5531 8535 } // end of for(Int_t ci=1;ci<=10;ci++) // correction term index
8536 } // end of for(Int sc=0;sc<2;sc++) // sin or cos correction terms
8537
8538} // end of void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUAIntFlow()
8539
8540
8541//================================================================================================================================
8542
8543
8544void AliFlowAnalysisWithQCumulants::GetPointersForNestedLoopsHistograms()
8545{
8546 // Get pointers to all objects relevant for calculations with nested loops.
8547
8548 TList *nestedLoopsList = dynamic_cast<TList*>(fHistList->FindObject("Nested Loops"));
8549 if(nestedLoopsList)
8550 {
8551 this->SetNestedLoopsList(nestedLoopsList);
8552 } else
8553 {
8554 cout<<"WARNING: nestedLoopsList is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
8555 exit(0);
8556 }
8557
8558 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)
8559 TString typeFlag[2] = {"RP","POI"}; // to be improved (should I promote this to data members?)
8560 TString ptEtaFlag[2] = {"p_{T}","#eta"}; // to be improved (should I promote this to data members?)
8561 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"}; // to be improved (should I promote this to data members?)
8562
8563 TString evaluateNestedLoopsName = "fEvaluateNestedLoops";
8564 evaluateNestedLoopsName += fAnalysisLabel->Data();
8565 TProfile *evaluateNestedLoops = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(evaluateNestedLoopsName.Data()));
8566 Bool_t bEvaluateIntFlowNestedLoops = kFALSE;
8567 Bool_t bEvaluateDiffFlowNestedLoops = kFALSE;
8568 if(evaluateNestedLoops)
8569 {
8570 this->SetEvaluateNestedLoops(evaluateNestedLoops);
8571 bEvaluateIntFlowNestedLoops = (Int_t)evaluateNestedLoops->GetBinContent(1);
8572 bEvaluateDiffFlowNestedLoops = (Int_t)evaluateNestedLoops->GetBinContent(2);
8573 }
8574 // nested loops relevant for integrated flow:
8575 if(bEvaluateIntFlowNestedLoops)
8576 {
8577 // correlations:
8578 TString intFlowDirectCorrelationsName = "fIntFlowDirectCorrelations";
8579 intFlowDirectCorrelationsName += fAnalysisLabel->Data();
8580 TProfile *intFlowDirectCorrelations = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(intFlowDirectCorrelationsName.Data()));
8581 if(intFlowDirectCorrelations)
8582 {
8583 this->SetIntFlowDirectCorrelations(intFlowDirectCorrelations);
8584 } else
8585 {
8586 cout<<"WARNING: intFlowDirectCorrelations is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
8587 exit(0);
8588 }
8589 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
8590 {
8591 TString intFlowExtraDirectCorrelationsName = "fIntFlowExtraDirectCorrelations";
8592 intFlowExtraDirectCorrelationsName += fAnalysisLabel->Data();
8593 TProfile *intFlowExtraDirectCorrelations = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(intFlowExtraDirectCorrelationsName.Data()));
8594 if(intFlowExtraDirectCorrelations)
8595 {
8596 this->SetIntFlowExtraDirectCorrelations(intFlowExtraDirectCorrelations);
8597 } else
8598 {
8599 cout<<"WARNING: intFlowExtraDirectCorrelations is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
8600 exit(0);
8601 }
8602 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
8603 // correction terms for non-uniform acceptance:
8604 TString intFlowDirectCorrectionTermsForNUAName = "fIntFlowDirectCorrectionTermsForNUA";
8605 intFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
8606 TProfile *intFlowDirectCorrectionTermsForNUA[2] = {NULL};
8607 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
8608 {
8609 intFlowDirectCorrectionTermsForNUA[sc] = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(Form("%s: %s terms",intFlowDirectCorrectionTermsForNUAName.Data(),sinCosFlag[sc].Data())));
8610 if(intFlowDirectCorrectionTermsForNUA[sc])
8611 {
8612 this->SetIntFlowDirectCorrectionTermsForNUA(intFlowDirectCorrectionTermsForNUA[sc],sc);
8613 } else
8614 {
8615 cout<<"WARNING: intFlowDirectCorrectionTermsForNUA[sc] is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
8616 cout<<"sc = "<<sc<<endl;
8617 exit(0);
8618 }
8619 } // end of for(Int_t sc=0;sc<2;sc++)
8620 } // end of if(bEvaluateIntFlowNestedLoops)
8621
8622 // nested loops relevant for differential flow:
8623 if(bEvaluateDiffFlowNestedLoops)
8624 {
8625 // correlations:
8626 TString diffFlowDirectCorrelationsName = "fDiffFlowDirectCorrelations";
8627 diffFlowDirectCorrelationsName += fAnalysisLabel->Data();
8628 TProfile *diffFlowDirectCorrelations[2][2][4] = {{{NULL}}};
8629 for(Int_t t=0;t<2;t++)
8630 {
8631 for(Int_t pe=0;pe<2;pe++)
8632 {
8633 for(Int_t ci=0;ci<4;ci++) // correlation index
8634 {
8635 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())));
8636 if(diffFlowDirectCorrelations[t][pe][ci])
8637 {
8638 this->SetDiffFlowDirectCorrelations(diffFlowDirectCorrelations[t][pe][ci],t,pe,ci);
8639 } else
8640 {
8641 cout<<"WARNING: diffFlowDirectCorrelations[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8642 cout<<"t = "<<t<<endl;
8643 cout<<"pe = "<<pe<<endl;
8644 cout<<"ci = "<<ci<<endl;
8645 }
8646 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
8647 } // end of for(Int_t pe=0;pe<2;pe++)
8648 } // end of for(Int_t t=0;t<2;t++)
8649 // correction terms for non-uniform acceptance:
8650 TString diffFlowDirectCorrectionTermsForNUAName = "fDiffFlowDirectCorrectionTermsForNUA";
8651 diffFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
8652 TProfile *diffFlowDirectCorrectionTermsForNUA[2][2][2][10] = {{{{NULL}}}};
8653 for(Int_t t=0;t<2;t++)
8654 {
8655 for(Int_t pe=0;pe<2;pe++)
8656 {
8657 // correction terms for NUA:
8658 for(Int_t sc=0;sc<2;sc++) // sin or cos
8659 {
8660 for(Int_t cti=0;cti<9;cti++) // correction term index
8661 {
8662 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)));
8663 if(diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti])
8664 {
8665 this->SetDiffFlowDirectCorrectionTermsForNUA(diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti],t,pe,sc,cti);
8666 } else
8667 {
8668 cout<<"WARNING: diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8669 cout<<"t = "<<t<<endl;
8670 cout<<"pe = "<<pe<<endl;
8671 cout<<"sc = "<<sc<<endl;
8672 cout<<"cti = "<<cti<<endl;
8673 }
8674 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index
8675 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
8676 } // end of for(Int_t pe=0;pe<2;pe++)
8677 } // end of for(Int_t t=0;t<2;t++)
8678 // number of RPs and POIs in selected pt and eta bins for cross-checkings:
8679 TString noOfParticlesInBinName = "fNoOfParticlesInBin";
8680 TH1D *noOfParticlesInBin = NULL;
8681 noOfParticlesInBin = dynamic_cast<TH1D*>(nestedLoopsList->FindObject(noOfParticlesInBinName.Data()));
8682 if(noOfParticlesInBin)
8683 {
8684 this->SetNoOfParticlesInBin(noOfParticlesInBin);
8685 } else
8686 {
8687 cout<<endl;
8688 cout<<" WARNING (QC): noOfParticlesInBin is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8689 cout<<endl;
8690 }
8691 } // end of if(bEvaluateDiffFlowNestedLoops)
8692
8693} // end of void AliFlowAnalysisWithQCumulants::GetPointersForNestedLoopsHistograms()
8694
8695
8696//================================================================================================================================
8697
8698
8699void AliFlowAnalysisWithQCumulants::StoreHarmonic()
8700{
8701 // Store flow harmonic in common control histograms.
8702
8703 (fCommonHists->GetHarmonic())->Fill(0.5,fHarmonic);
8704 (fCommonHists2nd->GetHarmonic())->Fill(0.5,fHarmonic);
8705 (fCommonHists4th->GetHarmonic())->Fill(0.5,fHarmonic);
8706 (fCommonHists6th->GetHarmonic())->Fill(0.5,fHarmonic);
8707 (fCommonHists8th->GetHarmonic())->Fill(0.5,fHarmonic);
8708
8709} // end of void AliFlowAnalysisWithQCumulants::StoreHarmonic()
8710
8711
8712//================================================================================================================================
8713
8714
8715void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelationsUsingParticleWeights(TString type, TString ptOrEta) // type = RP or POI
8716{
8717 // Calculate all correlations needed for differential flow using particle weights.
8718
8719 Int_t t = -1; // type flag
8720 Int_t pe = -1; // ptEta flag
8721
8722 if(type == "RP")
8723 {
8724 t = 0;
8725 } else if(type == "POI")
8726 {
8727 t = 1;
8728 }
8729
8730 if(ptOrEta == "Pt")
8731 {
8732 pe = 0;
8733 } else if(ptOrEta == "Eta")
8734 {
8735 pe = 1;
8736 }
8737
8738 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
8739 Double_t minPtEta[2] = {fPtMin,fEtaMin};
8740 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
8741 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
8742
8743 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
8744 Double_t dReQ1n1k = (*fReQ)(0,1);
8745 Double_t dReQ2n2k = (*fReQ)(1,2);
8746 Double_t dReQ1n3k = (*fReQ)(0,3);
8747 //Double_t dReQ4n4k = (*fReQ)(3,4);
8748 Double_t dImQ1n1k = (*fImQ)(0,1);
8749 Double_t dImQ2n2k = (*fImQ)(1,2);
8750 Double_t dImQ1n3k = (*fImQ)(0,3);
8751 //Double_t dImQ4n4k = (*fImQ)(3,4);
8752
8753 // S^M_{p,k} (see .h file for the definition of fSMpk):
8754 Double_t dSM1p1k = (*fSMpk)(0,1);
8755 Double_t dSM1p2k = (*fSMpk)(0,2);
8756 Double_t dSM1p3k = (*fSMpk)(0,3);
8757 Double_t dSM2p1k = (*fSMpk)(1,1);
8758 Double_t dSM3p1k = (*fSMpk)(2,1);
8759
8760 // looping over all bins and calculating reduced correlations:
8761 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
8762 {
8763 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin):
8764 Double_t p1n0kRe = 0.;
8765 Double_t p1n0kIm = 0.;
8766
8767 // number of POIs in particular (pt,eta) bin):
8768 Double_t mp = 0.;
8769
8770 // real and imaginary parts of q_{m*n,k}:
8771 // (weighted Q-vector evaluated for particles which are both RPs and POIs in particular (pt,eta) bin)
8772 Double_t q1n2kRe = 0.;
8773 Double_t q1n2kIm = 0.;
8774 Double_t q2n1kRe = 0.;
8775 Double_t q2n1kIm = 0.;
8776
8777 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
8778 Double_t s1p1k = 0.;
8779 Double_t s1p2k = 0.;
8780 Double_t s1p3k = 0.;
8781
8782 // M0111 from Eq. (118) in QC2c (to be improved (notation))
8783 Double_t dM0111 = 0.;
8784
8785 if(type == "POI")
8786 {
8787 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
8788 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
8789 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
8790 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
8791
8792 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
8793
8794 t = 1; // typeFlag = RP or POI
8795
8796 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
8797 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))
8798 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));
8799 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))
8800 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b));
8801 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))
8802 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));
8803 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))
8804 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b));
8805
8806 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
8807 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.);
8808 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.);
8809 s1p3k = pow(fs1dEBE[2][pe][3]->GetBinContent(b)*fs1dEBE[2][pe][3]->GetBinEntries(b),1.);
8810
8811 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
8812 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
8813 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
8814 + 2.*(s1p3k-s1p2k*dSM1p1k));
8815 }
8816 else if(type == "RP")
8817 {
8818 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
8819 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))
8820 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));
8821 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))
8822 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));
8823 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))
8824 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));
8825 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))
8826 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));
8827
8828 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
8829 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.);
8830 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.);
8831 s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.);
8832
8833 // to be improved (cross-checked):
8834 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
8835 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
8836 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
8837 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
8838
8839 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
8840
8841 t = 0; // typeFlag = RP or POI
8842
8843 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
8844 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
8845 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
8846 + 2.*(s1p3k-s1p2k*dSM1p1k));
8847 //...............................................................................................
8848 }
8849
8850 // 2'-particle correlation:
8851 Double_t two1n1nW0W1 = 0.;
8852 if(mp*dSM1p1k-s1p1k)
8853 {
8854 two1n1nW0W1 = (p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k-s1p1k)
8855 / (mp*dSM1p1k-s1p1k);
8856
8857 // fill profile to get <<2'>>
8858 fDiffFlowCorrelationsPro[t][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nW0W1,mp*dSM1p1k-s1p1k);
8859 // histogram to store <2'> e-b-e (needed in some other methods):
8860 fDiffFlowCorrelationsEBE[t][pe][0]->SetBinContent(b,two1n1nW0W1);
8861 fDiffFlowEventWeightsForCorrelationsEBE[t][pe][0]->SetBinContent(b,mp*dSM1p1k-s1p1k);
8862 } // end of if(mp*dSM1p1k-s1p1k)
8863
8864 // 4'-particle correlation:
8865 Double_t four1n1n1n1nW0W1W1W1 = 0.;
8866 if(dM0111)
8867 {
8868 four1n1n1n1nW0W1W1W1 = ((pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
8869 - q2n1kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))
8870 - 2.*q2n1kIm*dReQ1n1k*dImQ1n1k
8871 - p1n0kRe*(dReQ1n1k*dReQ2n2k+dImQ1n1k*dImQ2n2k)
8872 + p1n0kIm*(dImQ1n1k*dReQ2n2k-dReQ1n1k*dImQ2n2k)
8873 - 2.*dSM1p2k*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
8874 - 2.*(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*s1p1k
8875 + 6.*(q1n2kRe*dReQ1n1k+q1n2kIm*dImQ1n1k)
8876 + 1.*(q2n1kRe*dReQ2n2k+q2n1kIm*dImQ2n2k)
8877 + 2.*(p1n0kRe*dReQ1n3k+p1n0kIm*dImQ1n3k)
8878 + 2.*s1p1k*dSM1p2k
8879 - 6.*s1p3k)
8880 / dM0111; // to be improved (notation of dM0111)
8881
8882 // fill profile to get <<4'>>
8883 fDiffFlowCorrelationsPro[t][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nW0W1W1W1,dM0111);
8884 // histogram to store <4'> e-b-e (needed in some other methods):
8885 fDiffFlowCorrelationsEBE[t][pe][1]->SetBinContent(b,four1n1n1n1nW0W1W1W1);
8886 fDiffFlowEventWeightsForCorrelationsEBE[t][pe][1]->SetBinContent(b,dM0111);
8887 } // end of if(dM0111)
8888 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
8889
8890} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelationsUsingParticleWeights(TString type, TString ptOrEta); // type = RP or POI
8891
8892
8893//================================================================================================================================
8894
8895
8896void AliFlowAnalysisWithQCumulants::FillCommonControlHistograms(AliFlowEventSimple *anEvent)
8897{
8898 // Fill common control histograms.
8899
8900 Int_t nRP = anEvent->GetEventNSelTracksRP(); // number of RPs (i.e. number of particles used to determine the reaction plane)
8901 fCommonHists->FillControlHistograms(anEvent);
8902 if(nRP>1)
8903 {
8904 fCommonHists2nd->FillControlHistograms(anEvent);
8905 if(nRP>3)
8906 {
8907 fCommonHists4th->FillControlHistograms(anEvent);
8908 if(nRP>5)
8909 {
8910 fCommonHists6th->FillControlHistograms(anEvent);
8911 if(nRP>7)
8912 {
8913 fCommonHists8th->FillControlHistograms(anEvent);
8914 } // end of if(nRP>7)
8915 } // end of if(nRP>5)
8916 } // end of if(nRP>3)
8917 } // end of if(nRP>1)
8918
8919} // end of void AliFlowAnalysisWithQCumulants::FillCommonControlHistograms(AliFlowEventSimple *anEvent)
8920
8921
8922//================================================================================================================================
8923
8924
8925void AliFlowAnalysisWithQCumulants::ResetEventByEventQuantities()
8926{
8927 // Reset all event by event quantities.
8928
8929 // integrated flow:
8930 fReQ->Zero();
8931 fImQ->Zero();
8932 fSMpk->Zero();
8933 fIntFlowCorrelationsEBE->Reset();
8934 fIntFlowEventWeightsForCorrelationsEBE->Reset();
8935 fIntFlowCorrelationsAllEBE->Reset();
8936
8937 if(fApplyCorrectionForNUA)
8938 {
8939 for(Int_t sc=0;sc<2;sc++)
8940 {
8941 fIntFlowCorrectionTermsForNUAEBE[sc]->Reset();
0328db2d 8942 fIntFlowEventWeightForCorrectionTermsForNUAEBE[sc]->Reset();
489d5531 8943 }
8944 }
8945
8946 // differential flow:
8947 // 1D:
8948 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
8949 {
8950 for(Int_t pe=0;pe<2;pe++) // 1D in pt or eta
8951 {
8952 for(Int_t m=0;m<4;m++) // multiple of harmonic
8953 {
8954 for(Int_t k=0;k<9;k++) // power of weight
8955 {
8956 if(fReRPQ1dEBE[t][pe][m][k]) fReRPQ1dEBE[t][pe][m][k]->Reset();
8957 if(fImRPQ1dEBE[t][pe][m][k]) fImRPQ1dEBE[t][pe][m][k]->Reset();
8958 }
8959 }
8960 }
8961 }
8962
8963 for(Int_t t=0;t<3;t++) // type (0 = RP, 1 = POI, 2 = RP&&POI )
8964 {
8965 for(Int_t pe=0;pe<2;pe++) // 1D in pt or eta
8966 {
8967 for(Int_t k=0;k<9;k++)
8968 {
8969 if(fs1dEBE[t][pe][k]) fs1dEBE[t][pe][k]->Reset();
8970 }
8971 }
8972 }
8973
8974 // e-b-e reduced correlations:
8975 for(Int_t t=0;t<2;t++) // type (0 = RP, 1 = POI)
8976 {
8977 for(Int_t pe=0;pe<2;pe++) // pt or eta
8978 {
8979 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8980 {
8981 if(fDiffFlowCorrelationsEBE[t][pe][rci]) fDiffFlowCorrelationsEBE[t][pe][rci]->Reset();
8982 if(fDiffFlowEventWeightsForCorrelationsEBE[t][pe][rci]) fDiffFlowEventWeightsForCorrelationsEBE[t][pe][rci]->Reset();
8983 }
8984 }
8985 }
8986
8987 // correction terms for NUA:
8988 for(Int_t t=0;t<2;t++) // type (0 = RP, 1 = POI)
8989 {
8990 for(Int_t pe=0;pe<2;pe++) // pt or eta
8991 {
8992 for(Int_t sc=0;sc<2;sc++) // sin or cos
8993 {
8994 for(Int_t cti=0;cti<9;cti++) // correction term index
8995 {
8996 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti]->Reset();
8997 }
8998 }
8999 }
9000 }
9001
9002 // 2D (pt,eta)
9003 if(fCalculate2DFlow)
9004 {
9005 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
9006 {
9007 for(Int_t m=0;m<4;m++) // multiple of harmonic
9008 {
9009 for(Int_t k=0;k<9;k++) // power of weight
9010 {
9011 if(fReRPQ2dEBE[t][m][k]) fReRPQ2dEBE[t][m][k]->Reset();
9012 if(fImRPQ2dEBE[t][m][k]) fImRPQ2dEBE[t][m][k]->Reset();
9013 }
9014 }
9015 }
9016 for(Int_t t=0;t<3;t++) // type (0 = RP, 1 = POI, 2 = RP&&POI )
9017 {
9018 for(Int_t k=0;k<9;k++)
9019 {
9020 if(fs2dEBE[t][k]) fs2dEBE[t][k]->Reset();
9021 }
9022 }
9023 } // end of if(fCalculate2DFlow)
9024
9025} // end of void AliFlowAnalysisWithQCumulants::ResetEventByEventQuantities();
9026
9027
9028//================================================================================================================================
9029
9030
9031void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTerms(TString type, TString ptOrEta)
9032{
9033 // Calculate correction terms for non-uniform acceptance for differential flow (sin terms).
9034
9035 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][0][cti], where cti runs as follows:
9036 // 0: <<sin n(psi1)>>
9037 // 1: <<sin n(psi1+phi2)>>
9038 // 2: <<sin n(psi1+phi2-phi3)>>
9039 // 3: <<sin n(psi1-phi2-phi3)>>:
9040 // 4:
9041 // 5:
9042 // 6:
9043
9044 // multiplicity:
9045 Double_t dMult = (*fSMpk)(0,0);
9046
9047 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
9048 Double_t dReQ1n = (*fReQ)(0,0);
9049 Double_t dReQ2n = (*fReQ)(1,0);
9050 //Double_t dReQ3n = (*fReQ)(2,0);
9051 //Double_t dReQ4n = (*fReQ)(3,0);
9052 Double_t dImQ1n = (*fImQ)(0,0);
9053 Double_t dImQ2n = (*fImQ)(1,0);
9054 //Double_t dImQ3n = (*fImQ)(2,0);
9055 //Double_t dImQ4n = (*fImQ)(3,0);
9056
9057 Int_t t = -1; // type flag
9058 Int_t pe = -1; // ptEta flag
9059
9060 if(type == "RP")
9061 {
9062 t = 0;
9063 } else if(type == "POI")
9064 {
9065 t = 1;
9066 }
9067
9068 if(ptOrEta == "Pt")
9069 {
9070 pe = 0;
9071 } else if(ptOrEta == "Eta")
9072 {
9073 pe = 1;
9074 }
9075
9076 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
9077 Double_t minPtEta[2] = {fPtMin,fEtaMin};
9078 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
9079 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
9080
9081 // looping over all bins and calculating correction terms:
9082 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9083 {
9084 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
9085 Double_t p1n0kRe = 0.;
9086 Double_t p1n0kIm = 0.;
9087
9088 // number of POIs in particular pt or eta bin:
9089 Double_t mp = 0.;
9090
9091 // 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):
9092 Double_t q1n0kRe = 0.;
9093 Double_t q1n0kIm = 0.;
9094 Double_t q2n0kRe = 0.;
9095 Double_t q2n0kIm = 0.;
9096
9097 // number of particles which are both RPs and POIs in particular pt or eta bin:
9098 Double_t mq = 0.;
9099
9100 if(type == "POI")
9101 {
9102 // q_{m*n,0}:
9103 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))
9104 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));
9105 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))
9106 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));
9107 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))
9108 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));
9109 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))
9110 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b));
9111
9112 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9113 }
9114 else if(type == "RP")
9115 {
9116 // q_{m*n,0}:
9117 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
9118 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
9119 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
9120 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
9121 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))
9122 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));
9123 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))
9124 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b));
9125
9126 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9127 }
9128 if(type == "POI")
9129 {
9130 // p_{m*n,0}:
9131 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
9132 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
9133 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
9134 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
9135
9136 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9137
9138 t = 1; // typeFlag = RP or POI
9139 }
9140 else if(type == "RP")
9141 {
9142 // p_{m*n,0} = q_{m*n,0}:
9143 p1n0kRe = q1n0kRe;
9144 p1n0kIm = q1n0kIm;
9145
9146 mp = mq;
9147
9148 t = 0; // typeFlag = RP or POI
9149 }
9150
9151 // <<sin n(psi1)>>:
9152 Double_t sinP1nPsi = 0.;
9153 if(mp)
9154 {
9155 sinP1nPsi = p1n0kIm/mp;
9156 // fill profile for <<sin n(psi1)>>:
9157 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi,mp);
9158 // histogram to store <sin n(psi1)> e-b-e (needed in some other methods):
9159 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][0]->SetBinContent(b,sinP1nPsi);
9160 } // end of if(mp)
9161
9162 // <<sin n(psi1+phi2)>>:
9163 Double_t sinP1nPsiP1nPhi = 0.;
9164 if(mp*dMult-mq)
9165 {
9166 sinP1nPsiP1nPhi = (p1n0kRe*dImQ1n+p1n0kIm*dReQ1n-q2n0kIm)/(mp*dMult-mq);
9167 // fill profile for <<sin n(psi1+phi2)>>:
9168 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsiP1nPhi,mp*dMult-mq);
9169 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
9170 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][1]->SetBinContent(b,sinP1nPsiP1nPhi);
9171 } // end of if(mp*dMult-mq)
9172
9173 // <<sin n(psi1+phi2-phi3)>>:
9174 Double_t sinP1nPsi1P1nPhi2MPhi3 = 0.;
9175 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9176 {
9177 sinP1nPsi1P1nPhi2MPhi3 = (p1n0kIm*(pow(dImQ1n,2.)+pow(dReQ1n,2.)-dMult)
9178 - 1.*(q2n0kIm*dReQ1n-q2n0kRe*dImQ1n)
9179 - mq*dImQ1n+2.*q1n0kIm)
9180 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9181 // fill profile for <<sin n(psi1+phi2)>>:
9182 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1P1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9183 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
9184 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][2]->SetBinContent(b,sinP1nPsi1P1nPhi2MPhi3);
9185 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9186
9187 // <<sin n(psi1-phi2-phi3)>>:
9188 Double_t sinP1nPsi1M1nPhi2MPhi3 = 0.;
9189 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9190 {
9191 sinP1nPsi1M1nPhi2MPhi3 = (p1n0kIm*(pow(dReQ1n,2.)-pow(dImQ1n,2.))-2.*p1n0kRe*dReQ1n*dImQ1n
9192 - 1.*(p1n0kIm*dReQ2n-p1n0kRe*dImQ2n)
9193 + 2.*mq*dImQ1n-2.*q1n0kIm)
9194 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9195 // fill profile for <<sin n(psi1+phi2)>>:
9196 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1M1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9197 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
9198 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][3]->SetBinContent(b,sinP1nPsi1M1nPhi2MPhi3);
9199 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9200 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9201
9202} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTerms(TString type, TString ptOrEta)
9203
9204
9205//================================================================================================================================
9206
9207
9208void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTerms(TString type, TString ptOrEta)
9209{
9210 // Calculate correction terms for non-uniform acceptance for differential flow (cos terms).
9211
9212 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][1][cti], where cti runs as follows:
9213 // 0: <<cos n(psi)>>
9214 // 1: <<cos n(psi1+phi2)>>
9215 // 2: <<cos n(psi1+phi2-phi3)>>
9216 // 3: <<cos n(psi1-phi2-phi3)>>
9217 // 4:
9218 // 5:
9219 // 6:
9220
9221 // multiplicity:
9222 Double_t dMult = (*fSMpk)(0,0);
9223
9224 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
9225 Double_t dReQ1n = (*fReQ)(0,0);
9226 Double_t dReQ2n = (*fReQ)(1,0);
9227 //Double_t dReQ3n = (*fReQ)(2,0);
9228 //Double_t dReQ4n = (*fReQ)(3,0);
9229 Double_t dImQ1n = (*fImQ)(0,0);
9230 Double_t dImQ2n = (*fImQ)(1,0);
9231 //Double_t dImQ3n = (*fImQ)(2,0);
9232 //Double_t dImQ4n = (*fImQ)(3,0);
9233
9234 Int_t t = -1; // type flag
9235 Int_t pe = -1; // ptEta flag
9236
9237 if(type == "RP")
9238 {
9239 t = 0;
9240 } else if(type == "POI")
9241 {
9242 t = 1;
9243 }
9244
9245 if(ptOrEta == "Pt")
9246 {
9247 pe = 0;
9248 } else if(ptOrEta == "Eta")
9249 {
9250 pe = 1;
9251 }
9252
9253 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
9254 Double_t minPtEta[2] = {fPtMin,fEtaMin};
9255 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
9256 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
9257
9258 // looping over all bins and calculating correction terms:
9259 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9260 {
9261 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
9262 Double_t p1n0kRe = 0.;
9263 Double_t p1n0kIm = 0.;
9264
9265 // number of POIs in particular pt or eta bin:
9266 Double_t mp = 0.;
9267
9268 // 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):
9269 Double_t q1n0kRe = 0.;
9270 Double_t q1n0kIm = 0.;
9271 Double_t q2n0kRe = 0.;
9272 Double_t q2n0kIm = 0.;
9273
9274 // number of particles which are both RPs and POIs in particular pt or eta bin:
9275 Double_t mq = 0.;
9276
9277 if(type == "POI")
9278 {
9279 // q_{m*n,0}:
9280 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))
9281 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));
9282 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))
9283 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));
9284 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))
9285 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));
9286 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))
9287 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b));
9288
9289 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9290 }
9291 else if(type == "RP")
9292 {
9293 // q_{m*n,0}:
9294 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
9295 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
9296 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
9297 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
9298 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))
9299 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));
9300 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))
9301 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b));
9302
9303 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9304 }
9305 if(type == "POI")
9306 {
9307 // p_{m*n,0}:
9308 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
9309 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
9310 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
9311 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
9312
9313 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9314
9315 t = 1; // typeFlag = RP or POI
9316 }
9317 else if(type == "RP")
9318 {
9319 // p_{m*n,0} = q_{m*n,0}:
9320 p1n0kRe = q1n0kRe;
9321 p1n0kIm = q1n0kIm;
9322
9323 mp = mq;
9324
9325 t = 0; // typeFlag = RP or POI
9326 }
9327
9328 // <<cos n(psi1)>>:
9329 Double_t cosP1nPsi = 0.;
9330 if(mp)
9331 {
9332 cosP1nPsi = p1n0kRe/mp;
9333
9334 // fill profile for <<cos n(psi1)>>:
9335 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi,mp);
9336 // histogram to store <cos n(psi1)> e-b-e (needed in some other methods):
9337 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][0]->SetBinContent(b,cosP1nPsi);
9338 } // end of if(mp)
9339
9340 // <<cos n(psi1+phi2)>>:
9341 Double_t cosP1nPsiP1nPhi = 0.;
9342 if(mp*dMult-mq)
9343 {
9344 cosP1nPsiP1nPhi = (p1n0kRe*dReQ1n-p1n0kIm*dImQ1n-q2n0kRe)/(mp*dMult-mq);
9345 // fill profile for <<sin n(psi1+phi2)>>:
9346 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsiP1nPhi,mp*dMult-mq);
9347 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
9348 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][1]->SetBinContent(b,cosP1nPsiP1nPhi);
9349 } // end of if(mp*dMult-mq)
9350
9351 // <<cos n(psi1+phi2-phi3)>>:
9352 Double_t cosP1nPsi1P1nPhi2MPhi3 = 0.;
9353 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9354 {
9355 cosP1nPsi1P1nPhi2MPhi3 = (p1n0kRe*(pow(dImQ1n,2.)+pow(dReQ1n,2.)-dMult)
9356 - 1.*(q2n0kRe*dReQ1n+q2n0kIm*dImQ1n)
9357 - mq*dReQ1n+2.*q1n0kRe)
9358 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9359 // fill profile for <<sin n(psi1+phi2)>>:
9360 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1P1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9361 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
9362 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][2]->SetBinContent(b,cosP1nPsi1P1nPhi2MPhi3);
9363 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9364
9365 // <<cos n(psi1-phi2-phi3)>>:
9366 Double_t cosP1nPsi1M1nPhi2MPhi3 = 0.;
9367 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9368 {
9369 cosP1nPsi1M1nPhi2MPhi3 = (p1n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))+2.*p1n0kIm*dReQ1n*dImQ1n
9370 - 1.*(p1n0kRe*dReQ2n+p1n0kIm*dImQ2n)
9371 - 2.*mq*dReQ1n+2.*q1n0kRe)
9372 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9373 // fill profile for <<sin n(psi1+phi2)>>:
9374 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1M1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9375 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
9376 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][3]->SetBinContent(b,cosP1nPsi1M1nPhi2MPhi3);
9377 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9378 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9379
9380} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTerms(TString type, TString ptOrEta)
9381
9382
9383//==================================================================================================================================
9384
9385
9386void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUADiffFlow(TString type, TString ptOrEta)
9387{
9388 // Transfer prolfiles into histogams and correctly propagate the error (to be improved: description)
9389
9390 // to be improved: debugged - I do not correctly transfer all profiles into histos (bug appears only after merging)
9391
9392 Int_t t = -1; // type flag
9393 Int_t pe = -1; // ptEta flag
9394
9395 if(type == "RP")
9396 {
9397 t = 0;
9398 } else if(type == "POI")
9399 {
9400 t = 1;
9401 }
9402
9403 if(ptOrEta == "Pt")
9404 {
9405 pe = 0;
9406 } else if(ptOrEta == "Eta")
9407 {
9408 pe = 1;
9409 }
9410
9411 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
9412 //Double_t minPtEta[2] = {fPtMin,fEtaMin};
9413 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
9414 //Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
9415
9416 for(Int_t sc=0;sc<2;sc++) // sin or cos
9417 {
9418 for(Int_t cti=0;cti<9;cti++) // correction term index
9419 {
9420 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9421 {
9422 Double_t correctionTerm = fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]->GetBinContent(b);
9423 fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti]->SetBinContent(b,correctionTerm);
9424 // to be improved (propagate error correctly)
9425 // ...
9426 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9427 } // correction term index
9428 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
9429
9430}// end of void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUADiffFlow(TString type, TString ptOrEta)
9431
9432
9433//==================================================================================================================================
9434
9435
9436void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulantsCorrectedForNUA(TString type, TString ptOrEta)
9437{
9438 // Calculate generalized differential flow Q-cumulants (corrected for non-uniform acceptance)
9439
9440 Int_t typeFlag = -1;
9441 Int_t ptEtaFlag = -1;
9442
9443 if(type == "RP")
9444 {
9445 typeFlag = 0;
9446 } else if(type == "POI")
9447 {
9448 typeFlag = 1;
9449 }
9450
9451 if(ptOrEta == "Pt")
9452 {
9453 ptEtaFlag = 0;
9454 } else if(ptOrEta == "Eta")
9455 {
9456 ptEtaFlag = 1;
9457 }
9458
9459 // shortcuts:
9460 Int_t t = typeFlag;
9461 Int_t pe = ptEtaFlag;
9462
9463 // common:
9464 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
9465
9466 // 2-particle correlation:
9467 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
9468 // sin term coming from integrated flow:
9469 Double_t sinP1nPhi = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1); // <<sin(n*phi1)>>
9470 Double_t sinP1nPhi1P1nPhi2 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2); // <<sin(n*(phi1+phi2))>>
9471 Double_t sinP1nPhi1M1nPhi2M1nPhi3 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(3); // <<sin(n*(phi1-phi2-phi3))>>
9472 // cos term coming from integrated flow:
9473 Double_t cosP1nPhi = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1); // <<cos(n*phi1)>>
9474 Double_t cosP1nPhi1P1nPhi2 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2); // <<cos(n*(phi1+phi2))>>
9475 Double_t cosP1nPhi1M1nPhi2M1nPhi3 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(3); // <<cos(n*(phi1-phi2-phi3))>>
9476
9477 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9478 {
9479 Double_t twoPrime = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b); // <<2'>>
9480 Double_t fourPrime = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b); // <<4'>>
9481 Double_t sinP1nPsi = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][0]->GetBinContent(b); // <<sin n(Psi)>>
9482 Double_t cosP1nPsi = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][0]->GetBinContent(b); // <<cos n(Psi)>>
9483 Double_t sinP1nPsi1P1nPhi2 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][1]->GetBinContent(b); // <<sin n(psi1+phi2)>>
9484 Double_t cosP1nPsi1P1nPhi2 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][1]->GetBinContent(b); // <<cos n(psi1+phi2)>>
9485 Double_t sinP1nPsi1P1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][2]->GetBinContent(b); // <<sin n(psi1+phi2-phi3)>>
9486 Double_t cosP1nPsi1P1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][2]->GetBinContent(b); // <<cos n(psi1+phi2-phi3)>>
9487 Double_t sinP1nPsi1M1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][3]->GetBinContent(b); // <<sin n(psi1-phi2-phi3)>>
9488 Double_t cosP1nPsi1M1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][3]->GetBinContent(b); // <<cos n(psi1-phi2-phi3)>>
9489 // generalized QC{2'}:
9490 Double_t qc2Prime = twoPrime - sinP1nPsi*sinP1nPhi - cosP1nPsi*cosP1nPhi;
9491 fDiffFlowCumulants[t][pe][0]->SetBinContent(b,qc2Prime);
9492 // generalized QC{4'}:
9493 Double_t qc4Prime = fourPrime-2.*twoPrime*two
9494 - cosP1nPsi*cosP1nPhi1M1nPhi2M1nPhi3
9495 + sinP1nPsi*sinP1nPhi1M1nPhi2M1nPhi3
9496 - cosP1nPhi*cosP1nPsi1M1nPhi2M1nPhi3
9497 + sinP1nPhi*sinP1nPsi1M1nPhi2M1nPhi3
9498 - 2.*cosP1nPhi*cosP1nPsi1P1nPhi2M1nPhi3
9499 - 2.*sinP1nPhi*sinP1nPsi1P1nPhi2M1nPhi3
9500 - cosP1nPsi1P1nPhi2*cosP1nPhi1P1nPhi2
9501 - sinP1nPsi1P1nPhi2*sinP1nPhi1P1nPhi2
9502 + 2.*cosP1nPhi1P1nPhi2*(cosP1nPsi*cosP1nPhi-sinP1nPsi*sinP1nPhi)
9503 + 2.*sinP1nPhi1P1nPhi2*(cosP1nPsi*sinP1nPhi+sinP1nPsi*cosP1nPhi)
9504 + 4.*two*(cosP1nPsi*cosP1nPhi+sinP1nPsi*sinP1nPhi)
9505 + 2.*cosP1nPsi1P1nPhi2*(pow(cosP1nPhi,2.)-pow(sinP1nPhi,2.))
9506 + 4.*sinP1nPsi1P1nPhi2*cosP1nPhi*sinP1nPhi
9507 + 4.*twoPrime*(pow(cosP1nPhi,2.)+pow(sinP1nPhi,2.))
9508 - 6.*(pow(cosP1nPhi,2.)-pow(sinP1nPhi,2.))
9509 * (cosP1nPsi*cosP1nPhi-sinP1nPsi*sinP1nPhi)
9510 - 12.*cosP1nPhi*sinP1nPhi
9511 * (sinP1nPsi*cosP1nPhi+cosP1nPsi*sinP1nPhi);
9512 fDiffFlowCumulants[t][pe][1]->SetBinContent(b,qc4Prime);
9513 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
9514
9515} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulantsCorrectedForNUA(TString type, TString ptOrEta)
9516
9517
9518//==================================================================================================================================
9519
9520
9521void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectedForNUA(TString type, TString ptOrEta)
9522{
9523 // Calculate differential flow corrected for non-uniform acceptance.
9524
9525 // to be improved (rewritten completely)
9526
9527 Int_t typeFlag = -1;
9528 Int_t ptEtaFlag = -1;
9529
9530 if(type == "RP")
9531 {
9532 typeFlag = 0;
9533 } else if(type == "POI")
9534 {
9535 typeFlag = 1;
9536 }
9537
9538 if(ptOrEta == "Pt")
9539 {
9540 ptEtaFlag = 0;
9541 } else if(ptOrEta == "Eta")
9542 {
9543 ptEtaFlag = 1;
9544 }
9545
9546 // shortcuts:
9547 Int_t t = typeFlag;
9548 Int_t pe = ptEtaFlag;
9549
9550 // common:
9551 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
9552
9553 // to be improved: access here generalized QC{2} and QC{4} instead:
9554 Double_t dV2 = fIntFlow->GetBinContent(1);
9555 Double_t dV4 = fIntFlow->GetBinContent(2);
9556
9557 // loop over pt or eta bins:
9558 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9559 {
9560 // generalized QC{2'}:
9561 Double_t gQC2Prime = fDiffFlowCumulants[t][pe][0]->GetBinContent(b);
9562 // v'{2}:
9563 if(dV2>0)
9564 {
9565 Double_t v2Prime = gQC2Prime/dV2;
9566 fDiffFlow[t][pe][0]->SetBinContent(b,v2Prime);
9567 }
9568 // generalized QC{4'}:
9569 Double_t gQC4Prime = fDiffFlowCumulants[t][pe][1]->GetBinContent(b);
9570 // v'{4}:
9571 if(dV4>0)
9572 {
9573 Double_t v4Prime = -gQC4Prime/pow(dV4,3.);
9574 fDiffFlow[t][pe][1]->SetBinContent(b,v4Prime);
9575 }
9576 } // end of for(Int_t b=1;b<=fnBinsPtEta[pe];b++)
9577
9578} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectedForNUA(TString type, TString ptOrEta);
9579
9580
9581//==================================================================================================================================
9582
9583
0328db2d 9584void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoops(AliFlowEventSimple * const anEvent)
489d5531 9585{
9586 // Evaluate with nested loops multiparticle correlations for integrated flow (without using the particle weights).
9587
9588 // Remark: Results are stored in profile fIntFlowDirectCorrelations whose binning is organized as follows:
9589 //
9590 // 1st bin: <2>_{1n|1n} = two1n1n = cos(n*(phi1-phi2))>
9591 // 2nd bin: <2>_{2n|2n} = two2n2n = cos(2n*(phi1-phi2))>
9592 // 3rd bin: <2>_{3n|3n} = two3n3n = cos(3n*(phi1-phi2))>
9593 // 4th bin: <2>_{4n|4n} = two4n4n = cos(4n*(phi1-phi2))>
9594 // 5th bin: ---- EMPTY ----
9595 // 6th bin: <3>_{2n|1n,1n} = three2n1n1n = <cos(n*(2.*phi1-phi2-phi3))>
9596 // 7th bin: <3>_{3n|2n,1n} = three3n2n1n = <cos(n*(3.*phi1-2.*phi2-phi3))>
9597 // 8th bin: <3>_{4n|2n,2n} = three4n2n2n = <cos(n*(4.*phi1-2.*phi2-2.*phi3))>
9598 // 9th bin: <3>_{4n|3n,1n} = three4n3n1n = <cos(n*(4.*phi1-3.*phi2-phi3))>
9599 // 10th bin: ---- EMPTY ----
9600 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1n = <cos(n*(phi1+phi2-phi3-phi4))>
9601 // 12th bin: <4>_{2n,1n|2n,1n} = four2n1n2n1n = <cos(2.*n*(phi1+phi2-phi3-phi4))>
9602 // 13th bin: <4>_{2n,2n|2n,2n} = four2n2n2n2n = <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>
9603 // 14th bin: <4>_{3n|1n,1n,1n} = four3n1n1n1n = <cos(n*(3.*phi1-phi2-phi3-phi4))>
9604 // 15th bin: <4>_{3n,1n|3n,1n} = four3n1n3n1n = <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>
9605 // 16th bin: <4>_{3n,1n|2n,2n} = four3n1n2n2n = <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>
9606 // 17th bin: <4>_{4n|2n,1n,1n} = four4n2n1n1n = <cos(n*(3.*phi1+phi2-3.*phi3-phi4))>
9607 // 18th bin: ---- EMPTY ----
9608 // 19th bin: <5>_{2n|1n,1n,1n,1n} = five2n1n1n1n1n = <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>
9609 // 20th bin: <5>_{2n,2n|2n,1n,1n} = five2n2n2n1n1n = <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>
9610 // 21st bin: <5>_{3n,1n|2n,1n,1n} = five3n1n2n1n1n = <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>
9611 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = five4n1n1n1n1n = <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>
9612 // 23rd bin: ---- EMPTY ----
9613 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = six1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
9614 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = six2n1n1n2n1n1n = <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>
9615 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = six2n2n1n1n1n1n = <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>
9616 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = six3n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>
9617 // 28th bin: ---- EMPTY ----
9618 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = seven2n1n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
9619 // 30th bin: ---- EMPTY ----
9620 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = eight1n1n1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
9621
9622 Int_t nPrim = anEvent->NumberOfTracks();
9623 AliFlowTrackSimple *aftsTrack = NULL;
9624 Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
9625 Int_t n = fHarmonic;
9626 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
9627 Double_t dMult = (*fSMpk)(0,0);
9628 cout<<endl;
9629 cout<<"Multiparticle correlations: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
9630 if(dMult<2)
9631 {
9632 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
9633 } else if (dMult>fMaxAllowedMultiplicity)
9634 {
9635 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
9636 } else
9637 {
9638 cout<<"... evaluating nested loops (without using particle weights)..."<<endl;
9639 }
9640
9641 // 2-particle correlations:
9642 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
9643 {
9644 for(Int_t i1=0;i1<nPrim;i1++)
9645 {
9646 aftsTrack=anEvent->GetTrack(i1);
9647 if(!(aftsTrack->InRPSelection())) continue;
9648 phi1=aftsTrack->Phi();
9649 for(Int_t i2=0;i2<nPrim;i2++)
9650 {
9651 if(i2==i1)continue;
9652 aftsTrack=anEvent->GetTrack(i2);
9653 if(!(aftsTrack->InRPSelection())) continue;
9654 phi2=aftsTrack->Phi();
9655 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
9656 // fill the profile with 2-p correlations:
9657 fIntFlowDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),1.); // <cos(n*(phi1-phi2))>
9658 fIntFlowDirectCorrelations->Fill(1.5,cos(2.*n*(phi1-phi2)),1.); // <cos(2n*(phi1-phi2))>
9659 fIntFlowDirectCorrelations->Fill(2.5,cos(3.*n*(phi1-phi2)),1.); // <cos(3n*(phi1-phi2))>
9660 fIntFlowDirectCorrelations->Fill(3.5,cos(4.*n*(phi1-phi2)),1.); // <cos(4n*(phi1-phi2))>
9661 } // end of for(Int_t i2=0;i2<nPrim;i2++)
9662 } // end of for(Int_t i1=0;i1<nPrim;i1++)
9663 } // end of if(nPrim>=2)
9664
9665 // 3-particle correlations:
9666 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
9667 {
9668 for(Int_t i1=0;i1<nPrim;i1++)
9669 {
9670 aftsTrack=anEvent->GetTrack(i1);
9671 if(!(aftsTrack->InRPSelection())) continue;
9672 phi1=aftsTrack->Phi();
9673 for(Int_t i2=0;i2<nPrim;i2++)
9674 {
9675 if(i2==i1)continue;
9676 aftsTrack=anEvent->GetTrack(i2);
9677 if(!(aftsTrack->InRPSelection())) continue;
9678 phi2=aftsTrack->Phi();
9679 for(Int_t i3=0;i3<nPrim;i3++)
9680 {
9681 if(i3==i1||i3==i2)continue;
9682 aftsTrack=anEvent->GetTrack(i3);
9683 if(!(aftsTrack->InRPSelection())) continue;
9684 phi3=aftsTrack->Phi();
9685 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;
9686 // fill the profile with 3-p correlations:
9687 fIntFlowDirectCorrelations->Fill(5.,cos(2.*n*phi1-n*(phi2+phi3)),1.); //<3>_{2n|nn,n}
9688 fIntFlowDirectCorrelations->Fill(6.,cos(3.*n*phi1-2.*n*phi2-n*phi3),1.); //<3>_{3n|2n,n}
9689 fIntFlowDirectCorrelations->Fill(7.,cos(4.*n*phi1-2.*n*phi2-2.*n*phi3),1.); //<3>_{4n|2n,2n}
9690 fIntFlowDirectCorrelations->Fill(8.,cos(4.*n*phi1-3.*n*phi2-n*phi3),1.); //<3>_{4n|3n,n}
9691 } // end of for(Int_t i3=0;i3<nPrim;i3++)
9692 } // end of for(Int_t i2=0;i2<nPrim;i2++)
9693 } // end of for(Int_t i1=0;i1<nPrim;i1++)
9694 } // end of if(nPrim>=3)
9695
9696 // 4-particle correlations:
9697 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)
9698 {
9699 for(Int_t i1=0;i1<nPrim;i1++)
9700 {
9701 aftsTrack=anEvent->GetTrack(i1);
9702 if(!(aftsTrack->InRPSelection())) continue;
9703 phi1=aftsTrack->Phi();
9704 for(Int_t i2=0;i2<nPrim;i2++)
9705 {
9706 if(i2==i1)continue;
9707 aftsTrack=anEvent->GetTrack(i2);
9708 if(!(aftsTrack->InRPSelection())) continue;
9709 phi2=aftsTrack->Phi();
9710 for(Int_t i3=0;i3<nPrim;i3++)
9711 {
9712 if(i3==i1||i3==i2)continue;
9713 aftsTrack=anEvent->GetTrack(i3);
9714 if(!(aftsTrack->InRPSelection())) continue;
9715 phi3=aftsTrack->Phi();
9716 for(Int_t i4=0;i4<nPrim;i4++)
9717 {
9718 if(i4==i1||i4==i2||i4==i3)continue;
9719 aftsTrack=anEvent->GetTrack(i4);
9720 if(!(aftsTrack->InRPSelection())) continue;
9721 phi4=aftsTrack->Phi();
9722 if(nPrim==4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush;
9723 // fill the profile with 4-p correlations:
9724 fIntFlowDirectCorrelations->Fill(10.,cos(n*phi1+n*phi2-n*phi3-n*phi4),1.); // <4>_{n,n|n,n}
9725 fIntFlowDirectCorrelations->Fill(11.,cos(2.*n*phi1+n*phi2-2.*n*phi3-n*phi4),1.); // <4>_{2n,n|2n,n}
9726 fIntFlowDirectCorrelations->Fill(12.,cos(2.*n*phi1+2*n*phi2-2.*n*phi3-2.*n*phi4),1.); // <4>_{2n,2n|2n,2n}
9727 fIntFlowDirectCorrelations->Fill(13.,cos(3.*n*phi1-n*phi2-n*phi3-n*phi4),1.); // <4>_{3n|n,n,n}
9728 fIntFlowDirectCorrelations->Fill(14.,cos(3.*n*phi1+n*phi2-3.*n*phi3-n*phi4),1.); // <4>_{3n,n|3n,n}
9729 fIntFlowDirectCorrelations->Fill(15.,cos(3.*n*phi1+n*phi2-2.*n*phi3-2.*n*phi4),1.); // <4>_{3n,n|2n,2n}
9730 fIntFlowDirectCorrelations->Fill(16.,cos(4.*n*phi1-2.*n*phi2-n*phi3-n*phi4),1.); // <4>_{4n|2n,n,n}
9731 } // end of for(Int_t i4=0;i4<nPrim;i4++)
9732 } // end of for(Int_t i3=0;i3<nPrim;i3++)
9733 } // end of for(Int_t i2=0;i2<nPrim;i2++)
9734 } // end of for(Int_t i1=0;i1<nPrim;i1++)
9735 } // end of if(nPrim>=)
9736
9737 // 5-particle correlations:
9738 if(nPrim>=5 && nPrim<=fMaxAllowedMultiplicity)
9739 {
9740 for(Int_t i1=0;i1<nPrim;i1++)
9741 {
9742 aftsTrack=anEvent->GetTrack(i1);
9743 if(!(aftsTrack->InRPSelection())) continue;
9744 phi1=aftsTrack->Phi();
9745 for(Int_t i2=0;i2<nPrim;i2++)
9746 {
9747 if(i2==i1)continue;
9748 aftsTrack=anEvent->GetTrack(i2);
9749 if(!(aftsTrack->InRPSelection())) continue;
9750 phi2=aftsTrack->Phi();
9751 for(Int_t i3=0;i3<nPrim;i3++)
9752 {
9753 if(i3==i1||i3==i2)continue;
9754 aftsTrack=anEvent->GetTrack(i3);
9755 if(!(aftsTrack->InRPSelection())) continue;
9756 phi3=aftsTrack->Phi();
9757 for(Int_t i4=0;i4<nPrim;i4++)
9758 {
9759 if(i4==i1||i4==i2||i4==i3)continue;
9760 aftsTrack=anEvent->GetTrack(i4);
9761 if(!(aftsTrack->InRPSelection())) continue;
9762 phi4=aftsTrack->Phi();
9763 for(Int_t i5=0;i5<nPrim;i5++)
9764 {
9765 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
9766 aftsTrack=anEvent->GetTrack(i5);
9767 if(!(aftsTrack->InRPSelection())) continue;
9768 phi5=aftsTrack->Phi();
9769 if(nPrim==5) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<"\r"<<flush;
9770 // fill the profile with 5-p correlations:
9771 fIntFlowDirectCorrelations->Fill(18.,cos(2.*n*phi1+n*phi2-n*phi3-n*phi4-n*phi5),1.); //<5>_{2n,n|n,n,n}
9772 fIntFlowDirectCorrelations->Fill(19.,cos(2.*n*phi1+2.*n*phi2-2.*n*phi3-n*phi4-n*phi5),1.); //<5>_{2n,2n|2n,n,n}
9773 fIntFlowDirectCorrelations->Fill(20.,cos(3.*n*phi1+n*phi2-2.*n*phi3-n*phi4-n*phi5),1.); //<5>_{3n,n|2n,n,n}
9774 fIntFlowDirectCorrelations->Fill(21.,cos(4.*n*phi1-n*phi2-n*phi3-n*phi4-n*phi5),1.); //<5>_{4n|n,n,n,n}
9775 } // end of for(Int_t i5=0;i5<nPrim;i5++)
9776 } // end of for(Int_t i4=0;i4<nPrim;i4++)
9777 } // end of for(Int_t i3=0;i3<nPrim;i3++)
9778 } // end of for(Int_t i2=0;i2<nPrim;i2++)
9779 } // end of for(Int_t i1=0;i1<nPrim;i1++)
9780 } // end of if(nPrim>=5)
9781
9782 // 6-particle correlations:
9783 if(nPrim>=6 && nPrim<=fMaxAllowedMultiplicity)
9784 {
9785 for(Int_t i1=0;i1<nPrim;i1++)
9786 {
9787 aftsTrack=anEvent->GetTrack(i1);
9788 if(!(aftsTrack->InRPSelection())) continue;
9789 phi1=aftsTrack->Phi();
9790 for(Int_t i2=0;i2<nPrim;i2++)
9791 {
9792 if(i2==i1)continue;
9793 aftsTrack=anEvent->GetTrack(i2);
9794 if(!(aftsTrack->InRPSelection())) continue;
9795 phi2=aftsTrack->Phi();
9796 for(Int_t i3=0;i3<nPrim;i3++)
9797 {
9798 if(i3==i1||i3==i2)continue;
9799 aftsTrack=anEvent->GetTrack(i3);
9800 if(!(aftsTrack->InRPSelection())) continue;
9801 phi3=aftsTrack->Phi();
9802 for(Int_t i4=0;i4<nPrim;i4++)
9803 {
9804 if(i4==i1||i4==i2||i4==i3)continue;
9805 aftsTrack=anEvent->GetTrack(i4);
9806 if(!(aftsTrack->InRPSelection())) continue;
9807 phi4=aftsTrack->Phi();
9808 for(Int_t i5=0;i5<nPrim;i5++)
9809 {
9810 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
9811 aftsTrack=anEvent->GetTrack(i5);
9812 if(!(aftsTrack->InRPSelection())) continue;
9813 phi5=aftsTrack->Phi();
9814 for(Int_t i6=0;i6<nPrim;i6++)
9815 {
9816 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
9817 aftsTrack=anEvent->GetTrack(i6);
9818 if(!(aftsTrack->InRPSelection())) continue;
9819 phi6=aftsTrack->Phi();
9820 if(nPrim==6) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<"\r"<<flush;
9821 // fill the profile with 6-p correlations:
9822 fIntFlowDirectCorrelations->Fill(23.,cos(n*phi1+n*phi2+n*phi3-n*phi4-n*phi5-n*phi6),1.); //<6>_{n,n,n|n,n,n}
9823 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}
9824 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}
9825 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}
9826 } // end of for(Int_t i6=0;i6<nPrim;i6++)
9827 } // end of for(Int_t i5=0;i5<nPrim;i5++)
9828 } // end of for(Int_t i4=0;i4<nPrim;i4++)
9829 } // end of for(Int_t i3=0;i3<nPrim;i3++)
9830 } // end of for(Int_t i2=0;i2<nPrim;i2++)
9831 } // end of for(Int_t i1=0;i1<nPrim;i1++)
9832 } // end of if(nPrim>=6)
9833
9834 // 7-particle correlations:
9835 if(nPrim>=7 && nPrim<=fMaxAllowedMultiplicity)
9836 {
9837 for(Int_t i1=0;i1<nPrim;i1++)
9838 {
9839 aftsTrack=anEvent->GetTrack(i1);
9840 if(!(aftsTrack->InRPSelection())) continue;
9841 phi1=aftsTrack->Phi();
9842 for(Int_t i2=0;i2<nPrim;i2++)
9843 {
9844 if(i2==i1)continue;
9845 aftsTrack=anEvent->GetTrack(i2);
9846 if(!(aftsTrack->InRPSelection())) continue;
9847 phi2=aftsTrack->Phi();
9848 for(Int_t i3=0;i3<nPrim;i3++)
9849 {
9850 if(i3==i1||i3==i2)continue;
9851 aftsTrack=anEvent->GetTrack(i3);
9852 if(!(aftsTrack->InRPSelection())) continue;
9853 phi3=aftsTrack->Phi();
9854 for(Int_t i4=0;i4<nPrim;i4++)
9855 {
9856 if(i4==i1||i4==i2||i4==i3)continue;
9857 aftsTrack=anEvent->GetTrack(i4);
9858 if(!(aftsTrack->InRPSelection())) continue;
9859 phi4=aftsTrack->Phi();
9860 for(Int_t i5=0;i5<nPrim;i5++)
9861 {
9862 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
9863 aftsTrack=anEvent->GetTrack(i5);
9864 if(!(aftsTrack->InRPSelection())) continue;
9865 phi5=aftsTrack->Phi();
9866 for(Int_t i6=0;i6<nPrim;i6++)
9867 {
9868 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
9869 aftsTrack=anEvent->GetTrack(i6);
9870 if(!(aftsTrack->InRPSelection())) continue;
9871 phi6=aftsTrack->Phi();
9872 for(Int_t i7=0;i7<nPrim;i7++)
9873 {
9874 if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;
9875 aftsTrack=anEvent->GetTrack(i7);
9876 if(!(aftsTrack->InRPSelection())) continue;
9877 phi7=aftsTrack->Phi();
9878 if(nPrim==7) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<" "<<i7<<"\r"<<flush;
9879 // fill the profile with 7-p correlation:
9880 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}
9881 } // end of for(Int_t i7=0;i7<nPrim;i7++)
9882 } // end of for(Int_t i6=0;i6<nPrim;i6++)
9883 } // end of for(Int_t i5=0;i5<nPrim;i5++)
9884 } // end of for(Int_t i4=0;i4<nPrim;i4++)
9885 } // end of for(Int_t i3=0;i3<nPrim;i3++)
9886 } // end of for(Int_t i2=0;i2<nPrim;i2++)
9887 } // end of for(Int_t i1=0;i1<nPrim;i1++)
9888 } // end of if(nPrim>=7)
9889
9890 // 8-particle correlations:
9891 if(nPrim>=8 && nPrim<=fMaxAllowedMultiplicity)
9892 {
9893 for(Int_t i1=0;i1<nPrim;i1++)
9894 {
9895 aftsTrack=anEvent->GetTrack(i1);
9896 if(!(aftsTrack->InRPSelection())) continue;
9897 phi1=aftsTrack->Phi();
9898 for(Int_t i2=0;i2<nPrim;i2++)
9899 {
9900 if(i2==i1)continue;
9901 aftsTrack=anEvent->GetTrack(i2);
9902 if(!(aftsTrack->InRPSelection())) continue;
9903 phi2=aftsTrack->Phi();
9904 for(Int_t i3=0;i3<nPrim;i3++)
9905 {
9906 if(i3==i1||i3==i2)continue;
9907 aftsTrack=anEvent->GetTrack(i3);
9908 if(!(aftsTrack->InRPSelection())) continue;
9909 phi3=aftsTrack->Phi();
9910 for(Int_t i4=0;i4<nPrim;i4++)
9911 {
9912 if(i4==i1||i4==i2||i4==i3)continue;
9913 aftsTrack=anEvent->GetTrack(i4);
9914 if(!(aftsTrack->InRPSelection())) continue;
9915 phi4=aftsTrack->Phi();
9916 for(Int_t i5=0;i5<nPrim;i5++)
9917 {
9918 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
9919 aftsTrack=anEvent->GetTrack(i5);
9920 if(!(aftsTrack->InRPSelection())) continue;
9921 phi5=aftsTrack->Phi();
9922 for(Int_t i6=0;i6<nPrim;i6++)
9923 {
9924 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
9925 aftsTrack=anEvent->GetTrack(i6);
9926 if(!(aftsTrack->InRPSelection())) continue;
9927 phi6=aftsTrack->Phi();
9928 for(Int_t i7=0;i7<nPrim;i7++)
9929 {
9930 if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;
9931 aftsTrack=anEvent->GetTrack(i7);
9932 if(!(aftsTrack->InRPSelection())) continue;
9933 phi7=aftsTrack->Phi();
9934 for(Int_t i8=0;i8<nPrim;i8++)
9935 {
9936 if(i8==i1||i8==i2||i8==i3||i8==i4||i8==i5||i8==i6||i8==i7)continue;
9937 aftsTrack=anEvent->GetTrack(i8);
9938 if(!(aftsTrack->InRPSelection())) continue;
9939 phi8=aftsTrack->Phi();
9940 cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<" "<<i7<<" "<<i8<<"\r"<<flush;
9941 // fill the profile with 8-p correlation:
9942 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}
9943 } // end of for(Int_t i8=0;i8<nPrim;i8++)
9944 } // end of for(Int_t i7=0;i7<nPrim;i7++)
9945 } // end of for(Int_t i6=0;i6<nPrim;i6++)
9946 } // end of for(Int_t i5=0;i5<nPrim;i5++)
9947 } // end of for(Int_t i4=0;i4<nPrim;i4++)
9948 } // end of for(Int_t i3=0;i3<nPrim;i3++)
9949 } // end of for(Int_t i2=0;i2<nPrim;i2++)
9950 } // end of for(Int_t i1=0;i1<nPrim;i1++)
9951 } // end of if(nPrim>=8)
9952
9953 cout<<endl;
9954
9955} // end of AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoops(AliFlowEventSimple* anEvent)
9956
9957
9958//==================================================================================================================================
9959
9960
9961void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrelations()
9962{
9963 // Cross-check results for multiparticle correlations needed for int. flow: results from Q-vectors vs results from nested loops.
9964
9965 cout<<endl;
9966 cout<<endl;
9967 cout<<" *****************************************"<<endl;
9968 cout<<" **** cross-checking the correlations ****"<<endl;
9969 cout<<" **** for integrated flow ****"<<endl;
9970 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
9971 {
9972 cout<<" **** (particle weights not used) ****"<<endl;
9973 } else
9974 {
9975 cout<<" **** (particle weights used) ****"<<endl;
9976 }
9977 cout<<" *****************************************"<<endl;
9978 cout<<endl;
9979 cout<<endl;
9980
9981 Int_t ciMax = 32; // to be improved (removed eventually when I calculate 6th and 8th order with particle weights)
9982
9983 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
9984 {
9985 ciMax = 11;
9986 }
9987
9988 for(Int_t ci=1;ci<=ciMax;ci++)
9989 {
9990 if(strcmp((fIntFlowCorrelationsAllPro->GetXaxis())->GetBinLabel(ci), "") == 0) continue; // to be improved (access finalized histogram here)
9991 cout<<(fIntFlowCorrelationsAllPro->GetXaxis())->GetBinLabel(ci)<<":"<<endl; // to be improved (access finalized histogram here)
9992 cout<<"from Q-vectors = "<<fIntFlowCorrelationsAllPro->GetBinContent(ci)<<endl; // to be improved (access finalized histogram here)
9993 cout<<"from nested loops = "<<fIntFlowDirectCorrelations->GetBinContent(ci)<<endl;
9994 cout<<endl;
9995 }
9996
9997} // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrelations()
9998
9999
10000//================================================================================================================================
10001
10002
10003void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrectionTermsForNUA()
10004{
10005 // Cross-check results for corrections terms for non-uniform acceptance needed for int. flow: results from Q-vectors vs results from nested loops.
10006
10007 cout<<endl;
10008 cout<<endl;
10009 cout<<" *********************************************"<<endl;
10010 cout<<" **** cross-checking the correction terms ****"<<endl;
10011 cout<<" **** for non-uniform acceptance relevant ****"<<endl;
10012 cout<<" **** for integrated flow ****"<<endl;
10013 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
10014 {
10015 cout<<" **** (particle weights not used) ****"<<endl;
10016 } else
10017 {
10018 cout<<" **** (particle weights used) ****"<<endl;
10019 }
10020 cout<<" *********************************************"<<endl;
10021 cout<<endl;
10022 cout<<endl;
10023
10024 for(Int_t ci=1;ci<=10;ci++) // correction term index
10025 {
10026 for(Int_t sc=0;sc<2;sc++) // sin or cos term
10027 {
10028 if(strcmp((fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->GetBinLabel(ci), "") == 0) continue; // to be improved (access finalized histogram here)
10029 cout<<(fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->GetBinLabel(ci)<<":"<<endl; // to be improved (access finalized histogram here)
10030 cout<<"from Q-vectors = "<<fIntFlowCorrectionTermsForNUAPro[sc]->GetBinContent(ci)<<endl; // to be improved (access finalized histogram here)
10031 cout<<"from nested loops = "<<fIntFlowDirectCorrectionTermsForNUA[sc]->GetBinContent(ci)<<endl;
10032 cout<<endl;
10033 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos term
10034 } // end of for(Int_t ci=1;ci<=10;ci++) // correction term index
10035
10036} // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrectionTermsForNUA()
10037
10038
10039//================================================================================================================================
10040
10041
0328db2d 10042void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent)
489d5531 10043{
10044 // Evaluate with nested loops multiparticle correlations for integrated flow (using the particle weights).
10045
10046 // Results are stored in profile fIntFlowDirectCorrelations.
10047 // Remark 1: When particle weights are used the binning of fIntFlowDirectCorrelations is organized as follows:
10048 //
10049 // 1st bin: <2>_{1n|1n} = two1n1nW1W1 = <w1 w2 cos(n*(phi1-phi2))>
10050 // 2nd bin: <2>_{2n|2n} = two2n2nW2W2 = <w1^2 w2^2 cos(2n*(phi1-phi2))>
10051 // 3rd bin: <2>_{3n|3n} = two3n3nW3W3 = <w1^3 w2^3 cos(3n*(phi1-phi2))>
10052 // 4th bin: <2>_{4n|4n} = two4n4nW4W4 = <w1^4 w2^4 cos(4n*(phi1-phi2))>
10053 // 5th bin: ---- EMPTY ----
10054 // 6th bin: <3>_{2n|1n,1n} = three2n1n1nW2W1W1 = <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
10055 // 7th bin: <3>_{3n|2n,1n} = ...
10056 // 8th bin: <3>_{4n|2n,2n} = ...
10057 // 9th bin: <3>_{4n|3n,1n} = ...
10058 // 10th bin: ---- EMPTY ----
10059 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1nW1W1W1W1 = <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
10060 // 12th bin: <4>_{2n,1n|2n,1n} = ...
10061 // 13th bin: <4>_{2n,2n|2n,2n} = ...
10062 // 14th bin: <4>_{3n|1n,1n,1n} = ...
10063 // 15th bin: <4>_{3n,1n|3n,1n} = ...
10064 // 16th bin: <4>_{3n,1n|2n,2n} = ...
10065 // 17th bin: <4>_{4n|2n,1n,1n} = ...
10066 // 18th bin: ---- EMPTY ----
10067 // 19th bin: <5>_{2n|1n,1n,1n,1n} = ...
10068 // 20th bin: <5>_{2n,2n|2n,1n,1n} = ...
10069 // 21st bin: <5>_{3n,1n|2n,1n,1n} = ...
10070 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = ...
10071 // 23rd bin: ---- EMPTY ----
10072 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = ...
10073 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = ...
10074 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = ...
10075 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = ...
10076 // 28th bin: ---- EMPTY ----
10077 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = ...
10078 // 30th bin: ---- EMPTY ----
10079 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = ...
57340a27 10080
489d5531 10081 // Remark 2: When particle weights are used there are some extra correlations. They are stored in
10082 // fIntFlowExtraDirectCorrelations binning of which is organized as follows:
57340a27 10083
489d5531 10084 // 1st bin: two1n1nW3W1 = <w1^3 w2 cos(n*(phi1-phi2))>
10085 // 2nd bin: two1n1nW1W1W2 = <w1 w2 w3^2 cos(n*(phi1-phi2))>
10086 // ...
57340a27 10087
489d5531 10088 Int_t nPrim = anEvent->NumberOfTracks();
10089 AliFlowTrackSimple *aftsTrack = NULL;
10090 //Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
10091 //Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1., wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
10092 Double_t phi1=0., phi2=0., phi3=0., phi4=0.;
10093 Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1.;
10094 Int_t n = fHarmonic;
10095 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
10096 Double_t dMult = (*fSMpk)(0,0);
10097 cout<<endl;
10098 cout<<"Multiparticle correlations: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
10099 if(dMult<2)
10100 {
10101 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
10102 } else if (dMult>fMaxAllowedMultiplicity)
10103 {
10104 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
10105 } else
10106 {
10107 cout<<"... evaluating nested loops (using particle weights) ..."<<endl;
10108 }
10109
10110 // 2-particle correlations:
10111 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
10112 {
10113 // 2 nested loops multiparticle correlations using particle weights:
10114 for(Int_t i1=0;i1<nPrim;i1++)
10115 {
10116 aftsTrack=anEvent->GetTrack(i1);
10117 if(!(aftsTrack->InRPSelection())) continue;
10118 phi1=aftsTrack->Phi();
10119 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
10120 for(Int_t i2=0;i2<nPrim;i2++)
10121 {
10122 if(i2==i1)continue;
10123 aftsTrack=anEvent->GetTrack(i2);
10124 if(!(aftsTrack->InRPSelection())) continue;
10125 phi2=aftsTrack->Phi();
10126 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
10127 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
10128 // 2-p correlations using particle weights:
10129 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),wPhi1*wPhi2); // <w1 w2 cos( n*(phi1-phi2))>
10130 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))>
10131 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))>
10132 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))>
10133 // extra correlations:
10134 // 2-p extra correlations (do not appear if particle weights are not used):
10135 if(fUsePhiWeights) fIntFlowExtraDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),pow(wPhi1,3)*wPhi2); // <w1^3 w2 cos(n*(phi1-phi2))>
10136 // ...
10137 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10138 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10139 } // end of if(nPrim>=2)
10140
10141 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
57340a27 10142 {
489d5531 10143 // 3 nested loops multiparticle correlations using particle weights:
10144 for(Int_t i1=0;i1<nPrim;i1++)
57340a27 10145 {
489d5531 10146 aftsTrack=anEvent->GetTrack(i1);
10147 if(!(aftsTrack->InRPSelection())) continue;
10148 phi1=aftsTrack->Phi();
10149 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
10150 for(Int_t i2=0;i2<nPrim;i2++)
10151 {
10152 if(i2==i1)continue;
10153 aftsTrack=anEvent->GetTrack(i2);
10154 if(!(aftsTrack->InRPSelection())) continue;
10155 phi2=aftsTrack->Phi();
10156 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
10157 for(Int_t i3=0;i3<nPrim;i3++)
10158 {
10159 if(i3==i1||i3==i2)continue;
10160 aftsTrack=anEvent->GetTrack(i3);
10161 if(!(aftsTrack->InRPSelection())) continue;
10162 phi3=aftsTrack->Phi();
10163 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
10164 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;
10165 // 3-p correlations using particle weights:
10166 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))>
10167 // ...
10168 // extra correlations:
10169 // 2-p extra correlations (do not appear if particle weights are not used):
10170 if(fUsePhiWeights) fIntFlowExtraDirectCorrelations->Fill(1.5,cos(n*(phi1-phi2)),wPhi1*wPhi2*pow(wPhi3,2)); // <w1 w2 w3^2 cos(n*(phi1-phi2))>
10171 // ...
10172 // 3-p extra correlations (do not appear if particle weights are not used):
10173 // ...
10174 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10175 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10176 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10177 } // end of if(nPrim>=3)
57340a27 10178
489d5531 10179 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)
10180 {
10181 // 4 nested loops multiparticle correlations using particle weights:
10182 for(Int_t i1=0;i1<nPrim;i1++)
10183 {
10184 aftsTrack=anEvent->GetTrack(i1);
10185 if(!(aftsTrack->InRPSelection())) continue;
10186 phi1=aftsTrack->Phi();
10187 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
10188 for(Int_t i2=0;i2<nPrim;i2++)
10189 {
10190 if(i2==i1)continue;
10191 aftsTrack=anEvent->GetTrack(i2);
10192 if(!(aftsTrack->InRPSelection())) continue;
10193 phi2=aftsTrack->Phi();
10194 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
10195 for(Int_t i3=0;i3<nPrim;i3++)
10196 {
10197 if(i3==i1||i3==i2)continue;
10198 aftsTrack=anEvent->GetTrack(i3);
10199 if(!(aftsTrack->InRPSelection())) continue;
10200 phi3=aftsTrack->Phi();
10201 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
10202 for(Int_t i4=0;i4<nPrim;i4++)
10203 {
10204 if(i4==i1||i4==i2||i4==i3)continue;
10205 aftsTrack=anEvent->GetTrack(i4);
10206 if(!(aftsTrack->InRPSelection())) continue;
10207 phi4=aftsTrack->Phi();
10208 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
10209 if(nPrim>=4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush; // to be improved (replace eventually this if statement with if(nPrim==4))
10210 // 4-p correlations using particle weights:
10211 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(10.5,cos(n*phi1+n*phi2-n*phi3-n*phi4),wPhi1*wPhi2*wPhi3*wPhi4);
10212 // extra correlations:
10213 // 2-p extra correlations (do not appear if particle weights are not used):
10214 // ...
10215 // 3-p extra correlations (do not appear if particle weights are not used):
10216 // ...
10217 // 4-p extra correlations (do not appear if particle weights are not used):
10218 // ...
10219 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10220 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10221 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10222 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10223 } // end of if(nPrim>=4)
57340a27 10224
489d5531 10225 cout<<endl;
57340a27 10226
489d5531 10227} // end of void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent)
57340a27 10228
489d5531 10229
10230//================================================================================================================================
10231
10232
10233void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowExtraCorrelations()
57340a27 10234{
489d5531 10235 // Cross-check results for extra multiparticle correlations needed for int. flow
10236 // which appear only when particle weights are used: results from Q-vectors vs results from nested loops.
57340a27 10237
489d5531 10238 cout<<endl;
10239 cout<<endl;
10240 cout<<" ***********************************************"<<endl;
10241 cout<<" **** cross-checking the extra correlations ****"<<endl;
10242 cout<<" **** for integrated flow ****"<<endl;
10243 cout<<" ***********************************************"<<endl;
10244 cout<<endl;
10245 cout<<endl;
10246
10247 for(Int_t eci=1;eci<=2;eci++) // to be improved (increased eciMax eventually when I calculate 6th and 8th)
57340a27 10248 {
489d5531 10249 if(strcmp((fIntFlowExtraCorrelationsPro->GetXaxis())->GetBinLabel(eci), "") == 0) continue;
10250 cout<<(fIntFlowExtraCorrelationsPro->GetXaxis())->GetBinLabel(eci)<<":"<<endl;
10251 cout<<"from Q-vectors = "<<fIntFlowExtraCorrelationsPro->GetBinContent(eci)<<endl;
10252 cout<<"from nested loops = "<<fIntFlowExtraDirectCorrelations->GetBinContent(eci)<<endl;
10253 cout<<endl;
10254 }
57340a27 10255
489d5531 10256} // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowExtraCorrelations()
57340a27 10257
10258
489d5531 10259//================================================================================================================================
3b552efe 10260
10261
0328db2d 10262void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoops(AliFlowEventSimple * const anEvent)
489d5531 10263{
10264 // Evaluate with nested loops correction terms for non-uniform acceptance relevant for NONAME integrated flow (to be improved (name)).
10265 //
10266 // Remark: Both sin and cos correction terms are calculated in this method. Sin terms are stored in fIntFlowDirectCorrectionTermsForNUA[0],
10267 // and cos terms in fIntFlowDirectCorrectionTermsForNUA[1]. Binning of fIntFlowDirectCorrectionTermsForNUA[sc] is organized as follows
10268 // (sc stands for either sin or cos):
10269
10270 // 1st bin: <<sc(n*(phi1))>>
10271 // 2nd bin: <<sc(n*(phi1+phi2))>>
10272 // 3rd bin: <<sc(n*(phi1-phi2-phi3))>>
10273 // 4th bin: <<sc(n*(2phi1-phi2))>>
10274
10275 Int_t nPrim = anEvent->NumberOfTracks();
10276 AliFlowTrackSimple *aftsTrack = NULL;
10277 Double_t phi1=0., phi2=0., phi3=0.;
10278 Int_t n = fHarmonic;
10279 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
10280 Double_t dMult = (*fSMpk)(0,0);
10281 cout<<endl;
10282 cout<<"Correction terms for non-uniform acceptance: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
10283 if(dMult<1)
3b552efe 10284 {
489d5531 10285 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
10286 } else if (dMult>fMaxAllowedMultiplicity)
3b552efe 10287 {
489d5531 10288 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
10289 } else
10290 {
10291 cout<<"... evaluating nested loops (without using particle weights)..."<<endl;
10292 }
10293
10294 if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)
10295 {
10296 // 1-particle correction terms for non-uniform acceptance:
10297 for(Int_t i1=0;i1<nPrim;i1++)
10298 {
10299 aftsTrack=anEvent->GetTrack(i1);
10300 if(!(aftsTrack->InRPSelection())) continue;
10301 phi1=aftsTrack->Phi();
10302 if(nPrim==1) cout<<i1<<"\r"<<flush;
10303 // sin terms:
10304 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(0.5,sin(n*phi1),1.); // <sin(n*phi1)>
10305 // cos terms:
10306 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(0.5,cos(n*phi1),1.); // <cos(n*phi1)>
10307 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10308 } // end of if(nPrim>=1)
10309
10310 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
10311 {
10312 // 2-particle correction terms for non-uniform acceptance:
10313 for(Int_t i1=0;i1<nPrim;i1++)
10314 {
10315 aftsTrack=anEvent->GetTrack(i1);
10316 if(!(aftsTrack->InRPSelection())) continue;
10317 phi1=aftsTrack->Phi();
10318 for(Int_t i2=0;i2<nPrim;i2++)
3b552efe 10319 {
489d5531 10320 if(i2==i1)continue;
10321 aftsTrack=anEvent->GetTrack(i2);
10322 if(!(aftsTrack->InRPSelection())) continue;
10323 phi2=aftsTrack->Phi();
10324 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
10325 // sin terms:
3b552efe 10326 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(1.5,sin(n*(phi1+phi2)),1.); // <<sin(n*(phi1+phi2))>>
489d5531 10327 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(3.5,sin(n*(2*phi1-phi2)),1.); // <<sin(n*(2*phi1-phi2))>>
10328 // cos terms:
3b552efe 10329 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(1.5,cos(n*(phi1+phi2)),1.); // <<cos(n*(phi1+phi2))>>
489d5531 10330 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(3.5,cos(n*(2*phi1-phi2)),1.); // <<cos(n*(2*phi1-phi2))>>
10331 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10332 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10333 } // end of if(nPrim>=2)
10334
10335 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
10336 {
10337 // 3-particle correction terms for non-uniform acceptance:
10338 for(Int_t i1=0;i1<nPrim;i1++)
10339 {
10340 aftsTrack=anEvent->GetTrack(i1);
10341 if(!(aftsTrack->InRPSelection())) continue;
10342 phi1=aftsTrack->Phi();
10343 for(Int_t i2=0;i2<nPrim;i2++)
10344 {
10345 if(i2==i1)continue;
10346 aftsTrack=anEvent->GetTrack(i2);
10347 if(!(aftsTrack->InRPSelection())) continue;
10348 phi2=aftsTrack->Phi();
10349 for(Int_t i3=0;i3<nPrim;i3++)
10350 {
10351 if(i3==i1||i3==i2)continue;
10352 aftsTrack=anEvent->GetTrack(i3);
10353 if(!(aftsTrack->InRPSelection())) continue;
10354 phi3=aftsTrack->Phi();
10355 if(nPrim>=3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush; // to be improved (eventually I will change this if statement)
10356 // sin terms:
10357 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(2.5,sin(n*(phi1-phi2-phi3)),1.); // <<sin(n*(phi1-phi2-phi3))>>
10358 // cos terms:
10359 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(2.5,cos(n*(phi1-phi2-phi3)),1.); // <<cos(n*(phi1-phi2-phi3))>>
10360 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10361 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10362 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10363 } // end of if(nPrim>=3)
10364
10365 cout<<endl;
10366}
10367//================================================================================================================================
0328db2d 10368void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoops(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
489d5531 10369{
10370 // Evaluate reduced correlations with nested loops without using the particle weights.
10371
10372 // Remark 1: Reduced correlations are evaluated in pt bin number fCrossCheckInPtBinNo and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
10373 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrelations[t][pe][ci], where indices runs as follows:
10374 // [0=RP,1=POI][0=Pt,1=Eta][0=<2'>,1=<4'>,2=<6'>,3=<8'>]
10375 // Remark 3: <2'> = <cos(n*(psi1-phi2))>
10376 // <4'> = <cos(n*(psi1+phi2-phi3-phi4))>
10377 // ...
10378
10379 Int_t typeFlag = -1;
10380 Int_t ptEtaFlag = -1;
10381 if(type == "RP")
10382 {
10383 typeFlag = 0;
10384 } else if(type == "POI")
10385 {
10386 typeFlag = 1;
10387 }
10388 if(ptOrEta == "Pt")
10389 {
10390 ptEtaFlag = 0;
10391 } else if(ptOrEta == "Eta")
10392 {
10393 ptEtaFlag = 1;
10394 }
10395 // shortcuts:
10396 Int_t t = typeFlag;
10397 Int_t pe = ptEtaFlag;
10398
10399 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
10400 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
10401 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
10402
10403 Int_t nPrim = anEvent->NumberOfTracks();
10404 AliFlowTrackSimple *aftsTrack = NULL;
10405
10406 Double_t psi1=0., phi2=0., phi3=0., phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
10407
3b552efe 10408 Int_t n = fHarmonic;
489d5531 10409
10410 // 2'-particle correlations:
10411 for(Int_t i1=0;i1<nPrim;i1++)
10412 {
10413 aftsTrack=anEvent->GetTrack(i1);
3b552efe 10414 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
10415 if(typeFlag==1) // this is diff flow of POIs
489d5531 10416 {
10417 if(ptOrEta == "Pt")
10418 {
10419 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
10420 } else if (ptOrEta == "Eta")
10421 {
10422 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 10423 }
10424 } else // this is diff flow of RPs
10425 {
489d5531 10426 if(ptOrEta == "Pt")
10427 {
10428 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
10429 } else if (ptOrEta == "Eta")
10430 {
10431 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 10432 }
10433 }
489d5531 10434
10435 psi1=aftsTrack->Phi();
10436 for(Int_t i2=0;i2<nPrim;i2++)
10437 {
10438 if(i2==i1)continue;
10439 aftsTrack=anEvent->GetTrack(i2);
10440 // RP condition (!(first) particle in the correlator must be RP):
10441 if(!(aftsTrack->InRPSelection()))continue;
10442 phi2=aftsTrack->Phi();
10443 // 2'-particle correlations:
10444 fDiffFlowDirectCorrelations[t][pe][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(1.*n*(psi1-phi2)),1.); // <cos(n*(psi1-phi2))
10445 }//end of for(Int_t i2=0;i2<nPrim;i2++)
10446 }//end of for(Int_t i1=0;i1<nPrim;i1++)
10447
10448 /*
10449
10450 // 3'-particle correlations:
10451 for(Int_t i1=0;i1<nPrim;i1++)
10452 {
10453 aftsTrack=anEvent->GetTrack(i1);
10454 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
10455 if(ptOrEta == "Pt")
10456 {
10457 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
10458 } else if (ptOrEta == "Eta")
10459 {
10460 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
10461 }
10462 psi1=aftsTrack->Phi();
10463 for(Int_t i2=0;i2<nPrim;i2++)
10464 {
10465 if(i2==i1)continue;
10466 aftsTrack=anEvent->GetTrack(i2);
10467 // RP condition (!(first) particle in the correlator must be RP):
10468 if(!(aftsTrack->InRPSelection())) continue;
10469 phi2=aftsTrack->Phi();
10470 for(Int_t i3=0;i3<nPrim;i3++)
10471 {
10472 if(i3==i1||i3==i2)continue;
10473 aftsTrack=anEvent->GetTrack(i3);
10474 // RP condition (!(first) particle in the correlator must be RP):
10475 if(!(aftsTrack->InRPSelection())) continue;
10476 phi3=aftsTrack->Phi();
10477 // 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))>
10478 }//end of for(Int_t i3=0;i3<nPrim;i3++)
10479 }//end of for(Int_t i2=0;i2<nPrim;i2++)
10480 }//end of for(Int_t i1=0;i1<nPrim;i1++)
10481
10482 */
10483
10484 // 4'-particle correlations:
10485 for(Int_t i1=0;i1<nPrim;i1++)
10486 {
10487 aftsTrack=anEvent->GetTrack(i1);
3b552efe 10488 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
10489 if(typeFlag==1) // this is diff flow of POIs
489d5531 10490 {
10491 if(ptOrEta == "Pt")
10492 {
10493 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
10494 } else if (ptOrEta == "Eta")
10495 {
10496 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 10497 }
10498 } else // this is diff flow of RPs
10499 {
489d5531 10500 if(ptOrEta == "Pt")
10501 {
10502 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
10503 } else if (ptOrEta == "Eta")
10504 {
10505 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 10506 }
10507 }
489d5531 10508
10509 psi1=aftsTrack->Phi();
10510 for(Int_t i2=0;i2<nPrim;i2++)
10511 {
10512 if(i2==i1) continue;
10513 aftsTrack=anEvent->GetTrack(i2);
10514 // RP condition (!(first) particle in the correlator must be RP):
10515 if(!(aftsTrack->InRPSelection())) continue;
10516 phi2=aftsTrack->Phi();
10517 for(Int_t i3=0;i3<nPrim;i3++)
10518 {
10519 if(i3==i1||i3==i2) continue;
10520 aftsTrack=anEvent->GetTrack(i3);
10521 // RP condition (!(first) particle in the correlator must be RP):
10522 if(!(aftsTrack->InRPSelection())) continue;
10523 phi3=aftsTrack->Phi();
10524 for(Int_t i4=0;i4<nPrim;i4++)
10525 {
10526 if(i4==i1||i4==i2||i4==i3) continue;
10527 aftsTrack=anEvent->GetTrack(i4);
10528 // RP condition (!(first) particle in the correlator must be RP):
10529 if(!(aftsTrack->InRPSelection())) continue;
10530 phi4=aftsTrack->Phi();
10531 // 4'-particle correlations:
10532 fDiffFlowDirectCorrelations[t][pe][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3-phi4)),1.); // <cos(n(psi1+phi2-phi3-phi4))>
10533 }//end of for(Int_t i4=0;i4<nPrim;i4++)
10534 }//end of for(Int_t i3=0;i3<nPrim;i3++)
10535 }//end of for(Int_t i2=0;i2<nPrim;i2++)
10536 }//end of for(Int_t i1=0;i1<nPrim;i1++)
10537
10538 // count # of RPs and POIs in selected pt and eta bins for cross-checkings:
3b552efe 10539 for(Int_t i=0;i<nPrim;i++)
10540 {
10541 aftsTrack=anEvent->GetTrack(i);
10542 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
10543 if(typeFlag==1) // this is diff flow of POIs
489d5531 10544 {
10545 if(ptOrEta == "Pt")
10546 {
10547 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
10548 } else if (ptOrEta == "Eta")
10549 {
10550 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 10551 }
10552 } else // this is diff flow of RPs
10553 {
489d5531 10554 if(ptOrEta == "Pt")
10555 {
10556 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
10557 } else if (ptOrEta == "Eta")
10558 {
10559 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 10560 }
10561 }
10562 if(t==1)t++;
10563 fNoOfParticlesInBin->Fill(t+pe+0.5);
489d5531 10564 }
10565
10566} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoops(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
10567
10568
10569//================================================================================================================================
10570
10571
10572void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrelations(TString type, TString ptOrEta)
10573{
10574 // Compare correlations needed for diff. flow calculated with nested loops and those calculated from Q-vectors
10575
10576 Int_t typeFlag = -1;
10577 Int_t ptEtaFlag = -1;
10578 if(type == "RP")
10579 {
10580 typeFlag = 0;
10581 } else if(type == "POI")
10582 {
10583 typeFlag = 1;
10584 }
10585 if(ptOrEta == "Pt")
10586 {
10587 ptEtaFlag = 0;
10588 } else if(ptOrEta == "Eta")
10589 {
10590 ptEtaFlag = 1;
10591 }
10592 // shortcuts:
10593 Int_t t = typeFlag;
10594 Int_t pe = ptEtaFlag;
10595
10596 TString rpORpoiString[2] = {"RP ","POI"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
10597 TString ptORetaString[2] = {"pt","eta"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
10598 TString reducedCorrelations[4] = {"<<cos(n(psi1-phi2))>>","<<cos(n(psi1+phi2-phi3-phi4))>>","",""}; // to be improved (access this from pro or hist)
10599 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
10600 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
10601
10602 Int_t crossCheckInPtEtaBinNo[2] = {fCrossCheckInPtBinNo,fCrossCheckInEtaBinNo};
10603
10604
10605 cout<<endl;
10606 cout<<" *****************************************"<<endl;
10607 cout<<" **** cross-checking the correlations ****"<<endl;
10608 cout<<" **** for differential flow ("<<rpORpoiString[t]<<") ****"<<endl;
10609 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
10610 {
10611 cout<<" **** (particle weights not used) ****"<<endl;
10612 } else
10613 {
10614 cout<<" **** (particle weights used) ****"<<endl;
10615 }
10616 cout<<" *****************************************"<<endl;
10617 cout<<endl;
10618 cout<<" "<<ptORetaString[pe]<<" bin: "<<lowerPtEtaEdge[pe]<<" <= "<<ptORetaString[pe]<<" < "<<upperPtEtaEdge[pe]<<endl;
10619 cout<<endl;
10620
10621 for(Int_t rci=0;rci<2;rci++) // to be improved (calculate 6th and 8th order)
10622 {
10623 cout<<" "<<reducedCorrelations[rci].Data()<<":"<<endl;
10624 cout<<" from Q-vectors = "<<fDiffFlowCorrelationsPro[t][pe][rci]->GetBinContent(crossCheckInPtEtaBinNo[pe])<<endl;
10625 cout<<" from nested loops = "<<fDiffFlowDirectCorrelations[t][pe][rci]->GetBinContent(1)<<endl;
10626 cout<<endl;
10627 } // end of for(Int_t rci=0;rci<4;rci++)
10628
10629} // end of void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrelations(TString type, TString ptOrEta)
10630
3b552efe 10631//================================================================================================================================
10632
489d5531 10633void AliFlowAnalysisWithQCumulants::PrintNumberOfParticlesInSelectedBin()
3b552efe 10634{
10635 // Print on the screen number of RPs and POIs in selected pt and eta bin for cross checkings.
10636
10637 cout<<endl;
10638 cout<<"Number of RPs in selected pt bin = "<<fNoOfParticlesInBin->GetBinContent(1)<<endl;
10639 cout<<"Number of RPs in selected eta bin = "<<fNoOfParticlesInBin->GetBinContent(2)<<endl;
10640 cout<<"Number of POIs in selected pt bin = "<<fNoOfParticlesInBin->GetBinContent(3)<<endl;
10641 cout<<"Number of POIs in selected eta bin = "<<fNoOfParticlesInBin->GetBinContent(4)<<endl;
10642
489d5531 10643} // end of void AliFlowAnalysisWithQCumulants::PrintNumberOfParticlesInSelectedBin()
10644
3b552efe 10645//================================================================================================================================
10646
0328db2d 10647void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
489d5531 10648{
10649 // Evaluate reduced correlations with nested loops without using the particle weights.
10650
10651 // Remark 1: Reduced correlations are evaluated in pt bin number fCrossCheckInPtBinNo and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
10652 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrelations[t][pe][ci], where indices runs as follows:
10653 // [0=RP,1=POI][0=Pt,1=Eta][0=<2'>,1=<4'>,2=<6'>,3=<8'>]
10654 // Remark 3: <2'> = <w2 cos(n*(psi1-phi2))>
10655 // <4'> = <w2 w3 w4 cos(n*(psi1+phi2-phi3-phi4))>
10656 // ...
10657
10658 Int_t typeFlag = -1;
10659 Int_t ptEtaFlag = -1;
10660 if(type == "RP")
10661 {
10662 typeFlag = 0;
10663 } else if(type == "POI")
10664 {
10665 typeFlag = 1;
10666 }
10667 if(ptOrEta == "Pt")
10668 {
10669 ptEtaFlag = 0;
10670 } else if(ptOrEta == "Eta")
10671 {
10672 ptEtaFlag = 1;
10673 }
10674 // shortcuts:
10675 Int_t t = typeFlag;
10676 Int_t pe = ptEtaFlag;
10677
10678 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
10679 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
10680 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
10681
10682 Int_t nPrim = anEvent->NumberOfTracks();
10683 AliFlowTrackSimple *aftsTrack = NULL;
10684
10685 Double_t psi1=0., phi2=0., phi3=0., phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
10686 Double_t wPhi2=1., wPhi3=1., wPhi4=1.;// wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
10687
10688 Int_t n = fHarmonic;
10689
10690 // 2'-particle correlations:
10691 for(Int_t i1=0;i1<nPrim;i1++)
10692 {
10693 aftsTrack=anEvent->GetTrack(i1);
3b552efe 10694 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
10695 if(typeFlag==1) // this is diff flow of POIs
489d5531 10696 {
10697 if(ptOrEta == "Pt")
10698 {
10699 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
10700 } else if (ptOrEta == "Eta")
10701 {
10702 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 10703 }
10704 } else // this is diff flow of RPs
10705 {
489d5531 10706 if(ptOrEta == "Pt")
10707 {
10708 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
10709 } else if (ptOrEta == "Eta")
10710 {
10711 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 10712 }
489d5531 10713 }
10714 psi1=aftsTrack->Phi();
10715 for(Int_t i2=0;i2<nPrim;i2++)
10716 {
10717 if(i2==i1) continue;
10718 aftsTrack=anEvent->GetTrack(i2);
10719 // RP condition (!(first) particle in the correlator must be RP):
10720 if(!(aftsTrack->InRPSelection())) continue;
10721 phi2=aftsTrack->Phi();
10722 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
10723 // 2'-particle correlations:
10724 fDiffFlowDirectCorrelations[t][pe][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(1.*n*(psi1-phi2)),wPhi2); // <w2 cos(n*(psi1-phi2))
10725 }//end of for(Int_t i2=0;i2<nPrim;i2++)
10726 }//end of for(Int_t i1=0;i1<nPrim;i1++)
10727
10728 // 4'-particle correlations:
10729 for(Int_t i1=0;i1<nPrim;i1++)
10730 {
10731 aftsTrack=anEvent->GetTrack(i1);
3b552efe 10732 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
10733 if(typeFlag==1) // this is diff flow of POIs
489d5531 10734 {
10735 if(ptOrEta == "Pt")
10736 {
10737 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
10738 } else if (ptOrEta == "Eta")
10739 {
10740 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 10741 }
10742 } else // this is diff flow of RPs
10743 {
489d5531 10744 if(ptOrEta == "Pt")
10745 {
10746 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
10747 } else if (ptOrEta == "Eta")
10748 {
10749 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 10750 }
489d5531 10751 }
10752 psi1=aftsTrack->Phi();
10753 for(Int_t i2=0;i2<nPrim;i2++)
10754 {
10755 if(i2==i1) continue;
10756 aftsTrack=anEvent->GetTrack(i2);
10757 // RP condition (!(first) particle in the correlator must be RP):
10758 if(!(aftsTrack->InRPSelection())) continue;
10759 phi2=aftsTrack->Phi();
10760 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
10761 for(Int_t i3=0;i3<nPrim;i3++)
10762 {
10763 if(i3==i1||i3==i2) continue;
10764 aftsTrack=anEvent->GetTrack(i3);
10765 // RP condition (!(first) particle in the correlator must be RP):
10766 if(!(aftsTrack->InRPSelection())) continue;
10767 phi3=aftsTrack->Phi();
10768 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
10769 for(Int_t i4=0;i4<nPrim;i4++)
10770 {
10771 if(i4==i1||i4==i2||i4==i3) continue;
10772 aftsTrack=anEvent->GetTrack(i4);
10773 // RP condition (!(first) particle in the correlator must be RP):
10774 if(!(aftsTrack->InRPSelection())) continue;
10775 phi4=aftsTrack->Phi();
10776 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
10777 // 4'-particle correlations <w2 w3 w4 cos(n(psi1+phi2-phi3-phi4))>:
10778 fDiffFlowDirectCorrelations[t][pe][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3-phi4)),wPhi2*wPhi3*wPhi4);
10779 }//end of for(Int_t i4=0;i4<nPrim;i4++)
10780 }//end of for(Int_t i3=0;i3<nPrim;i3++)
10781 }//end of for(Int_t i2=0;i2<nPrim;i2++)
10782 }//end of for(Int_t i1=0;i1<nPrim;i1++)
10783
10784 // count # of RPs and POIs in selected pt and eta bins for cross-checkings: (to be improved - moved to dedicated method)
3b552efe 10785 for(Int_t i=0;i<nPrim;i++)
10786 {
489d5531 10787 aftsTrack=anEvent->GetTrack(i);
10788 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
10789 if(typeFlag==1) // this is diff flow of POIs
10790 {
10791 if(ptOrEta == "Pt")
10792 {
10793 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
10794 } else if (ptOrEta == "Eta")
10795 {
10796 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
10797 }
10798 } else // this is diff flow of RPs
10799 {
10800 if(ptOrEta == "Pt")
10801 {
10802 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
10803 } else if (ptOrEta == "Eta")
10804 {
10805 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
10806 }
10807 }
10808 if(t==1)t++;
10809 fNoOfParticlesInBin->Fill(t+pe+0.5);
10810 }
10811
10812} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
10813
10814
10815//================================================================================================================================
10816
10817
0328db2d 10818void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
489d5531 10819{
10820 // Evaluate with nested loops correction terms for non-uniform acceptance (both sin and cos terms) relevant for differential flow.
10821
10822 // Remark 1: Reduced correction terms for non-uniform acceptance are evaluated in pt bin number fCrossCheckInPtBinNo
10823 // and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
10824 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrections[t][pe][sc][cti], where first three indices runs as:
10825 // [0=RP,1=POI][0=Pt,1=Eta][0=sin terms,1=cos terms], whilst the cti (correction term index) runs as follows:
10826 // cti:
10827 // 0: <<sc n(psi1)>>
10828 // 1: <<sc n(psi1+phi2)>>
10829 // 2: <<sc n(psi1+phi2-phi3)>>
10830 // 3: <<sc n(psi1-phi2-phi3)>>
10831 // 4:
10832 // 5:
10833 // 6:
10834
10835 Int_t typeFlag = -1;
10836 Int_t ptEtaFlag = -1;
10837 if(type == "RP")
10838 {
10839 typeFlag = 0;
10840 } else if(type == "POI")
10841 {
10842 typeFlag = 1;
10843 }
10844 if(ptOrEta == "Pt")
10845 {
10846 ptEtaFlag = 0;
10847 } else if(ptOrEta == "Eta")
10848 {
10849 ptEtaFlag = 1;
10850 }
10851 // shortcuts:
10852 Int_t t = typeFlag;
10853 Int_t pe = ptEtaFlag;
10854
10855 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
10856 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
10857 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
10858
10859 Int_t nPrim = anEvent->NumberOfTracks();
10860 AliFlowTrackSimple *aftsTrack = NULL;
10861
10862 Double_t psi1=0., phi2=0., phi3=0.;// phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
10863
10864 Int_t n = fHarmonic;
10865
10866 // 1-particle correction terms:
10867 for(Int_t i1=0;i1<nPrim;i1++)
10868 {
10869 aftsTrack=anEvent->GetTrack(i1);
3b552efe 10870 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
10871 if(typeFlag==1) // this is diff flow of POIs
489d5531 10872 {
10873 if(ptOrEta == "Pt")
10874 {
10875 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
10876 } else if (ptOrEta == "Eta")
10877 {
10878 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 10879 }
10880 } else // this is diff flow of RPs
10881 {
489d5531 10882 if(ptOrEta == "Pt")
10883 {
10884 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
10885 } else if (ptOrEta == "Eta")
10886 {
10887 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 10888 }
10889 }
489d5531 10890 psi1=aftsTrack->Phi();
10891 // sin terms:
10892 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*psi1),1.); // <<sin(n*(psi1))>>
10893 // cos terms:
10894 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*psi1),1.); // <<cos(n*(psi1))>>
10895 }//end of for(Int_t i1=0;i1<nPrim;i1++)
10896
10897 // 2-particle correction terms:
10898 for(Int_t i1=0;i1<nPrim;i1++)
10899 {
10900 aftsTrack=anEvent->GetTrack(i1);
3b552efe 10901 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
10902 if(typeFlag==1) // this is diff flow of POIs
489d5531 10903 {
10904 if(ptOrEta == "Pt")
10905 {
10906 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
10907 } else if (ptOrEta == "Eta")
10908 {
10909 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 10910 }
10911 } else // this is diff flow of RPs
10912 {
489d5531 10913 if(ptOrEta == "Pt")
10914 {
10915 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
10916 } else if (ptOrEta == "Eta")
10917 {
10918 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 10919 }
489d5531 10920 }
10921 psi1=aftsTrack->Phi();
10922 for(Int_t i2=0;i2<nPrim;i2++)
10923 {
10924 if(i2==i1) continue;
10925 aftsTrack=anEvent->GetTrack(i2);
10926 // RP condition (!(first) particle in the correlator must be RP):
10927 if(!(aftsTrack->InRPSelection())) continue;
10928 phi2=aftsTrack->Phi();
10929 // sin terms:
10930 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2)),1.); // <<sin(n*(psi1+phi2))>>
10931 // cos terms:
10932 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2)),1.); // <<cos(n*(psi1+phi2))>>
10933 }//end of for(Int_t i2=0;i2<nPrim;i2++)
10934 }//end of for(Int_t i1=0;i1<nPrim;i1++)
10935
10936 // 3-particle correction terms:
10937 for(Int_t i1=0;i1<nPrim;i1++)
10938 {
10939 aftsTrack=anEvent->GetTrack(i1);
3b552efe 10940 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
10941 if(typeFlag==1) // this is diff flow of POIs
489d5531 10942 {
10943 if(ptOrEta == "Pt")
10944 {
10945 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
10946 } else if (ptOrEta == "Eta")
10947 {
10948 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 10949 }
10950 } else // this is diff flow of RPs
10951 {
489d5531 10952 if(ptOrEta == "Pt")
10953 {
10954 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
10955 } else if (ptOrEta == "Eta")
10956 {
10957 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 10958 }
489d5531 10959 }
10960 psi1=aftsTrack->Phi();
10961 for(Int_t i2=0;i2<nPrim;i2++)
10962 {
10963 if(i2==i1) continue;
10964 aftsTrack=anEvent->GetTrack(i2);
10965 // RP condition (!(first) particle in the correlator must be RP):
10966 if(!(aftsTrack->InRPSelection())) continue;
10967 phi2=aftsTrack->Phi();
10968 for(Int_t i3=0;i3<nPrim;i3++)
10969 {
10970 if(i3==i1||i3==i2) continue;
10971 aftsTrack=anEvent->GetTrack(i3);
10972 // RP condition (!(first) particle in the correlator must be RP):
10973 if(!(aftsTrack->InRPSelection())) continue;
10974 phi3=aftsTrack->Phi();
10975 // sin terms:
10976 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][2]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2-phi3)),1.); // <<sin(n*(psi1+phi2-phi3))>>
10977 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][3]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1-phi2-phi3)),1.); // <<sin(n*(psi1-phi2-phi3))>>
10978 // cos terms:
10979 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][2]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3)),1.); // <<cos(n*(psi1+phi2-phi3))>>
10980 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][3]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1-phi2-phi3)),1.); // <<cos(n*(psi1-phi2-phi3))>>
10981 }//end of for(Int_t i3=0;i3<nPrim;i3++)
10982 }//end of for(Int_t i2=0;i2<nPrim;i2++)
10983 }//end of for(Int_t i1=0;i1<nPrim;i1++)
10984
10985} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
10986
10987
10988//================================================================================================================================
10989
10990
10991void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrectionTermsForNUA(TString type, TString ptOrEta)
10992{
10993 // Compare corrections temrs for non-uniform acceptance 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 sinCosFlag[2] = {"sin","cos"}; // to be improved (eventually promote to data member)
11018 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)
11019 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)
11020 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
11021 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
11022
11023 Int_t crossCheckInPtEtaBinNo[2] = {fCrossCheckInPtBinNo,fCrossCheckInEtaBinNo};
11024
11025 cout<<endl;
11026 cout<<" ******************************************"<<endl;
11027 cout<<" **** cross-checking the correction ****"<<endl;
46b94261 11028 cout<<" **** terms for non-uniform acceptance ****"<<endl;
489d5531 11029 cout<<" **** for differential flow ("<<rpORpoiString[t]<<") ****"<<endl;
11030 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
11031 {
11032 cout<<" **** (particle weights not used) ****"<<endl;
11033 } else
11034 {
11035 cout<<" **** (particle weights used) ****"<<endl;
11036 }
11037 cout<<" ******************************************"<<endl;
11038 cout<<endl;
11039 cout<<" "<<ptORetaString[pe]<<" bin: "<<lowerPtEtaEdge[pe]<<" <= "<<ptORetaString[pe]<<" < "<<upperPtEtaEdge[pe]<<endl;
11040 cout<<endl;
11041
11042 for(Int_t cti=0;cti<4;cti++) // correction term index
11043 {
11044 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
11045 {
11046 if(sc==0) // to be improved (this can be implemented better)
11047 {
11048 cout<<" "<<reducedCorrectionSinTerms[cti].Data()<<":"<<endl;
11049 } else
11050 {
11051 cout<<" "<<reducedCorrectionCosTerms[cti].Data()<<":"<<endl;
11052 }
11053 cout<<" from Q-vectors = "<<fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]->GetBinContent(crossCheckInPtEtaBinNo[pe])<<endl;
11054 cout<<" from nested loops = "<<fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti]->GetBinContent(1)<<endl;
11055 cout<<endl;
11056 }
11057 } // end of for(Int_t rci=0;rci<4;rci++)
11058
11059} // end of void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrectionTermsForNUA(TString type, TString ptOrEta)
11060
11061
57340a27 11062//================================================================================================================================
11063
489d5531 11064
11065void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights()
11066{
11067 // Calculate corrections using particle weights for non-uniform acceptance of the detector for no-name integrated flow (cos terms).
11068
11069 // **********************************************************************
11070 // **** weighted corrections for non-uniform acceptance (cos terms): ****
11071 // **********************************************************************
57340a27 11072
489d5531 11073 // Remark 1: When particle weights are used the binning of fIntFlowCorrectionTermsForNUAPro[1] is organized as follows:
57340a27 11074 //
489d5531 11075 // 1st bin: <<w1 cos(n*(phi1))>> = cosP1nW1
11076 // 2nd bin: <<w1 w2 cos(n*(phi1+phi2))>> = cosP1nP1nW1W1
11077 // 3rd bin: <<w1 w2 w3 cos(n*(phi1-phi2-phi3))>> = cosP1nM1nM1nW1W1W1
11078 // ...
11079
11080 // multiplicity (number of particles used to determine the reaction plane)
11081 Double_t dMult = (*fSMpk)(0,0);
11082
11083 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
11084 Double_t dReQ1n1k = (*fReQ)(0,1);
11085 Double_t dReQ2n2k = (*fReQ)(1,2);
11086 //Double_t dReQ3n3k = (*fReQ)(2,3);
11087 //Double_t dReQ4n4k = (*fReQ)(3,4);
11088 Double_t dReQ1n3k = (*fReQ)(0,3);
11089 Double_t dImQ1n1k = (*fImQ)(0,1);
11090 Double_t dImQ2n2k = (*fImQ)(1,2);
11091 //Double_t dImQ3n3k = (*fImQ)(2,3);
11092 //Double_t dImQ4n4k = (*fImQ)(3,4);
11093 //Double_t dImQ1n3k = (*fImQ)(0,3);
11094
11095 // dMs are variables introduced in order to simplify some Eqs. bellow:
11096 //..............................................................................................
11097 Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
57340a27 11098 Double_t dM111 = (*fSMpk)(2,1)-3.*(*fSMpk)(0,2)*(*fSMpk)(0,1)
489d5531 11099 + 2.*(*fSMpk)(0,3); // dM111 = sum_{i,j,k=1,i!=j!=k}^M w_i w_j w_k
11100 //..............................................................................................
ecac11c2 11101 // 1-particle:
489d5531 11102 Double_t cosP1nW1 = 0.; // <<w1 cos(n*(phi1))>>
11103
0328db2d 11104 if(dMult>0 && TMath::Abs((*fSMpk)(0,1))>1e-6)
489d5531 11105 {
11106 cosP1nW1 = dReQ1n1k/(*fSMpk)(0,1);
11107
11108 // average weighted 1-particle correction (cos terms) for non-uniform acceptance for single event:
11109 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(1,cosP1nW1);
11110
11111 // final average weighted 1-particle correction (cos terms) for non-uniform acceptance for all events:
11112 fIntFlowCorrectionTermsForNUAPro[1]->Fill(0.5,cosP1nW1,(*fSMpk)(0,1));
11113 }
11114
11115 // 2-particle:
11116 Double_t cosP1nP1nW1W1 = 0.; // <<w1 w2 cos(n*(phi1+phi2))>>
11117
0328db2d 11118 if(dMult>1 && TMath::Abs(dM11)>1e-6)
489d5531 11119 {
11120 cosP1nP1nW1W1 = (pow(dReQ1n1k,2)-pow(dImQ1n1k,2)-dReQ2n2k)/dM11;
11121
11122 // average weighted 2-particle correction (cos terms) for non-uniform acceptance for single event:
11123 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(2,cosP1nP1nW1W1);
11124
11125 // final average weighted 2-particle correction (cos terms) for non-uniform acceptance for all events:
11126 fIntFlowCorrectionTermsForNUAPro[1]->Fill(1.5,cosP1nP1nW1W1,dM11);
11127 }
11128
11129 // 3-particle:
11130 Double_t cosP1nM1nM1nW1W1W1 = 0.; // <<w1 w2 w3 cos(n*(phi1-phi2-phi3))>>
11131
0328db2d 11132 if(dMult>2 && TMath::Abs(dM111)>1e-6)
489d5531 11133 {
57340a27 11134 cosP1nM1nM1nW1W1W1 = (dReQ1n1k*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
11135 - dReQ1n1k*dReQ2n2k-dImQ1n1k*dImQ2n2k
11136 - 2.*((*fSMpk)(0,2))*dReQ1n1k
489d5531 11137 + 2.*dReQ1n3k)
11138 / dM111;
11139
11140 // average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for single event:
11141 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(3,cosP1nM1nM1nW1W1W1);
11142
11143 // final average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for all events:
11144 fIntFlowCorrectionTermsForNUAPro[1]->Fill(2.5,cosP1nM1nM1nW1W1W1,dM111);
11145 }
11146
11147} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights()
11148
11149
11150//================================================================================================================================
11151
11152
11153void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights()
11154{
11155 // calculate corrections using particle weights for non-uniform acceptance of the detector for no-name integrated flow (sin terms)
11156
11157 // **********************************************************************
11158 // **** weighted corrections for non-uniform acceptance (sin terms): ****
11159 // **********************************************************************
11160
11161 // Remark 1: When particle weights are used the binning of fIntFlowCorrectionTermsForNUAPro[0] is organized as follows:
57340a27 11162 //
489d5531 11163 // 1st bin: <<w1 sin(n*(phi1))>> = sinP1nW1
11164 // 2nd bin: <<w1 w2 sin(n*(phi1+phi2))>> = sinP1nP1nW1W1
11165 // 3rd bin: <<w1 w2 w3 sin(n*(phi1-phi2-phi3))>> = sinP1nM1nM1nW1W1W1
11166 // ...
11167
11168 // multiplicity (number of particles used to determine the reaction plane)
11169 Double_t dMult = (*fSMpk)(0,0);
11170
11171 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
11172 Double_t dReQ1n1k = (*fReQ)(0,1);
11173 Double_t dReQ2n2k = (*fReQ)(1,2);
11174 //Double_t dReQ3n3k = (*fReQ)(2,3);
11175 //Double_t dReQ4n4k = (*fReQ)(3,4);
11176 //Double_t dReQ1n3k = (*fReQ)(0,3);
11177 Double_t dImQ1n1k = (*fImQ)(0,1);
11178 Double_t dImQ2n2k = (*fImQ)(1,2);
11179 //Double_t dImQ3n3k = (*fImQ)(2,3);
11180 //Double_t dImQ4n4k = (*fImQ)(3,4);
11181 Double_t dImQ1n3k = (*fImQ)(0,3);
11182
11183 // dMs are variables introduced in order to simplify some Eqs. bellow:
11184 //..............................................................................................
11185 Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
57340a27 11186 Double_t dM111 = (*fSMpk)(2,1)-3.*(*fSMpk)(0,2)*(*fSMpk)(0,1)
489d5531 11187 + 2.*(*fSMpk)(0,3); // dM111 = sum_{i,j,k=1,i!=j!=k}^M w_i w_j w_k
11188 //..............................................................................................
11189
11190 // 1-particle:
11191 Double_t sinP1nW1 = 0.; // <<w1 sin(n*(phi1))>>
11192
0328db2d 11193 if(dMult>0 && TMath::Abs((*fSMpk)(0,1))>1e-6)
489d5531 11194 {
11195 sinP1nW1 = dImQ1n1k/((*fSMpk)(0,1));
11196
11197 // average weighted 1-particle correction (sin terms) for non-uniform acceptance for single event:
11198 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(1,sinP1nW1);
11199
11200 // final average weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
11201 fIntFlowCorrectionTermsForNUAPro[0]->Fill(0.5,sinP1nW1,(*fSMpk)(0,1));
11202 }
11203
11204 // 2-particle:
11205 Double_t sinP1nP1nW1W1 = 0.; // <<w1 w2 sin(n*(phi1+phi2))>>
11206
0328db2d 11207 if(dMult>1 && TMath::Abs(dM11)>1e-6)
489d5531 11208 {
11209 sinP1nP1nW1W1 = (2.*dReQ1n1k*dImQ1n1k-dImQ2n2k)/dM11;
11210
11211 // average weighted 2-particle correction (sin terms) for non-uniform acceptance for single event:
11212 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(2,sinP1nP1nW1W1);
11213
11214 // final average weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
11215 fIntFlowCorrectionTermsForNUAPro[0]->Fill(1.5,sinP1nP1nW1W1,dM11);
11216 }
11217
11218 // 3-particle:
11219 Double_t sinP1nM1nM1nW1W1W1 = 0.; // <<w1 w2 w3 sin(n*(phi1-phi2-phi3))>>
11220
0328db2d 11221 if(dMult>2 && TMath::Abs(dM111)>1e-6)
489d5531 11222 {
57340a27 11223 sinP1nM1nM1nW1W1W1 = (-dImQ1n1k*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
11224 + dReQ1n1k*dImQ2n2k-dImQ1n1k*dReQ2n2k
11225 + 2.*((*fSMpk)(0,2))*dImQ1n1k
489d5531 11226 - 2.*dImQ1n3k)
11227 / dM111;
11228
11229 // average weighted 3-particle correction (sin terms) for non-uniform acceptance for single event:
11230 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(3,sinP1nM1nM1nW1W1W1);
11231
11232 // final average weighted 3-particle correction (sin terms) for non-uniform acceptance for all events:
11233 fIntFlowCorrectionTermsForNUAPro[0]->Fill(2.5,sinP1nM1nM1nW1W1W1,dM111);
11234 }
11235
11236} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights()
11237
11238
57340a27 11239//================================================================================================================================
489d5531 11240
11241
0328db2d 11242void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent)
489d5531 11243{
11244 // Evaluate with nested loops correction terms for non-uniform acceptance for integrated flow (using the particle weights).
11245
57340a27 11246 // Results are stored in profiles fIntFlowDirectCorrectionTermsForNUA[0] (sin terms) and
11247 // fIntFlowDirectCorrectionTermsForNUA[1] (cos terms).
489d5531 11248
57340a27 11249 // Remark 1: When particle weights are used the binning of fIntFlowDirectCorrectionTermsForNUA[sc] is
489d5531 11250 // organized as follows (sc stands for either sin or cos):
11251 //
11252 // 1st bin: <<w1 sc(n*(phi1))>> = scP1nW1
11253 // 2nd bin: <<w1 w2 sc(n*(phi1+phi2))>> = scP1nP1nW1W1
11254 // 3rd bin: <<w1 w2 w3 sc(n*(phi1-phi2-phi3))>> = scP1nM1nM1nW1W1W1
3b552efe 11255 // ...
489d5531 11256
11257 Int_t nPrim = anEvent->NumberOfTracks();
11258 AliFlowTrackSimple *aftsTrack = NULL;
11259 //Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
11260 //Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1., wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
11261 Double_t phi1=0., phi2=0., phi3=0.;
11262 Double_t wPhi1=1., wPhi2=1., wPhi3=1.;
11263 Int_t n = fHarmonic;
11264 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
11265 Double_t dMult = (*fSMpk)(0,0);
11266 cout<<endl;
11267 cout<<"Correction terms for non-uniform acceptance: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
11268 if(dMult<1)
11269 {
11270 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
11271 } else if (dMult>fMaxAllowedMultiplicity)
11272 {
11273 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
11274 } else
11275 {
11276 cout<<"... evaluating nested loops (using particle weights) ..."<<endl;
11277 }
11278
11279 // 1-particle correction terms using particle weights:
11280 if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)
11281 {
11282 for(Int_t i1=0;i1<nPrim;i1++)
11283 {
11284 aftsTrack=anEvent->GetTrack(i1);
11285 if(!(aftsTrack->InRPSelection())) continue;
11286 phi1=aftsTrack->Phi();
11287 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
57340a27 11288 // 1-particle correction terms using particle weights:
489d5531 11289 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(0.5,sin(n*phi1),wPhi1); // <w1 sin(n*phi1)>
11290 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(0.5,cos(n*phi1),wPhi1); // <w1 cos(n*phi1)>
57340a27 11291 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11292 } // end of if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)
11293
489d5531 11294 // 2-particle correction terms using particle weights:
11295 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
11296 {
11297 for(Int_t i1=0;i1<nPrim;i1++)
11298 {
11299 aftsTrack=anEvent->GetTrack(i1);
11300 if(!(aftsTrack->InRPSelection())) continue;
11301 phi1=aftsTrack->Phi();
11302 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
11303 for(Int_t i2=0;i2<nPrim;i2++)
11304 {
11305 if(i2==i1)continue;
11306 aftsTrack=anEvent->GetTrack(i2);
11307 if(!(aftsTrack->InRPSelection())) continue;
11308 phi2=aftsTrack->Phi();
11309 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
11310 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
57340a27 11311 // 2-p correction terms using particle weights:
489d5531 11312 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(1.5,sin(n*(phi1+phi2)),wPhi1*wPhi2); // <w1 w2 sin(n*(phi1+phi2))>
11313 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(1.5,cos(n*(phi1+phi2)),wPhi1*wPhi2); // <w1 w2 cos(n*(phi1+phi2))>
11314 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11315 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11316 } // end of if(nPrim>=2)
11317
11318 // 3-particle correction terms using particle weights:
11319 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
11320 {
11321 for(Int_t i1=0;i1<nPrim;i1++)
11322 {
11323 aftsTrack=anEvent->GetTrack(i1);
11324 if(!(aftsTrack->InRPSelection())) continue;
11325 phi1=aftsTrack->Phi();
11326 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
11327 for(Int_t i2=0;i2<nPrim;i2++)
11328 {
11329 if(i2==i1)continue;
11330 aftsTrack=anEvent->GetTrack(i2);
11331 if(!(aftsTrack->InRPSelection())) continue;
11332 phi2=aftsTrack->Phi();
11333 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
11334 for(Int_t i3=0;i3<nPrim;i3++)
11335 {
11336 if(i3==i1||i3==i2)continue;
11337 aftsTrack=anEvent->GetTrack(i3);
11338 if(!(aftsTrack->InRPSelection())) continue;
11339 phi3=aftsTrack->Phi();
11340 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
11341 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;
57340a27 11342 // 3-p correction terms using particle weights:
489d5531 11343 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(2.5,sin(n*(phi1-phi2-phi3)),wPhi1*wPhi2*wPhi3); // <w1 w2 w3 sin(n*(phi1-phi2-phi3))>
11344 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(2.5,cos(n*(phi1-phi2-phi3)),wPhi1*wPhi2*wPhi3); // <w1 w2 w3 cos(n*(phi1-phi2-phi3))>
11345 } // end of for(Int_t i3=0;i3<nPrim;i3++)
11346 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11347 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11348 } // end of if(nPrim>=3)
11349
57340a27 11350 /*
11351
489d5531 11352 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)
11353 {
11354 // 4 nested loops multiparticle correlations using particle weights:
11355 for(Int_t i1=0;i1<nPrim;i1++)
11356 {
11357 aftsTrack=anEvent->GetTrack(i1);
11358 if(!(aftsTrack->InRPSelection())) continue;
11359 phi1=aftsTrack->Phi();
11360 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
11361 for(Int_t i2=0;i2<nPrim;i2++)
11362 {
11363 if(i2==i1)continue;
11364 aftsTrack=anEvent->GetTrack(i2);
11365 if(!(aftsTrack->InRPSelection())) continue;
11366 phi2=aftsTrack->Phi();
11367 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
11368 for(Int_t i3=0;i3<nPrim;i3++)
11369 {
11370 if(i3==i1||i3==i2)continue;
11371 aftsTrack=anEvent->GetTrack(i3);
11372 if(!(aftsTrack->InRPSelection())) continue;
11373 phi3=aftsTrack->Phi();
11374 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
11375 for(Int_t i4=0;i4<nPrim;i4++)
11376 {
11377 if(i4==i1||i4==i2||i4==i3)continue;
11378 aftsTrack=anEvent->GetTrack(i4);
11379 if(!(aftsTrack->InRPSelection())) continue;
11380 phi4=aftsTrack->Phi();
11381 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
11382 if(nPrim>=4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush; // to be improved (replace eventually this if statement with if(nPrim==4))
11383 // 4-p correlations using particle weights:
11384 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(10.5,cos(n*phi1+n*phi2-n*phi3-n*phi4),wPhi1*wPhi2*wPhi3*wPhi4);
11385 // extra correlations:
11386 // 2-p extra correlations (do not appear if particle weights are not used):
11387 // ...
11388 // 3-p extra correlations (do not appear if particle weights are not used):
11389 // ...
11390 // 4-p extra correlations (do not appear if particle weights are not used):
11391 // ...
11392 } // end of for(Int_t i4=0;i4<nPrim;i4++)
11393 } // end of for(Int_t i3=0;i3<nPrim;i3++)
11394 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11395 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11396 } // end of if(nPrim>=4)
11397
11398 */
11399
11400 cout<<endl;
11401
11402} // end of void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent)
11403
11404
57340a27 11405//================================================================================================================================
489d5531 11406
11407
11408void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights(TString type, TString ptOrEta)
11409{
11410 // Calculate correction terms for non-uniform acceptance for differential flow (cos terms) using particle weights.
57340a27 11411
489d5531 11412 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][1][cti], where cti runs as follows:
57340a27 11413 //
489d5531 11414 // 0: <<cos n(psi)>>
11415 // 1: <<w2 cos n(psi1+phi2)>>
11416 // 2: <<w2 w3 cos n(psi1+phi2-phi3)>>
11417 // 3: <<w2 w3 cos n(psi1-phi2-phi3)>>
11418 // 4:
11419 // 5:
11420 // 6:
11421
11422 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
11423 Double_t dReQ1n1k = (*fReQ)(0,1);
11424 Double_t dReQ2n2k = (*fReQ)(1,2);
11425 //Double_t dReQ1n3k = (*fReQ)(0,3);
11426 //Double_t dReQ4n4k = (*fReQ)(3,4);
11427 Double_t dImQ1n1k = (*fImQ)(0,1);
11428 Double_t dImQ2n2k = (*fImQ)(1,2);
11429 //Double_t dImQ1n3k = (*fImQ)(0,3);
11430 //Double_t dImQ4n4k = (*fImQ)(3,4);
11431
11432 // S^M_{p,k} (see .h file for the definition of fSMpk):
11433 Double_t dSM1p1k = (*fSMpk)(0,1);
11434 Double_t dSM1p2k = (*fSMpk)(0,2);
11435 Double_t dSM2p1k = (*fSMpk)(1,1);
11436
11437 Int_t t = -1; // type flag
11438 Int_t pe = -1; // ptEta flag
11439
11440 if(type == "RP")
11441 {
11442 t = 0;
11443 } else if(type == "POI")
11444 {
11445 t = 1;
11446 }
11447
11448 if(ptOrEta == "Pt")
11449 {
11450 pe = 0;
11451 } else if(ptOrEta == "Eta")
11452 {
11453 pe = 1;
11454 }
11455
11456 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
11457 Double_t minPtEta[2] = {fPtMin,fEtaMin};
11458 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
11459 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
11460
11461 // looping over all bins and calculating correction terms:
11462 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
11463 {
11464 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
11465 Double_t p1n0kRe = 0.;
11466 Double_t p1n0kIm = 0.;
11467
11468 // number of POIs in particular pt or eta bin:
11469 Double_t mp = 0.;
11470
11471 // 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):
11472 Double_t q1n2kRe = 0.;
11473 Double_t q1n2kIm = 0.;
11474 Double_t q2n1kRe = 0.;
11475 Double_t q2n1kIm = 0.;
46b94261 11476
489d5531 11477 // s_{1,1}, s_{1,2} // to be improved (add explanation)
11478 Double_t s1p1k = 0.;
11479 Double_t s1p2k = 0.;
46b94261 11480
489d5531 11481 // number of particles which are both RPs and POIs in particular pt or eta bin:
46b94261 11482 Double_t mq = 0.;
489d5531 11483
11484 // M0111 from Eq. (118) in QC2c (to be improved (notation))
11485 Double_t dM01 = 0.;
11486 Double_t dM011 = 0.;
11487
11488 if(type == "POI")
11489 {
11490 // q_{m*n,k}:
11491 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))
11492 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));
11493 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))
11494 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b));
11495 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))
11496 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));
11497 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))
11498 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b));
11499 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 11500
489d5531 11501 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.);
11502 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.);
11503 }else if(type == "RP")
11504 {
11505 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
11506 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))
11507 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));
11508 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))
11509 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));
11510 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))
11511 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));
11512 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))
11513 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));
11514 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
11515 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.);
11516 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.);
3b552efe 11517 //s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.);
11518
489d5531 11519 mq = fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
11520 }
3b552efe 11521
489d5531 11522 if(type == "POI")
3b552efe 11523 {
11524 // p_{m*n,k}:
489d5531 11525 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
11526 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
11527 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
3b552efe 11528 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
11529 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 11530 // M01 from Eq. (118) in QC2c (to be improved (notation)):
3b552efe 11531 dM01 = mp*dSM1p1k-s1p1k;
11532 dM011 = mp*(dSM2p1k-dSM1p2k)
11533 - 2.*(s1p1k*dSM1p1k-s1p2k);
11534
11535 // typeFlag = RP (0) or POI (1):
11536 t = 1;
11537 } else if(type == "RP")
489d5531 11538 {
11539 // to be improved (cross-checked):
11540 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
11541 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
11542 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
11543 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
11544 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
11545 // M01 from Eq. (118) in QC2c (to be improved (notation)):
3b552efe 11546 dM01 = mp*dSM1p1k-s1p1k;
11547 dM011 = mp*(dSM2p1k-dSM1p2k)
11548 - 2.*(s1p1k*dSM1p1k-s1p2k);
489d5531 11549 // typeFlag = RP (0) or POI (1):
3b552efe 11550 t = 0;
11551 }
489d5531 11552
11553 // <<cos n(psi1)>>:
11554 Double_t cosP1nPsi = 0.;
11555 if(mp)
11556 {
11557 cosP1nPsi = p1n0kRe/mp;
11558
11559 // fill profile for <<cos n(psi1)>>:
11560 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi,mp);
11561 // histogram to store <cos n(psi1)> e-b-e (needed in some other methods):
11562 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][0]->SetBinContent(b,cosP1nPsi);
46b94261 11563 } // end of if(mp)
57340a27 11564
489d5531 11565 // <<w2 cos n(psi1+phi2)>>:
11566 Double_t cosP1nPsiP1nPhiW2 = 0.;
11567 if(dM01)
11568 {
11569 cosP1nPsiP1nPhiW2 = (p1n0kRe*dReQ1n1k-p1n0kIm*dImQ1n1k-q2n1kRe)/(dM01);
11570 // fill profile for <<w2 cos n(psi1+phi2)>>:
11571 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsiP1nPhiW2,dM01);
11572 // histogram to store <w2 cos n(psi1+phi2)> e-b-e (needed in some other methods):
11573 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][1]->SetBinContent(b,cosP1nPsiP1nPhiW2);
11574 } // end of if(dM01)
11575
11576 // <<w2 w3 cos n(psi1+phi2-phi3)>>:
11577 Double_t cosP1nPsi1P1nPhi2MPhi3W2W3 = 0.;
11578 if(dM011)
11579 {
46b94261 11580 cosP1nPsi1P1nPhi2MPhi3W2W3 = (p1n0kRe*(pow(dImQ1n1k,2.)+pow(dReQ1n1k,2.))
11581 - p1n0kRe*dSM1p2k
11582 - q2n1kRe*dReQ1n1k-q2n1kIm*dImQ1n1k
11583 - s1p1k*dReQ1n1k
11584 + 2.*q1n2kRe)
11585 / dM011;
489d5531 11586 // fill profile for <<w1 w2 w3 cos n(psi1+phi2)>>:
11587 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1P1nPhi2MPhi3W2W3,dM011);
11588 // histogram to store <w1 w2 w3 cos n(psi1+phi2)> e-b-e (needed in some other methods):
11589 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][2]->SetBinContent(b,cosP1nPsi1P1nPhi2MPhi3W2W3);
11590 } // end of if(dM011)
11591
11592 // <<w2 w3 cos n(psi1-phi2-phi3)>>:
11593 Double_t cosP1nPsi1M1nPhi2MPhi3W2W3 = 0.;
11594 if(dM011)
11595 {
11596 cosP1nPsi1M1nPhi2MPhi3W2W3 = (p1n0kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))+2.*p1n0kIm*dReQ1n1k*dImQ1n1k
11597 - 1.*(p1n0kRe*dReQ2n2k+p1n0kIm*dImQ2n2k)
46b94261 11598 - 2.*s1p1k*dReQ1n1k
489d5531 11599 + 2.*q1n2kRe)
11600 / dM011;
11601 // fill profile for <<w1 w2 w3 cos n(psi1+phi2)>>:
11602 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1M1nPhi2MPhi3W2W3,dM011);
11603 // histogram to store <w1 w2 w3 cos n(psi1+phi2)> e-b-e (needed in some other methods):
11604 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][3]->SetBinContent(b,cosP1nPsi1M1nPhi2MPhi3W2W3);
11605 } // end of if(dM011)
11606
11607 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
46b94261 11608
57340a27 11609} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights(TString type, TString ptOrEta)
11610
489d5531 11611
11612//================================================================================================================================
11613
11614
11615void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights(TString type, TString ptOrEta)
11616{
11617 // Calculate correction terms for non-uniform acceptance for differential flow (sin terms).
11618
11619 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][0][cti], where cti runs as follows:
11620 // 0: <<sin n(psi1)>>
11621 // 1: <<w2 sin n(psi1+phi2)>>
11622 // 2: <<w2 w3 sin n(psi1+phi2-phi3)>>
11623 // 3: <<w2 w3 sin n(psi1-phi2-phi3)>>:
11624 // 4:
11625 // 5:
11626 // 6:
11627
11628 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
11629 Double_t dReQ1n1k = (*fReQ)(0,1);
11630 Double_t dReQ2n2k = (*fReQ)(1,2);
11631 //Double_t dReQ1n3k = (*fReQ)(0,3);
11632 //Double_t dReQ4n4k = (*fReQ)(3,4);
11633 Double_t dImQ1n1k = (*fImQ)(0,1);
11634 Double_t dImQ2n2k = (*fImQ)(1,2);
11635 //Double_t dImQ1n3k = (*fImQ)(0,3);
11636 //Double_t dImQ4n4k = (*fImQ)(3,4);
11637
11638 // S^M_{p,k} (see .h file for the definition of fSMpk):
11639 Double_t dSM1p1k = (*fSMpk)(0,1);
11640 Double_t dSM1p2k = (*fSMpk)(0,2);
11641 Double_t dSM2p1k = (*fSMpk)(1,1);
11642
11643 Int_t t = -1; // type flag
11644 Int_t pe = -1; // ptEta flag
11645
11646 if(type == "RP")
11647 {
11648 t = 0;
11649 } else if(type == "POI")
11650 {
11651 t = 1;
11652 }
11653
11654 if(ptOrEta == "Pt")
11655 {
11656 pe = 0;
11657 } else if(ptOrEta == "Eta")
11658 {
11659 pe = 1;
11660 }
11661
11662 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
11663 Double_t minPtEta[2] = {fPtMin,fEtaMin};
11664 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
11665 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
11666
11667 // looping over all bins and calculating correction terms:
11668 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
11669 {
11670 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
11671 Double_t p1n0kRe = 0.;
11672 Double_t p1n0kIm = 0.;
11673
11674 // number of POIs in particular pt or eta bin:
11675 Double_t mp = 0.;
11676
11677 // 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):
11678 Double_t q1n2kRe = 0.;
11679 Double_t q1n2kIm = 0.;
11680 Double_t q2n1kRe = 0.;
11681 Double_t q2n1kIm = 0.;
46b94261 11682
489d5531 11683 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
11684 Double_t s1p1k = 0.;
11685 Double_t s1p2k = 0.;
46b94261 11686
489d5531 11687 // number of particles which are both RPs and POIs in particular pt or eta bin:
46b94261 11688 Double_t mq = 0.;
489d5531 11689
11690 // M0111 from Eq. (118) in QC2c (to be improved (notation))
11691 Double_t dM01 = 0.;
11692 Double_t dM011 = 0.;
11693
11694 if(type == "POI")
11695 {
11696 // q_{m*n,k}:
11697 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))
11698 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));
11699 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))
11700 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b));
11701 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))
11702 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));
11703 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))
11704 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b));
11705 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 11706
489d5531 11707 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.);
11708 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.);
11709 }else if(type == "RP")
11710 {
11711 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
11712 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))
11713 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));
11714 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))
11715 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));
11716 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))
11717 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));
11718 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))
11719 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));
11720 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
11721 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.);
11722 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.);
11723 //s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.);
3b552efe 11724 }
11725
11726 if(type == "POI")
11727 {
11728 // p_{m*n,k}:
489d5531 11729 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
11730 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
11731 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
3b552efe 11732 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
11733 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 11734 // M01 from Eq. (118) in QC2c (to be improved (notation)):
3b552efe 11735 dM01 = mp*dSM1p1k-s1p1k;
11736 dM011 = mp*(dSM2p1k-dSM1p2k)
11737 - 2.*(s1p1k*dSM1p1k-s1p2k);
11738 // typeFlag = RP (0) or POI (1):
11739 t = 1;
489d5531 11740 } else if(type == "RP")
3b552efe 11741 {
489d5531 11742 // to be improved (cross-checked):
11743 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
11744 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
11745 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
11746 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
11747 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
11748 // M01 from Eq. (118) in QC2c (to be improved (notation)):
3b552efe 11749 dM01 = mp*dSM1p1k-s1p1k;
11750 dM011 = mp*(dSM2p1k-dSM1p2k)
489d5531 11751 - 2.*(s1p1k*dSM1p1k-s1p2k);
11752 // typeFlag = RP (0) or POI (1):
3b552efe 11753 t = 0;
11754 }
11755
489d5531 11756 // <<sin n(psi1)>>:
11757 Double_t sinP1nPsi = 0.;
11758 if(mp)
11759 {
11760 sinP1nPsi = p1n0kIm/mp;
11761
11762 // fill profile for <<sin n(psi1)>>:
11763 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi,mp);
11764 // histogram to store <sin n(psi1)> e-b-e (needed in some other methods):
11765 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][0]->SetBinContent(b,sinP1nPsi);
46b94261 11766 } // end of if(mp)
11767
489d5531 11768 // <<w2 sin n(psi1+phi2)>>:
11769 Double_t sinP1nPsiP1nPhiW2 = 0.;
11770 if(dM01)
11771 {
11772 sinP1nPsiP1nPhiW2 = (p1n0kRe*dImQ1n1k+p1n0kIm*dReQ1n1k-q2n1kIm)/(dM01);
11773 // fill profile for <<w2 sin n(psi1+phi2)>>:
11774 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsiP1nPhiW2,dM01);
11775 // histogram to store <w2 sin n(psi1+phi2)> e-b-e (needed in some other methods):
11776 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][1]->SetBinContent(b,sinP1nPsiP1nPhiW2);
11777 } // end of if(mp*dMult-mq)
11778
11779 // <<w2 w3 sin n(psi1+phi2-phi3)>>:
11780 Double_t sinP1nPsi1P1nPhi2MPhi3W2W3 = 0.;
11781 if(dM011)
11782 {
46b94261 11783 sinP1nPsi1P1nPhi2MPhi3W2W3 = (p1n0kIm*(pow(dImQ1n1k,2.)+pow(dReQ1n1k,2.))
11784 - p1n0kIm*dSM1p2k
11785 + q2n1kRe*dImQ1n1k-q2n1kIm*dReQ1n1k
11786 - s1p1k*dImQ1n1k
11787 + 2.*q1n2kIm)
11788 / dM011;
489d5531 11789 // fill profile for <<w2 w3 sin n(psi1+phi2-phi3)>>:
11790 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1P1nPhi2MPhi3W2W3,dM011);
11791 // histogram to store <w2 w3 sin n(psi1+phi2-phi3)> e-b-e (needed in some other methods):
11792 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][2]->SetBinContent(b,sinP1nPsi1P1nPhi2MPhi3W2W3);
11793 } // end of if(dM011)
11794
11795 // <<w2 w3 sin n(psi1-phi2-phi3)>>:
11796 Double_t sinP1nPsi1M1nPhi2MPhi3W2W3 = 0.;
11797 if(dM011)
11798 {
11799 sinP1nPsi1M1nPhi2MPhi3W2W3 = (p1n0kIm*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))-2.*p1n0kRe*dReQ1n1k*dImQ1n1k
11800 + 1.*(p1n0kRe*dImQ2n2k-p1n0kIm*dReQ2n2k)
46b94261 11801 + 2.*s1p1k*dImQ1n1k
489d5531 11802 - 2.*q1n2kIm)
11803 / dM011;
11804 // fill profile for <<w2 w3 sin n(psi1-phi2-phi3)>>:
11805 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1M1nPhi2MPhi3W2W3,dM011);
11806 // histogram to store <w2 w3 sin n(psi1-phi2-phi3)> e-b-e (needed in some other methods):
11807 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][3]->SetBinContent(b,sinP1nPsi1M1nPhi2MPhi3W2W3);
11808 } // end of if(dM011)
11809
11810 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
11811
11812} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights(TString type, TString ptOrEta)
11813
11814
11815//================================================================================================================================
11816
11817
0328db2d 11818void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
489d5531 11819{
57340a27 11820 // Evaluate with nested loops correction terms for non-uniform acceptance
489d5531 11821 // with using particle weights (both sin and cos terms) relevant for differential flow.
11822
57340a27 11823 // Remark 1: "w1" in expressions bellow is a particle weight used only for particles which were
11824 // flagged both as POI and RP.
489d5531 11825 // Remark 2: Reduced correction terms for non-uniform acceptance are evaluated in pt bin number fCrossCheckInPtBinNo
11826 // and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
11827 // Remark 3: Results are stored in 1 bin profiles fDiffFlowDirectCorrections[t][pe][sc][cti], where first three indices runs as:
11828 // [0=RP,1=POI][0=Pt,1=Eta][0=sin terms,1=cos terms], whilst the cti (correction term index) runs as follows:
11829 // cti:
11830 // 0: <<sc n(psi1)>>
11831 // 1: <<w2 sc n(psi1+phi2)>>
11832 // 2: <<w2 w3 sc n(psi1+phi2-phi3)>>
11833 // 3: <<w2 w3 sc n(psi1-phi2-phi3)>>
11834 // 4:
11835 // 5:
11836 // 6:
46b94261 11837
489d5531 11838 Int_t typeFlag = -1;
11839 Int_t ptEtaFlag = -1;
11840 if(type == "RP")
11841 {
11842 typeFlag = 0;
11843 } else if(type == "POI")
11844 {
11845 typeFlag = 1;
11846 }
11847 if(ptOrEta == "Pt")
11848 {
11849 ptEtaFlag = 0;
11850 } else if(ptOrEta == "Eta")
11851 {
11852 ptEtaFlag = 1;
11853 }
11854 // shortcuts:
11855 Int_t t = typeFlag;
11856 Int_t pe = ptEtaFlag;
11857
11858 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
11859 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
11860 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
11861
11862 Int_t nPrim = anEvent->NumberOfTracks();
11863 AliFlowTrackSimple *aftsTrack = NULL;
11864
11865 Double_t psi1=0., phi2=0., phi3=0.;// phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
11866 Double_t wPhi2=1., wPhi3=1.;
11867
11868 Int_t n = fHarmonic;
11869
11870 // 1'-particle correction terms:
11871 for(Int_t i1=0;i1<nPrim;i1++)
11872 {
11873 aftsTrack=anEvent->GetTrack(i1);
3b552efe 11874 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11875 if(typeFlag==1) // this is diff flow of POIs
489d5531 11876 {
11877 if(ptOrEta == "Pt")
11878 {
11879 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11880 } else if (ptOrEta == "Eta")
11881 {
11882 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11883 }
11884 } else // this is diff flow of RPs
11885 {
489d5531 11886 if(ptOrEta == "Pt")
11887 {
11888 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11889 } else if (ptOrEta == "Eta")
11890 {
11891 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11892 }
489d5531 11893 }
11894 psi1=aftsTrack->Phi();
11895 // sin terms:
11896 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*psi1),1.); // <<sin(n*(psi1))>>
11897 // cos terms:
11898 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*psi1),1.); // <<cos(n*(psi1))>>
11899 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11900
11901 // 2'-particle correction terms:
11902 for(Int_t i1=0;i1<nPrim;i1++)
11903 {
11904 aftsTrack=anEvent->GetTrack(i1);
3b552efe 11905 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11906 if(typeFlag==1) // this is diff flow of POIs
489d5531 11907 {
11908 if(ptOrEta == "Pt")
11909 {
11910 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11911 } else if (ptOrEta == "Eta")
11912 {
11913 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11914 }
11915 } else // this is diff flow of RPs
11916 {
489d5531 11917 if(ptOrEta == "Pt")
11918 {
11919 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11920 } else if (ptOrEta == "Eta")
11921 {
11922 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11923 }
489d5531 11924 }
11925 psi1=aftsTrack->Phi();
11926 for(Int_t i2=0;i2<nPrim;i2++)
11927 {
11928 if(i2==i1) continue;
11929 aftsTrack=anEvent->GetTrack(i2);
11930 // RP condition (!(first) particle in the correlator must be RP):
11931 if(!(aftsTrack->InRPSelection())) continue;
46b94261 11932 phi2=aftsTrack->Phi();
489d5531 11933 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
11934 // sin terms:
11935 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2)),wPhi2); // <<w2 sin(n*(psi1+phi2))>>
11936 // cos terms:
11937 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2)),wPhi2); // <<w2 cos(n*(psi1+phi2))>>
11938 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11939 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11940
11941 // 3'-particle correction terms:
11942 for(Int_t i1=0;i1<nPrim;i1++)
11943 {
11944 aftsTrack=anEvent->GetTrack(i1);
3b552efe 11945 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11946 if(typeFlag==1) // this is diff flow of POIs
489d5531 11947 {
11948 if(ptOrEta == "Pt")
11949 {
11950 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11951 } else if (ptOrEta == "Eta")
11952 {
11953 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11954 }
11955 } else // this is diff flow of RPs
11956 {
489d5531 11957 if(ptOrEta == "Pt")
11958 {
11959 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11960 } else if (ptOrEta == "Eta")
11961 {
11962 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11963 }
489d5531 11964 }
11965 psi1=aftsTrack->Phi();
11966 for(Int_t i2=0;i2<nPrim;i2++)
11967 {
11968 if(i2==i1) continue;
11969 aftsTrack=anEvent->GetTrack(i2);
11970 // RP condition (!(first) particle in the correlator must be RP):
11971 if(!(aftsTrack->InRPSelection())) continue;
11972 phi2=aftsTrack->Phi();
11973 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
11974 for(Int_t i3=0;i3<nPrim;i3++)
11975 {
11976 if(i3==i1||i3==i2) continue;
11977 aftsTrack=anEvent->GetTrack(i3);
11978 // RP condition (!(first) particle in the correlator must be RP):
11979 if(!(aftsTrack->InRPSelection())) continue;
11980 phi3=aftsTrack->Phi();
11981 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
11982 // sin terms:
11983 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))>>
11984 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))>>
11985 // cos terms:
11986 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))>>
11987 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))>>
11988 }//end of for(Int_t i3=0;i3<nPrim;i3++)
11989 }//end of for(Int_t i2=0;i2<nPrim;i2++)
46b94261 11990 }//end of for(Int_t i1=0;i1<nPrim;i1++)
489d5531 11991
11992} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
11993
11994
57340a27 11995
11996
11997