]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithQCumulants.cxx
Added new scheme for the analysis cuts
[u/mrichter/AliRoot.git] / PWG2 / FLOW / AliFlowCommon / AliFlowAnalysisWithQCumulants.cxx
CommitLineData
489d5531 1/*************************************************************************
2* Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *
3* *
4* Author: The ALICE Off-line Project. *
5* Contributors are mentioned in the code where appropriate. *
6* *
7* Permission to use, copy, modify and distribute this software and its *
8* documentation strictly for non-commercial purposes is hereby granted *
9* without fee, provided that the above copyright notice appears in all *
10* copies and that both the copyright notice and this permission notice *
11* appear in the supporting documentation. The authors make no claims *
12* about the suitability of this software for any purpose. It is *
13* provided "as is" without express or implied warranty. *
14**************************************************************************/
15
16/**********************************
17 * flow analysis with Q-cumulants *
18 * *
ff70ca91 19 * author: Ante Bilandzic *
20 * (abilandzic@gmail.com) *
489d5531 21 *********************************/
22
23#define AliFlowAnalysisWithQCumulants_cxx
24
25#include "Riostream.h"
26#include "AliFlowCommonConstants.h"
27#include "AliFlowCommonHist.h"
28#include "AliFlowCommonHistResults.h"
29#include "TChain.h"
30
31#include "TFile.h"
32#include "TList.h"
33#include "TGraph.h"
34#include "TParticle.h"
35#include "TRandom3.h"
36#include "TStyle.h"
37#include "TProfile.h"
38#include "TProfile2D.h"
39#include "TProfile3D.h"
40#include "TMath.h"
41#include "TArrow.h"
42#include "TPaveLabel.h"
43#include "TCanvas.h"
44#include "AliFlowEventSimple.h"
45#include "AliFlowTrackSimple.h"
46#include "AliFlowAnalysisWithQCumulants.h"
47#include "TArrayD.h"
48#include "TRandom.h"
49#include "TF1.h"
50
51class TH1;
52class TH2;
53class TGraph;
54class TPave;
55class TLatex;
56class TMarker;
57class TRandom3;
58class TObjArray;
59class TList;
60class TCanvas;
61class TSystem;
62class TROOT;
63class AliFlowVector;
64class TVector;
65
66
67//================================================================================================================
68
69
70ClassImp(AliFlowAnalysisWithQCumulants)
71
72AliFlowAnalysisWithQCumulants::AliFlowAnalysisWithQCumulants():
73 // 0.) base:
74 fHistList(NULL),
75 // 1.) common:
76 fCommonHists(NULL),
77 fCommonHists2nd(NULL),
78 fCommonHists4th(NULL),
79 fCommonHists6th(NULL),
80 fCommonHists8th(NULL),
81 fCommonHistsResults2nd(NULL),
82 fCommonHistsResults4th(NULL),
83 fCommonHistsResults6th(NULL),
84 fCommonHistsResults8th(NULL),
85 fnBinsPhi(0),
86 fPhiMin(0),
87 fPhiMax(0),
88 fPhiBinWidth(0),
89 fnBinsPt(0),
90 fPtMin(0),
91 fPtMax(0),
92 fPtBinWidth(0),
93 fnBinsEta(0),
94 fEtaMin(0),
95 fEtaMax(0),
96 fEtaBinWidth(0),
97 fHarmonic(2),
98 fAnalysisLabel(NULL),
99 // 2a.) particle weights:
100 fWeightsList(NULL),
101 fUsePhiWeights(kFALSE),
102 fUsePtWeights(kFALSE),
103 fUseEtaWeights(kFALSE),
104 fUseParticleWeights(NULL),
105 fPhiWeights(NULL),
106 fPtWeights(NULL),
107 fEtaWeights(NULL),
108 // 2b.) event weights:
109 fMultiplicityWeight(NULL),
110 // 3.) integrated flow:
111 fIntFlowList(NULL),
112 fIntFlowProfiles(NULL),
113 fIntFlowResults(NULL),
114 fIntFlowFlags(NULL),
9da1a4f3 115 fApplyCorrectionForNUA(kTRUE),
116 fnBinsMult(10000),
117 fMinMult(0),
118 fMaxMult(10000),
489d5531 119 fReQ(NULL),
120 fImQ(NULL),
121 fSMpk(NULL),
122 fIntFlowCorrelationsEBE(NULL),
123 fIntFlowEventWeightsForCorrelationsEBE(NULL),
124 fIntFlowCorrelationsAllEBE(NULL),
125 fAvMultiplicity(NULL),
126 fIntFlowCorrelationsPro(NULL),
127 fIntFlowCorrelationsAllPro(NULL),
128 fIntFlowExtraCorrelationsPro(NULL),
129 fIntFlowProductOfCorrelationsPro(NULL),
0328db2d 130 fIntFlowProductOfCorrectionTermsForNUAPro(NULL),
489d5531 131 fIntFlowCorrelationsHist(NULL),
132 fIntFlowCorrelationsAllHist(NULL),
133 fIntFlowCovariances(NULL),
134 fIntFlowSumOfProductOfEventWeights(NULL),
0328db2d 135 fIntFlowCovariancesNUA(NULL),
136 fIntFlowSumOfProductOfEventWeightsNUA(NULL),
489d5531 137 fIntFlowQcumulants(NULL),
138 fIntFlow(NULL),
139 // 4.) differential flow:
140 fDiffFlowList(NULL),
141 fDiffFlowProfiles(NULL),
142 fDiffFlowResults(NULL),
143 fDiffFlowFlags(NULL),
144 fCalculate2DFlow(kFALSE),
145 // 5.) distributions:
57340a27 146 fDistributionsList(NULL),
147 fDistributionsFlags(NULL),
489d5531 148 fStoreDistributions(kFALSE),
149 // x.) debugging and cross-checking:
150 fNestedLoopsList(NULL),
151 fEvaluateIntFlowNestedLoops(kFALSE),
152 fEvaluateDiffFlowNestedLoops(kFALSE),
153 fMaxAllowedMultiplicity(10),
154 fEvaluateNestedLoops(NULL),
155 fIntFlowDirectCorrelations(NULL),
156 fIntFlowExtraDirectCorrelations(NULL),
157 fCrossCheckInPtBinNo(10),
3b552efe 158 fCrossCheckInEtaBinNo(20),
489d5531 159 fNoOfParticlesInBin(NULL)
160 {
161 // constructor
162
163 // base list to hold all output objects:
164 fHistList = new TList();
165 fHistList->SetName("cobjQC");
166 fHistList->SetOwner(kTRUE);
167
168 // list to hold histograms with phi, pt and eta weights:
169 fWeightsList = new TList();
170
171 // multiplicity weight:
172 fMultiplicityWeight = new TString("combinations");
173
174 // analysis label;
175 fAnalysisLabel = new TString();
176
177 // initialize all arrays:
178 this->InitializeArraysForIntFlow();
179 this->InitializeArraysForDiffFlow();
180 this->InitializeArraysForDistributions();
181 this->InitializeArraysForNestedLoops();
182
183 } // end of constructor
184
185
186//================================================================================================================
187
188
189AliFlowAnalysisWithQCumulants::~AliFlowAnalysisWithQCumulants()
190{
191 // destructor
192
193 delete fHistList;
194
195} // end of AliFlowAnalysisWithQCumulants::~AliFlowAnalysisWithQCumulants()
196
197
198//================================================================================================================
199
200
201void AliFlowAnalysisWithQCumulants::Init()
202{
3b552efe 203 // a) Cross check if the settings make sense before starting the QC adventure;
489d5531 204 // b) Access all common constants;
205 // c) Book all objects;
3b552efe 206 // d) Store flags for integrated and differential flow;
489d5531 207 // e) Store flags for distributions of corelations;
208 // f) Store harmonic which will be estimated.
3b552efe 209
489d5531 210 //save old value and prevent histograms from being added to directory
211 //to avoid name clashes in case multiple analaysis objects are used
212 //in an analysis
213 Bool_t oldHistAddStatus = TH1::AddDirectoryStatus();
214 TH1::AddDirectory(kFALSE);
215
3b552efe 216 // a) Cross check if the settings make sense before starting the QC adventure;
489d5531 217 this->CrossCheckSettings();
218 // b) Access all common constants:
219 this->AccessConstants();
220 // c) Book all objects:
221 this->BookAndFillWeightsHistograms();
222 this->BookAndNestAllLists();
223 this->BookCommonHistograms();
224 this->BookEverythingForIntegratedFlow();
225 this->BookEverythingForDifferentialFlow();
226 this->BookEverythingForDistributions();
227 this->BookEverythingForNestedLoops();
228 // d) Store flags for integrated and differential flow:
229 this->StoreIntFlowFlags();
3b552efe 230 this->StoreDiffFlowFlags();
489d5531 231 // e) Store flags for distributions of corelations:
232 this->StoreFlagsForDistributions();
233 // f) Store harmonic which will be estimated:
234 this->StoreHarmonic();
235
236 TH1::AddDirectory(oldHistAddStatus);
237} // end of void AliFlowAnalysisWithQCumulants::Init()
238
239
240//================================================================================================================
241
242
243void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
244{
245 // Running over data only in this method.
246
247 // a) Fill the common control histograms and call the method to fill fAvMultiplicity;
248 // b) Loop over data and calculate e-b-e quantities;
249 // c) Call all the methods;
250 // d) Debugging and cross-checking (evaluate nested loops);
251 // e) Reset all event by event quantities.
252
253 Double_t dPhi = 0.; // azimuthal angle in the laboratory frame
254 Double_t dPt = 0.; // transverse momentum
255 Double_t dEta = 0.; // pseudorapidity
256
257 Double_t wPhi = 1.; // phi weight
258 Double_t wPt = 1.; // pt weight
259 Double_t wEta = 1.; // eta weight
260
261 Int_t nRP = anEvent->GetEventNSelTracksRP(); // number of RPs (i.e. number of particles used to determine the reaction plane)
262
263 // a) Fill the common control histograms and call the method to fill fAvMultiplicity:
264 this->FillCommonControlHistograms(anEvent);
265 this->FillAverageMultiplicities(nRP);
266
267 // b) Loop over data and calculate e-b-e quantities:
268 Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = total number of primary tracks, i.e. nPrim = nRP + nPOI + rest, where:
269 // nRP = # of particles used to determine the reaction plane;
270 // nPOI = # of particles of interest for a detailed flow analysis;
271 // rest = # of particles which are not niether RPs nor POIs.
272
273 AliFlowTrackSimple *aftsTrack = NULL;
274
275 for(Int_t i=0;i<nPrim;i++)
276 {
277 aftsTrack=anEvent->GetTrack(i);
278 if(aftsTrack)
279 {
280 if(!(aftsTrack->InRPSelection() || aftsTrack->InPOISelection())) continue; // consider only tracks which are RPs or POIs
281 Int_t n = fHarmonic; // shortcut for the harmonic
282 if(aftsTrack->InRPSelection()) // RP condition:
283 {
284 dPhi = aftsTrack->Phi();
285 dPt = aftsTrack->Pt();
286 dEta = aftsTrack->Eta();
287 if(fUsePhiWeights && fPhiWeights && fnBinsPhi) // determine phi weight for this particle:
288 {
289 wPhi = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*fnBinsPhi/TMath::TwoPi())));
290 }
291 if(fUsePtWeights && fPtWeights && fnBinsPt) // determine pt weight for this particle:
292 {
293 wPt = fPtWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/fPtBinWidth)));
294 }
295 if(fUseEtaWeights && fEtaWeights && fEtaBinWidth) // determine eta weight for this particle:
296 {
297 wEta = fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/fEtaBinWidth)));
298 }
299
300 // integrated flow:
301 // calculate Re[Q_{m*n,k}] and Im[Q_{m*n,k}], m = 1,2,3,4, for this event:
302 for(Int_t m=0;m<4;m++)
303 {
304 for(Int_t k=0;k<9;k++)
305 {
306 (*fReQ)(m,k)+=pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1)*n*dPhi);
307 (*fImQ)(m,k)+=pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1)*n*dPhi);
308 }
309 }
310 // calculate S^{M}_{p,k} for this event
311 // Remark: final calculation of S^{M}_{p,k} follows after the loop over data bellow:
312 for(Int_t p=0;p<8;p++)
313 {
314 for(Int_t k=0;k<9;k++)
315 {
316 (*fSMpk)(p,k)+=pow(wPhi*wPt*wEta,k);
317 }
318 }
319
320 // differential flow:
321 // 1D (pt):
322 // (r_{m*m,k}(pt)):
323 for(Int_t m=0;m<4;m++)
324 {
325 for(Int_t k=0;k<9;k++)
326 {
327 fReRPQ1dEBE[0][0][m][k]->Fill(dPt,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
328 fImRPQ1dEBE[0][0][m][k]->Fill(dPt,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
329 }
330 }
331
332 // s_{k}(pt) for RPs // to be improved (clarified)
333 // Remark: final calculation of s_{p,k}(pt) follows after the loop over data bellow:
334 for(Int_t k=0;k<9;k++)
335 {
336 fs1dEBE[0][0][k]->Fill(dPt,pow(wPhi*wPt*wEta,k),1.);
337 }
338 // 1D (eta):
339 // (r_{m*m,k}(eta)):
340 for(Int_t m=0;m<4;m++)
341 {
342 for(Int_t k=0;k<9;k++)
343 {
344 fReRPQ1dEBE[0][1][m][k]->Fill(dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
345 fImRPQ1dEBE[0][1][m][k]->Fill(dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
346 }
347 }
348 // s_{k}(eta) for RPs // to be improved (clarified)
349 // Remark: final calculation of s_{p,k}(eta) follows after the loop over data bellow:
350 for(Int_t k=0;k<9;k++)
351 {
352 fs1dEBE[0][1][k]->Fill(dEta,pow(wPhi*wPt*wEta,k),1.);
353 }
354
355
356
357 /*
358 // 2D (pt,eta):
359 if(fCalculate2DFlow)
360 {
361 // (r_{m*m,k}(pt,eta)):
362 for(Int_t m=0;m<4;m++)
363 {
364 for(Int_t k=0;k<9;k++)
365 {
366 fReRPQ2dEBE[0][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
367 fImRPQ2dEBE[0][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
368 }
369 }
370 // s_{k}(pt,eta) for RPs // to be improved (clarified)
371 // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:
372 for(Int_t k=0;k<9;k++)
373 {
374 fs2dEBE[0][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k),1.);
375 }
376 } // end of if(fCalculate2DFlow)
377 */
378
379
380
381 if(aftsTrack->InPOISelection())
382 {
383 // 1D (pt):
384 // (q_{m*m,k}(pt)):
385 for(Int_t m=0;m<4;m++)
386 {
387 for(Int_t k=0;k<9;k++)
388 {
389 fReRPQ1dEBE[2][0][m][k]->Fill(dPt,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
390 fImRPQ1dEBE[2][0][m][k]->Fill(dPt,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
391 }
392 }
393 // s_{k}(pt) for RP&&POIs // to be improved (clarified)
394 // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:
395 for(Int_t k=0;k<9;k++)
396 {
397 fs1dEBE[2][0][k]->Fill(dPt,pow(wPhi*wPt*wEta,k),1.);
398 }
399 // 1D (eta):
400 // (q_{m*m,k}(eta)):
401 for(Int_t m=0;m<4;m++)
402 {
403 for(Int_t k=0;k<9;k++)
404 {
405 fReRPQ1dEBE[2][1][m][k]->Fill(dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
406 fImRPQ1dEBE[2][1][m][k]->Fill(dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
407 }
408 }
409 // s_{k}(eta) for RP&&POIs // to be improved (clarified)
410 // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:
411 for(Int_t k=0;k<9;k++)
412 {
413 fs1dEBE[2][1][k]->Fill(dEta,pow(wPhi*wPt*wEta,k),1.);
414 }
415
416 /*
417 // 2D (pt,eta)
418 if(fCalculate2DFlow)
419 {
420 // (q_{m*m,k}(pt,eta)):
421 for(Int_t m=0;m<4;m++)
422 {
423 for(Int_t k=0;k<9;k++)
424 {
425 fReRPQ2dEBE[2][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
426 fImRPQ2dEBE[2][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
427 }
428 }
429 // s_{k}(pt,eta) for RP&&POIs // to be improved (clarified)
430 // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:
431 for(Int_t k=0;k<9;k++)
432 {
433 fs2dEBE[2][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k),1.);
434 }
435 } // end of if(fCalculate2DFlow)
436 */
437
438 } // end of if(aftsTrack->InPOISelection())
439
440
441
442 } // end of if(pTrack->InRPSelection())
443
444
445
446 if(aftsTrack->InPOISelection())
447 {
448 dPhi = aftsTrack->Phi();
449 dPt = aftsTrack->Pt();
450 dEta = aftsTrack->Eta();
451
452 // 1D (pt)
453 // p_n(m*n,0):
454 for(Int_t m=0;m<4;m++)
455 {
456 fReRPQ1dEBE[1][0][m][0]->Fill(dPt,TMath::Cos((m+1.)*n*dPhi),1.);
457 fImRPQ1dEBE[1][0][m][0]->Fill(dPt,TMath::Sin((m+1.)*n*dPhi),1.);
458 }
459 // 1D (eta)
460 // p_n(m*n,0):
461 for(Int_t m=0;m<4;m++)
462 {
463 fReRPQ1dEBE[1][1][m][0]->Fill(dEta,TMath::Cos((m+1.)*n*dPhi),1.);
464 fImRPQ1dEBE[1][1][m][0]->Fill(dEta,TMath::Sin((m+1.)*n*dPhi),1.);
465 }
466
467
468 /*
469 // 2D (pt,eta):
470 if(fCalculate2DFlow)
471 {
472 // p_n(m*n,0):
473 for(Int_t m=0;m<4;m++)
474 {
475 fReRPQ2dEBE[1][m][0]->Fill(dPt,dEta,TMath::Cos((m+1.)*n*dPhi),1.);
476 fImRPQ2dEBE[1][m][0]->Fill(dPt,dEta,TMath::Sin((m+1.)*n*dPhi),1.);
477 }
478 } // end of if(fCalculate2DFlow)
479 */
480
481
482 } // end of if(pTrack->InPOISelection() )
483
484
485 } else // to if(aftsTrack)
486 {
487 cout<<endl;
488 cout<<" WARNING: no particle! (i.e. aftsTrack is a NULL pointer in AFAWQC::Make().)"<<endl;
489 cout<<endl;
490 }
491 } // end of for(Int_t i=0;i<nPrim;i++)
492
493 // calculate the final expressions for S^{M}_{p,k}:
494 for(Int_t p=0;p<8;p++)
495 {
496 for(Int_t k=0;k<9;k++)
497 {
498 (*fSMpk)(p,k)=pow((*fSMpk)(p,k),p+1);
499 }
500 }
501
502 // *****************************
503 // **** CALL THE METHODS *******
504 // *****************************
505 // integrated flow:
506 if(!fEvaluateIntFlowNestedLoops)
507 {
508 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
509 {
510 if(nRP>1) this->CalculateIntFlowCorrelations(); // without using particle weights
0328db2d 511 } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
489d5531 512 {
513 if(nRP>1) this->CalculateIntFlowCorrelationsUsingParticleWeights(); // with using particle weights
514 }
515
516 if(nRP>3) this->CalculateIntFlowProductOfCorrelations();
517 if(nRP>1) this->CalculateIntFlowSumOfEventWeights();
518 if(nRP>1) this->CalculateIntFlowSumOfProductOfEventWeights();
519 if(fApplyCorrectionForNUA)
520 {
57340a27 521 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
522 {
489d5531 523 if(nRP>0) this->CalculateIntFlowCorrectionsForNUASinTerms();
524 if(nRP>0) this->CalculateIntFlowCorrectionsForNUACosTerms();
57340a27 525 } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
526 {
489d5531 527 if(nRP>0) this->CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights();
57340a27 528 if(nRP>0) this->CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights();
529 }
0328db2d 530
531 if(nRP>0) this->CalculateIntFlowProductOfCorrectionTermsForNUA();
532 if(nRP>0) this->CalculateIntFlowSumOfEventWeightsNUA();
533 if(nRP>0) this->CalculateIntFlowSumOfProductOfEventWeightsNUA();
489d5531 534 } // end of if(fApplyCorrectionForNUA)
535 } // end of if(!fEvaluateIntFlowNestedLoops)
536
537 // differential flow:
538 if(!fEvaluateDiffFlowNestedLoops)
539 {
540 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
541 {
542 // without using particle weights:
543 this->CalculateDiffFlowCorrelations("RP","Pt");
544 this->CalculateDiffFlowCorrelations("RP","Eta");
545 this->CalculateDiffFlowCorrelations("POI","Pt");
57340a27 546 this->CalculateDiffFlowCorrelations("POI","Eta");
547 if(fApplyCorrectionForNUA)
548 {
489d5531 549 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Pt");
550 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Eta");
551 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Pt");
552 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Eta");
553 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Pt");
554 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Eta");
555 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Pt");
57340a27 556 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Eta");
489d5531 557 } // end of if(fApplyCorrectionForNUA)
558 } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
559 {
560 // with using particle weights:
561 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Pt");
562 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Eta");
563 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Pt");
564 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Eta");
57340a27 565 if(fApplyCorrectionForNUA)
566 {
489d5531 567 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Pt");
568 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Eta");
569 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Pt");
570 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Eta");
571 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Pt");
572 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Eta");
573 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Pt");
57340a27 574 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Eta");
489d5531 575 } // end of if(fApplyCorrectionForNUA)
576 }
57340a27 577
489d5531 578 // whether or not using particle weights the following is calculated in the same way:
579 this->CalculateDiffFlowProductOfCorrelations("RP","Pt");
580 this->CalculateDiffFlowProductOfCorrelations("RP","Eta");
581 this->CalculateDiffFlowProductOfCorrelations("POI","Pt");
582 this->CalculateDiffFlowProductOfCorrelations("POI","Eta");
583 this->CalculateDiffFlowSumOfEventWeights("RP","Pt");
584 this->CalculateDiffFlowSumOfEventWeights("RP","Eta");
585 this->CalculateDiffFlowSumOfEventWeights("POI","Pt");
586 this->CalculateDiffFlowSumOfEventWeights("POI","Eta");
587 this->CalculateDiffFlowSumOfProductOfEventWeights("RP","Pt");
588 this->CalculateDiffFlowSumOfProductOfEventWeights("RP","Eta");
589 this->CalculateDiffFlowSumOfProductOfEventWeights("POI","Pt");
590 this->CalculateDiffFlowSumOfProductOfEventWeights("POI","Eta");
591 } // end of if(!fEvaluateDiffFlowNestedLoops)
592
593
594
595 // with weights:
596 // ...
597
598 /*
599 // 2D differential flow
600 if(fCalculate2DFlow)
601 {
602 // without weights:
603 if(nRP>1) this->CalculateCorrelationsForDifferentialFlow2D("RP");
604 if(nRP>1) this->CalculateCorrelationsForDifferentialFlow2D("POI");
605
606 // with weights:
607 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
608 {
609 if(nRP>1) this->CalculateWeightedCorrelationsForDifferentialFlow2D("RP");
610 if(nRP>1) this->CalculateWeightedCorrelationsForDifferentialFlow2D("POI");
611 }
612 } // end of if(fCalculate2DFlow)
613 */
57340a27 614
615 // distributions of correlations:
616 if(fStoreDistributions)
617 {
618 this->StoreDistributionsOfCorrelations();
619 }
489d5531 620
621 // d) Debugging and cross-checking (evaluate nested loops):
622 // d1) cross-checking results for integrated flow:
623 if(fEvaluateIntFlowNestedLoops)
624 {
625 if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10
626 {
627 // without using particle weights:
628 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
629 {
630 // correlations:
631 this->CalculateIntFlowCorrelations(); // from Q-vectors
632 this->EvaluateIntFlowCorrelationsWithNestedLoops(anEvent); // from nested loops (to be improved: do I have to pass here anEvent or not?)
633 // correction for non-uniform acceptance:
634 this->CalculateIntFlowCorrectionsForNUASinTerms(); // from Q-vectors (sin terms)
635 this->CalculateIntFlowCorrectionsForNUACosTerms(); // from Q-vectors (cos terms)
636 this->EvaluateIntFlowCorrectionsForNUAWithNestedLoops(anEvent); // from nested loops (both sin and cos terms)
637 }
638 // using particle weights:
639 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
640 {
641 // correlations:
642 this->CalculateIntFlowCorrelationsUsingParticleWeights(); // from Q-vectors
643 this->EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent); // from nested loops (to be improved: do I have to pass here anEvent or not?)
644 // correction for non-uniform acceptance:
645 this->CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights(); // from Q-vectors (sin terms)
646 this->CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights(); // from Q-vectors (cos terms)
57340a27 647 this->EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(anEvent); // from nested loops (both sin and cos terms)
489d5531 648 }
649 } else if (nPrim>fMaxAllowedMultiplicity) // to if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity)
650 {
651 cout<<endl;
652 cout<<"Skipping the event because multiplicity is "<<nPrim<<". Too high to evaluate nested loops!"<<endl;
653 } else
654 {
655 cout<<endl;
656 cout<<"Skipping the event because multiplicity is "<<nPrim<<"."<<endl;
657 }
658 } // end of if(fEvaluateIntFlowNestedLoops)
659
660 // d2) cross-checking results for differential flow:
661 if(fEvaluateDiffFlowNestedLoops)
662 {
663 if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10
664 {
665 // without using particle weights:
666 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
667 {
668 // reduced correlations:
669 // Q-vectors:
670 this->CalculateDiffFlowCorrelations("RP","Pt");
671 this->CalculateDiffFlowCorrelations("RP","Eta");
672 this->CalculateDiffFlowCorrelations("POI","Pt");
673 this->CalculateDiffFlowCorrelations("POI","Eta");
674 // nested loops:
675 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"RP","Pt");
676 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"RP","Eta");
677 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"POI","Pt");
678 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"POI","Eta");
679 // reduced corrections for non-uniform acceptance:
680 // Q-vectors:
681 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Pt");
682 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Eta");
683 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Pt");
684 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Eta");
685 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Pt");
686 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Eta");
687 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Pt");
688 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Eta");
689 // nested loops:
690 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"RP","Pt");
691 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"RP","Eta");
692 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"POI","Pt");
693 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"POI","Eta");
694 } // end of if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
695 // using particle weights:
696 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
697 {
698 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Pt");
699 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Eta");
700 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Pt");
701 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Eta");
702 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Pt");
703 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Eta");
704 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Pt");
705 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Eta");
706 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Pt");
707 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Eta");
708 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Pt");
709 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Eta");
710 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"RP","Pt");
711 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"RP","Eta");
712 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"POI","Pt");
3b552efe 713 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"POI","Eta");
489d5531 714 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"RP","Pt");
715 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"RP","Eta");
716 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"POI","Pt");
717 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"POI","Eta");
718 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
719 } // end of if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10
720 } // end of if(fEvaluateDiffFlowNestedLoops)
721
722 // e) Reset all event by event quantities:
723 this->ResetEventByEventQuantities();
724
725} // end of AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
726
727
728//================================================================================================================================
729
730
731void AliFlowAnalysisWithQCumulants::Finish()
732{
733 // Calculate the final results.
734 // a) acces the constants;
735 // b) access the flags;
736 // c) calculate the final results for integrated flow (without and with weights);
737 // d) store in AliFlowCommonHistResults and print the final results for integrated flow;
738 // e) calculate the final results for differential flow (without and with weights);
739 // f) print the final results for integrated flow obtained from differential flow (to be improved (terminology));
740 // g) cross-check the results: results from Q-vectors vs results from nested loops
741
742 // ******************************
743 // **** ACCESS THE CONSTANTS ****
744 // ******************************
745
746 this->AccessConstants();
747
748 if(fCommonHists && fCommonHists->GetHarmonic())
749 {
750 fHarmonic = (Int_t)(fCommonHists->GetHarmonic())->GetBinContent(1); // to be improved (moved somewhere else)
751 }
752
753 // **************************
ff70ca91 754 // **** ACCESS THE FLAGS **** // to be improved (moved somewhere else)
489d5531 755 // **************************
756 fUsePhiWeights = (Int_t)fUseParticleWeights->GetBinContent(1);
757 fUsePtWeights = (Int_t)fUseParticleWeights->GetBinContent(2);
758 fUseEtaWeights = (Int_t)fUseParticleWeights->GetBinContent(3);
3b552efe 759 fApplyCorrectionForNUA = (Int_t)fIntFlowFlags->GetBinContent(3);
489d5531 760 fPrintFinalResults[0] = (Int_t)fIntFlowFlags->GetBinContent(4);
761 fPrintFinalResults[1] = (Int_t)fIntFlowFlags->GetBinContent(5);
762 fPrintFinalResults[2] = (Int_t)fIntFlowFlags->GetBinContent(6);
763 fEvaluateIntFlowNestedLoops = (Int_t)fEvaluateNestedLoops->GetBinContent(1);
764 fEvaluateDiffFlowNestedLoops = (Int_t)fEvaluateNestedLoops->GetBinContent(2);
765 fCrossCheckInPtBinNo = (Int_t)fEvaluateNestedLoops->GetBinContent(3);
766 fCrossCheckInEtaBinNo = (Int_t)fEvaluateNestedLoops->GetBinContent(4);
767
768 // *********************************************************
769 // **** CALCULATE THE FINAL RESULTS FOR INTEGRATED FLOW ****
770 // *********************************************************
771
772 this->FinalizeCorrelationsIntFlow();
773 this->CalculateCovariancesIntFlow();
774 this->CalculateCumulantsIntFlow();
775 this->CalculateIntFlow();
776
777 if(fApplyCorrectionForNUA) // to be improved (reorganized, etc)
778 {
779 this->FinalizeCorrectionTermsForNUAIntFlow();
0328db2d 780 this->CalculateCovariancesNUAIntFlow();
489d5531 781 this->CalculateQcumulantsCorrectedForNUAIntFlow();
782 this->CalculateIntFlowCorrectedForNUA();
783 }
784
785 // ***************************************************************
786 // **** STORE AND PRINT THE FINAL RESULTS FOR INTEGRATED FLOW ****
787 // ***************************************************************
788
789 this->FillCommonHistResultsIntFlow();
790
3b552efe 791 if(fPrintFinalResults[0])
792 {
489d5531 793 this->PrintFinalResultsForIntegratedFlow("NONAME"); // to be improved (name)
794 }
795
796 // ***********************************************************
797 // **** CALCULATE THE FINAL RESULTS FOR DIFFERENTIAL FLOW ****
798 // ***********************************************************
799
800 this->FinalizeReducedCorrelations("RP","Pt");
801 this->FinalizeReducedCorrelations("RP","Eta");
802 this->FinalizeReducedCorrelations("POI","Pt");
803 this->FinalizeReducedCorrelations("POI","Eta");
804 this->CalculateDiffFlowCovariances("RP","Pt");
805 this->CalculateDiffFlowCovariances("RP","Eta");
806 this->CalculateDiffFlowCovariances("POI","Pt");
807 this->CalculateDiffFlowCovariances("POI","Eta");
808 this->CalculateDiffFlowCumulants("RP","Pt");
809 this->CalculateDiffFlowCumulants("RP","Eta");
810 this->CalculateDiffFlowCumulants("POI","Pt");
811 this->CalculateDiffFlowCumulants("POI","Eta");
812 this->CalculateDiffFlow("RP","Pt");
813 this->CalculateDiffFlow("RP","Eta");
814 this->CalculateDiffFlow("POI","Pt");
815 this->CalculateDiffFlow("POI","Eta");
816
817 if(fApplyCorrectionForNUA) // to be improved (reorganized, etc)
818 {
819 this->FinalizeCorrectionTermsForNUADiffFlow("RP","Pt");
820 this->FinalizeCorrectionTermsForNUADiffFlow("RP","Eta");
821 this->FinalizeCorrectionTermsForNUADiffFlow("POI","Pt");
822 this->FinalizeCorrectionTermsForNUADiffFlow("POI","Eta");
823 this->CalculateDiffFlowCumulantsCorrectedForNUA("RP","Pt");
824 this->CalculateDiffFlowCumulantsCorrectedForNUA("RP","Eta");
825 this->CalculateDiffFlowCumulantsCorrectedForNUA("POI","Pt");
826 this->CalculateDiffFlowCumulantsCorrectedForNUA("POI","Eta");
827 this->CalculateDiffFlowCorrectedForNUA("RP","Pt");
828 this->CalculateDiffFlowCorrectedForNUA("RP","Eta");
829 this->CalculateDiffFlowCorrectedForNUA("POI","Pt");
830 this->CalculateDiffFlowCorrectedForNUA("POI","Eta");
3b552efe 831 }
489d5531 832
833 this->CalculateFinalResultsForRPandPOIIntegratedFlow("RP");
834 this->CalculateFinalResultsForRPandPOIIntegratedFlow("POI");
835
836 // *****************************************************************
837 // **** STORE AND PRINT THE FINAL RESULTS FOR DIFFERENTIAL FLOW ****
838 // *****************************************************************
839 this->FillCommonHistResultsDiffFlow("RP");
840 this->FillCommonHistResultsDiffFlow("POI");
841
3b552efe 842 if(fPrintFinalResults[1])
843 {
489d5531 844 this->PrintFinalResultsForIntegratedFlow("RP");
3b552efe 845 }
846 if(fPrintFinalResults[2])
847 {
489d5531 848 this->PrintFinalResultsForIntegratedFlow("POI");
849 }
850 // g) cross-check the results: results from Q-vectors vs results from nested loops
851
852 // g1) integrated flow:
853 if(fEvaluateIntFlowNestedLoops)
854 {
855 this->CrossCheckIntFlowCorrelations();
856 this->CrossCheckIntFlowCorrectionTermsForNUA();
857 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights) this->CrossCheckIntFlowExtraCorrelations();
858 } // end of if(fEvaluateIntFlowNestedLoops)
859
860 // g2) differential flow:
861 if(fEvaluateDiffFlowNestedLoops)
862 {
3b552efe 863 // correlations:
489d5531 864 this->PrintNumberOfParticlesInSelectedBin();
865 this->CrossCheckDiffFlowCorrelations("RP","Pt");
866 this->CrossCheckDiffFlowCorrelations("RP","Eta");
867 this->CrossCheckDiffFlowCorrelations("POI","Pt");
868 this->CrossCheckDiffFlowCorrelations("POI","Eta");
869 // correction terms for non-uniform acceptance:
870 this->CrossCheckDiffFlowCorrectionTermsForNUA("RP","Pt");
871 this->CrossCheckDiffFlowCorrectionTermsForNUA("RP","Eta");
872 this->CrossCheckDiffFlowCorrectionTermsForNUA("POI","Pt");
873 this->CrossCheckDiffFlowCorrectionTermsForNUA("POI","Eta");
874 } // end of if(fEvaluateDiffFlowNestedLoops)
875
876} // end of AliFlowAnalysisWithQCumulants::Finish()
877
878
879//================================================================================================================================
880
881
882void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTerms()
883{
884 // calculate corrections for non-uniform acceptance of the detector for no-name integrated flow (cos terms)
885
886 // multiplicity:
887 Double_t dMult = (*fSMpk)(0,0);
888
889 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
890 Double_t dReQ1n = (*fReQ)(0,0);
891 Double_t dReQ2n = (*fReQ)(1,0);
892 //Double_t dReQ3n = (*fReQ)(2,0);
893 //Double_t dReQ4n = (*fReQ)(3,0);
894 Double_t dImQ1n = (*fImQ)(0,0);
895 Double_t dImQ2n = (*fImQ)(1,0);
896 //Double_t dImQ3n = (*fImQ)(2,0);
897 //Double_t dImQ4n = (*fImQ)(3,0);
898
899 // *************************************************************
900 // **** corrections for non-uniform acceptance (cos terms): ****
901 // *************************************************************
902 //
903 // Remark 1: corrections for non-uniform acceptance (cos terms) calculated with non-weighted Q-vectors
904 // are stored in 1D profile fQCorrectionsCos.
905 // Remark 2: binning of fIntFlowCorrectionTermsForNUAPro[1] is organized as follows:
906 // --------------------------------------------------------------------------------------------------------------------
907 // 1st bin: <<cos(n*(phi1))>> = cosP1n
908 // 2nd bin: <<cos(n*(phi1+phi2))>> = cosP1nP1n
909 // 3rd bin: <<cos(n*(phi1-phi2-phi3))>> = cosP1nM1nM1n
910 // 4th bin: <<cos(n*(2phi1-phi2))>> = cosP2nM1n
911 // --------------------------------------------------------------------------------------------------------------------
912
913 // 1-particle:
914 Double_t cosP1n = 0.; // <<cos(n*(phi1))>>
915
916 if(dMult>0)
917 {
918 cosP1n = dReQ1n/dMult;
919
920 // average non-weighted 1-particle correction (cos terms) for non-uniform acceptance for single event:
921 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(1,cosP1n);
0328db2d 922 // event weights for NUA terms:
923 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(1,dMult);
489d5531 924
925 // final average non-weighted 1-particle correction (cos terms) for non-uniform acceptance for all events:
926 fIntFlowCorrectionTermsForNUAPro[1]->Fill(0.5,cosP1n,dMult);
927 }
928
929 // 2-particle:
3b552efe 930 Double_t cosP1nP1n = 0.; // <<cos(n*(phi1+phi2))>>
489d5531 931 Double_t cosP2nM1n = 0.; // <<cos(n*(2phi1-phi2))>>
932
933 if(dMult>1)
934 {
935 cosP1nP1n = (pow(dReQ1n,2)-pow(dImQ1n,2)-dReQ2n)/(dMult*(dMult-1));
936 cosP2nM1n = (dReQ2n*dReQ1n+dImQ2n*dImQ1n-dReQ1n)/(dMult*(dMult-1));
937
938 // average non-weighted 2-particle correction (cos terms) for non-uniform acceptance for single event:
3b552efe 939 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(2,cosP1nP1n);
489d5531 940 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(4,cosP2nM1n);
0328db2d 941 // event weights for NUA terms:
942 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(2,dMult*(dMult-1));
943 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(4,dMult*(dMult-1));
944
489d5531 945 // final average non-weighted 2-particle correction (cos terms) for non-uniform acceptance for all events:
3b552efe 946 fIntFlowCorrectionTermsForNUAPro[1]->Fill(1.5,cosP1nP1n,dMult*(dMult-1));
489d5531 947 fIntFlowCorrectionTermsForNUAPro[1]->Fill(3.5,cosP2nM1n,dMult*(dMult-1));
948 }
949
950 // 3-particle:
951 Double_t cosP1nM1nM1n = 0.; // <<cos(n*(phi1-phi2-phi3))>>
952
953 if(dMult>2)
954 {
955 cosP1nM1nM1n = (dReQ1n*(pow(dReQ1n,2)+pow(dImQ1n,2))-dReQ1n*dReQ2n-dImQ1n*dImQ2n-2.*(dMult-1)*dReQ1n)
956 / (dMult*(dMult-1)*(dMult-2));
957
958 // average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for single event:
959 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(3,cosP1nM1nM1n);
0328db2d 960 // event weights for NUA terms:
961 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(3,dMult*(dMult-1)*(dMult-2));
489d5531 962
963 // final average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for all events:
964 fIntFlowCorrectionTermsForNUAPro[1]->Fill(2.5,cosP1nM1nM1n,dMult*(dMult-1)*(dMult-2));
965 }
966
967} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTerms()
968
969
970//================================================================================================================================
971
972
973void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTerms()
974{
975 // calculate corrections for non-uniform acceptance of the detector for no-name integrated flow (sin terms)
976
977 // multiplicity:
978 Double_t dMult = (*fSMpk)(0,0);
979
980 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
981 Double_t dReQ1n = (*fReQ)(0,0);
982 Double_t dReQ2n = (*fReQ)(1,0);
983 //Double_t dReQ3n = (*fReQ)(2,0);
984 //Double_t dReQ4n = (*fReQ)(3,0);
985 Double_t dImQ1n = (*fImQ)(0,0);
986 Double_t dImQ2n = (*fImQ)(1,0);
987 //Double_t dImQ3n = (*fImQ)(2,0);
988 //Double_t dImQ4n = (*fImQ)(3,0);
989
990 // *************************************************************
991 // **** corrections for non-uniform acceptance (sin terms): ****
992 // *************************************************************
993 //
994 // Remark 1: corrections for non-uniform acceptance (sin terms) calculated with non-weighted Q-vectors
995 // are stored in 1D profile fQCorrectionsSin.
996 // Remark 2: binning of fIntFlowCorrectionTermsForNUAPro[0] is organized as follows:
997 // --------------------------------------------------------------------------------------------------------------------
998 // 1st bin: <<sin(n*(phi1))>> = sinP1n
999 // 2nd bin: <<sin(n*(phi1+phi2))>> = sinP1nP1n
1000 // 3rd bin: <<sin(n*(phi1-phi2-phi3))>> = sinP1nM1nM1n
1001 // 4th bin: <<sin(n*(2phi1-phi2))>> = sinP2nM1n
1002 // --------------------------------------------------------------------------------------------------------------------
1003
1004 // 1-particle:
1005 Double_t sinP1n = 0.; // <sin(n*(phi1))>
1006
1007 if(dMult>0)
1008 {
1009 sinP1n = dImQ1n/dMult;
1010
1011 // average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for single event:
0328db2d 1012 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(1,sinP1n);
1013 // event weights for NUA terms:
1014 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(1,dMult);
489d5531 1015
1016 // final average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
1017 fIntFlowCorrectionTermsForNUAPro[0]->Fill(0.5,sinP1n,dMult);
1018 }
1019
1020 // 2-particle:
1021 Double_t sinP1nP1n = 0.; // <<sin(n*(phi1+phi2))>>
1022 Double_t sinP2nM1n = 0.; // <<sin(n*(2phi1-phi2))>>
1023 if(dMult>1)
1024 {
3b552efe 1025 sinP1nP1n = (2.*dReQ1n*dImQ1n-dImQ2n)/(dMult*(dMult-1));
489d5531 1026 sinP2nM1n = (dImQ2n*dReQ1n-dReQ2n*dImQ1n-dImQ1n)/(dMult*(dMult-1));
1027
1028 // average non-weighted 2-particle correction (sin terms) for non-uniform acceptance for single event:
1029 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(2,sinP1nP1n);
3b552efe 1030 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(4,sinP2nM1n);
0328db2d 1031 // event weights for NUA terms:
1032 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(2,dMult*(dMult-1));
1033 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(4,dMult*(dMult-1));
489d5531 1034
1035 // final average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
1036 fIntFlowCorrectionTermsForNUAPro[0]->Fill(1.5,sinP1nP1n,dMult*(dMult-1));
1037 fIntFlowCorrectionTermsForNUAPro[0]->Fill(3.5,sinP2nM1n,dMult*(dMult-1));
1038 }
1039
1040 // 3-particle:
1041 Double_t sinP1nM1nM1n = 0.; // <<sin(n*(phi1-phi2-phi3))>>
1042
1043 if(dMult>2)
1044 {
1045 sinP1nM1nM1n = (-dImQ1n*(pow(dReQ1n,2)+pow(dImQ1n,2))+dReQ1n*dImQ2n-dImQ1n*dReQ2n+2.*(dMult-1)*dImQ1n)
1046 / (dMult*(dMult-1)*(dMult-2));
1047
1048 // average non-weighted 3-particle correction (sin terms) for non-uniform acceptance for single event:
1049 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(3,sinP1nM1nM1n);
0328db2d 1050 // event weights for NUA terms:
1051 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(3,dMult*(dMult-1)*(dMult-2));
489d5531 1052
1053 // final average non-weighted 3-particle correction (sin terms) for non-uniform acceptance for all events:
1054 fIntFlowCorrectionTermsForNUAPro[0]->Fill(2.5,sinP1nM1nM1n,dMult*(dMult-1)*(dMult-2));
1055 }
1056
1057} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTerms()
1058
1059
1060//================================================================================================================================
1061
1062
1063void AliFlowAnalysisWithQCumulants::GetOutputHistograms(TList *outputListHistos)
1064{
1065 // a) Get pointers for common control and common result histograms and profiles.
1066 // b) Get pointers for histograms with particle weights.
1067 // c) Get pointers for histograms and profiles relevant for integrated flow.
1068 // d) Get pointers for histograms and profiles relevant for differental flow.
1069 // e) Get pointers for histograms and profiles holding results obtained with nested loops.
1070
1071 if(outputListHistos)
3b552efe 1072 {
1073 this->SetHistList(outputListHistos);
1074 if(!fHistList)
1075 {
1076 cout<<endl;
1077 cout<<" WARNING (QC): fHistList is NULL in AFAWQC::GOH() !!!!"<<endl;
1078 cout<<endl;
1079 exit(0);
489d5531 1080 }
1081 this->GetPointersForCommonHistograms();
1082 this->GetPointersForParticleWeightsHistograms();
1083 this->GetPointersForIntFlowHistograms();
1084 this->GetPointersForDiffFlowHistograms();
1085 this->GetPointersForNestedLoopsHistograms();
3b552efe 1086 } else
1087 {
1088 cout<<endl;
1089 cout<<" WARNING (QC): outputListHistos is NULL in AFAWQC::GOH() !!!!"<<endl;
1090 cout<<endl;
1091 exit(0);
489d5531 1092 }
1093
1094} // end of void AliFlowAnalysisWithQCumulants::GetOutputHistograms(TList *outputListHistos)
ad87ae62 1095
1096
489d5531 1097//================================================================================================================================
1098
1099
1100TProfile* AliFlowAnalysisWithQCumulants::MakePtProjection(TProfile2D *profilePtEta) const
ad87ae62 1101{
489d5531 1102 // project 2D profile onto pt axis to get 1D profile
1103
1104 Int_t nBinsPt = profilePtEta->GetNbinsX();
1105 Double_t dPtMin = (profilePtEta->GetXaxis())->GetXmin();
1106 Double_t dPtMax = (profilePtEta->GetXaxis())->GetXmax();
1107
1108 Int_t nBinsEta = profilePtEta->GetNbinsY();
1109
1110 TProfile *profilePt = new TProfile("","",nBinsPt,dPtMin,dPtMax);
1111
1112 for(Int_t p=1;p<=nBinsPt;p++)
1113 {
1114 Double_t contentPt = 0.;
1115 Double_t entryPt = 0.;
1116 Double_t spreadPt = 0.;
1117 Double_t sum1 = 0.;
1118 Double_t sum2 = 0.;
1119 Double_t sum3 = 0.;
1120 for(Int_t e=1;e<=nBinsEta;e++)
1121 {
1122 contentPt += (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)))
1123 * (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1124 entryPt += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1125
1126 sum1 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)))
1127 * (pow(profilePtEta->GetBinError(profilePtEta->GetBin(p,e)),2.)
1128 + pow(profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)),2.));
1129 sum2 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1130 sum3 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)))
1131 * (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)));
1132 }
1133 if(sum2>0. && sum1/sum2-pow(sum3/sum2,2.) > 0.)
1134 {
1135 spreadPt = pow(sum1/sum2-pow(sum3/sum2,2.),0.5);
1136 }
1137 profilePt->SetBinContent(p,contentPt);
1138 profilePt->SetBinEntries(p,entryPt);
1139 {
1140 profilePt->SetBinError(p,spreadPt);
1141 }
1142
1143 }
1144
1145 return profilePt;
1146
1147} // end of TProfile* AliFlowAnalysisWithQCumulants::MakePtProjection(TProfile2D *profilePtEta)
1148
1149
1150//================================================================================================================================
1151
1152
1153TProfile* AliFlowAnalysisWithQCumulants::MakeEtaProjection(TProfile2D *profilePtEta) const
1154{
1155 // project 2D profile onto eta axis to get 1D profile
1156
1157 Int_t nBinsEta = profilePtEta->GetNbinsY();
1158 Double_t dEtaMin = (profilePtEta->GetYaxis())->GetXmin();
1159 Double_t dEtaMax = (profilePtEta->GetYaxis())->GetXmax();
1160
1161 Int_t nBinsPt = profilePtEta->GetNbinsX();
1162
1163 TProfile *profileEta = new TProfile("","",nBinsEta,dEtaMin,dEtaMax);
1164
1165 for(Int_t e=1;e<=nBinsEta;e++)
1166 {
1167 Double_t contentEta = 0.;
1168 Double_t entryEta = 0.;
1169 for(Int_t p=1;p<=nBinsPt;p++)
1170 {
1171 contentEta += (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)))
1172 * (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1173 entryEta += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1174 }
1175 profileEta->SetBinContent(e,contentEta);
1176 profileEta->SetBinEntries(e,entryEta);
1177 }
1178
1179 return profileEta;
1180
1181} // end of TProfile* AliFlowAnalysisWithQCumulants::MakeEtaProjection(TProfile2D *profilePtEta)
1182
1183
1184//================================================================================================================================
1185
1186
1187void AliFlowAnalysisWithQCumulants::PrintFinalResultsForIntegratedFlow(TString type)
1188{
1189 // printing on the screen the final results for integrated flow (NONAME, POI and RP) // to be improved (NONAME)
1190
1191 Int_t n = fHarmonic;
1192
1193 if(type == "NONAME" || type == "RP" || type == "POI")
1194 {
1195 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
1196 {
1197 cout<<"WARNING: fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th"<<endl;
1198 cout<<" is NULL in AFAWQC::PFRFIF() !!!!"<<endl;
1199 }
1200 } else
1201 {
1202 cout<<"WARNING: type in not from {NONAME, RP, POI} in AFAWQC::PFRFIF() !!!!"<<endl;
1203 exit(0);
1204 }
1205
1206 Double_t dVn[4] = {0.}; // array to hold Vn{2}, Vn{4}, Vn{6} and Vn{8}
1207 Double_t dVnErr[4] = {0.}; // array to hold errors of Vn{2}, Vn{4}, Vn{6} and Vn{8}
1208
1209 if(type == "NONAME")
1210 {
1211 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinContent(1);
1212 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinError(1);
1213 dVn[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinContent(1);
1214 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinError(1);
1215 dVn[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinContent(1);
1216 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinError(1);
1217 dVn[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinContent(1);
1218 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinError(1);
1219 } else if(type == "RP")
1220 {
1221 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinContent(1);
1222 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinError(1);
1223 dVn[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinContent(1);
1224 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinError(1);
1225 dVn[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinContent(1);
1226 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinError(1);
1227 dVn[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinContent(1);
1228 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinError(1);
1229 } else if(type == "POI")
1230 {
1231 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinContent(1);
1232 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinError(1);
1233 dVn[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinContent(1);
1234 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinError(1);
1235 dVn[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinContent(1);
1236 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinError(1);
1237 dVn[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinContent(1);
1238 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinError(1);
1239 }
1240
1241 TString title = " flow estimates from Q-cumulants";
1242 TString subtitle = " (";
1243
1244 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
1245 {
1246 subtitle.Append(type);
1247 subtitle.Append(", without weights)");
1248 } else
1249 {
1250 subtitle.Append(type);
1251 subtitle.Append(", with weights)");
1252 }
1253
1254 cout<<endl;
1255 cout<<"*************************************"<<endl;
1256 cout<<"*************************************"<<endl;
1257 cout<<title.Data()<<endl;
1258 cout<<subtitle.Data()<<endl;
1259 cout<<endl;
1260
1261 for(Int_t i=0;i<4;i++)
1262 {
1263 if(dVn[i]>=0.)
1264 {
1265 cout<<" v_"<<n<<"{"<<2*(i+1)<<"} = "<<dVn[i]<<" +/- "<<dVnErr[i]<<endl;
1266 }
1267 else
1268 {
1269 cout<<" v_"<<n<<"{"<<2*(i+1)<<"} = Im"<<endl;
1270 }
1271 }
1272
1273 cout<<endl;
1274 /*
1275 if(type == "NONAME")
1276 {
1277 cout<<" nEvts = "<<nEvtsNoName<<", AvM = "<<dMultNoName<<endl; // to be improved
1278 }
1279 else if (type == "RP")
1280 {
1281 cout<<" nEvts = "<<nEvtsRP<<", AvM = "<<dMultRP<<endl; // to be improved
1282 }
1283 else if (type == "POI")
1284 {
1285 cout<<" nEvts = "<<nEvtsPOI<<", AvM = "<<dMultPOI<<endl; // to be improved
1286 }
1287 */
1288 cout<<"*************************************"<<endl;
1289 cout<<"*************************************"<<endl;
1290 cout<<endl;
1291
1292}// end of AliFlowAnalysisWithQCumulants::PrintFinalResultsForIntegratedFlow(TString type="NONAME");
1293
1294
1295//================================================================================================================================
1296
1297
1298void AliFlowAnalysisWithQCumulants::WriteHistograms(TString outputFileName)
1299{
1300 //store the final results in output .root file
1301 TFile *output = new TFile(outputFileName.Data(),"RECREATE");
1302 //output->WriteObject(fHistList, "cobjQC","SingleKey");
1303 fHistList->Write(fHistList->GetName(), TObject::kSingleKey);
1304 delete output;
1305}
1306
1307
1308//================================================================================================================================
1309
1310
1311void AliFlowAnalysisWithQCumulants::WriteHistograms(TDirectoryFile *outputFileName)
1312{
1313 //store the final results in output .root file
1314 fHistList->SetName("cobjQC");
1315 fHistList->SetOwner(kTRUE);
1316 outputFileName->Add(fHistList);
1317 outputFileName->Write(outputFileName->GetName(), TObject::kSingleKey);
1318}
1319
1320
1321//================================================================================================================================
1322
1323
1324void AliFlowAnalysisWithQCumulants::BookCommonHistograms()
1325{
1326 // Book common control histograms and common histograms for final results.
1327 // common control histogram (ALL events)
1328 TString commonHistsName = "AliFlowCommonHistQC";
1329 commonHistsName += fAnalysisLabel->Data();
1330 fCommonHists = new AliFlowCommonHist(commonHistsName.Data());
1331 fHistList->Add(fCommonHists);
1332 // common control histogram (for events with 2 and more particles)
1333 TString commonHists2ndOrderName = "AliFlowCommonHist2ndOrderQC";
1334 commonHists2ndOrderName += fAnalysisLabel->Data();
1335 fCommonHists2nd = new AliFlowCommonHist(commonHists2ndOrderName.Data());
1336 fHistList->Add(fCommonHists2nd);
1337 // common control histogram (for events with 4 and more particles)
1338 TString commonHists4thOrderName = "AliFlowCommonHist4thOrderQC";
1339 commonHists4thOrderName += fAnalysisLabel->Data();
1340 fCommonHists4th = new AliFlowCommonHist(commonHists4thOrderName.Data());
1341 fHistList->Add(fCommonHists4th);
1342 // common control histogram (for events with 6 and more particles)
1343 TString commonHists6thOrderName = "AliFlowCommonHist6thOrderQC";
1344 commonHists6thOrderName += fAnalysisLabel->Data();
1345 fCommonHists6th = new AliFlowCommonHist(commonHists6thOrderName.Data());
1346 fHistList->Add(fCommonHists6th);
1347 // common control histogram (for events with 8 and more particles)
1348 TString commonHists8thOrderName = "AliFlowCommonHist8thOrderQC";
1349 commonHists8thOrderName += fAnalysisLabel->Data();
1350 fCommonHists8th = new AliFlowCommonHist(commonHists8thOrderName.Data());
1351 fHistList->Add(fCommonHists8th);
1352 // common histograms for final results (calculated for events with 2 and more particles)
1353 TString commonHistResults2ndOrderName = "AliFlowCommonHistResults2ndOrderQC";
1354 commonHistResults2ndOrderName += fAnalysisLabel->Data();
1355 fCommonHistsResults2nd = new AliFlowCommonHistResults(commonHistResults2ndOrderName.Data());
1356 fHistList->Add(fCommonHistsResults2nd);
1357 // common histograms for final results (calculated for events with 4 and more particles)
1358 TString commonHistResults4thOrderName = "AliFlowCommonHistResults4thOrderQC";
1359 commonHistResults4thOrderName += fAnalysisLabel->Data();
1360 fCommonHistsResults4th = new AliFlowCommonHistResults(commonHistResults4thOrderName.Data());
1361 fHistList->Add(fCommonHistsResults4th);
1362 // common histograms for final results (calculated for events with 6 and more particles)
1363 TString commonHistResults6thOrderName = "AliFlowCommonHistResults6thOrderQC";
1364 commonHistResults6thOrderName += fAnalysisLabel->Data();
1365 fCommonHistsResults6th = new AliFlowCommonHistResults(commonHistResults6thOrderName.Data());
1366 fHistList->Add(fCommonHistsResults6th);
1367 // common histograms for final results (calculated for events with 8 and more particles)
1368 TString commonHistResults8thOrderName = "AliFlowCommonHistResults8thOrderQC";
1369 commonHistResults8thOrderName += fAnalysisLabel->Data();
1370 fCommonHistsResults8th = new AliFlowCommonHistResults(commonHistResults8thOrderName.Data());
1371 fHistList->Add(fCommonHistsResults8th);
1372
1373} // end of void AliFlowAnalysisWithQCumulants::BookCommonHistograms()
1374
1375
1376//================================================================================================================================
1377
1378
1379void AliFlowAnalysisWithQCumulants::BookAndFillWeightsHistograms()
1380{
1381 // book and fill histograms which hold phi, pt and eta weights
1382
1383 if(!fWeightsList)
1384 {
1385 cout<<"WARNING: fWeightsList is NULL in AFAWQC::BAFWH() !!!!"<<endl;
1386 exit(0);
1387 }
1388
1389 TString fUseParticleWeightsName = "fUseParticleWeightsQC";
1390 fUseParticleWeightsName += fAnalysisLabel->Data();
1391 fUseParticleWeights = new TProfile(fUseParticleWeightsName.Data(),"0 = particle weight not used, 1 = particle weight used ",3,0,3);
1392 fUseParticleWeights->SetLabelSize(0.06);
1393 (fUseParticleWeights->GetXaxis())->SetBinLabel(1,"w_{#phi}");
1394 (fUseParticleWeights->GetXaxis())->SetBinLabel(2,"w_{p_{T}}");
1395 (fUseParticleWeights->GetXaxis())->SetBinLabel(3,"w_{#eta}");
1396 fUseParticleWeights->Fill(0.5,(Int_t)fUsePhiWeights);
1397 fUseParticleWeights->Fill(1.5,(Int_t)fUsePtWeights);
1398 fUseParticleWeights->Fill(2.5,(Int_t)fUseEtaWeights);
1399 fWeightsList->Add(fUseParticleWeights);
1400
1401 if(fUsePhiWeights)
1402 {
1403 if(fWeightsList->FindObject("phi_weights"))
1404 {
1405 fPhiWeights = dynamic_cast<TH1F*>(fWeightsList->FindObject("phi_weights"));
1406 if(TMath::Abs(fPhiWeights->GetBinWidth(1)-fPhiBinWidth)>pow(10.,-6.))
1407 {
1408 cout<<endl;
1409 cout<<"WARNING (QC): Inconsistent binning in histograms for phi-weights throughout the code."<<endl;
1410 cout<<endl;
1411 exit(0);
1412 }
1413 } else
1414 {
1415 cout<<"WARNING: fWeightsList->FindObject(\"phi_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
1416 exit(0);
1417 }
1418 } // end of if(fUsePhiWeights)
1419
1420 if(fUsePtWeights)
1421 {
1422 if(fWeightsList->FindObject("pt_weights"))
1423 {
1424 fPtWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("pt_weights"));
1425 if(TMath::Abs(fPtWeights->GetBinWidth(1)-fPtBinWidth)>pow(10.,-6.))
1426 {
1427 cout<<endl;
1428 cout<<"WARNING (QC): Inconsistent binning in histograms for pt-weights throughout the code."<<endl;
1429 cout<<endl;
1430 exit(0);
1431 }
1432 } else
1433 {
1434 cout<<"WARNING: fWeightsList->FindObject(\"pt_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
1435 exit(0);
1436 }
1437 } // end of if(fUsePtWeights)
1438
1439 if(fUseEtaWeights)
1440 {
1441 if(fWeightsList->FindObject("eta_weights"))
1442 {
1443 fEtaWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("eta_weights"));
1444 if(TMath::Abs(fEtaWeights->GetBinWidth(1)-fEtaBinWidth)>pow(10.,-6.))
1445 {
1446 cout<<endl;
1447 cout<<"WARNING (QC): Inconsistent binning in histograms for eta-weights throughout the code."<<endl;
1448 cout<<endl;
1449 exit(0);
1450 }
1451 } else
1452 {
1453 cout<<"WARNING: fUseEtaWeights && fWeightsList->FindObject(\"eta_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
1454 exit(0);
1455 }
1456 } // end of if(fUseEtaWeights)
1457
1458} // end of AliFlowAnalysisWithQCumulants::BookAndFillWeightsHistograms()
1459
1460
1461//================================================================================================================================
1462
1463
1464void AliFlowAnalysisWithQCumulants::BookEverythingForIntegratedFlow()
1465{
1466 // Book all objects for integrated flow:
1467 // a) Book profile to hold all flags for integrated flow.
1468 // b) Book event-by-event quantities.
1469 // c) Book profiles. // to be improved (comment)
1470 // d) Book histograms holding the final results.
1471
1472 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)
1473 TString powerFlag[2] = {"linear","quadratic"}; // to be improved (should I promote this to data members?)
1474
1475 // a) Book profile to hold all flags for integrated flow:
1476 TString intFlowFlagsName = "fIntFlowFlags";
1477 intFlowFlagsName += fAnalysisLabel->Data();
1478 fIntFlowFlags = new TProfile(intFlowFlagsName.Data(),"Flags for Integrated Flow",6,0,6);
1479 fIntFlowFlags->SetTickLength(-0.01,"Y");
1480 fIntFlowFlags->SetMarkerStyle(25);
1481 fIntFlowFlags->SetLabelSize(0.05);
1482 fIntFlowFlags->SetLabelOffset(0.02,"Y");
1483 fIntFlowFlags->GetXaxis()->SetBinLabel(1,"Particle Weights");
1484 fIntFlowFlags->GetXaxis()->SetBinLabel(2,"Event Weights");
1485 fIntFlowFlags->GetXaxis()->SetBinLabel(3,"Corrected for NUA?");
1486 fIntFlowFlags->GetXaxis()->SetBinLabel(4,"Print NONAME results");
1487 fIntFlowFlags->GetXaxis()->SetBinLabel(5,"Print RP results");
3b552efe 1488 fIntFlowFlags->GetXaxis()->SetBinLabel(6,"Print POI results");
489d5531 1489 fIntFlowList->Add(fIntFlowFlags);
1490
1491 // b) Book event-by-event quantities:
1492 // Re[Q_{m*n,k}], Im[Q_{m*n,k}] and S_{p,k}^M:
1493 fReQ = new TMatrixD(4,9);
1494 fImQ = new TMatrixD(4,9);
1495 fSMpk = new TMatrixD(8,9);
1496 // average correlations <2>, <4>, <6> and <8> for single event (bining is the same as in fIntFlowCorrelationsPro and fIntFlowCorrelationsHist):
1497 TString intFlowCorrelationsEBEName = "fIntFlowCorrelationsEBE";
1498 intFlowCorrelationsEBEName += fAnalysisLabel->Data();
1499 fIntFlowCorrelationsEBE = new TH1D(intFlowCorrelationsEBEName.Data(),intFlowCorrelationsEBEName.Data(),4,0,4);
1500 // weights for average correlations <2>, <4>, <6> and <8> for single event:
1501 TString intFlowEventWeightsForCorrelationsEBEName = "fIntFlowEventWeightsForCorrelationsEBE";
1502 intFlowEventWeightsForCorrelationsEBEName += fAnalysisLabel->Data();
1503 fIntFlowEventWeightsForCorrelationsEBE = new TH1D(intFlowEventWeightsForCorrelationsEBEName.Data(),intFlowEventWeightsForCorrelationsEBEName.Data(),4,0,4);
1504 // average all correlations for single event (bining is the same as in fIntFlowCorrelationsAllPro and fIntFlowCorrelationsAllHist):
1505 TString intFlowCorrelationsAllEBEName = "fIntFlowCorrelationsAllEBE";
1506 intFlowCorrelationsAllEBEName += fAnalysisLabel->Data();
1507 fIntFlowCorrelationsAllEBE = new TH1D(intFlowCorrelationsAllEBEName.Data(),intFlowCorrelationsAllEBEName.Data(),32,0,32);
1508 // average correction terms for non-uniform acceptance for single event
1509 // (binning is the same as in fIntFlowCorrectionTermsForNUAPro[2] and fIntFlowCorrectionTermsForNUAHist[2]):
1510 TString fIntFlowCorrectionTermsForNUAEBEName = "fIntFlowCorrectionTermsForNUAEBE";
1511 fIntFlowCorrectionTermsForNUAEBEName += fAnalysisLabel->Data();
1512 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1513 {
1514 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);
1515 }
0328db2d 1516 // event weights for terms for non-uniform acceptance:
1517 TString fIntFlowEventWeightForCorrectionTermsForNUAEBEName = "fIntFlowEventWeightForCorrectionTermsForNUAEBE";
1518 fIntFlowEventWeightForCorrectionTermsForNUAEBEName += fAnalysisLabel->Data();
1519 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1520 {
1521 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);
1522 }
489d5531 1523 // c) Book profiles: // to be improved (comment)
1524 // profile to hold average multiplicities and number of events for events with nRP>=0, nRP>=1, ... , and nRP>=8:
1525 TString avMultiplicityName = "fAvMultiplicity";
1526 avMultiplicityName += fAnalysisLabel->Data();
1527 fAvMultiplicity = new TProfile(avMultiplicityName.Data(),"Average Multiplicities of RPs",9,0,9);
1528 fAvMultiplicity->SetTickLength(-0.01,"Y");
1529 fAvMultiplicity->SetMarkerStyle(25);
1530 fAvMultiplicity->SetLabelSize(0.05);
1531 fAvMultiplicity->SetLabelOffset(0.02,"Y");
1532 fAvMultiplicity->SetYTitle("Average Multiplicity");
1533 (fAvMultiplicity->GetXaxis())->SetBinLabel(1,"all evts");
1534 (fAvMultiplicity->GetXaxis())->SetBinLabel(2,"n_{RP} #geq 1");
1535 (fAvMultiplicity->GetXaxis())->SetBinLabel(3,"n_{RP} #geq 2");
1536 (fAvMultiplicity->GetXaxis())->SetBinLabel(4,"n_{RP} #geq 3");
1537 (fAvMultiplicity->GetXaxis())->SetBinLabel(5,"n_{RP} #geq 4");
1538 (fAvMultiplicity->GetXaxis())->SetBinLabel(6,"n_{RP} #geq 5");
1539 (fAvMultiplicity->GetXaxis())->SetBinLabel(7,"n_{RP} #geq 6");
1540 (fAvMultiplicity->GetXaxis())->SetBinLabel(8,"n_{RP} #geq 7");
1541 (fAvMultiplicity->GetXaxis())->SetBinLabel(9,"n_{RP} #geq 8");
1542 fIntFlowProfiles->Add(fAvMultiplicity);
1543 // average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with wrong errors!):
1544 TString intFlowCorrelationsProName = "fIntFlowCorrelationsPro";
1545 intFlowCorrelationsProName += fAnalysisLabel->Data();
1546 fIntFlowCorrelationsPro = new TProfile(intFlowCorrelationsProName.Data(),"Average correlations for all events",4,0,4,"s");
1547 fIntFlowCorrelationsPro->SetTickLength(-0.01,"Y");
1548 fIntFlowCorrelationsPro->SetMarkerStyle(25);
1549 fIntFlowCorrelationsPro->SetLabelSize(0.06);
1550 fIntFlowCorrelationsPro->SetLabelOffset(0.01,"Y");
1551 (fIntFlowCorrelationsPro->GetXaxis())->SetBinLabel(1,"<<2>>");
1552 (fIntFlowCorrelationsPro->GetXaxis())->SetBinLabel(2,"<<4>>");
1553 (fIntFlowCorrelationsPro->GetXaxis())->SetBinLabel(3,"<<6>>");
1554 (fIntFlowCorrelationsPro->GetXaxis())->SetBinLabel(4,"<<8>>");
1555 fIntFlowProfiles->Add(fIntFlowCorrelationsPro);
ff70ca91 1556 // average correlations <<2>>, <<4>>, <<6>> and <<8>> versus multiplicity for all events (error is biased estimator):
1557 TString correlationFlag[4] = {"<<2>>","<<4>>","<<6>>","<<8>>"};
ff70ca91 1558 for(Int_t ci=0;ci<4;ci++) // correlation index
1559 {
1560 TString intFlowCorrelationsVsMProName = "fIntFlowCorrelationsVsMPro";
1561 intFlowCorrelationsVsMProName += fAnalysisLabel->Data();
1562 fIntFlowCorrelationsVsMPro[ci] = new TProfile(Form("%s, %s",intFlowCorrelationsVsMProName.Data(),correlationFlag[ci].Data()),
1563 Form("%s vs multiplicity",correlationFlag[ci].Data()),
9da1a4f3 1564 fnBinsMult,fMinMult,fMaxMult,"s");
ff70ca91 1565 fIntFlowCorrelationsVsMPro[ci]->GetYaxis()->SetTitle(correlationFlag[ci].Data());
1566 fIntFlowCorrelationsVsMPro[ci]->GetXaxis()->SetTitle("M");
1567 fIntFlowProfiles->Add(fIntFlowCorrelationsVsMPro[ci]);
1568 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
489d5531 1569 // averaged all correlations for all events (with wrong errors!):
1570 TString intFlowCorrelationsAllProName = "fIntFlowCorrelationsAllPro";
1571 intFlowCorrelationsAllProName += fAnalysisLabel->Data();
1572 fIntFlowCorrelationsAllPro = new TProfile(intFlowCorrelationsAllProName.Data(),"Average correlations for all events",32,0,32,"s");
1573 fIntFlowCorrelationsAllPro->SetTickLength(-0.01,"Y");
1574 fIntFlowCorrelationsAllPro->SetMarkerStyle(25);
1575 fIntFlowCorrelationsAllPro->SetLabelSize(0.03);
1576 fIntFlowCorrelationsAllPro->SetLabelOffset(0.01,"Y");
1577 // 2-p correlations:
1578 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(1,"<<2>>_{n|n}");
1579 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(2,"<<2>>_{2n|2n}");
1580 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(3,"<<2>>_{3n|3n}");
1581 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(4,"<<2>>_{4n|4n}");
1582 // 3-p correlations:
1583 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(6,"<<3>>_{2n|n,n}");
1584 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(7,"<<3>>_{3n|2n,n}");
1585 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(8,"<<3>>_{4n|2n,2n}");
1586 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(9,"<<3>>_{4n|3n,n}");
1587 // 4-p correlations:
1588 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(11,"<<4>>_{n,n|n,n}");
1589 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(12,"<<4>>_{2n,n|2n,n}");
1590 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(13,"<<4>>_{2n,2n|2n,2n}");
1591 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(14,"<<4>>_{3n|n,n,n}");
1592 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(15,"<<4>>_{3n,n|3n,n}");
1593 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(16,"<<4>>_{3n,n|2n,2n}");
1594 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(17,"<<4>>_{4n|2n,n,n}");
1595 // 5-p correlations:
1596 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(19,"<<5>>_{2n|n,n,n,n}");
1597 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(20,"<<5>>_{2n,2n|2n,n,n}");
1598 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(21,"<<5>>_{3n,n|2n,n,n}");
1599 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(22,"<<5>>_{4n|n,n,n,n}");
1600 // 6-p correlations:
1601 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(24,"<<6>>_{n,n,n|n,n,n}");
1602 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(25,"<<6>>_{2n,n,n|2n,n,n}");
1603 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(26,"<<6>>_{2n,2n|n,n,n,n}");
1604 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(27,"<<6>>_{3n,n|n,n,n,n}");
1605 // 7-p correlations:
1606 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(29,"<<7>>_{2n,n,n|n,n,n,n}");
1607 // 8-p correlations:
1608 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(31,"<<8>>_{n,n,n,n|n,n,n,n}");
1609 fIntFlowProfiles->Add(fIntFlowCorrelationsAllPro);
1610 // when particle weights are used some extra correlations appear:
1611 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
1612 {
1613 TString intFlowExtraCorrelationsProName = "fIntFlowExtraCorrelationsPro";
1614 intFlowExtraCorrelationsProName += fAnalysisLabel->Data();
1615 fIntFlowExtraCorrelationsPro = new TProfile(intFlowExtraCorrelationsProName.Data(),"Average extra correlations for all events",100,0,100,"s");
1616 fIntFlowExtraCorrelationsPro->SetTickLength(-0.01,"Y");
1617 fIntFlowExtraCorrelationsPro->SetMarkerStyle(25);
1618 fIntFlowExtraCorrelationsPro->SetLabelSize(0.03);
1619 fIntFlowExtraCorrelationsPro->SetLabelOffset(0.01,"Y");
1620 // extra 2-p correlations:
1621 (fIntFlowExtraCorrelationsPro->GetXaxis())->SetBinLabel(1,"<<w1^3 w2 cos(n*(phi1-phi2))>>");
1622 (fIntFlowExtraCorrelationsPro->GetXaxis())->SetBinLabel(2,"<<w1 w2 w3^2 cos(n*(phi1-phi2))>>");
1623 fIntFlowProfiles->Add(fIntFlowExtraCorrelationsPro);
1624 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
1625 // average product of correlations <2>, <4>, <6> and <8>:
1626 TString intFlowProductOfCorrelationsProName = "fIntFlowProductOfCorrelationsPro";
1627 intFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
1628 fIntFlowProductOfCorrelationsPro = new TProfile(intFlowProductOfCorrelationsProName.Data(),"Average products of correlations",6,0,6);
1629 fIntFlowProductOfCorrelationsPro->SetTickLength(-0.01,"Y");
1630 fIntFlowProductOfCorrelationsPro->SetMarkerStyle(25);
1631 fIntFlowProductOfCorrelationsPro->SetLabelSize(0.05);
1632 fIntFlowProductOfCorrelationsPro->SetLabelOffset(0.01,"Y");
1633 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(1,"<<2><4>>");
1634 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(2,"<<2><6>>");
1635 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(3,"<<2><8>>");
1636 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(4,"<<4><6>>");
1637 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(5,"<<4><8>>");
1638 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(6,"<<6><8>>");
1639 fIntFlowProfiles->Add(fIntFlowProductOfCorrelationsPro);
ff70ca91 1640 // average product of correlations <2>, <4>, <6> and <8> versus multiplicity
1641 // [0=<<2><4>>,1=<<2><6>>,2=<<2><8>>,3=<<4><6>>,4=<<4><8>>,5=<<6><8>>]
1642 TString intFlowProductOfCorrelationsVsMProName = "fIntFlowProductOfCorrelationsVsMPro";
1643 intFlowProductOfCorrelationsVsMProName += fAnalysisLabel->Data();
1644 TString productFlag[6] = {"<<2><4>>","<<2><6>>","<<2><8>>","<<4><6>>","<<4><8>>","<<6><8>>"};
1645 for(Int_t pi=0;pi<6;pi++)
1646 {
1647 fIntFlowProductOfCorrelationsVsMPro[pi] = new TProfile(Form("%s, %s",intFlowProductOfCorrelationsVsMProName.Data(),productFlag[pi].Data()),
1648 Form("%s versus multiplicity",productFlag[pi].Data()),
9da1a4f3 1649 fnBinsMult,fMinMult,fMaxMult);
ff70ca91 1650 fIntFlowProductOfCorrelationsVsMPro[pi]->GetXaxis()->SetTitle("M");
1651 fIntFlowProfiles->Add(fIntFlowProductOfCorrelationsVsMPro[pi]);
1652 } // end of for(Int_t pi=0;pi<6;pi++)
0328db2d 1653 // average product of correction terms for NUA:
1654 TString intFlowProductOfCorrectionTermsForNUAProName = "fIntFlowProductOfCorrectionTermsForNUAPro";
1655 intFlowProductOfCorrectionTermsForNUAProName += fAnalysisLabel->Data();
1656 fIntFlowProductOfCorrectionTermsForNUAPro = new TProfile(intFlowProductOfCorrectionTermsForNUAProName.Data(),"Average products of correction terms for NUA",27,0,27);
1657 fIntFlowProductOfCorrectionTermsForNUAPro->SetTickLength(-0.01,"Y");
1658 fIntFlowProductOfCorrectionTermsForNUAPro->SetMarkerStyle(25);
1659 fIntFlowProductOfCorrectionTermsForNUAPro->SetLabelSize(0.05);
1660 fIntFlowProductOfCorrectionTermsForNUAPro->SetLabelOffset(0.01,"Y");
1661 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(1,"<<2><cos(#phi)>>");
1662 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(2,"<<2><sin(#phi)>>");
1663 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(3,"<<cos(#phi)><sin(#phi)>>");
1664 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(4,"Cov(<2>,<cos(#phi_{1}+#phi_{2})>)");
1665 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(5,"Cov(<2>,<sin(#phi_{1}+#phi_{2})>)");
1666 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(6,"Cov(<2>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1667 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(7,"Cov(<2>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1668 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(8,"Cov(<4>,<cos(#phi)>)");
1669 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(9,"Cov(<4>,<sin(#phi)>)");
1670 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(10,"Cov(<4>,<cos(#phi_{1}+#phi_{2})>)");
1671 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(11,"Cov(<4>,<sin(#phi_{1}+#phi_{2})>)");
1672 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(12,"Cov(<4>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>>)");
1673 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(13,"Cov(<4>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>>)");
1674 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(14,"Cov(<cos(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
1675 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(15,"Cov(<cos(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
1676 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(16,"Cov(<cos(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1677 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(17,"Cov(<cos(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1678 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(18,"Cov(<sin(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
1679 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(19,"Cov(<sin(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
1680 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(20,"Cov(<sin(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1681 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(21,"Cov(<sin(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1682 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(22,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}+#phi_{2})>)");
1683 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(23,"Cov(<cos(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1684 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(24,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1685 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(25,"Cov(<sin(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1686 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(26,"Cov(<sin(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1687 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(27,"Cov(<cos(#phi_{1}-#phi_{2}-#phi_{3}>,<sin(#phi_{1}-#phi_{2}-#phi_{3}>)");
1688 fIntFlowProfiles->Add(fIntFlowProductOfCorrectionTermsForNUAPro);
489d5531 1689 // average correction terms for non-uniform acceptance (with wrong errors!):
1690 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1691 {
1692 TString intFlowCorrectionTermsForNUAProName = "fIntFlowCorrectionTermsForNUAPro";
1693 intFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
1694 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");
1695 fIntFlowCorrectionTermsForNUAPro[sc]->SetTickLength(-0.01,"Y");
1696 fIntFlowCorrectionTermsForNUAPro[sc]->SetMarkerStyle(25);
1697 fIntFlowCorrectionTermsForNUAPro[sc]->SetLabelSize(0.03);
1698 fIntFlowCorrectionTermsForNUAPro[sc]->SetLabelOffset(0.01,"Y");
1699 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(1,Form("<<%s(n(phi1))>>",sinCosFlag[sc].Data()));
1700 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(2,Form("<<%s(n(phi1+phi2))>>",sinCosFlag[sc].Data()));
1701 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(3,Form("<<%s(n(phi1-phi2-phi3))>>",sinCosFlag[sc].Data()));
1702 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(4,Form("<<%s(n(2phi1-phi2))>>",sinCosFlag[sc].Data()));
1703 fIntFlowProfiles->Add(fIntFlowCorrectionTermsForNUAPro[sc]);
1704 } // end of for(Int_t sc=0;sc<2;sc++)
1705
1706 // d) Book histograms holding the final results:
1707 // average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with correct errors!):
1708 TString intFlowCorrelationsHistName = "fIntFlowCorrelationsHist";
1709 intFlowCorrelationsHistName += fAnalysisLabel->Data();
1710 fIntFlowCorrelationsHist = new TH1D(intFlowCorrelationsHistName.Data(),"Average correlations for all events",4,0,4);
1711 fIntFlowCorrelationsHist->SetTickLength(-0.01,"Y");
1712 fIntFlowCorrelationsHist->SetMarkerStyle(25);
1713 fIntFlowCorrelationsHist->SetLabelSize(0.06);
1714 fIntFlowCorrelationsHist->SetLabelOffset(0.01,"Y");
1715 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(1,"<<2>>");
1716 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(2,"<<4>>");
1717 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(3,"<<6>>");
1718 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(4,"<<8>>");
1719 fIntFlowResults->Add(fIntFlowCorrelationsHist);
ff70ca91 1720 // average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with correct errors!) vs M:
1721 for(Int_t ci=0;ci<4;ci++) // correlation index
1722 {
1723 TString intFlowCorrelationsVsMHistName = "fIntFlowCorrelationsVsMHist";
1724 intFlowCorrelationsVsMHistName += fAnalysisLabel->Data();
1725 fIntFlowCorrelationsVsMHist[ci] = new TH1D(Form("%s, %s",intFlowCorrelationsVsMHistName.Data(),correlationFlag[ci].Data()),
1726 Form("%s vs multiplicity",correlationFlag[ci].Data()),
9da1a4f3 1727 fnBinsMult,fMinMult,fMaxMult);
ff70ca91 1728 fIntFlowCorrelationsVsMHist[ci]->GetYaxis()->SetTitle(correlationFlag[ci].Data());
1729 fIntFlowCorrelationsVsMHist[ci]->GetXaxis()->SetTitle("M");
1730 fIntFlowResults->Add(fIntFlowCorrelationsVsMHist[ci]);
1731 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
489d5531 1732 // average all correlations for all events (with correct errors!):
1733 TString intFlowCorrelationsAllHistName = "fIntFlowCorrelationsAllHist";
1734 intFlowCorrelationsAllHistName += fAnalysisLabel->Data();
1735 fIntFlowCorrelationsAllHist = new TH1D(intFlowCorrelationsAllHistName.Data(),"Average correlations for all events",32,0,32);
1736 fIntFlowCorrelationsAllHist->SetTickLength(-0.01,"Y");
1737 fIntFlowCorrelationsAllHist->SetMarkerStyle(25);
1738 fIntFlowCorrelationsAllHist->SetLabelSize(0.03);
1739 fIntFlowCorrelationsAllHist->SetLabelOffset(0.01,"Y");
1740 // 2-p correlations:
1741 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(1,"<<2>>_{n|n}");
1742 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(2,"<<2>>_{2n|2n}");
1743 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(3,"<<2>>_{3n|3n}");
1744 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(4,"<<2>>_{4n|4n}");
1745 // 3-p correlations:
1746 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(6,"<<3>>_{2n|n,n}");
1747 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(7,"<<3>>_{3n|2n,n}");
1748 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(8,"<<3>>_{4n|2n,2n}");
1749 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(9,"<<3>>_{4n|3n,n}");
1750 // 4-p correlations:
1751 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(11,"<<4>>_{n,n|n,n}");
1752 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(12,"<<4>>_{2n,n|2n,n}");
1753 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(13,"<<4>>_{2n,2n|2n,2n}");
1754 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(14,"<<4>>_{3n|n,n,n}");
1755 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(15,"<<4>>_{3n,n|3n,n}");
1756 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(16,"<<4>>_{3n,n|2n,2n}");
1757 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(17,"<<4>>_{4n|2n,n,n}");
1758 // 5-p correlations:
1759 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(19,"<<5>>_{2n|n,n,n,n}");
1760 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(20,"<<5>>_{2n,2n|2n,n,n}");
1761 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(21,"<<5>>_{3n,n|2n,n,n}");
1762 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(22,"<<5>>_{4n|n,n,n,n}");
1763 // 6-p correlations:
1764 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(24,"<<6>>_{n,n,n|n,n,n}");
1765 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(25,"<<6>>_{2n,n,n|2n,n,n}");
1766 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(26,"<<6>>_{2n,2n|n,n,n,n}");
1767 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(27,"<<6>>_{3n,n|n,n,n,n}");
1768 // 7-p correlations:
1769 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(29,"<<7>>_{2n,n,n|n,n,n,n}");
1770 // 8-p correlations:
1771 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(31,"<<8>>_{n,n,n,n|n,n,n,n}");
1772 fIntFlowResults->Add(fIntFlowCorrelationsAllHist);
1773 // average correction terms for non-uniform acceptance (with correct errors!):
1774 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1775 {
1776 TString intFlowCorrectionTermsForNUAHistName = "fIntFlowCorrectionTermsForNUAHist";
1777 intFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
1778 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);
1779 fIntFlowCorrectionTermsForNUAHist[sc]->SetTickLength(-0.01,"Y");
1780 fIntFlowCorrectionTermsForNUAHist[sc]->SetMarkerStyle(25);
1781 fIntFlowCorrectionTermsForNUAHist[sc]->SetLabelSize(0.03);
1782 fIntFlowCorrectionTermsForNUAHist[sc]->SetLabelOffset(0.01,"Y");
1783 // .........................................................................
1784 // 1-p terms:
1785 (fIntFlowCorrectionTermsForNUAHist[sc]->GetXaxis())->SetBinLabel(1,Form("%s(n(#phi_{1}))>",sinCosFlag[sc].Data()));
1786 // 2-p terms:
1787 // 3-p terms:
1788 // ...
1789 // .........................................................................
1790 fIntFlowResults->Add(fIntFlowCorrectionTermsForNUAHist[sc]);
1791 } // end of for(Int_t sc=0;sc<2;sc++)
1792 // covariances (multiplied with weight dependent prefactor):
1793 TString intFlowCovariancesName = "fIntFlowCovariances";
1794 intFlowCovariancesName += fAnalysisLabel->Data();
1795 fIntFlowCovariances = new TH1D(intFlowCovariancesName.Data(),"Covariances (multiplied with weight dependent prefactor)",6,0,6);
1796 fIntFlowCovariances->SetLabelSize(0.04);
1797 fIntFlowCovariances->SetMarkerStyle(25);
1798 (fIntFlowCovariances->GetXaxis())->SetBinLabel(1,"Cov(<2>,<4>)");
1799 (fIntFlowCovariances->GetXaxis())->SetBinLabel(2,"Cov(<2>,<6>)");
1800 (fIntFlowCovariances->GetXaxis())->SetBinLabel(3,"Cov(<2>,<8>)");
1801 (fIntFlowCovariances->GetXaxis())->SetBinLabel(4,"Cov(<4>,<6>)");
1802 (fIntFlowCovariances->GetXaxis())->SetBinLabel(5,"Cov(<4>,<8>)");
1803 (fIntFlowCovariances->GetXaxis())->SetBinLabel(6,"Cov(<6>,<8>)");
1804 fIntFlowResults->Add(fIntFlowCovariances);
1805 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8>:
1806 TString intFlowSumOfEventWeightsName = "fIntFlowSumOfEventWeights";
1807 intFlowSumOfEventWeightsName += fAnalysisLabel->Data();
1808 for(Int_t power=0;power<2;power++)
1809 {
1810 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);
1811 fIntFlowSumOfEventWeights[power]->SetLabelSize(0.05);
1812 fIntFlowSumOfEventWeights[power]->SetMarkerStyle(25);
1813 if(power == 0)
1814 {
1815 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>}");
1816 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<4>}");
1817 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<6>}");
1818 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<8>}");
1819 } else if (power == 1)
1820 {
1821 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>}^{2}");
1822 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<4>}^{2}");
1823 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<6>}^{2}");
1824 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<8>}^{2}");
1825 }
1826 fIntFlowResults->Add(fIntFlowSumOfEventWeights[power]);
1827 }
1828 // sum of products of event weights for correlations <2>, <4>, <6> and <8>:
1829 TString intFlowSumOfProductOfEventWeightsName = "fIntFlowSumOfProductOfEventWeights";
1830 intFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
1831 fIntFlowSumOfProductOfEventWeights = new TH1D(intFlowSumOfProductOfEventWeightsName.Data(),"Sum of product of event weights for correlations",6,0,6);
1832 fIntFlowSumOfProductOfEventWeights->SetLabelSize(0.05);
1833 fIntFlowSumOfProductOfEventWeights->SetMarkerStyle(25);
1834 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>} w_{<4>}");
1835 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<2>} w_{<6>}");
1836 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<2>} w_{<8>}");
1837 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<4>} w_{<6>}");
1838 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(5,"#sum_{i=1}^{N} w_{<4>} w_{<8>}");
1839 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(6,"#sum_{i=1}^{N} w_{<6>} w_{<8>}");
1840 fIntFlowResults->Add(fIntFlowSumOfProductOfEventWeights);
ff70ca91 1841 // final result for covariances of correlations (multiplied with weight dependent prefactor) versus M
1842 // [0=Cov(2,4),1=Cov(2,6),2=Cov(2,8),3=Cov(4,6),4=Cov(4,8),5=Cov(6,8)]:
1843 TString intFlowCovariancesVsMName = "fIntFlowCovariancesVsM";
1844 intFlowCovariancesVsMName += fAnalysisLabel->Data();
1845 TString covarianceFlag[6] = {"Cov(<2>,<4>)","Cov(<2>,<6>)","Cov(<2>,<8>)","Cov(<4>,<6>)","Cov(<4>,<8>)","Cov(<6>,<8>)"};
1846 for(Int_t ci=0;ci<6;ci++)
1847 {
1848 fIntFlowCovariancesVsM[ci] = new TH1D(Form("%s, %s",intFlowCovariancesVsMName.Data(),covarianceFlag[ci].Data()),
1849 Form("%s vs multiplicity",covarianceFlag[ci].Data()),
9da1a4f3 1850 fnBinsMult,fMinMult,fMaxMult);
ff70ca91 1851 fIntFlowCovariancesVsM[ci]->GetYaxis()->SetTitle(covarianceFlag[ci].Data());
1852 fIntFlowCovariancesVsM[ci]->GetXaxis()->SetTitle("M");
1853 fIntFlowResults->Add(fIntFlowCovariancesVsM[ci]);
1854 }
1855 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8> versus multiplicity
1856 // [0=sum{w_{<2>}},1=sum{w_{<4>}},2=sum{w_{<6>}},3=sum{w_{<8>}}][0=linear 1,1=quadratic]:
1857 TString intFlowSumOfEventWeightsVsMName = "fIntFlowSumOfEventWeightsVsM";
1858 intFlowSumOfEventWeightsVsMName += fAnalysisLabel->Data();
1859 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>}"},
1860 {"#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}"}};
1861 for(Int_t si=0;si<4;si++)
1862 {
1863 for(Int_t power=0;power<2;power++)
1864 {
1865 fIntFlowSumOfEventWeightsVsM[si][power] = new TH1D(Form("%s, %s",intFlowSumOfEventWeightsVsMName.Data(),sumFlag[power][si].Data()),
1866 Form("%s vs multiplicity",sumFlag[power][si].Data()),
9da1a4f3 1867 fnBinsMult,fMinMult,fMaxMult);
ff70ca91 1868 fIntFlowSumOfEventWeightsVsM[si][power]->GetYaxis()->SetTitle(sumFlag[power][si].Data());
1869 fIntFlowSumOfEventWeightsVsM[si][power]->GetXaxis()->SetTitle("M");
1870 fIntFlowResults->Add(fIntFlowSumOfEventWeightsVsM[si][power]);
1871 } // end of for(Int_t power=0;power<2;power++)
1872 } // end of for(Int_t si=0;si<4;si++)
1873 // sum of products of event weights for correlations <2>, <4>, <6> and <8> vs M
1874 // [0=sum{w_{<2>}w_{<4>}},1=sum{w_{<2>}w_{<6>}},2=sum{w_{<2>}w_{<8>}},
1875 // 3=sum{w_{<4>}w_{<6>}},4=sum{w_{<4>}w_{<8>}},5=sum{w_{<6>}w_{<8>}}]:
1876 TString intFlowSumOfProductOfEventWeightsVsMName = "fIntFlowSumOfProductOfEventWeightsVsM";
1877 intFlowSumOfProductOfEventWeightsVsMName += fAnalysisLabel->Data();
1878 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>}",
1879 "#sum_{i=1}^{N} w_{<4>} w_{<6>}","#sum_{i=1}^{N} w_{<4>} w_{<8>}","#sum_{i=1}^{N} w_{<6>} w_{<8>}"};
1880 for(Int_t pi=0;pi<6;pi++)
1881 {
1882 fIntFlowSumOfProductOfEventWeightsVsM[pi] = new TH1D(Form("%s, %s",intFlowSumOfProductOfEventWeightsVsMName.Data(),sopowFlag[pi].Data()),
1883 Form("%s versus multiplicity",sopowFlag[pi].Data()),
9da1a4f3 1884 fnBinsMult,fMinMult,fMaxMult);
ff70ca91 1885 fIntFlowSumOfProductOfEventWeightsVsM[pi]->GetXaxis()->SetTitle("M");
1886 fIntFlowSumOfProductOfEventWeightsVsM[pi]->GetYaxis()->SetTitle(sopowFlag[pi].Data());
1887 fIntFlowResults->Add(fIntFlowSumOfProductOfEventWeightsVsM[pi]);
1888 } // end of for(Int_t pi=0;pi<6;pi++)
0328db2d 1889 // covariances of NUA terms (multiplied with weight dependent prefactor):
1890 TString intFlowCovariancesNUAName = "fIntFlowCovariancesNUA";
1891 intFlowCovariancesNUAName += fAnalysisLabel->Data();
1892 fIntFlowCovariancesNUA = new TH1D(intFlowCovariancesNUAName.Data(),"Covariances for NUA (multiplied with weight dependent prefactor)",27,0,27);
1893 fIntFlowCovariancesNUA->SetLabelSize(0.04);
1894 fIntFlowCovariancesNUA->SetMarkerStyle(25);
1895 fIntFlowCovariancesNUA->GetXaxis()->SetLabelSize(0.02);
1896 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(1,"Cov(<2>,<cos(#phi)>");
1897 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(2,"Cov(<2>,<sin(#phi)>)");
1898 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(3,"Cov(<cos(#phi)>,<sin(#phi)>)");
1899 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(4,"Cov(<2>,<cos(#phi_{1}+#phi_{2})>)");
1900 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(5,"Cov(<2>,<sin(#phi_{1}+#phi_{2})>)");
1901 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(6,"Cov(<2>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1902 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(7,"Cov(<2>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1903 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(8,"Cov(<4>,<cos(#phi)>)");
1904 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(9,"Cov(<4>,<sin(#phi)>)");
1905 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(10,"Cov(<4>,<cos(#phi_{1}+#phi_{2})>)");
1906 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(11,"Cov(<4>,<sin(#phi_{1}+#phi_{2})>)");
1907 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(12,"Cov(<4>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>>)");
1908 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(13,"Cov(<4>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>>)");
1909 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(14,"Cov(<cos(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
1910 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(15,"Cov(<cos(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
1911 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(16,"Cov(<cos(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1912 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(17,"Cov(<cos(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1913 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(18,"Cov(<sin(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
1914 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(19,"Cov(<sin(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
1915 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(20,"Cov(<sin(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1916 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(21,"Cov(<sin(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1917 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(22,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}+#phi_{2})>)");
1918 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(23,"Cov(<cos(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1919 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(24,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1920 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(25,"Cov(<sin(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1921 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(26,"Cov(<sin(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1922 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(27,"Cov(<cos(#phi_{1}-#phi_{2}-#phi_{3}>,<sin(#phi_{1}-#phi_{2}-#phi_{3}>)");
1923 fIntFlowResults->Add(fIntFlowCovariancesNUA);
1924 // sum of linear and quadratic event weights for NUA terms:
1925 TString intFlowSumOfEventWeightsNUAName = "fIntFlowSumOfEventWeightsNUA";
1926 intFlowSumOfEventWeightsNUAName += fAnalysisLabel->Data();
1927 for(Int_t sc=0;sc<2;sc++)
1928 {
1929 for(Int_t power=0;power<2;power++)
1930 {
1931 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);
1932 fIntFlowSumOfEventWeightsNUA[sc][power]->SetLabelSize(0.05);
1933 fIntFlowSumOfEventWeightsNUA[sc][power]->SetMarkerStyle(25);
1934 if(power == 0)
1935 {
1936 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(1,Form("#sum_{i=1}^{N} w_{<%s(#phi)>}",sinCosFlag[sc].Data()));
1937 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(2,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}+#phi_{2})>}",sinCosFlag[sc].Data()));
1938 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(3,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}-#phi_{2}-#phi_{3})>}",sinCosFlag[sc].Data()));
1939 } else if(power == 1)
1940 {
1941 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(1,Form("#sum_{i=1}^{N} w_{<%s(#phi)>}^{2}",sinCosFlag[sc].Data()));
1942 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(2,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}+#phi_{2})>}^{2}",sinCosFlag[sc].Data()));
1943 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(3,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}-#phi_{2}-#phi_{3})>}^{2}",sinCosFlag[sc].Data()));
1944 }
1945 fIntFlowResults->Add(fIntFlowSumOfEventWeightsNUA[sc][power]);
1946 }
1947 }
1948 // sum of products of event weights for NUA terms:
1949 TString intFlowSumOfProductOfEventWeightsNUAName = "fIntFlowSumOfProductOfEventWeightsNUA";
1950 intFlowSumOfProductOfEventWeightsNUAName += fAnalysisLabel->Data();
1951 fIntFlowSumOfProductOfEventWeightsNUA = new TH1D(intFlowSumOfProductOfEventWeightsNUAName.Data(),"Sum of product of event weights for NUA terms",27,0,27);
1952 fIntFlowSumOfProductOfEventWeightsNUA->SetLabelSize(0.05);
1953 fIntFlowSumOfProductOfEventWeightsNUA->SetMarkerStyle(25);
1954 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>} w_{<cos(#phi)>}");
1955 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<2>} w_{<sin(#phi)>}");
1956 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<cos(#phi)>} w_{<sin(#phi)>}");
1957 // ....
1958 // to be improved - add labels for remaining bins
1959 // ....
1960 fIntFlowResults->Add(fIntFlowSumOfProductOfEventWeightsNUA);
489d5531 1961 // final results for integrated Q-cumulants:
1962 TString intFlowQcumulantsName = "fIntFlowQcumulants";
1963 intFlowQcumulantsName += fAnalysisLabel->Data();
1964 fIntFlowQcumulants = new TH1D(intFlowQcumulantsName.Data(),"Integrated Q-cumulants",4,0,4);
1965 fIntFlowQcumulants->SetLabelSize(0.05);
1966 fIntFlowQcumulants->SetMarkerStyle(25);
1967 (fIntFlowQcumulants->GetXaxis())->SetBinLabel(1,"QC{2}");
1968 (fIntFlowQcumulants->GetXaxis())->SetBinLabel(2,"QC{4}");
1969 (fIntFlowQcumulants->GetXaxis())->SetBinLabel(3,"QC{6}");
1970 (fIntFlowQcumulants->GetXaxis())->SetBinLabel(4,"QC{8}");
1971 fIntFlowResults->Add(fIntFlowQcumulants);
ff70ca91 1972 // final results for integrated Q-cumulants versus multiplicity:
1973 TString intFlowQcumulantsVsMName = "fIntFlowQcumulantsVsM";
1974 intFlowQcumulantsVsMName += fAnalysisLabel->Data();
1975 TString cumulantFlag[4] = {"QC{2}","QC{4}","QC{6}","QC{8}"};
1976 for(Int_t co=0;co<4;co++) // cumulant order
1977 {
1978 fIntFlowQcumulantsVsM[co] = new TH1D(Form("%s, %s",intFlowQcumulantsVsMName.Data(),cumulantFlag[co].Data()),
1979 Form("%s vs multipicity",cumulantFlag[co].Data()),
9da1a4f3 1980 fnBinsMult,fMinMult,fMaxMult);
ff70ca91 1981 fIntFlowQcumulantsVsM[co]->GetXaxis()->SetTitle("M");
1982 fIntFlowQcumulantsVsM[co]->GetYaxis()->SetTitle(cumulantFlag[co].Data());
1983 fIntFlowResults->Add(fIntFlowQcumulantsVsM[co]);
1984 } // end of for(Int_t co=0;co<4;co++) // cumulant order
489d5531 1985 // final integrated flow estimates from Q-cumulants:
1986 TString intFlowName = "fIntFlow";
1987 intFlowName += fAnalysisLabel->Data();
1988 // integrated flow from Q-cumulants:
1989 fIntFlow = new TH1D(intFlowName.Data(),"Integrated flow estimates from Q-cumulants",4,0,4);
1990 fIntFlow->SetLabelSize(0.05);
1991 fIntFlow->SetMarkerStyle(25);
ff70ca91 1992 (fIntFlow->GetXaxis())->SetBinLabel(1,"v_{2}{2,QC}"); // to be improved (harwired harmonic)
1993 (fIntFlow->GetXaxis())->SetBinLabel(2,"v_{2}{4,QC}"); // to be improved (harwired harmonic)
1994 (fIntFlow->GetXaxis())->SetBinLabel(3,"v_{2}{6,QC}"); // to be improved (harwired harmonic)
1995 (fIntFlow->GetXaxis())->SetBinLabel(4,"v_{2}{8,QC}"); // to be improved (harwired harmonic)
1996 fIntFlowResults->Add(fIntFlow);
1997 // integrated flow from Q-cumulants: versus multiplicity:
1998 TString intFlowVsMName = "fIntFlowVsM";
1999 intFlowVsMName += fAnalysisLabel->Data();
2000 TString flowFlag[4] = {"v_{2}{2,QC}","v_{2}{4,QC}","v_{2}{6,QC}","v_{2}{8,QC}"}; // to be improved (harwired harmonic)
2001 for(Int_t co=0;co<4;co++) // cumulant order
2002 {
2003 fIntFlowVsM[co] = new TH1D(Form("%s, %s",intFlowVsMName.Data(),flowFlag[co].Data()),
2004 Form("%s vs multipicity",flowFlag[co].Data()),
9da1a4f3 2005 fnBinsMult,fMinMult,fMaxMult);
ff70ca91 2006 fIntFlowVsM[co]->GetXaxis()->SetTitle("M");
2007 fIntFlowVsM[co]->GetYaxis()->SetTitle(flowFlag[co].Data());
2008 fIntFlowResults->Add(fIntFlowVsM[co]);
2009 } // end of for(Int_t co=0;co<4;co++) // cumulant order
489d5531 2010
2011 /* // to be improved (removed):
2012 // final average weighted multi-particle correlations for all events calculated from Q-vectors
2013 fQCorrelations[1] = new TProfile("Weighted correlations","final average multi-particle correlations from weighted Q-vectors",200,0,200,"s");
2014 fQCorrelations[1]->SetTickLength(-0.01,"Y");
2015 fQCorrelations[1]->SetMarkerStyle(25);
2016 fQCorrelations[1]->SetLabelSize(0.03);
2017 fQCorrelations[1]->SetLabelOffset(0.01,"Y");
2018 // 2-particle correlations:
2019 (fQCorrelations[1]->GetXaxis())->SetBinLabel(1,"<w_{1}w_{2}cos(n(#phi_{1}-#phi_{2}))>");
2020 (fQCorrelations[1]->GetXaxis())->SetBinLabel(2,"<w_{1}^{2}w_{2}^{2}cos(2n(#phi_{1}-#phi_{2}))>");
2021 (fQCorrelations[1]->GetXaxis())->SetBinLabel(3,"<w_{1}^{3}w_{2}^{3}cos(3n(#phi_{1}-#phi_{2}))>");
2022 (fQCorrelations[1]->GetXaxis())->SetBinLabel(4,"<w_{1}^{4}w_{2}^{4}cos(4n(#phi_{1}-#phi_{2}))>");
2023 (fQCorrelations[1]->GetXaxis())->SetBinLabel(5,"<w_{1}^{3}w_{2}cos(n(#phi_{1}-#phi_{2}))>");
2024 (fQCorrelations[1]->GetXaxis())->SetBinLabel(6,"<w_{1}^{2}w_{2}w_{3}cos(n(#phi_{1}-#phi_{2}))>");
2025 // 3-particle correlations:
2026 (fQCorrelations[1]->GetXaxis())->SetBinLabel(21,"<w_{1}w_{2}w_{3}^{2}cos(n(2#phi_{1}-#phi_{2}-#phi_{3}))>");
2027 // 4-particle correlations:
2028 (fQCorrelations[1]->GetXaxis())->SetBinLabel(41,"<w_{1}w_{2}w_{3}w_{4}cos(n(#phi_{1}+#phi_{2}-#phi_{3}-#phi_{4}))>");
2029 // add fQCorrelations[1] to the list fIntFlowList:
2030 fIntFlowList->Add(fQCorrelations[1]);
2031 */
2032
2033} // end of AliFlowAnalysisWithQCumulants::BookEverythingForIntegratedFlow()
2034
2035
2036//================================================================================================================================
2037
2038
2039void AliFlowAnalysisWithQCumulants::InitializeArraysForNestedLoops()
2040{
2041 // Initialize arrays of all objects relevant for calculations with nested loops.
2042
2043 // integrated flow:
2044 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2045 {
2046 fIntFlowDirectCorrectionTermsForNUA[sc] = NULL;
2047 }
2048
2049 // differential flow:
2050 // correlations:
2051 for(Int_t t=0;t<2;t++) // type: RP or POI
2052 {
2053 for(Int_t pe=0;pe<2;pe++) // pt or eta
2054 {
2055 for(Int_t ci=0;ci<4;ci++) // correlation index
2056 {
2057 fDiffFlowDirectCorrelations[t][pe][ci] = NULL;
2058 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
2059 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
2060 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
2061 // correction terms for non-uniform acceptance:
2062 for(Int_t t=0;t<2;t++) // type: RP or POI
2063 {
2064 for(Int_t pe=0;pe<2;pe++) // pt or eta
2065 {
2066 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2067 {
2068 for(Int_t cti=0;cti<9;cti++) // correction term index
2069 {
2070 fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti] = NULL;
2071 }
2072 }
2073 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
2074 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
2075
2076
2077} // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForNestedLoops()
2078
2079
2080//================================================================================================================================
2081
2082
2083void AliFlowAnalysisWithQCumulants::BookEverythingForNestedLoops()
2084{
2085 // Book all objects relevant for calculations with nested loops.
2086
2087 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)
2088 TString typeFlag[2] = {"RP","POI"}; // to be improved (should I promote this to data members?)
2089 TString ptEtaFlag[2] = {"p_{T}","#eta"}; // to be improved (should I promote this to data members?)
2090 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"}; // to be improved (should I promote this to data members?)
2091 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
2092 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
2093
2094 TString evaluateNestedLoopsName = "fEvaluateNestedLoops";
2095 evaluateNestedLoopsName += fAnalysisLabel->Data();
2096 fEvaluateNestedLoops = new TProfile(evaluateNestedLoopsName.Data(),"Flags for nested loops",4,0,4);
2097 fEvaluateNestedLoops->SetLabelSize(0.03);
2098 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(1,"fEvaluateIntFlowNestedLoops");
2099 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(2,"fEvaluateDiffFlowNestedLoops");
2100 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(3,"fCrossCheckInPtBinNo");
2101 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(4,"fCrossCheckInEtaBinNo");
2102 fEvaluateNestedLoops->Fill(0.5,(Int_t)fEvaluateIntFlowNestedLoops);
2103 fEvaluateNestedLoops->Fill(1.5,(Int_t)fEvaluateDiffFlowNestedLoops);
2104 fEvaluateNestedLoops->Fill(2.5,fCrossCheckInPtBinNo);
2105 fEvaluateNestedLoops->Fill(3.5,fCrossCheckInEtaBinNo);
2106 fNestedLoopsList->Add(fEvaluateNestedLoops);
2107 // nested loops for integrated flow:
2108 if(fEvaluateIntFlowNestedLoops)
2109 {
2110 // correlations:
2111 TString intFlowDirectCorrelationsName = "fIntFlowDirectCorrelations";
2112 intFlowDirectCorrelationsName += fAnalysisLabel->Data();
2113 fIntFlowDirectCorrelations = new TProfile(intFlowDirectCorrelationsName.Data(),"Multiparticle correlations calculated with nested loops (for int. flow)",32,0,32,"s");
2114 fNestedLoopsList->Add(fIntFlowDirectCorrelations);
2115 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
2116 {
2117 TString intFlowExtraDirectCorrelationsName = "fIntFlowExtraDirectCorrelations";
2118 intFlowExtraDirectCorrelationsName += fAnalysisLabel->Data();
2119 fIntFlowExtraDirectCorrelations = new TProfile(intFlowExtraDirectCorrelationsName.Data(),"Extra multiparticle correlations calculated with nested loops (for int. flow)",100,0,100,"s");
2120 fNestedLoopsList->Add(fIntFlowExtraDirectCorrelations);
2121 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
2122 // correction terms for non-uniform acceptance:
2123 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2124 {
2125 TString intFlowDirectCorrectionTermsForNUAName = "fIntFlowDirectCorrectionTermsForNUA";
2126 intFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
2127 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");
2128 fNestedLoopsList->Add(fIntFlowDirectCorrectionTermsForNUA[sc]);
2129 } // end of for(Int_t sc=0;sc<2;sc++)
2130 } // end of if(fEvaluateIntFlowNestedLoops)
2131
2132 // nested loops for differential flow:
2133 if(fEvaluateDiffFlowNestedLoops)
2134 {
2135 // reduced correlations:
2136 TString diffFlowDirectCorrelationsName = "fDiffFlowDirectCorrelations";
2137 diffFlowDirectCorrelationsName += fAnalysisLabel->Data();
2138 for(Int_t t=0;t<2;t++) // type: RP or POI
2139 {
2140 for(Int_t pe=0;pe<2;pe++) // pt or eta
2141 {
2142 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
2143 {
2144 // reduced correlations:
2145 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");
2146 fDiffFlowDirectCorrelations[t][pe][rci]->SetXTitle(ptEtaFlag[pe].Data());
2147 fNestedLoopsList->Add(fDiffFlowDirectCorrelations[t][pe][rci]); // to be improved (add dedicated list to hold reduced correlations)
2148 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
2149 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
2150 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
2151 // correction terms for non-uniform acceptance:
2152 TString diffFlowDirectCorrectionTermsForNUAName = "fDiffFlowDirectCorrectionTermsForNUA";
2153 diffFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
2154 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
2155 {
2156 for(Int_t pe=0;pe<2;pe++) // pt or eta
2157 {
2158 for(Int_t sc=0;sc<2;sc++) // sin or cos
2159 {
2160 for(Int_t cti=0;cti<9;cti++) // correction term index
2161 {
2162 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");
2163 fNestedLoopsList->Add(fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti]);
2164 }
2165 }
2166 }
3b552efe 2167 }
2168 // number of RPs and POIs in selected pt and eta bins for cross-checkings:
2169 TString noOfParticlesInBinName = "fNoOfParticlesInBin";
2170 fNoOfParticlesInBin = new TH1D(noOfParticlesInBinName.Data(),"Number of RPs and POIs in selected p_{T} and #eta bin",4,0,4);
489d5531 2171 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(1,"# of RPs in p_{T} bin");
2172 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(2,"# of RPs in #eta bin");
2173 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(3,"# of POIs in p_{T} bin");
3b552efe 2174 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(4,"# of POIs in #eta bin");
489d5531 2175 fNestedLoopsList->Add(fNoOfParticlesInBin);
2176 } // end of if(fEvaluateDiffFlowNestedLoops)
2177
2178} // end of AliFlowAnalysisWithQCumulants::BookEverythingForNestedLoops()
2179
2180
2181//================================================================================================================================
2182
2183
2184void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelations()
2185{
2186 // calculate all correlations needed for integrated flow
57340a27 2187
489d5531 2188 // multiplicity:
2189 Double_t dMult = (*fSMpk)(0,0);
57340a27 2190
489d5531 2191 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
2192 Double_t dReQ1n = (*fReQ)(0,0);
2193 Double_t dReQ2n = (*fReQ)(1,0);
2194 Double_t dReQ3n = (*fReQ)(2,0);
2195 Double_t dReQ4n = (*fReQ)(3,0);
2196 Double_t dImQ1n = (*fImQ)(0,0);
2197 Double_t dImQ2n = (*fImQ)(1,0);
2198 Double_t dImQ3n = (*fImQ)(2,0);
2199 Double_t dImQ4n = (*fImQ)(3,0);
2200
2201 // real and imaginary parts of some expressions involving various combinations of Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
2202 // (these expression appear in the Eqs. for the multi-particle correlations bellow)
2203
2204 // Re[Q_{2n} Q_{n}^* Q_{n}^*]
2205 Double_t reQ2nQ1nstarQ1nstar = pow(dReQ1n,2.)*dReQ2n + 2.*dReQ1n*dImQ1n*dImQ2n - pow(dImQ1n,2.)*dReQ2n;
2206
2207 // Im[Q_{2n} Q_{n}^* Q_{n}^*]
2208 //Double_t imQ2nQ1nstarQ1nstar = pow(dReQ1n,2.)*dImQ2n-2.*dReQ1n*dImQ1n*dReQ2n-pow(dImQ1n,2.)*dImQ2n;
2209
2210 // Re[Q_{n} Q_{n} Q_{2n}^*] = Re[Q_{2n} Q_{n}^* Q_{n}^*]
2211 Double_t reQ1nQ1nQ2nstar = reQ2nQ1nstarQ1nstar;
2212
2213 // Re[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]
2214 Double_t reQ3nQ1nQ2nstarQ2nstar = (pow(dReQ2n,2.)-pow(dImQ2n,2.))*(dReQ3n*dReQ1n-dImQ3n*dImQ1n)
2215 + 2.*dReQ2n*dImQ2n*(dReQ3n*dImQ1n+dImQ3n*dReQ1n);
2216
2217 // Im[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]
2218 //Double_t imQ3nQ1nQ2nstarQ2nstar = calculate and implement this (deleteMe)
2219
2220 // Re[Q_{2n} Q_{2n} Q_{3n}^* Q_{1n}^*] = Re[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]
2221 Double_t reQ2nQ2nQ3nstarQ1nstar = reQ3nQ1nQ2nstarQ2nstar;
2222
2223 // Re[Q_{4n} Q_{2n}^* Q_{2n}^*]
2224 Double_t reQ4nQ2nstarQ2nstar = pow(dReQ2n,2.)*dReQ4n+2.*dReQ2n*dImQ2n*dImQ4n-pow(dImQ2n,2.)*dReQ4n;
2225
2226 // Im[Q_{4n} Q_{2n}^* Q_{2n}^*]
2227 //Double_t imQ4nQ2nstarQ2nstar = calculate and implement this (deleteMe)
2228
2229 // Re[Q_{2n} Q_{2n} Q_{4n}^*] = Re[Q_{4n} Q_{2n}^* Q_{2n}^*]
2230 Double_t reQ2nQ2nQ4nstar = reQ4nQ2nstarQ2nstar;
2231
2232 // Re[Q_{4n} Q_{3n}^* Q_{n}^*]
2233 Double_t reQ4nQ3nstarQ1nstar = dReQ4n*(dReQ3n*dReQ1n-dImQ3n*dImQ1n)+dImQ4n*(dReQ3n*dImQ1n+dImQ3n*dReQ1n);
2234
2235 // Re[Q_{3n} Q_{n} Q_{4n}^*] = Re[Q_{4n} Q_{3n}^* Q_{n}^*]
2236 Double_t reQ3nQ1nQ4nstar = reQ4nQ3nstarQ1nstar;
2237
2238 // Im[Q_{4n} Q_{3n}^* Q_{n}^*]
2239 //Double_t imQ4nQ3nstarQ1nstar = calculate and implement this (deleteMe)
2240
2241 // Re[Q_{3n} Q_{2n}^* Q_{n}^*]
2242 Double_t reQ3nQ2nstarQ1nstar = dReQ3n*dReQ2n*dReQ1n-dReQ3n*dImQ2n*dImQ1n+dImQ3n*dReQ2n*dImQ1n
2243 + dImQ3n*dImQ2n*dReQ1n;
2244
2245 // Re[Q_{2n} Q_{n} Q_{3n}^*] = Re[Q_{3n} Q_{2n}^* Q_{n}^*]
2246 Double_t reQ2nQ1nQ3nstar = reQ3nQ2nstarQ1nstar;
2247
2248 // Im[Q_{3n} Q_{2n}^* Q_{n}^*]
2249 //Double_t imQ3nQ2nstarQ1nstar; //calculate and implement this (deleteMe)
2250
2251 // Re[Q_{3n} Q_{n}^* Q_{n}^* Q_{n}^*]
2252 Double_t reQ3nQ1nstarQ1nstarQ1nstar = dReQ3n*pow(dReQ1n,3)-3.*dReQ1n*dReQ3n*pow(dImQ1n,2)
2253 + 3.*dImQ1n*dImQ3n*pow(dReQ1n,2)-dImQ3n*pow(dImQ1n,3);
2254
2255 // Im[Q_{3n} Q_{n}^* Q_{n}^* Q_{n}^*]
2256 //Double_t imQ3nQ1nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)
2257
2258 // |Q_{2n}|^2 |Q_{n}|^2
2259 Double_t dQ2nQ1nQ2nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.));
2260
2261 // Re[Q_{4n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2262 Double_t reQ4nQ2nstarQ1nstarQ1nstar = (dReQ4n*dReQ2n+dImQ4n*dImQ2n)*(pow(dReQ1n,2)-pow(dImQ1n,2))
2263 + 2.*dReQ1n*dImQ1n*(dImQ4n*dReQ2n-dReQ4n*dImQ2n);
2264
2265 // Im[Q_{4n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2266 //Double_t imQ4nQ2nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)
2267
2268 // Re[Q_{2n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^*]
2269 Double_t reQ2nQ1nQ1nstarQ1nstarQ1nstar = (dReQ2n*dReQ1n-dImQ2n*dImQ1n)*(pow(dReQ1n,3)-3.*dReQ1n*pow(dImQ1n,2))
2270 + (dReQ2n*dImQ1n+dReQ1n*dImQ2n)*(3.*dImQ1n*pow(dReQ1n,2)-pow(dImQ1n,3));
2271
2272 // Im[Q_{2n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^*]
2273 //Double_t imQ2nQ1nQ1nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)
2274
2275 // Re[Q_{2n} Q_{2n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2276 Double_t reQ2nQ2nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))
2277 * (dReQ2n*(pow(dReQ1n,2.)-pow(dImQ1n,2.)) + 2.*dImQ2n*dReQ1n*dImQ1n);
2278
2279 // Im[Q_{2n} Q_{2n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2280 //Double_t imQ2nQ2nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))
2281 // * (dImQ2n*(pow(dReQ1n,2.)-pow(dImQ1n,2.)) - 2.*dReQ2n*dReQ1n*dImQ1n);
2282
2283 // Re[Q_{4n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2284 Double_t reQ4nQ1nstarQ1nstarQ1nstarQ1nstar = pow(dReQ1n,4.)*dReQ4n-6.*pow(dReQ1n,2.)*dReQ4n*pow(dImQ1n,2.)
2285 + pow(dImQ1n,4.)*dReQ4n+4.*pow(dReQ1n,3.)*dImQ1n*dImQ4n
2286 - 4.*pow(dImQ1n,3.)*dReQ1n*dImQ4n;
2287
2288 // Im[Q_{4n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2289 //Double_t imQ4nQ1nstarQ1nstarQ1nstarQ1nstar = pow(dReQ1n,4.)*dImQ4n-6.*pow(dReQ1n,2.)*dImQ4n*pow(dImQ1n,2.)
2290 // + pow(dImQ1n,4.)*dImQ4n+4.*pow(dImQ1n,3.)*dReQ1n*dReQ4n
2291 // - 4.*pow(dReQ1n,3.)*dImQ1n*dReQ4n;
2292
2293 // Re[Q_{3n} Q_{n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2294 Double_t reQ3nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
2295 * (dReQ1n*dReQ2n*dReQ3n-dReQ3n*dImQ1n*dImQ2n+dReQ2n*dImQ1n*dImQ3n+dReQ1n*dImQ2n*dImQ3n);
2296
2297 // Im[Q_{3n} Q_{n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2298 //Double_t imQ3nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
2299 // * (-dReQ2n*dReQ3n*dImQ1n-dReQ1n*dReQ3n*dImQ2n+dReQ1n*dReQ2n*dImQ3n-dImQ1n*dImQ2n*dImQ3n);
2300
2301
2302 // Re[Q_{2n} Q_{2n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2303 Double_t reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)*dReQ2n-2.*dReQ1n*dReQ2n*dImQ1n-dReQ2n*pow(dImQ1n,2.)
2304 + dImQ2n*pow(dReQ1n,2.)+2.*dReQ1n*dImQ1n*dImQ2n-pow(dImQ1n,2.)*dImQ2n)
2305 * (pow(dReQ1n,2.)*dReQ2n+2.*dReQ1n*dReQ2n*dImQ1n-dReQ2n*pow(dImQ1n,2.)
2306 - dImQ2n*pow(dReQ1n,2.)+2.*dReQ1n*dImQ1n*dImQ2n+pow(dImQ1n,2.)*dImQ2n);
2307
2308 // Im[Q_{2n} Q_{2n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2309 //Double_t imQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar = 2.*(pow(dReQ1n,2.)*dReQ2n-dReQ2n*pow(dImQ1n,2.)
2310 // + 2.*dReQ1n*dImQ1n*dImQ2n)*(pow(dReQ1n,2.)*dImQ2n
2311 // - 2.*dReQ1n*dImQ1n*dReQ2n-pow(dImQ1n,2.)*dImQ2n);
2312
2313 // Re[Q_{3n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2314 Double_t reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
2315 * (pow(dReQ1n,3.)*dReQ3n-3.*dReQ1n*dReQ3n*pow(dImQ1n,2.)
2316 + 3.*pow(dReQ1n,2.)*dImQ1n*dImQ3n-pow(dImQ1n,3.)*dImQ3n);
2317
2318 // Im[Q_{3n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2319 //Double_t imQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
2320 // * (pow(dImQ1n,3.)*dReQ3n-3.*dImQ1n*dReQ3n*pow(dReQ1n,2.)
2321 // - 3.*pow(dImQ1n,2.)*dReQ1n*dImQ3n+pow(dReQ1n,3.)*dImQ3n);
2322
2323 // |Q_{2n}|^2 |Q_{n}|^4
2324 Double_t dQ2nQ1nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))*pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.);
2325
2326 // Re[Q_{2n} Q_{n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2327 Double_t reQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
2328 * (pow(dReQ1n,2.)*dReQ2n-dReQ2n*pow(dImQ1n,2.)
2329 + 2.*dReQ1n*dImQ1n*dImQ2n);
2330
2331 // Im[Q_{2n} Q_{n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2332 //Double_t imQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
2333 // * (pow(dReQ1n,2.)*dImQ2n-dImQ2n*pow(dImQ1n,2.)
2334 // - 2.*dReQ1n*dReQ2n*dImQ1n);
2335
2336
2337
2338
2339 // **************************************
2340 // **** multi-particle correlations: ****
2341 // **************************************
2342 //
2343 // Remark 1: multi-particle correlations calculated with non-weighted Q-vectors are stored in 1D profile fQCorrelations[0]. // to be improved (wrong profiles)
2344 // Remark 2: binning of fQCorrelations[0] is organized as follows: // to be improved (wrong profiles)
2345 // --------------------------------------------------------------------------------------------------------------------
2346 // 1st bin: <2>_{1n|1n} = two1n1n = cos(n*(phi1-phi2))>
2347 // 2nd bin: <2>_{2n|2n} = two2n2n = cos(2n*(phi1-phi2))>
2348 // 3rd bin: <2>_{3n|3n} = two3n3n = cos(3n*(phi1-phi2))>
2349 // 4th bin: <2>_{4n|4n} = two4n4n = cos(4n*(phi1-phi2))>
2350 // 5th bin: ---- EMPTY ----
2351 // 6th bin: <3>_{2n|1n,1n} = three2n1n1n = <cos(n*(2.*phi1-phi2-phi3))>
2352 // 7th bin: <3>_{3n|2n,1n} = three3n2n1n = <cos(n*(3.*phi1-2.*phi2-phi3))>
2353 // 8th bin: <3>_{4n|2n,2n} = three4n2n2n = <cos(n*(4.*phi1-2.*phi2-2.*phi3))>
2354 // 9th bin: <3>_{4n|3n,1n} = three4n3n1n = <cos(n*(4.*phi1-3.*phi2-phi3))>
2355 // 10th bin: ---- EMPTY ----
2356 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1n = <cos(n*(phi1+phi2-phi3-phi4))>
2357 // 12th bin: <4>_{2n,1n|2n,1n} = four2n1n2n1n = <cos(2.*n*(phi1+phi2-phi3-phi4))>
2358 // 13th bin: <4>_{2n,2n|2n,2n} = four2n2n2n2n = <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>
2359 // 14th bin: <4>_{3n|1n,1n,1n} = four3n1n1n1n = <cos(n*(3.*phi1-phi2-phi3-phi4))>
2360 // 15th bin: <4>_{3n,1n|3n,1n} = four3n1n3n1n = <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>
2361 // 16th bin: <4>_{3n,1n|2n,2n} = four3n1n2n2n = <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>
2362 // 17th bin: <4>_{4n|2n,1n,1n} = four4n2n1n1n = <cos(n*(3.*phi1+phi2-3.*phi3-phi4))>
2363 // 18th bin: ---- EMPTY ----
2364 // 19th bin: <5>_{2n|1n,1n,1n,1n} = five2n1n1n1n1n = <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>
2365 // 20th bin: <5>_{2n,2n|2n,1n,1n} = five2n2n2n1n1n = <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>
2366 // 21st bin: <5>_{3n,1n|2n,1n,1n} = five3n1n2n1n1n = <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>
2367 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = five4n1n1n1n1n = <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>
2368 // 23rd bin: ---- EMPTY ----
2369 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = six1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
2370 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = six2n1n1n2n1n1n = <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>
2371 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = six2n2n1n1n1n1n = <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>
2372 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = six3n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>
2373 // 28th bin: ---- EMPTY ----
2374 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = seven2n1n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
2375 // 30th bin: ---- EMPTY ----
2376 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = eight1n1n1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
2377 // --------------------------------------------------------------------------------------------------------------------
2378
2379 // 2-particle:
2380 Double_t two1n1n = 0.; // <cos(n*(phi1-phi2))>
2381 Double_t two2n2n = 0.; // <cos(2n*(phi1-phi2))>
2382 Double_t two3n3n = 0.; // <cos(3n*(phi1-phi2))>
2383 Double_t two4n4n = 0.; // <cos(4n*(phi1-phi2))>
2384
2385 if(dMult>1)
2386 {
2387 two1n1n = (pow(dReQ1n,2.)+pow(dImQ1n,2.)-dMult)/(dMult*(dMult-1.));
2388 two2n2n = (pow(dReQ2n,2.)+pow(dImQ2n,2.)-dMult)/(dMult*(dMult-1.));
2389 two3n3n = (pow(dReQ3n,2.)+pow(dImQ3n,2.)-dMult)/(dMult*(dMult-1.));
2390 two4n4n = (pow(dReQ4n,2.)+pow(dImQ4n,2.)-dMult)/(dMult*(dMult-1.));
2391
2392 // average 2-particle correlations for single event:
2393 fIntFlowCorrelationsAllEBE->SetBinContent(1,two1n1n);
2394 fIntFlowCorrelationsAllEBE->SetBinContent(2,two2n2n);
2395 fIntFlowCorrelationsAllEBE->SetBinContent(3,two3n3n);
2396 fIntFlowCorrelationsAllEBE->SetBinContent(4,two4n4n);
2397
2398 // average 2-particle correlations for all events:
2399 fIntFlowCorrelationsAllPro->Fill(0.5,two1n1n,dMult*(dMult-1.));
2400 fIntFlowCorrelationsAllPro->Fill(1.5,two2n2n,dMult*(dMult-1.));
2401 fIntFlowCorrelationsAllPro->Fill(2.5,two3n3n,dMult*(dMult-1.));
2402 fIntFlowCorrelationsAllPro->Fill(3.5,two4n4n,dMult*(dMult-1.));
2403
2404 // store separetately <2> (to be improved: do I really need this?)
2405 fIntFlowCorrelationsEBE->SetBinContent(1,two1n1n); // <2>
2406
2407 // to be improved (this can be implemented better):
2408 Double_t mWeight2p = 0.;
2409 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
2410 {
2411 mWeight2p = dMult*(dMult-1.);
2412 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
2413 {
2414 mWeight2p = 1.;
2415 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2416 {
2417 mWeight2p = dMult;
2418 }
2419
2420 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(1,mWeight2p); // eW_<2>
2421 fIntFlowCorrelationsPro->Fill(0.5,two1n1n,mWeight2p);
ff70ca91 2422 fIntFlowCorrelationsVsMPro[0]->Fill(dMult+0.5,two1n1n,mWeight2p);
489d5531 2423
2424 // distribution of <cos(n*(phi1-phi2))>:
2425 //f2pDistribution->Fill(two1n1n,dMult*(dMult-1.));
2426 } // end of if(dMult>1)
2427
2428 // 3-particle:
2429 Double_t three2n1n1n = 0.; // <cos(n*(2.*phi1-phi2-phi3))>
2430 Double_t three3n2n1n = 0.; // <cos(n*(3.*phi1-2.*phi2-phi3))>
2431 Double_t three4n2n2n = 0.; // <cos(n*(4.*phi1-2.*phi2-2.*phi3))>
2432 Double_t three4n3n1n = 0.; // <cos(n*(4.*phi1-3.*phi2-phi3))>
2433
2434 if(dMult>2)
2435 {
2436 three2n1n1n = (reQ2nQ1nstarQ1nstar-2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
2437 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))+2.*dMult)
2438 / (dMult*(dMult-1.)*(dMult-2.));
2439 three3n2n1n = (reQ3nQ2nstarQ1nstar-(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2440 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))
2441 - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)
2442 / (dMult*(dMult-1.)*(dMult-2.));
2443 three4n2n2n = (reQ4nQ2nstarQ2nstar-2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2444 - (pow(dReQ4n,2.)+pow(dImQ4n,2.))+2.*dMult)
2445 / (dMult*(dMult-1.)*(dMult-2.));
2446 three4n3n1n = (reQ4nQ3nstarQ1nstar-(pow(dReQ4n,2.)+pow(dImQ4n,2.))
2447 - (pow(dReQ3n,2.)+pow(dImQ3n,2.))
2448 - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)
2449 / (dMult*(dMult-1.)*(dMult-2.));
2450
2451 // average 3-particle correlations for single event:
2452 fIntFlowCorrelationsAllEBE->SetBinContent(6,three2n1n1n);
2453 fIntFlowCorrelationsAllEBE->SetBinContent(7,three3n2n1n);
2454 fIntFlowCorrelationsAllEBE->SetBinContent(8,three4n2n2n);
2455 fIntFlowCorrelationsAllEBE->SetBinContent(9,three4n3n1n);
2456
2457 // average 3-particle correlations for all events:
2458 fIntFlowCorrelationsAllPro->Fill(5.5,three2n1n1n,dMult*(dMult-1.)*(dMult-2.));
2459 fIntFlowCorrelationsAllPro->Fill(6.5,three3n2n1n,dMult*(dMult-1.)*(dMult-2.));
2460 fIntFlowCorrelationsAllPro->Fill(7.5,three4n2n2n,dMult*(dMult-1.)*(dMult-2.));
2461 fIntFlowCorrelationsAllPro->Fill(8.5,three4n3n1n,dMult*(dMult-1.)*(dMult-2.));
2462 } // end of if(dMult>2)
2463
2464 // 4-particle:
2465 Double_t four1n1n1n1n = 0.; // <cos(n*(phi1+phi2-phi3-phi4))>
2466 Double_t four2n2n2n2n = 0.; // <cos(2.*n*(phi1+phi2-phi3-phi4))>
2467 Double_t four2n1n2n1n = 0.; // <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>
2468 Double_t four3n1n1n1n = 0.; // <cos(n*(3.*phi1-phi2-phi3-phi4))>
2469 Double_t four4n2n1n1n = 0.; // <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>
2470 Double_t four3n1n2n2n = 0.; // <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>
2471 Double_t four3n1n3n1n = 0.; // <cos(n*(3.*phi1+phi2-3.*phi3-phi4))>
2472
2473 if(dMult>3)
2474 {
2475 four1n1n1n1n = (2.*dMult*(dMult-3.)+pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)-4.*(dMult-2.)*(pow(dReQ1n,2.)
2476 + pow(dImQ1n,2.))-2.*reQ2nQ1nstarQ1nstar+(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
2477 / (dMult*(dMult-1)*(dMult-2.)*(dMult-3.));
2478 four2n2n2n2n = (2.*dMult*(dMult-3.)+pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)-4.*(dMult-2.)*(pow(dReQ2n,2.)
2479 + pow(dImQ2n,2.))-2.*reQ4nQ2nstarQ2nstar+(pow(dReQ4n,2.)+pow(dImQ4n,2.)))
2480 / (dMult*(dMult-1)*(dMult-2.)*(dMult-3.));
2481 four2n1n2n1n = (dQ2nQ1nQ2nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar-2.*reQ2nQ1nstarQ1nstar)
2482 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2483 - ((dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
2484 + (dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-(pow(dReQ3n,2.)+pow(dImQ3n,2.)))
2485 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2486 + (dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.));
2487 four3n1n1n1n = (reQ3nQ1nstarQ1nstarQ1nstar-3.*reQ3nQ2nstarQ1nstar-3.*reQ2nQ1nstarQ1nstar)
2488 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2489 + (2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+3.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2490 + 6.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-6.*dMult)
2491 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2492 four4n2n1n1n = (reQ4nQ2nstarQ1nstarQ1nstar-2.*reQ4nQ3nstarQ1nstar-reQ4nQ2nstarQ2nstar-2.*reQ3nQ2nstarQ1nstar)
2493 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2494 - (reQ2nQ1nstarQ1nstar-2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2495 - 3.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2496 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2497 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
2498 four3n1n2n2n = (reQ3nQ1nQ2nstarQ2nstar-reQ4nQ2nstarQ2nstar-reQ3nQ1nQ4nstar-2.*reQ3nQ2nstarQ1nstar)
2499 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2500 - (2.*reQ1nQ1nQ2nstar-(pow(dReQ4n,2.)+pow(dImQ4n,2.))-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2501 - 4.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2502 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2503 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
2504 four3n1n3n1n = ((pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
2505 - 2.*reQ4nQ3nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar)
2506 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2507 + ((pow(dReQ4n,2.)+pow(dImQ4n,2.))-(dMult-4.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2508 + (pow(dReQ2n,2.)+pow(dImQ2n,2.))-(dMult-4.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2509 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2510 + (dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.));
2511
2512 // average 4-particle correlations for single event:
2513 fIntFlowCorrelationsAllEBE->SetBinContent(11,four1n1n1n1n);
2514 fIntFlowCorrelationsAllEBE->SetBinContent(12,four2n1n2n1n);
2515 fIntFlowCorrelationsAllEBE->SetBinContent(13,four2n2n2n2n);
2516 fIntFlowCorrelationsAllEBE->SetBinContent(14,four3n1n1n1n);
2517 fIntFlowCorrelationsAllEBE->SetBinContent(15,four3n1n3n1n);
2518 fIntFlowCorrelationsAllEBE->SetBinContent(16,four3n1n2n2n);
2519 fIntFlowCorrelationsAllEBE->SetBinContent(17,four4n2n1n1n);
2520
2521 // average 4-particle correlations for all events:
2522 fIntFlowCorrelationsAllPro->Fill(10.5,four1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2523 fIntFlowCorrelationsAllPro->Fill(11.5,four2n1n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2524 fIntFlowCorrelationsAllPro->Fill(12.5,four2n2n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2525 fIntFlowCorrelationsAllPro->Fill(13.5,four3n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2526 fIntFlowCorrelationsAllPro->Fill(14.5,four3n1n3n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2527 fIntFlowCorrelationsAllPro->Fill(15.5,four3n1n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2528 fIntFlowCorrelationsAllPro->Fill(16.5,four4n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2529
2530 // store separetately <4> (to be improved: do I really need this?)
2531 fIntFlowCorrelationsEBE->SetBinContent(2,four1n1n1n1n); // <4>
2532
2533 // to be improved (this can be implemented better):
2534 Double_t mWeight4p = 0.;
2535 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
2536 {
2537 mWeight4p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.);
2538 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
2539 {
2540 mWeight4p = 1.;
2541 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2542 {
2543 mWeight4p = dMult;
2544 }
2545
2546 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(2,mWeight4p); // eW_<4>
2547 fIntFlowCorrelationsPro->Fill(1.5,four1n1n1n1n,mWeight4p);
ff70ca91 2548 fIntFlowCorrelationsVsMPro[1]->Fill(dMult+0.5,four1n1n1n1n,mWeight4p);
489d5531 2549
2550 // distribution of <cos(n*(phi1+phi2-phi3-phi4))>
2551 //f4pDistribution->Fill(four1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2552
2553 } // end of if(dMult>3)
2554
2555 // 5-particle:
2556 Double_t five2n1n1n1n1n = 0.; // <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>
2557 Double_t five2n2n2n1n1n = 0.; // <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>
2558 Double_t five3n1n2n1n1n = 0.; // <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>
2559 Double_t five4n1n1n1n1n = 0.; // <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>
2560
2561 if(dMult>4)
2562 {
2563 five2n1n1n1n1n = (reQ2nQ1nQ1nstarQ1nstarQ1nstar-reQ3nQ1nstarQ1nstarQ1nstar+6.*reQ3nQ2nstarQ1nstar)
2564 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2565 - (reQ2nQ1nQ3nstar+3.*(dMult-6.)*reQ2nQ1nstarQ1nstar+3.*reQ1nQ1nQ2nstar)
2566 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2567 - (2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2568 + 3.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2569 - 3.*(dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
2570 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2571 - 3.*(pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
2572 - 2.*(2*dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult*(dMult-4.))
2573 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2574
2575 five2n2n2n1n1n = (reQ2nQ2nQ2nstarQ1nstarQ1nstar-reQ4nQ2nstarQ1nstarQ1nstar-2.*reQ2nQ2nQ3nstarQ1nstar)
2576 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2577 + 2.*(reQ4nQ2nstarQ2nstar+4.*reQ3nQ2nstarQ1nstar+reQ3nQ1nQ4nstar)
2578 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2579 + (reQ2nQ2nQ4nstar-2.*(dMult-5.)*reQ2nQ1nstarQ1nstar+2.*reQ1nQ1nQ2nstar)
2580 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2581 - (2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+4.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2582 + 1.*pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)
2583 - 2.*(3.*dMult-10.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
2584 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2585 - (4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2586 - 4.*(dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))+4.*dMult*(dMult-6.))
2587 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2588
2589 five4n1n1n1n1n = (reQ4nQ1nstarQ1nstarQ1nstarQ1nstar-6.*reQ4nQ2nstarQ1nstarQ1nstar-4.*reQ3nQ1nstarQ1nstarQ1nstar)
2590 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2591 + (8.*reQ4nQ3nstarQ1nstar+3.*reQ4nQ2nstarQ2nstar+12.*reQ3nQ2nstarQ1nstar+12.*reQ2nQ1nstarQ1nstar)
2592 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2593 - (6.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+8.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2594 + 12.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))+24.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-24.*dMult)
2595 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2596
2597 five3n1n2n1n1n = (reQ3nQ1nQ2nstarQ1nstarQ1nstar-reQ4nQ2nstarQ1nstarQ1nstar-reQ3nQ1nstarQ1nstarQ1nstar)
2598 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2599 - (reQ3nQ1nQ2nstarQ2nstar-3.*reQ4nQ3nstarQ1nstar-reQ4nQ2nstarQ2nstar)
2600 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2601 - ((2.*dMult-13.)*reQ3nQ2nstarQ1nstar-reQ3nQ1nQ4nstar-9.*reQ2nQ1nstarQ1nstar)
2602 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2603 - (2.*reQ1nQ1nQ2nstar+2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
2604 - 2.*(dMult-5.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+2.*(pow(dReQ3n,2.)
2605 + pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2606 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2607 + (2.*(dMult-6.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2608 - 2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
2609 - pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
2610 + 2.*(3.*dMult-11.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2611 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2612 - 4.*(dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2613
2614 // average 5-particle correlations for single event:
2615 fIntFlowCorrelationsAllEBE->SetBinContent(19,five2n1n1n1n1n);
2616 fIntFlowCorrelationsAllEBE->SetBinContent(20,five2n2n2n1n1n);
2617 fIntFlowCorrelationsAllEBE->SetBinContent(21,five3n1n2n1n1n);
2618 fIntFlowCorrelationsAllEBE->SetBinContent(22,five4n1n1n1n1n);
2619
2620 // average 5-particle correlations for all events:
2621 fIntFlowCorrelationsAllPro->Fill(18.5,five2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2622 fIntFlowCorrelationsAllPro->Fill(19.5,five2n2n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2623 fIntFlowCorrelationsAllPro->Fill(20.5,five3n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2624 fIntFlowCorrelationsAllPro->Fill(21.5,five4n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2625 } // end of if(dMult>4)
2626
2627 // 6-particle:
2628 Double_t six1n1n1n1n1n1n = 0.; // <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
2629 Double_t six2n2n1n1n1n1n = 0.; // <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>
2630 Double_t six3n1n1n1n1n1n = 0.; // <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>
2631 Double_t six2n1n1n2n1n1n = 0.; // <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>
2632
2633 if(dMult>5)
2634 {
2635 six1n1n1n1n1n1n = (pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),3.)+9.*dQ2nQ1nQ2nstarQ1nstar-6.*reQ2nQ1nQ1nstarQ1nstarQ1nstar)
2636 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))
2637 + 4.*(reQ3nQ1nstarQ1nstarQ1nstar-3.*reQ3nQ2nstarQ1nstar)
2638 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))
2639 + 2.*(9.*(dMult-4.)*reQ2nQ1nstarQ1nstar+2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.)))
2640 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))
2641 - 9.*(pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)+(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
2642 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-5.))
2643 + (18.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2644 / (dMult*(dMult-1)*(dMult-3)*(dMult-4))
2645 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
2646
2647 six2n1n1n2n1n1n = (dQ2nQ1nQ1nQ2nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)
2648 * (2.*five2n2n2n1n1n+4.*five2n1n1n1n1n+4.*five3n1n2n1n1n+4.*four2n1n2n1n+1.*four1n1n1n1n)
2649 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four1n1n1n1n+4.*two1n1n
2650 + 2.*three2n1n1n+2.*three2n1n1n+4.*four3n1n1n1n+8.*three2n1n1n+2.*four4n2n1n1n
2651 + 4.*four2n1n2n1n+2.*two2n2n+8.*four2n1n2n1n+4.*four3n1n3n1n+8.*three3n2n1n
2652 + 4.*four3n1n2n2n+4.*four1n1n1n1n+4.*four2n1n2n1n+1.*four2n2n2n2n)
2653 - dMult*(dMult-1.)*(dMult-2.)*(2.*three2n1n1n+8.*two1n1n+4.*two1n1n+2.
2654 + 4.*two1n1n+4.*three2n1n1n+2.*two2n2n+4.*three2n1n1n+8.*three3n2n1n
2655 + 8.*two2n2n+4.*three4n3n1n+4.*two3n3n+4.*three3n2n1n+4.*two1n1n
2656 + 8.*three2n1n1n+4.*two1n1n+4.*three3n2n1n+4.*three2n1n1n+2.*two2n2n
2657 + 4.*three3n2n1n+2.*three4n2n2n)-dMult*(dMult-1.)
2658 * (4.*two1n1n+4.+4.*two1n1n+2.*two2n2n+1.+4.*two1n1n+4.*two2n2n+4.*two3n3n
2659 + 1.+2.*two2n2n+1.*two4n4n)-dMult)
2660 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)
2661
2662 six2n2n1n1n1n1n = (reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)
2663 * (five4n1n1n1n1n+8.*five2n1n1n1n1n+6.*five2n2n2n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)
2664 * (4.*four3n1n1n1n+6.*four4n2n1n1n+12.*three2n1n1n+12.*four1n1n1n1n+24.*four2n1n2n1n
2665 + 4.*four3n1n2n2n+3.*four2n2n2n2n)-dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+12.*three3n2n1n
2666 + 4.*three4n3n1n+3.*three4n2n2n+8.*three2n1n1n+24.*two1n1n+12.*two2n2n+12.*three2n1n1n+8.*three3n2n1n
2667 + 1.*three4n2n2n)-dMult*(dMult-1.)*(4.*two1n1n+6.*two2n2n+4.*two3n3n+1.*two4n4n+2.*two2n2n+8.*two1n1n+6.)-dMult)
2668 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)
2669
2670 six3n1n1n1n1n1n = (reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)
2671 * (five4n1n1n1n1n+4.*five2n1n1n1n1n+6.*five3n1n2n1n1n+4.*four3n1n1n1n)
2672 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four3n1n1n1n+6.*four4n2n1n1n+6.*four1n1n1n1n
2673 + 12.*three2n1n1n+12.*four2n1n2n1n+6.*four3n1n1n1n+12.*three3n2n1n+4.*four3n1n3n1n+3.*four3n1n2n2n)
2674 - dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+12.*three3n2n1n+4.*three4n3n1n+3.*three4n2n2n+4.*two1n1n
2675 + 12.*two1n1n+6.*three2n1n1n+12.*three2n1n1n+4.*three3n2n1n+12.*two2n2n+4.*three3n2n1n+4.*two3n3n+1.*three4n3n1n
2676 + 6.*three3n2n1n)-dMult*(dMult-1.)*(4.*two1n1n+6.*two2n2n+4.*two3n3n+1.*two4n4n+1.*two1n1n+4.+6.*two1n1n+4.*two2n2n
2677 + 1.*two3n3n)-dMult)/(dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)
2678
2679 // average 6-particle correlations for single event:
2680 fIntFlowCorrelationsAllEBE->SetBinContent(24,six1n1n1n1n1n1n);
2681 fIntFlowCorrelationsAllEBE->SetBinContent(25,six2n1n1n2n1n1n);
2682 fIntFlowCorrelationsAllEBE->SetBinContent(26,six2n2n1n1n1n1n);
2683 fIntFlowCorrelationsAllEBE->SetBinContent(27,six3n1n1n1n1n1n);
2684
2685 // average 6-particle correlations for all events:
2686 fIntFlowCorrelationsAllPro->Fill(23.5,six1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2687 fIntFlowCorrelationsAllPro->Fill(24.5,six2n1n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2688 fIntFlowCorrelationsAllPro->Fill(25.5,six2n2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2689 fIntFlowCorrelationsAllPro->Fill(26.5,six3n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2690
2691 // store separetately <6> (to be improved: do I really need this?)
2692 fIntFlowCorrelationsEBE->SetBinContent(3,six1n1n1n1n1n1n); // <6>
2693
2694 // to be improved (this can be implemented better):
2695 Double_t mWeight6p = 0.;
2696 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
2697 {
2698 mWeight6p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.);
2699 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
2700 {
2701 mWeight6p = 1.;
2702 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2703 {
2704 mWeight6p = dMult;
2705 }
2706
2707 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(3,mWeight6p); // eW_<6>
2708 fIntFlowCorrelationsPro->Fill(2.5,six1n1n1n1n1n1n,mWeight6p);
ff70ca91 2709 fIntFlowCorrelationsVsMPro[2]->Fill(dMult+0.5,six1n1n1n1n1n1n,mWeight6p);
489d5531 2710
2711 // distribution of <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
2712 //f6pDistribution->Fill(six1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2713 } // end of if(dMult>5)
2714
2715 // 7-particle:
2716 Double_t seven2n1n1n1n1n1n1n = 0.; // <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
2717
2718 if(dMult>6)
2719 {
2720 seven2n1n1n1n1n1n1n = (reQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)
2721 * (2.*six3n1n1n1n1n1n+4.*six1n1n1n1n1n1n+1.*six2n2n1n1n1n1n+6.*six2n1n1n2n1n1n+8.*five2n1n1n1n1n)
2722 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(1.*five4n1n1n1n1n +8.*five2n1n1n1n1n+8.*four3n1n1n1n
2723 + 12.*five3n1n2n1n1n+4.*five2n1n1n1n1n+3.*five2n2n2n1n1n+6.*five2n2n2n1n1n+6.*four1n1n1n1n+24.*four1n1n1n1n
2724 + 12.*five2n1n1n1n1n+12.*five2n1n1n1n1n+12.*three2n1n1n+24.*four2n1n2n1n+4.*five3n1n2n1n1n+4.*five2n1n1n1n1n)
2725 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four3n1n1n1n+6.*four4n2n1n1n+12.*four1n1n1n1n+24.*three2n1n1n
2726 + 24.*four2n1n2n1n+12.*four3n1n1n1n+24.*three3n2n1n+8.*four3n1n3n1n+6.*four3n1n2n2n+6.*three2n1n1n+12.*four1n1n1n1n
2727 + 12.*four2n1n2n1n+6.*three2n1n1n+12.*four2n1n2n1n+4.*four3n1n2n2n+3.*four2n2n2n2n+4.*four1n1n1n1n+6.*three2n1n1n
2728 + 24.*two1n1n+24.*four1n1n1n1n+4.*four3n1n1n1n+24.*two1n1n+24.*three2n1n1n+12.*two2n2n+24.*three2n1n1n+12.*four2n1n2n1n
2729 + 8.*three3n2n1n+8.*four2n1n2n1n+1.*four4n2n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+1.*three2n1n1n+8.*two1n1n
2730 + 12.*three3n2n1n+24.*two1n1n+12.*three2n1n1n+4.*three2n1n1n+8.*two1n1n+4.*three4n3n1n+24.*three2n1n1n+8.*three3n2n1n
2731 + 12.*two1n1n+12.*two1n1n+3.*three4n2n2n+24.*two2n2n+6.*two2n2n+12.+12.*three3n2n1n+8.*two3n3n+12.*three2n1n1n+24.*two1n1n
2732 + 4.*three3n2n1n+8.*three3n2n1n+2.*three4n3n1n+12.*two1n1n+8.*three2n1n1n+4.*three2n1n1n+2.*three3n2n1n+6.*two2n2n+8.*two2n2n
2733 + 1.*three4n2n2n+4.*three3n2n1n+6.*three2n1n1n)-dMult*(dMult-1.)*(4.*two1n1n+2.*two1n1n+6.*two2n2n+8.+1.*two2n2n+4.*two3n3n
2734 + 12.*two1n1n+4.*two1n1n+1.*two4n4n+8.*two2n2n+6.+2.*two3n3n+4.*two1n1n+1.*two2n2n)-dMult)
2735 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)); // to be improved (direct formula needed)
2736
2737 // average 7-particle correlations for single event:
2738 fIntFlowCorrelationsAllEBE->SetBinContent(29,seven2n1n1n1n1n1n1n);
2739
2740 // average 7-particle correlations for all events:
2741 fIntFlowCorrelationsAllPro->Fill(28.5,seven2n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.));
2742 } // end of if(dMult>6)
2743
2744 // 8-particle:
2745 Double_t eight1n1n1n1n1n1n1n1n = 0.; // <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
2746 if(dMult>7)
2747 {
2748 eight1n1n1n1n1n1n1n1n = (pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),4.)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)
2749 * (12.*seven2n1n1n1n1n1n1n+16.*six1n1n1n1n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)
2750 * (8.*six3n1n1n1n1n1n+48.*six1n1n1n1n1n1n+6.*six2n2n1n1n1n1n+96.*five2n1n1n1n1n+72.*four1n1n1n1n+36.*six2n1n1n2n1n1n)
2751 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(2.*five4n1n1n1n1n+32.*five2n1n1n1n1n+36.*four1n1n1n1n
2752 + 32.*four3n1n1n1n+48.*five2n1n1n1n1n+48.*five3n1n2n1n1n+144.*five2n1n1n1n1n+288.*four1n1n1n1n+36.*five2n2n2n1n1n
2753 + 144.*three2n1n1n+96.*two1n1n+144.*four2n1n2n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)
2754 * (8.*four3n1n1n1n+48.*four1n1n1n1n+12.*four4n2n1n1n+96.*four2n1n2n1n+96.*three2n1n1n+72.*three2n1n1n+144.*two1n1n
2755 + 16.*four3n1n3n1n+48.*four3n1n1n1n+144.*four1n1n1n1n+72.*four1n1n1n1n+96.*three3n2n1n+24.*four3n1n2n2n+144.*four2n1n2n1n
2756 + 288.*two1n1n+288.*three2n1n1n+9.*four2n2n2n2n+72.*two2n2n+24.)-dMult*(dMult-1.)*(dMult-2.)*(12.*three2n1n1n+16.*two1n1n
2757 + 24.*three3n2n1n+48.*three2n1n1n+96.*two1n1n+8.*three4n3n1n+32.*three3n2n1n+96.*three2n1n1n+144.*two1n1n+6.*three4n2n2n
2758 + 96.*two2n2n+36.*two2n2n+72.+48.*three3n2n1n+16.*two3n3n+72.*three2n1n1n+144.*two1n1n)-dMult*(dMult-1.)*(8.*two1n1n
2759 + 12.*two2n2n+16.+8.*two3n3n+48.*two1n1n+1.*two4n4n+16.*two2n2n+18.)-dMult)
2760 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.)); // to be improved (direct formula needed)
2761
2762 // average 8-particle correlations for single event:
2763 fIntFlowCorrelationsAllEBE->SetBinContent(31,eight1n1n1n1n1n1n1n1n);
2764
2765 // average 8-particle correlations for all events:
2766 fIntFlowCorrelationsAllPro->Fill(30.5,eight1n1n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.));
2767
2768 // store separetately <8> (to be improved: do I really need this?)
2769 fIntFlowCorrelationsEBE->SetBinContent(4,eight1n1n1n1n1n1n1n1n); // <8>
2770
2771 // to be improved (this can be implemented better):
2772 Double_t mWeight8p = 0.;
2773 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
2774 {
2775 mWeight8p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.);
2776 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
2777 {
2778 mWeight8p = 1.;
2779 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2780 {
2781 mWeight8p = dMult;
2782 }
2783
2784 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(4,mWeight8p); // eW_<8>
2785 fIntFlowCorrelationsPro->Fill(3.5,eight1n1n1n1n1n1n1n1n,mWeight8p);
ff70ca91 2786 fIntFlowCorrelationsVsMPro[3]->Fill(dMult+0.5,eight1n1n1n1n1n1n1n1n,mWeight8p);
489d5531 2787
2788 // distribution of <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
2789 //f8pDistribution->Fill(eight1n1n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.));
2790 } // end of if(dMult>7)
2791
2792} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelations()
2793
2794
2795//================================================================================================================================
2796
2797
2798void AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrelations()
2799{
0328db2d 2800 // Calculate averages of products of correlations for integrated flow.
489d5531 2801
ff70ca91 2802 // multiplicity:
2803 Double_t dMult = (*fSMpk)(0,0);
2804
489d5531 2805 Int_t counter = 0;
2806
2807 for(Int_t ci1=1;ci1<4;ci1++)
2808 {
2809 for(Int_t ci2=ci1+1;ci2<=4;ci2++)
2810 {
ff70ca91 2811 fIntFlowProductOfCorrelationsPro->Fill(0.5+counter,
2812 fIntFlowCorrelationsEBE->GetBinContent(ci1)*
2813 fIntFlowCorrelationsEBE->GetBinContent(ci2),
2814 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
2815 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
2816 // products versus multiplicity: // [0=<<2><4>>,1=<<2><6>>,2=<<2><8>>,3=<<4><6>>,4=<<4><8>>,5=<<6><8>>]
2817 fIntFlowProductOfCorrelationsVsMPro[counter]->Fill(dMult+0.5,
2818 fIntFlowCorrelationsEBE->GetBinContent(ci1)*
2819 fIntFlowCorrelationsEBE->GetBinContent(ci2),
2820 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
2821 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
2822 counter++;
489d5531 2823 }
2824 }
2825
2826} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrelations()
2827
2828
2829//================================================================================================================================
2830
2831
0328db2d 2832void AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrectionTermsForNUA()
2833{
2834 // Calculate averages of products of correction terms for NUA.
2835
2836 // a) Binning of fIntFlowProductOfCorrectionTermsForNUAPro is organized as follows:
2837 // 1st bin: <<2><cos(phi)>>
2838 // 2nd bin: <<2><sin(phi)>>
2839 // 3rd bin: <<cos(phi)><sin(phi)>>
2840 // 4th bin: <<2><cos(phi1+phi2)>>
2841 // 5th bin: <<2><sin(phi1+phi2)>>
2842 // 6th bin: <<2><cos(phi1-phi2-phi3)>>
2843 // 7th bin: <<2><sin(phi1-phi2-phi3)>>
2844 // 8th bin: <<4><cos(phi1)>>
2845 // 9th bin: <<4><sin(phi1)>>
2846 // 10th bin: <<4><cos(phi1+phi2)>>
2847 // 11th bin: <<4><sin(phi1+phi2)>>
2848 // 12th bin: <<4><cos(phi1-phi2-phi3)>>
2849 // 13th bin: <<4><sin(phi1-phi2-phi3)>>
2850 // 14th bin: <<cos(phi1)><cos(phi1+phi2)>>
2851 // 15th bin: <<cos(phi1)><sin(phi1+phi2)>>
2852 // 16th bin: <<cos(phi1)><cos(phi1-phi2-phi3)>>
2853 // 17th bin: <<cos(phi1)><sin(phi1-phi2-phi3)>>
2854 // 18th bin: <<sin(phi1)><cos(phi1+phi2)>>
2855 // 19th bin: <<sin(phi1)><sin(phi1+phi2)>>
2856 // 20th bin: <<sin(phi1)><cos(phi1-phi2-phi3)>>
2857 // 21st bin: <<sin(phi1)><sin(phi1-phi2-phi3)>>
2858 // 22nd bin: <<cos(phi1+phi2)><sin(phi1+phi2)>>
2859 // 23rd bin: <<cos(phi1+phi2)><cos(phi1-phi2-phi3)>>
2860 // 24th bin: <<cos(phi1+phi2)><sin(phi1-phi2-phi3)>>
2861 // 25th bin: <<sin(phi1+phi2)><cos(phi1-phi2-phi3)>>
2862 // 26th bin: <<sin(phi1+phi2)><sin(phi1-phi2-phi3)>>
2863 // 27th bin: <<cos(phi1-phi2-phi3)><sin(phi1-phi2-phi3)>>
2864
2865 // <<2><cos(phi)>>:
2866 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(0.5,
2867 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1),
2868 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
2869 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
2870 // <<2><sin(phi)>>:
2871 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(1.5,
2872 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1),
2873 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
2874 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
2875 // <<cos(phi)><sin(phi)>>:
2876 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(2.5,
2877 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1),
2878 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
2879 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
2880 // <<2><cos(phi1+phi2)>>:
2881 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(3.5,
2882 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
2883 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
2884 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
2885 // <<2><sin(phi1+phi2)>>:
2886 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(4.5,
2887 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
2888 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
2889 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
2890 // <<2><cos(phi1-phi2-phi3)>>:
2891 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(5.5,
2892 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
2893 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
2894 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
2895 // <<2><sin(phi1-phi2-phi3)>>:
2896 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(6.5,
2897 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
2898 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
2899 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
2900 // <<4><cos(phi1)>>:
2901 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(7.5,
2902 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1),
2903 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
2904 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
2905 // <<4><sin(phi1)>>:
2906 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(8.5,
2907 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1),
2908 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
2909 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
2910 // <<4><cos(phi1+phi2)>>:
2911 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(9.5,
2912 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
2913 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
2914 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
2915 // <<4><sin(phi1+phi2)>>:
2916 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(10.5,
2917 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
2918 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
2919 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
2920 // <<4><cos(phi1-phi2-phi3)>>:
2921 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(11.5,
2922 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
2923 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
2924 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
2925 // <<4><sin(phi1-phi2-phi3)>>:
2926 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(12.5,
2927 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
2928 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
2929 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
2930 // <<cos(phi1)><cos(phi1+phi2)>>:
2931 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(13.5,
2932 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
2933 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
2934 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
2935 // <<cos(phi1)><sin(phi1+phi2)>>:
2936 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(14.5,
2937 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
2938 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
2939 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
2940 // <<cos(phi1)><cos(phi1-phi2-phi3)>>:
2941 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(15.5,
2942 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
2943 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
2944 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
2945 // <<cos(phi1)><sin(phi1-phi2-phi3)>>:
2946 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(16.5,
2947 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
2948 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
2949 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
2950 // <<sin(phi1)><cos(phi1+phi2)>>:
2951 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(17.5,
2952 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
2953 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
2954 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
2955 // <<sin(phi1)><sin(phi1+phi2)>>:
2956 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(18.5,
2957 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
2958 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
2959 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
2960 // <<sin(phi1)><cos(phi1-phi2-phi3)>>:
2961 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(19.5,
2962 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
2963 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
2964 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
2965 // <<sin(phi1)><sin(phi1-phi2-phi3)>>:
2966 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(20.5,
2967 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
2968 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
2969 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
2970 // <<cos(phi1+phi2)><sin(phi1+phi2)>>:
2971 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(21.5,
2972 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
2973 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)
2974 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
2975 // <<cos(phi1+phi2)><cos(phi1-phi2-phi3)>>:
2976 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(22.5,
2977 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
2978 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)
2979 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
2980 // <<cos(phi1+phi2)><sin(phi1-phi2-phi3)>>:
2981 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(23.5,
2982 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
2983 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)
2984 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
2985 // <<sin(phi1+phi2)><cos(phi1-phi2-phi3)>>:
2986 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(24.5,
2987 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
2988 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)
2989 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
2990 // <<sin(phi1+phi2)><sin(phi1-phi2-phi3)>>:
2991 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(25.5,
2992 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
2993 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)
2994 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
2995 // <<cos(phi1-phi2-phi3)><sin(phi1-phi2-phi3)>>:
2996 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(26.5,
2997 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
2998 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3)
2999 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3000
3001} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrectionTermsForNUA()
3002
3003
3004//================================================================================================================================
3005
3006
489d5531 3007void AliFlowAnalysisWithQCumulants::CalculateCovariancesIntFlow()
3008{
3009 // a) Calculate unbiased estimators Cov(<2>,<4>), Cov(<2>,<6>), Cov(<2>,<8>), Cov(<4>,<6>), Cov(<4>,<8>) and Cov(<6>,<8>)
3010 // for covariances V_(<2>,<4>), V_(<2>,<6>), V_(<2>,<8>), V_(<4>,<6>), V_(<4>,<8>) and V_(<6>,<8>).
3011 // b) Store in histogram fIntFlowCovariances for instance the following:
3012 //
3013 // 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)]
3014 //
3015 // where N is the number of events, w_{<2>} is event weight for <2> and w_{<4>} is event weight for <4>.
3016 // c) Binning of fIntFlowCovariances is organized as follows:
3017 //
3018 // 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)]
3019 // 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)]
3020 // 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)]
3021 // 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)]
3022 // 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)]
3023 // 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)]
3024
3025 for(Int_t power=0;power<2;power++)
3026 {
3027 if(!(fIntFlowCorrelationsPro && fIntFlowProductOfCorrelationsPro
3028 && fIntFlowSumOfEventWeights[power] && fIntFlowSumOfProductOfEventWeights
3029 && fIntFlowCovariances))
3030 {
3031 cout<<"WARNING: fIntFlowCorrelationsPro && fIntFlowProductOfCorrelationsPro "<<endl;
3032 cout<<" && fIntFlowSumOfEventWeights[power] && fIntFlowSumOfProductOfEventWeights"<<endl;
3033 cout<<" && fIntFlowCovariances is NULL in AFAWQC::FCIF() !!!!"<<endl;
3034 cout<<"power = "<<power<<endl;
3035 exit(0);
3036 }
3037 }
3038
3039 // average 2-, 4-, 6- and 8-particle correlations for all events:
3040 Double_t correlation[4] = {0.};
3041 for(Int_t ci=0;ci<4;ci++)
3042 {
3043 correlation[ci] = fIntFlowCorrelationsPro->GetBinContent(ci+1);
3044 }
3045 // average products of 2-, 4-, 6- and 8-particle correlations:
3046 Double_t productOfCorrelations[4][4] = {{0.}};
3047 Int_t productOfCorrelationsLabel = 1;
3048 // denominators in the expressions for the unbiased estimator for covariance:
3049 Double_t denominator[4][4] = {{0.}};
3050 Int_t sumOfProductOfEventWeightsLabel1 = 1;
3051 // weight dependent prefactor which multiply unbiased estimators for covariances:
3052 Double_t wPrefactor[4][4] = {{0.}};
3053 Int_t sumOfProductOfEventWeightsLabel2 = 1;
3054 for(Int_t c1=0;c1<4;c1++)
3055 {
3056 for(Int_t c2=c1+1;c2<4;c2++)
3057 {
3058 productOfCorrelations[c1][c2] = fIntFlowProductOfCorrelationsPro->GetBinContent(productOfCorrelationsLabel);
3059 if(fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1) && fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1))
3060 {
3061 denominator[c1][c2] = 1.-(fIntFlowSumOfProductOfEventWeights->GetBinContent(sumOfProductOfEventWeightsLabel1))/
3062 (fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1)
3063 * fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1));
3064
3065 wPrefactor[c1][c2] = fIntFlowSumOfProductOfEventWeights->GetBinContent(sumOfProductOfEventWeightsLabel2)/
3066 (fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1)
3067 * fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1));
3068
3069
3070 }
3071 productOfCorrelationsLabel++;
3072 sumOfProductOfEventWeightsLabel1++;
3073 sumOfProductOfEventWeightsLabel2++;
3074 }
3075 }
3076
3077 // covariance label:
3078 Int_t covarianceLabel = 1;
3079 for(Int_t c1=0;c1<4;c1++)
3080 {
3081 for(Int_t c2=c1+1;c2<4;c2++)
3082 {
3083 if(denominator[c1][c2])
3084 {
3085 // covariances:
3086 Double_t cov = (productOfCorrelations[c1][c2]-correlation[c1]*correlation[c2])/denominator[c1][c2];
3087 // covarianced multiplied with weight dependent prefactor:
3088 Double_t wCov = cov * wPrefactor[c1][c2];
3089 fIntFlowCovariances->SetBinContent(covarianceLabel,wCov);
3090 }
3091 covarianceLabel++;
3092 }
3093 }
3094
9da1a4f3 3095 // versus multiplicity:
3096 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
3097 for(Int_t b=1;b<=nBins;b++)
3098 {
3099 // average 2-, 4-, 6- and 8-particle correlations for all events:
3100 Double_t correlationVsM[4] = {0.};
3101 for(Int_t ci=0;ci<4;ci++)
3102 {
3103 correlationVsM[ci] = fIntFlowCorrelationsVsMPro[ci]->GetBinContent(b);
3104 } // end of for(Int_t ci=0;ci<4;ci++)
3105 // average products of 2-, 4-, 6- and 8-particle correlations:
3106 Double_t productOfCorrelationsVsM[4][4] = {{0.}};
3107 Int_t productOfCorrelationsLabelVsM = 1;
3108 // denominators in the expressions for the unbiased estimator for covariance:
3109 Double_t denominatorVsM[4][4] = {{0.}};
3110 Int_t sumOfProductOfEventWeightsLabel1VsM = 1;
3111 // weight dependent prefactor which multiply unbiased estimators for covariances:
3112 Double_t wPrefactorVsM[4][4] = {{0.}};
3113 Int_t sumOfProductOfEventWeightsLabel2VsM = 1;
3114 for(Int_t c1=0;c1<4;c1++)
3115 {
3116 for(Int_t c2=c1+1;c2<4;c2++)
3117 {
3118 productOfCorrelationsVsM[c1][c2] = fIntFlowProductOfCorrelationsVsMPro[productOfCorrelationsLabelVsM-1]->GetBinContent(b);
3119 if(fIntFlowSumOfEventWeightsVsM[c1][0]->GetBinContent(b) && fIntFlowSumOfEventWeightsVsM[c2][0]->GetBinContent(b))
3120 {
3121 denominatorVsM[c1][c2] = 1.-(fIntFlowSumOfProductOfEventWeightsVsM[sumOfProductOfEventWeightsLabel1VsM-1]->GetBinContent(b))/
3122 (fIntFlowSumOfEventWeightsVsM[c1][0]->GetBinContent(b)
3123 * fIntFlowSumOfEventWeightsVsM[c2][0]->GetBinContent(b));
3124
3125 wPrefactorVsM[c1][c2] = fIntFlowSumOfProductOfEventWeightsVsM[sumOfProductOfEventWeightsLabel2VsM-1]->GetBinContent(b)/
3126 (fIntFlowSumOfEventWeightsVsM[c1][0]->GetBinContent(b)
3127 * fIntFlowSumOfEventWeightsVsM[c2][0]->GetBinContent(b));
3128
3129
3130 }
3131 productOfCorrelationsLabelVsM++;
3132 sumOfProductOfEventWeightsLabel1VsM++;
3133 sumOfProductOfEventWeightsLabel2VsM++;
3134 } // end of for(Int_t c1=0;c1<4;c1++)
3135 } // end of for(Int_t c2=c1+1;c2<4;c2++)
3136 // covariance label:
3137 Int_t covarianceLabelVsM = 1;
3138 for(Int_t c1=0;c1<4;c1++)
3139 {
3140 for(Int_t c2=c1+1;c2<4;c2++)
3141 {
3142 if(denominatorVsM[c1][c2])
3143 {
3144 // covariances:
3145 Double_t covVsM = (productOfCorrelationsVsM[c1][c2]-correlationVsM[c1]*correlationVsM[c2])/denominatorVsM[c1][c2];
3146 // covarianced multiplied with weight dependent prefactor:
3147 Double_t wCovVsM = covVsM * wPrefactorVsM[c1][c2];
3148 fIntFlowCovariancesVsM[covarianceLabelVsM-1]->SetBinContent(b,wCovVsM);
3149 }
3150 covarianceLabelVsM++;
3151 }
3152 }
3153 } // end of for(Int_t b=1;b<=nBins;b++)
3154
489d5531 3155} // end of AliFlowAnalysisWithQCumulants::CalculateCovariancesIntFlow()
3156
489d5531 3157//================================================================================================================================
3158
0328db2d 3159void AliFlowAnalysisWithQCumulants::CalculateCovariancesNUAIntFlow()
3160{
3161 // a) Calculate unbiased estimators Cov(*,*) for true covariances V_(*,*) for NUA terms.
3162 // b) Store in histogram fIntFlowCovariancesNUA for instance the following:
3163 //
3164 // 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)]
3165 //
3166 // where N is the number of events, w_{<2>} is event weight for <2> and w_{<cos(phi)>} is event weight for <cos(phi)>.
3167 // c) Binning of fIntFlowCovariancesNUA is organized as follows:
3168 //
3169 // 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)]
3170 // 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)]
3171 // 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)]
3172 // ...
3173
3174 // Cov(<2>,<cos(phi)>):
3175 Double_t product1 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(1); // <<2><cos(phi)>>
3176 Double_t term1st1 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3177 Double_t term2nd1 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi)>>
3178 Double_t sumOfW1st1 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3179 Double_t sumOfW2nd1 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi)>}
3180 Double_t sumOfWW1 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(1); // W_{<2>} * W_{<cos(phi)>}
3181 // numerator in the expression for the the unbiased estimator for covariance:
3182 Double_t numerator1 = product1 - term1st1*term2nd1;
3183 // denominator in the expression for the the unbiased estimator for covariance:
3184 Double_t denominator1 = 1.-sumOfWW1/(sumOfW1st1*sumOfW2nd1);
3185 // covariance:
3186 Double_t covariance1 = numerator1/denominator1;
3187 // weight dependent prefactor for covariance:
3188 Double_t wPrefactor1 = sumOfWW1/(sumOfW1st1*sumOfW2nd1);
3189 // finally, store "weighted" covariance:
3190 fIntFlowCovariancesNUA->SetBinContent(1,wPrefactor1*covariance1);
3191
3192 // Cov(<2>,<sin(phi)>):
3193 Double_t product2 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(2); // <<2><sin(phi)>>
3194 Double_t term1st2 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3195 Double_t term2nd2 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi)>>
3196 Double_t sumOfW1st2 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3197 Double_t sumOfW2nd2 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi)>}
3198 Double_t sumOfWW2 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(2); // W_{<2>} * W_{<sin(phi)>}
3199 // numerator in the expression for the the unbiased estimator for covariance:
3200 Double_t numerator2 = product2 - term1st2*term2nd2;
3201 // denominator in the expression for the the unbiased estimator for covariance:
3202 Double_t denominator2 = 1.-sumOfWW2/(sumOfW1st2*sumOfW2nd2);
3203 // covariance:
3204 Double_t covariance2 = numerator2/denominator2;
3205 // weight dependent prefactor for covariance:
3206 Double_t wPrefactor2 = sumOfWW2/(sumOfW1st2*sumOfW2nd2);
3207 // finally, store "weighted" covariance:
3208 fIntFlowCovariancesNUA->SetBinContent(2,wPrefactor2*covariance2);
3209
3210 // Cov(<cos(phi)>,<sin(phi)>):
3211 Double_t product3 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(3); // <<cos(phi)><sin(phi)>>
3212 Double_t term1st3 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi)>>
3213 Double_t term2nd3 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi)>>
3214 Double_t sumOfW1st3 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi)>}
3215 Double_t sumOfW2nd3 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi)>}
3216 Double_t sumOfWW3 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(3); // W_{<cos(phi)>} * W_{<sin(phi)>}
3217 // numerator in the expression for the the unbiased estimator for covariance:
3218 Double_t numerator3 = product3 - term1st3*term2nd3;
3219 // denominator in the expression for the the unbiased estimator for covariance:
3220 Double_t denominator3 = 1.-sumOfWW3/(sumOfW1st3*sumOfW2nd3);
3221 // covariance:
3222 Double_t covariance3 = numerator3/denominator3;
3223 // weight dependent prefactor for covariance:
3224 Double_t wPrefactor3 = sumOfWW3/(sumOfW1st3*sumOfW2nd3);
3225 // finally, store "weighted" covariance:
3226 fIntFlowCovariancesNUA->SetBinContent(3,wPrefactor3*covariance3);
3227
3228 // Cov(<2>,<cos(phi1+phi2)>):
3229 Double_t product4 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(4); // <<2><cos(phi1+phi2)>>
3230 Double_t term1st4 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3231 Double_t term2nd4 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3232 Double_t sumOfW1st4 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3233 Double_t sumOfW2nd4 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3234 Double_t sumOfWW4 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(4); // W_{<2>} * W_{<cos(phi1+phi2)>}
3235 // numerator in the expression for the the unbiased estimator for covariance:
3236 Double_t numerator4 = product4 - term1st4*term2nd4;
3237 // denominator in the expression for the the unbiased estimator for covariance:
3238 Double_t denominator4 = 1.-sumOfWW4/(sumOfW1st4*sumOfW2nd4);
3239 // covariance:
3240 Double_t covariance4 = numerator4/denominator4;
3241 // weight dependent prefactor for covariance:
3242 Double_t wPrefactor4 = sumOfWW4/(sumOfW1st4*sumOfW2nd4);
3243 // finally, store "weighted" covariance:
3244 fIntFlowCovariancesNUA->SetBinContent(4,wPrefactor4*covariance4);
3245
3246 // Cov(<2>,<sin(phi1+phi2)>):
3247 Double_t product5 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(5); // <<2><sin(phi1+phi2)>>
3248 Double_t term1st5 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3249 Double_t term2nd5 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3250 Double_t sumOfW1st5 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3251 Double_t sumOfW2nd5 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3252 Double_t sumOfWW5 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(5); // W_{<2>} * W_{<sin(phi1+phi2)>}
3253 // numerator in the expression for the the unbiased estimator for covariance:
3254 Double_t numerator5 = product5 - term1st5*term2nd5;
3255 // denominator in the expression for the the unbiased estimator for covariance:
3256 Double_t denominator5 = 1.-sumOfWW5/(sumOfW1st5*sumOfW2nd5);
3257 // covariance:
3258 Double_t covariance5 = numerator5/denominator5;
3259 // weight dependent prefactor for covariance:
3260 Double_t wPrefactor5 = sumOfWW5/(sumOfW1st5*sumOfW2nd5);
3261 // finally, store "weighted" covariance:
3262 fIntFlowCovariancesNUA->SetBinContent(5,wPrefactor5*covariance5);
3263
3264 // Cov(<2>,<cos(phi1-phi2-phi3)>):
3265 Double_t product6 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(6); // <<2><cos(phi1-phi2-phi3)>>
3266 Double_t term1st6 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3267 Double_t term2nd6 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3268 Double_t sumOfW1st6 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3269 Double_t sumOfW2nd6 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3270 Double_t sumOfWW6 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(6); // W_{<2>} * W_{<cos(phi1-phi2-phi3)>}
3271 // numerator in the expression for the the unbiased estimator for covariance:
3272 Double_t numerator6 = product6 - term1st6*term2nd6;
3273 // denominator in the expression for the the unbiased estimator for covariance:
3274 Double_t denominator6 = 1.-sumOfWW6/(sumOfW1st6*sumOfW2nd6);
3275 // covariance:
3276 Double_t covariance6 = numerator6/denominator6;
3277 // weight dependent prefactor for covariance:
3278 Double_t wPrefactor6 = sumOfWW6/(sumOfW1st6*sumOfW2nd6);
3279 // finally, store "weighted" covariance:
3280 fIntFlowCovariancesNUA->SetBinContent(6,wPrefactor6*covariance6);
3281
3282 // Cov(<2>,<sin(phi1-phi2-phi3)>):
3283 Double_t product7 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(7); // <<2><sin(phi1-phi2-phi3)>>
3284 Double_t term1st7 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3285 Double_t term2nd7 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3286 Double_t sumOfW1st7 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3287 Double_t sumOfW2nd7 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3288 Double_t sumOfWW7 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(7); // W_{<2>} * W_{<sin(phi1-phi2-phi3)>}
3289 // numerator in the expression for the the unbiased estimator for covariance:
3290 Double_t numerator7 = product7 - term1st7*term2nd7;
3291 // denominator in the expression for the the unbiased estimator for covariance:
3292 Double_t denominator7 = 1.-sumOfWW7/(sumOfW1st7*sumOfW2nd7);
3293 // covariance:
3294 Double_t covariance7 = numerator7/denominator7;
3295 // weight dependent prefactor for covariance:
3296 Double_t wPrefactor7 = sumOfWW7/(sumOfW1st7*sumOfW2nd7);
3297 // finally, store "weighted" covariance:
3298 fIntFlowCovariancesNUA->SetBinContent(7,wPrefactor7*covariance7);
3299
3300 // Cov(<4>,<cos(phi1>):
3301 Double_t product8 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(8); // <<4><cos(phi1)>>
3302 Double_t term1st8 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3303 Double_t term2nd8 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
3304 Double_t sumOfW1st8 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3305 Double_t sumOfW2nd8 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
3306 Double_t sumOfWW8 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(8); // W_{<4>} * W_{<cos(phi1)>}
3307 // numerator in the expression for the the unbiased estimator for covariance:
3308 Double_t numerator8 = product8 - term1st8*term2nd8;
3309 // denominator in the expression for the the unbiased estimator for covariance:
3310 Double_t denominator8 = 1.-sumOfWW8/(sumOfW1st8*sumOfW2nd8);
3311 // covariance:
3312 Double_t covariance8 = numerator8/denominator8;
3313 // weight dependent prefactor for covariance:
3314 Double_t wPrefactor8 = sumOfWW8/(sumOfW1st8*sumOfW2nd8);
3315 // finally, store "weighted" covariance:
3316 fIntFlowCovariancesNUA->SetBinContent(8,wPrefactor8*covariance8);
3317
3318 // Cov(<4>,<sin(phi1)>):
3319 Double_t product9 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(9); // <<4><sin(phi1)>>
3320 Double_t term1st9 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3321 Double_t term2nd9 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
3322 Double_t sumOfW1st9 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3323 Double_t sumOfW2nd9 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
3324 Double_t sumOfWW9 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(9); // W_{<4>} * W_{<sin(phi1)>}
3325 // numerator in the expression for the the unbiased estimator for covariance:
3326 Double_t numerator9 = product9 - term1st9*term2nd9;
3327 // denominator in the expression for the the unbiased estimator for covariance:
3328 Double_t denominator9 = 1.-sumOfWW9/(sumOfW1st9*sumOfW2nd9);
3329 // covariance:
3330 Double_t covariance9 = numerator9/denominator9;
3331 // weight dependent prefactor for covariance:
3332 Double_t wPrefactor9 = sumOfWW9/(sumOfW1st9*sumOfW2nd9);
3333 // finally, store "weighted" covariance:
3334 fIntFlowCovariancesNUA->SetBinContent(9,wPrefactor9*covariance9);
3335
3336 // Cov(<4>,<cos(phi1+phi2)>):
3337 Double_t product10 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(10); // <<4><cos(phi1+phi2)>>
3338 Double_t term1st10 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3339 Double_t term2nd10 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3340 Double_t sumOfW1st10 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3341 Double_t sumOfW2nd10 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3342 Double_t sumOfWW10 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(10); // W_{<4>} * W_{<cos(phi1+phi2)>}
3343 // numerator in the expression for the the unbiased estimator for covariance:
3344 Double_t numerator10 = product10 - term1st10*term2nd10;
3345 // denominator in the expression for the the unbiased estimator for covariance:
3346 Double_t denominator10 = 1.-sumOfWW10/(sumOfW1st10*sumOfW2nd10);
3347 // covariance:
3348 Double_t covariance10 = numerator10/denominator10;
3349 // weight dependent prefactor for covariance:
3350 Double_t wPrefactor10 = sumOfWW10/(sumOfW1st10*sumOfW2nd10);
3351 // finally, store "weighted" covariance:
3352 fIntFlowCovariancesNUA->SetBinContent(10,wPrefactor10*covariance10);
3353
3354 // Cov(<4>,<sin(phi1+phi2)>):
3355 Double_t product11 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(11); // <<4><sin(phi1+phi2)>>
3356 Double_t term1st11 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3357 Double_t term2nd11 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3358 Double_t sumOfW1st11 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3359 Double_t sumOfW2nd11 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3360 Double_t sumOfWW11 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(11); // W_{<4>} * W_{<sin(phi1+phi2)>}
3361 // numerator in the expression for the the unbiased estimator for covariance:
3362 Double_t numerator11 = product11 - term1st11*term2nd11;
3363 // denominator in the expression for the the unbiased estimator for covariance:
3364 Double_t denominator11 = 1.-sumOfWW11/(sumOfW1st11*sumOfW2nd11);
3365 // covariance:
3366 Double_t covariance11 = numerator11/denominator11;
3367 // weight dependent prefactor for covariance:
3368 Double_t wPrefactor11 = sumOfWW11/(sumOfW1st11*sumOfW2nd11);
3369 // finally, store "weighted" covariance:
3370 fIntFlowCovariancesNUA->SetBinContent(11,wPrefactor11*covariance11);
3371
3372 // Cov(<4>,<cos(phi1-phi2-phi3)>):
3373 Double_t product12 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(12); // <<4><cos(phi1-phi2-phi3)>>
3374 Double_t term1st12 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3375 Double_t term2nd12 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3376 Double_t sumOfW1st12 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3377 Double_t sumOfW2nd12 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3378 Double_t sumOfWW12 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(12); // W_{<4>} * W_{<cos(phi1-phi2-phi3)>}
3379 // numerator in the expression for the the unbiased estimator for covariance:
3380 Double_t numerator12 = product12 - term1st12*term2nd12;
3381 // denominator in the expression for the the unbiased estimator for covariance:
3382 Double_t denominator12 = 1.-sumOfWW12/(sumOfW1st12*sumOfW2nd12);
3383 // covariance:
3384 Double_t covariance12 = numerator12/denominator12;
3385 // weight dependent prefactor for covariance:
3386 Double_t wPrefactor12 = sumOfWW12/(sumOfW1st12*sumOfW2nd12);
3387 // finally, store "weighted" covariance:
3388 fIntFlowCovariancesNUA->SetBinContent(12,wPrefactor12*covariance12);
3389
3390 // Cov(<4>,<sin(phi1-phi2-phi3)>):
3391 Double_t product13 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(13); // <<4><sin(phi1-phi2-phi3)>>
3392 Double_t term1st13 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3393 Double_t term2nd13 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3394 Double_t sumOfW1st13 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3395 Double_t sumOfW2nd13 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3396 Double_t sumOfWW13 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(13); // W_{<4>} * W_{<sin(phi1-phi2-phi3)>}
3397 // numerator in the expression for the the unbiased estimator for covariance:
3398 Double_t numerator13 = product13 - term1st13*term2nd13;
3399 // denominator in the expression for the the unbiased estimator for covariance:
3400 Double_t denominator13 = 1.-sumOfWW13/(sumOfW1st13*sumOfW2nd13);
3401 // covariance:
3402 Double_t covariance13 = numerator13/denominator13;
3403 // weight dependent prefactor for covariance:
3404 Double_t wPrefactor13 = sumOfWW13/(sumOfW1st13*sumOfW2nd13);
3405 // finally, store "weighted" covariance:
3406 fIntFlowCovariancesNUA->SetBinContent(13,wPrefactor13*covariance13);
3407
3408 // Cov(<cos(phi1)>,<cos(phi1+phi2)>):
3409 Double_t product14 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(14); // <<cos(phi1)><cos(phi1+phi2)>>
3410 Double_t term1st14 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
3411 Double_t term2nd14 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3412 Double_t sumOfW1st14 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
3413 Double_t sumOfW2nd14 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3414 Double_t sumOfWW14 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(14); // W_{<cos(phi1)>} * W_{<cos(phi1+phi2)>}
3415 // numerator in the expression for the the unbiased estimator for covariance:
3416 Double_t numerator14 = product14 - term1st14*term2nd14;
3417 // denominator in the expression for the the unbiased estimator for covariance:
3418 Double_t denominator14 = 1.-sumOfWW14/(sumOfW1st14*sumOfW2nd14);
3419 // covariance:
3420 Double_t covariance14 = numerator14/denominator14;
3421 // weight dependent prefactor for covariance:
3422 Double_t wPrefactor14 = sumOfWW14/(sumOfW1st14*sumOfW2nd14);
3423 // finally, store "weighted" covariance:
3424 fIntFlowCovariancesNUA->SetBinContent(14,wPrefactor14*covariance14);
3425
3426 // Cov(<cos(phi1)>,<sin(phi1+phi2)>):
3427 Double_t product15 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(15); // <<cos(phi1)><sin(phi1+phi2)>>
3428 Double_t term1st15 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
3429 Double_t term2nd15 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3430 Double_t sumOfW1st15 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
3431 Double_t sumOfW2nd15 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3432 Double_t sumOfWW15 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(15); // W_{<cos(phi1)>} * W_{<sin(phi1+phi2)>}
3433 // numerator in the expression for the the unbiased estimator for covariance:
3434 Double_t numerator15 = product15 - term1st15*term2nd15;
3435 // denominator in the expression for the the unbiased estimator for covariance:
3436 Double_t denominator15 = 1.-sumOfWW15/(sumOfW1st15*sumOfW2nd15);
3437 // covariance:
3438 Double_t covariance15 = numerator15/denominator15;
3439 // weight dependent prefactor for covariance:
3440 Double_t wPrefactor15 = sumOfWW15/(sumOfW1st15*sumOfW2nd15);
3441 // finally, store "weighted" covariance:
3442 fIntFlowCovariancesNUA->SetBinContent(15,wPrefactor15*covariance15);
3443
3444 // Cov(<cos(phi1)>,<cos(phi1-phi2-phi3)>):
3445 Double_t product16 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(16); // <<cos(phi1)><cos(phi1-phi2-phi3)>>
3446 Double_t term1st16 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
3447 Double_t term2nd16 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3448 Double_t sumOfW1st16 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
3449 Double_t sumOfW2nd16 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3450 Double_t sumOfWW16 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(16); // W_{<cos(phi1)>} * W_{<cos(phi1-phi2-phi3)>}
3451 // numerator in the expression for the the unbiased estimator for covariance:
3452 Double_t numerator16 = product16 - term1st16*term2nd16;
3453 // denominator in the expression for the the unbiased estimator for covariance:
3454 Double_t denominator16 = 1.-sumOfWW16/(sumOfW1st16*sumOfW2nd16);
3455 // covariance:
3456 Double_t covariance16 = numerator16/denominator16;
3457 // weight dependent prefactor for covariance:
3458 Double_t wPrefactor16 = sumOfWW16/(sumOfW1st16*sumOfW2nd16);
3459 // finally, store "weighted" covariance:
3460 fIntFlowCovariancesNUA->SetBinContent(16,wPrefactor16*covariance16);
3461
3462 // Cov(<cos(phi1)>,<sin(phi1-phi2-phi3)>):
3463 Double_t product17 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(17); // <<cos(phi1)><sin(phi1-phi2-phi3)>>
3464 Double_t term1st17 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
3465 Double_t term2nd17 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3466 Double_t sumOfW1st17 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
3467 Double_t sumOfW2nd17 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3468 Double_t sumOfWW17 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(17); // W_{<cos(phi1)>} * W_{<sin(phi1-phi2-phi3)>}
3469 // numerator in the expression for the the unbiased estimator for covariance:
3470 Double_t numerator17 = product17 - term1st17*term2nd17;
3471 // denominator in the expression for the the unbiased estimator for covariance:
3472 Double_t denominator17 = 1.-sumOfWW17/(sumOfW1st17*sumOfW2nd17);
3473 // covariance:
3474 Double_t covariance17 = numerator17/denominator17;
3475 // weight dependent prefactor for covariance:
3476 Double_t wPrefactor17 = sumOfWW17/(sumOfW1st17*sumOfW2nd17);
3477 // finally, store "weighted" covariance:
3478 fIntFlowCovariancesNUA->SetBinContent(17,wPrefactor17*covariance17);
3479
3480 // Cov(<sin(phi1)>,<cos(phi1+phi2)>):
3481 Double_t product18 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(18); // <<sin(phi1)><cos(phi1+phi2)>>
3482 Double_t term1st18 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
3483 Double_t term2nd18 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3484 Double_t sumOfW1st18 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
3485 Double_t sumOfW2nd18 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3486 Double_t sumOfWW18 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(18); // W_{<sin(phi1)>} * W_{<cos(phi1+phi2)>}
3487 // numerator in the expression for the the unbiased estimator for covariance:
3488 Double_t numerator18 = product18 - term1st18*term2nd18;
3489 // denominator in the expression for the the unbiased estimator for covariance:
3490 Double_t denominator18 = 1.-sumOfWW18/(sumOfW1st18*sumOfW2nd18);
3491 // covariance:
3492 Double_t covariance18 = numerator18/denominator18;
3493 // weight dependent prefactor for covariance:
3494 Double_t wPrefactor18 = sumOfWW18/(sumOfW1st18*sumOfW2nd18);
3495 // finally, store "weighted" covariance:
3496 fIntFlowCovariancesNUA->SetBinContent(18,wPrefactor18*covariance18);
3497
3498 // Cov(<sin(phi1)>,<sin(phi1+phi2)>):
3499 Double_t product19 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(19); // <<sin(phi1)><sin(phi1+phi2)>>
3500 Double_t term1st19 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
3501 Double_t term2nd19 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3502 Double_t sumOfW1st19 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
3503 Double_t sumOfW2nd19 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3504 Double_t sumOfWW19 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(19); // W_{<sin(phi1)>} * W_{<sin(phi1+phi2)>}
3505 // numerator in the expression for the the unbiased estimator for covariance:
3506 Double_t numerator19 = product19 - term1st19*term2nd19;
3507 // denominator in the expression for the the unbiased estimator for covariance:
3508 Double_t denominator19 = 1.-sumOfWW19/(sumOfW1st19*sumOfW2nd19);
3509 // covariance:
3510 Double_t covariance19 = numerator19/denominator19;
3511 // weight dependent prefactor for covariance:
3512 Double_t wPrefactor19 = sumOfWW19/(sumOfW1st19*sumOfW2nd19);
3513 // finally, store "weighted" covariance:
3514 fIntFlowCovariancesNUA->SetBinContent(19,wPrefactor19*covariance19);
3515
3516 // Cov(<sin(phi1)>,<cos(phi1-phi2-phi3)>):
3517 Double_t product20 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(20); // <<sin(phi1)><cos(phi1-phi2-phi3)>>
3518 Double_t term1st20 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
3519 Double_t term2nd20 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3520 Double_t sumOfW1st20 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
3521 Double_t sumOfW2nd20 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3522 Double_t sumOfWW20 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(20); // W_{<sin(phi1)>} * W_{<cos(phi1-phi2-phi3)>}
3523 // numerator in the expression for the the unbiased estimator for covariance:
3524 Double_t numerator20 = product20 - term1st20*term2nd20;
3525 // denominator in the expression for the the unbiased estimator for covariance:
3526 Double_t denominator20 = 1.-sumOfWW20/(sumOfW1st20*sumOfW2nd20);
3527 // covariance:
3528 Double_t covariance20 = numerator20/denominator20;
3529 // weight dependent prefactor for covariance:
3530 Double_t wPrefactor20 = sumOfWW20/(sumOfW1st20*sumOfW2nd20);
3531 // finally, store "weighted" covariance:
3532 fIntFlowCovariancesNUA->SetBinContent(20,wPrefactor20*covariance20);
3533
3534 // Cov(<sin(phi1)>,<sin(phi1-phi2-phi3)>):
3535 Double_t product21 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(21); // <<sin(phi1)><sin(phi1-phi2-phi3)>>
3536 Double_t term1st21 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
3537 Double_t term2nd21 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3538 Double_t sumOfW1st21 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
3539 Double_t sumOfW2nd21 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3540 Double_t sumOfWW21 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(21); // W_{<sin(phi1)>} * W_{<sin(phi1-phi2-phi3)>}
3541 // numerator in the expression for the the unbiased estimator for covariance:
3542 Double_t numerator21 = product21 - term1st21*term2nd21;
3543 // denominator in the expression for the the unbiased estimator for covariance:
3544 Double_t denominator21 = 1.-sumOfWW21/(sumOfW1st21*sumOfW2nd21);
3545 // covariance:
3546 Double_t covariance21 = numerator21/denominator21;
3547 // weight dependent prefactor for covariance:
3548 Double_t wPrefactor21 = sumOfWW21/(sumOfW1st21*sumOfW2nd21);
3549 // finally, store "weighted" covariance:
3550 fIntFlowCovariancesNUA->SetBinContent(21,wPrefactor21*covariance21);
3551
3552 // Cov(<cos(phi1+phi2)>,<sin(phi1+phi2)>):
3553 Double_t product22 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(22); // <<cos(phi1+phi2)><sin(phi1+phi2)>>
3554 Double_t term1st22 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3555 Double_t term2nd22 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3556 Double_t sumOfW1st22 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3557 Double_t sumOfW2nd22 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3558 Double_t sumOfWW22 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(22); // W_{<cos(phi1+phi2)>} * W_{<sin(phi1+phi2)>}
3559 // numerator in the expression for the the unbiased estimator for covariance:
3560 Double_t numerator22 = product22 - term1st22*term2nd22;
3561 // denominator in the expression for the the unbiased estimator for covariance:
3562 Double_t denominator22 = 1.-sumOfWW22/(sumOfW1st22*sumOfW2nd22);
3563 // covariance:
3564 Double_t covariance22 = numerator22/denominator22;
3565 // weight dependent prefactor for covariance:
3566 Double_t wPrefactor22 = sumOfWW22/(sumOfW1st22*sumOfW2nd22);
3567 // finally, store "weighted" covariance:
3568 fIntFlowCovariancesNUA->SetBinContent(22,wPrefactor22*covariance22);
3569
3570 // Cov(<cos(phi1+phi2)>,<cos(phi1-phi2-phi3)>):
3571 Double_t product23 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(23); // <<cos(phi1+phi2)><cos(phi1-phi2-phi3)>>
3572 Double_t term1st23 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3573 Double_t term2nd23 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3574 Double_t sumOfW1st23 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3575 Double_t sumOfW2nd23 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3576 Double_t sumOfWW23 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(23); // W_{<cos(phi1+phi2)>} * W_{<cos(phi1-phi2-phi3)>}
3577 // numerator in the expression for the the unbiased estimator for covariance:
3578 Double_t numerator23 = product23 - term1st23*term2nd23;
3579 // denominator in the expression for the the unbiased estimator for covariance:
3580 Double_t denominator23 = 1.-sumOfWW23/(sumOfW1st23*sumOfW2nd23);
3581 // covariance:
3582 Double_t covariance23 = numerator23/denominator23;
3583 // weight dependent prefactor for covariance:
3584 Double_t wPrefactor23 = sumOfWW23/(sumOfW1st23*sumOfW2nd23);
3585 // finally, store "weighted" covariance:
3586 fIntFlowCovariancesNUA->SetBinContent(23,wPrefactor23*covariance23);
3587
3588 // Cov(<cos(phi1+phi2)>,<sin(phi1-phi2-phi3)>):
3589 Double_t product24 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(24); // <<cos(phi1+phi2)><sin(phi1-phi2-phi3)>>
3590 Double_t term1st24 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3591 Double_t term2nd24 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3592 Double_t sumOfW1st24 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3593 Double_t sumOfW2nd24 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3594 Double_t sumOfWW24 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(24); // W_{<cos(phi1+phi2)>} * W_{<sin(phi1-phi2-phi3)>}
3595 // numerator in the expression for the the unbiased estimator for covariance:
3596 Double_t numerator24 = product24 - term1st24*term2nd24;
3597 // denominator in the expression for the the unbiased estimator for covariance:
3598 Double_t denominator24 = 1.-sumOfWW24/(sumOfW1st24*sumOfW2nd24);
3599 // covariance:
3600 Double_t covariance24 = numerator24/denominator24;
3601 // weight dependent prefactor for covariance:
3602 Double_t wPrefactor24 = sumOfWW24/(sumOfW1st24*sumOfW2nd24);
3603 // finally, store "weighted" covariance:
3604 fIntFlowCovariancesNUA->SetBinContent(24,wPrefactor24*covariance24);
3605
3606 // Cov(<sin(phi1+phi2)>,<cos(phi1-phi2-phi3)>):
3607 Double_t product25 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(25); // <<sin(phi1+phi2)><cos(phi1-phi2-phi3)>>
3608 Double_t term1st25 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3609 Double_t term2nd25 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3610 Double_t sumOfW1st25 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3611 Double_t sumOfW2nd25 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3612 Double_t sumOfWW25 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(25); // W_{<sin(phi1+phi2)>} * W_{<cos(phi1-phi2-phi3)>}
3613 // numerator in the expression for the the unbiased estimator for covariance:
3614 Double_t numerator25 = product25 - term1st25*term2nd25;
3615 // denominator in the expression for the the unbiased estimator for covariance:
3616 Double_t denominator25 = 1.-sumOfWW25/(sumOfW1st25*sumOfW2nd25);
3617 // covariance:
3618 Double_t covariance25 = numerator25/denominator25;
3619 // weight dependent prefactor for covariance:
3620 Double_t wPrefactor25 = sumOfWW25/(sumOfW1st25*sumOfW2nd25);
3621 // finally, store "weighted" covariance:
3622 fIntFlowCovariancesNUA->SetBinContent(25,wPrefactor25*covariance25);
3623
3624 // Cov(<sin(phi1+phi2)>,<sin(phi1-phi2-phi3)>):
3625 Double_t product26 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(26); // <<sin(phi1+phi2)><sin(phi1-phi2-phi3)>>
3626 Double_t term1st26 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3627 Double_t term2nd26 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3628 Double_t sumOfW1st26 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3629 Double_t sumOfW2nd26 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3630 Double_t sumOfWW26 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(26); // W_{<sin(phi1+phi2)>} * W_{<sin(phi1-phi2-phi3)>}
3631 // numerator in the expression for the the unbiased estimator for covariance:
3632 Double_t numerator26 = product26 - term1st26*term2nd26;
3633 // denominator in the expression for the the unbiased estimator for covariance:
3634 Double_t denominator26 = 1.-sumOfWW26/(sumOfW1st26*sumOfW2nd26);
3635 // covariance:
3636 Double_t covariance26 = numerator26/denominator26;
3637 // weight dependent prefactor for covariance:
3638 Double_t wPrefactor26 = sumOfWW26/(sumOfW1st26*sumOfW2nd26);
3639 // finally, store "weighted" covariance:
3640 fIntFlowCovariancesNUA->SetBinContent(26,wPrefactor26*covariance26);
3641
3642 // Cov(<cos(phi1-phi2-phi3)>,<sin(phi1-phi2-phi3)>):
3643 Double_t product27 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(27); // <<cos(phi1-phi2-phi3)><sin(phi1-phi2-phi3)>>
3644 Double_t term1st27 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1-phi2-phi3)>>
3645 Double_t term2nd27 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3646 Double_t sumOfW1st27 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1-phi2-phi3)>}
3647 Double_t sumOfW2nd27 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3648 Double_t sumOfWW27 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(27); // W_{<cos(phi1-phi2-phi3)>} * W_{<sin(phi1-phi2-phi3)>}
3649 // numerator in the expression for the the unbiased estimator for covariance:
3650 Double_t numerator27 = product27 - term1st27*term2nd27;
3651 // denominator in the expression for the the unbiased estimator for covariance:
3652 Double_t denominator27 = 1.-sumOfWW27/(sumOfW1st27*sumOfW2nd27);
3653 // covariance:
3654 Double_t covariance27 = numerator27/denominator27;
3655 // weight dependent prefactor for covariance:
3656 Double_t wPrefactor27 = sumOfWW27/(sumOfW1st27*sumOfW2nd27);
3657 // finally, store "weighted" covariance:
3658 fIntFlowCovariancesNUA->SetBinContent(27,wPrefactor27*covariance27);
3659
3660} // end of AliFlowAnalysisWithQCumulants::CalculateCovariancesNUAIntFlow()
3661
3662
3663//================================================================================================================================
3664
3665
489d5531 3666void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsIntFlow()
3667{
3668 // From profile fIntFlowCorrelationsPro access measured correlations and spread,
3669 // correctly calculate the statistical errors and store the final results and
3670 // statistical errors for correlations in histogram fIntFlowCorrelationsHist.
3671 //
3672 // Remark: Statistical error of correlation is calculated as:
3673 //
3674 // statistical error = termA * spread * termB:
3675 // termA = sqrt{sum_{i=1}^{N} w^2}/(sum_{i=1}^{N} w)
3676 // termB = 1/sqrt(1-termA^2)
3677
3678 for(Int_t power=0;power<2;power++)
3679 {
3680 if(!(fIntFlowCorrelationsHist && fIntFlowCorrelationsPro && fIntFlowSumOfEventWeights[power]))
3681 {
3682 cout<<"WARNING: fIntFlowCorrelationsHist && fIntFlowCorrelationsPro && fIntFlowSumOfEventWeights[power] is NULL in AFAWQC::FCIF() !!!!"<<endl;
3683 cout<<"power = "<<power<<endl;
3684 exit(0);
3685 }
3686 }
3687
3688 for(Int_t ci=1;ci<=4;ci++) // correlation index
3689 {
3690 Double_t correlation = fIntFlowCorrelationsPro->GetBinContent(ci);
3691 Double_t spread = fIntFlowCorrelationsPro->GetBinError(ci);
3692 Double_t sumOfLinearEventWeights = fIntFlowSumOfEventWeights[0]->GetBinContent(ci);
3693 Double_t sumOfQuadraticEventWeights = fIntFlowSumOfEventWeights[1]->GetBinContent(ci);
3694 Double_t termA = 0.;
3695 Double_t termB = 0.;
3696 if(sumOfLinearEventWeights)
3697 {
3698 termA = pow(sumOfQuadraticEventWeights,0.5)/sumOfLinearEventWeights;
3699 } else
3700 {
3701 cout<<"WARNING: sumOfLinearEventWeights == 0 in AFAWQC::FCIF() !!!!"<<endl;
3702 cout<<" (for "<<2*ci<<"-particle correlation)"<<endl;
3703 }
3704 if(1.-pow(termA,2.) > 0.)
3705 {
3706 termB = 1./pow(1-pow(termA,2.),0.5);
3707 } else
3708 {
3709 cout<<"WARNING: 1.-pow(termA,2.) <= 0 in AFAWQC::FCIF() !!!!"<<endl;
3710 cout<<" (for "<<2*ci<<"-particle correlation)"<<endl;
3711 }
3712 Double_t statisticalError = termA * spread * termB;
3713 fIntFlowCorrelationsHist->SetBinContent(ci,correlation);
3714 fIntFlowCorrelationsHist->SetBinError(ci,statisticalError);
ff70ca91 3715 } // end of for(Int_t ci=1;ci<=4;ci++) // correlation index
3716
3717 // versus multiplicity:
3718 for(Int_t ci=0;ci<=3;ci++) // correlation index
3719 {
3720 Int_t nBins = fIntFlowCorrelationsVsMPro[ci]->GetNbinsX();
3721 for(Int_t b=1;b<=nBins;b++) // looping over multiplicity bins
3722 {
3723 Double_t correlationVsM = fIntFlowCorrelationsVsMPro[ci]->GetBinContent(b);
3724 Double_t spreadVsM = fIntFlowCorrelationsVsMPro[ci]->GetBinError(b);
3725 Double_t sumOfLinearEventWeightsVsM = fIntFlowSumOfEventWeightsVsM[ci][0]->GetBinContent(b);
3726 Double_t sumOfQuadraticEventWeightsVsM = fIntFlowSumOfEventWeightsVsM[ci][1]->GetBinContent(b);
3727 Double_t termAVsM = 0.;
3728 Double_t termBVsM = 0.;
3729 if(sumOfLinearEventWeightsVsM)
3730 {
3731 termAVsM = pow(sumOfQuadraticEventWeightsVsM,0.5)/sumOfLinearEventWeightsVsM;
3732 } else
3733 {
9da1a4f3 3734 //cout<<"WARNING: sumOfLinearEventWeightsVsM == 0 in AFAWQC::FCIF() !!!!"<<endl;
3735 //cout<<" (for "<<2*(ci+1)<<"-particle correlation versus multiplicity)"<<endl;
ff70ca91 3736 }
3737 if(1.-pow(termAVsM,2.) > 0.)
3738 {
3739 termBVsM = 1./pow(1-pow(termAVsM,2.),0.5);
3740 } else
3741 {
9da1a4f3 3742 //cout<<"WARNING: 1.-pow(termAVsM,2.) <= 0 in AFAWQC::FCIF() !!!!"<<endl;
3743 //cout<<" (for "<<2*(ci+1)<<"-particle correlation versus multiplicity)"<<endl;
ff70ca91 3744 }
3745 Double_t statisticalErrorVsM = termAVsM * spreadVsM * termBVsM;
3746 fIntFlowCorrelationsVsMHist[ci]->SetBinContent(b,correlationVsM);
3747 fIntFlowCorrelationsVsMHist[ci]->SetBinError(b,statisticalErrorVsM);
3748 } // end of for(Int_t b=1;b<=nBins;b++)
3749 } // end of for(Int_t ci=1;ci<=4;ci++) // correlation index
3750
489d5531 3751} // end of AliFlowAnalysisWithQCumulants::FinalizeCorrelationsIntFlow()
3752
489d5531 3753//================================================================================================================================
3754
489d5531 3755void AliFlowAnalysisWithQCumulants::FillAverageMultiplicities(Int_t nRP)
3756{
3757 // Fill profile fAverageMultiplicity to hold average multiplicities and number of events for events with nRP>=0, nRP>=1, ... , and nRP>=8
3758
3759 // Binning of fAverageMultiplicity is organized as follows:
3760 // 1st bin: all events (including the empty ones)
3761 // 2nd bin: event with # of RPs greater or equal to 1
3762 // 3rd bin: event with # of RPs greater or equal to 2
3763 // 4th bin: event with # of RPs greater or equal to 3
3764 // 5th bin: event with # of RPs greater or equal to 4
3765 // 6th bin: event with # of RPs greater or equal to 5
3766 // 7th bin: event with # of RPs greater or equal to 6
3767 // 8th bin: event with # of RPs greater or equal to 7
3768 // 9th bin: event with # of RPs greater or equal to 8
3769
3770 if(!fAvMultiplicity)
3771 {
3772 cout<<"WARNING: fAvMultiplicity is NULL in AFAWQC::FAM() !!!!"<<endl;
3773 exit(0);
3774 }
3775
3776 if(nRP<0)
3777 {
3778 cout<<"WARNING: nRP<0 in in AFAWQC::FAM() !!!!"<<endl;
3779 exit(0);
3780 }
3781
3782 for(Int_t i=0;i<9;i++)
3783 {
3784 if(nRP>=i) fAvMultiplicity->Fill(i+0.5,nRP,1);
3785 }
3786
3787} // end of AliFlowAnalysisWithQCumulants::FillAverageMultiplicities(nRP)
3788
3789
3790//================================================================================================================================
3791
3792
3793void AliFlowAnalysisWithQCumulants::CalculateCumulantsIntFlow()
3794{
3795 // a) Calculate Q-cumulants from the measured multiparticle correlations.
3796 // b) Propagate the statistical errors of measured multiparticle correlations to statistical errors of Q-cumulants.
3797 // c) REMARK: Q-cumulants calculated in this method are biased by non-uniform acceptance of detector !!!!
3798 // Method ApplyCorrectionForNonUniformAcceptance* (to be improved: finalize the name here)
3799 // is called afterwards to correct for this bias.
3800 // d) Store the results and statistical error of Q-cumulants in histogram fCumulants.
3801 // Binning of fCumulants is organized as follows:
3802 //
3803 // 1st bin: QC{2}
3804 // 2nd bin: QC{4}
3805 // 3rd bin: QC{6}
3806 // 4th bin: QC{8}
3807
3808 if(!(fIntFlowCorrelationsHist && fIntFlowCovariances && fIntFlowQcumulants))
3809 {
3810 cout<<"WARNING: fIntFlowCorrelationsHist && fIntFlowCovariances && fIntFlowQcumulants is NULL in AFAWQC::CCIF() !!!!"<<endl;
3811 exit(0);
3812 }
3813
3814 // correlations:
3815 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
3816 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
3817 Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
3818 Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
3819
3820 // statistical errors of average 2-, 4-, 6- and 8-particle azimuthal correlations:
3821 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <2>
3822 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <4>
3823 Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <6>
3824 Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <8>
3825
3826 // covariances (multiplied by prefactor depending on weights - see comments in CalculateCovariancesIntFlow()):
3827 Double_t wCov24 = fIntFlowCovariances->GetBinContent(1); // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
3828 Double_t wCov26 = fIntFlowCovariances->GetBinContent(2); // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)
3829 Double_t wCov28 = fIntFlowCovariances->GetBinContent(3); // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)
3830 Double_t wCov46 = fIntFlowCovariances->GetBinContent(4); // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)
3831 Double_t wCov48 = fIntFlowCovariances->GetBinContent(5); // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)
3832 Double_t wCov68 = fIntFlowCovariances->GetBinContent(6); // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)
3833
3834 // Q-cumulants:
3835 Double_t qc2 = 0.; // QC{2}
3836 Double_t qc4 = 0.; // QC{4}
3837 Double_t qc6 = 0.; // QC{6}
3838 Double_t qc8 = 0.; // QC{8}
3839 if(two) qc2 = two;
3840 if(four) qc4 = four-2.*pow(two,2.);
3841 if(six) qc6 = six-9.*two*four+12.*pow(two,3.);
3842 if(eight) qc8 = eight-16.*two*six-18.*pow(four,2.)+144.*pow(two,2.)*four-144.*pow(two,4.);
3843
3844 // statistical errors of Q-cumulants:
3845 Double_t qc2Error = 0.;
3846 Double_t qc4Error = 0.;
3847 Double_t qc6Error = 0.;
3848 Double_t qc8Error = 0.;
3849
3850 // squared statistical errors of Q-cumulants:
3851 //Double_t qc2ErrorSquared = 0.;
3852 Double_t qc4ErrorSquared = 0.;
3853 Double_t qc6ErrorSquared = 0.;
3854 Double_t qc8ErrorSquared = 0.;
3855
3856 // statistical error of QC{2}:
3857 qc2Error = twoError;
3858
3859 // statistical error of QC{4}:
3860 qc4ErrorSquared = 16.*pow(two,2.)*pow(twoError,2)+pow(fourError,2.)
3861 - 8.*two*wCov24;
3862 if(qc4ErrorSquared>0.)
3863 {
3864 qc4Error = pow(qc4ErrorSquared,0.5);
3865 } else
3866 {
3867 cout<<"WARNING: Statistical error of QC{4} is imaginary !!!!"<<endl;
3868 }
3869
3870 // statistical error of QC{6}:
3871 qc6ErrorSquared = 81.*pow(4.*pow(two,2.)-four,2.)*pow(twoError,2.)
3872 + 81.*pow(two,2.)*pow(fourError,2.)
3873 + pow(sixError,2.)
3874 - 162.*two*(4.*pow(two,2.)-four)*wCov24
3875 + 18.*(4.*pow(two,2.)-four)*wCov26
3876 - 18.*two*wCov46;
3877
3878 if(qc6ErrorSquared>0.)
3879 {
3880 qc6Error = pow(qc6ErrorSquared,0.5);
3881 } else
3882 {
3883 cout<<"WARNING: Statistical error of QC{6} is imaginary !!!!"<<endl;
3884 }
3885
3886 // statistical error of QC{8}:
3887 qc8ErrorSquared = 256.*pow(36.*pow(two,3.)-18.*four*two+six,2.)*pow(twoError,2.)
3888 + 1296.*pow(4.*pow(two,2.)-four,2.)*pow(fourError,2.)
3889 + 256.*pow(two,2.)*pow(sixError,2.)
3890 + pow(eightError,2.)
3891 - 1152.*(36.*pow(two,3.)-18.*four*two+six)*(4.*pow(two,2.)-four)*wCov24
3892 + 512.*two*(36.*pow(two,3.)-18.*four*two+six)*wCov26
3893 - 32.*(36.*pow(two,3.)-18.*four*two+six)*wCov28
3894 - 1152.*two*(4.*pow(two,2.)-four)*wCov46
3895 + 72.*(4.*pow(two,2.)-four)*wCov48
3896 - 32.*two*wCov68;
3897 if(qc8ErrorSquared>0.)
3898 {
3899 qc8Error = pow(qc8ErrorSquared,0.5);
3900 } else
3901 {
3902 cout<<"WARNING: Statistical error of QC{8} is imaginary !!!!"<<endl;
3903 }
3904
3905 // store the results and statistical errors for Q-cumulants:
3906 fIntFlowQcumulants->SetBinContent(1,qc2);
3907 fIntFlowQcumulants->SetBinError(1,qc2Error);
3908 fIntFlowQcumulants->SetBinContent(2,qc4);
3909 fIntFlowQcumulants->SetBinError(2,qc4Error);
3910 fIntFlowQcumulants->SetBinContent(3,qc6);
3911 fIntFlowQcumulants->SetBinError(3,qc6Error);
3912 fIntFlowQcumulants->SetBinContent(4,qc8);
3913 fIntFlowQcumulants->SetBinError(4,qc8Error);
9da1a4f3 3914
3915 // versus multiplicity:
3916 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
3917 for(Int_t b=1;b<=nBins;b++)
3918 {
3919 // correlations:
3920 two = fIntFlowCorrelationsVsMHist[0]->GetBinContent(b); // <<2>>
3921 four = fIntFlowCorrelationsVsMHist[1]->GetBinContent(b); // <<4>>
3922 six = fIntFlowCorrelationsVsMHist[2]->GetBinContent(b); // <<6>>
3923 eight = fIntFlowCorrelationsVsMHist[3]->GetBinContent(b); // <<8>>
3924
3925 // statistical errors of average 2-, 4-, 6- and 8-particle azimuthal correlations:
3926 twoError = fIntFlowCorrelationsVsMHist[0]->GetBinError(b); // statistical error of <2>
3927 fourError = fIntFlowCorrelationsVsMHist[1]->GetBinError(b); // statistical error of <4>
3928 sixError = fIntFlowCorrelationsVsMHist[2]->GetBinError(b); // statistical error of <6>
3929 eightError = fIntFlowCorrelationsVsMHist[3]->GetBinError(b); // statistical error of <8>
3930
3931 // covariances (multiplied by prefactor depending on weights - see comments in CalculateCovariancesIntFlow()):
3932 wCov24 = fIntFlowCovariancesVsM[0]->GetBinContent(b); // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
3933 wCov26 = fIntFlowCovariancesVsM[1]->GetBinContent(b); // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)
3934 wCov28 = fIntFlowCovariancesVsM[2]->GetBinContent(b); // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)
3935 wCov46 = fIntFlowCovariancesVsM[3]->GetBinContent(b); // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)
3936 wCov48 = fIntFlowCovariancesVsM[4]->GetBinContent(b); // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)
3937 wCov68 = fIntFlowCovariancesVsM[5]->GetBinContent(b); // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)
3938
3939 // Q-cumulants:
3940 qc2 = 0.; // QC{2}
3941 qc4 = 0.; // QC{4}
3942 qc6 = 0.; // QC{6}
3943 qc8 = 0.; // QC{8}
3944 if(two) qc2 = two;
3945 if(four) qc4 = four-2.*pow(two,2.);
3946 if(six) qc6 = six-9.*two*four+12.*pow(two,3.);
3947 if(eight) qc8 = eight-16.*two*six-18.*pow(four,2.)+144.*pow(two,2.)*four-144.*pow(two,4.);
3948
3949 // statistical errors of Q-cumulants:
3950 qc2Error = 0.;
3951 qc4Error = 0.;
3952 qc6Error = 0.;
3953 qc8Error = 0.;
3954
3955 // squared statistical errors of Q-cumulants:
3956 //Double_t qc2ErrorSquared = 0.;
3957 qc4ErrorSquared = 0.;
3958 qc6ErrorSquared = 0.;
3959 qc8ErrorSquared = 0.;
3960
3961 // statistical error of QC{2}:
3962 qc2Error = twoError;
3963
3964 // statistical error of QC{4}:
3965 qc4ErrorSquared = 16.*pow(two,2.)*pow(twoError,2)+pow(fourError,2.)
3966 - 8.*two*wCov24;
3967 if(qc4ErrorSquared>0.)
3968 {
3969 qc4Error = pow(qc4ErrorSquared,0.5);
3970 } else
3971 {
3972 // cout<<"WARNING: Statistical error of QC{4} is imaginary in multiplicity bin "<<b<<" !!!!"<<endl;
3973 }
3974
3975 // statistical error of QC{6}:
3976 qc6ErrorSquared = 81.*pow(4.*pow(two,2.)-four,2.)*pow(twoError,2.)
3977 + 81.*pow(two,2.)*pow(fourError,2.)
3978 + pow(sixError,2.)
3979 - 162.*two*(4.*pow(two,2.)-four)*wCov24
3980 + 18.*(4.*pow(two,2.)-four)*wCov26
3981 - 18.*two*wCov46;
3982
3983 if(qc6ErrorSquared>0.)
3984 {
3985 qc6Error = pow(qc6ErrorSquared,0.5);
3986 } else
3987 {
3988 // cout<<"WARNING: Statistical error of QC{6} is imaginary in multiplicity bin "<<b<<" !!!!"<<endl;
3989 }
3990
3991 // statistical error of QC{8}:
3992 qc8ErrorSquared = 256.*pow(36.*pow(two,3.)-18.*four*two+six,2.)*pow(twoError,2.)
3993 + 1296.*pow(4.*pow(two,2.)-four,2.)*pow(fourError,2.)
3994 + 256.*pow(two,2.)*pow(sixError,2.)
3995 + pow(eightError,2.)
3996 - 1152.*(36.*pow(two,3.)-18.*four*two+six)*(4.*pow(two,2.)-four)*wCov24
3997 + 512.*two*(36.*pow(two,3.)-18.*four*two+six)*wCov26
3998 - 32.*(36.*pow(two,3.)-18.*four*two+six)*wCov28
3999 - 1152.*two*(4.*pow(two,2.)-four)*wCov46
4000 + 72.*(4.*pow(two,2.)-four)*wCov48
4001 - 32.*two*wCov68;
4002 if(qc8ErrorSquared>0.)
4003 {
4004 qc8Error = pow(qc8ErrorSquared,0.5);
4005 } else
4006 {
4007 // cout<<"WARNING: Statistical error of QC{8} is imaginary in multiplicity bin "<<b<<" !!!!"<<endl;
4008 }
4009
4010 // store the results and statistical errors for Q-cumulants:
4011 fIntFlowQcumulantsVsM[0]->SetBinContent(b,qc2);
4012 fIntFlowQcumulantsVsM[0]->SetBinError(b,qc2Error);
4013 fIntFlowQcumulantsVsM[1]->SetBinContent(b,qc4);
4014 fIntFlowQcumulantsVsM[1]->SetBinError(b,qc4Error);
4015 fIntFlowQcumulantsVsM[2]->SetBinContent(b,qc6);
4016 fIntFlowQcumulantsVsM[2]->SetBinError(b,qc6Error);
4017 fIntFlowQcumulantsVsM[3]->SetBinContent(b,qc8);
4018 fIntFlowQcumulantsVsM[3]->SetBinError(b,qc8Error);
4019 } // end of for(Int_t b=1;b<=nBins;b++)
489d5531 4020
4021} // end of AliFlowAnalysisWithQCumulants::CalculateCumulantsIntFlow()
4022
489d5531 4023//================================================================================================================================
4024
489d5531 4025void AliFlowAnalysisWithQCumulants::CalculateIntFlow()
4026{
0328db2d 4027 // a) Calculate the final results for reference flow estimates from Q-cumulants.
4028 // b) Propagate the statistical errors of measured multiparticle correlations to statistical errors of reference flow estimates.
4029 // c) Store the results and statistical errors of reference flow estimates in histogram fIntFlow.
489d5531 4030 // Binning of fIntFlow is organized as follows:
4031 //
4032 // 1st bin: v{2,QC}
4033 // 2nd bin: v{4,QC}
4034 // 3rd bin: v{6,QC}
4035 // 4th bin: v{8,QC}
4036
4037 if(!(fIntFlowCorrelationsHist && fIntFlowCovariances && fIntFlowQcumulants && fIntFlow))
4038 {
4039 cout<<"WARNING: fIntFlowCorrelationsHist && fIntFlowCovariances && fIntFlowQcumulants && fIntFlow is NULL in AFAWQC::CCIF() !!!!"<<endl;
4040 exit(0);
4041 }
4042
4043 // Q-cumulants:
4044 Double_t qc2 = fIntFlowQcumulants->GetBinContent(1); // QC{2}
4045 Double_t qc4 = fIntFlowQcumulants->GetBinContent(2); // QC{4}
4046 Double_t qc6 = fIntFlowQcumulants->GetBinContent(3); // QC{6}
4047 Double_t qc8 = fIntFlowQcumulants->GetBinContent(4); // QC{8}
4048
4049 // correlations:
4050 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
4051 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
4052 Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
4053 Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
4054
4055 // statistical errors of average 2-, 4-, 6- and 8-particle azimuthal correlations:
4056 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <2>
4057 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <4>
4058 Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <6>
4059 Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <8>
4060
4061 // covariances (multiplied by prefactor depending on weights - see comments in CalculateCovariancesIntFlow()):
4062 Double_t wCov24 = fIntFlowCovariances->GetBinContent(1); // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
4063 Double_t wCov26 = fIntFlowCovariances->GetBinContent(2); // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)
4064 Double_t wCov28 = fIntFlowCovariances->GetBinContent(3); // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)
4065 Double_t wCov46 = fIntFlowCovariances->GetBinContent(4); // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)
4066 Double_t wCov48 = fIntFlowCovariances->GetBinContent(5); // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)
4067 Double_t wCov68 = fIntFlowCovariances->GetBinContent(6); // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)
4068
4069 // integrated flow estimates:
4070 Double_t v2 = 0.; // v{2,QC}
4071 Double_t v4 = 0.; // v{4,QC}
4072 Double_t v6 = 0.; // v{6,QC}
4073 Double_t v8 = 0.; // v{8,QC}
4074
4075 // calculate integrated flow estimates from Q-cumulants:
4076 if(qc2>=0.) v2 = pow(qc2,1./2.);
4077 if(qc4<=0.) v4 = pow(-1.*qc4,1./4.);
4078 if(qc6>=0.) v6 = pow((1./4.)*qc6,1./6.);
4079 if(qc8<=0.) v8 = pow((-1./33.)*qc8,1./8.);
4080
4081 // statistical errors of integrated flow estimates:
4082 Double_t v2Error = 0.; // statistical error of v{2,QC}
4083 Double_t v4Error = 0.; // statistical error of v{4,QC}
4084 Double_t v6Error = 0.; // statistical error of v{6,QC}
4085 Double_t v8Error = 0.; // statistical error of v{8,QC}
4086
4087 // squares of statistical errors of integrated flow estimates:
4088 Double_t v2ErrorSquared = 0.; // squared statistical error of v{2,QC}
4089 Double_t v4ErrorSquared = 0.; // squared statistical error of v{4,QC}
4090 Double_t v6ErrorSquared = 0.; // squared statistical error of v{6,QC}
4091 Double_t v8ErrorSquared = 0.; // squared statistical error of v{8,QC}
4092
4093 // calculate squared statistical errors of integrated flow estimates:
4094 if(two > 0.)
4095 {
4096 v2ErrorSquared = (1./(4.*two))*pow(twoError,2.);
4097 }
4098 if(2.*pow(two,2.)-four > 0.)
4099 {
4100 v4ErrorSquared = (1./pow(2.*pow(two,2.)-four,3./2.))*
4101 (pow(two,2.)*pow(twoError,2.)+(1./16.)*pow(fourError,2.)-(1./2.)*two*wCov24);
4102 }
4103 if(six-9.*four*two+12.*pow(two,3.) > 0.)
4104 {
4105 v6ErrorSquared = ((1./2.)*(1./pow(2.,2./3.))*(1./pow(six-9.*four*two+12.*pow(two,3.),5./3.)))*
4106 ((9./2.)*pow(4.*pow(two,2.)-four,2.)*pow(twoError,2.)
4107 + (9./2.)*pow(two,2.)*pow(fourError,2.)+(1./18.)*pow(sixError,2.)
4108 - 9.*two*(4.*pow(two,2.)-four)*wCov24+(4.*pow(two,2.)-four)*wCov26-two*wCov46);
4109 }
4110 if(-1.*eight+16.*six*two+18.*pow(four,2.)-144.*four*pow(two,2.)+144.*pow(two,4.) > 0.)
4111 {
4112 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.))*
4113 (pow(36.*pow(two,3.)-18.*four*two+six,2.)*pow(twoError,2.)
4114 + (81./16.)*pow(4.*pow(two,2.)-four,2.)*pow(fourError,2.)
4115 + pow(two,2.)*pow(sixError,2.)
4116 + (1./256.)*pow(eightError,2.)
4117 - (9./2.)*(36.*pow(two,3.)-18.*four*two+six)*(4.*pow(two,2.)-four)*wCov24
4118 + 2.*two*(36.*pow(two,3.)-18.*four*two+six)*wCov26
4119 - (1./8.)*(36.*pow(two,3.)-18.*four*two+six)*wCov28
4120 - (9./2.)*two*(4.*pow(two,2.)-four)*wCov46
4121 + (9./32.)*(4.*pow(two,2.)-four)*wCov48
4122 - (1./8.)*two*wCov68);
4123 }
4124
4125 // calculate statistical errors of integrated flow estimates:
4126 if(v2ErrorSquared > 0.)
4127 {
4128 v2Error = pow(v2ErrorSquared,0.5);
4129 } else
4130 {
4131 cout<<"WARNING: Statistical error of v{2,QC} is imaginary !!!!"<<endl;
4132 }
4133 if(v4ErrorSquared > 0.)
4134 {
4135 v4Error = pow(v4ErrorSquared,0.5);
4136 } else
4137 {
4138 cout<<"WARNING: Statistical error of v{4,QC} is imaginary !!!!"<<endl;
4139 }
4140 if(v6ErrorSquared > 0.)
4141 {
4142 v6Error = pow(v6ErrorSquared,0.5);
4143 } else
4144 {
4145 cout<<"WARNING: Statistical error of v{6,QC} is imaginary !!!!"<<endl;
4146 }
4147 if(v8ErrorSquared > 0.)
4148 {
4149 v8Error = pow(v8ErrorSquared,0.5);
4150 } else
4151 {
4152 cout<<"WARNING: Statistical error of v{8,QC} is imaginary !!!!"<<endl;
4153 }
4154
4155 // store the results and statistical errors of integrated flow estimates:
4156 fIntFlow->SetBinContent(1,v2);
4157 fIntFlow->SetBinError(1,v2Error);
4158 fIntFlow->SetBinContent(2,v4);
4159 fIntFlow->SetBinError(2,v4Error);
4160 fIntFlow->SetBinContent(3,v6);
4161 fIntFlow->SetBinError(3,v6Error);
4162 fIntFlow->SetBinContent(4,v8);
4163 fIntFlow->SetBinError(4,v8Error);
9da1a4f3 4164
4165 // versus multiplicity:
4166 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
4167 for(Int_t b=1;b<=nBins;b++)
4168 {
4169 // Q-cumulants:
4170 qc2 = fIntFlowQcumulantsVsM[0]->GetBinContent(b); // QC{2}
4171 qc4 = fIntFlowQcumulantsVsM[1]->GetBinContent(b); // QC{4}
4172 qc6 = fIntFlowQcumulantsVsM[2]->GetBinContent(b); // QC{6}
4173 qc8 = fIntFlowQcumulantsVsM[3]->GetBinContent(b); // QC{8}
4174
4175 // correlations:
4176 two = fIntFlowCorrelationsVsMHist[0]->GetBinContent(b); // <<2>>
4177 four = fIntFlowCorrelationsVsMHist[1]->GetBinContent(b); // <<4>>
4178 six = fIntFlowCorrelationsVsMHist[2]->GetBinContent(b); // <<6>>
4179 eight = fIntFlowCorrelationsVsMHist[3]->GetBinContent(b); // <<8>>
4180
4181 // statistical errors of average 2-, 4-, 6- and 8-particle azimuthal correlations:
4182 twoError = fIntFlowCorrelationsVsMHist[0]->GetBinError(b); // statistical error of <2>
4183 fourError = fIntFlowCorrelationsVsMHist[1]->GetBinError(b); // statistical error of <4>
4184 sixError = fIntFlowCorrelationsVsMHist[2]->GetBinError(b); // statistical error of <6>
4185 eightError = fIntFlowCorrelationsVsMHist[3]->GetBinError(b); // statistical error of <8>
4186
4187 // covariances (multiplied by prefactor depending on weights - see comments in CalculateCovariancesIntFlow()):
4188 wCov24 = fIntFlowCovariancesVsM[0]->GetBinContent(b); // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
4189 wCov26 = fIntFlowCovariancesVsM[1]->GetBinContent(b); // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)
4190 wCov28 = fIntFlowCovariancesVsM[2]->GetBinContent(b); // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)
4191 wCov46 = fIntFlowCovariancesVsM[3]->GetBinContent(b); // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)
4192 wCov48 = fIntFlowCovariancesVsM[4]->GetBinContent(b); // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)
4193 wCov68 = fIntFlowCovariancesVsM[5]->GetBinContent(b); // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)
4194
4195 // integrated flow estimates:
4196 v2 = 0.; // v{2,QC}
4197 v4 = 0.; // v{4,QC}
4198 v6 = 0.; // v{6,QC}
4199 v8 = 0.; // v{8,QC}
4200
4201 // calculate integrated flow estimates from Q-cumulants:
4202 if(qc2>=0.) v2 = pow(qc2,1./2.);
4203 if(qc4<=0.) v4 = pow(-1.*qc4,1./4.);
4204 if(qc6>=0.) v6 = pow((1./4.)*qc6,1./6.);
4205 if(qc8<=0.) v8 = pow((-1./33.)*qc8,1./8.);
4206
4207 // statistical errors of integrated flow estimates:
4208 v2Error = 0.; // statistical error of v{2,QC}
4209 v4Error = 0.; // statistical error of v{4,QC}
4210 v6Error = 0.; // statistical error of v{6,QC}
4211 v8Error = 0.; // statistical error of v{8,QC}
4212
4213 // squares of statistical errors of integrated flow estimates:
4214 v2ErrorSquared = 0.; // squared statistical error of v{2,QC}
4215 v4ErrorSquared = 0.; // squared statistical error of v{4,QC}
4216 v6ErrorSquared = 0.; // squared statistical error of v{6,QC}
4217 v8ErrorSquared = 0.; // squared statistical error of v{8,QC}
4218
4219 // calculate squared statistical errors of integrated flow estimates:
4220 if(two > 0.)
4221 {
4222 v2ErrorSquared = (1./(4.*two))*pow(twoError,2.);
4223 }
4224 if(2.*pow(two,2.)-four > 0.)
4225 {
4226 v4ErrorSquared = (1./pow(2.*pow(two,2.)-four,3./2.))*
4227 (pow(two,2.)*pow(twoError,2.)+(1./16.)*pow(fourError,2.)-(1./2.)*two*wCov24);
4228 }
4229 if(six-9.*four*two+12.*pow(two,3.) > 0.)
4230 {
4231 v6ErrorSquared = ((1./2.)*(1./pow(2.,2./3.))*(1./pow(six-9.*four*two+12.*pow(two,3.),5./3.)))*
4232 ((9./2.)*pow(4.*pow(two,2.)-four,2.)*pow(twoError,2.)
4233 + (9./2.)*pow(two,2.)*pow(fourError,2.)+(1./18.)*pow(sixError,2.)
4234 - 9.*two*(4.*pow(two,2.)-four)*wCov24+(4.*pow(two,2.)-four)*wCov26-two*wCov46);
4235 }
4236 if(-1.*eight+16.*six*two+18.*pow(four,2.)-144.*four*pow(two,2.)+144.*pow(two,4.) > 0.)
4237 {
4238 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.))*
4239 (pow(36.*pow(two,3.)-18.*four*two+six,2.)*pow(twoError,2.)
4240 + (81./16.)*pow(4.*pow(two,2.)-four,2.)*pow(fourError,2.)
4241 + pow(two,2.)*pow(sixError,2.)
4242 + (1./256.)*pow(eightError,2.)
4243 - (9./2.)*(36.*pow(two,3.)-18.*four*two+six)*(4.*pow(two,2.)-four)*wCov24
4244 + 2.*two*(36.*pow(two,3.)-18.*four*two+six)*wCov26
4245 - (1./8.)*(36.*pow(two,3.)-18.*four*two+six)*wCov28
4246 - (9./2.)*two*(4.*pow(two,2.)-four)*wCov46
4247 + (9./32.)*(4.*pow(two,2.)-four)*wCov48
4248 - (1./8.)*two*wCov68);
4249 }
4250
4251 // calculate statistical errors of integrated flow estimates:
4252 if(v2ErrorSquared > 0.)
4253 {
4254 v2Error = pow(v2ErrorSquared,0.5);
4255 } else
4256 {
4257 // cout<<"WARNING: Statistical error of v{2,QC} is imaginary !!!!"<<endl;
4258 }
4259 if(v4ErrorSquared > 0.)
4260 {
4261 v4Error = pow(v4ErrorSquared,0.5);
4262 } else
4263 {
4264 // cout<<"WARNING: Statistical error of v{4,QC} is imaginary !!!!"<<endl;
4265 }
4266 if(v6ErrorSquared > 0.)
4267 {
4268 v6Error = pow(v6ErrorSquared,0.5);
4269 } else
4270 {
4271 // cout<<"WARNING: Statistical error of v{6,QC} is imaginary !!!!"<<endl;
4272 }
4273 if(v8ErrorSquared > 0.)
4274 {
4275 v8Error = pow(v8ErrorSquared,0.5);
4276 } else
4277 {
4278 // cout<<"WARNING: Statistical error of v{8,QC} is imaginary !!!!"<<endl;
4279 }
4280
4281 // store the results and statistical errors of integrated flow estimates:
4282 fIntFlowVsM[0]->SetBinContent(b,v2);
4283 fIntFlowVsM[0]->SetBinError(b,v2Error);
4284 fIntFlowVsM[1]->SetBinContent(b,v4);
4285 fIntFlowVsM[1]->SetBinError(b,v4Error);
4286 fIntFlowVsM[2]->SetBinContent(b,v6);
4287 fIntFlowVsM[2]->SetBinError(b,v6Error);
4288 fIntFlowVsM[3]->SetBinContent(b,v8);
4289 fIntFlowVsM[3]->SetBinError(b,v8Error);
4290 } // end of for(Int_t b=1;b<=nBins;b++)
489d5531 4291
4292} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlow()
4293
489d5531 4294//================================================================================================================================
4295
489d5531 4296void AliFlowAnalysisWithQCumulants::FillCommonHistResultsIntFlow()
4297{
4298 // Fill in AliFlowCommonHistResults histograms relevant for 'NONAME' integrated flow (to be improved (name))
4299
4300 if(!fIntFlow)
4301 {
4302 cout<<"WARNING: fIntFlow is NULL in AFAWQC::FCHRIF() !!!!"<<endl;
4303 exit(0);
4304 }
4305
4306 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
4307 {
4308 cout<<"WARNING: fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th"<<endl;
4309 cout<<" is NULL in AFAWQC::FCHRIF() !!!!"<<endl;
4310 exit(0);
4311 }
4312
4313 Double_t v2 = fIntFlow->GetBinContent(1);
4314 Double_t v4 = fIntFlow->GetBinContent(2);
4315 Double_t v6 = fIntFlow->GetBinContent(3);
4316 Double_t v8 = fIntFlow->GetBinContent(4);
4317
4318 Double_t v2Error = fIntFlow->GetBinError(1);
4319 Double_t v4Error = fIntFlow->GetBinError(2);
4320 Double_t v6Error = fIntFlow->GetBinError(3);
4321 Double_t v8Error = fIntFlow->GetBinError(4);
4322
4323 fCommonHistsResults2nd->FillIntegratedFlow(v2,v2Error); // to be improved (hardwired 2nd in the name)
4324 fCommonHistsResults4th->FillIntegratedFlow(v4,v4Error); // to be improved (hardwired 4th in the name)
4325 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)) // to be improved (calculate also 6th and 8th order)
4326 {
4327 fCommonHistsResults6th->FillIntegratedFlow(v6,v6Error); // to be improved (hardwired 6th in the name)
4328 fCommonHistsResults8th->FillIntegratedFlow(v8,v8Error); // to be improved (hardwired 8th in the name)
4329 }
4330
4331} // end of AliFlowAnalysisWithQCumulants::FillCommonHistResultsIntFlow()
4332
4333
4334//================================================================================================================================
4335
4336
4337/*
4338void AliFlowAnalysisWithQCumulants::ApplyCorrectionForNonUniformAcceptanceToCumulantsForIntFlow(Bool_t useParticleWeights, TString eventWeights)
4339{
4340 // apply correction for non-uniform acceptance to cumulants for integrated flow
4341 // (Remark: non-corrected cumulants are accessed from fCumulants[pW][0], corrected cumulants are stored in fCumulants[pW][1])
4342
4343 // shortcuts for the flags:
4344 Int_t pW = (Int_t)(useParticleWeights); // 0=pWeights not used, 1=pWeights used
4345 Int_t eW = -1;
4346
4347 if(eventWeights == "exact")
4348 {
4349 eW = 0;
4350 }
4351
4352 if(!(fCumulants[pW][eW][0] && fCumulants[pW][eW][1] && fCorrections[pW][eW]))
4353 {
4354 cout<<"WARNING: fCumulants[pW][eW][0] && fCumulants[pW][eW][1] && fCorrections[pW][eW] is NULL in AFAWQC::ACFNUATCFIF() !!!!"<<endl;
4355 cout<<"pW = "<<pW<<endl;
4356 cout<<"eW = "<<eW<<endl;
4357 exit(0);
4358 }
4359
4360 // non-corrected cumulants:
4361 Double_t qc2 = fCumulants[pW][eW][0]->GetBinContent(1);
4362 Double_t qc4 = fCumulants[pW][eW][0]->GetBinContent(2);
4363 Double_t qc6 = fCumulants[pW][eW][0]->GetBinContent(3);
4364 Double_t qc8 = fCumulants[pW][eW][0]->GetBinContent(4);
4365 // statistical error of non-corrected cumulants:
4366 Double_t qc2Error = fCumulants[pW][eW][0]->GetBinError(1);
4367 Double_t qc4Error = fCumulants[pW][eW][0]->GetBinError(2);
4368 Double_t qc6Error = fCumulants[pW][eW][0]->GetBinError(3);
4369 Double_t qc8Error = fCumulants[pW][eW][0]->GetBinError(4);
4370 // corrections for non-uniform acceptance:
4371 Double_t qc2Correction = fCorrections[pW][eW]->GetBinContent(1);
4372 Double_t qc4Correction = fCorrections[pW][eW]->GetBinContent(2);
4373 Double_t qc6Correction = fCorrections[pW][eW]->GetBinContent(3);
4374 Double_t qc8Correction = fCorrections[pW][eW]->GetBinContent(4);
4375 // corrected cumulants:
4376 Double_t qc2Corrected = qc2 + qc2Correction;
4377 Double_t qc4Corrected = qc4 + qc4Correction;
4378 Double_t qc6Corrected = qc6 + qc6Correction;
4379 Double_t qc8Corrected = qc8 + qc8Correction;
4380
4381 // ... to be improved (I need here also to correct error of QCs for NUA.
4382 // For simplicity sake I assume at the moment that this correction is negliglible, but it will be added eventually...)
4383
4384 // store corrected results and statistical errors for cumulants:
4385 fCumulants[pW][eW][1]->SetBinContent(1,qc2Corrected);
4386 fCumulants[pW][eW][1]->SetBinContent(2,qc4Corrected);
4387 fCumulants[pW][eW][1]->SetBinContent(3,qc6Corrected);
4388 fCumulants[pW][eW][1]->SetBinContent(4,qc8Corrected);
4389 fCumulants[pW][eW][1]->SetBinError(1,qc2Error); // to be improved (correct also qc2Error for NUA)
4390 fCumulants[pW][eW][1]->SetBinError(2,qc4Error); // to be improved (correct also qc4Error for NUA)
4391 fCumulants[pW][eW][1]->SetBinError(3,qc6Error); // to be improved (correct also qc6Error for NUA)
4392 fCumulants[pW][eW][1]->SetBinError(4,qc8Error); // to be improved (correct also qc8Error for NUA)
4393
4394} // end of AliFlowAnalysisWithQCumulants::ApplyCorrectionForNonUniformAcceptanceToCumulantsForIntFlow(Bool_t useParticleWeights, TString eventWeights)
4395*/
4396
4397
4398//================================================================================================================================
4399
4400
4401/*
4402void AliFlowAnalysisWithQCumulants::PrintQuantifyingCorrectionsForNonUniformAcceptance(Bool_t useParticleWeights, TString eventWeights)
4403{
4404 // print on the screen QC{n,biased}/QC{n,corrected}
4405
4406 // shortcuts for the flags:
4407 Int_t pW = (Int_t)(useParticleWeights); // 0=pWeights not used, 1=pWeights used
4408
4409 Int_t eW = -1;
4410
4411 if(eventWeights == "exact")
4412 {
4413 eW = 0;
4414 }
4415
4416 if(!(fCumulants[pW][eW][0] && fCumulants[pW][eW][1]))
4417 {
4418 cout<<"WARNING: fCumulants[pW][eW][0] && fCumulants[pW][eW][1] is NULL in AFAWQC::PQCFNUA() !!!!"<<endl;
4419 cout<<"pW = "<<pW<<endl;
4420 cout<<"eW = "<<eW<<endl;
4421 exit(0);
4422 }
4423
4424 cout<<endl;
4425 cout<<" Quantifying the bias to Q-cumulants from"<<endl;
4426 cout<<" non-uniform acceptance of the detector:"<<endl;
4427 cout<<endl;
4428
4429 if(fCumulants[pW][eW][1]->GetBinContent(1))
4430 {
4431 cout<<" QC{2,biased}/QC{2,corrected} = "<<(fCumulants[pW][eW][0]->GetBinContent(1))/(fCumulants[pW][eW][1]->GetBinContent(1))<<endl;
4432 }
4433 if(fCumulants[pW][eW][1]->GetBinContent(2))
4434 {
4435 cout<<" QC{4,biased}/QC{4,corrected} = "<<fCumulants[pW][eW][0]->GetBinContent(2)/fCumulants[pW][eW][1]->GetBinContent(2)<<endl;
4436 }
4437
4438 cout<<endl;
4439
4440} // end of AliFlowAnalysisWithQCumulants::PrintQuantifyingCorrectionsForNonUniformAcceptance(Bool_t useParticleWeights, TString eventWeights)
4441*/
4442
4443
4444//================================================================================================================================
4445
4446
4447void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelationsUsingParticleWeights()
4448{
4449 // Calculate all correlations needed for integrated flow using particle weights.
4450
4451 // Remark 1: When particle weights are used the binning of fIntFlowCorrelationAllPro is organized as follows:
4452 //
4453 // 1st bin: <2>_{1n|1n} = two1n1nW1W1 = <w1 w2 cos(n*(phi1-phi2))>
4454 // 2nd bin: <2>_{2n|2n} = two2n2nW2W2 = <w1^2 w2^2 cos(2n*(phi1-phi2))>
4455 // 3rd bin: <2>_{3n|3n} = two3n3nW3W3 = <w1^3 w2^3 cos(3n*(phi1-phi2))>
4456 // 4th bin: <2>_{4n|4n} = two4n4nW4W4 = <w1^4 w2^4 cos(4n*(phi1-phi2))>
4457 // 5th bin: ---- EMPTY ----
4458 // 6th bin: <3>_{2n|1n,1n} = three2n1n1nW2W1W1 = <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
4459 // 7th bin: <3>_{3n|2n,1n} = ...
4460 // 8th bin: <3>_{4n|2n,2n} = ...
4461 // 9th bin: <3>_{4n|3n,1n} = ...
4462 // 10th bin: ---- EMPTY ----
4463 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1nW1W1W1W1 = <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
4464 // 12th bin: <4>_{2n,1n|2n,1n} = ...
4465 // 13th bin: <4>_{2n,2n|2n,2n} = ...
4466 // 14th bin: <4>_{3n|1n,1n,1n} = ...
4467 // 15th bin: <4>_{3n,1n|3n,1n} = ...
4468 // 16th bin: <4>_{3n,1n|2n,2n} = ...
4469 // 17th bin: <4>_{4n|2n,1n,1n} = ...
4470 // 18th bin: ---- EMPTY ----
4471 // 19th bin: <5>_{2n|1n,1n,1n,1n} = ...
4472 // 20th bin: <5>_{2n,2n|2n,1n,1n} = ...
4473 // 21st bin: <5>_{3n,1n|2n,1n,1n} = ...
4474 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = ...
4475 // 23rd bin: ---- EMPTY ----
4476 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = ...
4477 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = ...
4478 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = ...
4479 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = ...
4480 // 28th bin: ---- EMPTY ----
4481 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = ...
4482 // 30th bin: ---- EMPTY ----
4483 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = ...
4484
4485 // Remark 2: When particle weights are used there are some extra correlations. They are stored in
4486 // fIntFlowExtraCorrelationsPro binning of which is organized as follows:
4487
4488 // 1st bin: two1n1nW3W1 = <w1^3 w2 cos(n*(phi1-phi2))>
4489 // 2nd bin: two1n1nW1W1W2 = <w1 w2 w3^2 cos(n*(phi1-phi2))>
4490
4491 // multiplicity (number of particles used to determine the reaction plane)
4492 Double_t dMult = (*fSMpk)(0,0);
4493
4494 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
4495 Double_t dReQ1n1k = (*fReQ)(0,1);
4496 Double_t dReQ2n2k = (*fReQ)(1,2);
4497 Double_t dReQ3n3k = (*fReQ)(2,3);
4498 Double_t dReQ4n4k = (*fReQ)(3,4);
4499 Double_t dReQ1n3k = (*fReQ)(0,3);
4500 Double_t dImQ1n1k = (*fImQ)(0,1);
4501 Double_t dImQ2n2k = (*fImQ)(1,2);
4502 Double_t dImQ3n3k = (*fImQ)(2,3);
4503 Double_t dImQ4n4k = (*fImQ)(3,4);
4504 Double_t dImQ1n3k = (*fImQ)(0,3);
4505
4506 // dMs are variables introduced in order to simplify some Eqs. bellow:
4507 //..............................................................................................
4508 Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
4509 Double_t dM22 = (*fSMpk)(1,2)-(*fSMpk)(0,4); // dM22 = sum_{i,j=1,i!=j}^M w_i^2 w_j^2
4510 Double_t dM33 = (*fSMpk)(1,3)-(*fSMpk)(0,6); // dM33 = sum_{i,j=1,i!=j}^M w_i^3 w_j^3
4511 Double_t dM44 = (*fSMpk)(1,4)-(*fSMpk)(0,8); // dM44 = sum_{i,j=1,i!=j}^M w_i^4 w_j^4
4512 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
4513 Double_t dM211 = (*fSMpk)(0,2)*(*fSMpk)(1,1)-2.*(*fSMpk)(0,3)*(*fSMpk)(0,1)
4514 - (*fSMpk)(1,2)+2.*(*fSMpk)(0,4); // dM211 = sum_{i,j,k=1,i!=j!=k}^M w_i^2 w_j w_k
4515 Double_t dM1111 = (*fSMpk)(3,1)-6.*(*fSMpk)(0,2)*(*fSMpk)(1,1)
4516 + 8.*(*fSMpk)(0,3)*(*fSMpk)(0,1)
4517 + 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
4518 //..............................................................................................
4519
4520 // 2-particle correlations:
4521 Double_t two1n1nW1W1 = 0.; // <w1 w2 cos(n*(phi1-phi2))>
4522 Double_t two2n2nW2W2 = 0.; // <w1^2 w2^2 cos(2n*(phi1-phi2))>
4523 Double_t two3n3nW3W3 = 0.; // <w1^3 w2^3 cos(3n*(phi1-phi2))>
4524 Double_t two4n4nW4W4 = 0.; // <w1^4 w2^4 cos(4n*(phi1-phi2))>
4525 if(dMult>1)
4526 {
4527 if(dM11)
4528 {
4529 two1n1nW1W1 = (pow(dReQ1n1k,2)+pow(dImQ1n1k,2)-(*fSMpk)(0,2))/dM11;
4530 // average correlation <w1 w2 cos(n*(phi1-phi2))> for single event:
4531 fIntFlowCorrelationsEBE->SetBinContent(1,two1n1nW1W1);
4532 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(1,dM11);
4533 // average correlation <w1 w2 cos(n*(phi1-phi2))> for all events:
4534 fIntFlowCorrelationsPro->Fill(0.5,two1n1nW1W1,dM11);
4535 fIntFlowCorrelationsAllPro->Fill(0.5,two1n1nW1W1,dM11);
4536 }
4537 if(dM22)
4538 {
4539 two2n2nW2W2 = (pow(dReQ2n2k,2)+pow(dImQ2n2k,2)-(*fSMpk)(0,4))/dM22;
4540 // ...
4541 // average correlation <w1^2 w2^2 cos(2n*(phi1-phi2))> for all events:
4542 fIntFlowCorrelationsAllPro->Fill(1.5,two2n2nW2W2,dM22);
4543 }
4544 if(dM33)
4545 {
4546 two3n3nW3W3 = (pow(dReQ3n3k,2)+pow(dImQ3n3k,2)-(*fSMpk)(0,6))/dM33;
4547 // ...
4548 // average correlation <w1^3 w2^3 cos(3n*(phi1-phi2))> for all events:
4549 fIntFlowCorrelationsAllPro->Fill(2.5,two3n3nW3W3,dM33);
4550 }
4551 if(dM44)
4552 {
4553 two4n4nW4W4 = (pow(dReQ4n4k,2)+pow(dImQ4n4k,2)-(*fSMpk)(0,8))/dM44;
4554 // ...
4555 // average correlation <w1^4 w2^4 cos(4n*(phi1-phi2))> for all events:
4556 fIntFlowCorrelationsAllPro->Fill(3.5,two4n4nW4W4,dM44);
4557 }
4558 } // end of if(dMult>1)
4559
4560 // extra 2-particle correlations:
4561 Double_t two1n1nW3W1 = 0.; // <w1^3 w2 cos(n*(phi1-phi2))>
4562 Double_t two1n1nW1W1W2 = 0.; // <w1 w2 w3^2 cos(n*(phi1-phi2))>
4563 if(dMult>1)
4564 {
4565 if(dM31)
4566 {
4567 two1n1nW3W1 = (dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k-(*fSMpk)(0,4))/dM31;
4568 fIntFlowExtraCorrelationsPro->Fill(0.5,two1n1nW3W1,dM31);
4569 }
4570 if(dM211)
4571 {
4572 two1n1nW1W1W2 = ((*fSMpk)(0,2)*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2)-(*fSMpk)(0,2))
4573 - 2.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k
4574 - (*fSMpk)(0,4)))/dM211;
4575 fIntFlowExtraCorrelationsPro->Fill(1.5,two1n1nW1W1W2,dM211);
4576 }
4577 } // end of if(dMult>1)
4578 //..............................................................................................
4579
4580 //..............................................................................................
4581 // 3-particle correlations:
4582 Double_t three2n1n1nW2W1W1 = 0.; // <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
4583
4584 if(dMult>2)
4585 {
4586 if(dM211)
4587 {
4588 three2n1n1nW2W1W1 = (pow(dReQ1n1k,2.)*dReQ2n2k+2.*dReQ1n1k*dImQ1n1k*dImQ2n2k-pow(dImQ1n1k,2.)*dReQ2n2k
4589 - 2.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k)
4590 - pow(dReQ2n2k,2)-pow(dImQ2n2k,2)
4591 + 2.*(*fSMpk)(0,4))/dM211;
4592 fIntFlowCorrelationsAllPro->Fill(5.5,three2n1n1nW2W1W1,dM211);
4593 }
4594 } // end of if(dMult>2)
4595 //..............................................................................................
4596
4597 //..............................................................................................
4598 // 4-particle correlations:
4599 Double_t four1n1n1n1nW1W1W1W1 = 0.; // <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
4600 if(dMult>3)
4601 {
4602 if(dM1111)
4603 {
4604 four1n1n1n1nW1W1W1W1 = (pow(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.),2)
4605 - 2.*(pow(dReQ1n1k,2.)*dReQ2n2k+2.*dReQ1n1k*dImQ1n1k*dImQ2n2k-pow(dImQ1n1k,2.)*dReQ2n2k)
4606 + 8.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k)
4607 + (pow(dReQ2n2k,2)+pow(dImQ2n2k,2))
4608 - 4.*(*fSMpk)(0,2)*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
4609 - 6.*(*fSMpk)(0,4)+2.*(*fSMpk)(1,2))/dM1111;
4610
4611 // average correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for single event:
4612 fIntFlowCorrelationsEBE->SetBinContent(2,four1n1n1n1nW1W1W1W1);
4613 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(2,dM1111);
4614 // average correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for all events:
4615 fIntFlowCorrelationsPro->Fill(1.5,four1n1n1n1nW1W1W1W1,dM1111);
4616 fIntFlowCorrelationsAllPro->Fill(10.5,four1n1n1n1nW1W1W1W1,dM1111);
4617 }
4618 } // end of if(dMult>3)
4619 //..............................................................................................
4620
4621} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelationsUsingParticleWeights()
4622
4623
4624//================================================================================================================================
4625
4626
4627void AliFlowAnalysisWithQCumulants::CalculateWeightedQProductsForIntFlow() // to be improved (completed)
4628{
4629 // calculate averages like <<2><4>>, <<2><6>>, <<4><6>>, etc. which are needed to calculate covariances
4630 // Remark: here we take weighted correlations!
4631
4632 /*
4633
4634 // binning of fQProductsW is organized as follows:
4635 //
4636 // 1st bin: <2><4>
4637 // 2nd bin: <2><6>
4638 // 3rd bin: <2><8>
4639 // 4th bin: <4><6>
4640 // 5th bin: <4><8>
4641 // 6th bin: <6><8>
4642
4643 Double_t dMult = (*fSMpk)(0,0); // multiplicity (number of particles used to determine the reaction plane)
4644
4645 Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
4646 Double_t dM1111 = (*fSMpk)(3,1)-6.*(*fSMpk)(0,2)*(*fSMpk)(1,1)
4647 + 8.*(*fSMpk)(0,3)*(*fSMpk)(0,1)
4648 + 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
4649
4650 Double_t twoEBEW = 0.; // <2>
4651 Double_t fourEBEW = 0.; // <4>
4652
4653 twoEBEW = fQCorrelationsEBE[1]->GetBinContent(1);
4654 fourEBEW = fQCorrelationsEBE[1]->GetBinContent(11);
4655
4656 // <2><4>
4657 if(dMult>3)
4658 {
4659 fQProducts[1][0]->Fill(0.5,twoEBEW*fourEBEW,dM11*dM1111);
4660 }
4661
4662 */
4663
4664} // end of AliFlowAnalysisWithQCumulants::CalculateWeightedQProductsForIntFlow()
4665
4666
4667//================================================================================================================================
4668
4669
4670void AliFlowAnalysisWithQCumulants::InitializeArraysForIntFlow()
4671{
4672 // Initialize all arrays used to calculate integrated flow.
4673
4674 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
4675 {
4676 fIntFlowCorrectionTermsForNUAEBE[sc] = NULL;
0328db2d 4677 fIntFlowEventWeightForCorrectionTermsForNUAEBE[sc] = NULL;
489d5531 4678 fIntFlowCorrectionTermsForNUAPro[sc] = NULL;
4679 fIntFlowCorrectionTermsForNUAHist[sc] = NULL;
0328db2d 4680 for(Int_t power=0;power<2;power++) // linear or quadratic
4681 {
4682 fIntFlowSumOfEventWeightsNUA[sc][power] = NULL;
4683 }
489d5531 4684 }
4685 for(Int_t power=0;power<2;power++) // linear or quadratic
4686 {
4687 fIntFlowSumOfEventWeights[power] = NULL;
4688 }
4689 for(Int_t i=0;i<3;i++) // print on the screen the final results (0=NONAME, 1=RP, 2=POI)
4690 {
4691 fPrintFinalResults[i] = kTRUE;
4692 }
ff70ca91 4693 for(Int_t ci=0;ci<4;ci++) // correlation index or cumulant order
4694 {
4695 fIntFlowCorrelationsVsMPro[ci] = NULL;
4696 fIntFlowCorrelationsVsMHist[ci] = NULL;
4697 fIntFlowQcumulantsVsM[ci] = NULL;
4698 fIntFlowVsM[ci] = NULL;
4699 for(Int_t lc=0;lc<2;lc++)
4700 {
4701 fIntFlowSumOfEventWeightsVsM[ci][lc] = NULL;
4702 }
4703 }
4704 for(Int_t pi=0;pi<6;pi++) // product or covariance index
4705 {
4706 fIntFlowProductOfCorrelationsVsMPro[pi] = NULL;
4707 fIntFlowCovariancesVsM[pi] = NULL;
4708 fIntFlowSumOfProductOfEventWeightsVsM[pi] = NULL;
4709 }
4710
489d5531 4711} // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForIntFlow()
4712
489d5531 4713//================================================================================================================================
4714
489d5531 4715void AliFlowAnalysisWithQCumulants::InitializeArraysForDiffFlow()
4716{
4717 // Initialize all arrays needed to calculate differential flow.
4718 // a) Initialize lists holding profiles;
4719 // b) Initialize lists holding histograms;
4720 // c) Initialize event-by-event quantities;
4721 // d) Initialize profiles;
4722 // e) Initialize histograms holding final results.
4723
4724 // a) Initialize lists holding profiles;
4725 for(Int_t t=0;t<2;t++) // type (RP, POI)
4726 {
4727 for(Int_t pe=0;pe<2;pe++) // pt or eta
4728 {
4729 fDiffFlowCorrelationsProList[t][pe] = NULL;
4730 fDiffFlowProductOfCorrelationsProList[t][pe] = NULL;
4731 fDiffFlowCorrectionsProList[t][pe] = NULL;
4732 }
4733 }
4734
4735 // b) Initialize lists holding histograms;
4736 for(Int_t t=0;t<2;t++) // type (RP, POI)
4737 {
4738 for(Int_t pe=0;pe<2;pe++) // pt or eta
4739 {
4740 fDiffFlowCorrelationsHistList[t][pe] = NULL;
4741 for(Int_t power=0;power<2;power++)
4742 {
4743 fDiffFlowSumOfEventWeightsHistList[t][pe][power] = NULL;
4744 } // end of for(Int_t power=0;power<2;power++)
4745 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe] = NULL;
4746 fDiffFlowCorrectionsHistList[t][pe] = NULL;
4747 fDiffFlowCovariancesHistList[t][pe] = NULL;
4748 fDiffFlowCumulantsHistList[t][pe] = NULL;
4749 fDiffFlowHistList[t][pe] = NULL;
4750 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
4751 } // enf of for(Int_t t=0;t<2;t++) // type (RP, POI)
4752
4753 // c) Initialize event-by-event quantities:
4754 // 1D:
4755 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
4756 {
4757 for(Int_t pe=0;pe<2;pe++) // pt or eta
4758 {
4759 for(Int_t m=0;m<4;m++) // multiple of harmonic
4760 {
4761 for(Int_t k=0;k<9;k++) // power of weight
4762 {
4763 fReRPQ1dEBE[t][pe][m][k] = NULL;
4764 fImRPQ1dEBE[t][pe][m][k] = NULL;
4765 fs1dEBE[t][pe][k] = NULL; // to be improved (this doesn't need to be within loop over m)
4766 }
4767 }
4768 }
4769 }
4770 // 1D:
4771 for(Int_t t=0;t<2;t++) // type (RP or POI)
4772 {
4773 for(Int_t pe=0;pe<2;pe++) // pt or eta
4774 {
4775 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
4776 {
4777 for(Int_t cti=0;cti<9;cti++) // correction term index
4778 {
4779 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti] = NULL;
4780 }
4781 }
4782 }
4783 }
4784 // 2D:
4785 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
4786 {
4787 for(Int_t m=0;m<4;m++) // multiple of harmonic
4788 {
4789 for(Int_t k=0;k<9;k++) // power of weight
4790 {
4791 fReRPQ2dEBE[t][m][k] = NULL;
4792 fImRPQ2dEBE[t][m][k] = NULL;
4793 fs2dEBE[t][k] = NULL; // to be improved (this doesn't need to be within loop over m)
4794 }
4795 }
4796 }
4797
4798 // d) Initialize profiles:
4799 for(Int_t t=0;t<2;t++) // type: RP or POI
4800 {
4801 for(Int_t pe=0;pe<2;pe++) // pt or eta
4802 {
4803 for(Int_t ci=0;ci<4;ci++) // correlation index
4804 {
4805 fDiffFlowCorrelationsPro[t][pe][ci] = NULL;
4806 } // end of for(Int_t ci=0;ci<4;ci++)
4807 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
4808 {
4809 for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index
4810 {
4811 fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2] = NULL;
4812 } // end of for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index
4813 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
4814 // correction terms for nua:
4815 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
4816 {
4817 for(Int_t cti=0;cti<9;cti++) // correction term index
4818 {
4819 fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti] = NULL;
4820 }
4821 }
4822 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
4823 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
4824
4825 // e) Initialize histograms holding final results.
4826 for(Int_t t=0;t<2;t++) // type: RP or POI
4827 {
4828 for(Int_t pe=0;pe<2;pe++) // pt or eta
4829 {
4830 for(Int_t ci=0;ci<4;ci++) // correlation index
4831 {
4832 fDiffFlowCorrelationsHist[t][pe][ci] = NULL;
4833 fDiffFlowCumulants[t][pe][ci] = NULL;
4834 fDiffFlow[t][pe][ci] = NULL;
4835 } // end of for(Int_t ci=0;ci<4;ci++)
4836 for(Int_t covarianceIndex=0;covarianceIndex<5;covarianceIndex++)
4837 {
4838 fDiffFlowCovariances[t][pe][covarianceIndex] = NULL;
4839 } // end of for(Int_t covarianceIndex=0;covarianceIndex<5;covarianceIndex++)
4840 // correction terms for nua:
4841 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
4842 {
4843 for(Int_t cti=0;cti<9;cti++) // correction term index
4844 {
4845 fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti] = NULL;
4846 }
4847 }
4848 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
4849 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
4850
4851 // sum of event weights for reduced correlations:
4852 for(Int_t t=0;t<2;t++) // type = RP or POI
4853 {
4854 for(Int_t pe=0;pe<2;pe++) // pt or eta
4855 {
4856 for(Int_t p=0;p<2;p++) // power of weight is 1 or 2
4857 {
4858 for(Int_t ew=0;ew<4;ew++) // event weight index for reduced correlations
4859 {
4860 fDiffFlowSumOfEventWeights[t][pe][p][ew] = NULL;
4861 }
4862 }
4863 }
4864 }
4865 // product of event weights for both types of correlations:
4866 for(Int_t t=0;t<2;t++) // type = RP or POI
4867 {
4868 for(Int_t pe=0;pe<2;pe++) // pt or eta
4869 {
4870 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
4871 {
4872 for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index
4873 {
4874 fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2] = NULL;
4875 }
4876 }
4877 }
4878 }
4879
4880
4881
4882
4883 /*
4884
4885 // nested lists in fDiffFlowProfiles:
4886 for(Int_t t=0;t<2;t++)
4887 {
4888 fDFPType[t] = NULL;
4889 for(Int_t pW=0;pW<2;pW++) // particle weights not used (0) or used (1)
4890 {
4891 fDFPParticleWeights[t][pW] = NULL;
4892 for(Int_t eW=0;eW<2;eW++)
4893 {
4894 fDFPEventWeights[t][pW][eW] = NULL;
4895 fDiffFlowCorrelations[t][pW][eW] = NULL;
4896 fDiffFlowProductsOfCorrelations[t][pW][eW] = NULL;
4897 for(Int_t sc=0;sc<2;sc++)
4898 {
4899 fDiffFlowCorrectionTerms[t][pW][eW][sc] = NULL;
4900 }
4901 }
4902 }
4903 }
4904
4905
4906 */
4907
4908
4909
4910 /*
4911 for(Int_t pW=0;pW<2;pW++) // particle weights not used (0) or used (1)
4912 {
4913 for(Int_t eW=0;eW<2;eW++)
4914 {
4915 // correlations:
4916 for(Int_t correlationIndex=0;correlationIndex<4;correlationIndex++)
4917 {
4918 fCorrelationsPro[t][pW][eW][correlationIndex] = NULL;
4919 }
4920 // products of correlations:
4921 for(Int_t productOfCorrelationsIndex=0;productOfCorrelationsIndex<6;productOfCorrelationsIndex++)
4922 {
4923 fProductsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex] = NULL;
4924 }
4925 // correction terms:
4926 for(Int_t sc=0;sc<2;sc++)
4927 {
4928 for(Int_t correctionsIndex=0;correctionsIndex<2;correctionsIndex++)
4929 {
4930 fCorrectionTermsPro[t][pW][eW][sc][correctionsIndex] = NULL;
4931 }
4932 }
4933 }
4934 }
4935 */
4936
4937} // end of AliFlowAnalysisWithQCumulants::InitializeArraysForDiffFlow()
4938
4939
4940//================================================================================================================================
4941 /*
4942
4943
4944void AliFlowAnalysisWithQCumulants::CalculateCorrelationsForDifferentialFlow2D(TString type)
4945{
4946 // calculate all reduced correlations needed for differential flow for each (pt,eta) bin:
4947
4948 if(type == "RP") // to be improved (removed)
4949 {
4950 cout<<endl;
4951 }
4952 // ...
4953
4954
4955 Int_t typeFlag = -1;
4956
4957 // reduced correlations ares stored in fCorrelationsPro[t][pW][index] and are indexed as follows:
4958 // index:
4959 // 0: <2'>
4960 // 1: <4'>
4961
4962 // multiplicity:
4963 Double_t dMult = (*fSMpk)(0,0);
4964
4965 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
4966 Double_t dReQ1n = (*fReQ)(0,0);
4967 Double_t dReQ2n = (*fReQ)(1,0);
4968 //Double_t dReQ3n = (*fReQ)(2,0);
4969 //Double_t dReQ4n = (*fReQ)(3,0);
4970 Double_t dImQ1n = (*fImQ)(0,0);
4971 Double_t dImQ2n = (*fImQ)(1,0);
4972 //Double_t dImQ3n = (*fImQ)(2,0);
4973 //Double_t dImQ4n = (*fImQ)(3,0);
4974
4975 // looping over all (pt,eta) bins and calculating correlations needed for differential flow:
4976 for(Int_t p=1;p<=fnBinsPt;p++)
4977 {
4978 for(Int_t e=1;e<=fnBinsEta;e++)
4979 {
4980 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin):
4981 Double_t p1n0kRe = 0.;
4982 Double_t p1n0kIm = 0.;
4983
4984 // number of POIs in particular (pt,eta) bin:
4985 Double_t mp = 0.;
4986
4987 // 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):
4988 Double_t q1n0kRe = 0.;
4989 Double_t q1n0kIm = 0.;
4990 Double_t q2n0kRe = 0.;
4991 Double_t q2n0kIm = 0.;
4992
4993 // number of particles which are both RPs and POIs in particular (pt,eta) bin:
4994 Double_t mq = 0.;
4995
4996 // q_{m*n,0}:
4997 q1n0kRe = fReEBE2D[2][0][0]->GetBinContent(fReEBE2D[2][0][0]->GetBin(p,e))
4998 * fReEBE2D[2][0][0]->GetBinEntries(fReEBE2D[2][0][0]->GetBin(p,e));
4999 q1n0kIm = fImEBE2D[2][0][0]->GetBinContent(fImEBE2D[2][0][0]->GetBin(p,e))
5000 * fImEBE2D[2][0][0]->GetBinEntries(fImEBE2D[2][0][0]->GetBin(p,e));
5001 q2n0kRe = fReEBE2D[2][1][0]->GetBinContent(fReEBE2D[2][1][0]->GetBin(p,e))
5002 * fReEBE2D[2][1][0]->GetBinEntries(fReEBE2D[2][1][0]->GetBin(p,e));
5003 q2n0kIm = fImEBE2D[2][1][0]->GetBinContent(fImEBE2D[2][1][0]->GetBin(p,e))
5004 * fImEBE2D[2][1][0]->GetBinEntries(fImEBE2D[2][1][0]->GetBin(p,e));
5005
5006 mq = fReEBE2D[2][0][0]->GetBinEntries(fReEBE2D[2][0][0]->GetBin(p,e)); // to be improved (cross-checked by accessing other profiles here)
5007
5008 if(type == "POI")
5009 {
5010 // p_{m*n,0}:
5011 p1n0kRe = fReEBE2D[1][0][0]->GetBinContent(fReEBE2D[1][0][0]->GetBin(p,e))
5012 * fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e));
5013 p1n0kIm = fImEBE2D[1][0][0]->GetBinContent(fImEBE2D[1][0][0]->GetBin(p,e))
5014 * fImEBE2D[1][0][0]->GetBinEntries(fImEBE2D[1][0][0]->GetBin(p,e));
5015
5016 mp = fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e)); // to be improved (cross-checked by accessing other profiles here)
5017
5018 typeFlag = 1;
5019 }
5020 else if(type == "RP")
5021 {
5022 // p_{m*n,0} = q_{m*n,0}:
5023 p1n0kRe = q1n0kRe;
5024 p1n0kIm = q1n0kIm;
5025 mp = mq;
5026
5027 typeFlag = 0;
5028 }
5029
5030 // count events with non-empty (pt,eta) bin:
5031 if(mp>0)
5032 {
5033 fNonEmptyBins2D[typeFlag]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,1);
5034 }
5035
5036 // 2'-particle correlation for particular (pt,eta) bin:
5037 Double_t two1n1nPtEta = 0.;
5038 if(mp*dMult-mq)
5039 {
5040 two1n1nPtEta = (p1n0kRe*dReQ1n+p1n0kIm*dImQ1n-mq)
5041 / (mp*dMult-mq);
5042
5043 // fill the 2D profile to get the average correlation for each (pt,eta) bin:
5044 if(type == "POI")
5045 {
5046 //f2pPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);
5047
5048 fCorrelationsPro[1][0][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);
5049 }
5050 else if(type == "RP")
5051 {
5052 //f2pPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);
5053 fCorrelationsPro[0][0][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);
5054 }
5055 } // end of if(mp*dMult-mq)
5056
5057 // 4'-particle correlation:
5058 Double_t four1n1n1n1nPtEta = 0.;
5059 if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5060 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)
5061 {
5062 four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
5063 - q2n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))
5064 - 2.*q2n0kIm*dReQ1n*dImQ1n
5065 - p1n0kRe*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)
5066 + p1n0kIm*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)
5067 - 2.*dMult*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
5068 - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*mq
5069 + 6.*(q1n0kRe*dReQ1n+q1n0kIm*dImQ1n)
5070 + 1.*(q2n0kRe*dReQ2n+q2n0kIm*dImQ2n)
5071 + 2.*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
5072 + 2.*mq*dMult
5073 - 6.*mq)
5074 / ((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5075 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
5076
5077 // fill the 2D profile to get the average correlation for each (pt, eta) bin:
5078 if(type == "POI")
5079 {
5080 //f4pPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
5081 // (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5082 // + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
5083
5084 fCorrelationsPro[1][0][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
5085 (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5086 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
5087 }
5088 else if(type == "RP")
5089 {
5090 //f4pPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
5091 // (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5092 // + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
5093
5094 fCorrelationsPro[0][0][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
5095 (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5096 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
5097 }
5098 } // end of if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5099 // +mq*(dMult-1.)*(dMult-2.)*(dMult-3.))
5100
5101 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
5102 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5103
5104
5105
5106
5107
5108} // end of AliFlowAnalysisWithQCumulants::CalculateCorrelationsForDifferentialFlow2D()
5109
5110
5111
5112
5113
5114
5115//================================================================================================================================
5116
5117
5118void AliFlowAnalysisWithQCumulants::CalculateWeightedCorrelationsForDifferentialFlow2D(TString type)
5119{
5120 // calculate all weighted correlations needed for differential flow
5121
5122 if(type == "RP") // to be improved (removed)
5123 {
5124 cout<<endl;
5125 }
5126 // ...
5127
5128
5129
5130
5131 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
5132 Double_t dReQ1n1k = (*fReQ)(0,1);
5133 Double_t dReQ2n2k = (*fReQ)(1,2);
5134 Double_t dReQ1n3k = (*fReQ)(0,3);
5135 //Double_t dReQ4n4k = (*fReQ)(3,4);
5136 Double_t dImQ1n1k = (*fImQ)(0,1);
5137 Double_t dImQ2n2k = (*fImQ)(1,2);
5138 Double_t dImQ1n3k = (*fImQ)(0,3);
5139 //Double_t dImQ4n4k = (*fImQ)(3,4);
5140
5141 // S^M_{p,k} (see .h file for the definition of fSMpk):
5142 Double_t dSM1p1k = (*fSMpk)(0,1);
5143 Double_t dSM1p2k = (*fSMpk)(0,2);
5144 Double_t dSM1p3k = (*fSMpk)(0,3);
5145 Double_t dSM2p1k = (*fSMpk)(1,1);
5146 Double_t dSM3p1k = (*fSMpk)(2,1);
5147
5148 // looping over all (pt,eta) bins and calculating weighted correlations needed for differential flow:
5149 for(Int_t p=1;p<=fnBinsPt;p++)
5150 {
5151 for(Int_t e=1;e<=fnBinsEta;e++)
5152 {
5153 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin):
5154 Double_t p1n0kRe = 0.;
5155 Double_t p1n0kIm = 0.;
5156
5157 // number of POIs in particular (pt,eta) bin):
5158 Double_t mp = 0.;
5159
5160 // real and imaginary parts of q_{m*n,k}:
5161 // (weighted Q-vector evaluated for particles which are both RPs and POIs in particular (pt,eta) bin)
5162 Double_t q1n2kRe = 0.;
5163 Double_t q1n2kIm = 0.;
5164 Double_t q2n1kRe = 0.;
5165 Double_t q2n1kIm = 0.;
5166
5167 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
5168 Double_t s1p1k = 0.;
5169 Double_t s1p2k = 0.;
5170 Double_t s1p3k = 0.;
5171
5172 // M0111 from Eq. (118) in QC2c (to be improved (notation))
5173 Double_t dM0111 = 0.;
5174
5175 if(type == "POI")
5176 {
5177 // p_{m*n,0}:
5178 p1n0kRe = fReEBE2D[1][0][0]->GetBinContent(fReEBE2D[1][0][0]->GetBin(p,e))
5179 * fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e));
5180 p1n0kIm = fImEBE2D[1][0][0]->GetBinContent(fImEBE2D[1][0][0]->GetBin(p,e))
5181 * fImEBE2D[1][0][0]->GetBinEntries(fImEBE2D[1][0][0]->GetBin(p,e));
5182
5183 mp = fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e));
5184
5185 // q_{m*n,k}:
5186 q1n2kRe = fReEBE2D[2][0][2]->GetBinContent(fReEBE2D[2][0][2]->GetBin(p,e))
5187 * fReEBE2D[2][0][2]->GetBinEntries(fReEBE2D[2][0][2]->GetBin(p,e));
5188 q1n2kIm = fImEBE2D[2][0][2]->GetBinContent(fImEBE2D[2][0][2]->GetBin(p,e))
5189 * fImEBE2D[2][0][2]->GetBinEntries(fImEBE2D[2][0][2]->GetBin(p,e));
5190 q2n1kRe = fReEBE2D[2][1][1]->GetBinContent(fReEBE2D[2][1][1]->GetBin(p,e))
5191 * fReEBE2D[2][1][1]->GetBinEntries(fReEBE2D[2][1][1]->GetBin(p,e));
5192 q2n1kIm = fImEBE2D[2][1][1]->GetBinContent(fImEBE2D[2][1][1]->GetBin(p,e))
5193 * fImEBE2D[2][1][1]->GetBinEntries(fImEBE2D[2][1][1]->GetBin(p,e));
5194
5195 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
5196 s1p1k = pow(fs2D[2][1]->GetBinContent(fs2D[2][1]->GetBin(p,e)),1.);
5197 s1p2k = pow(fs2D[2][2]->GetBinContent(fs2D[2][2]->GetBin(p,e)),1.);
5198 s1p3k = pow(fs2D[2][3]->GetBinContent(fs2D[2][3]->GetBin(p,e)),1.);
5199
5200 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
5201 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
5202 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
5203 + 2.*(s1p3k-s1p2k*dSM1p1k));
5204 }
5205 else if(type == "RP")
5206 {
5207 p1n0kRe = fReEBE2D[0][0][0]->GetBinContent(fReEBE2D[0][0][0]->GetBin(p,e))
5208 * fReEBE2D[0][0][0]->GetBinEntries(fReEBE2D[0][0][0]->GetBin(p,e));
5209 p1n0kIm = fImEBE2D[0][0][0]->GetBinContent(fImEBE2D[0][0][0]->GetBin(p,e))
5210 * fImEBE2D[0][0][0]->GetBinEntries(fImEBE2D[0][0][0]->GetBin(p,e));
5211
5212 mp = fReEBE2D[0][0][0]->GetBinEntries(fReEBE2D[0][0][0]->GetBin(p,e));
5213
5214 // q_{m*n,k}:
5215 q1n2kRe = fReEBE2D[0][0][2]->GetBinContent(fReEBE2D[0][0][2]->GetBin(p,e))
5216 * fReEBE2D[0][0][2]->GetBinEntries(fReEBE2D[0][0][2]->GetBin(p,e));
5217 q1n2kIm = fImEBE2D[0][0][2]->GetBinContent(fImEBE2D[0][0][2]->GetBin(p,e))
5218 * fImEBE2D[0][0][2]->GetBinEntries(fImEBE2D[0][0][2]->GetBin(p,e));
5219 q2n1kRe = fReEBE2D[0][1][1]->GetBinContent(fReEBE2D[0][1][1]->GetBin(p,e))
5220 * fReEBE2D[0][1][1]->GetBinEntries(fReEBE2D[0][1][1]->GetBin(p,e));
5221 q2n1kIm = fImEBE2D[0][1][1]->GetBinContent(fImEBE2D[0][1][1]->GetBin(p,e))
5222 * fImEBE2D[0][1][1]->GetBinEntries(fImEBE2D[0][1][1]->GetBin(p,e));
5223
5224 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
5225 s1p1k = pow(fs2D[0][1]->GetBinContent(fs2D[0][1]->GetBin(p,e)),1.);
5226 s1p2k = pow(fs2D[0][2]->GetBinContent(fs2D[0][2]->GetBin(p,e)),1.);
5227 s1p3k = pow(fs2D[0][3]->GetBinContent(fs2D[0][3]->GetBin(p,e)),1.);
5228
5229 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
5230 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
5231 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
5232 + 2.*(s1p3k-s1p2k*dSM1p1k));
5233 //...............................................................................................
5234 }
5235
5236 // 2'-particle correlation:
5237 Double_t two1n1nW0W1PtEta = 0.;
5238 if(mp*dSM1p1k-s1p1k)
5239 {
5240 two1n1nW0W1PtEta = (p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k-s1p1k)
5241 / (mp*dSM1p1k-s1p1k);
5242
5243 // fill the 2D profile to get the average correlation for each (pt, eta) bin:
5244 if(type == "POI")
5245 {
5246 //f2pPtEtaPOIW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,
5247 // mp*dSM1p1k-s1p1k);
5248 fCorrelationsPro[1][1][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,mp*dSM1p1k-s1p1k);
5249 }
5250 else if(type == "RP")
5251 {
5252 //f2pPtEtaRPW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,
5253 // mp*dSM1p1k-s1p1k);
5254 fCorrelationsPro[0][1][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,mp*dSM1p1k-s1p1k);
5255 }
5256 } // end of if(mp*dMult-dmPrimePrimePtEta)
5257
5258 // 4'-particle correlation:
5259 Double_t four1n1n1n1nW0W1W1W1PtEta = 0.;
5260 if(dM0111)
5261 {
5262 four1n1n1n1nW0W1W1W1PtEta = ((pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
5263 - q2n1kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))
5264 - 2.*q2n1kIm*dReQ1n1k*dImQ1n1k
5265 - p1n0kRe*(dReQ1n1k*dReQ2n2k+dImQ1n1k*dImQ2n2k)
5266 + p1n0kIm*(dImQ1n1k*dReQ2n2k-dReQ1n1k*dImQ2n2k)
5267 - 2.*dSM1p2k*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
5268 - 2.*(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*s1p1k
5269 + 6.*(q1n2kRe*dReQ1n1k+q1n2kIm*dImQ1n1k)
5270 + 1.*(q2n1kRe*dReQ2n2k+q2n1kIm*dImQ2n2k)
5271 + 2.*(p1n0kRe*dReQ1n3k+p1n0kIm*dImQ1n3k)
5272 + 2.*s1p1k*dSM1p2k
5273 - 6.*s1p3k)
5274 / dM0111; // to be imropoved (notation of dM0111)
5275
5276 // fill the 2D profile to get the average correlation for each (pt, eta) bin:
5277 if(type == "POI")
5278 {
5279 //f4pPtEtaPOIW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);
5280 fCorrelationsPro[1][1][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);
5281 }
5282 else if(type == "RP")
5283 {
5284 //f4pPtEtaRPW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);
5285 fCorrelationsPro[0][1][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);
5286 }
5287 } // end of if(dM0111)
5288
5289 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
5290 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5291
5292
5293
5294
5295} // end of AliFlowAnalysisWithQCumulants::CalculateWeightedCorrelationsForDifferentialFlow2D(TString type)
5296
5297
5298//================================================================================================================================
5299
5300 */
5301
5302/*
5303void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsForDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights)
5304{
5305 // 1.) Access average for 2D correlations from profiles and store them in 2D final results histograms;
5306 // 2.) Access spread for 2D correlations from profiles, calculate error and store it in 2D final results histograms;
5307 // 3.) Make projections along pt and eta axis and store results and errors in 1D final results histograms.
5308
5309 Int_t typeFlag = -1;
5310 Int_t pWeightsFlag = -1;
5311 Int_t eWeightsFlag = -1;
5312
5313 if(type == "RP")
5314 {
5315 typeFlag = 0;
5316 } else if(type == "POI")
5317 {
5318 typeFlag = 1;
5319 } else
5320 {
5321 cout<<"WARNING: type must be either RP or POI in AFAWQC::FCFDF() !!!!"<<endl;
5322 exit(0);
5323 }
5324
5325 if(!useParticleWeights)
5326 {
5327 pWeightsFlag = 0;
5328 } else
5329 {
5330 pWeightsFlag = 1;
5331 }
5332
5333 if(eventWeights == "exact")
5334 {
5335 eWeightsFlag = 0;
5336 }
5337
5338 // shortcuts:
5339 Int_t t = typeFlag;
5340 Int_t pW = pWeightsFlag;
5341 Int_t eW = eWeightsFlag;
5342
5343 // from 2D histogram fNonEmptyBins2D make two 1D histograms fNonEmptyBins1D in pt and eta (to be improved (i.e. moved somewhere else))
5344 // pt:
5345 for(Int_t p=1;p<fnBinsPt;p++)
5346 {
5347 Double_t contentPt = 0.;
5348 for(Int_t e=1;e<=fnBinsEta;e++)
5349 {
5350 contentPt += (fNonEmptyBins2D[t]->GetBinContent(fNonEmptyBins2D[t]->GetBin(p,e)));
5351 }
5352 fNonEmptyBins1D[t][0]->SetBinContent(p,contentPt);
5353 }
5354 // eta:
5355 for(Int_t e=1;e<fnBinsEta;e++)
5356 {
5357 Double_t contentEta = 0.;
5358 for(Int_t p=1;p<=fnBinsPt;p++)
5359 {
5360 contentEta += (fNonEmptyBins2D[t]->GetBinContent(fNonEmptyBins2D[t]->GetBin(p,e)));
5361 }
5362 fNonEmptyBins1D[t][1]->SetBinContent(e,contentEta);
5363 }
5364
5365 // from 2D profile in (pt,eta) make two 1D profiles in (pt) and (eta):
5366 TProfile *profile[2][4]; // [0=pt,1=eta][correlation index] // to be improved (do not hardwire the correlation index)
5367
5368 for(Int_t pe=0;pe<2;pe++) // pt or eta
5369 {
5370 for(Int_t ci=0;ci<4;ci++) // correlation index
5371 {
5372 if(pe==0) profile[pe][ci] = this->MakePtProjection(fCorrelationsPro[t][pW][eW][ci]);
5373 if(pe==1) profile[pe][ci] = this->MakeEtaProjection(fCorrelationsPro[t][pW][eW][ci]);
5374 }
5375 }
5376
5377 // transfer 2D profile into 2D histogram:
5378 // to be improved (see in documentation if there is a method to transfer values from 2D profile into 2D histogram)
5379 for(Int_t ci=0;ci<4;ci++)
5380 {
5381 for(Int_t p=1;p<=fnBinsPt;p++)
5382 {
5383 for(Int_t e=1;e<=fnBinsEta;e++)
5384 {
5385 Double_t correlation = fCorrelationsPro[t][pW][eW][ci]->GetBinContent(fCorrelationsPro[t][pW][eW][ci]->GetBin(p,e));
5386 Double_t spread = fCorrelationsPro[t][pW][eW][ci]->GetBinError(fCorrelationsPro[t][pW][eW][ci]->GetBin(p,e));
5387 Double_t nEvts = fNonEmptyBins2D[t]->GetBinContent(fNonEmptyBins2D[t]->GetBin(p,e));
5388 Double_t error = 0.;
5389 fFinalCorrelations2D[t][pW][eW][ci]->SetBinContent(fFinalCorrelations2D[t][pW][eW][ci]->GetBin(p,e),correlation);
5390 if(nEvts>0)
5391 {
5392 error = spread/pow(nEvts,0.5);
5393 fFinalCorrelations2D[t][pW][eW][ci]->SetBinError(fFinalCorrelations2D[t][pW][eW][ci]->GetBin(p,e),error);
5394 }
5395 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
5396 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5397 } // end of for(Int_t ci=0;ci<4;ci++)
5398
5399 // transfer 1D profile into 1D histogram (pt):
5400 // to be improved (see in documentation if there is a method to transfer values from 1D profile into 1D histogram)
5401 for(Int_t ci=0;ci<4;ci++)
5402 {
5403 for(Int_t p=1;p<=fnBinsPt;p++)
5404 {
5405 if(profile[0][ci])
5406 {
5407 Double_t correlation = profile[0][ci]->GetBinContent(p);
5408 Double_t spread = profile[0][ci]->GetBinError(p);
5409 Double_t nEvts = fNonEmptyBins1D[t][0]->GetBinContent(p);
5410 Double_t error = 0.;
5411 fFinalCorrelations1D[t][pW][eW][0][ci]->SetBinContent(p,correlation);
5412 if(nEvts>0)
5413 {
5414 error = spread/pow(nEvts,0.5);
5415 fFinalCorrelations1D[t][pW][eW][0][ci]->SetBinError(p,error);
5416 }
5417 }
5418 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5419 } // end of for(Int_t ci=0;ci<4;ci++)
5420
5421 // transfer 1D profile into 1D histogram (eta):
5422 // to be improved (see in documentation if there is a method to transfer values from 1D profile into 1D histogram)
5423 for(Int_t ci=0;ci<4;ci++)
5424 {
5425 for(Int_t e=1;e<=fnBinsEta;e++)
5426 {
5427 if(profile[1][ci])
5428 {
5429 Double_t correlation = profile[1][ci]->GetBinContent(e);
5430 fFinalCorrelations1D[t][pW][eW][1][ci]->SetBinContent(e,correlation);
5431 }
5432 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
5433 } // end of for(Int_t ci=0;ci<4;ci++)
5434
5435} // end of void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsForDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights)
5436*/
5437
5438
5439//================================================================================================================================
5440
5441
5442void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulants(TString type, TString ptOrEta)
5443{
5444 // calcualate cumulants for differential flow from measured correlations
5445 // Remark: cumulants calculated here are NOT corrected for non-uniform acceptance. This correction is applied in the method ...
5446 // to be improved (description)
5447
5448 Int_t typeFlag = -1;
5449 Int_t ptEtaFlag = -1;
5450
5451 if(type == "RP")
5452 {
5453 typeFlag = 0;
5454 } else if(type == "POI")
5455 {
5456 typeFlag = 1;
5457 }
5458
5459 if(ptOrEta == "Pt")
5460 {
5461 ptEtaFlag = 0;
5462 } else if(ptOrEta == "Eta")
5463 {
5464 ptEtaFlag = 1;
5465 }
5466
5467 // shortcuts:
5468 Int_t t = typeFlag;
5469 Int_t pe = ptEtaFlag;
5470
5471 // common:
5472 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
5473
5474 // correlation <<2>>:
5475 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1);
5476
5477 // 1D:
5478 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
5479 {
5480 // reduced correlations:
5481 Double_t twoPrime = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b); // <<2'>>(pt)
5482 Double_t fourPrime = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b); // <<4'>>(pt)
5483 // final statistical error of reduced correlations:
5484 //Double_t twoPrimeError = fFinalCorrelations1D[t][pW][eW][0][0]->GetBinError(p);
5485 // QC{2'}:
5486 Double_t qc2Prime = twoPrime; // QC{2'}
5487 //Double_t qc2PrimeError = twoPrimeError; // final stat. error of QC{2'}
5488 fDiffFlowCumulants[t][pe][0]->SetBinContent(b,qc2Prime);
5489 //fFinalCumulantsPt[t][pW][eW][nua][0]->SetBinError(p,qc2PrimeError);
5490 // QC{4'}:
5491 Double_t qc4Prime = fourPrime - 2.*twoPrime*two; // QC{4'} = <<4'>> - 2*<<2'>><<2>>
5492 fDiffFlowCumulants[t][pe][1]->SetBinContent(b,qc4Prime);
5493 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5494
5495
5496 /*
5497 // 2D (pt,eta):
5498 // to be improved (see documentation if I can do all this without looping)
5499 for(Int_t p=1;p<=fnBinsPt;p++)
5500 {
5501 for(Int_t e=1;e<=fnBinsEta;e++)
5502 {
5503 // reduced correlations:
5504 Double_t twoPrime = fFinalCorrelations2D[t][pW][eW][0]->GetBinContent(fFinalCorrelations2D[t][pW][eW][0]->GetBin(p,e)); // <<2'>>(pt,eta)
5505 Double_t fourPrime = fFinalCorrelations2D[t][pW][eW][1]->GetBinContent(fFinalCorrelations2D[t][pW][eW][1]->GetBin(p,e)); // <<4'>>(pt,eta)
5506 for(Int_t nua=0;nua<2;nua++)
5507 {
5508 // QC{2'}:
5509 Double_t qc2Prime = twoPrime; // QC{2'} = <<2'>>
5510 fFinalCumulants2D[t][pW][eW][nua][0]->SetBinContent(fFinalCumulants2D[t][pW][eW][nua][0]->GetBin(p,e),qc2Prime);
5511 // QC{4'}:
5512 Double_t qc4Prime = fourPrime - 2.*twoPrime*two; // QC{4'} = <<4'>> - 2*<<2'>><<2>>
5513 fFinalCumulants2D[t][pW][eW][nua][1]->SetBinContent(fFinalCumulants2D[t][pW][eW][nua][1]->GetBin(p,e),qc4Prime);
5514 } // end of for(Int_t nua=0;nua<2;nua++)
5515 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
5516 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5517 */
5518
5519} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulants(TString type, Bool_t useParticleWeights, TString eventWeights);
5520
5521
5522//================================================================================================================================
5523
5524
5525void AliFlowAnalysisWithQCumulants::CalculateFinalResultsForRPandPOIIntegratedFlow(TString type)
5526{
5527 // calculate final results for integrated flow of RPs and POIs
5528
5529 Int_t typeFlag = -1;
5530
5531 if(type == "RP")
5532 {
5533 typeFlag = 0;
5534 } else if(type == "POI")
5535 {
5536 typeFlag = 1;
5537 } else
5538 {
5539 cout<<"WARNING: type must be either RP or POI in AFAWQC::CDF() !!!!"<<endl;
5540 exit(0);
5541 }
5542
5543 // shortcuts:
5544 Int_t t = typeFlag;
5545
5546 // pt yield:
5547 TH1F *yield2ndPt = NULL;
5548 TH1F *yield4thPt = NULL;
5549 TH1F *yield6thPt = NULL;
5550 TH1F *yield8thPt = NULL;
5551
5552 if(type == "POI")
5553 {
5554 yield2ndPt = (TH1F*)(fCommonHists2nd->GetHistPtPOI())->Clone();
5555 yield4thPt = (TH1F*)(fCommonHists4th->GetHistPtPOI())->Clone();
5556 yield6thPt = (TH1F*)(fCommonHists6th->GetHistPtPOI())->Clone();
5557 yield8thPt = (TH1F*)(fCommonHists8th->GetHistPtPOI())->Clone();
5558 }
5559 else if(type == "RP")
5560 {
5561 yield2ndPt = (TH1F*)(fCommonHists2nd->GetHistPtRP())->Clone();
5562 yield4thPt = (TH1F*)(fCommonHists4th->GetHistPtRP())->Clone();
5563 yield6thPt = (TH1F*)(fCommonHists6th->GetHistPtRP())->Clone();
5564 yield8thPt = (TH1F*)(fCommonHists8th->GetHistPtRP())->Clone();
5565 }
5566
5567 Int_t nBinsPt = yield2ndPt->GetNbinsX();
5568
5569 TH1D *flow2ndPt = NULL;
5570 TH1D *flow4thPt = NULL;
5571 TH1D *flow6thPt = NULL;
5572 TH1D *flow8thPt = NULL;
5573
5574 // to be improved (hardwired pt index)
5575 flow2ndPt = (TH1D*)fDiffFlow[t][0][0]->Clone();
5576 flow4thPt = (TH1D*)fDiffFlow[t][0][1]->Clone();
5577 flow6thPt = (TH1D*)fDiffFlow[t][0][2]->Clone();
5578 flow8thPt = (TH1D*)fDiffFlow[t][0][3]->Clone();
5579
5580 Double_t dvn2nd = 0., dvn4th = 0., dvn6th = 0., dvn8th = 0.; // differential flow
5581 Double_t dErrvn2nd = 0., dErrvn4th = 0., dErrvn6th = 0., dErrvn8th = 0.; // error on differential flow
5582
5583 Double_t dVn2nd = 0., dVn4th = 0., dVn6th = 0., dVn8th = 0.; // integrated flow
5584 Double_t dErrVn2nd = 0., dErrVn4th = 0., dErrVn6th = 0., dErrVn8th = 0.; // error on integrated flow
5585
5586 Double_t dYield2nd = 0., dYield4th = 0., dYield6th = 0., dYield8th = 0.; // pt yield
5587 Double_t dSum2nd = 0., dSum4th = 0., dSum6th = 0., dSum8th = 0.; // needed for normalizing integrated flow
5588
5589 // looping over pt bins:
5590 for(Int_t p=1;p<nBinsPt+1;p++)
5591 {
5592 dvn2nd = flow2ndPt->GetBinContent(p);
5593 dvn4th = flow4thPt->GetBinContent(p);
5594 dvn6th = flow6thPt->GetBinContent(p);
5595 dvn8th = flow8thPt->GetBinContent(p);
5596
5597 dErrvn2nd = flow2ndPt->GetBinError(p);
5598 dErrvn4th = flow4thPt->GetBinError(p);
5599 dErrvn6th = flow6thPt->GetBinError(p);
5600 dErrvn8th = flow8thPt->GetBinError(p);
5601
5602 dYield2nd = yield2ndPt->GetBinContent(p);
5603 dYield4th = yield4thPt->GetBinContent(p);
5604 dYield6th = yield6thPt->GetBinContent(p);
5605 dYield8th = yield8thPt->GetBinContent(p);
5606
5607 dVn2nd += dvn2nd*dYield2nd;
5608 dVn4th += dvn4th*dYield4th;
5609 dVn6th += dvn6th*dYield6th;
5610 dVn8th += dvn8th*dYield8th;
5611
5612 dSum2nd += dYield2nd;
5613 dSum4th += dYield4th;
5614 dSum6th += dYield6th;
5615 dSum8th += dYield8th;
5616
5617 dErrVn2nd += dYield2nd*dYield2nd*dErrvn2nd*dErrvn2nd; // ro be improved (check this relation)
5618 dErrVn4th += dYield4th*dYield4th*dErrvn4th*dErrvn4th;
5619 dErrVn6th += dYield6th*dYield6th*dErrvn6th*dErrvn6th;
5620 dErrVn8th += dYield8th*dYield8th*dErrvn8th*dErrvn8th;
5621
5622 } // end of for(Int_t p=1;p<nBinsPt+1;p++)
5623
5624 // normalizing the results for integrated flow:
5625 if(dSum2nd)
5626 {
5627 dVn2nd /= dSum2nd;
5628 dErrVn2nd /= (dSum2nd*dSum2nd);
5629 dErrVn2nd = TMath::Sqrt(dErrVn2nd);
5630 }
5631 if(dSum4th)
5632 {
5633 dVn4th /= dSum4th;
5634 dErrVn4th /= (dSum4th*dSum4th);
5635 dErrVn4th = TMath::Sqrt(dErrVn4th);
5636 }
5637 //if(dSum6th) dVn6th/=dSum6th;
5638 //if(dSum8th) dVn8th/=dSum8th;
5639
5640 // storing the results for integrated flow in common histos: (to be improved: new method for this?)
5641 if(type == "POI")
5642 {
5643 fCommonHistsResults2nd->FillIntegratedFlowPOI(dVn2nd,dErrVn2nd);
5644 fCommonHistsResults4th->FillIntegratedFlowPOI(dVn4th,dErrVn4th);
5645 fCommonHistsResults6th->FillIntegratedFlowPOI(dVn6th,0.); // to be improved (errors)
5646 fCommonHistsResults8th->FillIntegratedFlowPOI(dVn8th,0.); // to be improved (errors)
5647 }
5648 else if (type == "RP")
5649 {
5650 fCommonHistsResults2nd->FillIntegratedFlowRP(dVn2nd,dErrVn2nd);
5651 fCommonHistsResults4th->FillIntegratedFlowRP(dVn4th,dErrVn4th);
5652 fCommonHistsResults6th->FillIntegratedFlowRP(dVn6th,0.); // to be improved (errors)
5653 fCommonHistsResults8th->FillIntegratedFlowRP(dVn8th,0.); // to be improved (errors)
5654 }
5655
5656 delete flow2ndPt;
5657 delete flow4thPt;
5658 //delete flow6thPt;
5659 //delete flow8thPt;
5660
5661 delete yield2ndPt;
5662 delete yield4thPt;
5663 delete yield6thPt;
5664 delete yield8thPt;
5665
5666} // end of AliFlowAnalysisWithQCumulants::CalculateFinalResultsForRPandPOIIntegratedFlow(TString type)
5667
5668
5669//================================================================================================================================
5670
5671
5672void AliFlowAnalysisWithQCumulants::InitializeArraysForDistributions()
5673{
5674 // Initialize all arrays used for distributions.
5675
5676 // a) Initialize arrays of histograms used to hold distributions of correlations;
5677 // b) Initialize array to hold min and max values of correlations.
5678
5679 // a) Initialize arrays of histograms used to hold distributions of correlations:
5680 for(Int_t di=0;di<4;di++) // distribution index
5681 {
5682 fDistributions[di] = NULL;
5683 }
5684
5685 // b) Initialize default min and max values of correlations:
5686 // (Remark: The default values bellow were chosen for v2=5% and M=500)
5687 fMinValueOfCorrelation[0] = -0.01; // <2>_min
5688 fMaxValueOfCorrelation[0] = 0.04; // <2>_max
5689 fMinValueOfCorrelation[1] = -0.00002; // <4>_min
5690 fMaxValueOfCorrelation[1] = 0.00015; // <4>_max
5691 fMinValueOfCorrelation[2] = -0.0000003; // <6>_min
5692 fMaxValueOfCorrelation[2] = 0.0000006; // <6>_max
5693 fMinValueOfCorrelation[3] = -0.000000006; // <8>_min
5694 fMaxValueOfCorrelation[3] = 0.000000003; // <8>_max
5695
5696} // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForDistributions()
5697
5698
5699//================================================================================================================================
5700
5701
5702void AliFlowAnalysisWithQCumulants::BookEverythingForDistributions()
5703{
5704 // a) Book profile to hold all flags for distributions of correlations;
5705 // b) Book all histograms to hold distributions of correlations.
5706
5707 TString correlationIndex[4] = {"<2>","<4>","<6>","<8>"}; // to be improved (should I promote this to data members?)
5708
5709 // a) Book profile to hold all flags for distributions of correlations:
5710 TString distributionsFlagsName = "fDistributionsFlags";
5711 distributionsFlagsName += fAnalysisLabel->Data();
5712 fDistributionsFlags = new TProfile(distributionsFlagsName.Data(),"Flags for Distributions of Correlations",9,0,9);
5713 fDistributionsFlags->SetTickLength(-0.01,"Y");
5714 fDistributionsFlags->SetMarkerStyle(25);
5715 fDistributionsFlags->SetLabelSize(0.05);
5716 fDistributionsFlags->SetLabelOffset(0.02,"Y");
5717 fDistributionsFlags->GetXaxis()->SetBinLabel(1,"Store or not?");
5718 fDistributionsFlags->GetXaxis()->SetBinLabel(2,"<2>_{min}");
5719 fDistributionsFlags->GetXaxis()->SetBinLabel(3,"<2>_{max}");
5720 fDistributionsFlags->GetXaxis()->SetBinLabel(4,"<4>_{min}");
5721 fDistributionsFlags->GetXaxis()->SetBinLabel(5,"<4>_{max}");
5722 fDistributionsFlags->GetXaxis()->SetBinLabel(6,"<6>_{min}");
5723 fDistributionsFlags->GetXaxis()->SetBinLabel(7,"<6>_{max}");
5724 fDistributionsFlags->GetXaxis()->SetBinLabel(8,"<8>_{min}");
5725 fDistributionsFlags->GetXaxis()->SetBinLabel(9,"<8>_{max}");
5726 fDistributionsList->Add(fDistributionsFlags);
5727
5728 // b) Book all histograms to hold distributions of correlations.
5729 if(fStoreDistributions)
5730 {
5731 TString distributionsName = "fDistributions";
5732 distributionsName += fAnalysisLabel->Data();
5733 for(Int_t di=0;di<4;di++) // distribution index
5734 {
5735 fDistributions[di] = new TH1D(Form("Distribution of %s",correlationIndex[di].Data()),Form("Distribution of %s",correlationIndex[di].Data()),10000,fMinValueOfCorrelation[di],fMaxValueOfCorrelation[di]);
5736 fDistributions[di]->SetXTitle(correlationIndex[di].Data());
5737 fDistributionsList->Add(fDistributions[di]);
5738 } // end of for(Int_t di=0;di<4;di++) // distribution index
5739 } // end of if(fStoreDistributions)
5740
5741} // end of void AliFlowAnalysisWithQCumulants::BookEverythingForDistributions()
5742
5743
5744//================================================================================================================================
5745
5746
5747void AliFlowAnalysisWithQCumulants::StoreFlagsForDistributions()
5748{
5749 // Store all flags for distributiuons of correlations in profile fDistributionsFlags.
5750
5751 if(!fDistributionsFlags)
5752 {
5753 cout<<"WARNING: fDistributionsFlags is NULL in AFAWQC::SDF() !!!!"<<endl;
5754 exit(0);
5755 }
5756
5757 fDistributionsFlags->Fill(0.5,(Int_t)fStoreDistributions); // histos with distributions of correlations stored or not in the output file
5758 // store min and max values of correlations:
5759 for(Int_t di=0;di<4;di++) // distribution index
5760 {
5761 fDistributionsFlags->Fill(1.5+2.*(Double_t)di,fMinValueOfCorrelation[di]);
5762 fDistributionsFlags->Fill(2.5+2.*(Double_t)di,fMaxValueOfCorrelation[di]);
5763 }
5764
5765} // end of void AliFlowAnalysisWithQCumulants::StoreFlagsForDistributions()
5766
5767
5768//================================================================================================================================
5769
5770
5771void AliFlowAnalysisWithQCumulants::StoreDistributionsOfCorrelations()
5772{
5773 // Store distributions of correlations.
5774
5775 if(!(fIntFlowCorrelationsEBE && fIntFlowEventWeightsForCorrelationsEBE))
5776 {
5777 cout<<"WARNING: fIntFlowCorrelationsEBE && fIntFlowEventWeightsForCorrelationsEBE"<<endl;
5778 cout<<" is NULL in AFAWQC::SDOC() !!!!"<<endl;
5779 exit(0);
5780 }
5781
5782 for(Int_t di=0;di<4;di++) // distribution index
5783 {
5784 if(!fDistributions[di])
5785 {
5786 cout<<"WARNING: fDistributions[di] is NULL in AFAWQC::SDOC() !!!!"<<endl;
5787 cout<<"di = "<<di<<endl;
5788 exit(0);
5789 } else
5790 {
5791 fDistributions[di]->Fill(fIntFlowCorrelationsEBE->GetBinContent(di+1),fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(di+1));
5792 }
5793 } // end of for(Int_t di=0;di<4;di++) // distribution index
5794
5795} // end of void AliFlowAnalysisWithQCumulants::StoreDistributionsOfCorrelations()
5796
5797
5798//================================================================================================================================
5799
5800
5801void AliFlowAnalysisWithQCumulants::BookAndNestAllLists()
5802{
5803 // Book and nest all lists nested in the base list fHistList.
5804 // a) Book and nest lists for integrated flow;
5805 // b) Book and nest lists for differential flow;
5806 // c) Book and nest list for particle weights;
5807 // d) Book and nest list for distributions;
5808 // e) Book and nest list for nested loops;
5809
5810 // a) Book and nest all lists for integrated flow:
5811 // base list for integrated flow:
5812 fIntFlowList = new TList();
5813 fIntFlowList->SetName("Integrated Flow");
5814 fIntFlowList->SetOwner(kTRUE);
5815 fHistList->Add(fIntFlowList);
5816 // list holding profiles:
5817 fIntFlowProfiles = new TList();
5818 fIntFlowProfiles->SetName("Profiles");
5819 fIntFlowProfiles->SetOwner(kTRUE);
5820 fIntFlowList->Add(fIntFlowProfiles);
5821 // list holding histograms with results:
5822 fIntFlowResults = new TList();
5823 fIntFlowResults->SetName("Results");
5824 fIntFlowResults->SetOwner(kTRUE);
5825 fIntFlowList->Add(fIntFlowResults);
5826
5827 // b) Book and nest lists for differential flow;
5828 fDiffFlowList = new TList();
5829 fDiffFlowList->SetName("Differential Flow");
5830 fDiffFlowList->SetOwner(kTRUE);
5831 fHistList->Add(fDiffFlowList);
5832 // list holding profiles:
5833 fDiffFlowProfiles = new TList();
5834 fDiffFlowProfiles->SetName("Profiles");
5835 fDiffFlowProfiles->SetOwner(kTRUE);
5836 fDiffFlowList->Add(fDiffFlowProfiles);
5837 // list holding histograms with results:
5838 fDiffFlowResults = new TList();
5839 fDiffFlowResults->SetName("Results");
5840 fDiffFlowResults->SetOwner(kTRUE);
5841 fDiffFlowList->Add(fDiffFlowResults);
5842 // flags used for naming nested lists in list fDiffFlowProfiles and fDiffFlowResults:
5843 TList list;
5844 list.SetOwner(kTRUE);
5845 TString typeFlag[2] = {"RP","POI"};
5846 TString ptEtaFlag[2] = {"p_{T}","#eta"};
5847 TString powerFlag[2] = {"linear","quadratic"};
5848 // nested lists in fDiffFlowProfiles (~/Differential Flow/Profiles):
5849 for(Int_t t=0;t<2;t++) // type: RP or POI
5850 {
5851 for(Int_t pe=0;pe<2;pe++) // pt or eta
5852 {
5853 // list holding profiles with correlations:
5854 fDiffFlowCorrelationsProList[t][pe] = (TList*)list.Clone();
5855 fDiffFlowCorrelationsProList[t][pe]->SetName(Form("Profiles with correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5856 fDiffFlowProfiles->Add(fDiffFlowCorrelationsProList[t][pe]);
5857 // list holding profiles with products of correlations:
5858 fDiffFlowProductOfCorrelationsProList[t][pe] = (TList*)list.Clone();
5859 fDiffFlowProductOfCorrelationsProList[t][pe]->SetName(Form("Profiles with products of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5860 fDiffFlowProfiles->Add(fDiffFlowProductOfCorrelationsProList[t][pe]);
5861 // list holding profiles with corrections:
5862 fDiffFlowCorrectionsProList[t][pe] = (TList*)list.Clone();
5863 fDiffFlowCorrectionsProList[t][pe]->SetName(Form("Profiles with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5864 fDiffFlowProfiles->Add(fDiffFlowCorrectionsProList[t][pe]);
5865 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
5866 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
5867 // nested lists in fDiffFlowResults (~/Differential Flow/Results):
5868 for(Int_t t=0;t<2;t++) // type: RP or POI
5869 {
5870 for(Int_t pe=0;pe<2;pe++) // pt or eta
5871 {
5872 // list holding histograms with correlations:
5873 fDiffFlowCorrelationsHistList[t][pe] = (TList*)list.Clone();
5874 fDiffFlowCorrelationsHistList[t][pe]->SetName(Form("Correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5875 fDiffFlowResults->Add(fDiffFlowCorrelationsHistList[t][pe]);
5876 // list holding histograms with corrections:
5877 fDiffFlowCorrectionsHistList[t][pe] = (TList*)list.Clone();
5878 fDiffFlowCorrectionsHistList[t][pe]->SetName(Form("Histograms with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5879 fDiffFlowResults->Add(fDiffFlowCorrectionsHistList[t][pe]);
5880 for(Int_t power=0;power<2;power++)
5881 {
5882 // list holding histograms with sums of event weights:
5883 fDiffFlowSumOfEventWeightsHistList[t][pe][power] = (TList*)list.Clone();
5884 fDiffFlowSumOfEventWeightsHistList[t][pe][power]->SetName(Form("Sum of %s event weights (%s, %s)",powerFlag[power].Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5885 fDiffFlowResults->Add(fDiffFlowSumOfEventWeightsHistList[t][pe][power]);
5886 } // end of for(Int_t power=0;power<2;power++)
5887 // list holding histograms with sums of products of event weights:
5888 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe] = (TList*)list.Clone();
5889 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]->SetName(Form("Sum of products of event weights (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5890 fDiffFlowResults->Add(fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]);
5891 // list holding histograms with covariances of correlations:
5892 fDiffFlowCovariancesHistList[t][pe] = (TList*)list.Clone();
5893 fDiffFlowCovariancesHistList[t][pe]->SetName(Form("Covariances of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5894 fDiffFlowResults->Add(fDiffFlowCovariancesHistList[t][pe]);
5895 // list holding histograms with differential Q-cumulants:
5896 fDiffFlowCumulantsHistList[t][pe] = (TList*)list.Clone();
5897 fDiffFlowCumulantsHistList[t][pe]->SetName(Form("Differential Q-cumulants (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5898 fDiffFlowResults->Add(fDiffFlowCumulantsHistList[t][pe]);
5899 // list holding histograms with differential flow estimates from Q-cumulants:
5900 fDiffFlowHistList[t][pe] = (TList*)list.Clone();
5901 fDiffFlowHistList[t][pe]->SetName(Form("Differential flow (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5902 fDiffFlowResults->Add(fDiffFlowHistList[t][pe]);
5903 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
5904 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
5905
5906 // c) Book and nest list for particle weights:
5907 fWeightsList->SetName("Weights");
5908 fWeightsList->SetOwner(kTRUE);
5909 fHistList->Add(fWeightsList);
5910
5911 // d) Book and nest list for distributions:
5912 fDistributionsList = new TList();
5913 fDistributionsList->SetName("Distributions");
5914 fDistributionsList->SetOwner(kTRUE);
5915 fHistList->Add(fDistributionsList);
5916
5917 // e) Book and nest list for nested loops:
5918 fNestedLoopsList = new TList();
5919 fNestedLoopsList->SetName("Nested Loops");
5920 fNestedLoopsList->SetOwner(kTRUE);
5921 fHistList->Add(fNestedLoopsList);
5922
5923} // end of void AliFlowAnalysisWithQCumulants::BookAndNestAllLists()
5924
5925
5926//================================================================================================================================
5927
5928
5929void AliFlowAnalysisWithQCumulants::FillCommonHistResultsDiffFlow(TString type)
5930{
5931 // fill common result histograms for differential flow
5932
5933 Int_t typeFlag = -1;
5934 //Int_t ptEtaFlag = -1;
5935
5936 if(type == "RP")
5937 {
5938 typeFlag = 0;
5939 } else if(type == "POI")
5940 {
5941 typeFlag = 1;
5942 }
5943
5944 // shortcuts:
5945 Int_t t = typeFlag;
5946 //Int_t pe = ptEtaFlag;
5947
5948 // to be improved (implement protection here)
5949
5950 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
5951 {
5952 cout<<"WARNING: fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th"<<endl;
5953 cout<<" is NULL in AFAWQC::FCHRIF() !!!!"<<endl;
5954 exit(0);
5955 }
5956
5957 // pt:
5958 for(Int_t p=1;p<=fnBinsPt;p++)
5959 {
5960 Double_t v2 = fDiffFlow[t][0][0]->GetBinContent(p);
5961 Double_t v4 = fDiffFlow[t][0][1]->GetBinContent(p);
5962 Double_t v6 = fDiffFlow[t][0][2]->GetBinContent(p);
5963 Double_t v8 = fDiffFlow[t][0][3]->GetBinContent(p);
5964
5965 Double_t v2Error = fDiffFlow[t][0][0]->GetBinError(p);
5966 Double_t v4Error = fDiffFlow[t][0][1]->GetBinError(p);
5967 //Double_t v6Error = fFinalFlow1D[t][pW][nua][0][2]->GetBinError(p);
5968 //Double_t v8Error = fFinalFlow1D[t][pW][nua][0][3]->GetBinError(p);
5969
5970 if(type == "RP")
5971 {
5972 fCommonHistsResults2nd->FillDifferentialFlowPtRP(p,v2,v2Error);
5973 fCommonHistsResults4th->FillDifferentialFlowPtRP(p,v4,v4Error);
5974 fCommonHistsResults6th->FillDifferentialFlowPtRP(p,v6,0.);
5975 fCommonHistsResults8th->FillDifferentialFlowPtRP(p,v8,0.);
5976 } else if(type == "POI")
5977 {
5978 fCommonHistsResults2nd->FillDifferentialFlowPtPOI(p,v2,v2Error);
5979 fCommonHistsResults4th->FillDifferentialFlowPtPOI(p,v4,v4Error);
5980 fCommonHistsResults6th->FillDifferentialFlowPtPOI(p,v6,0.);
5981 fCommonHistsResults8th->FillDifferentialFlowPtPOI(p,v8,0.);
5982 }
5983 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5984
5985 // eta:
5986 for(Int_t e=1;e<=fnBinsEta;e++)
5987 {
5988 Double_t v2 = fDiffFlow[t][1][0]->GetBinContent(e);
5989 Double_t v4 = fDiffFlow[t][1][1]->GetBinContent(e);
5990 Double_t v6 = fDiffFlow[t][1][2]->GetBinContent(e);
5991 Double_t v8 = fDiffFlow[t][1][3]->GetBinContent(e);
5992
5993 Double_t v2Error = fDiffFlow[t][1][0]->GetBinError(e);
5994 Double_t v4Error = fDiffFlow[t][1][1]->GetBinError(e);
5995 //Double_t v6Error = fDiffFlow[t][1][2]->GetBinError(e);
5996 //Double_t v8Error = fDiffFlow[t][1][3]->GetBinError(e);
5997
5998 if(type == "RP")
5999 {
6000 fCommonHistsResults2nd->FillDifferentialFlowEtaRP(e,v2,v2Error);
6001 fCommonHistsResults4th->FillDifferentialFlowEtaRP(e,v4,v4Error);
6002 fCommonHistsResults6th->FillDifferentialFlowEtaRP(e,v6,0.);
6003 fCommonHistsResults8th->FillDifferentialFlowEtaRP(e,v8,0.);
6004 } else if(type == "POI")
6005 {
6006 fCommonHistsResults2nd->FillDifferentialFlowEtaPOI(e,v2,v2Error);
6007 fCommonHistsResults4th->FillDifferentialFlowEtaPOI(e,v4,v4Error);
6008 fCommonHistsResults6th->FillDifferentialFlowEtaPOI(e,v6,0.);
6009 fCommonHistsResults8th->FillDifferentialFlowEtaPOI(e,v8,0.);
6010 }
6011 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
6012
6013} // end of void AliFlowAnalysisWithQCumulants::FillCommonHistResultsDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights, Bool_t correctedForNUA)
6014
6015
6016//================================================================================================================================
6017
6018
6019void AliFlowAnalysisWithQCumulants::AccessConstants()
6020{
6021 // Access needed common constants from AliFlowCommonConstants
6022
6023 fnBinsPhi = AliFlowCommonConstants::GetMaster()->GetNbinsPhi();
6024 fPhiMin = AliFlowCommonConstants::GetMaster()->GetPhiMin();
6025 fPhiMax = AliFlowCommonConstants::GetMaster()->GetPhiMax();
6026 if(fnBinsPhi) fPhiBinWidth = (fPhiMax-fPhiMin)/fnBinsPhi;
6027 fnBinsPt = AliFlowCommonConstants::GetMaster()->GetNbinsPt();
6028 fPtMin = AliFlowCommonConstants::GetMaster()->GetPtMin();
6029 fPtMax = AliFlowCommonConstants::GetMaster()->GetPtMax();
6030 if(fnBinsPt) fPtBinWidth = (fPtMax-fPtMin)/fnBinsPt;
6031 fnBinsEta = AliFlowCommonConstants::GetMaster()->GetNbinsEta();
6032 fEtaMin = AliFlowCommonConstants::GetMaster()->GetEtaMin();
6033 fEtaMax = AliFlowCommonConstants::GetMaster()->GetEtaMax();
6034 if(fnBinsEta) fEtaBinWidth = (fEtaMax-fEtaMin)/fnBinsEta;
6035
6036} // end of void AliFlowAnalysisWithQCumulants::AccessConstants()
6037
6038
6039//================================================================================================================================
6040
6041
6042void AliFlowAnalysisWithQCumulants::CrossCheckSettings()
6043{
6044 // a) Cross check if the choice for multiplicity weights make sense;
6045
6046 // a) Cross check if the choice for multiplicity weights make sense:
6047 if(strcmp(fMultiplicityWeight->Data(),"combinations") &&
6048 strcmp(fMultiplicityWeight->Data(),"unit") &&
6049 strcmp(fMultiplicityWeight->Data(),"multiplicity"))
6050 {
6051 cout<<"WARNING (QC): Multiplicity weight can be either \"combinations\", \"unit\""<<endl;
6052 cout<<" or \"multiplicity\". Certainly not \""<<fMultiplicityWeight->Data()<<"\"."<<endl;
6053 exit(0);
6054 }
6055
6056} // end of void AliFlowAnalysisWithQCumulants::CrossCheckSettings()
6057
489d5531 6058//================================================================================================================================
6059
489d5531 6060void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeights()
6061{
0328db2d 6062 // Calculate sum of linear and quadratic event weights for correlations.
ff70ca91 6063
6064 // multiplicity:
6065 Double_t dMult = (*fSMpk)(0,0);
0328db2d 6066
489d5531 6067 for(Int_t p=0;p<2;p++) // power-1
6068 {
6069 for(Int_t ci=0;ci<4;ci++) // correlation index
6070 {
6071 fIntFlowSumOfEventWeights[p]->Fill(ci+0.5,pow(fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci+1),p+1));
ff70ca91 6072 fIntFlowSumOfEventWeightsVsM[ci][p]->Fill(dMult+0.5,pow(fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci+1),p+1));
489d5531 6073 }
6074 }
6075
6076} // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeights()
6077
489d5531 6078//================================================================================================================================
6079
0328db2d 6080void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeightsNUA()
489d5531 6081{
0328db2d 6082 // Calculate sum of linear and quadratic event weights for NUA terms.
6083
6084 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
489d5531 6085 {
0328db2d 6086 for(Int_t p=0;p<2;p++) // power-1
6087 {
6088 for(Int_t ci=0;ci<3;ci++) // nua term index
6089 {
6090 fIntFlowSumOfEventWeightsNUA[sc][p]->Fill(ci+0.5,pow(fIntFlowEventWeightForCorrectionTermsForNUAEBE[sc]->GetBinContent(ci+1),p+1));
489d5531 6091 }
0328db2d 6092 }
6093 }
6094
6095} // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeightsNUA()
489d5531 6096
0328db2d 6097//================================================================================================================================
6098
0328db2d 6099void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfProductOfEventWeights()
6100{
ff70ca91 6101 // Calculate sum of product of event weights for correlations.
6102
6103 // multiplicity:
6104 Double_t dMult = (*fSMpk)(0,0);
489d5531 6105
489d5531 6106 Int_t counter = 0;
6107
6108 for(Int_t ci1=1;ci1<4;ci1++)
6109 {
6110 for(Int_t ci2=ci1+1;ci2<=4;ci2++)
6111 {
ff70ca91 6112 fIntFlowSumOfProductOfEventWeights->Fill(0.5+counter,
6113 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
6114 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
6115 fIntFlowSumOfProductOfEventWeightsVsM[counter]->Fill(dMult+0.5,
6116 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
6117 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
6118 counter++;
489d5531 6119 }
6120 }
6121
0328db2d 6122} // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfProductOfEventWeights()
6123
0328db2d 6124//================================================================================================================================
6125
0328db2d 6126void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfProductOfEventWeightsNUA()
6127{
6128 // Calculate sum of product of event weights for NUA terms.
6129
6130 // w_{<2>} * w_{<cos(#phi)>}:
6131 fIntFlowSumOfProductOfEventWeightsNUA->Fill(0.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6132 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
6133 // w_{<2>} * w_{<sin(#phi)>}:
6134 fIntFlowSumOfProductOfEventWeightsNUA->Fill(1.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6135 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
6136 // w_{<cos(#phi)> * w_{<sin(#phi)>}:
6137 fIntFlowSumOfProductOfEventWeightsNUA->Fill(2.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6138 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
6139 // w_{<2>} * w{<cos(phi1+phi2)>}
6140 fIntFlowSumOfProductOfEventWeightsNUA->Fill(3.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6141 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
6142 // w_{<2>} * w{<sin(phi1+phi2)>}
6143 fIntFlowSumOfProductOfEventWeightsNUA->Fill(4.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6144 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6145 // w_{<2>} * w{<cos(phi1-phi2-phi3)>}
6146 fIntFlowSumOfProductOfEventWeightsNUA->Fill(5.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6147 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6148 // w_{<2>} * w{<sin(phi1-phi2-phi3)>}
6149 fIntFlowSumOfProductOfEventWeightsNUA->Fill(6.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6150 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6151 // w_{<4>} * w{<cos(phi1)>}
6152 fIntFlowSumOfProductOfEventWeightsNUA->Fill(7.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6153 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
6154 // w_{<4>} * w{<sin(phi1)>}
6155 fIntFlowSumOfProductOfEventWeightsNUA->Fill(8.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6156 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
6157 // w_{<4>} * w{<cos(phi1+phi2)>}
6158 fIntFlowSumOfProductOfEventWeightsNUA->Fill(9.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6159 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
6160 // w_{<4>} * w{<sin(phi1+phi2)>}
6161 fIntFlowSumOfProductOfEventWeightsNUA->Fill(10.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6162 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6163 // w_{<4>} * w{<cos(phi1-phi2-phi3)>}
6164 fIntFlowSumOfProductOfEventWeightsNUA->Fill(11.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6165 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6166 // w_{<4>} * w{<sin(phi1-phi2-phi3)>}
6167 fIntFlowSumOfProductOfEventWeightsNUA->Fill(12.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6168 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6169 // w_{<cos(phi1)>} * w{<cos(phi1+phi2)>}
6170 fIntFlowSumOfProductOfEventWeightsNUA->Fill(13.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6171 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
6172 // w_{<cos(phi1)>} * w{<sin(phi1+phi2)>}
6173 fIntFlowSumOfProductOfEventWeightsNUA->Fill(14.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6174 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6175 // w_{<cos(phi1)>} * w{<cos(phi1-phi2-phi3)>}
6176 fIntFlowSumOfProductOfEventWeightsNUA->Fill(15.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6177 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6178 // w_{<cos(phi1)>} * w{<sin(phi1-phi2-phi3)>}
6179 fIntFlowSumOfProductOfEventWeightsNUA->Fill(16.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6180 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6181 // w_{<sin(phi1)>} * w{<cos(phi1+phi2)>}
6182 fIntFlowSumOfProductOfEventWeightsNUA->Fill(17.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
6183 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
6184 // w_{<sin(phi1)>} * w{<sin(phi1+phi2)>}
6185 fIntFlowSumOfProductOfEventWeightsNUA->Fill(18.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
6186 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6187 // w_{<sin(phi1)>} * w{<cos(phi1-phi2-phi3)>}
6188 fIntFlowSumOfProductOfEventWeightsNUA->Fill(19.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
6189 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6190 // w_{<sin(phi1)>} * w{<sin(phi1-phi2-phi3)>}
6191 fIntFlowSumOfProductOfEventWeightsNUA->Fill(20.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
6192 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6193 // w_{<cos(phi1+phi2)>} * w{<sin(phi1+phi2))>}
6194 fIntFlowSumOfProductOfEventWeightsNUA->Fill(21.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)*
6195 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6196 // w_{<cos(phi1+phi2)>} * w{<cos(phi1-phi2-phi3)>}
6197 fIntFlowSumOfProductOfEventWeightsNUA->Fill(22.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)*
6198 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6199 // w_{<cos(phi1+phi2)>} * w{<sin(phi1-phi2-phi3)>}
6200 fIntFlowSumOfProductOfEventWeightsNUA->Fill(23.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)*
6201 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6202 // w_{<sin(phi1+phi2)>} * w{<cos(phi1-phi2-phi3)>}
6203 fIntFlowSumOfProductOfEventWeightsNUA->Fill(24.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)*
6204 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6205 // w_{<sin(phi1+phi2)>} * w{<sin(phi1-phi2-phi3)>}
6206 fIntFlowSumOfProductOfEventWeightsNUA->Fill(25.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)*
6207 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6208 // w_{<cos(phi1-phi2-phi3)>} * w{<sin(phi1-phi2-phi3)>}
6209 fIntFlowSumOfProductOfEventWeightsNUA->Fill(26.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3)*
6210 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6211
6212} // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowIntFlowSumOfProductOfEventWeightsNUA()
489d5531 6213
6214
6215//================================================================================================================================
6216
6217
6218void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelations(TString type, TString ptOrEta)
6219{
6220 // calculate reduced correlations for RPs or POIs in pt or eta bins
6221
6222 // multiplicity:
6223 Double_t dMult = (*fSMpk)(0,0);
6224
6225 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
6226 Double_t dReQ1n = (*fReQ)(0,0);
6227 Double_t dReQ2n = (*fReQ)(1,0);
6228 //Double_t dReQ3n = (*fReQ)(2,0);
6229 //Double_t dReQ4n = (*fReQ)(3,0);
6230 Double_t dImQ1n = (*fImQ)(0,0);
6231 Double_t dImQ2n = (*fImQ)(1,0);
6232 //Double_t dImQ3n = (*fImQ)(2,0);
6233 //Double_t dImQ4n = (*fImQ)(3,0);
6234
6235 // reduced correlations are stored in fDiffFlowCorrelationsPro[0=RP,1=POI][0=pt,1=eta][correlation index]. Correlation index runs as follows:
6236 //
6237 // 0: <<2'>>
6238 // 1: <<4'>>
6239 // 2: <<6'>>
6240 // 3: <<8'>>
6241
6242 Int_t t = -1; // type flag
6243 Int_t pe = -1; // ptEta flag
6244
6245 if(type == "RP")
6246 {
6247 t = 0;
6248 } else if(type == "POI")
6249 {
6250 t = 1;
6251 }
6252
6253 if(ptOrEta == "Pt")
6254 {
6255 pe = 0;
6256 } else if(ptOrEta == "Eta")
6257 {
6258 pe = 1;
6259 }
6260
6261 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6262 Double_t minPtEta[2] = {fPtMin,fEtaMin};
6263 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
6264 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
6265
6266 // looping over all bins and calculating reduced correlations:
6267 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6268 {
6269 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
6270 Double_t p1n0kRe = 0.;
6271 Double_t p1n0kIm = 0.;
6272
6273 // number of POIs in particular pt or eta bin:
6274 Double_t mp = 0.;
6275
6276 // 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):
6277 Double_t q1n0kRe = 0.;
6278 Double_t q1n0kIm = 0.;
6279 Double_t q2n0kRe = 0.;
6280 Double_t q2n0kIm = 0.;
6281
6282 // number of particles which are both RPs and POIs in particular pt or eta bin:
6283 Double_t mq = 0.;
6284
6285 if(type == "POI")
6286 {
6287 // q_{m*n,0}:
6288 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))
6289 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));
6290 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))
6291 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));
6292 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))
6293 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));
6294 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))
6295 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b));
6296
6297 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
6298 }
6299 else if(type == "RP")
6300 {
6301 // q_{m*n,0}:
6302 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
6303 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
6304 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
6305 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
6306 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))
6307 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));
6308 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))
6309 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b));
6310
6311 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
6312 }
6313
6314 if(type == "POI")
6315 {
6316 // p_{m*n,0}:
6317 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
6318 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
6319 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
6320 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
6321
6322 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
6323
6324 t = 1; // typeFlag = RP or POI
6325 }
6326 else if(type == "RP")
6327 {
6328 // p_{m*n,0} = q_{m*n,0}:
6329 p1n0kRe = q1n0kRe;
6330 p1n0kIm = q1n0kIm;
6331
6332 mp = mq;
6333
6334 t = 0; // typeFlag = RP or POI
6335 }
6336
6337 // 2'-particle correlation for particular (pt,eta) bin:
6338 Double_t two1n1nPtEta = 0.;
6339 if(mp*dMult-mq)
6340 {
6341 two1n1nPtEta = (p1n0kRe*dReQ1n+p1n0kIm*dImQ1n-mq)
6342 / (mp*dMult-mq);
6343
6344 if(type == "POI") // to be improved (I do not this if)
6345 {
6346 // fill profile to get <<2'>> for POIs
6347 fDiffFlowCorrelationsPro[1][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta,mp*dMult-mq);
6348 // histogram to store <2'> for POIs e-b-e (needed in some other methods):
6349 fDiffFlowCorrelationsEBE[1][pe][0]->SetBinContent(b,two1n1nPtEta);
6350 fDiffFlowEventWeightsForCorrelationsEBE[1][pe][0]->SetBinContent(b,mp*dMult-mq);
6351 }
6352 else if(type == "RP") // to be improved (I do not this if)
6353 {
6354 // profile to get <<2'>> for RPs:
6355 fDiffFlowCorrelationsPro[0][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta,mp*dMult-mq);
6356 // histogram to store <2'> for RPs e-b-e (needed in some other methods):
6357 fDiffFlowCorrelationsEBE[0][pe][0]->SetBinContent(b,two1n1nPtEta);
6358 fDiffFlowEventWeightsForCorrelationsEBE[0][pe][0]->SetBinContent(b,mp*dMult-mq);
6359 }
6360 } // end of if(mp*dMult-mq)
6361
6362 // 4'-particle correlation:
6363 Double_t four1n1n1n1nPtEta = 0.;
6364 if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6365 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)
6366 {
6367 four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6368 - q2n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))
6369 - 2.*q2n0kIm*dReQ1n*dImQ1n
6370 - p1n0kRe*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)
6371 + p1n0kIm*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)
6372 - 2.*dMult*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6373 - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*mq
6374 + 6.*(q1n0kRe*dReQ1n+q1n0kIm*dImQ1n)
6375 + 1.*(q2n0kRe*dReQ2n+q2n0kIm*dImQ2n)
6376 + 2.*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6377 + 2.*mq*dMult
6378 - 6.*mq)
6379 / ((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6380 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
6381
6382 if(type == "POI")
6383 {
6384 // profile to get <<4'>> for POIs:
6385 fDiffFlowCorrelationsPro[1][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta,
6386 (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6387 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
6388 // histogram to store <4'> for POIs e-b-e (needed in some other methods):
6389 fDiffFlowCorrelationsEBE[1][pe][1]->SetBinContent(b,four1n1n1n1nPtEta);
6390 fDiffFlowEventWeightsForCorrelationsEBE[1][pe][1]->SetBinContent(b,(mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6391 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
6392 }
6393 else if(type == "RP")
6394 {
6395 // profile to get <<4'>> for RPs:
6396 fDiffFlowCorrelationsPro[0][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta,
6397 (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6398 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
6399 // histogram to store <4'> for RPs e-b-e (needed in some other methods):
6400 fDiffFlowCorrelationsEBE[0][pe][1]->SetBinContent(b,four1n1n1n1nPtEta);
6401 fDiffFlowEventWeightsForCorrelationsEBE[0][pe][1]->SetBinContent(b,(mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6402 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
6403 }
6404 } // end of if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6405 // +mq*(dMult-1.)*(dMult-2.)*(dMult-3.))
6406
6407 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6408
6409
6410} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelations(TString type, TString ptOrEta);
6411
6412
6413//================================================================================================================================
6414
6415
6416void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfEventWeights(TString type, TString ptOrEta)
6417{
6418 // Calculate sums of various event weights for reduced correlations.
6419 // (These quantitites are needed in expressions for unbiased estimators relevant for the statistical errors.)
6420
6421 Int_t typeFlag = -1;
6422 Int_t ptEtaFlag = -1;
6423
6424 if(type == "RP")
6425 {
6426 typeFlag = 0;
6427 } else if(type == "POI")
6428 {
6429 typeFlag = 1;
6430 }
6431
6432 if(ptOrEta == "Pt")
6433 {
6434 ptEtaFlag = 0;
6435 } else if(ptOrEta == "Eta")
6436 {
6437 ptEtaFlag = 1;
6438 }
6439
6440 // shortcuts:
6441 Int_t t = typeFlag;
6442 Int_t pe = ptEtaFlag;
6443
6444 // binning:
6445 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6446 Double_t minPtEta[2] = {fPtMin,fEtaMin};
6447 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
6448 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
6449
6450 for(Int_t rpq=0;rpq<3;rpq++)
6451 {
6452 for(Int_t m=0;m<4;m++)
6453 {
6454 for(Int_t k=0;k<9;k++)
6455 {
6456 if(!fReRPQ1dEBE[rpq][pe][m][k])
6457 {
6458 cout<<"WARNING: fReRPQ1dEBE[rpq][pe][m][k] is NULL in AFAWQC::CSAPOEWFDF() !!!!"<<endl;
6459 cout<<"pe = "<<pe<<endl;
6460 cout<<"rpq = "<<rpq<<endl;
6461 cout<<"m = "<<m<<endl;
6462 cout<<"k = "<<k<<endl;
6463 exit(0);
6464 }
6465 }
6466 }
6467 }
6468
6469 // multiplicities:
6470 Double_t dMult = (*fSMpk)(0,0); // total event multiplicity
6471 //Double_t mr = 0.; // number of RPs in particular pt or eta bin
6472 Double_t mp = 0.; // number of POIs in particular pt or eta bin
6473 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin
6474
6475 // event weights for reduced correlations:
6476 Double_t dw2 = 0.; // event weight for <2'>
6477 Double_t dw4 = 0.; // event weight for <4'>
6478 //Double_t dw6 = 0.; // event weight for <6'>
6479 //Double_t dw8 = 0.; // event weight for <8'>
6480
6481 // looping over bins:
6482 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6483 {
6484 if(type == "RP")
6485 {
6486 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);
6487 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
6488 } else if(type == "POI")
6489 {
6490 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);
6491 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b);
6492 }
6493
6494 // event weight for <2'>:
6495 dw2 = mp*dMult-mq;
6496 fDiffFlowSumOfEventWeights[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2);
6497 fDiffFlowSumOfEventWeights[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw2,2.));
6498
6499 // event weight for <4'>:
6500 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6501 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.);
6502 fDiffFlowSumOfEventWeights[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4);
6503 fDiffFlowSumOfEventWeights[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw4,2.));
6504
6505 // event weight for <6'>:
6506 //dw6 = ...;
6507 //fDiffFlowSumOfEventWeights[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6);
6508 //fDiffFlowSumOfEventWeights[t][pe][t][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw6,2.));
6509
6510 // event weight for <8'>:
6511 //dw8 = ...;
6512 //fDiffFlowSumOfEventWeights[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw8);
6513 //fDiffFlowSumOfEventWeights[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw8,2.));
6514 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6515
6516} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfEventWeights()
6517
6518
6519//================================================================================================================================
6520
6521
6522void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfProductOfEventWeights(TString type, TString ptOrEta)
6523{
6524 // Calculate sum of products of various event weights for both types of correlations (the ones for int. and diff. flow).
6525 // (These quantitites are needed in expressions for unbiased estimators relevant for the statistical errors.)
6526 //
6527 // Important: To fill fDiffFlowSumOfProductOfEventWeights[][][][] use bellow table (i,j) with following constraints:
6528 // 1.) i<j
6529 // 2.) do not store terms which DO NOT include reduced correlations;
6530 // Table:
6531 // [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'>]
6532
6533 Int_t typeFlag = -1;
6534 Int_t ptEtaFlag = -1;
6535
6536 if(type == "RP")
6537 {
6538 typeFlag = 0;
6539 } else if(type == "POI")
6540 {
6541 typeFlag = 1;
6542 }
6543
6544 if(ptOrEta == "Pt")
6545 {
6546 ptEtaFlag = 0;
6547 } else if(ptOrEta == "Eta")
6548 {
6549 ptEtaFlag = 1;
6550 }
6551
6552 // shortcuts:
6553 Int_t t = typeFlag;
6554 Int_t pe = ptEtaFlag;
6555
6556 // binning:
6557 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6558 Double_t minPtEta[2] = {fPtMin,fEtaMin};
6559 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
6560 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
6561
6562 // protection:
6563 for(Int_t rpq=0;rpq<3;rpq++)
6564 {
6565 for(Int_t m=0;m<4;m++)
6566 {
6567 for(Int_t k=0;k<9;k++)
6568 {
6569 if(!fReRPQ1dEBE[rpq][pe][m][k])
6570 {
6571 cout<<"WARNING: fReRPQ1dEBE[rpq][pe][m][k] is NULL in AFAWQC::CSAPOEWFDF() !!!!"<<endl;
6572 cout<<"pe = "<<pe<<endl;
6573 cout<<"rpq = "<<rpq<<endl;
6574 cout<<"m = "<<m<<endl;
6575 cout<<"k = "<<k<<endl;
6576 exit(0);
6577 }
6578 }
6579 }
6580 }
6581
6582 // multiplicities:
6583 Double_t dMult = (*fSMpk)(0,0); // total event multiplicity
6584 //Double_t mr = 0.; // number of RPs in particular pt or eta bin
6585 Double_t mp = 0.; // number of POIs in particular pt or eta bin
6586 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin
6587
6588 // event weights for correlations:
6589 Double_t dW2 = dMult*(dMult-1); // event weight for <2>
6590 Double_t dW4 = dMult*(dMult-1)*(dMult-2)*(dMult-3); // event weight for <4>
6591 Double_t dW6 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5); // event weight for <6>
6592 Double_t dW8 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7); // event weight for <8>
6593
6594 // event weights for reduced correlations:
6595 Double_t dw2 = 0.; // event weight for <2'>
6596 Double_t dw4 = 0.; // event weight for <4'>
6597 //Double_t dw6 = 0.; // event weight for <6'>
6598 //Double_t dw8 = 0.; // event weight for <8'>
6599
6600 // looping over bins:
6601 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6602 {
6603 if(type == "RP")
6604 {
6605 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);
6606 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
6607 } else if(type == "POI")
6608 {
6609 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);
6610 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b);
6611 }
6612
6613 // event weight for <2'>:
6614 dw2 = mp*dMult-mq;
6615 fDiffFlowSumOfProductOfEventWeights[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw2); // storing product of even weights for <2> and <2'>
6616 fDiffFlowSumOfProductOfEventWeights[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW4); // storing product of even weights for <4> and <2'>
6617 fDiffFlowSumOfProductOfEventWeights[t][pe][1][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW6); // storing product of even weights for <6> and <2'>
6618 fDiffFlowSumOfProductOfEventWeights[t][pe][1][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW8); // storing product of even weights for <8> and <2'>
6619
6620 // event weight for <4'>:
6621 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6622 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.);
6623 fDiffFlowSumOfProductOfEventWeights[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw4); // storing product of even weights for <2> and <4'>
6624 fDiffFlowSumOfProductOfEventWeights[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw4); // storing product of even weights for <2'> and <4'>
6625 fDiffFlowSumOfProductOfEventWeights[t][pe][2][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw4); // storing product of even weights for <4> and <4'>
6626 fDiffFlowSumOfProductOfEventWeights[t][pe][3][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dW6); // storing product of even weights for <6> and <4'>
6627 fDiffFlowSumOfProductOfEventWeights[t][pe][3][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dW8); // storing product of even weights for <8> and <4'>
6628
6629 // event weight for <6'>:
6630 //dw6 = ...;
6631 //fDiffFlowSumOfProductOfEventWeights[t][pe][0][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw6); // storing product of even weights for <2> and <6'>
6632 //fDiffFlowSumOfProductOfEventWeights[t][pe][1][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw6); // storing product of even weights for <2'> and <6'>
6633 //fDiffFlowSumOfProductOfEventWeights[t][pe][2][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw6); // storing product of even weights for <4> and <6'>
6634 //fDiffFlowSumOfProductOfEventWeights[t][pe][3][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dw6); // storing product of even weights for <4'> and <6'>
6635 //fDiffFlowSumOfProductOfEventWeights[t][pe][4][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW6*dw6); // storing product of even weights for <6> and <6'>
6636 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dW8); // storing product of even weights for <6'> and <8>
6637 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dw8); // storing product of even weights for <6'> and <8'>
6638
6639 // event weight for <8'>:
6640 //dw8 = ...;
6641 //fDiffFlowSumOfProductOfEventWeights[t][pe][0][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw8); // storing product of even weights for <2> and <8'>
6642 //fDiffFlowSumOfProductOfEventWeights[t][pe][1][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw8); // storing product of even weights for <2'> and <8'>
6643 //fDiffFlowSumOfProductOfEventWeights[t][pe][2][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw8); // storing product of even weights for <4> and <8'>
6644 //fDiffFlowSumOfProductOfEventWeights[t][pe][3][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dw8); // storing product of even weights for <4'> and <8'>
6645 //fDiffFlowSumOfProductOfEventWeights[t][pe][4][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW6*dw8); // storing product of even weights for <6> and <8'>
6646 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dw8); // storing product of even weights for <6'> and <8'>
6647 //fDiffFlowSumOfProductOfEventWeights[t][pe][6][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW8*dw8); // storing product of even weights for <8> and <8'>
6648
6649 // Table:
6650 // [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'>]
6651
6652 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6653
6654
6655
6656} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfProductOfEventWeights(TString type, TString ptOrEta)
6657
6658
6659//================================================================================================================================
6660
6661
6662void AliFlowAnalysisWithQCumulants::FinalizeReducedCorrelations(TString type, TString ptOrEta)
6663{
6664 // Transfer profiles into histograms and calculate statistical errors correctly.
6665
6666 Int_t typeFlag = -1;
6667 Int_t ptEtaFlag = -1;
6668
6669 if(type == "RP")
6670 {
6671 typeFlag = 0;
6672 } else if(type == "POI")
6673 {
6674 typeFlag = 1;
6675 }
6676
6677 if(ptOrEta == "Pt")
6678 {
6679 ptEtaFlag = 0;
6680 } else if(ptOrEta == "Eta")
6681 {
6682 ptEtaFlag = 1;
6683 }
6684
6685 // shortcuts:
6686 Int_t t = typeFlag;
6687 Int_t pe = ptEtaFlag;
6688
6689 for(Int_t rci=0;rci<4;rci++)
6690 {
6691 if(!fDiffFlowCorrelationsPro[t][pe][rci])
6692 {
6693 cout<<"WARNING: fDiffFlowCorrelationsPro[t][pe][rci] is NULL in AFAWQC::FRC() !!!!"<<endl;
6694 cout<<"t = "<<t<<endl;
6695 cout<<"pe = "<<pe<<endl;
6696 cout<<"rci = "<<rci<<endl;
6697 exit(0);
6698 }
6699 for(Int_t power=0;power<2;power++)
6700 {
6701 if(!fDiffFlowSumOfEventWeights[t][pe][power][rci])
6702 {
6703 cout<<"WARNING: fDiffFlowSumOfEventWeights[t][pe][power][rci] is NULL in AFAWQC::FRC() !!!!"<<endl;
6704 cout<<"t = "<<t<<endl;
6705 cout<<"pe = "<<pe<<endl;
6706 cout<<"power = "<<power<<endl;
6707 cout<<"rci = "<<rci<<endl;
6708 exit(0);
6709 }
6710 } // end of for(Int_t power=0;power<2;power++)
6711 } // end of for(Int_t rci=0;rci<4;rci++)
6712
6713 // common:
6714 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6715
6716 // transfer 1D profile into 1D histogram:
6717 Double_t correlation = 0.;
6718 Double_t spread = 0.;
6719 Double_t sumOfWeights = 0.; // sum of weights for particular reduced correlations for particular pt or eta bin
6720 Double_t sumOfSquaredWeights = 0.; // sum of squared weights for particular reduced correlations for particular pt or eta bin
6721 Double_t error = 0.; // error = termA * spread * termB
6722 // termA = (sqrt(sumOfSquaredWeights)/sumOfWeights)
6723 // termB = 1/pow(1-termA^2,0.5)
6724 Double_t termA = 0.;
6725 Double_t termB = 0.;
6726 for(Int_t rci=0;rci<4;rci++) // index of reduced correlation
6727 {
6728 for(Int_t b=1;b<=nBinsPtEta[pe];b++) // number of pt or eta bins
6729 {
6730 correlation = fDiffFlowCorrelationsPro[t][pe][rci]->GetBinContent(b);
6731 spread = fDiffFlowCorrelationsPro[t][pe][rci]->GetBinError(b);
6732 sumOfWeights = fDiffFlowSumOfEventWeights[t][pe][0][rci]->GetBinContent(b);
6733 sumOfSquaredWeights = fDiffFlowSumOfEventWeights[t][pe][1][rci]->GetBinContent(b);
6734 if(sumOfWeights) termA = (pow(sumOfSquaredWeights,0.5)/sumOfWeights);
6735 if(1.-pow(termA,2.)>0.) termB = 1./pow(1.-pow(termA,2.),0.5);
6736 error = termA*spread*termB; // final error (unbiased estimator for standard deviation)
6737 fDiffFlowCorrelationsHist[t][pe][rci]->SetBinContent(b,correlation);
6738 fDiffFlowCorrelationsHist[t][pe][rci]->SetBinError(b,error);
6739 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6740 } // end of for(Int_t rci=0;rci<4;rci++)
6741
6742} // end of void AliFlowAnalysisWithQCumulants::FinalizeReducedCorrelations(TString type, TString ptOrEta)
6743
6744
6745//================================================================================================================================
6746
6747
6748void AliFlowAnalysisWithQCumulants::CalculateDiffFlowProductOfCorrelations(TString type, TString ptOrEta)
6749{
6750 // store products: <2><2'>, <2><4'>, <2><6'>, <2><8'>, <2'><4>,
6751 // <2'><4'>, <2'><6>, <2'><6'>, <2'><8>, <2'><8'>,
6752 // <4><4'>, <4><6'>, <4><8'>, <4'><6>, <4'><6'>,
6753 // <4'><8>, <4'><8'>, <6><6'>, <6><8'>, <6'><8>,
6754 // <6'><8'>, <8><8'>.
6755
6756 Int_t typeFlag = -1;
6757 Int_t ptEtaFlag = -1;
6758
6759 if(type == "RP")
6760 {
6761 typeFlag = 0;
6762 } else if(type == "POI")
6763 {
6764 typeFlag = 1;
6765 }
6766
6767 if(ptOrEta == "Pt")
6768 {
6769 ptEtaFlag = 0;
6770 } else if(ptOrEta == "Eta")
6771 {
6772 ptEtaFlag = 1;
6773 }
6774
6775 // shortcuts:
6776 Int_t t = typeFlag;
6777 Int_t pe = ptEtaFlag;
6778
6779 // common:
6780 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6781 Double_t minPtEta[2] = {fPtMin,fEtaMin};
6782 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
6783
6784 // protections // to be improved (add protection for all pointers in this method)
6785 if(!fIntFlowCorrelationsEBE)
6786 {
6787 cout<<"WARNING: fIntFlowCorrelationsEBE is NULL in AFAWQC::CDFPOC() !!!!"<<endl;
6788 exit(0);
6789 }
6790
6791 /*
6792 Double_t dMult = (*fSMpk)(0,0); // multiplicity (number of particles used to determine the reaction plane)
6793 //Double_t mr = 0.; // number of RPs in particular pt or eta bin
6794 Double_t mp = 0.; // number of POIs in particular pt or eta bin
6795 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin
6796 */
6797
6798 // e-b-e correlations:
6799 Double_t twoEBE = fIntFlowCorrelationsEBE->GetBinContent(1); // <2>
6800 Double_t fourEBE = fIntFlowCorrelationsEBE->GetBinContent(2); // <4>
6801 Double_t sixEBE = fIntFlowCorrelationsEBE->GetBinContent(3); // <6>
6802 Double_t eightEBE = fIntFlowCorrelationsEBE->GetBinContent(4); // <8>
6803
6804 // event weights for correlations:
6805 Double_t dW2 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1); // event weight for <2>
6806 Double_t dW4 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2); // event weight for <4>
6807 Double_t dW6 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(3); // event weight for <6>
6808 Double_t dW8 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(4); // event weight for <8>
6809
6810 // e-b-e reduced correlations:
6811 Double_t twoReducedEBE = 0.; // <2'>
6812 Double_t fourReducedEBE = 0.; // <4'>
6813 Double_t sixReducedEBE = 0.; // <6'>
6814 Double_t eightReducedEBE = 0.; // <8'>
6815
6816 // event weights for reduced correlations:
6817 Double_t dw2 = 0.; // event weight for <2'>
6818 Double_t dw4 = 0.; // event weight for <4'>
6819 //Double_t dw6 = 0.; // event weight for <6'>
6820 //Double_t dw8 = 0.; // event weight for <8'>
6821
6822 // looping over bins:
6823 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6824 {
6825 // e-b-e reduced correlations:
6826 twoReducedEBE = fDiffFlowCorrelationsEBE[t][pe][0]->GetBinContent(b);
6827 fourReducedEBE = fDiffFlowCorrelationsEBE[t][pe][1]->GetBinContent(b);
6828 sixReducedEBE = fDiffFlowCorrelationsEBE[t][pe][2]->GetBinContent(b);
6829 eightReducedEBE = fDiffFlowCorrelationsEBE[t][pe][3]->GetBinContent(b);
6830
6831 /*
6832 // to be improved (I should not do this here again)
6833 if(type == "RP")
6834 {
6835 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);
6836 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
6837 } else if(type == "POI")
6838 {
6839 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);
6840 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b);
6841 }
6842
6843 // event weights for reduced correlations:
6844 dw2 = mp*dMult-mq; // weight for <2'>
6845 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6846 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.); // weight for <4'>
6847 //dw6 = ...
6848 //dw8 = ...
6849
6850 */
6851
6852 dw2 = fDiffFlowEventWeightsForCorrelationsEBE[t][pe][0]->GetBinContent(b);
6853 dw4 = fDiffFlowEventWeightsForCorrelationsEBE[t][pe][1]->GetBinContent(b);
6854
6855 // storing all products:
6856 fDiffFlowProductOfCorrelationsPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*twoReducedEBE,dW2*dw2); // storing <2><2'>
6857 fDiffFlowProductOfCorrelationsPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*twoReducedEBE,dW4*dw2); // storing <4><2'>
6858 fDiffFlowProductOfCorrelationsPro[t][pe][1][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*twoReducedEBE,dW6*dw2); // storing <6><2'>
6859 fDiffFlowProductOfCorrelationsPro[t][pe][1][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*twoReducedEBE,dW8*dw2); // storing <8><2'>
6860
6861 // event weight for <4'>:
6862 fDiffFlowProductOfCorrelationsPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*fourReducedEBE,dW2*dw4); // storing <2><4'>
6863 fDiffFlowProductOfCorrelationsPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*fourReducedEBE,dw2*dw4); // storing <2'><4'>
6864 fDiffFlowProductOfCorrelationsPro[t][pe][2][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*fourReducedEBE,dW4*dw4); // storing <4><4'>
6865 fDiffFlowProductOfCorrelationsPro[t][pe][3][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*fourReducedEBE,dW6*dw4); // storing <6><4'>
6866 fDiffFlowProductOfCorrelationsPro[t][pe][3][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*fourReducedEBE,dW8*dw4); // storing <8><4'>
6867
6868 // event weight for <6'>:
6869 //dw6 = ...;
6870 //fDiffFlowProductOfCorrelationsPro[t][pe][0][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*sixReducedEBE,dW2*dw6); // storing <2><6'>
6871 //fDiffFlowProductOfCorrelationsPro[t][pe][1][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*sixReducedEBE,dw2*dw6); // storing <2'><6'>
6872 //fDiffFlowProductOfCorrelationsPro[t][pe][2][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*sixReducedEBE,dW4*dw6); // storing <4><6'>
6873 //fDiffFlowProductOfCorrelationsPro[t][pe][3][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourReducedEBE*sixReducedEBE,dw4*dw6); // storing <4'><6'>
6874 //fDiffFlowProductOfCorrelationsPro[t][pe][4][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*sixReducedEBE,dW6*dw6); // storing <6><6'>
6875 //fDiffFlowProductOfCorrelationsPro[t][pe][5][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightEBE,dw6*dW8); // storing <6'><8>
6876 //fDiffFlowProductOfCorrelationsPro[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightReducedEBE,dw6*dw8); // storing <6'><8'>
6877
6878 // event weight for <8'>:
6879 //dw8 = ...;
6880 //fDiffFlowProductOfCorrelationsPro[t][pe][0][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*eightReducedEBE,dW2*dw8); // storing <2><8'>
6881 //fDiffFlowProductOfCorrelationsPro[t][pe][1][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*eightReducedEBE,dw2*dw8); // storing <2'><8'>
6882 //fDiffFlowProductOfCorrelationsPro[t][pe][2][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*eightReducedEBE,dW4*dw8); // storing <4><8'>
6883 //fDiffFlowProductOfCorrelationsPro[t][pe][3][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourReducedEBE*eightReducedEBE,dw4*dw8); // storing <4'><8'>
6884 //fDiffFlowProductOfCorrelationsPro[t][pe][4][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*eightReducedEBE,dW6*dw8); // storing <6><8'>
6885 //fDiffFlowProductOfCorrelationsPro[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightReducedEBE,dw6*dw8); // storing <6'><8'>
6886 //fDiffFlowProductOfCorrelationsPro[t][pe][6][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*eightReducedEBE,dW8*dw8); // storing <8><8'>
6887 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++
6888
6889} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowProductOfCorrelations(TString type, TString ptOrEta)
6890
6891
6892//================================================================================================================================
6893
6894
6895void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCovariances(TString type, TString ptOrEta) // to be improved (reimplemented)
6896{
6897 // a) Calculate unbiased estimators Cov(<2>,<2'>), Cov(<2>,<4'>), Cov(<4>,<2'>), Cov(<4>,<4'>) and Cov(<2'>,<4'>)
6898 // for covariances V(<2>,<2'>), V(<2>,<4'>), V(<4>,<2'>), V(<4>,<4'>) and V(<2'>,<4'>).
6899 // b) Store in histogram fDiffFlowCovariances[t][pe][index] for instance the following:
6900 //
6901 // 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)]
6902 //
6903 // where N is the number of events, w_{<2>} is event weight for <2> and w_{<2'>} is event weight for <2'>.
6904 // c) Binning of fDiffFlowCovariances[t][pe][index] is organized as follows:
6905 //
6906 // 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)]
6907 // 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)]
6908 // 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)]
6909 // 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)]
6910 // 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)]
6911 // ...
6912
6913 Int_t typeFlag = -1;
6914 Int_t ptEtaFlag = -1;
6915
6916 if(type == "RP")
6917 {
6918 typeFlag = 0;
6919 } else if(type == "POI")
6920 {
6921 typeFlag = 1;
6922 }
6923
6924 if(ptOrEta == "Pt")
6925 {
6926 ptEtaFlag = 0;
6927 } else if(ptOrEta == "Eta")
6928 {
6929 ptEtaFlag = 1;
6930 }
6931
6932 // shortcuts:
6933 Int_t t = typeFlag;
6934 Int_t pe = ptEtaFlag;
6935
6936 // common:
6937 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6938 //Double_t minPtEta[2] = {fPtMin,fEtaMin};
6939 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
6940 //Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
6941
6942 // average correlations:
6943 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
6944 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
6945 //Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
6946 //Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
6947
6948 // sum of weights for correlation:
6949 Double_t sumOfWeightsForTwo = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // sum_{i=1}^{N} w_{<2>}
6950 Double_t sumOfWeightsForFour = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // sum_{i=1}^{N} w_{<4>}
6951 //Double_t sumOfWeightsForSix = fIntFlowSumOfEventWeights[0]->GetBinContent(3); // sum_{i=1}^{N} w_{<6>}
6952 //Double_t sumOfWeightsForEight = fIntFlowSumOfEventWeights[0]->GetBinContent(4); // sum_{i=1}^{N} w_{<8>}
6953
6954 // average reduced correlations:
6955 Double_t twoReduced = 0.; // <<2'>>
6956 Double_t fourReduced = 0.; // <<4'>>
6957 //Double_t sixReduced = 0.; // <<6'>>
6958 //Double_t eightReduced = 0.; // <<8'>>
6959
6960 // sum of weights for reduced correlation:
6961 Double_t sumOfWeightsForTwoReduced = 0.; // sum_{i=1}^{N} w_{<2'>}
6962 Double_t sumOfWeightsForFourReduced = 0.; // sum_{i=1}^{N} w_{<4'>}
6963 //Double_t sumOfWeightsForSixReduced = 0.; // sum_{i=1}^{N} w_{<6'>}
6964 //Double_t sumOfWeightsForEightReduced = 0.; // sum_{i=1}^{N} w_{<8'>}
6965
6966 // product of weights for reduced correlation:
6967 Double_t productOfWeightsForTwoTwoReduced = 0.; // sum_{i=1}^{N} w_{<2>}w_{<2'>}
6968 Double_t productOfWeightsForTwoFourReduced = 0.; // sum_{i=1}^{N} w_{<2>}w_{<4'>}
6969 Double_t productOfWeightsForFourTwoReduced = 0.; // sum_{i=1}^{N} w_{<4>}w_{<2'>}
6970 Double_t productOfWeightsForFourFourReduced = 0.; // sum_{i=1}^{N} w_{<4>}w_{<4'>}
6971 Double_t productOfWeightsForTwoReducedFourReduced = 0.; // sum_{i=1}^{N} w_{<2'>}w_{<4'>}
6972 // ...
6973
6974 // products for differential flow:
6975 Double_t twoTwoReduced = 0; // <<2><2'>>
6976 Double_t twoFourReduced = 0; // <<2><4'>>
6977 Double_t fourTwoReduced = 0; // <<4><2'>>
6978 Double_t fourFourReduced = 0; // <<4><4'>>
6979 Double_t twoReducedFourReduced = 0; // <<2'><4'>>
6980
6981 // denominators in the expressions for the unbiased estimators for covariances:
6982 // denominator = 1 - term1/(term2*term3)
6983 // prefactor = term1/(term2*term3)
6984 Double_t denominator = 0.;
6985 Double_t prefactor = 0.;
6986 Double_t term1 = 0.;
6987 Double_t term2 = 0.;
6988 Double_t term3 = 0.;
6989
6990 // unbiased estimators for covariances for differential flow:
6991 Double_t covTwoTwoReduced = 0.; // Cov(<2>,<2'>)
6992 Double_t wCovTwoTwoReduced = 0.; // Cov(<2>,<2'>) * prefactor(w_{<2>},w_{<2'>})
6993 Double_t covTwoFourReduced = 0.; // Cov(<2>,<4'>)
6994 Double_t wCovTwoFourReduced = 0.; // Cov(<2>,<4'>) * prefactor(w_{<2>},w_{<4'>})
6995 Double_t covFourTwoReduced = 0.; // Cov(<4>,<2'>)
6996 Double_t wCovFourTwoReduced = 0.; // Cov(<4>,<2'>) * prefactor(w_{<4>},w_{<2'>})
6997 Double_t covFourFourReduced = 0.; // Cov(<4>,<4'>)
6998 Double_t wCovFourFourReduced = 0.; // Cov(<4>,<4'>) * prefactor(w_{<4>},w_{<4'>})
6999 Double_t covTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>)
7000 Double_t wCovTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>) * prefactor(w_{<2'>},w_{<4'>})
7001
7002 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7003 {
7004 // average reduced corelations:
7005 twoReduced = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b);
7006 fourReduced = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b);
7007 // average products:
7008 twoTwoReduced = fDiffFlowProductOfCorrelationsPro[t][pe][0][1]->GetBinContent(b);
7009 twoFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][0][3]->GetBinContent(b);
7010 fourTwoReduced = fDiffFlowProductOfCorrelationsPro[t][pe][1][2]->GetBinContent(b);
7011 fourFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][2][3]->GetBinContent(b);
7012 twoReducedFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][1][3]->GetBinContent(b);
7013 // sum of weights for reduced correlations:
7014 sumOfWeightsForTwoReduced = fDiffFlowSumOfEventWeights[t][pe][0][0]->GetBinContent(b);
7015 sumOfWeightsForFourReduced = fDiffFlowSumOfEventWeights[t][pe][0][1]->GetBinContent(b);
7016 // products of weights for correlations:
7017 productOfWeightsForTwoTwoReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][0][1]->GetBinContent(b);
7018 productOfWeightsForTwoFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][0][3]->GetBinContent(b);
7019 productOfWeightsForFourTwoReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][1][2]->GetBinContent(b);
7020 productOfWeightsForFourFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][2][3]->GetBinContent(b);
7021 productOfWeightsForTwoReducedFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][1][3]->GetBinContent(b);
7022 // denominator for the unbiased estimator for covariances: 1 - term1/(term2*term3)
7023 // prefactor (multiplies Cov's) = term1/(term2*term3)
7024 // <2>,<2'>:
7025 term1 = productOfWeightsForTwoTwoReduced;
7026 term2 = sumOfWeightsForTwo;
7027 term3 = sumOfWeightsForTwoReduced;
7028 if(term2*term3>0.)
7029 {
7030 denominator = 1.-term1/(term2*term3);
7031 prefactor = term1/(term2*term3);
0328db2d 7032 if(TMath::Abs(denominator)>1e-6)
489d5531 7033 {
7034 covTwoTwoReduced = (twoTwoReduced-two*twoReduced)/denominator;
7035 wCovTwoTwoReduced = covTwoTwoReduced*prefactor;
7036 fDiffFlowCovariances[t][pe][0]->SetBinContent(b,wCovTwoTwoReduced);
7037 }
7038 }
7039 // <2>,<4'>:
7040 term1 = productOfWeightsForTwoFourReduced;
7041 term2 = sumOfWeightsForTwo;
7042 term3 = sumOfWeightsForFourReduced;
7043 if(term2*term3>0.)
7044 {
7045 denominator = 1.-term1/(term2*term3);
7046 prefactor = term1/(term2*term3);
0328db2d 7047 if(TMath::Abs(denominator)>1e-6)
489d5531 7048 {
7049 covTwoFourReduced = (twoFourReduced-two*fourReduced)/denominator;
7050 wCovTwoFourReduced = covTwoFourReduced*prefactor;
7051 fDiffFlowCovariances[t][pe][1]->SetBinContent(b,wCovTwoFourReduced);
7052 }
7053 }
7054 // <4>,<2'>:
7055 term1 = productOfWeightsForFourTwoReduced;
7056 term2 = sumOfWeightsForFour;
7057 term3 = sumOfWeightsForTwoReduced;
7058 if(term2*term3>0.)
7059 {
7060 denominator = 1.-term1/(term2*term3);
7061 prefactor = term1/(term2*term3);
0328db2d 7062 if(TMath::Abs(denominator)>1e-6)
489d5531 7063 {
7064 covFourTwoReduced = (fourTwoReduced-four*twoReduced)/denominator;
7065 wCovFourTwoReduced = covFourTwoReduced*prefactor;
7066 fDiffFlowCovariances[t][pe][2]->SetBinContent(b,wCovFourTwoReduced);
7067 }
7068 }
7069 // <4>,<4'>:
7070 term1 = productOfWeightsForFourFourReduced;
7071 term2 = sumOfWeightsForFour;
7072 term3 = sumOfWeightsForFourReduced;
7073 if(term2*term3>0.)
7074 {
7075 denominator = 1.-term1/(term2*term3);
7076 prefactor = term1/(term2*term3);
0328db2d 7077 if(TMath::Abs(denominator)>1e-6)
489d5531 7078 {
7079 covFourFourReduced = (fourFourReduced-four*fourReduced)/denominator;
7080 wCovFourFourReduced = covFourFourReduced*prefactor;
7081 fDiffFlowCovariances[t][pe][3]->SetBinContent(b,wCovFourFourReduced);
7082 }
7083 }
7084 // <2'>,<4'>:
7085 term1 = productOfWeightsForTwoReducedFourReduced;
7086 term2 = sumOfWeightsForTwoReduced;
7087 term3 = sumOfWeightsForFourReduced;
7088 if(term2*term3>0.)
7089 {
7090 denominator = 1.-term1/(term2*term3);
7091 prefactor = term1/(term2*term3);
0328db2d 7092 if(TMath::Abs(denominator)>1e-6)
489d5531 7093 {
7094 covTwoReducedFourReduced = (twoReducedFourReduced-twoReduced*fourReduced)/denominator;
7095 wCovTwoReducedFourReduced = covTwoReducedFourReduced*prefactor;
7096 fDiffFlowCovariances[t][pe][4]->SetBinContent(b,wCovTwoReducedFourReduced);
7097 }
7098 }
7099 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7100
7101} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCovariances(TString type, TString ptOrEta)
7102
7103
7104//================================================================================================================================
7105
7106
7107void AliFlowAnalysisWithQCumulants::CalculateDiffFlow(TString type, TString ptOrEta)
7108{
7109 // calculate differential flow from differential cumulants and previously obtained integrated flow: (to be improved: description)
7110
7111 Int_t typeFlag = -1;
7112 Int_t ptEtaFlag = -1;
7113
7114 if(type == "RP")
7115 {
7116 typeFlag = 0;
7117 } else if(type == "POI")
7118 {
7119 typeFlag = 1;
7120 }
7121
7122 if(ptOrEta == "Pt")
7123 {
7124 ptEtaFlag = 0;
7125 } else if(ptOrEta == "Eta")
7126 {
7127 ptEtaFlag = 1;
7128 }
7129
7130 // shortcuts:
7131 Int_t t = typeFlag;
7132 Int_t pe = ptEtaFlag;
7133
7134 // common:
7135 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
7136
7137 // correlations:
7138 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
7139 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
7140
7141 // statistical errors of correlations:
7142 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1);
7143 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2);
7144
7145 // reduced correlations:
7146 Double_t twoReduced = 0.; // <<2'>>
7147 Double_t fourReduced = 0.; // <<4'>>
7148
7149 // statistical errors of reduced correlations:
7150 Double_t twoReducedError = 0.;
7151 Double_t fourReducedError = 0.;
7152
7153 // covariances:
7154 Double_t wCovTwoFour = fIntFlowCovariances->GetBinContent(1);// // Cov(<2>,<4>) * prefactor(<2>,<4>)
7155 Double_t wCovTwoTwoReduced = 0.; // Cov(<2>,<2'>) * prefactor(<2>,<2'>)
7156 Double_t wCovTwoFourReduced = 0.; // Cov(<2>,<4'>) * prefactor(<2>,<4'>)
7157 Double_t wCovFourTwoReduced = 0.; // Cov(<4>,<2'>) * prefactor(<4>,<2'>)
7158 Double_t wCovFourFourReduced = 0.; // Cov(<4>,<4'>) * prefactor(<4>,<4'>)
7159 Double_t wCovTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>) * prefactor(<2'>,<4'>)
7160
7161 // differential flow:
7162 Double_t v2Prime = 0.; // v'{2}
7163 Double_t v4Prime = 0.; // v'{4}
7164
7165 // statistical error of differential flow:
7166 Double_t v2PrimeError = 0.;
7167 Double_t v4PrimeError = 0.;
7168
7169 // squared statistical error of differential flow:
7170 Double_t v2PrimeErrorSquared = 0.;
7171 Double_t v4PrimeErrorSquared = 0.;
7172
7173 // loop over pt or eta bins:
7174 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7175 {
7176 // reduced correlations and statistical errors:
7177 twoReduced = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b);
7178 twoReducedError = fDiffFlowCorrelationsHist[t][pe][0]->GetBinError(b);
7179 fourReduced = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b);
7180 fourReducedError = fDiffFlowCorrelationsHist[t][pe][1]->GetBinError(b);
7181 // covariances:
7182 wCovTwoTwoReduced = fDiffFlowCovariances[t][pe][0]->GetBinContent(b);
7183 wCovTwoFourReduced = fDiffFlowCovariances[t][pe][1]->GetBinContent(b);
7184 wCovFourTwoReduced = fDiffFlowCovariances[t][pe][2]->GetBinContent(b);
7185 wCovFourFourReduced = fDiffFlowCovariances[t][pe][3]->GetBinContent(b);
7186 wCovTwoReducedFourReduced = fDiffFlowCovariances[t][pe][4]->GetBinContent(b);
7187 // differential flow:
7188 // v'{2}:
7189 if(two>0.)
7190 {
7191 v2Prime = twoReduced/pow(two,0.5);
7192 v2PrimeErrorSquared = (1./4.)*pow(two,-3.)*
7193 (pow(twoReduced,2.)*pow(twoError,2.)
7194 + 4.*pow(two,2.)*pow(twoReducedError,2.)
7195 - 4.*two*twoReduced*wCovTwoTwoReduced);
7196
7197
7198 if(v2PrimeErrorSquared>0.) v2PrimeError = pow(v2PrimeErrorSquared,0.5);
7199 fDiffFlow[t][pe][0]->SetBinContent(b,v2Prime);
60694576 7200 if(TMath::Abs(v2Prime)>1.e-44)fDiffFlow[t][pe][0]->SetBinError(b,v2PrimeError);
489d5531 7201 }
7202 // differential flow:
7203 // v'{4}
7204 if(2.*pow(two,2.)-four > 0.)
7205 {
7206 v4Prime = (2.*two*twoReduced-fourReduced)/pow(2.*pow(two,2.)-four,3./4.);
7207 v4PrimeErrorSquared = pow(2.*pow(two,2.)-four,-7./2.)*
7208 (pow(2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced,2.)*pow(twoError,2.)
7209 + (9./16.)*pow(2.*two*twoReduced-fourReduced,2.)*pow(fourError,2.)
7210 + 4.*pow(two,2.)*pow(2.*pow(two,2.)-four,2.)*pow(twoReducedError,2.)
7211 + pow(2.*pow(two,2.)-four,2.)*pow(fourReducedError,2.)
7212 - (3./2.)*(2.*two*twoReduced-fourReduced)
7213 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoFour
7214 - 4.*two*(2.*pow(two,2.)-four)
7215 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoTwoReduced
7216 + 2.*(2.*pow(two,2.)-four)
7217 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoFourReduced
7218 + 3.*two*(2.*pow(two,2.)-four)*(2.*two*twoReduced-fourReduced)*wCovFourTwoReduced
7219 - (3./2.)*(2.*pow(two,2.)-four)*(2.*two*twoReduced-fourReduced)*wCovFourFourReduced
7220 - 4.*two*pow(2.*pow(two,2.)-four,2.)*wCovTwoReducedFourReduced);
7221 if(v4PrimeErrorSquared>0.) v4PrimeError = pow(v4PrimeErrorSquared,0.5);
7222 fDiffFlow[t][pe][1]->SetBinContent(b,v4Prime);
60694576 7223 if(TMath::Abs(v4Prime)>1.e-44)fDiffFlow[t][pe][1]->SetBinError(b,v4PrimeError);
489d5531 7224 }
7225
7226 } // end of for(Int_t b=1;b<=fnBinsPtEta[pe];b++)
7227
7228
7229
7230
7231 /*
7232 // 2D:
7233 for(Int_t nua=0;nua<2;nua++)
7234 {
7235 for(Int_t p=1;p<=fnBinsPt;p++)
7236 {
7237 for(Int_t e=1;e<=fnBinsEta;e++)
7238 {
7239 // differential cumulants:
7240 Double_t qc2Prime = fFinalCumulants2D[t][pW][eW][nua][0]->GetBinContent(fFinalCumulants2D[t][pW][eW][nua][0]->GetBin(p,e)); // QC{2'}
7241 Double_t qc4Prime = fFinalCumulants2D[t][pW][eW][nua][1]->GetBinContent(fFinalCumulants2D[t][pW][eW][nua][1]->GetBin(p,e)); // QC{4'}
7242 // differential flow:
7243 Double_t v2Prime = 0.;
7244 Double_t v4Prime = 0.;
7245 if(v2)
7246 {
7247 v2Prime = qc2Prime/v2;
7248 fFinalFlow2D[t][pW][eW][nua][0]->SetBinContent(fFinalFlow2D[t][pW][eW][nua][0]->GetBin(p,e),v2Prime);
7249 }
7250 if(v4)
7251 {
7252 v4Prime = -qc4Prime/pow(v4,3.);
7253 fFinalFlow2D[t][pW][eW][nua][1]->SetBinContent(fFinalFlow2D[t][pW][eW][nua][1]->GetBin(p,e),v4Prime);
7254 }
7255 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
7256 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
7257 } // end of for(Int_t nua=0;nua<2;nua++)
7258 */
7259
7260} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlow(TString type, Bool_t useParticleWeights)
7261
7262
7263//================================================================================================================================
7264
7265
7266void AliFlowAnalysisWithQCumulants::StoreIntFlowFlags()
7267{
7268 // a) Store all flags for integrated flow in profile fIntFlowFlags.
7269
7270 if(!fIntFlowFlags)
7271 {
7272 cout<<"WARNING: fIntFlowFlags is NULL in AFAWQC::SFFIF() !!!!"<<endl;
7273 exit(0);
7274 }
7275
7276 // particle weights used or not:
7277 fIntFlowFlags->Fill(0.5,(Int_t)fUsePhiWeights||fUsePtWeights||fUseEtaWeights);
7278 // which event weights were used:
7279 if(strcmp(fMultiplicityWeight->Data(),"combinations"))
7280 {
7281 fIntFlowFlags->Fill(1.5,0); // 0 = "combinations" (default)
7282 } else if(strcmp(fMultiplicityWeight->Data(),"unit"))
7283 {
7284 fIntFlowFlags->Fill(1.5,1); // 1 = "unit"
7285 } else if(strcmp(fMultiplicityWeight->Data(),"multiplicity"))
7286 {
7287 fIntFlowFlags->Fill(1.5,2); // 2 = "multiplicity"
7288 }
7289 // corrected for non-uniform acceptance or not:
7290 fIntFlowFlags->Fill(2.5,(Int_t)fApplyCorrectionForNUA);
7291 fIntFlowFlags->Fill(3.5,(Int_t)fPrintFinalResults[0]);
7292 fIntFlowFlags->Fill(4.5,(Int_t)fPrintFinalResults[1]);
7293 fIntFlowFlags->Fill(5.5,(Int_t)fPrintFinalResults[2]);
7294
7295} // end of void AliFlowAnalysisWithQCumulants::StoreIntFlowFlags()
7296
7297
7298//================================================================================================================================
7299
7300
7301void AliFlowAnalysisWithQCumulants::StoreDiffFlowFlags()
7302{
7303 // Store all flags for differential flow in the profile fDiffFlowFlags.
7304
7305 if(!fDiffFlowFlags)
7306 {
7307 cout<<"WARNING: fDiffFlowFlags is NULL in AFAWQC::SFFDF() !!!!"<<endl;
7308 exit(0);
7309 }
7310
7311 fDiffFlowFlags->Fill(0.5,fUsePhiWeights||fUsePtWeights||fUseEtaWeights); // particle weights used or not
7312 //fDiffFlowFlags->Fill(1.5,""); // which event weight was used? // to be improved
7313 fDiffFlowFlags->Fill(2.5,fApplyCorrectionForNUA); // corrected for non-uniform acceptance or not
7314 fDiffFlowFlags->Fill(3.5,fCalculate2DFlow); // calculate also 2D differential flow in (pt,eta) or not
7315
7316} // end of void AliFlowAnalysisWithQCumulants::StoreDiffFlowFlags()
7317
7318
7319//================================================================================================================================
7320
7321
7322void AliFlowAnalysisWithQCumulants::GetPointersForCommonHistograms()
7323{
7324 // Access all pointers to common control and common result histograms and profiles.
7325
7326 TString commonHistsName = "AliFlowCommonHistQC";
7327 commonHistsName += fAnalysisLabel->Data();
7328 AliFlowCommonHist *commonHist = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHistsName.Data()));
7329 if(commonHist) this->SetCommonHists(commonHist);
7330 TString commonHists2ndOrderName = "AliFlowCommonHist2ndOrderQC";
7331 commonHists2ndOrderName += fAnalysisLabel->Data();
7332 AliFlowCommonHist *commonHist2nd = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists2ndOrderName.Data()));
7333 if(commonHist2nd) this->SetCommonHists2nd(commonHist2nd);
7334 TString commonHists4thOrderName = "AliFlowCommonHist4thOrderQC";
7335 commonHists4thOrderName += fAnalysisLabel->Data();
7336 AliFlowCommonHist *commonHist4th = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists4thOrderName.Data()));
7337 if(commonHist4th) this->SetCommonHists4th(commonHist4th);
7338 TString commonHists6thOrderName = "AliFlowCommonHist6thOrderQC";
7339 commonHists6thOrderName += fAnalysisLabel->Data();
7340 AliFlowCommonHist *commonHist6th = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists6thOrderName.Data()));
7341 if(commonHist6th) this->SetCommonHists6th(commonHist6th);
7342 TString commonHists8thOrderName = "AliFlowCommonHist8thOrderQC";
7343 commonHists8thOrderName += fAnalysisLabel->Data();
7344 AliFlowCommonHist *commonHist8th = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists8thOrderName.Data()));
7345 if(commonHist8th) this->SetCommonHists8th(commonHist8th);
7346 TString commonHistResults2ndOrderName = "AliFlowCommonHistResults2ndOrderQC";
7347 commonHistResults2ndOrderName += fAnalysisLabel->Data();
ecac11c2 7348 AliFlowCommonHistResults *commonHistRes2nd = dynamic_cast<AliFlowCommonHistResults*> (fHistList->FindObject(commonHistResults2ndOrderName.Data()));
489d5531 7349 if(commonHistRes2nd) this->SetCommonHistsResults2nd(commonHistRes2nd);
7350 TString commonHistResults4thOrderName = "AliFlowCommonHistResults4thOrderQC";
7351 commonHistResults4thOrderName += fAnalysisLabel->Data();
7352 AliFlowCommonHistResults *commonHistRes4th = dynamic_cast<AliFlowCommonHistResults*>
7353 (fHistList->FindObject(commonHistResults4thOrderName.Data()));
7354 if(commonHistRes4th) this->SetCommonHistsResults4th(commonHistRes4th);
7355 TString commonHistResults6thOrderName = "AliFlowCommonHistResults6thOrderQC";
7356 commonHistResults6thOrderName += fAnalysisLabel->Data();
7357 AliFlowCommonHistResults *commonHistRes6th = dynamic_cast<AliFlowCommonHistResults*>
7358 (fHistList->FindObject(commonHistResults6thOrderName.Data()));
7359 if(commonHistRes6th) this->SetCommonHistsResults6th(commonHistRes6th);
7360 TString commonHistResults8thOrderName = "AliFlowCommonHistResults8thOrderQC";
7361 commonHistResults8thOrderName += fAnalysisLabel->Data();
7362 AliFlowCommonHistResults *commonHistRes8th = dynamic_cast<AliFlowCommonHistResults*>
7363 (fHistList->FindObject(commonHistResults8thOrderName.Data()));
7364 if(commonHistRes8th) this->SetCommonHistsResults8th(commonHistRes8th);
7365
7366} // end of void AliFlowAnalysisWithQCumulants::GetPointersForCommonHistograms()
7367
7368
7369//================================================================================================================================
7370
7371
7372void AliFlowAnalysisWithQCumulants::GetPointersForParticleWeightsHistograms()
7373{
7374 // Get pointers for histograms with particle weights.
7375
7376 TList *weightsList = dynamic_cast<TList*>(fHistList->FindObject("Weights"));
7377 if(weightsList) this->SetWeightsList(weightsList);
7378 TString fUseParticleWeightsName = "fUseParticleWeightsQC"; // to be improved (hirdwired label QC)
7379 fUseParticleWeightsName += fAnalysisLabel->Data();
7380 TProfile *useParticleWeights = dynamic_cast<TProfile*>(weightsList->FindObject(fUseParticleWeightsName.Data()));
7381 if(useParticleWeights)
7382 {
7383 this->SetUseParticleWeights(useParticleWeights);
7384 fUsePhiWeights = (Int_t)fUseParticleWeights->GetBinContent(1);
7385 fUsePtWeights = (Int_t)fUseParticleWeights->GetBinContent(2);
7386 fUseEtaWeights = (Int_t)fUseParticleWeights->GetBinContent(3);
7387 }
7388} // end of void AliFlowAnalysisWithQCumulants::GetPointersForParticleWeightsHistograms();
7389
7390
7391//================================================================================================================================
7392
7393
7394void AliFlowAnalysisWithQCumulants::GetPointersForIntFlowHistograms()
7395{
7396 // Get pointers for histograms and profiles relevant for integrated flow:
7397 // a) Get pointer to base list for integrated flow holding profile fIntFlowFlags and lists fIntFlowProfiles and fIntFlowResults.
7398 // b) Get pointer to profile fIntFlowFlags holding all flags for integrated flow.
7399 // c) Get pointer to list fIntFlowProfiles and pointers to all objects that she holds.
7400 // d) Get pointer to list fIntFlowResults and pointers to all objects that she holds.
7401
7402 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data member?)
7403 TString powerFlag[2] = {"linear","quadratic"}; // to be improved (should I promote this to data member?)
ff70ca91 7404 TString correlationFlag[4] = {"<<2>>","<<4>>","<<6>>","<<8>>"}; // to be improved (should I promote this to data member?)
489d5531 7405
7406 // a) Get pointer to base list for integrated flow holding profile fIntFlowFlags and lists fIntFlowProfiles and fIntFlowResults:
7407 TList *intFlowList = NULL;
7408 intFlowList = dynamic_cast<TList*>(fHistList->FindObject("Integrated Flow"));
7409 if(!intFlowList)
7410 {
7411 cout<<"WARNING: intFlowList is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7412 exit(0);
7413 }
7414
7415 // b) Get pointer to profile fIntFlowFlags holding all flags for integrated flow:
7416 TString intFlowFlagsName = "fIntFlowFlags";
7417 intFlowFlagsName += fAnalysisLabel->Data();
7418 TProfile *intFlowFlags = dynamic_cast<TProfile*>(intFlowList->FindObject(intFlowFlagsName.Data()));
7419 Bool_t bApplyCorrectionForNUA = kFALSE;
7420 if(intFlowFlags)
7421 {
7422 this->SetIntFlowFlags(intFlowFlags);
7423 bApplyCorrectionForNUA = (Int_t)intFlowFlags->GetBinContent(3);
7424 this->SetApplyCorrectionForNUA(bApplyCorrectionForNUA);
7425 } else
7426 {
7427 cout<<"WARNING: intFlowFlags is NULL in FAWQC::GPFIFH() !!!!"<<endl;
7428 }
7429
7430 // c) Get pointer to list fIntFlowProfiles and pointers to all objects that she holds:
7431 TList *intFlowProfiles = NULL;
7432 intFlowProfiles = dynamic_cast<TList*>(intFlowList->FindObject("Profiles"));
7433 if(intFlowProfiles)
7434 {
7435 // average multiplicities:
7436 TString avMultiplicityName = "fAvMultiplicity";
7437 avMultiplicityName += fAnalysisLabel->Data();
7438 TProfile *avMultiplicity = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(avMultiplicityName.Data()));
7439 if(avMultiplicity)
7440 {
7441 this->SetAvMultiplicity(avMultiplicity);
7442 } else
7443 {
7444 cout<<"WARNING: avMultiplicity is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7445 }
7446 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with wrong errors!):
7447 TString intFlowCorrelationsProName = "fIntFlowCorrelationsPro";
7448 intFlowCorrelationsProName += fAnalysisLabel->Data();
7449 TProfile *intFlowCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowCorrelationsProName.Data()));
7450 if(intFlowCorrelationsPro)
7451 {
7452 this->SetIntFlowCorrelationsPro(intFlowCorrelationsPro);
7453 } else
7454 {
7455 cout<<"WARNING: intFlowCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
ff70ca91 7456 }
7457 // average correlations <<2>>, <<4>>, <<6>> and <<8>> versus multiplicity for all events (error is wrong here):
7458 TString intFlowCorrelationsVsMProName = "fIntFlowCorrelationsVsMPro";
7459 intFlowCorrelationsVsMProName += fAnalysisLabel->Data();
7460 for(Int_t ci=0;ci<4;ci++) // correlation index
7461 {
7462 TProfile *intFlowCorrelationsVsMPro = dynamic_cast<TProfile*>
7463 (intFlowProfiles->FindObject(Form("%s, %s",intFlowCorrelationsVsMProName.Data(),correlationFlag[ci].Data())));
7464 if(intFlowCorrelationsVsMPro)
7465 {
7466 this->SetIntFlowCorrelationsVsMPro(intFlowCorrelationsVsMPro,ci);
7467 } else
7468 {
7469 cout<<"WARNING: "<<Form("intFlowCorrelationsVsMPro[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7470 }
7471 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
489d5531 7472 // average all correlations for integrated flow (with wrong errors!):
7473 TString intFlowCorrelationsAllProName = "fIntFlowCorrelationsAllPro";
7474 intFlowCorrelationsAllProName += fAnalysisLabel->Data();
7475 TProfile *intFlowCorrelationsAllPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowCorrelationsAllProName.Data()));
7476 if(intFlowCorrelationsAllPro)
7477 {
7478 this->SetIntFlowCorrelationsAllPro(intFlowCorrelationsAllPro);
7479 } else
7480 {
7481 cout<<"WARNING: intFlowCorrelationsAllPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7482 }
7483 // average extra correlations for integrated flow (which appear only when particle weights are used):
7484 // (to be improved: Weak point in implementation, I am assuming here that method GetPointersForParticleWeightsHistograms() was called)
7485 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
7486 {
7487 TString intFlowExtraCorrelationsProName = "fIntFlowExtraCorrelationsPro";
7488 intFlowExtraCorrelationsProName += fAnalysisLabel->Data();
7489 TProfile *intFlowExtraCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowExtraCorrelationsProName.Data()));
7490 if(intFlowExtraCorrelationsPro)
7491 {
7492 this->SetIntFlowExtraCorrelationsPro(intFlowExtraCorrelationsPro);
7493 } else
7494 {
7495 cout<<"WARNING: intFlowExtraCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7496 }
7497 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
7498 // average products of correlations <2>, <4>, <6> and <8>:
7499 TString intFlowProductOfCorrelationsProName = "fIntFlowProductOfCorrelationsPro";
7500 intFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
7501 TProfile *intFlowProductOfCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowProductOfCorrelationsProName.Data()));
7502 if(intFlowProductOfCorrelationsPro)
7503 {
7504 this->SetIntFlowProductOfCorrelationsPro(intFlowProductOfCorrelationsPro);
7505 } else
7506 {
7507 cout<<"WARNING: intFlowProductOfCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
ff70ca91 7508 }
7509 // average product of correlations <2>, <4>, <6> and <8> versus multiplicity
7510 // [0=<<2><4>>,1=<<2><6>>,2=<<2><8>>,3=<<4><6>>,4=<<4><8>>,5=<<6><8>>]
7511 TString intFlowProductOfCorrelationsVsMProName = "fIntFlowProductOfCorrelationsVsMPro";
7512 intFlowProductOfCorrelationsVsMProName += fAnalysisLabel->Data();
7513 TString productFlag[6] = {"<<2><4>>","<<2><6>>","<<2><8>>","<<4><6>>","<<4><8>>","<<6><8>>"};
7514 for(Int_t pi=0;pi<6;pi++)
7515 {
7516 TProfile *intFlowProductOfCorrelationsVsMPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(Form("%s, %s",intFlowProductOfCorrelationsVsMProName.Data(),productFlag[pi].Data())));
7517 if(intFlowProductOfCorrelationsVsMPro)
7518 {
7519 this->SetIntFlowProductOfCorrelationsVsMPro(intFlowProductOfCorrelationsVsMPro,pi);
7520 } else
7521 {
7522 cout<<"WARNING: "<<Form("intFlowProductOfCorrelationsVsMPro[%d]",pi)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7523 }
7524 } // end of for(Int_t pi=0;pi<6;pi++)
489d5531 7525 // average correction terms for non-uniform acceptance (with wrong errors!):
7526 for(Int_t sc=0;sc<2;sc++)
7527 {
7528 TString intFlowCorrectionTermsForNUAProName = "fIntFlowCorrectionTermsForNUAPro";
7529 intFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
7530 TProfile *intFlowCorrectionTermsForNUAPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject((Form("%s: %s terms",intFlowCorrectionTermsForNUAProName.Data(),sinCosFlag[sc].Data()))));
7531 if(intFlowCorrectionTermsForNUAPro)
7532 {
7533 this->SetIntFlowCorrectionTermsForNUAPro(intFlowCorrectionTermsForNUAPro,sc);
7534 } else
7535 {
7536 cout<<"WARNING: intFlowCorrectionTermsForNUAPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7537 cout<<"sc = "<<sc<<endl;
7538 }
7539 } // end of for(Int_t sc=0;sc<2;sc++)
0328db2d 7540 // average products of correction terms for NUA:
7541 TString intFlowProductOfCorrectionTermsForNUAProName = "fIntFlowProductOfCorrectionTermsForNUAPro";
7542 intFlowProductOfCorrectionTermsForNUAProName += fAnalysisLabel->Data();
7543 TProfile *intFlowProductOfCorrectionTermsForNUAPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowProductOfCorrectionTermsForNUAProName.Data()));
7544 if(intFlowProductOfCorrectionTermsForNUAPro)
7545 {
7546 this->SetIntFlowProductOfCorrectionTermsForNUAPro(intFlowProductOfCorrectionTermsForNUAPro);
7547 } else
7548 {
7549 cout<<"WARNING: intFlowProductOfCorrectionTermsForNUAPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7550 }
489d5531 7551 } else // to if(intFlowProfiles)
7552 {
7553 cout<<"WARNING: intFlowProfiles is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7554 }
7555
7556 // d) Get pointer to list fIntFlowResults and pointers to all objects that she holds.
7557 TList *intFlowResults = NULL;
7558 intFlowResults = dynamic_cast<TList*>(intFlowList->FindObject("Results"));
7559 if(intFlowResults)
7560 {
7561 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with correct errors!):
7562 TString intFlowCorrelationsHistName = "fIntFlowCorrelationsHist";
7563 intFlowCorrelationsHistName += fAnalysisLabel->Data();
7564 TH1D *intFlowCorrelationsHist = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCorrelationsHistName.Data()));
7565 if(intFlowCorrelationsHist)
7566 {
7567 this->SetIntFlowCorrelationsHist(intFlowCorrelationsHist);
7568 } else
7569 {
7570 cout<<"WARNING: intFlowCorrelationsHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7571 }
ff70ca91 7572 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with correct errors!) vs M:
7573 TString intFlowCorrelationsVsMHistName = "fIntFlowCorrelationsVsMHist";
7574 intFlowCorrelationsVsMHistName += fAnalysisLabel->Data();
7575 for(Int_t ci=0;ci<4;ci++) // correlation index
7576 {
7577 TH1D *intFlowCorrelationsVsMHist = dynamic_cast<TH1D*>
7578 (intFlowResults->FindObject(Form("%s, %s",intFlowCorrelationsVsMHistName.Data(),correlationFlag[ci].Data())));
7579 if(intFlowCorrelationsVsMHist)
7580 {
7581 this->SetIntFlowCorrelationsVsMHist(intFlowCorrelationsVsMHist,ci);
7582 } else
7583 {
7584 cout<<"WARNING: "<<Form("intFlowCorrelationsVsMHist[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7585 }
7586 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
489d5531 7587 // average all correlations for integrated flow (with correct errors!):
7588 TString intFlowCorrelationsAllHistName = "fIntFlowCorrelationsAllHist";
7589 intFlowCorrelationsAllHistName += fAnalysisLabel->Data();
7590 TH1D *intFlowCorrelationsAllHist = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCorrelationsAllHistName.Data()));
7591 if(intFlowCorrelationsAllHist)
7592 {
7593 this->SetIntFlowCorrelationsAllHist(intFlowCorrelationsAllHist);
7594 } else
7595 {
7596 cout<<"WARNING: intFlowCorrelationsAllHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7597 }
7598 // average correction terms for non-uniform acceptance (with correct errors!):
7599 TString intFlowCorrectionTermsForNUAHistName = "fIntFlowCorrectionTermsForNUAHist";
7600 intFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
7601 for(Int_t sc=0;sc<2;sc++)
7602 {
7603 TH1D *intFlowCorrectionTermsForNUAHist = dynamic_cast<TH1D*>(intFlowResults->FindObject((Form("%s: %s terms",intFlowCorrectionTermsForNUAHistName.Data(),sinCosFlag[sc].Data()))));
7604 if(intFlowCorrectionTermsForNUAHist)
7605 {
7606 this->SetIntFlowCorrectionTermsForNUAHist(intFlowCorrectionTermsForNUAHist,sc);
7607 } else
7608 {
7609 cout<<"WARNING: intFlowCorrectionTermsForNUAHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7610 cout<<"sc = "<<sc<<endl;
7611 }
7612 } // end of for(Int_t sc=0;sc<2;sc++)
7613 // covariances (multiplied with weight dependent prefactor):
7614 TString intFlowCovariancesName = "fIntFlowCovariances";
7615 intFlowCovariancesName += fAnalysisLabel->Data();
7616 TH1D *intFlowCovariances = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCovariancesName.Data()));
7617 if(intFlowCovariances)
7618 {
7619 this->SetIntFlowCovariances(intFlowCovariances);
7620 } else
7621 {
7622 cout<<"WARNING: intFlowCovariances is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7623 }
7624 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8>:
7625 TString intFlowSumOfEventWeightsName = "fIntFlowSumOfEventWeights";
7626 intFlowSumOfEventWeightsName += fAnalysisLabel->Data();
7627 for(Int_t power=0;power<2;power++)
7628 {
7629 TH1D *intFlowSumOfEventWeights = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s: %s",intFlowSumOfEventWeightsName.Data(),powerFlag[power].Data())));
7630 if(intFlowSumOfEventWeights)
7631 {
7632 this->SetIntFlowSumOfEventWeights(intFlowSumOfEventWeights,power);
7633 } else
7634 {
7635 cout<<"WARNING: intFlowSumOfEventWeights is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7636 cout<<"power = "<<power<<endl;
7637 }
7638 } // end of for(Int_t power=0;power<2;power++)
7639 // sum of products of event weights for correlations <2>, <4>, <6> and <8>:
7640 TString intFlowSumOfProductOfEventWeightsName = "fIntFlowSumOfProductOfEventWeights";
7641 intFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
7642 TH1D *intFlowSumOfProductOfEventWeights = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowSumOfProductOfEventWeightsName.Data()));
7643 if(intFlowSumOfProductOfEventWeights)
7644 {
7645 this->SetIntFlowSumOfProductOfEventWeights(intFlowSumOfProductOfEventWeights);
7646 } else
7647 {
7648 cout<<"WARNING: intFlowSumOfProductOfEventWeights is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7649 }
ff70ca91 7650 // final result for covariances of correlations (multiplied with weight dependent prefactor) versus M
7651 // [0=Cov(2,4),1=Cov(2,6),2=Cov(2,8),3=Cov(4,6),4=Cov(4,8),5=Cov(6,8)]:
7652 TString intFlowCovariancesVsMName = "fIntFlowCovariancesVsM";
7653 intFlowCovariancesVsMName += fAnalysisLabel->Data();
7654 TString covarianceFlag[6] = {"Cov(<2>,<4>)","Cov(<2>,<6>)","Cov(<2>,<8>)","Cov(<4>,<6>)","Cov(<4>,<8>)","Cov(<6>,<8>)"};
7655 for(Int_t ci=0;ci<6;ci++)
7656 {
7657 TH1D *intFlowCovariancesVsM = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s, %s",intFlowCovariancesVsMName.Data(),covarianceFlag[ci].Data())));
7658 if(intFlowCovariancesVsM)
7659 {
7660 this->SetIntFlowCovariancesVsM(intFlowCovariancesVsM,ci);
7661 } else
7662 {
7663 cout<<"WARNING: "<<Form("intFlowCovariancesVsM[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7664 }
7665 } // end of for(Int_t ci=0;ci<6;ci++)
7666 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8> versus multiplicity
7667 // [0=sum{w_{<2>}},1=sum{w_{<4>}},2=sum{w_{<6>}},3=sum{w_{<8>}}][0=linear 1,1=quadratic]:
7668 TString intFlowSumOfEventWeightsVsMName = "fIntFlowSumOfEventWeightsVsM";
7669 intFlowSumOfEventWeightsVsMName += fAnalysisLabel->Data();
7670 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>}"},
7671 {"#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}"}};
7672 for(Int_t si=0;si<4;si++)
7673 {
7674 for(Int_t power=0;power<2;power++)
7675 {
7676 TH1D *intFlowSumOfEventWeightsVsM = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s, %s",intFlowSumOfEventWeightsVsMName.Data(),sumFlag[power][si].Data())));
7677 if(intFlowSumOfEventWeightsVsM)
7678 {
7679 this->SetIntFlowSumOfEventWeightsVsM(intFlowSumOfEventWeightsVsM,si,power);
7680 } else
7681 {
7682 cout<<"WARNING: "<<Form("intFlowSumOfEventWeightsVsM[%d][%d]",si,power)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7683 }
7684 } // end of for(Int_t power=0;power<2;power++)
7685 } // end of for(Int_t si=0;si<4;si++)
7686 // sum of products of event weights for correlations <2>, <4>, <6> and <8> vs M
7687 // [0=sum{w_{<2>}w_{<4>}},1=sum{w_{<2>}w_{<6>}},2=sum{w_{<2>}w_{<8>}},
7688 // 3=sum{w_{<4>}w_{<6>}},4=sum{w_{<4>}w_{<8>}},5=sum{w_{<6>}w_{<8>}}]:
7689 TString intFlowSumOfProductOfEventWeightsVsMName = "fIntFlowSumOfProductOfEventWeightsVsM";
7690 intFlowSumOfProductOfEventWeightsVsMName += fAnalysisLabel->Data();
7691 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>}",
7692 "#sum_{i=1}^{N} w_{<4>} w_{<6>}","#sum_{i=1}^{N} w_{<4>} w_{<8>}","#sum_{i=1}^{N} w_{<6>} w_{<8>}"};
7693 for(Int_t pi=0;pi<6;pi++)
7694 {
7695 TH1D *intFlowSumOfProductOfEventWeightsVsM = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s, %s",intFlowSumOfProductOfEventWeightsVsMName.Data(),sopowFlag[pi].Data())));
7696 if(intFlowSumOfProductOfEventWeightsVsM)
7697 {
7698 this->SetIntFlowSumOfProductOfEventWeightsVsM(intFlowSumOfProductOfEventWeightsVsM,pi);
7699 } else
7700 {
7701 cout<<"WARNING: "<<Form("intFlowSumOfProductOfEventWeightsVsM[%d]",pi)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7702 }
7703 } // end of for(Int_t pi=0;pi<6;pi++)
0328db2d 7704 // covariances for NUA (multiplied with weight dependent prefactor):
7705 TString intFlowCovariancesNUAName = "fIntFlowCovariancesNUA";
7706 intFlowCovariancesNUAName += fAnalysisLabel->Data();
7707 TH1D *intFlowCovariancesNUA = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCovariancesNUAName.Data()));
7708 if(intFlowCovariancesNUA)
7709 {
7710 this->SetIntFlowCovariancesNUA(intFlowCovariancesNUA);
7711 } else
7712 {
7713 cout<<"WARNING: intFlowCovariancesNUA is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7714 }
7715 // sum of linear and quadratic event weights NUA terms:
7716 TString intFlowSumOfEventWeightsNUAName = "fIntFlowSumOfEventWeightsNUA";
7717 intFlowSumOfEventWeightsNUAName += fAnalysisLabel->Data();
7718 for(Int_t sc=0;sc<2;sc++)
7719 {
7720 for(Int_t power=0;power<2;power++)
7721 {
7722 TH1D *intFlowSumOfEventWeightsNUA = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s: %s, %s",intFlowSumOfEventWeightsNUAName.Data(),powerFlag[power].Data(),sinCosFlag[sc].Data())));
7723 if(intFlowSumOfEventWeightsNUA)
7724 {
7725 this->SetIntFlowSumOfEventWeightsNUA(intFlowSumOfEventWeightsNUA,sc,power);
7726 } else
7727 {
7728 cout<<"WARNING: intFlowSumOfEventWeightsNUA is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7729 cout<<"sc = "<<sc<<endl;
7730 cout<<"power = "<<power<<endl;
7731 }
7732 } // end of for(Int_t power=0;power<2;power++)
7733 } // end of for(Int_t sc=0;sc<2;sc++)
7734 // sum of products of event weights for NUA terms:
7735 TString intFlowSumOfProductOfEventWeightsNUAName = "fIntFlowSumOfProductOfEventWeightsNUA";
7736 intFlowSumOfProductOfEventWeightsNUAName += fAnalysisLabel->Data();
7737 TH1D *intFlowSumOfProductOfEventWeightsNUA = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowSumOfProductOfEventWeightsNUAName.Data()));
7738 if(intFlowSumOfProductOfEventWeightsNUA)
7739 {
7740 this->SetIntFlowSumOfProductOfEventWeightsNUA(intFlowSumOfProductOfEventWeightsNUA);
7741 } else
7742 {
7743 cout<<"WARNING: intFlowSumOfProductOfEventWeightsNUA is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7744 }
489d5531 7745 // final results for integrated Q-cumulants:
7746 TString intFlowQcumulantsName = "fIntFlowQcumulants";
7747 intFlowQcumulantsName += fAnalysisLabel->Data();
7748 TH1D *intFlowQcumulants = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowQcumulantsName.Data()));
7749 if(intFlowQcumulants)
7750 {
7751 this->SetIntFlowQcumulants(intFlowQcumulants);
7752 } else
7753 {
7754 cout<<"WARNING: intFlowQcumulants is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7755 }
ff70ca91 7756 // final results for integrated Q-cumulants versus multiplicity:
7757 TString intFlowQcumulantsVsMName = "fIntFlowQcumulantsVsM";
7758 intFlowQcumulantsVsMName += fAnalysisLabel->Data();
7759 TString cumulantFlag[4] = {"QC{2}","QC{4}","QC{6}","QC{8}"};
7760 for(Int_t co=0;co<4;co++) // cumulant order
7761 {
7762 TH1D *intFlowQcumulantsVsM = dynamic_cast<TH1D*>
7763 (intFlowResults->FindObject(Form("%s, %s",intFlowQcumulantsVsMName.Data(),cumulantFlag[co].Data())));
7764 if(intFlowQcumulantsVsM)
7765 {
7766 this->SetIntFlowQcumulantsVsM(intFlowQcumulantsVsM,co);
7767 } else
7768 {
7769 cout<<"WARNING: "<<Form("intFlowQcumulantsVsM[%d]",co)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7770 }
7771 } // end of for(Int_t co=0;co<4;co++) // cumulant order
489d5531 7772 // final integrated flow estimates from Q-cumulants:
7773 TString intFlowName = "fIntFlow";
7774 intFlowName += fAnalysisLabel->Data();
7775 TH1D *intFlow = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowName.Data()));
7776 if(intFlow)
7777 {
7778 this->SetIntFlow(intFlow);
7779 } else
7780 {
7781 cout<<"WARNING: intFlow is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
ff70ca91 7782 }
7783 // integrated flow from Q-cumulants versus multiplicity:
7784 TString intFlowVsMName = "fIntFlowVsM";
7785 intFlowVsMName += fAnalysisLabel->Data();
7786 TString flowFlag[4] = {"v_{2}{2,QC}","v_{2}{4,QC}","v_{2}{6,QC}","v_{2}{8,QC}"}; // to be improved (harwired harmonic)
7787 for(Int_t co=0;co<4;co++) // cumulant order
7788 {
7789 TH1D *intFlowVsM = dynamic_cast<TH1D*>
7790 (intFlowResults->FindObject(Form("%s, %s",intFlowVsMName.Data(),flowFlag[co].Data())));
7791 if(intFlowVsM)
7792 {
7793 this->SetIntFlowVsM(intFlowVsM,co);
7794 } else
7795 {
7796 cout<<"WARNING: "<<Form("intFlowVsM[%d]",co)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7797 }
7798 } // end of for(Int_t co=0;co<4;co++) // cumulant order
489d5531 7799 } else // to if(intFlowResults)
7800 {
7801 cout<<"WARNING: intFlowResults is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7802 }
ff70ca91 7803
489d5531 7804} // end of void AliFlowAnalysisWithQCumulants::GetPointersForIntFlowHistograms()
7805
489d5531 7806//================================================================================================================================
7807
489d5531 7808void AliFlowAnalysisWithQCumulants::GetPointersForDiffFlowHistograms()
7809{
7810 // Get pointer to all objects relevant for differential flow.
7811 // a) Define flags locally (to be improved: should I promote flags to data members?);
7812 // b) Get pointer to base list for differential flow fDiffFlowList and nested lists fDiffFlowListProfiles and fDiffFlowListResults;
7813 // c) Get pointer to profile fDiffFlowFlags holding all flags for differential flow;
7814 // d) Get pointers to all nested lists in fDiffFlowListProfiles and to profiles which they hold;
7815 // e) Get pointers to all nested lists in fDiffFlowListResults and to histograms which they hold.
7816
7817 // a) Define flags locally (to be improved: should I promote flags to data members?):
7818 TString typeFlag[2] = {"RP","POI"};
7819 TString ptEtaFlag[2] = {"p_{T}","#eta"};
7820 TString powerFlag[2] = {"linear","quadratic"};
7821 TString sinCosFlag[2] = {"sin","cos"};
7822 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
7823 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
7824 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};
7825 TString mixedCorrelationIndex[8] = {"<2>","<2'>","<4>","<4'>","<6>","<6'>","<8>","<8'>"};
7826 TString covarianceName[5] = {"Cov(<2>,<2'>)","Cov(<2>,<4'>)","Cov(<4>,<2'>)","Cov(<4>,<4'>)","Cov(<2'>,<4'>)"};
7827
7828 // b) Get pointer to base list for differential flow fDiffFlowList and nested lists fDiffFlowListProfiles and fDiffFlowListResults:
7829 TList *diffFlowList = NULL;
7830 diffFlowList = dynamic_cast<TList*>(fHistList->FindObject("Differential Flow"));
7831 if(!diffFlowList)
7832 {
7833 cout<<"WARNING: diffFlowList is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
7834 exit(0);
7835 }
7836 // list holding nested lists containing profiles:
7837 TList *diffFlowListProfiles = NULL;
7838 diffFlowListProfiles = dynamic_cast<TList*>(diffFlowList->FindObject("Profiles"));
7839 if(!diffFlowListProfiles)
7840 {
7841 cout<<"WARNING: diffFlowListProfiles is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
7842 exit(0);
7843 }
7844 // list holding nested lists containing 2D and 1D histograms with final results:
7845 TList *diffFlowListResults = NULL;
7846 diffFlowListResults = dynamic_cast<TList*>(diffFlowList->FindObject("Results"));
7847 if(!diffFlowListResults)
7848 {
7849 cout<<"WARNING: diffFlowListResults is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
7850 exit(0);
7851 }
7852
7853 // c) Get pointer to profile holding all flags for differential flow;
7854 TString diffFlowFlagsName = "fDiffFlowFlags";
7855 diffFlowFlagsName += fAnalysisLabel->Data();
7856 TProfile *diffFlowFlags = dynamic_cast<TProfile*>(diffFlowList->FindObject(diffFlowFlagsName.Data()));
7857 Bool_t bCalculate2DFlow = kFALSE;
7858 if(diffFlowFlags)
7859 {
7860 this->SetDiffFlowFlags(diffFlowFlags);
7861 bCalculate2DFlow = (Int_t)diffFlowFlags->GetBinContent(4);
7862 this->SetCalculate2DFlow(bCalculate2DFlow); // to be improved (shoul I call this setter somewhere else?)
7863 }
7864
7865 // d) Get pointers to all nested lists in fDiffFlowListProfiles and to profiles which they hold;
7866 // correlations:
7867 TList *diffFlowCorrelationsProList[2][2] = {{NULL}};
7868 TString diffFlowCorrelationsProName = "fDiffFlowCorrelationsPro";
7869 diffFlowCorrelationsProName += fAnalysisLabel->Data();
7870 TProfile *diffFlowCorrelationsPro[2][2][4] = {{{NULL}}};
7871 // products of correlations:
7872 TList *diffFlowProductOfCorrelationsProList[2][2] = {{NULL}};
7873 TString diffFlowProductOfCorrelationsProName = "fDiffFlowProductOfCorrelationsPro";
7874 diffFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
7875 TProfile *diffFlowProductOfCorrelationsPro[2][2][8][8] = {{{{NULL}}}};
7876 // corrections:
7877 TList *diffFlowCorrectionsProList[2][2] = {{NULL}};
7878 TString diffFlowCorrectionTermsForNUAProName = "fDiffFlowCorrectionTermsForNUAPro";
7879 diffFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
7880 TProfile *diffFlowCorrectionTermsForNUAPro[2][2][2][10] = {{{{NULL}}}};
7881 for(Int_t t=0;t<2;t++)
7882 {
7883 for(Int_t pe=0;pe<2;pe++)
7884 {
7885 diffFlowCorrelationsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
7886 if(!diffFlowCorrelationsProList[t][pe])
7887 {
7888 cout<<"WARNING: diffFlowCorrelationsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
7889 cout<<"t = "<<t<<endl;
7890 cout<<"pe = "<<pe<<endl;
7891 exit(0);
7892 }
7893 for(Int_t ci=0;ci<4;ci++) // correlation index
7894 {
7895 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())));
7896 if(diffFlowCorrelationsPro[t][pe][ci])
7897 {
7898 this->SetDiffFlowCorrelationsPro(diffFlowCorrelationsPro[t][pe][ci],t,pe,ci);
7899 } else
7900 {
7901 cout<<"WARNING: diffFlowCorrelationsPro[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
7902 cout<<"t = "<<t<<endl;
7903 cout<<"pe = "<<pe<<endl;
7904 cout<<"ci = "<<ci<<endl;
7905 }
7906 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
7907 // products of correlations:
7908 diffFlowProductOfCorrelationsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with products of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
7909 if(!diffFlowProductOfCorrelationsProList[t][pe])
7910 {
7911 cout<<"WARNING: ddiffFlowProductOfCorrelationsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
7912 cout<<"t = "<<t<<endl;
7913 cout<<"pe = "<<pe<<endl;
7914 exit(0);
7915 }
7916 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
7917 {
7918 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
7919 {
7920 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())));
7921 if(diffFlowProductOfCorrelationsPro[t][pe][mci1][mci2])
7922 {
7923 this->SetDiffFlowProductOfCorrelationsPro(diffFlowProductOfCorrelationsPro[t][pe][mci1][mci2],t,pe,mci1,mci2);
7924 } else
7925 {
7926 cout<<"WARNING: diffFlowCorrelationsPro[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
7927 cout<<"t = "<<t<<endl;
7928 cout<<"pe = "<<pe<<endl;
7929 cout<<"mci1 = "<<mci1<<endl;
7930 cout<<"mci2 = "<<mci2<<endl;
7931 }
7932 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
7933 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
7934 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
7935 // corrections:
7936 diffFlowCorrectionsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
7937 if(!diffFlowCorrectionsProList[t][pe])
7938 {
7939 cout<<"WARNING: diffFlowCorrectionsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
7940 cout<<"t = "<<t<<endl;
7941 cout<<"pe = "<<pe<<endl;
7942 exit(0);
7943 }
7944 // correction terms for NUA:
7945 for(Int_t sc=0;sc<2;sc++) // sin or cos
7946 {
7947 for(Int_t cti=0;cti<9;cti++) // correction term index
7948 {
7949 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)));
7950 if(diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti])
7951 {
7952 this->SetDiffFlowCorrectionTermsForNUAPro(diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti],t,pe,sc,cti);
7953 } else
7954 {
7955 cout<<"WARNING: diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
7956 cout<<"t = "<<t<<endl;
7957 cout<<"pe = "<<pe<<endl;
7958 cout<<"sc = "<<sc<<endl;
7959 cout<<"cti = "<<cti<<endl;
7960 }
7961 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index
7962 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
7963 // ...
7964 } // end of for(Int_t pe=0;pe<2;pe++)
7965 } // end of for(Int_t t=0;t<2;t++)
7966
7967 // e) Get pointers to all nested lists in fDiffFlowListResults and to histograms which they hold.
7968 // reduced correlations:
7969 TList *diffFlowCorrelationsHistList[2][2] = {{NULL}};
7970 TString diffFlowCorrelationsHistName = "fDiffFlowCorrelationsHist";
7971 diffFlowCorrelationsHistName += fAnalysisLabel->Data();
7972 TH1D *diffFlowCorrelationsHist[2][2][4] = {{{NULL}}};
7973 // corrections for NUA:
7974 TList *diffFlowCorrectionsHistList[2][2] = {{NULL}};
7975 TString diffFlowCorrectionTermsForNUAHistName = "fDiffFlowCorrectionTermsForNUAHist";
7976 diffFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
7977 TH1D *diffFlowCorrectionTermsForNUAHist[2][2][2][10] = {{{{NULL}}}};
7978 // differential Q-cumulants:
7979 TList *diffFlowCumulantsHistList[2][2] = {{NULL}};
7980 TString diffFlowCumulantsName = "fDiffFlowCumulants";
7981 diffFlowCumulantsName += fAnalysisLabel->Data();
7982 TH1D *diffFlowCumulants[2][2][4] = {{{NULL}}};
7983 // differential flow estimates from Q-cumulants:
7984 TList *diffFlowHistList[2][2] = {{NULL}};
7985 TString diffFlowName = "fDiffFlow";
7986 diffFlowName += fAnalysisLabel->Data();
7987 TH1D *diffFlow[2][2][4] = {{{NULL}}};
7988 // differential covariances:
7989 TList *diffFlowCovariancesHistList[2][2] = {{NULL}};
7990 TString diffFlowCovariancesName = "fDiffFlowCovariances";
7991 diffFlowCovariancesName += fAnalysisLabel->Data();
7992 TH1D *diffFlowCovariances[2][2][5] = {{{NULL}}};
7993 for(Int_t t=0;t<2;t++) // type: RP or POI
7994 {
7995 for(Int_t pe=0;pe<2;pe++) // pt or eta
7996 {
7997 // reduced correlations:
7998 diffFlowCorrelationsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
7999 if(!diffFlowCorrelationsHistList[t][pe])
8000 {
8001 cout<<"WARNING: diffFlowCorrelationsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8002 cout<<"t = "<<t<<endl;
8003 cout<<"pe = "<<pe<<endl;
8004 exit(0);
8005 }
8006 for(Int_t index=0;index<4;index++)
8007 {
8008 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())));
8009 if(diffFlowCorrelationsHist[t][pe][index])
8010 {
8011 this->SetDiffFlowCorrelationsHist(diffFlowCorrelationsHist[t][pe][index],t,pe,index);
8012 } else
8013 {
8014 cout<<"WARNING: diffFlowCorrelationsHist[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8015 cout<<"t = "<<t<<endl;
8016 cout<<"pe = "<<pe<<endl;
8017 cout<<"index = "<<index<<endl;
8018 exit(0);
8019 }
8020 } // end of for(Int_t index=0;index<4;index++)
8021 // corrections:
8022 diffFlowCorrectionsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Histograms with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8023 if(!diffFlowCorrectionsHistList[t][pe])
8024 {
8025 cout<<"WARNING: diffFlowCorrectionsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8026 cout<<"t = "<<t<<endl;
8027 cout<<"pe = "<<pe<<endl;
8028 exit(0);
8029 }
8030 // correction terms for NUA:
8031 for(Int_t sc=0;sc<2;sc++) // sin or cos
8032 {
8033 for(Int_t cti=0;cti<9;cti++) // correction term index
8034 {
8035 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)));
8036 if(diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti])
8037 {
8038 this->SetDiffFlowCorrectionTermsForNUAHist(diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti],t,pe,sc,cti);
8039 } else
8040 {
8041 cout<<"WARNING: diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8042 cout<<"t = "<<t<<endl;
8043 cout<<"pe = "<<pe<<endl;
8044 cout<<"sc = "<<sc<<endl;
8045 cout<<"cti = "<<cti<<endl;
8046 }
8047 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index
8048 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
8049 // ...
8050 // differential Q-cumulants:
8051 diffFlowCumulantsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Differential Q-cumulants (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8052 if(!diffFlowCumulantsHistList[t][pe])
8053 {
8054 cout<<"WARNING: diffFlowCumulantsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8055 cout<<"t = "<<t<<endl;
8056 cout<<"pe = "<<pe<<endl;
8057 exit(0);
8058 }
8059 for(Int_t index=0;index<4;index++)
8060 {
8061 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())));
8062 if(diffFlowCumulants[t][pe][index])
8063 {
8064 this->SetDiffFlowCumulants(diffFlowCumulants[t][pe][index],t,pe,index);
8065 } else
8066 {
8067 cout<<"WARNING: diffFlowCumulants[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8068 cout<<"t = "<<t<<endl;
8069 cout<<"pe = "<<pe<<endl;
8070 cout<<"index = "<<index<<endl;
8071 exit(0);
8072 }
8073 } // end of for(Int_t index=0;index<4;index++)
8074 // differential flow estimates from Q-cumulants:
8075 diffFlowHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Differential flow (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8076 if(!diffFlowHistList[t][pe])
8077 {
8078 cout<<"WARNING: diffFlowHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8079 cout<<"t = "<<t<<endl;
8080 cout<<"pe = "<<pe<<endl;
8081 exit(0);
8082 }
8083 for(Int_t index=0;index<4;index++)
8084 {
8085 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())));
8086 if(diffFlow[t][pe][index])
8087 {
8088 this->SetDiffFlow(diffFlow[t][pe][index],t,pe,index);
8089 } else
8090 {
8091 cout<<"WARNING: diffFlow[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8092 cout<<"t = "<<t<<endl;
8093 cout<<"pe = "<<pe<<endl;
8094 cout<<"index = "<<index<<endl;
8095 exit(0);
8096 }
8097 } // end of for(Int_t index=0;index<4;index++)
8098 // differential covariances:
8099 diffFlowCovariancesHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Covariances of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8100 if(!diffFlowCovariancesHistList[t][pe])
8101 {
8102 cout<<"WARNING: diffFlowCovariancesHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8103 cout<<"t = "<<t<<endl;
8104 cout<<"pe = "<<pe<<endl;
8105 exit(0);
8106 }
8107 for(Int_t covIndex=0;covIndex<5;covIndex++)
8108 {
8109 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())));
8110 if(diffFlowCovariances[t][pe][covIndex])
8111 {
8112 this->SetDiffFlowCovariances(diffFlowCovariances[t][pe][covIndex],t,pe,covIndex);
8113 } else
8114 {
8115 cout<<"WARNING: diffFlowCovariances[t][pe][covIndex] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8116 cout<<"t = "<<t<<endl;
8117 cout<<"pe = "<<pe<<endl;
8118 cout<<"covIndex = "<<covIndex<<endl;
8119 exit(0);
8120 }
8121 } // end of for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index
8122 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8123 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8124 // sum of event weights for reduced correlations:
8125 TList *diffFlowSumOfEventWeightsHistList[2][2][2] = {{{NULL}}};
8126 TString diffFlowSumOfEventWeightsName = "fDiffFlowSumOfEventWeights";
8127 diffFlowSumOfEventWeightsName += fAnalysisLabel->Data();
8128 TH1D *diffFlowSumOfEventWeights[2][2][2][4] = {{{{NULL}}}};
8129 for(Int_t t=0;t<2;t++) // type is RP or POI
8130 {
8131 for(Int_t pe=0;pe<2;pe++) // pt or eta
8132 {
8133 for(Int_t p=0;p<2;p++) // power of event weights is either 1 or 2
8134 {
8135 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())));
8136 if(!diffFlowSumOfEventWeightsHistList[t][pe][p])
8137 {
8138 cout<<"WARNING: diffFlowSumOfEventWeightsHistList[t][pe][p] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8139 cout<<"t = "<<t<<endl;
8140 cout<<"pe = "<<pe<<endl;
8141 cout<<"power = "<<p<<endl;
8142 exit(0);
8143 }
8144 for(Int_t ew=0;ew<4;ew++) // index of reduced correlation
8145 {
8146 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())));
8147 if(diffFlowSumOfEventWeights[t][pe][p][ew])
8148 {
8149 this->SetDiffFlowSumOfEventWeights(diffFlowSumOfEventWeights[t][pe][p][ew],t,pe,p,ew);
8150 } else
8151 {
8152 cout<<"WARNING: diffFlowSumOfEventWeights[t][pe][p][ew] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8153 cout<<"t = "<<t<<endl;
8154 cout<<"pe = "<<pe<<endl;
8155 cout<<"power = "<<p<<endl;
8156 cout<<"ew = "<<ew<<endl;
8157 exit(0);
8158 }
8159 }
8160 } // end of for(Int_t p=0;p<2;p++) // power of event weights is either 1 or 2
8161 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8162 } // end of for(Int_t t=0;t<2;t++) // type is RP or POI
8163 //
8164 TList *diffFlowSumOfProductOfEventWeightsHistList[2][2] = {{NULL}};
8165 TString diffFlowSumOfProductOfEventWeightsName = "fDiffFlowSumOfProductOfEventWeights";
8166 diffFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
8167 TH1D *diffFlowSumOfProductOfEventWeights[2][2][8][8] = {{{{NULL}}}};
8168 for(Int_t t=0;t<2;t++) // type is RP or POI
8169 {
8170 for(Int_t pe=0;pe<2;pe++) // pt or eta
8171 {
8172 diffFlowSumOfProductOfEventWeightsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Sum of products of event weights (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8173 if(!diffFlowSumOfProductOfEventWeightsHistList[t][pe])
8174 {
8175 cout<<"WARNING: diffFlowSumOfProductOfEventWeightsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8176 cout<<"t = "<<t<<endl;
8177 cout<<"pe = "<<pe<<endl;
8178 exit(0);
8179 }
8180 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8181 {
8182 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8183 {
8184 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())));
8185 if(diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2])
8186 {
8187 this->SetDiffFlowSumOfProductOfEventWeights(diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2],t,pe,mci1,mci2);
8188 } else
8189 {
8190 cout<<"WARNING: diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8191 cout<<"t = "<<t<<endl;
8192 cout<<"pe = "<<pe<<endl;
8193 cout<<"mci1 = "<<mci1<<endl;
8194 cout<<"mci2 = "<<mci2<<endl;
8195 exit(0);
8196 }
8197 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
8198 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8199 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8200 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8201 } // end of for(Int_t t=0;t<2;t++) // type is RP or POI
8202
8203} // end void AliFlowAnalysisWithQCumulants::GetPointersForDiffFlowHistograms()
8204
8205
8206//================================================================================================================================
8207
8208
8209void AliFlowAnalysisWithQCumulants::BookEverythingForDifferentialFlow()
8210{
8211 // Book all histograms and profiles needed for differential flow.
8212 // a) Define flags locally (to be improved: should I promote flags to data members?);
8213 // b) Book profile to hold all flags for differential flow;
8214 // c) Book e-b-e quantities;
8215 // d) Book profiles;
8216 // e) Book histograms holding final results.
8217
8218 // a) Define flags locally (to be improved: should I promote flags to data members?):
8219 TString typeFlag[2] = {"RP","POI"};
8220 TString ptEtaFlag[2] = {"p_{T}","#eta"};
8221 TString powerFlag[2] = {"linear","quadratic"};
8222 TString sinCosFlag[2] = {"sin","cos"};
8223 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
8224 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
8225 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};
8226 TString mixedCorrelationIndex[8] = {"<2>","<2'>","<4>","<4'>","<6>","<6'>","<8>","<8'>"};
8227 TString covarianceName[5] = {"Cov(<2>,<2'>)","Cov(<2>,<4'>)","Cov(<4>,<2'>)","Cov(<4>,<4'>)","Cov(<2'>,<4'>)"};
8228 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
8229 Double_t minPtEta[2] = {fPtMin,fEtaMin};
8230 Double_t maxPtEta[2] = {fPtMax,fEtaMax};
8231
8232 // b) Book profile to hold all flags for differential flow:
8233 TString diffFlowFlagsName = "fDiffFlowFlags";
8234 diffFlowFlagsName += fAnalysisLabel->Data();
8235 fDiffFlowFlags = new TProfile(diffFlowFlagsName.Data(),"Flags for Differential Flow",4,0,4);
8236 fDiffFlowFlags->SetTickLength(-0.01,"Y");
8237 fDiffFlowFlags->SetMarkerStyle(25);
8238 fDiffFlowFlags->SetLabelSize(0.05);
8239 fDiffFlowFlags->SetLabelOffset(0.02,"Y");
8240 (fDiffFlowFlags->GetXaxis())->SetBinLabel(1,"Particle Weights");
8241 (fDiffFlowFlags->GetXaxis())->SetBinLabel(2,"Event Weights");
8242 (fDiffFlowFlags->GetXaxis())->SetBinLabel(3,"Corrected for NUA?");
8243 (fDiffFlowFlags->GetXaxis())->SetBinLabel(4,"Calculated 2D flow?");
8244 fDiffFlowList->Add(fDiffFlowFlags);
8245
8246 // c) Book e-b-e quantities:
8247 // Event-by-event r_{m*n,k}(pt,eta), p_{m*n,k}(pt,eta) and q_{m*n,k}(pt,eta)
8248 // Explanantion of notation:
8249 // 1.) n is harmonic, m is multiple of harmonic;
8250 // 2.) k is power of particle weight;
8251 // 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);
8252 // 4.) p_{m*n,k}(pt,eta) = Q-vector evaluated in harmonic m*n for POIs in particular (pt,eta) bin
8253 // (if i-th POI is also RP, than it is weighted with w_i^k);
8254 // 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
8255 // (i-th RP&&POI is weighted with w_i^k)
8256
8257 // 1D:
8258 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP && POI )
8259 {
8260 for(Int_t pe=0;pe<2;pe++) // pt or eta
8261 {
8262 for(Int_t m=0;m<4;m++) // multiple of harmonic
8263 {
8264 for(Int_t k=0;k<9;k++) // power of particle weight
8265 {
8266 fReRPQ1dEBE[t][pe][m][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%dpower%dRe",t,pe,m,k),
8267 Form("TypeFlag%dpteta%dmultiple%dpower%dRe",t,pe,m,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8268 fImRPQ1dEBE[t][pe][m][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%dpower%dIm",t,pe,m,k),
8269 Form("TypeFlag%dpteta%dmultiple%dpower%dIm",t,pe,m,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8270 }
8271 }
8272 }
8273 }
8274 // to be improved (add explanation of fs1dEBE[t][pe][k]):
8275 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
8276 {
8277 for(Int_t pe=0;pe<2;pe++) // pt or eta
8278 {
8279 for(Int_t k=0;k<9;k++) // power of particle weight
8280 {
8281 fs1dEBE[t][pe][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%d",t,pe,k),
8282 Form("TypeFlag%dpteta%dmultiple%d",t,pe,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8283 }
8284 }
8285 }
8286 // correction terms for nua:
8287 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
8288 {
8289 for(Int_t pe=0;pe<2;pe++) // pt or eta
8290 {
8291 for(Int_t sc=0;sc<2;sc++) // sin or cos
8292 {
8293 for(Int_t cti=0;cti<9;cti++) // correction term index
8294 {
8295 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti] = new TH1D(Form("typeFlag%d pteta%d sincos%d cti%d",t,pe,sc,cti),
8296 Form("typeFlag%d pteta%d sincos%d cti%d",t,pe,sc,cti),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8297 }
8298 }
8299 }
8300 }
8301 // 2D:
8302 TProfile2D styleRe("typeMultiplePowerRe","typeMultiplePowerRe",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
8303 TProfile2D styleIm("typeMultiplePowerIm","typeMultiplePowerIm",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
8304 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
8305 {
8306 for(Int_t m=0;m<4;m++)
8307 {
8308 for(Int_t k=0;k<9;k++)
8309 {
8310 fReRPQ2dEBE[t][m][k] = (TProfile2D*)styleRe.Clone(Form("typeFlag%dmultiple%dpower%dRe",t,m,k));
8311 fImRPQ2dEBE[t][m][k] = (TProfile2D*)styleIm.Clone(Form("typeFlag%dmultiple%dpower%dIm",t,m,k));
8312 }
8313 }
8314 }
8315 TProfile2D styleS("typePower","typePower",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
8316 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
8317 {
8318 for(Int_t k=0;k<9;k++)
8319 {
8320 fs2dEBE[t][k] = (TProfile2D*)styleS.Clone(Form("typeFlag%dpower%d",t,k));
8321 }
8322 }
8323 // reduced correlations e-b-e:
8324 TString diffFlowCorrelationsEBEName = "fDiffFlowCorrelationsEBE";
8325 diffFlowCorrelationsEBEName += fAnalysisLabel->Data();
8326 for(Int_t t=0;t<2;t++) // type: RP or POI
8327 {
8328 for(Int_t pe=0;pe<2;pe++) // pt or eta
8329 {
8330 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8331 {
8332 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]);
8333 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
8334 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8335 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8336 // event weights for reduced correlations e-b-e:
8337 TString diffFlowEventWeightsForCorrelationsEBEName = "fDiffFlowEventWeightsForCorrelationsEBE";
8338 diffFlowEventWeightsForCorrelationsEBEName += fAnalysisLabel->Data();
8339 for(Int_t t=0;t<2;t++) // type: RP or POI
8340 {
8341 for(Int_t pe=0;pe<2;pe++) // pt or eta
8342 {
8343 for(Int_t rci=0;rci<4;rci++) // event weight for reduced correlation index
8344 {
8345 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]);
8346 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
8347 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8348 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8349
8350 // d) Book profiles;
8351 // reduced correlations:
8352 TString diffFlowCorrelationsProName = "fDiffFlowCorrelationsPro";
8353 diffFlowCorrelationsProName += fAnalysisLabel->Data();
8354 // corrections terms:
8355 TString diffFlowCorrectionTermsForNUAProName = "fDiffFlowCorrectionTermsForNUAPro";
8356 diffFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
8357 for(Int_t t=0;t<2;t++) // type: RP or POI
8358 {
8359 for(Int_t pe=0;pe<2;pe++) // pt or eta
8360 {
8361 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8362 {
8363 // reduced correlations:
8364 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");
8365 fDiffFlowCorrelationsPro[t][pe][rci]->SetXTitle(ptEtaFlag[pe].Data());
8366 fDiffFlowCorrelationsProList[t][pe]->Add(fDiffFlowCorrelationsPro[t][pe][rci]); // to be improved (add dedicated list to hold reduced correlations)
8367 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
8368 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8369 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8370 // correction terms for nua:
8371 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
8372 {
8373 for(Int_t pe=0;pe<2;pe++) // pt or eta
8374 {
8375 for(Int_t sc=0;sc<2;sc++) // sin or cos
8376 {
8377 for(Int_t cti=0;cti<9;cti++) // correction term index
8378 {
8379 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]);
8380 fDiffFlowCorrectionsProList[t][pe]->Add(fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]);
8381 }
8382 }
8383 }
8384 }
8385 // e) Book histograms holding final results.
8386 // reduced correlations:
8387 TString diffFlowCorrelationsHistName = "fDiffFlowCorrelationsHist";
8388 diffFlowCorrelationsHistName += fAnalysisLabel->Data();
8389 // corrections terms:
8390 TString diffFlowCorrectionTermsForNUAHistName = "fDiffFlowCorrectionTermsForNUAHist";
8391 diffFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
8392 // differential covariances:
8393 TString diffFlowCovariancesName = "fDiffFlowCovariances";
8394 diffFlowCovariancesName += fAnalysisLabel->Data();
8395 // differential Q-cumulants:
8396 TString diffFlowCumulantsName = "fDiffFlowCumulants";
8397 diffFlowCumulantsName += fAnalysisLabel->Data();
8398 // differential flow:
8399 TString diffFlowName = "fDiffFlow";
8400 diffFlowName += fAnalysisLabel->Data();
8401 for(Int_t t=0;t<2;t++) // type: RP or POI
8402 {
8403 for(Int_t pe=0;pe<2;pe++) // pt or eta
8404 {
8405 for(Int_t index=0;index<4;index++)
8406 {
8407 // reduced correlations:
8408 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]);
8409 fDiffFlowCorrelationsHist[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
8410 fDiffFlowCorrelationsHistList[t][pe]->Add(fDiffFlowCorrelationsHist[t][pe][index]);
8411 // differential Q-cumulants:
8412 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]);
8413 fDiffFlowCumulants[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
8414 fDiffFlowCumulantsHistList[t][pe]->Add(fDiffFlowCumulants[t][pe][index]);
8415 // differential flow estimates from Q-cumulants:
8416 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]);
8417 fDiffFlow[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
8418 fDiffFlowHistList[t][pe]->Add(fDiffFlow[t][pe][index]);
8419 } // end of for(Int_t index=0;index<4;index++)
8420 for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index
8421 {
8422 // differential covariances:
8423 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]);
8424 fDiffFlowCovariances[t][pe][covIndex]->SetXTitle(ptEtaFlag[pe].Data());
8425 fDiffFlowCovariancesHistList[t][pe]->Add(fDiffFlowCovariances[t][pe][covIndex]);
8426 } // end of for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index
8427 // products of both types of correlations:
8428 TString diffFlowProductOfCorrelationsProName = "fDiffFlowProductOfCorrelationsPro";
8429 diffFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
8430 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8431 {
8432 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8433 {
8434 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]);
8435 fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2]->SetXTitle(ptEtaFlag[pe].Data());
8436 fDiffFlowProductOfCorrelationsProList[t][pe]->Add(fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2]);
8437 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
8438 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8439 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8440 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8441 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8442 // sums of event weights for reduced correlations:
8443 TString diffFlowSumOfEventWeightsName = "fDiffFlowSumOfEventWeights";
8444 diffFlowSumOfEventWeightsName += fAnalysisLabel->Data();
8445 for(Int_t t=0;t<2;t++) // type is RP or POI
8446 {
8447 for(Int_t pe=0;pe<2;pe++) // pt or eta
8448 {
8449 for(Int_t p=0;p<2;p++) // power of weights is either 1 or 2
8450 {
8451 for(Int_t ew=0;ew<4;ew++) // index of reduced correlation
8452 {
8453 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]);
8454 fDiffFlowSumOfEventWeights[t][pe][p][ew]->SetXTitle(ptEtaFlag[pe].Data());
8455 fDiffFlowSumOfEventWeightsHistList[t][pe][p]->Add(fDiffFlowSumOfEventWeights[t][pe][p][ew]); // to be improved (add dedicated list to hold all this)
8456 }
8457 }
8458 }
8459 }
8460 // sum of products of event weights for both types of correlations:
8461 TString diffFlowSumOfProductOfEventWeightsName = "fDiffFlowSumOfProductOfEventWeights";
8462 diffFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
8463 for(Int_t t=0;t<2;t++) // type is RP or POI
8464 {
8465 for(Int_t pe=0;pe<2;pe++) // pt or eta
8466 {
8467 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8468 {
8469 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8470 {
8471 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]);
8472 fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2]->SetXTitle(ptEtaFlag[pe].Data());
8473 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]->Add(fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2]);
8474 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
8475 }
8476 }
8477 }
8478 }
8479 // correction terms for nua:
8480 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
8481 {
8482 for(Int_t pe=0;pe<2;pe++) // pt or eta
8483 {
8484 for(Int_t sc=0;sc<2;sc++) // sin or cos
8485 {
8486 for(Int_t cti=0;cti<9;cti++) // correction term index
8487 {
8488 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]);
8489 fDiffFlowCorrectionsHistList[t][pe]->Add(fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti]);
8490 }
8491 }
8492 }
8493 }
8494
8495} // end of AliFlowAnalysisWithQCumulants::BookEverythingForDifferentialFlow()
8496
8497
8498//================================================================================================================================
8499
8500/*
8501void AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNUAForIntQcumulants() // to be improved (do I really need this method?)
8502{
8503 // Calculate final corrections for non-uniform acceptance for Q-cumulants.
8504
8505 // Corrections for non-uniform acceptance are stored in histogram fCorrectionsForNUA,
8506 // binning of fCorrectionsForNUA is organized as follows:
8507 //
8508 // 1st bin: correction to QC{2}
8509 // 2nd bin: correction to QC{4}
8510 // 3rd bin: correction to QC{6}
8511 // 4th bin: correction to QC{8}
8512
8513 // shortcuts flags:
8514 Int_t pW = (Int_t)(useParticleWeights);
8515
8516 Int_t eW = -1;
8517
8518 if(eventWeights == "exact")
8519 {
8520 eW = 0;
8521 }
8522
8523 for(Int_t sc=0;sc<2;sc++) // sin or cos terms flag
8524 {
8525 if(!(fQCorrelations[pW][eW] && fQCorrections[pW][eW][sc] && fCorrections[pW][eW]))
8526 {
8527 cout<<"WARNING: fQCorrelations[pW][eW] && fQCorrections[pW][eW][sc] && fCorrections[pW][eW] is NULL in AFAWQC::CFCFNUAFIF() !!!!"<<endl;
8528 cout<<"pW = "<<pW<<endl;
8529 cout<<"eW = "<<eW<<endl;
8530 cout<<"sc = "<<sc<<endl;
8531 exit(0);
8532 }
8533 }
8534
8535 // measured 2-, 4-, 6- and 8-particle azimuthal correlations (biased with non-uniform acceptance!):
8536 Double_t two = fQCorrelations[pW][eW]->GetBinContent(1); // <<2>>
8537 //Double_t four = fQCorrelations[pW][eW]->GetBinContent(11); // <<4>>
8538 //Double_t six = fQCorrelations[pW][eW]->GetBinContent(24); // <<6>>
8539 //Double_t eight = fQCorrelations[pW][eW]->GetBinContent(31); // <<8>>
8540
8541 // correction terms to QC{2}:
8542 // <<cos(n*phi1)>>^2
8543 Double_t two1stTerm = pow(fQCorrections[pW][eW][1]->GetBinContent(1),2);
8544 // <<sin(n*phi1)>>^2
8545 Double_t two2ndTerm = pow(fQCorrections[pW][eW][0]->GetBinContent(1),2);
8546 // final corrections for non-uniform acceptance to QC{2}:
8547 Double_t correctionQC2 = -1.*two1stTerm-1.*two2ndTerm;
8548 fCorrections[pW][eW]->SetBinContent(1,correctionQC2);
8549
8550 // correction terms to QC{4}:
8551 // <<cos(n*phi1)>> <<cos(n*(phi1-phi2-phi3))>>
8552 Double_t four1stTerm = fQCorrections[pW][eW][1]->GetBinContent(1)*fQCorrections[pW][eW][1]->GetBinContent(3);
8553 // <<sin(n*phi1)>> <<sin(n*(phi1-phi2-phi3))>>
8554 Double_t four2ndTerm = fQCorrections[pW][eW][0]->GetBinContent(1)*fQCorrections[pW][eW][0]->GetBinContent(3);
8555 // <<cos(n*(phi1+phi2))>>^2
8556 Double_t four3rdTerm = pow(fQCorrections[pW][eW][1]->GetBinContent(2),2);
8557 // <<sin(n*(phi1+phi2))>>^2
8558 Double_t four4thTerm = pow(fQCorrections[pW][eW][0]->GetBinContent(2),2);
8559 // <<cos(n*(phi1+phi2))>> (<<cos(n*phi1)>>^2 - <<sin(n*phi1)>>^2)
8560 Double_t four5thTerm = fQCorrections[pW][eW][1]->GetBinContent(2)
8561 * (pow(fQCorrections[pW][eW][1]->GetBinContent(1),2)-pow(fQCorrections[pW][eW][0]->GetBinContent(1),2));
8562 // <<sin(n*(phi1+phi2))>> <<cos(n*phi1)>> <<sin(n*phi1)>>
8563 Double_t four6thTerm = fQCorrections[pW][eW][0]->GetBinContent(2)
8564 * fQCorrections[pW][eW][1]->GetBinContent(1)
8565 * fQCorrections[pW][eW][0]->GetBinContent(1);
8566 // <<cos(n*(phi1-phi2))>> (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2)
8567 Double_t four7thTerm = two*(pow(fQCorrections[pW][eW][1]->GetBinContent(1),2)+pow(fQCorrections[pW][eW][0]->GetBinContent(1),2));
8568 // (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2)^2
8569 Double_t four8thTerm = pow(pow(fQCorrections[pW][eW][1]->GetBinContent(1),2)+pow(fQCorrections[pW][eW][0]->GetBinContent(1),2),2);
8570 // final correction to QC{4}:
8571 Double_t correctionQC4 = -4.*four1stTerm+4.*four2ndTerm-four3rdTerm-four4thTerm
8572 + 4.*four5thTerm+8.*four6thTerm+8.*four7thTerm-6.*four8thTerm;
8573 fCorrections[pW][eW]->SetBinContent(2,correctionQC4);
8574
8575 // ... to be improved (continued for 6th and 8th order)
8576
8577
8578} // end of AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNUAForIntQcumulants()
8579*/
8580
8581//================================================================================================================================
8582
8583
8584void AliFlowAnalysisWithQCumulants::CalculateQcumulantsCorrectedForNUAIntFlow()
8585{
8586 // Calculate generalized Q-cumulants (cumulants corrected for non-unifom acceptance).
8587
8588 // measured 2-, 4-, 6- and 8-particle correlations (biased by non-uniform acceptance!):
8589 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
8590 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
8591 //Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
8592 //Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
8593
8594 // statistical error of measured 2-, 4-, 6- and 8-particle correlations:
8595 //Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <<2>>
8596 //Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <<4>>
8597 //Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <<6>>
8598 //Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <<8>>
8599
8600 // QC{2}:
8601 // <<cos(n*phi1)>>^2
8602 Double_t two1stTerm = pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1),2);
8603 //Double_t two1stTermErrorSquared = pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(1),2);
8604 // <<sin(n*phi1)>>^2
8605 Double_t two2ndTerm = pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1),2);
8606 //Double_t two2ndTermErrorSquared = pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(1),2);
8607 // generalized QC{2}:
8608 Double_t gQC2 = two - two1stTerm - two2ndTerm; // to be improved (terminology, notation)
8609 fIntFlowQcumulants->SetBinContent(1,gQC2);
8610 //fIntFlowQcumulants->SetBinError(1,0.); // to be improved (propagate error)
8611
8612 // QC{4}:
8613 // <<cos(n*phi1)>> <<cos(n*(phi1-phi2-phi3))>>
8614 Double_t four1stTerm = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1)
8615 * fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(3);
8616 // <<sin(n*phi1)>> <<sin(n*(phi1-phi2-phi3))>>
8617 Double_t four2ndTerm = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1)
8618 * fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(3);
8619 // <<cos(n*(phi1+phi2))>>^2
8620 Double_t four3rdTerm = pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2),2);
8621 // <<sin(n*(phi1+phi2))>>^2
8622 Double_t four4thTerm = pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2),2);
8623 // <<cos(n*(phi1+phi2))>> (<<cos(n*phi1)>>^2 - <<sin(n*phi1)>>^2)
8624 Double_t four5thTerm = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2)
8625 * (pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1),2)
8626 - pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1),2));
8627 // <<sin(n*(phi1+phi2))>> <<cos(n*phi1)>> <<sin(n*phi1)>>
8628 Double_t four6thTerm = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2)
8629 * fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1)
8630 * fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1);
8631 // <<cos(n*(phi1-phi2))>> (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2)
8632 Double_t four7thTerm = two*(pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1),2)
8633 + pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1),2));
8634 // (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2)^2
8635 Double_t four8thTerm = pow(pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1),2)
8636 + pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1),2),2);
8637 // generalized QC{4}:
8638 Double_t gQC4 = four-2.*pow(two,2.)-4.*four1stTerm+4.*four2ndTerm-four3rdTerm
8639 - four4thTerm+4.*four5thTerm+8.*four6thTerm+8.*four7thTerm-6.*four8thTerm;
8640 fIntFlowQcumulants->SetBinContent(2,gQC4);
8641 //fIntFlowQcumulants->SetBinError(2,0.); // to be improved (propagate error)
8642
8643 // ... to be improved (continued for 6th and 8th order)
8644
8645} // end of void AliFlowAnalysisWithQCumulants::CalculateQcumulantsCorrectedForNUAIntFlow()
8646
8647
8648//================================================================================================================================
8649
8650
8651void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectedForNUA()
8652{
8653 // Calculate integrated flow from generalized Q-cumulants (corrected for non-uniform acceptance).
8654
8655 // to be improved: add protection for NULL pointers, propagate statistical errors from
8656 // measured correlations and correction terms
8657
8658 // generalized Q-cumulants:
8659 Double_t qc2 = fIntFlowQcumulants->GetBinContent(1); // QC{2}
8660 Double_t qc4 = fIntFlowQcumulants->GetBinContent(2); // QC{4}
8661 //Double_t qc6 = fIntFlowQcumulants->GetBinContent(3); // QC{6}
8662 //Double_t qc8 = fIntFlowQcumulants->GetBinContent(4); // QC{8}
8663
8664 // integrated flow estimates:
8665 Double_t v2 = 0.; // v{2,QC}
8666 Double_t v4 = 0.; // v{4,QC}
8667 //Double_t v6 = 0.; // v{6,QC}
8668 //Double_t v8 = 0.; // v{8,QC}
8669
8670 // calculate integrated flow estimates from generalized Q-cumulants:
8671 if(qc2>=0.) v2 = pow(qc2,1./2.);
8672 if(qc4<=0.) v4 = pow(-1.*qc4,1./4.);
8673 //if(qc6>=0.) v6 = pow((1./4.)*qc6,1./6.);
8674 //if(qc8<=0.) v8 = pow((-1./33.)*qc8,1./8.);
8675
8676 // store integrated flow estimates from generalized Q-cumulants:
8677 fIntFlow->SetBinContent(1,v2);
8678 fIntFlow->SetBinContent(2,v4);
8679 //fIntFlow->SetBinContent(3,v6);
8680 //fIntFlow->SetBinContent(4,v8);
0328db2d 8681
8682 /*
8683 // propagate correctly error by including non-isotropic terms (to be improved - moved somewhere else):
8684 // correlations:
8685 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
8686 //Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
8687 //Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
8688 //Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
8689 // statistical errors of average 2-, 4-, 6- and 8-particle azimuthal correlations:
8690 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <2>
8691 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <4>
8692 //Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <6>
8693 //Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <8>
8694 // nua terms:
8695 Double_t c1 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1); // <<cos(phi1)>>
8696 Double_t c2 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
8697 Double_t c3 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
8698 Double_t s1 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1); // <<sin(phi1)>>
8699 Double_t s2 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
8700 Double_t s3 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
8701 // statistical errors of nua terms:
8702 Double_t c1Error = fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(1); // statistical error of <cos(phi1)>
8703 Double_t c2Error = fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(2); // statistical error of <cos(phi1+phi2)>
8704 Double_t c3Error = fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(3); // statistical error of <cos(phi1-phi2-phi3)>
8705 Double_t s1Error = fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(1); // statistical error of <sin(phi1)>
8706 Double_t s2Error = fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(2); // statistical error of <sin(phi1+phi2)>
8707 Double_t s3Error = fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(3); // statistical error of <sin(phi1-phi2-phi3)>
8708
8709 // covariances for nua:
8710 Double_t wCov24 = fIntFlowCovariances->GetBinContent(1); // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
8711 Double_t wCov2c1 = fIntFlowCovariancesNUA->GetBinContent(1);
8712 Double_t wCov2s1 = fIntFlowCovariancesNUA->GetBinContent(2);
8713 Double_t wCovc1s1 = fIntFlowCovariancesNUA->GetBinContent(3);
8714 Double_t wCov2c2 = fIntFlowCovariancesNUA->GetBinContent(4);
8715 Double_t wCov2s2 = fIntFlowCovariancesNUA->GetBinContent(5);
8716 Double_t wCov2c3 = fIntFlowCovariancesNUA->GetBinContent(6);
8717 Double_t wCov2s3 = fIntFlowCovariancesNUA->GetBinContent(7);
8718 Double_t wCov4c1 = fIntFlowCovariancesNUA->GetBinContent(8);
8719 Double_t wCov4s1 = fIntFlowCovariancesNUA->GetBinContent(9);
8720 Double_t wCov4c2 = fIntFlowCovariancesNUA->GetBinContent(10);
8721 Double_t wCov4s2 = fIntFlowCovariancesNUA->GetBinContent(11);
8722 Double_t wCov4c3 = fIntFlowCovariancesNUA->GetBinContent(12);
8723 Double_t wCov4s3 = fIntFlowCovariancesNUA->GetBinContent(13);
8724 Double_t wCovc1c2 = fIntFlowCovariancesNUA->GetBinContent(14);
8725 Double_t wCovc1s2 = fIntFlowCovariancesNUA->GetBinContent(15);
8726 Double_t wCovc1c3 = fIntFlowCovariancesNUA->GetBinContent(16);
8727 Double_t wCovc1s3 = fIntFlowCovariancesNUA->GetBinContent(17);
8728 Double_t wCovs1c2 = fIntFlowCovariancesNUA->GetBinContent(18);
8729 Double_t wCovs1s2 = fIntFlowCovariancesNUA->GetBinContent(19);
8730 Double_t wCovs1c3 = fIntFlowCovariancesNUA->GetBinContent(20);
8731 Double_t wCovs1s3 = fIntFlowCovariancesNUA->GetBinContent(21);
8732 Double_t wCovc2s2 = fIntFlowCovariancesNUA->GetBinContent(22);
8733 Double_t wCovc2c3 = fIntFlowCovariancesNUA->GetBinContent(23);
8734 Double_t wCovc2s3 = fIntFlowCovariancesNUA->GetBinContent(24);
8735 Double_t wCovs2c3 = fIntFlowCovariancesNUA->GetBinContent(25);
8736 Double_t wCovs2s3 = fIntFlowCovariancesNUA->GetBinContent(26);
8737 Double_t wCovc3s3 = fIntFlowCovariancesNUA->GetBinContent(27);
8738 */
8739
8740 /*
8741 // 2nd order:
8742 Double_t err2ndSquared = (1./(4.*pow(v2,2.)))
8743 * (pow(twoError,2.)+4.*pow(s1*s1Error,2.)+4.*pow(c1*c1Error,2.)
8744 // to be improved (add eventually also covariance terms)
8745 //- 4.*c1*wCov2c1-4.*s1*wCov2s1+8.*c1*s1*wCovc1s1
8746 );
8747 if(err2ndSquared>=0.)
8748 {
8749 fIntFlow->SetBinError(1,pow(err2ndSquared,0.5)); // to be improved (enabled eventually)
8750 } else
8751 {
8752 cout<<"WARNING: Statistical error of v{2,QC} (with non-isotropic terms included) is imaginary !!!! "<<endl;
8753 }
8754 // 4th order:
8755 Double_t err4thSquared = (1./(16.*pow(v4,6.)))
8756 * (pow(4.*pow(two,2.)-8.*(pow(c1,2.)+pow(s1,2.)),2.)*pow(twoError,2.)
8757 + pow(fourError,2.)
8758 + 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.)
8759 + 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.)
8760 + 4.*pow(c2-2.*(pow(c1,2.)-pow(s1,2.)),2.)*pow(c2Error,2.)
8761 + 4.*pow(4*c1*s1-s2,2.)*pow(s2Error,2.)
8762 + 16.*pow(c1,2.)*pow(c3Error,2.)
8763 + 16.*pow(s1,2.)*pow(s3Error,2.)
8764 // to be improved (add eventually also covariance terms)
8765 // ...
8766 );
8767 if(err4thSquared>=0.)
8768 {
8769 fIntFlow->SetBinError(2,pow(err4thSquared,0.5)); // to be improved (enabled eventually)
8770 } else
8771 {
8772 cout<<"WARNING: Statistical error of v{4,QC} (with non-isotropic terms included) is imaginary !!!! "<<endl;
8773 }
8774 */
8775
489d5531 8776} // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectedForNUA()
8777
8778
8779//================================================================================================================================
8780
8781
8782void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUAIntFlow()
8783{
0328db2d 8784 // From profile fIntFlowCorrectionTermsForNUAPro[sc] access measured correction terms for NUA
489d5531 8785 // and their spread, correctly calculate the statistical errors and store the final
0328db2d 8786 // results and statistical errors for correction terms for NUA in histogram fIntFlowCorrectionTermsForNUAHist[sc].
489d5531 8787 //
8788 // Remark: Statistical error of correction temrs is calculated as:
8789 //
8790 // statistical error = termA * spread * termB:
8791 // termA = sqrt{sum_{i=1}^{N} w^2}/(sum_{i=1}^{N} w)
8792 // termB = 1/sqrt(1-termA^2)
8793
489d5531 8794 for(Int_t sc=0;sc<2;sc++) // sin or cos correction terms
8795 {
0328db2d 8796 for(Int_t ci=1;ci<=3;ci++) // correction term index
489d5531 8797 {
8798 Double_t correction = fIntFlowCorrectionTermsForNUAPro[sc]->GetBinContent(ci);
0328db2d 8799 Double_t spread = fIntFlowCorrectionTermsForNUAPro[sc]->GetBinError(ci);
8800 Double_t sumOfLinearEventWeights = fIntFlowSumOfEventWeightsNUA[sc][0]->GetBinContent(ci);
8801 Double_t sumOfQuadraticEventWeights = fIntFlowSumOfEventWeightsNUA[sc][1]->GetBinContent(ci);
8802 Double_t termA = 0.;
8803 Double_t termB = 0.;
8804 if(sumOfLinearEventWeights)
8805 {
8806 termA = pow(sumOfQuadraticEventWeights,0.5)/sumOfLinearEventWeights;
8807 } else
8808 {
8809 cout<<"WARNING: sumOfLinearEventWeights == 0 in AFAWQC::FCTFNIF() !!!!"<<endl;
8810 cout<<" (for "<<ci<<"-th correction term)"<<endl;
8811 }
489d5531 8812 if(1.-pow(termA,2.) > 0.)
8813 {
8814 termB = 1./pow(1-pow(termA,2.),0.5);
8815 } else
8816 {
0328db2d 8817 cout<<"WARNING: 1.-pow(termA,2.) <= 0 in AFAWQC::FCTFNIF() !!!!"<<endl;
8818 cout<<" (for "<<ci<<"-th correction term)"<<endl;
489d5531 8819 }
8820 Double_t statisticalError = termA * spread * termB;
489d5531 8821 fIntFlowCorrectionTermsForNUAHist[sc]->SetBinContent(ci,correction);
0328db2d 8822 fIntFlowCorrectionTermsForNUAHist[sc]->SetBinError(ci,statisticalError);
489d5531 8823 } // end of for(Int_t ci=1;ci<=10;ci++) // correction term index
8824 } // end of for(Int sc=0;sc<2;sc++) // sin or cos correction terms
8825
8826} // end of void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUAIntFlow()
8827
8828
8829//================================================================================================================================
8830
8831
8832void AliFlowAnalysisWithQCumulants::GetPointersForNestedLoopsHistograms()
8833{
8834 // Get pointers to all objects relevant for calculations with nested loops.
8835
8836 TList *nestedLoopsList = dynamic_cast<TList*>(fHistList->FindObject("Nested Loops"));
8837 if(nestedLoopsList)
8838 {
8839 this->SetNestedLoopsList(nestedLoopsList);
8840 } else
8841 {
8842 cout<<"WARNING: nestedLoopsList is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
8843 exit(0);
8844 }
8845
8846 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)
8847 TString typeFlag[2] = {"RP","POI"}; // to be improved (should I promote this to data members?)
8848 TString ptEtaFlag[2] = {"p_{T}","#eta"}; // to be improved (should I promote this to data members?)
8849 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"}; // to be improved (should I promote this to data members?)
8850
8851 TString evaluateNestedLoopsName = "fEvaluateNestedLoops";
8852 evaluateNestedLoopsName += fAnalysisLabel->Data();
8853 TProfile *evaluateNestedLoops = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(evaluateNestedLoopsName.Data()));
8854 Bool_t bEvaluateIntFlowNestedLoops = kFALSE;
8855 Bool_t bEvaluateDiffFlowNestedLoops = kFALSE;
8856 if(evaluateNestedLoops)
8857 {
8858 this->SetEvaluateNestedLoops(evaluateNestedLoops);
8859 bEvaluateIntFlowNestedLoops = (Int_t)evaluateNestedLoops->GetBinContent(1);
8860 bEvaluateDiffFlowNestedLoops = (Int_t)evaluateNestedLoops->GetBinContent(2);
8861 }
8862 // nested loops relevant for integrated flow:
8863 if(bEvaluateIntFlowNestedLoops)
8864 {
8865 // correlations:
8866 TString intFlowDirectCorrelationsName = "fIntFlowDirectCorrelations";
8867 intFlowDirectCorrelationsName += fAnalysisLabel->Data();
8868 TProfile *intFlowDirectCorrelations = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(intFlowDirectCorrelationsName.Data()));
8869 if(intFlowDirectCorrelations)
8870 {
8871 this->SetIntFlowDirectCorrelations(intFlowDirectCorrelations);
8872 } else
8873 {
8874 cout<<"WARNING: intFlowDirectCorrelations is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
8875 exit(0);
8876 }
8877 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
8878 {
8879 TString intFlowExtraDirectCorrelationsName = "fIntFlowExtraDirectCorrelations";
8880 intFlowExtraDirectCorrelationsName += fAnalysisLabel->Data();
8881 TProfile *intFlowExtraDirectCorrelations = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(intFlowExtraDirectCorrelationsName.Data()));
8882 if(intFlowExtraDirectCorrelations)
8883 {
8884 this->SetIntFlowExtraDirectCorrelations(intFlowExtraDirectCorrelations);
8885 } else
8886 {
8887 cout<<"WARNING: intFlowExtraDirectCorrelations is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
8888 exit(0);
8889 }
8890 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
8891 // correction terms for non-uniform acceptance:
8892 TString intFlowDirectCorrectionTermsForNUAName = "fIntFlowDirectCorrectionTermsForNUA";
8893 intFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
8894 TProfile *intFlowDirectCorrectionTermsForNUA[2] = {NULL};
8895 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
8896 {
8897 intFlowDirectCorrectionTermsForNUA[sc] = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(Form("%s: %s terms",intFlowDirectCorrectionTermsForNUAName.Data(),sinCosFlag[sc].Data())));
8898 if(intFlowDirectCorrectionTermsForNUA[sc])
8899 {
8900 this->SetIntFlowDirectCorrectionTermsForNUA(intFlowDirectCorrectionTermsForNUA[sc],sc);
8901 } else
8902 {
8903 cout<<"WARNING: intFlowDirectCorrectionTermsForNUA[sc] is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
8904 cout<<"sc = "<<sc<<endl;
8905 exit(0);
8906 }
8907 } // end of for(Int_t sc=0;sc<2;sc++)
8908 } // end of if(bEvaluateIntFlowNestedLoops)
8909
8910 // nested loops relevant for differential flow:
8911 if(bEvaluateDiffFlowNestedLoops)
8912 {
8913 // correlations:
8914 TString diffFlowDirectCorrelationsName = "fDiffFlowDirectCorrelations";
8915 diffFlowDirectCorrelationsName += fAnalysisLabel->Data();
8916 TProfile *diffFlowDirectCorrelations[2][2][4] = {{{NULL}}};
8917 for(Int_t t=0;t<2;t++)
8918 {
8919 for(Int_t pe=0;pe<2;pe++)
8920 {
8921 for(Int_t ci=0;ci<4;ci++) // correlation index
8922 {
8923 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())));
8924 if(diffFlowDirectCorrelations[t][pe][ci])
8925 {
8926 this->SetDiffFlowDirectCorrelations(diffFlowDirectCorrelations[t][pe][ci],t,pe,ci);
8927 } else
8928 {
8929 cout<<"WARNING: diffFlowDirectCorrelations[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8930 cout<<"t = "<<t<<endl;
8931 cout<<"pe = "<<pe<<endl;
8932 cout<<"ci = "<<ci<<endl;
8933 }
8934 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
8935 } // end of for(Int_t pe=0;pe<2;pe++)
8936 } // end of for(Int_t t=0;t<2;t++)
8937 // correction terms for non-uniform acceptance:
8938 TString diffFlowDirectCorrectionTermsForNUAName = "fDiffFlowDirectCorrectionTermsForNUA";
8939 diffFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
8940 TProfile *diffFlowDirectCorrectionTermsForNUA[2][2][2][10] = {{{{NULL}}}};
8941 for(Int_t t=0;t<2;t++)
8942 {
8943 for(Int_t pe=0;pe<2;pe++)
8944 {
8945 // correction terms for NUA:
8946 for(Int_t sc=0;sc<2;sc++) // sin or cos
8947 {
8948 for(Int_t cti=0;cti<9;cti++) // correction term index
8949 {
8950 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)));
8951 if(diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti])
8952 {
8953 this->SetDiffFlowDirectCorrectionTermsForNUA(diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti],t,pe,sc,cti);
8954 } else
8955 {
8956 cout<<"WARNING: diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8957 cout<<"t = "<<t<<endl;
8958 cout<<"pe = "<<pe<<endl;
8959 cout<<"sc = "<<sc<<endl;
8960 cout<<"cti = "<<cti<<endl;
8961 }
8962 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index
8963 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
8964 } // end of for(Int_t pe=0;pe<2;pe++)
8965 } // end of for(Int_t t=0;t<2;t++)
8966 // number of RPs and POIs in selected pt and eta bins for cross-checkings:
8967 TString noOfParticlesInBinName = "fNoOfParticlesInBin";
8968 TH1D *noOfParticlesInBin = NULL;
8969 noOfParticlesInBin = dynamic_cast<TH1D*>(nestedLoopsList->FindObject(noOfParticlesInBinName.Data()));
8970 if(noOfParticlesInBin)
8971 {
8972 this->SetNoOfParticlesInBin(noOfParticlesInBin);
8973 } else
8974 {
8975 cout<<endl;
8976 cout<<" WARNING (QC): noOfParticlesInBin is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8977 cout<<endl;
8978 }
8979 } // end of if(bEvaluateDiffFlowNestedLoops)
8980
8981} // end of void AliFlowAnalysisWithQCumulants::GetPointersForNestedLoopsHistograms()
8982
8983
8984//================================================================================================================================
8985
8986
8987void AliFlowAnalysisWithQCumulants::StoreHarmonic()
8988{
8989 // Store flow harmonic in common control histograms.
8990
8991 (fCommonHists->GetHarmonic())->Fill(0.5,fHarmonic);
8992 (fCommonHists2nd->GetHarmonic())->Fill(0.5,fHarmonic);
8993 (fCommonHists4th->GetHarmonic())->Fill(0.5,fHarmonic);
8994 (fCommonHists6th->GetHarmonic())->Fill(0.5,fHarmonic);
8995 (fCommonHists8th->GetHarmonic())->Fill(0.5,fHarmonic);
8996
8997} // end of void AliFlowAnalysisWithQCumulants::StoreHarmonic()
8998
8999
9000//================================================================================================================================
9001
9002
9003void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelationsUsingParticleWeights(TString type, TString ptOrEta) // type = RP or POI
9004{
9005 // Calculate all correlations needed for differential flow using particle weights.
9006
9007 Int_t t = -1; // type flag
9008 Int_t pe = -1; // ptEta flag
9009
9010 if(type == "RP")
9011 {
9012 t = 0;
9013 } else if(type == "POI")
9014 {
9015 t = 1;
9016 }
9017
9018 if(ptOrEta == "Pt")
9019 {
9020 pe = 0;
9021 } else if(ptOrEta == "Eta")
9022 {
9023 pe = 1;
9024 }
9025
9026 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
9027 Double_t minPtEta[2] = {fPtMin,fEtaMin};
9028 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
9029 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
9030
9031 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
9032 Double_t dReQ1n1k = (*fReQ)(0,1);
9033 Double_t dReQ2n2k = (*fReQ)(1,2);
9034 Double_t dReQ1n3k = (*fReQ)(0,3);
9035 //Double_t dReQ4n4k = (*fReQ)(3,4);
9036 Double_t dImQ1n1k = (*fImQ)(0,1);
9037 Double_t dImQ2n2k = (*fImQ)(1,2);
9038 Double_t dImQ1n3k = (*fImQ)(0,3);
9039 //Double_t dImQ4n4k = (*fImQ)(3,4);
9040
9041 // S^M_{p,k} (see .h file for the definition of fSMpk):
9042 Double_t dSM1p1k = (*fSMpk)(0,1);
9043 Double_t dSM1p2k = (*fSMpk)(0,2);
9044 Double_t dSM1p3k = (*fSMpk)(0,3);
9045 Double_t dSM2p1k = (*fSMpk)(1,1);
9046 Double_t dSM3p1k = (*fSMpk)(2,1);
9047
9048 // looping over all bins and calculating reduced correlations:
9049 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9050 {
9051 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin):
9052 Double_t p1n0kRe = 0.;
9053 Double_t p1n0kIm = 0.;
9054
9055 // number of POIs in particular (pt,eta) bin):
9056 Double_t mp = 0.;
9057
9058 // real and imaginary parts of q_{m*n,k}:
9059 // (weighted Q-vector evaluated for particles which are both RPs and POIs in particular (pt,eta) bin)
9060 Double_t q1n2kRe = 0.;
9061 Double_t q1n2kIm = 0.;
9062 Double_t q2n1kRe = 0.;
9063 Double_t q2n1kIm = 0.;
9064
9065 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
9066 Double_t s1p1k = 0.;
9067 Double_t s1p2k = 0.;
9068 Double_t s1p3k = 0.;
9069
9070 // M0111 from Eq. (118) in QC2c (to be improved (notation))
9071 Double_t dM0111 = 0.;
9072
9073 if(type == "POI")
9074 {
9075 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
9076 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
9077 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
9078 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
9079
9080 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9081
9082 t = 1; // typeFlag = RP or POI
9083
9084 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
9085 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))
9086 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));
9087 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))
9088 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b));
9089 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))
9090 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));
9091 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))
9092 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b));
9093
9094 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
9095 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.);
9096 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.);
9097 s1p3k = pow(fs1dEBE[2][pe][3]->GetBinContent(b)*fs1dEBE[2][pe][3]->GetBinEntries(b),1.);
9098
9099 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
9100 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
9101 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
9102 + 2.*(s1p3k-s1p2k*dSM1p1k));
9103 }
9104 else if(type == "RP")
9105 {
9106 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
9107 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))
9108 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));
9109 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))
9110 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));
9111 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))
9112 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));
9113 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))
9114 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));
9115
9116 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
9117 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.);
9118 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.);
9119 s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.);
9120
9121 // to be improved (cross-checked):
9122 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
9123 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
9124 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
9125 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
9126
9127 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9128
9129 t = 0; // typeFlag = RP or POI
9130
9131 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
9132 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
9133 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
9134 + 2.*(s1p3k-s1p2k*dSM1p1k));
9135 //...............................................................................................
9136 }
9137
9138 // 2'-particle correlation:
9139 Double_t two1n1nW0W1 = 0.;
9140 if(mp*dSM1p1k-s1p1k)
9141 {
9142 two1n1nW0W1 = (p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k-s1p1k)
9143 / (mp*dSM1p1k-s1p1k);
9144
9145 // fill profile to get <<2'>>
9146 fDiffFlowCorrelationsPro[t][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nW0W1,mp*dSM1p1k-s1p1k);
9147 // histogram to store <2'> e-b-e (needed in some other methods):
9148 fDiffFlowCorrelationsEBE[t][pe][0]->SetBinContent(b,two1n1nW0W1);
9149 fDiffFlowEventWeightsForCorrelationsEBE[t][pe][0]->SetBinContent(b,mp*dSM1p1k-s1p1k);
9150 } // end of if(mp*dSM1p1k-s1p1k)
9151
9152 // 4'-particle correlation:
9153 Double_t four1n1n1n1nW0W1W1W1 = 0.;
9154 if(dM0111)
9155 {
9156 four1n1n1n1nW0W1W1W1 = ((pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
9157 - q2n1kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))
9158 - 2.*q2n1kIm*dReQ1n1k*dImQ1n1k
9159 - p1n0kRe*(dReQ1n1k*dReQ2n2k+dImQ1n1k*dImQ2n2k)
9160 + p1n0kIm*(dImQ1n1k*dReQ2n2k-dReQ1n1k*dImQ2n2k)
9161 - 2.*dSM1p2k*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
9162 - 2.*(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*s1p1k
9163 + 6.*(q1n2kRe*dReQ1n1k+q1n2kIm*dImQ1n1k)
9164 + 1.*(q2n1kRe*dReQ2n2k+q2n1kIm*dImQ2n2k)
9165 + 2.*(p1n0kRe*dReQ1n3k+p1n0kIm*dImQ1n3k)
9166 + 2.*s1p1k*dSM1p2k
9167 - 6.*s1p3k)
9168 / dM0111; // to be improved (notation of dM0111)
9169
9170 // fill profile to get <<4'>>
9171 fDiffFlowCorrelationsPro[t][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nW0W1W1W1,dM0111);
9172 // histogram to store <4'> e-b-e (needed in some other methods):
9173 fDiffFlowCorrelationsEBE[t][pe][1]->SetBinContent(b,four1n1n1n1nW0W1W1W1);
9174 fDiffFlowEventWeightsForCorrelationsEBE[t][pe][1]->SetBinContent(b,dM0111);
9175 } // end of if(dM0111)
9176 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9177
9178} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelationsUsingParticleWeights(TString type, TString ptOrEta); // type = RP or POI
9179
9180
9181//================================================================================================================================
9182
9183
9184void AliFlowAnalysisWithQCumulants::FillCommonControlHistograms(AliFlowEventSimple *anEvent)
9185{
9186 // Fill common control histograms.
9187
9188 Int_t nRP = anEvent->GetEventNSelTracksRP(); // number of RPs (i.e. number of particles used to determine the reaction plane)
9189 fCommonHists->FillControlHistograms(anEvent);
9190 if(nRP>1)
9191 {
9192 fCommonHists2nd->FillControlHistograms(anEvent);
9193 if(nRP>3)
9194 {
9195 fCommonHists4th->FillControlHistograms(anEvent);
9196 if(nRP>5)
9197 {
9198 fCommonHists6th->FillControlHistograms(anEvent);
9199 if(nRP>7)
9200 {
9201 fCommonHists8th->FillControlHistograms(anEvent);
9202 } // end of if(nRP>7)
9203 } // end of if(nRP>5)
9204 } // end of if(nRP>3)
9205 } // end of if(nRP>1)
9206
9207} // end of void AliFlowAnalysisWithQCumulants::FillCommonControlHistograms(AliFlowEventSimple *anEvent)
9208
9209
9210//================================================================================================================================
9211
9212
9213void AliFlowAnalysisWithQCumulants::ResetEventByEventQuantities()
9214{
9215 // Reset all event by event quantities.
9216
9217 // integrated flow:
9218 fReQ->Zero();
9219 fImQ->Zero();
9220 fSMpk->Zero();
9221 fIntFlowCorrelationsEBE->Reset();
9222 fIntFlowEventWeightsForCorrelationsEBE->Reset();
9223 fIntFlowCorrelationsAllEBE->Reset();
9224
9225 if(fApplyCorrectionForNUA)
9226 {
9227 for(Int_t sc=0;sc<2;sc++)
9228 {
9229 fIntFlowCorrectionTermsForNUAEBE[sc]->Reset();
0328db2d 9230 fIntFlowEventWeightForCorrectionTermsForNUAEBE[sc]->Reset();
489d5531 9231 }
9232 }
9233
9234 // differential flow:
9235 // 1D:
9236 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
9237 {
9238 for(Int_t pe=0;pe<2;pe++) // 1D in pt or eta
9239 {
9240 for(Int_t m=0;m<4;m++) // multiple of harmonic
9241 {
9242 for(Int_t k=0;k<9;k++) // power of weight
9243 {
9244 if(fReRPQ1dEBE[t][pe][m][k]) fReRPQ1dEBE[t][pe][m][k]->Reset();
9245 if(fImRPQ1dEBE[t][pe][m][k]) fImRPQ1dEBE[t][pe][m][k]->Reset();
9246 }
9247 }
9248 }
9249 }
9250
9251 for(Int_t t=0;t<3;t++) // type (0 = RP, 1 = POI, 2 = RP&&POI )
9252 {
9253 for(Int_t pe=0;pe<2;pe++) // 1D in pt or eta
9254 {
9255 for(Int_t k=0;k<9;k++)
9256 {
9257 if(fs1dEBE[t][pe][k]) fs1dEBE[t][pe][k]->Reset();
9258 }
9259 }
9260 }
9261
9262 // e-b-e reduced correlations:
9263 for(Int_t t=0;t<2;t++) // type (0 = RP, 1 = POI)
9264 {
9265 for(Int_t pe=0;pe<2;pe++) // pt or eta
9266 {
9267 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
9268 {
9269 if(fDiffFlowCorrelationsEBE[t][pe][rci]) fDiffFlowCorrelationsEBE[t][pe][rci]->Reset();
9270 if(fDiffFlowEventWeightsForCorrelationsEBE[t][pe][rci]) fDiffFlowEventWeightsForCorrelationsEBE[t][pe][rci]->Reset();
9271 }
9272 }
9273 }
9274
9275 // correction terms for NUA:
9276 for(Int_t t=0;t<2;t++) // type (0 = RP, 1 = POI)
9277 {
9278 for(Int_t pe=0;pe<2;pe++) // pt or eta
9279 {
9280 for(Int_t sc=0;sc<2;sc++) // sin or cos
9281 {
9282 for(Int_t cti=0;cti<9;cti++) // correction term index
9283 {
9284 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti]->Reset();
9285 }
9286 }
9287 }
9288 }
9289
9290 // 2D (pt,eta)
9291 if(fCalculate2DFlow)
9292 {
9293 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
9294 {
9295 for(Int_t m=0;m<4;m++) // multiple of harmonic
9296 {
9297 for(Int_t k=0;k<9;k++) // power of weight
9298 {
9299 if(fReRPQ2dEBE[t][m][k]) fReRPQ2dEBE[t][m][k]->Reset();
9300 if(fImRPQ2dEBE[t][m][k]) fImRPQ2dEBE[t][m][k]->Reset();
9301 }
9302 }
9303 }
9304 for(Int_t t=0;t<3;t++) // type (0 = RP, 1 = POI, 2 = RP&&POI )
9305 {
9306 for(Int_t k=0;k<9;k++)
9307 {
9308 if(fs2dEBE[t][k]) fs2dEBE[t][k]->Reset();
9309 }
9310 }
9311 } // end of if(fCalculate2DFlow)
9312
9313} // end of void AliFlowAnalysisWithQCumulants::ResetEventByEventQuantities();
9314
9315
9316//================================================================================================================================
9317
9318
9319void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTerms(TString type, TString ptOrEta)
9320{
9321 // Calculate correction terms for non-uniform acceptance for differential flow (sin terms).
9322
9323 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][0][cti], where cti runs as follows:
9324 // 0: <<sin n(psi1)>>
9325 // 1: <<sin n(psi1+phi2)>>
9326 // 2: <<sin n(psi1+phi2-phi3)>>
9327 // 3: <<sin n(psi1-phi2-phi3)>>:
9328 // 4:
9329 // 5:
9330 // 6:
9331
9332 // multiplicity:
9333 Double_t dMult = (*fSMpk)(0,0);
9334
9335 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
9336 Double_t dReQ1n = (*fReQ)(0,0);
9337 Double_t dReQ2n = (*fReQ)(1,0);
9338 //Double_t dReQ3n = (*fReQ)(2,0);
9339 //Double_t dReQ4n = (*fReQ)(3,0);
9340 Double_t dImQ1n = (*fImQ)(0,0);
9341 Double_t dImQ2n = (*fImQ)(1,0);
9342 //Double_t dImQ3n = (*fImQ)(2,0);
9343 //Double_t dImQ4n = (*fImQ)(3,0);
9344
9345 Int_t t = -1; // type flag
9346 Int_t pe = -1; // ptEta flag
9347
9348 if(type == "RP")
9349 {
9350 t = 0;
9351 } else if(type == "POI")
9352 {
9353 t = 1;
9354 }
9355
9356 if(ptOrEta == "Pt")
9357 {
9358 pe = 0;
9359 } else if(ptOrEta == "Eta")
9360 {
9361 pe = 1;
9362 }
9363
9364 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
9365 Double_t minPtEta[2] = {fPtMin,fEtaMin};
9366 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
9367 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
9368
9369 // looping over all bins and calculating correction terms:
9370 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9371 {
9372 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
9373 Double_t p1n0kRe = 0.;
9374 Double_t p1n0kIm = 0.;
9375
9376 // number of POIs in particular pt or eta bin:
9377 Double_t mp = 0.;
9378
9379 // 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):
9380 Double_t q1n0kRe = 0.;
9381 Double_t q1n0kIm = 0.;
9382 Double_t q2n0kRe = 0.;
9383 Double_t q2n0kIm = 0.;
9384
9385 // number of particles which are both RPs and POIs in particular pt or eta bin:
9386 Double_t mq = 0.;
9387
9388 if(type == "POI")
9389 {
9390 // q_{m*n,0}:
9391 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))
9392 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));
9393 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))
9394 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));
9395 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))
9396 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));
9397 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))
9398 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b));
9399
9400 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9401 }
9402 else if(type == "RP")
9403 {
9404 // q_{m*n,0}:
9405 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
9406 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
9407 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
9408 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
9409 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))
9410 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));
9411 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))
9412 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b));
9413
9414 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9415 }
9416 if(type == "POI")
9417 {
9418 // p_{m*n,0}:
9419 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
9420 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
9421 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
9422 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
9423
9424 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9425
9426 t = 1; // typeFlag = RP or POI
9427 }
9428 else if(type == "RP")
9429 {
9430 // p_{m*n,0} = q_{m*n,0}:
9431 p1n0kRe = q1n0kRe;
9432 p1n0kIm = q1n0kIm;
9433
9434 mp = mq;
9435
9436 t = 0; // typeFlag = RP or POI
9437 }
9438
9439 // <<sin n(psi1)>>:
9440 Double_t sinP1nPsi = 0.;
9441 if(mp)
9442 {
9443 sinP1nPsi = p1n0kIm/mp;
9444 // fill profile for <<sin n(psi1)>>:
9445 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi,mp);
9446 // histogram to store <sin n(psi1)> e-b-e (needed in some other methods):
9447 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][0]->SetBinContent(b,sinP1nPsi);
9448 } // end of if(mp)
9449
9450 // <<sin n(psi1+phi2)>>:
9451 Double_t sinP1nPsiP1nPhi = 0.;
9452 if(mp*dMult-mq)
9453 {
9454 sinP1nPsiP1nPhi = (p1n0kRe*dImQ1n+p1n0kIm*dReQ1n-q2n0kIm)/(mp*dMult-mq);
9455 // fill profile for <<sin n(psi1+phi2)>>:
9456 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsiP1nPhi,mp*dMult-mq);
9457 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
9458 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][1]->SetBinContent(b,sinP1nPsiP1nPhi);
9459 } // end of if(mp*dMult-mq)
9460
9461 // <<sin n(psi1+phi2-phi3)>>:
9462 Double_t sinP1nPsi1P1nPhi2MPhi3 = 0.;
9463 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9464 {
9465 sinP1nPsi1P1nPhi2MPhi3 = (p1n0kIm*(pow(dImQ1n,2.)+pow(dReQ1n,2.)-dMult)
9466 - 1.*(q2n0kIm*dReQ1n-q2n0kRe*dImQ1n)
9467 - mq*dImQ1n+2.*q1n0kIm)
9468 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9469 // fill profile for <<sin n(psi1+phi2)>>:
9470 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1P1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9471 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
9472 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][2]->SetBinContent(b,sinP1nPsi1P1nPhi2MPhi3);
9473 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9474
9475 // <<sin n(psi1-phi2-phi3)>>:
9476 Double_t sinP1nPsi1M1nPhi2MPhi3 = 0.;
9477 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9478 {
9479 sinP1nPsi1M1nPhi2MPhi3 = (p1n0kIm*(pow(dReQ1n,2.)-pow(dImQ1n,2.))-2.*p1n0kRe*dReQ1n*dImQ1n
9480 - 1.*(p1n0kIm*dReQ2n-p1n0kRe*dImQ2n)
9481 + 2.*mq*dImQ1n-2.*q1n0kIm)
9482 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9483 // fill profile for <<sin n(psi1+phi2)>>:
9484 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1M1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9485 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
9486 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][3]->SetBinContent(b,sinP1nPsi1M1nPhi2MPhi3);
9487 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9488 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9489
9490} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTerms(TString type, TString ptOrEta)
9491
9492
9493//================================================================================================================================
9494
9495
9496void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTerms(TString type, TString ptOrEta)
9497{
9498 // Calculate correction terms for non-uniform acceptance for differential flow (cos terms).
9499
9500 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][1][cti], where cti runs as follows:
9501 // 0: <<cos n(psi)>>
9502 // 1: <<cos n(psi1+phi2)>>
9503 // 2: <<cos n(psi1+phi2-phi3)>>
9504 // 3: <<cos n(psi1-phi2-phi3)>>
9505 // 4:
9506 // 5:
9507 // 6:
9508
9509 // multiplicity:
9510 Double_t dMult = (*fSMpk)(0,0);
9511
9512 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
9513 Double_t dReQ1n = (*fReQ)(0,0);
9514 Double_t dReQ2n = (*fReQ)(1,0);
9515 //Double_t dReQ3n = (*fReQ)(2,0);
9516 //Double_t dReQ4n = (*fReQ)(3,0);
9517 Double_t dImQ1n = (*fImQ)(0,0);
9518 Double_t dImQ2n = (*fImQ)(1,0);
9519 //Double_t dImQ3n = (*fImQ)(2,0);
9520 //Double_t dImQ4n = (*fImQ)(3,0);
9521
9522 Int_t t = -1; // type flag
9523 Int_t pe = -1; // ptEta flag
9524
9525 if(type == "RP")
9526 {
9527 t = 0;
9528 } else if(type == "POI")
9529 {
9530 t = 1;
9531 }
9532
9533 if(ptOrEta == "Pt")
9534 {
9535 pe = 0;
9536 } else if(ptOrEta == "Eta")
9537 {
9538 pe = 1;
9539 }
9540
9541 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
9542 Double_t minPtEta[2] = {fPtMin,fEtaMin};
9543 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
9544 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
9545
9546 // looping over all bins and calculating correction terms:
9547 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9548 {
9549 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
9550 Double_t p1n0kRe = 0.;
9551 Double_t p1n0kIm = 0.;
9552
9553 // number of POIs in particular pt or eta bin:
9554 Double_t mp = 0.;
9555
9556 // 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):
9557 Double_t q1n0kRe = 0.;
9558 Double_t q1n0kIm = 0.;
9559 Double_t q2n0kRe = 0.;
9560 Double_t q2n0kIm = 0.;
9561
9562 // number of particles which are both RPs and POIs in particular pt or eta bin:
9563 Double_t mq = 0.;
9564
9565 if(type == "POI")
9566 {
9567 // q_{m*n,0}:
9568 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))
9569 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));
9570 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))
9571 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));
9572 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))
9573 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));
9574 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))
9575 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b));
9576
9577 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9578 }
9579 else if(type == "RP")
9580 {
9581 // q_{m*n,0}:
9582 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
9583 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
9584 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
9585 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
9586 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))
9587 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));
9588 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))
9589 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b));
9590
9591 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9592 }
9593 if(type == "POI")
9594 {
9595 // p_{m*n,0}:
9596 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
9597 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
9598 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
9599 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
9600
9601 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9602
9603 t = 1; // typeFlag = RP or POI
9604 }
9605 else if(type == "RP")
9606 {
9607 // p_{m*n,0} = q_{m*n,0}:
9608 p1n0kRe = q1n0kRe;
9609 p1n0kIm = q1n0kIm;
9610
9611 mp = mq;
9612
9613 t = 0; // typeFlag = RP or POI
9614 }
9615
9616 // <<cos n(psi1)>>:
9617 Double_t cosP1nPsi = 0.;
9618 if(mp)
9619 {
9620 cosP1nPsi = p1n0kRe/mp;
9621
9622 // fill profile for <<cos n(psi1)>>:
9623 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi,mp);
9624 // histogram to store <cos n(psi1)> e-b-e (needed in some other methods):
9625 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][0]->SetBinContent(b,cosP1nPsi);
9626 } // end of if(mp)
9627
9628 // <<cos n(psi1+phi2)>>:
9629 Double_t cosP1nPsiP1nPhi = 0.;
9630 if(mp*dMult-mq)
9631 {
9632 cosP1nPsiP1nPhi = (p1n0kRe*dReQ1n-p1n0kIm*dImQ1n-q2n0kRe)/(mp*dMult-mq);
9633 // fill profile for <<sin n(psi1+phi2)>>:
9634 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsiP1nPhi,mp*dMult-mq);
9635 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
9636 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][1]->SetBinContent(b,cosP1nPsiP1nPhi);
9637 } // end of if(mp*dMult-mq)
9638
9639 // <<cos n(psi1+phi2-phi3)>>:
9640 Double_t cosP1nPsi1P1nPhi2MPhi3 = 0.;
9641 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9642 {
9643 cosP1nPsi1P1nPhi2MPhi3 = (p1n0kRe*(pow(dImQ1n,2.)+pow(dReQ1n,2.)-dMult)
9644 - 1.*(q2n0kRe*dReQ1n+q2n0kIm*dImQ1n)
9645 - mq*dReQ1n+2.*q1n0kRe)
9646 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9647 // fill profile for <<sin n(psi1+phi2)>>:
9648 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1P1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9649 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
9650 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][2]->SetBinContent(b,cosP1nPsi1P1nPhi2MPhi3);
9651 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9652
9653 // <<cos n(psi1-phi2-phi3)>>:
9654 Double_t cosP1nPsi1M1nPhi2MPhi3 = 0.;
9655 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9656 {
9657 cosP1nPsi1M1nPhi2MPhi3 = (p1n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))+2.*p1n0kIm*dReQ1n*dImQ1n
9658 - 1.*(p1n0kRe*dReQ2n+p1n0kIm*dImQ2n)
9659 - 2.*mq*dReQ1n+2.*q1n0kRe)
9660 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9661 // fill profile for <<sin n(psi1+phi2)>>:
9662 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1M1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9663 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
9664 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][3]->SetBinContent(b,cosP1nPsi1M1nPhi2MPhi3);
9665 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9666 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9667
9668} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTerms(TString type, TString ptOrEta)
9669
9670
9671//==================================================================================================================================
9672
9673
9674void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUADiffFlow(TString type, TString ptOrEta)
9675{
9676 // Transfer prolfiles into histogams and correctly propagate the error (to be improved: description)
9677
9678 // to be improved: debugged - I do not correctly transfer all profiles into histos (bug appears only after merging)
9679
9680 Int_t t = -1; // type flag
9681 Int_t pe = -1; // ptEta flag
9682
9683 if(type == "RP")
9684 {
9685 t = 0;
9686 } else if(type == "POI")
9687 {
9688 t = 1;
9689 }
9690
9691 if(ptOrEta == "Pt")
9692 {
9693 pe = 0;
9694 } else if(ptOrEta == "Eta")
9695 {
9696 pe = 1;
9697 }
9698
9699 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
9700 //Double_t minPtEta[2] = {fPtMin,fEtaMin};
9701 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
9702 //Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
9703
9704 for(Int_t sc=0;sc<2;sc++) // sin or cos
9705 {
9706 for(Int_t cti=0;cti<9;cti++) // correction term index
9707 {
9708 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9709 {
9710 Double_t correctionTerm = fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]->GetBinContent(b);
9711 fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti]->SetBinContent(b,correctionTerm);
9712 // to be improved (propagate error correctly)
9713 // ...
9714 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9715 } // correction term index
9716 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
9717
9718}// end of void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUADiffFlow(TString type, TString ptOrEta)
9719
9720
9721//==================================================================================================================================
9722
9723
9724void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulantsCorrectedForNUA(TString type, TString ptOrEta)
9725{
9726 // Calculate generalized differential flow Q-cumulants (corrected for non-uniform acceptance)
9727
9728 Int_t typeFlag = -1;
9729 Int_t ptEtaFlag = -1;
9730
9731 if(type == "RP")
9732 {
9733 typeFlag = 0;
9734 } else if(type == "POI")
9735 {
9736 typeFlag = 1;
9737 }
9738
9739 if(ptOrEta == "Pt")
9740 {
9741 ptEtaFlag = 0;
9742 } else if(ptOrEta == "Eta")
9743 {
9744 ptEtaFlag = 1;
9745 }
9746
9747 // shortcuts:
9748 Int_t t = typeFlag;
9749 Int_t pe = ptEtaFlag;
9750
9751 // common:
9752 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
9753
9754 // 2-particle correlation:
9755 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
9756 // sin term coming from integrated flow:
9757 Double_t sinP1nPhi = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1); // <<sin(n*phi1)>>
9758 Double_t sinP1nPhi1P1nPhi2 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2); // <<sin(n*(phi1+phi2))>>
9759 Double_t sinP1nPhi1M1nPhi2M1nPhi3 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(3); // <<sin(n*(phi1-phi2-phi3))>>
9760 // cos term coming from integrated flow:
9761 Double_t cosP1nPhi = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1); // <<cos(n*phi1)>>
9762 Double_t cosP1nPhi1P1nPhi2 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2); // <<cos(n*(phi1+phi2))>>
9763 Double_t cosP1nPhi1M1nPhi2M1nPhi3 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(3); // <<cos(n*(phi1-phi2-phi3))>>
9764
9765 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9766 {
9767 Double_t twoPrime = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b); // <<2'>>
9768 Double_t fourPrime = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b); // <<4'>>
9769 Double_t sinP1nPsi = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][0]->GetBinContent(b); // <<sin n(Psi)>>
9770 Double_t cosP1nPsi = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][0]->GetBinContent(b); // <<cos n(Psi)>>
9771 Double_t sinP1nPsi1P1nPhi2 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][1]->GetBinContent(b); // <<sin n(psi1+phi2)>>
9772 Double_t cosP1nPsi1P1nPhi2 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][1]->GetBinContent(b); // <<cos n(psi1+phi2)>>
9773 Double_t sinP1nPsi1P1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][2]->GetBinContent(b); // <<sin n(psi1+phi2-phi3)>>
9774 Double_t cosP1nPsi1P1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][2]->GetBinContent(b); // <<cos n(psi1+phi2-phi3)>>
9775 Double_t sinP1nPsi1M1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][3]->GetBinContent(b); // <<sin n(psi1-phi2-phi3)>>
9776 Double_t cosP1nPsi1M1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][3]->GetBinContent(b); // <<cos n(psi1-phi2-phi3)>>
9777 // generalized QC{2'}:
9778 Double_t qc2Prime = twoPrime - sinP1nPsi*sinP1nPhi - cosP1nPsi*cosP1nPhi;
9779 fDiffFlowCumulants[t][pe][0]->SetBinContent(b,qc2Prime);
9780 // generalized QC{4'}:
9781 Double_t qc4Prime = fourPrime-2.*twoPrime*two
9782 - cosP1nPsi*cosP1nPhi1M1nPhi2M1nPhi3
9783 + sinP1nPsi*sinP1nPhi1M1nPhi2M1nPhi3
9784 - cosP1nPhi*cosP1nPsi1M1nPhi2M1nPhi3
9785 + sinP1nPhi*sinP1nPsi1M1nPhi2M1nPhi3
9786 - 2.*cosP1nPhi*cosP1nPsi1P1nPhi2M1nPhi3
9787 - 2.*sinP1nPhi*sinP1nPsi1P1nPhi2M1nPhi3
9788 - cosP1nPsi1P1nPhi2*cosP1nPhi1P1nPhi2
9789 - sinP1nPsi1P1nPhi2*sinP1nPhi1P1nPhi2
9790 + 2.*cosP1nPhi1P1nPhi2*(cosP1nPsi*cosP1nPhi-sinP1nPsi*sinP1nPhi)
9791 + 2.*sinP1nPhi1P1nPhi2*(cosP1nPsi*sinP1nPhi+sinP1nPsi*cosP1nPhi)
9792 + 4.*two*(cosP1nPsi*cosP1nPhi+sinP1nPsi*sinP1nPhi)
9793 + 2.*cosP1nPsi1P1nPhi2*(pow(cosP1nPhi,2.)-pow(sinP1nPhi,2.))
9794 + 4.*sinP1nPsi1P1nPhi2*cosP1nPhi*sinP1nPhi
9795 + 4.*twoPrime*(pow(cosP1nPhi,2.)+pow(sinP1nPhi,2.))
9796 - 6.*(pow(cosP1nPhi,2.)-pow(sinP1nPhi,2.))
9797 * (cosP1nPsi*cosP1nPhi-sinP1nPsi*sinP1nPhi)
9798 - 12.*cosP1nPhi*sinP1nPhi
9799 * (sinP1nPsi*cosP1nPhi+cosP1nPsi*sinP1nPhi);
9800 fDiffFlowCumulants[t][pe][1]->SetBinContent(b,qc4Prime);
9801 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
9802
9803} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulantsCorrectedForNUA(TString type, TString ptOrEta)
9804
9805
9806//==================================================================================================================================
9807
9808
9809void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectedForNUA(TString type, TString ptOrEta)
9810{
9811 // Calculate differential flow corrected for non-uniform acceptance.
9812
9813 // to be improved (rewritten completely)
9814
9815 Int_t typeFlag = -1;
9816 Int_t ptEtaFlag = -1;
9817
9818 if(type == "RP")
9819 {
9820 typeFlag = 0;
9821 } else if(type == "POI")
9822 {
9823 typeFlag = 1;
9824 }
9825
9826 if(ptOrEta == "Pt")
9827 {
9828 ptEtaFlag = 0;
9829 } else if(ptOrEta == "Eta")
9830 {
9831 ptEtaFlag = 1;
9832 }
9833
9834 // shortcuts:
9835 Int_t t = typeFlag;
9836 Int_t pe = ptEtaFlag;
9837
9838 // common:
9839 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
9840
9841 // to be improved: access here generalized QC{2} and QC{4} instead:
9842 Double_t dV2 = fIntFlow->GetBinContent(1);
9843 Double_t dV4 = fIntFlow->GetBinContent(2);
9844
9845 // loop over pt or eta bins:
9846 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9847 {
9848 // generalized QC{2'}:
9849 Double_t gQC2Prime = fDiffFlowCumulants[t][pe][0]->GetBinContent(b);
9850 // v'{2}:
9851 if(dV2>0)
9852 {
9853 Double_t v2Prime = gQC2Prime/dV2;
9854 fDiffFlow[t][pe][0]->SetBinContent(b,v2Prime);
9855 }
9856 // generalized QC{4'}:
9857 Double_t gQC4Prime = fDiffFlowCumulants[t][pe][1]->GetBinContent(b);
9858 // v'{4}:
9859 if(dV4>0)
9860 {
9861 Double_t v4Prime = -gQC4Prime/pow(dV4,3.);
9862 fDiffFlow[t][pe][1]->SetBinContent(b,v4Prime);
9863 }
9864 } // end of for(Int_t b=1;b<=fnBinsPtEta[pe];b++)
9865
9866} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectedForNUA(TString type, TString ptOrEta);
9867
9868
9869//==================================================================================================================================
9870
9871
0328db2d 9872void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoops(AliFlowEventSimple * const anEvent)
489d5531 9873{
9874 // Evaluate with nested loops multiparticle correlations for integrated flow (without using the particle weights).
9875
9876 // Remark: Results are stored in profile fIntFlowDirectCorrelations whose binning is organized as follows:
9877 //
9878 // 1st bin: <2>_{1n|1n} = two1n1n = cos(n*(phi1-phi2))>
9879 // 2nd bin: <2>_{2n|2n} = two2n2n = cos(2n*(phi1-phi2))>
9880 // 3rd bin: <2>_{3n|3n} = two3n3n = cos(3n*(phi1-phi2))>
9881 // 4th bin: <2>_{4n|4n} = two4n4n = cos(4n*(phi1-phi2))>
9882 // 5th bin: ---- EMPTY ----
9883 // 6th bin: <3>_{2n|1n,1n} = three2n1n1n = <cos(n*(2.*phi1-phi2-phi3))>
9884 // 7th bin: <3>_{3n|2n,1n} = three3n2n1n = <cos(n*(3.*phi1-2.*phi2-phi3))>
9885 // 8th bin: <3>_{4n|2n,2n} = three4n2n2n = <cos(n*(4.*phi1-2.*phi2-2.*phi3))>
9886 // 9th bin: <3>_{4n|3n,1n} = three4n3n1n = <cos(n*(4.*phi1-3.*phi2-phi3))>
9887 // 10th bin: ---- EMPTY ----
9888 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1n = <cos(n*(phi1+phi2-phi3-phi4))>
9889 // 12th bin: <4>_{2n,1n|2n,1n} = four2n1n2n1n = <cos(2.*n*(phi1+phi2-phi3-phi4))>
9890 // 13th bin: <4>_{2n,2n|2n,2n} = four2n2n2n2n = <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>
9891 // 14th bin: <4>_{3n|1n,1n,1n} = four3n1n1n1n = <cos(n*(3.*phi1-phi2-phi3-phi4))>
9892 // 15th bin: <4>_{3n,1n|3n,1n} = four3n1n3n1n = <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>
9893 // 16th bin: <4>_{3n,1n|2n,2n} = four3n1n2n2n = <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>
9894 // 17th bin: <4>_{4n|2n,1n,1n} = four4n2n1n1n = <cos(n*(3.*phi1+phi2-3.*phi3-phi4))>
9895 // 18th bin: ---- EMPTY ----
9896 // 19th bin: <5>_{2n|1n,1n,1n,1n} = five2n1n1n1n1n = <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>
9897 // 20th bin: <5>_{2n,2n|2n,1n,1n} = five2n2n2n1n1n = <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>
9898 // 21st bin: <5>_{3n,1n|2n,1n,1n} = five3n1n2n1n1n = <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>
9899 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = five4n1n1n1n1n = <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>
9900 // 23rd bin: ---- EMPTY ----
9901 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = six1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
9902 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = six2n1n1n2n1n1n = <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>
9903 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = six2n2n1n1n1n1n = <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>
9904 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = six3n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>
9905 // 28th bin: ---- EMPTY ----
9906 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = seven2n1n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
9907 // 30th bin: ---- EMPTY ----
9908 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = eight1n1n1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
9909
9910 Int_t nPrim = anEvent->NumberOfTracks();
9911 AliFlowTrackSimple *aftsTrack = NULL;
9912 Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
9913 Int_t n = fHarmonic;
9914 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
9915 Double_t dMult = (*fSMpk)(0,0);
9916 cout<<endl;
9917 cout<<"Multiparticle correlations: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
9918 if(dMult<2)
9919 {
9920 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
9921 } else if (dMult>fMaxAllowedMultiplicity)
9922 {
9923 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
9924 } else
9925 {
9926 cout<<"... evaluating nested loops (without using particle weights)..."<<endl;
9927 }
9928
9929 // 2-particle correlations:
9930 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
9931 {
9932 for(Int_t i1=0;i1<nPrim;i1++)
9933 {
9934 aftsTrack=anEvent->GetTrack(i1);
9935 if(!(aftsTrack->InRPSelection())) continue;
9936 phi1=aftsTrack->Phi();
9937 for(Int_t i2=0;i2<nPrim;i2++)
9938 {
9939 if(i2==i1)continue;
9940 aftsTrack=anEvent->GetTrack(i2);
9941 if(!(aftsTrack->InRPSelection())) continue;
9942 phi2=aftsTrack->Phi();
9943 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
9944 // fill the profile with 2-p correlations:
9945 fIntFlowDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),1.); // <cos(n*(phi1-phi2))>
9946 fIntFlowDirectCorrelations->Fill(1.5,cos(2.*n*(phi1-phi2)),1.); // <cos(2n*(phi1-phi2))>
9947 fIntFlowDirectCorrelations->Fill(2.5,cos(3.*n*(phi1-phi2)),1.); // <cos(3n*(phi1-phi2))>
9948 fIntFlowDirectCorrelations->Fill(3.5,cos(4.*n*(phi1-phi2)),1.); // <cos(4n*(phi1-phi2))>
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>=2)
9952
9953 // 3-particle correlations:
9954 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
9955 {
9956 for(Int_t i1=0;i1<nPrim;i1++)
9957 {
9958 aftsTrack=anEvent->GetTrack(i1);
9959 if(!(aftsTrack->InRPSelection())) continue;
9960 phi1=aftsTrack->Phi();
9961 for(Int_t i2=0;i2<nPrim;i2++)
9962 {
9963 if(i2==i1)continue;
9964 aftsTrack=anEvent->GetTrack(i2);
9965 if(!(aftsTrack->InRPSelection())) continue;
9966 phi2=aftsTrack->Phi();
9967 for(Int_t i3=0;i3<nPrim;i3++)
9968 {
9969 if(i3==i1||i3==i2)continue;
9970 aftsTrack=anEvent->GetTrack(i3);
9971 if(!(aftsTrack->InRPSelection())) continue;
9972 phi3=aftsTrack->Phi();
9973 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;
9974 // fill the profile with 3-p correlations:
9975 fIntFlowDirectCorrelations->Fill(5.,cos(2.*n*phi1-n*(phi2+phi3)),1.); //<3>_{2n|nn,n}
9976 fIntFlowDirectCorrelations->Fill(6.,cos(3.*n*phi1-2.*n*phi2-n*phi3),1.); //<3>_{3n|2n,n}
9977 fIntFlowDirectCorrelations->Fill(7.,cos(4.*n*phi1-2.*n*phi2-2.*n*phi3),1.); //<3>_{4n|2n,2n}
9978 fIntFlowDirectCorrelations->Fill(8.,cos(4.*n*phi1-3.*n*phi2-n*phi3),1.); //<3>_{4n|3n,n}
9979 } // end of for(Int_t i3=0;i3<nPrim;i3++)
9980 } // end of for(Int_t i2=0;i2<nPrim;i2++)
9981 } // end of for(Int_t i1=0;i1<nPrim;i1++)
9982 } // end of if(nPrim>=3)
9983
9984 // 4-particle correlations:
9985 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)
9986 {
9987 for(Int_t i1=0;i1<nPrim;i1++)
9988 {
9989 aftsTrack=anEvent->GetTrack(i1);
9990 if(!(aftsTrack->InRPSelection())) continue;
9991 phi1=aftsTrack->Phi();
9992 for(Int_t i2=0;i2<nPrim;i2++)
9993 {
9994 if(i2==i1)continue;
9995 aftsTrack=anEvent->GetTrack(i2);
9996 if(!(aftsTrack->InRPSelection())) continue;
9997 phi2=aftsTrack->Phi();
9998 for(Int_t i3=0;i3<nPrim;i3++)
9999 {
10000 if(i3==i1||i3==i2)continue;
10001 aftsTrack=anEvent->GetTrack(i3);
10002 if(!(aftsTrack->InRPSelection())) continue;
10003 phi3=aftsTrack->Phi();
10004 for(Int_t i4=0;i4<nPrim;i4++)
10005 {
10006 if(i4==i1||i4==i2||i4==i3)continue;
10007 aftsTrack=anEvent->GetTrack(i4);
10008 if(!(aftsTrack->InRPSelection())) continue;
10009 phi4=aftsTrack->Phi();
10010 if(nPrim==4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush;
10011 // fill the profile with 4-p correlations:
10012 fIntFlowDirectCorrelations->Fill(10.,cos(n*phi1+n*phi2-n*phi3-n*phi4),1.); // <4>_{n,n|n,n}
10013 fIntFlowDirectCorrelations->Fill(11.,cos(2.*n*phi1+n*phi2-2.*n*phi3-n*phi4),1.); // <4>_{2n,n|2n,n}
10014 fIntFlowDirectCorrelations->Fill(12.,cos(2.*n*phi1+2*n*phi2-2.*n*phi3-2.*n*phi4),1.); // <4>_{2n,2n|2n,2n}
10015 fIntFlowDirectCorrelations->Fill(13.,cos(3.*n*phi1-n*phi2-n*phi3-n*phi4),1.); // <4>_{3n|n,n,n}
10016 fIntFlowDirectCorrelations->Fill(14.,cos(3.*n*phi1+n*phi2-3.*n*phi3-n*phi4),1.); // <4>_{3n,n|3n,n}
10017 fIntFlowDirectCorrelations->Fill(15.,cos(3.*n*phi1+n*phi2-2.*n*phi3-2.*n*phi4),1.); // <4>_{3n,n|2n,2n}
10018 fIntFlowDirectCorrelations->Fill(16.,cos(4.*n*phi1-2.*n*phi2-n*phi3-n*phi4),1.); // <4>_{4n|2n,n,n}
10019 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10020 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10021 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10022 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10023 } // end of if(nPrim>=)
10024
10025 // 5-particle correlations:
10026 if(nPrim>=5 && nPrim<=fMaxAllowedMultiplicity)
10027 {
10028 for(Int_t i1=0;i1<nPrim;i1++)
10029 {
10030 aftsTrack=anEvent->GetTrack(i1);
10031 if(!(aftsTrack->InRPSelection())) continue;
10032 phi1=aftsTrack->Phi();
10033 for(Int_t i2=0;i2<nPrim;i2++)
10034 {
10035 if(i2==i1)continue;
10036 aftsTrack=anEvent->GetTrack(i2);
10037 if(!(aftsTrack->InRPSelection())) continue;
10038 phi2=aftsTrack->Phi();
10039 for(Int_t i3=0;i3<nPrim;i3++)
10040 {
10041 if(i3==i1||i3==i2)continue;
10042 aftsTrack=anEvent->GetTrack(i3);
10043 if(!(aftsTrack->InRPSelection())) continue;
10044 phi3=aftsTrack->Phi();
10045 for(Int_t i4=0;i4<nPrim;i4++)
10046 {
10047 if(i4==i1||i4==i2||i4==i3)continue;
10048 aftsTrack=anEvent->GetTrack(i4);
10049 if(!(aftsTrack->InRPSelection())) continue;
10050 phi4=aftsTrack->Phi();
10051 for(Int_t i5=0;i5<nPrim;i5++)
10052 {
10053 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
10054 aftsTrack=anEvent->GetTrack(i5);
10055 if(!(aftsTrack->InRPSelection())) continue;
10056 phi5=aftsTrack->Phi();
10057 if(nPrim==5) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<"\r"<<flush;
10058 // fill the profile with 5-p correlations:
10059 fIntFlowDirectCorrelations->Fill(18.,cos(2.*n*phi1+n*phi2-n*phi3-n*phi4-n*phi5),1.); //<5>_{2n,n|n,n,n}
10060 fIntFlowDirectCorrelations->Fill(19.,cos(2.*n*phi1+2.*n*phi2-2.*n*phi3-n*phi4-n*phi5),1.); //<5>_{2n,2n|2n,n,n}
10061 fIntFlowDirectCorrelations->Fill(20.,cos(3.*n*phi1+n*phi2-2.*n*phi3-n*phi4-n*phi5),1.); //<5>_{3n,n|2n,n,n}
10062 fIntFlowDirectCorrelations->Fill(21.,cos(4.*n*phi1-n*phi2-n*phi3-n*phi4-n*phi5),1.); //<5>_{4n|n,n,n,n}
10063 } // end of for(Int_t i5=0;i5<nPrim;i5++)
10064 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10065 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10066 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10067 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10068 } // end of if(nPrim>=5)
10069
10070 // 6-particle correlations:
10071 if(nPrim>=6 && nPrim<=fMaxAllowedMultiplicity)
10072 {
10073 for(Int_t i1=0;i1<nPrim;i1++)
10074 {
10075 aftsTrack=anEvent->GetTrack(i1);
10076 if(!(aftsTrack->InRPSelection())) continue;
10077 phi1=aftsTrack->Phi();
10078 for(Int_t i2=0;i2<nPrim;i2++)
10079 {
10080 if(i2==i1)continue;
10081 aftsTrack=anEvent->GetTrack(i2);
10082 if(!(aftsTrack->InRPSelection())) continue;
10083 phi2=aftsTrack->Phi();
10084 for(Int_t i3=0;i3<nPrim;i3++)
10085 {
10086 if(i3==i1||i3==i2)continue;
10087 aftsTrack=anEvent->GetTrack(i3);
10088 if(!(aftsTrack->InRPSelection())) continue;
10089 phi3=aftsTrack->Phi();
10090 for(Int_t i4=0;i4<nPrim;i4++)
10091 {
10092 if(i4==i1||i4==i2||i4==i3)continue;
10093 aftsTrack=anEvent->GetTrack(i4);
10094 if(!(aftsTrack->InRPSelection())) continue;
10095 phi4=aftsTrack->Phi();
10096 for(Int_t i5=0;i5<nPrim;i5++)
10097 {
10098 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
10099 aftsTrack=anEvent->GetTrack(i5);
10100 if(!(aftsTrack->InRPSelection())) continue;
10101 phi5=aftsTrack->Phi();
10102 for(Int_t i6=0;i6<nPrim;i6++)
10103 {
10104 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
10105 aftsTrack=anEvent->GetTrack(i6);
10106 if(!(aftsTrack->InRPSelection())) continue;
10107 phi6=aftsTrack->Phi();
10108 if(nPrim==6) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<"\r"<<flush;
10109 // fill the profile with 6-p correlations:
10110 fIntFlowDirectCorrelations->Fill(23.,cos(n*phi1+n*phi2+n*phi3-n*phi4-n*phi5-n*phi6),1.); //<6>_{n,n,n|n,n,n}
10111 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}
10112 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}
10113 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}
10114 } // end of for(Int_t i6=0;i6<nPrim;i6++)
10115 } // end of for(Int_t i5=0;i5<nPrim;i5++)
10116 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10117 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10118 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10119 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10120 } // end of if(nPrim>=6)
10121
10122 // 7-particle correlations:
10123 if(nPrim>=7 && nPrim<=fMaxAllowedMultiplicity)
10124 {
10125 for(Int_t i1=0;i1<nPrim;i1++)
10126 {
10127 aftsTrack=anEvent->GetTrack(i1);
10128 if(!(aftsTrack->InRPSelection())) continue;
10129 phi1=aftsTrack->Phi();
10130 for(Int_t i2=0;i2<nPrim;i2++)
10131 {
10132 if(i2==i1)continue;
10133 aftsTrack=anEvent->GetTrack(i2);
10134 if(!(aftsTrack->InRPSelection())) continue;
10135 phi2=aftsTrack->Phi();
10136 for(Int_t i3=0;i3<nPrim;i3++)
10137 {
10138 if(i3==i1||i3==i2)continue;
10139 aftsTrack=anEvent->GetTrack(i3);
10140 if(!(aftsTrack->InRPSelection())) continue;
10141 phi3=aftsTrack->Phi();
10142 for(Int_t i4=0;i4<nPrim;i4++)
10143 {
10144 if(i4==i1||i4==i2||i4==i3)continue;
10145 aftsTrack=anEvent->GetTrack(i4);
10146 if(!(aftsTrack->InRPSelection())) continue;
10147 phi4=aftsTrack->Phi();
10148 for(Int_t i5=0;i5<nPrim;i5++)
10149 {
10150 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
10151 aftsTrack=anEvent->GetTrack(i5);
10152 if(!(aftsTrack->InRPSelection())) continue;
10153 phi5=aftsTrack->Phi();
10154 for(Int_t i6=0;i6<nPrim;i6++)
10155 {
10156 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
10157 aftsTrack=anEvent->GetTrack(i6);
10158 if(!(aftsTrack->InRPSelection())) continue;
10159 phi6=aftsTrack->Phi();
10160 for(Int_t i7=0;i7<nPrim;i7++)
10161 {
10162 if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;
10163 aftsTrack=anEvent->GetTrack(i7);
10164 if(!(aftsTrack->InRPSelection())) continue;
10165 phi7=aftsTrack->Phi();
10166 if(nPrim==7) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<" "<<i7<<"\r"<<flush;
10167 // fill the profile with 7-p correlation:
10168 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}
10169 } // end of for(Int_t i7=0;i7<nPrim;i7++)
10170 } // end of for(Int_t i6=0;i6<nPrim;i6++)
10171 } // end of for(Int_t i5=0;i5<nPrim;i5++)
10172 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10173 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10174 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10175 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10176 } // end of if(nPrim>=7)
10177
10178 // 8-particle correlations:
10179 if(nPrim>=8 && nPrim<=fMaxAllowedMultiplicity)
10180 {
10181 for(Int_t i1=0;i1<nPrim;i1++)
10182 {
10183 aftsTrack=anEvent->GetTrack(i1);
10184 if(!(aftsTrack->InRPSelection())) continue;
10185 phi1=aftsTrack->Phi();
10186 for(Int_t i2=0;i2<nPrim;i2++)
10187 {
10188 if(i2==i1)continue;
10189 aftsTrack=anEvent->GetTrack(i2);
10190 if(!(aftsTrack->InRPSelection())) continue;
10191 phi2=aftsTrack->Phi();
10192 for(Int_t i3=0;i3<nPrim;i3++)
10193 {
10194 if(i3==i1||i3==i2)continue;
10195 aftsTrack=anEvent->GetTrack(i3);
10196 if(!(aftsTrack->InRPSelection())) continue;
10197 phi3=aftsTrack->Phi();
10198 for(Int_t i4=0;i4<nPrim;i4++)
10199 {
10200 if(i4==i1||i4==i2||i4==i3)continue;
10201 aftsTrack=anEvent->GetTrack(i4);
10202 if(!(aftsTrack->InRPSelection())) continue;
10203 phi4=aftsTrack->Phi();
10204 for(Int_t i5=0;i5<nPrim;i5++)
10205 {
10206 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
10207 aftsTrack=anEvent->GetTrack(i5);
10208 if(!(aftsTrack->InRPSelection())) continue;
10209 phi5=aftsTrack->Phi();
10210 for(Int_t i6=0;i6<nPrim;i6++)
10211 {
10212 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
10213 aftsTrack=anEvent->GetTrack(i6);
10214 if(!(aftsTrack->InRPSelection())) continue;
10215 phi6=aftsTrack->Phi();
10216 for(Int_t i7=0;i7<nPrim;i7++)
10217 {
10218 if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;
10219 aftsTrack=anEvent->GetTrack(i7);
10220 if(!(aftsTrack->InRPSelection())) continue;
10221 phi7=aftsTrack->Phi();
10222 for(Int_t i8=0;i8<nPrim;i8++)
10223 {
10224 if(i8==i1||i8==i2||i8==i3||i8==i4||i8==i5||i8==i6||i8==i7)continue;
10225 aftsTrack=anEvent->GetTrack(i8);
10226 if(!(aftsTrack->InRPSelection())) continue;
10227 phi8=aftsTrack->Phi();
10228 cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<" "<<i7<<" "<<i8<<"\r"<<flush;
10229 // fill the profile with 8-p correlation:
10230 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}
10231 } // end of for(Int_t i8=0;i8<nPrim;i8++)
10232 } // end of for(Int_t i7=0;i7<nPrim;i7++)
10233 } // end of for(Int_t i6=0;i6<nPrim;i6++)
10234 } // end of for(Int_t i5=0;i5<nPrim;i5++)
10235 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10236 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10237 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10238 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10239 } // end of if(nPrim>=8)
10240
10241 cout<<endl;
10242
10243} // end of AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoops(AliFlowEventSimple* anEvent)
10244
10245
10246//==================================================================================================================================
10247
10248
10249void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrelations()
10250{
10251 // Cross-check results for multiparticle correlations needed for int. flow: results from Q-vectors vs results from nested loops.
10252
10253 cout<<endl;
10254 cout<<endl;
10255 cout<<" *****************************************"<<endl;
10256 cout<<" **** cross-checking the correlations ****"<<endl;
10257 cout<<" **** for integrated flow ****"<<endl;
10258 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
10259 {
10260 cout<<" **** (particle weights not used) ****"<<endl;
10261 } else
10262 {
10263 cout<<" **** (particle weights used) ****"<<endl;
10264 }
10265 cout<<" *****************************************"<<endl;
10266 cout<<endl;
10267 cout<<endl;
10268
10269 Int_t ciMax = 32; // to be improved (removed eventually when I calculate 6th and 8th order with particle weights)
10270
10271 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
10272 {
10273 ciMax = 11;
10274 }
10275
10276 for(Int_t ci=1;ci<=ciMax;ci++)
10277 {
10278 if(strcmp((fIntFlowCorrelationsAllPro->GetXaxis())->GetBinLabel(ci), "") == 0) continue; // to be improved (access finalized histogram here)
10279 cout<<(fIntFlowCorrelationsAllPro->GetXaxis())->GetBinLabel(ci)<<":"<<endl; // to be improved (access finalized histogram here)
10280 cout<<"from Q-vectors = "<<fIntFlowCorrelationsAllPro->GetBinContent(ci)<<endl; // to be improved (access finalized histogram here)
10281 cout<<"from nested loops = "<<fIntFlowDirectCorrelations->GetBinContent(ci)<<endl;
10282 cout<<endl;
10283 }
10284
10285} // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrelations()
10286
10287
10288//================================================================================================================================
10289
10290
10291void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrectionTermsForNUA()
10292{
10293 // Cross-check results for corrections terms for non-uniform acceptance needed for int. flow: results from Q-vectors vs results from nested loops.
10294
10295 cout<<endl;
10296 cout<<endl;
10297 cout<<" *********************************************"<<endl;
10298 cout<<" **** cross-checking the correction terms ****"<<endl;
10299 cout<<" **** for non-uniform acceptance relevant ****"<<endl;
10300 cout<<" **** for integrated flow ****"<<endl;
10301 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
10302 {
10303 cout<<" **** (particle weights not used) ****"<<endl;
10304 } else
10305 {
10306 cout<<" **** (particle weights used) ****"<<endl;
10307 }
10308 cout<<" *********************************************"<<endl;
10309 cout<<endl;
10310 cout<<endl;
10311
10312 for(Int_t ci=1;ci<=10;ci++) // correction term index
10313 {
10314 for(Int_t sc=0;sc<2;sc++) // sin or cos term
10315 {
10316 if(strcmp((fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->GetBinLabel(ci), "") == 0) continue; // to be improved (access finalized histogram here)
10317 cout<<(fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->GetBinLabel(ci)<<":"<<endl; // to be improved (access finalized histogram here)
10318 cout<<"from Q-vectors = "<<fIntFlowCorrectionTermsForNUAPro[sc]->GetBinContent(ci)<<endl; // to be improved (access finalized histogram here)
10319 cout<<"from nested loops = "<<fIntFlowDirectCorrectionTermsForNUA[sc]->GetBinContent(ci)<<endl;
10320 cout<<endl;
10321 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos term
10322 } // end of for(Int_t ci=1;ci<=10;ci++) // correction term index
10323
10324} // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrectionTermsForNUA()
10325
10326
10327//================================================================================================================================
10328
10329
0328db2d 10330void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent)
489d5531 10331{
10332 // Evaluate with nested loops multiparticle correlations for integrated flow (using the particle weights).
10333
10334 // Results are stored in profile fIntFlowDirectCorrelations.
10335 // Remark 1: When particle weights are used the binning of fIntFlowDirectCorrelations is organized as follows:
10336 //
10337 // 1st bin: <2>_{1n|1n} = two1n1nW1W1 = <w1 w2 cos(n*(phi1-phi2))>
10338 // 2nd bin: <2>_{2n|2n} = two2n2nW2W2 = <w1^2 w2^2 cos(2n*(phi1-phi2))>
10339 // 3rd bin: <2>_{3n|3n} = two3n3nW3W3 = <w1^3 w2^3 cos(3n*(phi1-phi2))>
10340 // 4th bin: <2>_{4n|4n} = two4n4nW4W4 = <w1^4 w2^4 cos(4n*(phi1-phi2))>
10341 // 5th bin: ---- EMPTY ----
10342 // 6th bin: <3>_{2n|1n,1n} = three2n1n1nW2W1W1 = <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
10343 // 7th bin: <3>_{3n|2n,1n} = ...
10344 // 8th bin: <3>_{4n|2n,2n} = ...
10345 // 9th bin: <3>_{4n|3n,1n} = ...
10346 // 10th bin: ---- EMPTY ----
10347 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1nW1W1W1W1 = <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
10348 // 12th bin: <4>_{2n,1n|2n,1n} = ...
10349 // 13th bin: <4>_{2n,2n|2n,2n} = ...
10350 // 14th bin: <4>_{3n|1n,1n,1n} = ...
10351 // 15th bin: <4>_{3n,1n|3n,1n} = ...
10352 // 16th bin: <4>_{3n,1n|2n,2n} = ...
10353 // 17th bin: <4>_{4n|2n,1n,1n} = ...
10354 // 18th bin: ---- EMPTY ----
10355 // 19th bin: <5>_{2n|1n,1n,1n,1n} = ...
10356 // 20th bin: <5>_{2n,2n|2n,1n,1n} = ...
10357 // 21st bin: <5>_{3n,1n|2n,1n,1n} = ...
10358 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = ...
10359 // 23rd bin: ---- EMPTY ----
10360 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = ...
10361 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = ...
10362 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = ...
10363 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = ...
10364 // 28th bin: ---- EMPTY ----
10365 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = ...
10366 // 30th bin: ---- EMPTY ----
10367 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = ...
57340a27 10368
489d5531 10369 // Remark 2: When particle weights are used there are some extra correlations. They are stored in
10370 // fIntFlowExtraDirectCorrelations binning of which is organized as follows:
57340a27 10371
489d5531 10372 // 1st bin: two1n1nW3W1 = <w1^3 w2 cos(n*(phi1-phi2))>
10373 // 2nd bin: two1n1nW1W1W2 = <w1 w2 w3^2 cos(n*(phi1-phi2))>
10374 // ...
57340a27 10375
489d5531 10376 Int_t nPrim = anEvent->NumberOfTracks();
10377 AliFlowTrackSimple *aftsTrack = NULL;
10378 //Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
10379 //Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1., wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
10380 Double_t phi1=0., phi2=0., phi3=0., phi4=0.;
10381 Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1.;
10382 Int_t n = fHarmonic;
10383 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
10384 Double_t dMult = (*fSMpk)(0,0);
10385 cout<<endl;
10386 cout<<"Multiparticle correlations: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
10387 if(dMult<2)
10388 {
10389 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
10390 } else if (dMult>fMaxAllowedMultiplicity)
10391 {
10392 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
10393 } else
10394 {
10395 cout<<"... evaluating nested loops (using particle weights) ..."<<endl;
10396 }
10397
10398 // 2-particle correlations:
10399 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
10400 {
10401 // 2 nested loops multiparticle correlations using particle weights:
10402 for(Int_t i1=0;i1<nPrim;i1++)
10403 {
10404 aftsTrack=anEvent->GetTrack(i1);
10405 if(!(aftsTrack->InRPSelection())) continue;
10406 phi1=aftsTrack->Phi();
10407 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
10408 for(Int_t i2=0;i2<nPrim;i2++)
10409 {
10410 if(i2==i1)continue;
10411 aftsTrack=anEvent->GetTrack(i2);
10412 if(!(aftsTrack->InRPSelection())) continue;
10413 phi2=aftsTrack->Phi();
10414 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
10415 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
10416 // 2-p correlations using particle weights:
10417 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),wPhi1*wPhi2); // <w1 w2 cos( n*(phi1-phi2))>
10418 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))>
10419 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))>
10420 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))>
10421 // extra correlations:
10422 // 2-p extra correlations (do not appear if particle weights are not used):
10423 if(fUsePhiWeights) fIntFlowExtraDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),pow(wPhi1,3)*wPhi2); // <w1^3 w2 cos(n*(phi1-phi2))>
10424 // ...
10425 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10426 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10427 } // end of if(nPrim>=2)
10428
10429 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
57340a27 10430 {
489d5531 10431 // 3 nested loops multiparticle correlations using particle weights:
10432 for(Int_t i1=0;i1<nPrim;i1++)
57340a27 10433 {
489d5531 10434 aftsTrack=anEvent->GetTrack(i1);
10435 if(!(aftsTrack->InRPSelection())) continue;
10436 phi1=aftsTrack->Phi();
10437 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
10438 for(Int_t i2=0;i2<nPrim;i2++)
10439 {
10440 if(i2==i1)continue;
10441 aftsTrack=anEvent->GetTrack(i2);
10442 if(!(aftsTrack->InRPSelection())) continue;
10443 phi2=aftsTrack->Phi();
10444 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
10445 for(Int_t i3=0;i3<nPrim;i3++)
10446 {
10447 if(i3==i1||i3==i2)continue;
10448 aftsTrack=anEvent->GetTrack(i3);
10449 if(!(aftsTrack->InRPSelection())) continue;
10450 phi3=aftsTrack->Phi();
10451 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
10452 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;
10453 // 3-p correlations using particle weights:
10454 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))>
10455 // ...
10456 // extra correlations:
10457 // 2-p extra correlations (do not appear if particle weights are not used):
10458 if(fUsePhiWeights) fIntFlowExtraDirectCorrelations->Fill(1.5,cos(n*(phi1-phi2)),wPhi1*wPhi2*pow(wPhi3,2)); // <w1 w2 w3^2 cos(n*(phi1-phi2))>
10459 // ...
10460 // 3-p extra correlations (do not appear if particle weights are not used):
10461 // ...
10462 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10463 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10464 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10465 } // end of if(nPrim>=3)
57340a27 10466
489d5531 10467 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)
10468 {
10469 // 4 nested loops multiparticle correlations using particle weights:
10470 for(Int_t i1=0;i1<nPrim;i1++)
10471 {
10472 aftsTrack=anEvent->GetTrack(i1);
10473 if(!(aftsTrack->InRPSelection())) continue;
10474 phi1=aftsTrack->Phi();
10475 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
10476 for(Int_t i2=0;i2<nPrim;i2++)
10477 {
10478 if(i2==i1)continue;
10479 aftsTrack=anEvent->GetTrack(i2);
10480 if(!(aftsTrack->InRPSelection())) continue;
10481 phi2=aftsTrack->Phi();
10482 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
10483 for(Int_t i3=0;i3<nPrim;i3++)
10484 {
10485 if(i3==i1||i3==i2)continue;
10486 aftsTrack=anEvent->GetTrack(i3);
10487 if(!(aftsTrack->InRPSelection())) continue;
10488 phi3=aftsTrack->Phi();
10489 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
10490 for(Int_t i4=0;i4<nPrim;i4++)
10491 {
10492 if(i4==i1||i4==i2||i4==i3)continue;
10493 aftsTrack=anEvent->GetTrack(i4);
10494 if(!(aftsTrack->InRPSelection())) continue;
10495 phi4=aftsTrack->Phi();
10496 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
10497 if(nPrim>=4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush; // to be improved (replace eventually this if statement with if(nPrim==4))
10498 // 4-p correlations using particle weights:
10499 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(10.5,cos(n*phi1+n*phi2-n*phi3-n*phi4),wPhi1*wPhi2*wPhi3*wPhi4);
10500 // extra correlations:
10501 // 2-p extra correlations (do not appear if particle weights are not used):
10502 // ...
10503 // 3-p extra correlations (do not appear if particle weights are not used):
10504 // ...
10505 // 4-p extra correlations (do not appear if particle weights are not used):
10506 // ...
10507 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10508 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10509 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10510 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10511 } // end of if(nPrim>=4)
57340a27 10512
489d5531 10513 cout<<endl;
57340a27 10514
489d5531 10515} // end of void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent)
57340a27 10516
489d5531 10517
10518//================================================================================================================================
10519
10520
10521void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowExtraCorrelations()
57340a27 10522{
489d5531 10523 // Cross-check results for extra multiparticle correlations needed for int. flow
10524 // which appear only when particle weights are used: results from Q-vectors vs results from nested loops.
57340a27 10525
489d5531 10526 cout<<endl;
10527 cout<<endl;
10528 cout<<" ***********************************************"<<endl;
10529 cout<<" **** cross-checking the extra correlations ****"<<endl;
10530 cout<<" **** for integrated flow ****"<<endl;
10531 cout<<" ***********************************************"<<endl;
10532 cout<<endl;
10533 cout<<endl;
10534
10535 for(Int_t eci=1;eci<=2;eci++) // to be improved (increased eciMax eventually when I calculate 6th and 8th)
57340a27 10536 {
489d5531 10537 if(strcmp((fIntFlowExtraCorrelationsPro->GetXaxis())->GetBinLabel(eci), "") == 0) continue;
10538 cout<<(fIntFlowExtraCorrelationsPro->GetXaxis())->GetBinLabel(eci)<<":"<<endl;
10539 cout<<"from Q-vectors = "<<fIntFlowExtraCorrelationsPro->GetBinContent(eci)<<endl;
10540 cout<<"from nested loops = "<<fIntFlowExtraDirectCorrelations->GetBinContent(eci)<<endl;
10541 cout<<endl;
10542 }
57340a27 10543
489d5531 10544} // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowExtraCorrelations()
57340a27 10545
10546
489d5531 10547//================================================================================================================================
3b552efe 10548
10549
0328db2d 10550void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoops(AliFlowEventSimple * const anEvent)
489d5531 10551{
10552 // Evaluate with nested loops correction terms for non-uniform acceptance relevant for NONAME integrated flow (to be improved (name)).
10553 //
10554 // Remark: Both sin and cos correction terms are calculated in this method. Sin terms are stored in fIntFlowDirectCorrectionTermsForNUA[0],
10555 // and cos terms in fIntFlowDirectCorrectionTermsForNUA[1]. Binning of fIntFlowDirectCorrectionTermsForNUA[sc] is organized as follows
10556 // (sc stands for either sin or cos):
10557
10558 // 1st bin: <<sc(n*(phi1))>>
10559 // 2nd bin: <<sc(n*(phi1+phi2))>>
10560 // 3rd bin: <<sc(n*(phi1-phi2-phi3))>>
10561 // 4th bin: <<sc(n*(2phi1-phi2))>>
10562
10563 Int_t nPrim = anEvent->NumberOfTracks();
10564 AliFlowTrackSimple *aftsTrack = NULL;
10565 Double_t phi1=0., phi2=0., phi3=0.;
10566 Int_t n = fHarmonic;
10567 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
10568 Double_t dMult = (*fSMpk)(0,0);
10569 cout<<endl;
10570 cout<<"Correction terms for non-uniform acceptance: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
10571 if(dMult<1)
3b552efe 10572 {
489d5531 10573 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
10574 } else if (dMult>fMaxAllowedMultiplicity)
3b552efe 10575 {
489d5531 10576 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
10577 } else
10578 {
10579 cout<<"... evaluating nested loops (without using particle weights)..."<<endl;
10580 }
10581
10582 if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)
10583 {
10584 // 1-particle correction terms for non-uniform acceptance:
10585 for(Int_t i1=0;i1<nPrim;i1++)
10586 {
10587 aftsTrack=anEvent->GetTrack(i1);
10588 if(!(aftsTrack->InRPSelection())) continue;
10589 phi1=aftsTrack->Phi();
10590 if(nPrim==1) cout<<i1<<"\r"<<flush;
10591 // sin terms:
10592 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(0.5,sin(n*phi1),1.); // <sin(n*phi1)>
10593 // cos terms:
10594 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(0.5,cos(n*phi1),1.); // <cos(n*phi1)>
10595 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10596 } // end of if(nPrim>=1)
10597
10598 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
10599 {
10600 // 2-particle correction terms for non-uniform acceptance:
10601 for(Int_t i1=0;i1<nPrim;i1++)
10602 {
10603 aftsTrack=anEvent->GetTrack(i1);
10604 if(!(aftsTrack->InRPSelection())) continue;
10605 phi1=aftsTrack->Phi();
10606 for(Int_t i2=0;i2<nPrim;i2++)
3b552efe 10607 {
489d5531 10608 if(i2==i1)continue;
10609 aftsTrack=anEvent->GetTrack(i2);
10610 if(!(aftsTrack->InRPSelection())) continue;
10611 phi2=aftsTrack->Phi();
10612 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
10613 // sin terms:
3b552efe 10614 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(1.5,sin(n*(phi1+phi2)),1.); // <<sin(n*(phi1+phi2))>>
489d5531 10615 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(3.5,sin(n*(2*phi1-phi2)),1.); // <<sin(n*(2*phi1-phi2))>>
10616 // cos terms:
3b552efe 10617 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(1.5,cos(n*(phi1+phi2)),1.); // <<cos(n*(phi1+phi2))>>
489d5531 10618 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(3.5,cos(n*(2*phi1-phi2)),1.); // <<cos(n*(2*phi1-phi2))>>
10619 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10620 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10621 } // end of if(nPrim>=2)
10622
10623 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
10624 {
10625 // 3-particle correction terms for non-uniform acceptance:
10626 for(Int_t i1=0;i1<nPrim;i1++)
10627 {
10628 aftsTrack=anEvent->GetTrack(i1);
10629 if(!(aftsTrack->InRPSelection())) continue;
10630 phi1=aftsTrack->Phi();
10631 for(Int_t i2=0;i2<nPrim;i2++)
10632 {
10633 if(i2==i1)continue;
10634 aftsTrack=anEvent->GetTrack(i2);
10635 if(!(aftsTrack->InRPSelection())) continue;
10636 phi2=aftsTrack->Phi();
10637 for(Int_t i3=0;i3<nPrim;i3++)
10638 {
10639 if(i3==i1||i3==i2)continue;
10640 aftsTrack=anEvent->GetTrack(i3);
10641 if(!(aftsTrack->InRPSelection())) continue;
10642 phi3=aftsTrack->Phi();
10643 if(nPrim>=3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush; // to be improved (eventually I will change this if statement)
10644 // sin terms:
10645 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(2.5,sin(n*(phi1-phi2-phi3)),1.); // <<sin(n*(phi1-phi2-phi3))>>
10646 // cos terms:
10647 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(2.5,cos(n*(phi1-phi2-phi3)),1.); // <<cos(n*(phi1-phi2-phi3))>>
10648 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10649 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10650 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10651 } // end of if(nPrim>=3)
10652
10653 cout<<endl;
10654}
10655//================================================================================================================================
0328db2d 10656void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoops(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
489d5531 10657{
10658 // Evaluate reduced correlations with nested loops without using the particle weights.
10659
10660 // Remark 1: Reduced correlations are evaluated in pt bin number fCrossCheckInPtBinNo and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
10661 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrelations[t][pe][ci], where indices runs as follows:
10662 // [0=RP,1=POI][0=Pt,1=Eta][0=<2'>,1=<4'>,2=<6'>,3=<8'>]
10663 // Remark 3: <2'> = <cos(n*(psi1-phi2))>
10664 // <4'> = <cos(n*(psi1+phi2-phi3-phi4))>
10665 // ...
10666
10667 Int_t typeFlag = -1;
10668 Int_t ptEtaFlag = -1;
10669 if(type == "RP")
10670 {
10671 typeFlag = 0;
10672 } else if(type == "POI")
10673 {
10674 typeFlag = 1;
10675 }
10676 if(ptOrEta == "Pt")
10677 {
10678 ptEtaFlag = 0;
10679 } else if(ptOrEta == "Eta")
10680 {
10681 ptEtaFlag = 1;
10682 }
10683 // shortcuts:
10684 Int_t t = typeFlag;
10685 Int_t pe = ptEtaFlag;
10686
10687 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
10688 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
10689 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
10690
10691 Int_t nPrim = anEvent->NumberOfTracks();
10692 AliFlowTrackSimple *aftsTrack = NULL;
10693
10694 Double_t psi1=0., phi2=0., phi3=0., phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
10695
3b552efe 10696 Int_t n = fHarmonic;
489d5531 10697
10698 // 2'-particle correlations:
10699 for(Int_t i1=0;i1<nPrim;i1++)
10700 {
10701 aftsTrack=anEvent->GetTrack(i1);
3b552efe 10702 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
10703 if(typeFlag==1) // this is diff flow of POIs
489d5531 10704 {
10705 if(ptOrEta == "Pt")
10706 {
10707 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
10708 } else if (ptOrEta == "Eta")
10709 {
10710 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 10711 }
10712 } else // this is diff flow of RPs
10713 {
489d5531 10714 if(ptOrEta == "Pt")
10715 {
10716 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
10717 } else if (ptOrEta == "Eta")
10718 {
10719 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 10720 }
10721 }
489d5531 10722
10723 psi1=aftsTrack->Phi();
10724 for(Int_t i2=0;i2<nPrim;i2++)
10725 {
10726 if(i2==i1)continue;
10727 aftsTrack=anEvent->GetTrack(i2);
10728 // RP condition (!(first) particle in the correlator must be RP):
10729 if(!(aftsTrack->InRPSelection()))continue;
10730 phi2=aftsTrack->Phi();
10731 // 2'-particle correlations:
10732 fDiffFlowDirectCorrelations[t][pe][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(1.*n*(psi1-phi2)),1.); // <cos(n*(psi1-phi2))
10733 }//end of for(Int_t i2=0;i2<nPrim;i2++)
10734 }//end of for(Int_t i1=0;i1<nPrim;i1++)
10735
10736 /*
10737
10738 // 3'-particle correlations:
10739 for(Int_t i1=0;i1<nPrim;i1++)
10740 {
10741 aftsTrack=anEvent->GetTrack(i1);
10742 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
10743 if(ptOrEta == "Pt")
10744 {
10745 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
10746 } else if (ptOrEta == "Eta")
10747 {
10748 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
10749 }
10750 psi1=aftsTrack->Phi();
10751 for(Int_t i2=0;i2<nPrim;i2++)
10752 {
10753 if(i2==i1)continue;
10754 aftsTrack=anEvent->GetTrack(i2);
10755 // RP condition (!(first) particle in the correlator must be RP):
10756 if(!(aftsTrack->InRPSelection())) continue;
10757 phi2=aftsTrack->Phi();
10758 for(Int_t i3=0;i3<nPrim;i3++)
10759 {
10760 if(i3==i1||i3==i2)continue;
10761 aftsTrack=anEvent->GetTrack(i3);
10762 // RP condition (!(first) particle in the correlator must be RP):
10763 if(!(aftsTrack->InRPSelection())) continue;
10764 phi3=aftsTrack->Phi();
10765 // 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))>
10766 }//end of for(Int_t i3=0;i3<nPrim;i3++)
10767 }//end of for(Int_t i2=0;i2<nPrim;i2++)
10768 }//end of for(Int_t i1=0;i1<nPrim;i1++)
10769
10770 */
10771
10772 // 4'-particle correlations:
10773 for(Int_t i1=0;i1<nPrim;i1++)
10774 {
10775 aftsTrack=anEvent->GetTrack(i1);
3b552efe 10776 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
10777 if(typeFlag==1) // this is diff flow of POIs
489d5531 10778 {
10779 if(ptOrEta == "Pt")
10780 {
10781 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
10782 } else if (ptOrEta == "Eta")
10783 {
10784 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 10785 }
10786 } else // this is diff flow of RPs
10787 {
489d5531 10788 if(ptOrEta == "Pt")
10789 {
10790 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
10791 } else if (ptOrEta == "Eta")
10792 {
10793 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 10794 }
10795 }
489d5531 10796
10797 psi1=aftsTrack->Phi();
10798 for(Int_t i2=0;i2<nPrim;i2++)
10799 {
10800 if(i2==i1) continue;
10801 aftsTrack=anEvent->GetTrack(i2);
10802 // RP condition (!(first) particle in the correlator must be RP):
10803 if(!(aftsTrack->InRPSelection())) continue;
10804 phi2=aftsTrack->Phi();
10805 for(Int_t i3=0;i3<nPrim;i3++)
10806 {
10807 if(i3==i1||i3==i2) continue;
10808 aftsTrack=anEvent->GetTrack(i3);
10809 // RP condition (!(first) particle in the correlator must be RP):
10810 if(!(aftsTrack->InRPSelection())) continue;
10811 phi3=aftsTrack->Phi();
10812 for(Int_t i4=0;i4<nPrim;i4++)
10813 {
10814 if(i4==i1||i4==i2||i4==i3) continue;
10815 aftsTrack=anEvent->GetTrack(i4);
10816 // RP condition (!(first) particle in the correlator must be RP):
10817 if(!(aftsTrack->InRPSelection())) continue;
10818 phi4=aftsTrack->Phi();
10819 // 4'-particle correlations:
10820 fDiffFlowDirectCorrelations[t][pe][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3-phi4)),1.); // <cos(n(psi1+phi2-phi3-phi4))>
10821 }//end of for(Int_t i4=0;i4<nPrim;i4++)
10822 }//end of for(Int_t i3=0;i3<nPrim;i3++)
10823 }//end of for(Int_t i2=0;i2<nPrim;i2++)
10824 }//end of for(Int_t i1=0;i1<nPrim;i1++)
10825
10826 // count # of RPs and POIs in selected pt and eta bins for cross-checkings:
3b552efe 10827 for(Int_t i=0;i<nPrim;i++)
10828 {
10829 aftsTrack=anEvent->GetTrack(i);
10830 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
10831 if(typeFlag==1) // this is diff flow of POIs
489d5531 10832 {
10833 if(ptOrEta == "Pt")
10834 {
10835 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
10836 } else if (ptOrEta == "Eta")
10837 {
10838 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 10839 }
10840 } else // this is diff flow of RPs
10841 {
489d5531 10842 if(ptOrEta == "Pt")
10843 {
10844 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
10845 } else if (ptOrEta == "Eta")
10846 {
10847 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 10848 }
10849 }
10850 if(t==1)t++;
10851 fNoOfParticlesInBin->Fill(t+pe+0.5);
489d5531 10852 }
10853
10854} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoops(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
10855
10856
10857//================================================================================================================================
10858
10859
10860void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrelations(TString type, TString ptOrEta)
10861{
10862 // Compare correlations needed for diff. flow calculated with nested loops and those calculated from Q-vectors
10863
10864 Int_t typeFlag = -1;
10865 Int_t ptEtaFlag = -1;
10866 if(type == "RP")
10867 {
10868 typeFlag = 0;
10869 } else if(type == "POI")
10870 {
10871 typeFlag = 1;
10872 }
10873 if(ptOrEta == "Pt")
10874 {
10875 ptEtaFlag = 0;
10876 } else if(ptOrEta == "Eta")
10877 {
10878 ptEtaFlag = 1;
10879 }
10880 // shortcuts:
10881 Int_t t = typeFlag;
10882 Int_t pe = ptEtaFlag;
10883
10884 TString rpORpoiString[2] = {"RP ","POI"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
10885 TString ptORetaString[2] = {"pt","eta"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
10886 TString reducedCorrelations[4] = {"<<cos(n(psi1-phi2))>>","<<cos(n(psi1+phi2-phi3-phi4))>>","",""}; // to be improved (access this from pro or hist)
10887 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
10888 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
10889
10890 Int_t crossCheckInPtEtaBinNo[2] = {fCrossCheckInPtBinNo,fCrossCheckInEtaBinNo};
10891
10892
10893 cout<<endl;
10894 cout<<" *****************************************"<<endl;
10895 cout<<" **** cross-checking the correlations ****"<<endl;
10896 cout<<" **** for differential flow ("<<rpORpoiString[t]<<") ****"<<endl;
10897 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
10898 {
10899 cout<<" **** (particle weights not used) ****"<<endl;
10900 } else
10901 {
10902 cout<<" **** (particle weights used) ****"<<endl;
10903 }
10904 cout<<" *****************************************"<<endl;
10905 cout<<endl;
10906 cout<<" "<<ptORetaString[pe]<<" bin: "<<lowerPtEtaEdge[pe]<<" <= "<<ptORetaString[pe]<<" < "<<upperPtEtaEdge[pe]<<endl;
10907 cout<<endl;
10908
10909 for(Int_t rci=0;rci<2;rci++) // to be improved (calculate 6th and 8th order)
10910 {
10911 cout<<" "<<reducedCorrelations[rci].Data()<<":"<<endl;
10912 cout<<" from Q-vectors = "<<fDiffFlowCorrelationsPro[t][pe][rci]->GetBinContent(crossCheckInPtEtaBinNo[pe])<<endl;
10913 cout<<" from nested loops = "<<fDiffFlowDirectCorrelations[t][pe][rci]->GetBinContent(1)<<endl;
10914 cout<<endl;
10915 } // end of for(Int_t rci=0;rci<4;rci++)
10916
10917} // end of void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrelations(TString type, TString ptOrEta)
10918
3b552efe 10919//================================================================================================================================
10920
489d5531 10921void AliFlowAnalysisWithQCumulants::PrintNumberOfParticlesInSelectedBin()
3b552efe 10922{
10923 // Print on the screen number of RPs and POIs in selected pt and eta bin for cross checkings.
10924
10925 cout<<endl;
10926 cout<<"Number of RPs in selected pt bin = "<<fNoOfParticlesInBin->GetBinContent(1)<<endl;
10927 cout<<"Number of RPs in selected eta bin = "<<fNoOfParticlesInBin->GetBinContent(2)<<endl;
10928 cout<<"Number of POIs in selected pt bin = "<<fNoOfParticlesInBin->GetBinContent(3)<<endl;
10929 cout<<"Number of POIs in selected eta bin = "<<fNoOfParticlesInBin->GetBinContent(4)<<endl;
10930
489d5531 10931} // end of void AliFlowAnalysisWithQCumulants::PrintNumberOfParticlesInSelectedBin()
10932
3b552efe 10933//================================================================================================================================
10934
0328db2d 10935void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
489d5531 10936{
10937 // Evaluate reduced correlations with nested loops without using the particle weights.
10938
10939 // Remark 1: Reduced correlations are evaluated in pt bin number fCrossCheckInPtBinNo and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
10940 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrelations[t][pe][ci], where indices runs as follows:
10941 // [0=RP,1=POI][0=Pt,1=Eta][0=<2'>,1=<4'>,2=<6'>,3=<8'>]
10942 // Remark 3: <2'> = <w2 cos(n*(psi1-phi2))>
10943 // <4'> = <w2 w3 w4 cos(n*(psi1+phi2-phi3-phi4))>
10944 // ...
10945
10946 Int_t typeFlag = -1;
10947 Int_t ptEtaFlag = -1;
10948 if(type == "RP")
10949 {
10950 typeFlag = 0;
10951 } else if(type == "POI")
10952 {
10953 typeFlag = 1;
10954 }
10955 if(ptOrEta == "Pt")
10956 {
10957 ptEtaFlag = 0;
10958 } else if(ptOrEta == "Eta")
10959 {
10960 ptEtaFlag = 1;
10961 }
10962 // shortcuts:
10963 Int_t t = typeFlag;
10964 Int_t pe = ptEtaFlag;
10965
10966 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
10967 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
10968 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
10969
10970 Int_t nPrim = anEvent->NumberOfTracks();
10971 AliFlowTrackSimple *aftsTrack = NULL;
10972
10973 Double_t psi1=0., phi2=0., phi3=0., phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
10974 Double_t wPhi2=1., wPhi3=1., wPhi4=1.;// wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
10975
10976 Int_t n = fHarmonic;
10977
10978 // 2'-particle correlations:
10979 for(Int_t i1=0;i1<nPrim;i1++)
10980 {
10981 aftsTrack=anEvent->GetTrack(i1);
3b552efe 10982 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
10983 if(typeFlag==1) // this is diff flow of POIs
489d5531 10984 {
10985 if(ptOrEta == "Pt")
10986 {
10987 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
10988 } else if (ptOrEta == "Eta")
10989 {
10990 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 10991 }
10992 } else // this is diff flow of RPs
10993 {
489d5531 10994 if(ptOrEta == "Pt")
10995 {
10996 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
10997 } else if (ptOrEta == "Eta")
10998 {
10999 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11000 }
489d5531 11001 }
11002 psi1=aftsTrack->Phi();
11003 for(Int_t i2=0;i2<nPrim;i2++)
11004 {
11005 if(i2==i1) continue;
11006 aftsTrack=anEvent->GetTrack(i2);
11007 // RP condition (!(first) particle in the correlator must be RP):
11008 if(!(aftsTrack->InRPSelection())) continue;
11009 phi2=aftsTrack->Phi();
11010 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
11011 // 2'-particle correlations:
11012 fDiffFlowDirectCorrelations[t][pe][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(1.*n*(psi1-phi2)),wPhi2); // <w2 cos(n*(psi1-phi2))
11013 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11014 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11015
11016 // 4'-particle correlations:
11017 for(Int_t i1=0;i1<nPrim;i1++)
11018 {
11019 aftsTrack=anEvent->GetTrack(i1);
3b552efe 11020 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11021 if(typeFlag==1) // this is diff flow of POIs
489d5531 11022 {
11023 if(ptOrEta == "Pt")
11024 {
11025 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11026 } else if (ptOrEta == "Eta")
11027 {
11028 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11029 }
11030 } else // this is diff flow of RPs
11031 {
489d5531 11032 if(ptOrEta == "Pt")
11033 {
11034 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11035 } else if (ptOrEta == "Eta")
11036 {
11037 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11038 }
489d5531 11039 }
11040 psi1=aftsTrack->Phi();
11041 for(Int_t i2=0;i2<nPrim;i2++)
11042 {
11043 if(i2==i1) continue;
11044 aftsTrack=anEvent->GetTrack(i2);
11045 // RP condition (!(first) particle in the correlator must be RP):
11046 if(!(aftsTrack->InRPSelection())) continue;
11047 phi2=aftsTrack->Phi();
11048 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
11049 for(Int_t i3=0;i3<nPrim;i3++)
11050 {
11051 if(i3==i1||i3==i2) continue;
11052 aftsTrack=anEvent->GetTrack(i3);
11053 // RP condition (!(first) particle in the correlator must be RP):
11054 if(!(aftsTrack->InRPSelection())) continue;
11055 phi3=aftsTrack->Phi();
11056 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
11057 for(Int_t i4=0;i4<nPrim;i4++)
11058 {
11059 if(i4==i1||i4==i2||i4==i3) continue;
11060 aftsTrack=anEvent->GetTrack(i4);
11061 // RP condition (!(first) particle in the correlator must be RP):
11062 if(!(aftsTrack->InRPSelection())) continue;
11063 phi4=aftsTrack->Phi();
11064 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
11065 // 4'-particle correlations <w2 w3 w4 cos(n(psi1+phi2-phi3-phi4))>:
11066 fDiffFlowDirectCorrelations[t][pe][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3-phi4)),wPhi2*wPhi3*wPhi4);
11067 }//end of for(Int_t i4=0;i4<nPrim;i4++)
11068 }//end of for(Int_t i3=0;i3<nPrim;i3++)
11069 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11070 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11071
11072 // count # of RPs and POIs in selected pt and eta bins for cross-checkings: (to be improved - moved to dedicated method)
3b552efe 11073 for(Int_t i=0;i<nPrim;i++)
11074 {
489d5531 11075 aftsTrack=anEvent->GetTrack(i);
11076 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11077 if(typeFlag==1) // this is diff flow of POIs
11078 {
11079 if(ptOrEta == "Pt")
11080 {
11081 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11082 } else if (ptOrEta == "Eta")
11083 {
11084 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11085 }
11086 } else // this is diff flow of RPs
11087 {
11088 if(ptOrEta == "Pt")
11089 {
11090 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11091 } else if (ptOrEta == "Eta")
11092 {
11093 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11094 }
11095 }
11096 if(t==1)t++;
11097 fNoOfParticlesInBin->Fill(t+pe+0.5);
11098 }
11099
11100} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
11101
11102
11103//================================================================================================================================
11104
11105
0328db2d 11106void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
489d5531 11107{
11108 // Evaluate with nested loops correction terms for non-uniform acceptance (both sin and cos terms) relevant for differential flow.
11109
11110 // Remark 1: Reduced correction terms for non-uniform acceptance are evaluated in pt bin number fCrossCheckInPtBinNo
11111 // and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
11112 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrections[t][pe][sc][cti], where first three indices runs as:
11113 // [0=RP,1=POI][0=Pt,1=Eta][0=sin terms,1=cos terms], whilst the cti (correction term index) runs as follows:
11114 // cti:
11115 // 0: <<sc n(psi1)>>
11116 // 1: <<sc n(psi1+phi2)>>
11117 // 2: <<sc n(psi1+phi2-phi3)>>
11118 // 3: <<sc n(psi1-phi2-phi3)>>
11119 // 4:
11120 // 5:
11121 // 6:
11122
11123 Int_t typeFlag = -1;
11124 Int_t ptEtaFlag = -1;
11125 if(type == "RP")
11126 {
11127 typeFlag = 0;
11128 } else if(type == "POI")
11129 {
11130 typeFlag = 1;
11131 }
11132 if(ptOrEta == "Pt")
11133 {
11134 ptEtaFlag = 0;
11135 } else if(ptOrEta == "Eta")
11136 {
11137 ptEtaFlag = 1;
11138 }
11139 // shortcuts:
11140 Int_t t = typeFlag;
11141 Int_t pe = ptEtaFlag;
11142
11143 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
11144 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
11145 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
11146
11147 Int_t nPrim = anEvent->NumberOfTracks();
11148 AliFlowTrackSimple *aftsTrack = NULL;
11149
11150 Double_t psi1=0., phi2=0., phi3=0.;// phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
11151
11152 Int_t n = fHarmonic;
11153
11154 // 1-particle correction terms:
11155 for(Int_t i1=0;i1<nPrim;i1++)
11156 {
11157 aftsTrack=anEvent->GetTrack(i1);
3b552efe 11158 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11159 if(typeFlag==1) // this is diff flow of POIs
489d5531 11160 {
11161 if(ptOrEta == "Pt")
11162 {
11163 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11164 } else if (ptOrEta == "Eta")
11165 {
11166 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11167 }
11168 } else // this is diff flow of RPs
11169 {
489d5531 11170 if(ptOrEta == "Pt")
11171 {
11172 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11173 } else if (ptOrEta == "Eta")
11174 {
11175 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11176 }
11177 }
489d5531 11178 psi1=aftsTrack->Phi();
11179 // sin terms:
11180 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*psi1),1.); // <<sin(n*(psi1))>>
11181 // cos terms:
11182 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*psi1),1.); // <<cos(n*(psi1))>>
11183 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11184
11185 // 2-particle correction terms:
11186 for(Int_t i1=0;i1<nPrim;i1++)
11187 {
11188 aftsTrack=anEvent->GetTrack(i1);
3b552efe 11189 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11190 if(typeFlag==1) // this is diff flow of POIs
489d5531 11191 {
11192 if(ptOrEta == "Pt")
11193 {
11194 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11195 } else if (ptOrEta == "Eta")
11196 {
11197 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11198 }
11199 } else // this is diff flow of RPs
11200 {
489d5531 11201 if(ptOrEta == "Pt")
11202 {
11203 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11204 } else if (ptOrEta == "Eta")
11205 {
11206 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11207 }
489d5531 11208 }
11209 psi1=aftsTrack->Phi();
11210 for(Int_t i2=0;i2<nPrim;i2++)
11211 {
11212 if(i2==i1) continue;
11213 aftsTrack=anEvent->GetTrack(i2);
11214 // RP condition (!(first) particle in the correlator must be RP):
11215 if(!(aftsTrack->InRPSelection())) continue;
11216 phi2=aftsTrack->Phi();
11217 // sin terms:
11218 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2)),1.); // <<sin(n*(psi1+phi2))>>
11219 // cos terms:
11220 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2)),1.); // <<cos(n*(psi1+phi2))>>
11221 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11222 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11223
11224 // 3-particle correction terms:
11225 for(Int_t i1=0;i1<nPrim;i1++)
11226 {
11227 aftsTrack=anEvent->GetTrack(i1);
3b552efe 11228 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11229 if(typeFlag==1) // this is diff flow of POIs
489d5531 11230 {
11231 if(ptOrEta == "Pt")
11232 {
11233 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11234 } else if (ptOrEta == "Eta")
11235 {
11236 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 11237 }
11238 } else // this is diff flow of RPs
11239 {
489d5531 11240 if(ptOrEta == "Pt")
11241 {
11242 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11243 } else if (ptOrEta == "Eta")
11244 {
11245 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 11246 }
489d5531 11247 }
11248 psi1=aftsTrack->Phi();
11249 for(Int_t i2=0;i2<nPrim;i2++)
11250 {
11251 if(i2==i1) continue;
11252 aftsTrack=anEvent->GetTrack(i2);
11253 // RP condition (!(first) particle in the correlator must be RP):
11254 if(!(aftsTrack->InRPSelection())) continue;
11255 phi2=aftsTrack->Phi();
11256 for(Int_t i3=0;i3<nPrim;i3++)
11257 {
11258 if(i3==i1||i3==i2) continue;
11259 aftsTrack=anEvent->GetTrack(i3);
11260 // RP condition (!(first) particle in the correlator must be RP):
11261 if(!(aftsTrack->InRPSelection())) continue;
11262 phi3=aftsTrack->Phi();
11263 // sin terms:
11264 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][2]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2-phi3)),1.); // <<sin(n*(psi1+phi2-phi3))>>
11265 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][3]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1-phi2-phi3)),1.); // <<sin(n*(psi1-phi2-phi3))>>
11266 // cos terms:
11267 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][2]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3)),1.); // <<cos(n*(psi1+phi2-phi3))>>
11268 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][3]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1-phi2-phi3)),1.); // <<cos(n*(psi1-phi2-phi3))>>
11269 }//end of for(Int_t i3=0;i3<nPrim;i3++)
11270 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11271 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11272
11273} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
11274
11275
11276//================================================================================================================================
11277
11278
11279void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrectionTermsForNUA(TString type, TString ptOrEta)
11280{
11281 // Compare corrections temrs for non-uniform acceptance needed for diff. flow calculated with nested loops and those calculated from Q-vectors
11282
11283 Int_t typeFlag = -1;
11284 Int_t ptEtaFlag = -1;
11285 if(type == "RP")
11286 {
11287 typeFlag = 0;
11288 } else if(type == "POI")
11289 {
11290 typeFlag = 1;
11291 }
11292 if(ptOrEta == "Pt")
11293 {
11294 ptEtaFlag = 0;
11295 } else if(ptOrEta == "Eta")
11296 {
11297 ptEtaFlag = 1;
11298 }
11299 // shortcuts:
11300 Int_t t = typeFlag;
11301 Int_t pe = ptEtaFlag;
11302
11303 TString rpORpoiString[2] = {"RP ","POI"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
11304 TString ptORetaString[2] = {"pt","eta"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
11305 //TString sinCosFlag[2] = {"sin","cos"}; // to be improved (eventually promote to data member)
11306 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)
11307 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)
11308 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
11309 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
11310
11311 Int_t crossCheckInPtEtaBinNo[2] = {fCrossCheckInPtBinNo,fCrossCheckInEtaBinNo};
11312
11313 cout<<endl;
11314 cout<<" ******************************************"<<endl;
11315 cout<<" **** cross-checking the correction ****"<<endl;
46b94261 11316 cout<<" **** terms for non-uniform acceptance ****"<<endl;
489d5531 11317 cout<<" **** for differential flow ("<<rpORpoiString[t]<<") ****"<<endl;
11318 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
11319 {
11320 cout<<" **** (particle weights not used) ****"<<endl;
11321 } else
11322 {
11323 cout<<" **** (particle weights used) ****"<<endl;
11324 }
11325 cout<<" ******************************************"<<endl;
11326 cout<<endl;
11327 cout<<" "<<ptORetaString[pe]<<" bin: "<<lowerPtEtaEdge[pe]<<" <= "<<ptORetaString[pe]<<" < "<<upperPtEtaEdge[pe]<<endl;
11328 cout<<endl;
11329
11330 for(Int_t cti=0;cti<4;cti++) // correction term index
11331 {
11332 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
11333 {
11334 if(sc==0) // to be improved (this can be implemented better)
11335 {
11336 cout<<" "<<reducedCorrectionSinTerms[cti].Data()<<":"<<endl;
11337 } else
11338 {
11339 cout<<" "<<reducedCorrectionCosTerms[cti].Data()<<":"<<endl;
11340 }
11341 cout<<" from Q-vectors = "<<fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]->GetBinContent(crossCheckInPtEtaBinNo[pe])<<endl;
11342 cout<<" from nested loops = "<<fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti]->GetBinContent(1)<<endl;
11343 cout<<endl;
11344 }
11345 } // end of for(Int_t rci=0;rci<4;rci++)
11346
11347} // end of void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrectionTermsForNUA(TString type, TString ptOrEta)
11348
11349
57340a27 11350//================================================================================================================================
11351
489d5531 11352
11353void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights()
11354{
11355 // Calculate corrections using particle weights for non-uniform acceptance of the detector for no-name integrated flow (cos terms).
11356
11357 // **********************************************************************
11358 // **** weighted corrections for non-uniform acceptance (cos terms): ****
11359 // **********************************************************************
57340a27 11360
489d5531 11361 // Remark 1: When particle weights are used the binning of fIntFlowCorrectionTermsForNUAPro[1] is organized as follows:
57340a27 11362 //
489d5531 11363 // 1st bin: <<w1 cos(n*(phi1))>> = cosP1nW1
11364 // 2nd bin: <<w1 w2 cos(n*(phi1+phi2))>> = cosP1nP1nW1W1
11365 // 3rd bin: <<w1 w2 w3 cos(n*(phi1-phi2-phi3))>> = cosP1nM1nM1nW1W1W1
11366 // ...
11367
11368 // multiplicity (number of particles used to determine the reaction plane)
11369 Double_t dMult = (*fSMpk)(0,0);
11370
11371 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
11372 Double_t dReQ1n1k = (*fReQ)(0,1);
11373 Double_t dReQ2n2k = (*fReQ)(1,2);
11374 //Double_t dReQ3n3k = (*fReQ)(2,3);
11375 //Double_t dReQ4n4k = (*fReQ)(3,4);
11376 Double_t dReQ1n3k = (*fReQ)(0,3);
11377 Double_t dImQ1n1k = (*fImQ)(0,1);
11378 Double_t dImQ2n2k = (*fImQ)(1,2);
11379 //Double_t dImQ3n3k = (*fImQ)(2,3);
11380 //Double_t dImQ4n4k = (*fImQ)(3,4);
11381 //Double_t dImQ1n3k = (*fImQ)(0,3);
11382
11383 // dMs are variables introduced in order to simplify some Eqs. bellow:
11384 //..............................................................................................
11385 Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
57340a27 11386 Double_t dM111 = (*fSMpk)(2,1)-3.*(*fSMpk)(0,2)*(*fSMpk)(0,1)
489d5531 11387 + 2.*(*fSMpk)(0,3); // dM111 = sum_{i,j,k=1,i!=j!=k}^M w_i w_j w_k
11388 //..............................................................................................
ecac11c2 11389 // 1-particle:
489d5531 11390 Double_t cosP1nW1 = 0.; // <<w1 cos(n*(phi1))>>
11391
0328db2d 11392 if(dMult>0 && TMath::Abs((*fSMpk)(0,1))>1e-6)
489d5531 11393 {
11394 cosP1nW1 = dReQ1n1k/(*fSMpk)(0,1);
11395
11396 // average weighted 1-particle correction (cos terms) for non-uniform acceptance for single event:
11397 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(1,cosP1nW1);
11398
11399 // final average weighted 1-particle correction (cos terms) for non-uniform acceptance for all events:
11400 fIntFlowCorrectionTermsForNUAPro[1]->Fill(0.5,cosP1nW1,(*fSMpk)(0,1));
11401 }
11402
11403 // 2-particle:
11404 Double_t cosP1nP1nW1W1 = 0.; // <<w1 w2 cos(n*(phi1+phi2))>>
11405
0328db2d 11406 if(dMult>1 && TMath::Abs(dM11)>1e-6)
489d5531 11407 {
11408 cosP1nP1nW1W1 = (pow(dReQ1n1k,2)-pow(dImQ1n1k,2)-dReQ2n2k)/dM11;
11409
11410 // average weighted 2-particle correction (cos terms) for non-uniform acceptance for single event:
11411 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(2,cosP1nP1nW1W1);
11412
11413 // final average weighted 2-particle correction (cos terms) for non-uniform acceptance for all events:
11414 fIntFlowCorrectionTermsForNUAPro[1]->Fill(1.5,cosP1nP1nW1W1,dM11);
11415 }
11416
11417 // 3-particle:
11418 Double_t cosP1nM1nM1nW1W1W1 = 0.; // <<w1 w2 w3 cos(n*(phi1-phi2-phi3))>>
11419
0328db2d 11420 if(dMult>2 && TMath::Abs(dM111)>1e-6)
489d5531 11421 {
57340a27 11422 cosP1nM1nM1nW1W1W1 = (dReQ1n1k*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
11423 - dReQ1n1k*dReQ2n2k-dImQ1n1k*dImQ2n2k
11424 - 2.*((*fSMpk)(0,2))*dReQ1n1k
489d5531 11425 + 2.*dReQ1n3k)
11426 / dM111;
11427
11428 // average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for single event:
11429 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(3,cosP1nM1nM1nW1W1W1);
11430
11431 // final average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for all events:
11432 fIntFlowCorrectionTermsForNUAPro[1]->Fill(2.5,cosP1nM1nM1nW1W1W1,dM111);
11433 }
11434
11435} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights()
11436
11437
11438//================================================================================================================================
11439
11440
11441void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights()
11442{
11443 // calculate corrections using particle weights for non-uniform acceptance of the detector for no-name integrated flow (sin terms)
11444
11445 // **********************************************************************
11446 // **** weighted corrections for non-uniform acceptance (sin terms): ****
11447 // **********************************************************************
11448
11449 // Remark 1: When particle weights are used the binning of fIntFlowCorrectionTermsForNUAPro[0] is organized as follows:
57340a27 11450 //
489d5531 11451 // 1st bin: <<w1 sin(n*(phi1))>> = sinP1nW1
11452 // 2nd bin: <<w1 w2 sin(n*(phi1+phi2))>> = sinP1nP1nW1W1
11453 // 3rd bin: <<w1 w2 w3 sin(n*(phi1-phi2-phi3))>> = sinP1nM1nM1nW1W1W1
11454 // ...
11455
11456 // multiplicity (number of particles used to determine the reaction plane)
11457 Double_t dMult = (*fSMpk)(0,0);
11458
11459 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
11460 Double_t dReQ1n1k = (*fReQ)(0,1);
11461 Double_t dReQ2n2k = (*fReQ)(1,2);
11462 //Double_t dReQ3n3k = (*fReQ)(2,3);
11463 //Double_t dReQ4n4k = (*fReQ)(3,4);
11464 //Double_t dReQ1n3k = (*fReQ)(0,3);
11465 Double_t dImQ1n1k = (*fImQ)(0,1);
11466 Double_t dImQ2n2k = (*fImQ)(1,2);
11467 //Double_t dImQ3n3k = (*fImQ)(2,3);
11468 //Double_t dImQ4n4k = (*fImQ)(3,4);
11469 Double_t dImQ1n3k = (*fImQ)(0,3);
11470
11471 // dMs are variables introduced in order to simplify some Eqs. bellow:
11472 //..............................................................................................
11473 Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
57340a27 11474 Double_t dM111 = (*fSMpk)(2,1)-3.*(*fSMpk)(0,2)*(*fSMpk)(0,1)
489d5531 11475 + 2.*(*fSMpk)(0,3); // dM111 = sum_{i,j,k=1,i!=j!=k}^M w_i w_j w_k
11476 //..............................................................................................
11477
11478 // 1-particle:
11479 Double_t sinP1nW1 = 0.; // <<w1 sin(n*(phi1))>>
11480
0328db2d 11481 if(dMult>0 && TMath::Abs((*fSMpk)(0,1))>1e-6)
489d5531 11482 {
11483 sinP1nW1 = dImQ1n1k/((*fSMpk)(0,1));
11484
11485 // average weighted 1-particle correction (sin terms) for non-uniform acceptance for single event:
11486 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(1,sinP1nW1);
11487
11488 // final average weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
11489 fIntFlowCorrectionTermsForNUAPro[0]->Fill(0.5,sinP1nW1,(*fSMpk)(0,1));
11490 }
11491
11492 // 2-particle:
11493 Double_t sinP1nP1nW1W1 = 0.; // <<w1 w2 sin(n*(phi1+phi2))>>
11494
0328db2d 11495 if(dMult>1 && TMath::Abs(dM11)>1e-6)
489d5531 11496 {
11497 sinP1nP1nW1W1 = (2.*dReQ1n1k*dImQ1n1k-dImQ2n2k)/dM11;
11498
11499 // average weighted 2-particle correction (sin terms) for non-uniform acceptance for single event:
11500 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(2,sinP1nP1nW1W1);
11501
11502 // final average weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
11503 fIntFlowCorrectionTermsForNUAPro[0]->Fill(1.5,sinP1nP1nW1W1,dM11);
11504 }
11505
11506 // 3-particle:
11507 Double_t sinP1nM1nM1nW1W1W1 = 0.; // <<w1 w2 w3 sin(n*(phi1-phi2-phi3))>>
11508
0328db2d 11509 if(dMult>2 && TMath::Abs(dM111)>1e-6)
489d5531 11510 {
57340a27 11511 sinP1nM1nM1nW1W1W1 = (-dImQ1n1k*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
11512 + dReQ1n1k*dImQ2n2k-dImQ1n1k*dReQ2n2k
11513 + 2.*((*fSMpk)(0,2))*dImQ1n1k
489d5531 11514 - 2.*dImQ1n3k)
11515 / dM111;
11516
11517 // average weighted 3-particle correction (sin terms) for non-uniform acceptance for single event:
11518 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(3,sinP1nM1nM1nW1W1W1);
11519
11520 // final average weighted 3-particle correction (sin terms) for non-uniform acceptance for all events:
11521 fIntFlowCorrectionTermsForNUAPro[0]->Fill(2.5,sinP1nM1nM1nW1W1W1,dM111);
11522 }
11523
11524} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights()
11525
11526
57340a27 11527//================================================================================================================================
489d5531 11528
11529
0328db2d 11530void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent)
489d5531 11531{
11532 // Evaluate with nested loops correction terms for non-uniform acceptance for integrated flow (using the particle weights).
11533
57340a27 11534 // Results are stored in profiles fIntFlowDirectCorrectionTermsForNUA[0] (sin terms) and
11535 // fIntFlowDirectCorrectionTermsForNUA[1] (cos terms).
489d5531 11536
57340a27 11537 // Remark 1: When particle weights are used the binning of fIntFlowDirectCorrectionTermsForNUA[sc] is
489d5531 11538 // organized as follows (sc stands for either sin or cos):
11539 //
11540 // 1st bin: <<w1 sc(n*(phi1))>> = scP1nW1
11541 // 2nd bin: <<w1 w2 sc(n*(phi1+phi2))>> = scP1nP1nW1W1
11542 // 3rd bin: <<w1 w2 w3 sc(n*(phi1-phi2-phi3))>> = scP1nM1nM1nW1W1W1
3b552efe 11543 // ...
489d5531 11544
11545 Int_t nPrim = anEvent->NumberOfTracks();
11546 AliFlowTrackSimple *aftsTrack = NULL;
11547 //Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
11548 //Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1., wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
11549 Double_t phi1=0., phi2=0., phi3=0.;
11550 Double_t wPhi1=1., wPhi2=1., wPhi3=1.;
11551 Int_t n = fHarmonic;
11552 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
11553 Double_t dMult = (*fSMpk)(0,0);
11554 cout<<endl;
11555 cout<<"Correction terms for non-uniform acceptance: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
11556 if(dMult<1)
11557 {
11558 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
11559 } else if (dMult>fMaxAllowedMultiplicity)
11560 {
11561 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
11562 } else
11563 {
11564 cout<<"... evaluating nested loops (using particle weights) ..."<<endl;
11565 }
11566
11567 // 1-particle correction terms using particle weights:
11568 if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)
11569 {
11570 for(Int_t i1=0;i1<nPrim;i1++)
11571 {
11572 aftsTrack=anEvent->GetTrack(i1);
11573 if(!(aftsTrack->InRPSelection())) continue;
11574 phi1=aftsTrack->Phi();
11575 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
57340a27 11576 // 1-particle correction terms using particle weights:
489d5531 11577 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(0.5,sin(n*phi1),wPhi1); // <w1 sin(n*phi1)>
11578 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(0.5,cos(n*phi1),wPhi1); // <w1 cos(n*phi1)>
57340a27 11579 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11580 } // end of if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)
11581
489d5531 11582 // 2-particle correction terms using particle weights:
11583 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
11584 {
11585 for(Int_t i1=0;i1<nPrim;i1++)
11586 {
11587 aftsTrack=anEvent->GetTrack(i1);
11588 if(!(aftsTrack->InRPSelection())) continue;
11589 phi1=aftsTrack->Phi();
11590 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
11591 for(Int_t i2=0;i2<nPrim;i2++)
11592 {
11593 if(i2==i1)continue;
11594 aftsTrack=anEvent->GetTrack(i2);
11595 if(!(aftsTrack->InRPSelection())) continue;
11596 phi2=aftsTrack->Phi();
11597 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
11598 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
57340a27 11599 // 2-p correction terms using particle weights:
489d5531 11600 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(1.5,sin(n*(phi1+phi2)),wPhi1*wPhi2); // <w1 w2 sin(n*(phi1+phi2))>
11601 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(1.5,cos(n*(phi1+phi2)),wPhi1*wPhi2); // <w1 w2 cos(n*(phi1+phi2))>
11602 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11603 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11604 } // end of if(nPrim>=2)
11605
11606 // 3-particle correction terms using particle weights:
11607 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
11608 {
11609 for(Int_t i1=0;i1<nPrim;i1++)
11610 {
11611 aftsTrack=anEvent->GetTrack(i1);
11612 if(!(aftsTrack->InRPSelection())) continue;
11613 phi1=aftsTrack->Phi();
11614 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
11615 for(Int_t i2=0;i2<nPrim;i2++)
11616 {
11617 if(i2==i1)continue;
11618 aftsTrack=anEvent->GetTrack(i2);
11619 if(!(aftsTrack->InRPSelection())) continue;
11620 phi2=aftsTrack->Phi();
11621 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
11622 for(Int_t i3=0;i3<nPrim;i3++)
11623 {
11624 if(i3==i1||i3==i2)continue;
11625 aftsTrack=anEvent->GetTrack(i3);
11626 if(!(aftsTrack->InRPSelection())) continue;
11627 phi3=aftsTrack->Phi();
11628 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
11629 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;
57340a27 11630 // 3-p correction terms using particle weights:
489d5531 11631 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(2.5,sin(n*(phi1-phi2-phi3)),wPhi1*wPhi2*wPhi3); // <w1 w2 w3 sin(n*(phi1-phi2-phi3))>
11632 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(2.5,cos(n*(phi1-phi2-phi3)),wPhi1*wPhi2*wPhi3); // <w1 w2 w3 cos(n*(phi1-phi2-phi3))>
11633 } // end of for(Int_t i3=0;i3<nPrim;i3++)
11634 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11635 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11636 } // end of if(nPrim>=3)
11637
57340a27 11638 /*
11639
489d5531 11640 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)
11641 {
11642 // 4 nested loops multiparticle correlations using particle weights:
11643 for(Int_t i1=0;i1<nPrim;i1++)
11644 {
11645 aftsTrack=anEvent->GetTrack(i1);
11646 if(!(aftsTrack->InRPSelection())) continue;
11647 phi1=aftsTrack->Phi();
11648 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
11649 for(Int_t i2=0;i2<nPrim;i2++)
11650 {
11651 if(i2==i1)continue;
11652 aftsTrack=anEvent->GetTrack(i2);
11653 if(!(aftsTrack->InRPSelection())) continue;
11654 phi2=aftsTrack->Phi();
11655 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
11656 for(Int_t i3=0;i3<nPrim;i3++)
11657 {
11658 if(i3==i1||i3==i2)continue;
11659 aftsTrack=anEvent->GetTrack(i3);
11660 if(!(aftsTrack->InRPSelection())) continue;
11661 phi3=aftsTrack->Phi();
11662 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
11663 for(Int_t i4=0;i4<nPrim;i4++)
11664 {
11665 if(i4==i1||i4==i2||i4==i3)continue;
11666 aftsTrack=anEvent->GetTrack(i4);
11667 if(!(aftsTrack->InRPSelection())) continue;
11668 phi4=aftsTrack->Phi();
11669 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
11670 if(nPrim>=4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush; // to be improved (replace eventually this if statement with if(nPrim==4))
11671 // 4-p correlations using particle weights:
11672 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(10.5,cos(n*phi1+n*phi2-n*phi3-n*phi4),wPhi1*wPhi2*wPhi3*wPhi4);
11673 // extra correlations:
11674 // 2-p extra correlations (do not appear if particle weights are not used):
11675 // ...
11676 // 3-p extra correlations (do not appear if particle weights are not used):
11677 // ...
11678 // 4-p extra correlations (do not appear if particle weights are not used):
11679 // ...
11680 } // end of for(Int_t i4=0;i4<nPrim;i4++)
11681 } // end of for(Int_t i3=0;i3<nPrim;i3++)
11682 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11683 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11684 } // end of if(nPrim>=4)
11685
11686 */
11687
11688 cout<<endl;
11689
11690} // end of void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent)
11691
11692
57340a27 11693//================================================================================================================================
489d5531 11694
11695
11696void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights(TString type, TString ptOrEta)
11697{
11698 // Calculate correction terms for non-uniform acceptance for differential flow (cos terms) using particle weights.
57340a27 11699
489d5531 11700 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][1][cti], where cti runs as follows:
57340a27 11701 //
489d5531 11702 // 0: <<cos n(psi)>>
11703 // 1: <<w2 cos n(psi1+phi2)>>
11704 // 2: <<w2 w3 cos n(psi1+phi2-phi3)>>
11705 // 3: <<w2 w3 cos n(psi1-phi2-phi3)>>
11706 // 4:
11707 // 5:
11708 // 6:
11709
11710 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
11711 Double_t dReQ1n1k = (*fReQ)(0,1);
11712 Double_t dReQ2n2k = (*fReQ)(1,2);
11713 //Double_t dReQ1n3k = (*fReQ)(0,3);
11714 //Double_t dReQ4n4k = (*fReQ)(3,4);
11715 Double_t dImQ1n1k = (*fImQ)(0,1);
11716 Double_t dImQ2n2k = (*fImQ)(1,2);
11717 //Double_t dImQ1n3k = (*fImQ)(0,3);
11718 //Double_t dImQ4n4k = (*fImQ)(3,4);
11719
11720 // S^M_{p,k} (see .h file for the definition of fSMpk):
11721 Double_t dSM1p1k = (*fSMpk)(0,1);
11722 Double_t dSM1p2k = (*fSMpk)(0,2);
11723 Double_t dSM2p1k = (*fSMpk)(1,1);
11724
11725 Int_t t = -1; // type flag
11726 Int_t pe = -1; // ptEta flag
11727
11728 if(type == "RP")
11729 {
11730 t = 0;
11731 } else if(type == "POI")
11732 {
11733 t = 1;
11734 }
11735
11736 if(ptOrEta == "Pt")
11737 {
11738 pe = 0;
11739 } else if(ptOrEta == "Eta")
11740 {
11741 pe = 1;
11742 }
11743
11744 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
11745 Double_t minPtEta[2] = {fPtMin,fEtaMin};
11746 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
11747 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
11748
11749 // looping over all bins and calculating correction terms:
11750 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
11751 {
11752 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
11753 Double_t p1n0kRe = 0.;
11754 Double_t p1n0kIm = 0.;
11755
11756 // number of POIs in particular pt or eta bin:
11757 Double_t mp = 0.;
11758
11759 // 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):
11760 Double_t q1n2kRe = 0.;
11761 Double_t q1n2kIm = 0.;
11762 Double_t q2n1kRe = 0.;
11763 Double_t q2n1kIm = 0.;
46b94261 11764
489d5531 11765 // s_{1,1}, s_{1,2} // to be improved (add explanation)
11766 Double_t s1p1k = 0.;
11767 Double_t s1p2k = 0.;
46b94261 11768
489d5531 11769 // number of particles which are both RPs and POIs in particular pt or eta bin:
46b94261 11770 Double_t mq = 0.;
489d5531 11771
11772 // M0111 from Eq. (118) in QC2c (to be improved (notation))
11773 Double_t dM01 = 0.;
11774 Double_t dM011 = 0.;
11775
11776 if(type == "POI")
11777 {
11778 // q_{m*n,k}:
11779 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))
11780 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));
11781 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))
11782 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b));
11783 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))
11784 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));
11785 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))
11786 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b));
11787 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 11788
489d5531 11789 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.);
11790 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.);
11791 }else if(type == "RP")
11792 {
11793 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
11794 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))
11795 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));
11796 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))
11797 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));
11798 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))
11799 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));
11800 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))
11801 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));
11802 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
11803 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.);
11804 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.);
3b552efe 11805 //s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.);
11806
489d5531 11807 mq = fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
11808 }
3b552efe 11809
489d5531 11810 if(type == "POI")
3b552efe 11811 {
11812 // p_{m*n,k}:
489d5531 11813 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
11814 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
11815 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
3b552efe 11816 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
11817 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 11818 // M01 from Eq. (118) in QC2c (to be improved (notation)):
3b552efe 11819 dM01 = mp*dSM1p1k-s1p1k;
11820 dM011 = mp*(dSM2p1k-dSM1p2k)
11821 - 2.*(s1p1k*dSM1p1k-s1p2k);
11822
11823 // typeFlag = RP (0) or POI (1):
11824 t = 1;
11825 } else if(type == "RP")
489d5531 11826 {
11827 // to be improved (cross-checked):
11828 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
11829 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
11830 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
11831 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
11832 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
11833 // M01 from Eq. (118) in QC2c (to be improved (notation)):
3b552efe 11834 dM01 = mp*dSM1p1k-s1p1k;
11835 dM011 = mp*(dSM2p1k-dSM1p2k)
11836 - 2.*(s1p1k*dSM1p1k-s1p2k);
489d5531 11837 // typeFlag = RP (0) or POI (1):
3b552efe 11838 t = 0;
11839 }
489d5531 11840
11841 // <<cos n(psi1)>>:
11842 Double_t cosP1nPsi = 0.;
11843 if(mp)
11844 {
11845 cosP1nPsi = p1n0kRe/mp;
11846
11847 // fill profile for <<cos n(psi1)>>:
11848 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi,mp);
11849 // histogram to store <cos n(psi1)> e-b-e (needed in some other methods):
11850 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][0]->SetBinContent(b,cosP1nPsi);
46b94261 11851 } // end of if(mp)
57340a27 11852
489d5531 11853 // <<w2 cos n(psi1+phi2)>>:
11854 Double_t cosP1nPsiP1nPhiW2 = 0.;
11855 if(dM01)
11856 {
11857 cosP1nPsiP1nPhiW2 = (p1n0kRe*dReQ1n1k-p1n0kIm*dImQ1n1k-q2n1kRe)/(dM01);
11858 // fill profile for <<w2 cos n(psi1+phi2)>>:
11859 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsiP1nPhiW2,dM01);
11860 // histogram to store <w2 cos n(psi1+phi2)> e-b-e (needed in some other methods):
11861 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][1]->SetBinContent(b,cosP1nPsiP1nPhiW2);
11862 } // end of if(dM01)
11863
11864 // <<w2 w3 cos n(psi1+phi2-phi3)>>:
11865 Double_t cosP1nPsi1P1nPhi2MPhi3W2W3 = 0.;
11866 if(dM011)
11867 {
46b94261 11868 cosP1nPsi1P1nPhi2MPhi3W2W3 = (p1n0kRe*(pow(dImQ1n1k,2.)+pow(dReQ1n1k,2.))
11869 - p1n0kRe*dSM1p2k
11870 - q2n1kRe*dReQ1n1k-q2n1kIm*dImQ1n1k
11871 - s1p1k*dReQ1n1k
11872 + 2.*q1n2kRe)
11873 / dM011;
489d5531 11874 // fill profile for <<w1 w2 w3 cos n(psi1+phi2)>>:
11875 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1P1nPhi2MPhi3W2W3,dM011);
11876 // histogram to store <w1 w2 w3 cos n(psi1+phi2)> e-b-e (needed in some other methods):
11877 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][2]->SetBinContent(b,cosP1nPsi1P1nPhi2MPhi3W2W3);
11878 } // end of if(dM011)
11879
11880 // <<w2 w3 cos n(psi1-phi2-phi3)>>:
11881 Double_t cosP1nPsi1M1nPhi2MPhi3W2W3 = 0.;
11882 if(dM011)
11883 {
11884 cosP1nPsi1M1nPhi2MPhi3W2W3 = (p1n0kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))+2.*p1n0kIm*dReQ1n1k*dImQ1n1k
11885 - 1.*(p1n0kRe*dReQ2n2k+p1n0kIm*dImQ2n2k)
46b94261 11886 - 2.*s1p1k*dReQ1n1k
489d5531 11887 + 2.*q1n2kRe)
11888 / dM011;
11889 // fill profile for <<w1 w2 w3 cos n(psi1+phi2)>>:
11890 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1M1nPhi2MPhi3W2W3,dM011);
11891 // histogram to store <w1 w2 w3 cos n(psi1+phi2)> e-b-e (needed in some other methods):
11892 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][3]->SetBinContent(b,cosP1nPsi1M1nPhi2MPhi3W2W3);
11893 } // end of if(dM011)
11894
11895 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
46b94261 11896
57340a27 11897} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights(TString type, TString ptOrEta)
11898
489d5531 11899
11900//================================================================================================================================
11901
11902
11903void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights(TString type, TString ptOrEta)
11904{
11905 // Calculate correction terms for non-uniform acceptance for differential flow (sin terms).
11906
11907 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][0][cti], where cti runs as follows:
11908 // 0: <<sin n(psi1)>>
11909 // 1: <<w2 sin n(psi1+phi2)>>
11910 // 2: <<w2 w3 sin n(psi1+phi2-phi3)>>
11911 // 3: <<w2 w3 sin n(psi1-phi2-phi3)>>:
11912 // 4:
11913 // 5:
11914 // 6:
11915
11916 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
11917 Double_t dReQ1n1k = (*fReQ)(0,1);
11918 Double_t dReQ2n2k = (*fReQ)(1,2);
11919 //Double_t dReQ1n3k = (*fReQ)(0,3);
11920 //Double_t dReQ4n4k = (*fReQ)(3,4);
11921 Double_t dImQ1n1k = (*fImQ)(0,1);
11922 Double_t dImQ2n2k = (*fImQ)(1,2);
11923 //Double_t dImQ1n3k = (*fImQ)(0,3);
11924 //Double_t dImQ4n4k = (*fImQ)(3,4);
11925
11926 // S^M_{p,k} (see .h file for the definition of fSMpk):
11927 Double_t dSM1p1k = (*fSMpk)(0,1);
11928 Double_t dSM1p2k = (*fSMpk)(0,2);
11929 Double_t dSM2p1k = (*fSMpk)(1,1);
11930
11931 Int_t t = -1; // type flag
11932 Int_t pe = -1; // ptEta flag
11933
11934 if(type == "RP")
11935 {
11936 t = 0;
11937 } else if(type == "POI")
11938 {
11939 t = 1;
11940 }
11941
11942 if(ptOrEta == "Pt")
11943 {
11944 pe = 0;
11945 } else if(ptOrEta == "Eta")
11946 {
11947 pe = 1;
11948 }
11949
11950 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
11951 Double_t minPtEta[2] = {fPtMin,fEtaMin};
11952 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
11953 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
11954
11955 // looping over all bins and calculating correction terms:
11956 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
11957 {
11958 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
11959 Double_t p1n0kRe = 0.;
11960 Double_t p1n0kIm = 0.;
11961
11962 // number of POIs in particular pt or eta bin:
11963 Double_t mp = 0.;
11964
11965 // 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):
11966 Double_t q1n2kRe = 0.;
11967 Double_t q1n2kIm = 0.;
11968 Double_t q2n1kRe = 0.;
11969 Double_t q2n1kIm = 0.;
46b94261 11970
489d5531 11971 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
11972 Double_t s1p1k = 0.;
11973 Double_t s1p2k = 0.;
46b94261 11974
489d5531 11975 // number of particles which are both RPs and POIs in particular pt or eta bin:
46b94261 11976 Double_t mq = 0.;
489d5531 11977
11978 // M0111 from Eq. (118) in QC2c (to be improved (notation))
11979 Double_t dM01 = 0.;
11980 Double_t dM011 = 0.;
11981
11982 if(type == "POI")
11983 {
11984 // q_{m*n,k}:
11985 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))
11986 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));
11987 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))
11988 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b));
11989 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))
11990 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));
11991 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))
11992 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b));
11993 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 11994
489d5531 11995 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.);
11996 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.);
11997 }else if(type == "RP")
11998 {
11999 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
12000 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))
12001 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));
12002 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))
12003 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));
12004 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))
12005 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));
12006 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))
12007 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));
12008 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
12009 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.);
12010 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.);
12011 //s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.);
3b552efe 12012 }
12013
12014 if(type == "POI")
12015 {
12016 // p_{m*n,k}:
489d5531 12017 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
12018 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
12019 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
3b552efe 12020 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
12021 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 12022 // M01 from Eq. (118) in QC2c (to be improved (notation)):
3b552efe 12023 dM01 = mp*dSM1p1k-s1p1k;
12024 dM011 = mp*(dSM2p1k-dSM1p2k)
12025 - 2.*(s1p1k*dSM1p1k-s1p2k);
12026 // typeFlag = RP (0) or POI (1):
12027 t = 1;
489d5531 12028 } else if(type == "RP")
3b552efe 12029 {
489d5531 12030 // to be improved (cross-checked):
12031 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
12032 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
12033 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
12034 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
12035 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
12036 // M01 from Eq. (118) in QC2c (to be improved (notation)):
3b552efe 12037 dM01 = mp*dSM1p1k-s1p1k;
12038 dM011 = mp*(dSM2p1k-dSM1p2k)
489d5531 12039 - 2.*(s1p1k*dSM1p1k-s1p2k);
12040 // typeFlag = RP (0) or POI (1):
3b552efe 12041 t = 0;
12042 }
12043
489d5531 12044 // <<sin n(psi1)>>:
12045 Double_t sinP1nPsi = 0.;
12046 if(mp)
12047 {
12048 sinP1nPsi = p1n0kIm/mp;
12049
12050 // fill profile for <<sin n(psi1)>>:
12051 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi,mp);
12052 // histogram to store <sin n(psi1)> e-b-e (needed in some other methods):
12053 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][0]->SetBinContent(b,sinP1nPsi);
46b94261 12054 } // end of if(mp)
12055
489d5531 12056 // <<w2 sin n(psi1+phi2)>>:
12057 Double_t sinP1nPsiP1nPhiW2 = 0.;
12058 if(dM01)
12059 {
12060 sinP1nPsiP1nPhiW2 = (p1n0kRe*dImQ1n1k+p1n0kIm*dReQ1n1k-q2n1kIm)/(dM01);
12061 // fill profile for <<w2 sin n(psi1+phi2)>>:
12062 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsiP1nPhiW2,dM01);
12063 // histogram to store <w2 sin n(psi1+phi2)> e-b-e (needed in some other methods):
12064 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][1]->SetBinContent(b,sinP1nPsiP1nPhiW2);
12065 } // end of if(mp*dMult-mq)
12066
12067 // <<w2 w3 sin n(psi1+phi2-phi3)>>:
12068 Double_t sinP1nPsi1P1nPhi2MPhi3W2W3 = 0.;
12069 if(dM011)
12070 {
46b94261 12071 sinP1nPsi1P1nPhi2MPhi3W2W3 = (p1n0kIm*(pow(dImQ1n1k,2.)+pow(dReQ1n1k,2.))
12072 - p1n0kIm*dSM1p2k
12073 + q2n1kRe*dImQ1n1k-q2n1kIm*dReQ1n1k
12074 - s1p1k*dImQ1n1k
12075 + 2.*q1n2kIm)
12076 / dM011;
489d5531 12077 // fill profile for <<w2 w3 sin n(psi1+phi2-phi3)>>:
12078 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1P1nPhi2MPhi3W2W3,dM011);
12079 // histogram to store <w2 w3 sin n(psi1+phi2-phi3)> e-b-e (needed in some other methods):
12080 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][2]->SetBinContent(b,sinP1nPsi1P1nPhi2MPhi3W2W3);
12081 } // end of if(dM011)
12082
12083 // <<w2 w3 sin n(psi1-phi2-phi3)>>:
12084 Double_t sinP1nPsi1M1nPhi2MPhi3W2W3 = 0.;
12085 if(dM011)
12086 {
12087 sinP1nPsi1M1nPhi2MPhi3W2W3 = (p1n0kIm*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))-2.*p1n0kRe*dReQ1n1k*dImQ1n1k
12088 + 1.*(p1n0kRe*dImQ2n2k-p1n0kIm*dReQ2n2k)
46b94261 12089 + 2.*s1p1k*dImQ1n1k
489d5531 12090 - 2.*q1n2kIm)
12091 / dM011;
12092 // fill profile for <<w2 w3 sin n(psi1-phi2-phi3)>>:
12093 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1M1nPhi2MPhi3W2W3,dM011);
12094 // histogram to store <w2 w3 sin n(psi1-phi2-phi3)> e-b-e (needed in some other methods):
12095 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][3]->SetBinContent(b,sinP1nPsi1M1nPhi2MPhi3W2W3);
12096 } // end of if(dM011)
12097
12098 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
12099
12100} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights(TString type, TString ptOrEta)
12101
12102
12103//================================================================================================================================
12104
12105
0328db2d 12106void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
489d5531 12107{
57340a27 12108 // Evaluate with nested loops correction terms for non-uniform acceptance
489d5531 12109 // with using particle weights (both sin and cos terms) relevant for differential flow.
12110
57340a27 12111 // Remark 1: "w1" in expressions bellow is a particle weight used only for particles which were
12112 // flagged both as POI and RP.
489d5531 12113 // Remark 2: Reduced correction terms for non-uniform acceptance are evaluated in pt bin number fCrossCheckInPtBinNo
12114 // and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
12115 // Remark 3: Results are stored in 1 bin profiles fDiffFlowDirectCorrections[t][pe][sc][cti], where first three indices runs as:
12116 // [0=RP,1=POI][0=Pt,1=Eta][0=sin terms,1=cos terms], whilst the cti (correction term index) runs as follows:
12117 // cti:
12118 // 0: <<sc n(psi1)>>
12119 // 1: <<w2 sc n(psi1+phi2)>>
12120 // 2: <<w2 w3 sc n(psi1+phi2-phi3)>>
12121 // 3: <<w2 w3 sc n(psi1-phi2-phi3)>>
12122 // 4:
12123 // 5:
12124 // 6:
46b94261 12125
489d5531 12126 Int_t typeFlag = -1;
12127 Int_t ptEtaFlag = -1;
12128 if(type == "RP")
12129 {
12130 typeFlag = 0;
12131 } else if(type == "POI")
12132 {
12133 typeFlag = 1;
12134 }
12135 if(ptOrEta == "Pt")
12136 {
12137 ptEtaFlag = 0;
12138 } else if(ptOrEta == "Eta")
12139 {
12140 ptEtaFlag = 1;
12141 }
12142 // shortcuts:
12143 Int_t t = typeFlag;
12144 Int_t pe = ptEtaFlag;
12145
12146 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
12147 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
12148 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
12149
12150 Int_t nPrim = anEvent->NumberOfTracks();
12151 AliFlowTrackSimple *aftsTrack = NULL;
12152
12153 Double_t psi1=0., phi2=0., phi3=0.;// phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
12154 Double_t wPhi2=1., wPhi3=1.;
12155
12156 Int_t n = fHarmonic;
12157
12158 // 1'-particle correction terms:
12159 for(Int_t i1=0;i1<nPrim;i1++)
12160 {
12161 aftsTrack=anEvent->GetTrack(i1);
3b552efe 12162 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12163 if(typeFlag==1) // this is diff flow of POIs
489d5531 12164 {
12165 if(ptOrEta == "Pt")
12166 {
12167 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12168 } else if (ptOrEta == "Eta")
12169 {
12170 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 12171 }
12172 } else // this is diff flow of RPs
12173 {
489d5531 12174 if(ptOrEta == "Pt")
12175 {
12176 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12177 } else if (ptOrEta == "Eta")
12178 {
12179 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 12180 }
489d5531 12181 }
12182 psi1=aftsTrack->Phi();
12183 // sin terms:
12184 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*psi1),1.); // <<sin(n*(psi1))>>
12185 // cos terms:
12186 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*psi1),1.); // <<cos(n*(psi1))>>
12187 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12188
12189 // 2'-particle correction terms:
12190 for(Int_t i1=0;i1<nPrim;i1++)
12191 {
12192 aftsTrack=anEvent->GetTrack(i1);
3b552efe 12193 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12194 if(typeFlag==1) // this is diff flow of POIs
489d5531 12195 {
12196 if(ptOrEta == "Pt")
12197 {
12198 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12199 } else if (ptOrEta == "Eta")
12200 {
12201 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 12202 }
12203 } else // this is diff flow of RPs
12204 {
489d5531 12205 if(ptOrEta == "Pt")
12206 {
12207 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12208 } else if (ptOrEta == "Eta")
12209 {
12210 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 12211 }
489d5531 12212 }
12213 psi1=aftsTrack->Phi();
12214 for(Int_t i2=0;i2<nPrim;i2++)
12215 {
12216 if(i2==i1) continue;
12217 aftsTrack=anEvent->GetTrack(i2);
12218 // RP condition (!(first) particle in the correlator must be RP):
12219 if(!(aftsTrack->InRPSelection())) continue;
46b94261 12220 phi2=aftsTrack->Phi();
489d5531 12221 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
12222 // sin terms:
12223 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2)),wPhi2); // <<w2 sin(n*(psi1+phi2))>>
12224 // cos terms:
12225 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2)),wPhi2); // <<w2 cos(n*(psi1+phi2))>>
12226 }//end of for(Int_t i2=0;i2<nPrim;i2++)
12227 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12228
12229 // 3'-particle correction terms:
12230 for(Int_t i1=0;i1<nPrim;i1++)
12231 {
12232 aftsTrack=anEvent->GetTrack(i1);
3b552efe 12233 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12234 if(typeFlag==1) // this is diff flow of POIs
489d5531 12235 {
12236 if(ptOrEta == "Pt")
12237 {
12238 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12239 } else if (ptOrEta == "Eta")
12240 {
12241 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
3b552efe 12242 }
12243 } else // this is diff flow of RPs
12244 {
489d5531 12245 if(ptOrEta == "Pt")
12246 {
12247 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12248 } else if (ptOrEta == "Eta")
12249 {
12250 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
3b552efe 12251 }
489d5531 12252 }
12253 psi1=aftsTrack->Phi();
12254 for(Int_t i2=0;i2<nPrim;i2++)
12255 {
12256 if(i2==i1) continue;
12257 aftsTrack=anEvent->GetTrack(i2);
12258 // RP condition (!(first) particle in the correlator must be RP):
12259 if(!(aftsTrack->InRPSelection())) continue;
12260 phi2=aftsTrack->Phi();
12261 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
12262 for(Int_t i3=0;i3<nPrim;i3++)
12263 {
12264 if(i3==i1||i3==i2) continue;
12265 aftsTrack=anEvent->GetTrack(i3);
12266 // RP condition (!(first) particle in the correlator must be RP):
12267 if(!(aftsTrack->InRPSelection())) continue;
12268 phi3=aftsTrack->Phi();
12269 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
12270 // sin terms:
12271 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))>>
12272 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))>>
12273 // cos terms:
12274 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))>>
12275 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))>>
12276 }//end of for(Int_t i3=0;i3<nPrim;i3++)
12277 }//end of for(Int_t i2=0;i2<nPrim;i2++)
46b94261 12278 }//end of for(Int_t i1=0;i1<nPrim;i1++)
489d5531 12279
12280} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
12281
12282
57340a27 12283
12284
12285