]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithQCumulants.cxx
small correction for error calculation
[u/mrichter/AliRoot.git] / PWG2 / FLOW / AliFlowCommon / AliFlowAnalysisWithQCumulants.cxx
CommitLineData
bc92c0cb 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 * *
19 * author: Ante Bilandzic *
20 * (anteb@nikhef.nl) *
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#include "TFile.h"
1315fe58 31#include "TList.h"
e085f1a9 32#include "TGraph.h"
bc92c0cb 33#include "TParticle.h"
34#include "TRandom3.h"
1315fe58 35#include "TStyle.h"
bc92c0cb 36#include "TProfile.h"
37#include "TProfile2D.h"
38#include "TProfile3D.h"
1dfa3c16 39#include "TMath.h"
e085f1a9 40#include "TArrow.h"
41#include "TPaveLabel.h"
42#include "TCanvas.h"
bc92c0cb 43#include "AliFlowEventSimple.h"
44#include "AliFlowTrackSimple.h"
45#include "AliFlowAnalysisWithQCumulants.h"
3d824203 46#include "TArrayD.h"
bc92c0cb 47#include "TRandom.h"
2bdc5281 48#include "TF1.h"
bc92c0cb 49
50class TH1;
9c1a9547 51class TH2;
bc92c0cb 52class TGraph;
53class TPave;
54class TLatex;
55class TMarker;
56class TRandom3;
57class TObjArray;
58class TList;
59class TCanvas;
60class TSystem;
61class TROOT;
62class AliFlowVector;
63class TVector;
64
2aa4ebcd 65
bc92c0cb 66//================================================================================================================
67
2aa4ebcd 68
bc92c0cb 69ClassImp(AliFlowAnalysisWithQCumulants)
70
2aa4ebcd 71AliFlowAnalysisWithQCumulants::AliFlowAnalysisWithQCumulants():
72 // 0.) base:
bc92c0cb 73 fHistList(NULL),
2aa4ebcd 74 // 1.) common:
75 fCommonHists(NULL),
76 fCommonHists2nd(NULL),
cb308e83 77 fCommonHists4th(NULL),
78 fCommonHists6th(NULL),
79 fCommonHists8th(NULL),
8842fb2b 80 fCommonHistsResults2nd(NULL),
81 fCommonHistsResults4th(NULL),
82 fCommonHistsResults6th(NULL),
83 fCommonHistsResults8th(NULL),
2aa4ebcd 84 fnBinsPhi(0),
85 fPhiMin(0),
86 fPhiMax(0),
87 fPhiBinWidth(0),
8842fb2b 88 fnBinsPt(0),
89 fPtMin(0),
1dfa3c16 90 fPtMax(0),
2aa4ebcd 91 fPtBinWidth(0),
1dfa3c16 92 fnBinsEta(0),
93 fEtaMin(0),
e085f1a9 94 fEtaMax(0),
2aa4ebcd 95 fEtaBinWidth(0),
96 fHarmonic(2),
97 // 2.) weights:
98 fWeightsList(NULL),
e085f1a9 99 fUsePhiWeights(kFALSE),
100 fUsePtWeights(kFALSE),
9c1a9547 101 fUseEtaWeights(kFALSE),
2aa4ebcd 102 fUseParticleWeights(NULL),
103 fPhiWeights(NULL),
104 fPtWeights(NULL),
105 fEtaWeights(NULL),
106 // 3.) integrated flow:
107 fIntFlowList(NULL),
108 fIntFlowProfiles(NULL),
109 fIntFlowResults(NULL),
9c1a9547 110 fReQ(NULL),
111 fImQ(NULL),
112 fSMpk(NULL),
2aa4ebcd 113 fAvMultiplicity(NULL),
114 // 4.) differential flow:
115 fDiffFlowList(NULL),
116 fDiffFlowProfiles(NULL),
117 fDiffFlowResults(NULL),
118 // 5.) distributions:
119 fDistributionsList(NULL),
120 // x.) debugging and cross-checking:
121 fNestedLoopsList(NULL),
122 fEvaluateNestedLoopsForIntFlow(kFALSE),
123 fEvaluateNestedLoopsForDiffFlow(kFALSE),
124 fEvaluateNestedLoops(NULL),
125 fDirectCorrelations(NULL),
126 fDirectCorrectionsCos(NULL),
127 fDirectCorrectionsSin(NULL),
128 fDirectCorrelationsDiffFlow(NULL),
129 fDirectCorrectionsDiffFlowCos(NULL),
130 fDirectCorrectionsDiffFlowSin(NULL),
131 fDirectCorrelationsW(NULL),
132 fDirectCorrectionsCosW(NULL),
133 fDirectCorrectionsSinW(NULL),
134 fDirectCorrelationsDiffFlowW(NULL),
135 fDirectCorrectionsDiffFlowCosW(NULL),
136 fDirectCorrectionsDiffFlowSinW(NULL)
137 {
138 // constructor
9c1a9547 139
2aa4ebcd 140 // base list to hold all output objects:
141 fHistList = new TList();
142 fHistList->SetName("cobjQC");
143 fHistList->SetOwner(kTRUE);
9c1a9547 144
2aa4ebcd 145 // list to hold histograms with phi, pt and eta weights:
146 fWeightsList = new TList();
147 fWeightsList->SetName("Weights");
148 fWeightsList->SetOwner(kTRUE);
149
150 // initialize all arrays:
151 this->InitializeArraysForIntFlow();
152 this->InitializeArraysForDiffFlow();
153 this->InitializeArraysForDistributions();
03a02aca 154
2aa4ebcd 155 } // end of constructor
8842fb2b 156
2aa4ebcd 157
158//================================================================================================================
159
bc92c0cb 160
161AliFlowAnalysisWithQCumulants::~AliFlowAnalysisWithQCumulants()
162{
2aa4ebcd 163 // destructor
164
165 delete fHistList;
166
167} // end of AliFlowAnalysisWithQCumulants::~AliFlowAnalysisWithQCumulants()
168
bc92c0cb 169
170//================================================================================================================
171
2aa4ebcd 172
e085f1a9 173void AliFlowAnalysisWithQCumulants::Init()
bc92c0cb 174{
2aa4ebcd 175 // initialize all constants and book everything
ae733b3b 176
2aa4ebcd 177 // access constants:
178 this->AccessConstants();
ae733b3b 179
2aa4ebcd 180 // booking:
181 this->BookAndNestAllLists();
182 this->BookCommonHistograms();
183 this->BookAndFillWeightsHistograms();
184 this->BookEverythingForIntegratedFlow();
185 this->BookEverythingForDifferentialFlow();
186 this->BookEverythingForDistributions();
187 this->BookEverythingForNestedLoops();
5e838eeb 188
2aa4ebcd 189 // set harmonic in common control histograms (to be improved (should I do this somewhere else?)):
190 (fCommonHists->GetHarmonic())->Fill(0.5,fHarmonic);
191 (fCommonHists2nd->GetHarmonic())->Fill(0.5,fHarmonic);
192 (fCommonHists4th->GetHarmonic())->Fill(0.5,fHarmonic);
193 (fCommonHists6th->GetHarmonic())->Fill(0.5,fHarmonic);
194 (fCommonHists8th->GetHarmonic())->Fill(0.5,fHarmonic);
9c1a9547 195
2aa4ebcd 196} // end of void AliFlowAnalysisWithQCumulants::Init()
3d824203 197
9c1a9547 198
199//================================================================================================================
200
201
202void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
203{
204 // running over data only in this method
205
2aa4ebcd 206 // a) fill the common control histograms and call method to fill fAvMultiplicity;
207 // b) loop over data to calculate e-b-e quantities;
208 // c) call the methods;
209 // d) debugging and cross-checking (evaluate nested loops);
210 // e) reset e-b-e quantities.
9c1a9547 211
2aa4ebcd 212 Double_t dPhi = 0.; // azimuthal angle in the laboratory frame
9c1a9547 213 Double_t dPt = 0.; // transverse momentum
214 Double_t dEta = 0.; // pseudorapidity
215
3d824203 216 Double_t wPhi = 1.; // phi weight
217 Double_t wPt = 1.; // pt weight
218 Double_t wEta = 1.; // eta weight
2aa4ebcd 219
220 // ********************************************
221 // **** FILL THE COMMON CONTROL HISTOGRAMS ****
222 // ********************************************
9c1a9547 223
2aa4ebcd 224 Int_t nRP = anEvent->GetEventNSelTracksRP(); // number of RPs (i.e. number of particles used to determine the reaction plane)
225
226 fCommonHists->FillControlHistograms(anEvent);
227
9c1a9547 228 if(nRP>1)
229 {
230 fCommonHists2nd->FillControlHistograms(anEvent);
231 if(nRP>3)
232 {
233 fCommonHists4th->FillControlHistograms(anEvent);
234 if(nRP>5)
3d824203 235 {
9c1a9547 236 fCommonHists6th->FillControlHistograms(anEvent);
237 if(nRP>7)
3d824203 238 {
9c1a9547 239 fCommonHists8th->FillControlHistograms(anEvent);
240 } // end of if(nRP>7)
241 } // end of if(nRP>5)
242 } // end of if(nRP>3)
243 } // end of if(nRP>1)
2aa4ebcd 244
245 this->FillAverageMultiplicities(nRP);
246
247 // *******************************************************
248 // **** LOOP OVER DATA AND CALCULATE E-B-E QUANTITIES ****
249 // *******************************************************
3d824203 250
2aa4ebcd 251 Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = total number of primary tracks, i.e. nPrim = nRP + nPOI + rest, where:
252 // nRP = # of particles used to determine the reaction plane;
253 // nPOI = # of particles of interest for a detailed flow analysis;
254 // rest = # of particles which are not niether RPs nor POIs.
3d824203 255
2aa4ebcd 256 AliFlowTrackSimple *aftsTrack = NULL;
3d824203 257
9c1a9547 258 for(Int_t i=0;i<nPrim;i++)
3d824203 259 {
2aa4ebcd 260 aftsTrack=anEvent->GetTrack(i);
261 if(aftsTrack)
77515452 262 {
2aa4ebcd 263 if(!(aftsTrack->InRPSelection() || aftsTrack->InPOISelection())) continue; // consider only tracks which are RPs or POIs
264
265 Int_t n = fHarmonic; // shortcut for the harmonic
9c1a9547 266
2aa4ebcd 267 if(aftsTrack->InRPSelection()) // RP condition:
9c1a9547 268 {
2aa4ebcd 269 dPhi = aftsTrack->Phi();
270 dPt = aftsTrack->Pt();
271 dEta = aftsTrack->Eta();
9c1a9547 272
2aa4ebcd 273 if(fUsePhiWeights && fPhiWeights && fnBinsPhi) // determine phi weight for this particle:
3d824203 274 {
2aa4ebcd 275 wPhi = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*fnBinsPhi/TMath::TwoPi())));
9c1a9547 276 }
2aa4ebcd 277 if(fUsePtWeights && fPtWeights && fnBinsPt) // determine pt weight for this particle:
9c1a9547 278 {
2aa4ebcd 279 wPt = fPtWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/fPtBinWidth)));
9c1a9547 280 }
2aa4ebcd 281 if(fUseEtaWeights && fEtaWeights && fEtaBinWidth) // determine eta weight for this particle:
9c1a9547 282 {
2aa4ebcd 283 wEta = fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/fEtaBinWidth)));
9c1a9547 284 }
2aa4ebcd 285
286 // integrated flow:
287 // calculate Re[Q_{m*n,k}] and Im[Q_{m*n,k}], m = 1,2,3,4, for this event:
288 for(Int_t m=0;m<4;m++)
9c1a9547 289 {
290 for(Int_t k=0;k<9;k++)
77515452 291 {
2aa4ebcd 292 (*fReQ)(m,k)+=pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1)*n*dPhi);
293 (*fImQ)(m,k)+=pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1)*n*dPhi);
77515452 294 }
9c1a9547 295 }
2aa4ebcd 296 // calculate S^{M}_{p,k} for this event
297 // Remark: final calculation of S^{M}_{p,k} follows after the loop over data bellow:
9c1a9547 298 for(Int_t p=0;p<8;p++)
299 {
300 for(Int_t k=0;k<9;k++)
301 {
302 (*fSMpk)(p,k)+=pow(wPhi*wPt*wEta,k);
77515452 303 }
9c1a9547 304 }
2aa4ebcd 305
306 // differential flow:
307 // (r_{m*m,k}(pt,eta)):
308 for(Int_t m=0;m<4;m++)
3d824203 309 {
2aa4ebcd 310 for(Int_t k=0;k<9;k++)
311 {
312 fReEBE[0][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
313 fImEBE[0][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
314 }
315 }
316 // s_{k}(pt,eta) for RPs // to be improved (clarified)
317 // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:
318 for(Int_t k=0;k<9;k++)
319 {
320 fs[0][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k),1.);
9c1a9547 321 }
9c1a9547 322
2aa4ebcd 323 if(aftsTrack->InPOISelection())
324 {
325 // (q_{m*m,k}(pt,eta)):
326 for(Int_t m=0;m<4;m++)
9c1a9547 327 {
2aa4ebcd 328 for(Int_t k=0;k<9;k++)
329 {
330 fReEBE[2][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
331 fImEBE[2][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
332 }
333 }
334 // s_{k}(pt,eta) for RP&&POIs // to be improved (clarified)
335 // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:
336 for(Int_t k=0;k<9;k++)
337 {
338 fs[2][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k),1.);
339 }
340
341 } // end of if(aftsTrack->InPOISelection())
9c1a9547 342 } // end of if(pTrack->InRPSelection())
2aa4ebcd 343
344 if(aftsTrack->InPOISelection())
9c1a9547 345 {
2aa4ebcd 346 dPhi = aftsTrack->Phi();
347 dPt = aftsTrack->Pt();
348 dEta = aftsTrack->Eta();
349
350 // p_n(m*n,0):
351 for(Int_t m=0;m<4;m++)
352 {
353 fReEBE[1][m][0]->Fill(dPt,dEta,TMath::Cos((m+1.)*n*dPhi),1.);
354 fImEBE[1][m][0]->Fill(dPt,dEta,TMath::Sin((m+1.)*n*dPhi),1.);
355 }
9c1a9547 356
2aa4ebcd 357 } // end of if(pTrack->InPOISelection() )
358
359 } else // to if(aftsTrack)
360 {
361 cout<<endl;
362 cout<<" WARNING: no particle! (i.e. aftsTrack is a NULL pointer in AFAWQC::Make().)"<<endl;
363 cout<<endl;
364 }
9c1a9547 365 } // end of for(Int_t i=0;i<nPrim;i++)
2aa4ebcd 366
367 // calculate the final expressions for S^{M}_{p,k}:
9c1a9547 368 for(Int_t p=0;p<8;p++)
369 {
370 for(Int_t k=0;k<9;k++)
77515452 371 {
9c1a9547 372 (*fSMpk)(p,k)=pow((*fSMpk)(p,k),p+1);
373 }
374 }
77515452 375
2aa4ebcd 376 // *****************************
377 // **** CALL THE METHODS *******
378 // *****************************
77515452 379
2aa4ebcd 380 if(!fEvaluateNestedLoopsForIntFlow)
9c1a9547 381 {
2aa4ebcd 382 // without weights:
383 if(nRP>1) this->CalculateCorrelationsForIntegratedFlow();
384 if(nRP>0) this->CalculateCorrectionsForNonUniformAcceptanceForIntFlowCosTerms();
385 if(nRP>0) this->CalculateCorrectionsForNonUniformAcceptanceForIntFlowSinTerms();
386 if(nRP>3) this->CalculateQProductsForIntFlow();
c2a42ea2 387 if(nRP>1) this->CalculateSumAndProductOfEventWeights();
2aa4ebcd 388 // with weights:
389 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
c365fe76 390 {
2aa4ebcd 391 if(nRP>1) this->CalculateWeightedCorrelationsForIntegratedFlow();
392 if(nRP>3) this->CalculateWeightedQProductsForIntFlow();
393 }
9c1a9547 394 }
77515452 395
2aa4ebcd 396 if(!fEvaluateNestedLoopsForDiffFlow)
9c1a9547 397 {
2aa4ebcd 398 // without weights:
399 if(nRP>1) this->CalculateCorrelationsForDifferentialFlow("RP");
400 if(nRP>1) this->CalculateCorrelationsForDifferentialFlow("POI");
401
402 // with weights:
403 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
77515452 404 {
2aa4ebcd 405 if(nRP>1) this->CalculateWeightedCorrelationsForDifferentialFlow("RP");
406 if(nRP>1) this->CalculateWeightedCorrelationsForDifferentialFlow("POI");
9c1a9547 407 }
408 }
2aa4ebcd 409
410 // **************************************************************
411 // **** DEBUGGING AND CROSS-CHECKING (EVALUATE NESTED LOOPS) ****
412 // **************************************************************
413
414 if(fEvaluateNestedLoopsForIntFlow)
415 {
416 if(nPrim>0 && nPrim<15) // only for these multiplicities it is feasible to evaluate 8 nested loops in short time
77515452 417 {
2aa4ebcd 418 // without weights:
419 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
420 {
421 this->CalculateCorrelationsForIntegratedFlow();
422 this->CalculateCorrectionsForNonUniformAcceptanceForIntFlowCosTerms();
423 this->CalculateCorrectionsForNonUniformAcceptanceForIntFlowSinTerms();
424 }
425 // with weights:
426 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
427 {
428 this->CalculateWeightedCorrelationsForIntegratedFlow();
429 }
430
431 this->EvaluateNestedLoopsForIntegratedFlow(anEvent);
77515452 432 }
9c1a9547 433 }
77515452 434
2aa4ebcd 435 if(fEvaluateNestedLoopsForDiffFlow)
9c1a9547 436 {
2aa4ebcd 437 if(nPrim>0 && nPrim<15) // only for these multiplicities it is feasible to evaluate 8 nested loops in short time
438 {
439 // without weights:
440 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
441 {
442 this->CalculateCorrelationsForDifferentialFlow("RP");
443 this->CalculateCorrelationsForDifferentialFlow("POI");
444 }
445 // with weights:
446 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
447 {
448 this->CalculateWeightedCorrelationsForDifferentialFlow("RP");
449 this->CalculateWeightedCorrelationsForDifferentialFlow("POI");
450 }
451
452 this->EvaluateNestedLoopsForDifferentialFlow(anEvent);
453 }
454 }
9c1a9547 455
2aa4ebcd 456 // ********************************
457 // **** RESET E-B-E QUANTITIES ****
458 // ********************************
9c1a9547 459
2aa4ebcd 460 // integrated flow:
9c1a9547 461 fReQ->Zero();
462 fImQ->Zero();
463 fSMpk->Zero();
2aa4ebcd 464 for(Int_t pW=0;pW<1+(Int_t)(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);pW++)
465 {
466 fQCorrelationsEBE[pW]->Reset();
467 for(Int_t sc=0;sc<2;sc++)
468 {
469 fQCorrectionsEBE[pW][sc]->Reset();
470 }
471 }
472
473 // differential flow:
474 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
475 {
476 for(Int_t m=0;m<4;m++) // multiple of harmonic
477 {
478 for(Int_t k=0;k<9;k++) // power of weight
479 {
480 if(fReEBE[t][m][k]) fReEBE[t][m][k]->Reset();
481 if(fImEBE[t][m][k]) fImEBE[t][m][k]->Reset();
482 }
483 }
484 }
485
486 for(Int_t t=0;t<3;t++) // type (0 = RP, 1 = POI, 2 = RP&&POI )
487 {
488 for(Int_t k=0;k<9;k++)
489 {
490 if(fs[t][k]) fs[t][k]->Reset();
491 }
492 }
9c1a9547 493
494} // end of AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
495
496
497//================================================================================================================================
498
499
2aa4ebcd 500void AliFlowAnalysisWithQCumulants::Finish()
501{
502 // calculate the final results
503
504 // a) acces the constants;
505 // b) access the flags;
506 // c) calculate the final results for integrated flow (without and with weights);
507 // d) store in AliFlowCommonHistResults and print the final results for integrated flow;
508 // e) calculate the final results for differential flow (without and with weights);
509 // f) print the final results for integrated flow obtained from differential flow (to be improved (terminology));
510 // g) COMPARE RESULTS FROM NESTED LOOPS vs RESULTS FROM Q-VECTORS FOR INTEGRATED FLOW
511
512 // ******************************
513 // **** ACCESS THE CONSTANTS ****
514 // ******************************
515
516 this->AccessConstants();
517
518 // **************************
519 // **** ACCESS THE FLAGS ****
520 // **************************
521
522 fUsePhiWeights = (Int_t)fUseParticleWeights->GetBinContent(1);
523 fUsePtWeights = (Int_t)fUseParticleWeights->GetBinContent(2);
524 fUseEtaWeights = (Int_t)fUseParticleWeights->GetBinContent(3);
525 fEvaluateNestedLoopsForIntFlow = (Int_t)fEvaluateNestedLoops->GetBinContent(1);
526 fEvaluateNestedLoopsForDiffFlow = (Int_t)fEvaluateNestedLoops->GetBinContent(2);
527
528 // *********************************************************
529 // **** CALCULATE THE FINAL RESULTS FOR INTEGRATED FLOW ****
530 // *********************************************************
531
532 // without weights:
533 this->FinalizeCorrelationsForIntFlow(kFALSE,"exact");
534 this->CalculateFinalCorrectionsForNonUniformAcceptanceForCumulantsForIntFlow(kFALSE,"exact");
535 this->CalculateCovariancesForIntFlow(kFALSE,"exact");
536 this->CalculateCumulantsForIntFlow(kFALSE,"exact");
537 this->ApplyCorrectionForNonUniformAcceptanceToCumulantsForIntFlow(kFALSE,"exact");
538 this->CalculateIntFlow(kFALSE,"exact",kFALSE); // pW = 0, eW = 0, not corrected for non-uniform acceptance
539 this->CalculateIntFlow(kFALSE,"exact",kTRUE); // pW = 0, eW = 0, corrected for non-uniform acceptance
540
541 // with weights:
542 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
543 {
544 this->FinalizeCorrelationsForIntFlow(kTRUE,"exact");
545 // this->CalculateFinalCorrectionsForNonUniformAcceptanceForCumulantsForIntFlow(kTRUE,"exact");
546 this->CalculateCovariancesForIntFlow(kTRUE,"exact");
547 this->CalculateCumulantsForIntFlow(kTRUE,"exact");
548 // this->ApplyCorrectionForNonUniformAcceptanceToCumulantsForIntFlow(kTRUE,"exact");
549 this->CalculateIntFlow(kTRUE,"exact",kFALSE); // weighted and not corrected for non-uniform acceptance
550 // this->CalculateIntFlow(kTRUE,"exact",kTRUE); // weighted and corrected for non-uniform acceptance
551 }
552
553 // ***************************************************************
554 // **** STORE AND PRINT THE FINAL RESULTS FOR INTEGRATED FLOW ****
555 // ***************************************************************
556
557 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
558 {
559 this->FillCommonHistResultsIntFlow(kTRUE,"exact",kFALSE); // weighted and not corrected for non-uniform acceptance
560 // this->FillCommonHistResultsIntFlow(kTRUE,kTRUE); // weighted and corrected for non-uniform acceptance (to be improved (enabled))
561 // this->PrintQuantifyingCorrectionsForNonUniformAcceptance(kTRUE,"exact"); // (to be improved (enabled))
562 } else
563 {
564 this->FillCommonHistResultsIntFlow(kFALSE,"exact",kTRUE); // non-weighted and corrected for non-uniform acceptance
565 this->PrintQuantifyingCorrectionsForNonUniformAcceptance(kFALSE,"exact");
566 }
567
568 this->PrintFinalResultsForIntegratedFlow("NONAME"); // to be improved (name)
569
570 // ***********************************************************
571 // **** CALCULATE THE FINAL RESULTS FOR DIFFERENTIAL FLOW ****
572 // ***********************************************************
573
574 // without weights:
575 this->FinalizeCorrelationsForDiffFlow("RP",kFALSE,"exact");
576 this->FinalizeCorrelationsForDiffFlow("POI",kFALSE,"exact");
577 this->CalculateCumulantsForDiffFlow("RP",kFALSE,"exact");
578 this->CalculateCumulantsForDiffFlow("POI",kFALSE,"exact");
579 this->CalculateDiffFlow("RP",kFALSE,"exact");
580 this->CalculateDiffFlow("POI",kFALSE,"exact");
581 this->CalculateFinalResultsForRPandPOIIntegratedFlow("RP",kFALSE,"exact");
582 this->CalculateFinalResultsForRPandPOIIntegratedFlow("POI",kFALSE,"exact");
583
584 // with weights:
585 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
586 {
587 this->FinalizeCorrelationsForDiffFlow("RP",kTRUE,"exact");
588 this->FinalizeCorrelationsForDiffFlow("POI",kTRUE,"exact");
589 this->CalculateCumulantsForDiffFlow("RP",kTRUE,"exact");
590 this->CalculateCumulantsForDiffFlow("POI",kTRUE,"exact");
591 this->CalculateDiffFlow("RP",kTRUE,"exact");
592 this->CalculateDiffFlow("POI",kTRUE,"exact");
593 this->CalculateFinalResultsForRPandPOIIntegratedFlow("RP",kTRUE,"exact");
594 this->CalculateFinalResultsForRPandPOIIntegratedFlow("POI",kTRUE,"exact");
595 }
596
597
598 //this->CalculateFinalCorrectionsForNonUniformAcceptanceForDifferentialFlow(kFALSE,"POI"); // to be improved (to calculate also when weights are used)
599 //this->CalculateFinalCorrectionsForNonUniformAcceptanceForDifferentialFlow(kFALSE,"RP"); // to be improved (to calculate also when weights are used)
600
601
602 // *****************************************************************
603 // **** STORE AND PRINT THE FINAL RESULTS FOR DIFFERENTIAL FLOW ****
604 // *****************************************************************
605 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
606 {
607 this->FillCommonHistResultsDiffFlow("RP",kTRUE,"exact",kFALSE);
608 this->FillCommonHistResultsDiffFlow("POI",kTRUE,"exact",kFALSE);
609 } else
610 {
611 this->FillCommonHistResultsDiffFlow("RP",kFALSE,"exact",kFALSE);
612 this->FillCommonHistResultsDiffFlow("POI",kFALSE,"exact",kFALSE);
613 }
614
615 this->PrintFinalResultsForIntegratedFlow("RP");
616 this->PrintFinalResultsForIntegratedFlow("POI");
617
618 // *****************************************************************************************
619 // **** COMPARE RESULTS FROM NESTED LOOPS vs RESULTS FROM Q-VECTORS FOR INTEGRATED FLOW ****
620 // *****************************************************************************************
621
622 if(fEvaluateNestedLoopsForIntFlow)
623 {
624 this->CompareResultsFromNestedLoopsAndFromQVectorsForIntFlow(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);
625 }
626
627 if(fEvaluateNestedLoopsForDiffFlow)
628 {
629 this->CompareResultsFromNestedLoopsAndFromQVectorsForDiffFlow(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);
630 }
631
632} // end of AliFlowAnalysisWithQCumulants::Finish()
633
634
635//================================================================================================================================
636
637
638void AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNonUniformAcceptanceForIntFlowCosTerms()
9c1a9547 639{
2aa4ebcd 640 // calculate corrections for non-uniform acceptance of the detector for no-name integrated flow (cos terms)
9c1a9547 641
642 // multiplicity:
643 Double_t dMult = (*fSMpk)(0,0);
644
645 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
646 Double_t dReQ1n = (*fReQ)(0,0);
647 Double_t dReQ2n = (*fReQ)(1,0);
2aa4ebcd 648 //Double_t dReQ3n = (*fReQ)(2,0);
649 //Double_t dReQ4n = (*fReQ)(3,0);
9c1a9547 650 Double_t dImQ1n = (*fImQ)(0,0);
651 Double_t dImQ2n = (*fImQ)(1,0);
2aa4ebcd 652 //Double_t dImQ3n = (*fImQ)(2,0);
653 //Double_t dImQ4n = (*fImQ)(3,0);
654
655 // *************************************************************
656 // **** corrections for non-uniform acceptance (cos terms): ****
657 // *************************************************************
658 //
659 // Remark 1: corrections for non-uniform acceptance (cos terms) calculated with non-weighted Q-vectors
660 // are stored in 1D profile fQCorrectionsCos.
661 // Remark 2: binning of fQCorrectionsCos is organized as follows:
662 // --------------------------------------------------------------------------------------------------------------------
663 // 1st bin: <<cos(n*(phi1))>> = cosP1n
664 // 2nd bin: <<cos(n*(phi1+phi2))>> = cosP1nP1n
665 // 3rd bin: <<cos(n*(phi1-phi2-phi3))>> = cosP1nM1nM1n
666 // ...
667 // --------------------------------------------------------------------------------------------------------------------
3d824203 668
2aa4ebcd 669 // 1-particle:
670 Double_t cosP1n = 0.; // <<cos(n*(phi1))>>
671
672 if(dMult>0)
673 {
674 cosP1n = dReQ1n/dMult;
675
676 // average non-weighted 1-particle correction (cos terms) for non-uniform acceptance for single event:
677 fQCorrectionsEBE[0][1]->SetBinContent(1,cosP1n);
678
679 // final average non-weighted 1-particle correction (cos terms) for non-uniform acceptance for all events:
680 fQCorrections[0][0][1]->Fill(0.5,cosP1n,dMult);
681 }
77515452 682
2aa4ebcd 683 // 2-particle:
684 Double_t cosP1nP1n = 0.; // <<cos(n*(phi1+phi2))>>
77515452 685
2aa4ebcd 686 if(dMult>1)
687 {
688 cosP1nP1n = (pow(dReQ1n,2)-pow(dImQ1n,2)-dReQ2n)/(dMult*(dMult-1));
9c1a9547 689
2aa4ebcd 690 // average non-weighted 2-particle correction (cos terms) for non-uniform acceptance for single event:
691 fQCorrectionsEBE[0][1]->SetBinContent(2,cosP1nP1n);
9c1a9547 692
2aa4ebcd 693 // final average non-weighted 2-particle correction (cos terms) for non-uniform acceptance for all events:
694 fQCorrections[0][0][1]->Fill(1.5,cosP1nP1n,dMult*(dMult-1));
695 }
77515452 696
2aa4ebcd 697 // 3-particle:
698 Double_t cosP1nM1nM1n = 0.; // <<cos(n*(phi1-phi2-phi3))>>
77515452 699
2aa4ebcd 700 if(dMult>2)
701 {
702 cosP1nM1nM1n = (dReQ1n*(pow(dReQ1n,2)+pow(dImQ1n,2))-dReQ1n*dReQ2n-dImQ1n*dImQ2n-2.*(dMult-1)*dReQ1n)
703 / (dMult*(dMult-1)*(dMult-2));
704
705 // average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for single event:
706 fQCorrectionsEBE[0][1]->SetBinContent(3,cosP1nM1nM1n);
707
708 // final average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for all events:
709 fQCorrections[0][0][1]->Fill(2.5,cosP1nM1nM1n,dMult*(dMult-1)*(dMult-2));
710 }
77515452 711
2aa4ebcd 712} // end of AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNonUniformAcceptanceForIntFlowCosTerms()
6f366058 713
9c1a9547 714
2aa4ebcd 715//================================================================================================================================
9c1a9547 716
9c1a9547 717
2aa4ebcd 718void AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNonUniformAcceptanceForIntFlowSinTerms()
719{
720 // calculate corrections for non-uniform acceptance of the detector for no-name integrated flow (sin terms)
9c1a9547 721
2aa4ebcd 722 // multiplicity:
723 Double_t dMult = (*fSMpk)(0,0);
9c1a9547 724
2aa4ebcd 725 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
726 Double_t dReQ1n = (*fReQ)(0,0);
727 Double_t dReQ2n = (*fReQ)(1,0);
728 //Double_t dReQ3n = (*fReQ)(2,0);
729 //Double_t dReQ4n = (*fReQ)(3,0);
730 Double_t dImQ1n = (*fImQ)(0,0);
731 Double_t dImQ2n = (*fImQ)(1,0);
732 //Double_t dImQ3n = (*fImQ)(2,0);
733 //Double_t dImQ4n = (*fImQ)(3,0);
734
735 // *************************************************************
736 // **** corrections for non-uniform acceptance (sin terms): ****
737 // *************************************************************
738 //
739 // Remark 1: corrections for non-uniform acceptance (sin terms) calculated with non-weighted Q-vectors
740 // are stored in 1D profile fQCorrectionsSin.
741 // Remark 2: binning of fQCorrectionsSin is organized as follows:
742 // --------------------------------------------------------------------------------------------------------------------
743 // 1st bin: <<sin(n*(phi1))>> = sinP1n
744 // 2nd bin: <<sin(n*(phi1+phi2))>> = sinP1nP1n
745 // 3rd bin: <<sin(n*(phi1-phi2-phi3))>> = sinP1nM1nM1n
746 // ...
747 // --------------------------------------------------------------------------------------------------------------------
9c1a9547 748
2aa4ebcd 749 // 1-particle:
750 Double_t sinP1n = 0.; // <sin(n*(phi1))>
9c1a9547 751
2aa4ebcd 752 if(dMult>0)
753 {
754 sinP1n = dImQ1n/dMult;
755
756 // average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for single event:
757 fQCorrectionsEBE[0][0]->SetBinContent(1,sinP1n);
758
759 // final average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
760 fQCorrections[0][0][0]->Fill(0.5,sinP1n,dMult);
761 }
9c1a9547 762
2aa4ebcd 763 // 2-particle:
764 Double_t sinP1nP1n = 0.; // <<sin(n*(phi1+phi2))>>
9c1a9547 765
2aa4ebcd 766 if(dMult>1)
767 {
768 sinP1nP1n = (2.*dReQ1n*dImQ1n-dImQ2n)/(dMult*(dMult-1));
769
770 // average non-weighted 2-particle correction (sin terms) for non-uniform acceptance for single event:
771 fQCorrectionsEBE[0][0]->SetBinContent(2,sinP1nP1n);
9c1a9547 772
2aa4ebcd 773 // final average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
774 fQCorrections[0][0][0]->Fill(1.5,sinP1nP1n,dMult*(dMult-1));
775 }
9c1a9547 776
2aa4ebcd 777 // 3-particle:
778 Double_t sinP1nM1nM1n = 0.; // <<sin(n*(phi1-phi2-phi3))>>
ae733b3b 779
2aa4ebcd 780 if(dMult>2)
781 {
782 sinP1nM1nM1n = (-dImQ1n*(pow(dReQ1n,2)+pow(dImQ1n,2))+dReQ1n*dImQ2n-dImQ1n*dReQ2n+2.*(dMult-1)*dImQ1n)
783 / (dMult*(dMult-1)*(dMult-2));
784
785 // average non-weighted 3-particle correction (sin terms) for non-uniform acceptance for single event:
786 fQCorrectionsEBE[0][0]->SetBinContent(3,sinP1nM1nM1n);
9c1a9547 787
2aa4ebcd 788 // final average non-weighted 3-particle correction (sin terms) for non-uniform acceptance for all events:
789 fQCorrections[0][0][0]->Fill(2.5,sinP1nM1nM1n,dMult*(dMult-1)*(dMult-2));
790 }
1dfa3c16 791
2aa4ebcd 792} // end of AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNonUniformAcceptanceForIntFlowSinTerms()
793
794
795//================================================================================================================================
796
797
798void AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNonUniformAcceptanceForDifferentialFlowCosTerms(TString type)
799{
800 // calculate corrections for non-uniform acceptance of the detector for differential flow (cos terms)
801
802 // multiplicity:
803 //Double_t dMult = (*fSMpk)(0,0);
804
805 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
806 //Double_t dReQ1n = (*fReQ)(0,0);
807 //Double_t dReQ2n = (*fReQ)(1,0);
808 //Double_t dReQ3n = (*fReQ)(2,0);
809 //Double_t dReQ4n = (*fReQ)(3,0);
810 //Double_t dImQ1n = (*fImQ)(0,0);
811 //Double_t dImQ2n = (*fImQ)(1,0);
812 //Double_t dImQ3n = (*fImQ)(2,0);
813 //Double_t dImQ4n = (*fImQ)(3,0);
814
815 // looping over all (pt,eta) bins and calculating correlations needed for differential flow:
816 for(Int_t p=1;p<=fnBinsPt;p++)
817 {
818 for(Int_t e=1;e<=fnBinsEta;e++)
819 {
820 // real and imaginary parts of q_n (non-weighted Q-vector evaluated only for POIs in harmonic n for each (pt,eta) bin):
821 //Double_t dReqnPtEta = 0.;
822 //Double_t dImqnPtEta = 0.;
823
824 // number of POIs in each (pt,eta) bin:
825 Double_t dmPtEta = 0.;
826
827 // real and imaginary parts of q''_{n}, q''_{2n}, ...
828 // (non-weighted Q-vectors evaluated only for particles which are both RPs and POIs in harmonic n, 2n, ... for each (pt,eta) bin):
829 //Double_t dReqPrimePrime1nPtEta = 0.;
830 //Double_t dImqPrimePrime1nPtEta = 0.;
831 //Double_t dReqPrimePrime2nPtEta = 0.;
832 //Double_t dImqPrimePrime2nPtEta = 0.;
833
834 // number of particles which are both RPs and POIs in each (pt,eta) bin:
835 //Double_t dmPrimePrimePtEta = 0.;
836
837 if(type == "POI")
838 {
839 // q''_{n}, q''_{2n}:
840 //...............................................................................................
841 //dReqPrimePrime1nPtEta = fReqPrimePrime1nPtEta->GetBinContent(fReqPrimePrime1nPtEta->GetBin(p,e));
842 //dImqPrimePrime1nPtEta = fImqPrimePrime1nPtEta->GetBinContent(fImqPrimePrime1nPtEta->GetBin(p,e));
843 //dReqPrimePrime2nPtEta = fReqPrimePrime2nPtEta->GetBinContent(fReqPrimePrime2nPtEta->GetBin(p,e));
844 //dImqPrimePrime2nPtEta = fImqPrimePrime2nPtEta->GetBinContent(fImqPrimePrime2nPtEta->GetBin(p,e));
845 //...............................................................................................
846
847 // m'':
848 //dmPrimePrimePtEta = fmPrimePrimePtEta->GetBinContent(fmPrimePrimePtEta->GetBin(p,e));
849
850 // q'_{n}:
851 //dReqnPtEta = fReqnPtEta->GetBinContent(fReqnPtEta->GetBin(p,e));
852 //dImqnPtEta = fImqnPtEta->GetBinContent(fImqnPtEta->GetBin(p,e));
853 //dmPtEta = fmPtEta->GetBinContent(fmPtEta->GetBin(p,e));
854 }
855 else if(type == "RP")
856 {
857 // q_RP{n}, q_RP{2n}:
858 //...............................................................................................
859 //dReqPrimePrime1nPtEta = fReqRP1nPtEta->GetBinContent(fReqRP1nPtEta->GetBin(p,e));
860 //dImqPrimePrime1nPtEta = fImqRP1nPtEta->GetBinContent(fImqRP1nPtEta->GetBin(p,e));
861 //dReqPrimePrime2nPtEta = fReqRP2nPtEta->GetBinContent(fReqRP2nPtEta->GetBin(p,e));
862 //dImqPrimePrime2nPtEta = fImqRP2nPtEta->GetBinContent(fImqRP2nPtEta->GetBin(p,e));
863 //...............................................................................................
864
865 // m'':
866 //dmPrimePrimePtEta = fmRPPtEta->GetBinContent(fmRPPtEta->GetBin(p,e));
867
868 //dReqnPtEta = fReqRP1nPtEta->GetBinContent(fReqRP1nPtEta->GetBin(p,e)); // not a bug ;-)
869 //dImqnPtEta = fImqRP1nPtEta->GetBinContent(fImqRP1nPtEta->GetBin(p,e)); // not a bug ;-)
870 //dmPtEta = fmRPPtEta->GetBinContent(fmRPPtEta->GetBin(p,e)); // not a bug ;-)
871 }
872
873 // 1'-p correction:
874 //Double_t oneCosP1nPsiPtEta = 0.;
875
876 if(dmPtEta)
877 {
878 //oneCosP1nPsiPtEta = dReqnPtEta/dmPtEta;
879
880 // fill the 2D profile to get the average 1'-p correction for each (pt, eta) bin:
881 if(type == "POI")
882 {
883 //fCorrectionsCosP1nPsiPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,
884 // oneCosP1nPsiPtEta,dmPtEta);
885 }
886 else if(type == "RP")
887 {
888 //fCorrectionsCosP1nPsiPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,
889 // oneCosP1nPsiPtEta,dmPtEta);
890 }
891 } // end of if(dmPtEta*dMult-dmPrimePrimePtEta)
892
893 /*
894
895 // 4'-particle correlation:
896 Double_t four1n1n1n1nPtEta = 0.;
897 if((dmPtEta-dmPrimePrimePtEta)*dMult*(dMult-1.)*(dMult-2.)
898 + dmPrimePrimePtEta*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)
899 {
900 four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(dReqnPtEta*dReQ1n+dImqnPtEta*dImQ1n)
901 - dReqPrimePrime2nPtEta*(pow(dReQ1n,2.)-pow(dImQ1n,2.))
902 - 2.*dImqPrimePrime2nPtEta*dReQ1n*dImQ1n
903 - dReqnPtEta*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)
904 + dImqnPtEta*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)
905 - 2.*dMult*(dReqnPtEta*dReQ1n+dImqnPtEta*dImQ1n)
906 - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*dmPrimePrimePtEta
907 + 6.*(dReqPrimePrime1nPtEta*dReQ1n+dImqPrimePrime1nPtEta*dImQ1n)
908 + 1.*(dReqPrimePrime2nPtEta*dReQ2n+dImqPrimePrime2nPtEta*dImQ2n)
909 + 2.*(dReqnPtEta*dReQ1n+dImqnPtEta*dImQ1n)
910 + 2.*dmPrimePrimePtEta*dMult
911 - 6.*dmPrimePrimePtEta)
912 / ((dmPtEta-dmPrimePrimePtEta)*dMult*(dMult-1.)*(dMult-2.)
913 + dmPrimePrimePtEta*(dMult-1.)*(dMult-2.)*(dMult-3.));
9c1a9547 914
2aa4ebcd 915 // fill the 2D profile to get the average correlation for each (pt, eta) bin:
916 if(type == "POI")
917 {
918 f4pPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
919 (dmPtEta-dmPrimePrimePtEta)*dMult*(dMult-1.)*(dMult-2.)
920 + dmPrimePrimePtEta*(dMult-1.)*(dMult-2.)*(dMult-3.));
921 }
922 else if(type == "RP")
923 {
924 f4pPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
925 (dmPtEta-dmPrimePrimePtEta)*dMult*(dMult-1.)*(dMult-2.)
926 + dmPrimePrimePtEta*(dMult-1.)*(dMult-2.)*(dMult-3.));
927 }
928 } // end of if((dmPtEta-dmPrimePrimePtEta)*dMult*(dMult-1.)*(dMult-2.)
929 // +dmPrimePrimePtEta*(dMult-1.)*(dMult-2.)*(dMult-3.))
930
931 */
932
933 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
934 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
935
936} // end of AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNonUniformAcceptanceForDifferentialFlowCosTerms(TString type)
937
938
939//================================================================================================================================
940
941
942void AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNonUniformAcceptanceForDifferentialFlowSinTerms(TString type)
943{
944 // calculate corrections for non-uniform acceptance of the detector for differential flow (sin terms)
945
946 // multiplicity:
947 //Double_t dMult = (*fSMpk)(0,0);
948
949 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
950 //Double_t dReQ1n = (*fReQ)(0,0);
951 //Double_t dReQ2n = (*fReQ)(1,0);
952 //Double_t dReQ3n = (*fReQ)(2,0);
953 //Double_t dReQ4n = (*fReQ)(3,0);
954 //Double_t dImQ1n = (*fImQ)(0,0);
955 //Double_t dImQ2n = (*fImQ)(1,0);
956 //Double_t dImQ3n = (*fImQ)(2,0);
957 //Double_t dImQ4n = (*fImQ)(3,0);
958
959 // looping over all (pt,eta) bins and calculating correlations needed for differential flow:
960 for(Int_t p=1;p<=fnBinsPt;p++)
961 {
962 for(Int_t e=1;e<=fnBinsEta;e++)
963 {
964 // real and imaginary parts of q_n (non-weighted Q-vector evaluated only for POIs in harmonic n for each (pt,eta) bin):
965 //Double_t dReqnPtEta = 0.;
966 //Double_t dImqnPtEta = 0.;
967
968 // number of POIs in each (pt,eta) bin:
969 Double_t dmPtEta = 0.;
970
971 // real and imaginary parts of q''_{n}, q''_{2n}, ...
972 // (non-weighted Q-vectors evaluated only for particles which are both RPs and POIs in harmonic n, 2n, ... for each (pt,eta) bin):
973 //Double_t dReqPrimePrime1nPtEta = 0.;
974 //Double_t dImqPrimePrime1nPtEta = 0.;
975 //Double_t dReqPrimePrime2nPtEta = 0.;
976 //Double_t dImqPrimePrime2nPtEta = 0.;
977
978 // number of particles which are both RPs and POIs in each (pt,eta) bin:
979 //Double_t dmPrimePrimePtEta = 0.;
980
981 if(type == "POI")
982 {
983 // q''_{n}, q''_{2n}:
984 //...............................................................................................
985 //dReqPrimePrime1nPtEta = fReqPrimePrime1nPtEta->GetBinContent(fReqPrimePrime1nPtEta->GetBin(p,e));
986 //dImqPrimePrime1nPtEta = fImqPrimePrime1nPtEta->GetBinContent(fImqPrimePrime1nPtEta->GetBin(p,e));
987 //dReqPrimePrime2nPtEta = fReqPrimePrime2nPtEta->GetBinContent(fReqPrimePrime2nPtEta->GetBin(p,e));
988 //dImqPrimePrime2nPtEta = fImqPrimePrime2nPtEta->GetBinContent(fImqPrimePrime2nPtEta->GetBin(p,e));
989 //...............................................................................................
990
991 // m'':
992 //dmPrimePrimePtEta = fmPrimePrimePtEta->GetBinContent(fmPrimePrimePtEta->GetBin(p,e));
993
994 // q'_{n}:
995 //dReqnPtEta = fReqnPtEta->GetBinContent(fReqnPtEta->GetBin(p,e));
996 //dImqnPtEta = fImqnPtEta->GetBinContent(fImqnPtEta->GetBin(p,e));
997 //dmPtEta = fmPtEta->GetBinContent(fmPtEta->GetBin(p,e));
998 }
999 else if(type == "RP")
1000 {
1001 // q_RP{n}, q_RP{2n}:
1002 //...............................................................................................
1003 //dReqPrimePrime1nPtEta = fReqRP1nPtEta->GetBinContent(fReqRP1nPtEta->GetBin(p,e));
1004 //dImqPrimePrime1nPtEta = fImqRP1nPtEta->GetBinContent(fImqRP1nPtEta->GetBin(p,e));
1005 //dReqPrimePrime2nPtEta = fReqRP2nPtEta->GetBinContent(fReqRP2nPtEta->GetBin(p,e));
1006 //dImqPrimePrime2nPtEta = fImqRP2nPtEta->GetBinContent(fImqRP2nPtEta->GetBin(p,e));
1007 //...............................................................................................
1008
1009 // m'':
1010 //dmPrimePrimePtEta = fmRPPtEta->GetBinContent(fmRPPtEta->GetBin(p,e));
1011
1012 //dReqnPtEta = fReqRP1nPtEta->GetBinContent(fReqRP1nPtEta->GetBin(p,e)); // not a bug ;-)
1013 //dImqnPtEta = fImqRP1nPtEta->GetBinContent(fImqRP1nPtEta->GetBin(p,e)); // not a bug ;-)
1014 //dmPtEta = fmRPPtEta->GetBinContent(fmRPPtEta->GetBin(p,e)); // not a bug ;-)
1015 }
1016
1017 // 1'-p correction:
1018 //Double_t oneSinP1nPsiPtEta = 0.;
1019
1020 if(dmPtEta)
1021 {
1022 //oneSinP1nPsiPtEta = dImqnPtEta/dmPtEta;
1023
1024 // fill the 2D profile to get the average 1'-p correction for each (pt, eta) bin:
1025 if(type == "POI")
1026 {
1027 //fCorrectionsSinP1nPsiPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,
1028 // oneSinP1nPsiPtEta,dmPtEta);
1029 }
1030 else if(type == "RP")
1031 {
1032 //fCorrectionsSinP1nPsiPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,
1033 // oneSinP1nPsiPtEta,dmPtEta);
1034 }
1035 } // end of if(dmPtEta*dMult-dmPrimePrimePtEta)
1036
1037 /*
1038
1039 // 4'-particle correlation:
1040 Double_t four1n1n1n1nPtEta = 0.;
1041 if((dmPtEta-dmPrimePrimePtEta)*dMult*(dMult-1.)*(dMult-2.)
1042 + dmPrimePrimePtEta*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)
1043 {
1044 four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(dReqnPtEta*dReQ1n+dImqnPtEta*dImQ1n)
1045 - dReqPrimePrime2nPtEta*(pow(dReQ1n,2.)-pow(dImQ1n,2.))
1046 - 2.*dImqPrimePrime2nPtEta*dReQ1n*dImQ1n
1047 - dReqnPtEta*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)
1048 + dImqnPtEta*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)
1049 - 2.*dMult*(dReqnPtEta*dReQ1n+dImqnPtEta*dImQ1n)
1050 - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*dmPrimePrimePtEta
1051 + 6.*(dReqPrimePrime1nPtEta*dReQ1n+dImqPrimePrime1nPtEta*dImQ1n)
1052 + 1.*(dReqPrimePrime2nPtEta*dReQ2n+dImqPrimePrime2nPtEta*dImQ2n)
1053 + 2.*(dReqnPtEta*dReQ1n+dImqnPtEta*dImQ1n)
1054 + 2.*dmPrimePrimePtEta*dMult
1055 - 6.*dmPrimePrimePtEta)
1056 / ((dmPtEta-dmPrimePrimePtEta)*dMult*(dMult-1.)*(dMult-2.)
1057 + dmPrimePrimePtEta*(dMult-1.)*(dMult-2.)*(dMult-3.));
1058
1059 // fill the 2D profile to get the average correlation for each (pt, eta) bin:
1060 if(type == "POI")
1061 {
1062 f4pPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
1063 (dmPtEta-dmPrimePrimePtEta)*dMult*(dMult-1.)*(dMult-2.)
1064 + dmPrimePrimePtEta*(dMult-1.)*(dMult-2.)*(dMult-3.));
1065 }
1066 else if(type == "RP")
1067 {
1068 f4pPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
1069 (dmPtEta-dmPrimePrimePtEta)*dMult*(dMult-1.)*(dMult-2.)
1070 + dmPrimePrimePtEta*(dMult-1.)*(dMult-2.)*(dMult-3.));
1071 }
1072 } // end of if((dmPtEta-dmPrimePrimePtEta)*dMult*(dMult-1.)*(dMult-2.)
1073 // +dmPrimePrimePtEta*(dMult-1.)*(dMult-2.)*(dMult-3.))
1074
1075 */
1076
1077 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
1078 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
1079
1080} // end of AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNonUniformAcceptanceForDifferentialFlowSinTerms(TString type)
1081
1082
1083//================================================================================================================================
1084
1085
1086void AliFlowAnalysisWithQCumulants::EvaluateNestedLoopsForDifferentialFlow(AliFlowEventSimple* anEvent)
1087{
1088 // evaluate the nested loops relevant for differential flow (needed for cross-checking the results)
1dfa3c16 1089
2aa4ebcd 1090 Int_t nPrim = anEvent->NumberOfTracks();
1091 AliFlowTrackSimple *aftsTrack = NULL;
ae733b3b 1092
2aa4ebcd 1093 Double_t psi1=0., phi2=0., phi3=0., phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
1094 Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1.;// wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
ae733b3b 1095
2aa4ebcd 1096 Int_t n = fHarmonic; // to be improved
ae733b3b 1097
2aa4ebcd 1098 // ********************************************
1099 // **** NESTED LOOPS FOR DIFFERENTIAL FLOW ****
1100 // ********************************************
1dfa3c16 1101
2aa4ebcd 1102 // Remark 1: (pt,eta) bin in which the cross-checking will be performed is given by 1.1 < pt < 1.2 GeV and -0.55 < eta < -0.525
1103
1104 // Remark 2: multi-particle correlations needed for diff. flow calculated with nested loops without weights are stored in 1D profile
1105 // fDirectCorrelationsDiffFlow
1106
1107 // Remark 3: multi-particle correlations needed for diff. flow calculated with nested loops with weights are stored in 1D profile
1108 // fDirectCorrelationsDiffFlowW;
1109
1110 // Remark 4: binning of fDirectCorrelationsDiffFlow is organized as follows:
1111 //......................................................................................
1112 // ---- bins 1-20: 2-particle correlations ----
1113 // 1st bin: <2'>_{1n|1n} = twoPrime1n1n = <cos(n*(psi1-phi2))>
1114 // ---- bins 21-40: 3-particle correlations ----
1115 // ---- bins 41-60: 4-particle correlations ----
1116 // 41st bin: <4'>_{1n,1n|1n,1n} = fourPrime1n1n1n1n = <cos(n*(psi1+phi2-phi3-phi4))>
1117 //......................................................................................
1118
1119 // Remark 5: binning of fDirectCorrelationsDiffFlow is organized as follows:
1120 //......................................................................................
1121 // ---- bins 1-20: 2-particle correlations ----
1122 // 1st bin: twoPrime1n1nW0W1 = <w2 cos(n*(psi1-phi2))>
1123 // ---- bins 21-40: 3-particle correlations ----
1124 // ---- bins 41-60: 4-particle correlations ----
1125 // 41st bin: fourPrime1n1n1n1nW0W1W1W1 = <w2 w3 w4 cos(n*(psi1+phi2-phi3-phi4))>
1126 //......................................................................................
1127
1128 // 2'-particle:
1129 for(Int_t i1=0;i1<nPrim;i1++)
9c1a9547 1130 {
2aa4ebcd 1131 aftsTrack=anEvent->GetTrack(i1);
1132 // POI condition (first particle in the correlator must be POI):
1133 if(!((aftsTrack->Pt()>=1.1 && aftsTrack->Pt()<1.2) && (aftsTrack->Eta()>=-0.55 && aftsTrack->Eta()<-0.525) && (aftsTrack->InPOISelection())))continue;
1134 psi1=aftsTrack->Phi();
1135 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(psi1*fnBinsPhi/TMath::TwoPi())));
9c1a9547 1136
2aa4ebcd 1137 fDirectCorrectionsDiffFlowCos->Fill(0.,cos(1.*n*(psi1)),1.); // <<cos(n*(psi1))>>
1138 fDirectCorrectionsDiffFlowSin->Fill(0.,sin(1.*n*(psi1)),1.); // <<sin(n*(psi1))>>
9c1a9547 1139
2aa4ebcd 1140 for(Int_t i2=0;i2<nPrim;i2++)
1141 {
1142 if(i2==i1)continue;
1143 aftsTrack=anEvent->GetTrack(i2);
1144 // RP condition (!(first) particle in the correlator must be RP):
1145 if(!(aftsTrack->InRPSelection()))continue;
1146 phi2=aftsTrack->Phi();
1147 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
1148
1149 // non-weighted:
1150 //.....................................................................................
1151 fDirectCorrelationsDiffFlow->Fill(0.,cos(1.*n*(psi1-phi2)),1.); // <cos(n*(psi1-phi2))>
1152 //.....................................................................................
1153 // weighted:
1154 //.....................................................................................
1155 if(fUsePhiWeights) fDirectCorrelationsDiffFlowW->Fill(0.,cos(1.*n*(psi1-phi2)),wPhi2); // <w2 cos(n*(psi1-phi2))>
1156 //.....................................................................................
1157
1158 //fDirectCorrelations->Fill(103.,cos(1.*n*(phi1-phi2)),pow(wPhi1,2)*wPhi2);//<2'>_{n,n}
1159 //fDirectCorrelations->Fill(104.,cos(2.*n*(phi1-phi2)),wPhi1*pow(wPhi2,2));//<2'>_{n,n}
1160 //fDirectCorrelations->Fill(105.,cos(1.*n*(phi1-phi2)),pow(wPhi2,3));//<2'>_{n,n}
1161 //fDirectCorrelations->Fill(41.,cos(2.*n*(phi1-phi2)),1);//<2'>_{2n,2n}
1162 //fDirectCorrelations->Fill(42.,cos(3.*n*(phi1-phi2)),1);//<2'>_{3n,3n}
1163 //fDirectCorrelations->Fill(43.,cos(4.*n*(phi1-phi2)),1);//<2'>_{4n,4n}
1164
1165 }//end of for(Int_t i2=0;i2<nPrim;i2++)
1166 }//end of for(Int_t i1=0;i1<nPrim;i1++)
4057ba99 1167
2aa4ebcd 1168
1169
1170 /*
1171
1172 //<3'>_{2n|n,n}
1173 for(Int_t i1=0;i1<nPrim;i1++)
9c1a9547 1174 {
2aa4ebcd 1175 aftsTrack=anEvent->GetTrack(i1);
1176 if(!((aftsTrack->Pt()>=0.5&&aftsTrack->Pt()<0.6)&&(aftsTrack->InPOISelection())))continue;//POI condition
1177 psi1=aftsTrack->Phi();
1178 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(psi1*fnBinsPhi/TMath::TwoPi())));
1179 for(Int_t i2=0;i2<nPrim;i2++)
1180 {
1181 if(i2==i1)continue;
1182 aftsTrack=anEvent->GetTrack(i2);
1183 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1184 phi2=aftsTrack->Phi();
1185 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
1186 for(Int_t i3=0;i3<nPrim;i3++)
1187 {
1188 if(i3==i1||i3==i2)continue;
1189 aftsTrack=anEvent->GetTrack(i3);
1190 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1191 phi3=aftsTrack->Phi();
1192 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
1193 //fill the fDirectCorrelations:
1194
1195 // 2-p
1196 //fDirectCorrelations->Fill(101.,cos(n*(phi2-phi3)),wPhi1*wPhi2*wPhi3); // <w1 w2 w3 cos(n(phi2-phi3))>
1197 //fDirectCorrelations->Fill(102.,cos(n*(phi1-phi3)),pow(wPhi2,2.)*wPhi3); // <w2^2 w3 cos(n(psi1-phi2))>
1198
1199 // 3-p
1200 //fDirectCorrelations->Fill(110.,cos(n*(2.*phi1-phi2-phi3)),wPhi1*wPhi2*wPhi3); // <w1 w2 w3 cos(n(2psi1-phi2-phi3))>
1201 //fDirectCorrelations->Fill(111.,cos(n*(phi1+phi2-2.*phi3)),wPhi2*pow(wPhi3,2.)); // <w2 w3^2 cos(n(psi1+phi2-2.*phi3))>
1202
1203
1204 //fDirectCorrelations->Fill(46.,cos(n*(phi1+phi2-2.*phi3)),1);//<3'>_{n,n|2n}
1205 }//end of for(Int_t i3=0;i3<nPrim;i3++)
1206 }//end of for(Int_t i2=0;i2<nPrim;i2++)
1207 }//end of for(Int_t i1=0;i1<nPrim;i1++)
1208 */
1209
1210 // 4'-particle:
1211 for(Int_t i1=0;i1<nPrim;i1++)
1212 {
1213 aftsTrack=anEvent->GetTrack(i1);
1214 // POI condition (first particle in the correlator must be POI):
1215 if(!((aftsTrack->Pt()>=1.1 && aftsTrack->Pt()<1.2) && (aftsTrack->Eta()>=-0.55 && aftsTrack->Eta()<-0.525) && (aftsTrack->InPOISelection())))continue;
1216 psi1=aftsTrack->Phi();
1217 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(psi1*fnBinsPhi/TMath::TwoPi())));
1218 for(Int_t i2=0;i2<nPrim;i2++)
1219 {
1220 if(i2==i1)continue;
1221 aftsTrack=anEvent->GetTrack(i2);
1222 // RP condition (!(first) particle in the correlator must be RP):
1223 if(!(aftsTrack->InRPSelection()))continue;
1224 phi2=aftsTrack->Phi();
1225 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
1226 for(Int_t i3=0;i3<nPrim;i3++)
1227 {
1228 if(i3==i1||i3==i2)continue;
1229 aftsTrack=anEvent->GetTrack(i3);
1230 // RP condition (!(first) particle in the correlator must be RP):
1231 if(!(aftsTrack->InRPSelection()))continue;
1232 phi3=aftsTrack->Phi();
1233 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
1234 for(Int_t i4=0;i4<nPrim;i4++)
1235 {
1236 if(i4==i1||i4==i2||i4==i3)continue;
1237 aftsTrack=anEvent->GetTrack(i4);
1238 // RP condition (!(first) particle in the correlator must be RP):
1239 if(!(aftsTrack->InRPSelection()))continue;
1240 phi4=aftsTrack->Phi();
1241 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
1242
1243 // non-weighted:
1244 //.........................................................................................................................
1245 fDirectCorrelationsDiffFlow->Fill(40.,cos(n*(psi1+phi2-phi3-phi4)),1.); // <cos(n(psi1+phi1-phi2-phi3))>
1246 //.........................................................................................................................
1247 // weighted:
1248 //...............................................................................................................................
1249 if(fUsePhiWeights) fDirectCorrelationsDiffFlowW->Fill(40.,cos(n*(psi1+phi2-phi3-phi4)),wPhi2*wPhi3*wPhi4); // <w2 w3 w4 cos(n(psi1+phi2-phi3-phi4))>
1250 //...............................................................................................................................
1251
1252 }//end of for(Int_t i4=0;i4<nPrim;i4++)
1253 }//end of for(Int_t i3=0;i3<nPrim;i3++)
1254 }//end of for(Int_t i2=0;i2<nPrim;i2++)
1255 }//end of for(Int_t i1=0;i1<nPrim;i1++)
1256
1257 /*
1258 //<5'>_{2n,n|n,n,n}
1259 for(Int_t i1=0;i1<nPrim;i1++)
1260 {
1261 aftsTrack=anEvent->GetTrack(i1);
1262 if(!((aftsTrack->Pt()>=0.5&&aftsTrack->Pt()<0.6)&&(aftsTrack->InPOISelection())))continue;//POI condition
1263 phi1=aftsTrack->Phi();
1264 for(Int_t i2=0;i2<nPrim;i2++)
1265 {
1266 if(i2==i1)continue;
1267 aftsTrack=anEvent->GetTrack(i2);
1268 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1269 phi2=aftsTrack->Phi();
1270 for(Int_t i3=0;i3<nPrim;i3++)
1271 {
1272 if(i3==i1||i3==i2)continue;
1273 aftsTrack=anEvent->GetTrack(i3);
1274 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1275 phi3=aftsTrack->Phi();
1276 for(Int_t i4=0;i4<nPrim;i4++)
1277 {
1278 if(i4==i1||i4==i2||i4==i3)continue;
1279 aftsTrack=anEvent->GetTrack(i4);
1280 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1281 phi4=aftsTrack->Phi();//
1282 for(Int_t i5=0;i5<nPrim;i5++)
1283 {
1284 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
1285 aftsTrack=anEvent->GetTrack(i5);
1286 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1287 phi5=aftsTrack->Phi();
1288 //fill the fDirectCorrelations:if(bNestedLoops)
1289 //fDirectCorrelations->Fill(55.,cos(2.*n*phi1+n*phi2-n*phi3-n*phi4-n*phi5),1);//<5'>_{2n,n|n,n,n}
1290 }//end of for(Int_t i5=0;i5<nPrim;i5++)
1291 }//end of for(Int_t i4=0;i4<nPrim;i4++)
1292 }//end of for(Int_t i3=0;i3<nPrim;i3++)
1293 }//end of for(Int_t i2=0;i2<nPrim;i2++)
1294 }//end of for(Int_t i1=0;i1<nPrim;i1++)
1295
9c1a9547 1296
9c1a9547 1297
2aa4ebcd 1298 */
1299 /*
ae733b3b 1300
2aa4ebcd 1301
1302
1303 //<6'>_{n,n,n|n,n,n}
1304 for(Int_t i1=0;i1<nPrim;i1++)
9c1a9547 1305 {
2aa4ebcd 1306 aftsTrack=anEvent->GetTrack(i1);
1307 if(!((aftsTrack->Pt()>=0.5&&aftsTrack->Pt()<0.6)&&(aftsTrack->InPOISelection())))continue;//POI condition
1308 phi1=aftsTrack->Phi();
1309 for(Int_t i2=0;i2<nPrim;i2++)
1310 {
1311 if(i2==i1)continue;
1312 aftsTrack=anEvent->GetTrack(i2);
1313 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1314 phi2=aftsTrack->Phi();
1315 for(Int_t i3=0;i3<nPrim;i3++)
1316 {
1317 if(i3==i1||i3==i2)continue;
1318 aftsTrack=anEvent->GetTrack(i3);
1319 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1320 phi3=aftsTrack->Phi();
1321 for(Int_t i4=0;i4<nPrim;i4++)
1322 {
1323 if(i4==i1||i4==i2||i4==i3)continue;
1324 aftsTrack=anEvent->GetTrack(i4);
1325 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1326 phi4=aftsTrack->Phi();
1327 for(Int_t i5=0;i5<nPrim;i5++)
1328 {
1329 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
1330 aftsTrack=anEvent->GetTrack(i5);
1331 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1332 phi5=aftsTrack->Phi();
1333 for(Int_t i6=0;i6<nPrim;i6++)
1334 {
1335 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
1336 aftsTrack=anEvent->GetTrack(i6);
1337 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1338 phi6=aftsTrack->Phi();
1339 //fill the fDirectCorrelations:
1340 //fDirectCorrelations->Fill(60.,cos(n*(phi1+phi2+phi3-phi4-phi5-phi6)),1);//<6'>_{n,n,n|n,n,n}
1341 }//end of for(Int_t i6=0;i6<nPrim;i6++)
1342 }//end of for(Int_t i5=0;i5<nPrim;i5++)
1343 }//end of for(Int_t i4=0;i4<nPrim;i4++)
1344 }//end of for(Int_t i3=0;i3<nPrim;i3++)
1345 }//end of for(Int_t i2=0;i2<nPrim;i2++)
1346 }//end of for(Int_t i1=0;i1<nPrim;i1++)
1347
9c1a9547 1348
2aa4ebcd 1349 */
1350 /*
9c1a9547 1351
2aa4ebcd 1352
1353 //<7'>_{2n,n,n|n,n,n,n}
1354 for(Int_t i1=0;i1<nPrim;i1++)
1355 {
1356 aftsTrack=anEvent->GetTrack(i1);
1357 if(!((aftsTrack->Pt()>=0.5&&aftsTrack->Pt()<0.6)&&(aftsTrack->InPOISelection())))continue;//POI condition
1358 phi1=aftsTrack->Phi();
1359 for(Int_t i2=0;i2<nPrim;i2++)
1360 {
1361 if(i2==i1)continue;
1362 aftsTrack=anEvent->GetTrack(i2);
1363 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1364 phi2=aftsTrack->Phi();
1365 for(Int_t i3=0;i3<nPrim;i3++)
1366 {
1367 if(i3==i1||i3==i2)continue;
1368 aftsTrack=anEvent->GetTrack(i3);
1369 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1370 phi3=aftsTrack->Phi();
1371 for(Int_t i4=0;i4<nPrim;i4++)
1372 {
1373 if(i4==i1||i4==i2||i4==i3)continue;
1374 aftsTrack=anEvent->GetTrack(i4);
1375 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1376 phi4=aftsTrack->Phi();
1377 for(Int_t i5=0;i5<nPrim;i5++)
1378 {
1379 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
1380 aftsTrack=anEvent->GetTrack(i5);
1381 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1382 phi5=aftsTrack->Phi();
1383 for(Int_t i6=0;i6<nPrim;i6++)
1384 {
1385 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
1386 aftsTrack=anEvent->GetTrack(i6);
1387 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1388 phi6=aftsTrack->Phi();
1389 for(Int_t i7=0;i7<nPrim;i7++)
1390 {
1391 if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;
1392 aftsTrack=anEvent->GetTrack(i7);
1393 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1394 phi7=aftsTrack->Phi();
1395 //fill the fDirectCorrelations:
1396 //fDirectCorrelations->Fill(65.,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}
1397 }//end of for(Int_t i7=0;i7<nPrim;i7++)
1398 }//end of for(Int_t i6=0;i6<nPrim;i6++)
1399 }//end of for(Int_t i5=0;i5<nPrim;i5++)
1400 }//end of for(Int_t i4=0;i4<nPrim;i4++)
1401 }//end of for(Int_t i3=0;i3<nPrim;i3++)
1402 }//end of for(Int_t i2=0;i2<nPrim;i2++)
1403 }//end of for(Int_t i1=0;i1<nPrim;i1++)
9c1a9547 1404
2aa4ebcd 1405
9c1a9547 1406
2aa4ebcd 1407 */
1408 /*
1409
1410
1411
1412 //<8'>_{n,n,n,n|n,n,n,n}
1413 for(Int_t i1=0;i1<nPrim;i1++)
1414 {
1415 aftsTrack=anEvent->GetTrack(i1);
1416 if(!((aftsTrack->Pt()>=0.5&&aftsTrack->Pt()<0.6)&&(aftsTrack->InPOISelection())))continue;//POI condition
1417 phi1=aftsTrack->Phi();
1418 for(Int_t i2=0;i2<nPrim;i2++)
1419 {
1420 if(i2==i1)continue;
1421 aftsTrack=anEvent->GetTrack(i2);
1422 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1423 phi2=aftsTrack->Phi();
1424 for(Int_t i3=0;i3<nPrim;i3++)
1425 {
1426 if(i3==i1||i3==i2)continue;
1427 aftsTrack=anEvent->GetTrack(i3);
1428 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1429 phi3=aftsTrack->Phi();
1430 for(Int_t i4=0;i4<nPrim;i4++)
1431 {
1432 if(i4==i1||i4==i2||i4==i3)continue;
1433 aftsTrack=anEvent->GetTrack(i4);
1434 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1435 phi4=aftsTrack->Phi();
1436 for(Int_t i5=0;i5<nPrim;i5++)
1437 {
1438 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
1439 aftsTrack=anEvent->GetTrack(i5);
1440 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1441 phi5=aftsTrack->Phi();
1442 for(Int_t i6=0;i6<nPrim;i6++)
1443 {
1444 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
1445 aftsTrack=anEvent->GetTrack(i6);
1446 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1447 phi6=aftsTrack->Phi();
1448 for(Int_t i7=0;i7<nPrim;i7++)
1449 {
1450 if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;
1451 aftsTrack=anEvent->GetTrack(i7);
1452 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1453 phi7=aftsTrack->Phi();
1454 for(Int_t i8=0;i8<nPrim;i8++)
1455 {
1456 if(i8==i1||i8==i2||i8==i3||i8==i4||i8==i5||i8==i6||i8==i7)continue;
1457 aftsTrack=anEvent->GetTrack(i8);
1458 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1459 phi8=aftsTrack->Phi();
1460 //fill the fDirectCorrelations:
1461 //fDirectCorrelations->Fill(70.,cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8)),1);//<8'>_{n,n,n,n|n,n,n,n}
1462 }//end of for(Int_t i8=0;i8<nPrim;i8++)
1463 }//end of for(Int_t i7=0;i7<nPrim;i7++)
1464 }//end of for(Int_t i6=0;i6<nPrim;i6++)
1465 }//end of for(Int_t i5=0;i5<nPrim;i5++)
1466 }//end of for(Int_t i4=0;i4<nPrim;i4++)
1467 }//end of for(Int_t i3=0;i3<nPrim;i3++)
1468 }//end of for(Int_t i2=0;i2<nPrim;i2++)
1469 }//end of for(Int_t i1=0;i1<nPrim;i1++)
4057ba99 1470
1dfa3c16 1471
2aa4ebcd 1472
1473 */
1474
1475
1476
1477
1478} // end of AliFlowAnalysisWithQCumulants::EvaluateNestedLoopsForDifferentialFlow(AliFlowEventSimple* anEvent)
1479
1480
1481//================================================================================================================================
1482
1483
1484void AliFlowAnalysisWithQCumulants::GetOutputHistograms(TList *outputListHistos)
1485{
1486 // get pointers to all output histograms (called before Finish())
1487 if(outputListHistos)
1488 {
1489 // 1.) common control histograms and common histograms for final results:
1490 AliFlowCommonHist *commonHist = dynamic_cast<AliFlowCommonHist*>(outputListHistos->FindObject("AliFlowCommonHistQC"));
1491 if(commonHist) this->SetCommonHists(commonHist);
1492 AliFlowCommonHist *commonHist2nd = dynamic_cast<AliFlowCommonHist*>(outputListHistos->FindObject("AliFlowCommonHist2ndOrderQC"));
1493 if(commonHist2nd) this->SetCommonHists2nd(commonHist2nd);
1494 AliFlowCommonHist *commonHist4th = dynamic_cast<AliFlowCommonHist*>(outputListHistos->FindObject("AliFlowCommonHist4thOrderQC"));
1495 if(commonHist4th) this->SetCommonHists4th(commonHist4th);
1496 AliFlowCommonHist *commonHist6th = dynamic_cast<AliFlowCommonHist*>(outputListHistos->FindObject("AliFlowCommonHist6thOrderQC"));
1497 if(commonHist6th) this->SetCommonHists6th(commonHist6th);
1498 AliFlowCommonHist *commonHist8th = dynamic_cast<AliFlowCommonHist*>(outputListHistos->FindObject("AliFlowCommonHist8thOrderQC"));
1499 if(commonHist8th) this->SetCommonHists8th(commonHist8th);
1500 AliFlowCommonHistResults *commonHistRes2nd = dynamic_cast<AliFlowCommonHistResults*>
1501 (outputListHistos->FindObject("AliFlowCommonHistResults2ndOrderQC"));
1502 if(commonHistRes2nd) this->SetCommonHistsResults2nd(commonHistRes2nd);
1503 AliFlowCommonHistResults *commonHistRes4th = dynamic_cast<AliFlowCommonHistResults*>
1504 (outputListHistos->FindObject("AliFlowCommonHistResults4thOrderQC"));
1505 if(commonHistRes4th) this->SetCommonHistsResults4th(commonHistRes4th);
1506 AliFlowCommonHistResults *commonHistRes6th = dynamic_cast<AliFlowCommonHistResults*>
1507 (outputListHistos->FindObject("AliFlowCommonHistResults6thOrderQC"));
1508 if(commonHistRes6th) this->SetCommonHistsResults6th(commonHistRes6th);
1509 AliFlowCommonHistResults *commonHistRes8th = dynamic_cast<AliFlowCommonHistResults*>
1510 (outputListHistos->FindObject("AliFlowCommonHistResults8thOrderQC"));
1511 if(commonHistRes8th) this->SetCommonHistsResults8th(commonHistRes8th);
1512
1513 // 2.) weights:
1514 TList *weightsList = dynamic_cast<TList*>(outputListHistos->FindObject("Weights"));
1515 if(weightsList) this->SetWeightsList(weightsList);
1516 Bool_t bUsePhiWeights = kFALSE;
1517 Bool_t bUsePtWeights = kFALSE;
1518 Bool_t bUseEtaWeights = kFALSE;
1519 TProfile *useParticleWeights = dynamic_cast<TProfile*>(weightsList->FindObject("fUseParticleWeights"));
1520 if(useParticleWeights)
1521 {
1522 this->SetUseParticleWeights(useParticleWeights);
1523 bUsePhiWeights = (Int_t)useParticleWeights->GetBinContent(1);
1524 bUsePtWeights = (Int_t)useParticleWeights->GetBinContent(2);
1525 bUseEtaWeights = (Int_t)useParticleWeights->GetBinContent(3);
1526 }
1527
1528 // 3.) integrated flow:
1529 TList *intFlowList = NULL;
1530 TList *intFlowProfiles = NULL;
1531 TList *intFlowResults = NULL;
1532
1533 intFlowList = dynamic_cast<TList*>(outputListHistos->FindObject("Integrated Flow"));
1534 if(intFlowList)
1535 {
1536 intFlowProfiles = dynamic_cast<TList*>(intFlowList->FindObject("Profiles"));
1537 intFlowResults = dynamic_cast<TList*>(intFlowList->FindObject("Results"));
1538 } else
1539 {
1540 cout<<"WARNING: intFlowList is NULL in AFAWQC::GOH() !!!!"<<endl;
1541 }
1542
1543 // profiles:
1544 if(intFlowProfiles)
1545 {
1546 // average multiplicities:
1547 TProfile *avMultiplicity = dynamic_cast<TProfile*>(intFlowProfiles->FindObject("fAvMultiplicity"));
1548 if(avMultiplicity)
1549 {
1550 this->SetAvMultiplicity(avMultiplicity);
1551 } else
1552 {
1553 cout<<"WARNING: avMultiplicity is NULL in AFAWQC::GOH() !!!!"<<endl;
1554 }
1555
1556 // flags: (to be improved (united with other flags in this method))
1557 TString pWeightsFlag[2] = {"pWeights not used","pWeights used"};
1558 TString eWeightsFlag[2] = {"exact eWeights","non-exact eWeights"};
1559 //TString nuaFlag[2] = {"not corrected","corrected"};
1560 TString sinCosFlag[2] = {"sin","cos"};
1561
1562 for(Int_t pW=0;pW<1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights);pW++)
1563 {
1564 for(Int_t eW=0;eW<1;eW++)
1565 {
1566 // correlations (profiles):
1567 TProfile *qCorrelations = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(Form("fQCorrelations: %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));
1568 if(qCorrelations)
1569 {
1570 this->SetQCorrelations(qCorrelations,pW,eW);
1571 } else
1572 {
1573 cout<<"WARNING: qCorrelations is NULL in AFAWQC::GOH() !!!!"<<endl;
1574 cout<<"pW = "<<pW<<endl;
1575 cout<<"eW = "<<eW<<endl;
1576 }
1577 // products (profiles):
1578 TProfile *qProducts = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(Form("fQProducts: %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));
1579 if(qProducts)
1580 {
1581 this->SetQProducts(qProducts,pW,eW);
1582 } else
1583 {
1584 cout<<"WARNING: qProducts is NULL in AFAWQC::GOH() !!!!"<<endl;
1585 cout<<"pW = "<<pW<<endl;
1586 cout<<"eW = "<<eW<<endl;
1587 }
1588 // corrections (profiles):
1589 for(Int_t sc=0;sc<2;sc++)
1590 {
1591 TProfile *qCorrections = dynamic_cast<TProfile*>(intFlowProfiles->FindObject((Form("fQCorrections: %s, %s, %s terms",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),sinCosFlag[sc].Data()))));
1592 if(qCorrections)
1593 {
1594 this->SetQCorrections(qCorrections,pW,eW,sc);
1595 } else
1596 {
1597 cout<<"WARNING: qCorrections is NULL in AFAWQC::GOH() !!!!"<<endl;
1598 cout<<"pW = "<<pW<<endl;
1599 cout<<"eW = "<<eW<<endl;
1600 cout<<"sc = "<<sc<<endl;
1601 }
1602 } // end of for(Int_t sc=0;sc<2;sc++)
1603 } // end of for(Int_t eW=0;eW<1;eW++)
1604 } // end of for(Int_t pW=0;pW<1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights);pW++)
1605 } else // to if(intFlowProfiles)
1606 {
1607 cout<<"WARNING: intFlowProfiles is NULL in AFAWQC::GOH() !!!!"<<endl;
1608 }
1609
1610 // results:
1611 if(intFlowResults)
1612 {
1613 for(Int_t pW=0;pW<1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights);pW++)
1614 {
1615 for(Int_t eW=0;eW<2;eW++)
1616 {
1617 // flags: (to be improved (united with other flags in this method))
1618 TString pWeightsFlag[2] = {"pWeights not used","pWeights used"};
1619 TString eWeightsFlag[2] = {"exact eWeights","non-exact eWeights"};
1620 TString nuaFlag[2] = {"not corrected","corrected"};
c2a42ea2 1621 TString powerFlag[2] = {"linear","quadratic"};
2aa4ebcd 1622 //TString sinCosFlag[2] = {"sin","cos"};
1623 // correlations (results):
1624 TH1D *correlations = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("fCorrelations: %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));
1625 if(correlations)
1626 {
1627 this->SetCorrelations(correlations,pW,eW);
1628 } else
1629 {
1630 cout<<"WARNING: correlations is NULL in AFAWQC::GOH() !!!!"<<endl;
1631 cout<<"pW = "<<pW<<endl;
1632 cout<<"eW = "<<eW<<endl;
1633 }
1634 // corrections (results):
1635 TH1D *corrections = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("fCorrections: %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));
1636 if(corrections)
1637 {
1638 this->SetCorrections(corrections,pW,eW);
1639 } else
1640 {
1641 cout<<"WARNING: corrections is NULL in AFAWQC::GOH() !!!!"<<endl;
1642 cout<<"pW = "<<pW<<endl;
1643 cout<<"eW = "<<eW<<endl;
1644 }
1645 // covariances (results):
1646 TH1D *covariances = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("fCovariances: %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));
1647 if(covariances)
1648 {
1649 this->SetCovariances(covariances,pW,eW);
1650 } else
1651 {
1652 cout<<"WARNING: covariances is NULL in AFAWQC::GOH() !!!!"<<endl;
1653 cout<<"pW = "<<pW<<endl;
1654 cout<<"eW = "<<eW<<endl;
c2a42ea2 1655 }
1656 // sum of linear and quadratic event weights (results):
1657 for(Int_t power=0;power<2;power++)
1658 {
1659 TH1D *sumOfEventWeights = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("fSumOfEventWeights: %s, %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),powerFlag[power].Data())));
1660 if(sumOfEventWeights)
1661 {
1662 this->SetSumOfEventWeights(sumOfEventWeights,pW,eW,power);
1663 } else
1664 {
1665 cout<<"WARNING: sumOfEventWeights is NULL in AFAWQC::GOH() !!!!"<<endl;
1666 cout<<"pW = "<<pW<<endl;
1667 cout<<"eW = "<<eW<<endl;
1668 cout<<"power = "<<power<<endl;
1669 }
1670 } // end of for(Int_t power=0;power<2;power++)
1671 // products of event weights (results):
1672 TH1D *productOfEventWeights = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("fProductOfEventWeights: %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));
1673 if(productOfEventWeights)
1674 {
1675 this->SetProductOfEventWeights(productOfEventWeights,pW,eW);
1676 } else
1677 {
1678 cout<<"WARNING: productOfEventWeights is NULL in AFAWQC::GOH() !!!!"<<endl;
1679 cout<<"pW = "<<pW<<endl;
1680 cout<<"eW = "<<eW<<endl;
1681 }
1682
2aa4ebcd 1683 for(Int_t nua=0;nua<2;nua++)
1684 {
1685 // integrated Q-cumulants:
1686 TH1D *cumulants = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("fCumulants: %s, %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data())));
1687 if(cumulants)
1688 {
1689 this->SetCumulants(cumulants,pW,eW,nua);
1690 } else
1691 {
1692 cout<<"WARNING: cumulants is NULL in AFAWQC::GOH() !!!!"<<endl;
1693 cout<<"pW = "<<pW<<endl;
1694 cout<<"eW = "<<eW<<endl;
1695 cout<<"nua = "<<nua<<endl;
1696 }
1697 // integrated flow estimates from Q-cumulants:
1698 TH1D *intFlow = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("fIntFlow: %s, %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data())));
1699 if(intFlow)
1700 {
1701 this->SetIntFlow(intFlow,pW,eW,nua);
1702 } else
1703 {
1704 cout<<"WARNING: intFlow is NULL in AFAWQC::GOH() !!!!"<<endl;
1705 cout<<"pW = "<<pW<<endl;
1706 cout<<"eW = "<<eW<<endl;
1707 cout<<"nua = "<<nua<<endl;
1708 }
1709 } // end of for(Int_t nua=0;nua<2;nua++)
1710 } // end of for(Int_t eW=0;eW<1;eW++)
1711 } // end of for(Int_t pW=0;pW<1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights);pW++)
1712 } else // to if(intFlowResults)
1713 {
1714 cout<<"WARNING: intFlowResults is NULL in AFAWQC::GOH() !!!!"<<endl;
1715 }
1716
1717 // differential flow:
1718 TString typeFlag[2] = {"RP","POI"};
1719 TString pWeightsFlag[2] = {"not used","used"};
1720 TString eWeightsFlag[2] = {"exact","non-exact"};
1721 TString sinCosFlag[2] = {"sin","cos"};
1722 TString nuaFlag[2] = {"not corrected","corrected"}; // nua = non-uniform acceptance
1723 TString ptEtaFlag[2] = {"p_{t}","#eta"};
1724 // base list fDiffFlowList "Differential Flow":
1725 TList *diffFlowList = NULL;
1726 diffFlowList = dynamic_cast<TList*>(outputListHistos->FindObject("Differential Flow"));
1727 // list holding nested lists containing profiles:
1728 TList *diffFlowListProfiles = NULL;
1729 // list holding nested lists containing 2D and 1D histograms with final results:
1730 TList *diffFlowListResults = NULL;
1731 if(diffFlowList)
1732 {
1733 diffFlowListProfiles = dynamic_cast<TList*>(diffFlowList->FindObject("Profiles"));
1734 diffFlowListResults = dynamic_cast<TList*>(diffFlowList->FindObject("Results"));
1735 } else
1736 {
1737 cout<<"WARNING: diffFlowList is NULL in AFAWQC::GOH() !!!!"<<endl;
1738 }
1739
1740 // nested list in the list of profiles fDiffFlowListProfiles "Profiles":
1741 TList *dfpType[2] = {NULL};
1742 TList *dfpParticleWeights[2][2] = {NULL};
1743 TList *dfpEventWeights[2][2][2] = {NULL};
1744 TList *diffFlowCorrelations[2][2][2] = {NULL};
1745 TList *diffFlowProductsOfCorrelations[2][2][2] = {NULL};
1746 TList *diffFlowCorrectionTerms[2][2][2][2] = {NULL};
1747
1748 if(diffFlowListProfiles)
1749 {
1750 for(Int_t t=0;t<2;t++)
1751 {
1752 dfpType[t] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(typeFlag[t].Data()));
1753 if(dfpType[t])
1754 {
1755 for(Int_t pW=0;pW<(1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights));pW++)
1756 {
1757 dfpParticleWeights[t][pW] = dynamic_cast<TList*>(dfpType[t]->FindObject(Form("%s, pWeights %s",typeFlag[t].Data(),pWeightsFlag[pW].Data())));
1758 if(dfpParticleWeights[t][pW])
1759 {
1760 for(Int_t eW=0;eW<2;eW++)
1761 {
1762 dfpEventWeights[t][pW][eW] = dynamic_cast<TList*>(dfpParticleWeights[t][pW]->FindObject(Form("%s, pWeights %s, eWeights %s",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));
1763 if(dfpEventWeights[t][pW][eW])
1764 {
1765 // correlations:
1766 diffFlowCorrelations[t][pW][eW] = dynamic_cast<TList*>(dfpEventWeights[t][pW][eW]->FindObject(Form("Correlations (%s, pWeights %s, eWeights %s)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));
1767 // products of correlations:
1768 diffFlowProductsOfCorrelations[t][pW][eW] = dynamic_cast<TList*>(dfpEventWeights[t][pW][eW]->FindObject(Form("Products of correlations (%s, pWeights %s, eWeights %s)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));
1769 // correction terms:
1770 for(Int_t sc=0;sc<2;sc++)
1771 {
1772 diffFlowCorrectionTerms[t][pW][eW][sc] = dynamic_cast<TList*>(dfpEventWeights[t][pW][eW]->FindObject(Form("Corrections for NUA (%s, pWeights %s, eWeights %s, %s terms)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),sinCosFlag[sc].Data())));
1773 //this->SetDiffFlowCorrectionTerms(diffFlowCorrectionTerms[t][pW][sc],t,pW,sc);
1774 }
1775 } else // to if(dfpEventWeights[t][pW][eW])
1776 {
1777 cout<<"WARNING: dfpEventWeights[t][pW][eW] is NULL in AFAWQC::GOH() !!!!"<<endl;
1778 cout<<"t = "<<t<<endl;
1779 cout<<"pW = "<<pW<<endl;
1780 cout<<"eW = "<<eW<<endl;
1781 }
1782 } // end of for(Int_t eW=0;eW<2;eW++)
1783 } else // to if(dfpParticleWeights[t][pW])
1784 {
1785 cout<<"WARNING: dfpParticleWeights[t][pW] is NULL in AFAWQC::GOH() !!!!"<<endl;
1786 cout<<"t = "<<t<<endl;
1787 cout<<"pW = "<<pW<<endl;
1788 }
1789 } // end of for(Int_t pW=0;pW<(1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights));pW++)
1790 } else // if(dfpType[t])
1791 {
1792 cout<<"WARNING: dfpType[t] is NULL in AFAWQC::GOH() !!!!"<<endl;
1793 cout<<"t = "<<t<<endl;
1794 }
1795 } // end of for(Int_t t=0;t<2;t++)
1796 } else // to if(diffFlowListProfiles)
1797 {
1798 cout<<"WARNING: diffFlowListProfiles is NULL in AFAWQC::GOH() !!!!"<<endl;
1799 }
1800
1801 TProfile2D *correlationsPro[2][2][2][4] = {NULL};
1802 TProfile2D *productsOfCorrelationsPro[2][2][2][5] = {NULL};
1803 TProfile2D *correctionTermsPro[2][2][2][2][2] = {NULL};
1804
1805 TString correlationName[4] = {"<2'>","<4'>","<6'>","<8'>"};
1806 TString cumulantName[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
1807 TString productOfCorrelationsName[5] = {"<2><2'>","<2><4'>","<4><2'>","<4><4'>","<2'><4'>"};
1808 TString correctionsSinTermsName[2] = {"sin(1)","sin(2)"};
1809 TString correctionsCosTermsName[2] = {"cos(1)","cos(2)"};
1810 TString correctionName[4] = {"corr. to QC{2'}","corr. to QC{4'}","corr. to QC{6'}","corr. to QC{8'}"};
1811 TString covarianceName[4] = {"Cov(2,2')","Cov(2,4')","Cov(2',4')","Cov(4,2')"}; // to be improved (reorganized)
1812 TString flowName[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
1813
1814 for(Int_t t=0;t<2;t++)
1815 {
1816 for(Int_t pW=0;pW<(1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights));pW++)
1817 {
1818 for(Int_t eW=0;eW<2;eW++)
1819 {
1820 // correlations:
1821 if(diffFlowCorrelations[t][pW][eW])
1822 {
1823 for(Int_t correlationIndex=0;correlationIndex<4;correlationIndex++)
1824 {
1825 correlationsPro[t][pW][eW][correlationIndex] = dynamic_cast<TProfile2D*>(diffFlowCorrelations[t][pW][eW]->FindObject(correlationName[correlationIndex].Data()));
1826 if(correlationsPro[t][pW][eW][correlationIndex])
1827 {
1828 this->SetCorrelationsPro(correlationsPro[t][pW][eW][correlationIndex],t,pW,eW,correlationIndex);
1829 } else // to if(correlationsPro[t][pW][ew][correlationIndex])
1830 {
1831 cout<<"WARNING: correlationsPro[t][pW][eW][correlationIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
1832 cout<<"t = "<<t<<endl;
1833 cout<<"pW = "<<pW<<endl;
1834 cout<<"eW = "<<eW<<endl;
1835 cout<<"ci = "<<correlationIndex<<endl;
1836 }
1837 }
1838 } else // to if(diffFlowCorrelations[t][pW][eW])
1839 {
1840 cout<<"WARNING: diffFlowCorrelations[t][pW][eW] is NULL in AFAWQC::GOH() !!!!"<<endl;
1841 cout<<"t = "<<t<<endl;
1842 cout<<"pW = "<<pW<<endl;
1843 cout<<"eW = "<<eW<<endl;
1844 }
1845 // products of correlations:
1846 if(diffFlowProductsOfCorrelations[t][pW][eW])
1847 {
1848 for(Int_t productOfCorrelationsIndex=0;productOfCorrelationsIndex<5;productOfCorrelationsIndex++)
1849 {
1850 productsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex] = dynamic_cast<TProfile2D*>(diffFlowProductsOfCorrelations[t][pW][eW]->FindObject(productOfCorrelationsName[productOfCorrelationsIndex].Data()));
1851 if(productsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex])
1852 {
1853 this->SetProductsOfCorrelationsPro(productsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex],t,pW,eW,productOfCorrelationsIndex);
1854 } else // to if(productsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex])
1855 {
1856 cout<<"WARNING: productsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
1857 cout<<"t = "<<t<<endl;
1858 cout<<"pW = "<<pW<<endl;
1859 cout<<"eW = "<<eW<<endl;
1860 cout<<"ci = "<<productOfCorrelationsIndex<<endl;
1861 }
1862 }
1863 } else // to if(diffFlowProductsOfCorrelations[t][pW][eW])
1864 {
1865 cout<<"WARNING: diffFlowProductsOfCorrelations[t][pW][eW] is NULL in AFAWQC::GOH() !!!!"<<endl;
1866 cout<<"t = "<<t<<endl;
1867 cout<<"pW = "<<pW<<endl;
1868 cout<<"eW = "<<eW<<endl;
1869 }
1870 // correction terms:
1871 for(Int_t sc=0;sc<2;sc++)
1872 {
1873 if(diffFlowCorrectionTerms[t][pW][eW][sc])
1874 {
1875 for(Int_t correctionIndex=0;correctionIndex<2;correctionIndex++)
1876 {
1877 if(sc==0)
1878 {
1879 correctionTermsPro[t][pW][eW][sc][correctionIndex] = dynamic_cast<TProfile2D*>(diffFlowCorrectionTerms[t][pW][eW][sc]->FindObject(correctionsSinTermsName[correctionIndex].Data()));
1880 if(correctionTermsPro[t][pW][eW][sc][correctionIndex])
1881 {
1882 this->SetCorrectionTermsPro(correctionTermsPro[t][pW][eW][sc][correctionIndex],t,pW,eW,sc,correctionIndex);
1883 } else
1884 {
1885 cout<<"WARNING: correctionTermsPro[t][pW][eW][sc][correctionIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
1886 cout<<"t = "<<t<<endl;
1887 cout<<"pW = "<<pW<<endl;
1888 cout<<"eW = "<<eW<<endl;
1889 cout<<"sc = "<<sc<<endl;
1890 cout<<"ci = "<<correctionIndex<<endl;
1891 }
1892 }
1893 if(sc==1)
1894 {
1895 correctionTermsPro[t][pW][eW][sc][correctionIndex] = dynamic_cast<TProfile2D*>(diffFlowCorrectionTerms[t][pW][eW][sc]->FindObject(correctionsCosTermsName[correctionIndex].Data()));
1896 if(correctionTermsPro[t][pW][eW][sc][correctionIndex])
1897 {
1898 this->SetCorrectionTermsPro(correctionTermsPro[t][pW][eW][sc][correctionIndex],t,pW,eW,sc,correctionIndex);
1899 } else
1900 {
1901 cout<<"WARNING: correctionTermsPro[t][pW][eW][sc][correctionIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
1902 cout<<"t = "<<t<<endl;
1903 cout<<"pW = "<<pW<<endl;
1904 cout<<"eW = "<<eW<<endl;
1905 cout<<"sc = "<<sc<<endl;
1906 cout<<"ci = "<<correctionIndex<<endl;
1907 }
1908 }
1909 } // end of for(Int_t correctionIndex=0;correctionIndex<2;correctionIndex++)
1910 } else // to if(diffFlowCorrectionTerms[t][pW][eW][sc])
1911 {
1912 cout<<"WARNING: diffFlowCorrectionTerms[t][pW][eW][sc] is NULL in AFAWQC::GOH() !!!!"<<endl;
1913 cout<<"t = "<<t<<endl;
1914 cout<<"pW = "<<pW<<endl;
1915 cout<<"eW = "<<eW<<endl;
1916 cout<<"sc = "<<sc<<endl;
1917 }
1918 } // end of for(Int_t sc=0;sc<2;sc++)
1919 } // end of for(Int_t eW=0;eW<2;eW++)
1920 } // end of for(Int_t pW=0;pW<(1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights));pW++)
1921 } // end of for(Int_t t=0;t<2;t++)
1922
1923 // nested list in the list of results fDiffFlowListResults "Results":
1924 TList *dfrType[2] = {NULL};
1925 TList *dfrParticleWeights[2][2] = {NULL};
1926 TList *dfrEventWeights[2][2][2] = {NULL};
1927 TList *dfrCorrections[2][2][2][2] = {NULL};
1928 TList *diffFlowFinalCorrelations[2][2][2] = {NULL};
1929 TList *diffFlowFinalCorrections[2][2][2] = {NULL};
1930 TList *diffFlowFinalCovariances[2][2][2] = {NULL};
1931 TList *diffFlowFinalCumulants[2][2][2][2] = {NULL};
1932 TList *diffFlowFinalFlow[2][2][2][2] = {NULL};
1933
1934 if(diffFlowListResults)
1935 {
1936 for(Int_t t=0;t<2;t++)
1937 {
1938 dfrType[t] = dynamic_cast<TList*>(diffFlowListResults->FindObject(typeFlag[t].Data()));
1939 if(dfrType[t])
1940 {
1941 for(Int_t pW=0;pW<(1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights));pW++)
1942 {
1943 dfrParticleWeights[t][pW] = dynamic_cast<TList*>(dfrType[t]->FindObject(Form("%s, pWeights %s",typeFlag[t].Data(),pWeightsFlag[pW].Data())));
1944 if(dfrParticleWeights[t][pW])
1945 {
1946 for(Int_t eW=0;eW<2;eW++)
1947 {
1948 dfrEventWeights[t][pW][eW] = dynamic_cast<TList*>(dfrParticleWeights[t][pW]->FindObject(Form("%s, pWeights %s, eWeights %s",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));
1949 if(dfrEventWeights[t][pW][eW])
1950 {
1951 diffFlowFinalCorrelations[t][pW][eW] = dynamic_cast<TList*>(dfrEventWeights[t][pW][eW]->FindObject(Form("Correlations (%s, pWeights %s, eWeights %s)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));
1952 diffFlowFinalCorrections[t][pW][eW] = dynamic_cast<TList*>(dfrEventWeights[t][pW][eW]->FindObject(Form("Corrections (%s, pWeights %s, eWeights %s)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));
1953 diffFlowFinalCovariances[t][pW][eW] = dynamic_cast<TList*>(dfrEventWeights[t][pW][eW]->FindObject(Form("Covariances (%s, pWeights %s, eWeights %s)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));
1954 for(Int_t nua=0;nua<2;nua++)
1955 {
1956 dfrCorrections[t][pW][eW][nua] = dynamic_cast<TList*>(dfrEventWeights[t][pW][eW]->FindObject(Form("%s, pWeights %s, eWeights %s, %s for NUA",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data())));
1957 if(dfrCorrections[t][pW][eW][nua])
1958 {
1959 diffFlowFinalCumulants[t][pW][eW][nua] = dynamic_cast<TList*>(dfrCorrections[t][pW][eW][nua]->FindObject(Form("Cumulants (%s, pWeights %s, eWeights %s, %s for NUA)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data())));
1960 diffFlowFinalFlow[t][pW][eW][nua] = dynamic_cast<TList*>(dfrCorrections[t][pW][eW][nua]->FindObject(Form("Differential Flow (%s, pWeights %s, eWeights %s, %s for NUA)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data())));
1961 } else // to if(dfrCorrections[t][pW][eW][nua])
1962 {
1963 cout<<"WARNING: dfrCorrections[t][pW][eW][nua] is NULL in AFAWQC::GOH() !!!!"<<endl;
1964 cout<<"t = "<<t<<endl;
1965 cout<<"pW = "<<pW<<endl;
1966 cout<<"eW = "<<eW<<endl;
1967 cout<<"nua = "<<nua<<endl;
1968 }
1969 } // end of for(Int_t nua=0;nua<2;nua++)
1970 } else // to if(dfrEventWeights[t][pW][eW])
1971 {
1972 cout<<"WARNING: dfrEventWeights[t][pW][eW] is NULL in AFAWQC::GOH() !!!!"<<endl;
1973 cout<<"t = "<<t<<endl;
1974 cout<<"pW = "<<pW<<endl;
1975 cout<<"eW = "<<eW<<endl;
1976 }
1977 } // end of for(Int_t eW=0;eW<2;eW++)
1978 } else // to if(dfrParticleWeights[t][pW])
1979 {
1980 cout<<"WARNING: dfrParticleWeights[t][pW] is NULL in AFAWQC::GOH() !!!!"<<endl;
1981 cout<<"t = "<<t<<endl;
1982 cout<<"pW = "<<pW<<endl;
1983 }
1984 } // end of for(Int_t pW=0;pW<(1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights));pW++)
1985 } else // to if(dfrType[t])
1986 {
1987 cout<<"WARNING: dfrType[t] is NULL in AFAWQC::GOH() !!!!"<<endl;
1988 cout<<"t = "<<t<<endl;
1989 }
1990 } // end of for(Int_t t=0;t<2;t++)
1991 } else // to if(diffFlowListResults)
1992 {
1993 cout<<"WARNING: diffFlowListResults is NULL in AFAWQC::GOH() !!!!"<<endl;
1994 }
ae733b3b 1995
2aa4ebcd 1996 TH2D *finalCorrelations2D[2][2][2][4] = {NULL};
1997 TH1D *finalCorrelations1D[2][2][2][2][4] = {NULL};
1998 TH2D *finalCumulants2D[2][2][2][2][4] = {NULL};
1999 TH1D *finalCumulantsPt[2][2][2][2][4] = {NULL};
2000 TH1D *finalCumulantsEta[2][2][2][2][4] = {NULL};
2001 TH2D *finalCorrections2D[2][2][2][4] = {NULL};
2002 TH1D *finalCorrections1D[2][2][2][2][4] = {NULL};
2003 TH2D *finalCovariances2D[2][2][2][4] = {NULL};
2004 TH1D *finalCovariances1D[2][2][2][2][4] = {NULL};
2005 TH2D *finalFlow2D[2][2][2][2][4] = {NULL};
2006 TH1D *finalFlowPt[2][2][2][2][4] = {NULL};
2007 TH1D *finalFlowEta[2][2][2][2][4] = {NULL};
2008 TH2D *nonEmptyBins2D[2] = {NULL};
2009 TH1D *nonEmptyBins1D[2][2] = {NULL};
2010
2011 for(Int_t t=0;t<2;t++)
9c1a9547 2012 {
2aa4ebcd 2013 // 2D:
2014 nonEmptyBins2D[t] = dynamic_cast<TH2D*>(dfrType[t]->FindObject(Form("%s, (p_{t},#eta)",typeFlag[t].Data())));
2015 if(nonEmptyBins2D[t])
2016 {
2017 this->SetNonEmptyBins2D(nonEmptyBins2D[t],t);
2018 } else
2019 {
2020 cout<<"WARNING: nonEmptyBins2D[t] is NULL in AFAWQC::GOH() !!!!"<<endl;
2021 cout<<"t = "<<t<<endl;
2022 }
2023 // 1D:
2024 for(Int_t pe=0;pe<2;pe++)
2025 {
2026 nonEmptyBins1D[t][pe] = dynamic_cast<TH1D*>(dfrType[t]->FindObject(Form("%s, %s",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
2027 if(nonEmptyBins1D[t][pe])
2028 {
2029 this->SetNonEmptyBins1D(nonEmptyBins1D[t][pe],t,pe);
2030 } else
2031 {
2032 cout<<"WARNING: nonEmptyBins1D[t][pe] is NULL in AFAWQC::GOH() !!!!"<<endl;
2033 cout<<"t = "<<t<<endl;
2034 cout<<"pe = "<<pe<<endl;
2035 }
2036 }
9c1a9547 2037
2aa4ebcd 2038 for(Int_t pW=0;pW<(1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights));pW++)
2039 {
2040 for(Int_t eW=0;eW<2;eW++)
2041 {
2042 // correlations:
2043 if(diffFlowFinalCorrelations[t][pW][eW])
2044 {
2045 for(Int_t correlationIndex=0;correlationIndex<4;correlationIndex++)
2046 {
2047 // 2D:
2048 finalCorrelations2D[t][pW][eW][correlationIndex] = dynamic_cast<TH2D*>(diffFlowFinalCorrelations[t][pW][eW]->FindObject(Form("%s, (p_{t},#eta)",correlationName[correlationIndex].Data())));
2049 if(finalCorrelations2D[t][pW][eW][correlationIndex])
2050 {
2051 this->SetFinalCorrelations2D(finalCorrelations2D[t][pW][eW][correlationIndex],t,pW,eW,correlationIndex);
2052 } else
2053 {
2054 cout<<"WARNING: finalCorrelations2D[t][pW][eW][correlationIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
2055 cout<<"t = "<<t<<endl;
2056 cout<<"pW = "<<pW<<endl;
2057 cout<<"eW = "<<eW<<endl;
2058 cout<<"ci = "<<correlationIndex<<endl;
2059 }
2060 // 1D
2061 for(Int_t pe=0;pe<2;pe++)
2062 {
2063 if(pe==0)
2064 {
2065 finalCorrelations1D[t][pW][eW][pe][correlationIndex] = dynamic_cast<TH1D*>(diffFlowFinalCorrelations[t][pW][eW]->FindObject(Form("%s, (p_{t})",correlationName[correlationIndex].Data())));
2066 }
2067 if(pe==1)
2068 {
2069 finalCorrelations1D[t][pW][eW][pe][correlationIndex] = dynamic_cast<TH1D*>(diffFlowFinalCorrelations[t][pW][eW]->FindObject(Form("%s, (#eta)",correlationName[correlationIndex].Data())));
2070 }
2071 if(finalCorrelations1D[t][pW][eW][pe][correlationIndex])
2072 {
2073 this->SetFinalCorrelations1D(finalCorrelations1D[t][pW][eW][pe][correlationIndex],t,pW,eW,pe,correlationIndex);
2074 } else
2075 {
2076 cout<<"WARNING: finalCorrelations1D[t][pW][eW][pe][correlationIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
2077 cout<<"t = "<<t<<endl;
2078 cout<<"pW = "<<pW<<endl;
2079 cout<<"eW = "<<eW<<endl;
2080 cout<<"pe = "<<pe<<endl;
2081 cout<<"ci = "<<correlationIndex<<endl;
2082 }
2083 } // end of for(Int_t pe=0;pe<2;pe++)
2084 } // end of for(Int_t correlationIndex=0;correlationIndex<4;correlationIndex++)
2085 } else // to if(diffFlowFinalCorrelations[t][pW][eW])
2086 {
2087 cout<<"WARNING: diffFlowFinalCorrelations[t][pW] is NULL in AFAWQC::GOH() !!!!"<<endl;
2088 cout<<"t = "<<t<<endl;
2089 cout<<"pW = "<<pW<<endl;
2090 cout<<"eW = "<<eW<<endl;
2091 }
2092 // corrections:
2093 if(diffFlowFinalCorrections[t][pW][eW])
2094 {
2095 for(Int_t correctionIndex=0;correctionIndex<4;correctionIndex++)
2096 {
2097 // 2D:
2098 finalCorrections2D[t][pW][eW][correctionIndex] = dynamic_cast<TH2D*>(diffFlowFinalCorrections[t][pW][eW]->FindObject(Form("%s, (p_{t},#eta)",correctionName[correctionIndex].Data())));
2099 if(finalCorrections2D[t][pW][eW][correctionIndex])
2100 {
2101 this->SetFinalCorrections2D(finalCorrections2D[t][pW][eW][correctionIndex],t,pW,eW,correctionIndex);
2102 } else
2103 {
2104 cout<<"WARNING: finalCorrections2D[t][pW][eW][correctionIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
2105 cout<<"t = "<<t<<endl;
2106 cout<<"pW = "<<pW<<endl;
2107 cout<<"eW = "<<eW<<endl;
2108 cout<<"ci = "<<correctionIndex<<endl;
2109 }
2110 // 1D
2111 for(Int_t pe=0;pe<2;pe++)
2112 {
2113 if(pe==0)
2114 {
2115 finalCorrections1D[t][pW][eW][pe][correctionIndex] = dynamic_cast<TH1D*>(diffFlowFinalCorrections[t][pW][eW]->FindObject(Form("%s, (p_{t})",correctionName[correctionIndex].Data())));
2116 }
2117 if(pe==1)
2118 {
2119 finalCorrections1D[t][pW][eW][pe][correctionIndex] = dynamic_cast<TH1D*>(diffFlowFinalCorrections[t][pW][eW]->FindObject(Form("%s, (#eta)",correctionName[correctionIndex].Data())));
2120 }
2121 if(finalCorrections1D[t][pW][eW][pe][correctionIndex])
2122 {
2123 this->SetFinalCorrections1D(finalCorrections1D[t][pW][eW][pe][correctionIndex],t,pW,eW,pe,correctionIndex);
2124 } else
2125 {
2126 cout<<"WARNING: finalCorrections1D[t][pW][eW][pe][correctionIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
2127 cout<<"t = "<<t<<endl;
2128 cout<<"pW = "<<pW<<endl;
2129 cout<<"eW = "<<eW<<endl;
2130 cout<<"pe = "<<pe<<endl;
2131 cout<<"ci = "<<correctionIndex<<endl;
2132 }
2133 } // end of for(Int_t pe=0;pe<2;pe++)
2134 } // end of for(Int_t correctionIndex=0;correctionIndex<4;correctionIndex++)
2135 } else // to if(diffFlowFinalCorrections[t][pW][eW])
2136 {
2137 cout<<"WARNING: diffFlowFinalCorrections[t][pW][eW] is NULL in AFAWQC::GOH() !!!!"<<endl;
2138 cout<<"t = "<<t<<endl;
2139 cout<<"pW = "<<pW<<endl;
2140 cout<<"eW = "<<eW<<endl;
2141 }
2142 // covariances:
2143 if(diffFlowFinalCovariances[t][pW][eW])
2144 {
2145 for(Int_t covarianceIndex=0;covarianceIndex<4;covarianceIndex++)
2146 {
2147 // 2D:
2148 finalCovariances2D[t][pW][eW][covarianceIndex] = dynamic_cast<TH2D*>(diffFlowFinalCovariances[t][pW][eW]->FindObject(Form("%s, (p_{t},#eta)",covarianceName[covarianceIndex].Data())));
2149 if(finalCovariances2D[t][pW][eW][covarianceIndex])
2150 {
2151 this->SetFinalCovariances2D(finalCovariances2D[t][pW][eW][covarianceIndex],t,pW,eW,covarianceIndex);
2152 } else
2153 {
2154 cout<<"WARNING: finalCovariances2D[t][pW][eW][nua][covarianceIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
2155 cout<<"t = "<<t<<endl;
2156 cout<<"pW = "<<pW<<endl;
2157 cout<<"eW = "<<eW<<endl;
2158 cout<<"ci = "<<covarianceIndex<<endl;
2159 }
2160 // 1D:
2161 for(Int_t pe=0;pe<2;pe++)
2162 {
2163 if(pe==0)
2164 {
2165 finalCovariances1D[t][pW][eW][pe][covarianceIndex] = dynamic_cast<TH1D*>(diffFlowFinalCovariances[t][pW][eW]->FindObject(Form("%s, (p_{t})",covarianceName[covarianceIndex].Data())));
2166 }
2167 if(pe==1)
2168 {
2169 finalCovariances1D[t][pW][eW][pe][covarianceIndex] = dynamic_cast<TH1D*>(diffFlowFinalCovariances[t][pW][eW]->FindObject(Form("%s, (#eta)",covarianceName[covarianceIndex].Data())));
2170 }
2171 if(finalCovariances1D[t][pW][eW][pe][covarianceIndex])
2172 {
2173 this->SetFinalCovariances1D(finalCovariances1D[t][pW][eW][pe][covarianceIndex],t,pW,eW,pe,covarianceIndex);
2174 } else
2175 {
2176 cout<<"WARNING: finalCovariances1D[t][pW][eW][pe][covarianceIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
2177 cout<<"t = "<<t<<endl;
2178 cout<<"pW = "<<pW<<endl;
2179 cout<<"eW = "<<eW<<endl;
2180 cout<<"pe = "<<pe<<endl;
2181 cout<<"ci = "<<covarianceIndex<<endl;
2182 }
2183 } // end of for(Int_t pe=0;pe<2;pe++)
2184 } // end of for(Int_t covarianceIndex=0;covarianceIndex<4;covarianceIndex++)
2185 } else // to if(diffFlowFinalCovariances[t][pW][eW])
2186 {
2187 cout<<"WARNING: diffFlowFinalCovariances[t][pW][eW] is NULL in AFAWQC::GOH() !!!!"<<endl;
2188 cout<<"t = "<<t<<endl;
2189 cout<<"pW = "<<pW<<endl;
2190 cout<<"eW = "<<eW<<endl;
2191 }
2192
2193 for(Int_t nua=0;nua<2;nua++)
2194 {
2195 // cumulants:
2196 if(diffFlowFinalCumulants[t][pW][eW][nua])
2197 {
2198 for(Int_t cumulantIndex=0;cumulantIndex<4;cumulantIndex++)
2199 {
2200 // 2D:
2201 finalCumulants2D[t][pW][eW][nua][cumulantIndex] = dynamic_cast<TH2D*>(diffFlowFinalCumulants[t][pW][eW][nua]->FindObject(Form("%s, (p_{t},#eta)",cumulantName[cumulantIndex].Data())));
2202 if(finalCumulants2D[t][pW][eW][nua][cumulantIndex])
2203 {
2204 this->SetFinalCumulants2D(finalCumulants2D[t][pW][eW][nua][cumulantIndex],t,pW,eW,nua,cumulantIndex);
2205 } else
2206 {
2207 cout<<"WARNING: finalCumulants2D[t][pW][eW][nua][cumulantIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
2208 cout<<"t = "<<t<<endl;
2209 cout<<"pW = "<<pW<<endl;
2210 cout<<"eW = "<<eW<<endl;
2211 cout<<"nua = "<<nua<<endl;
2212 cout<<"ci = "<<cumulantIndex<<endl;
2213 }
2214 // pt:
2215 finalCumulantsPt[t][pW][eW][nua][cumulantIndex] = dynamic_cast<TH1D*>(diffFlowFinalCumulants[t][pW][eW][nua]->FindObject(Form("%s, (p_{t})",cumulantName[cumulantIndex].Data())));
2216 if(finalCumulantsPt[t][pW][eW][nua][cumulantIndex])
2217 {
2218 this->SetFinalCumulantsPt(finalCumulantsPt[t][pW][eW][nua][cumulantIndex],t,pW,eW,nua,cumulantIndex);
2219 } else
2220 {
2221 cout<<"WARNING: finalCumulantsPt[t][pW][eW][nua][cumulantIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
2222 cout<<"t = "<<t<<endl;
2223 cout<<"pW = "<<pW<<endl;
2224 cout<<"eW = "<<eW<<endl;
2225 cout<<"nua = "<<nua<<endl;
2226 cout<<"ci = "<<cumulantIndex<<endl;
2227 }
2228 // eta:
2229 finalCumulantsEta[t][pW][eW][nua][cumulantIndex] = dynamic_cast<TH1D*>(diffFlowFinalCumulants[t][pW][eW][nua]->FindObject(Form("%s, (#eta)",cumulantName[cumulantIndex].Data())));
2230 if(finalCumulantsEta[t][pW][eW][nua][cumulantIndex])
2231 {
2232 this->SetFinalCumulantsEta(finalCumulantsEta[t][pW][eW][nua][cumulantIndex],t,pW,eW,nua,cumulantIndex);
2233 } else
2234 {
2235 cout<<"WARNING: finalCumulantsEta[t][pW][eW][nua][cumulantIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
2236 cout<<"t = "<<t<<endl;
2237 cout<<"pW = "<<pW<<endl;
2238 cout<<"eW = "<<eW<<endl;
2239 cout<<"nua = "<<nua<<endl;
2240 cout<<"ci = "<<cumulantIndex<<endl;
2241 }
2242 } // end of for(Int_t cumulantIndex=0;cumulantIndex<4;cumulantIndex++)
2243 } else // to if(diffFlowFinalCumulants[t][pW][eW][nua])
2244 {
2245 cout<<"WARNING: diffFlowFinalCumulants[t][pW][eW][nua] is NULL in AFAWQC::GOH() !!!!"<<endl;
2246 cout<<"t = "<<t<<endl;
2247 cout<<"pW = "<<pW<<endl;
2248 cout<<"eW = "<<eW<<endl;
2249 cout<<"nua = "<<nua<<endl;
2250 }
2251 // flow:
2252 if(diffFlowFinalFlow[t][pW][eW][nua])
2253 {
2254 for(Int_t flowIndex=0;flowIndex<4;flowIndex++)
2255 {
2256 // 2D:
2257 finalFlow2D[t][pW][eW][nua][flowIndex] = dynamic_cast<TH2D*>(diffFlowFinalFlow[t][pW][eW][nua]->FindObject(Form("%s, (p_{t},#eta)",flowName[flowIndex].Data())));
2258 if(finalFlow2D[t][pW][eW][nua][flowIndex])
2259 {
2260 this->SetFinalFlow2D(finalFlow2D[t][pW][eW][nua][flowIndex],t,pW,eW,nua,flowIndex);
2261 } else
2262 {
2263 cout<<"WARNING: finalFlow2D[t][pW][eW][nua][flowIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
2264 cout<<"t = "<<t<<endl;
2265 cout<<"pW = "<<pW<<endl;
2266 cout<<"eW = "<<eW<<endl;
2267 cout<<"nua = "<<nua<<endl;
2268 cout<<"ci = "<<flowIndex<<endl;
2269 }
2270 // pt:
2271 finalFlowPt[t][pW][eW][nua][flowIndex] = dynamic_cast<TH1D*>(diffFlowFinalFlow[t][pW][eW][nua]->FindObject(Form("%s, (p_{t})",flowName[flowIndex].Data())));
2272 if(finalFlowPt[t][pW][eW][nua][flowIndex])
2273 {
2274 this->SetFinalFlowPt(finalFlowPt[t][pW][eW][nua][flowIndex],t,pW,eW,nua,flowIndex);
2275 } else
2276 {
2277 cout<<"WARNING: finalFlow1D[t][pW][nua][flowIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
2278 cout<<"t = "<<t<<endl;
2279 cout<<"pW = "<<pW<<endl;
2280 cout<<"eW = "<<eW<<endl;
2281 cout<<"nua = "<<nua<<endl;
2282 cout<<"ci = "<<flowIndex<<endl;
2283 }
2284 // eta:
2285 finalFlowEta[t][pW][eW][nua][flowIndex] = dynamic_cast<TH1D*>(diffFlowFinalFlow[t][pW][eW][nua]->FindObject(Form("%s, (#eta)",flowName[flowIndex].Data())));
2286 if(finalFlowEta[t][pW][eW][nua][flowIndex])
2287 {
2288 this->SetFinalFlowEta(finalFlowEta[t][pW][eW][nua][flowIndex],t,pW,eW,nua,flowIndex);
2289 } else
2290 {
2291 cout<<"WARNING: finalFlow1D[t][pW][nua][flowIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
2292 cout<<"t = "<<t<<endl;
2293 cout<<"pW = "<<pW<<endl;
2294 cout<<"eW = "<<eW<<endl;
2295 cout<<"nua = "<<nua<<endl;
2296 cout<<"ci = "<<flowIndex<<endl;
2297 }
2298 } // end of for(Int_t flowIndex=0;flowIndex<4;flowIndex++)
2299 } else // to if(diffFlowFinalFlow[t][pW][eW][nua])
2300 {
2301 cout<<"WARNING: diffFlowFinalFlow[t][pW][eW][nua] is NULL in AFAWQC::GOH() !!!!"<<endl;
2302 cout<<"t = "<<t<<endl;
2303 cout<<"pW = "<<pW<<endl;
2304 cout<<"eW = "<<eW<<endl;
2305 cout<<"nua = "<<nua<<endl;
2306 }
2307 } // end of for(Int_t nua=0;nua<2;nua++)
2308 } // end of for(Int_t eW=0;eW<2;eW++)
2309 } // end of for(Int_t pW=0;pW<(1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights));pW++)
2310 } // end of for(Int_t t=0;t<2;t++)
2311
2312 // x.) nested loops:
2313 TList *nestedLoopsList = dynamic_cast<TList*>(outputListHistos->FindObject("Nested Loops"));
2314 if(nestedLoopsList) this->SetNestedLoopsList(nestedLoopsList);
2315 TProfile *evaluateNestedLoops = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fEvaluateNestedLoops"));
2316 Bool_t bEvaluateNestedLoopsForIntFlow = kFALSE;
2317 Bool_t bEvaluateNestedLoopsForDiffFlow = kFALSE;
2318 if(evaluateNestedLoops)
2319 {
2320 this->SetEvaluateNestedLoops(evaluateNestedLoops);
2321 bEvaluateNestedLoopsForIntFlow = (Int_t)evaluateNestedLoops->GetBinContent(1);
2322 bEvaluateNestedLoopsForDiffFlow = (Int_t)evaluateNestedLoops->GetBinContent(2);
2323 }
9c1a9547 2324
2aa4ebcd 2325 if(bEvaluateNestedLoopsForIntFlow)
2326 {
2327 TProfile *directCorrelations = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrelation"));
2328 if(directCorrelations) this->SetDirectCorrelations(directCorrelations);
2329 TProfile *directCorrectionsCos = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrectionsCos"));
2330 if(directCorrectionsCos) this->SetDirectCorrectionsCos(directCorrectionsCos);
2331 TProfile *directCorrectionsSin = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrectionsSin"));
2332 if(directCorrectionsSin) this->SetDirectCorrectionsSin(directCorrectionsSin);
2333 if(bUsePhiWeights||bUsePtWeights||bUseEtaWeights)
2334 {
2335 TProfile *directCorrelationsW = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrelationW"));
2336 if(directCorrelationsW) this->SetDirectCorrelationsW(directCorrelationsW);
2337 TProfile *directCorrectionsCosW = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrectionsCosW"));
2338 if(directCorrectionsCosW) this->SetDirectCorrectionsCosW(directCorrectionsCosW);
2339 TProfile *directCorrectionsSinW = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrectionsSinW"));
2340 if(directCorrectionsSinW) this->SetDirectCorrectionsSinW(directCorrectionsSinW);
2341 }
2342 }
2343
2344 if(bEvaluateNestedLoopsForDiffFlow)
2345 {
2346 TProfile *directCorrelationsDiffFlow = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrelationsDiffFlow"));
2347 if(directCorrelationsDiffFlow) this->SetDirectCorrelationsDiffFlow(directCorrelationsDiffFlow);
2348 TProfile *directCorrectionsDiffFlowCos = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrectionsDiffFlowCos"));
2349 if(directCorrectionsDiffFlowCos) this->SetDirectCorrectionsDiffFlowCos(directCorrectionsDiffFlowCos);
2350 TProfile *directCorrectionsDiffFlowSin = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrectionsDiffFlowSin"));
2351 if(directCorrectionsDiffFlowSin) this->SetDirectCorrectionsDiffFlowSin(directCorrectionsDiffFlowSin);
2352 if(bUsePhiWeights||bUsePtWeights||bUseEtaWeights)
2353 {
2354 TProfile *directCorrelationsDiffFlowW = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrelationsDiffFlowW"));
2355 if(directCorrelationsDiffFlowW) this->SetDirectCorrelationsDiffFlowW(directCorrelationsDiffFlowW);
2356 TProfile *directCorrectionsDiffFlowCosW = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrectionsDiffFlowCosW"));
2357 if(directCorrectionsDiffFlowCosW) this->SetDirectCorrectionsDiffFlowCosW(directCorrectionsDiffFlowCosW);
2358 TProfile *directCorrectionsDiffFlowSinW = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrectionsDiffFlowSinW"));
2359 if(directCorrectionsDiffFlowSinW) this->SetDirectCorrectionsDiffFlowSinW(directCorrectionsDiffFlowSinW);
2360 }
2361 }
2362
2363 }
2364}
bc92c0cb 2365
2366
9c1a9547 2367//================================================================================================================================
bc92c0cb 2368
2369
2aa4ebcd 2370TProfile* AliFlowAnalysisWithQCumulants::MakePtProjection(TProfile2D *profilePtEta) const
9c1a9547 2371{
2aa4ebcd 2372 // project 2D profile onto pt axis to get 1D profile
9c1a9547 2373
2aa4ebcd 2374 Int_t nBinsPt = profilePtEta->GetNbinsX();
2375 Double_t dPtMin = (profilePtEta->GetXaxis())->GetXmin();
2376 Double_t dPtMax = (profilePtEta->GetXaxis())->GetXmax();
9c1a9547 2377
2aa4ebcd 2378 Int_t nBinsEta = profilePtEta->GetNbinsY();
9c1a9547 2379
2aa4ebcd 2380 TProfile *profilePt = new TProfile("","",nBinsPt,dPtMin,dPtMax);
9c1a9547 2381
2aa4ebcd 2382 for(Int_t p=1;p<=nBinsPt;p++)
2383 {
2384 Double_t contentPt = 0.;
2385 Double_t entryPt = 0.;
2386 Double_t spreadPt = 0.;
2387 Double_t sum1 = 0.;
2388 Double_t sum2 = 0.;
2389 Double_t sum3 = 0.;
2390 for(Int_t e=1;e<=nBinsEta;e++)
9c1a9547 2391 {
2aa4ebcd 2392 contentPt += (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)))
2393 * (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
2394 entryPt += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
2395
2396 sum1 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)))
2397 * (pow(profilePtEta->GetBinError(profilePtEta->GetBin(p,e)),2.)
2398 + pow(profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)),2.));
2399 sum2 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
2400 sum3 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)))
2401 * (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)));
9c1a9547 2402 }
2aa4ebcd 2403 if(sum2>0. && sum1/sum2-pow(sum3/sum2,2.) > 0.)
9c1a9547 2404 {
2aa4ebcd 2405 spreadPt = pow(sum1/sum2-pow(sum3/sum2,2.),0.5);
9c1a9547 2406 }
2aa4ebcd 2407 profilePt->SetBinContent(p,contentPt);
2408 profilePt->SetBinEntries(p,entryPt);
2409 {
2410 profilePt->SetBinError(p,spreadPt);
2411 }
2412
2413 }
2414
2415 return profilePt;
2416
2417} // end of TProfile* AliFlowAnalysisWithQCumulants::MakePtProjection(TProfile2D *profilePtEta)
2418
2419
2420//================================================================================================================================
2421
2422
2423TProfile* AliFlowAnalysisWithQCumulants::MakeEtaProjection(TProfile2D *profilePtEta) const
2424{
2425 // project 2D profile onto eta axis to get 1D profile
2426
2427 Int_t nBinsEta = profilePtEta->GetNbinsY();
2428 Double_t dEtaMin = (profilePtEta->GetYaxis())->GetXmin();
2429 Double_t dEtaMax = (profilePtEta->GetYaxis())->GetXmax();
2430
2431 Int_t nBinsPt = profilePtEta->GetNbinsX();
2432
2433 TProfile *profileEta = new TProfile("","",nBinsEta,dEtaMin,dEtaMax);
2434
2435 for(Int_t e=1;e<=nBinsEta;e++)
2436 {
2437 Double_t contentEta = 0.;
2438 Double_t entryEta = 0.;
2439 for(Int_t p=1;p<=nBinsPt;p++)
9c1a9547 2440 {
2aa4ebcd 2441 contentEta += (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)))
2442 * (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
2443 entryEta += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
9c1a9547 2444 }
2aa4ebcd 2445 profileEta->SetBinContent(e,contentEta);
2446 profileEta->SetBinEntries(e,entryEta);
2447 }
9c1a9547 2448
2aa4ebcd 2449 return profileEta;
9c1a9547 2450
2aa4ebcd 2451} // end of TProfile* AliFlowAnalysisWithQCumulants::MakeEtaProjection(TProfile2D *profilePtEta)
2452
2453
2454//================================================================================================================================
2455
2456
2457void AliFlowAnalysisWithQCumulants::CalculateFinalCorrectionsForNonUniformAcceptanceForCumulantsForIntFlow(Bool_t useParticleWeights, TString eventWeights)
2458{
2459 // calculate final corrections for non-uniform acceptance for QC{2}, QC{4}, QC{6} and QC{8}
9c1a9547 2460
2aa4ebcd 2461 // corrections for non-uniform acceptance (NUA) are stored in histogram fCorrectionsForNUA,
2462 // binning of fCorrectionsForNUA is organized as follows:
2463 //
2464 // 1st bin: correction to QC{2}
2465 // 2nd bin: correction to QC{4}
2466 // 3rd bin: correction to QC{6}
2467 // 4th bin: correction to QC{8}
9c1a9547 2468
2aa4ebcd 2469 // shortcuts flags:
2470 Int_t pW = (Int_t)(useParticleWeights);
2471
2472 Int_t eW = -1;
2473
2474 if(eventWeights == "exact")
2475 {
2476 eW = 0;
2477 }
2478
2479 for(Int_t sc=0;sc<2;sc++) // sin or cos terms flag
2480 {
2481 if(!(fQCorrelations[pW][eW] && fQCorrections[pW][eW][sc] && fCorrections[pW][eW]))
2482 {
2483 cout<<"WARNING: fQCorrelations[pW][eW] && fQCorrections[pW][eW][sc] && fCorrections[pW][eW] is NULL in AFAWQC::CFCFNUAFIF() !!!!"<<endl;
2484 cout<<"pW = "<<pW<<endl;
2485 cout<<"eW = "<<eW<<endl;
2486 cout<<"sc = "<<sc<<endl;
2487 exit(0);
2488 }
2489 }
2490
2491 // measured 2-, 4-, 6- and 8-particle azimuthal correlations (biased with non-uniform acceptance!):
2492 Double_t two = fQCorrelations[pW][eW]->GetBinContent(1); // <<2>>
2493 //Double_t four = fQCorrelations[pW][eW]->GetBinContent(11); // <<4>>
2494 //Double_t six = fQCorrelations[pW][eW]->GetBinContent(24); // <<6>>
2495 //Double_t eight = fQCorrelations[pW][eW]->GetBinContent(31); // <<8>>
2496
2497 // correction terms to QC{2}:
2498 // <<cos(n*phi1)>>^2
2499 Double_t two1stTerm = pow(fQCorrections[pW][eW][1]->GetBinContent(1),2);
2500 // <<sin(n*phi1)>>^2
2501 Double_t two2ndTerm = pow(fQCorrections[pW][eW][0]->GetBinContent(1),2);
2502 // final corrections for non-uniform acceptance to QC{2}:
2503 Double_t correctionQC2 = -1.*two1stTerm-1.*two2ndTerm;
2504 fCorrections[pW][eW]->SetBinContent(1,correctionQC2);
2505
2506 // correction terms to QC{4}:
2507 // <<cos(n*phi1)>> <<cos(n*(phi1-phi2-phi3))>>
2508 Double_t four1stTerm = fQCorrections[pW][eW][1]->GetBinContent(1)*fQCorrections[pW][eW][1]->GetBinContent(3);
2509 // <<sin(n*phi1)>> <<sin(n*(phi1-phi2-phi3))>>
2510 Double_t four2ndTerm = fQCorrections[pW][eW][0]->GetBinContent(1)*fQCorrections[pW][eW][0]->GetBinContent(3);
2511 // <<cos(n*(phi1+phi2))>>^2
2512 Double_t four3rdTerm = pow(fQCorrections[pW][eW][1]->GetBinContent(2),2);
2513 // <<sin(n*(phi1+phi2))>>^2
2514 Double_t four4thTerm = pow(fQCorrections[pW][eW][0]->GetBinContent(2),2);
2515 // <<cos(n*(phi1+phi2))>> (<<cos(n*phi1)>>^2 - <<sin(n*phi1)>>^2)
2516 Double_t four5thTerm = fQCorrections[pW][eW][1]->GetBinContent(2)
2517 * (pow(fQCorrections[pW][eW][1]->GetBinContent(1),2)-pow(fQCorrections[pW][eW][0]->GetBinContent(1),2));
2518 // <<sin(n*(phi1+phi2))>> <<cos(n*phi1)>> <<sin(n*phi1)>>
2519 Double_t four6thTerm = fQCorrections[pW][eW][0]->GetBinContent(2)
2520 * fQCorrections[pW][eW][1]->GetBinContent(1)
2521 * fQCorrections[pW][eW][0]->GetBinContent(1);
2522 // <<cos(n*(phi1-phi2))>> (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2)
2523 Double_t four7thTerm = two*(pow(fQCorrections[pW][eW][1]->GetBinContent(1),2)+pow(fQCorrections[pW][eW][0]->GetBinContent(1),2));
2524 // (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2)^2
2525 Double_t four8thTerm = pow(pow(fQCorrections[pW][eW][1]->GetBinContent(1),2)+pow(fQCorrections[pW][eW][0]->GetBinContent(1),2),2);
2526 // final correction to QC{4}:
2527 Double_t correctionQC4 = -4.*four1stTerm+4.*four2ndTerm-four3rdTerm-four4thTerm
2528 + 4.*four5thTerm+8.*four6thTerm+8.*four7thTerm-6.*four8thTerm;
2529 fCorrections[pW][eW]->SetBinContent(2,correctionQC4);
2530
2531 // ... to be improved (continued for 6th and 8th order)
2532
2533} // end of AliFlowAnalysisWithQCumulants::CalculateFinalCorrectionsForNonUniformAcceptanceForCumulantsForIntFlow(Bool_t useParticleWeights, TString eventWeights)
bc92c0cb 2534
2535
9c1a9547 2536//================================================================================================================================
bc92c0cb 2537
2538
2aa4ebcd 2539void AliFlowAnalysisWithQCumulants::CalculateFinalCorrectionsForNonUniformAcceptanceForDifferentialFlow(Bool_t useParticleWeights,TString type)
2540{
2541
2542 useParticleWeights=kFALSE;
2543 type="ac";
2544
2545 // calculate final corrections due to non-uniform acceptance of the detector to reduced multi-particle correlations
2546 /*
2547 if(!(useParticleWeights))
2548 {
2549 if(type == "POI")
2550 {
2551 // **** corrections for non-uniform acceptance for 2nd order QC' for POI's ****
2552
2553 // 1st term: <<cos(n*psi)>><<cos(n*phi)>>:
2554 if(fCorrectionsCosP1nPsiPtEtaPOI && fQCorrectionsCos)
2555 {
2556 // pt,eta:
2557 if(f2pFinalCorrectionsForNUAPtEtaPOI) f2pFinalCorrectionsForNUAPtEtaPOI->Reset(); // to be improved
2558 TH2D *correctionPtEta1stTerm = new TH2D(*(fCorrectionsCosP1nPsiPtEtaPOI->ProjectionXY("","e")));
2559 correctionPtEta1stTerm->Scale(fQCorrectionsCos->GetBinContent(1)); // to be improved: are errors propagated correctly here?
2560 if(f2pFinalCorrectionsForNUAPtEtaPOI) f2pFinalCorrectionsForNUAPtEtaPOI->Add(correctionPtEta1stTerm); // to be improved (if condition goes somewhere else)
2561 delete correctionPtEta1stTerm;
2562 // pt:
2563 if(f2pFinalCorrectionsForNUAPtPOI) f2pFinalCorrectionsForNUAPtPOI->Reset(); // to be improved
2564 TH1D *correctionPt1stTerm = new TH1D(*((this->MakePtProjection(fCorrectionsCosP1nPsiPtEtaPOI))->ProjectionX("","e"))); // to be improved: are errors propagated correctly here?
2565 correctionPt1stTerm->Scale(fQCorrectionsCos->GetBinContent(1)); // to be improved: are errors propagated correctly here?
2566 if(f2pFinalCorrectionsForNUAPtPOI) f2pFinalCorrectionsForNUAPtPOI->Add(correctionPt1stTerm); // to be improved (if condition goes somewhere else)
2567 delete correctionPt1stTerm;
2568 // eta:
2569 if(f2pFinalCorrectionsForNUAEtaPOI) f2pFinalCorrectionsForNUAEtaPOI->Reset(); // to be improved
2570 TH1D *correctionEta1stTerm = new TH1D(*((this->MakeEtaProjection(fCorrectionsCosP1nPsiPtEtaPOI))->ProjectionX("","e"))); // to be improved: are errors propagated correctly here?
2571 correctionEta1stTerm->Scale(fQCorrectionsCos->GetBinContent(1)); // to be improved: are errors propagated correctly here?
2572 if(f2pFinalCorrectionsForNUAEtaPOI) f2pFinalCorrectionsForNUAEtaPOI->Add(correctionEta1stTerm); // to be improved (if condition goes somewhere else)
2573 delete correctionEta1stTerm;
2574 } else
2575 {
2576 cout<<"WARNING: (fCorrectionsCosP1nPsiPtEtaPOI && fQCorrectionsCos && f2pFinalCorrectionsForNUAPtEtaPOI) is NULL in QC::CFCFNUAFDF() !!!! "<<endl;
2577 cout<<" Corrections for non-uniform acceptance for differential flow are not correct."<<endl;
2578 }
2579
2580 // 2nd term: <<sin(n*psi)>><<sin(n*phi)>>:
2581 if(fCorrectionsSinP1nPsiPtEtaPOI && fQCorrectionsSin)
2582 {
2583 // pt,eta:
2584 TH2D *correctionPtEta2ndTerm = new TH2D(*(fCorrectionsSinP1nPsiPtEtaPOI->ProjectionXY("","e")));
2585 correctionPtEta2ndTerm->Scale(fQCorrectionsSin->GetBinContent(1)); // to be improved: are errors propagated correctly here?
2586 if(f2pFinalCorrectionsForNUAPtEtaPOI) f2pFinalCorrectionsForNUAPtEtaPOI->Add(correctionPtEta2ndTerm); // to be improved (if condition goes somewhere else)
2587 delete correctionPtEta2ndTerm;
2588 // pt:
2589 TH1D *correctionPt2ndTerm = new TH1D(*((this->MakePtProjection(fCorrectionsSinP1nPsiPtEtaPOI))->ProjectionX("","e"))); // to be improved: are errors propagated correctly here?
2590 correctionPt2ndTerm->Scale(fQCorrectionsSin->GetBinContent(1)); // to be improved: are errors propagated correctly here?
2591 if(f2pFinalCorrectionsForNUAPtPOI) f2pFinalCorrectionsForNUAPtPOI->Add(correctionPt2ndTerm); // to be improved (if condition goes somewhere else)
2592 delete correctionPt2ndTerm;
2593 // eta:
2594 TH1D *correctionEta2ndTerm = new TH1D(*((this->MakeEtaProjection(fCorrectionsSinP1nPsiPtEtaPOI))->ProjectionX("","e"))); // to be improved: are errors propagated correctly here?
2595 correctionEta2ndTerm->Scale(fQCorrectionsSin->GetBinContent(1)); // to be improved: are errors propagated correctly here?
2596 if(f2pFinalCorrectionsForNUAEtaPOI) f2pFinalCorrectionsForNUAEtaPOI->Add(correctionEta2ndTerm); // to be improved (if condition goes somewhere else)
2597 delete correctionEta2ndTerm;
2598 } else
2599 {
2600 cout<<"WARNING: (fCorrectionsSinP1nPsiPtEtaPOI && fQCorrectionsSin) is NULL in QC::CFCFNUAFDF() !!!! "<<endl;
2601 cout<<" Corrections for non-uniform acceptance for differential flow are not correct."<<endl;
2602 }
2603 } else if(type == "RP")
2604 {
2605 // **** corrections for non-uniform acceptance for 2nd order QC' for RP's ****
2606
2607 // 1st term: <<cos(n*psi)>><<cos(n*phi)>>:
2608 if(fCorrectionsCosP1nPsiPtEtaRP && fQCorrectionsCos)
2609 {
2610 // pt,eta:
2611 if(f2pFinalCorrectionsForNUAPtEtaRP) f2pFinalCorrectionsForNUAPtEtaRP->Reset(); // to be improved
2612 TH2D *correctionPtEta1stTerm = new TH2D(*(fCorrectionsCosP1nPsiPtEtaRP->ProjectionXY("","e")));
2613 correctionPtEta1stTerm->Scale(fQCorrectionsCos->GetBinContent(1)); // to be improved: are errors propagated correctly here?
2614 if(f2pFinalCorrectionsForNUAPtEtaRP) f2pFinalCorrectionsForNUAPtEtaRP->Add(correctionPtEta1stTerm); // to be improved (if condition goes somewhere else)
2615 delete correctionPtEta1stTerm;
2616 // pt:
2617 if(f2pFinalCorrectionsForNUAPtRP) f2pFinalCorrectionsForNUAPtRP->Reset(); // to be improved
2618 TH1D *correctionPt1stTerm = new TH1D(*((this->MakePtProjection(fCorrectionsCosP1nPsiPtEtaRP))->ProjectionX("","e"))); // to be improved: are errors propagated correctly here?
2619 correctionPt1stTerm->Scale(fQCorrectionsCos->GetBinContent(1)); // to be improved: are errors propagated correctly here?
2620 if(f2pFinalCorrectionsForNUAPtRP) f2pFinalCorrectionsForNUAPtRP->Add(correctionPt1stTerm); // to be improved (if condition goes somewhere else)
2621 delete correctionPt1stTerm;
2622 // eta:
2623 if(f2pFinalCorrectionsForNUAEtaRP) f2pFinalCorrectionsForNUAEtaRP->Reset(); // to be improved
2624 TH1D *correctionEta1stTerm = new TH1D(*((this->MakeEtaProjection(fCorrectionsCosP1nPsiPtEtaRP))->ProjectionX("","e"))); // to be improved: are errors propagated correctly here?
2625 correctionEta1stTerm->Scale(fQCorrectionsCos->GetBinContent(1)); // to be improved: are errors propagated correctly here?
2626 if(f2pFinalCorrectionsForNUAEtaRP) f2pFinalCorrectionsForNUAEtaRP->Add(correctionEta1stTerm); // to be improved (if condition goes somewhere else)
2627 delete correctionEta1stTerm;
2628 } else
2629 {
2630 cout<<"WARNING: (fCorrectionsCosP1nPsiPtEtaRP && fQCorrectionsCos) is NULL in QC::CFCFNUAFDF() !!!! "<<endl;
2631 cout<<" Corrections for non-uniform acceptance for differential flow are not correct."<<endl;
2632 }
2633 // 2nd term: <<sin(n*psi)>><<sin(n*phi)>>:
2634 if(fCorrectionsSinP1nPsiPtEtaRP && fQCorrectionsSin)
2635 {
2636 // pt,eta:
2637 TH2D *correctionPtEta2ndTerm = new TH2D(*(fCorrectionsSinP1nPsiPtEtaRP->ProjectionXY("","e")));
2638 correctionPtEta2ndTerm->Scale(fQCorrectionsSin->GetBinContent(1)); // to be improved: are errors propagated correctly here?
2639 if(f2pFinalCorrectionsForNUAPtEtaRP) f2pFinalCorrectionsForNUAPtEtaRP->Add(correctionPtEta2ndTerm); // to be improved (if condition goes somewhere else)
2640 delete correctionPtEta2ndTerm;
2641 // pt:
2642 TH1D *correctionPt2ndTerm = new TH1D(*((this->MakePtProjection(fCorrectionsSinP1nPsiPtEtaRP))->ProjectionX("","e"))); // to be improved: are errors propagated correctly here?
2643 correctionPt2ndTerm->Scale(fQCorrectionsSin->GetBinContent(1)); // to be improved: are errors propagated correctly here?
2644 if(f2pFinalCorrectionsForNUAPtRP) f2pFinalCorrectionsForNUAPtRP->Add(correctionPt2ndTerm); // to be improved (if condition goes somewhere else)
2645 delete correctionPt2ndTerm;
2646 // eta:
2647 TH1D *correctionEta2ndTerm = new TH1D(*((this->MakeEtaProjection(fCorrectionsSinP1nPsiPtEtaRP))->ProjectionX("","e"))); // to be improved: are errors propagated correctly here?
2648 correctionEta2ndTerm->Scale(fQCorrectionsSin->GetBinContent(1)); // to be improved: are errors propagated correctly here?
2649 if(f2pFinalCorrectionsForNUAEtaRP) f2pFinalCorrectionsForNUAEtaRP->Add(correctionEta2ndTerm); // to be improved (if condition goes somewhere else)
2650 delete correctionEta2ndTerm;
2651 } else
2652 {
2653 cout<<"WARNING: (fCorrectionsSinP1nPsiPtEtaRP && fQCorrectionsSin) is NULL in QC::CFCFNUAFDF() !!!! "<<endl;
2654 cout<<" Corrections for non-uniform acceptance for differential flow are not correct."<<endl;
2655 }
2656 } else // to else if(type == "RP")
2657 {
2658 cout<<"WARNING: Type must be either POI or RP in QC::CFCFNUAFDF() !!!! "<<endl;
2659 cout<<" Corrections for non-uniform acceptance for differential flow were not calculated."<<endl;
2660 }
2661 } else // to if(!(useParticleWeights))
2662 {
2663 // ...
2664 }
2665 */
2666} // end of AliFlowAnalysisWithQCumulants::CalculateFinalCorrectionsForNonUniformAcceptanceForDifferentialFlow(Bool_t useParticleWeights,TString type)
2667
2668
2669//==================================================================================================================================
2670
2671/*
2672void AliFlowAnalysisWithQCumulants::CalculateFinalResultsForDifferentialFlow(
2673 TH2D *flowPtEta, TH1D *flowPt, TH1D *flowEta,
2674 TProfile2D *profile2ndPtEta, TProfile2D *profile4thPtEta,
2675 TProfile2D *profile6thPtEta, TProfile2D *profile8thPtEta)
9c1a9547 2676{
2aa4ebcd 2677 // calculate and store the final results for integrated flow
2678
2679 TString *namePtEta = new TString();
2680 TString *type = new TString();
2681 TString *order2nd = new TString();
2682 TString *order4th = new TString();
2683 TString *order6th = new TString();
2684 TString *order8th = new TString();
2685 TString *pW = new TString();
2686
2687 if(profile2ndPtEta) *namePtEta = profile2ndPtEta->GetName();
2688 if(namePtEta->Contains("POI")) *type = "POI";
2689 if(namePtEta->Contains("RP")) *type = "RP";
2690 if(namePtEta->Contains("W")) *pW = "W";
2691 if(namePtEta->Contains("2")) *order2nd = "2";
2692 if(profile4thPtEta) *namePtEta = profile4thPtEta->GetName();
2693 if(namePtEta->Contains("4")) *order4th = "4";
2694
2695 if(profile6thPtEta) *namePtEta = profile6thPtEta->GetName();
2696 if(namePtEta->Contains("6")) *order6th = "6";
9c1a9547 2697
2aa4ebcd 2698 if(profile8thPtEta) *namePtEta = profile8thPtEta->GetName();
2699 if(namePtEta->Contains("8")) *order8th = "8";
2700
2701 TProfile *profile2ndPt = NULL;
2702 TProfile *profile4thPt = NULL;
2703 TProfile *profile6thPt = NULL;
2704 TProfile *profile8thPt = NULL;
2705
2706 TProfile *profile2ndEta = NULL;
2707 TProfile *profile4thEta = NULL;
2708 TProfile *profile6thEta = NULL;
2709 TProfile *profile8thEta = NULL;
2710
2711 if(*order2nd == "2")
2712 {
2713 profile2ndPt = new TProfile(*(this->MakePtProjection(profile2ndPtEta)));
2714 profile2ndEta = new TProfile(*(this->MakeEtaProjection(profile2ndPtEta)));
2715 if(*order4th == "4")
2716 {
2717 profile4thPt = new TProfile(*(this->MakePtProjection(profile4thPtEta)));
2718 profile4thEta = new TProfile(*(this->MakeEtaProjection(profile4thPtEta)));
2719 if(*order6th == "6")
2720 {
2721 profile6thPt = new TProfile(*(this->MakePtProjection(profile6thPtEta)));
2722 profile6thEta = new TProfile(*(this->MakeEtaProjection(profile6thPtEta)));
2723 if(*order8th == "8")
2724 {
2725 profile8thPt = new TProfile(*(this->MakePtProjection(profile8thPtEta)));
2726 profile8thEta = new TProfile(*(this->MakeEtaProjection(profile8thPtEta)));
2727 }
2728 }
2729 }
2730 }
9c1a9547 2731
2aa4ebcd 2732 Int_t nBinsPt = profile2ndPt->GetNbinsX();
2733 Int_t nBinsEta = profile2ndEta->GetNbinsX();
9c1a9547 2734
2aa4ebcd 2735 Double_t dV2 = 0.;
2736 Double_t dV4 = 0.;
2737 Double_t dV6 = 0.;
2738 Double_t dV8 = 0.;
9c1a9547 2739
2aa4ebcd 2740 if(!(*pW == "W"))
9c1a9547 2741 {
2aa4ebcd 2742 dV2 = fIntFlowResultsQC->GetBinContent(1);
2743 dV4 = fIntFlowResultsQC->GetBinContent(2);
2744 dV6 = fIntFlowResultsQC->GetBinContent(3);
2745 dV8 = fIntFlowResultsQC->GetBinContent(4);
2746 }
2747 else if(*pW == "W")
2748 {
2749 dV2 = fIntFlowResultsQCW->GetBinContent(1);
2750 dV4 = fIntFlowResultsQCW->GetBinContent(2);
2751 dV6 = fIntFlowResultsQCW->GetBinContent(3);
2752 dV8 = fIntFlowResultsQCW->GetBinContent(4);
2753 }
2754
2755 // 3D (pt,eta):
2756 Double_t twoPrimePtEta = 0.; // <<2'>> (pt,eta)
2757 Double_t fourPrimePtEta = 0.; // <<4'>> (pt,eta)
2758 //Double_t sixPrimePtEta = 0.; // <<6'>> (pt,eta)
2759 //Double_t eightPrimePtEta = 0.; // <<8'>> (pt,eta)
2760 Double_t secondOrderDiffFlowCumulantPtEta = 0.; // d_n{2,Q} (pt,eta)
2761 Double_t fourthOrderDiffFlowCumulantPtEta = 0.; // d_n{4,Q} (pt,eta)
2762 //Double_t sixthOrderDiffFlowCumulantPtEta = 0.; // d_n{6,Q} (pt,eta)
2763 //Double_t eightOrderDiffFlowCumulantPtEta = 0.; // d_n{8,Q} (pt,eta)2nd
2764 Double_t dv2PtEta = 0.; // v'_n{2} (pt,eta)
2765 Double_t dv4PtEta = 0.; // v'_n{4} (pt,eta)
2766 //Double_t dv6PtEta = 0.; // v'_n{6} (pt,eta)
2767 //Double_t dv8PtEta = 0.; // v'_n{8} (pt,eta)
9c1a9547 2768
2aa4ebcd 2769 // 2D (pt):
2770 Double_t twoPrimePt = 0.; // <<2'>> (pt)
2771 Double_t fourPrimePt = 0.; // <<4'>> (pt)
2772 //Double_t sixPrimePt = 0.; // <<6'>> (pt)
2773 //Double_t eightPrimePt = 0.; // <<8'>> (pt)
2774 Double_t secondOrderDiffFlowCumulantPt = 0.; // d_n{2,Q} (pt)
2775 Double_t fourthOrderDiffFlowCumulantPt = 0.; // d_n{4,Q} (pt)
2776 //Double_t sixthOrderDiffFlowCumulantPt = 0.; // d_n{6,Q} (pt)
2777 //Double_t eightOrderDiffFlowCumulantPt = 0.; // d_n{8,Q} (pt)
2778 Double_t dv2Pt = 0.; // v'_n{2} (pt)
2779 Double_t dv4Pt = 0.; // v'_n{4} (pt)
2780 //Double_t dv6Pt = 0.; // v'_n{6} (pt)
2781 //Double_t dv8Pt = 0.; // v'_n{8} (pt)
9c1a9547 2782
2aa4ebcd 2783 // 2D (eta):
2784 Double_t twoPrimeEta = 0.; // <<2'>> (eta)
2785 Double_t fourPrimeEta = 0.; // <<4>> (eta)
2786 //Double_t sixPrimeEta = 0.; // <<6>> (eta)
2787 //Double_t eightPrimeEta = 0.; // <<8'>> (eta)
2788 Double_t secondOrderDiffFlowCumulantEta = 0.; // d_n{2,Q} (eta)
2789 Double_t fourthOrderDiffFlowCumulantEta = 0.; // d_n{4,Q} (eta)
2790 //Double_t sixthOrderDiffFlowCumulantEta = 0.; // d_n{6,Q} (eta)
2791 //Double_t eightOrderDiffFlowCumulantEta = 0.; // d_n{8,Q} (eta)
2792 Double_t dv2Eta = 0.; // v'_n{2} (eta)
2793 Double_t dv4Eta = 0.; // v'_n{4} (eta)
2794 //Double_t dv6Eta = 0.; // v'_n{6} (eta)
2795 //Double_t dv8Eta = 0.; // v'_n{8} (eta)
2796
9c1a9547 2797
2aa4ebcd 2798 // looping over (pt,eta) bins to calculate v'(pt,eta)
2799 for(Int_t p=1;p<nBinsPt+1;p++)
2800 {
2801 for(Int_t e=1;e<nBinsEta+1;e++)
2802 {
2803
2804 // 2nd order:
2805 twoPrimePtEta = profile2ndPtEta->GetBinContent(profile2ndPtEta->GetBin(p,e));
2806 secondOrderDiffFlowCumulantPtEta = twoPrimePtEta;
9c1a9547 2807
2aa4ebcd 2808
2809 //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2810 // to be improved (applying correction for NUA):
2811 if(namePtEta->Contains("POI"))
9c1a9547 2812 {
2aa4ebcd 2813 if(f2pFinalCorrectionsForNUAPtEtaPOI) secondOrderDiffFlowCumulantPtEta = twoPrimePtEta
2814 - f2pFinalCorrectionsForNUAPtEtaPOI->GetBinContent(f2pFinalCorrectionsForNUAPtEtaPOI->GetBin(p,e)) ;
2815 } else if (namePtEta->Contains("RP"))
2816 {
2817 if(f2pFinalCorrectionsForNUAPtEtaRP) secondOrderDiffFlowCumulantPtEta = twoPrimePtEta
2818 - f2pFinalCorrectionsForNUAPtEtaRP->GetBinContent(f2pFinalCorrectionsForNUAPtEtaRP->GetBin(p,e));
2819 }
2820 //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
9c1a9547 2821
9c1a9547 2822
2aa4ebcd 2823 if(dV2)
9c1a9547 2824 {
2aa4ebcd 2825 dv2PtEta = secondOrderDiffFlowCumulantPtEta/dV2;
2826 if(*order2nd == "2")
2827 {
2828 flowPtEta->SetBinContent(p,e,dv2PtEta);
2829 }
9c1a9547 2830 }
2831
2aa4ebcd 2832 // 4th order:
2833 if(*order4th == "4" || *order6th == "6" || *order8th == "8")
9c1a9547 2834 {
2aa4ebcd 2835 fourPrimePtEta = profile4thPtEta->GetBinContent(profile4thPtEta->GetBin(p,e));
2836 fourthOrderDiffFlowCumulantPtEta = fourPrimePtEta - 2.*twoPrimePtEta*pow(dV2,2.); // to be improved (correlations instead of pow(dV2,2.))
2837 if(dV4)
9c1a9547 2838 {
2aa4ebcd 2839 dv4PtEta = -fourthOrderDiffFlowCumulantPtEta/pow(dV4,3);
2840 if(*order4th == "4")
2841 {
2842 flowPtEta->SetBinContent(p,e,dv4PtEta);
2843 }
9c1a9547 2844 }
2aa4ebcd 2845 }
9c1a9547 2846
2aa4ebcd 2847 } // end of for(Int_t e=1;e<nBinsEta+1;e++)
2848 } // end of for(Int_t p=1;p<nBinsPt+1;p++)
9c1a9547 2849
9c1a9547 2850
2aa4ebcd 2851 // looping over (pt) bins to calcualate v'(pt)
2852 for(Int_t p=1;p<nBinsPt+1;p++)
2853 {
2854
2855 // 2nd order:
2856 twoPrimePt = profile2ndPt->GetBinContent(p);
2857 secondOrderDiffFlowCumulantPt = twoPrimePt;
2858
2859
2860 //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2861 // to be improved (applying correction for NUA):
2862 if(namePtEta->Contains("POI"))
2863 {
2864 if(f2pFinalCorrectionsForNUAPtPOI) secondOrderDiffFlowCumulantPt = twoPrimePt
2865 - f2pFinalCorrectionsForNUAPtPOI->GetBinContent(p) ;
2866 } else if (namePtEta->Contains("RP"))
2867 {
2868 if(f2pFinalCorrectionsForNUAPtRP) secondOrderDiffFlowCumulantPt = twoPrimePt
2869 - f2pFinalCorrectionsForNUAPtRP->GetBinContent(p);
2870 }
2871 //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2872
2873
2874 if(dV2)
2875 {
2876 dv2Pt = secondOrderDiffFlowCumulantPt/dV2;
2877 if(*order2nd == "2")
9c1a9547 2878 {
2aa4ebcd 2879 flowPt->SetBinContent(p,dv2Pt);
9c1a9547 2880 }
2881
2aa4ebcd 2882 // common control histos: (to be improved fill only once. now they are filled first without weights and then with weights):
2883 if(namePtEta->Contains("POI") && *order2nd == "2")
2884 {
2885 fCommonHistsResults2nd->FillDifferentialFlowPtPOI(p,dv2Pt,0.); //to be improved (errors && bb or bb+1 ?)
2886 }
2887 else if(namePtEta->Contains("RP") && *order2nd == "2")
9c1a9547 2888 {
2aa4ebcd 2889 fCommonHistsResults2nd->FillDifferentialFlowPtRP(p,dv2Pt,0.); //to be improved (errors && bb or bb+1 ?)
2890 }
9c1a9547 2891
2aa4ebcd 2892 }
2893
2894 // 4th order:
2895 if(*order4th == "4" || *order6th == "6" || *order8th == "8")
2896 {
2897 fourPrimePt = profile4thPt->GetBinContent(profile4thPt->GetBin(p));
2898 fourthOrderDiffFlowCumulantPt = fourPrimePt - 2.*twoPrimePt*pow(dV2,2.); // to be improved (correlations instead of pow(dV2,2.))
2899 if(dV4)
2900 {
2901 dv4Pt = -fourthOrderDiffFlowCumulantPt/pow(dV4,3);
2902 if(*order4th == "4")
9c1a9547 2903 {
2aa4ebcd 2904 flowPt->SetBinContent(p,dv4Pt);
9c1a9547 2905 }
2aa4ebcd 2906
2907 // common control histos: (to be improved):
2908 if(namePtEta->Contains("POI") && *order4th == "4")
2909 {
2910 fCommonHistsResults4th->FillDifferentialFlowPtPOI(p,dv4Pt,0.); //to be improved (errors && bb or bb+1 ?)
2911 }
2912 else if(namePtEta->Contains("RP") && *order4th == "4" )
9c1a9547 2913 {
2aa4ebcd 2914 fCommonHistsResults4th->FillDifferentialFlowPtRP(p,dv4Pt,0.); //to be improved (errors && bb or bb+1 ?)
9c1a9547 2915 }
2aa4ebcd 2916
2917 }
2918 }
2919
2920 } // end of for(Int_t p=1;p<nBinsPt+1;p++)
2921
2922
2923 // looping over (eta) bins to calcualate v'(eta)
2924 for(Int_t e=1;e<nBinsEta+1;e++)
2925 {
2926
2927 // 2nd order:
2928 twoPrimeEta = profile2ndEta->GetBinContent(e);
2929 secondOrderDiffFlowCumulantEta = twoPrimeEta;
2930
2931
2932 //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2933 // to be improved (applying correction for NUA):
2934 if(namePtEta->Contains("POI"))
2935 {
2936 if(f2pFinalCorrectionsForNUAEtaPOI) secondOrderDiffFlowCumulantEta = twoPrimeEta
2937 - f2pFinalCorrectionsForNUAEtaPOI->GetBinContent(e) ;
2938 } else if (namePtEta->Contains("RP"))
2939 {
2940 if(f2pFinalCorrectionsForNUAEtaRP) secondOrderDiffFlowCumulantEta = twoPrimeEta
2941 - f2pFinalCorrectionsForNUAEtaRP->GetBinContent(e);
2942 }
2943 //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2944
2945
2946 if(dV2)
2947 {
2948 dv2Eta = secondOrderDiffFlowCumulantEta/dV2;
2949 if(*order2nd == "2")
9c1a9547 2950 {
2aa4ebcd 2951 flowEta->SetBinContent(e,dv2Eta);
2952 }
9c1a9547 2953
2aa4ebcd 2954 // common control histos: (to be improved):
2955 if(namePtEta->Contains("POI") && *order2nd == "2")
2956 {
2957 fCommonHistsResults2nd->FillDifferentialFlowEtaPOI(e,dv2Eta,0.); //to be improved (errors && bb or bb+1 ?)
2958 }
2959 else if(namePtEta->Contains("RP") && *order2nd == "2")
2960 {
2961 fCommonHistsResults2nd->FillDifferentialFlowEtaRP(e,dv2Eta,0.); //to be improved (errors && bb or bb+1 ?)
2962 }
2963
2964
2965 }
2966
2967 // 4th order:
2968 if(*order4th == "4" || *order6th == "6" || *order8th == "8")
2969 {
2970 fourPrimeEta = profile4thEta->GetBinContent(profile4thEta->GetBin(e));
2971 fourthOrderDiffFlowCumulantEta = fourPrimeEta - 2.*twoPrimeEta*pow(dV2,2.); // to be improved (correlations instead of pow(dV2,2.))
2972 if(dV4)
2973 {
2974 dv4Eta = -fourthOrderDiffFlowCumulantEta/pow(dV4,3);
2975 if(*order4th == "4")
9c1a9547 2976 {
2aa4ebcd 2977 flowEta->SetBinContent(e,dv4Eta);
9c1a9547 2978 }
2aa4ebcd 2979
2980 // common control histos: (to be improved):
2981 if(namePtEta->Contains("POI") && *order4th == "4")
2982 {
2983 fCommonHistsResults4th->FillDifferentialFlowEtaPOI(e,dv4Eta,0.); //to be improved (errors && bb or bb+1 ?)
2984 }
2985 else if(namePtEta->Contains("RP") && *order4th == "4")
9c1a9547 2986 {
2aa4ebcd 2987 fCommonHistsResults4th->FillDifferentialFlowEtaRP(e,dv4Eta,0.); //to be improved (errors && bb or bb+1 ?)
9c1a9547 2988 }
2aa4ebcd 2989
2990 }
2991 }
9c1a9547 2992
2aa4ebcd 2993 } // end of for(Int_t e=1;e<nBinsEta+1;e++)
2994
2995 delete namePtEta;
2996 delete type;
2997 delete order2nd;
2998 delete order4th;
2999 delete order6th;
3000 delete order8th;
3001 delete pW;
3002 delete profile2ndPt;
3003 delete profile4thPt;
3004 delete profile6thPt;
3005 delete profile8thPt;
3006 delete profile2ndEta;
3007 delete profile4thEta;
3008 delete profile6thEta;
3009 delete profile8thEta;
bc92c0cb 3010
2aa4ebcd 3011} // end of AliFlowAnalysisWithQCumulants::CalculateFinalResultsForDifferentialFlow(Bool_t useParticleWeights, TString type)
3012*/
bc92c0cb 3013
9c1a9547 3014//================================================================================================================================
bc92c0cb 3015
3016
2aa4ebcd 3017void AliFlowAnalysisWithQCumulants::PrintFinalResultsForIntegratedFlow(TString type)
c365fe76 3018{
2aa4ebcd 3019 // printing on the screen the final results for integrated flow (NONAME, POI and RP) // to be improved (NONAME)
c365fe76 3020
2aa4ebcd 3021 Int_t n = fHarmonic;
c365fe76 3022
2aa4ebcd 3023 if(type == "NONAME" || type == "RP" || type == "POI")
c365fe76 3024 {
2aa4ebcd 3025 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
3026 {
3027 cout<<"WARNING: fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th"<<endl;
3028 cout<<" is NULL in AFAWQC::PFRFIF() !!!!"<<endl;
3029 }
3030 } else
3031 {
3032 cout<<"WARNING: type in not from {NONAME, RP, POI} in AFAWQC::PFRFIF() !!!!"<<endl;
3033 exit(0);
3034 }
c365fe76 3035
2aa4ebcd 3036 Double_t dVn[4] = {0.}; // array to hold Vn{2}, Vn{4}, Vn{6} and Vn{8}
3037 Double_t dVnErr[4] = {0.}; // array to hold errors of Vn{2}, Vn{4}, Vn{6} and Vn{8}
c365fe76 3038
2aa4ebcd 3039 if(type == "NONAME")
c365fe76 3040 {
2aa4ebcd 3041 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinContent(1);
3042 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinError(1);
3043 dVn[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinContent(1);
3044 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinError(1);
3045 dVn[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinContent(1);
3046 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinError(1);
3047 dVn[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinContent(1);
3048 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinError(1);
3049 } else if(type == "RP")
3050 {
3051 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinContent(1);
3052 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinError(1);
3053 dVn[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinContent(1);
3054 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinError(1);
3055 dVn[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinContent(1);
3056 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinError(1);
3057 dVn[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinContent(1);
3058 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinError(1);
3059 } else if(type == "POI")
3060 {
3061 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinContent(1);
3062 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinError(1);
3063 dVn[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinContent(1);
3064 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinError(1);
3065 dVn[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinContent(1);
3066 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinError(1);
3067 dVn[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinContent(1);
3068 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinError(1);
3069 }
3070
3071 TString title = " flow estimates from Q-cumulants";
3072 TString subtitle = " (";
3073
3074 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
3075 {
3076 subtitle.Append(type);
3077 subtitle.Append(", without weights)");
3078 } else
3079 {
3080 subtitle.Append(type);
3081 subtitle.Append(", with weights)");
3082 }
3083
3084 cout<<endl;
3085 cout<<"*************************************"<<endl;
3086 cout<<"*************************************"<<endl;
3087 cout<<title.Data()<<endl;
3088 cout<<subtitle.Data()<<endl;
3089 cout<<endl;
c365fe76 3090
2aa4ebcd 3091 for(Int_t i=0;i<4;i++)
3092 {
3093 if(dVn[i]>=0.)
3094 {
3095 cout<<" v_"<<n<<"{"<<2*(i+1)<<"} = "<<dVn[i]<<" +/- "<<dVnErr[i]<<endl;
3096 }
3097 else
3098 {
3099 cout<<" v_"<<n<<"{"<<2*(i+1)<<"} = Im"<<endl;
3100 }
3101 }
3102
3103 cout<<endl;
3104 /*
3105 if(type == "NONAME")
3106 {
3107 cout<<" nEvts = "<<nEvtsNoName<<", AvM = "<<dMultNoName<<endl; // to be improved
3108 }
3109 else if (type == "RP")
3110 {
3111 cout<<" nEvts = "<<nEvtsRP<<", AvM = "<<dMultRP<<endl; // to be improved
c365fe76 3112 }
2aa4ebcd 3113 else if (type == "POI")
3114 {
3115 cout<<" nEvts = "<<nEvtsPOI<<", AvM = "<<dMultPOI<<endl; // to be improved
3116 }
3117 */
3118 cout<<"*************************************"<<endl;
3119 cout<<"*************************************"<<endl;
3120 cout<<endl;
3121
3122}// end of AliFlowAnalysisWithQCumulants::PrintFinalResultsForIntegratedFlow(TString type="NONAME");
3123
3124
3125//================================================================================================================================
3126
3127
3128void AliFlowAnalysisWithQCumulants::CompareResultsFromNestedLoopsAndFromQVectorsForDiffFlow(Bool_t useParticleWeights)
3129{
3130 // compare correlations needed for diff. flow calculated with nested loops and those calculated from Q-vectors
3131
3132 cout<<endl;
3133 cout<<" *************************************"<<endl;
3134 cout<<" **** cross-checking the formulas ****"<<endl;
3135 cout<<" **** for differential flow ****"<<endl;
3136 cout<<" **** ****"<<endl;
3137 cout<<" **** (pt,eta) bin: ****"<<endl;
3138 cout<<" **** 1.1 < pt < 1.2 GeV ****"<<endl;
3139 cout<<" **** -0.55 < eta < -0.525 ****"<<endl;
3140 cout<<" *************************************"<<endl;
3141 cout<<endl;
c365fe76 3142
2aa4ebcd 3143 if(!useParticleWeights)
3144 {
3145 cout<<"<cos(n(psi1-phi2))> from Q-vectors = "<<fCorrelationsPro[0][0][0][0]->GetBinContent(fCorrelationsPro[0][0][0][0]->GetBin(12,19))<<endl;
3146 cout<<"<cos(n(psi1-phi2))> from nested loops = "<<fDirectCorrelationsDiffFlow->GetBinContent(1)<<endl;
3147 cout<<endl;
3148 cout<<"<cos(n(psi1+phi2-phi3-phi4))> from Q-vectors = "<<fCorrelationsPro[0][0][0][1]->GetBinContent(fCorrelationsPro[0][0][0][1]->GetBin(12,19))<<endl;
3149 cout<<"<cos(n(psi1+phi2-phi3-phi4))> from nested loops = "<<fDirectCorrelationsDiffFlow->GetBinContent(41)<<endl;
3150 cout<<endl;
3151 cout<<"****************************************************"<<endl;
3152 cout<<"****************************************************"<<endl;
3153 cout<<endl;
3154 /*
3155 cout<<"<cos(n(psi1))> from Q-vectors = "<<fCorrectionsCosP1nPsiPtEtaPOI->GetBinContent(fCorrectionsCosP1nPsiPtEtaPOI->GetBin(12,19))<<endl;
3156 cout<<"<cos(n(psi1))> from nested loops = "<<fDirectCorrectionsDiffFlowCos->GetBinContent(1)<<endl;
3157 cout<<endl;
3158 cout<<"<sin(n(psi1))> from Q-vectors = "<<fCorrectionsSinP1nPsiPtEtaPOI->GetBinContent(fCorrectionsSinP1nPsiPtEtaPOI->GetBin(12,19))<<endl;
3159 cout<<"<sin(n(psi1))> from nested loops = "<<fDirectCorrectionsDiffFlowSin->GetBinContent(1)<<endl;
3160 cout<<endl;
3161 */
3162 }
3163
3164 if(useParticleWeights)
c365fe76 3165 {
2aa4ebcd 3166 cout<<"<w2 cos(n(psi1-phi2))> from Q-vectors (RP) = "<<fCorrelationsPro[0][1][0][0]->GetBinContent(fCorrelationsPro[0][1][0][0]->GetBin(12,19))<<endl;
3167 cout<<"<w2 cos(n(psi1-phi2))> from Q-vectors (POI) = "<<fCorrelationsPro[1][1][0][0]->GetBinContent(fCorrelationsPro[1][1][0][0]->GetBin(12,19))<<endl;
3168 cout<<"<w2 cos(n(psi1-phi2))> from nested loops = "<<fDirectCorrelationsDiffFlowW->GetBinContent(1)<<endl;
3169 cout<<endl;
3170 cout<<"<w2 w3 w4 cos(n(psi1+phi2-phi3-phi4))> from Q-vectors (RP) = "<<fCorrelationsPro[0][1][0][1]->GetBinContent(fCorrelationsPro[0][1][0][1]->GetBin(12,19))<<endl;
3171 cout<<"<w2 w3 w4 cos(n(psi1+phi2-phi3-phi4))> from Q-vectors (POI) = "<<fCorrelationsPro[1][1][0][1]->GetBinContent(fCorrelationsPro[1][1][0][1]->GetBin(12,19))<<endl;
3172 cout<<"<w2 w3 w4 cos(n(psi1+phi2-phi3-phi4))> from nested loops = "<<fDirectCorrelationsDiffFlowW->GetBinContent(41)<<endl;
3173 cout<<endl;
3174 }
c365fe76 3175
2aa4ebcd 3176} // end of void AliFlowAnalysisWithQCumulants::CompareResultsFromNestedLoopsAndFromQVectorsForDiffFlow()
c365fe76 3177
3178
3179//================================================================================================================================
3180
3181
2aa4ebcd 3182void AliFlowAnalysisWithQCumulants::WriteHistograms(TString outputFileName)
c365fe76 3183{
2aa4ebcd 3184 //store the final results in output .root file
3185 TFile *output = new TFile(outputFileName.Data(),"RECREATE");
3186 //output->WriteObject(fHistList, "cobjQC","SingleKey");
3187 fHistList->Write(fHistList->GetName(), TObject::kSingleKey);
3188 delete output;
3189}
3190
3191
3192//================================================================================================================================
3193
3194
3195void AliFlowAnalysisWithQCumulants::BookCommonHistograms()
3196{
3197 // book common control histograms and common histograms for final results
c365fe76 3198
2aa4ebcd 3199 // common control histogram (ALL events)
3200 fCommonHists = new AliFlowCommonHist("AliFlowCommonHistQC");
3201 fHistList->Add(fCommonHists);
c365fe76 3202
2aa4ebcd 3203 // common control histogram (for events with 2 and more particles)
3204 fCommonHists2nd = new AliFlowCommonHist("AliFlowCommonHist2ndOrderQC");
3205 fHistList->Add(fCommonHists2nd);
c365fe76 3206
2aa4ebcd 3207 // common control histogram (for events with 4 and more particles)
3208 fCommonHists4th = new AliFlowCommonHist("AliFlowCommonHist4thOrderQC");
3209 fHistList->Add(fCommonHists4th);
c365fe76 3210
2aa4ebcd 3211 // common control histogram (for events with 6 and more particles)
3212 fCommonHists6th = new AliFlowCommonHist("AliFlowCommonHist6thOrderQC");
3213 fHistList->Add(fCommonHists6th);
c365fe76 3214
2aa4ebcd 3215 // common control histogram (for events with 8 and more particles)
3216 fCommonHists8th = new AliFlowCommonHist("AliFlowCommonHist8thOrderQC");
3217 fHistList->Add(fCommonHists8th);
3218
3219 // common histograms for final results (calculated for events with 2 and more particles)
3220 fCommonHistsResults2nd = new AliFlowCommonHistResults("AliFlowCommonHistResults2ndOrderQC");
3221 fHistList->Add(fCommonHistsResults2nd);
c365fe76 3222
2aa4ebcd 3223 // common histograms for final results (calculated for events with 4 and more particles)
3224 fCommonHistsResults4th = new AliFlowCommonHistResults("AliFlowCommonHistResults4thOrderQC");
3225 fHistList->Add(fCommonHistsResults4th);
c365fe76 3226
2aa4ebcd 3227 // common histograms for final results (calculated for events with 6 and more particles)
3228 fCommonHistsResults6th = new AliFlowCommonHistResults("AliFlowCommonHistResults6thOrderQC");
3229 fHistList->Add(fCommonHistsResults6th);
c365fe76 3230
2aa4ebcd 3231 // common histograms for final results (calculated for events with 8 and more particles)
3232 fCommonHistsResults8th = new AliFlowCommonHistResults("AliFlowCommonHistResults8thOrderQC");
3233 fHistList->Add(fCommonHistsResults8th);
c365fe76 3234
2aa4ebcd 3235} // end of void AliFlowAnalysisWithQCumulants::BookCommonHistograms()
2bdc5281 3236
3237
3238//================================================================================================================================
3239
3240
2aa4ebcd 3241void AliFlowAnalysisWithQCumulants::BookAndFillWeightsHistograms()
2bdc5281 3242{
2aa4ebcd 3243 // book and fill histograms which hold phi, pt and eta weights
2bdc5281 3244
2aa4ebcd 3245 if(!fWeightsList)
2bdc5281 3246 {
2aa4ebcd 3247 cout<<"WARNING: fWeightsList is NULL in AFAWQC::BAFWH() !!!!"<<endl;
3248 exit(0);
3249 }
3250
3251 fUseParticleWeights = new TProfile("fUseParticleWeights","1 = weight used, 0 = weight not used",3,0,3);
3252 fUseParticleWeights->SetLabelSize(0.06);
3253 (fUseParticleWeights->GetXaxis())->SetBinLabel(1,"w_{#phi}");
3254 (fUseParticleWeights->GetXaxis())->SetBinLabel(2,"w_{p_{T}}");
3255 (fUseParticleWeights->GetXaxis())->SetBinLabel(3,"w_{#eta}");
3256 fUseParticleWeights->Fill(0.5,(Int_t)fUsePhiWeights);
3257 fUseParticleWeights->Fill(1.5,(Int_t)fUsePtWeights);
3258 fUseParticleWeights->Fill(2.5,(Int_t)fUseEtaWeights);
3259 fWeightsList->Add(fUseParticleWeights);
3260
3261 if(fUsePhiWeights)
3262 {
3263 if(fWeightsList->FindObject("phi_weights"))
2bdc5281 3264 {
2aa4ebcd 3265 fPhiWeights = dynamic_cast<TH1F*>(fWeightsList->FindObject("phi_weights"));
3266 if(fPhiWeights->GetBinWidth(1) != fPhiBinWidth)
2bdc5281 3267 {
2aa4ebcd 3268 cout<<"WARNING: fPhiWeights->GetBinWidth(1) != fPhiBinWidth in AFAWQC::BAFWH() !!!! "<<endl;
3269 cout<<" This indicates inconsistent binning in phi histograms throughout the code."<<endl;
3270 exit(0);
2bdc5281 3271 }
2aa4ebcd 3272 } else
2bdc5281 3273 {
2aa4ebcd 3274 cout<<"WARNING: fWeightsList->FindObject(\"phi_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
3275 exit(0);
2bdc5281 3276 }
2aa4ebcd 3277 } // end of if(fUsePhiWeights)
3278
3279 if(fUsePtWeights)
3280 {
3281 if(fWeightsList->FindObject("pt_weights"))
3282 {
3283 fPtWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("pt_weights"));
3284 if(fPtWeights->GetBinWidth(1) != fPtBinWidth)
2bdc5281 3285 {
2aa4ebcd 3286 cout<<"WARNING: fPtWeights->GetBinWidth(1) != fPtBinWidth in AFAWQC::BAFWH() !!!! "<<endl;
3287 cout<<" This indicates insconsistent binning in pt histograms throughout the code."<<endl;
3288 exit(0);
3289 }
3290 } else
2bdc5281 3291 {
2aa4ebcd 3292 cout<<"WARNING: fWeightsList->FindObject(\"pt_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
3293 exit(0);
2bdc5281 3294 }
2aa4ebcd 3295 } // end of if(fUsePtWeights)
3296
3297 if(fUseEtaWeights)
3298 {
3299 if(fWeightsList->FindObject("eta_weights"))
3300 {
3301 fEtaWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("eta_weights"));
3302 if(fEtaWeights->GetBinWidth(1) != fEtaBinWidth)
3303 {
3304 cout<<"WARNING: fEtaWeights->GetBinWidth(1) != fEtaBinWidth in AFAWQC::BAFWH() !!!! "<<endl;
3305 cout<<" This indicates insconsistent binning in eta histograms throughout the code."<<endl;
3306 exit(0);
3307 }
3308 } else
2bdc5281 3309 {
2aa4ebcd 3310 cout<<"WARNING: fUseEtaWeights && fWeightsList->FindObject(\"eta_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
3311 exit(0);
2bdc5281 3312 }
2aa4ebcd 3313 } // end of if(fUseEtaWeights)
3314
3315} // end of AliFlowAnalysisWithQCumulants::BookAndFillWeightsHistograms()
3316
3317
3318//================================================================================================================================
3319
3320
3321void AliFlowAnalysisWithQCumulants::BookEverythingForIntegratedFlow()
3322{
3323 // book all objects for integrated flow
3324
3325 // a) common;
3326 // b) profiles;
3327 // c) results;
3328
3329 // ****************
3330 // **** COMMON ****
3331 // ****************
3332
3333 // Re[Q_{m*n,k}], Im[Q_{m*n,k}] and S_{p,k}^M:
3334 fReQ = new TMatrixD(4,9);
3335 fImQ = new TMatrixD(4,9);
3336 fSMpk = new TMatrixD(8,9);
3337
3338 // profile to hold average multiplicities and number of events for events with nRP>=0, nRP>=1, ... , and nRP>=8
3339 fAvMultiplicity = new TProfile("fAvMultiplicity","Average Multiplicities of RPs",9,0,9);
3340 fAvMultiplicity->SetTickLength(-0.01,"Y");
3341 fAvMultiplicity->SetMarkerStyle(25);
3342 fAvMultiplicity->SetLabelSize(0.05);
3343 fAvMultiplicity->SetLabelOffset(0.02,"Y");
3344 fAvMultiplicity->SetYTitle("Average Multiplicity");
3345 (fAvMultiplicity->GetXaxis())->SetBinLabel(1,"all evts");
3346 (fAvMultiplicity->GetXaxis())->SetBinLabel(2,"n_{RP} #geq 1");
3347 (fAvMultiplicity->GetXaxis())->SetBinLabel(3,"n_{RP} #geq 2");
3348 (fAvMultiplicity->GetXaxis())->SetBinLabel(4,"n_{RP} #geq 3");
3349 (fAvMultiplicity->GetXaxis())->SetBinLabel(5,"n_{RP} #geq 4");
3350 (fAvMultiplicity->GetXaxis())->SetBinLabel(6,"n_{RP} #geq 5");
3351 (fAvMultiplicity->GetXaxis())->SetBinLabel(7,"n_{RP} #geq 6");
3352 (fAvMultiplicity->GetXaxis())->SetBinLabel(8,"n_{RP} #geq 7");
3353 (fAvMultiplicity->GetXaxis())->SetBinLabel(9,"n_{RP} #geq 8");
3354 fIntFlowProfiles->Add(fAvMultiplicity);
3355
3356 TString pWeightsFlag[2] = {"pWeights not used","pWeights used"};
3357 TString eWeightsFlag[2] = {"exact eWeights","non-exact eWeights"};
3358 TString nuaFlag[2] = {"not corrected","corrected"};
3359 TString sinCosFlag[2] = {"sin","cos"};
c2a42ea2 3360 TString powerFlag[2] = {"linear","quadratic"};
2aa4ebcd 3361
3362 for(Int_t pW=0;pW<1+(Int_t)(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);pW++)
3363 {
3364 // ***************
3365 // **** E-B-E ****
3366 // ***************
3367
3368 // average multiparticle correlations for single event calculated from Q-vectors
3369 // (Remark: binning is organized in the same way as in fQCorrelations[pW][eW] bellow):
3370 fQCorrelationsEBE[pW] = new TH1D(Form("fQCorrelationsEBE: %s",pWeightsFlag[pW].Data()),Form("Average multi-particle correlations for single event calculated from Q-vectors (%s)",pWeightsFlag[pW].Data()),32,0,32);
3371
3372 for(Int_t sc=0;sc<2;sc++)
3373 {
3374 // correction terms for non-uniform acceptance for single event calculated from Q-vectors
3375 // (Remark: binning is organized in the same way as in fQCorrections[pW][sc]):
3376 fQCorrectionsEBE[pW][sc] = new TH1D(Form("fQCorrectionsEBE: %s, %s terms",pWeightsFlag[pW].Data(),sinCosFlag[sc].Data()),Form("Correction terms for non-uniform acceptance for single event (%s, %s terms)",pWeightsFlag[pW].Data(),sinCosFlag[sc].Data()),10,0,10);
3377 }
3378
3379 for(Int_t eW=0;eW<2;eW++)
3380 {
3381 // ******************
3382 // **** PROFILES ****
3383 // ******************
3384
3385 // final average multiparticle correlations for all events calculated from Q-vectors:
3386 fQCorrelations[pW][eW] = new TProfile(Form("fQCorrelations: %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()),Form("Final average multi-particle correlations calculated from Q-vectors (%s, %s)",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()),32,0,32,"s");
3387 fQCorrelations[pW][eW]->SetTickLength(-0.01,"Y");
3388 fQCorrelations[pW][eW]->SetMarkerStyle(25);
3389 fQCorrelations[pW][eW]->SetLabelSize(0.03);
3390 fQCorrelations[pW][eW]->SetLabelOffset(0.01,"Y");
3391 // 2-p correlations:
3392 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(1,"<<2>>_{n|n}");
3393 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(2,"<<2>>_{2n|2n}");
3394 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(3,"<<2>>_{3n|3n}");
3395 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(4,"<<2>>_{4n|4n}");
3396 // 3-p correlations:
3397 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(6,"<<3>>_{2n|n,n}");
3398 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(7,"<<3>>_{3n|2n,n}");
3399 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(8,"<<3>>_{4n|2n,2n}");
3400 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(9,"<<3>>_{4n|3n,n}");
3401 // 4-p correlations:
3402 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(11,"<<4>>_{n,n|n,n}");
3403 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(12,"<<4>>_{2n,n|2n,n}");
3404 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(13,"<<4>>_{2n,2n|2n,2n}");
3405 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(14,"<<4>>_{3n|n,n,n}");
3406 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(15,"<<4>>_{3n,n|3n,n}");
3407 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(16,"<<4>>_{3n,n|2n,2n}");
3408 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(17,"<<4>>_{4n|2n,n,n}");
3409 // 5-p correlations:
3410 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(19,"<<5>>_{2n|n,n,n,n}");
3411 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(20,"<<5>>_{2n,2n|2n,n,n}");
3412 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(21,"<<5>>_{3n,n|2n,n,n}");
3413 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(22,"<<5>>_{4n|n,n,n,n}");
3414 // 6-p correlations:
3415 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(24,"<<6>>_{n,n,n|n,n,n}");
3416 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(25,"<<6>>_{2n,n,n|2n,n,n}");
3417 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(26,"<<6>>_{2n,2n|n,n,n,n}");
3418 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(27,"<<6>>_{3n,n|n,n,n,n}");
3419 // 7-p correlations:
3420 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(29,"<<7>>_{2n,n,n|n,n,n,n}");
3421 // 8-p correlations:
3422 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(31,"<<8>>_{n,n,n,n|n,n,n,n}");
3423 // add fQCorrelations[0] to the list fIntFlowList:
3424 fIntFlowProfiles->Add(fQCorrelations[pW][eW]);
3425
3426 // averages <<2><4>>, <<2><6>>, <<4><6>>, etc, needed to calculate covariances:
3427 fQProducts[pW][eW] = new TProfile(Form("fQProducts: %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()),Form("Averages of products (%s, %s)",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()),6,0,6);
3428 fQProducts[pW][eW]->SetTickLength(-0.01,"Y");
3429 fQProducts[pW][eW]->SetMarkerStyle(25);
3430 fQProducts[pW][eW]->SetLabelSize(0.05);
3431 fQProducts[pW][eW]->SetLabelOffset(0.01,"Y");
3432 (fQProducts[pW][eW]->GetXaxis())->SetBinLabel(1,"<<2><4>>");
3433 (fQProducts[pW][eW]->GetXaxis())->SetBinLabel(2,"<<2><6>>");
3434 (fQProducts[pW][eW]->GetXaxis())->SetBinLabel(3,"<<2><8>>");
3435 (fQProducts[pW][eW]->GetXaxis())->SetBinLabel(4,"<<4><6>>");
3436 (fQProducts[pW][eW]->GetXaxis())->SetBinLabel(5,"<<4><8>>");
3437 (fQProducts[pW][eW]->GetXaxis())->SetBinLabel(6,"<<6><8>>");
3438 fIntFlowProfiles->Add(fQProducts[pW][eW]);
3439
3440 for(Int_t sc=0;sc<2;sc++)
3441 {
3442 // final average correction terms for non-uniform acceptance calculated from Q-vectors:
3443 fQCorrections[pW][eW][sc] = new TProfile(Form("fQCorrections: %s, %s, %s terms",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),sinCosFlag[sc].Data()),Form("Correction terms for non-uniform acceptance (%s, %s, %s terms)",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),sinCosFlag[sc].Data()),10,0,10,"s");
3444 fQCorrections[pW][eW][sc]->SetTickLength(-0.01,"Y");
3445 fQCorrections[pW][eW][sc]->SetMarkerStyle(25);
3446 fQCorrections[pW][eW][sc]->SetLabelSize(0.03);
3447 fQCorrections[pW][eW][sc]->SetLabelOffset(0.01,"Y");
3448 // .........................................................................
3449 // 1-p terms:
3450 (fQCorrections[pW][eW][sc]->GetXaxis())->SetBinLabel(1,Form("%s(n(#phi_{1}))>",sinCosFlag[sc].Data()));
3451 // 2-p terms:
3452 // 3-p terms:
3453 // ...
3454 // .........................................................................
3455 // add fQCorrectionsCos to the list fIntFlowList:
3456 fIntFlowProfiles->Add(fQCorrections[pW][eW][sc]);
3457 } // end of for(Int_t sc=0;sc<2;sc++)
3458
3459 // *****************
3460 // **** RESULTS ****
3461 // *****************
3462
3463 // final results for average multi-particle correlations with correct statistical errors:
3464 fCorrelations[pW][eW] = new TH1D(Form("fCorrelations: %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()),Form("Average multi-particle correlations (%s, %s)",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()),32,0,32);
3465 fCorrelations[pW][eW]->SetTickLength(-0.01,"Y");
3466 fCorrelations[pW][eW]->SetMarkerStyle(25);
3467 fCorrelations[pW][eW]->SetLabelSize(0.03);
3468 fCorrelations[pW][eW]->SetLabelOffset(0.01,"Y");
3469 // 2-p correlations:
3470 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(1,"<<2>>_{n|n}");
3471 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(2,"<<2>>_{2n|2n}");
3472 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(3,"<<2>>_{3n|3n}");
3473 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(4,"<<2>>_{4n|4n}");
3474 // 3-p correlations:
3475 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(6,"<<3>>_{2n|n,n}");
3476 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(7,"<<3>>_{3n|2n,n}");
3477 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(8,"<<3>>_{4n|2n,2n}");
3478 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(9,"<<3>>_{4n|3n,n}");
3479 // 4-p correlations:
3480 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(11,"<<4>>_{n,n|n,n}");
3481 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(12,"<<4>>_{2n,n|2n,n}");
3482 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(13,"<<4>>_{2n,2n|2n,2n}");
3483 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(14,"<<4>>_{3n|n,n,n}");
3484 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(15,"<<4>>_{3n,n|3n,n}");
3485 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(16,"<<4>>_{3n,n|2n,2n}");
3486 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(17,"<<4>>_{4n|2n,n,n}");
3487 // 5-p correlations:
3488 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(19,"<<5>>_{2n|n,n,n,n}");
3489 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(20,"<<5>>_{2n,2n|2n,n,n}");
3490 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(21,"<<5>>_{3n,n|2n,n,n}");
3491 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(22,"<<5>>_{4n|n,n,n,n}");
3492 // 6-p correlations:
3493 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(24,"<<6>>_{n,n,n|n,n,n}");
3494 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(25,"<<6>>_{2n,n,n|2n,n,n}");
3495 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(26,"<<6>>_{2n,2n|n,n,n,n}");
3496 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(27,"<<6>>_{3n,n|n,n,n,n}");
3497 // 7-p correlations:
3498 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(29,"<<7>>_{2n,n,n|n,n,n,n}");
3499 // 8-p correlations:
3500 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(31,"<<8>>_{n,n,n,n|n,n,n,n}");
3501 // add fCorrelations to the list fIntFlowList:
3502 fIntFlowResults->Add(fCorrelations[pW][eW]);
3503
3504 // final corrections for non-uniform acceptance for QC{2}, QC{4}, QC{6} and QC{8}:
3505 fCorrections[pW][eW] = new TH1D(Form("fCorrections: %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()),Form("Corrections for non-uniform acceptance for Q-cumulants (%s, %s)",eWeightsFlag[eW].Data()),4,0,4);
3506 fCorrections[pW][eW]->SetLabelSize(0.05);
3507 fCorrections[pW][eW]->SetMarkerStyle(25);
3508 (fCorrections[pW][eW]->GetXaxis())->SetBinLabel(1,"corr. for QC{2}");
3509 (fCorrections[pW][eW]->GetXaxis())->SetBinLabel(2,"corr. for QC{4}");
3510 (fCorrections[pW][eW]->GetXaxis())->SetBinLabel(3,"corr. for QC{6}");
3511 (fCorrections[pW][eW]->GetXaxis())->SetBinLabel(4,"corr. for QC{8}");
3512 // add fCorrections[pW] to list fIntFlowResults:
3513 fIntFlowResults->Add(fCorrections[pW][eW]);
3514
3515 // final results for covariances:
3516 fCovariances[pW][eW] = new TH1D(Form("fCovariances: %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()),Form("Covariances (%s, %s)",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()),6,0,6);
3517 fCovariances[pW][eW]->SetLabelSize(0.05);
3518 fCovariances[pW][eW]->SetMarkerStyle(25);
3519 (fCovariances[pW][eW]->GetXaxis())->SetBinLabel(1,"Cov(2,4)");
3520 (fCovariances[pW][eW]->GetXaxis())->SetBinLabel(2,"Cov(2,6)");
3521 (fCovariances[pW][eW]->GetXaxis())->SetBinLabel(3,"Cov(2,8)");
3522 (fCovariances[pW][eW]->GetXaxis())->SetBinLabel(4,"Cov(4,6)");
3523 (fCovariances[pW][eW]->GetXaxis())->SetBinLabel(5,"Cov(4,8)");
3524 (fCovariances[pW][eW]->GetXaxis())->SetBinLabel(6,"Cov(6,8)");
3525 // add fCovariances[pW][eW] to list fIntFlowResults:
3526 fIntFlowResults->Add(fCovariances[pW][eW]);
3527
c2a42ea2 3528 // final results for sum of event weights:
3529 for(Int_t power=0;power<2;power++)
3530 {
3531 fSumOfEventWeights[pW][eW][power] = new TH1D(Form("fSumOfEventWeights: %s, %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),powerFlag[power].Data()),Form("SumOfEventWeights (%s, %s, %s)",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),powerFlag[power].Data()),4,0,4);
3532 fSumOfEventWeights[pW][eW][power]->SetLabelSize(0.05);
3533 fSumOfEventWeights[pW][eW][power]->SetMarkerStyle(25);
3534 (fSumOfEventWeights[pW][eW][power]->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>}");
3535 (fSumOfEventWeights[pW][eW][power]->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<4>}");
3536 (fSumOfEventWeights[pW][eW][power]->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<6>}");
3537 (fSumOfEventWeights[pW][eW][power]->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<8>}");
3538 // add fSumOfEventWeights[pW][eW] to list fIntFlowResults:
3539 fIntFlowResults->Add(fSumOfEventWeights[pW][eW][power]);
3540 }
3541
3542 // final results for sum of product of event weights:
3543 fProductOfEventWeights[pW][eW] = new TH1D(Form("fProductOfEventWeights: %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()),Form("ProductOfEventWeights (%s, %s)",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()),6,0,6);
3544 fProductOfEventWeights[pW][eW]->SetLabelSize(0.05);
3545 fProductOfEventWeights[pW][eW]->SetMarkerStyle(25);
3546 (fProductOfEventWeights[pW][eW]->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>} w_{<4>}");
3547 (fProductOfEventWeights[pW][eW]->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<2>} w_{<6>}");
3548 (fProductOfEventWeights[pW][eW]->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<2>} w_{<8>}");
3549 (fProductOfEventWeights[pW][eW]->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<4>} w_{<6>}");
3550 (fProductOfEventWeights[pW][eW]->GetXaxis())->SetBinLabel(5,"#sum_{i=1}^{N} w_{<4>} w_{<8>}");
3551 (fProductOfEventWeights[pW][eW]->GetXaxis())->SetBinLabel(6,"#sum_{i=1}^{N} w_{<6>} w_{<8>}");
3552 // add fProductOfEventWeights[pW][eW] to list fIntFlowResults:
3553 fIntFlowResults->Add(fProductOfEventWeights[pW][eW]);
3554
2aa4ebcd 3555 for(Int_t nua=0;nua<2;nua++)
3556 {
3557 // integrated Q-cumulants:
3558 fCumulants[pW][eW][nua] = new TH1D(Form("fCumulants: %s, %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data()),Form("Q-cumulants (%s, %s, %s)",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data()),4,0,4);
3559 fCumulants[pW][eW][nua]->SetLabelSize(0.05);
3560 fCumulants[pW][eW][nua]->SetMarkerStyle(25);
3561 (fCumulants[pW][eW][nua]->GetXaxis())->SetBinLabel(1,"QC{2}");
3562 (fCumulants[pW][eW][nua]->GetXaxis())->SetBinLabel(2,"QC{4}");
3563 (fCumulants[pW][eW][nua]->GetXaxis())->SetBinLabel(3,"QC{6}");
3564 (fCumulants[pW][eW][nua]->GetXaxis())->SetBinLabel(4,"QC{8}");
3565 // add fCumulants[pW][nua] to list fIntFlowResults:
3566 fIntFlowResults->Add(fCumulants[pW][eW][nua]);
2bdc5281 3567
2aa4ebcd 3568 // integrated flow from Q-cumulants:
3569 fIntFlow[pW][eW][nua] = new TH1D(Form("fIntFlow: %s, %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data()),Form("Integrated flow from Q-cumulants (%s, %s, %s)",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data()),4,0,4);
3570 fIntFlow[pW][eW][nua]->SetLabelSize(0.05);
3571 fIntFlow[pW][eW][nua]->SetMarkerStyle(25);
3572 (fIntFlow[pW][eW][nua]->GetXaxis())->SetBinLabel(1,"v_{2}{2,QC}");
3573 (fIntFlow[pW][eW][nua]->GetXaxis())->SetBinLabel(2,"v_{2}{4,QC}");
3574 (fIntFlow[pW][eW][nua]->GetXaxis())->SetBinLabel(3,"v_{2}{6,QC}");
3575 (fIntFlow[pW][eW][nua]->GetXaxis())->SetBinLabel(4,"v_{2}{8,QC}");
3576 // add fIntFlow[pW][nua] to list fIntFlowResults:
3577 fIntFlowResults->Add(fIntFlow[pW][eW][nua]);
2bdc5281 3578
2aa4ebcd 3579 } // end of for(Int_t nua=0;nua<2;nua++)
3580 } // end of for(Int_t eW=0;eW<2;eW++)
3581 } // end of for(Int_t pW=0;pW<1+(Int_t)(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);pW++)
3582
3583
3584
3585 /*
3586 // final average weighted multi-particle correlations for all events calculated from Q-vectors
3587 fQCorrelations[1] = new TProfile("Weighted correlations","final average multi-particle correlations from weighted Q-vectors",200,0,200,"s");
3588 fQCorrelations[1]->SetTickLength(-0.01,"Y");
3589 fQCorrelations[1]->SetMarkerStyle(25);
3590 fQCorrelations[1]->SetLabelSize(0.03);
3591 fQCorrelations[1]->SetLabelOffset(0.01,"Y");
3592 // 2-particle correlations:
3593 (fQCorrelations[1]->GetXaxis())->SetBinLabel(1,"<w_{1}w_{2}cos(n(#phi_{1}-#phi_{2}))>");
3594 (fQCorrelations[1]->GetXaxis())->SetBinLabel(2,"<w_{1}^{2}w_{2}^{2}cos(2n(#phi_{1}-#phi_{2}))>");
3595 (fQCorrelations[1]->GetXaxis())->SetBinLabel(3,"<w_{1}^{3}w_{2}^{3}cos(3n(#phi_{1}-#phi_{2}))>");
3596 (fQCorrelations[1]->GetXaxis())->SetBinLabel(4,"<w_{1}^{4}w_{2}^{4}cos(4n(#phi_{1}-#phi_{2}))>");
3597 (fQCorrelations[1]->GetXaxis())->SetBinLabel(5,"<w_{1}^{3}w_{2}cos(n(#phi_{1}-#phi_{2}))>");
3598 (fQCorrelations[1]->GetXaxis())->SetBinLabel(6,"<w_{1}^{2}w_{2}w_{3}cos(n(#phi_{1}-#phi_{2}))>");
3599 // 3-particle correlations:
3600 (fQCorrelations[1]->GetXaxis())->SetBinLabel(21,"<w_{1}w_{2}w_{3}^{2}cos(n(2#phi_{1}-#phi_{2}-#phi_{3}))>");
3601 // 4-particle correlations:
3602 (fQCorrelations[1]->GetXaxis())->SetBinLabel(41,"<w_{1}w_{2}w_{3}w_{4}cos(n(#phi_{1}+#phi_{2}-#phi_{3}-#phi_{4}))>");
3603 // add fQCorrelations[1] to the list fIntFlowList:
3604 fIntFlowList->Add(fQCorrelations[1]);
3605 */
3606
2bdc5281 3607
2aa4ebcd 3608} // end of AliFlowAnalysisWithQCumulants::BookEverythingForIntegratedFlow()
2bdc5281 3609
3610
3611//================================================================================================================================
3612
3613
2aa4ebcd 3614void AliFlowAnalysisWithQCumulants::BookEverythingForNestedLoops()
2bdc5281 3615{
2aa4ebcd 3616 // book all profiles relevant for calculations with nested loops
3617
3618 fEvaluateNestedLoops = new TProfile("fEvaluateNestedLoops","1 = evaluate, 0 = do not evaluate",2,0,2);
3619 fEvaluateNestedLoops->SetLabelSize(0.05);
3620 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(1,"Nested Loops (Int. Flow)");
3621 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(2,"Nested Loops (Diff. Flow)");
3622 fEvaluateNestedLoops->Fill(0.5,(Int_t)fEvaluateNestedLoopsForIntFlow);
3623 fEvaluateNestedLoops->Fill(1.5,(Int_t)fEvaluateNestedLoopsForDiffFlow);
3624 // add fEvaluateNestedLoops to the list fNestedLoopsList:
3625 fNestedLoopsList->Add(fEvaluateNestedLoops);
3626
3627 if(fEvaluateNestedLoopsForIntFlow)
3628 {
3629 fDirectCorrelations = new TProfile("fDirectCorrelations","multi-particle correlations with nested loops",100,0,100,"s");
3630 fNestedLoopsList->Add(fDirectCorrelations);
3631 fDirectCorrectionsCos = new TProfile("fDirectCorrectionsCos"," corrections for non-uniform acceptance (cos terms)",100,0,100,"s");
3632 fNestedLoopsList->Add(fDirectCorrectionsCos);
3633 fDirectCorrectionsSin = new TProfile("fDirectCorrectionsSin"," corrections for non-uniform acceptance (sin terms)",100,0,100,"s");
3634 fNestedLoopsList->Add(fDirectCorrectionsSin);
3635 if(fUsePhiWeights) // Remark: cross-checking performed only with phi-weights (this is sufficient)
3636 {
3637 fDirectCorrelationsW = new TProfile("fDirectCorrelationsW","multi-particle correlations with nested loops",200,0,200,"s");
3638 fNestedLoopsList->Add(fDirectCorrelationsW);
3639 fDirectCorrectionsCosW = new TProfile("fDirectCorrectionsCosW"," corrections for non-uniform acceptance (cos terms)",100,0,100,"s");
3640 fNestedLoopsList->Add(fDirectCorrectionsCosW);
3641 fDirectCorrectionsSinW = new TProfile("fDirectCorrectionsSinW"," corrections for non-uniform acceptance (sin terms)",100,0,100,"s");
3642 fNestedLoopsList->Add(fDirectCorrectionsSinW);
3643 }
3644 }
2bdc5281 3645
2aa4ebcd 3646 if(fEvaluateNestedLoopsForDiffFlow)
3647 {
3648 fDirectCorrelationsDiffFlow = new TProfile("fDirectCorrelationsDiffFlow","multi-particle correlations with nested loops",200,0,200,"s");
3649 fNestedLoopsList->Add(fDirectCorrelationsDiffFlow);
3650 fDirectCorrectionsDiffFlowCos = new TProfile("fDirectCorrectionsDiffFlowCos",
3651 "corrections for non-uniform acceptance (cos terms) with nested loops",200,0,200,"s");
3652 fNestedLoopsList->Add(fDirectCorrectionsDiffFlowCos);
3653 fDirectCorrectionsDiffFlowSin = new TProfile("fDirectCorrectionsDiffFlowSin",
3654 "corrections for non-uniform acceptance (sin terms) with nested loops",200,0,200,"s");
3655 fNestedLoopsList->Add(fDirectCorrectionsDiffFlowSin);
3656 if(fUsePhiWeights) // Remark: cross-checking performed only with phi-weights (this is sufficient)
3657 {
3658 fDirectCorrelationsDiffFlowW = new TProfile("fDirectCorrelationsDiffFlowW","multi-particle correlations with nested loops",200,0,200,"s");
3659 fNestedLoopsList->Add(fDirectCorrelationsDiffFlowW);
3660 fDirectCorrectionsDiffFlowCosW = new TProfile("fDirectCorrectionsDiffFlowCosW",
3661 "corrections for non-uniform acceptance (cos terms) with nested loops",200,0,200,"s");
3662 fNestedLoopsList->Add(fDirectCorrectionsDiffFlowCosW);
3663 fDirectCorrectionsDiffFlowSinW = new TProfile("fDirectCorrectionsDiffFlowSinW",
3664 "corrections for non-uniform acceptance (sin terms) with nested loops",200,0,200,"s");
3665 fNestedLoopsList->Add(fDirectCorrectionsDiffFlowSinW);
3666 }
3667 }
2bdc5281 3668
2aa4ebcd 3669} // end of AliFlowAnalysisWithQCumulants::BookEverythingForNestedLoops()
3670
3671
3672//================================================================================================================================
3673
3674
3675void AliFlowAnalysisWithQCumulants::CalculateCorrelationsForIntegratedFlow()
3676{
3677 // calculate all correlations needed for integrated flow
2bdc5281 3678
3679 // multiplicity:
2aa4ebcd 3680 Double_t dMult = (*fSMpk)(0,0);
2bdc5281 3681
3682 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
2aa4ebcd 3683 Double_t dReQ1n = (*fReQ)(0,0);
3684 Double_t dReQ2n = (*fReQ)(1,0);
3685 Double_t dReQ3n = (*fReQ)(2,0);
3686 Double_t dReQ4n = (*fReQ)(3,0);
3687 Double_t dImQ1n = (*fImQ)(0,0);
3688 Double_t dImQ2n = (*fImQ)(1,0);
3689 Double_t dImQ3n = (*fImQ)(2,0);
3690 Double_t dImQ4n = (*fImQ)(3,0);
3691
3692 // real and imaginary parts of some expressions involving various combinations of Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
3693 // (these expression appear in the Eqs. for the multi-particle correlations bellow)
3694
3695 // Re[Q_{2n} Q_{n}^* Q_{n}^*]
3696 Double_t reQ2nQ1nstarQ1nstar = pow(dReQ1n,2.)*dReQ2n + 2.*dReQ1n*dImQ1n*dImQ2n - pow(dImQ1n,2.)*dReQ2n;
3697
3698 // Im[Q_{2n} Q_{n}^* Q_{n}^*]
3699 //Double_t imQ2nQ1nstarQ1nstar = pow(dReQ1n,2.)*dImQ2n-2.*dReQ1n*dImQ1n*dReQ2n-pow(dImQ1n,2.)*dImQ2n;
3700
3701 // Re[Q_{n} Q_{n} Q_{2n}^*] = Re[Q_{2n} Q_{n}^* Q_{n}^*]
3702 Double_t reQ1nQ1nQ2nstar = reQ2nQ1nstarQ1nstar;
3703
3704 // Re[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]
3705 Double_t reQ3nQ1nQ2nstarQ2nstar = (pow(dReQ2n,2.)-pow(dImQ2n,2.))*(dReQ3n*dReQ1n-dImQ3n*dImQ1n)
3706 + 2.*dReQ2n*dImQ2n*(dReQ3n*dImQ1n+dImQ3n*dReQ1n);
2bdc5281 3707
2aa4ebcd 3708 // Im[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]
3709 //Double_t imQ3nQ1nQ2nstarQ2nstar = calculate and implement this (deleteMe)
3710
3711 // Re[Q_{2n} Q_{2n} Q_{3n}^* Q_{1n}^*] = Re[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]
3712 Double_t reQ2nQ2nQ3nstarQ1nstar = reQ3nQ1nQ2nstarQ2nstar;
3713
3714 // Re[Q_{4n} Q_{2n}^* Q_{2n}^*]
3715 Double_t reQ4nQ2nstarQ2nstar = pow(dReQ2n,2.)*dReQ4n+2.*dReQ2n*dImQ2n*dImQ4n-pow(dImQ2n,2.)*dReQ4n;
2bdc5281 3716
2aa4ebcd 3717 // Im[Q_{4n} Q_{2n}^* Q_{2n}^*]
3718 //Double_t imQ4nQ2nstarQ2nstar = calculate and implement this (deleteMe)
2bdc5281 3719
2aa4ebcd 3720 // Re[Q_{2n} Q_{2n} Q_{4n}^*] = Re[Q_{4n} Q_{2n}^* Q_{2n}^*]
3721 Double_t reQ2nQ2nQ4nstar = reQ4nQ2nstarQ2nstar;
3722
3723 // Re[Q_{4n} Q_{3n}^* Q_{n}^*]
3724 Double_t reQ4nQ3nstarQ1nstar = dReQ4n*(dReQ3n*dReQ1n-dImQ3n*dImQ1n)+dImQ4n*(dReQ3n*dImQ1n+dImQ3n*dReQ1n);
3725
3726 // Re[Q_{3n} Q_{n} Q_{4n}^*] = Re[Q_{4n} Q_{3n}^* Q_{n}^*]
3727 Double_t reQ3nQ1nQ4nstar = reQ4nQ3nstarQ1nstar;
3728
3729 // Im[Q_{4n} Q_{3n}^* Q_{n}^*]
3730 //Double_t imQ4nQ3nstarQ1nstar = calculate and implement this (deleteMe)
c365fe76 3731
2aa4ebcd 3732 // Re[Q_{3n} Q_{2n}^* Q_{n}^*]
3733 Double_t reQ3nQ2nstarQ1nstar = dReQ3n*dReQ2n*dReQ1n-dReQ3n*dImQ2n*dImQ1n+dImQ3n*dReQ2n*dImQ1n
3734 + dImQ3n*dImQ2n*dReQ1n;
3735
3736 // Re[Q_{2n} Q_{n} Q_{3n}^*] = Re[Q_{3n} Q_{2n}^* Q_{n}^*]
3737 Double_t reQ2nQ1nQ3nstar = reQ3nQ2nstarQ1nstar;
3738
3739 // Im[Q_{3n} Q_{2n}^* Q_{n}^*]
3740 //Double_t imQ3nQ2nstarQ1nstar; //calculate and implement this (deleteMe)
3741
3742 // Re[Q_{3n} Q_{n}^* Q_{n}^* Q_{n}^*]
3743 Double_t reQ3nQ1nstarQ1nstarQ1nstar = dReQ3n*pow(dReQ1n,3)-3.*dReQ1n*dReQ3n*pow(dImQ1n,2)
3744 + 3.*dImQ1n*dImQ3n*pow(dReQ1n,2)-dImQ3n*pow(dImQ1n,3);
c365fe76 3745
2aa4ebcd 3746 // Im[Q_{3n} Q_{n}^* Q_{n}^* Q_{n}^*]
3747 //Double_t imQ3nQ1nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)
3748
3749 // |Q_{2n}|^2 |Q_{n}|^2
3750 Double_t dQ2nQ1nQ2nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.));
3751
3752 // Re[Q_{4n} Q_{2n}^* Q_{n}^* Q_{n}^*]
3753 Double_t reQ4nQ2nstarQ1nstarQ1nstar = (dReQ4n*dReQ2n+dImQ4n*dImQ2n)*(pow(dReQ1n,2)-pow(dImQ1n,2))
3754 + 2.*dReQ1n*dImQ1n*(dImQ4n*dReQ2n-dReQ4n*dImQ2n);
3755
3756 // Im[Q_{4n} Q_{2n}^* Q_{n}^* Q_{n}^*]
3757 //Double_t imQ4nQ2nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)
3758
3759 // Re[Q_{2n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^*]
3760 Double_t reQ2nQ1nQ1nstarQ1nstarQ1nstar = (dReQ2n*dReQ1n-dImQ2n*dImQ1n)*(pow(dReQ1n,3)-3.*dReQ1n*pow(dImQ1n,2))
3761 + (dReQ2n*dImQ1n+dReQ1n*dImQ2n)*(3.*dImQ1n*pow(dReQ1n,2)-pow(dImQ1n,3));
c365fe76 3762
2aa4ebcd 3763 // Im[Q_{2n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^*]
3764 //Double_t imQ2nQ1nQ1nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)
3765
3766 // Re[Q_{2n} Q_{2n} Q_{2n}^* Q_{n}^* Q_{n}^*]
3767 Double_t reQ2nQ2nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))
3768 * (dReQ2n*(pow(dReQ1n,2.)-pow(dImQ1n,2.)) + 2.*dImQ2n*dReQ1n*dImQ1n);
c365fe76 3769
2aa4ebcd 3770 // Im[Q_{2n} Q_{2n} Q_{2n}^* Q_{n}^* Q_{n}^*]
3771 //Double_t imQ2nQ2nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))
3772 // * (dImQ2n*(pow(dReQ1n,2.)-pow(dImQ1n,2.)) - 2.*dReQ2n*dReQ1n*dImQ1n);
3773
3774 // Re[Q_{4n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
3775 Double_t reQ4nQ1nstarQ1nstarQ1nstarQ1nstar = pow(dReQ1n,4.)*dReQ4n-6.*pow(dReQ1n,2.)*dReQ4n*pow(dImQ1n,2.)
3776 + pow(dImQ1n,4.)*dReQ4n+4.*pow(dReQ1n,3.)*dImQ1n*dImQ4n
3777 - 4.*pow(dImQ1n,3.)*dReQ1n*dImQ4n;
3778
3779 // Im[Q_{4n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
3780 //Double_t imQ4nQ1nstarQ1nstarQ1nstarQ1nstar = pow(dReQ1n,4.)*dImQ4n-6.*pow(dReQ1n,2.)*dImQ4n*pow(dImQ1n,2.)
3781 // + pow(dImQ1n,4.)*dImQ4n+4.*pow(dImQ1n,3.)*dReQ1n*dReQ4n
3782 // - 4.*pow(dReQ1n,3.)*dImQ1n*dReQ4n;
3783
3784 // Re[Q_{3n} Q_{n} Q_{2n}^* Q_{n}^* Q_{n}^*]
3785 Double_t reQ3nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
3786 * (dReQ1n*dReQ2n*dReQ3n-dReQ3n*dImQ1n*dImQ2n+dReQ2n*dImQ1n*dImQ3n+dReQ1n*dImQ2n*dImQ3n);
3787
3788 // Im[Q_{3n} Q_{n} Q_{2n}^* Q_{n}^* Q_{n}^*]
3789 //Double_t imQ3nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
3790 // * (-dReQ2n*dReQ3n*dImQ1n-dReQ1n*dReQ3n*dImQ2n+dReQ1n*dReQ2n*dImQ3n-dImQ1n*dImQ2n*dImQ3n);
3d824203 3791
dee1e0e0 3792
2aa4ebcd 3793 // Re[Q_{2n} Q_{2n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
3794 Double_t reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)*dReQ2n-2.*dReQ1n*dReQ2n*dImQ1n-dReQ2n*pow(dImQ1n,2.)
3795 + dImQ2n*pow(dReQ1n,2.)+2.*dReQ1n*dImQ1n*dImQ2n-pow(dImQ1n,2.)*dImQ2n)
3796 * (pow(dReQ1n,2.)*dReQ2n+2.*dReQ1n*dReQ2n*dImQ1n-dReQ2n*pow(dImQ1n,2.)
3797 - dImQ2n*pow(dReQ1n,2.)+2.*dReQ1n*dImQ1n*dImQ2n+pow(dImQ1n,2.)*dImQ2n);
3798
3799 // Im[Q_{2n} Q_{2n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
3800 //Double_t imQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar = 2.*(pow(dReQ1n,2.)*dReQ2n-dReQ2n*pow(dImQ1n,2.)
3801 // + 2.*dReQ1n*dImQ1n*dImQ2n)*(pow(dReQ1n,2.)*dImQ2n
3802 // - 2.*dReQ1n*dImQ1n*dReQ2n-pow(dImQ1n,2.)*dImQ2n);
3803
3804 // Re[Q_{3n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
3805 Double_t reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
3806 * (pow(dReQ1n,3.)*dReQ3n-3.*dReQ1n*dReQ3n*pow(dImQ1n,2.)
3807 + 3.*pow(dReQ1n,2.)*dImQ1n*dImQ3n-pow(dImQ1n,3.)*dImQ3n);
3808
3809 // Im[Q_{3n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
3810 //Double_t imQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
3811 // * (pow(dImQ1n,3.)*dReQ3n-3.*dImQ1n*dReQ3n*pow(dReQ1n,2.)
3812 // - 3.*pow(dImQ1n,2.)*dReQ1n*dImQ3n+pow(dReQ1n,3.)*dImQ3n);
3d824203 3813
2aa4ebcd 3814 // |Q_{2n}|^2 |Q_{n}|^4
3815 Double_t dQ2nQ1nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))*pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.);
77515452 3816
2aa4ebcd 3817 // Re[Q_{2n} Q_{n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
3818 Double_t reQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
3819 * (pow(dReQ1n,2.)*dReQ2n-dReQ2n*pow(dImQ1n,2.)
3820 + 2.*dReQ1n*dImQ1n*dImQ2n);
3821
3822 // Im[Q_{2n} Q_{n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
3823 //Double_t imQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
3824 // * (pow(dReQ1n,2.)*dImQ2n-dImQ2n*pow(dImQ1n,2.)
3825 // - 2.*dReQ1n*dReQ2n*dImQ1n);
77515452 3826
2aa4ebcd 3827
77515452 3828
2aa4ebcd 3829
3830 // **************************************
3831 // **** multi-particle correlations: ****
3832 // **************************************
9c1a9547 3833 //
2aa4ebcd 3834 // Remark 1: multi-particle correlations calculated with non-weighted Q-vectors are stored in 1D profile fQCorrelations[0].
3835 // Remark 2: binning of fQCorrelations[0] is organized as follows:
9c1a9547 3836 // --------------------------------------------------------------------------------------------------------------------
3837 // 1st bin: <2>_{1n|1n} = two1n1n = cos(n*(phi1-phi2))>
3838 // 2nd bin: <2>_{2n|2n} = two2n2n = cos(2n*(phi1-phi2))>
3839 // 3rd bin: <2>_{3n|3n} = two3n3n = cos(3n*(phi1-phi2))>
3840 // 4th bin: <2>_{4n|4n} = two4n4n = cos(4n*(phi1-phi2))>
3841 // 5th bin: ---- EMPTY ----
3842 // 6th bin: <3>_{2n|1n,1n} = three2n1n1n = <cos(n*(2.*phi1-phi2-phi3))>
3843 // 7th bin: <3>_{3n|2n,1n} = three3n2n1n = <cos(n*(3.*phi1-2.*phi2-phi3))>
3844 // 8th bin: <3>_{4n|2n,2n} = three4n2n2n = <cos(n*(4.*phi1-2.*phi2-2.*phi3))>
3845 // 9th bin: <3>_{4n|3n,1n} = three4n3n1n = <cos(n*(4.*phi1-3.*phi2-phi3))>
3846 // 10th bin: ---- EMPTY ----
3847 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1n = <cos(n*(phi1+phi2-phi3-phi4))>
3848 // 12th bin: <4>_{2n,1n|2n,1n} = four2n1n2n1n = <cos(2.*n*(phi1+phi2-phi3-phi4))>
3849 // 13th bin: <4>_{2n,2n|2n,2n} = four2n2n2n2n = <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>
3850 // 14th bin: <4>_{3n|1n,1n,1n} = four3n1n1n1n = <cos(n*(3.*phi1-phi2-phi3-phi4))>
3851 // 15th bin: <4>_{3n,1n|3n,1n} = four3n1n3n1n = <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>
3852 // 16th bin: <4>_{3n,1n|2n,2n} = four3n1n2n2n = <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>
3853 // 17th bin: <4>_{4n|2n,1n,1n} = four4n2n1n1n = <cos(n*(3.*phi1+phi2-3.*phi3-phi4))>
3854 // 18th bin: ---- EMPTY ----
3855 // 19th bin: <5>_{2n|1n,1n,1n,1n} = five2n1n1n1n1n = <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>
3856 // 20th bin: <5>_{2n,2n|2n,1n,1n} = five2n2n2n1n1n = <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>
3857 // 21st bin: <5>_{3n,1n|2n,1n,1n} = five3n1n2n1n1n = <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>
3858 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = five4n1n1n1n1n = <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>
3859 // 23rd bin: ---- EMPTY ----
3860 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = six1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
3861 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = six2n1n1n2n1n1n = <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>
3862 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = six2n2n1n1n1n1n = <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>
3863 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = six3n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>
3864 // 28th bin: ---- EMPTY ----
3865 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = seven2n1n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
3866 // 30th bin: ---- EMPTY ----
3867 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = eight1n1n1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
3868 // --------------------------------------------------------------------------------------------------------------------
9c1a9547 3869
2aa4ebcd 3870 // 2-particle:
3871 Double_t two1n1n = 0.; // <cos(n*(phi1-phi2))>
3872 Double_t two2n2n = 0.; // <cos(2n*(phi1-phi2))>
3873 Double_t two3n3n = 0.; // <cos(3n*(phi1-phi2))>
3874 Double_t two4n4n = 0.; // <cos(4n*(phi1-phi2))>
c365fe76 3875
2aa4ebcd 3876 if(dMult>1)
bc92c0cb 3877 {
2aa4ebcd 3878 two1n1n = (pow(dReQ1n,2.)+pow(dImQ1n,2.)-dMult)/(dMult*(dMult-1.));
3879 two2n2n = (pow(dReQ2n,2.)+pow(dImQ2n,2.)-dMult)/(dMult*(dMult-1.));
3880 two3n3n = (pow(dReQ3n,2.)+pow(dImQ3n,2.)-dMult)/(dMult*(dMult-1.));
3881 two4n4n = (pow(dReQ4n,2.)+pow(dImQ4n,2.)-dMult)/(dMult*(dMult-1.));
c365fe76 3882
2aa4ebcd 3883 // average non-weighted 2-particle correlations for single event:
3884 fQCorrelationsEBE[0]->SetBinContent(1,two1n1n);
3885 fQCorrelationsEBE[0]->SetBinContent(2,two2n2n);
3886 fQCorrelationsEBE[0]->SetBinContent(3,two3n3n);
3887 fQCorrelationsEBE[0]->SetBinContent(4,two4n4n);
3888
3889 // final average non-weighted 2-particle correlations for all events:
3890 fQCorrelations[0][0]->Fill(0.5,two1n1n,dMult*(dMult-1.));
3891 fQCorrelations[0][0]->Fill(1.5,two2n2n,dMult*(dMult-1.));
3892 fQCorrelations[0][0]->Fill(2.5,two3n3n,dMult*(dMult-1.));
3893 fQCorrelations[0][0]->Fill(3.5,two4n4n,dMult*(dMult-1.));
3894
3895 // distribution of <cos(n*(phi1-phi2))>:
3896 //f2pDistribution->Fill(two1n1n,dMult*(dMult-1.));
3897 } // end of if(dMult>1)
3898
3899 // 3-particle:
3900 Double_t three2n1n1n = 0.; // <cos(n*(2.*phi1-phi2-phi3))>
3901 Double_t three3n2n1n = 0.; // <cos(n*(3.*phi1-2.*phi2-phi3))>
3902 Double_t three4n2n2n = 0.; // <cos(n*(4.*phi1-2.*phi2-2.*phi3))>
3903 Double_t three4n3n1n = 0.; // <cos(n*(4.*phi1-3.*phi2-phi3))>
3904
3905 if(dMult>2)
bc92c0cb 3906 {
2aa4ebcd 3907 three2n1n1n = (reQ2nQ1nstarQ1nstar-2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3908 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))+2.*dMult)
3909 / (dMult*(dMult-1.)*(dMult-2.));
3910 three3n2n1n = (reQ3nQ2nstarQ1nstar-(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3911 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))
3912 - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)
3913 / (dMult*(dMult-1.)*(dMult-2.));
3914 three4n2n2n = (reQ4nQ2nstarQ2nstar-2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3915 - (pow(dReQ4n,2.)+pow(dImQ4n,2.))+2.*dMult)
3916 / (dMult*(dMult-1.)*(dMult-2.));
3917 three4n3n1n = (reQ4nQ3nstarQ1nstar-(pow(dReQ4n,2.)+pow(dImQ4n,2.))
3918 - (pow(dReQ3n,2.)+pow(dImQ3n,2.))
3919 - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)
3920 / (dMult*(dMult-1.)*(dMult-2.));
3921
3922 // average non-weighted 3-particle correlations for single event:
3923 fQCorrelationsEBE[0]->SetBinContent(6,three2n1n1n);
3924 fQCorrelationsEBE[0]->SetBinContent(7,three3n2n1n);
3925 fQCorrelationsEBE[0]->SetBinContent(8,three4n2n2n);
3926 fQCorrelationsEBE[0]->SetBinContent(9,three4n3n1n);
3927
3928 // final average non-weighted 3-particle correlations for all events:
3929 fQCorrelations[0][0]->Fill(5.5,three2n1n1n,dMult*(dMult-1.)*(dMult-2.));
3930 fQCorrelations[0][0]->Fill(6.5,three3n2n1n,dMult*(dMult-1.)*(dMult-2.));
3931 fQCorrelations[0][0]->Fill(7.5,three4n2n2n,dMult*(dMult-1.)*(dMult-2.));
3932 fQCorrelations[0][0]->Fill(8.5,three4n3n1n,dMult*(dMult-1.)*(dMult-2.));
3933 } // end of if(dMult>2)
bc92c0cb 3934
2aa4ebcd 3935 // 4-particle:
3936 Double_t four1n1n1n1n = 0.; // <cos(n*(phi1+phi2-phi3-phi4))>
3937 Double_t four2n2n2n2n = 0.; // <cos(2.*n*(phi1+phi2-phi3-phi4))>
3938 Double_t four2n1n2n1n = 0.; // <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>
3939 Double_t four3n1n1n1n = 0.; // <cos(n*(3.*phi1-phi2-phi3-phi4))>
3940 Double_t four4n2n1n1n = 0.; // <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>
3941 Double_t four3n1n2n2n = 0.; // <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>
3942 Double_t four3n1n3n1n = 0.; // <cos(n*(3.*phi1+phi2-3.*phi3-phi4))>
3943
3944 if(dMult>3)
dee1e0e0 3945 {
2aa4ebcd 3946 four1n1n1n1n = (2.*dMult*(dMult-3.)+pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)-4.*(dMult-2.)*(pow(dReQ1n,2.)
3947 + pow(dImQ1n,2.))-2.*reQ2nQ1nstarQ1nstar+(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
3948 / (dMult*(dMult-1)*(dMult-2.)*(dMult-3.));
3949 four2n2n2n2n = (2.*dMult*(dMult-3.)+pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)-4.*(dMult-2.)*(pow(dReQ2n,2.)
3950 + pow(dImQ2n,2.))-2.*reQ4nQ2nstarQ2nstar+(pow(dReQ4n,2.)+pow(dImQ4n,2.)))
3951 / (dMult*(dMult-1)*(dMult-2.)*(dMult-3.));
3952 four2n1n2n1n = (dQ2nQ1nQ2nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar-2.*reQ2nQ1nstarQ1nstar)
3953 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
3954 - ((dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3955 + (dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-(pow(dReQ3n,2.)+pow(dImQ3n,2.)))
3956 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
3957 + (dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.));
3958 four3n1n1n1n = (reQ3nQ1nstarQ1nstarQ1nstar-3.*reQ3nQ2nstarQ1nstar-3.*reQ2nQ1nstarQ1nstar)
3959 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
3960 + (2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+3.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3961 + 6.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-6.*dMult)
3962 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3963 four4n2n1n1n = (reQ4nQ2nstarQ1nstarQ1nstar-2.*reQ4nQ3nstarQ1nstar-reQ4nQ2nstarQ2nstar-2.*reQ3nQ2nstarQ1nstar)
3964 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
3965 - (reQ2nQ1nstarQ1nstar-2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3966 - 3.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
3967 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
3968 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
3969 four3n1n2n2n = (reQ3nQ1nQ2nstarQ2nstar-reQ4nQ2nstarQ2nstar-reQ3nQ1nQ4nstar-2.*reQ3nQ2nstarQ1nstar)
3970 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
3971 - (2.*reQ1nQ1nQ2nstar-(pow(dReQ4n,2.)+pow(dImQ4n,2.))-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3972 - 4.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
3973 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
3974 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
3975 four3n1n3n1n = ((pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3976 - 2.*reQ4nQ3nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar)
3977 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
3978 + ((pow(dReQ4n,2.)+pow(dImQ4n,2.))-(dMult-4.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3979 + (pow(dReQ2n,2.)+pow(dImQ2n,2.))-(dMult-4.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
3980 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
3981 + (dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.));
3982
3983 // average non-weighted 4-particle correlations for single event:
3984 fQCorrelationsEBE[0]->SetBinContent(11,four1n1n1n1n);
3985 fQCorrelationsEBE[0]->SetBinContent(12,four2n1n2n1n);
3986 fQCorrelationsEBE[0]->SetBinContent(13,four2n2n2n2n);
3987 fQCorrelationsEBE[0]->SetBinContent(14,four3n1n1n1n);
3988 fQCorrelationsEBE[0]->SetBinContent(15,four3n1n3n1n);
3989 fQCorrelationsEBE[0]->SetBinContent(16,four3n1n2n2n);
3990 fQCorrelationsEBE[0]->SetBinContent(17,four4n2n1n1n);
3991
3992 // final average non-weighted 4-particle correlations for all events:
3993 fQCorrelations[0][0]->Fill(10.5,four1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3994 fQCorrelations[0][0]->Fill(11.5,four2n1n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3995 fQCorrelations[0][0]->Fill(12.5,four2n2n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3996 fQCorrelations[0][0]->Fill(13.5,four3n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3997 fQCorrelations[0][0]->Fill(14.5,four3n1n3n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3998 fQCorrelations[0][0]->Fill(15.5,four3n1n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3999 fQCorrelations[0][0]->Fill(16.5,four4n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
4000
4001 // distribution of <cos(n*(phi1+phi2-phi3-phi4))>
4002 //f4pDistribution->Fill(four1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
4003
4004 } // end of if(dMult>3)
9c1a9547 4005
2aa4ebcd 4006 // 5-particle:
4007 Double_t five2n1n1n1n1n = 0.; // <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>
4008 Double_t five2n2n2n1n1n = 0.; // <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>
4009 Double_t five3n1n2n1n1n = 0.; // <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>
4010 Double_t five4n1n1n1n1n = 0.; // <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>
3d824203 4011
2aa4ebcd 4012 if(dMult>4)
bc92c0cb 4013 {
2aa4ebcd 4014 five2n1n1n1n1n = (reQ2nQ1nQ1nstarQ1nstarQ1nstar-reQ3nQ1nstarQ1nstarQ1nstar+6.*reQ3nQ2nstarQ1nstar)
4015 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
4016 - (reQ2nQ1nQ3nstar+3.*(dMult-6.)*reQ2nQ1nstarQ1nstar+3.*reQ1nQ1nQ2nstar)
4017 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
4018 - (2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
4019 + 3.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
4020 - 3.*(dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
4021 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
4022 - 3.*(pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
4023 - 2.*(2*dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult*(dMult-4.))
4024 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
4025
4026 five2n2n2n1n1n = (reQ2nQ2nQ2nstarQ1nstarQ1nstar-reQ4nQ2nstarQ1nstarQ1nstar-2.*reQ2nQ2nQ3nstarQ1nstar)
4027 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
4028 + 2.*(reQ4nQ2nstarQ2nstar+4.*reQ3nQ2nstarQ1nstar+reQ3nQ1nQ4nstar)
4029 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
4030 + (reQ2nQ2nQ4nstar-2.*(dMult-5.)*reQ2nQ1nstarQ1nstar+2.*reQ1nQ1nQ2nstar)
4031 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
4032 - (2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+4.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
4033 + 1.*pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)
4034 - 2.*(3.*dMult-10.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
4035 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
4036 - (4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
4037 - 4.*(dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))+4.*dMult*(dMult-6.))
4038 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
4039
4040 five4n1n1n1n1n = (reQ4nQ1nstarQ1nstarQ1nstarQ1nstar-6.*reQ4nQ2nstarQ1nstarQ1nstar-4.*reQ3nQ1nstarQ1nstarQ1nstar)
4041 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
4042 + (8.*reQ4nQ3nstarQ1nstar+3.*reQ4nQ2nstarQ2nstar+12.*reQ3nQ2nstarQ1nstar+12.*reQ2nQ1nstarQ1nstar)
4043 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
4044 - (6.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+8.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
4045 + 12.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))+24.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-24.*dMult)
4046 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
4047
4048 five3n1n2n1n1n = (reQ3nQ1nQ2nstarQ1nstarQ1nstar-reQ4nQ2nstarQ1nstarQ1nstar-reQ3nQ1nstarQ1nstarQ1nstar)
4049 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
4050 - (reQ3nQ1nQ2nstarQ2nstar-3.*reQ4nQ3nstarQ1nstar-reQ4nQ2nstarQ2nstar)
4051 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
4052 - ((2.*dMult-13.)*reQ3nQ2nstarQ1nstar-reQ3nQ1nQ4nstar-9.*reQ2nQ1nstarQ1nstar)
4053 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
4054 - (2.*reQ1nQ1nQ2nstar+2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
4055 - 2.*(dMult-5.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+2.*(pow(dReQ3n,2.)
4056 + pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
4057 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
4058 + (2.*(dMult-6.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
4059 - 2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
4060 - pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
4061 + 2.*(3.*dMult-11.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
4062 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
4063 - 4.*(dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
4064
4065 // average non-weighted 5-particle correlations for single event:
4066 fQCorrelationsEBE[0]->SetBinContent(19,five2n1n1n1n1n);
4067 fQCorrelationsEBE[0]->SetBinContent(20,five2n2n2n1n1n);
4068 fQCorrelationsEBE[0]->SetBinContent(21,five3n1n2n1n1n);
4069 fQCorrelationsEBE[0]->SetBinContent(22,five4n1n1n1n1n);
9c1a9547 4070
2aa4ebcd 4071 // final average non-weighted 5-particle correlations for all events:
4072 fQCorrelations[0][0]->Fill(18.5,five2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
4073 fQCorrelations[0][0]->Fill(19.5,five2n2n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
4074 fQCorrelations[0][0]->Fill(20.5,five3n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
4075 fQCorrelations[0][0]->Fill(21.5,five4n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
4076 } // end of if(dMult>4)
4077
4078 // 6-particle:
4079 Double_t six1n1n1n1n1n1n = 0.; // <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
4080 Double_t six2n2n1n1n1n1n = 0.; // <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>
4081 Double_t six3n1n1n1n1n1n = 0.; // <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>
4082 Double_t six2n1n1n2n1n1n = 0.; // <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>
4083
4084 if(dMult>5)
4085 {
4086 six1n1n1n1n1n1n = (pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),3.)+9.*dQ2nQ1nQ2nstarQ1nstar-6.*reQ2nQ1nQ1nstarQ1nstarQ1nstar)
4087 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))
4088 + 4.*(reQ3nQ1nstarQ1nstarQ1nstar-3.*reQ3nQ2nstarQ1nstar)
4089 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))
4090 + 2.*(9.*(dMult-4.)*reQ2nQ1nstarQ1nstar+2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.)))
4091 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))
4092 - 9.*(pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)+(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
4093 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-5.))
4094 + (18.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
4095 / (dMult*(dMult-1)*(dMult-3)*(dMult-4))
4096 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
4097
4098 six2n1n1n2n1n1n = (dQ2nQ1nQ1nQ2nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)
4099 * (2.*five2n2n2n1n1n+4.*five2n1n1n1n1n+4.*five3n1n2n1n1n+4.*four2n1n2n1n+1.*four1n1n1n1n)
4100 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four1n1n1n1n+4.*two1n1n
4101 + 2.*three2n1n1n+2.*three2n1n1n+4.*four3n1n1n1n+8.*three2n1n1n+2.*four4n2n1n1n
4102 + 4.*four2n1n2n1n+2.*two2n2n+8.*four2n1n2n1n+4.*four3n1n3n1n+8.*three3n2n1n
4103 + 4.*four3n1n2n2n+4.*four1n1n1n1n+4.*four2n1n2n1n+1.*four2n2n2n2n)
4104 - dMult*(dMult-1.)*(dMult-2.)*(2.*three2n1n1n+8.*two1n1n+4.*two1n1n+2.
4105 + 4.*two1n1n+4.*three2n1n1n+2.*two2n2n+4.*three2n1n1n+8.*three3n2n1n
4106 + 8.*two2n2n+4.*three4n3n1n+4.*two3n3n+4.*three3n2n1n+4.*two1n1n
4107 + 8.*three2n1n1n+4.*two1n1n+4.*three3n2n1n+4.*three2n1n1n+2.*two2n2n
4108 + 4.*three3n2n1n+2.*three4n2n2n)-dMult*(dMult-1.)
4109 * (4.*two1n1n+4.+4.*two1n1n+2.*two2n2n+1.+4.*two1n1n+4.*two2n2n+4.*two3n3n
4110 + 1.+2.*two2n2n+1.*two4n4n)-dMult)
4111 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)
4112
4113 six2n2n1n1n1n1n = (reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)
4114 * (five4n1n1n1n1n+8.*five2n1n1n1n1n+6.*five2n2n2n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)
4115 * (4.*four3n1n1n1n+6.*four4n2n1n1n+12.*three2n1n1n+12.*four1n1n1n1n+24.*four2n1n2n1n
4116 + 4.*four3n1n2n2n+3.*four2n2n2n2n)-dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+12.*three3n2n1n
4117 + 4.*three4n3n1n+3.*three4n2n2n+8.*three2n1n1n+24.*two1n1n+12.*two2n2n+12.*three2n1n1n+8.*three3n2n1n
4118 + 1.*three4n2n2n)-dMult*(dMult-1.)*(4.*two1n1n+6.*two2n2n+4.*two3n3n+1.*two4n4n+2.*two2n2n+8.*two1n1n+6.)-dMult)
4119 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)
4120
4121 six3n1n1n1n1n1n = (reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)
4122 * (five4n1n1n1n1n+4.*five2n1n1n1n1n+6.*five3n1n2n1n1n+4.*four3n1n1n1n)
4123 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four3n1n1n1n+6.*four4n2n1n1n+6.*four1n1n1n1n
4124 + 12.*three2n1n1n+12.*four2n1n2n1n+6.*four3n1n1n1n+12.*three3n2n1n+4.*four3n1n3n1n+3.*four3n1n2n2n)
4125 - dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+12.*three3n2n1n+4.*three4n3n1n+3.*three4n2n2n+4.*two1n1n
4126 + 12.*two1n1n+6.*three2n1n1n+12.*three2n1n1n+4.*three3n2n1n+12.*two2n2n+4.*three3n2n1n+4.*two3n3n+1.*three4n3n1n
4127 + 6.*three3n2n1n)-dMult*(dMult-1.)*(4.*two1n1n+6.*two2n2n+4.*two3n3n+1.*two4n4n+1.*two1n1n+4.+6.*two1n1n+4.*two2n2n
4128 + 1.*two3n3n)-dMult)/(dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)
4129
4130 // average non-weighted 6-particle correlations for single event:
4131 fQCorrelationsEBE[0]->SetBinContent(24,six1n1n1n1n1n1n);
4132 fQCorrelationsEBE[0]->SetBinContent(25,six2n1n1n2n1n1n);
4133 fQCorrelationsEBE[0]->SetBinContent(26,six2n2n1n1n1n1n);
4134 fQCorrelationsEBE[0]->SetBinContent(27,six3n1n1n1n1n1n);
9c1a9547 4135
2aa4ebcd 4136 // final average non-weighted 6-particle correlations for all events:
4137 fQCorrelations[0][0]->Fill(23.5,six1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
4138 fQCorrelations[0][0]->Fill(24.5,six2n1n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
4139 fQCorrelations[0][0]->Fill(25.5,six2n2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
4140 fQCorrelations[0][0]->Fill(26.5,six3n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
4141
4142 // distribution of <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
4143 //f6pDistribution->Fill(six1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
4144 } // end of if(dMult>5)
4145
4146 // 7-particle:
4147 Double_t seven2n1n1n1n1n1n1n = 0.; // <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
4148
4149 if(dMult>6)
4150 {
4151 seven2n1n1n1n1n1n1n = (reQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)
4152 * (2.*six3n1n1n1n1n1n+4.*six1n1n1n1n1n1n+1.*six2n2n1n1n1n1n+6.*six2n1n1n2n1n1n+8.*five2n1n1n1n1n)
4153 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(1.*five4n1n1n1n1n +8.*five2n1n1n1n1n+8.*four3n1n1n1n
4154 + 12.*five3n1n2n1n1n+4.*five2n1n1n1n1n+3.*five2n2n2n1n1n+6.*five2n2n2n1n1n+6.*four1n1n1n1n+24.*four1n1n1n1n
4155 + 12.*five2n1n1n1n1n+12.*five2n1n1n1n1n+12.*three2n1n1n+24.*four2n1n2n1n+4.*five3n1n2n1n1n+4.*five2n1n1n1n1n)
4156 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four3n1n1n1n+6.*four4n2n1n1n+12.*four1n1n1n1n+24.*three2n1n1n
4157 + 24.*four2n1n2n1n+12.*four3n1n1n1n+24.*three3n2n1n+8.*four3n1n3n1n+6.*four3n1n2n2n+6.*three2n1n1n+12.*four1n1n1n1n
4158 + 12.*four2n1n2n1n+6.*three2n1n1n+12.*four2n1n2n1n+4.*four3n1n2n2n+3.*four2n2n2n2n+4.*four1n1n1n1n+6.*three2n1n1n
4159 + 24.*two1n1n+24.*four1n1n1n1n+4.*four3n1n1n1n+24.*two1n1n+24.*three2n1n1n+12.*two2n2n+24.*three2n1n1n+12.*four2n1n2n1n
4160 + 8.*three3n2n1n+8.*four2n1n2n1n+1.*four4n2n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+1.*three2n1n1n+8.*two1n1n
4161 + 12.*three3n2n1n+24.*two1n1n+12.*three2n1n1n+4.*three2n1n1n+8.*two1n1n+4.*three4n3n1n+24.*three2n1n1n+8.*three3n2n1n
4162 + 12.*two1n1n+12.*two1n1n+3.*three4n2n2n+24.*two2n2n+6.*two2n2n+12.+12.*three3n2n1n+8.*two3n3n+12.*three2n1n1n+24.*two1n1n
4163 + 4.*three3n2n1n+8.*three3n2n1n+2.*three4n3n1n+12.*two1n1n+8.*three2n1n1n+4.*three2n1n1n+2.*three3n2n1n+6.*two2n2n+8.*two2n2n
4164 + 1.*three4n2n2n+4.*three3n2n1n+6.*three2n1n1n)-dMult*(dMult-1.)*(4.*two1n1n+2.*two1n1n+6.*two2n2n+8.+1.*two2n2n+4.*two3n3n
4165 + 12.*two1n1n+4.*two1n1n+1.*two4n4n+8.*two2n2n+6.+2.*two3n3n+4.*two1n1n+1.*two2n2n)-dMult)
4166 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)); // to be improved (direct formula needed)
9c1a9547 4167
2aa4ebcd 4168 // average non-weighted 7-particle correlations for single event:
4169 fQCorrelationsEBE[0]->SetBinContent(29,seven2n1n1n1n1n1n1n);
4170
4171 // final average non-weighted 7-particle correlations for all events:
4172 fQCorrelations[0][0]->Fill(28.5,seven2n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.));
4173 } // end of if(dMult>6)
52021ae2 4174
2aa4ebcd 4175 // 8-particle:
4176 Double_t eight1n1n1n1n1n1n1n1n = 0.; // <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
4177 if(dMult>7)
dee1e0e0 4178 {
2aa4ebcd 4179 eight1n1n1n1n1n1n1n1n = (pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),4.)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)
4180 * (12.*seven2n1n1n1n1n1n1n+16.*six1n1n1n1n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)
4181 * (8.*six3n1n1n1n1n1n+48.*six1n1n1n1n1n1n+6.*six2n2n1n1n1n1n+96.*five2n1n1n1n1n+72.*four1n1n1n1n+36.*six2n1n1n2n1n1n)
4182 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(2.*five4n1n1n1n1n+32.*five2n1n1n1n1n+36.*four1n1n1n1n
4183 + 32.*four3n1n1n1n+48.*five2n1n1n1n1n+48.*five3n1n2n1n1n+144.*five2n1n1n1n1n+288.*four1n1n1n1n+36.*five2n2n2n1n1n
4184 + 144.*three2n1n1n+96.*two1n1n+144.*four2n1n2n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)
4185 * (8.*four3n1n1n1n+48.*four1n1n1n1n+12.*four4n2n1n1n+96.*four2n1n2n1n+96.*three2n1n1n+72.*three2n1n1n+144.*two1n1n
4186 + 16.*four3n1n3n1n+48.*four3n1n1n1n+144.*four1n1n1n1n+72.*four1n1n1n1n+96.*three3n2n1n+24.*four3n1n2n2n+144.*four2n1n2n1n
4187 + 288.*two1n1n+288.*three2n1n1n+9.*four2n2n2n2n+72.*two2n2n+24.)-dMult*(dMult-1.)*(dMult-2.)*(12.*three2n1n1n+16.*two1n1n
4188 + 24.*three3n2n1n+48.*three2n1n1n+96.*two1n1n+8.*three4n3n1n+32.*three3n2n1n+96.*three2n1n1n+144.*two1n1n+6.*three4n2n2n
4189 + 96.*two2n2n+36.*two2n2n+72.+48.*three3n2n1n+16.*two3n3n+72.*three2n1n1n+144.*two1n1n)-dMult*(dMult-1.)*(8.*two1n1n
4190 + 12.*two2n2n+16.+8.*two3n3n+48.*two1n1n+1.*two4n4n+16.*two2n2n+18.)-dMult)
4191 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.)); // to be improved (direct formula needed)
4192
4193 // average non-weighted 8-particle correlations for single event:
4194 fQCorrelationsEBE[0]->SetBinContent(31,eight1n1n1n1n1n1n1n1n);
4195
4196 // final average non-weighted 8-particle correlations for all events:
4197 fQCorrelations[0][0]->Fill(30.5,eight1n1n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.));
9c1a9547 4198
2aa4ebcd 4199 // distribution of <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
4200 //f8pDistribution->Fill(eight1n1n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.));
4201 } // end of if(dMult>7)
4202
4203} // end of AliFlowAnalysisWithQCumulants::CalculateCorrelationsForIntegratedFlow()
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
9c1a9547 4245
4246
4247//================================================================================================================================
4248
4249
2aa4ebcd 4250void AliFlowAnalysisWithQCumulants::EvaluateNestedLoopsForIntegratedFlow(AliFlowEventSimple* anEvent)
9c1a9547 4251{
2aa4ebcd 4252 // 1.) Evaluate with nested loops the relevant correlations for integrated flow without and with using the particle weights.
4253 // Results are stored in profiles fDirectCorrelations and fDirectCorrelationsW, respectively.
bc92c0cb 4254
2aa4ebcd 4255 // 2.) Evaluate with nested loops corrections for non-uniform acceptance relevant for integrated flow,
4256 // without and with using the particle weights.
4257 // Without weights: cos terms are stored in profile fDirectCorrectionsCos, and sin terms in profile fDirectCorrectionsSin.
4258 // With weights: cos terms are stored in profile fDirectCorrectionsCosW, and sin terms in profile fDirectCorrectionsSinW.
77515452 4259
2aa4ebcd 4260 // 3.) Binning of fDirectCorrelations is organized as follows:
4261 //
4262 // 1st bin: <2>_{1n|1n} = two1n1n = cos(n*(phi1-phi2))>
4263 // 2nd bin: <2>_{2n|2n} = two2n2n = cos(2n*(phi1-phi2))>
4264 // 3rd bin: <2>_{3n|3n} = two3n3n = cos(3n*(phi1-phi2))>
4265 // 4th bin: <2>_{4n|4n} = two4n4n = cos(4n*(phi1-phi2))>
4266 // 5th bin: ---- EMPTY ----
4267 // 6th bin: <3>_{2n|1n,1n} = three2n1n1n = <cos(n*(2.*phi1-phi2-phi3))>
4268 // 7th bin: <3>_{3n|2n,1n} = three3n2n1n = <cos(n*(3.*phi1-2.*phi2-phi3))>
4269 // 8th bin: <3>_{4n|2n,2n} = three4n2n2n = <cos(n*(4.*phi1-2.*phi2-2.*phi3))>
4270 // 9th bin: <3>_{4n|3n,1n} = three4n3n1n = <cos(n*(4.*phi1-3.*phi2-phi3))>
4271 // 10th bin: ---- EMPTY ----
4272 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1n = <cos(n*(phi1+phi2-phi3-phi4))>
4273 // 12th bin: <4>_{2n,1n|2n,1n} = four2n1n2n1n = <cos(2.*n*(phi1+phi2-phi3-phi4))>
4274 // 13th bin: <4>_{2n,2n|2n,2n} = four2n2n2n2n = <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>
4275 // 14th bin: <4>_{3n|1n,1n,1n} = four3n1n1n1n = <cos(n*(3.*phi1-phi2-phi3-phi4))>
4276 // 15th bin: <4>_{3n,1n|3n,1n} = four3n1n3n1n = <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>
4277 // 16th bin: <4>_{3n,1n|2n,2n} = four3n1n2n2n = <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>
4278 // 17th bin: <4>_{4n|2n,1n,1n} = four4n2n1n1n = <cos(n*(3.*phi1+phi2-3.*phi3-phi4))>
4279 // 18th bin: ---- EMPTY ----
4280 // 19th bin: <5>_{2n|1n,1n,1n,1n} = five2n1n1n1n1n = <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>
4281 // 20th bin: <5>_{2n,2n|2n,1n,1n} = five2n2n2n1n1n = <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>
4282 // 21st bin: <5>_{3n,1n|2n,1n,1n} = five3n1n2n1n1n = <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>
4283 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = five4n1n1n1n1n = <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>
4284 // 23rd bin: ---- EMPTY ----
4285 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = six1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
4286 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = six2n1n1n2n1n1n = <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>
4287 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = six2n2n1n1n1n1n = <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>
4288 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = six3n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>
4289 // 28th bin: ---- EMPTY ----
4290 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = seven2n1n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
4291 // 30th bin: ---- EMPTY ----
4292 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = eight1n1n1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
9c1a9547 4293
2aa4ebcd 4294 // 4.) Binning of fDirectCorrelationsW is organized as follows:
4295 // ..............................................................................................
4296 // ---- bins 1-20: 2-particle correlations ----
4297 // 1st bin: two1n1nW1W1 = <w1 w2 cos(n*(phi1-phi2))>
4298 // 2nd bin: two2n2nW2W2 = <w1^2 w2^2 cos(2n*(phi1-phi2))>
4299 // 3rd bin: two3n3nW3W3 = <w1^3 w2^3 cos(3n*(phi1-phi2))>
4300 // 4th bin: two4n4nW4W4 = <w1^4 w2^4 cos(4n*(phi1-phi2))>
4301 // 5th bin: two1n1nW3W1 = <w1^3 w2 cos(n*(phi1-phi2))>
4302 // 6th bin: two1n1nW1W1W2 = <w1 w2 w3^2 cos(n*(phi1-phi2))>
4303 // ---- bins 21-40: 3-particle correlations ----
4304 // 21st bin: three2n1n1nW2W1W1 = <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
4305 // ---- bins 41-60: 4-particle correlations ----
4306 // 41st bin: four1n1n1n1nW1W1W1W1 = <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
4307 // ---- bins 61-80: 5-particle correlations ----
4308 // ---- bins 81-100: 6-particle correlations ----
4309 // ---- bins 101-120: 7-particle correlations ----
4310 // ---- bins 121-140: 8-particle correlations ----
4311 // ..............................................................................................
9c1a9547 4312
2aa4ebcd 4313 // 5.) Binning of fDirectCorrectionsCos is organized as follows:
4314 // ..............................................................................................
4315 // 1st bin: <<cos(n*(phi1))>> = cosP1n
4316 // 2nd bin: <<cos(n*(phi1+phi2))>> = cosP1nP1n
4317 // 3rd bin: <<cos(n*(phi1-phi2-phi3))>> = cosP1nM1nM1n
4318 // ...
4319 // ..............................................................................................
4320
4321 // 6.) Binning of fDirectCorrectionsSin is organized as follows:
4322 // ..............................................................................................
4323 // 1st bin: <<sin(n*(phi1))>> = sinP1n
4324 // 2nd bin: <<sin(n*(phi1+phi2))>> = sinP1nP1n
4325 // 3rd bin: <<sin(n*(phi1-phi2-phi3))>> = sinP1nM1nM1n
4326 // ...
4327 // ..............................................................................................
4328
4329 // 7.) Binning of fDirectCorrectionsCosW is organized as follows:
4330 // ..............................................................................................
4331 // ...
4332 // ..............................................................................................
9c1a9547 4333
2aa4ebcd 4334 // 8.) Binning of fDirectCorrectionsSinW is organized as follows:
4335 // ..............................................................................................
4336 // ...
4337 // ..............................................................................................
4057ba99 4338
2aa4ebcd 4339 Int_t nPrim = anEvent->NumberOfTracks();
4340 AliFlowTrackSimple *aftsTrack = NULL;
bc92c0cb 4341
2aa4ebcd 4342 Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
4343 Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1., wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
b7cb54d5 4344
2aa4ebcd 4345 Int_t n = fHarmonic;
77515452 4346
2aa4ebcd 4347 // 2-particle correlations and 1- and 2-particle correction terms:
4057ba99 4348 for(Int_t i1=0;i1<nPrim;i1++)
bc92c0cb 4349 {
2aa4ebcd 4350 aftsTrack=anEvent->GetTrack(i1);
4351 if(!(aftsTrack->InRPSelection())) continue;
4352 phi1=aftsTrack->Phi();
4353 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
4354
4355 // corrections for non-uniform acceptance:
4356 // non-weighted:
4357 fDirectCorrectionsCos->Fill(0.5,cos(n*phi1),1.); // <cos(n*phi1)>
4358 fDirectCorrectionsSin->Fill(0.5,sin(n*phi1),1.); // <sin(n*phi1)>
4359 // weighted:
4360 // fDirectCorrectionsCosW->Fill(0.5,???,1); // to be improved (continued)
4361 // fDirectCorrectionsSinW->Fill(0.5,???,1); // to be improved (continued)
2bdc5281 4362
4057ba99 4363 for(Int_t i2=0;i2<nPrim;i2++)
bc92c0cb 4364 {
4057ba99 4365 if(i2==i1)continue;
2aa4ebcd 4366 aftsTrack=anEvent->GetTrack(i2);
4367 if(!(aftsTrack->InRPSelection())) continue;
4368 phi2=aftsTrack->Phi();
4369 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
9c1a9547 4370
2aa4ebcd 4371 // non-weighted correlations:
4372 fDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),1.); // <cos(n*(phi1-phi2))>
4373 fDirectCorrelations->Fill(1.5,cos(2.*n*(phi1-phi2)),1.); // <cos(2n*(phi1-phi2))>
4374 fDirectCorrelations->Fill(2.5,cos(3.*n*(phi1-phi2)),1.); // <cos(3n*(phi1-phi2))>
4375 fDirectCorrelations->Fill(3.5,cos(4.*n*(phi1-phi2)),1.); // <cos(4n*(phi1-phi2))>
3d824203 4376
2aa4ebcd 4377 // weighted correlations:
4378 // ................................................................................................................
4379 if(fUsePhiWeights) fDirectCorrelationsW->Fill(0.5,cos(n*(phi1-phi2)),wPhi1*wPhi2); // <w1 w2 cos( n*(phi1-phi2))>
4380 if(fUsePhiWeights) fDirectCorrelationsW->Fill(1.5,cos(2.*n*(phi1-phi2)),pow(wPhi1,2)*pow(wPhi2,2)); // <w1^2 w2^2 cos(2n*(phi1-phi2))>
4381 if(fUsePhiWeights) fDirectCorrelationsW->Fill(2.5,cos(3.*n*(phi1-phi2)),pow(wPhi1,3)*pow(wPhi2,3)); // <w1^3 w2^3 cos(3n*(phi1-phi2))>
4382 if(fUsePhiWeights) fDirectCorrelationsW->Fill(3.5,cos(4.*n*(phi1-phi2)),pow(wPhi1,4)*pow(wPhi2,4)); // <w1^4 w2^4 cos(4n*(phi1-phi2))>
4383 if(fUsePhiWeights) fDirectCorrelationsW->Fill(4.5,cos(n*(phi1-phi2)),pow(wPhi1,3)*wPhi2); // <w1^3 w2 cos(n*(phi1-phi2))>
4384 // ...
4385 // ................................................................................................................
4386
4387 // non-weighted corrections for non-uniform acceptance (cos terms)
4388 // ................................................................................................................
4389 fDirectCorrectionsCos->Fill(1.5,cos(n*(phi1+phi2)),1.); // <<cos(n*(phi1+phi2))>>
4390 // ...
4391 // ................................................................................................................
4392
4393 // non-weighted corrections for non-uniform acceptance (sin terms)
4394 // ................................................................................................................
4395 fDirectCorrectionsSin->Fill(1.5,sin(n*(phi1+phi2)),1.); // <<sin(n*(phi1+phi2))>>
4396 // ...
4397 // ................................................................................................................
3d824203 4398
2aa4ebcd 4399 // weighted corrections for non-uniform acceptance (cos terms)
4400 // ................................................................................................................
4401 // fDirectCorrectionsCosW->Fill(1.5,???,1.); // to be improved (continued)
4402 // ...
4403 // ................................................................................................................
4404
4405 // non-weighted corrections for non-uniform acceptance (sin terms)
4406 // ................................................................................................................
4407 // fDirectCorrectionsSinW->Fill(1.5,???,1.); // to be improved (continued)
4408 // ...
4409 // ................................................................................................................
4410
4411 } // end of for(Int_t i2=0;i2<nPrim;i2++)
4412 } // end of for(Int_t i1=0;i1<nPrim;i1++)
3d824203 4413
2aa4ebcd 4414 // 3-particle correlations:
4057ba99 4415 for(Int_t i1=0;i1<nPrim;i1++)
bc92c0cb 4416 {
2aa4ebcd 4417 aftsTrack=anEvent->GetTrack(i1);
4418 if(!(aftsTrack->InRPSelection())) continue;
4419 phi1=aftsTrack->Phi();
4420 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
4057ba99 4421 for(Int_t i2=0;i2<nPrim;i2++)
bc92c0cb 4422 {
4057ba99 4423 if(i2==i1)continue;
2aa4ebcd 4424 aftsTrack=anEvent->GetTrack(i2);
4425 if(!(aftsTrack->InRPSelection())) continue;
4426 phi2=aftsTrack->Phi();
4427 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
4057ba99 4428 for(Int_t i3=0;i3<nPrim;i3++)
bc92c0cb 4429 {
4057ba99 4430 if(i3==i1||i3==i2)continue;
2aa4ebcd 4431 aftsTrack=anEvent->GetTrack(i3);
4432 if(!(aftsTrack->InRPSelection())) continue;
4433 phi3=aftsTrack->Phi();
4434 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
3d824203 4435
2aa4ebcd 4436 // non-weighted correlations:
4437 fDirectCorrelations->Fill(5.,cos(2.*n*phi1-n*(phi2+phi3)),1.); //<3>_{2n|nn,n}
4438 fDirectCorrelations->Fill(6.,cos(3.*n*phi1-2.*n*phi2-n*phi3),1.); //<3>_{3n|2n,n}
4439 fDirectCorrelations->Fill(7.,cos(4.*n*phi1-2.*n*phi2-2.*n*phi3),1.); //<3>_{4n|2n,2n}
4440 fDirectCorrelations->Fill(8.,cos(4.*n*phi1-3.*n*phi2-n*phi3),1.); //<3>_{4n|3n,n}
3d824203 4441
2aa4ebcd 4442 // weighted correlations:
4443 // ..............................................................................................................................
4444 // 2-p:
4445 if(fUsePhiWeights) fDirectCorrelationsW->Fill(5.,cos(n*(phi1-phi2)),wPhi1*wPhi2*pow(wPhi3,2)); // <w1 w2 w3^2 cos(n*(phi1-phi2))>
4446 // 3-p:
4447 if(fUsePhiWeights) fDirectCorrelationsW->Fill(20.,cos(2.*n*phi1-n*(phi2+phi3)),pow(wPhi1,2)*wPhi2*wPhi3); // <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
4448 // ...
4449 // ..............................................................................................................................
3d824203 4450
2aa4ebcd 4451 // non-weighted corrections for non-uniform acceptance (cos terms)
4452 // ................................................................................................................
4453 fDirectCorrectionsCos->Fill(2.,cos(n*(phi1-phi2-phi3)),1.); // <<cos(n*(phi1-phi2-phi3))>>
4454 // ...
4455 // ................................................................................................................
4456
4457 // non-weighted corrections for non-uniform acceptance (sin terms)
4458 // ................................................................................................................
4459 fDirectCorrectionsSin->Fill(2.,sin(n*(phi1-phi2-phi3)),1.); // <<sin(n*(phi1-phi2-phi3))>>
4460 // ...
4461 // ................................................................................................................
3d824203 4462
2aa4ebcd 4463 // weighted corrections for non-uniform acceptance (cos terms)
4464 // ................................................................................................................
4465 // ...
4466 // ................................................................................................................
4467
4468 // weighted corrections for non-uniform acceptance (sin terms)
4469 // ................................................................................................................
4470 // ...
4471 // ................................................................................................................
4472
4473 } // end of for(Int_t i3=0;i3<nPrim;i3++)
4474 } // end of for(Int_t i2=0;i2<nPrim;i2++)
4475 } // end of for(Int_t i1=0;i1<nPrim;i1++)
4476
4477 // 4-particle correlations:
4057ba99 4478 for(Int_t i1=0;i1<nPrim;i1++)
bc92c0cb 4479 {
2aa4ebcd 4480 aftsTrack=anEvent->GetTrack(i1);
4481 if(!(aftsTrack->InRPSelection())) continue;
4482 phi1=aftsTrack->Phi();
4483 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
4057ba99 4484 for(Int_t i2=0;i2<nPrim;i2++)
bc92c0cb 4485 {
4057ba99 4486 if(i2==i1)continue;
2aa4ebcd 4487 aftsTrack=anEvent->GetTrack(i2);
4488 if(!(aftsTrack->InRPSelection())) continue;
4489 phi2=aftsTrack->Phi();
4490 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
4057ba99 4491 for(Int_t i3=0;i3<nPrim;i3++)
2aa4ebcd 4492 {
4057ba99 4493 if(i3==i1||i3==i2)continue;
2aa4ebcd 4494 aftsTrack=anEvent->GetTrack(i3);
4495 if(!(aftsTrack->InRPSelection())) continue;
4496 phi3=aftsTrack->Phi();
4497 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
4057ba99 4498 for(Int_t i4=0;i4<nPrim;i4++)
bc92c0cb 4499 {
4057ba99 4500 if(i4==i1||i4==i2||i4==i3)continue;
2aa4ebcd 4501 aftsTrack=anEvent->GetTrack(i4);
4502 if(!(aftsTrack->InRPSelection())) continue;
4503 phi4=aftsTrack->Phi();
4504 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
3d824203 4505
9c1a9547 4506 // non-weighted:
2aa4ebcd 4507 fDirectCorrelations->Fill(10.,cos(n*phi1+n*phi2-n*phi3-n*phi4),1.); // <4>_{n,n|n,n}
4508 fDirectCorrelations->Fill(11.,cos(2.*n*phi1+n*phi2-2.*n*phi3-n*phi4),1.); // <4>_{2n,n|2n,n}
4509 fDirectCorrelations->Fill(12.,cos(2.*n*phi1+2*n*phi2-2.*n*phi3-2.*n*phi4),1.); // <4>_{2n,2n|2n,2n}
4510 fDirectCorrelations->Fill(13.,cos(3.*n*phi1-n*phi2-n*phi3-n*phi4),1.); // <4>_{3n|n,n,n}
4511 fDirectCorrelations->Fill(14.,cos(3.*n*phi1+n*phi2-3.*n*phi3-n*phi4),1.); // <4>_{3n,n|3n,n}
4512 fDirectCorrelations->Fill(15.,cos(3.*n*phi1+n*phi2-2.*n*phi3-2.*n*phi4),1.); // <4>_{3n,n|2n,2n}
4513 fDirectCorrelations->Fill(16.,cos(4.*n*phi1-2.*n*phi2-n*phi3-n*phi4),1.); // <4>_{4n|2n,n,n}
4514
9c1a9547 4515 // weighted:
2aa4ebcd 4516 //.......................................................................................
4517 // 4-p:
4518 if(fUsePhiWeights) fDirectCorrelationsW->Fill(40.,cos(n*phi1+n*phi2-n*phi3-n*phi4),wPhi1*wPhi2*wPhi3*wPhi4);
4519 // ...
4520 //.......................................................................................
4521
4522 }
4523 }
4524 }
4525 }
4526
4527 // 5-particle correlations:
4057ba99 4528 for(Int_t i1=0;i1<nPrim;i1++)
4529 {
2aa4ebcd 4530 //cout<<"i1 = "<<i1<<endl;
4531 aftsTrack=anEvent->GetTrack(i1);
4532 if(!(aftsTrack->InRPSelection())) continue;
4533 phi1=aftsTrack->Phi();
4534 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
4057ba99 4535 for(Int_t i2=0;i2<nPrim;i2++)
4536 {
4537 if(i2==i1)continue;
2aa4ebcd 4538 aftsTrack=anEvent->GetTrack(i2);
4539 if(!(aftsTrack->InRPSelection())) continue;
4540 phi2=aftsTrack->Phi();
4541 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
4057ba99 4542 for(Int_t i3=0;i3<nPrim;i3++)
2aa4ebcd 4543 {
4057ba99 4544 if(i3==i1||i3==i2)continue;
2aa4ebcd 4545 aftsTrack=anEvent->GetTrack(i3);
4546 if(!(aftsTrack->InRPSelection())) continue;
4547 phi3=aftsTrack->Phi();
4548 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
4057ba99 4549 for(Int_t i4=0;i4<nPrim;i4++)
4550 {
4551 if(i4==i1||i4==i2||i4==i3)continue;
2aa4ebcd 4552 aftsTrack=anEvent->GetTrack(i4);
4553 if(!(aftsTrack->InRPSelection())) continue;
4554 phi4=aftsTrack->Phi();
4555 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
4057ba99 4556 for(Int_t i5=0;i5<nPrim;i5++)
bc92c0cb 4557 {
4057ba99 4558 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
2aa4ebcd 4559 aftsTrack=anEvent->GetTrack(i5);
4560 if(!(aftsTrack->InRPSelection())) continue;
4561 phi5=aftsTrack->Phi();
4562 if(fUsePhiWeights && fPhiWeights) wPhi5 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi5*fnBinsPhi/TMath::TwoPi())));
4563
4564 // non-weighted:
4565 //------------------------------------------------------------------------------------------------------
4566 fDirectCorrelations->Fill(18.,cos(2.*n*phi1+n*phi2-n*phi3-n*phi4-n*phi5),1.); //<5>_{2n,n|n,n,n}
4567 fDirectCorrelations->Fill(19.,cos(2.*n*phi1+2.*n*phi2-2.*n*phi3-n*phi4-n*phi5),1.); //<5>_{2n,2n|2n,n,n}
4568 fDirectCorrelations->Fill(20.,cos(3.*n*phi1+n*phi2-2.*n*phi3-n*phi4-n*phi5),1.); //<5>_{3n,n|2n,n,n}
4569 fDirectCorrelations->Fill(21.,cos(4.*n*phi1-n*phi2-n*phi3-n*phi4-n*phi5),1.); //<5>_{4n|n,n,n,n}
4570 //------------------------------------------------------------------------------------------------------
4571
4572 // weighted:
4573 //..............................................................................................................
4574 // 5-p:
4575 if(fUsePhiWeights) fDirectCorrelationsW->Fill(60.,cos(2.*n*phi1+n*phi2-n*phi3-n*phi4-n*phi5),pow(wPhi1,2)*wPhi2*wPhi3*wPhi4*wPhi5);
4576 //..............................................................................................................
4577
4578 }
4579 }
4580 }
4581 }
4582 }
9c1a9547 4583
2aa4ebcd 4584 // 6-particle correlations:
4057ba99 4585 for(Int_t i1=0;i1<nPrim;i1++)
4586 {
2aa4ebcd 4587 //cout<<"i1 = "<<i1<<endl;
4588 aftsTrack=anEvent->GetTrack(i1);
4589 if(!(aftsTrack->InRPSelection())) continue;
4590 phi1=aftsTrack->Phi();
4591 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
4057ba99 4592 for(Int_t i2=0;i2<nPrim;i2++)
4593 {
4594 if(i2==i1)continue;
2aa4ebcd 4595 aftsTrack=anEvent->GetTrack(i2);
4596 if(!(aftsTrack->InRPSelection())) continue;
4597 phi2=aftsTrack->Phi();
4598 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
4057ba99 4599 for(Int_t i3=0;i3<nPrim;i3++)
2aa4ebcd 4600 {
4057ba99 4601 if(i3==i1||i3==i2)continue;
2aa4ebcd 4602 aftsTrack=anEvent->GetTrack(i3);
4603 if(!(aftsTrack->InRPSelection())) continue;
4604 phi3=aftsTrack->Phi();
4605 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
4057ba99 4606 for(Int_t i4=0;i4<nPrim;i4++)
4607 {
4608 if(i4==i1||i4==i2||i4==i3)continue;
2aa4ebcd 4609 aftsTrack=anEvent->GetTrack(i4);
4610 if(!(aftsTrack->InRPSelection())) continue;
4611 phi4=aftsTrack->Phi();
4612 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
4057ba99 4613 for(Int_t i5=0;i5<nPrim;i5++)
4614 {
4615 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
2aa4ebcd 4616 aftsTrack=anEvent->GetTrack(i5);
4617 if(!(aftsTrack->InRPSelection())) continue;
4618 phi5=aftsTrack->Phi();
4619 if(fUsePhiWeights && fPhiWeights) wPhi5 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi5*fnBinsPhi/TMath::TwoPi())));
4057ba99 4620 for(Int_t i6=0;i6<nPrim;i6++)
4621 {
4622 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
2aa4ebcd 4623 aftsTrack=anEvent->GetTrack(i6);
4624 if(!(aftsTrack->InRPSelection())) continue;
4625 phi6=aftsTrack->Phi();
4626 if(fUsePhiWeights && fPhiWeights) wPhi6 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi6*fnBinsPhi/TMath::TwoPi())));
4627
4628 // non-weighted:
4629 //-----------------------------------------------------------------------------------------------------------
4630 fDirectCorrelations->Fill(23.,cos(n*phi1+n*phi2+n*phi3-n*phi4-n*phi5-n*phi6),1.); //<6>_{n,n,n|n,n,n}
4631 fDirectCorrelations->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}
4632 fDirectCorrelations->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}
4633 fDirectCorrelations->Fill(26.,cos(3.*n*phi1+n*phi2-n*phi3-n*phi4-n*phi5-n*phi6),1.); //<6>_{3n,n|n,n,n,n}
4634 //-----------------------------------------------------------------------------------------------------------
9c1a9547 4635
2aa4ebcd 4636 // weighted:
4637 //.................................................................................................................
4638 // 6-p:
4639 if(fUsePhiWeights) fDirectCorrelationsW->Fill(80.,cos(n*phi1+n*phi2+n*phi3-n*phi4-n*phi5-n*phi6),wPhi1*wPhi2*wPhi3*wPhi4*wPhi5*wPhi6);
4640 //.................................................................................................................
4641
4642 }
4643 }
4644 }
4645 }
4646 }
4647 }
4057ba99 4648
2aa4ebcd 4649 // 7-particle correlations:
4057ba99 4650 for(Int_t i1=0;i1<nPrim;i1++)
4651 {
2aa4ebcd 4652 //cout<<"i1 = "<<i1<<endl;
4653 aftsTrack=anEvent->GetTrack(i1);
4654 if(!(aftsTrack->InRPSelection())) continue;
4655 phi1=aftsTrack->Phi();
4656 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
4057ba99 4657 for(Int_t i2=0;i2<nPrim;i2++)
4658 {
4659 if(i2==i1)continue;
2aa4ebcd 4660 aftsTrack=anEvent->GetTrack(i2);
4661 if(!(aftsTrack->InRPSelection())) continue;
4662 phi2=aftsTrack->Phi();
4663 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
4057ba99 4664 for(Int_t i3=0;i3<nPrim;i3++)
2aa4ebcd 4665 {
4057ba99 4666 if(i3==i1||i3==i2)continue;
2aa4ebcd 4667 aftsTrack=anEvent->GetTrack(i3);
4668 if(!(aftsTrack->InRPSelection())) continue;
4669 phi3=aftsTrack->Phi();
4670 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
4057ba99 4671 for(Int_t i4=0;i4<nPrim;i4++)
4672 {
4673 if(i4==i1||i4==i2||i4==i3)continue;
2aa4ebcd 4674 aftsTrack=anEvent->GetTrack(i4);
4675 if(!(aftsTrack->InRPSelection())) continue;
4676 phi4=aftsTrack->Phi();
4677 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
4057ba99 4678 for(Int_t i5=0;i5<nPrim;i5++)
4679 {
4680 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
2aa4ebcd 4681 aftsTrack=anEvent->GetTrack(i5);
4682 if(!(aftsTrack->InRPSelection())) continue;
4683 phi5=aftsTrack->Phi();
4684 if(fUsePhiWeights && fPhiWeights) wPhi5 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi5*fnBinsPhi/TMath::TwoPi())));
4057ba99 4685 for(Int_t i6=0;i6<nPrim;i6++)
4686 {
4687 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
2aa4ebcd 4688 aftsTrack=anEvent->GetTrack(i6);
4689 if(!(aftsTrack->InRPSelection())) continue;
4690 phi6=aftsTrack->Phi();
4691 if(fUsePhiWeights && fPhiWeights) wPhi6 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi6*fnBinsPhi/TMath::TwoPi())));
4057ba99 4692 for(Int_t i7=0;i7<nPrim;i7++)
4693 {
4694 if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;
2aa4ebcd 4695 aftsTrack=anEvent->GetTrack(i7);
4696 if(!(aftsTrack->InRPSelection())) continue;
4697 phi7=aftsTrack->Phi();
4698 if(fUsePhiWeights && fPhiWeights) wPhi7 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi7*fnBinsPhi/TMath::TwoPi())));
4699
4700 // non-weighted:
4701 //---------------------------------------------------------------------------------------------------------------
4702 fDirectCorrelations->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}
4703 //---------------------------------------------------------------------------------------------------------------
4704
4705 // weighted:
4706 //..........................................................................................................................................
4707 if(fUsePhiWeights) fDirectCorrelationsW->Fill(100.,cos(2.*n*phi1+n*phi2+n*phi3-n*phi4-n*phi5-n*phi6-n*phi7),
4708 pow(wPhi1,2.)*wPhi2*wPhi3*wPhi4*wPhi5*wPhi6*wPhi7);
4709 //..........................................................................................................................................
4710
4711 }
4712 }
4713 }
4714 }
4715 }
4716 }
4717 }
4057ba99 4718
2aa4ebcd 4719 cout<<endl;
4720
4721 // 8-particle correlations:
4057ba99 4722 for(Int_t i1=0;i1<nPrim;i1++)
4723 {
2aa4ebcd 4724 cout<<"i1 = "<<i1<<endl;
4725 aftsTrack=anEvent->GetTrack(i1);
4726 if(!(aftsTrack->InRPSelection())) continue;
4727 phi1=aftsTrack->Phi();
4728 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
4057ba99 4729 for(Int_t i2=0;i2<nPrim;i2++)
4730 {
4731 if(i2==i1)continue;
2aa4ebcd 4732 aftsTrack=anEvent->GetTrack(i2);
4733 if(!(aftsTrack->InRPSelection())) continue;
4734 phi2=aftsTrack->Phi();
4735 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
4057ba99 4736 for(Int_t i3=0;i3<nPrim;i3++)
2aa4ebcd 4737 {
4057ba99 4738 if(i3==i1||i3==i2)continue;
2aa4ebcd 4739 aftsTrack=anEvent->GetTrack(i3);
4740 if(!(aftsTrack->InRPSelection())) continue;
4741 phi3=aftsTrack->Phi();
4742 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
4057ba99 4743 for(Int_t i4=0;i4<nPrim;i4++)
4744 {
4745 if(i4==i1||i4==i2||i4==i3)continue;
2aa4ebcd 4746 aftsTrack=anEvent->GetTrack(i4);
4747 if(!(aftsTrack->InRPSelection())) continue;
4748 phi4=aftsTrack->Phi();
4749 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
4057ba99 4750 for(Int_t i5=0;i5<nPrim;i5++)
4751 {
4752 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
2aa4ebcd 4753 aftsTrack=anEvent->GetTrack(i5);
4754 if(!(aftsTrack->InRPSelection())) continue;
4755 phi5=aftsTrack->Phi();
4756 if(fUsePhiWeights && fPhiWeights) wPhi5 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi5*fnBinsPhi/TMath::TwoPi())));
4057ba99 4757 for(Int_t i6=0;i6<nPrim;i6++)
4758 {
4759 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
2aa4ebcd 4760 aftsTrack=anEvent->GetTrack(i6);
4761 if(!(aftsTrack->InRPSelection())) continue;
4762 phi6=aftsTrack->Phi();
4763 if(fUsePhiWeights && fPhiWeights) wPhi6 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi6*fnBinsPhi/TMath::TwoPi())));
4057ba99 4764 for(Int_t i7=0;i7<nPrim;i7++)
4765 {
4766 if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;
2aa4ebcd 4767 aftsTrack=anEvent->GetTrack(i7);
4768 if(!(aftsTrack->InRPSelection())) continue;
4769 phi7=aftsTrack->Phi();
4770 if(fUsePhiWeights && fPhiWeights) wPhi7 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi7*fnBinsPhi/TMath::TwoPi())));
4057ba99 4771 for(Int_t i8=0;i8<nPrim;i8++)
4772 {
4773 if(i8==i1||i8==i2||i8==i3||i8==i4||i8==i5||i8==i6||i8==i7)continue;
2aa4ebcd 4774 aftsTrack=anEvent->GetTrack(i8);
4775 if(!(aftsTrack->InRPSelection())) continue;
4776 phi8=aftsTrack->Phi();
4777 if(fUsePhiWeights && fPhiWeights) wPhi8 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi8*fnBinsPhi/TMath::TwoPi())));
4778
4779 // non-weighted:
4780 //--------------------------------------------------------------------------------------------------------------------
4781 fDirectCorrelations->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}
4782 //--------------------------------------------------------------------------------------------------------------------
4783
4784 // weighted:
4785 //...........................................................................................................................................
4786 if(fUsePhiWeights) fDirectCorrelationsW->Fill(120.,cos(n*phi1+n*phi2+n*phi3+n*phi4-n*phi5-n*phi6-n*phi7-n*phi8),
4787 wPhi1*wPhi2*wPhi3*wPhi4*wPhi5*wPhi6*wPhi7*wPhi8);
4788 //...........................................................................................................................................
4789
4790 }
4791 }
4792 }
4793 }
4794 }
4795 }
4796 }
4797 }
4798
4799} // end of AliFlowAnalysisWithQCumulants::EvaluateNestedLoopsForIntegratedFlow(AliFlowEventSimple* anEvent)
4800
4801
4802//================================================================================================================================
4803
4804
4805void AliFlowAnalysisWithQCumulants::CompareResultsFromNestedLoopsAndFromQVectorsForIntFlow(Bool_t useParticleWeights)
4806{
4807 // compare results needed for int. flow calculated with nested loops and with those calculated from Q-vectors
4808
4809 cout<<endl;
4810 cout<<endl;
4811 cout<<" *************************************"<<endl;
4812 cout<<" **** cross-checking the formulas ****"<<endl;
4813 cout<<" **** for integrated flow ****"<<endl;
4814 cout<<" *************************************"<<endl;
4815 cout<<endl;
4816 cout<<endl;
4817
4818 if(!(useParticleWeights))
4819 {
4820 cout<<" **** results for non-weighted correlations: ****"<<endl;
4821 cout<<endl;
4822 cout<<"<2>_{1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(1)<<endl;
4823 cout<<"<2>_{1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(1)<<endl;
4824 cout<<endl;
4825 cout<<"<2>_{2n,2n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(2)<<endl;
4826 cout<<"<2>_{2n,2n} from nested loops = "<<fDirectCorrelations->GetBinContent(2)<<endl;
4827 cout<<endl;
4828 cout<<"<2>_{3n,3n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(3)<<endl;
4829 cout<<"<2>_{3n,3n} from nested loops = "<<fDirectCorrelations->GetBinContent(3)<<endl;
4830 cout<<endl;
4831 cout<<"<2>_{4n,4n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(4)<<endl;
4832 cout<<"<2>_{4n,4n} from nested loops = "<<fDirectCorrelations->GetBinContent(4)<<endl;
4833 cout<<endl;
4834 cout<<"<3>_{2n|1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(6)<<endl;
4835 cout<<"<3>_{2n|1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(6)<<endl;
4836 cout<<endl;
4837 cout<<"<3>_{3n|2n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(7)<<endl;
4838 cout<<"<3>_{3n|2n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(7)<<endl;
4839 cout<<endl;
4840 cout<<"<3>_{4n,2n,2n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(8)<<endl;
4841 cout<<"<3>_{4n,2n,2n} from nested loops = "<<fDirectCorrelations->GetBinContent(8)<<endl;
4842 cout<<endl;
4843 cout<<"<3>_{4n,3n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(9)<<endl;
4844 cout<<"<3>_{4n,3n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(9)<<endl;
4845 cout<<endl;
4846 cout<<"<4>_{1n,1n|1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(11)<<endl;
4847 cout<<"<4>_{1n,1n|1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(11)<<endl;
4848 cout<<endl;
4849 cout<<"<4>_{2n,1n|2n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(12)<<endl;
4850 cout<<"<4>_{2n,1n|2n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(12)<<endl;
4851 cout<<endl;
4852 cout<<"<4>_{2n,2n|2n,2n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(13)<<endl;
4853 cout<<"<4>_{2n,2n|2n,2n} from nested loops = "<<fDirectCorrelations->GetBinContent(13)<<endl;
4854 cout<<endl;
4855 cout<<"<4>_{3n|1n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(14)<<endl;
4856 cout<<"<4>_{3n|1n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(14)<<endl;
4857 cout<<endl;
4858 cout<<"<4>_{3n,1n|3n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(15)<<endl;
4859 cout<<"<4>_{3n,1n|3n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(15)<<endl;
4860 cout<<endl;
4861 cout<<"<4>_{3n,1n|2n,2n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(16)<<endl;
4862 cout<<"<4>_{3n,1n|2n,2n} from nested loops = "<<fDirectCorrelations->GetBinContent(16)<<endl;
4863 cout<<endl;
4864 cout<<"<4>_{4n|2n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(17)<<endl;
4865 cout<<"<4>_{4n|2n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(17)<<endl;
4866 cout<<endl;
4867 cout<<"<5>_{2n,1n|1n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(19)<<endl;
4868 cout<<"<5>_{2n,1n|1n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(19)<<endl;
4869 cout<<endl;
4870 cout<<"<5>_{2n,2n|2n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(20)<<endl;
4871 cout<<"<5>_{2n,2n|2n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(20)<<endl;
4872 cout<<endl;
4873 cout<<"<5>_{3n,1n|2n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(21)<<endl;
4874 cout<<"<5>_{3n,1n|2n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(21)<<endl;
4875 cout<<endl;
4876 cout<<"<5>_{4n|1n,1n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(22)<<endl;
4877 cout<<"<5>_{4n|1n,1n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(22)<<endl;
4878 cout<<endl;
4879 cout<<"<6>_{1n,1n,1n|1n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(24)<<endl;
4880 cout<<"<6>_{1n,1n,1n|1n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(24)<<endl;
4881 cout<<endl;
4882 cout<<"<6>_{2n,1n,1n|2n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(25)<<endl;
4883 cout<<"<6>_{2n,1n,1n|2n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(25)<<endl;
4884 cout<<endl;
4885 cout<<"<6>_{2n,2n|1n,1n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(26)<<endl;
4886 cout<<"<6>_{2n,2n|1n,1n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(26)<<endl;
4887 cout<<endl;
4888 cout<<"<6>_{3n,1n|1n,1n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(27)<<endl;
4889 cout<<"<6>_{3n,1n|1n,1n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(27)<<endl;
4890 cout<<endl;
4891 cout<<"<7>_{2n,1n,1n|1n,1n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(29)<<endl;
4892 cout<<"<7>_{2n,1n,1n|1n,1n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(29)<<endl;
4893 cout<<endl;
4894 cout<<"<8>_{1n,1n,1n,1n|1n,1n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(31)<<endl;
4895 cout<<"<8>_{1n,1n,1n,1n|1n,1n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(31)<<endl;
4896 cout<<endl;
4897 cout<<endl;
4898 cout<<" **** results for non-weighted correction terms: ****"<<endl;
4899 cout<<endl;
4900 //.........................................................................................
4901 cout<<"<cos(n*phi1)> from Q-vectors = "<<fQCorrections[0][0][1]->GetBinContent(1)<<endl;
4902 cout<<"<cos(n*phi1)> from nested loops = "<<fDirectCorrectionsCos->GetBinContent(1)<<endl;
4903 cout<<endl;
4904 cout<<"<sin(n*phi1)> from Q-vectors = "<<fQCorrections[0][0][0]->GetBinContent(1)<<endl;
4905 cout<<"<sin(n*phi1)> from nested loops = "<<fDirectCorrectionsSin->GetBinContent(1)<<endl;
4906 cout<<endl;
4907 cout<<"<cos(n*(phi1+phi2))> from Q-vectors = "<<fQCorrections[0][0][1]->GetBinContent(2)<<endl;
4908 cout<<"<cos(n*(phi1+phi2))> from nested loops = "<<fDirectCorrectionsCos->GetBinContent(2)<<endl;
4909 cout<<endl;
4910 cout<<"<sin(n*(phi1+phi2))> from Q-vectors = "<<fQCorrections[0][0][0]->GetBinContent(2)<<endl;
4911 cout<<"<sin(n*(phi1+phi2))> from nested loops = "<<fDirectCorrectionsSin->GetBinContent(2)<<endl;
4912 cout<<endl;
4913 cout<<"<cos(n*(phi1-phi2-phi3))> from Q-vectors = "<<fQCorrections[0][0][1]->GetBinContent(3)<<endl;
4914 cout<<"<cos(n*(phi1-phi2-phi3))> from nested loops = "<<fDirectCorrectionsCos->GetBinContent(3)<<endl;
4915 cout<<endl;
4916 cout<<"<sin(n*(phi1-phi2-phi3))> from Q-vectors = "<<fQCorrections[0][0][0]->GetBinContent(3)<<endl;
4917 cout<<"<sin(n*(phi1-phi2-phi3))> from nested loops = "<<fDirectCorrectionsSin->GetBinContent(3)<<endl;
4918 cout<<endl;
4919 //.........................................................................................
4920 }
4921
4922 if(useParticleWeights)
4923 {
4924 cout<<" **** results for weighted correlations: ****"<<endl;
4925 cout<<endl;
4926 //.........................................................................................
4927 cout<<"<w1 w2 cos(n*(phi1-phi2))> from Q-vectors = "<<fQCorrelations[1][0]->GetBinContent(1)<<endl;
4928 cout<<"<<w1 w2 cos(n*(phi1-phi2))> from nested loops = "<<fDirectCorrelationsW->GetBinContent(1)<<endl;
4929 cout<<endl;
4930 cout<<"<w1^2 w2^2 cos(2n*(phi1-phi2))> from Q-vectors = "<<fQCorrelations[1][0]->GetBinContent(2)<<endl;
4931 cout<<"<w1^2 w2^2 cos(2n*(phi1-phi2))> from nested loops = "<<fDirectCorrelationsW->GetBinContent(2)<<endl;
4932 cout<<endl;
4933 cout<<"<w1^3 w2^3 cos(3n*(phi1-phi2))> from Q-vectors = "<<fQCorrelations[1][0]->GetBinContent(3)<<endl;
4934 cout<<"<w1^3 w2^3 cos(3n*(phi1-phi2))> from nested loops = "<<fDirectCorrelationsW->GetBinContent(3)<<endl;
4935 cout<<endl;
4936 cout<<"<w1^4 w2^4 cos(4n*(phi1-phi2))> from Q-vectors = "<<fQCorrelations[1][0]->GetBinContent(4)<<endl;
4937 cout<<"<w1^4 w2^4 cos(4n*(phi1-phi2))> from nested loops = "<<fDirectCorrelationsW->GetBinContent(4)<<endl;
4938 cout<<endl;
4939 /*
4940 cout<<"<w1^3 w2 cos(n*(phi1-phi2))> from Q-vectors = "<<fQCorrelationsW->GetBinContent(5)<<endl;
4941 cout<<"<w1^3 w2 cos(n*(phi1-phi2))> from nested loops = "<<fDirectCorrelationsW->GetBinContent(5)<<endl;
4942 cout<<endl;
4943 cout<<"<w1 w2 w3^2 cos(n*(phi1-phi2))> from Q-vectors = "<<fQCorrelationsW->GetBinContent(6)<<endl;
4944 cout<<"<w1 w2 w3^2 cos(n*(phi1-phi2))> from nested loops = "<<fDirectCorrelationsW->GetBinContent(6)<<endl;
4945 cout<<endl;
4946 cout<<"<w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))> from Q-vectors = "<<fQCorrelationsW->GetBinContent(21)<<endl;
4947 cout<<"<w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))> from nested loops = "<<fDirectCorrelationsW->GetBinContent(21)<<endl;
4948 cout<<endl;
4949 */
4950 cout<<"<w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> from Q-vectors = "<<fQCorrelations[1][0]->GetBinContent(11)<<endl;
4951 cout<<"<w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> from nested loops = "<<fDirectCorrelationsW->GetBinContent(41)<<endl;
4952 cout<<endl;
4953 //.........................................................................................
4954 //cout<<endl;
4955 //cout<<endl;
4956 //cout<<" **** results for weighted correction terms: ****"<<endl;
4957 //cout<<endl;
4958 //.........................................................................................
4959 }
4057ba99 4960
2aa4ebcd 4961} // end of AliFlowAnalysisWithQCumulants::CompareResultsFromNestedLoopsAndFromQVectorsForIntFlow(Bool_t useParticleWeights)
4962
4963
4964//================================================================================================================================
4965
4966
4967void AliFlowAnalysisWithQCumulants::CalculateQProductsForIntFlow()
4968{
4969 // calculate averages like <<2><4>>, <<2><6>>, <<4><6>>, etc. which are needed to calculate covariances
4970
4971 // binning of fQProducts is organized as follows:
4972 //
4973 // 1st bin: <2><4>
4974 // 2nd bin: <2><6>
4975 // 3rd bin: <2><8>
4976 // 4th bin: <4><6>
4977 // 5th bin: <4><8>
4978 // 6th bin: <6><8>
4979
4980 Double_t dMult = (*fSMpk)(0,0); // multiplicity (number of particles used to determine the reaction plane)
4981
4982 Double_t twoEBE = 0.; // <2>
4983 Double_t fourEBE = 0.; // <4>
4984 Double_t sixEBE = 0.; // <6>
4985 Double_t eightEBE = 0.; // <8>
4986
4987 twoEBE = fQCorrelationsEBE[0]->GetBinContent(1);
4988 fourEBE = fQCorrelationsEBE[0]->GetBinContent(11);
4989 if(dMult>5)
4990 {
4991 sixEBE = fQCorrelationsEBE[0]->GetBinContent(24);
4992 if(dMult>7)
4993 {
4994 eightEBE = fQCorrelationsEBE[0]->GetBinContent(31);
4995 }
4996 }
4057ba99 4997
2aa4ebcd 4998 // <2><4>
4999 if(dMult>3)
5000 {
5001 fQProducts[0][0]->Fill(0.5,twoEBE*fourEBE,dMult*(dMult-1)*dMult*(dMult-1)*(dMult-2)*(dMult-3));
5002 }
4057ba99 5003
2aa4ebcd 5004 // <2><6>
5005 if(dMult>5)
5006 {
5007 fQProducts[0][0]->Fill(1.5,twoEBE*sixEBE,dMult*(dMult-1)*dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5));
5008 }
5009
5010 // <2><8>
5011 if(dMult>7)
5012 {
5013 fQProducts[0][0]->Fill(2.5,twoEBE*eightEBE,dMult*(dMult-1)*dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7));
5014 }
9c1a9547 5015
2aa4ebcd 5016 // <4><6>
5017 if(dMult>5)
5018 {
5019 fQProducts[0][0]->Fill(3.5,fourEBE*sixEBE,dMult*(dMult-1)*(dMult-2)*(dMult-3)*dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5));
5020 }
9c1a9547 5021
2aa4ebcd 5022 // <4><8>
5023 if(dMult>7)
5024 {
5025 fQProducts[0][0]->Fill(4.5,fourEBE*eightEBE,dMult*(dMult-1)*(dMult-2)*(dMult-3)*
5026 dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7));
5027 }
9c1a9547 5028
2aa4ebcd 5029 // <6><8>
5030 if(dMult>7)
5031 {
5032 fQProducts[0][0]->Fill(5.5,sixEBE*eightEBE,dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*
5033 dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7));
5034 }
3d824203 5035
2aa4ebcd 5036} // end of AliFlowAnalysisWithQCumulants::CalculateQProductsForIntFlow()
9c1a9547 5037
5038
5039//================================================================================================================================
5040
5041
2aa4ebcd 5042void AliFlowAnalysisWithQCumulants::CalculateCovariancesForIntFlow(Bool_t useParticleWeights, TString eventWeights)
fd46c3dd 5043{
2aa4ebcd 5044 // calculate covariances Cov(2,4), Cov(2,6), etc (needed to propagate errors for integrated flow)
5045
5046 // binning of fCovariances[pW] is organized as follows:
5047 //
5048 // 1st bin: <<2><4>>-<<2>><<4>>
5049 // 2nd bin: <<2><6>>-<<2>><<6>>
5050 // 3rd bin: <<2><8>>-<<2>><<8>>
5051 // 4th bin: <<4><6>>-<<4>><<6>>
5052 // 5th bin: <<4><8>>-<<4>><<8>>
5053 // 6th bin: <<6><8>>-<<6>><<8>>
5054
5055 // shortcuts for flags:
5056 Int_t pW = (Int_t)(useParticleWeights);
5057 Int_t eW = -1;
5058
5059 if(eventWeights == "exact")
5060 {
5061 eW = 0;
5062 }
fd46c3dd 5063
c2a42ea2 5064 for(Int_t power=0;power<2;power++)
5065 {
5066 if(!(fQCorrelations[pW][eW] && fQProducts[pW][eW] && fCovariances[pW][eW] && fSumOfEventWeights[pW][eW][power] && fProductOfEventWeights[pW][eW]))
5067 {
5068 cout<<"WARNING: fQCorrelations[pW][eW] && fQProducts[pW][eW] && fCovariances[pW][eW] && fSumOfEventWeights[pW][eW][power] && fProductOfEventWeights[pW][eW] is NULL in AFAWQC::CCFIF() !!!!"<<endl;
5069 cout<<"pW = "<<pW<<endl;
5070 cout<<"eW = "<<eW<<endl;
5071 cout<<"power = "<<power<<endl;
5072 exit(0);
5073 }
5074 }
fd46c3dd 5075
2aa4ebcd 5076 // average 2-, 4-, 6- and 8-particle azimuthal correlations for all events:
c2a42ea2 5077 Double_t two = fCorrelations[pW][eW]->GetBinContent(1); // <<2>>
5078 Double_t four = fCorrelations[pW][eW]->GetBinContent(11); // <<4>>
5079 Double_t six = fCorrelations[pW][eW]->GetBinContent(24); // <<6>>
5080 Double_t eight = fCorrelations[pW][eW]->GetBinContent(31); // <<8>>
2aa4ebcd 5081 // average products of 2-, 4-, 6- and 8-particle azimuthal correlations:
5082 Double_t product24 = fQProducts[pW][eW]->GetBinContent(1); // <<2><4>>
5083 Double_t product26 = fQProducts[pW][eW]->GetBinContent(2); // <<2><6>>
5084 Double_t product28 = fQProducts[pW][eW]->GetBinContent(3); // <<2><8>>
5085 Double_t product46 = fQProducts[pW][eW]->GetBinContent(4); // <<4><6>>
5086 Double_t product48 = fQProducts[pW][eW]->GetBinContent(5); // <<4><8>>
5087 Double_t product68 = fQProducts[pW][eW]->GetBinContent(6); // <<6><8>>
c2a42ea2 5088 // denominator in the expression for the unbiased estimator for covariance:
5089 Double_t denom24 = 0.;
5090 if(fSumOfEventWeights[pW][eW][0]->GetBinContent(1) && fSumOfEventWeights[pW][eW][0]->GetBinContent(2))
5091 {
5092 denom24 = 1-(fProductOfEventWeights[pW][eW]->GetBinContent(1))/
5093 (fSumOfEventWeights[pW][eW][0]->GetBinContent(1) * fSumOfEventWeights[pW][eW][0]->GetBinContent(2));
5094 }
5095 Double_t denom26 = 0.;
5096 if(fSumOfEventWeights[pW][eW][0]->GetBinContent(1) && fSumOfEventWeights[pW][eW][0]->GetBinContent(3))
5097 {
5098 denom26 = 1-(fProductOfEventWeights[pW][eW]->GetBinContent(2))/
5099 (fSumOfEventWeights[pW][eW][0]->GetBinContent(1) * fSumOfEventWeights[pW][eW][0]->GetBinContent(3));
5100 }
5101 Double_t denom28 = 0.;
5102 if(fSumOfEventWeights[pW][eW][0]->GetBinContent(1) && fSumOfEventWeights[pW][eW][0]->GetBinContent(4))
5103 {
5104 denom28 = 1-(fProductOfEventWeights[pW][eW]->GetBinContent(3))/
5105 (fSumOfEventWeights[pW][eW][0]->GetBinContent(1) * fSumOfEventWeights[pW][eW][0]->GetBinContent(4));
5106 }
5107 Double_t denom46 = 0.;
5108 if(fSumOfEventWeights[pW][eW][0]->GetBinContent(2) && fSumOfEventWeights[pW][eW][0]->GetBinContent(3))
5109 {
5110 denom46 = 1-(fProductOfEventWeights[pW][eW]->GetBinContent(4))/
5111 (fSumOfEventWeights[pW][eW][0]->GetBinContent(2) * fSumOfEventWeights[pW][eW][0]->GetBinContent(3));
5112 }
5113 Double_t denom48 = 0.;
5114 if(fSumOfEventWeights[pW][eW][0]->GetBinContent(2) && fSumOfEventWeights[pW][eW][0]->GetBinContent(4))
5115 {
5116 denom48 = 1-(fProductOfEventWeights[pW][eW]->GetBinContent(5))/
5117 (fSumOfEventWeights[pW][eW][0]->GetBinContent(2) * fSumOfEventWeights[pW][eW][0]->GetBinContent(4));
5118 }
5119 Double_t denom68 = 0.;
5120 if(fSumOfEventWeights[pW][eW][0]->GetBinContent(3) && fSumOfEventWeights[pW][eW][0]->GetBinContent(4))
5121 {
5122 denom68 = 1-(fProductOfEventWeights[pW][eW]->GetBinContent(6))/
5123 (fSumOfEventWeights[pW][eW][0]->GetBinContent(3) * fSumOfEventWeights[pW][eW][0]->GetBinContent(4));
5124 }
5125
5126 // final covariances:
5127 Double_t cov24 = 0.;
5128 if(denom24)
5129 {
5130 cov24 = (product24-two*four)/denom24; // Cov(<2>,<4>)
5131 fCovariances[pW][eW]->SetBinContent(1,cov24);
5132 }
5133 Double_t cov26 = 0.;
5134 if(denom26)
5135 {
5136 cov26 = (product26-two*six)/denom26; // Cov(<2>,<6>)
5137 fCovariances[pW][eW]->SetBinContent(2,cov26);
5138 }
5139 Double_t cov28 = 0.;
5140 if(denom28)
5141 {
5142 cov28 = (product28-two*eight)/denom28; // Cov(<2>,<8>)
5143 fCovariances[pW][eW]->SetBinContent(3,cov28);
5144 }
5145 Double_t cov46 = 0.;
5146 if(denom46)
5147 {
5148 cov46 = (product46-four*six)/denom46; // Cov(<4>,<6>)
5149 fCovariances[pW][eW]->SetBinContent(4,cov46);
5150 }
5151 Double_t cov48 = 0.;
5152 if(denom48)
5153 {
5154 cov48 = (product48-four*eight)/denom48; // Cov(<4>,<8>)
5155 fCovariances[pW][eW]->SetBinContent(5,cov48);
5156 }
5157 Double_t cov68 = 0.;
5158 if(denom68)
5159 {
5160 cov68 = (product68-six*eight)/denom68; // Cov(<6>,<8>)
5161 fCovariances[pW][eW]->SetBinContent(6,cov68);
5162 }
2aa4ebcd 5163
5164} // end of AliFlowAnalysisWithQCumulants::CalculateCovariancesForIntFlow(Bool_t useParticleWeights, TString eventWeights)
fd46c3dd 5165
5166
5167//================================================================================================================================
5168
5169
2aa4ebcd 5170void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsForIntFlow(Bool_t useParticleWeights, TString eventWeights) // to be improved (there is better way to implement this method)
9c1a9547 5171{
2aa4ebcd 5172 // From fQCorrelations[pW][eW] access measured correlations and spread, calculate statistical errors and store the
5173 // final results and statistical errors for correlations in fCorrelations[pW][eW] (binning is the same as in fQCorrelations[pW][eW]).
3d824203 5174
2aa4ebcd 5175 // shortcuts for flags:
5176 Int_t pW = (Int_t)(useParticleWeights);
3d824203 5177
2aa4ebcd 5178 Int_t eW = -1;
5179
5180 if(eventWeights == "exact")
9c1a9547 5181 {
2aa4ebcd 5182 eW = 0;
5183 }
5184
c2a42ea2 5185 for(Int_t power=0;power<2;power++)
9c1a9547 5186 {
c2a42ea2 5187 if(!(fQCorrelations[pW][eW] && fCorrelations[pW][eW] && fSumOfEventWeights[pW][eW][power]))
5188 {
5189 cout<<"WARNING: fQCorrelations[pW][eW] && fCorrelations[pW][eW] && fSumOfEventWeights[pW][eW][power] is NULL in AFAWQC::FCFIF() !!!!"<<endl;
5190 cout<<"pW = "<<pW<<endl;
5191 cout<<"eW = "<<eW<<endl;
5192 cout<<"power = "<<power<<endl;
5193 exit(0);
5194 }
2aa4ebcd 5195 }
3d824203 5196
c2a42ea2 5197 // <<2>>:
5198 Double_t correlation2p = fQCorrelations[pW][eW]->GetBinContent(1);
5199 Double_t spread2p = fQCorrelations[pW][eW]->GetBinError(1);
5200 Double_t sumOfEventWeightsLinear2p = fSumOfEventWeights[pW][eW][0]->GetBinContent(1);
5201 Double_t sumOfEventWeightsQuadratic2p = fSumOfEventWeights[pW][eW][1]->GetBinContent(1);
5202 // stat.error = termA * spread * termB:
5203 // termB = 1/sqrt(1-termA^2)
5204 Double_t termA2p = 0.;
5205 Double_t termB2p = 0.;
5206 Double_t statError2p = 0.;
5207 if(sumOfEventWeightsLinear2p)
5208 {
5209 termA2p = pow(sumOfEventWeightsQuadratic2p,0.5)/sumOfEventWeightsLinear2p;
5210 } else
5211 {
5212 cout<<"WARNING: sumOfEventWeightsLinear2p == 0 in in AFAWQC::FCFIF() !!!!"<<endl;
5213 }
5214
5215 if(1-pow(termA2p,2.) > 0)
2bdc5281 5216 {
c2a42ea2 5217 termB2p = 1./pow(1-pow(termA2p,2.),0.5);
5218 } else
5219 {
5220 cout<<"WARNING: 1-pow(termA2p,2.) <= 0 in in AFAWQC::FCFIF() !!!!"<<endl;
5221 }
9c1a9547 5222
c2a42ea2 5223 statError2p = termA2p*spread2p*termB2p;
5224 fCorrelations[pW][eW]->SetBinContent(1,correlation2p);
5225 fCorrelations[pW][eW]->SetBinError(1,statError2p);
5226
5227 // <<4>>:
5228 Double_t correlation4p = fQCorrelations[pW][eW]->GetBinContent(11);
5229 Double_t spread4p = fQCorrelations[pW][eW]->GetBinError(11);
5230 Double_t sumOfEventWeightsLinear4p = fSumOfEventWeights[pW][eW][0]->GetBinContent(2);
5231 Double_t sumOfEventWeightsQuadratic4p = fSumOfEventWeights[pW][eW][1]->GetBinContent(2);
5232 Double_t termA4p = 0.;
5233 Double_t termB4p = 0.;
5234 Double_t statError4p = 0.;
5235 if(sumOfEventWeightsLinear4p)
5236 {
5237 termA4p = pow(sumOfEventWeightsQuadratic4p,0.5)/sumOfEventWeightsLinear4p;
5238 } else
5239 {
5240 cout<<"WARNING: sumOfEventWeightsLinear4p == 0 in in AFAWQC::FCFIF() !!!!"<<endl;
5241 }
5242 if(1-pow(termA4p,2.) > 0)
5243 {
5244 termB4p = 1./pow(1-pow(termA4p,2.),0.5);
5245 } else
5246 {
5247 cout<<"WARNING: 1-pow(termA4p,2.) <= 0 in in AFAWQC::FCFIF() !!!!"<<endl;
5248 }
5249
5250 statError4p = termA4p*spread4p*termB4p;
5251 fCorrelations[pW][eW]->SetBinContent(11,correlation4p);
5252 fCorrelations[pW][eW]->SetBinError(11,statError4p);
5253
5254 // <<6>>:
5255 Double_t correlation6p = fQCorrelations[pW][eW]->GetBinContent(24);
5256 Double_t spread6p = fQCorrelations[pW][eW]->GetBinError(24);
5257 Double_t sumOfEventWeightsLinear6p = fSumOfEventWeights[pW][eW][0]->GetBinContent(3);
5258 Double_t sumOfEventWeightsQuadratic6p = fSumOfEventWeights[pW][eW][1]->GetBinContent(3);
5259 Double_t termA6p = 0.;
5260 Double_t termB6p = 0.;
5261 Double_t statError6p = 0.;
5262 if(sumOfEventWeightsLinear6p)
5263 {
5264 termA6p = pow(sumOfEventWeightsQuadratic6p,0.5)/sumOfEventWeightsLinear6p;
5265 } else
5266 {
5267 cout<<"WARNING: sumOfEventWeightsLinear6p == 0 in in AFAWQC::FCFIF() !!!!"<<endl;
5268 }
5269 if(1-pow(termA6p,2.) > 0)
5270 {
5271 termB6p = 1./pow(1-pow(termA6p,2.),0.5);
5272 } else
5273 {
5274 cout<<"WARNING: 1-pow(termA6p,2.) <= 0 in in AFAWQC::FCFIF() !!!!"<<endl;
5275 }
5276
5277 statError6p = termA6p*spread6p*termB6p;
5278 fCorrelations[pW][eW]->SetBinContent(24,correlation6p);
5279 fCorrelations[pW][eW]->SetBinError(24,statError6p);
5280
5281 // <<8>>
5282 Double_t correlation8p = fQCorrelations[pW][eW]->GetBinContent(31);
5283 // ...
5284 fCorrelations[pW][eW]->SetBinContent(31,correlation8p);
5285 // ...
5286
2aa4ebcd 5287} // end of AliFlowAnalysisWithQCumulants::FinalizeCorrelationsForIntFlow(Bool_t useParticleWeights, TString eventWeights)
9c1a9547 5288
9c1a9547 5289
2aa4ebcd 5290//================================================================================================================================
5291
5292
5293void AliFlowAnalysisWithQCumulants::FillAverageMultiplicities(Int_t nRP)
5294{
5295 // Fill profile fAverageMultiplicity to hold average multiplicities and number of events for events with nRP>=0, nRP>=1, ... , and nRP>=8
5296
5297 // Binning of fAverageMultiplicity is organized as follows:
5298 // 1st bin: all events (including the empty ones)
5299 // 2nd bin: event with # of RPs greater or equal to 1
5300 // 3rd bin: event with # of RPs greater or equal to 2
5301 // 4th bin: event with # of RPs greater or equal to 3
5302 // 5th bin: event with # of RPs greater or equal to 4
5303 // 6th bin: event with # of RPs greater or equal to 5
5304 // 7th bin: event with # of RPs greater or equal to 6
5305 // 8th bin: event with # of RPs greater or equal to 7
5306 // 9th bin: event with # of RPs greater or equal to 8
5307
5308 if(!fAvMultiplicity)
5309 {
5310 cout<<"WARNING: fAvMultiplicity is NULL in AFAWQC::FAM() !!!!"<<endl;
5311 exit(0);
5312 }
9c1a9547 5313
2aa4ebcd 5314 if(nRP<0)
5315 {
5316 cout<<"WARNING: nRP<0 in in AFAWQC::FAM() !!!!"<<endl;
5317 exit(0);
5318 }
9c1a9547 5319
2aa4ebcd 5320 for(Int_t i=0;i<9;i++)
5321 {
5322 if(nRP>=i) fAvMultiplicity->Fill(i+0.5,nRP,1);
5323 }
9c1a9547 5324
2aa4ebcd 5325} // end of AliFlowAnalysisWithQCumulants::FillAverageMultiplicities(nRP)
9c1a9547 5326
5327
5328//================================================================================================================================
5329
5330
2aa4ebcd 5331void AliFlowAnalysisWithQCumulants::CalculateCumulantsForIntFlow(Bool_t useParticleWeights, TString eventWeights)
9c1a9547 5332{
2aa4ebcd 5333 // calculate cumulants from measured correlations and store results in fCumulants[pW][eW][0].
5334 // (Remark: these cumulants are biased by non-uniform acceptance, corrected cumulants are stored in fCumulants[pW][eW][1].)
9c1a9547 5335
2aa4ebcd 5336 // Binning of fCumulants[pW][nua] is organized as follows:
5337 // 1st bin: QC{2}
5338 // 2nd bin: QC{4}
5339 // 3rd bin: QC{6}
5340 // 4th bin: QC{8}
9c1a9547 5341
2aa4ebcd 5342 // shortcuts for the flags:
5343 Int_t pW = (Int_t)(useParticleWeights); // (0=weights not used, 1=weights used)
9c1a9547 5344
2aa4ebcd 5345 Int_t eW = -1;
9c1a9547 5346
2aa4ebcd 5347 if(eventWeights == "exact")
9c1a9547 5348 {
2aa4ebcd 5349 eW = 0;
9c1a9547 5350 }
5351
c2a42ea2 5352 if(!(fCorrelations[pW][eW] && fCovariances[pW][eW] && fCumulants[pW][eW][0] && fAvMultiplicity))
2aa4ebcd 5353 {
c2a42ea2 5354 cout<<"WARNING: fCorrelations[pW][eW] && fCovariances[pW][eW] && fCumulants[pW][eW][0] && fAvMultiplicity is NULL in AFAWQC::CCFIF() !!!!"<<endl;
2aa4ebcd 5355 cout<<"pW = "<<pW<<endl;
5356 cout<<"eW = "<<eW<<endl;
5357 exit(0);
5358 }
9c1a9547 5359
2aa4ebcd 5360 // correlations:
c2a42ea2 5361 Double_t two = fCorrelations[pW][eW]->GetBinContent(1); // <<2>>
5362 Double_t four = fCorrelations[pW][eW]->GetBinContent(11); // <<4>>
5363 Double_t six = fCorrelations[pW][eW]->GetBinContent(24); // <<6>>
5364 Double_t eight = fCorrelations[pW][eW]->GetBinContent(31); // <<8>>
5365 // stat. error of correlations:
5366 Double_t twoError = fCorrelations[pW][eW]->GetBinError(1); // stat. error of <<2>>
5367 Double_t fourError = fCorrelations[pW][eW]->GetBinError(11); // stat. error of <<4>>
5368 Double_t sixError = fCorrelations[pW][eW]->GetBinError(24); // stat. error of <<6>>
5369 //Double_t eightError = fQCorrelations[pW]->GetBinError(31); // stat. error of <<8>>
2aa4ebcd 5370 // spread of correlations:
c2a42ea2 5371 Double_t twoSpread = 0.; // spread of <<2>>
5372 Double_t fourSpread = 0.; // spread of <<6>>
5373 Double_t sixSpread = 0.; // spread of <<8>>
5374 //Double_t eightSpread = 0.;
5375 // stat. error = prefactor * spread:
5376 Double_t twoPrefactor = 0;
5377 if(fSumOfEventWeights[pW][eW][0]->GetBinContent(1))
5378 {
5379 twoPrefactor = pow(fSumOfEventWeights[pW][eW][1]->GetBinContent(1),0.5)/fSumOfEventWeights[pW][eW][0]->GetBinContent(1);
5380 if(twoPrefactor) twoSpread = twoError/twoPrefactor;
5381 }
5382 Double_t fourPrefactor = 0;
5383 if(fSumOfEventWeights[pW][eW][0]->GetBinContent(2))
5384 {
5385 fourPrefactor = pow(fSumOfEventWeights[pW][eW][1]->GetBinContent(2),0.5)/fSumOfEventWeights[pW][eW][0]->GetBinContent(2);
5386 if(fourPrefactor) fourSpread = fourError/fourPrefactor;
5387 }
5388 Double_t sixPrefactor = 0;
5389 if(fSumOfEventWeights[pW][eW][0]->GetBinContent(3))
5390 {
5391 sixPrefactor = pow(fSumOfEventWeights[pW][eW][1]->GetBinContent(3),0.5)/fSumOfEventWeights[pW][eW][0]->GetBinContent(3);
5392 if(sixPrefactor) sixSpread = sixError/sixPrefactor;
5393 }
5394 // ... 8th
2aa4ebcd 5395 // covariances:
c2a42ea2 5396 Double_t cov24 = fCovariances[pW][eW]->GetBinContent(1); // Cov(<2>,<4>)
5397 Double_t cov26 = fCovariances[pW][eW]->GetBinContent(2); // Cov(<2>,<6>)
5398 //Double_t cov28 = fCovariances[pW]->GetBinContent(3); // Cov(<2>,<8>)
5399 Double_t cov46 = fCovariances[pW][eW]->GetBinContent(4); // Cov(<4>,<6>)
5400 //Double_t cov48 = fCovariances[pW]->GetBinContent(5); // Cov(<4>,<8>)
5401 //Double_t cov68 = fCovariances[pW]->GetBinContent(6); // Cov(<6>,<8>)
2aa4ebcd 5402 // cumulants:
5403 Double_t qc2 = 0.; // QC{2}
5404 Double_t qc4 = 0.; // QC{4}
5405 Double_t qc6 = 0.; // QC{6}
5406 Double_t qc8 = 0.; // QC{8}
5407
5408 if(two) qc2 = two;
5409 if(four) qc4 = four-2.*pow(two,2.);
5410 if(six) qc6 = six-9.*two*four+12.*pow(two,3.);
5411 if(eight) qc8 = eight-16.*two*six-18.*pow(four,2.)+144.*pow(two,2.)*four-144.*pow(two,4.);
5412
c2a42ea2 5413 // stat. error of cumulants:
5414 Double_t qc2Error = 0; // stat. error of QC{2}
5415 Double_t qc4Error = 0; // stat. error of QC{4}
5416 Double_t qc6Error = 0; // stat. error of QC{6}
5417 // Double_t qc8Error = 0; // stat. error of QC{8} // to be improved (calculated)
2aa4ebcd 5418 // spread of cumulants:
c2a42ea2 5419 //Double_t qc2Spread = 0; // spread of QC{2}
2aa4ebcd 5420 Double_t qc4Spread = 0; // spread of QC{4}
5421 Double_t qc6Spread = 0; // spread of QC{6}
5422 // Double_t qc8Spread = 0; // spread of QC{8} // to be improved (calculated)
5423
c2a42ea2 5424 qc2Error = twoError; // final stat. error of QC{2}
2aa4ebcd 5425
5426 if(16.*pow(two,2.)*pow(twoSpread,2.)+pow(fourSpread,2.)-8.*two*cov24 >= 0.)
5427 {
5428 qc4Spread = pow(16.*pow(two,2.)*pow(twoSpread,2.)+pow(fourSpread,2.)-8.*two*cov24,0.5);
5429 } else
5430 {
5431 cout<<"WARNING: spread of QC{4} is imaginary !!!!"<<endl;
5432 }
c2a42ea2 5433
5434 qc4Error = fourPrefactor*qc4Spread; // final stat. error of QC{4}
5435
2aa4ebcd 5436 if(81.*pow(4.*pow(two,2.)-four,2.)*pow(twoSpread,2.)
5437 + 81.*pow(two,2.)*pow(fourSpread,2.)+pow(sixSpread,2.)
5438 - 162.*(4.*pow(two,2.)-four)*two*cov24
5439 + 18.*(4.*pow(two,2.)-four)*cov26
5440 - 18.*two*cov46 >= 0.)
5441 {
5442 qc6Spread = pow(81.*pow(4.*pow(two,2.)-four,2.)*pow(twoSpread,2.)
5443 + 81.*pow(two,2.)*pow(fourSpread,2.)+pow(sixSpread,2.)
5444 - 162.*(4.*pow(two,2.)-four)*two*cov24
5445 + 18.*(4.*pow(two,2.)-four)*cov26
5446 - 18.*two*cov46,0.5);
5447 } else
5448 {
c2a42ea2 5449 cout<<"WARNING: stat. error of QC{6} is imaginary !!!!"<<endl;
5450 }
5451
5452 qc6Error = sixPrefactor*qc6Spread; // final stat. error of QC{6}
2aa4ebcd 5453
2aa4ebcd 5454 // store the results and statistical errors for cumulants:
5455 fCumulants[pW][eW][0]->SetBinContent(1,qc2);
5456 fCumulants[pW][eW][0]->SetBinError(1,qc2Error);
5457 fCumulants[pW][eW][0]->SetBinContent(2,qc4);
5458 fCumulants[pW][eW][0]->SetBinError(2,qc4Error);
5459 fCumulants[pW][eW][0]->SetBinContent(3,qc6);
5460 fCumulants[pW][eW][0]->SetBinError(3,qc6Error);
5461 fCumulants[pW][eW][0]->SetBinContent(4,qc8);
5462 // fCumulants[pW]->SetBinError(4,qc8Error); // to be improved (calculated)
5463
5464} // end of AliFlowAnalysisWithQCumulants::CalculateCumulantsForIntFlow(Bool_t useParticleWeights, TString eventWeights)
9c1a9547 5465
5466
2aa4ebcd 5467//================================================================================================================================
9c1a9547 5468
5469
2aa4ebcd 5470void AliFlowAnalysisWithQCumulants::CalculateIntFlow(Bool_t useParticleWeights, TString eventWeights, Bool_t correctedForNUA)
9c1a9547 5471{
2aa4ebcd 5472 // calculate final results for integrated flow
9c1a9547 5473
2aa4ebcd 5474 // Results for integrated flow are stored in fInfFlow[pW][nua]. Binning of fIntFlow[pW][nua] is organized as follows:
5475 // 1st bin: v{2}
5476 // 2nd bin: v{4}
5477 // 3rd bin: v{6}
5478 // 4th bin: v{8}
9c1a9547 5479
2aa4ebcd 5480 // shortcuts for the flags:
5481 Int_t pW = (Int_t)(useParticleWeights); // 0=pWeights not useed, 1=pWeights used
5482 Int_t nua = (Int_t)(correctedForNUA); // 0=not corrected for NUA, 1=corrected for NUA
5483 Int_t eW = -1;
9c1a9547 5484
2aa4ebcd 5485 if(eventWeights = "exact")
5486 {
5487 eW = 0;
5488 }
5489
5490 if(!(fCumulants[pW][eW][nua] && fIntFlow[pW][eW][nua]))
5491 {
5492 cout<<"WARNING: fCumulants[pW][eW][nua] && fIntFlow[pW][eW][nua] is NULL in AFAWQC::CIF() !!!!"<<endl;
5493 cout<<"pW = "<<pW<<endl;
5494 cout<<"eW = "<<eW<<endl;
5495 cout<<"nua = "<<nua<<endl;
5496 exit(0);
5497 }
5498
5499 // cumulants:
5500 Double_t qc2 = fCumulants[pW][eW][nua]->GetBinContent(1); // QC{2}
5501 Double_t qc4 = fCumulants[pW][eW][nua]->GetBinContent(2); // QC{4}
5502 Double_t qc6 = fCumulants[pW][eW][nua]->GetBinContent(3); // QC{6}
5503 Double_t qc8 = fCumulants[pW][eW][nua]->GetBinContent(4); // QC{8}
5504
5505 // cumulants' statistical errors:
5506 Double_t qc2Error = fCumulants[pW][eW][nua]->GetBinError(1); // error of QC{2}
5507 Double_t qc4Error = fCumulants[pW][eW][nua]->GetBinError(2); // error of QC{4}
5508 Double_t qc6Error = fCumulants[pW][eW][nua]->GetBinError(3); // error of QC{6}
5509 //Double_t qc8Error = fCumulants[pW][nua]->GetBinError(4); // error of QC{8}
5510
5511 // integrated flow estimates:
5512 Double_t v2 = 0.; // v{2}
5513 Double_t v4 = 0.; // v{4}
5514 Double_t v6 = 0.; // v{6}
5515 Double_t v8 = 0.; // v{8}
5516
5517 // calculate integrated flow estimates from cumulants:
5518 if(qc2>=0.) v2 = pow(qc2,1./2.);
5519 if(qc4<=0.) v4 = pow(-1.*qc4,1./4.);
5520 if(qc6>=0.) v6 = pow((1./4.)*qc6,1./6.);
5521 if(qc8<=0.) v8 = pow((-1./33.)*qc8,1./8.);
5522
5523 // statistical errors of integrated flow estimates:
5524 Double_t v2Error = 0.; // error of v{2}
5525 Double_t v4Error = 0.; // error of v{4}
5526 Double_t v6Error = 0.; // error of v{6}
5527 Double_t v8Error = 0.; // error of v{8}
5528
5529 // calculate statistical errors for integrated flow estimates:
5530 if(qc2>0.) v2Error = (1./(2.*pow(qc2,0.5)))*qc2Error;
5531 if(qc4<0.) v4Error = (1./(4.*pow(-1.*qc4,3./4.)))*qc4Error;
5532 if(qc6>0.) v6Error = (1./(6.*pow(2.,1./3.)*pow(qc6,5./6.)))*qc6Error;
5533 if(qc8<0.) v8Error = 0.; // to be improved (calculated)
5534
5535 // store final results and statistical errors for integrated flow:
5536 fIntFlow[pW][eW][nua]->SetBinContent(1,v2);
5537 fIntFlow[pW][eW][nua]->SetBinError(1,v2Error);
5538 fIntFlow[pW][eW][nua]->SetBinContent(2,v4);
5539 fIntFlow[pW][eW][nua]->SetBinError(2,v4Error);
5540 fIntFlow[pW][eW][nua]->SetBinContent(3,v6);
5541 fIntFlow[pW][eW][nua]->SetBinError(3,v6Error);
5542 fIntFlow[pW][eW][nua]->SetBinContent(4,v8);
5543 fIntFlow[pW][eW][nua]->SetBinError(4,v8Error);
5544
5545} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlow(Bool_t useParticleWeights, TString eventWeights, Bool_t correctedForNUA)
5546
5547
5548//================================================================================================================================
5549
5550
5551void AliFlowAnalysisWithQCumulants::FillCommonHistResultsIntFlow(Bool_t useParticleWeights, TString eventWeights, Bool_t correctedForNUA)
5552{
5553 // fill in AliFlowCommonHistResults histograms relevant for 'NONAME' integrated flow (to be improved (name))
9c1a9547 5554
2aa4ebcd 5555 // shortcuts for the flags:
5556 Int_t pW = (Int_t)(useParticleWeights); // 0=pWeights not useed, 1=pWeights used
5557 Int_t nua = (Int_t)(correctedForNUA); // 0=not corrected for NUA, 1=corrected for NUA
5558 Int_t eW = -1;
5559
5560 if(eventWeights == "exact")
9c1a9547 5561 {
2aa4ebcd 5562 eW = 0;
5563 }
5564
5565 if(!fIntFlow[pW][eW][nua])
5566 {
5567 cout<<"WARNING: fIntFlow[pW][eW][nua] is NULL in AFAWQC::FCHRIF() !!!!"<<endl;
5568 cout<<"pW = "<<pW<<endl;
5569 cout<<"eW = "<<eW<<endl;
5570 cout<<"nua = "<<nua<<endl;
5571 exit(0);
5572 }
5573
5574 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
5575 {
5576 cout<<"WARNING: fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th"<<endl;
5577 cout<<" is NULL in AFAWQC::FCHRIF() !!!!"<<endl;
5578 exit(0);
5579 }
5580
5581 Double_t v2 = fIntFlow[pW][eW][nua]->GetBinContent(1);
5582 Double_t v4 = fIntFlow[pW][eW][nua]->GetBinContent(2);
5583 Double_t v6 = fIntFlow[pW][eW][nua]->GetBinContent(3);
5584 Double_t v8 = fIntFlow[pW][eW][nua]->GetBinContent(4);
5585
5586 Double_t v2Error = fIntFlow[pW][eW][nua]->GetBinError(1);
5587 Double_t v4Error = fIntFlow[pW][eW][nua]->GetBinError(2);
5588 Double_t v6Error = fIntFlow[pW][eW][nua]->GetBinError(3);
5589 Double_t v8Error = fIntFlow[pW][eW][nua]->GetBinError(4);
5590
5591 fCommonHistsResults2nd->FillIntegratedFlow(v2,v2Error);
5592 fCommonHistsResults4th->FillIntegratedFlow(v4,v4Error);
5593 fCommonHistsResults6th->FillIntegratedFlow(v6,v6Error);
5594 fCommonHistsResults8th->FillIntegratedFlow(v8,v8Error);
5595
5596} // end of AliFlowAnalysisWithQCumulants::FillCommonHistResultsIntFlow(Bool_t useParticleWeights, TString eventWeights, Bool_t correctedForNUA)
5597
5598
5599//================================================================================================================================
5600
5601
5602void AliFlowAnalysisWithQCumulants::ApplyCorrectionForNonUniformAcceptanceToCumulantsForIntFlow(Bool_t useParticleWeights, TString eventWeights)
5603{
5604 // apply correction for non-uniform acceptance to cumulants for integrated flow
5605 // (Remark: non-corrected cumulants are accessed from fCumulants[pW][0], corrected cumulants are stored in fCumulants[pW][1])
5606
5607 // shortcuts for the flags:
5608 Int_t pW = (Int_t)(useParticleWeights); // 0=pWeights not used, 1=pWeights used
5609 Int_t eW = -1;
5610
5611 if(eventWeights == "exact")
5612 {
5613 eW = 0;
9c1a9547 5614 }
5615
2aa4ebcd 5616 if(!(fCumulants[pW][eW][0] && fCumulants[pW][eW][1] && fCorrections[pW][eW]))
5617 {
5618 cout<<"WARNING: fCumulants[pW][eW][0] && fCumulants[pW][eW][1] && fCorrections[pW][eW] is NULL in AFAWQC::ACFNUATCFIF() !!!!"<<endl;
5619 cout<<"pW = "<<pW<<endl;
5620 cout<<"eW = "<<eW<<endl;
5621 exit(0);
5622 }
9c1a9547 5623
2aa4ebcd 5624 // non-corrected cumulants:
5625 Double_t qc2 = fCumulants[pW][eW][0]->GetBinContent(1);
5626 Double_t qc4 = fCumulants[pW][eW][0]->GetBinContent(2);
5627 Double_t qc6 = fCumulants[pW][eW][0]->GetBinContent(3);
5628 Double_t qc8 = fCumulants[pW][eW][0]->GetBinContent(4);
5629 // statistical error of non-corrected cumulants:
5630 Double_t qc2Error = fCumulants[pW][eW][0]->GetBinError(1);
5631 Double_t qc4Error = fCumulants[pW][eW][0]->GetBinError(2);
5632 Double_t qc6Error = fCumulants[pW][eW][0]->GetBinError(3);
5633 Double_t qc8Error = fCumulants[pW][eW][0]->GetBinError(4);
5634 // corrections for non-uniform acceptance:
5635 Double_t qc2Correction = fCorrections[pW][eW]->GetBinContent(1);
5636 Double_t qc4Correction = fCorrections[pW][eW]->GetBinContent(2);
5637 Double_t qc6Correction = fCorrections[pW][eW]->GetBinContent(3);
5638 Double_t qc8Correction = fCorrections[pW][eW]->GetBinContent(4);
5639 // corrected cumulants:
5640 Double_t qc2Corrected = qc2 + qc2Correction;
5641 Double_t qc4Corrected = qc4 + qc4Correction;
5642 Double_t qc6Corrected = qc6 + qc6Correction;
5643 Double_t qc8Corrected = qc8 + qc8Correction;
5644
5645 // ... to be improved (I need here also to correct error of QCs for NUA.
5646 // For simplicity sake I assume at the moment that this correction is negliglible, but it will be added eventually...)
5647
5648 // store corrected results and statistical errors for cumulants:
5649 fCumulants[pW][eW][1]->SetBinContent(1,qc2Corrected);
5650 fCumulants[pW][eW][1]->SetBinContent(2,qc4Corrected);
5651 fCumulants[pW][eW][1]->SetBinContent(3,qc6Corrected);
5652 fCumulants[pW][eW][1]->SetBinContent(4,qc8Corrected);
5653 fCumulants[pW][eW][1]->SetBinError(1,qc2Error); // to be improved (correct also qc2Error for NUA)
5654 fCumulants[pW][eW][1]->SetBinError(2,qc4Error); // to be improved (correct also qc4Error for NUA)
5655 fCumulants[pW][eW][1]->SetBinError(3,qc6Error); // to be improved (correct also qc6Error for NUA)
5656 fCumulants[pW][eW][1]->SetBinError(4,qc8Error); // to be improved (correct also qc8Error for NUA)
5657
5658} // end of AliFlowAnalysisWithQCumulants::ApplyCorrectionForNonUniformAcceptanceToCumulantsForIntFlow(Bool_t useParticleWeights, TString eventWeights)
9c1a9547 5659
5660
5661//================================================================================================================================
5662
2aa4ebcd 5663
5664void AliFlowAnalysisWithQCumulants::PrintQuantifyingCorrectionsForNonUniformAcceptance(Bool_t useParticleWeights, TString eventWeights)
c365fe76 5665{
2aa4ebcd 5666 // print on the screen QC{n,biased}/QC{n,corrected}
c365fe76 5667
2aa4ebcd 5668 // shortcuts for the flags:
5669 Int_t pW = (Int_t)(useParticleWeights); // 0=pWeights not used, 1=pWeights used
c365fe76 5670
2aa4ebcd 5671 Int_t eW = -1;
c365fe76 5672
2aa4ebcd 5673 if(eventWeights == "exact")
5674 {
5675 eW = 0;
5676 }
c365fe76 5677
2aa4ebcd 5678 if(!(fCumulants[pW][eW][0] && fCumulants[pW][eW][1]))
5679 {
5680 cout<<"WARNING: fCumulants[pW][eW][0] && fCumulants[pW][eW][1] is NULL in AFAWQC::PQCFNUA() !!!!"<<endl;
5681 cout<<"pW = "<<pW<<endl;
5682 cout<<"eW = "<<eW<<endl;
5683 exit(0);
5684 }
5685
5686 cout<<endl;
5687 cout<<" Quantifying the bias to Q-cumulants from"<<endl;
5688 cout<<" non-uniform acceptance of the detector:"<<endl;
5689 cout<<endl;
c365fe76 5690
2aa4ebcd 5691 if(fCumulants[pW][eW][1]->GetBinContent(1))
5692 {
5693 cout<<" QC{2,biased}/QC{2,corrected} = "<<(fCumulants[pW][eW][0]->GetBinContent(1))/(fCumulants[pW][eW][1]->GetBinContent(1))<<endl;
5694 }
5695 if(fCumulants[pW][eW][1]->GetBinContent(2))
5696 {
5697 cout<<" QC{4,biased}/QC{4,corrected} = "<<fCumulants[pW][eW][0]->GetBinContent(2)/fCumulants[pW][eW][1]->GetBinContent(2)<<endl;
5698 }
5699
5700 cout<<endl;
5701
5702} // end of AliFlowAnalysisWithQCumulants::PrintQuantifyingCorrectionsForNonUniformAcceptance(Bool_t useParticleWeights, TString eventWeights)
2bdc5281 5703
5704
5705//================================================================================================================================
5706
5707
2aa4ebcd 5708void AliFlowAnalysisWithQCumulants::CalculateWeightedCorrelationsForIntegratedFlow()
2bdc5281 5709{
2aa4ebcd 5710 // calculate all weighted correlations needed for integrated flow and store them in 1D profile fQCorrelations[1][eW] and fQExtraCorrelations[1][eW]
5711
5712 for(Int_t eW=0;eW<2;eW++)
2bdc5281 5713 {
2aa4ebcd 5714 if(!(fQCorrelationsEBE[1] && fQCorrelations[1][eW]))
5715 {
5716 cout<<"WARNING: fQCorrelationsEBE[1] && fQCorrelations[1][eW] is NULL in AFAWQC::CWCFIF() !!!!"<<endl;
5717 cout<<"eW = "<<eW<<endl;
5718 exit(0);
5719 }
5720 }
5721
5722 // Remark 1: binning of fQCorrelations[W] is organized as follows:
5723 //..............................................................................................
5724 // ---- bins 1-20: 2-particle correlations ----
5725 // 1st bin: two1n1nW1W1 = <w1 w2 cos(n*(phi1-phi2))>
5726 // 2nd bin: two2n2nW2W2 = <w1^2 w2^2 cos(2n*(phi1-phi2))>
5727 // 3rd bin: two3n3nW3W3 = <w1^3 w2^3 cos(3n*(phi1-phi2))>
5728 // 4th bin: two4n4nW4W4 = <w1^4 w2^4 cos(4n*(phi1-phi2))>
5729 // 5th bin: two1n1nW3W1 = <w1^3 w2 cos(n*(phi1-phi2))>
5730 // 6th bin: two1n1nW1W1W2 = <w1 w2 w3^2 cos(n*(phi1-phi2))>
5731 // ---- bins 21-40: 3-particle correlations ----
5732 // 21st bin: three2n1n1nW2W1W1 = <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
5733 // ---- bins 41-60: 4-particle correlations ----
5734 // 41st bin: four1n1n1n1nW1W1W1W1 = <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
5735 // ---- bins 61-80: 5-particle correlations ----
5736 // ---- bins 81-100: 6-particle correlations ----
5737 // ---- bins 101-120: 7-particle correlations ----
5738 // ---- bins 121-140: 8-particle correlations ----
5739 //..............................................................................................
5740
5741 // multiplicity (number of particles used to determine the reaction plane)
5742 Double_t dMult = (*fSMpk)(0,0);
5743
5744 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
5745 Double_t dReQ1n1k = (*fReQ)(0,1);
5746 Double_t dReQ2n2k = (*fReQ)(1,2);
5747 Double_t dReQ3n3k = (*fReQ)(2,3);
5748 Double_t dReQ4n4k = (*fReQ)(3,4);
5749 Double_t dReQ1n3k = (*fReQ)(0,3);
5750 Double_t dImQ1n1k = (*fImQ)(0,1);
5751 Double_t dImQ2n2k = (*fImQ)(1,2);
5752 Double_t dImQ3n3k = (*fImQ)(2,3);
5753 Double_t dImQ4n4k = (*fImQ)(3,4);
5754 Double_t dImQ1n3k = (*fImQ)(0,3);
5755
5756 // dMs are variables introduced in order to simplify some Eqs. bellow:
5757 //..............................................................................................
5758 Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
5759 Double_t dM22 = (*fSMpk)(1,2)-(*fSMpk)(0,4); // dM22 = sum_{i,j=1,i!=j}^M w_i^2 w_j^2
5760 Double_t dM33 = (*fSMpk)(1,3)-(*fSMpk)(0,6); // dM33 = sum_{i,j=1,i!=j}^M w_i^3 w_j^3
5761 Double_t dM44 = (*fSMpk)(1,4)-(*fSMpk)(0,8); // dM44 = sum_{i,j=1,i!=j}^M w_i^4 w_j^4
5762 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
5763 Double_t dM211 = (*fSMpk)(0,2)*(*fSMpk)(1,1)-2.*(*fSMpk)(0,3)*(*fSMpk)(0,1)
5764 - (*fSMpk)(1,2)+2.*(*fSMpk)(0,4); // dM211 = sum_{i,j,k=1,i!=j!=k}^M w_i^2 w_j w_k
5765 Double_t dM1111 = (*fSMpk)(3,1)-6.*(*fSMpk)(0,2)*(*fSMpk)(1,1)
5766 + 8.*(*fSMpk)(0,3)*(*fSMpk)(0,1)
5767 + 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
5768 //..............................................................................................
5769
5770 // ***********************************************
5771 // **** weighted multi-particle correlations: ****
5772 // ***********************************************
5773 //..............................................................................................
5774 // weighted 2-particle correlations:
5775 Double_t two1n1nW1W1 = 0.; // <w1 w2 cos(n*(phi1-phi2))>
5776 Double_t two2n2nW2W2 = 0.; // <w1^2 w2^2 cos(2n*(phi1-phi2))>
5777 Double_t two3n3nW3W3 = 0.; // <w1^3 w2^3 cos(3n*(phi1-phi2))>
5778 Double_t two4n4nW4W4 = 0.; // <w1^4 w2^4 cos(4n*(phi1-phi2))>
5779 Double_t two1n1nW3W1 = 0.; // <w1^3 w2 cos(n*(phi1-phi2))>
5780 Double_t two1n1nW1W1W2 = 0.; // <w1 w2 w3^2 cos(n*(phi1-phi2))>
5781
5782 if(dMult>1)
5783 {
5784 if(dM11)
5785 {
5786 two1n1nW1W1 = (pow(dReQ1n1k,2)+pow(dImQ1n1k,2)-(*fSMpk)(0,2))/dM11;
2bdc5281 5787
2aa4ebcd 5788 // average weighted correlation <w1 w2 cos(n*(phi1-phi2))> for single event:
5789 fQCorrelationsEBE[1]->SetBinContent(1,two1n1nW1W1);
5790
5791 // average weighted correlation <w1 w2 cos(n*(phi1-phi2))> for all events:
5792 //fQCorrelationsW->Fill(0.,two1n1nW1W1,dM11);
5793 fQCorrelations[1][0]->Fill(0.5,two1n1nW1W1,dM11);
5794 }
5795 if(dM22)
5796 {
5797 two2n2nW2W2 = (pow(dReQ2n2k,2)+pow(dImQ2n2k,2)-(*fSMpk)(0,4))/dM22;
5798 //fQCorrelationsW->Fill(1.,two2n2nW2W2,dM22);
5799 fQCorrelations[1][0]->Fill(1.5,two2n2nW2W2,dM22);
5800 }
5801 if(dM33)
5802 {
5803 two3n3nW3W3 = (pow(dReQ3n3k,2)+pow(dImQ3n3k,2)-(*fSMpk)(0,6))/dM33;
5804 //fQCorrelationsW->Fill(2.,two3n3nW3W3,dM33);
5805 fQCorrelations[1][0]->Fill(2.5,two3n3nW3W3,dM33);
5806 }
5807 if(dM44)
5808 {
5809 two4n4nW4W4 = (pow(dReQ4n4k,2)+pow(dImQ4n4k,2)-(*fSMpk)(0,8))/dM44;
5810 //fQCorrelationsW->Fill(3.,two4n4nW4W4,dM44);
5811 fQCorrelations[1][0]->Fill(3.5,two4n4nW4W4,dM44);
5812 }
5813 if(dM31)
5814 {
5815 two1n1nW3W1 = (dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k-(*fSMpk)(0,4))/dM31;
5816 //fQCorrelationsW->Fill(4.,two1n1nW3W1,dM31);
5817 }
5818 if(dM211)
5819 {
5820 two1n1nW1W1W2 = ((*fSMpk)(0,2)*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2)-(*fSMpk)(0,2))
5821 - 2.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k
5822 - (*fSMpk)(0,4)))/dM211;
5823 //fQCorrelationsW->Fill(5.,two1n1nW1W1W2,dM211);
5824 }
5825 } // end of if(dMult>1)
5826 //..............................................................................................
5827
5828 //..............................................................................................
5829 // weighted 3-particle correlations:
5830 Double_t three2n1n1nW2W1W1 = 0.; // <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
5831
5832 if(dMult>2)
5833 {
5834 if(dM211)
5835 {
5836 three2n1n1nW2W1W1 = (pow(dReQ1n1k,2.)*dReQ2n2k+2.*dReQ1n1k*dImQ1n1k*dImQ2n2k-pow(dImQ1n1k,2.)*dReQ2n2k
5837 - 2.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k)
5838 - pow(dReQ2n2k,2)-pow(dImQ2n2k,2)
5839 + 2.*(*fSMpk)(0,4))/dM211;
5840 //fQCorrelationsW->Fill(20.,three2n1n1nW2W1W1,dM211);
5841 }
5842 } // end of if(dMult>2)
5843 //..............................................................................................
5844
5845 //..............................................................................................
5846 // weighted 4-particle correlations:
5847 Double_t four1n1n1n1nW1W1W1W1 = 0.; // <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
5848 if(dMult>3)
5849 {
5850 if(dM1111)
5851 {
5852 four1n1n1n1nW1W1W1W1 = (pow(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.),2)
5853 - 2.*(pow(dReQ1n1k,2.)*dReQ2n2k+2.*dReQ1n1k*dImQ1n1k*dImQ2n2k-pow(dImQ1n1k,2.)*dReQ2n2k)
5854 + 8.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k)
5855 + (pow(dReQ2n2k,2)+pow(dImQ2n2k,2))
5856 - 4.*(*fSMpk)(0,2)*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
5857 - 6.*(*fSMpk)(0,4)+2.*(*fSMpk)(1,2))/dM1111;
5858
5859 // average weighted correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for single event:
5860 fQCorrelationsEBE[1]->SetBinContent(11,four1n1n1n1nW1W1W1W1);
5861
5862 // average weighted correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for all events:
5863 //fQCorrelationsW->Fill(40.,four1n1n1n1nW1W1W1W1,dM1111);
5864
5865 fQCorrelations[1][0]->Fill(10.5,four1n1n1n1nW1W1W1W1,dM1111);
5866 }
5867 } // end of if(dMult>3)
5868 //..............................................................................................
2bdc5281 5869
2aa4ebcd 5870} // end of AliFlowAnalysisWithQCumulants::CalculateWeightedCorrelationsForIntegratedFlow()
c365fe76 5871
5872
5873//================================================================================================================================
5874
5875
2aa4ebcd 5876void AliFlowAnalysisWithQCumulants::CalculateWeightedQProductsForIntFlow() // to be improved (completed)
9c1a9547 5877{
2aa4ebcd 5878 // calculate averages like <<2><4>>, <<2><6>>, <<4><6>>, etc. which are needed to calculate covariances
5879 // Remark: here we take weighted correlations!
9c1a9547 5880
2aa4ebcd 5881 // binning of fQProductsW is organized as follows:
5882 //
5883 // 1st bin: <2><4>
5884 // 2nd bin: <2><6>
5885 // 3rd bin: <2><8>
5886 // 4th bin: <4><6>
5887 // 5th bin: <4><8>
5888 // 6th bin: <6><8>
9c1a9547 5889
2aa4ebcd 5890 Double_t dMult = (*fSMpk)(0,0); // multiplicity (number of particles used to determine the reaction plane)
9c1a9547 5891
2aa4ebcd 5892 Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
5893 Double_t dM1111 = (*fSMpk)(3,1)-6.*(*fSMpk)(0,2)*(*fSMpk)(1,1)
5894 + 8.*(*fSMpk)(0,3)*(*fSMpk)(0,1)
5895 + 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
5896
5897 Double_t twoEBEW = 0.; // <2>
5898 Double_t fourEBEW = 0.; // <4>
c365fe76 5899
2aa4ebcd 5900 twoEBEW = fQCorrelationsEBE[1]->GetBinContent(1);
5901 fourEBEW = fQCorrelationsEBE[1]->GetBinContent(11);
c365fe76 5902
2aa4ebcd 5903 // <2><4>
5904 if(dMult>3)
5905 {
5906 fQProducts[1][0]->Fill(0.5,twoEBEW*fourEBEW,dM11*dM1111);
cad7c05a 5907 }
5908
2aa4ebcd 5909} // end of AliFlowAnalysisWithQCumulants::CalculateWeightedQProductsForIntFlow()
5910
5911
5912//================================================================================================================================
5913
5914
5915void AliFlowAnalysisWithQCumulants::InitializeArraysForIntFlow()
5916{
5917 // initialize all arrays needed to calculate the integrated flow
9c1a9547 5918
2aa4ebcd 5919 for(Int_t pW=0;pW<1+(Int_t)(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);pW++) // not weighted or weighted
9c1a9547 5920 {
2aa4ebcd 5921 fQCorrelationsEBE[pW] = NULL;
5922 for(Int_t sc=0;sc<2;sc++)
9c1a9547 5923 {
2aa4ebcd 5924 fQCorrectionsEBE[pW][sc] = NULL;
9c1a9547 5925 }
2aa4ebcd 5926 for(Int_t eW=0;eW<2;eW++)
9c1a9547 5927 {
2aa4ebcd 5928 // profiles:
5929 fQCorrelations[pW][eW] = NULL;
5930 fQProducts[pW][eW] = NULL;
5931 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
5932 {
5933 fQCorrections[pW][eW][sc] = NULL;
5934 }
5935 // histograms with results:
5936 fCorrelations[pW][eW] = NULL;
5937 fCovariances[pW][eW] = NULL;
5938 fCorrections[pW][eW] = NULL;
c2a42ea2 5939 fProductOfEventWeights[pW][eW] = NULL;
5940 for(Int_t power=0;power<2;power++)
5941 {
5942 fSumOfEventWeights[pW][eW][power] = NULL;
5943 }
2aa4ebcd 5944 for(Int_t nua=0;nua<2;nua++) // not corrected or corrected
5945 {
5946 fCumulants[pW][eW][nua] = NULL;
5947 fIntFlow[pW][eW][nua] = NULL;
5948 }
9c1a9547 5949 }
9c1a9547 5950 }
4057ba99 5951
2aa4ebcd 5952} // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForIntFlow()
9c1a9547 5953
5954
5955//================================================================================================================================
5956
5957
2aa4ebcd 5958void AliFlowAnalysisWithQCumulants::InitializeArraysForDiffFlow()
9c1a9547 5959{
2aa4ebcd 5960 // initialize all arrays needed to calcualted differential flow
4057ba99 5961
2aa4ebcd 5962 // nested lists in fDiffFlowProfiles:
5963 for(Int_t t=0;t<2;t++)
9c1a9547 5964 {
2aa4ebcd 5965 fDFPType[t] = NULL;
5966 for(Int_t pW=0;pW<1+(Int_t)(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);pW++)
5967 {
5968 fDFPParticleWeights[t][pW] = NULL;
5969 for(Int_t eW=0;eW<2;eW++)
5970 {
5971 fDFPEventWeights[t][pW][eW] = NULL;
5972 fDiffFlowCorrelations[t][pW][eW] = NULL;
5973 fDiffFlowProductsOfCorrelations[t][pW][eW] = NULL;
5974 for(Int_t sc=0;sc<2;sc++)
5975 {
5976 fDiffFlowCorrectionTerms[t][pW][eW][sc] = NULL;
5977 }
5978 }
5979 }
5980 }
3d824203 5981
2aa4ebcd 5982 // profiles in nested lists in fDiffFlowProfiles:
5983 for(Int_t t=0;t<2;t++) // type: RP or POI
9c1a9547 5984 {
2aa4ebcd 5985 for(Int_t pW=0;pW<1+(Int_t)(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);pW++) // particle weights: not used or used
9c1a9547 5986 {
2aa4ebcd 5987 for(Int_t eW=0;eW<2;eW++)
5988 {
5989 // correlations:
5990 for(Int_t correlationIndex=0;correlationIndex<4;correlationIndex++)
5991 {
5992 fCorrelationsPro[t][pW][eW][correlationIndex] = NULL;
5993 }
5994 // products of correlations:
5995 for(Int_t productOfCorrelationsIndex=0;productOfCorrelationsIndex<6;productOfCorrelationsIndex++)
5996 {
5997 fProductsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex] = NULL;
5998 }
5999 // correction terms:
6000 for(Int_t sc=0;sc<2;sc++)
6001 {
6002 for(Int_t correctionsIndex=0;correctionsIndex<2;correctionsIndex++)
6003 {
6004 fCorrectionTermsPro[t][pW][eW][sc][correctionsIndex] = NULL;
6005 }
6006 }
6007 }
9c1a9547 6008 }
2aa4ebcd 6009 }
6010
6011 // nested lists in fDiffFlowResults:
6012 for(Int_t t=0;t<2;t++)
6013 {
6014 fDFRType[t] = NULL;
6015 for(Int_t pW=0;pW<1+(Int_t)(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);pW++)
9c1a9547 6016 {
2aa4ebcd 6017 fDFRParticleWeights[t][pW] = NULL;
6018 for(Int_t eW=0;eW<2;eW++)
6019 {
6020 fDFREventWeights[t][pW][eW] = NULL;
6021 fDiffFlowFinalCorrelations[t][pW][eW] = NULL;
6022 fDiffFlowFinalCorrections[t][pW][eW] = NULL;
6023 fDiffFlowFinalCovariances[t][pW][eW] = NULL;
6024 for(Int_t nua=0;nua<2;nua++)
6025 {
6026 fDFRCorrections[t][pW][eW][nua] = NULL;
6027 fDiffFlowFinalCumulants[t][pW][eW][nua] = NULL;
6028 fDiffFlowFinalFlow[t][pW][eW][nua] = NULL;
6029 }
6030 }
9c1a9547 6031 }
6032 }
2aa4ebcd 6033
6034 // 2D and 1D histograms in nested lists in fDiffFlowResults:
6035 for(Int_t t=0;t<2;t++)
9c1a9547 6036 {
2aa4ebcd 6037 fNonEmptyBins2D[t] = NULL;
6038 for(Int_t pe=0;pe<2;pe++)
9c1a9547 6039 {
2aa4ebcd 6040 fNonEmptyBins1D[t][pe] = NULL;
9c1a9547 6041 }
2aa4ebcd 6042 for(Int_t pW=0;pW<1+(Int_t)(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);pW++)
9c1a9547 6043 {
2aa4ebcd 6044 for(Int_t eW=0;eW<2;eW++)
6045 {
6046 // correlations:
6047 for(Int_t correlationIndex=0;correlationIndex<4;correlationIndex++)
6048 {
6049 fFinalCorrelations2D[t][pW][eW][correlationIndex] = NULL;
6050 for(Int_t pe=0;pe<2;pe++)
6051 {
6052 fFinalCorrelations1D[t][pW][eW][pe][correlationIndex] = NULL;
6053 }
6054 }
6055 // corrections:
6056 for(Int_t correctionIndex=0;correctionIndex<4;correctionIndex++)
6057 {
6058 fFinalCorrections2D[t][pW][eW][correctionIndex] = NULL;
6059 for(Int_t pe=0;pe<2;pe++)
6060 {
6061 fFinalCorrections1D[t][pW][eW][pe][correctionIndex] = NULL;
6062 }
6063 }
6064 // covariances:
6065 for(Int_t covarianceIndex=0;covarianceIndex<4;covarianceIndex++)
6066 {
6067 fFinalCovariances2D[t][pW][eW][covarianceIndex] = NULL;
6068 for(Int_t pe=0;pe<2;pe++)
6069 {
6070 fFinalCovariances1D[t][pW][eW][pe][covarianceIndex] = NULL;
6071 }
6072 }
6073 for(Int_t nua=0;nua<2;nua++)
6074 {
6075 // cumulants:
6076 for(Int_t cumulantIndex=0;cumulantIndex<4;cumulantIndex++)
6077 {
6078 fFinalCumulants2D[t][pW][eW][nua][cumulantIndex] = NULL;
6079 fFinalCumulantsPt[t][pW][eW][nua][cumulantIndex] = NULL;
6080 fFinalCumulantsEta[t][pW][eW][nua][cumulantIndex] = NULL;
6081 }
6082 // final flow:
6083 for(Int_t finalFlowIndex=0;finalFlowIndex<4;finalFlowIndex++)
6084 {
6085 fFinalFlow2D[t][pW][eW][nua][finalFlowIndex] = NULL;
6086 fFinalFlowPt[t][pW][eW][nua][finalFlowIndex] = NULL;
6087 fFinalFlowEta[t][pW][eW][nua][finalFlowIndex] = NULL;
6088 }
6089 }
6090 }
6091 }
6092 }
3d824203 6093
2aa4ebcd 6094 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
9c1a9547 6095 {
2aa4ebcd 6096 for(Int_t m=0;m<4;m++) // multiple of harmonic
6097 {
6098 for(Int_t k=0;k<9;k++) // power of weight
6099 {
6100 fReEBE[t][m][k] = NULL;
6101 fImEBE[t][m][k] = NULL;
6102 fs[t][k] = NULL; // to be improved (this doesn't need to be within loop over m)
6103 }
6104 }
6105 }
9c1a9547 6106
2aa4ebcd 6107} // end of AliFlowAnalysisWithQCumulants::InitializeArraysForDiffFlow()
9c1a9547 6108
2aa4ebcd 6109
6110//================================================================================================================================
6111
6112
6113void AliFlowAnalysisWithQCumulants::BookEverythingForDifferentialFlow()
6114{
6115 // organize and book everything needed for differential flow
6116
6117 // book and nest all lists belonging to the list fDiffFlowProfiles "Profiles":
6118 TList list; // to be improved (do I need this here?)
6119 list.SetOwner(kTRUE); // to be improved (do I need this here?)
6120 TString typeFlag[2] = {"RP","POI"}; // to be improved (do I need this here?)
6121 TString pWeightsFlag[2] = {"not used","used"}; // to be improved (do I need this here?)
6122 TString eWeightsFlag[2] = {"exact","non-exact"}; // to be improved (do I need this here?)
6123 //TString sinCosFlag[2] = {"sin","cos"}; // to be improved (do I need this here?)
6124 TString nuaFlag[2] = {"not corrected","corrected"}; // nua = non-uniform acceptance // to be improved (do I need this here?)
6125
6126 // book all 2D profiles and add to appropriate lists:
6127 TProfile2D styleProfile("","",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
6128 styleProfile.SetXTitle("p_{t}");
6129 styleProfile.SetYTitle("#eta");
6130 TString correlationName[4] = {"<2'>","<4'>","<6'>","<8'>"};
6131 TString cumulantName[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
6132 TString productOfCorrelationsName[5] = {"<2><2'>","<2><4'>","<4><2'>","<4><4'>","<2'><4'>"};
6133 TString correctionsSinTermsName[2] = {"sin(1)","sin(2)"};
6134 TString correctionsCosTermsName[2] = {"cos(1)","cos(2)"};
6135 TString correctionName[4] = {"corr. to QC{2'}","corr. to QC{4'}","corr. to QC{6'}","corr. to QC{8'}"};
6136 TString covarianceName[4] = {"Cov(2,2')","Cov(2,4')","Cov(2',4')","Cov(4,2')"}; // to be improved (reorganized)
6137 TString flowName[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
6138
6139 for(Int_t t=0;t<2;t++) // type: RP or POI
6140 {
6141 for(Int_t pW=0;pW<1+(Int_t)(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);pW++) // weights: not used or used
9c1a9547 6142 {
2aa4ebcd 6143 for(Int_t eW=0;eW<2;eW++)
6144 {
6145 // correlations:
6146 for(Int_t correlationIndex=0;correlationIndex<4;correlationIndex++)
6147 {
6148 fCorrelationsPro[t][pW][eW][correlationIndex] = (TProfile2D*)styleProfile.Clone(correlationName[correlationIndex].Data());
6149 fCorrelationsPro[t][pW][eW][correlationIndex]->SetTitle(correlationName[correlationIndex].Data());
6150 fDiffFlowCorrelations[t][pW][eW]->Add(fCorrelationsPro[t][pW][eW][correlationIndex]);
6151 }
6152 // products of correlations:
6153 for(Int_t productOfCorrelationsIndex=0;productOfCorrelationsIndex<5;productOfCorrelationsIndex++)
6154 {
6155 fProductsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex] = (TProfile2D*)styleProfile.Clone(productOfCorrelationsName[productOfCorrelationsIndex].Data());
6156 fProductsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex]->SetTitle(productOfCorrelationsName[productOfCorrelationsIndex].Data());
6157 fDiffFlowProductsOfCorrelations[t][pW][eW]->Add(fProductsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex]);
6158 }
6159 // correction terms:
6160 for(Int_t sc=0;sc<2;sc++)
6161 {
6162 for(Int_t correctionsIndex=0;correctionsIndex<2;correctionsIndex++)
6163 {
6164 if(sc==0)
6165 {
6166 fCorrectionTermsPro[t][pW][eW][sc][correctionsIndex] = (TProfile2D*)styleProfile.Clone(correctionsSinTermsName[correctionsIndex].Data());
6167 fCorrectionTermsPro[t][pW][eW][sc][correctionsIndex]->SetTitle(correctionsSinTermsName[correctionsIndex].Data());
6168 fDiffFlowCorrectionTerms[t][pW][eW][sc]->Add(fCorrectionTermsPro[t][pW][eW][sc][correctionsIndex]);
6169 }
6170 if(sc==1)
6171 {
6172 fCorrectionTermsPro[t][pW][eW][sc][correctionsIndex] = (TProfile2D*)styleProfile.Clone(correctionsCosTermsName[correctionsIndex].Data());
6173 fCorrectionTermsPro[t][pW][eW][sc][correctionsIndex]->SetTitle(correctionsCosTermsName[correctionsIndex].Data());
6174 fDiffFlowCorrectionTerms[t][pW][eW][sc]->Add(fCorrectionTermsPro[t][pW][eW][sc][correctionsIndex]);
6175 }
6176 }
6177 }
6178 }
6179 }
6180 }
6181
6182 // book all 2D and 1D histograms for final results and store them in appropriate lists:
6183 TH2D styleHistPtEta("","",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
6184 styleHistPtEta.SetXTitle("p_{t}");
6185 styleHistPtEta.SetYTitle("#eta");
6186 TH1D styleHistPt("","",fnBinsPt,fPtMin,fPtMax);
6187 styleHistPt.SetXTitle("p_{t}");
6188 TH1D styleHistEta("","",fnBinsEta,fEtaMin,fEtaMax);
6189 styleHistEta.SetXTitle("#eta");
6190 for(Int_t t=0;t<2;t++) // RP or POI
6191 {
6192 // 2D:
6193 fNonEmptyBins2D[t] = (TH2D*)styleHistPtEta.Clone(Form("%s, (p_{t},#eta)",typeFlag[t].Data()));
6194 fNonEmptyBins2D[t]->SetTitle(Form("Non-empty bins: %s (p_{t},#eta)",typeFlag[t].Data()));
6195 fDFRType[t]->Add(fNonEmptyBins2D[t]);
6196 // 1D:
6197 fNonEmptyBins1D[t][0] = (TH1D*)styleHistPt.Clone(Form("%s, p_{t}",typeFlag[t].Data()));
6198 fNonEmptyBins1D[t][0]->SetTitle(Form("Non-empty bins: %s (p_{t})",typeFlag[t].Data()));
6199 fDFRType[t]->Add(fNonEmptyBins1D[t][0]);
6200 fNonEmptyBins1D[t][1] = (TH1D*)styleHistEta.Clone(Form("%s, #eta",typeFlag[t].Data()));
6201 fNonEmptyBins1D[t][1]->SetTitle(Form("Non-empty bins: %s (#eta)",typeFlag[t].Data()));
6202 fDFRType[t]->Add(fNonEmptyBins1D[t][1]);
6203
6204 for(Int_t pW=0;pW<1+(Int_t)(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);pW++) // particle weights not used or used
9c1a9547 6205 {
2aa4ebcd 6206 for(Int_t eW=0;eW<2;eW++)
6207 {
6208 // correlations:
6209 for(Int_t correlationIndex=0;correlationIndex<4;correlationIndex++)
6210 {
6211 // 2D:
6212 fFinalCorrelations2D[t][pW][eW][correlationIndex] = (TH2D*)styleHistPtEta.Clone(Form("%s, (p_{t},#eta)",correlationName[correlationIndex].Data()));
6213 fFinalCorrelations2D[t][pW][eW][correlationIndex]->SetTitle(Form("%s (p_{t},#eta): %s, pWeights %s, eWeights %s",correlationName[correlationIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
6214 fDiffFlowFinalCorrelations[t][pW][eW]->Add(fFinalCorrelations2D[t][pW][eW][correlationIndex]);
6215 // 1D:
6216 for(Int_t pe=0;pe<2;pe++) // pt or eta:
6217 {
6218 if(pe==0)
6219 {
6220 fFinalCorrelations1D[t][pW][eW][pe][correlationIndex] = (TH1D*)styleHistPt.Clone(Form("%s, (p_{t})",correlationName[correlationIndex].Data()));
6221 fFinalCorrelations1D[t][pW][eW][pe][correlationIndex]->SetTitle(Form("%s (p_{t}): %s, pWeights %s, eWeights %s",correlationName[correlationIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
6222 fDiffFlowFinalCorrelations[t][pW][eW]->Add(fFinalCorrelations1D[t][pW][eW][pe][correlationIndex]);
6223 }
6224 if(pe==1)
6225 {
6226 fFinalCorrelations1D[t][pW][eW][pe][correlationIndex] = (TH1D*)styleHistEta.Clone(Form("%s, (#eta)",correlationName[correlationIndex].Data()));
6227 fFinalCorrelations1D[t][pW][eW][pe][correlationIndex]->SetTitle(Form("%s (#eta): %s, pWeights %s, eWeights %s",correlationName[correlationIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
6228 fDiffFlowFinalCorrelations[t][pW][eW]->Add(fFinalCorrelations1D[t][pW][eW][pe][correlationIndex]);
6229 }
6230 }
6231 }
6232 // corrections:
6233 for(Int_t correctionIndex=0;correctionIndex<4;correctionIndex++)
6234 {
6235 // 2D:
6236 fFinalCorrections2D[t][pW][eW][correctionIndex] = (TH2D*)styleHistPtEta.Clone(Form("%s, (p_{t},#eta)",correctionName[correctionIndex].Data()));
6237 fFinalCorrections2D[t][pW][eW][correctionIndex]->SetTitle(Form("%s (p_{t},#eta): %s, pWeights %s, eWeights %s",correctionName[correctionIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
6238 fDiffFlowFinalCorrections[t][pW][eW]->Add(fFinalCorrections2D[t][pW][eW][correctionIndex]);
6239 // 1D:
6240 for(Int_t pe=0;pe<2;pe++) // pt or eta:
6241 {
6242 if(pe==0)
6243 {
6244 fFinalCorrections1D[t][pW][eW][pe][correctionIndex] = (TH1D*)styleHistPt.Clone(Form("%s, (p_{t})",correctionName[correctionIndex].Data()));
6245 fFinalCorrections1D[t][pW][eW][pe][correctionIndex]->SetTitle(Form("%s (p_{t}): %s, pWeights %s, eWeights %s",correctionName[correctionIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
6246 fDiffFlowFinalCorrections[t][pW][eW]->Add(fFinalCorrections1D[t][pW][eW][pe][correctionIndex]);
6247 }
6248 if(pe==1)
6249 {
6250 fFinalCorrections1D[t][pW][eW][pe][correctionIndex] = (TH1D*)styleHistEta.Clone(Form("%s, (#eta)",correctionName[correctionIndex].Data()));
6251 fFinalCorrections1D[t][pW][eW][pe][correctionIndex]->SetTitle(Form("%s (#eta): %s, pWeights %s, eWeights %s",correctionName[correctionIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
6252 fDiffFlowFinalCorrections[t][pW][eW]->Add(fFinalCorrections1D[t][pW][eW][pe][correctionIndex]);
6253 }
6254 }
6255 }
6256 // covariances:
6257 for(Int_t covarianceIndex=0;covarianceIndex<4;covarianceIndex++)
6258 {
6259 // 2D:
6260 fFinalCovariances2D[t][pW][eW][covarianceIndex] = (TH2D*)styleHistPtEta.Clone(Form("%s, (p_{t},#eta)",covarianceName[covarianceIndex].Data()));
6261 fFinalCovariances2D[t][pW][eW][covarianceIndex]->SetTitle(Form("%s (p_{t},#eta): %s, pWeights %s, eWeights %s",covarianceName[covarianceIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
6262 fDiffFlowFinalCovariances[t][pW][eW]->Add(fFinalCovariances2D[t][pW][eW][covarianceIndex]);
6263 // 1D:
6264 for(Int_t pe=0;pe<2;pe++) // pt or eta:
6265 {
6266 if(pe==0)
6267 {
6268 fFinalCovariances1D[t][pW][eW][pe][covarianceIndex] = (TH1D*)styleHistPt.Clone(Form("%s, (p_{t})",covarianceName[covarianceIndex].Data()));
6269 fFinalCovariances1D[t][pW][eW][pe][covarianceIndex]->SetTitle(Form("%s (p_{t}): %s, pWeights %s, eWeights %s",covarianceName[covarianceIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
6270 fDiffFlowFinalCovariances[t][pW][eW]->Add(fFinalCovariances1D[t][pW][eW][pe][covarianceIndex]);
6271 }
6272 if(pe==1)
6273 {
6274 fFinalCovariances1D[t][pW][eW][pe][covarianceIndex] = (TH1D*)styleHistEta.Clone(Form("%s, (#eta)",covarianceName[covarianceIndex].Data()));
6275 fFinalCovariances1D[t][pW][eW][pe][covarianceIndex]->SetTitle(Form("%s (#eta): %s, pWeights %s, eWeights %s",covarianceName[covarianceIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
6276 fDiffFlowFinalCovariances[t][pW][eW]->Add(fFinalCovariances1D[t][pW][eW][pe][covarianceIndex]);
6277 }
6278 }
6279 }
6280 for(Int_t nua=0;nua<2;nua++) // corrected or not
6281 {
6282 // cumulants:
6283 for(Int_t cumulantIndex=0;cumulantIndex<4;cumulantIndex++)
6284 {
6285 // 2D:
6286 fFinalCumulants2D[t][pW][eW][nua][cumulantIndex] = (TH2D*)styleHistPtEta.Clone(Form("%s, (p_{t},#eta)",cumulantName[cumulantIndex].Data()));
6287 fFinalCumulants2D[t][pW][eW][nua][cumulantIndex]->SetTitle(Form("%s (p_{t},#eta): %s, pWeights %s, eWeights %s, %s for NUA",cumulantName[cumulantIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data()));
6288 fDiffFlowFinalCumulants[t][pW][eW][nua]->Add(fFinalCumulants2D[t][pW][eW][nua][cumulantIndex]);
6289 // pt:
6290 fFinalCumulantsPt[t][pW][eW][nua][cumulantIndex] = (TH1D*)styleHistPt.Clone(Form("%s, (p_{t})",cumulantName[cumulantIndex].Data()));
6291 fFinalCumulantsPt[t][pW][eW][nua][cumulantIndex]->SetTitle(Form("%s (p_{t}): %s, pWeights %s, eWeights %s, %s for NUA",cumulantName[cumulantIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data()));
6292 fDiffFlowFinalCumulants[t][pW][eW][nua]->Add(fFinalCumulantsPt[t][pW][eW][nua][cumulantIndex]);
6293 // eta:
6294 fFinalCumulantsEta[t][pW][eW][nua][cumulantIndex] = (TH1D*)styleHistEta.Clone(Form("%s, (#eta)",cumulantName[cumulantIndex].Data()));
6295 fFinalCumulantsEta[t][pW][eW][nua][cumulantIndex]->SetTitle(Form("%s (#eta): %s, pWeights %s, eWeights %s, %s for NUA",cumulantName[cumulantIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data()));
6296 fDiffFlowFinalCumulants[t][pW][eW][nua]->Add(fFinalCumulantsEta[t][pW][eW][nua][cumulantIndex]);
6297 }
6298 // flow:
6299 for(Int_t flowIndex=0;flowIndex<4;flowIndex++)
6300 {
6301 // 2D:
6302 fFinalFlow2D[t][pW][eW][nua][flowIndex] = (TH2D*)styleHistPtEta.Clone(Form("%s, (p_{t},#eta)",flowName[flowIndex].Data()));
6303 fFinalFlow2D[t][pW][eW][nua][flowIndex]->SetTitle(Form("%s (p_{t},#eta): %s, pWeights %s, eWeights %s, %s for NUA",flowName[flowIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data()));
6304 fDiffFlowFinalFlow[t][pW][eW][nua]->Add(fFinalFlow2D[t][pW][eW][nua][flowIndex]);
6305 // pt:
6306 fFinalFlowPt[t][pW][eW][nua][flowIndex] = (TH1D*)styleHistPt.Clone(Form("%s, (p_{t})",flowName[flowIndex].Data()));
6307 fFinalFlowPt[t][pW][eW][nua][flowIndex]->SetTitle(Form("%s (p_{t}): %s, pWeights %s, eWeights %s, %s for NUA",flowName[flowIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data()));
6308 fDiffFlowFinalFlow[t][pW][eW][nua]->Add(fFinalFlowPt[t][pW][eW][nua][flowIndex]);
6309 // eta:
6310 fFinalFlowEta[t][pW][eW][nua][flowIndex] = (TH1D*)styleHistEta.Clone(Form("%s, (#eta)",flowName[flowIndex].Data()));
6311 fFinalFlowEta[t][pW][eW][nua][flowIndex]->SetTitle(Form("%s (#eta): %s, pWeights %s, eWeights %s, %s for NUA",flowName[flowIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data()));
6312 fDiffFlowFinalFlow[t][pW][eW][nua]->Add(fFinalFlowEta[t][pW][eW][nua][flowIndex]);
6313 }
6314 }
6315 }
6316 }
9c1a9547 6317 }
2aa4ebcd 6318
6319 // Event-by-event r_{m*n,k}(pt,eta), p_{m*n,k}(pt,eta) and q_{m*n,k}(pt,eta)
6320 // Explanantion of notation:
6321 // 1.) n is harmonic, m is multiple of harmonic;
6322 // 2.) k is power of weight;
6323 // 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);
6324 // 4.) p_{m*n,k}(pt,eta) = Q-vector evaluated in harmonic m*n for POIs in particular (pt,eta) bin
6325 // (if i-th POI is also RP, than it is weighted with w_i^k);
6326 // 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
6327 // (i-th RP&&POI is weighted with w_i^k)
6328
6329 TProfile2D styleRe("typeMultiplePowerRe","typeMultiplePowerRe",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
6330 TProfile2D styleIm("typeMultiplePowerIm","typeMultiplePowerIm",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
6331
6332 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
6333 {
6334 for(Int_t m=0;m<4;m++)
9c1a9547 6335 {
2aa4ebcd 6336 for(Int_t k=0;k<9;k++)
6337 {
6338 fReEBE[t][m][k] = (TProfile2D*)styleRe.Clone(Form("typeFlag%dmultiple%dpower%dRe",t,m,k));
6339 fImEBE[t][m][k] = (TProfile2D*)styleIm.Clone(Form("typeFlag%dmultiple%dpower%dIm",t,m,k));
6340 }
6341 }
6342 }
6343
6344 TProfile2D styleS("typePower","typePower",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
6345
6346 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
6347 {
6348 for(Int_t k=0;k<9;k++)
9c1a9547 6349 {
2aa4ebcd 6350 fs[t][k] = (TProfile2D*)styleS.Clone(Form("typeFlag%dpower%d",t,k));
9c1a9547 6351 }
6352 }
2aa4ebcd 6353
6354} // end of AliFlowAnalysisWithQCumulants::BookEverythingForDifferentialFlow()
9c1a9547 6355
6356
2aa4ebcd 6357//================================================================================================================================
9c1a9547 6358
6359
2aa4ebcd 6360void AliFlowAnalysisWithQCumulants::CalculateCorrelationsForDifferentialFlow(TString type)
9c1a9547 6361{
2aa4ebcd 6362 // calculate all reduced correlations needed for differential flow for each (pt,eta) bin:
3d824203 6363
2aa4ebcd 6364 Int_t typeFlag = -1;
6365
6366 // reduced correlations ares stored in fCorrelationsPro[t][pW][index] and are indexed as follows:
6367 // index:
6368 // 0: <2'>
6369 // 1: <4'>
3c16adde 6370
2aa4ebcd 6371 // multiplicity:
6372 Double_t dMult = (*fSMpk)(0,0);
3c16adde 6373
2aa4ebcd 6374 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
6375 Double_t dReQ1n = (*fReQ)(0,0);
6376 Double_t dReQ2n = (*fReQ)(1,0);
6377 //Double_t dReQ3n = (*fReQ)(2,0);
6378 //Double_t dReQ4n = (*fReQ)(3,0);
6379 Double_t dImQ1n = (*fImQ)(0,0);
6380 Double_t dImQ2n = (*fImQ)(1,0);
6381 //Double_t dImQ3n = (*fImQ)(2,0);
6382 //Double_t dImQ4n = (*fImQ)(3,0);
3c16adde 6383
2aa4ebcd 6384 // looping over all (pt,eta) bins and calculating correlations needed for differential flow:
6385 for(Int_t p=1;p<=fnBinsPt;p++)
3c16adde 6386 {
2aa4ebcd 6387 for(Int_t e=1;e<=fnBinsEta;e++)
3c16adde 6388 {
2aa4ebcd 6389 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin):
6390 Double_t p1n0kRe = 0.;
6391 Double_t p1n0kIm = 0.;
6392
6393 // number of POIs in particular (pt,eta) bin:
6394 Double_t mp = 0.;
6395
6396 // 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):
6397 Double_t q1n0kRe = 0.;
6398 Double_t q1n0kIm = 0.;
6399 Double_t q2n0kRe = 0.;
6400 Double_t q2n0kIm = 0.;
6401
6402 // number of particles which are both RPs and POIs in particular (pt,eta) bin:
6403 Double_t mq = 0.;
6404
6405 // q_{m*n,0}:
6406 q1n0kRe = fReEBE[2][0][0]->GetBinContent(fReEBE[2][0][0]->GetBin(p,e))
6407 * fReEBE[2][0][0]->GetBinEntries(fReEBE[2][0][0]->GetBin(p,e));
6408 q1n0kIm = fImEBE[2][0][0]->GetBinContent(fImEBE[2][0][0]->GetBin(p,e))
6409 * fImEBE[2][0][0]->GetBinEntries(fImEBE[2][0][0]->GetBin(p,e));
6410 q2n0kRe = fReEBE[2][1][0]->GetBinContent(fReEBE[2][1][0]->GetBin(p,e))
6411 * fReEBE[2][1][0]->GetBinEntries(fReEBE[2][1][0]->GetBin(p,e));
6412 q2n0kIm = fImEBE[2][1][0]->GetBinContent(fImEBE[2][1][0]->GetBin(p,e))
6413 * fImEBE[2][1][0]->GetBinEntries(fImEBE[2][1][0]->GetBin(p,e));
6414
6415 mq = fReEBE[2][0][0]->GetBinEntries(fReEBE[2][0][0]->GetBin(p,e)); // to be improved (cross-checked by accessing other profiles here)
6416
6417 if(type == "POI")
3c16adde 6418 {
2aa4ebcd 6419 // p_{m*n,0}:
6420 p1n0kRe = fReEBE[1][0][0]->GetBinContent(fReEBE[1][0][0]->GetBin(p,e))
6421 * fReEBE[1][0][0]->GetBinEntries(fReEBE[1][0][0]->GetBin(p,e));
6422 p1n0kIm = fImEBE[1][0][0]->GetBinContent(fImEBE[1][0][0]->GetBin(p,e))
6423 * fImEBE[1][0][0]->GetBinEntries(fImEBE[1][0][0]->GetBin(p,e));
6424
6425 mp = fReEBE[1][0][0]->GetBinEntries(fReEBE[1][0][0]->GetBin(p,e)); // to be improved (cross-checked by accessing other profiles here)
6426
6427 typeFlag = 1;
6428 }
6429 else if(type == "RP")
6430 {
6431 // p_{m*n,0} = q_{m*n,0}:
6432 p1n0kRe = q1n0kRe;
6433 p1n0kIm = q1n0kIm;
6434 mp = mq;
6435
6436 typeFlag = 0;
6437 }
6438
6439 // count events with non-empty (pt,eta) bin:
6440 if(mp>0)
6441 {
6442 fNonEmptyBins2D[typeFlag]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,1);
6443 }
6444
6445 // 2'-particle correlation for particular (pt,eta) bin:
6446 Double_t two1n1nPtEta = 0.;
6447 if(mp*dMult-mq)
6448 {
6449 two1n1nPtEta = (p1n0kRe*dReQ1n+p1n0kIm*dImQ1n-mq)
6450 / (mp*dMult-mq);
6451
6452 // fill the 2D profile to get the average correlation for each (pt,eta) bin:
6453 if(type == "POI")
6454 {
6455 //f2pPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);
6456
6457 fCorrelationsPro[1][0][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);
6458 }
6459 else if(type == "RP")
3c16adde 6460 {
2aa4ebcd 6461 //f2pPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);
6462 fCorrelationsPro[0][0][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);
6463 }
6464 } // end of if(mp*dMult-mq)
6465
6466 // 4'-particle correlation:
6467 Double_t four1n1n1n1nPtEta = 0.;
6468 if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6469 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)
6470 {
6471 four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6472 - q2n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))
6473 - 2.*q2n0kIm*dReQ1n*dImQ1n
6474 - p1n0kRe*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)
6475 + p1n0kIm*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)
6476 - 2.*dMult*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6477 - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*mq
6478 + 6.*(q1n0kRe*dReQ1n+q1n0kIm*dImQ1n)
6479 + 1.*(q2n0kRe*dReQ2n+q2n0kIm*dImQ2n)
6480 + 2.*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6481 + 2.*mq*dMult
6482 - 6.*mq)
6483 / ((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6484 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
6485
6486 // fill the 2D profile to get the average correlation for each (pt, eta) bin:
6487 if(type == "POI")
6488 {
6489 //f4pPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
6490 // (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6491 // + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
6492
6493 fCorrelationsPro[1][0][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
6494 (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6495 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
6496 }
6497 else if(type == "RP")
6498 {
6499 //f4pPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
6500 // (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6501 // + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
6502
6503 fCorrelationsPro[0][0][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
6504 (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6505 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
6506 }
6507 } // end of if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6508 // +mq*(dMult-1.)*(dMult-2.)*(dMult-3.))
6509
6510 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
6511 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
9c1a9547 6512
2aa4ebcd 6513} // end of AliFlowAnalysisWithQCumulants::CalculateCorrelationsForDifferentialFlow()
9c1a9547 6514
9c1a9547 6515
2aa4ebcd 6516//================================================================================================================================
6517
6518
6519void AliFlowAnalysisWithQCumulants::CalculateWeightedCorrelationsForDifferentialFlow(TString type)
6520{
6521 // calculate all weighted correlations needed for differential flow
6522
6523 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
6524 Double_t dReQ1n1k = (*fReQ)(0,1);
6525 Double_t dReQ2n2k = (*fReQ)(1,2);
6526 Double_t dReQ1n3k = (*fReQ)(0,3);
6527 //Double_t dReQ4n4k = (*fReQ)(3,4);
6528 Double_t dImQ1n1k = (*fImQ)(0,1);
6529 Double_t dImQ2n2k = (*fImQ)(1,2);
6530 Double_t dImQ1n3k = (*fImQ)(0,3);
6531 //Double_t dImQ4n4k = (*fImQ)(3,4);
9c1a9547 6532
2aa4ebcd 6533 // S^M_{p,k} (see .h file for the definition of fSMpk):
6534 Double_t dSM1p1k = (*fSMpk)(0,1);
6535 Double_t dSM1p2k = (*fSMpk)(0,2);
6536 Double_t dSM1p3k = (*fSMpk)(0,3);
6537 Double_t dSM2p1k = (*fSMpk)(1,1);
6538 Double_t dSM3p1k = (*fSMpk)(2,1);
6539
6540 // looping over all (pt,eta) bins and calculating weighted correlations needed for differential flow:
6541 for(Int_t p=1;p<=fnBinsPt;p++)
9c1a9547 6542 {
2aa4ebcd 6543 for(Int_t e=1;e<=fnBinsEta;e++)
9c1a9547 6544 {
2aa4ebcd 6545 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin):
6546 Double_t p1n0kRe = 0.;
6547 Double_t p1n0kIm = 0.;
6548
6549 // number of POIs in particular (pt,eta) bin):
6550 Double_t mp = 0.;
6551
6552 // real and imaginary parts of q_{m*n,k}:
6553 // (weighted Q-vector evaluated for particles which are both RPs and POIs in particular (pt,eta) bin)
6554 Double_t q1n2kRe = 0.;
6555 Double_t q1n2kIm = 0.;
6556 Double_t q2n1kRe = 0.;
6557 Double_t q2n1kIm = 0.;
6558
6559 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
6560 Double_t s1p1k = 0.;
6561 Double_t s1p2k = 0.;
6562 Double_t s1p3k = 0.;
2bdc5281 6563
2aa4ebcd 6564 // M0111 from Eq. (118) in QC2c (to be improved (notation))
6565 Double_t dM0111 = 0.;
6566
6567 if(type == "POI")
2bdc5281 6568 {
2aa4ebcd 6569 // p_{m*n,0}:
6570 p1n0kRe = fReEBE[1][0][0]->GetBinContent(fReEBE[1][0][0]->GetBin(p,e))
6571 * fReEBE[1][0][0]->GetBinEntries(fReEBE[1][0][0]->GetBin(p,e));
6572 p1n0kIm = fImEBE[1][0][0]->GetBinContent(fImEBE[1][0][0]->GetBin(p,e))
6573 * fImEBE[1][0][0]->GetBinEntries(fImEBE[1][0][0]->GetBin(p,e));
6574
6575 mp = fReEBE[1][0][0]->GetBinEntries(fReEBE[1][0][0]->GetBin(p,e));
6576
6577 // q_{m*n,k}:
6578 q1n2kRe = fReEBE[2][0][2]->GetBinContent(fReEBE[2][0][2]->GetBin(p,e))
6579 * fReEBE[2][0][2]->GetBinEntries(fReEBE[2][0][2]->GetBin(p,e));
6580 q1n2kIm = fImEBE[2][0][2]->GetBinContent(fImEBE[2][0][2]->GetBin(p,e))
6581 * fImEBE[2][0][2]->GetBinEntries(fImEBE[2][0][2]->GetBin(p,e));
6582 q2n1kRe = fReEBE[2][1][1]->GetBinContent(fReEBE[2][1][1]->GetBin(p,e))
6583 * fReEBE[2][1][1]->GetBinEntries(fReEBE[2][1][1]->GetBin(p,e));
6584 q2n1kIm = fImEBE[2][1][1]->GetBinContent(fImEBE[2][1][1]->GetBin(p,e))
6585 * fImEBE[2][1][1]->GetBinEntries(fImEBE[2][1][1]->GetBin(p,e));
6586
6587 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
6588 s1p1k = pow(fs[2][1]->GetBinContent(fs[2][1]->GetBin(p,e)),1.);
6589 s1p2k = pow(fs[2][2]->GetBinContent(fs[2][2]->GetBin(p,e)),1.);
6590 s1p3k = pow(fs[2][3]->GetBinContent(fs[2][3]->GetBin(p,e)),1.);
2bdc5281 6591
2aa4ebcd 6592 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
6593 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
6594 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
6595 + 2.*(s1p3k-s1p2k*dSM1p1k));
6596 }
6597 else if(type == "RP")
9c1a9547 6598 {
2aa4ebcd 6599 p1n0kRe = fReEBE[0][0][0]->GetBinContent(fReEBE[0][0][0]->GetBin(p,e))
6600 * fReEBE[0][0][0]->GetBinEntries(fReEBE[0][0][0]->GetBin(p,e));
6601 p1n0kIm = fImEBE[0][0][0]->GetBinContent(fImEBE[0][0][0]->GetBin(p,e))
6602 * fImEBE[0][0][0]->GetBinEntries(fImEBE[0][0][0]->GetBin(p,e));
6603
6604 mp = fReEBE[0][0][0]->GetBinEntries(fReEBE[0][0][0]->GetBin(p,e));
6605
6606 // q_{m*n,k}:
6607 q1n2kRe = fReEBE[0][0][2]->GetBinContent(fReEBE[0][0][2]->GetBin(p,e))
6608 * fReEBE[0][0][2]->GetBinEntries(fReEBE[0][0][2]->GetBin(p,e));
6609 q1n2kIm = fImEBE[0][0][2]->GetBinContent(fImEBE[0][0][2]->GetBin(p,e))
6610 * fImEBE[0][0][2]->GetBinEntries(fImEBE[0][0][2]->GetBin(p,e));
6611 q2n1kRe = fReEBE[0][1][1]->GetBinContent(fReEBE[0][1][1]->GetBin(p,e))
6612 * fReEBE[0][1][1]->GetBinEntries(fReEBE[0][1][1]->GetBin(p,e));
6613 q2n1kIm = fImEBE[0][1][1]->GetBinContent(fImEBE[0][1][1]->GetBin(p,e))
6614 * fImEBE[0][1][1]->GetBinEntries(fImEBE[0][1][1]->GetBin(p,e));
6615
6616 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
6617 s1p1k = pow(fs[0][1]->GetBinContent(fs[0][1]->GetBin(p,e)),1.);
6618 s1p2k = pow(fs[0][2]->GetBinContent(fs[0][2]->GetBin(p,e)),1.);
6619 s1p3k = pow(fs[0][3]->GetBinContent(fs[0][3]->GetBin(p,e)),1.);
6620
6621 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
6622 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
6623 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
6624 + 2.*(s1p3k-s1p2k*dSM1p1k));
6625 //...............................................................................................
9c1a9547 6626 }
6627
2aa4ebcd 6628 // 2'-particle correlation:
6629 Double_t two1n1nW0W1PtEta = 0.;
6630 if(mp*dSM1p1k-s1p1k)
9c1a9547 6631 {
2aa4ebcd 6632 two1n1nW0W1PtEta = (p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k-s1p1k)
6633 / (mp*dSM1p1k-s1p1k);
6634
6635 // fill the 2D profile to get the average correlation for each (pt, eta) bin:
6636 if(type == "POI")
9c1a9547 6637 {
2aa4ebcd 6638 //f2pPtEtaPOIW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,
6639 // mp*dSM1p1k-s1p1k);
6640 fCorrelationsPro[1][1][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,mp*dSM1p1k-s1p1k);
9c1a9547 6641 }
2aa4ebcd 6642 else if(type == "RP")
6643 {
6644 //f2pPtEtaRPW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,
6645 // mp*dSM1p1k-s1p1k);
6646 fCorrelationsPro[0][1][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,mp*dSM1p1k-s1p1k);
6647 }
6648 } // end of if(mp*dMult-dmPrimePrimePtEta)
9c1a9547 6649
2aa4ebcd 6650 // 4'-particle correlation:
6651 Double_t four1n1n1n1nW0W1W1W1PtEta = 0.;
6652 if(dM0111)
6653 {
6654 four1n1n1n1nW0W1W1W1PtEta = ((pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
6655 - q2n1kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))
6656 - 2.*q2n1kIm*dReQ1n1k*dImQ1n1k
6657 - p1n0kRe*(dReQ1n1k*dReQ2n2k+dImQ1n1k*dImQ2n2k)
6658 + p1n0kIm*(dImQ1n1k*dReQ2n2k-dReQ1n1k*dImQ2n2k)
6659 - 2.*dSM1p2k*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
6660 - 2.*(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*s1p1k
6661 + 6.*(q1n2kRe*dReQ1n1k+q1n2kIm*dImQ1n1k)
6662 + 1.*(q2n1kRe*dReQ2n2k+q2n1kIm*dImQ2n2k)
6663 + 2.*(p1n0kRe*dReQ1n3k+p1n0kIm*dImQ1n3k)
6664 + 2.*s1p1k*dSM1p2k
6665 - 6.*s1p3k)
6666 / dM0111; // to be imropoved (notation of dM0111)
9c1a9547 6667
2aa4ebcd 6668 // fill the 2D profile to get the average correlation for each (pt, eta) bin:
6669 if(type == "POI")
2bdc5281 6670 {
2aa4ebcd 6671 //f4pPtEtaPOIW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);
6672 fCorrelationsPro[1][1][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);
2bdc5281 6673 }
2aa4ebcd 6674 else if(type == "RP")
6675 {
6676 //f4pPtEtaRPW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);
6677 fCorrelationsPro[0][1][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);
6678 }
6679 } // end of if(dM0111)
2bdc5281 6680
2aa4ebcd 6681 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
6682 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
2bdc5281 6683
2aa4ebcd 6684} // end of AliFlowAnalysisWithQCumulants::CalculateWeightedCorrelationsForDifferentialFlow(TString type)
6685
6686
6687//================================================================================================================================
6688
6689
6690void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsForDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights)
6691{
6692 // 1.) Access average for 2D correlations from profiles and store them in 2D final results histograms;
6693 // 2.) Access spread for 2D correlations from profiles, calculate error and store it in 2D final results histograms;
6694 // 3.) Make projections along pt and eta axis and store results and errors in 1D final results histograms.
6695
6696 Int_t typeFlag = -1;
6697 Int_t pWeightsFlag = -1;
6698 Int_t eWeightsFlag = -1;
6699
6700 if(type == "RP")
6701 {
6702 typeFlag = 0;
6703 } else if(type == "POI")
9c1a9547 6704 {
2aa4ebcd 6705 typeFlag = 1;
6706 } else
6707 {
6708 cout<<"WARNING: type must be either RP or POI in AFAWQC::FCFDF() !!!!"<<endl;
6709 exit(0);
6710 }
6711
6712 if(!useParticleWeights)
6713 {
6714 pWeightsFlag = 0;
6715 } else
9c1a9547 6716 {
2aa4ebcd 6717 pWeightsFlag = 1;
6718 }
9c1a9547 6719
2aa4ebcd 6720 if(eventWeights == "exact")
6721 {
6722 eWeightsFlag = 0;
6723 }
6724
6725 // shortcuts:
6726 Int_t t = typeFlag;
6727 Int_t pW = pWeightsFlag;
6728 Int_t eW = eWeightsFlag;
6729
6730 // from 2D histogram fNonEmptyBins2D make two 1D histograms fNonEmptyBins1D in pt and eta (to be improved (i.e. moved somewhere else))
6731 // pt:
6732 for(Int_t p=1;p<fnBinsPt;p++)
6733 {
6734 Double_t contentPt = 0.;
6735 for(Int_t e=1;e<=fnBinsEta;e++)
6736 {
6737 contentPt += (fNonEmptyBins2D[t]->GetBinContent(fNonEmptyBins2D[t]->GetBin(p,e)));
6738 }
6739 fNonEmptyBins1D[t][0]->SetBinContent(p,contentPt);
6740 }
6741 // eta:
6742 for(Int_t e=1;e<fnBinsEta;e++)
6743 {
6744 Double_t contentEta = 0.;
6745 for(Int_t p=1;p<=fnBinsPt;p++)
6746 {
6747 contentEta += (fNonEmptyBins2D[t]->GetBinContent(fNonEmptyBins2D[t]->GetBin(p,e)));
9c1a9547 6748 }
2aa4ebcd 6749 fNonEmptyBins1D[t][1]->SetBinContent(e,contentEta);
6750 }
6751
6752 // from 2D profile in (pt,eta) make two 1D profiles in (pt) and (eta):
6753 TProfile *profile[2][4]; // [0=pt,1=eta][correlation index] // to be improved (do not hardwire the correlation index)
6754
6755 for(Int_t pe=0;pe<2;pe++) // pt or eta
6756 {
6757 for(Int_t ci=0;ci<4;ci++) // correlation index
6758 {
6759 if(pe==0) profile[pe][ci] = this->MakePtProjection(fCorrelationsPro[t][pW][eW][ci]);
6760 if(pe==1) profile[pe][ci] = this->MakeEtaProjection(fCorrelationsPro[t][pW][eW][ci]);
6761 }
6762 }
9c1a9547 6763
2aa4ebcd 6764 // transfer 2D profile into 2D histogram:
6765 // to be improved (see in documentation if there is a method to transfer values from 2D profile into 2D histogram)
6766 for(Int_t ci=0;ci<4;ci++)
6767 {
6768 for(Int_t p=1;p<=fnBinsPt;p++)
9c1a9547 6769 {
2aa4ebcd 6770 for(Int_t e=1;e<=fnBinsEta;e++)
9c1a9547 6771 {
2aa4ebcd 6772 Double_t correlation = fCorrelationsPro[t][pW][eW][ci]->GetBinContent(fCorrelationsPro[t][pW][eW][ci]->GetBin(p,e));
6773 Double_t spread = fCorrelationsPro[t][pW][eW][ci]->GetBinError(fCorrelationsPro[t][pW][eW][ci]->GetBin(p,e));
6774 Double_t nEvts = fNonEmptyBins2D[t]->GetBinContent(fNonEmptyBins2D[t]->GetBin(p,e));
6775 Double_t error = 0.;
6776 fFinalCorrelations2D[t][pW][eW][ci]->SetBinContent(fFinalCorrelations2D[t][pW][eW][ci]->GetBin(p,e),correlation);
6777 if(nEvts>0)
3c16adde 6778 {
2aa4ebcd 6779 error = spread/pow(nEvts,0.5);
6780 fFinalCorrelations2D[t][pW][eW][ci]->SetBinError(fFinalCorrelations2D[t][pW][eW][ci]->GetBin(p,e),error);
3c16adde 6781 }
2aa4ebcd 6782 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
6783 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
6784 } // end of for(Int_t ci=0;ci<4;ci++)
6785
6786 // transfer 1D profile into 1D histogram (pt):
6787 // to be improved (see in documentation if there is a method to transfer values from 1D profile into 1D histogram)
6788 for(Int_t ci=0;ci<4;ci++)
6789 {
6790 for(Int_t p=1;p<=fnBinsPt;p++)
6791 {
6792 if(profile[0][ci])
6793 {
6794 Double_t correlation = profile[0][ci]->GetBinContent(p);
6795 Double_t spread = profile[0][ci]->GetBinError(p);
6796 Double_t nEvts = fNonEmptyBins1D[t][0]->GetBinContent(p);
6797 Double_t error = 0.;
6798 fFinalCorrelations1D[t][pW][eW][0][ci]->SetBinContent(p,correlation);
6799 if(nEvts>0)
9c1a9547 6800 {
2aa4ebcd 6801 error = spread/pow(nEvts,0.5);
6802 fFinalCorrelations1D[t][pW][eW][0][ci]->SetBinError(p,error);
6803 }
6804 }
6805 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
6806 } // end of for(Int_t ci=0;ci<4;ci++)
6807
6808 // transfer 1D profile into 1D histogram (eta):
6809 // to be improved (see in documentation if there is a method to transfer values from 1D profile into 1D histogram)
6810 for(Int_t ci=0;ci<4;ci++)
6811 {
6812 for(Int_t e=1;e<=fnBinsEta;e++)
6813 {
6814 if(profile[1][ci])
6815 {
6816 Double_t correlation = profile[1][ci]->GetBinContent(e);
6817 fFinalCorrelations1D[t][pW][eW][1][ci]->SetBinContent(e,correlation);
6818 }
6819 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
6820 } // end of for(Int_t ci=0;ci<4;ci++)
9c1a9547 6821
2aa4ebcd 6822} // end of void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsForDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights)
6823
6824
6825//================================================================================================================================
6826
6827
6828void AliFlowAnalysisWithQCumulants::CalculateCumulantsForDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights)
6829{
6830 // calcualate cumulants for differential flow from measured correlations
6831 // Remark: cumulants calculated here are NOT corrected for non-uniform acceptance. This correction is applied in the method ...
6832
6833 Int_t typeFlag = -1;
6834 Int_t pWeightsFlag = -1;
6835 Int_t eWeightsFlag = -1;
6836
6837 if(type == "RP")
6838 {
6839 typeFlag = 0;
6840 } else if(type == "POI")
6841 {
6842 typeFlag = 1;
6843 } else
6844 {
6845 cout<<"WARNING: type must be either RP or POI in AFAWQC::CCFDF() !!!!"<<endl;
6846 exit(0);
6847 }
6848
6849 if(!useParticleWeights)
6850 {
6851 pWeightsFlag = 0;
6852 } else
6853 {
6854 pWeightsFlag = 1;
6855 }
6856
6857 if(eventWeights == "exact")
6858 {
6859 eWeightsFlag = 0;
6860 }
6861
6862 // shortcuts:
6863 Int_t t = typeFlag;
6864 Int_t pW = pWeightsFlag;
6865 Int_t eW = eWeightsFlag;
3d824203 6866
2aa4ebcd 6867 // correlation <<2>>:
6868 Double_t two = fQCorrelations[pW][eW]->GetBinContent(1);
6869
6870 // 2D (pt,eta):
6871 // to be improved (see documentation if I can do all this without looping)
6872 for(Int_t p=1;p<=fnBinsPt;p++)
6873 {
6874 for(Int_t e=1;e<=fnBinsEta;e++)
6875 {
6876 // reduced correlations:
6877 Double_t twoPrime = fFinalCorrelations2D[t][pW][eW][0]->GetBinContent(fFinalCorrelations2D[t][pW][eW][0]->GetBin(p,e)); // <<2'>>(pt,eta)
6878 Double_t fourPrime = fFinalCorrelations2D[t][pW][eW][1]->GetBinContent(fFinalCorrelations2D[t][pW][eW][1]->GetBin(p,e)); // <<4'>>(pt,eta)
6879 for(Int_t nua=0;nua<2;nua++)
6880 {
6881 // QC{2'}:
6882 Double_t qc2Prime = twoPrime; // QC{2'} = <<2'>>
6883 fFinalCumulants2D[t][pW][eW][nua][0]->SetBinContent(fFinalCumulants2D[t][pW][eW][nua][0]->GetBin(p,e),qc2Prime);
6884 // QC{4'}:
6885 Double_t qc4Prime = fourPrime - 2.*twoPrime*two; // QC{4'} = <<4'>> - 2*<<2'>><<2>>
6886 fFinalCumulants2D[t][pW][eW][nua][1]->SetBinContent(fFinalCumulants2D[t][pW][eW][nua][1]->GetBin(p,e),qc4Prime);
6887 } // end of for(Int_t nua=0;nua<2;nua++)
6888 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
6889 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
3d824203 6890
2aa4ebcd 6891 // 1D (pt):
6892 // to be improved (see documentation if I can do all this without looping)
6893 // to be improved (treat pt and eta in one go)
6894 // to be improved (combine loops over nua for 2D and 1D)
6895 for(Int_t p=1;p<=fnBinsPt;p++)
6896 {
6897 // reduced correlations:
6898 Double_t twoPrime = fFinalCorrelations1D[t][pW][eW][0][0]->GetBinContent(p); // <<2'>>(pt)
6899 Double_t fourPrime = fFinalCorrelations1D[t][pW][eW][0][1]->GetBinContent(p); // <<4'>>(pt)
6900 // spread of reduced correlations:
6901 Double_t twoPrimeError = fFinalCorrelations1D[t][pW][eW][0][0]->GetBinError(p); // sigma_2'/sqrt{N_2'}(pt)
6902 for(Int_t nua=0;nua<2;nua++)
6903 {
6904 // QC{2'}:
6905 Double_t qc2Prime = twoPrime; // QC{2'}
6906 Double_t qc2PrimeError = twoPrimeError; // sigma_{d_n{2}}/sqrt{N_2'} // to be improved
6907 fFinalCumulantsPt[t][pW][eW][nua][0]->SetBinContent(p,qc2Prime);
6908 fFinalCumulantsPt[t][pW][eW][nua][0]->SetBinError(p,qc2PrimeError);
6909 // QC{4'}:
6910 Double_t qc4Prime = fourPrime - 2.*twoPrime*two; // QC{4'} = <<4'>> - 2*<<2'>><<2>>
6911 fFinalCumulantsPt[t][pW][eW][nua][1]->SetBinContent(p,qc4Prime);
6912 } // end of for(Int_t nua=0;nua<2;nua++)
6913 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
6914
6915
6916 // 1D (eta):
6917 // to be improved (see documentation if I can do all this without looping)
6918 // to be improved (treat pt and eta in one go)
6919 // to be improved (combine loops over nua for 2D and 1D)
6920 for(Int_t e=1;e<=fnBinsEta;e++)
6921 {
6922 // reduced correlations:
6923 Double_t twoPrime = fFinalCorrelations1D[t][pW][eW][1][0]->GetBinContent(e); // <<2'>>(eta)
6924 Double_t fourPrime = fFinalCorrelations1D[t][pW][eW][1][1]->GetBinContent(e); // <<4'>>(eta)
6925 for(Int_t nua=0;nua<2;nua++)
6926 {
6927 // QC{2'}:
6928 Double_t qc2Prime = twoPrime; // QC{2'}
6929 fFinalCumulantsEta[t][pW][eW][nua][0]->SetBinContent(e,qc2Prime);
6930 // QC{4'}:
6931 Double_t qc4Prime = fourPrime - 2.*twoPrime*two; // QC{4'} = <<4'>> - 2*<<2'>><<2>>
6932 fFinalCumulantsEta[t][pW][eW][nua][1]->SetBinContent(e,qc4Prime);
6933 } // end of for(Int_t nua=0;nua<2;nua++)
6934 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
6935
6936
6937} // end of void AliFlowAnalysisWithQCumulants::CalculateCumulantsForDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights);
6938
6939
6940//================================================================================================================================
6941
6942
6943void AliFlowAnalysisWithQCumulants::CalculateDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights)
6944{
6945 // calculate differential flow from differential cumulants and previously obtained integrated flow:
6946
6947 Int_t typeFlag = -1;
6948 Int_t pWeightsFlag = -1;
6949 Int_t eWeightsFlag = -1;
6950
6951 if(type == "RP")
6952 {
6953 typeFlag = 0;
6954 } else if(type == "POI")
6955 {
6956 typeFlag = 1;
6957 } else
6958 {
6959 cout<<"WARNING: type must be either RP or POI in AFAWQC::CDF() !!!!"<<endl;
6960 exit(0);
6961 }
6962
6963 if(!useParticleWeights)
6964 {
6965 pWeightsFlag = 0;
6966 } else
6967 {
6968 pWeightsFlag = 1;
6969 }
6970
6971 if(eventWeights == "exact")
6972 {
6973 eWeightsFlag = 0;
6974 }
6975
6976 // shortcuts:
6977 Int_t t = typeFlag;
6978 Int_t pW = pWeightsFlag;
6979 Int_t eW = eWeightsFlag;
6980
6981 // integrated flow:
6982 Double_t v2 = 0.;
6983 Double_t v4 = 0.;
6984
6985 if(pW == 0)
6986 {
6987 v2 = fIntFlow[pW][eW][1]->GetBinContent(1);
6988 v4 = fIntFlow[pW][eW][1]->GetBinContent(2);
6989 }
6990
6991 if(pW == 1)
9c1a9547 6992 {
2aa4ebcd 6993 v2 = fIntFlow[pW][eW][0]->GetBinContent(1);
6994 v4 = fIntFlow[pW][eW][0]->GetBinContent(2);
6995 }
3d824203 6996
2aa4ebcd 6997 // 2D:
6998 for(Int_t nua=0;nua<2;nua++)
6999 {
7000 for(Int_t p=1;p<=fnBinsPt;p++)
2bdc5281 7001 {
2aa4ebcd 7002 for(Int_t e=1;e<=fnBinsEta;e++)
7003 {
7004 // differential cumulants:
7005 Double_t qc2Prime = fFinalCumulants2D[t][pW][eW][nua][0]->GetBinContent(fFinalCumulants2D[t][pW][eW][nua][0]->GetBin(p,e)); // QC{2'}
7006 Double_t qc4Prime = fFinalCumulants2D[t][pW][eW][nua][1]->GetBinContent(fFinalCumulants2D[t][pW][eW][nua][1]->GetBin(p,e)); // QC{4'}
7007 // differential flow:
7008 Double_t v2Prime = 0.;
7009 Double_t v4Prime = 0.;
7010 if(v2)
2bdc5281 7011 {
2aa4ebcd 7012 v2Prime = qc2Prime/v2;
7013 fFinalFlow2D[t][pW][eW][nua][0]->SetBinContent(fFinalFlow2D[t][pW][eW][nua][0]->GetBin(p,e),v2Prime);
7014 }
7015 if(v4)
7016 {
7017 v4Prime = -qc4Prime/pow(v4,3.);
7018 fFinalFlow2D[t][pW][eW][nua][1]->SetBinContent(fFinalFlow2D[t][pW][eW][nua][1]->GetBin(p,e),v4Prime);
7019 }
7020 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
7021 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
7022 } // end of for(Int_t nua=0;nua<2;nua++)
7023
7024 // 1D (pt): // to be improved (combined with eta, combined nua loop with 2D)
7025 for(Int_t nua=0;nua<2;nua++)
7026 {
7027 for(Int_t p=1;p<=fnBinsPt;p++)
9c1a9547 7028 {
2aa4ebcd 7029 // differential cumulants:
7030 Double_t qc2Prime = fFinalCumulantsPt[t][pW][eW][nua][0]->GetBinContent(p); // QC{2'}
7031 Double_t qc4Prime = fFinalCumulantsPt[t][pW][eW][nua][1]->GetBinContent(p); // QC{4'}
7032 // differential flow:
7033 Double_t v2Prime = 0.;
7034 Double_t v4Prime = 0.;
7035 if(v2)
9c1a9547 7036 {
2aa4ebcd 7037 v2Prime = qc2Prime/v2;
7038 fFinalFlowPt[t][pW][eW][nua][0]->SetBinContent(p,v2Prime);
7039 }
7040 if(v4)
9c1a9547 7041 {
2aa4ebcd 7042 v4Prime = -qc4Prime/pow(v4,3.);
7043 fFinalFlowPt[t][pW][eW][nua][1]->SetBinContent(p,v4Prime);
7044 }
7045 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
7046 } // end of for(Int_t nua=0;nua<2;nua++)
7047
7048 // 1D (eta): // to be improved (combined with pt, combined nua loop with 2D)
7049 for(Int_t nua=0;nua<2;nua++)
7050 {
7051 for(Int_t e=1;e<=fnBinsEta;e++)
9c1a9547 7052 {
2aa4ebcd 7053 // differential cumulants:
7054 Double_t qc2Prime = fFinalCumulantsEta[t][pW][eW][nua][0]->GetBinContent(e); // QC{2'}
7055 Double_t qc4Prime = fFinalCumulantsEta[t][pW][eW][nua][1]->GetBinContent(e); // QC{4'}
7056 // differential flow:
7057 Double_t v2Prime = 0.;
7058 Double_t v4Prime = 0.;
7059 if(v2)
9c1a9547 7060 {
2aa4ebcd 7061 v2Prime = qc2Prime/v2;
7062 fFinalFlowEta[t][pW][eW][nua][0]->SetBinContent(e,v2Prime);
7063 }
7064 if(v4)
7065 {
7066 v4Prime = -qc4Prime/pow(v4,3.);
7067 fFinalFlowEta[t][pW][eW][nua][1]->SetBinContent(e,v4Prime);
7068 }
7069 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
7070 } // end of for(Int_t nua=0;nua<2;nua++)
3d824203 7071
2aa4ebcd 7072} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlow(TString type, Bool_t useParticleWeights)
bc92c0cb 7073
bc92c0cb 7074
9c1a9547 7075//================================================================================================================================
bc92c0cb 7076
9c1a9547 7077
2aa4ebcd 7078void AliFlowAnalysisWithQCumulants::CalculateFinalResultsForRPandPOIIntegratedFlow(TString type, Bool_t useParticleWeights, TString eventWeights)
bc92c0cb 7079{
2aa4ebcd 7080 // calculate final results for integrated flow of RPs and POIs
77515452 7081
2aa4ebcd 7082 Int_t typeFlag = -1;
7083 Int_t pWeightsFlag = -1;
7084 Int_t eWeightsFlag = -1;
7085
7086 if(type == "RP")
9c1a9547 7087 {
2aa4ebcd 7088 typeFlag = 0;
7089 } else if(type == "POI")
7090 {
7091 typeFlag = 1;
7092 } else
7093 {
7094 cout<<"WARNING: type must be either RP or POI in AFAWQC::CDF() !!!!"<<endl;
7095 exit(0);
7096 }
7097
7098 if(!useParticleWeights)
77515452 7099 {
2aa4ebcd 7100 pWeightsFlag = 0;
7101 } else
7102 {
7103 pWeightsFlag = 1;
7104 }
9c1a9547 7105
2aa4ebcd 7106 if(eventWeights == "exact")
77515452 7107 {
2aa4ebcd 7108 eWeightsFlag = 0;
7109 }
9c1a9547 7110
2aa4ebcd 7111 // shortcuts:
7112 Int_t t = typeFlag;
7113 Int_t pW = pWeightsFlag;
7114 Int_t eW = eWeightsFlag;
7115
7116 // pt yield:
7117 TH1F *yield2ndPt = NULL;
7118 TH1F *yield4thPt = NULL;
7119 TH1F *yield6thPt = NULL;
7120 TH1F *yield8thPt = NULL;
9c1a9547 7121
2aa4ebcd 7122 if(type == "POI")
77515452 7123 {
2aa4ebcd 7124 yield2ndPt = (TH1F*)(fCommonHists2nd->GetHistPtPOI())->Clone();
7125 yield4thPt = (TH1F*)(fCommonHists4th->GetHistPtPOI())->Clone();
7126 yield6thPt = (TH1F*)(fCommonHists6th->GetHistPtPOI())->Clone();
7127 yield8thPt = (TH1F*)(fCommonHists8th->GetHistPtPOI())->Clone();
7128 }
7129 else if(type == "RP")
7130 {
7131 yield2ndPt = (TH1F*)(fCommonHists2nd->GetHistPtRP())->Clone();
7132 yield4thPt = (TH1F*)(fCommonHists4th->GetHistPtRP())->Clone();
7133 yield6thPt = (TH1F*)(fCommonHists6th->GetHistPtRP())->Clone();
7134 yield8thPt = (TH1F*)(fCommonHists8th->GetHistPtRP())->Clone();
7135 }
7136
7137 Int_t nBinsPt = yield2ndPt->GetNbinsX();
7138
7139 TH1D *flow2ndPt = NULL;
7140 TH1D *flow4thPt = NULL;
7141 TH1D *flow6thPt = NULL;
7142 TH1D *flow8thPt = NULL;
7143
7144 // to be improve (nua = 0 is hardwired)
7145 flow2ndPt = (TH1D*)fFinalFlowPt[t][pW][eW][0][0]->Clone();
7146 flow4thPt = (TH1D*)fFinalFlowPt[t][pW][eW][0][1]->Clone();
7147 flow6thPt = (TH1D*)fFinalFlowPt[t][pW][eW][0][2]->Clone();
7148 flow8thPt = (TH1D*)fFinalFlowPt[t][pW][eW][0][3]->Clone();
7149
7150 Double_t dvn2nd = 0., dvn4th = 0., dvn6th = 0., dvn8th = 0.; // differential flow
7151 Double_t dVn2nd = 0., dVn4th = 0., dVn6th = 0., dVn8th = 0.; // integrated flow
7152 //Double_t dSd2nd = 0., dSd4th = 0., dSd6th = 0., dSd8th = 0.; // error on integrated flow (to be improved - calculation needed)
7153
7154 Double_t dYield2nd = 0., dYield4th = 0., dYield6th = 0., dYield8th = 0.; // pt yield
7155 Double_t dSum2nd = 0., dSum4th = 0., dSum6th = 0., dSum8th = 0.; // needed for normalizing integrated flow
9c1a9547 7156
2aa4ebcd 7157 // looping over pt bins:
7158 for(Int_t p=1;p<nBinsPt+1;p++)
77515452 7159 {
2aa4ebcd 7160 dvn2nd = flow2ndPt->GetBinContent(p);
7161 dvn4th = flow4thPt->GetBinContent(p);
7162 dvn6th = flow6thPt->GetBinContent(p);
7163 dvn8th = flow8thPt->GetBinContent(p);
7164
7165 dYield2nd = yield2ndPt->GetBinContent(p);
7166 dYield4th = yield4thPt->GetBinContent(p);
7167 dYield6th = yield6thPt->GetBinContent(p);
7168 dYield8th = yield8thPt->GetBinContent(p);
9c1a9547 7169
2aa4ebcd 7170 dVn2nd += dvn2nd*dYield2nd;
7171 dVn4th += dvn4th*dYield4th;
7172 dVn6th += dvn6th*dYield6th;
7173 dVn8th += dvn8th*dYield8th;
9c1a9547 7174
2aa4ebcd 7175 dSum2nd += dYield2nd;
7176 dSum4th += dYield4th;
7177 dSum6th += dYield6th;
7178 dSum8th += dYield8th;
7179
7180 // ... to be improved - errors needed to be calculated
7181
7182 } // end of for(Int_t p=1;p<nBinsPt+1;p++)
7183
7184 // normalizing the results for integrated flow:
7185
7186
7187
7188
7189
7190 if(dSum2nd) dVn2nd/=dSum2nd;
7191 if(dSum4th) dVn4th/=dSum4th;
7192 //if(dSum6th) dVn6th/=dSum6th;
7193 //if(dSum8th) dVn8th/=dSum8th;
7194
7195 /*
7196 // storing the results for integrated flow:
7197 if(!(useParticleWeights))
9c1a9547 7198 {
2aa4ebcd 7199 if(type == "POI")
9c1a9547 7200 {
2aa4ebcd 7201 // 2nd:
7202 fIntFlowResultsPOIQC->SetBinContent(1,dVn2nd);
7203 fIntFlowResultsPOIQC->SetBinError(1,dSd2nd);
7204 // 4th:
7205 fIntFlowResultsPOIQC->SetBinContent(2,dVn4th);
7206 fIntFlowResultsPOIQC->SetBinError(2,dSd4th);
7207 // 6th:
7208 fIntFlowResultsPOIQC->SetBinContent(3,dVn6th);
7209 fIntFlowResultsPOIQC->SetBinError(3,dSd6th);
7210 // 8th:
7211 fIntFlowResultsPOIQC->SetBinContent(4,dVn8th);
7212 fIntFlowResultsPOIQC->SetBinError(4,dSd8th);
9c1a9547 7213 }
2aa4ebcd 7214 else if (type == "RP")
9c1a9547 7215 {
2aa4ebcd 7216 // 2nd:
7217 fIntFlowResultsRPQC->SetBinContent(1,dVn2nd);
7218 fIntFlowResultsRPQC->SetBinError(1,dSd2nd);
7219 // 4th:
7220 fIntFlowResultsRPQC->SetBinContent(2,dVn4th);
7221 fIntFlowResultsRPQC->SetBinError(2,dSd4th);
7222 // 6th:
7223 fIntFlowResultsRPQC->SetBinContent(3,dVn6th);
7224 fIntFlowResultsRPQC->SetBinError(3,dSd6th);
7225 // 8th:
7226 fIntFlowResultsRPQC->SetBinContent(4,dVn8th);
7227 fIntFlowResultsRPQC->SetBinError(4,dSd8th);
7228 }
7229 }
7230 else if (useParticleWeights)
9c1a9547 7231 {
2aa4ebcd 7232 if(type == "POI")
7233 {
7234 // 2nd:
7235 fIntFlowResultsPOIQCW->SetBinContent(1,dVn2nd);
7236 fIntFlowResultsPOIQCW->SetBinError(1,dSd2nd);
7237 // 4th:
7238 fIntFlowResultsPOIQCW->SetBinContent(2,dVn4th);
7239 fIntFlowResultsPOIQCW->SetBinError(2,dSd4th);
7240 // 6th:
7241 fIntFlowResultsPOIQCW->SetBinContent(3,dVn6th);
7242 fIntFlowResultsPOIQCW->SetBinError(3,dSd6th);
7243 // 8th:
7244 fIntFlowResultsPOIQCW->SetBinContent(4,dVn8th);
7245 fIntFlowResultsPOIQCW->SetBinError(4,dSd8th);
7246 }
7247 else if (type == "RP")
7248 {
7249 // 2nd:
7250 fIntFlowResultsRPQCW->SetBinContent(1,dVn2nd);
7251 fIntFlowResultsRPQCW->SetBinError(1,dSd2nd);
7252 // 4th:
7253 fIntFlowResultsRPQCW->SetBinContent(2,dVn4th);
7254 fIntFlowResultsRPQCW->SetBinError(2,dSd4th);
7255 // 6th:
7256 fIntFlowResultsRPQCW->SetBinContent(3,dVn6th);
7257 fIntFlowResultsRPQCW->SetBinError(3,dSd6th);
7258 // 8th:
7259 fIntFlowResultsRPQCW->SetBinContent(4,dVn8th);
7260 fIntFlowResultsRPQCW->SetBinError(4,dSd8th);
7261 }
9c1a9547 7262 }
2aa4ebcd 7263 */
7264
7265 // storing the results for integrated flow in common histos:
7266 // to be improved - now they are being filled twice ...
7267 if(type == "POI")
9c1a9547 7268 {
2aa4ebcd 7269 fCommonHistsResults2nd->FillIntegratedFlowPOI(dVn2nd,0.); // to be improved (errors)
7270 fCommonHistsResults4th->FillIntegratedFlowPOI(dVn4th,0.); // to be improved (errors)
7271 fCommonHistsResults6th->FillIntegratedFlowPOI(dVn6th,0.); // to be improved (errors)
7272 fCommonHistsResults8th->FillIntegratedFlowPOI(dVn8th,0.); // to be improved (errors)
7273 }
7274 else if (type == "RP")
9c1a9547 7275 {
2aa4ebcd 7276 fCommonHistsResults2nd->FillIntegratedFlowRP(dVn2nd,0.); // to be improved (errors)
7277 fCommonHistsResults4th->FillIntegratedFlowRP(dVn4th,0.); // to be improved (errors)
7278 fCommonHistsResults6th->FillIntegratedFlowRP(dVn6th,0.); // to be improved (errors)
7279 fCommonHistsResults8th->FillIntegratedFlowRP(dVn8th,0.); // to be improved (errors)
7280 }
7281
7282 delete flow2ndPt;
7283 delete flow4thPt;
7284 //delete flow6thPt;
7285 //delete flow8thPt;
7286
7287 delete yield2ndPt;
7288 delete yield4thPt;
7289 delete yield6thPt;
7290 delete yield8thPt;
9c1a9547 7291
2aa4ebcd 7292} // end of AliFlowAnalysisWithQCumulants::CalculateFinalResultsForRPandPOIIntegratedFlow(TString type, Bool_t useParticleWeights, TString eventWeights)
77515452 7293
77515452 7294
9c1a9547 7295//================================================================================================================================
77515452 7296
9c1a9547 7297
2aa4ebcd 7298void AliFlowAnalysisWithQCumulants::InitializeArraysForDistributions()
77515452 7299{
2aa4ebcd 7300 // initialize arrays used for distributions:
9c1a9547 7301
2aa4ebcd 7302 for(Int_t pW=0;pW<1+(Int_t)(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);pW++) // non-weighted or weighted
77515452 7303 {
2aa4ebcd 7304 for(Int_t eW=0;eW<2;eW++)
7305 {
7306 for(Int_t di=0;di<4;di++) // distribution index
7307 {
7308 fDistributions[pW][eW][di] = NULL;
7309 }
7310 }
77515452 7311 }
9c1a9547 7312
2aa4ebcd 7313} // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForDistributions()
9c1a9547 7314
77515452 7315
9c1a9547 7316//================================================================================================================================
77515452 7317
77515452 7318
2aa4ebcd 7319void AliFlowAnalysisWithQCumulants::BookEverythingForDistributions()
77515452 7320{
2aa4ebcd 7321 // book all histograms for distributions
7322
7323 /*
7324 //weighted <2>_{n|n} distribution
7325 f2pDistribution = new TH1D("f2pDistribution","<2>_{n|n} distribution",100000,-0.02,0.1);
7326 f2pDistribution->SetXTitle("<2>_{n|n}");
7327 f2pDistribution->SetYTitle("Counts");
7328 fHistList->Add(f2pDistribution);
9c1a9547 7329
2aa4ebcd 7330 //weighted <4>_{n,n|n,n} distribution
7331 f4pDistribution = new TH1D("f4pDistribution","<4>_{n,n|n,n} distribution",100000,-0.00025,0.002);
7332 f4pDistribution->SetXTitle("<4>_{n,n|n,n}");
7333 f4pDistribution->SetYTitle("Counts");
7334 fHistList->Add(f4pDistribution);
9c1a9547 7335
2aa4ebcd 7336 //weighted <6>_{n,n,n|n,n,n} distribution
7337 f6pDistribution = new TH1D("f6pDistribution","<6>_{n,n,n|n,n,n} distribution",100000,-0.000005,0.000025);
7338 f6pDistribution->SetXTitle("<6>_{n,n,n|n,n,n}");
7339 f6pDistribution->SetYTitle("Counts");
7340 fHistList->Add(f6pDistribution);
9c1a9547 7341
2aa4ebcd 7342 //weighted <8>_{n,n,n,n|n,n,n,n} distribution
7343 f8pDistribution = new TH1D("f8pDistribution","<8>_{n,n,n,n|n,n,n,n} distribution",100000,-0.000000001,0.00000001);
7344 f8pDistribution->SetXTitle("<8>_{n,n,n,n|n,n,n,n}");
7345 f8pDistribution->SetYTitle("Counts");
7346 fHistList->Add(f8pDistribution);
7347 */
3d824203 7348
2aa4ebcd 7349} // end of void AliFlowAnalysisWithQCumulants::BookEverythingForDistributions()
77515452 7350
7e58a232 7351
9c1a9547 7352//================================================================================================================================
77515452 7353
77515452 7354
2aa4ebcd 7355void AliFlowAnalysisWithQCumulants::BookAndNestAllLists()
77515452 7356{
2aa4ebcd 7357 // book and nest all lists in fHistList
7358
7359 // booking and nesting:
7360 fHistList->Add(fWeightsList);
7361
7362 fIntFlowList = new TList();
7363 fIntFlowList->SetName("Integrated Flow");
7364 fIntFlowList->SetOwner(kTRUE);
7365 fHistList->Add(fIntFlowList);
7366
7367 fIntFlowResults = new TList();
7368 fIntFlowResults->SetName("Results");
7369 fIntFlowResults->SetOwner(kTRUE);
7370 fIntFlowList->Add(fIntFlowResults);
7371
7372 fIntFlowProfiles = new TList();
7373 fIntFlowProfiles->SetName("Profiles");
7374 fIntFlowProfiles->SetOwner(kTRUE);
7375 fIntFlowList->Add(fIntFlowProfiles);
7376
7377 fDiffFlowList = new TList();
7378 fDiffFlowList->SetName("Differential Flow");
7379 fDiffFlowList->SetOwner(kTRUE);
7380 fHistList->Add(fDiffFlowList);
7381
7382 fDiffFlowProfiles = new TList();
7383 fDiffFlowProfiles->SetName("Profiles");
7384 fDiffFlowProfiles->SetOwner(kTRUE);
7385 fDiffFlowList->Add(fDiffFlowProfiles);
7386
7387 fDiffFlowResults = new TList();
7388 fDiffFlowResults->SetName("Results");
7389 fDiffFlowResults->SetOwner(kTRUE);
7390 fDiffFlowList->Add(fDiffFlowResults);
7391
7392 fDistributionsList = new TList();
7393 fDistributionsList->SetName("Distributions");
7394 fDistributionsList->SetOwner(kTRUE);
7395 fHistList->Add(fDistributionsList);
7396
7397 fNestedLoopsList = new TList();
7398 fNestedLoopsList->SetName("Nested Loops");
7399 fNestedLoopsList->SetOwner(kTRUE);
7400 fHistList->Add(fNestedLoopsList);
7401
7402 // flags for naming nested lists:
7403 TList list;
7404 list.SetOwner(kTRUE);
7405 TString typeFlag[2] = {"RP","POI"};
7406 TString pWeightsFlag[2] = {"not used","used"};
7407 TString eWeightsFlag[2] = {"exact","non-exact"};
7408 TString nuaFlag[2] = {"not corrected","corrected"}; // nua = non-uniform acceptance
7409 TString sinCosFlag[2] = {"sin","cos"};
7410
7411 // nested lists in fDiffFlowProfiles (Differential Flow/Profiles):
7412 for(Int_t t=0;t<2;t++) // type: RP or POI
7413 {
7414 fDFPType[t] = (TList*)list.Clone();
7415 fDFPType[t]->SetName(Form("%s",typeFlag[t].Data()));
7416 fDiffFlowProfiles->Add(fDFPType[t]);
7417 for(Int_t pW=0;pW<1+(Int_t)(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);pW++) // weights: not used or used
7418 {
7419 fDFPParticleWeights[t][pW] = (TList*)list.Clone();
7420 fDFPParticleWeights[t][pW]->SetName(Form("%s, pWeights %s",typeFlag[t].Data(),pWeightsFlag[pW].Data()));
7421 fDFPType[t]->Add(fDFPParticleWeights[t][pW]);
7422 for(Int_t eW=0;eW<2;eW++)
7423 {
7424 fDFPEventWeights[t][pW][eW] = (TList*)list.Clone();
7425 fDFPEventWeights[t][pW][eW]->SetName(Form("%s, pWeights %s, eWeights %s",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
7426 fDFPParticleWeights[t][pW]->Add(fDFPEventWeights[t][pW][eW]);
7427 // correlations:
7428 fDiffFlowCorrelations[t][pW][eW] = (TList*)list.Clone();
7429 fDiffFlowCorrelations[t][pW][eW]->SetName(Form("Correlations (%s, pWeights %s, eWeights %s)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
7430 fDFPEventWeights[t][pW][eW]->Add(fDiffFlowCorrelations[t][pW][eW]);
7431 // products of correlations:
7432 fDiffFlowProductsOfCorrelations[t][pW][eW] = (TList*)list.Clone();
7433 fDiffFlowProductsOfCorrelations[t][pW][eW]->SetName(Form("Products of correlations (%s, pWeights %s, eWeights %s)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
7434 fDFPEventWeights[t][pW][eW]->Add(fDiffFlowProductsOfCorrelations[t][pW][eW]);
7435 // correction terms:
7436 for(Int_t sc=0;sc<2;sc++) // corrections for NUA: sin or cos terms
7437 {
7438 fDiffFlowCorrectionTerms[t][pW][eW][sc] = (TList*)list.Clone();
7439 fDiffFlowCorrectionTerms[t][pW][eW][sc]->SetName(Form("Corrections for NUA (%s, pWeights %s, eWeights %s, %s terms)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),sinCosFlag[sc].Data()));
7440 fDFPEventWeights[t][pW][eW]->Add(fDiffFlowCorrectionTerms[t][pW][eW][sc]);
7441 }
7442 }
7443 }
7444 }
7445
7446 // nested lists in fDiffFlowResults (Differential Flow/Results):
7447 for(Int_t t=0;t<2;t++) // RP or POI
7448 {
7449 fDFRType[t] = (TList*)list.Clone();
7450 fDFRType[t]->SetName(Form("%s",typeFlag[t].Data()));
7451 fDiffFlowResults->Add(fDFRType[t]);
7452 for(Int_t pW=0;pW<1+(Int_t)(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);pW++) // particle weights not used or used
7453 {
7454 fDFRParticleWeights[t][pW] = (TList*)list.Clone();
7455 fDFRParticleWeights[t][pW]->SetName(Form("%s, pWeights %s",typeFlag[t].Data(),pWeightsFlag[pW].Data()));
7456 fDFRType[t]->Add(fDFRParticleWeights[t][pW]);
7457 for(Int_t eW=0;eW<2;eW++) // event weights: exact ot non-exact // to be improved (terminology)
7458 {
7459 fDFREventWeights[t][pW][eW] = (TList*)list.Clone();
7460 fDFREventWeights[t][pW][eW]->SetName(Form("%s, pWeights %s, eWeights %s",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
7461 fDFRParticleWeights[t][pW]->Add(fDFREventWeights[t][pW][eW]);
7462 // final correlations:
7463 fDiffFlowFinalCorrelations[t][pW][eW] = (TList*)list.Clone();
7464 fDiffFlowFinalCorrelations[t][pW][eW]->SetName(Form("Correlations (%s, pWeights %s, eWeights %s)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
7465 fDFREventWeights[t][pW][eW]->Add(fDiffFlowFinalCorrelations[t][pW][eW]);
7466 // final covariances:
7467 fDiffFlowFinalCovariances[t][pW][eW] = (TList*)list.Clone();
7468 fDiffFlowFinalCovariances[t][pW][eW]->SetName(Form("Covariances (%s, pWeights %s, eWeights %s)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
7469 fDFREventWeights[t][pW][eW]->Add(fDiffFlowFinalCovariances[t][pW][eW]);
7470 // final corrections:
7471 fDiffFlowFinalCorrections[t][pW][eW] = (TList*)list.Clone();
7472 fDiffFlowFinalCorrections[t][pW][eW]->SetName(Form("Corrections (%s, pWeights %s, eWeights %s)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
7473 fDFREventWeights[t][pW][eW]->Add(fDiffFlowFinalCorrections[t][pW][eW]);
7474 for(Int_t nua=0;nua<2;nua++)
7475 {
7476 fDFRCorrections[t][pW][eW][nua] = (TList*)list.Clone();
7477 fDFRCorrections[t][pW][eW][nua]->SetName(Form("%s, pWeights %s, eWeights %s, %s for NUA",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data()));
7478 fDFREventWeights[t][pW][eW]->Add(fDFRCorrections[t][pW][eW][nua]);
7479 // final cumulants:
7480 fDiffFlowFinalCumulants[t][pW][eW][nua] = (TList*)list.Clone();
7481 fDiffFlowFinalCumulants[t][pW][eW][nua]->SetName(Form("Cumulants (%s, pWeights %s, eWeights %s, %s for NUA)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data()));
7482 fDFRCorrections[t][pW][eW][nua]->Add(fDiffFlowFinalCumulants[t][pW][eW][nua]);
7483 // final differential flow:
7484 fDiffFlowFinalFlow[t][pW][eW][nua] = (TList*)list.Clone();
7485 fDiffFlowFinalFlow[t][pW][eW][nua]->SetName(Form("Differential Flow (%s, pWeights %s, eWeights %s, %s for NUA)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data()));
7486 fDFRCorrections[t][pW][eW][nua]->Add(fDiffFlowFinalFlow[t][pW][eW][nua]);
7487 }
7488 }
7489 }
7490 }
7491
7492} // end of void AliFlowAnalysisWithQCumulants::BookAndNestAllLists()
77515452 7493
77515452 7494
9c1a9547 7495//================================================================================================================================
77515452 7496
b7cb54d5 7497
2aa4ebcd 7498void AliFlowAnalysisWithQCumulants::FillCommonHistResultsDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights, Bool_t correctedForNUA)
9c1a9547 7499{
2aa4ebcd 7500 // fill common result histograms for differential flow
2bdc5281 7501
2aa4ebcd 7502 // shortcuts for the flags:
7503 Int_t t = 0; // 0=RP, 1=POI
7504 Int_t pW = (Int_t)(useParticleWeights); // 0=weights not useed, 1=weights used
7505 Int_t eW = -1;
7506 Int_t nua = (Int_t)(correctedForNUA); // 0=not corrected for NUA, 1=corrected for NUA
2bdc5281 7507
2aa4ebcd 7508 if(type == "POI")
7509 {
7510 t = 1;
7511 }
2bdc5281 7512
2aa4ebcd 7513 if(eventWeights == "exact")
7514 {
7515 eW = 0;
7516 }
e085f1a9 7517
2aa4ebcd 7518 for(Int_t o=0;o<4;o++) // order
e085f1a9 7519 {
2aa4ebcd 7520 if(!fFinalFlowPt[t][pW][eW][nua][o])
e085f1a9 7521 {
2aa4ebcd 7522 cout<<"WARNING: fFinalFlowPt[t][pW][eW][nua][o] is NULL in AFAWQC::FCHRIF() !!!!"<<endl;
7523 cout<<"t = "<<t<<endl;
7524 cout<<"pW = "<<pW<<endl;
7525 cout<<"eW = "<<eW<<endl;
7526 cout<<"nua = "<<nua<<endl;
7527 cout<<"o = "<<o<<endl;
7528 exit(0);
e085f1a9 7529 }
2aa4ebcd 7530 if(!fFinalFlowEta[t][pW][eW][nua][o])
7531 {
7532 cout<<"WARNING: fFinalFlowEta[t][pW][eW][nua][o] is NULL in AFAWQC::FCHRIF() !!!!"<<endl;
7533 cout<<"t = "<<t<<endl;
7534 cout<<"pW = "<<pW<<endl;
7535 cout<<"eW = "<<eW<<endl;
7536 cout<<"nua = "<<nua<<endl;
7537 cout<<"o = "<<o<<endl;
7538 exit(0);
7539 }
7540 }
7541
7542 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
7543 {
7544 cout<<"WARNING: fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th"<<endl;
7545 cout<<" is NULL in AFAWQC::FCHRIF() !!!!"<<endl;
7546 exit(0);
7547 }
9c1a9547 7548
2aa4ebcd 7549 // pt:
7550 for(Int_t p=1;p<=fnBinsPt;p++)
7551 {
7552 Double_t v2 = fFinalFlowPt[t][pW][eW][nua][0]->GetBinContent(p);
7553 Double_t v4 = fFinalFlowPt[t][pW][eW][nua][1]->GetBinContent(p);
7554 Double_t v6 = fFinalFlowPt[t][pW][eW][nua][2]->GetBinContent(p);
7555 Double_t v8 = fFinalFlowPt[t][pW][eW][nua][3]->GetBinContent(p);
9c1a9547 7556
2aa4ebcd 7557 //Double_t v2Error = fFinalFlow1D[t][pW][nua][0][0]->GetBinError(p);
7558 //Double_t v4Error = fFinalFlow1D[t][pW][nua][0][1]->GetBinError(p);
7559 //Double_t v6Error = fFinalFlow1D[t][pW][nua][0][2]->GetBinError(p);
7560 //Double_t v8Error = fFinalFlow1D[t][pW][nua][0][3]->GetBinError(p);
9c1a9547 7561
2aa4ebcd 7562 if(type == "RP")
7563 {
7564 fCommonHistsResults2nd->FillDifferentialFlowPtRP(p,v2,0.);
7565 fCommonHistsResults4th->FillDifferentialFlowPtRP(p,v4,0.);
7566 fCommonHistsResults6th->FillDifferentialFlowPtRP(p,v6,0.);
7567 fCommonHistsResults8th->FillDifferentialFlowPtRP(p,v8,0.);
7568 } else if(type == "POI")
7569 {
7570 fCommonHistsResults2nd->FillDifferentialFlowPtPOI(p,v2,0.);
7571 fCommonHistsResults4th->FillDifferentialFlowPtPOI(p,v4,0.);
7572 fCommonHistsResults6th->FillDifferentialFlowPtPOI(p,v6,0.);
7573 fCommonHistsResults8th->FillDifferentialFlowPtPOI(p,v8,0.);
7574 }
7575 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
9c1a9547 7576
2aa4ebcd 7577 // eta:
7578 for(Int_t e=1;e<=fnBinsEta;e++)
7579 {
7580 Double_t v2 = fFinalFlowEta[t][pW][eW][nua][0]->GetBinContent(e);
7581 Double_t v4 = fFinalFlowEta[t][pW][eW][nua][1]->GetBinContent(e);
7582 Double_t v6 = fFinalFlowEta[t][pW][eW][nua][2]->GetBinContent(e);
7583 Double_t v8 = fFinalFlowEta[t][pW][eW][nua][3]->GetBinContent(e);
7584
7585 //Double_t v2Error = fFinalFlow1D[t][pW][nua][1][0]->GetBinError(e);
7586 //Double_t v4Error = fFinalFlow1D[t][pW][nua][1][1]->GetBinError(e);
7587 //Double_t v6Error = fFinalFlow1D[t][pW][nua][1][2]->GetBinError(e);
7588 //Double_t v8Error = fFinalFlow1D[t][pW][nua][1][3]->GetBinError(e);
9c1a9547 7589
2aa4ebcd 7590 if(type == "RP")
7591 {
7592 fCommonHistsResults2nd->FillDifferentialFlowEtaRP(e,v2,0.);
7593 fCommonHistsResults4th->FillDifferentialFlowEtaRP(e,v4,0.);
7594 fCommonHistsResults6th->FillDifferentialFlowEtaRP(e,v6,0.);
7595 fCommonHistsResults8th->FillDifferentialFlowEtaRP(e,v8,0.);
7596 } else if(type == "POI")
7597 {
7598 fCommonHistsResults2nd->FillDifferentialFlowEtaPOI(e,v2,0.);
7599 fCommonHistsResults4th->FillDifferentialFlowEtaPOI(e,v4,0.);
7600 fCommonHistsResults6th->FillDifferentialFlowEtaPOI(e,v6,0.);
7601 fCommonHistsResults8th->FillDifferentialFlowEtaPOI(e,v8,0.);
7602 }
7603 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
9c1a9547 7604
2aa4ebcd 7605} // end of void AliFlowAnalysisWithQCumulants::FillCommonHistResultsDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights, Bool_t correctedForNUA)
bc92c0cb 7606
7607
2aa4ebcd 7608//================================================================================================================================
bc92c0cb 7609
dee1e0e0 7610
2aa4ebcd 7611void AliFlowAnalysisWithQCumulants::AccessConstants()
7612{
7613 // access needed common constants from AliFlowCommonConstants
7614
7615 fnBinsPhi = AliFlowCommonConstants::GetNbinsPhi();
7616 fPhiMin = AliFlowCommonConstants::GetPhiMin();
7617 fPhiMax = AliFlowCommonConstants::GetPhiMax();
7618 if(fnBinsPhi) fPhiBinWidth = (fPhiMax-fPhiMin)/fnBinsPhi;
7619 fnBinsPt = AliFlowCommonConstants::GetNbinsPt();
7620 fPtMin = AliFlowCommonConstants::GetPtMin();
7621 fPtMax = AliFlowCommonConstants::GetPtMax();
7622 if(fnBinsPt) fPtBinWidth = (fPtMax-fPtMin)/fnBinsPt;
7623 fnBinsEta = AliFlowCommonConstants::GetNbinsEta();
7624 fEtaMin = AliFlowCommonConstants::GetEtaMin();
7625 fEtaMax = AliFlowCommonConstants::GetEtaMax();
7626 if(fnBinsEta) fEtaBinWidth = (fEtaMax-fEtaMin)/fnBinsEta;
7627
7628} // end of void AliFlowAnalysisWithQCumulants::AccessConstants()
7629
4057ba99 7630
c2a42ea2 7631//================================================================================================================================
7632
7633
7634void AliFlowAnalysisWithQCumulants::CalculateSumAndProductOfEventWeights()
7635{
7636 // 1.) calculate sum of linear and quadratic event weights;
7637 // 2.) calculate products of event weights
7638
7639 Double_t dMult = (*fSMpk)(0,0); // multiplicity (number of particles used to determine the reaction plane)
7640
7641 Double_t eventWeight[4] = {0};
7642 eventWeight[0] = dMult*(dMult-1); // event weight for <2>
7643 eventWeight[1] = dMult*(dMult-1)*(dMult-2)*(dMult-3); // event weight for <4>
7644 eventWeight[2] = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5); // event weight for <6>
7645 eventWeight[3] = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7); // event weight for <8>
7646
7647 for(Int_t p=0;p<2;p++)
7648 {
7649 for(Int_t c=0;c<4;c++)
7650 {
7651 fSumOfEventWeights[0][0][p]->Fill(c+0.5,pow(eventWeight[c],p+1));
7652 }
7653 }
7654
7655 // to be improved (hardwired pW and eW):
7656 fProductOfEventWeights[0][0]->Fill(0.5,eventWeight[0]*eventWeight[1]);
7657 fProductOfEventWeights[0][0]->Fill(1.5,eventWeight[0]*eventWeight[2]);
7658 fProductOfEventWeights[0][0]->Fill(2.5,eventWeight[0]*eventWeight[3]);
7659 fProductOfEventWeights[0][0]->Fill(3.5,eventWeight[1]*eventWeight[2]);
7660 fProductOfEventWeights[0][0]->Fill(4.5,eventWeight[1]*eventWeight[3]);
7661 fProductOfEventWeights[0][0]->Fill(5.5,eventWeight[2]*eventWeight[3]);
7662
7663} // end of void AliFlowAnalysisWithQCumulants::CalculateSumAndProductOfEventWeights()
7664
7665
7666//================================================================================================================================
4057ba99 7667