1 /*************************************************************************
2 * Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 /**********************************
17 * flow analysis with Q-cumulants *
19 * author: Ante Bilandzic *
20 * (abilandzic@gmail.com) *
21 *********************************/
23 #define AliFlowAnalysisWithQCumulants_cxx
25 #include "Riostream.h"
26 #include "AliFlowCommonConstants.h"
27 #include "AliFlowCommonHist.h"
28 #include "AliFlowCommonHistResults.h"
34 #include "TParticle.h"
38 #include "TProfile2D.h"
39 #include "TProfile3D.h"
42 #include "TPaveLabel.h"
44 #include "AliFlowEventSimple.h"
45 #include "AliFlowTrackSimple.h"
46 #include "AliFlowAnalysisWithQCumulants.h"
66 //================================================================================================================
68 ClassImp(AliFlowAnalysisWithQCumulants)
70 AliFlowAnalysisWithQCumulants::AliFlowAnalysisWithQCumulants():
75 fCommonHists2nd(NULL),
76 fCommonHists4th(NULL),
77 fCommonHists6th(NULL),
78 fCommonHists8th(NULL),
79 fCommonHistsResults2nd(NULL),
80 fCommonHistsResults4th(NULL),
81 fCommonHistsResults6th(NULL),
82 fCommonHistsResults8th(NULL),
95 fFillMultipleControlHistograms(kFALSE),
98 // 2a.) particle weights:
100 fUsePhiWeights(kFALSE),
101 fUsePtWeights(kFALSE),
102 fUseEtaWeights(kFALSE),
103 fUseParticleWeights(NULL),
107 // 2b.) event weights:
108 fMultiplicityWeight(NULL),
109 // 3.) integrated flow:
111 fIntFlowProfiles(NULL),
112 fIntFlowResults(NULL),
114 fApplyCorrectionForNUA(kFALSE),
115 fApplyCorrectionForNUAVsM(kFALSE),
119 fPropagateErrorAlsoFromNIT(kFALSE),
120 fCalculateCumulantsVsM(kFALSE),
121 fMinimumBiasReferenceFlow(kTRUE),
122 fForgetAboutCovariances(kFALSE),
123 fStorePhiDistributionForOneEvent(kFALSE),
127 fIntFlowCorrelationsEBE(NULL),
128 fIntFlowEventWeightsForCorrelationsEBE(NULL),
129 fIntFlowCorrelationsAllEBE(NULL),
130 fReferenceMultiplicityEBE(0.),
131 fAvMultiplicity(NULL),
132 fIntFlowCorrelationsPro(NULL),
133 fIntFlowSquaredCorrelationsPro(NULL),
134 fIntFlowCorrelationsAllPro(NULL),
135 fIntFlowExtraCorrelationsPro(NULL),
136 fIntFlowProductOfCorrelationsPro(NULL),
137 fIntFlowProductOfCorrectionTermsForNUAPro(NULL),
138 fIntFlowCorrelationsHist(NULL),
139 fIntFlowCorrelationsAllHist(NULL),
140 fIntFlowCovariances(NULL),
141 fIntFlowSumOfProductOfEventWeights(NULL),
142 fIntFlowCovariancesNUA(NULL),
143 fIntFlowSumOfProductOfEventWeightsNUA(NULL),
144 fIntFlowQcumulants(NULL),
145 fIntFlowQcumulantsRebinnedInM(NULL),
146 fIntFlowQcumulantsErrorSquaredRatio(NULL),
148 fIntFlowRebinnedInM(NULL),
149 fIntFlowDetectorBias(NULL),
150 // 4.) differential flow:
152 fDiffFlowProfiles(NULL),
153 fDiffFlowResults(NULL),
154 fDiffFlowFlags(NULL),
155 fCalculate2DFlow(kFALSE),
156 // 5.) distributions:
157 fDistributionsList(NULL),
158 fDistributionsFlags(NULL),
159 fStoreDistributions(kFALSE),
162 fPhiDistributionForOneEvent(NULL),
163 // x.) debugging and cross-checking:
164 fNestedLoopsList(NULL),
165 fEvaluateIntFlowNestedLoops(kFALSE),
166 fEvaluateDiffFlowNestedLoops(kFALSE),
167 fMaxAllowedMultiplicity(10),
168 fEvaluateNestedLoops(NULL),
169 fIntFlowDirectCorrelations(NULL),
170 fIntFlowExtraDirectCorrelations(NULL),
171 fCrossCheckInPtBinNo(10),
172 fCrossCheckInEtaBinNo(20),
173 fNoOfParticlesInBin(NULL)
177 // base list to hold all output objects:
178 fHistList = new TList();
179 fHistList->SetName("cobjQC");
180 fHistList->SetOwner(kTRUE);
182 // list to hold histograms with phi, pt and eta weights:
183 fWeightsList = new TList();
185 // multiplicity weight:
186 fMultiplicityWeight = new TString("combinations");
189 fAnalysisLabel = new TString();
191 // initialize all arrays:
192 this->InitializeArraysForIntFlow();
193 this->InitializeArraysForDiffFlow();
194 this->InitializeArraysForDistributions();
195 this->InitializeArraysForVarious();
196 this->InitializeArraysForNestedLoops();
198 } // end of constructor
201 //================================================================================================================
204 AliFlowAnalysisWithQCumulants::~AliFlowAnalysisWithQCumulants()
210 } // end of AliFlowAnalysisWithQCumulants::~AliFlowAnalysisWithQCumulants()
213 //================================================================================================================
216 void AliFlowAnalysisWithQCumulants::Init()
218 // a) Cross check if the settings make sense before starting the QC adventure;
219 // b) Access all common constants;
220 // c) Book all objects;
221 // d) Store flags for integrated and differential flow;
222 // e) Store flags for distributions of corelations;
223 // f) Store harmonic which will be estimated.
225 //save old value and prevent histograms from being added to directory
226 //to avoid name clashes in case multiple analaysis objects are used
228 Bool_t oldHistAddStatus = TH1::AddDirectoryStatus();
229 TH1::AddDirectory(kFALSE);
231 // a) Cross check if the settings make sense before starting the QC adventure;
232 this->CrossCheckSettings();
233 // b) Access all common constants:
234 this->AccessConstants();
235 // c) Book all objects:
236 this->BookAndFillWeightsHistograms();
237 this->BookAndNestAllLists();
238 this->BookCommonHistograms();
239 this->BookEverythingForIntegratedFlow();
240 this->BookEverythingForDifferentialFlow();
241 this->BookEverythingForDistributions();
242 this->BookEverythingForVarious();
243 this->BookEverythingForNestedLoops();
244 // d) Store flags for integrated and differential flow:
245 this->StoreIntFlowFlags();
246 this->StoreDiffFlowFlags();
247 // e) Store flags for distributions of corelations:
248 this->StoreFlagsForDistributions();
249 // f) Store harmonic which will be estimated:
250 this->StoreHarmonic();
252 TH1::AddDirectory(oldHistAddStatus);
253 } // end of void AliFlowAnalysisWithQCumulants::Init()
256 //================================================================================================================
259 void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
261 // Running over data only in this method.
263 // a) Check all pointers used in this method;
264 // b) Define local variables;
265 // c) Fill the common control histograms and call the method to fill fAvMultiplicity;
266 // d) Loop over data and calculate e-b-e quantities;
267 // e) Call all the methods which calculate correlations for reference flow;
268 // f) Call all the methods which calculate correlations for differential flow;
269 // g) Distributions of correlations;
270 // h) Store phi distribution for one event to illustrate flow;
271 // i) Debugging and cross-checking (evaluate nested loops);
272 // j) Reset all event-by-event quantities.
274 // a) Check all pointers used in this method:
275 this->CheckPointersUsedInMake();
277 // b) Define local variables:
278 Double_t dPhi = 0.; // azimuthal angle in the laboratory frame
279 Double_t dPt = 0.; // transverse momentum
280 Double_t dEta = 0.; // pseudorapidity
281 Double_t wPhi = 1.; // phi weight
282 Double_t wPt = 1.; // pt weight
283 Double_t wEta = 1.; // eta weight
284 Int_t nRP = anEvent->GetEventNSelTracksRP(); // number of RPs (i.e. number of particles used to determine the reaction plane)
285 fReferenceMultiplicityEBE = anEvent->GetReferenceMultiplicity(); // reference multiplicity for current event
287 // c) Fill the common control histograms and call the method to fill fAvMultiplicity:
288 this->FillCommonControlHistograms(anEvent);
289 this->FillAverageMultiplicities(nRP);
291 // d) Loop over data and calculate e-b-e quantities:
292 Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = total number of primary tracks, i.e. nPrim = nRP + nPOI where:
293 // nRP = # of particles used to determine the reaction plane;
294 // nPOI = # of particles of interest for a detailed flow analysis;
296 AliFlowTrackSimple *aftsTrack = NULL;
298 for(Int_t i=0;i<nPrim;i++)
300 aftsTrack=anEvent->GetTrack(i);
303 if(!(aftsTrack->InRPSelection() || aftsTrack->InPOISelection())) continue; // consider only tracks which are RPs or POIs
304 Int_t n = fHarmonic; // shortcut for the harmonic
305 if(aftsTrack->InRPSelection()) // RP condition:
307 dPhi = aftsTrack->Phi();
308 dPt = aftsTrack->Pt();
309 dEta = aftsTrack->Eta();
310 if(fUsePhiWeights && fPhiWeights && fnBinsPhi) // determine phi weight for this particle:
312 wPhi = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*fnBinsPhi/TMath::TwoPi())));
314 if(fUsePtWeights && fPtWeights && fnBinsPt) // determine pt weight for this particle:
316 wPt = fPtWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/fPtBinWidth)));
318 if(fUseEtaWeights && fEtaWeights && fEtaBinWidth) // determine eta weight for this particle:
320 wEta = fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/fEtaBinWidth)));
324 // calculate Re[Q_{m*n,k}] and Im[Q_{m*n,k}], m = 1,2,3,4,5,6 for this event:
325 for(Int_t m=0;m<6;m++)
327 for(Int_t k=0;k<9;k++)
329 (*fReQ)(m,k)+=pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1)*n*dPhi);
330 (*fImQ)(m,k)+=pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1)*n*dPhi);
333 // calculate S^{M}_{p,k} for this event
334 // Remark: final calculation of S^{M}_{p,k} follows after the loop over data bellow:
335 for(Int_t p=0;p<8;p++)
337 for(Int_t k=0;k<9;k++)
339 (*fSMpk)(p,k)+=pow(wPhi*wPt*wEta,k);
343 // differential flow:
346 for(Int_t m=0;m<4;m++)
348 for(Int_t k=0;k<9;k++)
350 fReRPQ1dEBE[0][0][m][k]->Fill(dPt,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
351 fImRPQ1dEBE[0][0][m][k]->Fill(dPt,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
355 // s_{k}(pt) for RPs // to be improved (clarified)
356 // Remark: final calculation of s_{p,k}(pt) follows after the loop over data bellow:
357 for(Int_t k=0;k<9;k++)
359 fs1dEBE[0][0][k]->Fill(dPt,pow(wPhi*wPt*wEta,k),1.);
363 for(Int_t m=0;m<4;m++)
365 for(Int_t k=0;k<9;k++)
367 fReRPQ1dEBE[0][1][m][k]->Fill(dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
368 fImRPQ1dEBE[0][1][m][k]->Fill(dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
371 // s_{k}(eta) for RPs // to be improved (clarified)
372 // Remark: final calculation of s_{p,k}(eta) follows after the loop over data bellow:
373 for(Int_t k=0;k<9;k++)
375 fs1dEBE[0][1][k]->Fill(dEta,pow(wPhi*wPt*wEta,k),1.);
380 // (r_{m*m,k}(pt,eta)):
381 for(Int_t m=0;m<4;m++)
383 for(Int_t k=0;k<9;k++)
385 fReRPQ2dEBE[0][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
386 fImRPQ2dEBE[0][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
389 // s_{k}(pt,eta) for RPs // to be improved (clarified)
390 // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:
391 for(Int_t k=0;k<9;k++)
393 fs2dEBE[0][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k),1.);
395 } // end of if(fCalculate2DFlow)
397 if(aftsTrack->InPOISelection())
401 for(Int_t m=0;m<4;m++)
403 for(Int_t k=0;k<9;k++)
405 fReRPQ1dEBE[2][0][m][k]->Fill(dPt,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
406 fImRPQ1dEBE[2][0][m][k]->Fill(dPt,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
409 // s_{k}(pt) for RP&&POIs // to be improved (clarified)
410 // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:
411 for(Int_t k=0;k<9;k++)
413 fs1dEBE[2][0][k]->Fill(dPt,pow(wPhi*wPt*wEta,k),1.);
417 for(Int_t m=0;m<4;m++)
419 for(Int_t k=0;k<9;k++)
421 fReRPQ1dEBE[2][1][m][k]->Fill(dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
422 fImRPQ1dEBE[2][1][m][k]->Fill(dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
425 // s_{k}(eta) for RP&&POIs // to be improved (clarified)
426 // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:
427 for(Int_t k=0;k<9;k++)
429 fs1dEBE[2][1][k]->Fill(dEta,pow(wPhi*wPt*wEta,k),1.);
434 // (q_{m*m,k}(pt,eta)):
435 for(Int_t m=0;m<4;m++)
437 for(Int_t k=0;k<9;k++)
439 fReRPQ2dEBE[2][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
440 fImRPQ2dEBE[2][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
443 // s_{k}(pt,eta) for RP&&POIs // to be improved (clarified)
444 // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:
445 for(Int_t k=0;k<9;k++)
447 fs2dEBE[2][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k),1.);
449 } // end of if(fCalculate2DFlow)
451 } // end of if(aftsTrack->InPOISelection())
452 } // end of if(pTrack->InRPSelection())
454 if(aftsTrack->InPOISelection())
456 dPhi = aftsTrack->Phi();
457 dPt = aftsTrack->Pt();
458 dEta = aftsTrack->Eta();
462 for(Int_t m=0;m<4;m++)
464 fReRPQ1dEBE[1][0][m][0]->Fill(dPt,TMath::Cos((m+1.)*n*dPhi),1.);
465 fImRPQ1dEBE[1][0][m][0]->Fill(dPt,TMath::Sin((m+1.)*n*dPhi),1.);
469 for(Int_t m=0;m<4;m++)
471 fReRPQ1dEBE[1][1][m][0]->Fill(dEta,TMath::Cos((m+1.)*n*dPhi),1.);
472 fImRPQ1dEBE[1][1][m][0]->Fill(dEta,TMath::Sin((m+1.)*n*dPhi),1.);
478 for(Int_t m=0;m<4;m++)
480 fReRPQ2dEBE[1][m][0]->Fill(dPt,dEta,TMath::Cos((m+1.)*n*dPhi),1.);
481 fImRPQ2dEBE[1][m][0]->Fill(dPt,dEta,TMath::Sin((m+1.)*n*dPhi),1.);
483 } // end of if(fCalculate2DFlow)
484 } // end of if(pTrack->InPOISelection())
486 } else // to if(aftsTrack)
489 cout<<" WARNING: no particle! (i.e. aftsTrack is a NULL pointer in AFAWQC::Make().)"<<endl;
492 } // end of for(Int_t i=0;i<nPrim;i++)
494 // calculate the final expressions for S^{M}_{p,k}:
495 for(Int_t p=0;p<8;p++)
497 for(Int_t k=0;k<9;k++)
499 (*fSMpk)(p,k)=pow((*fSMpk)(p,k),p+1);
503 // e) Call all the methods which calculate correlations for reference flow:
504 if(!fEvaluateIntFlowNestedLoops)
506 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
508 if(nRP>1) this->CalculateIntFlowCorrelations(); // without using particle weights
509 } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
511 if(nRP>1) this->CalculateIntFlowCorrelationsUsingParticleWeights(); // with using particle weights
514 if(nRP>3) this->CalculateIntFlowProductOfCorrelations();
515 if(nRP>1) this->CalculateIntFlowSumOfEventWeights();
516 if(nRP>1) this->CalculateIntFlowSumOfProductOfEventWeights();
518 // non-isotropic terms:
519 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
521 if(nRP>0) this->CalculateIntFlowCorrectionsForNUASinTerms();
522 if(nRP>0) this->CalculateIntFlowCorrectionsForNUACosTerms();
523 } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
525 if(nRP>0) this->CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights();
526 if(nRP>0) this->CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights();
529 if(nRP>0) this->CalculateIntFlowProductOfCorrectionTermsForNUA();
530 if(nRP>0) this->CalculateIntFlowSumOfEventWeightsNUA();
531 if(nRP>0) this->CalculateIntFlowSumOfProductOfEventWeightsNUA();
532 } // end of if(!fEvaluateIntFlowNestedLoops)
534 // f) Call all the methods which calculate correlations for differential flow:
535 if(!fEvaluateDiffFlowNestedLoops)
537 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
539 // without using particle weights:
540 this->CalculateDiffFlowCorrelations("RP","Pt");
541 this->CalculateDiffFlowCorrelations("RP","Eta");
542 this->CalculateDiffFlowCorrelations("POI","Pt");
543 this->CalculateDiffFlowCorrelations("POI","Eta");
544 // non-isotropic terms:
545 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Pt");
546 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Eta");
547 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Pt");
548 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Eta");
549 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Pt");
550 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Eta");
551 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Pt");
552 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Eta");
553 } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
555 // with using particle weights:
556 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Pt");
557 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Eta");
558 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Pt");
559 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Eta");
560 // non-isotropic terms:
561 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Pt");
562 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Eta");
563 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Pt");
564 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Eta");
565 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Pt");
566 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Eta");
567 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Pt");
568 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Eta");
571 // whether or not using particle weights the following is calculated in the same way:
572 this->CalculateDiffFlowProductOfCorrelations("RP","Pt");
573 this->CalculateDiffFlowProductOfCorrelations("RP","Eta");
574 this->CalculateDiffFlowProductOfCorrelations("POI","Pt");
575 this->CalculateDiffFlowProductOfCorrelations("POI","Eta");
576 this->CalculateDiffFlowSumOfEventWeights("RP","Pt");
577 this->CalculateDiffFlowSumOfEventWeights("RP","Eta");
578 this->CalculateDiffFlowSumOfEventWeights("POI","Pt");
579 this->CalculateDiffFlowSumOfEventWeights("POI","Eta");
580 this->CalculateDiffFlowSumOfProductOfEventWeights("RP","Pt");
581 this->CalculateDiffFlowSumOfProductOfEventWeights("RP","Eta");
582 this->CalculateDiffFlowSumOfProductOfEventWeights("POI","Pt");
583 this->CalculateDiffFlowSumOfProductOfEventWeights("POI","Eta");
584 } // end of if(!fEvaluateDiffFlowNestedLoops)
592 // 2D differential flow
596 if(nRP>1) this->CalculateCorrelationsForDifferentialFlow2D("RP");
597 if(nRP>1) this->CalculateCorrelationsForDifferentialFlow2D("POI");
600 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
602 if(nRP>1) this->CalculateWeightedCorrelationsForDifferentialFlow2D("RP");
603 if(nRP>1) this->CalculateWeightedCorrelationsForDifferentialFlow2D("POI");
605 } // end of if(fCalculate2DFlow)
608 // g) Distributions of correlations:
609 if(fStoreDistributions){this->StoreDistributionsOfCorrelations();}
611 // h) Store phi distribution for one event to illustrate flow:
612 if(fStorePhiDistributionForOneEvent){this->StorePhiDistributionForOneEvent(anEvent);}
614 // h) Debugging and cross-checking (evaluate nested loops):
615 // h1) cross-checking results for integrated flow:
616 if(fEvaluateIntFlowNestedLoops)
618 if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10
620 // without using particle weights:
621 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
624 this->CalculateIntFlowCorrelations(); // from Q-vectors
625 this->EvaluateIntFlowCorrelationsWithNestedLoops(anEvent); // from nested loops (to be improved: do I have to pass here anEvent or not?)
626 // correction for non-uniform acceptance:
627 this->CalculateIntFlowCorrectionsForNUASinTerms(); // from Q-vectors (sin terms)
628 this->CalculateIntFlowCorrectionsForNUACosTerms(); // from Q-vectors (cos terms)
629 this->EvaluateIntFlowCorrectionsForNUAWithNestedLoops(anEvent); // from nested loops (both sin and cos terms)
631 // using particle weights:
632 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
635 this->CalculateIntFlowCorrelationsUsingParticleWeights(); // from Q-vectors
636 this->EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent); // from nested loops (to be improved: do I have to pass here anEvent or not?)
637 // correction for non-uniform acceptance:
638 this->CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights(); // from Q-vectors (sin terms)
639 this->CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights(); // from Q-vectors (cos terms)
640 this->EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(anEvent); // from nested loops (both sin and cos terms)
642 } else if (nPrim>fMaxAllowedMultiplicity) // to if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity)
645 cout<<"Skipping the event because multiplicity is "<<nPrim<<". Too high to evaluate nested loops!"<<endl;
649 cout<<"Skipping the event because multiplicity is "<<nPrim<<"."<<endl;
651 } // end of if(fEvaluateIntFlowNestedLoops)
653 // h2) cross-checking results for differential flow:
654 if(fEvaluateDiffFlowNestedLoops)
656 if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10
658 // without using particle weights:
659 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
661 // reduced correlations:
663 this->CalculateDiffFlowCorrelations("RP","Pt");
664 this->CalculateDiffFlowCorrelations("RP","Eta");
665 this->CalculateDiffFlowCorrelations("POI","Pt");
666 this->CalculateDiffFlowCorrelations("POI","Eta");
668 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"RP","Pt");
669 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"RP","Eta");
670 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"POI","Pt");
671 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"POI","Eta");
672 // reduced corrections for non-uniform acceptance:
674 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Pt");
675 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Eta");
676 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Pt");
677 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Eta");
678 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Pt");
679 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Eta");
680 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Pt");
681 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Eta");
683 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"RP","Pt");
684 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"RP","Eta");
685 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"POI","Pt");
686 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"POI","Eta");
687 } // end of if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
688 // using particle weights:
689 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
691 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Pt");
692 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Eta");
693 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Pt");
694 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Eta");
695 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Pt");
696 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Eta");
697 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Pt");
698 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Eta");
699 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Pt");
700 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Eta");
701 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Pt");
702 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Eta");
703 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"RP","Pt");
704 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"RP","Eta");
705 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"POI","Pt");
706 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"POI","Eta");
707 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"RP","Pt");
708 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"RP","Eta");
709 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"POI","Pt");
710 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"POI","Eta");
711 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
712 } // end of if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10
713 } // end of if(fEvaluateDiffFlowNestedLoops)
715 // i) Reset all event-by-event quantities.
716 this->ResetEventByEventQuantities();
718 } // end of AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
720 //================================================================================================================================
722 void AliFlowAnalysisWithQCumulants::Finish()
724 // Calculate the final results.
726 // a) Check all pointers used in this method;
727 // b) Acces the constants;
728 // c) Access the flags;
729 // d) Calculate reference cumulants (not corrected for detector effects);
730 // e) Correct reference cumulants for detector effects;
731 // f) Calculate reference flow;
732 // g) Store results for reference flow in AliFlowCommonHistResults and print them on the screen;
737 // h) Calculate the final results for differential flow (without/with weights);
738 // i) Correct the results for differential flow (without/with weights) for effects of non-uniform acceptance (NUA);
739 // j) Calculate the final results for integrated flow (RP/POI) and store in AliFlowCommonHistResults;
740 // k) Store results for differential flow in AliFlowCommonHistResults;
741 // l) Print the final results for integrated flow (RP/POI) on the screen;
742 // m) Cross-checking: Results from Q-vectors vs results from nested loops.
744 // a) Check all pointers used in this method:
745 this->CheckPointersUsedInFinish();
747 // b) Acces the constants:
748 this->AccessConstants();
750 if(fCommonHists && fCommonHists->GetHarmonic()) // to be improved (moved somewhere else)
752 fHarmonic = (Int_t)(fCommonHists->GetHarmonic())->GetBinContent(1);
755 // c) Access the flags: // to be improved (implement a method for this)
756 fUsePhiWeights = (Bool_t)fUseParticleWeights->GetBinContent(1);
757 fUsePtWeights = (Bool_t)fUseParticleWeights->GetBinContent(2);
758 fUseEtaWeights = (Bool_t)fUseParticleWeights->GetBinContent(3);
759 fApplyCorrectionForNUA = (Bool_t)fIntFlowFlags->GetBinContent(3);
760 fPrintFinalResults[0] = (Bool_t)fIntFlowFlags->GetBinContent(4);
761 fPrintFinalResults[1] = (Bool_t)fIntFlowFlags->GetBinContent(5);
762 fPrintFinalResults[2] = (Bool_t)fIntFlowFlags->GetBinContent(6);
763 fPrintFinalResults[3] = (Bool_t)fIntFlowFlags->GetBinContent(7);
764 fApplyCorrectionForNUAVsM = (Bool_t)fIntFlowFlags->GetBinContent(8);
765 fPropagateErrorAlsoFromNIT = (Bool_t)fIntFlowFlags->GetBinContent(9);
766 fCalculateCumulantsVsM = (Bool_t)fIntFlowFlags->GetBinContent(10);
767 fMinimumBiasReferenceFlow = (Bool_t)fIntFlowFlags->GetBinContent(11);
768 fForgetAboutCovariances = (Bool_t)fIntFlowFlags->GetBinContent(12);
769 fStorePhiDistributionForOneEvent = (Bool_t)fIntFlowFlags->GetBinContent(13);
770 fFillMultipleControlHistograms = (Bool_t)fIntFlowFlags->GetBinContent(14);
771 fEvaluateIntFlowNestedLoops = (Bool_t)fEvaluateNestedLoops->GetBinContent(1);
772 fEvaluateDiffFlowNestedLoops = (Bool_t)fEvaluateNestedLoops->GetBinContent(2);
773 fCrossCheckInPtBinNo = (Int_t)fEvaluateNestedLoops->GetBinContent(3);
774 fCrossCheckInEtaBinNo = (Int_t)fEvaluateNestedLoops->GetBinContent(4);
776 // d) Calculate reference cumulants (not corrected for detector effects):
777 this->FinalizeCorrelationsIntFlow();
778 this->CalculateCovariancesIntFlow();
779 this->CalculateCumulantsIntFlow();
781 // e) Correct reference cumulants for detector effects:
782 this->FinalizeCorrectionTermsForNUAIntFlow();
783 this->CalculateCovariancesNUAIntFlow();
784 this->CalculateQcumulantsCorrectedForNUAIntFlow();
786 // f) Calculate reference flow:
787 this->CalculateReferenceFlow();
789 // g) Store results for reference flow in AliFlowCommonHistResults and print them on the screen:
790 this->FillCommonHistResultsIntFlow();
791 if(fPrintFinalResults[0]){this->PrintFinalResultsForIntegratedFlow("RF");}
792 if(fPrintFinalResults[3] && fCalculateCumulantsVsM){this->PrintFinalResultsForIntegratedFlow("RF, rebinned in M");}
802 // g) Calculate the final results for differential flow (without/with weights):
803 this->FinalizeReducedCorrelations("RP","Pt");
804 this->FinalizeReducedCorrelations("RP","Eta");
805 this->FinalizeReducedCorrelations("POI","Pt");
806 this->FinalizeReducedCorrelations("POI","Eta");
807 this->CalculateDiffFlowCovariances("RP","Pt");
808 this->CalculateDiffFlowCovariances("RP","Eta");
809 this->CalculateDiffFlowCovariances("POI","Pt");
810 this->CalculateDiffFlowCovariances("POI","Eta");
811 this->CalculateDiffFlowCumulants("RP","Pt");
812 this->CalculateDiffFlowCumulants("RP","Eta");
813 this->CalculateDiffFlowCumulants("POI","Pt");
814 this->CalculateDiffFlowCumulants("POI","Eta");
815 this->CalculateDiffFlow("RP","Pt");
816 this->CalculateDiffFlow("RP","Eta");
817 this->CalculateDiffFlow("POI","Pt");
818 this->CalculateDiffFlow("POI","Eta");
820 // h) Correct the results for differential flow (without/with weights) for effects of non-uniform acceptance (NUA):
821 if(fApplyCorrectionForNUA)
823 this->FinalizeCorrectionTermsForNUADiffFlow("RP","Pt");
824 this->FinalizeCorrectionTermsForNUADiffFlow("RP","Eta");
825 this->FinalizeCorrectionTermsForNUADiffFlow("POI","Pt");
826 this->FinalizeCorrectionTermsForNUADiffFlow("POI","Eta");
827 this->CalculateDiffFlowCumulantsCorrectedForNUA("RP","Pt");
828 this->CalculateDiffFlowCumulantsCorrectedForNUA("RP","Eta");
829 this->CalculateDiffFlowCumulantsCorrectedForNUA("POI","Pt");
830 this->CalculateDiffFlowCumulantsCorrectedForNUA("POI","Eta");
831 this->CalculateDiffFlowCorrectedForNUA("RP","Pt");
832 this->CalculateDiffFlowCorrectedForNUA("RP","Eta");
833 this->CalculateDiffFlowCorrectedForNUA("POI","Pt");
834 this->CalculateDiffFlowCorrectedForNUA("POI","Eta");
837 // i) Calculate the final results for integrated flow (RP/POI) and store in AliFlowCommonHistResults:
838 this->CalculateFinalResultsForRPandPOIIntegratedFlow("RP");
839 this->CalculateFinalResultsForRPandPOIIntegratedFlow("POI");
841 // j) Store results for differential flow in AliFlowCommonHistResults:
842 this->FillCommonHistResultsDiffFlow("RP");
843 this->FillCommonHistResultsDiffFlow("POI");
845 // k) Print the final results for integrated flow (RP/POI) on the screen:
846 if(fPrintFinalResults[1]){this->PrintFinalResultsForIntegratedFlow("RP");}
847 if(fPrintFinalResults[2]){this->PrintFinalResultsForIntegratedFlow("POI");}
849 // l) Cross-checking: Results from Q-vectors vs results from nested loops:
850 // l1) Reference flow:
851 if(fEvaluateIntFlowNestedLoops)
853 this->CrossCheckIntFlowCorrelations();
854 this->CrossCheckIntFlowCorrectionTermsForNUA();
855 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights) this->CrossCheckIntFlowExtraCorrelations();
856 } // end of if(fEvaluateIntFlowNestedLoops)
858 // l2) Differential flow:
859 if(fEvaluateDiffFlowNestedLoops)
862 this->PrintNumberOfParticlesInSelectedBin();
863 this->CrossCheckDiffFlowCorrelations("RP","Pt");
864 this->CrossCheckDiffFlowCorrelations("RP","Eta");
865 this->CrossCheckDiffFlowCorrelations("POI","Pt");
866 this->CrossCheckDiffFlowCorrelations("POI","Eta");
867 // Correction terms for non-uniform acceptance:
868 this->CrossCheckDiffFlowCorrectionTermsForNUA("RP","Pt");
869 this->CrossCheckDiffFlowCorrectionTermsForNUA("RP","Eta");
870 this->CrossCheckDiffFlowCorrectionTermsForNUA("POI","Pt");
871 this->CrossCheckDiffFlowCorrectionTermsForNUA("POI","Eta");
872 } // end of if(fEvaluateDiffFlowNestedLoops)
874 } // end of AliFlowAnalysisWithQCumulants::Finish()
876 //================================================================================================================================
878 void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTerms()
880 // Calculate correction terms for non-uniform acceptance of the detector for reference flow (cos terms).
883 Double_t dMult = (*fSMpk)(0,0);
885 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
886 Double_t dReQ1n = (*fReQ)(0,0);
887 Double_t dReQ2n = (*fReQ)(1,0);
888 //Double_t dReQ3n = (*fReQ)(2,0);
889 //Double_t dReQ4n = (*fReQ)(3,0);
890 Double_t dImQ1n = (*fImQ)(0,0);
891 Double_t dImQ2n = (*fImQ)(1,0);
892 //Double_t dImQ3n = (*fImQ)(2,0);
893 //Double_t dImQ4n = (*fImQ)(3,0);
895 // *************************************************************
896 // **** corrections for non-uniform acceptance (cos terms): ****
897 // *************************************************************
899 // Remark 1: corrections for non-uniform acceptance (cos terms) calculated with non-weighted Q-vectors
900 // are stored in 1D profile fQCorrectionsCos.
901 // Remark 2: binning of fIntFlowCorrectionTermsForNUAPro[1] is organized as follows:
902 // --------------------------------------------------------------------------------------------------------------------
903 // 1st bin: <<cos(n*(phi1))>> = cosP1n
904 // 2nd bin: <<cos(n*(phi1+phi2))>> = cosP1nP1n
905 // 3rd bin: <<cos(n*(phi1-phi2-phi3))>> = cosP1nM1nM1n
906 // 4th bin: <<cos(n*(2phi1-phi2))>> = cosP2nM1n
907 // --------------------------------------------------------------------------------------------------------------------
910 Double_t cosP1n = 0.; // <<cos(n*(phi1))>>
914 cosP1n = dReQ1n/dMult;
916 // average non-weighted 1-particle correction (cos terms) for non-uniform acceptance for single event:
917 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(1,cosP1n);
918 // event weights for NUA terms:
919 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(1,dMult);
921 // final average non-weighted 1-particle correction (cos terms) for non-uniform acceptance for all events:
922 fIntFlowCorrectionTermsForNUAPro[1]->Fill(0.5,cosP1n,dMult);
923 if(fCalculateCumulantsVsM){fIntFlowCorrectionTermsForNUAVsMPro[1][0]->Fill(dMult+0.5,cosP1n,dMult);}
927 Double_t cosP1nP1n = 0.; // <<cos(n*(phi1+phi2))>>
928 Double_t cosP2nM1n = 0.; // <<cos(n*(2phi1-phi2))>>
932 cosP1nP1n = (pow(dReQ1n,2)-pow(dImQ1n,2)-dReQ2n)/(dMult*(dMult-1));
933 cosP2nM1n = (dReQ2n*dReQ1n+dImQ2n*dImQ1n-dReQ1n)/(dMult*(dMult-1));
935 // average non-weighted 2-particle correction (cos terms) for non-uniform acceptance for single event:
936 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(2,cosP1nP1n);
937 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(4,cosP2nM1n);
938 // event weights for NUA terms:
939 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(2,dMult*(dMult-1));
940 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(4,dMult*(dMult-1));
942 // final average non-weighted 2-particle correction (cos terms) for non-uniform acceptance for all events:
943 fIntFlowCorrectionTermsForNUAPro[1]->Fill(1.5,cosP1nP1n,dMult*(dMult-1));
944 fIntFlowCorrectionTermsForNUAPro[1]->Fill(3.5,cosP2nM1n,dMult*(dMult-1));
945 if(fCalculateCumulantsVsM)
947 fIntFlowCorrectionTermsForNUAVsMPro[1][1]->Fill(dMult+0.5,cosP1nP1n,dMult*(dMult-1));
948 fIntFlowCorrectionTermsForNUAVsMPro[1][3]->Fill(dMult+0.5,cosP2nM1n,dMult*(dMult-1));
953 Double_t cosP1nM1nM1n = 0.; // <<cos(n*(phi1-phi2-phi3))>>
957 cosP1nM1nM1n = (dReQ1n*(pow(dReQ1n,2)+pow(dImQ1n,2))-dReQ1n*dReQ2n-dImQ1n*dImQ2n-2.*(dMult-1)*dReQ1n)
958 / (dMult*(dMult-1)*(dMult-2));
960 // average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for single event:
961 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(3,cosP1nM1nM1n);
962 // event weights for NUA terms:
963 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(3,dMult*(dMult-1)*(dMult-2));
965 // final average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for all events:
966 fIntFlowCorrectionTermsForNUAPro[1]->Fill(2.5,cosP1nM1nM1n,dMult*(dMult-1)*(dMult-2));
967 if(fCalculateCumulantsVsM){fIntFlowCorrectionTermsForNUAVsMPro[1][2]->Fill(dMult+0.5,cosP1nM1nM1n,dMult*(dMult-1)*(dMult-2));}
970 } // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTerms()
973 //================================================================================================================================
976 void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTerms()
978 // calculate corrections for non-uniform acceptance of the detector for no-name integrated flow (sin terms)
981 Double_t dMult = (*fSMpk)(0,0);
983 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
984 Double_t dReQ1n = (*fReQ)(0,0);
985 Double_t dReQ2n = (*fReQ)(1,0);
986 //Double_t dReQ3n = (*fReQ)(2,0);
987 //Double_t dReQ4n = (*fReQ)(3,0);
988 Double_t dImQ1n = (*fImQ)(0,0);
989 Double_t dImQ2n = (*fImQ)(1,0);
990 //Double_t dImQ3n = (*fImQ)(2,0);
991 //Double_t dImQ4n = (*fImQ)(3,0);
993 // *************************************************************
994 // **** corrections for non-uniform acceptance (sin terms): ****
995 // *************************************************************
997 // Remark 1: corrections for non-uniform acceptance (sin terms) calculated with non-weighted Q-vectors
998 // are stored in 1D profile fQCorrectionsSin.
999 // Remark 2: binning of fIntFlowCorrectionTermsForNUAPro[0] is organized as follows:
1000 // --------------------------------------------------------------------------------------------------------------------
1001 // 1st bin: <<sin(n*(phi1))>> = sinP1n
1002 // 2nd bin: <<sin(n*(phi1+phi2))>> = sinP1nP1n
1003 // 3rd bin: <<sin(n*(phi1-phi2-phi3))>> = sinP1nM1nM1n
1004 // 4th bin: <<sin(n*(2phi1-phi2))>> = sinP2nM1n
1005 // --------------------------------------------------------------------------------------------------------------------
1008 Double_t sinP1n = 0.; // <sin(n*(phi1))>
1012 sinP1n = dImQ1n/dMult;
1014 // average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for single event:
1015 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(1,sinP1n);
1016 // event weights for NUA terms:
1017 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(1,dMult);
1019 // final average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
1020 fIntFlowCorrectionTermsForNUAPro[0]->Fill(0.5,sinP1n,dMult);
1021 if(fCalculateCumulantsVsM){fIntFlowCorrectionTermsForNUAVsMPro[0][0]->Fill(dMult+0.5,sinP1n,dMult);}
1025 Double_t sinP1nP1n = 0.; // <<sin(n*(phi1+phi2))>>
1026 Double_t sinP2nM1n = 0.; // <<sin(n*(2phi1-phi2))>>
1029 sinP1nP1n = (2.*dReQ1n*dImQ1n-dImQ2n)/(dMult*(dMult-1));
1030 sinP2nM1n = (dImQ2n*dReQ1n-dReQ2n*dImQ1n-dImQ1n)/(dMult*(dMult-1));
1032 // average non-weighted 2-particle correction (sin terms) for non-uniform acceptance for single event:
1033 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(2,sinP1nP1n);
1034 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(4,sinP2nM1n);
1035 // event weights for NUA terms:
1036 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(2,dMult*(dMult-1));
1037 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(4,dMult*(dMult-1));
1039 // final average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
1040 fIntFlowCorrectionTermsForNUAPro[0]->Fill(1.5,sinP1nP1n,dMult*(dMult-1));
1041 fIntFlowCorrectionTermsForNUAPro[0]->Fill(3.5,sinP2nM1n,dMult*(dMult-1));
1042 if(fCalculateCumulantsVsM)
1044 fIntFlowCorrectionTermsForNUAVsMPro[0][1]->Fill(dMult+0.5,sinP1nP1n,dMult*(dMult-1));
1045 fIntFlowCorrectionTermsForNUAVsMPro[0][3]->Fill(dMult+0.5,sinP2nM1n,dMult*(dMult-1));
1050 Double_t sinP1nM1nM1n = 0.; // <<sin(n*(phi1-phi2-phi3))>>
1054 sinP1nM1nM1n = (-dImQ1n*(pow(dReQ1n,2)+pow(dImQ1n,2))+dReQ1n*dImQ2n-dImQ1n*dReQ2n+2.*(dMult-1)*dImQ1n)
1055 / (dMult*(dMult-1)*(dMult-2));
1057 // average non-weighted 3-particle correction (sin terms) for non-uniform acceptance for single event:
1058 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(3,sinP1nM1nM1n);
1059 // event weights for NUA terms:
1060 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(3,dMult*(dMult-1)*(dMult-2));
1062 // final average non-weighted 3-particle correction (sin terms) for non-uniform acceptance for all events:
1063 fIntFlowCorrectionTermsForNUAPro[0]->Fill(2.5,sinP1nM1nM1n,dMult*(dMult-1)*(dMult-2));
1064 if(fCalculateCumulantsVsM){fIntFlowCorrectionTermsForNUAVsMPro[0][2]->Fill(dMult+0.5,sinP1nM1nM1n,dMult*(dMult-1)*(dMult-2));}
1067 } // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTerms()
1069 //================================================================================================================================
1071 void AliFlowAnalysisWithQCumulants::GetOutputHistograms(TList *outputListHistos)
1073 // a) Get pointers for common control and common result histograms and profiles.
1074 // b) Get pointers for histograms with particle weights.
1075 // c) Get pointers for histograms and profiles relevant for integrated flow.
1076 // d) Get pointers for histograms and profiles relevant for differental flow.
1077 // e) Get pointers for histograms and profiles holding results obtained with nested loops.
1079 if(outputListHistos)
1081 this->SetHistList(outputListHistos);
1085 cout<<" WARNING (QC): fHistList is NULL in AFAWQC::GOH() !!!!"<<endl;
1089 this->GetPointersForCommonHistograms();
1090 this->GetPointersForParticleWeightsHistograms();
1091 this->GetPointersForIntFlowHistograms();
1092 this->GetPointersForDiffFlowHistograms();
1093 this->GetPointersForNestedLoopsHistograms();
1097 cout<<" WARNING (QC): outputListHistos is NULL in AFAWQC::GOH() !!!!"<<endl;
1102 } // end of void AliFlowAnalysisWithQCumulants::GetOutputHistograms(TList *outputListHistos)
1104 //================================================================================================================================
1106 TProfile* AliFlowAnalysisWithQCumulants::MakePtProjection(TProfile2D *profilePtEta) const
1108 // project 2D profile onto pt axis to get 1D profile
1110 Int_t nBinsPt = profilePtEta->GetNbinsX();
1111 Double_t dPtMin = (profilePtEta->GetXaxis())->GetXmin();
1112 Double_t dPtMax = (profilePtEta->GetXaxis())->GetXmax();
1114 Int_t nBinsEta = profilePtEta->GetNbinsY();
1116 TProfile *profilePt = new TProfile("","",nBinsPt,dPtMin,dPtMax);
1118 for(Int_t p=1;p<=nBinsPt;p++)
1120 Double_t contentPt = 0.;
1121 Double_t entryPt = 0.;
1122 Double_t spreadPt = 0.;
1126 for(Int_t e=1;e<=nBinsEta;e++)
1128 contentPt += (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)))
1129 * (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1130 entryPt += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1132 sum1 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)))
1133 * (pow(profilePtEta->GetBinError(profilePtEta->GetBin(p,e)),2.)
1134 + pow(profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)),2.));
1135 sum2 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1136 sum3 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)))
1137 * (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)));
1139 if(sum2>0. && sum1/sum2-pow(sum3/sum2,2.) > 0.)
1141 spreadPt = pow(sum1/sum2-pow(sum3/sum2,2.),0.5);
1143 profilePt->SetBinContent(p,contentPt);
1144 profilePt->SetBinEntries(p,entryPt);
1146 profilePt->SetBinError(p,spreadPt);
1153 } // end of TProfile* AliFlowAnalysisWithQCumulants::MakePtProjection(TProfile2D *profilePtEta)
1156 //================================================================================================================================
1159 TProfile* AliFlowAnalysisWithQCumulants::MakeEtaProjection(TProfile2D *profilePtEta) const
1161 // project 2D profile onto eta axis to get 1D profile
1163 Int_t nBinsEta = profilePtEta->GetNbinsY();
1164 Double_t dEtaMin = (profilePtEta->GetYaxis())->GetXmin();
1165 Double_t dEtaMax = (profilePtEta->GetYaxis())->GetXmax();
1167 Int_t nBinsPt = profilePtEta->GetNbinsX();
1169 TProfile *profileEta = new TProfile("","",nBinsEta,dEtaMin,dEtaMax);
1171 for(Int_t e=1;e<=nBinsEta;e++)
1173 Double_t contentEta = 0.;
1174 Double_t entryEta = 0.;
1175 for(Int_t p=1;p<=nBinsPt;p++)
1177 contentEta += (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)))
1178 * (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1179 entryEta += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1181 profileEta->SetBinContent(e,contentEta);
1182 profileEta->SetBinEntries(e,entryEta);
1187 } // end of TProfile* AliFlowAnalysisWithQCumulants::MakeEtaProjection(TProfile2D *profilePtEta)
1189 //================================================================================================================================
1191 void AliFlowAnalysisWithQCumulants::PrintFinalResultsForIntegratedFlow(TString type)
1193 // Printing on the screen the final results for integrated flow (RF, POI and RP).
1195 Int_t n = fHarmonic;
1197 Double_t dVn[4] = {0.}; // array to hold Vn{2}, Vn{4}, Vn{6} and Vn{8}
1198 Double_t dVnErr[4] = {0.}; // array to hold errors of Vn{2}, Vn{4}, Vn{6} and Vn{8}
1202 for(Int_t b=0;b<4;b++)
1204 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinContent(1);
1205 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinError(1);
1206 dVn[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinContent(1);
1207 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinError(1);
1208 dVn[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinContent(1);
1209 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinError(1);
1210 dVn[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinContent(1);
1211 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinError(1);
1213 } else if(type == "RP")
1215 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinContent(1);
1216 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinError(1);
1217 dVn[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinContent(1);
1218 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinError(1);
1219 dVn[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinContent(1);
1220 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinError(1);
1221 dVn[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinContent(1);
1222 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinError(1);
1223 } else if(type == "POI")
1225 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinContent(1);
1226 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinError(1);
1227 dVn[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinContent(1);
1228 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinError(1);
1229 dVn[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinContent(1);
1230 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinError(1);
1231 dVn[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinContent(1);
1232 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinError(1);
1233 } else if(type == "RF, rebinned in M" && fCalculateCumulantsVsM)
1235 for(Int_t b=0;b<4;b++)
1237 dVn[b] = fIntFlowRebinnedInM->GetBinContent(b+1);
1238 dVnErr[b] = fIntFlowRebinnedInM->GetBinError(b+1);
1242 TString title = " flow estimates from Q-cumulants";
1243 TString subtitle = " (";
1244 TString subtitle2 = " (rebinned in M)";
1246 if(type != "RF, rebinned in M")
1248 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
1250 subtitle.Append(type);
1251 subtitle.Append(", without weights)");
1254 subtitle.Append(type);
1255 subtitle.Append(", with weights)");
1259 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
1261 subtitle.Append("RF");
1262 subtitle.Append(", without weights)");
1265 subtitle.Append("RF");
1266 subtitle.Append(", with weights)");
1271 cout<<"*************************************"<<endl;
1272 cout<<"*************************************"<<endl;
1273 cout<<title.Data()<<endl;
1274 cout<<subtitle.Data()<<endl;
1275 if(type == "RF, rebinned in M"){cout<<subtitle2.Data()<<endl;}
1278 for(Int_t i=0;i<4;i++)
1280 cout<<" v_"<<n<<"{"<<2*(i+1)<<"} = "<<dVn[i]<<" +/- "<<dVnErr[i]<<endl;
1286 if(fApplyCorrectionForNUA)
1288 cout<<" detector bias (corrected for): "<<endl;
1291 cout<<" detector bias (not corrected for):"<<endl;
1293 cout<<" to QC{2}: "<<fIntFlowDetectorBias->GetBinContent(1)<<" +/- "<<fIntFlowDetectorBias->GetBinError(1)<<endl;
1294 cout<<" to QC{4}: "<<fIntFlowDetectorBias->GetBinContent(2)<<" +/- "<<fIntFlowDetectorBias->GetBinError(2)<<endl;
1297 if(type == "RF" || type == "RF, rebinned in M")
1299 cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultRP()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultRP()->GetMean()<<endl;
1301 else if (type == "RP")
1303 cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultRP()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultRP()->GetMean()<<endl;
1305 else if (type == "POI")
1307 cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultPOI()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultPOI()->GetMean()<<endl;
1310 cout<<"*************************************"<<endl;
1311 cout<<"*************************************"<<endl;
1314 }// end of AliFlowAnalysisWithQCumulants::PrintFinalResultsForIntegratedFlow(TString type="RF");
1316 //================================================================================================================================
1318 void AliFlowAnalysisWithQCumulants::WriteHistograms(TString outputFileName)
1320 //store the final results in output .root file
1321 TFile *output = new TFile(outputFileName.Data(),"RECREATE");
1322 //output->WriteObject(fHistList, "cobjQC","SingleKey");
1323 fHistList->Write(fHistList->GetName(), TObject::kSingleKey);
1328 //================================================================================================================================
1331 void AliFlowAnalysisWithQCumulants::WriteHistograms(TDirectoryFile *outputFileName)
1333 //store the final results in output .root file
1334 fHistList->SetName("cobjQC");
1335 fHistList->SetOwner(kTRUE);
1336 outputFileName->Add(fHistList);
1337 outputFileName->Write(outputFileName->GetName(), TObject::kSingleKey);
1340 //================================================================================================================================
1342 void AliFlowAnalysisWithQCumulants::BookCommonHistograms()
1344 // Book common control histograms and common histograms for final results.
1345 // common control histogram (ALL events)
1346 TString commonHistsName = "AliFlowCommonHistQC";
1347 commonHistsName += fAnalysisLabel->Data();
1348 fCommonHists = new AliFlowCommonHist(commonHistsName.Data());
1349 fHistList->Add(fCommonHists);
1350 if(fFillMultipleControlHistograms)
1352 // common control histogram (for events with 2 and more particles)
1353 TString commonHists2ndOrderName = "AliFlowCommonHist2ndOrderQC";
1354 commonHists2ndOrderName += fAnalysisLabel->Data();
1355 fCommonHists2nd = new AliFlowCommonHist(commonHists2ndOrderName.Data());
1356 fHistList->Add(fCommonHists2nd);
1357 // common control histogram (for events with 4 and more particles)
1358 TString commonHists4thOrderName = "AliFlowCommonHist4thOrderQC";
1359 commonHists4thOrderName += fAnalysisLabel->Data();
1360 fCommonHists4th = new AliFlowCommonHist(commonHists4thOrderName.Data());
1361 fHistList->Add(fCommonHists4th);
1362 // common control histogram (for events with 6 and more particles)
1363 TString commonHists6thOrderName = "AliFlowCommonHist6thOrderQC";
1364 commonHists6thOrderName += fAnalysisLabel->Data();
1365 fCommonHists6th = new AliFlowCommonHist(commonHists6thOrderName.Data());
1366 fHistList->Add(fCommonHists6th);
1367 // common control histogram (for events with 8 and more particles)
1368 TString commonHists8thOrderName = "AliFlowCommonHist8thOrderQC";
1369 commonHists8thOrderName += fAnalysisLabel->Data();
1370 fCommonHists8th = new AliFlowCommonHist(commonHists8thOrderName.Data());
1371 fHistList->Add(fCommonHists8th);
1372 } // end of if(fFillMultipleControlHistograms)
1374 // common histograms for final results for QC{2}:
1375 TString commonHistResults2ndOrderName = "AliFlowCommonHistResults2ndOrderQC";
1376 commonHistResults2ndOrderName += fAnalysisLabel->Data();
1377 fCommonHistsResults2nd = new AliFlowCommonHistResults(commonHistResults2ndOrderName.Data());
1378 fHistList->Add(fCommonHistsResults2nd);
1379 // common histograms for final results for QC{4}:
1380 TString commonHistResults4thOrderName = "AliFlowCommonHistResults4thOrderQC";
1381 commonHistResults4thOrderName += fAnalysisLabel->Data();
1382 fCommonHistsResults4th = new AliFlowCommonHistResults(commonHistResults4thOrderName.Data());
1383 fHistList->Add(fCommonHistsResults4th);
1384 // common histograms for final results for QC{6}:
1385 TString commonHistResults6thOrderName = "AliFlowCommonHistResults6thOrderQC";
1386 commonHistResults6thOrderName += fAnalysisLabel->Data();
1387 fCommonHistsResults6th = new AliFlowCommonHistResults(commonHistResults6thOrderName.Data());
1388 fHistList->Add(fCommonHistsResults6th);
1389 // common histograms for final results for QC{8}:
1390 TString commonHistResults8thOrderName = "AliFlowCommonHistResults8thOrderQC";
1391 commonHistResults8thOrderName += fAnalysisLabel->Data();
1392 fCommonHistsResults8th = new AliFlowCommonHistResults(commonHistResults8thOrderName.Data());
1393 fHistList->Add(fCommonHistsResults8th);
1395 } // end of void AliFlowAnalysisWithQCumulants::BookCommonHistograms()
1398 //================================================================================================================================
1401 void AliFlowAnalysisWithQCumulants::BookAndFillWeightsHistograms()
1403 // book and fill histograms which hold phi, pt and eta weights
1407 cout<<"WARNING: fWeightsList is NULL in AFAWQC::BAFWH() !!!!"<<endl;
1411 TString fUseParticleWeightsName = "fUseParticleWeightsQC";
1412 fUseParticleWeightsName += fAnalysisLabel->Data();
1413 fUseParticleWeights = new TProfile(fUseParticleWeightsName.Data(),"0 = particle weight not used, 1 = particle weight used ",3,0,3);
1414 fUseParticleWeights->SetLabelSize(0.06);
1415 (fUseParticleWeights->GetXaxis())->SetBinLabel(1,"w_{#phi}");
1416 (fUseParticleWeights->GetXaxis())->SetBinLabel(2,"w_{p_{T}}");
1417 (fUseParticleWeights->GetXaxis())->SetBinLabel(3,"w_{#eta}");
1418 fUseParticleWeights->Fill(0.5,(Int_t)fUsePhiWeights);
1419 fUseParticleWeights->Fill(1.5,(Int_t)fUsePtWeights);
1420 fUseParticleWeights->Fill(2.5,(Int_t)fUseEtaWeights);
1421 fWeightsList->Add(fUseParticleWeights);
1425 if(fWeightsList->FindObject("phi_weights"))
1427 fPhiWeights = dynamic_cast<TH1F*>(fWeightsList->FindObject("phi_weights"));
1428 if(TMath::Abs(fPhiWeights->GetBinWidth(1)-fPhiBinWidth)>pow(10.,-6.))
1431 cout<<"WARNING (QC): Inconsistent binning in histograms for phi-weights throughout the code."<<endl;
1437 cout<<"WARNING: fWeightsList->FindObject(\"phi_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
1440 } // end of if(fUsePhiWeights)
1444 if(fWeightsList->FindObject("pt_weights"))
1446 fPtWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("pt_weights"));
1447 if(TMath::Abs(fPtWeights->GetBinWidth(1)-fPtBinWidth)>pow(10.,-6.))
1450 cout<<"WARNING (QC): Inconsistent binning in histograms for pt-weights throughout the code."<<endl;
1456 cout<<"WARNING: fWeightsList->FindObject(\"pt_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
1459 } // end of if(fUsePtWeights)
1463 if(fWeightsList->FindObject("eta_weights"))
1465 fEtaWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("eta_weights"));
1466 if(TMath::Abs(fEtaWeights->GetBinWidth(1)-fEtaBinWidth)>pow(10.,-6.))
1469 cout<<"WARNING (QC): Inconsistent binning in histograms for eta-weights throughout the code."<<endl;
1475 cout<<"WARNING: fUseEtaWeights && fWeightsList->FindObject(\"eta_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
1478 } // end of if(fUseEtaWeights)
1480 } // end of AliFlowAnalysisWithQCumulants::BookAndFillWeightsHistograms()
1483 //================================================================================================================================
1486 void AliFlowAnalysisWithQCumulants::BookEverythingForIntegratedFlow()
1488 // Book all objects for integrated flow:
1489 // a) Book profile to hold all flags for integrated flow;
1490 // b) Book event-by-event quantities;
1491 // c) Book profiles; // to be improved (comment)
1492 // d) Book histograms holding the final results.
1494 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)
1495 TString powerFlag[2] = {"linear","quadratic"}; // to be improved (should I promote this to data members?)
1497 // a) Book profile to hold all flags for integrated flow:
1498 TString intFlowFlagsName = "fIntFlowFlags";
1499 intFlowFlagsName += fAnalysisLabel->Data();
1500 fIntFlowFlags = new TProfile(intFlowFlagsName.Data(),"Flags for Integrated Flow",14,0,14);
1501 fIntFlowFlags->SetTickLength(-0.01,"Y");
1502 fIntFlowFlags->SetMarkerStyle(25);
1503 fIntFlowFlags->SetLabelSize(0.05);
1504 fIntFlowFlags->SetLabelOffset(0.02,"Y");
1505 fIntFlowFlags->GetXaxis()->SetBinLabel(1,"Particle Weights");
1506 fIntFlowFlags->GetXaxis()->SetBinLabel(2,"Event Weights");
1507 fIntFlowFlags->GetXaxis()->SetBinLabel(3,"Corrected for NUA?");
1508 fIntFlowFlags->GetXaxis()->SetBinLabel(4,"Print RF results");
1509 fIntFlowFlags->GetXaxis()->SetBinLabel(5,"Print RP results");
1510 fIntFlowFlags->GetXaxis()->SetBinLabel(6,"Print POI results");
1511 fIntFlowFlags->GetXaxis()->SetBinLabel(7,"Print RF (rebinned in M) results");
1512 fIntFlowFlags->GetXaxis()->SetBinLabel(8,"Corrected for NUA vs M?");
1513 fIntFlowFlags->GetXaxis()->SetBinLabel(9,"Propagate errors to v_{n} from correlations?");
1514 fIntFlowFlags->GetXaxis()->SetBinLabel(10,"Calculate cumulants vs M");
1515 fIntFlowFlags->GetXaxis()->SetBinLabel(11,"fMinimumBiasReferenceFlow");
1516 fIntFlowFlags->GetXaxis()->SetBinLabel(12,"fForgetAboutCovariances");
1517 fIntFlowFlags->GetXaxis()->SetBinLabel(13,"fStorePhiDistributionForOneEvent");
1518 fIntFlowFlags->GetXaxis()->SetBinLabel(14,"fFillMultipleControlHistograms");
1519 fIntFlowList->Add(fIntFlowFlags);
1521 // b) Book event-by-event quantities:
1522 // Re[Q_{m*n,k}], Im[Q_{m*n,k}] and S_{p,k}^M:
1523 fReQ = new TMatrixD(6,9);
1524 fImQ = new TMatrixD(6,9);
1525 fSMpk = new TMatrixD(8,9);
1526 // average correlations <2>, <4>, <6> and <8> for single event (bining is the same as in fIntFlowCorrelationsPro and fIntFlowCorrelationsHist):
1527 TString intFlowCorrelationsEBEName = "fIntFlowCorrelationsEBE";
1528 intFlowCorrelationsEBEName += fAnalysisLabel->Data();
1529 fIntFlowCorrelationsEBE = new TH1D(intFlowCorrelationsEBEName.Data(),intFlowCorrelationsEBEName.Data(),4,0,4);
1530 // weights for average correlations <2>, <4>, <6> and <8> for single event:
1531 TString intFlowEventWeightsForCorrelationsEBEName = "fIntFlowEventWeightsForCorrelationsEBE";
1532 intFlowEventWeightsForCorrelationsEBEName += fAnalysisLabel->Data();
1533 fIntFlowEventWeightsForCorrelationsEBE = new TH1D(intFlowEventWeightsForCorrelationsEBEName.Data(),intFlowEventWeightsForCorrelationsEBEName.Data(),4,0,4);
1534 // average all correlations for single event (bining is the same as in fIntFlowCorrelationsAllPro and fIntFlowCorrelationsAllHist):
1535 TString intFlowCorrelationsAllEBEName = "fIntFlowCorrelationsAllEBE";
1536 intFlowCorrelationsAllEBEName += fAnalysisLabel->Data();
1537 fIntFlowCorrelationsAllEBE = new TH1D(intFlowCorrelationsAllEBEName.Data(),intFlowCorrelationsAllEBEName.Data(),34,0,34);
1538 // average correction terms for non-uniform acceptance for single event
1539 // (binning is the same as in fIntFlowCorrectionTermsForNUAPro[2] and fIntFlowCorrectionTermsForNUAHist[2]):
1540 TString fIntFlowCorrectionTermsForNUAEBEName = "fIntFlowCorrectionTermsForNUAEBE";
1541 fIntFlowCorrectionTermsForNUAEBEName += fAnalysisLabel->Data();
1542 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1544 fIntFlowCorrectionTermsForNUAEBE[sc] = new TH1D(Form("%s: %s terms",fIntFlowCorrectionTermsForNUAEBEName.Data(),sinCosFlag[sc].Data()),Form("Correction terms for non-uniform acceptance (%s terms)",sinCosFlag[sc].Data()),4,0,4);
1546 // event weights for terms for non-uniform acceptance:
1547 TString fIntFlowEventWeightForCorrectionTermsForNUAEBEName = "fIntFlowEventWeightForCorrectionTermsForNUAEBE";
1548 fIntFlowEventWeightForCorrectionTermsForNUAEBEName += fAnalysisLabel->Data();
1549 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1551 fIntFlowEventWeightForCorrectionTermsForNUAEBE[sc] = new TH1D(Form("%s: %s terms",fIntFlowEventWeightForCorrectionTermsForNUAEBEName.Data(),sinCosFlag[sc].Data()),Form("Event weights for terms for non-uniform acceptance (%s terms)",sinCosFlag[sc].Data()),4,0,4); // to be improved - 4
1553 // c) Book profiles: // to be improved (comment)
1554 // profile to hold average multiplicities and number of events for events with nRP>=0, nRP>=1, ... , and nRP>=8:
1555 TString avMultiplicityName = "fAvMultiplicity";
1556 avMultiplicityName += fAnalysisLabel->Data();
1557 fAvMultiplicity = new TProfile(avMultiplicityName.Data(),"Average Multiplicities of RPs",9,0,9);
1558 fAvMultiplicity->SetTickLength(-0.01,"Y");
1559 fAvMultiplicity->SetMarkerStyle(25);
1560 fAvMultiplicity->SetLabelSize(0.05);
1561 fAvMultiplicity->SetLabelOffset(0.02,"Y");
1562 fAvMultiplicity->SetYTitle("Average Multiplicity");
1563 (fAvMultiplicity->GetXaxis())->SetBinLabel(1,"all evts");
1564 (fAvMultiplicity->GetXaxis())->SetBinLabel(2,"n_{RP} #geq 1");
1565 (fAvMultiplicity->GetXaxis())->SetBinLabel(3,"n_{RP} #geq 2");
1566 (fAvMultiplicity->GetXaxis())->SetBinLabel(4,"n_{RP} #geq 3");
1567 (fAvMultiplicity->GetXaxis())->SetBinLabel(5,"n_{RP} #geq 4");
1568 (fAvMultiplicity->GetXaxis())->SetBinLabel(6,"n_{RP} #geq 5");
1569 (fAvMultiplicity->GetXaxis())->SetBinLabel(7,"n_{RP} #geq 6");
1570 (fAvMultiplicity->GetXaxis())->SetBinLabel(8,"n_{RP} #geq 7");
1571 (fAvMultiplicity->GetXaxis())->SetBinLabel(9,"n_{RP} #geq 8");
1572 fIntFlowProfiles->Add(fAvMultiplicity);
1573 // Average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with wrong errors!):
1574 TString correlationFlag[4] = {"#LT#LT2#GT#GT","#LT#LT4#GT#GT","#LT#LT6#GT#GT","#LT#LT8#GT#GT"};
1575 TString intFlowCorrelationsProName = "fIntFlowCorrelationsPro";
1576 intFlowCorrelationsProName += fAnalysisLabel->Data();
1577 fIntFlowCorrelationsPro = new TProfile(intFlowCorrelationsProName.Data(),"Average correlations for all events",4,0,4,"s");
1578 fIntFlowCorrelationsPro->Sumw2();
1579 fIntFlowCorrelationsPro->SetTickLength(-0.01,"Y");
1580 fIntFlowCorrelationsPro->SetMarkerStyle(25);
1581 fIntFlowCorrelationsPro->SetLabelSize(0.06);
1582 fIntFlowCorrelationsPro->SetLabelOffset(0.01,"Y");
1583 for(Int_t b=0;b<4;b++)
1585 (fIntFlowCorrelationsPro->GetXaxis())->SetBinLabel(b+1,correlationFlag[b].Data());
1587 fIntFlowProfiles->Add(fIntFlowCorrelationsPro);
1588 // Average correlations squared <<2>^2>, <<4>^2>, <<6>^2> and <<8>^2> for all events:
1589 TString squaredCorrelationFlag[4] = {"#LT#LT2#GT^{2}#GT","#LT#LT4#GT^{2}#GT","#LT#LT6#GT^{2}#GT","#LT#LT8#GT^{2}#GT"};
1590 TString intFlowSquaredCorrelationsProName = "fIntFlowSquaredCorrelationsPro";
1591 intFlowSquaredCorrelationsProName += fAnalysisLabel->Data();
1592 fIntFlowSquaredCorrelationsPro = new TProfile(intFlowSquaredCorrelationsProName.Data(),"Average squared correlations for all events",4,0,4,"s");
1593 fIntFlowSquaredCorrelationsPro->Sumw2();
1594 fIntFlowSquaredCorrelationsPro->SetTickLength(-0.01,"Y");
1595 fIntFlowSquaredCorrelationsPro->SetMarkerStyle(25);
1596 fIntFlowSquaredCorrelationsPro->SetLabelSize(0.06);
1597 fIntFlowSquaredCorrelationsPro->SetLabelOffset(0.01,"Y");
1598 for(Int_t b=0;b<4;b++)
1600 (fIntFlowSquaredCorrelationsPro->GetXaxis())->SetBinLabel(b+1,squaredCorrelationFlag[b].Data());
1602 fIntFlowProfiles->Add(fIntFlowSquaredCorrelationsPro);
1603 if(fCalculateCumulantsVsM)
1605 for(Int_t ci=0;ci<4;ci++) // correlation index
1607 // average correlations <<2>>, <<4>>, <<6>> and <<8>> versus multiplicity for all events (with wrong errors):
1608 TString intFlowCorrelationsVsMProName = "fIntFlowCorrelationsVsMPro";
1609 intFlowCorrelationsVsMProName += fAnalysisLabel->Data();
1610 fIntFlowCorrelationsVsMPro[ci] = new TProfile(Form("%s, %s",intFlowCorrelationsVsMProName.Data(),correlationFlag[ci].Data()),
1611 Form("%s vs multiplicity",correlationFlag[ci].Data()),
1612 fnBinsMult,fMinMult,fMaxMult,"s");
1613 fIntFlowCorrelationsVsMPro[ci]->Sumw2();
1614 fIntFlowCorrelationsVsMPro[ci]->GetYaxis()->SetTitle(correlationFlag[ci].Data());
1615 fIntFlowCorrelationsVsMPro[ci]->GetXaxis()->SetTitle("M");
1616 fIntFlowProfiles->Add(fIntFlowCorrelationsVsMPro[ci]);
1617 // average squared correlations <<2>^2>, <<4>^2>, <<6>^2> and <<8>^2> versus multiplicity for all events:
1618 TString intFlowSquaredCorrelationsVsMProName = "fIntFlowSquaredCorrelationsVsMPro";
1619 intFlowSquaredCorrelationsVsMProName += fAnalysisLabel->Data();
1620 fIntFlowSquaredCorrelationsVsMPro[ci] = new TProfile(Form("%s, %s",intFlowSquaredCorrelationsVsMProName.Data(),squaredCorrelationFlag[ci].Data()),
1621 Form("%s vs multiplicity",squaredCorrelationFlag[ci].Data()),
1622 fnBinsMult,fMinMult,fMaxMult,"s");
1623 fIntFlowSquaredCorrelationsVsMPro[ci]->Sumw2();
1624 fIntFlowSquaredCorrelationsVsMPro[ci]->GetYaxis()->SetTitle(squaredCorrelationFlag[ci].Data());
1625 fIntFlowSquaredCorrelationsVsMPro[ci]->GetXaxis()->SetTitle("M");
1626 fIntFlowProfiles->Add(fIntFlowSquaredCorrelationsVsMPro[ci]);
1627 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
1628 } // end of if(fCalculateCumulantsVsM)
1629 // averaged all correlations for all events (with wrong errors!):
1630 TString intFlowCorrelationsAllProName = "fIntFlowCorrelationsAllPro";
1631 intFlowCorrelationsAllProName += fAnalysisLabel->Data();
1632 fIntFlowCorrelationsAllPro = new TProfile(intFlowCorrelationsAllProName.Data(),"Average correlations for all events",34,0,34,"s");
1633 fIntFlowCorrelationsAllPro->SetTickLength(-0.01,"Y");
1634 fIntFlowCorrelationsAllPro->SetMarkerStyle(25);
1635 fIntFlowCorrelationsAllPro->SetLabelSize(0.03);
1636 fIntFlowCorrelationsAllPro->SetLabelOffset(0.01,"Y");
1637 // 2-p correlations:
1638 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(1,"<<2>>_{n|n}");
1639 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(2,"<<2>>_{2n|2n}");
1640 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(3,"<<2>>_{3n|3n}");
1641 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(4,"<<2>>_{4n|4n}");
1642 // 3-p correlations:
1643 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(6,"<<3>>_{2n|n,n}");
1644 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(7,"<<3>>_{3n|2n,n}");
1645 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(8,"<<3>>_{4n|2n,2n}");
1646 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(9,"<<3>>_{4n|3n,n}");
1647 // 4-p correlations:
1648 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(11,"<<4>>_{n,n|n,n}");
1649 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(12,"<<4>>_{2n,n|2n,n}");
1650 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(13,"<<4>>_{2n,2n|2n,2n}");
1651 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(14,"<<4>>_{3n|n,n,n}");
1652 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(15,"<<4>>_{3n,n|3n,n}");
1653 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(16,"<<4>>_{3n,n|2n,2n}");
1654 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(17,"<<4>>_{4n|2n,n,n}");
1655 // 5-p correlations:
1656 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(19,"<<5>>_{2n|n,n,n,n}");
1657 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(20,"<<5>>_{2n,2n|2n,n,n}");
1658 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(21,"<<5>>_{3n,n|2n,n,n}");
1659 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(22,"<<5>>_{4n|n,n,n,n}");
1660 // 6-p correlations:
1661 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(24,"<<6>>_{n,n,n|n,n,n}");
1662 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(25,"<<6>>_{2n,n,n|2n,n,n}");
1663 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(26,"<<6>>_{2n,2n|n,n,n,n}");
1664 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(27,"<<6>>_{3n,n|n,n,n,n}");
1665 // 7-p correlations:
1666 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(29,"<<7>>_{2n,n,n|n,n,n,n}");
1667 // 8-p correlations:
1668 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(31,"<<8>>_{n,n,n,n|n,n,n,n}");
1669 // EXTRA correlations:
1670 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(33,"<<4>>_{4n,2n|3n,3n}");
1671 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(34,"<<5>>_{2n,2n,2n|3n,3n}");
1672 fIntFlowProfiles->Add(fIntFlowCorrelationsAllPro);
1673 // when particle weights are used some extra correlations appear:
1674 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
1676 TString intFlowExtraCorrelationsProName = "fIntFlowExtraCorrelationsPro";
1677 intFlowExtraCorrelationsProName += fAnalysisLabel->Data();
1678 fIntFlowExtraCorrelationsPro = new TProfile(intFlowExtraCorrelationsProName.Data(),"Average extra correlations for all events",100,0,100,"s");
1679 fIntFlowExtraCorrelationsPro->SetTickLength(-0.01,"Y");
1680 fIntFlowExtraCorrelationsPro->SetMarkerStyle(25);
1681 fIntFlowExtraCorrelationsPro->SetLabelSize(0.03);
1682 fIntFlowExtraCorrelationsPro->SetLabelOffset(0.01,"Y");
1683 // extra 2-p correlations:
1684 (fIntFlowExtraCorrelationsPro->GetXaxis())->SetBinLabel(1,"<<w1^3 w2 cos(n*(phi1-phi2))>>");
1685 (fIntFlowExtraCorrelationsPro->GetXaxis())->SetBinLabel(2,"<<w1 w2 w3^2 cos(n*(phi1-phi2))>>");
1686 fIntFlowProfiles->Add(fIntFlowExtraCorrelationsPro);
1687 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
1688 // average product of correlations <2>, <4>, <6> and <8>:
1689 TString productFlag[6] = {"<<2><4>>","<<2><6>>","<<2><8>>","<<4><6>>","<<4><8>>","<<6><8>>"};
1690 TString intFlowProductOfCorrelationsProName = "fIntFlowProductOfCorrelationsPro";
1691 intFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
1692 fIntFlowProductOfCorrelationsPro = new TProfile(intFlowProductOfCorrelationsProName.Data(),"Average products of correlations",6,0,6);
1693 fIntFlowProductOfCorrelationsPro->SetTickLength(-0.01,"Y");
1694 fIntFlowProductOfCorrelationsPro->SetMarkerStyle(25);
1695 fIntFlowProductOfCorrelationsPro->SetLabelSize(0.05);
1696 fIntFlowProductOfCorrelationsPro->SetLabelOffset(0.01,"Y");
1697 for(Int_t b=0;b<6;b++)
1699 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(b+1,productFlag[b].Data());
1701 fIntFlowProfiles->Add(fIntFlowProductOfCorrelationsPro);
1702 // average product of correlations <2>, <4>, <6> and <8> versus multiplicity
1703 // [0=<<2><4>>,1=<<2><6>>,2=<<2><8>>,3=<<4><6>>,4=<<4><8>>,5=<<6><8>>]
1704 if(fCalculateCumulantsVsM)
1706 TString intFlowProductOfCorrelationsVsMProName = "fIntFlowProductOfCorrelationsVsMPro";
1707 intFlowProductOfCorrelationsVsMProName += fAnalysisLabel->Data();
1708 for(Int_t pi=0;pi<6;pi++)
1710 fIntFlowProductOfCorrelationsVsMPro[pi] = new TProfile(Form("%s, %s",intFlowProductOfCorrelationsVsMProName.Data(),productFlag[pi].Data()),
1711 Form("%s versus multiplicity",productFlag[pi].Data()),
1712 fnBinsMult,fMinMult,fMaxMult);
1713 fIntFlowProductOfCorrelationsVsMPro[pi]->GetXaxis()->SetTitle("M");
1714 fIntFlowProfiles->Add(fIntFlowProductOfCorrelationsVsMPro[pi]);
1715 } // end of for(Int_t pi=0;pi<6;pi++)
1716 } // end of if(fCalculateCumulantsVsM)
1717 // average product of correction terms for NUA:
1718 TString intFlowProductOfCorrectionTermsForNUAProName = "fIntFlowProductOfCorrectionTermsForNUAPro";
1719 intFlowProductOfCorrectionTermsForNUAProName += fAnalysisLabel->Data();
1720 fIntFlowProductOfCorrectionTermsForNUAPro = new TProfile(intFlowProductOfCorrectionTermsForNUAProName.Data(),"Average products of correction terms for NUA",27,0,27);
1721 fIntFlowProductOfCorrectionTermsForNUAPro->SetTickLength(-0.01,"Y");
1722 fIntFlowProductOfCorrectionTermsForNUAPro->SetMarkerStyle(25);
1723 fIntFlowProductOfCorrectionTermsForNUAPro->SetLabelSize(0.05);
1724 fIntFlowProductOfCorrectionTermsForNUAPro->SetLabelOffset(0.01,"Y");
1725 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(1,"<<2><cos(#phi)>>");
1726 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(2,"<<2><sin(#phi)>>");
1727 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(3,"<<cos(#phi)><sin(#phi)>>");
1728 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(4,"Cov(<2>,<cos(#phi_{1}+#phi_{2})>)");
1729 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(5,"Cov(<2>,<sin(#phi_{1}+#phi_{2})>)");
1730 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(6,"Cov(<2>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1731 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(7,"Cov(<2>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1732 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(8,"Cov(<4>,<cos(#phi)>)");
1733 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(9,"Cov(<4>,<sin(#phi)>)");
1734 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(10,"Cov(<4>,<cos(#phi_{1}+#phi_{2})>)");
1735 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(11,"Cov(<4>,<sin(#phi_{1}+#phi_{2})>)");
1736 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(12,"Cov(<4>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>>)");
1737 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(13,"Cov(<4>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>>)");
1738 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(14,"Cov(<cos(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
1739 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(15,"Cov(<cos(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
1740 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(16,"Cov(<cos(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1741 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(17,"Cov(<cos(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1742 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(18,"Cov(<sin(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
1743 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(19,"Cov(<sin(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
1744 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(20,"Cov(<sin(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1745 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(21,"Cov(<sin(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1746 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(22,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}+#phi_{2})>)");
1747 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(23,"Cov(<cos(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1748 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(24,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1749 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(25,"Cov(<sin(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1750 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(26,"Cov(<sin(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1751 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(27,"Cov(<cos(#phi_{1}-#phi_{2}-#phi_{3}>,<sin(#phi_{1}-#phi_{2}-#phi_{3}>)");
1752 fIntFlowProfiles->Add(fIntFlowProductOfCorrectionTermsForNUAPro);
1753 // average correction terms for non-uniform acceptance (with wrong errors!):
1754 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1756 TString intFlowCorrectionTermsForNUAProName = "fIntFlowCorrectionTermsForNUAPro";
1757 intFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
1758 fIntFlowCorrectionTermsForNUAPro[sc] = new TProfile(Form("%s: %s terms",intFlowCorrectionTermsForNUAProName.Data(),sinCosFlag[sc].Data()),Form("Correction terms for non-uniform acceptance (%s terms)",sinCosFlag[sc].Data()),4,0,4,"s");
1759 fIntFlowCorrectionTermsForNUAPro[sc]->SetTickLength(-0.01,"Y");
1760 fIntFlowCorrectionTermsForNUAPro[sc]->SetMarkerStyle(25);
1761 fIntFlowCorrectionTermsForNUAPro[sc]->SetLabelSize(0.03);
1762 fIntFlowCorrectionTermsForNUAPro[sc]->SetLabelOffset(0.01,"Y");
1763 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(1,Form("#LT#LT%s(n(phi1))#GT#GT",sinCosFlag[sc].Data()));
1764 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(2,Form("#LT#LT%s(n(phi1+phi2))#GT#GT",sinCosFlag[sc].Data()));
1765 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(3,Form("#LT#LT%s(n(phi1-phi2-phi3))#GT#GT",sinCosFlag[sc].Data()));
1766 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(4,Form("#LT#LT%s(n(2phi1-phi2))#GT#GT",sinCosFlag[sc].Data()));
1767 fIntFlowProfiles->Add(fIntFlowCorrectionTermsForNUAPro[sc]);
1768 // versus multiplicity:
1769 if(fCalculateCumulantsVsM)
1771 TString correctionTermFlag[4] = {"(n(phi1))","(n(phi1+phi2))","(n(phi1-phi2-phi3))","(n(2phi1-phi2))"}; // to be improved - hardwired 4
1772 for(Int_t ci=0;ci<4;ci++) // correction term index (to be improved - hardwired 4)
1774 TString intFlowCorrectionTermsForNUAVsMProName = "fIntFlowCorrectionTermsForNUAVsMPro";
1775 intFlowCorrectionTermsForNUAVsMProName += fAnalysisLabel->Data();
1776 fIntFlowCorrectionTermsForNUAVsMPro[sc][ci] = new TProfile(Form("%s: #LT#LT%s%s#GT#GT",intFlowCorrectionTermsForNUAVsMProName.Data(),sinCosFlag[sc].Data(),correctionTermFlag[ci].Data()),Form("#LT#LT%s%s#GT#GT vs M",sinCosFlag[sc].Data(),correctionTermFlag[ci].Data()),fnBinsMult,fMinMult,fMaxMult,"s");
1777 fIntFlowProfiles->Add(fIntFlowCorrectionTermsForNUAVsMPro[sc][ci]);
1779 } // end of if(fCalculateCumulantsVsM)
1780 } // end of for(Int_t sc=0;sc<2;sc++)
1782 // d) Book histograms holding the final results:
1783 // average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with correct errors!):
1784 TString intFlowCorrelationsHistName = "fIntFlowCorrelationsHist";
1785 intFlowCorrelationsHistName += fAnalysisLabel->Data();
1786 fIntFlowCorrelationsHist = new TH1D(intFlowCorrelationsHistName.Data(),"Average correlations for all events",4,0,4);
1787 fIntFlowCorrelationsHist->SetTickLength(-0.01,"Y");
1788 fIntFlowCorrelationsHist->SetMarkerStyle(25);
1789 fIntFlowCorrelationsHist->SetLabelSize(0.06);
1790 fIntFlowCorrelationsHist->SetLabelOffset(0.01,"Y");
1791 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(1,"<<2>>");
1792 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(2,"<<4>>");
1793 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(3,"<<6>>");
1794 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(4,"<<8>>");
1795 fIntFlowResults->Add(fIntFlowCorrelationsHist);
1796 // average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with correct errors!) vs M:
1797 if(fCalculateCumulantsVsM)
1799 for(Int_t ci=0;ci<4;ci++) // correlation index
1801 TString intFlowCorrelationsVsMHistName = "fIntFlowCorrelationsVsMHist";
1802 intFlowCorrelationsVsMHistName += fAnalysisLabel->Data();
1803 fIntFlowCorrelationsVsMHist[ci] = new TH1D(Form("%s, %s",intFlowCorrelationsVsMHistName.Data(),correlationFlag[ci].Data()),
1804 Form("%s vs multiplicity",correlationFlag[ci].Data()),
1805 fnBinsMult,fMinMult,fMaxMult);
1806 fIntFlowCorrelationsVsMHist[ci]->GetYaxis()->SetTitle(correlationFlag[ci].Data());
1807 fIntFlowCorrelationsVsMHist[ci]->GetXaxis()->SetTitle("M");
1808 fIntFlowResults->Add(fIntFlowCorrelationsVsMHist[ci]);
1809 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
1810 } // end of if(fCalculateCumulantsVsM)
1811 // average all correlations for all events (with correct errors!):
1812 TString intFlowCorrelationsAllHistName = "fIntFlowCorrelationsAllHist";
1813 intFlowCorrelationsAllHistName += fAnalysisLabel->Data();
1814 fIntFlowCorrelationsAllHist = new TH1D(intFlowCorrelationsAllHistName.Data(),"Average correlations for all events",34,0,34);
1815 fIntFlowCorrelationsAllHist->SetTickLength(-0.01,"Y");
1816 fIntFlowCorrelationsAllHist->SetMarkerStyle(25);
1817 fIntFlowCorrelationsAllHist->SetLabelSize(0.03);
1818 fIntFlowCorrelationsAllHist->SetLabelOffset(0.01,"Y");
1819 // 2-p correlations:
1820 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(1,"<<2>>_{n|n}");
1821 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(2,"<<2>>_{2n|2n}");
1822 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(3,"<<2>>_{3n|3n}");
1823 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(4,"<<2>>_{4n|4n}");
1824 // 3-p correlations:
1825 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(6,"<<3>>_{2n|n,n}");
1826 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(7,"<<3>>_{3n|2n,n}");
1827 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(8,"<<3>>_{4n|2n,2n}");
1828 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(9,"<<3>>_{4n|3n,n}");
1829 // 4-p correlations:
1830 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(11,"<<4>>_{n,n|n,n}");
1831 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(12,"<<4>>_{2n,n|2n,n}");
1832 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(13,"<<4>>_{2n,2n|2n,2n}");
1833 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(14,"<<4>>_{3n|n,n,n}");
1834 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(15,"<<4>>_{3n,n|3n,n}");
1835 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(16,"<<4>>_{3n,n|2n,2n}");
1836 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(17,"<<4>>_{4n|2n,n,n}");
1837 // 5-p correlations:
1838 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(19,"<<5>>_{2n|n,n,n,n}");
1839 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(20,"<<5>>_{2n,2n|2n,n,n}");
1840 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(21,"<<5>>_{3n,n|2n,n,n}");
1841 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(22,"<<5>>_{4n|n,n,n,n}");
1842 // 6-p correlations:
1843 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(24,"<<6>>_{n,n,n|n,n,n}");
1844 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(25,"<<6>>_{2n,n,n|2n,n,n}");
1845 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(26,"<<6>>_{2n,2n|n,n,n,n}");
1846 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(27,"<<6>>_{3n,n|n,n,n,n}");
1847 // 7-p correlations:
1848 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(29,"<<7>>_{2n,n,n|n,n,n,n}");
1849 // 8-p correlations:
1850 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(31,"<<8>>_{n,n,n,n|n,n,n,n}");
1851 fIntFlowResults->Add(fIntFlowCorrelationsAllHist);
1852 // average correction terms for non-uniform acceptance (with correct errors!):
1853 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1855 TString intFlowCorrectionTermsForNUAHistName = "fIntFlowCorrectionTermsForNUAHist";
1856 intFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
1857 fIntFlowCorrectionTermsForNUAHist[sc] = new TH1D(Form("%s: %s terms",intFlowCorrectionTermsForNUAHistName.Data(),sinCosFlag[sc].Data()),Form("Correction terms for non-uniform acceptance (%s terms)",sinCosFlag[sc].Data()),4,0,4);
1858 fIntFlowCorrectionTermsForNUAHist[sc]->SetTickLength(-0.01,"Y");
1859 fIntFlowCorrectionTermsForNUAHist[sc]->SetMarkerStyle(25);
1860 fIntFlowCorrectionTermsForNUAHist[sc]->SetLabelSize(0.03);
1861 fIntFlowCorrectionTermsForNUAHist[sc]->SetLabelOffset(0.01,"Y");
1862 (fIntFlowCorrectionTermsForNUAHist[sc]->GetXaxis())->SetBinLabel(1,Form("#LT#LT%s(n(#phi_{1}))#GT#GT",sinCosFlag[sc].Data()));
1863 (fIntFlowCorrectionTermsForNUAHist[sc]->GetXaxis())->SetBinLabel(2,Form("#LT#LT%s(n(phi1+phi2))#GT#GT",sinCosFlag[sc].Data()));
1864 (fIntFlowCorrectionTermsForNUAHist[sc]->GetXaxis())->SetBinLabel(3,Form("#LT#LT%s(n(phi1-phi2-phi3))#GT#GT",sinCosFlag[sc].Data()));
1865 (fIntFlowCorrectionTermsForNUAHist[sc]->GetXaxis())->SetBinLabel(4,Form("#LT#LT%s(n(2phi1-phi2))#GT#GT",sinCosFlag[sc].Data()));
1866 fIntFlowResults->Add(fIntFlowCorrectionTermsForNUAHist[sc]);
1867 } // end of for(Int_t sc=0;sc<2;sc++)
1868 // covariances (multiplied with weight dependent prefactor):
1869 TString intFlowCovariancesName = "fIntFlowCovariances";
1870 intFlowCovariancesName += fAnalysisLabel->Data();
1871 fIntFlowCovariances = new TH1D(intFlowCovariancesName.Data(),"Covariances (multiplied with weight dependent prefactor)",6,0,6);
1872 fIntFlowCovariances->SetLabelSize(0.04);
1873 fIntFlowCovariances->SetMarkerStyle(25);
1874 (fIntFlowCovariances->GetXaxis())->SetBinLabel(1,"Cov(<2>,<4>)");
1875 (fIntFlowCovariances->GetXaxis())->SetBinLabel(2,"Cov(<2>,<6>)");
1876 (fIntFlowCovariances->GetXaxis())->SetBinLabel(3,"Cov(<2>,<8>)");
1877 (fIntFlowCovariances->GetXaxis())->SetBinLabel(4,"Cov(<4>,<6>)");
1878 (fIntFlowCovariances->GetXaxis())->SetBinLabel(5,"Cov(<4>,<8>)");
1879 (fIntFlowCovariances->GetXaxis())->SetBinLabel(6,"Cov(<6>,<8>)");
1880 fIntFlowResults->Add(fIntFlowCovariances);
1881 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8>:
1882 TString intFlowSumOfEventWeightsName = "fIntFlowSumOfEventWeights";
1883 intFlowSumOfEventWeightsName += fAnalysisLabel->Data();
1884 for(Int_t power=0;power<2;power++)
1886 fIntFlowSumOfEventWeights[power] = new TH1D(Form("%s: %s",intFlowSumOfEventWeightsName.Data(),powerFlag[power].Data()),Form("Sum of %s event weights for correlations",powerFlag[power].Data()),4,0,4);
1887 fIntFlowSumOfEventWeights[power]->SetLabelSize(0.05);
1888 fIntFlowSumOfEventWeights[power]->SetMarkerStyle(25);
1891 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>}");
1892 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<4>}");
1893 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<6>}");
1894 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<8>}");
1895 } else if (power == 1)
1897 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>}^{2}");
1898 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<4>}^{2}");
1899 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<6>}^{2}");
1900 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<8>}^{2}");
1902 fIntFlowResults->Add(fIntFlowSumOfEventWeights[power]);
1904 // sum of products of event weights for correlations <2>, <4>, <6> and <8>:
1905 TString intFlowSumOfProductOfEventWeightsName = "fIntFlowSumOfProductOfEventWeights";
1906 intFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
1907 fIntFlowSumOfProductOfEventWeights = new TH1D(intFlowSumOfProductOfEventWeightsName.Data(),"Sum of product of event weights for correlations",6,0,6);
1908 fIntFlowSumOfProductOfEventWeights->SetLabelSize(0.05);
1909 fIntFlowSumOfProductOfEventWeights->SetMarkerStyle(25);
1910 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>} w_{<4>}");
1911 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<2>} w_{<6>}");
1912 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<2>} w_{<8>}");
1913 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<4>} w_{<6>}");
1914 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(5,"#sum_{i=1}^{N} w_{<4>} w_{<8>}");
1915 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(6,"#sum_{i=1}^{N} w_{<6>} w_{<8>}");
1916 fIntFlowResults->Add(fIntFlowSumOfProductOfEventWeights);
1917 // final result for covariances of correlations (multiplied with weight dependent prefactor) versus M
1918 // [0=Cov(2,4),1=Cov(2,6),2=Cov(2,8),3=Cov(4,6),4=Cov(4,8),5=Cov(6,8)]:
1919 if(fCalculateCumulantsVsM)
1921 TString intFlowCovariancesVsMName = "fIntFlowCovariancesVsM";
1922 intFlowCovariancesVsMName += fAnalysisLabel->Data();
1923 TString covarianceFlag[6] = {"Cov(<2>,<4>)","Cov(<2>,<6>)","Cov(<2>,<8>)","Cov(<4>,<6>)","Cov(<4>,<8>)","Cov(<6>,<8>)"};
1924 for(Int_t ci=0;ci<6;ci++)
1926 fIntFlowCovariancesVsM[ci] = new TH1D(Form("%s, %s",intFlowCovariancesVsMName.Data(),covarianceFlag[ci].Data()),
1927 Form("%s vs multiplicity",covarianceFlag[ci].Data()),
1928 fnBinsMult,fMinMult,fMaxMult);
1929 fIntFlowCovariancesVsM[ci]->GetYaxis()->SetTitle(covarianceFlag[ci].Data());
1930 fIntFlowCovariancesVsM[ci]->GetXaxis()->SetTitle("M");
1931 fIntFlowResults->Add(fIntFlowCovariancesVsM[ci]);
1933 } // end of if(fCalculateCumulantsVsM)
1934 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8> versus multiplicity
1935 // [0=sum{w_{<2>}},1=sum{w_{<4>}},2=sum{w_{<6>}},3=sum{w_{<8>}}][0=linear 1,1=quadratic]:
1936 if(fCalculateCumulantsVsM)
1938 TString intFlowSumOfEventWeightsVsMName = "fIntFlowSumOfEventWeightsVsM";
1939 intFlowSumOfEventWeightsVsMName += fAnalysisLabel->Data();
1940 TString sumFlag[2][4] = {{"#sum_{i=1}^{N} w_{<2>}","#sum_{i=1}^{N} w_{<4>}","#sum_{i=1}^{N} w_{<6>}","#sum_{i=1}^{N} w_{<8>}"},
1941 {"#sum_{i=1}^{N} w_{<2>}^{2}","#sum_{i=1}^{N} w_{<4>}^{2}","#sum_{i=1}^{N} w_{<6>}^{2}","#sum_{i=1}^{N} w_{<8>}^{2}"}};
1942 for(Int_t si=0;si<4;si++)
1944 for(Int_t power=0;power<2;power++)
1946 fIntFlowSumOfEventWeightsVsM[si][power] = new TH1D(Form("%s, %s",intFlowSumOfEventWeightsVsMName.Data(),sumFlag[power][si].Data()),
1947 Form("%s vs multiplicity",sumFlag[power][si].Data()),
1948 fnBinsMult,fMinMult,fMaxMult);
1949 fIntFlowSumOfEventWeightsVsM[si][power]->GetYaxis()->SetTitle(sumFlag[power][si].Data());
1950 fIntFlowSumOfEventWeightsVsM[si][power]->GetXaxis()->SetTitle("M");
1951 fIntFlowResults->Add(fIntFlowSumOfEventWeightsVsM[si][power]);
1952 } // end of for(Int_t power=0;power<2;power++)
1953 } // end of for(Int_t si=0;si<4;si++)
1954 } // end of if(fCalculateCumulantsVsM)
1955 // sum of products of event weights for correlations <2>, <4>, <6> and <8> vs M
1956 // [0=sum{w_{<2>}w_{<4>}},1=sum{w_{<2>}w_{<6>}},2=sum{w_{<2>}w_{<8>}},
1957 // 3=sum{w_{<4>}w_{<6>}},4=sum{w_{<4>}w_{<8>}},5=sum{w_{<6>}w_{<8>}}]:
1958 if(fCalculateCumulantsVsM)
1960 TString intFlowSumOfProductOfEventWeightsVsMName = "fIntFlowSumOfProductOfEventWeightsVsM";
1961 intFlowSumOfProductOfEventWeightsVsMName += fAnalysisLabel->Data();
1962 TString sopowFlag[6] = {"#sum_{i=1}^{N} w_{<2>} w_{<4>}","#sum_{i=1}^{N} w_{<2>} w_{<6>}","#sum_{i=1}^{N} w_{<2>} w_{<8>}",
1963 "#sum_{i=1}^{N} w_{<4>} w_{<6>}","#sum_{i=1}^{N} w_{<4>} w_{<8>}","#sum_{i=1}^{N} w_{<6>} w_{<8>}"};
1964 for(Int_t pi=0;pi<6;pi++)
1966 fIntFlowSumOfProductOfEventWeightsVsM[pi] = new TH1D(Form("%s, %s",intFlowSumOfProductOfEventWeightsVsMName.Data(),sopowFlag[pi].Data()),
1967 Form("%s versus multiplicity",sopowFlag[pi].Data()),
1968 fnBinsMult,fMinMult,fMaxMult);
1969 fIntFlowSumOfProductOfEventWeightsVsM[pi]->GetXaxis()->SetTitle("M");
1970 fIntFlowSumOfProductOfEventWeightsVsM[pi]->GetYaxis()->SetTitle(sopowFlag[pi].Data());
1971 fIntFlowResults->Add(fIntFlowSumOfProductOfEventWeightsVsM[pi]);
1972 } // end of for(Int_t pi=0;pi<6;pi++)
1973 } // end of if(fCalculateCumulantsVsM)
1974 // covariances of NUA terms (multiplied with weight dependent prefactor):
1975 TString intFlowCovariancesNUAName = "fIntFlowCovariancesNUA";
1976 intFlowCovariancesNUAName += fAnalysisLabel->Data();
1977 fIntFlowCovariancesNUA = new TH1D(intFlowCovariancesNUAName.Data(),"Covariances for NUA (multiplied with weight dependent prefactor)",27,0,27);
1978 fIntFlowCovariancesNUA->SetLabelSize(0.04);
1979 fIntFlowCovariancesNUA->SetMarkerStyle(25);
1980 fIntFlowCovariancesNUA->GetXaxis()->SetLabelSize(0.02);
1981 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(1,"Cov(<2>,<cos(#phi)>");
1982 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(2,"Cov(<2>,<sin(#phi)>)");
1983 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(3,"Cov(<cos(#phi)>,<sin(#phi)>)");
1984 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(4,"Cov(<2>,<cos(#phi_{1}+#phi_{2})>)");
1985 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(5,"Cov(<2>,<sin(#phi_{1}+#phi_{2})>)");
1986 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(6,"Cov(<2>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1987 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(7,"Cov(<2>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1988 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(8,"Cov(<4>,<cos(#phi)>)");
1989 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(9,"Cov(<4>,<sin(#phi)>)");
1990 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(10,"Cov(<4>,<cos(#phi_{1}+#phi_{2})>)");
1991 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(11,"Cov(<4>,<sin(#phi_{1}+#phi_{2})>)");
1992 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(12,"Cov(<4>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>>)");
1993 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(13,"Cov(<4>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>>)");
1994 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(14,"Cov(<cos(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
1995 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(15,"Cov(<cos(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
1996 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(16,"Cov(<cos(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1997 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(17,"Cov(<cos(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1998 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(18,"Cov(<sin(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
1999 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(19,"Cov(<sin(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
2000 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(20,"Cov(<sin(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
2001 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(21,"Cov(<sin(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
2002 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(22,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}+#phi_{2})>)");
2003 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(23,"Cov(<cos(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
2004 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(24,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
2005 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(25,"Cov(<sin(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
2006 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(26,"Cov(<sin(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
2007 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(27,"Cov(<cos(#phi_{1}-#phi_{2}-#phi_{3}>,<sin(#phi_{1}-#phi_{2}-#phi_{3}>)");
2008 fIntFlowResults->Add(fIntFlowCovariancesNUA);
2009 // sum of linear and quadratic event weights for NUA terms:
2010 TString intFlowSumOfEventWeightsNUAName = "fIntFlowSumOfEventWeightsNUA";
2011 intFlowSumOfEventWeightsNUAName += fAnalysisLabel->Data();
2012 for(Int_t sc=0;sc<2;sc++)
2014 for(Int_t power=0;power<2;power++)
2016 fIntFlowSumOfEventWeightsNUA[sc][power] = new TH1D(Form("%s: %s, %s",intFlowSumOfEventWeightsNUAName.Data(),powerFlag[power].Data(),sinCosFlag[sc].Data()),Form("Sum of %s event weights for NUA %s terms",powerFlag[power].Data(),sinCosFlag[sc].Data()),4,0,4); // to be improved - 4
2017 fIntFlowSumOfEventWeightsNUA[sc][power]->SetLabelSize(0.05);
2018 fIntFlowSumOfEventWeightsNUA[sc][power]->SetMarkerStyle(25);
2021 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(1,Form("#sum_{i=1}^{N} w_{<%s(#phi)>}",sinCosFlag[sc].Data()));
2022 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(2,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}+#phi_{2})>}",sinCosFlag[sc].Data()));
2023 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(3,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}-#phi_{2}-#phi_{3})>}",sinCosFlag[sc].Data()));
2024 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(4,Form("#sum_{i=1}^{N} w_{<%s(2#phi_{1}-#phi_{2})>}",sinCosFlag[sc].Data()));
2025 } else if(power == 1)
2027 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(1,Form("#sum_{i=1}^{N} w_{<%s(#phi)>}^{2}",sinCosFlag[sc].Data()));
2028 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(2,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}+#phi_{2})>}^{2}",sinCosFlag[sc].Data()));
2029 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(3,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}-#phi_{2}-#phi_{3})>}^{2}",sinCosFlag[sc].Data()));
2030 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(4,Form("#sum_{i=1}^{N} w_{<%s(2#phi_{1}-#phi_{2})>}^{2}",sinCosFlag[sc].Data()));
2032 fIntFlowResults->Add(fIntFlowSumOfEventWeightsNUA[sc][power]);
2035 // sum of products of event weights for NUA terms:
2036 TString intFlowSumOfProductOfEventWeightsNUAName = "fIntFlowSumOfProductOfEventWeightsNUA";
2037 intFlowSumOfProductOfEventWeightsNUAName += fAnalysisLabel->Data();
2038 fIntFlowSumOfProductOfEventWeightsNUA = new TH1D(intFlowSumOfProductOfEventWeightsNUAName.Data(),"Sum of product of event weights for NUA terms",27,0,27);
2039 fIntFlowSumOfProductOfEventWeightsNUA->SetLabelSize(0.05);
2040 fIntFlowSumOfProductOfEventWeightsNUA->SetMarkerStyle(25);
2041 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>} w_{<cos(#phi)>}");
2042 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<2>} w_{<sin(#phi)>}");
2043 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<cos(#phi)>} w_{<sin(#phi)>}");
2045 // to be improved - add labels for remaining bins
2047 fIntFlowResults->Add(fIntFlowSumOfProductOfEventWeightsNUA);
2048 // Final results for reference Q-cumulants:
2049 TString cumulantFlag[4] = {"QC{2}","QC{4}","QC{6}","QC{8}"};
2050 TString intFlowQcumulantsName = "fIntFlowQcumulants";
2051 intFlowQcumulantsName += fAnalysisLabel->Data();
2052 fIntFlowQcumulants = new TH1D(intFlowQcumulantsName.Data(),"Reference Q-cumulants",4,0,4);
2053 if(fPropagateErrorAlsoFromNIT)
2055 fIntFlowQcumulants->SetTitle("Reference Q-cumulants (error from non-isotropic terms also propagated)");
2057 fIntFlowQcumulants->SetLabelSize(0.05);
2058 fIntFlowQcumulants->SetMarkerStyle(25);
2059 for(Int_t b=0;b<4;b++)
2061 (fIntFlowQcumulants->GetXaxis())->SetBinLabel(b+1,cumulantFlag[b].Data());
2063 fIntFlowResults->Add(fIntFlowQcumulants);
2064 // Final results for reference Q-cumulants rebinned in M:
2065 if(fCalculateCumulantsVsM)
2067 TString intFlowQcumulantsRebinnedInMName = "fIntFlowQcumulantsRebinnedInM";
2068 intFlowQcumulantsRebinnedInMName += fAnalysisLabel->Data();
2069 fIntFlowQcumulantsRebinnedInM = new TH1D(intFlowQcumulantsRebinnedInMName.Data(),"Reference Q-cumulants rebinned in M",4,0,4);
2070 fIntFlowQcumulantsRebinnedInM->SetLabelSize(0.05);
2071 fIntFlowQcumulantsRebinnedInM->SetMarkerStyle(25);
2072 for(Int_t b=0;b<4;b++)
2074 (fIntFlowQcumulantsRebinnedInM->GetXaxis())->SetBinLabel(b+1,cumulantFlag[b].Data());
2076 fIntFlowResults->Add(fIntFlowQcumulantsRebinnedInM);
2077 } // end of if(fCalculateCumulantsVsM)
2078 // Ratio between error squared: with/without non-isotropic terms:
2079 TString intFlowQcumulantsErrorSquaredRatioName = "fIntFlowQcumulantsErrorSquaredRatio";
2080 intFlowQcumulantsErrorSquaredRatioName += fAnalysisLabel->Data();
2081 fIntFlowQcumulantsErrorSquaredRatio = new TH1D(intFlowQcumulantsErrorSquaredRatioName.Data(),"Error squared of reference Q-cumulants: #frac{with NUA terms}{without NUA terms}",4,0,4);
2082 fIntFlowQcumulantsErrorSquaredRatio->SetLabelSize(0.05);
2083 fIntFlowQcumulantsErrorSquaredRatio->SetMarkerStyle(25);
2084 for(Int_t b=0;b<4;b++)
2086 (fIntFlowQcumulantsErrorSquaredRatio->GetXaxis())->SetBinLabel(b+1,cumulantFlag[b].Data());
2088 fIntFlowResults->Add(fIntFlowQcumulantsErrorSquaredRatio);
2089 // final results for integrated Q-cumulants versus multiplicity:
2090 if(fCalculateCumulantsVsM)
2092 TString intFlowQcumulantsVsMName = "fIntFlowQcumulantsVsM";
2093 intFlowQcumulantsVsMName += fAnalysisLabel->Data();
2094 for(Int_t co=0;co<4;co++) // cumulant order
2096 fIntFlowQcumulantsVsM[co] = new TH1D(Form("%s, %s",intFlowQcumulantsVsMName.Data(),cumulantFlag[co].Data()),
2097 Form("%s vs multipicity",cumulantFlag[co].Data()),
2098 fnBinsMult,fMinMult,fMaxMult);
2099 fIntFlowQcumulantsVsM[co]->GetXaxis()->SetTitle("M");
2100 fIntFlowQcumulantsVsM[co]->GetYaxis()->SetTitle(cumulantFlag[co].Data());
2101 fIntFlowResults->Add(fIntFlowQcumulantsVsM[co]);
2102 } // end of for(Int_t co=0;co<4;co++) // cumulant order
2103 } // end of if(fCalculateCumulantsVsM)
2104 // final integrated flow estimates from Q-cumulants:
2105 TString flowFlag[4] = {Form("v_{%d}{2,QC}",fHarmonic),Form("v_{%d}{4,QC}",fHarmonic),Form("v_{%d}{6,QC}",fHarmonic),Form("v_{%d}{8,QC}",fHarmonic)};
2106 TString intFlowName = "fIntFlow";
2107 intFlowName += fAnalysisLabel->Data();
2108 // integrated flow from Q-cumulants:
2109 fIntFlow = new TH1D(intFlowName.Data(),"Reference flow estimates from Q-cumulants",4,0,4);
2110 fIntFlow->SetLabelSize(0.05);
2111 fIntFlow->SetMarkerStyle(25);
2112 for(Int_t b=0;b<4;b++)
2114 (fIntFlow->GetXaxis())->SetBinLabel(b+1,flowFlag[b].Data());
2116 fIntFlowResults->Add(fIntFlow);
2117 // Reference flow vs M rebinned in one huge bin:
2118 if(fCalculateCumulantsVsM)
2120 TString intFlowRebinnedInMName = "fIntFlowRebinnedInM";
2121 intFlowRebinnedInMName += fAnalysisLabel->Data();
2122 fIntFlowRebinnedInM = new TH1D(intFlowRebinnedInMName.Data(),"Reference flow estimates from Q-cumulants (rebinned in M)",4,0,4);
2123 fIntFlowRebinnedInM->SetLabelSize(0.05);
2124 fIntFlowRebinnedInM->SetMarkerStyle(25);
2125 for(Int_t b=0;b<4;b++)
2127 (fIntFlowRebinnedInM->GetXaxis())->SetBinLabel(b+1,flowFlag[b].Data());
2129 fIntFlowResults->Add(fIntFlowRebinnedInM);
2131 // integrated flow from Q-cumulants: versus multiplicity:
2132 if(fCalculateCumulantsVsM)
2134 TString intFlowVsMName = "fIntFlowVsM";
2135 intFlowVsMName += fAnalysisLabel->Data();
2136 for(Int_t co=0;co<4;co++) // cumulant order
2138 fIntFlowVsM[co] = new TH1D(Form("%s, %s",intFlowVsMName.Data(),flowFlag[co].Data()),
2139 Form("%s vs multipicity",flowFlag[co].Data()),
2140 fnBinsMult,fMinMult,fMaxMult);
2141 fIntFlowVsM[co]->GetXaxis()->SetTitle("M");
2142 fIntFlowVsM[co]->GetYaxis()->SetTitle(flowFlag[co].Data());
2143 fIntFlowResults->Add(fIntFlowVsM[co]);
2144 } // end of for(Int_t co=0;co<4;co++) // cumulant order
2145 } // end of if(fCalculateCumulantsVsM)
2146 // quantifying detector effects effects to correlations:
2147 TString intFlowDetectorBiasName = "fIntFlowDetectorBias";
2148 intFlowDetectorBiasName += fAnalysisLabel->Data();
2149 fIntFlowDetectorBias = new TH1D(intFlowDetectorBiasName.Data(),"Quantifying detector bias",4,0,4);
2150 fIntFlowDetectorBias->SetLabelSize(0.05);
2151 fIntFlowDetectorBias->SetMarkerStyle(25);
2152 for(Int_t ci=0;ci<4;ci++)
2154 (fIntFlowDetectorBias->GetXaxis())->SetBinLabel(ci+1,Form("#frac{corrected}{measured} %s",cumulantFlag[ci].Data()));
2156 fIntFlowResults->Add(fIntFlowDetectorBias);
2157 // quantifying detector effects to correlations versus multiplicity:
2158 if(fCalculateCumulantsVsM)
2160 TString intFlowDetectorBiasVsMName = "fIntFlowDetectorBiasVsM";
2161 intFlowDetectorBiasVsMName += fAnalysisLabel->Data();
2162 for(Int_t ci=0;ci<4;ci++) // correlation index
2164 fIntFlowDetectorBiasVsM[ci] = new TH1D(Form("%s for %s",intFlowDetectorBiasVsMName.Data(),cumulantFlag[ci].Data()),
2165 Form("Quantifying detector bias for %s vs multipicity",cumulantFlag[ci].Data()),
2166 fnBinsMult,fMinMult,fMaxMult);
2167 fIntFlowDetectorBiasVsM[ci]->GetXaxis()->SetTitle("M");
2168 fIntFlowDetectorBiasVsM[ci]->GetYaxis()->SetTitle("#frac{corrected}{measured}");
2169 fIntFlowResults->Add(fIntFlowDetectorBiasVsM[ci]);
2170 } // end of for(Int_t co=0;co<4;co++) // cumulant order
2171 } // end of if(fCalculateCumulantsVsM)
2173 /* // to be improved (removed):
2174 // final average weighted multi-particle correlations for all events calculated from Q-vectors
2175 fQCorrelations[1] = new TProfile("Weighted correlations","final average multi-particle correlations from weighted Q-vectors",200,0,200,"s");
2176 fQCorrelations[1]->SetTickLength(-0.01,"Y");
2177 fQCorrelations[1]->SetMarkerStyle(25);
2178 fQCorrelations[1]->SetLabelSize(0.03);
2179 fQCorrelations[1]->SetLabelOffset(0.01,"Y");
2180 // 2-particle correlations:
2181 (fQCorrelations[1]->GetXaxis())->SetBinLabel(1,"<w_{1}w_{2}cos(n(#phi_{1}-#phi_{2}))>");
2182 (fQCorrelations[1]->GetXaxis())->SetBinLabel(2,"<w_{1}^{2}w_{2}^{2}cos(2n(#phi_{1}-#phi_{2}))>");
2183 (fQCorrelations[1]->GetXaxis())->SetBinLabel(3,"<w_{1}^{3}w_{2}^{3}cos(3n(#phi_{1}-#phi_{2}))>");
2184 (fQCorrelations[1]->GetXaxis())->SetBinLabel(4,"<w_{1}^{4}w_{2}^{4}cos(4n(#phi_{1}-#phi_{2}))>");
2185 (fQCorrelations[1]->GetXaxis())->SetBinLabel(5,"<w_{1}^{3}w_{2}cos(n(#phi_{1}-#phi_{2}))>");
2186 (fQCorrelations[1]->GetXaxis())->SetBinLabel(6,"<w_{1}^{2}w_{2}w_{3}cos(n(#phi_{1}-#phi_{2}))>");
2187 // 3-particle correlations:
2188 (fQCorrelations[1]->GetXaxis())->SetBinLabel(21,"<w_{1}w_{2}w_{3}^{2}cos(n(2#phi_{1}-#phi_{2}-#phi_{3}))>");
2189 // 4-particle correlations:
2190 (fQCorrelations[1]->GetXaxis())->SetBinLabel(41,"<w_{1}w_{2}w_{3}w_{4}cos(n(#phi_{1}+#phi_{2}-#phi_{3}-#phi_{4}))>");
2191 // add fQCorrelations[1] to the list fIntFlowList:
2192 fIntFlowList->Add(fQCorrelations[1]);
2195 } // end of AliFlowAnalysisWithQCumulants::BookEverythingForIntegratedFlow()
2198 //================================================================================================================================
2201 void AliFlowAnalysisWithQCumulants::InitializeArraysForNestedLoops()
2203 // Initialize arrays of all objects relevant for calculations with nested loops.
2206 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2208 fIntFlowDirectCorrectionTermsForNUA[sc] = NULL;
2211 // differential flow:
2213 for(Int_t t=0;t<2;t++) // type: RP or POI
2215 for(Int_t pe=0;pe<2;pe++) // pt or eta
2217 for(Int_t ci=0;ci<4;ci++) // correlation index
2219 fDiffFlowDirectCorrelations[t][pe][ci] = NULL;
2220 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
2221 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
2222 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
2223 // correction terms for non-uniform acceptance:
2224 for(Int_t t=0;t<2;t++) // type: RP or POI
2226 for(Int_t pe=0;pe<2;pe++) // pt or eta
2228 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2230 for(Int_t cti=0;cti<9;cti++) // correction term index
2232 fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti] = NULL;
2235 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
2236 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
2239 } // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForNestedLoops()
2242 //================================================================================================================================
2245 void AliFlowAnalysisWithQCumulants::BookEverythingForNestedLoops()
2247 // Book all objects relevant for calculations with nested loops.
2249 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)
2250 TString typeFlag[2] = {"RP","POI"}; // to be improved (should I promote this to data members?)
2251 TString ptEtaFlag[2] = {"p_{T}","#eta"}; // to be improved (should I promote this to data members?)
2252 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"}; // to be improved (should I promote this to data members?)
2253 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
2254 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
2256 TString evaluateNestedLoopsName = "fEvaluateNestedLoops";
2257 evaluateNestedLoopsName += fAnalysisLabel->Data();
2258 fEvaluateNestedLoops = new TProfile(evaluateNestedLoopsName.Data(),"Flags for nested loops",4,0,4);
2259 fEvaluateNestedLoops->SetLabelSize(0.03);
2260 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(1,"fEvaluateIntFlowNestedLoops");
2261 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(2,"fEvaluateDiffFlowNestedLoops");
2262 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(3,"fCrossCheckInPtBinNo");
2263 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(4,"fCrossCheckInEtaBinNo");
2264 fEvaluateNestedLoops->Fill(0.5,(Int_t)fEvaluateIntFlowNestedLoops);
2265 fEvaluateNestedLoops->Fill(1.5,(Int_t)fEvaluateDiffFlowNestedLoops);
2266 fEvaluateNestedLoops->Fill(2.5,fCrossCheckInPtBinNo);
2267 fEvaluateNestedLoops->Fill(3.5,fCrossCheckInEtaBinNo);
2268 fNestedLoopsList->Add(fEvaluateNestedLoops);
2269 // nested loops for integrated flow:
2270 if(fEvaluateIntFlowNestedLoops)
2273 TString intFlowDirectCorrelationsName = "fIntFlowDirectCorrelations";
2274 intFlowDirectCorrelationsName += fAnalysisLabel->Data();
2275 fIntFlowDirectCorrelations = new TProfile(intFlowDirectCorrelationsName.Data(),"Multiparticle correlations calculated with nested loops (for int. flow)",34,0,34,"s");
2276 fNestedLoopsList->Add(fIntFlowDirectCorrelations);
2277 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
2279 TString intFlowExtraDirectCorrelationsName = "fIntFlowExtraDirectCorrelations";
2280 intFlowExtraDirectCorrelationsName += fAnalysisLabel->Data();
2281 fIntFlowExtraDirectCorrelations = new TProfile(intFlowExtraDirectCorrelationsName.Data(),"Extra multiparticle correlations calculated with nested loops (for int. flow)",100,0,100,"s");
2282 fNestedLoopsList->Add(fIntFlowExtraDirectCorrelations);
2283 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
2284 // correction terms for non-uniform acceptance:
2285 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2287 TString intFlowDirectCorrectionTermsForNUAName = "fIntFlowDirectCorrectionTermsForNUA";
2288 intFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
2289 fIntFlowDirectCorrectionTermsForNUA[sc] = new TProfile(Form("%s: %s terms",intFlowDirectCorrectionTermsForNUAName.Data(),sinCosFlag[sc].Data()),Form("Correction terms for non-uniform acceptance (%s terms)",sinCosFlag[sc].Data()),10,0,10,"s");
2290 fNestedLoopsList->Add(fIntFlowDirectCorrectionTermsForNUA[sc]);
2291 } // end of for(Int_t sc=0;sc<2;sc++)
2292 } // end of if(fEvaluateIntFlowNestedLoops)
2294 // nested loops for differential flow:
2295 if(fEvaluateDiffFlowNestedLoops)
2297 // reduced correlations:
2298 TString diffFlowDirectCorrelationsName = "fDiffFlowDirectCorrelations";
2299 diffFlowDirectCorrelationsName += fAnalysisLabel->Data();
2300 for(Int_t t=0;t<2;t++) // type: RP or POI
2302 for(Int_t pe=0;pe<2;pe++) // pt or eta
2304 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
2306 // reduced correlations:
2307 fDiffFlowDirectCorrelations[t][pe][rci] = new TProfile(Form("%s, %s, %s, %s",diffFlowDirectCorrelationsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[rci].Data()),Form("%s, %s, %s, %s",diffFlowDirectCorrelationsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[rci].Data()),1,lowerPtEtaEdge[pe],upperPtEtaEdge[pe],"s");
2308 fDiffFlowDirectCorrelations[t][pe][rci]->SetXTitle(ptEtaFlag[pe].Data());
2309 fNestedLoopsList->Add(fDiffFlowDirectCorrelations[t][pe][rci]); // to be improved (add dedicated list to hold reduced correlations)
2310 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
2311 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
2312 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
2313 // correction terms for non-uniform acceptance:
2314 TString diffFlowDirectCorrectionTermsForNUAName = "fDiffFlowDirectCorrectionTermsForNUA";
2315 diffFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
2316 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
2318 for(Int_t pe=0;pe<2;pe++) // pt or eta
2320 for(Int_t sc=0;sc<2;sc++) // sin or cos
2322 for(Int_t cti=0;cti<9;cti++) // correction term index
2324 fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti] = new TProfile(Form("%s, %s, %s, %s, cti = %d",diffFlowDirectCorrectionTermsForNUAName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),cti+1),Form("%s, %s, %s, %s, cti = %d",diffFlowDirectCorrectionTermsForNUAName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),cti+1),1,lowerPtEtaEdge[pe],upperPtEtaEdge[pe],"s");
2325 fNestedLoopsList->Add(fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti]);
2330 // number of RPs and POIs in selected pt and eta bins for cross-checkings:
2331 TString noOfParticlesInBinName = "fNoOfParticlesInBin";
2332 fNoOfParticlesInBin = new TH1D(noOfParticlesInBinName.Data(),"Number of RPs and POIs in selected p_{T} and #eta bin",4,0,4);
2333 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(1,"# of RPs in p_{T} bin");
2334 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(2,"# of RPs in #eta bin");
2335 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(3,"# of POIs in p_{T} bin");
2336 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(4,"# of POIs in #eta bin");
2337 fNestedLoopsList->Add(fNoOfParticlesInBin);
2338 } // end of if(fEvaluateDiffFlowNestedLoops)
2340 } // end of AliFlowAnalysisWithQCumulants::BookEverythingForNestedLoops()
2343 //================================================================================================================================
2346 void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelations()
2348 // calculate all correlations needed for integrated flow
2351 Double_t dMult = (*fSMpk)(0,0);
2353 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
2354 Double_t dReQ1n = (*fReQ)(0,0);
2355 Double_t dReQ2n = (*fReQ)(1,0);
2356 Double_t dReQ3n = (*fReQ)(2,0);
2357 Double_t dReQ4n = (*fReQ)(3,0);
2358 //Double_t dReQ5n = (*fReQ)(4,0);
2359 Double_t dReQ6n = (*fReQ)(5,0);
2360 Double_t dImQ1n = (*fImQ)(0,0);
2361 Double_t dImQ2n = (*fImQ)(1,0);
2362 Double_t dImQ3n = (*fImQ)(2,0);
2363 Double_t dImQ4n = (*fImQ)(3,0);
2364 //Double_t dImQ5n = (*fImQ)(4,0);
2365 Double_t dImQ6n = (*fImQ)(5,0);
2367 // real and imaginary parts of some expressions involving various combinations of Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
2368 // (these expression appear in the Eqs. for the multi-particle correlations bellow)
2370 // Re[Q_{2n} Q_{n}^* Q_{n}^*]
2371 Double_t reQ2nQ1nstarQ1nstar = pow(dReQ1n,2.)*dReQ2n + 2.*dReQ1n*dImQ1n*dImQ2n - pow(dImQ1n,2.)*dReQ2n;
2373 // Im[Q_{2n} Q_{n}^* Q_{n}^*]
2374 //Double_t imQ2nQ1nstarQ1nstar = pow(dReQ1n,2.)*dImQ2n-2.*dReQ1n*dImQ1n*dReQ2n-pow(dImQ1n,2.)*dImQ2n;
2376 // Re[Q_{n} Q_{n} Q_{2n}^*] = Re[Q_{2n} Q_{n}^* Q_{n}^*]
2377 Double_t reQ1nQ1nQ2nstar = reQ2nQ1nstarQ1nstar;
2379 // Re[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]
2380 Double_t reQ3nQ1nQ2nstarQ2nstar = (pow(dReQ2n,2.)-pow(dImQ2n,2.))*(dReQ3n*dReQ1n-dImQ3n*dImQ1n)
2381 + 2.*dReQ2n*dImQ2n*(dReQ3n*dImQ1n+dImQ3n*dReQ1n);
2383 // Im[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]
2384 //Double_t imQ3nQ1nQ2nstarQ2nstar = calculate and implement this (deleteMe)
2386 // Re[Q_{2n} Q_{2n} Q_{3n}^* Q_{1n}^*] = Re[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]
2387 Double_t reQ2nQ2nQ3nstarQ1nstar = reQ3nQ1nQ2nstarQ2nstar;
2389 // Re[Q_{4n} Q_{2n}^* Q_{2n}^*]
2390 Double_t reQ4nQ2nstarQ2nstar = pow(dReQ2n,2.)*dReQ4n+2.*dReQ2n*dImQ2n*dImQ4n-pow(dImQ2n,2.)*dReQ4n;
2392 // Im[Q_{4n} Q_{2n}^* Q_{2n}^*]
2393 //Double_t imQ4nQ2nstarQ2nstar = calculate and implement this (deleteMe)
2395 // Re[Q_{2n} Q_{2n} Q_{4n}^*] = Re[Q_{4n} Q_{2n}^* Q_{2n}^*]
2396 Double_t reQ2nQ2nQ4nstar = reQ4nQ2nstarQ2nstar;
2398 // Re[Q_{4n} Q_{3n}^* Q_{n}^*]
2399 Double_t reQ4nQ3nstarQ1nstar = dReQ4n*(dReQ3n*dReQ1n-dImQ3n*dImQ1n)+dImQ4n*(dReQ3n*dImQ1n+dImQ3n*dReQ1n);
2401 // Re[Q_{3n} Q_{n} Q_{4n}^*] = Re[Q_{4n} Q_{3n}^* Q_{n}^*]
2402 Double_t reQ3nQ1nQ4nstar = reQ4nQ3nstarQ1nstar;
2404 // Im[Q_{4n} Q_{3n}^* Q_{n}^*]
2405 //Double_t imQ4nQ3nstarQ1nstar = calculate and implement this (deleteMe)
2407 // Re[Q_{3n} Q_{2n}^* Q_{n}^*]
2408 Double_t reQ3nQ2nstarQ1nstar = dReQ3n*dReQ2n*dReQ1n-dReQ3n*dImQ2n*dImQ1n+dImQ3n*dReQ2n*dImQ1n
2409 + dImQ3n*dImQ2n*dReQ1n;
2411 // Re[Q_{2n} Q_{n} Q_{3n}^*] = Re[Q_{3n} Q_{2n}^* Q_{n}^*]
2412 Double_t reQ2nQ1nQ3nstar = reQ3nQ2nstarQ1nstar;
2414 // Im[Q_{3n} Q_{2n}^* Q_{n}^*]
2415 //Double_t imQ3nQ2nstarQ1nstar; //calculate and implement this (deleteMe)
2417 // Re[Q_{3n} Q_{n}^* Q_{n}^* Q_{n}^*]
2418 Double_t reQ3nQ1nstarQ1nstarQ1nstar = dReQ3n*pow(dReQ1n,3)-3.*dReQ1n*dReQ3n*pow(dImQ1n,2)
2419 + 3.*dImQ1n*dImQ3n*pow(dReQ1n,2)-dImQ3n*pow(dImQ1n,3);
2421 // Im[Q_{3n} Q_{n}^* Q_{n}^* Q_{n}^*]
2422 //Double_t imQ3nQ1nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)
2424 // |Q_{2n}|^2 |Q_{n}|^2
2425 Double_t dQ2nQ1nQ2nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.));
2427 // Re[Q_{4n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2428 Double_t reQ4nQ2nstarQ1nstarQ1nstar = (dReQ4n*dReQ2n+dImQ4n*dImQ2n)*(pow(dReQ1n,2)-pow(dImQ1n,2))
2429 + 2.*dReQ1n*dImQ1n*(dImQ4n*dReQ2n-dReQ4n*dImQ2n);
2431 // Im[Q_{4n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2432 //Double_t imQ4nQ2nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)
2434 // Re[Q_{2n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^*]
2435 Double_t reQ2nQ1nQ1nstarQ1nstarQ1nstar = (dReQ2n*dReQ1n-dImQ2n*dImQ1n)*(pow(dReQ1n,3)-3.*dReQ1n*pow(dImQ1n,2))
2436 + (dReQ2n*dImQ1n+dReQ1n*dImQ2n)*(3.*dImQ1n*pow(dReQ1n,2)-pow(dImQ1n,3));
2438 // Im[Q_{2n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^*]
2439 //Double_t imQ2nQ1nQ1nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)
2441 // Re[Q_{2n} Q_{2n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2442 Double_t reQ2nQ2nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))
2443 * (dReQ2n*(pow(dReQ1n,2.)-pow(dImQ1n,2.)) + 2.*dImQ2n*dReQ1n*dImQ1n);
2445 // Im[Q_{2n} Q_{2n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2446 //Double_t imQ2nQ2nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))
2447 // * (dImQ2n*(pow(dReQ1n,2.)-pow(dImQ1n,2.)) - 2.*dReQ2n*dReQ1n*dImQ1n);
2449 // Re[Q_{4n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2450 Double_t reQ4nQ1nstarQ1nstarQ1nstarQ1nstar = pow(dReQ1n,4.)*dReQ4n-6.*pow(dReQ1n,2.)*dReQ4n*pow(dImQ1n,2.)
2451 + pow(dImQ1n,4.)*dReQ4n+4.*pow(dReQ1n,3.)*dImQ1n*dImQ4n
2452 - 4.*pow(dImQ1n,3.)*dReQ1n*dImQ4n;
2454 // Im[Q_{4n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2455 //Double_t imQ4nQ1nstarQ1nstarQ1nstarQ1nstar = pow(dReQ1n,4.)*dImQ4n-6.*pow(dReQ1n,2.)*dImQ4n*pow(dImQ1n,2.)
2456 // + pow(dImQ1n,4.)*dImQ4n+4.*pow(dImQ1n,3.)*dReQ1n*dReQ4n
2457 // - 4.*pow(dReQ1n,3.)*dImQ1n*dReQ4n;
2459 // Re[Q_{3n} Q_{n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2460 Double_t reQ3nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
2461 * (dReQ1n*dReQ2n*dReQ3n-dReQ3n*dImQ1n*dImQ2n+dReQ2n*dImQ1n*dImQ3n+dReQ1n*dImQ2n*dImQ3n);
2463 // Im[Q_{3n} Q_{n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2464 //Double_t imQ3nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
2465 // * (-dReQ2n*dReQ3n*dImQ1n-dReQ1n*dReQ3n*dImQ2n+dReQ1n*dReQ2n*dImQ3n-dImQ1n*dImQ2n*dImQ3n);
2468 // Re[Q_{2n} Q_{2n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2469 Double_t reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)*dReQ2n-2.*dReQ1n*dReQ2n*dImQ1n-dReQ2n*pow(dImQ1n,2.)
2470 + dImQ2n*pow(dReQ1n,2.)+2.*dReQ1n*dImQ1n*dImQ2n-pow(dImQ1n,2.)*dImQ2n)
2471 * (pow(dReQ1n,2.)*dReQ2n+2.*dReQ1n*dReQ2n*dImQ1n-dReQ2n*pow(dImQ1n,2.)
2472 - dImQ2n*pow(dReQ1n,2.)+2.*dReQ1n*dImQ1n*dImQ2n+pow(dImQ1n,2.)*dImQ2n);
2474 // Im[Q_{2n} Q_{2n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2475 //Double_t imQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar = 2.*(pow(dReQ1n,2.)*dReQ2n-dReQ2n*pow(dImQ1n,2.)
2476 // + 2.*dReQ1n*dImQ1n*dImQ2n)*(pow(dReQ1n,2.)*dImQ2n
2477 // - 2.*dReQ1n*dImQ1n*dReQ2n-pow(dImQ1n,2.)*dImQ2n);
2479 // Re[Q_{3n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2480 Double_t reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
2481 * (pow(dReQ1n,3.)*dReQ3n-3.*dReQ1n*dReQ3n*pow(dImQ1n,2.)
2482 + 3.*pow(dReQ1n,2.)*dImQ1n*dImQ3n-pow(dImQ1n,3.)*dImQ3n);
2484 // Im[Q_{3n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2485 //Double_t imQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
2486 // * (pow(dImQ1n,3.)*dReQ3n-3.*dImQ1n*dReQ3n*pow(dReQ1n,2.)
2487 // - 3.*pow(dImQ1n,2.)*dReQ1n*dImQ3n+pow(dReQ1n,3.)*dImQ3n);
2489 // |Q_{2n}|^2 |Q_{n}|^4
2490 Double_t dQ2nQ1nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))*pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.);
2492 // Re[Q_{2n} Q_{n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2493 Double_t reQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
2494 * (pow(dReQ1n,2.)*dReQ2n-dReQ2n*pow(dImQ1n,2.)
2495 + 2.*dReQ1n*dImQ1n*dImQ2n);
2497 // Im[Q_{2n} Q_{n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2498 //Double_t imQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
2499 // * (pow(dReQ1n,2.)*dImQ2n-dImQ2n*pow(dImQ1n,2.)
2500 // - 2.*dReQ1n*dReQ2n*dImQ1n);
2505 // **************************************
2506 // **** multi-particle correlations: ****
2507 // **************************************
2509 // Remark 1: All multi-particle correlations calculated with non-weighted Q-vectors are stored in 1D profile fIntFlowCorrelationsAllPro;
2510 // Remark 2: There is a special profile fIntFlowCorrelationsPro holding results ONLY for same harmonic's <<2>>, <<4>>, <<6>> and <<8>>;
2511 // Remark 3: Binning of fIntFlowCorrelationsAllPro is organized as follows:
2512 // --------------------------------------------------------------------------------------------------------------------
2513 // 1st bin: <2>_{1n|1n} = two1n1n = cos(n*(phi1-phi2))>
2514 // 2nd bin: <2>_{2n|2n} = two2n2n = cos(2n*(phi1-phi2))>
2515 // 3rd bin: <2>_{3n|3n} = two3n3n = cos(3n*(phi1-phi2))>
2516 // 4th bin: <2>_{4n|4n} = two4n4n = cos(4n*(phi1-phi2))>
2517 // 5th bin: ---- EMPTY ----
2518 // 6th bin: <3>_{2n|1n,1n} = three2n1n1n = <cos(n*(2.*phi1-phi2-phi3))>
2519 // 7th bin: <3>_{3n|2n,1n} = three3n2n1n = <cos(n*(3.*phi1-2.*phi2-phi3))>
2520 // 8th bin: <3>_{4n|2n,2n} = three4n2n2n = <cos(n*(4.*phi1-2.*phi2-2.*phi3))>
2521 // 9th bin: <3>_{4n|3n,1n} = three4n3n1n = <cos(n*(4.*phi1-3.*phi2-phi3))>
2522 // 10th bin: ---- EMPTY ----
2523 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1n = <cos(n*(phi1+phi2-phi3-phi4))>
2524 // 12th bin: <4>_{2n,1n|2n,1n} = four2n1n2n1n = <cos(2.*n*(phi1+phi2-phi3-phi4))>
2525 // 13th bin: <4>_{2n,2n|2n,2n} = four2n2n2n2n = <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>
2526 // 14th bin: <4>_{3n|1n,1n,1n} = four3n1n1n1n = <cos(n*(3.*phi1-phi2-phi3-phi4))>
2527 // 15th bin: <4>_{3n,1n|3n,1n} = four3n1n3n1n = <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>
2528 // 16th bin: <4>_{3n,1n|2n,2n} = four3n1n2n2n = <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>
2529 // 17th bin: <4>_{4n|2n,1n,1n} = four4n2n1n1n = <cos(n*(3.*phi1+phi2-3.*phi3-phi4))>
2530 // 18th bin: ---- EMPTY ----
2531 // 19th bin: <5>_{2n|1n,1n,1n,1n} = five2n1n1n1n1n = <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>
2532 // 20th bin: <5>_{2n,2n|2n,1n,1n} = five2n2n2n1n1n = <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>
2533 // 21st bin: <5>_{3n,1n|2n,1n,1n} = five3n1n2n1n1n = <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>
2534 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = five4n1n1n1n1n = <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>
2535 // 23rd bin: ---- EMPTY ----
2536 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = six1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
2537 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = six2n1n1n2n1n1n = <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>
2538 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = six2n2n1n1n1n1n = <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>
2539 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = six3n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>
2540 // 28th bin: ---- EMPTY ----
2541 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = seven2n1n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
2542 // 30th bin: ---- EMPTY ----
2543 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = eight1n1n1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
2544 // 32nd bin: ---- EMPTY ----
2545 // 33rd bin: <4>_{4n,2n|3n,3n}= four4n2n3n3n = <cos(n*(4.*phi1+2.*phi2-3.*phi3-3.*phi4))>
2546 // 34th bin: <5>_{2n,2n,2n|3n,3n} = five2n2n2n3n3n = <cos(n*(2.*phi1+2.*phi2+2.*phi3-3.*phi4-3.*phi5))>
2547 // --------------------------------------------------------------------------------------------------------------------
2550 Double_t two1n1n = 0.; // <cos(n*(phi1-phi2))>
2551 Double_t two2n2n = 0.; // <cos(2n*(phi1-phi2))>
2552 Double_t two3n3n = 0.; // <cos(3n*(phi1-phi2))>
2553 Double_t two4n4n = 0.; // <cos(4n*(phi1-phi2))>
2557 two1n1n = (pow(dReQ1n,2.)+pow(dImQ1n,2.)-dMult)/(dMult*(dMult-1.));
2558 two2n2n = (pow(dReQ2n,2.)+pow(dImQ2n,2.)-dMult)/(dMult*(dMult-1.));
2559 two3n3n = (pow(dReQ3n,2.)+pow(dImQ3n,2.)-dMult)/(dMult*(dMult-1.));
2560 two4n4n = (pow(dReQ4n,2.)+pow(dImQ4n,2.)-dMult)/(dMult*(dMult-1.));
2562 // average 2-particle correlations for single event:
2563 fIntFlowCorrelationsAllEBE->SetBinContent(1,two1n1n);
2564 fIntFlowCorrelationsAllEBE->SetBinContent(2,two2n2n);
2565 fIntFlowCorrelationsAllEBE->SetBinContent(3,two3n3n);
2566 fIntFlowCorrelationsAllEBE->SetBinContent(4,two4n4n);
2568 // average 2-particle correlations for all events:
2569 fIntFlowCorrelationsAllPro->Fill(0.5,two1n1n,dMult*(dMult-1.));
2570 fIntFlowCorrelationsAllPro->Fill(1.5,two2n2n,dMult*(dMult-1.));
2571 fIntFlowCorrelationsAllPro->Fill(2.5,two3n3n,dMult*(dMult-1.));
2572 fIntFlowCorrelationsAllPro->Fill(3.5,two4n4n,dMult*(dMult-1.));
2574 // store separetately <2> (to be improved: do I really need this?)
2575 fIntFlowCorrelationsEBE->SetBinContent(1,two1n1n); // <2>
2577 // to be improved (this can be implemented better):
2578 Double_t mWeight2p = 0.;
2579 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
2581 mWeight2p = dMult*(dMult-1.);
2582 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
2585 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2590 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(1,mWeight2p); // eW_<2>
2591 fIntFlowCorrelationsPro->Fill(0.5,two1n1n,mWeight2p);
2592 fIntFlowSquaredCorrelationsPro->Fill(0.5,two1n1n*two1n1n,mWeight2p);
2593 if(fCalculateCumulantsVsM)
2595 fIntFlowCorrelationsVsMPro[0]->Fill(dMult+0.5,two1n1n,mWeight2p);
2596 fIntFlowSquaredCorrelationsVsMPro[0]->Fill(dMult+0.5,two1n1n*two1n1n,mWeight2p);
2598 // distribution of <cos(n*(phi1-phi2))>:
2599 //f2pDistribution->Fill(two1n1n,dMult*(dMult-1.));
2600 } // end of if(dMult>1)
2603 Double_t three2n1n1n = 0.; // <cos(n*(2.*phi1-phi2-phi3))>
2604 Double_t three3n2n1n = 0.; // <cos(n*(3.*phi1-2.*phi2-phi3))>
2605 Double_t three4n2n2n = 0.; // <cos(n*(4.*phi1-2.*phi2-2.*phi3))>
2606 Double_t three4n3n1n = 0.; // <cos(n*(4.*phi1-3.*phi2-phi3))>
2610 three2n1n1n = (reQ2nQ1nstarQ1nstar-2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
2611 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))+2.*dMult)
2612 / (dMult*(dMult-1.)*(dMult-2.));
2613 three3n2n1n = (reQ3nQ2nstarQ1nstar-(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2614 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))
2615 - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)
2616 / (dMult*(dMult-1.)*(dMult-2.));
2617 three4n2n2n = (reQ4nQ2nstarQ2nstar-2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2618 - (pow(dReQ4n,2.)+pow(dImQ4n,2.))+2.*dMult)
2619 / (dMult*(dMult-1.)*(dMult-2.));
2620 three4n3n1n = (reQ4nQ3nstarQ1nstar-(pow(dReQ4n,2.)+pow(dImQ4n,2.))
2621 - (pow(dReQ3n,2.)+pow(dImQ3n,2.))
2622 - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)
2623 / (dMult*(dMult-1.)*(dMult-2.));
2625 // average 3-particle correlations for single event:
2626 fIntFlowCorrelationsAllEBE->SetBinContent(6,three2n1n1n);
2627 fIntFlowCorrelationsAllEBE->SetBinContent(7,three3n2n1n);
2628 fIntFlowCorrelationsAllEBE->SetBinContent(8,three4n2n2n);
2629 fIntFlowCorrelationsAllEBE->SetBinContent(9,three4n3n1n);
2631 // average 3-particle correlations for all events:
2632 fIntFlowCorrelationsAllPro->Fill(5.5,three2n1n1n,dMult*(dMult-1.)*(dMult-2.));
2633 fIntFlowCorrelationsAllPro->Fill(6.5,three3n2n1n,dMult*(dMult-1.)*(dMult-2.));
2634 fIntFlowCorrelationsAllPro->Fill(7.5,three4n2n2n,dMult*(dMult-1.)*(dMult-2.));
2635 fIntFlowCorrelationsAllPro->Fill(8.5,three4n3n1n,dMult*(dMult-1.)*(dMult-2.));
2636 } // end of if(dMult>2)
2639 Double_t four1n1n1n1n = 0.; // <cos(n*(phi1+phi2-phi3-phi4))>
2640 Double_t four2n2n2n2n = 0.; // <cos(2.*n*(phi1+phi2-phi3-phi4))>
2641 Double_t four2n1n2n1n = 0.; // <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>
2642 Double_t four3n1n1n1n = 0.; // <cos(n*(3.*phi1-phi2-phi3-phi4))>
2643 Double_t four4n2n1n1n = 0.; // <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>
2644 Double_t four3n1n2n2n = 0.; // <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>
2645 Double_t four3n1n3n1n = 0.; // <cos(n*(3.*phi1+phi2-3.*phi3-phi4))>
2649 four1n1n1n1n = (2.*dMult*(dMult-3.)+pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)-4.*(dMult-2.)*(pow(dReQ1n,2.)
2650 + pow(dImQ1n,2.))-2.*reQ2nQ1nstarQ1nstar+(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
2651 / (dMult*(dMult-1)*(dMult-2.)*(dMult-3.));
2652 four2n2n2n2n = (2.*dMult*(dMult-3.)+pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)-4.*(dMult-2.)*(pow(dReQ2n,2.)
2653 + pow(dImQ2n,2.))-2.*reQ4nQ2nstarQ2nstar+(pow(dReQ4n,2.)+pow(dImQ4n,2.)))
2654 / (dMult*(dMult-1)*(dMult-2.)*(dMult-3.));
2655 four2n1n2n1n = (dQ2nQ1nQ2nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar-2.*reQ2nQ1nstarQ1nstar)
2656 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2657 - ((dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
2658 + (dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-(pow(dReQ3n,2.)+pow(dImQ3n,2.)))
2659 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2660 + (dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.));
2661 four3n1n1n1n = (reQ3nQ1nstarQ1nstarQ1nstar-3.*reQ3nQ2nstarQ1nstar-3.*reQ2nQ1nstarQ1nstar)
2662 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2663 + (2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+3.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2664 + 6.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-6.*dMult)
2665 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2666 four4n2n1n1n = (reQ4nQ2nstarQ1nstarQ1nstar-2.*reQ4nQ3nstarQ1nstar-reQ4nQ2nstarQ2nstar-2.*reQ3nQ2nstarQ1nstar)
2667 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2668 - (reQ2nQ1nstarQ1nstar-2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2669 - 3.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2670 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2671 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
2672 four3n1n2n2n = (reQ3nQ1nQ2nstarQ2nstar-reQ4nQ2nstarQ2nstar-reQ3nQ1nQ4nstar-2.*reQ3nQ2nstarQ1nstar)
2673 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2674 - (2.*reQ1nQ1nQ2nstar-(pow(dReQ4n,2.)+pow(dImQ4n,2.))-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2675 - 4.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2676 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2677 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
2678 four3n1n3n1n = ((pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
2679 - 2.*reQ4nQ3nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar)
2680 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2681 + ((pow(dReQ4n,2.)+pow(dImQ4n,2.))-(dMult-4.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2682 + (pow(dReQ2n,2.)+pow(dImQ2n,2.))-(dMult-4.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2683 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2684 + (dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.));
2686 // average 4-particle correlations for single event:
2687 fIntFlowCorrelationsAllEBE->SetBinContent(11,four1n1n1n1n);
2688 fIntFlowCorrelationsAllEBE->SetBinContent(12,four2n1n2n1n);
2689 fIntFlowCorrelationsAllEBE->SetBinContent(13,four2n2n2n2n);
2690 fIntFlowCorrelationsAllEBE->SetBinContent(14,four3n1n1n1n);
2691 fIntFlowCorrelationsAllEBE->SetBinContent(15,four3n1n3n1n);
2692 fIntFlowCorrelationsAllEBE->SetBinContent(16,four3n1n2n2n);
2693 fIntFlowCorrelationsAllEBE->SetBinContent(17,four4n2n1n1n);
2695 // average 4-particle correlations for all events:
2696 fIntFlowCorrelationsAllPro->Fill(10.5,four1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2697 fIntFlowCorrelationsAllPro->Fill(11.5,four2n1n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2698 fIntFlowCorrelationsAllPro->Fill(12.5,four2n2n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2699 fIntFlowCorrelationsAllPro->Fill(13.5,four3n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2700 fIntFlowCorrelationsAllPro->Fill(14.5,four3n1n3n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2701 fIntFlowCorrelationsAllPro->Fill(15.5,four3n1n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2702 fIntFlowCorrelationsAllPro->Fill(16.5,four4n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2704 // store separetately <4> (to be improved: do I really need this?)
2705 fIntFlowCorrelationsEBE->SetBinContent(2,four1n1n1n1n); // <4>
2707 // to be improved (this can be implemented better):
2708 Double_t mWeight4p = 0.;
2709 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
2711 mWeight4p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.);
2712 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
2715 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2720 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(2,mWeight4p); // eW_<4>
2721 fIntFlowCorrelationsPro->Fill(1.5,four1n1n1n1n,mWeight4p);
2722 fIntFlowSquaredCorrelationsPro->Fill(1.5,four1n1n1n1n*four1n1n1n1n,mWeight4p);
2723 if(fCalculateCumulantsVsM)
2725 fIntFlowCorrelationsVsMPro[1]->Fill(dMult+0.5,four1n1n1n1n,mWeight4p);
2726 fIntFlowSquaredCorrelationsVsMPro[1]->Fill(dMult+0.5,four1n1n1n1n*four1n1n1n1n,mWeight4p);
2728 // distribution of <cos(n*(phi1+phi2-phi3-phi4))>
2729 //f4pDistribution->Fill(four1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2731 } // end of if(dMult>3)
2734 Double_t five2n1n1n1n1n = 0.; // <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>
2735 Double_t five2n2n2n1n1n = 0.; // <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>
2736 Double_t five3n1n2n1n1n = 0.; // <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>
2737 Double_t five4n1n1n1n1n = 0.; // <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>
2741 five2n1n1n1n1n = (reQ2nQ1nQ1nstarQ1nstarQ1nstar-reQ3nQ1nstarQ1nstarQ1nstar+6.*reQ3nQ2nstarQ1nstar)
2742 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2743 - (reQ2nQ1nQ3nstar+3.*(dMult-6.)*reQ2nQ1nstarQ1nstar+3.*reQ1nQ1nQ2nstar)
2744 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2745 - (2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2746 + 3.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2747 - 3.*(dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
2748 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2749 - 3.*(pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
2750 - 2.*(2*dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult*(dMult-4.))
2751 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2753 five2n2n2n1n1n = (reQ2nQ2nQ2nstarQ1nstarQ1nstar-reQ4nQ2nstarQ1nstarQ1nstar-2.*reQ2nQ2nQ3nstarQ1nstar)
2754 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2755 + 2.*(reQ4nQ2nstarQ2nstar+4.*reQ3nQ2nstarQ1nstar+reQ3nQ1nQ4nstar)
2756 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2757 + (reQ2nQ2nQ4nstar-2.*(dMult-5.)*reQ2nQ1nstarQ1nstar+2.*reQ1nQ1nQ2nstar)
2758 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2759 - (2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+4.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2760 + 1.*pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)
2761 - 2.*(3.*dMult-10.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
2762 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2763 - (4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2764 - 4.*(dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))+4.*dMult*(dMult-6.))
2765 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2767 five4n1n1n1n1n = (reQ4nQ1nstarQ1nstarQ1nstarQ1nstar-6.*reQ4nQ2nstarQ1nstarQ1nstar-4.*reQ3nQ1nstarQ1nstarQ1nstar)
2768 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2769 + (8.*reQ4nQ3nstarQ1nstar+3.*reQ4nQ2nstarQ2nstar+12.*reQ3nQ2nstarQ1nstar+12.*reQ2nQ1nstarQ1nstar)
2770 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2771 - (6.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+8.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2772 + 12.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))+24.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-24.*dMult)
2773 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2775 five3n1n2n1n1n = (reQ3nQ1nQ2nstarQ1nstarQ1nstar-reQ4nQ2nstarQ1nstarQ1nstar-reQ3nQ1nstarQ1nstarQ1nstar)
2776 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2777 - (reQ3nQ1nQ2nstarQ2nstar-3.*reQ4nQ3nstarQ1nstar-reQ4nQ2nstarQ2nstar)
2778 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2779 - ((2.*dMult-13.)*reQ3nQ2nstarQ1nstar-reQ3nQ1nQ4nstar-9.*reQ2nQ1nstarQ1nstar)
2780 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2781 - (2.*reQ1nQ1nQ2nstar+2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
2782 - 2.*(dMult-5.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+2.*(pow(dReQ3n,2.)
2783 + pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2784 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2785 + (2.*(dMult-6.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2786 - 2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
2787 - pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
2788 + 2.*(3.*dMult-11.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2789 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2790 - 4.*(dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2792 // average 5-particle correlations for single event:
2793 fIntFlowCorrelationsAllEBE->SetBinContent(19,five2n1n1n1n1n);
2794 fIntFlowCorrelationsAllEBE->SetBinContent(20,five2n2n2n1n1n);
2795 fIntFlowCorrelationsAllEBE->SetBinContent(21,five3n1n2n1n1n);
2796 fIntFlowCorrelationsAllEBE->SetBinContent(22,five4n1n1n1n1n);
2798 // average 5-particle correlations for all events:
2799 fIntFlowCorrelationsAllPro->Fill(18.5,five2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2800 fIntFlowCorrelationsAllPro->Fill(19.5,five2n2n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2801 fIntFlowCorrelationsAllPro->Fill(20.5,five3n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2802 fIntFlowCorrelationsAllPro->Fill(21.5,five4n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2803 } // end of if(dMult>4)
2806 Double_t six1n1n1n1n1n1n = 0.; // <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
2807 Double_t six2n2n1n1n1n1n = 0.; // <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>
2808 Double_t six3n1n1n1n1n1n = 0.; // <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>
2809 Double_t six2n1n1n2n1n1n = 0.; // <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>
2813 six1n1n1n1n1n1n = (pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),3.)+9.*dQ2nQ1nQ2nstarQ1nstar-6.*reQ2nQ1nQ1nstarQ1nstarQ1nstar)
2814 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))
2815 + 4.*(reQ3nQ1nstarQ1nstarQ1nstar-3.*reQ3nQ2nstarQ1nstar)
2816 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))
2817 + 2.*(9.*(dMult-4.)*reQ2nQ1nstarQ1nstar+2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.)))
2818 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))
2819 - 9.*(pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)+(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
2820 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-5.))
2821 + (18.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2822 / (dMult*(dMult-1)*(dMult-3)*(dMult-4))
2823 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
2825 six2n1n1n2n1n1n = (dQ2nQ1nQ1nQ2nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)
2826 * (2.*five2n2n2n1n1n+4.*five2n1n1n1n1n+4.*five3n1n2n1n1n+4.*four2n1n2n1n+1.*four1n1n1n1n)
2827 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four1n1n1n1n+4.*two1n1n
2828 + 2.*three2n1n1n+2.*three2n1n1n+4.*four3n1n1n1n+8.*three2n1n1n+2.*four4n2n1n1n
2829 + 4.*four2n1n2n1n+2.*two2n2n+8.*four2n1n2n1n+4.*four3n1n3n1n+8.*three3n2n1n
2830 + 4.*four3n1n2n2n+4.*four1n1n1n1n+4.*four2n1n2n1n+1.*four2n2n2n2n)
2831 - dMult*(dMult-1.)*(dMult-2.)*(2.*three2n1n1n+8.*two1n1n+4.*two1n1n+2.
2832 + 4.*two1n1n+4.*three2n1n1n+2.*two2n2n+4.*three2n1n1n+8.*three3n2n1n
2833 + 8.*two2n2n+4.*three4n3n1n+4.*two3n3n+4.*three3n2n1n+4.*two1n1n
2834 + 8.*three2n1n1n+4.*two1n1n+4.*three3n2n1n+4.*three2n1n1n+2.*two2n2n
2835 + 4.*three3n2n1n+2.*three4n2n2n)-dMult*(dMult-1.)
2836 * (4.*two1n1n+4.+4.*two1n1n+2.*two2n2n+1.+4.*two1n1n+4.*two2n2n+4.*two3n3n
2837 + 1.+2.*two2n2n+1.*two4n4n)-dMult)
2838 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)
2840 six2n2n1n1n1n1n = (reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)
2841 * (five4n1n1n1n1n+8.*five2n1n1n1n1n+6.*five2n2n2n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)
2842 * (4.*four3n1n1n1n+6.*four4n2n1n1n+12.*three2n1n1n+12.*four1n1n1n1n+24.*four2n1n2n1n
2843 + 4.*four3n1n2n2n+3.*four2n2n2n2n)-dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+12.*three3n2n1n
2844 + 4.*three4n3n1n+3.*three4n2n2n+8.*three2n1n1n+24.*two1n1n+12.*two2n2n+12.*three2n1n1n+8.*three3n2n1n
2845 + 1.*three4n2n2n)-dMult*(dMult-1.)*(4.*two1n1n+6.*two2n2n+4.*two3n3n+1.*two4n4n+2.*two2n2n+8.*two1n1n+6.)-dMult)
2846 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)
2848 six3n1n1n1n1n1n = (reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)
2849 * (five4n1n1n1n1n+4.*five2n1n1n1n1n+6.*five3n1n2n1n1n+4.*four3n1n1n1n)
2850 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four3n1n1n1n+6.*four4n2n1n1n+6.*four1n1n1n1n
2851 + 12.*three2n1n1n+12.*four2n1n2n1n+6.*four3n1n1n1n+12.*three3n2n1n+4.*four3n1n3n1n+3.*four3n1n2n2n)
2852 - dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+12.*three3n2n1n+4.*three4n3n1n+3.*three4n2n2n+4.*two1n1n
2853 + 12.*two1n1n+6.*three2n1n1n+12.*three2n1n1n+4.*three3n2n1n+12.*two2n2n+4.*three3n2n1n+4.*two3n3n+1.*three4n3n1n
2854 + 6.*three3n2n1n)-dMult*(dMult-1.)*(4.*two1n1n+6.*two2n2n+4.*two3n3n+1.*two4n4n+1.*two1n1n+4.+6.*two1n1n+4.*two2n2n
2855 + 1.*two3n3n)-dMult)/(dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)
2857 // average 6-particle correlations for single event:
2858 fIntFlowCorrelationsAllEBE->SetBinContent(24,six1n1n1n1n1n1n);
2859 fIntFlowCorrelationsAllEBE->SetBinContent(25,six2n1n1n2n1n1n);
2860 fIntFlowCorrelationsAllEBE->SetBinContent(26,six2n2n1n1n1n1n);
2861 fIntFlowCorrelationsAllEBE->SetBinContent(27,six3n1n1n1n1n1n);
2863 // average 6-particle correlations for all events:
2864 fIntFlowCorrelationsAllPro->Fill(23.5,six1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2865 fIntFlowCorrelationsAllPro->Fill(24.5,six2n1n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2866 fIntFlowCorrelationsAllPro->Fill(25.5,six2n2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2867 fIntFlowCorrelationsAllPro->Fill(26.5,six3n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2869 // store separetately <6> (to be improved: do I really need this?)
2870 fIntFlowCorrelationsEBE->SetBinContent(3,six1n1n1n1n1n1n); // <6>
2872 // to be improved (this can be implemented better):
2873 Double_t mWeight6p = 0.;
2874 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
2876 mWeight6p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.);
2877 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
2880 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2885 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(3,mWeight6p); // eW_<6>
2886 fIntFlowCorrelationsPro->Fill(2.5,six1n1n1n1n1n1n,mWeight6p);
2887 fIntFlowSquaredCorrelationsPro->Fill(2.5,six1n1n1n1n1n1n*six1n1n1n1n1n1n,mWeight6p);
2888 if(fCalculateCumulantsVsM)
2890 fIntFlowCorrelationsVsMPro[2]->Fill(dMult+0.5,six1n1n1n1n1n1n,mWeight6p);
2891 fIntFlowSquaredCorrelationsVsMPro[2]->Fill(dMult+0.5,six1n1n1n1n1n1n*six1n1n1n1n1n1n,mWeight6p);
2893 // distribution of <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
2894 //f6pDistribution->Fill(six1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2895 } // end of if(dMult>5)
2898 Double_t seven2n1n1n1n1n1n1n = 0.; // <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
2902 seven2n1n1n1n1n1n1n = (reQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)
2903 * (2.*six3n1n1n1n1n1n+4.*six1n1n1n1n1n1n+1.*six2n2n1n1n1n1n+6.*six2n1n1n2n1n1n+8.*five2n1n1n1n1n)
2904 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(1.*five4n1n1n1n1n +8.*five2n1n1n1n1n+8.*four3n1n1n1n
2905 + 12.*five3n1n2n1n1n+4.*five2n1n1n1n1n+3.*five2n2n2n1n1n+6.*five2n2n2n1n1n+6.*four1n1n1n1n+24.*four1n1n1n1n
2906 + 12.*five2n1n1n1n1n+12.*five2n1n1n1n1n+12.*three2n1n1n+24.*four2n1n2n1n+4.*five3n1n2n1n1n+4.*five2n1n1n1n1n)
2907 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four3n1n1n1n+6.*four4n2n1n1n+12.*four1n1n1n1n+24.*three2n1n1n
2908 + 24.*four2n1n2n1n+12.*four3n1n1n1n+24.*three3n2n1n+8.*four3n1n3n1n+6.*four3n1n2n2n+6.*three2n1n1n+12.*four1n1n1n1n
2909 + 12.*four2n1n2n1n+6.*three2n1n1n+12.*four2n1n2n1n+4.*four3n1n2n2n+3.*four2n2n2n2n+4.*four1n1n1n1n+6.*three2n1n1n
2910 + 24.*two1n1n+24.*four1n1n1n1n+4.*four3n1n1n1n+24.*two1n1n+24.*three2n1n1n+12.*two2n2n+24.*three2n1n1n+12.*four2n1n2n1n
2911 + 8.*three3n2n1n+8.*four2n1n2n1n+1.*four4n2n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+1.*three2n1n1n+8.*two1n1n
2912 + 12.*three3n2n1n+24.*two1n1n+12.*three2n1n1n+4.*three2n1n1n+8.*two1n1n+4.*three4n3n1n+24.*three2n1n1n+8.*three3n2n1n
2913 + 12.*two1n1n+12.*two1n1n+3.*three4n2n2n+24.*two2n2n+6.*two2n2n+12.+12.*three3n2n1n+8.*two3n3n+12.*three2n1n1n+24.*two1n1n
2914 + 4.*three3n2n1n+8.*three3n2n1n+2.*three4n3n1n+12.*two1n1n+8.*three2n1n1n+4.*three2n1n1n+2.*three3n2n1n+6.*two2n2n+8.*two2n2n
2915 + 1.*three4n2n2n+4.*three3n2n1n+6.*three2n1n1n)-dMult*(dMult-1.)*(4.*two1n1n+2.*two1n1n+6.*two2n2n+8.+1.*two2n2n+4.*two3n3n
2916 + 12.*two1n1n+4.*two1n1n+1.*two4n4n+8.*two2n2n+6.+2.*two3n3n+4.*two1n1n+1.*two2n2n)-dMult)
2917 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)); // to be improved (direct formula needed)
2919 // average 7-particle correlations for single event:
2920 fIntFlowCorrelationsAllEBE->SetBinContent(29,seven2n1n1n1n1n1n1n);
2922 // average 7-particle correlations for all events:
2923 fIntFlowCorrelationsAllPro->Fill(28.5,seven2n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.));
2924 } // end of if(dMult>6)
2927 Double_t eight1n1n1n1n1n1n1n1n = 0.; // <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
2930 eight1n1n1n1n1n1n1n1n = (pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),4.)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)
2931 * (12.*seven2n1n1n1n1n1n1n+16.*six1n1n1n1n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)
2932 * (8.*six3n1n1n1n1n1n+48.*six1n1n1n1n1n1n+6.*six2n2n1n1n1n1n+96.*five2n1n1n1n1n+72.*four1n1n1n1n+36.*six2n1n1n2n1n1n)
2933 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(2.*five4n1n1n1n1n+32.*five2n1n1n1n1n+36.*four1n1n1n1n
2934 + 32.*four3n1n1n1n+48.*five2n1n1n1n1n+48.*five3n1n2n1n1n+144.*five2n1n1n1n1n+288.*four1n1n1n1n+36.*five2n2n2n1n1n
2935 + 144.*three2n1n1n+96.*two1n1n+144.*four2n1n2n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)
2936 * (8.*four3n1n1n1n+48.*four1n1n1n1n+12.*four4n2n1n1n+96.*four2n1n2n1n+96.*three2n1n1n+72.*three2n1n1n+144.*two1n1n
2937 + 16.*four3n1n3n1n+48.*four3n1n1n1n+144.*four1n1n1n1n+72.*four1n1n1n1n+96.*three3n2n1n+24.*four3n1n2n2n+144.*four2n1n2n1n
2938 + 288.*two1n1n+288.*three2n1n1n+9.*four2n2n2n2n+72.*two2n2n+24.)-dMult*(dMult-1.)*(dMult-2.)*(12.*three2n1n1n+16.*two1n1n
2939 + 24.*three3n2n1n+48.*three2n1n1n+96.*two1n1n+8.*three4n3n1n+32.*three3n2n1n+96.*three2n1n1n+144.*two1n1n+6.*three4n2n2n
2940 + 96.*two2n2n+36.*two2n2n+72.+48.*three3n2n1n+16.*two3n3n+72.*three2n1n1n+144.*two1n1n)-dMult*(dMult-1.)*(8.*two1n1n
2941 + 12.*two2n2n+16.+8.*two3n3n+48.*two1n1n+1.*two4n4n+16.*two2n2n+18.)-dMult)
2942 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.)); // to be improved (direct formula needed)
2944 // average 8-particle correlations for single event:
2945 fIntFlowCorrelationsAllEBE->SetBinContent(31,eight1n1n1n1n1n1n1n1n);
2947 // average 8-particle correlations for all events:
2948 fIntFlowCorrelationsAllPro->Fill(30.5,eight1n1n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.));
2950 // store separetately <8> (to be improved: do I really need this?)
2951 fIntFlowCorrelationsEBE->SetBinContent(4,eight1n1n1n1n1n1n1n1n); // <8>
2953 // to be improved (this can be implemented better):
2954 Double_t mWeight8p = 0.;
2955 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
2957 mWeight8p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.);
2958 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
2961 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2966 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(4,mWeight8p); // eW_<8>
2967 fIntFlowCorrelationsPro->Fill(3.5,eight1n1n1n1n1n1n1n1n,mWeight8p);
2968 fIntFlowSquaredCorrelationsPro->Fill(3.5,eight1n1n1n1n1n1n1n1n*eight1n1n1n1n1n1n1n1n,mWeight8p);
2969 if(fCalculateCumulantsVsM)
2971 fIntFlowCorrelationsVsMPro[3]->Fill(dMult+0.5,eight1n1n1n1n1n1n1n1n,mWeight8p);
2972 fIntFlowSquaredCorrelationsVsMPro[3]->Fill(dMult+0.5,eight1n1n1n1n1n1n1n1n*eight1n1n1n1n1n1n1n1n,mWeight8p);
2974 // distribution of <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
2975 //f8pDistribution->Fill(eight1n1n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.));
2976 } // end of if(dMult>7)
2978 // EXTRA: // to be improved (reorganized)
2980 // 33rd bin: <4>_{4n,2n|3n,3n}= four4n2n3n3n = <cos(n*(4.*phi1+2.*phi2-3.*phi3-3.*phi4))>
2981 // 34th bin: <5>_{2n,2n,2n|3n,3n} = five2n2n2n3n3n = <cos(n*(2.*phi1+2.*phi2+2.*phi3-3.*phi4-3.*phi5))>
2984 Double_t four4n2n3n3n = 0.; // <cos(n*(4.*phi1+2.*phi2-3.*phi3-3.*phi4))>
2985 Double_t reQ4nQ2nQ3nstarQ3nstar = (dReQ4n*dReQ2n-dImQ4n*dImQ2n)*(dReQ3n*dReQ3n-dImQ3n*dImQ3n)
2986 + 2.*(dReQ4n*dImQ2n+dImQ4n*dReQ2n)*dReQ3n*dImQ3n;
2987 Double_t reQ6nQ4nstarQ2nstar = dReQ6n*dReQ4n*dReQ2n-dReQ6n*dImQ4n*dImQ2n+dImQ6n*dReQ4n*dImQ2n
2988 + dImQ6n*dImQ4n*dReQ2n;
2989 Double_t reQ6nQ3nstarQ3nstar = pow(dReQ3n,2.)*dReQ6n + 2.*dReQ3n*dImQ3n*dImQ6n
2990 - pow(dImQ3n,2.)*dReQ6n;
2993 four4n2n3n3n = (reQ4nQ2nQ3nstarQ3nstar-reQ6nQ4nstarQ2nstar-reQ6nQ3nstarQ3nstar
2994 - 2.*reQ4nQ3nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar
2995 + (pow(dReQ6n,2.)+pow(dImQ6n,2.))+2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
2996 + 2.*(2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2997 + (pow(dReQ1n,2.)+pow(dImQ1n,2.))-3.*dMult))
2998 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3000 fIntFlowCorrelationsAllPro->Fill(32.5,four4n2n3n3n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3001 } // end of if(dMult>3.)
3004 Double_t five2n2n2n3n3n = 0.; // <cos(n*(2.*phi1+2.*phi2+2.*phi3-3.*phi4-3.*phi5))>
3005 Double_t reQ2nQ2nQ2nQ3nstarQ3nstar = pow(dReQ2n,3.)*pow(dReQ3n,2.)
3006 - 3.*dReQ2n*pow(dReQ3n,2.)*pow(dImQ2n,2.)
3007 + 6.*pow(dReQ2n,2.)*dReQ3n*dImQ2n*dImQ3n
3008 - 2.*dReQ3n*pow(dImQ2n,3.)*dImQ3n-pow(dReQ2n,3.)*pow(dImQ3n,2.)
3009 + 3.*dReQ2n*pow(dImQ2n,2.)*pow(dImQ3n,2.);
3010 Double_t reQ2nQ2nQ2nQ6nstar = dReQ6n*pow(dReQ2n,3)-3.*dReQ2n*dReQ6n*pow(dImQ2n,2)
3011 + 3.*dImQ2n*dImQ6n*pow(dReQ2n,2)-dImQ6n*pow(dImQ2n,3);
3012 Double_t reQ2nQ2nQ1nstarQ3nstar = reQ3nQ1nQ2nstarQ2nstar;
3013 Double_t reQ4nQ2nQ6nstar = reQ6nQ4nstarQ2nstar;
3014 Double_t reQ4nQ1nstarQ3nstar = reQ3nQ1nQ4nstar;
3017 five2n2n2n3n3n = (reQ2nQ2nQ2nQ3nstarQ3nstar-reQ2nQ2nQ2nQ6nstar-3.*reQ4nQ2nQ3nstarQ3nstar
3018 - 6.*reQ2nQ2nQ1nstarQ3nstar+2.*reQ6nQ3nstarQ3nstar+3.*reQ4nQ2nQ6nstar
3019 + 6.*reQ4nQ1nstarQ3nstar+6.*reQ2nQ2nQ4nstar
3020 + 12.*reQ2nQ1nQ3nstar+6.*reQ2nQ1nstarQ1nstar
3021 - 2.*((pow(dReQ6n,2.)+pow(dImQ6n,2.))
3022 + 3.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
3023 + 6.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3024 + 9.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3025 + 6.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-12.*dMult))
3026 /(dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3028 fIntFlowCorrelationsAllPro->Fill(33.5,five2n2n2n3n3n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3029 } // end of if(dMult>4.)
3031 } // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelations()
3033 //================================================================================================================================
3035 void AliFlowAnalysisWithQCumulants::StorePhiDistributionForOneEvent(AliFlowEventSimple *anEvent)
3037 // Store phi distribution for one event to illustrate flow.
3039 if(fPhiDistributionForOneEvent->GetEntries()>0){return;} // store only phi distribution for one event
3041 Double_t vMin = fPhiDistributionForOneEventSettings[0];
3042 Double_t vMax = fPhiDistributionForOneEventSettings[1];
3043 Double_t refMultMin = fPhiDistributionForOneEventSettings[2];
3044 Double_t refMultMax = fPhiDistributionForOneEventSettings[3];
3047 Double_t cumulant4thEBE = fIntFlowCorrelationsEBE->GetBinContent(2)-2.*pow(fIntFlowCorrelationsEBE->GetBinContent(1),2.);
3048 if(cumulant4thEBE<0.)
3050 vEBE = pow(-1.*cumulant4thEBE,0.25);
3051 if((vEBE>vMin && vEBE<vMax) && (fReferenceMultiplicityEBE>refMultMin && fReferenceMultiplicityEBE<refMultMax))
3053 fPhiDistributionForOneEvent->SetTitle(Form("v_{%i} = %f",fHarmonic,vEBE));
3054 for(Int_t p=0;p<anEvent->NumberOfTracks();p++)
3056 if(anEvent->GetTrack(p)->InRPSelection())
3058 fPhiDistributionForOneEvent->Fill(anEvent->GetTrack(p)->Phi());
3060 } // end of for(Int_t p=0;p<anEvent->NumberOfTracks();p++)
3063 fPhiDistributionForOneEvent->SetTitle(Form("v_{%i} = %f, out of specified boundaries",fHarmonic,vEBE));
3066 } // end of if(cumulant4thEBE<0.)
3068 } // end of void AliFlowAnalysisWithQCumulants::StorePhiDistributionForOneEvent(AliFlowEventSimple *anEvent)
3070 //================================================================================================================================
3072 void AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrelations()
3074 // Calculate averages of products of correlations for integrated flow.
3077 Double_t dMult = (*fSMpk)(0,0);
3081 for(Int_t ci1=1;ci1<4;ci1++)
3083 for(Int_t ci2=ci1+1;ci2<=4;ci2++)
3085 fIntFlowProductOfCorrelationsPro->Fill(0.5+counter,
3086 fIntFlowCorrelationsEBE->GetBinContent(ci1)*
3087 fIntFlowCorrelationsEBE->GetBinContent(ci2),
3088 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
3089 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
3090 // products versus multiplicity: // [0=<<2><4>>,1=<<2><6>>,2=<<2><8>>,3=<<4><6>>,4=<<4><8>>,5=<<6><8>>]
3091 if(fCalculateCumulantsVsM)
3093 fIntFlowProductOfCorrelationsVsMPro[counter]->Fill(dMult+0.5, // to be improved: dMult => sum of weights ?
3094 fIntFlowCorrelationsEBE->GetBinContent(ci1)*
3095 fIntFlowCorrelationsEBE->GetBinContent(ci2),
3096 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
3097 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
3098 } // end of if(fCalculateCumulantsVsM)
3103 } // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrelations()
3106 //================================================================================================================================
3109 void AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrectionTermsForNUA()
3111 // Calculate averages of products of correction terms for NUA.
3113 // a) Binning of fIntFlowProductOfCorrectionTermsForNUAPro is organized as follows:
3114 // 1st bin: <<2><cos(phi)>>
3115 // 2nd bin: <<2><sin(phi)>>
3116 // 3rd bin: <<cos(phi)><sin(phi)>>
3117 // 4th bin: <<2><cos(phi1+phi2)>>
3118 // 5th bin: <<2><sin(phi1+phi2)>>
3119 // 6th bin: <<2><cos(phi1-phi2-phi3)>>
3120 // 7th bin: <<2><sin(phi1-phi2-phi3)>>
3121 // 8th bin: <<4><cos(phi1)>>
3122 // 9th bin: <<4><sin(phi1)>>
3123 // 10th bin: <<4><cos(phi1+phi2)>>
3124 // 11th bin: <<4><sin(phi1+phi2)>>
3125 // 12th bin: <<4><cos(phi1-phi2-phi3)>>
3126 // 13th bin: <<4><sin(phi1-phi2-phi3)>>
3127 // 14th bin: <<cos(phi1)><cos(phi1+phi2)>>
3128 // 15th bin: <<cos(phi1)><sin(phi1+phi2)>>
3129 // 16th bin: <<cos(phi1)><cos(phi1-phi2-phi3)>>
3130 // 17th bin: <<cos(phi1)><sin(phi1-phi2-phi3)>>
3131 // 18th bin: <<sin(phi1)><cos(phi1+phi2)>>
3132 // 19th bin: <<sin(phi1)><sin(phi1+phi2)>>
3133 // 20th bin: <<sin(phi1)><cos(phi1-phi2-phi3)>>
3134 // 21st bin: <<sin(phi1)><sin(phi1-phi2-phi3)>>
3135 // 22nd bin: <<cos(phi1+phi2)><sin(phi1+phi2)>>
3136 // 23rd bin: <<cos(phi1+phi2)><cos(phi1-phi2-phi3)>>
3137 // 24th bin: <<cos(phi1+phi2)><sin(phi1-phi2-phi3)>>
3138 // 25th bin: <<sin(phi1+phi2)><cos(phi1-phi2-phi3)>>
3139 // 26th bin: <<sin(phi1+phi2)><sin(phi1-phi2-phi3)>>
3140 // 27th bin: <<cos(phi1-phi2-phi3)><sin(phi1-phi2-phi3)>>
3143 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(0.5,
3144 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1),
3145 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3146 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
3148 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(1.5,
3149 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1),
3150 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3151 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
3152 // <<cos(phi)><sin(phi)>>:
3153 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(2.5,
3154 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1),
3155 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
3156 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
3157 // <<2><cos(phi1+phi2)>>:
3158 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(3.5,
3159 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
3160 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3161 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
3162 // <<2><sin(phi1+phi2)>>:
3163 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(4.5,
3164 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
3165 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3166 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
3167 // <<2><cos(phi1-phi2-phi3)>>:
3168 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(5.5,
3169 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3170 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3171 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3172 // <<2><sin(phi1-phi2-phi3)>>:
3173 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(6.5,
3174 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3175 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3176 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3177 // <<4><cos(phi1)>>:
3178 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(7.5,
3179 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1),
3180 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3181 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
3182 // <<4><sin(phi1)>>:
3183 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(8.5,
3184 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1),
3185 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3186 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
3187 // <<4><cos(phi1+phi2)>>:
3188 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(9.5,
3189 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
3190 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3191 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
3192 // <<4><sin(phi1+phi2)>>:
3193 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(10.5,
3194 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
3195 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3196 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
3197 // <<4><cos(phi1-phi2-phi3)>>:
3198 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(11.5,
3199 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3200 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3201 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3202 // <<4><sin(phi1-phi2-phi3)>>:
3203 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(12.5,
3204 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3205 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3206 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3207 // <<cos(phi1)><cos(phi1+phi2)>>:
3208 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(13.5,
3209 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
3210 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
3211 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
3212 // <<cos(phi1)><sin(phi1+phi2)>>:
3213 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(14.5,
3214 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
3215 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
3216 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
3217 // <<cos(phi1)><cos(phi1-phi2-phi3)>>:
3218 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(15.5,
3219 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3220 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
3221 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3222 // <<cos(phi1)><sin(phi1-phi2-phi3)>>:
3223 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(16.5,
3224 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3225 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
3226 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3227 // <<sin(phi1)><cos(phi1+phi2)>>:
3228 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(17.5,
3229 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
3230 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
3231 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
3232 // <<sin(phi1)><sin(phi1+phi2)>>:
3233 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(18.5,
3234 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
3235 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
3236 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
3237 // <<sin(phi1)><cos(phi1-phi2-phi3)>>:
3238 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(19.5,
3239 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3240 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
3241 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3242 // <<sin(phi1)><sin(phi1-phi2-phi3)>>:
3243 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(20.5,
3244 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3245 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
3246 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3247 // <<cos(phi1+phi2)><sin(phi1+phi2)>>:
3248 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(21.5,
3249 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
3250 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)
3251 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
3252 // <<cos(phi1+phi2)><cos(phi1-phi2-phi3)>>:
3253 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(22.5,
3254 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3255 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)
3256 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3257 // <<cos(phi1+phi2)><sin(phi1-phi2-phi3)>>:
3258 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(23.5,
3259 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3260 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)
3261 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3262 // <<sin(phi1+phi2)><cos(phi1-phi2-phi3)>>:
3263 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(24.5,
3264 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3265 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)
3266 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3267 // <<sin(phi1+phi2)><sin(phi1-phi2-phi3)>>:
3268 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(25.5,
3269 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3270 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)
3271 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3272 // <<cos(phi1-phi2-phi3)><sin(phi1-phi2-phi3)>>:
3273 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(26.5,
3274 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3275 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3)
3276 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3278 } // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrectionTermsForNUA()
3280 //================================================================================================================================
3282 void AliFlowAnalysisWithQCumulants::CalculateCovariancesIntFlow()
3284 // a) Calculate unbiased estimators Cov(<2>,<4>), Cov(<2>,<6>), Cov(<2>,<8>), Cov(<4>,<6>), Cov(<4>,<8>) and Cov(<6>,<8>)
3285 // for covariances V_(<2>,<4>), V_(<2>,<6>), V_(<2>,<8>), V_(<4>,<6>), V_(<4>,<8>) and V_(<6>,<8>).
3286 // b) Store in histogram fIntFlowCovariances for instance the following:
3288 // Cov(<2>,<4>) * (sum_{i=1}^{N} w_{<2>}_i w_{<4>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<4>}_j)]
3290 // where N is the number of events, w_{<2>} is event weight for <2> and w_{<4>} is event weight for <4>.
3291 // c) Binning of fIntFlowCovariances is organized as follows:
3293 // 1st bin: Cov(<2>,<4>) * (sum_{i=1}^{N} w_{<2>}_i w_{<4>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<4>}_j)]
3294 // 2nd bin: Cov(<2>,<6>) * (sum_{i=1}^{N} w_{<2>}_i w_{<6>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<6>}_j)]
3295 // 3rd bin: Cov(<2>,<8>) * (sum_{i=1}^{N} w_{<2>}_i w_{<8>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<8>}_j)]
3296 // 4th bin: Cov(<4>,<6>) * (sum_{i=1}^{N} w_{<4>}_i w_{<6>}_i )/[(sum_{i=1}^{N} w_{<4>}_i) * (sum_{j=1}^{N} w_{<6>}_j)]
3297 // 5th bin: Cov(<4>,<8>) * (sum_{i=1}^{N} w_{<4>}_i w_{<8>}_i )/[(sum_{i=1}^{N} w_{<4>}_i) * (sum_{j=1}^{N} w_{<8>}_j)]
3298 // 6th bin: Cov(<6>,<8>) * (sum_{i=1}^{N} w_{<6>}_i w_{<8>}_i )/[(sum_{i=1}^{N} w_{<6>}_i) * (sum_{j=1}^{N} w_{<8>}_j)]
3301 // Average 2-, 4-, 6- and 8-particle correlations for all events:
3302 Double_t correlation[4] = {0.};
3303 for(Int_t ci=0;ci<4;ci++)
3305 correlation[ci] = fIntFlowCorrelationsPro->GetBinContent(ci+1);
3307 // Average products of 2-, 4-, 6- and 8-particle correlations:
3308 Double_t productOfCorrelations[4][4] = {{0.}};
3309 Int_t productOfCorrelationsLabel = 1;
3310 // Denominators in the expressions for the unbiased estimator for covariance:
3311 Double_t denominator[4][4] = {{0.}};
3312 Int_t sumOfProductOfEventWeightsLabel1 = 1;
3313 // Weight dependent prefactor which multiply unbiased estimators for covariances:
3314 Double_t wPrefactor[4][4] = {{0.}};
3315 Int_t sumOfProductOfEventWeightsLabel2 = 1;
3316 for(Int_t c1=0;c1<4;c1++)
3318 for(Int_t c2=c1+1;c2<4;c2++)
3320 productOfCorrelations[c1][c2] = fIntFlowProductOfCorrelationsPro->GetBinContent(productOfCorrelationsLabel);
3321 if(TMath::Abs(fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1)) > 1.e-44 && TMath::Abs(fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1)) > 1.e-44)
3323 denominator[c1][c2] = 1.-(fIntFlowSumOfProductOfEventWeights->GetBinContent(sumOfProductOfEventWeightsLabel1))
3324 / (fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1)
3325 * fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1));
3326 wPrefactor[c1][c2] = fIntFlowSumOfProductOfEventWeights->GetBinContent(sumOfProductOfEventWeightsLabel2)
3327 / (fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1)
3328 * fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1));
3330 productOfCorrelationsLabel++; // to be improved - do I need here all 3 counters?
3331 sumOfProductOfEventWeightsLabel1++;
3332 sumOfProductOfEventWeightsLabel2++;
3333 } // end of for(Int_t c2=c1+1;c2<4;c2++)
3334 } // end of for(Int_t c1=0;c1<4;c1++)
3336 Int_t covarianceLabel = 1;
3337 for(Int_t c1=0;c1<4;c1++)
3339 for(Int_t c2=c1+1;c2<4;c2++)
3341 if(TMath::Abs(denominator[c1][c2]) > 1.e-44)
3344 Double_t cov = (productOfCorrelations[c1][c2]-correlation[c1]*correlation[c2])/denominator[c1][c2];
3345 // Covariances multiplied with weight dependent prefactor:
3346 Double_t wCov = cov * wPrefactor[c1][c2];
3347 fIntFlowCovariances->SetBinContent(covarianceLabel,wCov);
3350 } // end of for(Int_t c2=c1+1;c2<4;c2++)
3351 } // end of for(Int_t c1=0;c1<4;c1++)
3353 // Versus multiplicity:
3354 if(!fCalculateCumulantsVsM){return;}
3355 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
3356 for(Int_t b=1;b<=nBins;b++)
3358 // Average 2-, 4-, 6- and 8-particle correlations for all events:
3359 Double_t correlationVsM[4] = {0.};
3360 for(Int_t ci=0;ci<4;ci++)
3362 correlationVsM[ci] = fIntFlowCorrelationsVsMPro[ci]->GetBinContent(b);
3363 } // end of for(Int_t ci=0;ci<4;ci++)
3364 // Average products of 2-, 4-, 6- and 8-particle correlations:
3365 Double_t productOfCorrelationsVsM[4][4] = {{0.}};
3366 Int_t productOfCorrelationsLabelVsM = 1;
3367 // Denominators in the expressions for the unbiased estimator for covariance:
3368 Double_t denominatorVsM[4][4] = {{0.}};
3369 Int_t sumOfProductOfEventWeightsLabel1VsM = 1;
3370 // Weight dependent prefactor which multiply unbiased estimators for covariances:
3371 Double_t wPrefactorVsM[4][4] = {{0.}};
3372 Int_t sumOfProductOfEventWeightsLabel2VsM = 1;
3373 for(Int_t c1=0;c1<4;c1++)
3375 for(Int_t c2=c1+1;c2<4;c2++)
3377 productOfCorrelationsVsM[c1][c2] = fIntFlowProductOfCorrelationsVsMPro[productOfCorrelationsLabelVsM-1]->GetBinContent(b);
3378 if(TMath::Abs(fIntFlowSumOfEventWeightsVsM[c1][0]->GetBinContent(b)) > 1.e-44 && TMath::Abs(fIntFlowSumOfEventWeightsVsM[c2][0]->GetBinContent(b)) > 1.e-44)
3380 denominatorVsM[c1][c2] = 1.-(fIntFlowSumOfProductOfEventWeightsVsM[sumOfProductOfEventWeightsLabel1VsM-1]->GetBinContent(b))
3381 / (fIntFlowSumOfEventWeightsVsM[c1][0]->GetBinContent(b)
3382 * fIntFlowSumOfEventWeightsVsM[c2][0]->GetBinContent(b));
3383 wPrefactorVsM[c1][c2] = fIntFlowSumOfProductOfEventWeightsVsM[sumOfProductOfEventWeightsLabel2VsM-1]->GetBinContent(b)
3384 / (fIntFlowSumOfEventWeightsVsM[c1][0]->GetBinContent(b)
3385 * fIntFlowSumOfEventWeightsVsM[c2][0]->GetBinContent(b));
3387 productOfCorrelationsLabelVsM++;
3388 sumOfProductOfEventWeightsLabel1VsM++;
3389 sumOfProductOfEventWeightsLabel2VsM++;
3390 } // end of for(Int_t c1=0;c1<4;c1++)
3391 } // end of for(Int_t c2=c1+1;c2<4;c2++)
3393 Int_t covarianceLabelVsM = 1;
3394 for(Int_t c1=0;c1<4;c1++)
3396 for(Int_t c2=c1+1;c2<4;c2++)
3398 if(TMath::Abs(denominatorVsM[c1][c2]) > 1.e-44)
3401 Double_t covVsM = (productOfCorrelationsVsM[c1][c2]-correlationVsM[c1]*correlationVsM[c2])/denominatorVsM[c1][c2];
3402 // Covariances multiplied with weight dependent prefactor:
3403 Double_t wCovVsM = covVsM * wPrefactorVsM[c1][c2];
3404 fIntFlowCovariancesVsM[covarianceLabelVsM-1]->SetBinContent(b,wCovVsM);
3406 covarianceLabelVsM++;
3407 } // end of for(Int_t c2=c1+1;c2<4;c2++)
3408 } // end of for(Int_t c1=0;c1<4;c1++)
3409 } // end of for(Int_t b=1;b<=nBins;b++)
3411 } // end of AliFlowAnalysisWithQCumulants::CalculateCovariancesIntFlow()
3413 //================================================================================================================================
3415 void AliFlowAnalysisWithQCumulants::CalculateCovariancesNUAIntFlow()
3417 // a) Calculate unbiased estimators Cov(*,*) for true covariances V_(*,*) for NUA terms.
3418 // b) Store in histogram fIntFlowCovariancesNUA for instance the following:
3420 // Cov(<2>,<cos(phi)>) * (sum_{i=1}^{N} w_{<2>}_i w_{<cos(phi)>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<cos(phi)>}_j)]
3422 // where N is the number of events, w_{<2>} is event weight for <2> and w_{<cos(phi)>} is event weight for <cos(phi)>.
3423 // c) Binning of fIntFlowCovariancesNUA is organized as follows:
3425 // 1st bin: Cov(<2>,<cos(phi)>) * (sum_{i=1}^{N} w_{<2>}_i w_{<cos(phi)>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<cos(phi)>}_j)]
3426 // 2nd bin: Cov(<2>,<sin(phi)>) * (sum_{i=1}^{N} w_{<2>}_i w_{<sin(phi)>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<sin(phi)>}_j)]
3427 // 3rd bin: Cov(<cos(phi)>,<sin(phi)>) * (sum_{i=1}^{N} w_{<cos(phi)>}_i w_{<sin(phi)>}_i )/[(sum_{i=1}^{N} w_{<cos(phi)>}_i) * (sum_{j=1}^{N} w_{<sin(phi)>}_j)]
3430 // Cov(<2>,<cos(phi)>):
3431 Double_t product1 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(1); // <<2><cos(phi)>>
3432 Double_t term1st1 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3433 Double_t term2nd1 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi)>>
3434 Double_t sumOfW1st1 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3435 Double_t sumOfW2nd1 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi)>}
3436 Double_t sumOfWW1 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(1); // W_{<2>} * W_{<cos(phi)>}
3437 // numerator in the expression for the the unbiased estimator for covariance:
3438 Double_t numerator1 = product1 - term1st1*term2nd1;
3439 // denominator in the expression for the the unbiased estimator for covariance:
3440 Double_t denominator1 = 0.;
3441 if(TMath::Abs(sumOfW1st1*sumOfW2nd1)>0.)
3443 denominator1 = 1.-sumOfWW1/(sumOfW1st1*sumOfW2nd1);
3444 if(TMath::Abs(denominator1)>0.)
3447 Double_t covariance1 = numerator1/denominator1;
3448 // weight dependent prefactor for covariance:
3449 Double_t wPrefactor1 = sumOfWW1/(sumOfW1st1*sumOfW2nd1);
3450 // finally, store "weighted" covariance:
3451 fIntFlowCovariancesNUA->SetBinContent(1,wPrefactor1*covariance1);
3452 } // end of if(TMath::Abs(denominator)>0.)
3453 } // end of if(TMath::Abs(sumOfW1st1*sumOfW2nd1)>0.)
3455 // Cov(<2>,<sin(phi)>):
3456 Double_t product2 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(2); // <<2><sin(phi)>>
3457 Double_t term1st2 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3458 Double_t term2nd2 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi)>>
3459 Double_t sumOfW1st2 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3460 Double_t sumOfW2nd2 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi)>}
3461 Double_t sumOfWW2 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(2); // W_{<2>} * W_{<sin(phi)>}
3462 // numerator in the expression for the the unbiased estimator for covariance:
3463 Double_t numerator2 = product2 - term1st2*term2nd2;
3464 // denominator in the expression for the the unbiased estimator for covariance:
3465 Double_t denominator2 = 0.;
3466 if(TMath::Abs(sumOfW1st2*sumOfW2nd2)>0.)
3468 denominator2 = 1.-sumOfWW2/(sumOfW1st2*sumOfW2nd2);
3469 if(TMath::Abs(denominator2)>0.)
3472 Double_t covariance2 = numerator2/denominator2;
3473 // weight dependent prefactor for covariance:
3474 Double_t wPrefactor2 = sumOfWW2/(sumOfW1st2*sumOfW2nd2);
3475 // finally, store "weighted" covariance:
3476 fIntFlowCovariancesNUA->SetBinContent(2,wPrefactor2*covariance2);
3477 } // end of if(TMath::Abs(denominator2)>0.)
3478 } // end of if(TMath::Abs(sumOfW1st2*sumOfW2nd2)>0.)
3480 // Cov(<cos(phi)>,<sin(phi)>):
3481 Double_t product3 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(3); // <<cos(phi)><sin(phi)>>
3482 Double_t term1st3 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi)>>
3483 Double_t term2nd3 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi)>>
3484 Double_t sumOfW1st3 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi)>}
3485 Double_t sumOfW2nd3 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi)>}
3486 Double_t sumOfWW3 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(3); // W_{<cos(phi)>} * W_{<sin(phi)>}
3487 // numerator in the expression for the the unbiased estimator for covariance:
3488 Double_t numerator3 = product3 - term1st3*term2nd3;
3489 // denominator in the expression for the the unbiased estimator for covariance:
3490 Double_t denominator3 = 0;
3491 if(TMath::Abs(sumOfW1st3*sumOfW2nd3)>0.)
3493 denominator3 = 1.-sumOfWW3/(sumOfW1st3*sumOfW2nd3);
3494 if(TMath::Abs(denominator3)>0.)
3497 Double_t covariance3 = numerator3/denominator3;
3498 // weight dependent prefactor for covariance:
3499 Double_t wPrefactor3 = sumOfWW3/(sumOfW1st3*sumOfW2nd3);
3500 // finally, store "weighted" covariance:
3501 fIntFlowCovariancesNUA->SetBinContent(3,wPrefactor3*covariance3);
3502 } // end of if(TMath::Abs(denominator3)>0.)
3503 } // end of if(TMath::Abs(sumOfW1st3*sumOfW2nd3)>0.)
3505 // Cov(<2>,<cos(phi1+phi2)>):
3506 Double_t product4 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(4); // <<2><cos(phi1+phi2)>>
3507 Double_t term1st4 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3508 Double_t term2nd4 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3509 Double_t sumOfW1st4 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3510 Double_t sumOfW2nd4 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3511 Double_t sumOfWW4 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(4); // W_{<2>} * W_{<cos(phi1+phi2)>}
3512 // numerator in the expression for the the unbiased estimator for covariance:
3513 Double_t numerator4 = product4 - term1st4*term2nd4;
3514 // denominator in the expression for the the unbiased estimator for covariance:
3515 Double_t denominator4 = 0.;
3516 if(TMath::Abs(sumOfW1st4*sumOfW2nd4)>0.)
3518 denominator4 = 1.-sumOfWW4/(sumOfW1st4*sumOfW2nd4);
3519 if(TMath::Abs(denominator4)>0.)
3522 Double_t covariance4 = numerator4/denominator4;
3523 // weight dependent prefactor for covariance:
3524 Double_t wPrefactor4 = sumOfWW4/(sumOfW1st4*sumOfW2nd4);
3525 // finally, store "weighted" covariance:
3526 fIntFlowCovariancesNUA->SetBinContent(4,wPrefactor4*covariance4);
3527 } // end of if(TMath::Abs(denominator4)>0.)
3528 } // end of if(TMath::Abs(sumOfW1st4*sumOfW2nd4)>0.)
3530 // Cov(<2>,<sin(phi1+phi2)>):
3531 Double_t product5 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(5); // <<2><sin(phi1+phi2)>>
3532 Double_t term1st5 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3533 Double_t term2nd5 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3534 Double_t sumOfW1st5 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3535 Double_t sumOfW2nd5 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3536 Double_t sumOfWW5 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(5); // W_{<2>} * W_{<sin(phi1+phi2)>}
3537 // numerator in the expression for the the unbiased estimator for covariance:
3538 Double_t numerator5 = product5 - term1st5*term2nd5;
3539 // denominator in the expression for the the unbiased estimator for covariance:
3540 Double_t denominator5 = 0.;
3541 if(TMath::Abs(sumOfW1st5*sumOfW2nd5)>0.)
3543 denominator5 = 1.-sumOfWW5/(sumOfW1st5*sumOfW2nd5);
3544 if(TMath::Abs(denominator5)>0.)
3547 Double_t covariance5 = numerator5/denominator5;
3548 // weight dependent prefactor for covariance:
3549 Double_t wPrefactor5 = sumOfWW5/(sumOfW1st5*sumOfW2nd5);
3550 // finally, store "weighted" covariance:
3551 fIntFlowCovariancesNUA->SetBinContent(5,wPrefactor5*covariance5);
3552 } // end of if(TMath::Abs(denominator5)>0.)
3553 } // end of if(TMath::Abs(sumOfW1st5*sumOfW2nd5)>0.)
3555 // Cov(<2>,<cos(phi1-phi2-phi3)>):
3556 Double_t product6 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(6); // <<2><cos(phi1-phi2-phi3)>>
3557 Double_t term1st6 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3558 Double_t term2nd6 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3559 Double_t sumOfW1st6 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3560 Double_t sumOfW2nd6 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3561 Double_t sumOfWW6 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(6); // W_{<2>} * W_{<cos(phi1-phi2-phi3)>}
3562 // numerator in the expression for the the unbiased estimator for covariance:
3563 Double_t numerator6 = product6 - term1st6*term2nd6;
3564 // denominator in the expression for the the unbiased estimator for covariance:
3565 Double_t denominator6 = 0.;
3566 if(TMath::Abs(sumOfW1st6*sumOfW2nd6)>0.)
3568 denominator6 = 1.-sumOfWW6/(sumOfW1st6*sumOfW2nd6);
3569 if(TMath::Abs(denominator6)>0.)
3572 Double_t covariance6 = numerator6/denominator6;
3573 // weight dependent prefactor for covariance:
3574 Double_t wPrefactor6 = sumOfWW6/(sumOfW1st6*sumOfW2nd6);
3575 // finally, store "weighted" covariance:
3576 fIntFlowCovariancesNUA->SetBinContent(6,wPrefactor6*covariance6);
3577 } // end of if(TMath::Abs(denominator6)>0.)
3578 } // end of if(TMath::Abs(sumOfW1st6*sumOfW2nd6)>0.)
3580 // Cov(<2>,<sin(phi1-phi2-phi3)>):
3581 Double_t product7 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(7); // <<2><sin(phi1-phi2-phi3)>>
3582 Double_t term1st7 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3583 Double_t term2nd7 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3584 Double_t sumOfW1st7 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3585 Double_t sumOfW2nd7 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3586 Double_t sumOfWW7 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(7); // W_{<2>} * W_{<sin(phi1-phi2-phi3)>}
3587 // numerator in the expression for the the unbiased estimator for covariance:
3588 Double_t numerator7 = product7 - term1st7*term2nd7;
3589 // denominator in the expression for the the unbiased estimator for covariance:
3590 Double_t denominator7 = 0.;
3591 if(TMath::Abs(sumOfW1st7*sumOfW2nd7)>0.)
3593 denominator7 = 1.-sumOfWW7/(sumOfW1st7*sumOfW2nd7);
3594 if(TMath::Abs(denominator7)>0.)
3597 Double_t covariance7 = numerator7/denominator7;
3598 // weight dependent prefactor for covariance:
3599 Double_t wPrefactor7 = sumOfWW7/(sumOfW1st7*sumOfW2nd7);
3600 // finally, store "weighted" covariance:
3601 fIntFlowCovariancesNUA->SetBinContent(7,wPrefactor7*covariance7);
3602 } // end of if(TMath::Abs(denominator7)>0.)
3603 } // end of if(TMath::Abs(sumOfW1st7*sumOfW2nd7)>0.)
3605 // Cov(<4>,<cos(phi1>):
3606 Double_t product8 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(8); // <<4><cos(phi1)>>
3607 Double_t term1st8 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3608 Double_t term2nd8 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
3609 Double_t sumOfW1st8 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3610 Double_t sumOfW2nd8 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
3611 Double_t sumOfWW8 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(8); // W_{<4>} * W_{<cos(phi1)>}
3612 // numerator in the expression for the the unbiased estimator for covariance:
3613 Double_t numerator8 = product8 - term1st8*term2nd8;
3614 // denominator in the expression for the the unbiased estimator for covariance:
3615 Double_t denominator8 = 0.;
3616 if(TMath::Abs(sumOfW1st8*sumOfW2nd8)>0.)
3618 denominator8 = 1.-sumOfWW8/(sumOfW1st8*sumOfW2nd8);
3619 if(TMath::Abs(denominator8)>0.)
3622 Double_t covariance8 = numerator8/denominator8;
3623 // weight dependent prefactor for covariance:
3624 Double_t wPrefactor8 = sumOfWW8/(sumOfW1st8*sumOfW2nd8);
3625 // finally, store "weighted" covariance:
3626 fIntFlowCovariancesNUA->SetBinContent(8,wPrefactor8*covariance8);
3627 } // end of if(TMath::Abs(denominator8)>0.)
3628 } // end of if(TMath::Abs(sumOfW1st8*sumOfW2nd8)>0.)
3630 // Cov(<4>,<sin(phi1)>):
3631 Double_t product9 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(9); // <<4><sin(phi1)>>
3632 Double_t term1st9 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3633 Double_t term2nd9 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
3634 Double_t sumOfW1st9 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3635 Double_t sumOfW2nd9 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
3636 Double_t sumOfWW9 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(9); // W_{<4>} * W_{<sin(phi1)>}
3637 // numerator in the expression for the the unbiased estimator for covariance:
3638 Double_t numerator9 = product9 - term1st9*term2nd9;
3639 // denominator in the expression for the the unbiased estimator for covariance:
3640 Double_t denominator9 = 0.;
3641 if(TMath::Abs(sumOfW1st9*sumOfW2nd9)>0.)
3643 denominator9 = 1.-sumOfWW9/(sumOfW1st9*sumOfW2nd9);
3644 if(TMath::Abs(denominator9)>0.)
3647 Double_t covariance9 = numerator9/denominator9;
3648 // weight dependent prefactor for covariance:
3649 Double_t wPrefactor9 = sumOfWW9/(sumOfW1st9*sumOfW2nd9);
3650 // finally, store "weighted" covariance:
3651 fIntFlowCovariancesNUA->SetBinContent(9,wPrefactor9*covariance9);
3653 } // end of if(TMath::Abs(sumOfW1st9*sumOfW2nd9)>0.)
3655 // Cov(<4>,<cos(phi1+phi2)>):
3656 Double_t product10 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(10); // <<4><cos(phi1+phi2)>>
3657 Double_t term1st10 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3658 Double_t term2nd10 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3659 Double_t sumOfW1st10 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3660 Double_t sumOfW2nd10 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3661 Double_t sumOfWW10 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(10); // W_{<4>} * W_{<cos(phi1+phi2)>}
3662 // numerator in the expression for the the unbiased estimator for covariance:
3663 Double_t numerator10 = product10 - term1st10*term2nd10;
3664 // denominator in the expression for the the unbiased estimator for covariance:
3665 Double_t denominator10 = 0.;
3666 if(TMath::Abs(sumOfW1st10*sumOfW2nd10)>0.)
3668 denominator10 = 1.-sumOfWW10/(sumOfW1st10*sumOfW2nd10);
3669 if(TMath::Abs(denominator10)>0.)
3672 Double_t covariance10 = numerator10/denominator10;
3673 // weight dependent prefactor for covariance:
3674 Double_t wPrefactor10 = sumOfWW10/(sumOfW1st10*sumOfW2nd10);
3675 // finally, store "weighted" covariance:
3676 fIntFlowCovariancesNUA->SetBinContent(10,wPrefactor10*covariance10);
3677 } // end of if(TMath::Abs(denominator10)>0.)
3678 } // end of if(TMath::Abs(sumOfW1st10*sumOfW2nd10)>0.)
3680 // Cov(<4>,<sin(phi1+phi2)>):
3681 Double_t product11 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(11); // <<4><sin(phi1+phi2)>>
3682 Double_t term1st11 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3683 Double_t term2nd11 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3684 Double_t sumOfW1st11 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3685 Double_t sumOfW2nd11 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3686 Double_t sumOfWW11 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(11); // W_{<4>} * W_{<sin(phi1+phi2)>}
3687 // numerator in the expression for the the unbiased estimator for covariance:
3688 Double_t numerator11 = product11 - term1st11*term2nd11;
3689 // denominator in the expression for the the unbiased estimator for covariance:
3690 Double_t denominator11 = 0.;
3691 if(TMath::Abs(sumOfW1st11*sumOfW2nd11)>0.)
3693 denominator11 = 1.-sumOfWW11/(sumOfW1st11*sumOfW2nd11);
3694 if(TMath::Abs(denominator11)>0.)
3697 Double_t covariance11 = numerator11/denominator11;
3698 // weight dependent prefactor for covariance:
3699 Double_t wPrefactor11 = sumOfWW11/(sumOfW1st11*sumOfW2nd11);
3700 // finally, store "weighted" covariance:
3701 fIntFlowCovariancesNUA->SetBinContent(11,wPrefactor11*covariance11);
3702 } // end of if(TMath::Abs(denominator11)>0.)
3703 } // end of if(TMath::Abs(sumOfW1st11*sumOfW2nd11)>0.)
3705 // Cov(<4>,<cos(phi1-phi2-phi3)>):
3706 Double_t product12 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(12); // <<4><cos(phi1-phi2-phi3)>>
3707 Double_t term1st12 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3708 Double_t term2nd12 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3709 Double_t sumOfW1st12 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3710 Double_t sumOfW2nd12 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3711 Double_t sumOfWW12 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(12); // W_{<4>} * W_{<cos(phi1-phi2-phi3)>}
3712 // numerator in the expression for the the unbiased estimator for covariance:
3713 Double_t numerator12 = product12 - term1st12*term2nd12;
3714 // denominator in the expression for the the unbiased estimator for covariance:
3715 Double_t denominator12 = 0.;
3716 if(TMath::Abs(sumOfW1st12*sumOfW2nd12)>0.)
3718 denominator12 = 1.-sumOfWW12/(sumOfW1st12*sumOfW2nd12);
3719 if(TMath::Abs(denominator12)>0.)
3722 Double_t covariance12 = numerator12/denominator12;
3723 // weight dependent prefactor for covariance:
3724 Double_t wPrefactor12 = sumOfWW12/(sumOfW1st12*sumOfW2nd12);
3725 // finally, store "weighted" covariance:
3726 fIntFlowCovariancesNUA->SetBinContent(12,wPrefactor12*covariance12);
3727 } // end of if(TMath::Abs(denominator12)>0.)
3728 } // end of if(TMath::Abs(sumOfW1st12*sumOfW2nd12)>0.)
3730 // Cov(<4>,<sin(phi1-phi2-phi3)>):
3731 Double_t product13 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(13); // <<4><sin(phi1-phi2-phi3)>>
3732 Double_t term1st13 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3733 Double_t term2nd13 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3734 Double_t sumOfW1st13 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3735 Double_t sumOfW2nd13 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3736 Double_t sumOfWW13 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(13); // W_{<4>} * W_{<sin(phi1-phi2-phi3)>}
3737 // numerator in the expression for the the unbiased estimator for covariance:
3738 Double_t numerator13 = product13 - term1st13*term2nd13;
3739 // denominator in the expression for the the unbiased estimator for covariance:
3740 Double_t denominator13 = 0.;
3741 if(TMath::Abs(sumOfW1st13*sumOfW2nd13)>0.)
3743 denominator13 = 1.-sumOfWW13/(sumOfW1st13*sumOfW2nd13);
3744 if(TMath::Abs(denominator13)>0.)
3747 Double_t covariance13 = numerator13/denominator13;
3748 // weight dependent prefactor for covariance:
3749 Double_t wPrefactor13 = sumOfWW13/(sumOfW1st13*sumOfW2nd13);
3750 // finally, store "weighted" covariance:
3751 fIntFlowCovariancesNUA->SetBinContent(13,wPrefactor13*covariance13);
3752 } // end of if(TMath::Abs(denominator13)>0.)
3753 } // end of if(TMath::Abs(sumOfW1st13*sumOfW2nd13)>0.)
3755 // Cov(<cos(phi1)>,<cos(phi1+phi2)>):
3756 Double_t product14 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(14); // <<cos(phi1)><cos(phi1+phi2)>>
3757 Double_t term1st14 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
3758 Double_t term2nd14 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3759 Double_t sumOfW1st14 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
3760 Double_t sumOfW2nd14 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3761 Double_t sumOfWW14 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(14); // W_{<cos(phi1)>} * W_{<cos(phi1+phi2)>}
3762 // numerator in the expression for the the unbiased estimator for covariance:
3763 Double_t numerator14 = product14 - term1st14*term2nd14;
3764 // denominator in the expression for the the unbiased estimator for covariance:
3765 Double_t denominator14 = 0.;
3766 if(TMath::Abs(sumOfW1st14*sumOfW2nd14)>0.)
3768 denominator14 = 1.-sumOfWW14/(sumOfW1st14*sumOfW2nd14);
3769 if(TMath::Abs(denominator14)>0.)
3772 Double_t covariance14 = numerator14/denominator14;
3773 // weight dependent prefactor for covariance:
3774 Double_t wPrefactor14 = sumOfWW14/(sumOfW1st14*sumOfW2nd14);
3775 // finally, store "weighted" covariance:
3776 fIntFlowCovariancesNUA->SetBinContent(14,wPrefactor14*covariance14);
3777 } // end of if(TMath::Abs(denominator14)>0.)
3778 } // end of if(TMath::Abs(sumOfW1st14*sumOfW2nd14)>0.)
3780 // Cov(<cos(phi1)>,<sin(phi1+phi2)>):
3781 Double_t product15 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(15); // <<cos(phi1)><sin(phi1+phi2)>>
3782 Double_t term1st15 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
3783 Double_t term2nd15 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3784 Double_t sumOfW1st15 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
3785 Double_t sumOfW2nd15 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3786 Double_t sumOfWW15 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(15); // W_{<cos(phi1)>} * W_{<sin(phi1+phi2)>}
3787 // numerator in the expression for the the unbiased estimator for covariance:
3788 Double_t numerator15 = product15 - term1st15*term2nd15;
3789 // denominator in the expression for the the unbiased estimator for covariance:
3790 Double_t denominator15 = 0.;
3791 if(TMath::Abs(sumOfW1st15*sumOfW2nd15)>0.)
3793 denominator15 = 1.-sumOfWW15/(sumOfW1st15*sumOfW2nd15);
3794 if(TMath::Abs(denominator15)>0.)
3797 Double_t covariance15 = numerator15/denominator15;
3798 // weight dependent prefactor for covariance:
3799 Double_t wPrefactor15 = sumOfWW15/(sumOfW1st15*sumOfW2nd15);
3800 // finally, store "weighted" covariance:
3801 fIntFlowCovariancesNUA->SetBinContent(15,wPrefactor15*covariance15);
3802 } // end of if(TMath::Abs(denominator15)>0.)
3803 } // end of if(TMath::Abs(sumOfW1st15*sumOfW2nd15)>0.)
3805 // Cov(<cos(phi1)>,<cos(phi1-phi2-phi3)>):
3806 Double_t product16 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(16); // <<cos(phi1)><cos(phi1-phi2-phi3)>>
3807 Double_t term1st16 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
3808 Double_t term2nd16 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3809 Double_t sumOfW1st16 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
3810 Double_t sumOfW2nd16 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3811 Double_t sumOfWW16 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(16); // W_{<cos(phi1)>} * W_{<cos(phi1-phi2-phi3)>}
3812 // numerator in the expression for the the unbiased estimator for covariance:
3813 Double_t numerator16 = product16 - term1st16*term2nd16;
3814 // denominator in the expression for the the unbiased estimator for covariance:
3815 Double_t denominator16 = 0.;
3816 if(TMath::Abs(sumOfW1st16*sumOfW2nd16)>0.)
3818 denominator16 = 1.-sumOfWW16/(sumOfW1st16*sumOfW2nd16);
3819 if(TMath::Abs(denominator16)>0.)
3822 Double_t covariance16 = numerator16/denominator16;
3823 // weight dependent prefactor for covariance:
3824 Double_t wPrefactor16 = sumOfWW16/(sumOfW1st16*sumOfW2nd16);
3825 // finally, store "weighted" covariance:
3826 fIntFlowCovariancesNUA->SetBinContent(16,wPrefactor16*covariance16);
3827 } // end of if(TMath::Abs(denominator16)>0.)
3828 } // end ofif(TMath::Abs(sumOfW1st16*sumOfW2nd16)>0.)
3830 // Cov(<cos(phi1)>,<sin(phi1-phi2-phi3)>):
3831 Double_t product17 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(17); // <<cos(phi1)><sin(phi1-phi2-phi3)>>
3832 Double_t term1st17 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
3833 Double_t term2nd17 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3834 Double_t sumOfW1st17 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
3835 Double_t sumOfW2nd17 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3836 Double_t sumOfWW17 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(17); // W_{<cos(phi1)>} * W_{<sin(phi1-phi2-phi3)>}
3837 // numerator in the expression for the the unbiased estimator for covariance:
3838 Double_t numerator17 = product17 - term1st17*term2nd17;
3839 // denominator in the expression for the the unbiased estimator for covariance:
3840 Double_t denominator17 = 0.;
3841 if(TMath::Abs(sumOfW1st17*sumOfW2nd17)>0.)
3843 denominator17 = 1.-sumOfWW17/(sumOfW1st17*sumOfW2nd17);
3844 if(TMath::Abs(denominator17)>0.)
3847 Double_t covariance17 = numerator17/denominator17;
3848 // weight dependent prefactor for covariance:
3849 Double_t wPrefactor17 = sumOfWW17/(sumOfW1st17*sumOfW2nd17);
3850 // finally, store "weighted" covariance:
3851 fIntFlowCovariancesNUA->SetBinContent(17,wPrefactor17*covariance17);
3852 } // end of if(TMath::Abs(denominator17)>0.)
3853 } // end of if(TMath::Abs(sumOfW1st17*sumOfW2nd17)>0.)
3855 // Cov(<sin(phi1)>,<cos(phi1+phi2)>):
3856 Double_t product18 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(18); // <<sin(phi1)><cos(phi1+phi2)>>
3857 Double_t term1st18 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
3858 Double_t term2nd18 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3859 Double_t sumOfW1st18 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
3860 Double_t sumOfW2nd18 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3861 Double_t sumOfWW18 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(18); // W_{<sin(phi1)>} * W_{<cos(phi1+phi2)>}
3862 // numerator in the expression for the the unbiased estimator for covariance:
3863 Double_t numerator18 = product18 - term1st18*term2nd18;
3864 // denominator in the expression for the the unbiased estimator for covariance:
3865 Double_t denominator18 = 0.;
3866 if(TMath::Abs(sumOfW1st18*sumOfW2nd18)>0.)
3868 denominator18 = 1.-sumOfWW18/(sumOfW1st18*sumOfW2nd18);
3869 if(TMath::Abs(denominator18)>0.)
3872 Double_t covariance18 = numerator18/denominator18;
3873 // weight dependent prefactor for covariance:
3874 Double_t wPrefactor18 = sumOfWW18/(sumOfW1st18*sumOfW2nd18);
3875 // finally, store "weighted" covariance:
3876 fIntFlowCovariancesNUA->SetBinContent(18,wPrefactor18*covariance18);
3877 } // end of if(TMath::Abs(denominator18)>0.)
3878 } // end of if(TMath::Abs(sumOfW1st18*sumOfW2nd18)>0.)
3880 // Cov(<sin(phi1)>,<sin(phi1+phi2)>):
3881 Double_t product19 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(19); // <<sin(phi1)><sin(phi1+phi2)>>
3882 Double_t term1st19 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
3883 Double_t term2nd19 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3884 Double_t sumOfW1st19 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
3885 Double_t sumOfW2nd19 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3886 Double_t sumOfWW19 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(19); // W_{<sin(phi1)>} * W_{<sin(phi1+phi2)>}
3887 // numerator in the expression for the the unbiased estimator for covariance:
3888 Double_t numerator19 = product19 - term1st19*term2nd19;
3889 // denominator in the expression for the the unbiased estimator for covariance:
3890 Double_t denominator19 = 0.;
3891 if(TMath::Abs(sumOfW1st19*sumOfW2nd19)>0.)
3893 denominator19 = 1.-sumOfWW19/(sumOfW1st19*sumOfW2nd19);
3894 if(TMath::Abs(denominator19)>0.)
3897 Double_t covariance19 = numerator19/denominator19;
3898 // weight dependent prefactor for covariance:
3899 Double_t wPrefactor19 = sumOfWW19/(sumOfW1st19*sumOfW2nd19);
3900 // finally, store "weighted" covariance:
3901 fIntFlowCovariancesNUA->SetBinContent(19,wPrefactor19*covariance19);
3902 } // end of if(TMath::Abs(denominator19)>0.)
3903 } // end of if(TMath::Abs(sumOfW1st19*sumOfW2nd19)>0.)
3905 // Cov(<sin(phi1)>,<cos(phi1-phi2-phi3)>):
3906 Double_t product20 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(20); // <<sin(phi1)><cos(phi1-phi2-phi3)>>
3907 Double_t term1st20 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
3908 Double_t term2nd20 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3909 Double_t sumOfW1st20 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
3910 Double_t sumOfW2nd20 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3911 Double_t sumOfWW20 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(20); // W_{<sin(phi1)>} * W_{<cos(phi1-phi2-phi3)>}
3912 // numerator in the expression for the the unbiased estimator for covariance:
3913 Double_t numerator20 = product20 - term1st20*term2nd20;
3914 // denominator in the expression for the the unbiased estimator for covariance:
3915 Double_t denominator20 = 0.;
3916 if(TMath::Abs(sumOfW1st20*sumOfW2nd20)>0.)
3918 denominator20 = 1.-sumOfWW20/(sumOfW1st20*sumOfW2nd20);
3919 if(TMath::Abs(denominator20)>0.)
3922 Double_t covariance20 = numerator20/denominator20;
3923 // weight dependent prefactor for covariance:
3924 Double_t wPrefactor20 = sumOfWW20/(sumOfW1st20*sumOfW2nd20);
3925 // finally, store "weighted" covariance:
3926 fIntFlowCovariancesNUA->SetBinContent(20,wPrefactor20*covariance20);
3927 } // end of if(TMath::Abs(denominator20)>0.)
3928 } // end of if(TMath::Abs(sumOfW1st20*sumOfW2nd20)>0.)
3930 // Cov(<sin(phi1)>,<sin(phi1-phi2-phi3)>):
3931 Double_t product21 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(21); // <<sin(phi1)><sin(phi1-phi2-phi3)>>
3932 Double_t term1st21 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
3933 Double_t term2nd21 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3934 Double_t sumOfW1st21 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
3935 Double_t sumOfW2nd21 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3936 Double_t sumOfWW21 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(21); // W_{<sin(phi1)>} * W_{<sin(phi1-phi2-phi3)>}
3937 // numerator in the expression for the the unbiased estimator for covariance:
3938 Double_t numerator21 = product21 - term1st21*term2nd21;
3939 // denominator in the expression for the the unbiased estimator for covariance:
3940 Double_t denominator21 = 0.;
3941 if(TMath::Abs(sumOfW1st21*sumOfW2nd21)>0.)
3943 denominator21 = 1.-sumOfWW21/(sumOfW1st21*sumOfW2nd21);
3944 if(TMath::Abs(denominator21)>0.)
3947 Double_t covariance21 = numerator21/denominator21;
3948 // weight dependent prefactor for covariance:
3949 Double_t wPrefactor21 = sumOfWW21/(sumOfW1st21*sumOfW2nd21);
3950 // finally, store "weighted" covariance:
3951 fIntFlowCovariancesNUA->SetBinContent(21,wPrefactor21*covariance21);
3952 } // end of if(TMath::Abs(denominator21)>0.)
3953 } // end of if(TMath::Abs(sumOfW1st21*sumOfW2nd21)>0.)
3955 // Cov(<cos(phi1+phi2)>,<sin(phi1+phi2)>):
3956 Double_t product22 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(22); // <<cos(phi1+phi2)><sin(phi1+phi2)>>
3957 Double_t term1st22 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3958 Double_t term2nd22 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3959 Double_t sumOfW1st22 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3960 Double_t sumOfW2nd22 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3961 Double_t sumOfWW22 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(22); // W_{<cos(phi1+phi2)>} * W_{<sin(phi1+phi2)>}
3962 // numerator in the expression for the the unbiased estimator for covariance:
3963 Double_t numerator22 = product22 - term1st22*term2nd22;
3964 // denominator in the expression for the the unbiased estimator for covariance:
3965 Double_t denominator22 = 0.;
3966 if(TMath::Abs(sumOfW1st22*sumOfW2nd22)>0.)
3968 denominator22 = 1.-sumOfWW22/(sumOfW1st22*sumOfW2nd22);
3969 if(TMath::Abs(denominator22)>0.)
3972 Double_t covariance22 = numerator22/denominator22;
3973 // weight dependent prefactor for covariance:
3974 Double_t wPrefactor22 = sumOfWW22/(sumOfW1st22*sumOfW2nd22);
3975 // finally, store "weighted" covariance:
3976 fIntFlowCovariancesNUA->SetBinContent(22,wPrefactor22*covariance22);
3977 } // end of if(TMath::Abs(denominator22)>0.)
3978 } // end of if(TMath::Abs(sumOfW1st22*sumOfW2nd22)>0.)
3980 // Cov(<cos(phi1+phi2)>,<cos(phi1-phi2-phi3)>):
3981 Double_t product23 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(23); // <<cos(phi1+phi2)><cos(phi1-phi2-phi3)>>
3982 Double_t term1st23 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3983 Double_t term2nd23 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3984 Double_t sumOfW1st23 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3985 Double_t sumOfW2nd23 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3986 Double_t sumOfWW23 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(23); // W_{<cos(phi1+phi2)>} * W_{<cos(phi1-phi2-phi3)>}
3987 // numerator in the expression for the the unbiased estimator for covariance:
3988 Double_t numerator23 = product23 - term1st23*term2nd23;
3989 // denominator in the expression for the the unbiased estimator for covariance:
3990 Double_t denominator23 = 0.;
3991 if(TMath::Abs(sumOfW1st23*sumOfW2nd23)>0.)
3993 denominator23 = 1.-sumOfWW23/(sumOfW1st23*sumOfW2nd23);
3994 if(TMath::Abs(denominator23)>0.)
3997 Double_t covariance23 = numerator23/denominator23;
3998 // weight dependent prefactor for covariance:
3999 Double_t wPrefactor23 = sumOfWW23/(sumOfW1st23*sumOfW2nd23);
4000 // finally, store "weighted" covariance:
4001 fIntFlowCovariancesNUA->SetBinContent(23,wPrefactor23*covariance23);
4002 } // end of if(TMath::Abs(denominator23)>0.)
4003 } // end of if(TMath::Abs(sumOfW1st23*sumOfW2nd23)>0.)
4005 // Cov(<cos(phi1+phi2)>,<sin(phi1-phi2-phi3)>):
4006 Double_t product24 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(24); // <<cos(phi1+phi2)><sin(phi1-phi2-phi3)>>
4007 Double_t term1st24 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
4008 Double_t term2nd24 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
4009 Double_t sumOfW1st24 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
4010 Double_t sumOfW2nd24 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
4011 Double_t sumOfWW24 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(24); // W_{<cos(phi1+phi2)>} * W_{<sin(phi1-phi2-phi3)>}
4012 // numerator in the expression for the the unbiased estimator for covariance:
4013 Double_t numerator24 = product24 - term1st24*term2nd24;
4014 // denominator in the expression for the the unbiased estimator for covariance:
4015 Double_t denominator24 = 0.;
4016 if(TMath::Abs(sumOfW1st24*sumOfW2nd24)>0.)
4018 denominator24 = 1.-sumOfWW24/(sumOfW1st24*sumOfW2nd24);
4019 if(TMath::Abs(denominator24)>0.)
4022 Double_t covariance24 = numerator24/denominator24;
4023 // weight dependent prefactor for covariance:
4024 Double_t wPrefactor24 = sumOfWW24/(sumOfW1st24*sumOfW2nd24);
4025 // finally, store "weighted" covariance:
4026 fIntFlowCovariancesNUA->SetBinContent(24,wPrefactor24*covariance24);
4027 } // end of if(TMath::Abs(denominator24)>0.)
4028 } // end of if(TMath::Abs(sumOfW1st24*sumOfW2nd24)>0.)
4030 // Cov(<sin(phi1+phi2)>,<cos(phi1-phi2-phi3)>):
4031 Double_t product25 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(25); // <<sin(phi1+phi2)><cos(phi1-phi2-phi3)>>
4032 Double_t term1st25 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
4033 Double_t term2nd25 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
4034 Double_t sumOfW1st25 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
4035 Double_t sumOfW2nd25 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
4036 Double_t sumOfWW25 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(25); // W_{<sin(phi1+phi2)>} * W_{<cos(phi1-phi2-phi3)>}
4037 // numerator in the expression for the the unbiased estimator for covariance:
4038 Double_t numerator25 = product25 - term1st25*term2nd25;
4039 // denominator in the expression for the the unbiased estimator for covariance:
4040 Double_t denominator25 = 0.;
4041 if(TMath::Abs(sumOfW1st25*sumOfW2nd25)>0.)
4043 denominator25 = 1.-sumOfWW25/(sumOfW1st25*sumOfW2nd25);
4044 if(TMath::Abs(denominator25)>0.)
4047 Double_t covariance25 = numerator25/denominator25;
4048 // weight dependent prefactor for covariance:
4049 Double_t wPrefactor25 = sumOfWW25/(sumOfW1st25*sumOfW2nd25);
4050 // finally, store "weighted" covariance:
4051 fIntFlowCovariancesNUA->SetBinContent(25,wPrefactor25*covariance25);
4052 } // end of if(TMath::Abs(denominator25)>0.)
4053 } // end of if(TMath::Abs(sumOfW1st25*sumOfW2nd25)>0.)
4055 // Cov(<sin(phi1+phi2)>,<sin(phi1-phi2-phi3)>):
4056 Double_t product26 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(26); // <<sin(phi1+phi2)><sin(phi1-phi2-phi3)>>
4057 Double_t term1st26 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
4058 Double_t term2nd26 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
4059 Double_t sumOfW1st26 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
4060 Double_t sumOfW2nd26 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
4061 Double_t sumOfWW26 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(26); // W_{<sin(phi1+phi2)>} * W_{<sin(phi1-phi2-phi3)>}
4062 // numerator in the expression for the the unbiased estimator for covariance:
4063 Double_t numerator26 = product26 - term1st26*term2nd26;
4064 // denominator in the expression for the the unbiased estimator for covariance:
4065 Double_t denominator26 = 0.;
4066 if(TMath::Abs(sumOfW1st26*sumOfW2nd26)>0.)
4068 denominator26 = 1.-sumOfWW26/(sumOfW1st26*sumOfW2nd26);
4069 if(TMath::Abs(denominator26)>0.)
4072 Double_t covariance26 = numerator26/denominator26;
4073 // weight dependent prefactor for covariance:
4074 Double_t wPrefactor26 = sumOfWW26/(sumOfW1st26*sumOfW2nd26);
4075 // finally, store "weighted" covariance:
4076 fIntFlowCovariancesNUA->SetBinContent(26,wPrefactor26*covariance26);
4077 } // end of if(TMath::Abs(denominator26)>0.)
4078 } // end of if(TMath::Abs(sumOfW1st26*sumOfW2nd26)>0.)
4080 // Cov(<cos(phi1-phi2-phi3)>,<sin(phi1-phi2-phi3)>):
4081 Double_t product27 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(27); // <<cos(phi1-phi2-phi3)><sin(phi1-phi2-phi3)>>
4082 Double_t term1st27 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
4083 Double_t term2nd27 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
4084 Double_t sumOfW1st27 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
4085 Double_t sumOfW2nd27 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
4086 Double_t sumOfWW27 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(27); // W_{<cos(phi1-phi2-phi3)>} * W_{<sin(phi1-phi2-phi3)>}
4087 // numerator in the expression for the the unbiased estimator for covariance:
4088 Double_t numerator27 = product27 - term1st27*term2nd27;
4089 // denominator in the expression for the the unbiased estimator for covariance:
4090 Double_t denominator27 = 0.;
4091 if(TMath::Abs(sumOfW1st27*sumOfW2nd27)>0.)
4093 denominator27 = 1.-sumOfWW27/(sumOfW1st27*sumOfW2nd27);
4094 if(TMath::Abs(denominator27)>0.)
4097 Double_t covariance27 = numerator27/denominator27;
4098 // weight dependent prefactor for covariance:
4099 Double_t wPrefactor27 = sumOfWW27/(sumOfW1st27*sumOfW2nd27);
4100 // finally, store "weighted" covariance:
4101 fIntFlowCovariancesNUA->SetBinContent(27,wPrefactor27*covariance27);
4102 } // end of if(TMath::Abs(denominator27)>0.)
4103 } // end of if(TMath::Abs(sumOfW1st27*sumOfW2nd27)>0.)
4105 } // end of AliFlowAnalysisWithQCumulants::CalculateCovariancesNUAIntFlow()
4107 //================================================================================================================================
4109 void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsIntFlow()
4111 // From profile fIntFlowCorrelationsPro access measured correlations and spread,
4112 // correctly calculate the statistical errors and store the final results and
4113 // statistical errors for correlations in histogram fIntFlowCorrelationsHist.
4115 // Remark: Statistical error of correlation is calculated as:
4117 // statistical error = termA * spread * termB:
4118 // termA = sqrt{sum_{i=1}^{N} w^2}/(sum_{i=1}^{N} w)
4119 // termB = 1/sqrt(1-termA^2)
4122 for(Int_t ci=1;ci<=4;ci++) // correlation index
4124 if(fIntFlowCorrelationsPro->GetBinEffectiveEntries(ci) < 2 || fIntFlowSquaredCorrelationsPro->GetBinEffectiveEntries(ci) < 2)
4126 fIntFlowCorrelationsPro->SetBinError(ci,0.);
4127 fIntFlowSquaredCorrelationsPro->SetBinError(ci,0.);
4130 Double_t correlation = fIntFlowCorrelationsPro->GetBinContent(ci);
4131 Double_t squaredCorrelation = fIntFlowSquaredCorrelationsPro->GetBinContent(ci);
4132 Double_t spread = 0.;
4133 if(squaredCorrelation-correlation*correlation >= 0.)
4135 spread = pow(squaredCorrelation-correlation*correlation,0.5);
4139 cout<<Form(" WARNING: Imaginary 'spread' for %d-particle correlation!!!! ",2*ci)<<endl;
4142 Double_t sumOfLinearEventWeights = fIntFlowSumOfEventWeights[0]->GetBinContent(ci);
4143 Double_t sumOfQuadraticEventWeights = fIntFlowSumOfEventWeights[1]->GetBinContent(ci);
4144 Double_t termA = 0.;
4145 Double_t termB = 0.;
4146 if(TMath::Abs(sumOfLinearEventWeights) > 0.) // to be improved - shall I omitt here Abs() ?
4148 termA = pow(sumOfQuadraticEventWeights,0.5)/sumOfLinearEventWeights;
4152 cout<<" WARNING (QC): sumOfLinearEventWeights == 0 in method FinalizeCorrelationsIntFlow() !!!!"<<endl;
4153 cout<<" (for "<<2*ci<<"-particle correlation)"<<endl;
4156 if(1.-pow(termA,2.) > 0.)
4158 termB = 1./pow(1-pow(termA,2.),0.5);
4162 cout<<" WARNING (QC): 1.-pow(termA,2.) <= 0 in method FinalizeCorrelationsIntFlow() !!!!"<<endl;
4163 cout<<" (for "<<2*ci<<"-particle correlation)"<<endl;
4166 Double_t statisticalError = termA * spread * termB;
4167 fIntFlowCorrelationsHist->SetBinContent(ci,correlation);
4168 fIntFlowCorrelationsHist->SetBinError(ci,statisticalError);
4169 } // end of for(Int_t ci=1;ci<=4;ci++) // correlation index
4171 // Versus multiplicity:
4172 if(!fCalculateCumulantsVsM){return;}
4173 for(Int_t ci=0;ci<=3;ci++) // correlation index
4175 Int_t nBins = fIntFlowCorrelationsVsMPro[ci]->GetNbinsX();
4176 for(Int_t b=1;b<=nBins;b++) // looping over multiplicity bins
4178 if(fIntFlowCorrelationsVsMPro[ci]->GetBinEffectiveEntries(b) < 2 || fIntFlowSquaredCorrelationsVsMPro[ci]->GetBinEffectiveEntries(b) < 2)
4180 fIntFlowCorrelationsVsMPro[ci]->SetBinError(b,0.);
4181 fIntFlowSquaredCorrelationsVsMPro[ci]->SetBinError(b,0.);
4184 Double_t correlationVsM = fIntFlowCorrelationsVsMPro[ci]->GetBinContent(b);
4185 Double_t squaredCorrelationVsM = fIntFlowSquaredCorrelationsVsMPro[ci]->GetBinContent(b);
4186 Double_t spreadVsM = 0.;
4187 if(squaredCorrelationVsM-correlationVsM*correlationVsM >= 0.)
4189 spreadVsM = pow(squaredCorrelationVsM-correlationVsM*correlationVsM,0.5);
4193 cout<<Form(" WARNING (QC): Imaginary 'spreadVsM' for ci = %d, bin = %d, entries = %f !!!!",
4194 ci,b,fIntFlowCorrelationsVsMPro[ci]->GetBinEffectiveEntries(b))<<endl;
4197 Double_t sumOfLinearEventWeightsVsM = fIntFlowSumOfEventWeightsVsM[ci][0]->GetBinContent(b);
4198 Double_t sumOfQuadraticEventWeightsVsM = fIntFlowSumOfEventWeightsVsM[ci][1]->GetBinContent(b);
4199 Double_t termAVsM = 0.;
4200 Double_t termBVsM = 0.;
4201 if(sumOfLinearEventWeightsVsM > 0.)
4203 termAVsM = pow(sumOfQuadraticEventWeightsVsM,0.5)/sumOfLinearEventWeightsVsM;
4205 if(1.-pow(termAVsM,2.) > 0.)
4207 termBVsM = 1./pow(1-pow(termAVsM,2.),0.5);
4209 Double_t statisticalErrorVsM = termAVsM * spreadVsM * termBVsM;
4210 fIntFlowCorrelationsVsMHist[ci]->SetBinContent(b,correlationVsM);
4211 fIntFlowCorrelationsVsMHist[ci]->SetBinError(b,statisticalErrorVsM);
4212 } // end of for(Int_t b=1;b<=nBins;b++)
4213 } // end of for(Int_t ci=1;ci<=4;ci++) // correlation index
4215 } // end of AliFlowAnalysisWithQCumulants::FinalizeCorrelationsIntFlow()
4217 //================================================================================================================================
4219 void AliFlowAnalysisWithQCumulants::FillAverageMultiplicities(Int_t nRP)
4221 // Fill profile fAverageMultiplicity to hold average multiplicities and
4222 // number of events for events with nRP>=0, nRP>=1, ... , and nRP>=8
4224 // Binning of fAverageMultiplicity is organized as follows:
4225 // 1st bin: all events (including the empty ones)
4226 // 2nd bin: event with # of RPs greater or equal to 1
4227 // 3rd bin: event with # of RPs greater or equal to 2
4228 // 4th bin: event with # of RPs greater or equal to 3
4229 // 5th bin: event with # of RPs greater or equal to 4
4230 // 6th bin: event with # of RPs greater or equal to 5
4231 // 7th bin: event with # of RPs greater or equal to 6
4232 // 8th bin: event with # of RPs greater or equal to 7
4233 // 9th bin: event with # of RPs greater or equal to 8
4238 cout<<" WARNING (QC): nRP<0 in in AFAWQC::FAM() !!!!"<<endl;
4243 for(Int_t i=0;i<9;i++)
4245 if(nRP>=i){fAvMultiplicity->Fill(i+0.5,nRP,1);}
4248 } // end of AliFlowAnalysisWithQCumulants::FillAverageMultiplicities(nRP)
4250 //================================================================================================================================
4252 void AliFlowAnalysisWithQCumulants::CalculateCumulantsIntFlow()
4254 // a) Calculate Q-cumulants from the measured multiparticle correlations;
4255 // b) Propagate the statistical errors from measured multiparticle correlations to statistical errors of Q-cumulants;
4256 // c) Remark: Q-cumulants calculated in this method are biased by non-uniform acceptance of detector !!!!
4257 // Method CalculateQcumulantsCorrectedForNUAIntFlow() is called afterwards to correct for this bias;
4258 // d) Store the results and statistical error of Q-cumulants in histogram fIntFlowQcumulants.
4259 // Binning of fIntFlowQcumulants is organized as follows:
4268 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
4269 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
4270 Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
4271 Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
4272 // Statistical errors of average 2-, 4-, 6- and 8-particle azimuthal correlations:
4273 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <2>
4274 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <4>
4275 Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <6>
4276 Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <8>
4277 // Covariances (multiplied by prefactor depending on weights - see comments in CalculateCovariancesIntFlow()):
4278 Double_t wCov24 = 0.; // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
4279 Double_t wCov26 = 0.; // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)
4280 Double_t wCov28 = 0.; // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)
4281 Double_t wCov46 = 0.; // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)
4282 Double_t wCov48 = 0.; // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)
4283 Double_t wCov68 = 0.; // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)
4284 if(!fForgetAboutCovariances)
4286 wCov24 = fIntFlowCovariances->GetBinContent(1); // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
4287 wCov26 = fIntFlowCovariances->GetBinContent(2); // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)
4288 wCov28 = fIntFlowCovariances->GetBinContent(3); // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)
4289 wCov46 = fIntFlowCovariances->GetBinContent(4); // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)
4290 wCov48 = fIntFlowCovariances->GetBinContent(5); // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)
4291 wCov68 = fIntFlowCovariances->GetBinContent(6); // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)
4294 Double_t qc2 = 0.; // QC{2}
4295 Double_t qc4 = 0.; // QC{4}
4296 Double_t qc6 = 0.; // QC{6}
4297 Double_t qc8 = 0.; // QC{8}
4298 if(TMath::Abs(two) > 0.){qc2 = two;}
4299 if(TMath::Abs(four) > 0.){qc4 = four-2.*pow(two,2.);}
4300 if(TMath::Abs(six) > 0.){qc6 = six-9.*two*four+12.*pow(two,3.);}
4301 if(TMath::Abs(eight) > 0.){qc8 = eight-16.*two*six-18.*pow(four,2.)+144.*pow(two,2.)*four-144.*pow(two,4.);}
4302 // Statistical errors of Q-cumulants:
4303 Double_t qc2Error = 0.;
4304 Double_t qc4Error = 0.;
4305 Double_t qc6Error = 0.;
4306 Double_t qc8Error = 0.;
4307 // Squared statistical errors of Q-cumulants:
4308 //Double_t qc2ErrorSquared = 0.;
4309 Double_t qc4ErrorSquared = 0.;
4310 Double_t qc6ErrorSquared = 0.;
4311 Double_t qc8ErrorSquared = 0.;
4312 // Statistical error of QC{2}:
4313 qc2Error = twoError;
4314 // Statistical error of QC{4}:
4315 qc4ErrorSquared = 16.*pow(two,2.)*pow(twoError,2)+pow(fourError,2.)
4317 if(qc4ErrorSquared>0.)
4319 qc4Error = pow(qc4ErrorSquared,0.5);
4322 cout<<" WARNING (QC): Statistical error of QC{4} is imaginary !!!!"<<endl;
4324 // Statistical error of QC{6}:
4325 qc6ErrorSquared = 81.*pow(4.*pow(two,2.)-four,2.)*pow(twoError,2.)
4326 + 81.*pow(two,2.)*pow(fourError,2.)
4328 - 162.*two*(4.*pow(two,2.)-four)*wCov24
4329 + 18.*(4.*pow(two,2.)-four)*wCov26
4331 if(qc6ErrorSquared>0.)
4333 qc6Error = pow(qc6ErrorSquared,0.5);
4336 cout<<" WARNING (QC): Statistical error of QC{6} is imaginary !!!!"<<endl;
4338 // Statistical error of QC{8}:
4339 qc8ErrorSquared = 256.*pow(36.*pow(two,3.)-18.*four*two+six,2.)*pow(twoError,2.)
4340 + 1296.*pow(4.*pow(two,2.)-four,2.)*pow(fourError,2.)
4341 + 256.*pow(two,2.)*pow(sixError,2.)
4342 + pow(eightError,2.)
4343 - 1152.*(36.*pow(two,3.)-18.*four*two+six)*(4.*pow(two,2.)-four)*wCov24
4344 + 512.*two*(36.*pow(two,3.)-18.*four*two+six)*wCov26
4345 - 32.*(36.*pow(two,3.)-18.*four*two+six)*wCov28
4346 - 1152.*two*(4.*pow(two,2.)-four)*wCov46
4347 + 72.*(4.*pow(two,2.)-four)*wCov48
4349 if(qc8ErrorSquared>0.)
4351 qc8Error = pow(qc8ErrorSquared,0.5);
4354 cout<<"WARNING (QC): Statistical error of QC{8} is imaginary !!!!"<<endl;
4356 // Store the results and statistical errors for Q-cumulants:
4357 if(TMath::Abs(qc2)>0.)
4359 fIntFlowQcumulants->SetBinContent(1,qc2);
4360 fIntFlowQcumulants->SetBinError(1,qc2Error);
4362 if(TMath::Abs(qc4)>0.)
4364 fIntFlowQcumulants->SetBinContent(2,qc4);
4365 fIntFlowQcumulants->SetBinError(2,qc4Error);
4367 if(TMath::Abs(qc6)>0.)
4369 fIntFlowQcumulants->SetBinContent(3,qc6);
4370 fIntFlowQcumulants->SetBinError(3,qc6Error);
4372 if(TMath::Abs(qc8)>0.)
4374 fIntFlowQcumulants->SetBinContent(4,qc8);
4375 fIntFlowQcumulants->SetBinError(4,qc8Error);
4378 // Versus multiplicity:
4379 if(!fCalculateCumulantsVsM){return;}
4380 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
4381 Double_t value[4] = {0.}; // QCs vs M
4382 Double_t error[4] = {0.}; // error of QCs vs M
4383 Double_t dSum1[4] = {0.}; // sum value_i/(error_i)^2
4384 Double_t dSum2[4] = {0.}; // sum 1/(error_i)^2
4385 for(Int_t b=1;b<=nBins;b++)
4388 two = fIntFlowCorrelationsVsMHist[0]->GetBinContent(b); // <<2>>
4389 four = fIntFlowCorrelationsVsMHist[1]->GetBinContent(b); // <<4>>
4390 six = fIntFlowCorrelationsVsMHist[2]->GetBinContent(b); // <<6>>
4391 eight = fIntFlowCorrelationsVsMHist[3]->GetBinContent(b); // <<8>>
4392 // Statistical errors of average 2-, 4-, 6- and 8-particle azimuthal correlations:
4393 twoError = fIntFlowCorrelationsVsMHist[0]->GetBinError(b); // statistical error of <2>
4394 fourError = fIntFlowCorrelationsVsMHist[1]->GetBinError(b); // statistical error of <4>
4395 sixError = fIntFlowCorrelationsVsMHist[2]->GetBinError(b); // statistical error of <6>
4396 eightError = fIntFlowCorrelationsVsMHist[3]->GetBinError(b); // statistical error of <8>
4397 // Covariances (multiplied by prefactor depending on weights - see comments in CalculateCovariancesIntFlow()):
4398 if(!fForgetAboutCovariances)
4400 wCov24 = fIntFlowCovariancesVsM[0]->GetBinContent(b); // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
4401 wCov26 = fIntFlowCovariancesVsM[1]->GetBinContent(b); // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)
4402 wCov28 = fIntFlowCovariancesVsM[2]->GetBinContent(b); // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)
4403 wCov46 = fIntFlowCovariancesVsM[3]->GetBinContent(b); // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)
4404 wCov48 = fIntFlowCovariancesVsM[4]->GetBinContent(b); // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)
4405 wCov68 = fIntFlowCovariancesVsM[5]->GetBinContent(b); // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)
4412 if(TMath::Abs(two) > 0.){qc2 = two;}
4413 if(TMath::Abs(four) > 0.){qc4 = four-2.*pow(two,2.);}
4414 if(TMath::Abs(six) > 0.){qc6 = six-9.*two*four+12.*pow(two,3.);}
4415 if(TMath::Abs(eight) > 0.){qc8 = eight-16.*two*six-18.*pow(four,2.)+144.*pow(two,2.)*four-144.*pow(two,4.);}
4416 // Statistical errors of Q-cumulants:
4421 // Squared statistical errors of Q-cumulants:
4422 //Double_t qc2ErrorSquared = 0.;
4423 qc4ErrorSquared = 0.;
4424 qc6ErrorSquared = 0.;
4425 qc8ErrorSquared = 0.;
4426 // Statistical error of QC{2}:
4427 qc2Error = twoError;
4428 // Statistical error of QC{4}:
4429 qc4ErrorSquared = 16.*pow(two,2.)*pow(twoError,2)+pow(fourError,2.)
4431 if(qc4ErrorSquared>0.)
4433 qc4Error = pow(qc4ErrorSquared,0.5);
4436 // cout<<"WARNING: Statistical error of QC{4} is imaginary in multiplicity bin "<<b<<" !!!!"<<endl;
4438 // Statistical error of QC{6}:
4439 qc6ErrorSquared = 81.*pow(4.*pow(two,2.)-four,2.)*pow(twoError,2.)
4440 + 81.*pow(two,2.)*pow(fourError,2.)
4442 - 162.*two*(4.*pow(two,2.)-four)*wCov24
4443 + 18.*(4.*pow(two,2.)-four)*wCov26
4445 if(qc6ErrorSquared>0.)
4447 qc6Error = pow(qc6ErrorSquared,0.5);
4450 // cout<<"WARNING: Statistical error of QC{6} is imaginary in multiplicity bin "<<b<<" !!!!"<<endl;
4452 // Statistical error of QC{8}:
4453 qc8ErrorSquared = 256.*pow(36.*pow(two,3.)-18.*four*two+six,2.)*pow(twoError,2.)
4454 + 1296.*pow(4.*pow(two,2.)-four,2.)*pow(fourError,2.)
4455 + 256.*pow(two,2.)*pow(sixError,2.)
4456 + pow(eightError,2.)
4457 - 1152.*(36.*pow(two,3.)-18.*four*two+six)*(4.*pow(two,2.)-four)*wCov24
4458 + 512.*two*(36.*pow(two,3.)-18.*four*two+six)*wCov26
4459 - 32.*(36.*pow(two,3.)-18.*four*two+six)*wCov28
4460 - 1152.*two*(4.*pow(two,2.)-four)*wCov46
4461 + 72.*(4.*pow(two,2.)-four)*wCov48
4463 if(qc8ErrorSquared>0.)
4465 qc8Error = pow(qc8ErrorSquared,0.5);
4468 // cout<<"WARNING: Statistical error of QC{8} is imaginary in multiplicity bin "<<b<<" !!!!"<<endl;
4470 // Store the results and statistical errors for Q-cumulants:
4471 if(TMath::Abs(qc2)>0.)
4473 fIntFlowQcumulantsVsM[0]->SetBinContent(b,qc2);
4474 fIntFlowQcumulantsVsM[0]->SetBinError(b,qc2Error);
4476 if(TMath::Abs(qc4)>0.)
4478 fIntFlowQcumulantsVsM[1]->SetBinContent(b,qc4);
4479 fIntFlowQcumulantsVsM[1]->SetBinError(b,qc4Error);
4481 if(TMath::Abs(qc6)>0.)
4483 fIntFlowQcumulantsVsM[2]->SetBinContent(b,qc6);
4484 fIntFlowQcumulantsVsM[2]->SetBinError(b,qc6Error);
4486 if(TMath::Abs(qc8)>0.)
4488 fIntFlowQcumulantsVsM[3]->SetBinContent(b,qc8);
4489 fIntFlowQcumulantsVsM[3]->SetBinError(b,qc8Error);
4492 for(Int_t co=0;co<4;co++)
4494 if(fIntFlowCorrelationsVsMPro[co]->GetBinEffectiveEntries(b)<2){continue;}
4495 value[co] = fIntFlowQcumulantsVsM[co]->GetBinContent(b);
4496 error[co] = fIntFlowQcumulantsVsM[co]->GetBinError(b);
4499 dSum1[co]+=value[co]/(error[co]*error[co]);
4500 dSum2[co]+=1./(error[co]*error[co]);
4502 } // end of for(Int_t co=0;co<4;co++)
4503 } // end of for(Int_t b=1;b<=nBins;b++)
4504 // Store rebinned Q-cumulants:
4505 for(Int_t co=0;co<4;co++)
4509 fIntFlowQcumulantsRebinnedInM->SetBinContent(co+1,dSum1[co]/dSum2[co]);
4510 fIntFlowQcumulantsRebinnedInM->SetBinError(co+1,pow(1./dSum2[co],0.5));
4512 } // end of for(Int_t co=0;co<4;co++)
4514 } // end of AliFlowAnalysisWithQCumulants::CalculateCumulantsIntFlow()
4516 //================================================================================================================================
4518 void AliFlowAnalysisWithQCumulants::CalculateReferenceFlow()
4520 // a) Calculate the final results for reference flow estimates from Q-cumulants;
4521 // b) Propagate the statistical errors to reference flow estimates from statistical error of Q-cumulants;
4522 // c) Store the results and statistical errors of reference flow estimates in histogram fIntFlow.
4523 // Binning of fIntFlow is organized as follows:
4531 // Reference flow estimates:
4532 Double_t v2 = 0.; // v{2,QC}
4533 Double_t v4 = 0.; // v{4,QC}
4534 Double_t v6 = 0.; // v{6,QC}
4535 Double_t v8 = 0.; // v{8,QC}
4536 // Reference flow's statistical errors:
4537 Double_t v2Error = 0.; // v{2,QC} stat. error
4538 Double_t v4Error = 0.; // v{4,QC} stat. error
4539 Double_t v6Error = 0.; // v{6,QC} stat. error
4540 Double_t v8Error = 0.; // v{8,QC} stat. error
4543 Double_t qc2 = fIntFlowQcumulants->GetBinContent(1); // QC{2}
4544 Double_t qc4 = fIntFlowQcumulants->GetBinContent(2); // QC{4}
4545 Double_t qc6 = fIntFlowQcumulants->GetBinContent(3); // QC{6}
4546 Double_t qc8 = fIntFlowQcumulants->GetBinContent(4); // QC{8}
4547 // Q-cumulants's statistical errors:
4548 Double_t qc2Error = fIntFlowQcumulants->GetBinError(1); // QC{2} stat. error
4549 Double_t qc4Error = fIntFlowQcumulants->GetBinError(2); // QC{4} stat. error
4550 Double_t qc6Error = fIntFlowQcumulants->GetBinError(3); // QC{6} stat. error
4551 Double_t qc8Error = fIntFlowQcumulants->GetBinError(4); // QC{8} stat. error
4552 // Calculate reference flow estimates from Q-cumulants:
4553 if(qc2>=0.){v2 = pow(qc2,1./2.);}
4554 if(qc4<=0.){v4 = pow(-1.*qc4,1./4.);}
4555 if(qc6>=0.){v6 = pow((1./4.)*qc6,1./6.);}
4556 if(qc8<=0.){v8 = pow((-1./33.)*qc8,1./8.);}
4557 // Calculate stat. error for reference flow estimates from stat. error of Q-cumulants:
4558 if(qc2>0.){v2Error = (1./2.)*pow(qc2,-1./2.)*qc2Error;}
4559 if(qc4<0.){v4Error = (1./4.)*pow(-qc4,-3./4.)*qc4Error;}
4560 if(qc6>0.){v6Error = (1./6.)*pow(2.,-1./3.)*pow(qc6,-5./6.)*qc6Error;}
4561 if(qc8<0.){v8Error = (1./8.)*pow(33.,-1./8.)*pow(-qc8,-7./8.)*qc8Error;}
4562 // Print warnings for the 'wrong sign' cumulants:
4563 if(TMath::Abs(v2) < 1.e-44)
4565 cout<<" WARNING: Wrong sign QC{2}, couldn't calculate v{2,QC} !!!!"<<endl;
4567 if(TMath::Abs(v4) < 1.e-44)
4569 cout<<" WARNING: Wrong sign QC{4}, couldn't calculate v{4,QC} !!!!"<<endl;
4571 if(TMath::Abs(v6) < 1.e-44)
4573 cout<<" WARNING: Wrong sign QC{6}, couldn't calculate v{6,QC} !!!!"<<endl;
4575 if(TMath::Abs(v8) < 1.e-44)
4577 cout<<" WARNING: Wrong sign QC{8}, couldn't calculate v{8,QC} !!!!"<<endl;
4579 // Store the results and statistical errors of integrated flow estimates:
4580 fIntFlow->SetBinContent(1,v2);
4581 fIntFlow->SetBinError(1,v2Error);
4582 fIntFlow->SetBinContent(2,v4);
4583 fIntFlow->SetBinError(2,v4Error);
4584 fIntFlow->SetBinContent(3,v6);
4585 fIntFlow->SetBinError(3,v6Error);
4586 fIntFlow->SetBinContent(4,v8);
4587 fIntFlow->SetBinError(4,v8Error);
4589 // Versus multiplicity:
4590 if(!fCalculateCumulantsVsM){return;}
4591 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
4592 for(Int_t b=1;b<=nBins;b++)
4595 Double_t qc2VsM = fIntFlowQcumulantsVsM[0]->GetBinContent(b); // QC{2}
4596 Double_t qc4VsM = fIntFlowQcumulantsVsM[1]->GetBinContent(b); // QC{4}
4597 Double_t qc6VsM = fIntFlowQcumulantsVsM[2]->GetBinContent(b); // QC{6}
4598 Double_t qc8VsM = fIntFlowQcumulantsVsM[3]->GetBinContent(b); // QC{8}
4599 // Q-cumulants's statistical errors:
4600 Double_t qc2ErrorVsM = fIntFlowQcumulantsVsM[0]->GetBinError(b); // QC{2} stat. error
4601 Double_t qc4ErrorVsM = fIntFlowQcumulantsVsM[1]->GetBinError(b); // QC{4} stat. error
4602 Double_t qc6ErrorVsM = fIntFlowQcumulantsVsM[2]->GetBinError(b); // QC{6} stat. error
4603 Double_t qc8ErrorVsM = fIntFlowQcumulantsVsM[3]->GetBinError(b); // QC{8} stat. error
4604 // Reference flow estimates:
4605 Double_t v2VsM = 0.; // v{2,QC}
4606 Double_t v4VsM = 0.; // v{4,QC}
4607 Double_t v6VsM = 0.; // v{6,QC}
4608 Double_t v8VsM = 0.; // v{8,QC}
4609 // Reference flow estimates errors:
4610 Double_t v2ErrorVsM = 0.; // v{2,QC} stat. error
4611 Double_t v4ErrorVsM = 0.; // v{4,QC} stat. error
4612 Double_t v6ErrorVsM = 0.; // v{6,QC} stat. error
4613 Double_t v8ErrorVsM = 0.; // v{8,QC} stat. error
4614 // Calculate reference flow estimates from Q-cumulants:
4615 if(qc2VsM>=0.){v2VsM = pow(qc2VsM,1./2.);}
4616 if(qc4VsM<=0.){v4VsM = pow(-1.*qc4VsM,1./4.);}
4617 if(qc6VsM>=0.){v6VsM = pow((1./4.)*qc6VsM,1./6.);}
4618 if(qc8VsM<=0.){v8VsM = pow((-1./33.)*qc8VsM,1./8.);}
4619 // Calculate stat. error for reference flow estimates from stat. error of Q-cumulants:
4620 if(qc2VsM>0.){v2ErrorVsM = (1./2.)*pow(qc2VsM,-1./2.)*qc2ErrorVsM;}
4621 if(qc4VsM<0.){v4ErrorVsM = (1./4.)*pow(-qc4VsM,-3./4.)*qc4ErrorVsM;}
4622 if(qc6VsM>0.){v6ErrorVsM = (1./6.)*pow(2.,-1./3.)*pow(qc6VsM,-5./6.)*qc6ErrorVsM;}
4623 if(qc8VsM<0.){v8ErrorVsM = (1./8.)*pow(33.,-1./8.)*pow(-qc8VsM,-7./8.)*qc8ErrorVsM;}
4624 // Store the results and statistical errors of integrated flow estimates:
4625 fIntFlowVsM[0]->SetBinContent(b,v2VsM);
4626 fIntFlowVsM[0]->SetBinError(b,v2ErrorVsM);
4627 fIntFlowVsM[1]->SetBinContent(b,v4VsM);
4628 fIntFlowVsM[1]->SetBinError(b,v4ErrorVsM);
4629 fIntFlowVsM[2]->SetBinContent(b,v6VsM);
4630 fIntFlowVsM[2]->SetBinError(b,v6ErrorVsM);
4631 fIntFlowVsM[3]->SetBinContent(b,v8VsM);
4632 fIntFlowVsM[3]->SetBinError(b,v8ErrorVsM);
4633 } // end of for(Int_t b=1;b<=nBins;b++)
4635 // 'Rebinned in M' calculation: // to be improved - this can be implemented better:
4636 // Reference flow estimates:
4637 Double_t v2RebinnedInM = 0.; // v{2,QC}
4638 Double_t v4RebinnedInM = 0.; // v{4,QC}
4639 Double_t v6RebinnedInM = 0.; // v{6,QC}
4640 Double_t v8RebinnedInM = 0.; // v{8,QC}
4641 // Reference flow's statistical errors:
4642 Double_t v2ErrorRebinnedInM = 0.; // v{2,QC} stat. error
4643 Double_t v4ErrorRebinnedInM = 0.; // v{4,QC} stat. error
4644 Double_t v6ErrorRebinnedInM = 0.; // v{6,QC} stat. error
4645 Double_t v8ErrorRebinnedInM = 0.; // v{8,QC} stat. error
4647 Double_t qc2RebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinContent(1); // QC{2}
4648 Double_t qc4RebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinContent(2); // QC{4}
4649 Double_t qc6RebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinContent(3); // QC{6}
4650 Double_t qc8RebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinContent(4); // QC{8}
4651 // Q-cumulants's statistical errors:
4652 Double_t qc2ErrorRebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinError(1); // QC{2} stat. error
4653 Double_t qc4ErrorRebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinError(2); // QC{4} stat. error
4654 Double_t qc6ErrorRebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinError(3); // QC{6} stat. error
4655 Double_t qc8ErrorRebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinError(4); // QC{8} stat. error
4656 // Calculate reference flow estimates from Q-cumulants:
4657 if(qc2RebinnedInM>=0.){v2RebinnedInM = pow(qc2RebinnedInM,1./2.);}
4658 if(qc4RebinnedInM<=0.){v4RebinnedInM = pow(-1.*qc4RebinnedInM,1./4.);}
4659 if(qc6RebinnedInM>=0.){v6RebinnedInM = pow((1./4.)*qc6RebinnedInM,1./6.);}
4660 if(qc8RebinnedInM<=0.){v8RebinnedInM = pow((-1./33.)*qc8RebinnedInM,1./8.);}
4661 // Calculate stat. error for reference flow estimates from stat. error of Q-cumulants:
4662 if(qc2RebinnedInM>0.){v2ErrorRebinnedInM = (1./2.)*pow(qc2RebinnedInM,-1./2.)*qc2ErrorRebinnedInM;}
4663 if(qc4RebinnedInM<0.){v4ErrorRebinnedInM = (1./4.)*pow(-qc4RebinnedInM,-3./4.)*qc4ErrorRebinnedInM;}
4664 if(qc6RebinnedInM>0.){v6ErrorRebinnedInM = (1./6.)*pow(2.,-1./3.)*pow(qc6RebinnedInM,-5./6.)*qc6ErrorRebinnedInM;}
4665 if(qc8RebinnedInM<0.){v8ErrorRebinnedInM = (1./8.)*pow(33.,-1./8.)*pow(-qc8RebinnedInM,-7./8.)*qc8ErrorRebinnedInM;}
4666 // Print warnings for the 'wrong sign' cumulants:
4667 if(TMath::Abs(v2RebinnedInM) < 1.e-44)
4669 cout<<" WARNING: Wrong sign QC{2} rebinned in M, couldn't calculate v{2,QC} !!!!"<<endl;
4671 if(TMath::Abs(v4RebinnedInM) < 1.e-44)
4673 cout<<" WARNING: Wrong sign QC{4} rebinned in M, couldn't calculate v{4,QC} !!!!"<<endl;
4675 if(TMath::Abs(v6RebinnedInM) < 1.e-44)
4677 cout<<" WARNING: Wrong sign QC{6} rebinned in M, couldn't calculate v{6,QC} !!!!"<<endl;
4679 if(TMath::Abs(v8RebinnedInM) < 1.e-44)
4681 cout<<" WARNING: Wrong sign QC{8} rebinned in M, couldn't calculate v{8,QC} !!!!"<<endl;
4683 // Store the results and statistical errors of integrated flow estimates:
4684 fIntFlowRebinnedInM->SetBinContent(1,v2RebinnedInM);
4685 fIntFlowRebinnedInM->SetBinError(1,v2ErrorRebinnedInM);
4686 fIntFlowRebinnedInM->SetBinContent(2,v4RebinnedInM);
4687 fIntFlowRebinnedInM->SetBinError(2,v4ErrorRebinnedInM);
4688 fIntFlowRebinnedInM->SetBinContent(3,v6RebinnedInM);
4689 fIntFlowRebinnedInM->SetBinError(3,v6ErrorRebinnedInM);
4690 fIntFlowRebinnedInM->SetBinContent(4,v8RebinnedInM);
4691 fIntFlowRebinnedInM->SetBinError(4,v8ErrorRebinnedInM);
4693 } // end of AliFlowAnalysisWithQCumulants::CalculateReferenceFlow()
4695 //================================================================================================================================
4697 void AliFlowAnalysisWithQCumulants::FillCommonHistResultsIntFlow()
4699 // Fill in AliFlowCommonHistResults histograms relevant for reference flow.
4701 // There are two possibilities here:
4702 // a) Store minimum bias reference flow - use SetMinimumBiasReferenceFlow(kTRUE). This result is
4703 // biased by the interplay between nonflow correlations and multiplicity fluctuations and is
4704 // also stored in local histogram fIntFlow;
4705 // b) Store reference flow obtained from flow analysis performed at fixed multiplicity and
4706 // rebinned only at the end of the day - use SetMinimumBiasReferenceFlow(kFALSE). This result
4707 // is also stored in local histogram fIntFlowRebinnedInM.
4709 // Reference flow estimates:
4710 Double_t v[4] = {0.};
4711 // Statistical errors of reference flow estimates:
4712 Double_t vError[4] = {0.};
4714 for(Int_t b=0;b<4;b++)
4716 if(fMinimumBiasReferenceFlow)
4718 v[b] = fIntFlow->GetBinContent(b+1);
4719 vError[b] = fIntFlow->GetBinError(b+1);
4722 v[b] = fIntFlowRebinnedInM->GetBinContent(b+1);
4723 vError[b] = fIntFlowRebinnedInM->GetBinError(b+1);
4725 } // end of for(Int_t b=0;b<4;b++)
4727 // Fill AliFlowCommonHistResults histogram:
4728 fCommonHistsResults2nd->FillIntegratedFlow(v[0],vError[0]); // to be improved (hardwired 2nd in the name)
4729 fCommonHistsResults4th->FillIntegratedFlow(v[1],vError[1]); // to be improved (hardwired 4th in the name)
4730 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)) // to be improved (calculate also 6th and 8th order)
4732 fCommonHistsResults6th->FillIntegratedFlow(v[2],vError[2]); // to be improved (hardwired 6th in the name)
4733 fCommonHistsResults8th->FillIntegratedFlow(v[3],vError[3]); // to be improved (hardwired 8th in the name)
4736 } // end of AliFlowAnalysisWithQCumulants::FillCommonHistResultsIntFlow()
4738 //================================================================================================================================
4740 void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelationsUsingParticleWeights()
4742 // Calculate all correlations needed for integrated flow using particle weights.
4744 // Remark 1: When particle weights are used the binning of fIntFlowCorrelationAllPro is organized as follows:
4746 // 1st bin: <2>_{1n|1n} = two1n1nW1W1 = <w1 w2 cos(n*(phi1-phi2))>
4747 // 2nd bin: <2>_{2n|2n} = two2n2nW2W2 = <w1^2 w2^2 cos(2n*(phi1-phi2))>
4748 // 3rd bin: <2>_{3n|3n} = two3n3nW3W3 = <w1^3 w2^3 cos(3n*(phi1-phi2))>
4749 // 4th bin: <2>_{4n|4n} = two4n4nW4W4 = <w1^4 w2^4 cos(4n*(phi1-phi2))>
4750 // 5th bin: ---- EMPTY ----
4751 // 6th bin: <3>_{2n|1n,1n} = three2n1n1nW2W1W1 = <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
4752 // 7th bin: <3>_{3n|2n,1n} = ...
4753 // 8th bin: <3>_{4n|2n,2n} = ...
4754 // 9th bin: <3>_{4n|3n,1n} = ...
4755 // 10th bin: ---- EMPTY ----
4756 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1nW1W1W1W1 = <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
4757 // 12th bin: <4>_{2n,1n|2n,1n} = ...
4758 // 13th bin: <4>_{2n,2n|2n,2n} = ...
4759 // 14th bin: <4>_{3n|1n,1n,1n} = ...
4760 // 15th bin: <4>_{3n,1n|3n,1n} = ...
4761 // 16th bin: <4>_{3n,1n|2n,2n} = ...
4762 // 17th bin: <4>_{4n|2n,1n,1n} = ...
4763 // 18th bin: ---- EMPTY ----
4764 // 19th bin: <5>_{2n|1n,1n,1n,1n} = ...
4765 // 20th bin: <5>_{2n,2n|2n,1n,1n} = ...
4766 // 21st bin: <5>_{3n,1n|2n,1n,1n} = ...
4767 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = ...
4768 // 23rd bin: ---- EMPTY ----
4769 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = ...
4770 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = ...
4771 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = ...
4772 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = ...
4773 // 28th bin: ---- EMPTY ----
4774 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = ...
4775 // 30th bin: ---- EMPTY ----
4776 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = ...
4778 // Remark 2: When particle weights are used there are some extra correlations. They are stored in
4779 // fIntFlowExtraCorrelationsPro binning of which is organized as follows:
4781 // 1st bin: two1n1nW3W1 = <w1^3 w2 cos(n*(phi1-phi2))>
4782 // 2nd bin: two1n1nW1W1W2 = <w1 w2 w3^2 cos(n*(phi1-phi2))>
4784 // multiplicity (number of particles used to determine the reaction plane)
4785 Double_t dMult = (*fSMpk)(0,0);
4787 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
4788 Double_t dReQ1n1k = (*fReQ)(0,1);
4789 Double_t dReQ2n2k = (*fReQ)(1,2);
4790 Double_t dReQ3n3k = (*fReQ)(2,3);
4791 Double_t dReQ4n4k = (*fReQ)(3,4);
4792 Double_t dReQ1n3k = (*fReQ)(0,3);
4793 Double_t dImQ1n1k = (*fImQ)(0,1);
4794 Double_t dImQ2n2k = (*fImQ)(1,2);
4795 Double_t dImQ3n3k = (*fImQ)(2,3);
4796 Double_t dImQ4n4k = (*fImQ)(3,4);
4797 Double_t dImQ1n3k = (*fImQ)(0,3);
4799 // dMs are variables introduced in order to simplify some Eqs. bellow:
4800 //..............................................................................................
4801 Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
4802 Double_t dM22 = (*fSMpk)(1,2)-(*fSMpk)(0,4); // dM22 = sum_{i,j=1,i!=j}^M w_i^2 w_j^2
4803 Double_t dM33 = (*fSMpk)(1,3)-(*fSMpk)(0,6); // dM33 = sum_{i,j=1,i!=j}^M w_i^3 w_j^3
4804 Double_t dM44 = (*fSMpk)(1,4)-(*fSMpk)(0,8); // dM44 = sum_{i,j=1,i!=j}^M w_i^4 w_j^4
4805 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
4806 Double_t dM211 = (*fSMpk)(0,2)*(*fSMpk)(1,1)-2.*(*fSMpk)(0,3)*(*fSMpk)(0,1)
4807 - (*fSMpk)(1,2)+2.*(*fSMpk)(0,4); // dM211 = sum_{i,j,k=1,i!=j!=k}^M w_i^2 w_j w_k
4808 Double_t dM1111 = (*fSMpk)(3,1)-6.*(*fSMpk)(0,2)*(*fSMpk)(1,1)
4809 + 8.*(*fSMpk)(0,3)*(*fSMpk)(0,1)
4810 + 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
4811 //..............................................................................................
4813 // 2-particle correlations:
4814 Double_t two1n1nW1W1 = 0.; // <w1 w2 cos(n*(phi1-phi2))>
4815 Double_t two2n2nW2W2 = 0.; // <w1^2 w2^2 cos(2n*(phi1-phi2))>
4816 Double_t two3n3nW3W3 = 0.; // <w1^3 w2^3 cos(3n*(phi1-phi2))>
4817 Double_t two4n4nW4W4 = 0.; // <w1^4 w2^4 cos(4n*(phi1-phi2))>
4822 two1n1nW1W1 = (pow(dReQ1n1k,2)+pow(dImQ1n1k,2)-(*fSMpk)(0,2))/dM11;
4823 // average correlation <w1 w2 cos(n*(phi1-phi2))> for single event:
4824 fIntFlowCorrelationsEBE->SetBinContent(1,two1n1nW1W1);
4825 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(1,dM11);
4826 // average correlation <w1 w2 cos(n*(phi1-phi2))> for all events:
4827 fIntFlowCorrelationsPro->Fill(0.5,two1n1nW1W1,dM11);
4828 // average squared correlation <w1 w2 cos(n*(phi1-phi2))> for all events:
4829 fIntFlowSquaredCorrelationsPro->Fill(0.5,two1n1nW1W1*two1n1nW1W1,dM11);
4830 fIntFlowCorrelationsAllPro->Fill(0.5,two1n1nW1W1,dM11);
4834 two2n2nW2W2 = (pow(dReQ2n2k,2)+pow(dImQ2n2k,2)-(*fSMpk)(0,4))/dM22;
4836 // average correlation <w1^2 w2^2 cos(2n*(phi1-phi2))> for all events:
4837 fIntFlowCorrelationsAllPro->Fill(1.5,two2n2nW2W2,dM22);
4841 two3n3nW3W3 = (pow(dReQ3n3k,2)+pow(dImQ3n3k,2)-(*fSMpk)(0,6))/dM33;
4843 // average correlation <w1^3 w2^3 cos(3n*(phi1-phi2))> for all events:
4844 fIntFlowCorrelationsAllPro->Fill(2.5,two3n3nW3W3,dM33);
4848 two4n4nW4W4 = (pow(dReQ4n4k,2)+pow(dImQ4n4k,2)-(*fSMpk)(0,8))/dM44;
4850 // average correlation <w1^4 w2^4 cos(4n*(phi1-phi2))> for all events:
4851 fIntFlowCorrelationsAllPro->Fill(3.5,two4n4nW4W4,dM44);
4853 } // end of if(dMult>1)
4855 // extra 2-particle correlations:
4856 Double_t two1n1nW3W1 = 0.; // <w1^3 w2 cos(n*(phi1-phi2))>
4857 Double_t two1n1nW1W1W2 = 0.; // <w1 w2 w3^2 cos(n*(phi1-phi2))>
4862 two1n1nW3W1 = (dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k-(*fSMpk)(0,4))/dM31;
4863 fIntFlowExtraCorrelationsPro->Fill(0.5,two1n1nW3W1,dM31);
4867 two1n1nW1W1W2 = ((*fSMpk)(0,2)*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2)-(*fSMpk)(0,2))
4868 - 2.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k
4869 - (*fSMpk)(0,4)))/dM211;
4870 fIntFlowExtraCorrelationsPro->Fill(1.5,two1n1nW1W1W2,dM211);
4872 } // end of if(dMult>1)
4873 //..............................................................................................
4875 //..............................................................................................
4876 // 3-particle correlations:
4877 Double_t three2n1n1nW2W1W1 = 0.; // <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
4883 three2n1n1nW2W1W1 = (pow(dReQ1n1k,2.)*dReQ2n2k+2.*dReQ1n1k*dImQ1n1k*dImQ2n2k-pow(dImQ1n1k,2.)*dReQ2n2k
4884 - 2.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k)
4885 - pow(dReQ2n2k,2)-pow(dImQ2n2k,2)
4886 + 2.*(*fSMpk)(0,4))/dM211;
4887 fIntFlowCorrelationsAllPro->Fill(5.5,three2n1n1nW2W1W1,dM211);
4889 } // end of if(dMult>2)
4890 //..............................................................................................
4892 //..............................................................................................
4893 // 4-particle correlations:
4894 Double_t four1n1n1n1nW1W1W1W1 = 0.; // <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
4899 four1n1n1n1nW1W1W1W1 = (pow(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.),2)
4900 - 2.*(pow(dReQ1n1k,2.)*dReQ2n2k+2.*dReQ1n1k*dImQ1n1k*dImQ2n2k-pow(dImQ1n1k,2.)*dReQ2n2k)
4901 + 8.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k)
4902 + (pow(dReQ2n2k,2)+pow(dImQ2n2k,2))
4903 - 4.*(*fSMpk)(0,2)*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
4904 - 6.*(*fSMpk)(0,4)+2.*(*fSMpk)(1,2))/dM1111;
4906 // average correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for single event:
4907 fIntFlowCorrelationsEBE->SetBinContent(2,four1n1n1n1nW1W1W1W1);
4908 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(2,dM1111);
4909 // average correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for all events:
4910 fIntFlowCorrelationsPro->Fill(1.5,four1n1n1n1nW1W1W1W1,dM1111);
4911 // average squared correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for all events:
4912 fIntFlowSquaredCorrelationsPro->Fill(1.5,four1n1n1n1nW1W1W1W1*four1n1n1n1nW1W1W1W1,dM1111);
4913 fIntFlowCorrelationsAllPro->Fill(10.5,four1n1n1n1nW1W1W1W1,dM1111);
4915 } // end of if(dMult>3)
4916 //..............................................................................................
4918 } // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelationsUsingParticleWeights()
4920 //================================================================================================================================
4922 void AliFlowAnalysisWithQCumulants::InitializeArraysForIntFlow()
4924 // Initialize all arrays used to calculate integrated flow.
4926 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
4928 fIntFlowCorrectionTermsForNUAEBE[sc] = NULL;
4929 fIntFlowEventWeightForCorrectionTermsForNUAEBE[sc] = NULL;
4930 fIntFlowCorrectionTermsForNUAPro[sc] = NULL;
4931 fIntFlowCorrectionTermsForNUAHist[sc] = NULL;
4932 for(Int_t ci=0;ci<4;ci++) // correction term index (to be improved - hardwired 4)
4934 fIntFlowCorrectionTermsForNUAVsMPro[sc][ci] = NULL;
4936 for(Int_t power=0;power<2;power++) // linear or quadratic
4938 fIntFlowSumOfEventWeightsNUA[sc][power] = NULL;
4941 for(Int_t power=0;power<2;power++) // linear or quadratic
4943 fIntFlowSumOfEventWeights[power] = NULL;
4945 for(Int_t i=0;i<4;i++) // print on the screen the final results (0=RF, 1=RP, 2=POI, 3=RF (rebbined in M))
4947 fPrintFinalResults[i] = kTRUE;
4949 for(Int_t ci=0;ci<4;ci++) // correlation index or cumulant order
4951 fIntFlowCorrelationsVsMPro[ci] = NULL;
4952 fIntFlowSquaredCorrelationsVsMPro[ci] = NULL;
4953 fIntFlowCorrelationsVsMHist[ci] = NULL;
4954 fIntFlowQcumulantsVsM[ci] = NULL;
4955 fIntFlowVsM[ci] = NULL;
4956 fIntFlowDetectorBiasVsM[ci] = NULL;
4957 for(Int_t lc=0;lc<2;lc++)
4959 fIntFlowSumOfEventWeightsVsM[ci][lc] = NULL;
4962 for(Int_t pi=0;pi<6;pi++) // product or covariance index
4964 fIntFlowProductOfCorrelationsVsMPro[pi] = NULL;
4965 fIntFlowCovariancesVsM[pi] = NULL;
4966 fIntFlowSumOfProductOfEventWeightsVsM[pi] = NULL;
4969 } // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForIntFlow()
4971 //================================================================================================================================
4973 void AliFlowAnalysisWithQCumulants::InitializeArraysForDiffFlow()
4975 // Initialize all arrays needed to calculate differential flow.
4976 // a) Initialize lists holding profiles;
4977 // b) Initialize lists holding histograms;
4978 // c) Initialize event-by-event quantities;
4979 // d) Initialize profiles;
4980 // e) Initialize histograms holding final results.
4982 // a) Initialize lists holding profiles;
4983 for(Int_t t=0;t<2;t++) // type (RP, POI)
4985 for(Int_t pe=0;pe<2;pe++) // pt or eta
4987 fDiffFlowCorrelationsProList[t][pe] = NULL;
4988 fDiffFlowProductOfCorrelationsProList[t][pe] = NULL;
4989 fDiffFlowCorrectionsProList[t][pe] = NULL;
4993 // b) Initialize lists holding histograms;
4994 for(Int_t t=0;t<2;t++) // type (RP, POI)
4996 for(Int_t pe=0;pe<2;pe++) // pt or eta
4998 fDiffFlowCorrelationsHistList[t][pe] = NULL;
4999 for(Int_t power=0;power<2;power++)
5001 fDiffFlowSumOfEventWeightsHistList[t][pe][power] = NULL;
5002 } // end of for(Int_t power=0;power<2;power++)
5003 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe] = NULL;
5004 fDiffFlowCorrectionsHistList[t][pe] = NULL;
5005 fDiffFlowCovariancesHistList[t][pe] = NULL;
5006 fDiffFlowCumulantsHistList[t][pe] = NULL;
5007 fDiffFlowHistList[t][pe] = NULL;
5008 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
5009 } // enf of for(Int_t t=0;t<2;t++) // type (RP, POI)
5011 // c) Initialize event-by-event quantities:
5013 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
5015 for(Int_t pe=0;pe<2;pe++) // pt or eta
5017 for(Int_t m=0;m<4;m++) // multiple of harmonic
5019 for(Int_t k=0;k<9;k++) // power of weight
5021 fReRPQ1dEBE[t][pe][m][k] = NULL;
5022 fImRPQ1dEBE[t][pe][m][k] = NULL;
5023 fs1dEBE[t][pe][k] = NULL; // to be improved (this doesn't need to be within loop over m)
5029 for(Int_t t=0;t<2;t++) // type (RP or POI)
5031 for(Int_t pe=0;pe<2;pe++) // pt or eta
5033 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
5035 for(Int_t cti=0;cti<9;cti++) // correction term index
5037 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti] = NULL;
5043 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
5045 for(Int_t m=0;m<4;m++) // multiple of harmonic
5047 for(Int_t k=0;k<9;k++) // power of weight
5049 fReRPQ2dEBE[t][m][k] = NULL;
5050 fImRPQ2dEBE[t][m][k] = NULL;
5051 fs2dEBE[t][k] = NULL; // to be improved (this doesn't need to be within loop over m)
5056 // d) Initialize profiles:
5057 for(Int_t t=0;t<2;t++) // type: RP or POI
5059 for(Int_t pe=0;pe<2;pe++) // pt or eta
5061 for(Int_t ci=0;ci<4;ci++) // correlation index
5063 fDiffFlowCorrelationsPro[t][pe][ci] = NULL;
5064 fDiffFlowSquaredCorrelationsPro[t][pe][ci] = NULL;
5065 } // end of for(Int_t ci=0;ci<4;ci++)
5066 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
5068 for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index
5070 fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2] = NULL;
5071 } // end of for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index
5072 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
5073 // correction terms for nua:
5074 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
5076 for(Int_t cti=0;cti<9;cti++) // correction term index
5078 fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti] = NULL;
5081 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
5082 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
5084 // e) Initialize histograms holding final results.
5085 for(Int_t t=0;t<2;t++) // type: RP or POI
5087 for(Int_t pe=0;pe<2;pe++) // pt or eta
5089 for(Int_t ci=0;ci<4;ci++) // correlation index
5091 fDiffFlowCorrelationsHist[t][pe][ci] = NULL;
5092 fDiffFlowCumulants[t][pe][ci] = NULL;
5093 fDiffFlow[t][pe][ci] = NULL;
5094 } // end of for(Int_t ci=0;ci<4;ci++)
5095 for(Int_t covarianceIndex=0;covarianceIndex<5;covarianceIndex++)
5097 fDiffFlowCovariances[t][pe][covarianceIndex] = NULL;
5098 } // end of for(Int_t covarianceIndex=0;covarianceIndex<5;covarianceIndex++)
5099 // correction terms for nua:
5100 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
5102 for(Int_t cti=0;cti<9;cti++) // correction term index
5104 fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti] = NULL;
5107 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
5108 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
5110 // sum of event weights for reduced correlations:
5111 for(Int_t t=0;t<2;t++) // type = RP or POI
5113 for(Int_t pe=0;pe<2;pe++) // pt or eta
5115 for(Int_t p=0;p<2;p++) // power of weight is 1 or 2
5117 for(Int_t ew=0;ew<4;ew++) // event weight index for reduced correlations
5119 fDiffFlowSumOfEventWeights[t][pe][p][ew] = NULL;
5124 // product of event weights for both types of correlations:
5125 for(Int_t t=0;t<2;t++) // type = RP or POI
5127 for(Int_t pe=0;pe<2;pe++) // pt or eta
5129 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
5131 for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index
5133 fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2] = NULL;
5144 // nested lists in fDiffFlowProfiles:
5145 for(Int_t t=0;t<2;t++)
5148 for(Int_t pW=0;pW<2;pW++) // particle weights not used (0) or used (1)
5150 fDFPParticleWeights[t][pW] = NULL;
5151 for(Int_t eW=0;eW<2;eW++)
5153 fDFPEventWeights[t][pW][eW] = NULL;
5154 fDiffFlowCorrelations[t][pW][eW] = NULL;
5155 fDiffFlowProductsOfCorrelations[t][pW][eW] = NULL;
5156 for(Int_t sc=0;sc<2;sc++)
5158 fDiffFlowCorrectionTerms[t][pW][eW][sc] = NULL;
5170 for(Int_t pW=0;pW<2;pW++) // particle weights not used (0) or used (1)
5172 for(Int_t eW=0;eW<2;eW++)
5175 for(Int_t correlationIndex=0;correlationIndex<4;correlationIndex++)
5177 fCorrelationsPro[t][pW][eW][correlationIndex] = NULL;
5179 // products of correlations:
5180 for(Int_t productOfCorrelationsIndex=0;productOfCorrelationsIndex<6;productOfCorrelationsIndex++)
5182 fProductsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex] = NULL;
5184 // correction terms:
5185 for(Int_t sc=0;sc<2;sc++)
5187 for(Int_t correctionsIndex=0;correctionsIndex<2;correctionsIndex++)
5189 fCorrectionTermsPro[t][pW][eW][sc][correctionsIndex] = NULL;
5196 } // end of AliFlowAnalysisWithQCumulants::InitializeArraysForDiffFlow()
5199 //================================================================================================================================
5203 void AliFlowAnalysisWithQCumulants::CalculateCorrelationsForDifferentialFlow2D(TString type)
5205 // calculate all reduced correlations needed for differential flow for each (pt,eta) bin:
5207 if(type == "RP") // to be improved (removed)
5214 Int_t typeFlag = -1;
5216 // reduced correlations ares stored in fCorrelationsPro[t][pW][index] and are indexed as follows:
5222 Double_t dMult = (*fSMpk)(0,0);
5224 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
5225 Double_t dReQ1n = (*fReQ)(0,0);
5226 Double_t dReQ2n = (*fReQ)(1,0);
5227 //Double_t dReQ3n = (*fReQ)(2,0);
5228 //Double_t dReQ4n = (*fReQ)(3,0);
5229 Double_t dImQ1n = (*fImQ)(0,0);
5230 Double_t dImQ2n = (*fImQ)(1,0);
5231 //Double_t dImQ3n = (*fImQ)(2,0);
5232 //Double_t dImQ4n = (*fImQ)(3,0);
5234 // looping over all (pt,eta) bins and calculating correlations needed for differential flow:
5235 for(Int_t p=1;p<=fnBinsPt;p++)
5237 for(Int_t e=1;e<=fnBinsEta;e++)
5239 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin):
5240 Double_t p1n0kRe = 0.;
5241 Double_t p1n0kIm = 0.;
5243 // number of POIs in particular (pt,eta) bin:
5246 // 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):
5247 Double_t q1n0kRe = 0.;
5248 Double_t q1n0kIm = 0.;
5249 Double_t q2n0kRe = 0.;
5250 Double_t q2n0kIm = 0.;
5252 // number of particles which are both RPs and POIs in particular (pt,eta) bin:
5256 q1n0kRe = fReEBE2D[2][0][0]->GetBinContent(fReEBE2D[2][0][0]->GetBin(p,e))
5257 * fReEBE2D[2][0][0]->GetBinEntries(fReEBE2D[2][0][0]->GetBin(p,e));
5258 q1n0kIm = fImEBE2D[2][0][0]->GetBinContent(fImEBE2D[2][0][0]->GetBin(p,e))
5259 * fImEBE2D[2][0][0]->GetBinEntries(fImEBE2D[2][0][0]->GetBin(p,e));
5260 q2n0kRe = fReEBE2D[2][1][0]->GetBinContent(fReEBE2D[2][1][0]->GetBin(p,e))
5261 * fReEBE2D[2][1][0]->GetBinEntries(fReEBE2D[2][1][0]->GetBin(p,e));
5262 q2n0kIm = fImEBE2D[2][1][0]->GetBinContent(fImEBE2D[2][1][0]->GetBin(p,e))
5263 * fImEBE2D[2][1][0]->GetBinEntries(fImEBE2D[2][1][0]->GetBin(p,e));
5265 mq = fReEBE2D[2][0][0]->GetBinEntries(fReEBE2D[2][0][0]->GetBin(p,e)); // to be improved (cross-checked by accessing other profiles here)
5270 p1n0kRe = fReEBE2D[1][0][0]->GetBinContent(fReEBE2D[1][0][0]->GetBin(p,e))
5271 * fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e));
5272 p1n0kIm = fImEBE2D[1][0][0]->GetBinContent(fImEBE2D[1][0][0]->GetBin(p,e))
5273 * fImEBE2D[1][0][0]->GetBinEntries(fImEBE2D[1][0][0]->GetBin(p,e));
5275 mp = fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e)); // to be improved (cross-checked by accessing other profiles here)
5279 else if(type == "RP")
5281 // p_{m*n,0} = q_{m*n,0}:
5289 // count events with non-empty (pt,eta) bin:
5292 fNonEmptyBins2D[typeFlag]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,1);
5295 // 2'-particle correlation for particular (pt,eta) bin:
5296 Double_t two1n1nPtEta = 0.;
5299 two1n1nPtEta = (p1n0kRe*dReQ1n+p1n0kIm*dImQ1n-mq)
5302 // fill the 2D profile to get the average correlation for each (pt,eta) bin:
5305 //f2pPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);
5307 fCorrelationsPro[1][0][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);
5309 else if(type == "RP")
5311 //f2pPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);
5312 fCorrelationsPro[0][0][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);
5314 } // end of if(mp*dMult-mq)
5316 // 4'-particle correlation:
5317 Double_t four1n1n1n1nPtEta = 0.;
5318 if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5319 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)
5321 four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
5322 - q2n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))
5323 - 2.*q2n0kIm*dReQ1n*dImQ1n
5324 - p1n0kRe*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)
5325 + p1n0kIm*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)
5326 - 2.*dMult*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
5327 - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*mq
5328 + 6.*(q1n0kRe*dReQ1n+q1n0kIm*dImQ1n)
5329 + 1.*(q2n0kRe*dReQ2n+q2n0kIm*dImQ2n)
5330 + 2.*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
5333 / ((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5334 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
5336 // fill the 2D profile to get the average correlation for each (pt, eta) bin:
5339 //f4pPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
5340 // (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5341 // + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
5343 fCorrelationsPro[1][0][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
5344 (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5345 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
5347 else if(type == "RP")
5349 //f4pPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
5350 // (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5351 // + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
5353 fCorrelationsPro[0][0][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
5354 (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5355 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
5357 } // end of if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5358 // +mq*(dMult-1.)*(dMult-2.)*(dMult-3.))
5360 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
5361 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5367 } // end of AliFlowAnalysisWithQCumulants::CalculateCorrelationsForDifferentialFlow2D()
5374 //================================================================================================================================
5377 void AliFlowAnalysisWithQCumulants::CalculateWeightedCorrelationsForDifferentialFlow2D(TString type)
5379 // calculate all weighted correlations needed for differential flow
5381 if(type == "RP") // to be improved (removed)
5390 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
5391 Double_t dReQ1n1k = (*fReQ)(0,1);
5392 Double_t dReQ2n2k = (*fReQ)(1,2);
5393 Double_t dReQ1n3k = (*fReQ)(0,3);
5394 //Double_t dReQ4n4k = (*fReQ)(3,4);
5395 Double_t dImQ1n1k = (*fImQ)(0,1);
5396 Double_t dImQ2n2k = (*fImQ)(1,2);
5397 Double_t dImQ1n3k = (*fImQ)(0,3);
5398 //Double_t dImQ4n4k = (*fImQ)(3,4);
5400 // S^M_{p,k} (see .h file for the definition of fSMpk):
5401 Double_t dSM1p1k = (*fSMpk)(0,1);
5402 Double_t dSM1p2k = (*fSMpk)(0,2);
5403 Double_t dSM1p3k = (*fSMpk)(0,3);
5404 Double_t dSM2p1k = (*fSMpk)(1,1);
5405 Double_t dSM3p1k = (*fSMpk)(2,1);
5407 // looping over all (pt,eta) bins and calculating weighted correlations needed for differential flow:
5408 for(Int_t p=1;p<=fnBinsPt;p++)
5410 for(Int_t e=1;e<=fnBinsEta;e++)
5412 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin):
5413 Double_t p1n0kRe = 0.;
5414 Double_t p1n0kIm = 0.;
5416 // number of POIs in particular (pt,eta) bin):
5419 // real and imaginary parts of q_{m*n,k}:
5420 // (weighted Q-vector evaluated for particles which are both RPs and POIs in particular (pt,eta) bin)
5421 Double_t q1n2kRe = 0.;
5422 Double_t q1n2kIm = 0.;
5423 Double_t q2n1kRe = 0.;
5424 Double_t q2n1kIm = 0.;
5426 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
5427 Double_t s1p1k = 0.;
5428 Double_t s1p2k = 0.;
5429 Double_t s1p3k = 0.;
5431 // M0111 from Eq. (118) in QC2c (to be improved (notation))
5432 Double_t dM0111 = 0.;
5437 p1n0kRe = fReEBE2D[1][0][0]->GetBinContent(fReEBE2D[1][0][0]->GetBin(p,e))
5438 * fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e));
5439 p1n0kIm = fImEBE2D[1][0][0]->GetBinContent(fImEBE2D[1][0][0]->GetBin(p,e))
5440 * fImEBE2D[1][0][0]->GetBinEntries(fImEBE2D[1][0][0]->GetBin(p,e));
5442 mp = fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e));
5445 q1n2kRe = fReEBE2D[2][0][2]->GetBinContent(fReEBE2D[2][0][2]->GetBin(p,e))
5446 * fReEBE2D[2][0][2]->GetBinEntries(fReEBE2D[2][0][2]->GetBin(p,e));
5447 q1n2kIm = fImEBE2D[2][0][2]->GetBinContent(fImEBE2D[2][0][2]->GetBin(p,e))
5448 * fImEBE2D[2][0][2]->GetBinEntries(fImEBE2D[2][0][2]->GetBin(p,e));
5449 q2n1kRe = fReEBE2D[2][1][1]->GetBinContent(fReEBE2D[2][1][1]->GetBin(p,e))
5450 * fReEBE2D[2][1][1]->GetBinEntries(fReEBE2D[2][1][1]->GetBin(p,e));
5451 q2n1kIm = fImEBE2D[2][1][1]->GetBinContent(fImEBE2D[2][1][1]->GetBin(p,e))
5452 * fImEBE2D[2][1][1]->GetBinEntries(fImEBE2D[2][1][1]->GetBin(p,e));
5454 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
5455 s1p1k = pow(fs2D[2][1]->GetBinContent(fs2D[2][1]->GetBin(p,e)),1.);
5456 s1p2k = pow(fs2D[2][2]->GetBinContent(fs2D[2][2]->GetBin(p,e)),1.);
5457 s1p3k = pow(fs2D[2][3]->GetBinContent(fs2D[2][3]->GetBin(p,e)),1.);
5459 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
5460 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
5461 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
5462 + 2.*(s1p3k-s1p2k*dSM1p1k));
5464 else if(type == "RP")
5466 p1n0kRe = fReEBE2D[0][0][0]->GetBinContent(fReEBE2D[0][0][0]->GetBin(p,e))
5467 * fReEBE2D[0][0][0]->GetBinEntries(fReEBE2D[0][0][0]->GetBin(p,e));
5468 p1n0kIm = fImEBE2D[0][0][0]->GetBinContent(fImEBE2D[0][0][0]->GetBin(p,e))
5469 * fImEBE2D[0][0][0]->GetBinEntries(fImEBE2D[0][0][0]->GetBin(p,e));
5471 mp = fReEBE2D[0][0][0]->GetBinEntries(fReEBE2D[0][0][0]->GetBin(p,e));
5474 q1n2kRe = fReEBE2D[0][0][2]->GetBinContent(fReEBE2D[0][0][2]->GetBin(p,e))
5475 * fReEBE2D[0][0][2]->GetBinEntries(fReEBE2D[0][0][2]->GetBin(p,e));
5476 q1n2kIm = fImEBE2D[0][0][2]->GetBinContent(fImEBE2D[0][0][2]->GetBin(p,e))
5477 * fImEBE2D[0][0][2]->GetBinEntries(fImEBE2D[0][0][2]->GetBin(p,e));
5478 q2n1kRe = fReEBE2D[0][1][1]->GetBinContent(fReEBE2D[0][1][1]->GetBin(p,e))
5479 * fReEBE2D[0][1][1]->GetBinEntries(fReEBE2D[0][1][1]->GetBin(p,e));
5480 q2n1kIm = fImEBE2D[0][1][1]->GetBinContent(fImEBE2D[0][1][1]->GetBin(p,e))
5481 * fImEBE2D[0][1][1]->GetBinEntries(fImEBE2D[0][1][1]->GetBin(p,e));
5483 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
5484 s1p1k = pow(fs2D[0][1]->GetBinContent(fs2D[0][1]->GetBin(p,e)),1.);
5485 s1p2k = pow(fs2D[0][2]->GetBinContent(fs2D[0][2]->GetBin(p,e)),1.);
5486 s1p3k = pow(fs2D[0][3]->GetBinContent(fs2D[0][3]->GetBin(p,e)),1.);
5488 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
5489 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
5490 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
5491 + 2.*(s1p3k-s1p2k*dSM1p1k));
5492 //...............................................................................................
5495 // 2'-particle correlation:
5496 Double_t two1n1nW0W1PtEta = 0.;
5497 if(mp*dSM1p1k-s1p1k)
5499 two1n1nW0W1PtEta = (p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k-s1p1k)
5500 / (mp*dSM1p1k-s1p1k);
5502 // fill the 2D profile to get the average correlation for each (pt, eta) bin:
5505 //f2pPtEtaPOIW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,
5506 // mp*dSM1p1k-s1p1k);
5507 fCorrelationsPro[1][1][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,mp*dSM1p1k-s1p1k);
5509 else if(type == "RP")
5511 //f2pPtEtaRPW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,
5512 // mp*dSM1p1k-s1p1k);
5513 fCorrelationsPro[0][1][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,mp*dSM1p1k-s1p1k);
5515 } // end of if(mp*dMult-dmPrimePrimePtEta)
5517 // 4'-particle correlation:
5518 Double_t four1n1n1n1nW0W1W1W1PtEta = 0.;
5521 four1n1n1n1nW0W1W1W1PtEta = ((pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
5522 - q2n1kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))
5523 - 2.*q2n1kIm*dReQ1n1k*dImQ1n1k
5524 - p1n0kRe*(dReQ1n1k*dReQ2n2k+dImQ1n1k*dImQ2n2k)
5525 + p1n0kIm*(dImQ1n1k*dReQ2n2k-dReQ1n1k*dImQ2n2k)
5526 - 2.*dSM1p2k*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
5527 - 2.*(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*s1p1k
5528 + 6.*(q1n2kRe*dReQ1n1k+q1n2kIm*dImQ1n1k)
5529 + 1.*(q2n1kRe*dReQ2n2k+q2n1kIm*dImQ2n2k)
5530 + 2.*(p1n0kRe*dReQ1n3k+p1n0kIm*dImQ1n3k)
5533 / dM0111; // to be imropoved (notation of dM0111)
5535 // fill the 2D profile to get the average correlation for each (pt, eta) bin:
5538 //f4pPtEtaPOIW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);
5539 fCorrelationsPro[1][1][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);
5541 else if(type == "RP")
5543 //f4pPtEtaRPW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);
5544 fCorrelationsPro[0][1][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);
5546 } // end of if(dM0111)
5548 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
5549 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5554 } // end of AliFlowAnalysisWithQCumulants::CalculateWeightedCorrelationsForDifferentialFlow2D(TString type)
5557 //================================================================================================================================
5562 void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsForDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights)
5564 // 1.) Access average for 2D correlations from profiles and store them in 2D final results histograms;
5565 // 2.) Access spread for 2D correlations from profiles, calculate error and store it in 2D final results histograms;
5566 // 3.) Make projections along pt and eta axis and store results and errors in 1D final results histograms.
5568 Int_t typeFlag = -1;
5569 Int_t pWeightsFlag = -1;
5570 Int_t eWeightsFlag = -1;
5575 } else if(type == "POI")
5580 cout<<"WARNING: type must be either RP or POI in AFAWQC::FCFDF() !!!!"<<endl;
5584 if(!useParticleWeights)
5592 if(eventWeights == "exact")
5599 Int_t pW = pWeightsFlag;
5600 Int_t eW = eWeightsFlag;
5602 // from 2D histogram fNonEmptyBins2D make two 1D histograms fNonEmptyBins1D in pt and eta (to be improved (i.e. moved somewhere else))
5604 for(Int_t p=1;p<fnBinsPt;p++)
5606 Double_t contentPt = 0.;
5607 for(Int_t e=1;e<=fnBinsEta;e++)
5609 contentPt += (fNonEmptyBins2D[t]->GetBinContent(fNonEmptyBins2D[t]->GetBin(p,e)));
5611 fNonEmptyBins1D[t][0]->SetBinContent(p,contentPt);
5614 for(Int_t e=1;e<fnBinsEta;e++)
5616 Double_t contentEta = 0.;
5617 for(Int_t p=1;p<=fnBinsPt;p++)
5619 contentEta += (fNonEmptyBins2D[t]->GetBinContent(fNonEmptyBins2D[t]->GetBin(p,e)));
5621 fNonEmptyBins1D[t][1]->SetBinContent(e,contentEta);
5624 // from 2D profile in (pt,eta) make two 1D profiles in (pt) and (eta):
5625 TProfile *profile[2][4]; // [0=pt,1=eta][correlation index] // to be improved (do not hardwire the correlation index)
5627 for(Int_t pe=0;pe<2;pe++) // pt or eta
5629 for(Int_t ci=0;ci<4;ci++) // correlation index
5631 if(pe==0) profile[pe][ci] = this->MakePtProjection(fCorrelationsPro[t][pW][eW][ci]);
5632 if(pe==1) profile[pe][ci] = this->MakeEtaProjection(fCorrelationsPro[t][pW][eW][ci]);
5636 // transfer 2D profile into 2D histogram:
5637 // to be improved (see in documentation if there is a method to transfer values from 2D profile into 2D histogram)
5638 for(Int_t ci=0;ci<4;ci++)
5640 for(Int_t p=1;p<=fnBinsPt;p++)
5642 for(Int_t e=1;e<=fnBinsEta;e++)
5644 Double_t correlation = fCorrelationsPro[t][pW][eW][ci]->GetBinContent(fCorrelationsPro[t][pW][eW][ci]->GetBin(p,e));
5645 Double_t spread = fCorrelationsPro[t][pW][eW][ci]->GetBinError(fCorrelationsPro[t][pW][eW][ci]->GetBin(p,e));
5646 Double_t nEvts = fNonEmptyBins2D[t]->GetBinContent(fNonEmptyBins2D[t]->GetBin(p,e));
5647 Double_t error = 0.;
5648 fFinalCorrelations2D[t][pW][eW][ci]->SetBinContent(fFinalCorrelations2D[t][pW][eW][ci]->GetBin(p,e),correlation);
5651 error = spread/pow(nEvts,0.5);
5652 fFinalCorrelations2D[t][pW][eW][ci]->SetBinError(fFinalCorrelations2D[t][pW][eW][ci]->GetBin(p,e),error);
5654 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
5655 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5656 } // end of for(Int_t ci=0;ci<4;ci++)
5658 // transfer 1D profile into 1D histogram (pt):
5659 // to be improved (see in documentation if there is a method to transfer values from 1D profile into 1D histogram)
5660 for(Int_t ci=0;ci<4;ci++)
5662 for(Int_t p=1;p<=fnBinsPt;p++)
5666 Double_t correlation = profile[0][ci]->GetBinContent(p);
5667 Double_t spread = profile[0][ci]->GetBinError(p);
5668 Double_t nEvts = fNonEmptyBins1D[t][0]->GetBinContent(p);
5669 Double_t error = 0.;
5670 fFinalCorrelations1D[t][pW][eW][0][ci]->SetBinContent(p,correlation);
5673 error = spread/pow(nEvts,0.5);
5674 fFinalCorrelations1D[t][pW][eW][0][ci]->SetBinError(p,error);
5677 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5678 } // end of for(Int_t ci=0;ci<4;ci++)
5680 // transfer 1D profile into 1D histogram (eta):
5681 // to be improved (see in documentation if there is a method to transfer values from 1D profile into 1D histogram)
5682 for(Int_t ci=0;ci<4;ci++)
5684 for(Int_t e=1;e<=fnBinsEta;e++)
5688 Double_t correlation = profile[1][ci]->GetBinContent(e);
5689 fFinalCorrelations1D[t][pW][eW][1][ci]->SetBinContent(e,correlation);
5691 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
5692 } // end of for(Int_t ci=0;ci<4;ci++)
5694 } // end of void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsForDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights)
5698 //================================================================================================================================
5701 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulants(TString type, TString ptOrEta)
5703 // calcualate cumulants for differential flow from measured correlations
5704 // Remark: cumulants calculated here are NOT corrected for non-uniform acceptance. This correction is applied in the method ...
5705 // to be improved (description)
5708 Int_t ptEtaFlag = 0;
5713 } else if(type == "POI")
5721 } else if(ptOrEta == "Eta")
5728 Int_t pe = ptEtaFlag;
5731 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
5733 // correlation <<2>>:
5734 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1);
5737 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
5739 // reduced correlations:
5740 Double_t twoPrime = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b); // <<2'>>(pt)
5741 Double_t fourPrime = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b); // <<4'>>(pt)
5742 // final statistical error of reduced correlations:
5743 //Double_t twoPrimeError = fFinalCorrelations1D[t][pW][eW][0][0]->GetBinError(p);
5745 Double_t qc2Prime = twoPrime; // QC{2'}
5746 //Double_t qc2PrimeError = twoPrimeError; // final stat. error of QC{2'}
5747 fDiffFlowCumulants[t][pe][0]->SetBinContent(b,qc2Prime);
5748 //fFinalCumulantsPt[t][pW][eW][nua][0]->SetBinError(p,qc2PrimeError);
5750 Double_t qc4Prime = fourPrime - 2.*twoPrime*two; // QC{4'} = <<4'>> - 2*<<2'>><<2>>
5751 fDiffFlowCumulants[t][pe][1]->SetBinContent(b,qc4Prime);
5752 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5757 // to be improved (see documentation if I can do all this without looping)
5758 for(Int_t p=1;p<=fnBinsPt;p++)
5760 for(Int_t e=1;e<=fnBinsEta;e++)
5762 // reduced correlations:
5763 Double_t twoPrime = fFinalCorrelations2D[t][pW][eW][0]->GetBinContent(fFinalCorrelations2D[t][pW][eW][0]->GetBin(p,e)); // <<2'>>(pt,eta)
5764 Double_t fourPrime = fFinalCorrelations2D[t][pW][eW][1]->GetBinContent(fFinalCorrelations2D[t][pW][eW][1]->GetBin(p,e)); // <<4'>>(pt,eta)
5765 for(Int_t nua=0;nua<2;nua++)
5768 Double_t qc2Prime = twoPrime; // QC{2'} = <<2'>>
5769 fFinalCumulants2D[t][pW][eW][nua][0]->SetBinContent(fFinalCumulants2D[t][pW][eW][nua][0]->GetBin(p,e),qc2Prime);
5771 Double_t qc4Prime = fourPrime - 2.*twoPrime*two; // QC{4'} = <<4'>> - 2*<<2'>><<2>>
5772 fFinalCumulants2D[t][pW][eW][nua][1]->SetBinContent(fFinalCumulants2D[t][pW][eW][nua][1]->GetBin(p,e),qc4Prime);
5773 } // end of for(Int_t nua=0;nua<2;nua++)
5774 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
5775 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5778 } // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulants(TString type, Bool_t useParticleWeights, TString eventWeights);
5780 //================================================================================================================================
5782 void AliFlowAnalysisWithQCumulants::CalculateFinalResultsForRPandPOIIntegratedFlow(TString type)
5784 // calculate final results for integrated flow of RPs and POIs
5791 } else if(type == "POI")
5796 cout<<"WARNING: type must be either RP or POI in AFAWQC::CDF() !!!!"<<endl;
5804 TH1F *yield2ndPt = NULL;
5805 TH1F *yield4thPt = NULL;
5806 TH1F *yield6thPt = NULL;
5807 TH1F *yield8thPt = NULL;
5811 if(fFillMultipleControlHistograms)
5813 yield2ndPt = (TH1F*)(fCommonHists2nd->GetHistPtPOI())->Clone();
5814 yield4thPt = (TH1F*)(fCommonHists4th->GetHistPtPOI())->Clone();
5815 yield6thPt = (TH1F*)(fCommonHists6th->GetHistPtPOI())->Clone();
5816 yield8thPt = (TH1F*)(fCommonHists8th->GetHistPtPOI())->Clone();
5819 yield2ndPt = (TH1F*)(fCommonHists->GetHistPtPOI())->Clone();
5820 yield4thPt = (TH1F*)(fCommonHists->GetHistPtPOI())->Clone();
5821 yield6thPt = (TH1F*)(fCommonHists->GetHistPtPOI())->Clone();
5822 yield8thPt = (TH1F*)(fCommonHists->GetHistPtPOI())->Clone();
5825 else if(type == "RP")
5827 if(fFillMultipleControlHistograms)
5829 yield2ndPt = (TH1F*)(fCommonHists2nd->GetHistPtRP())->Clone();
5830 yield4thPt = (TH1F*)(fCommonHists4th->GetHistPtRP())->Clone();
5831 yield6thPt = (TH1F*)(fCommonHists6th->GetHistPtRP())->Clone();
5832 yield8thPt = (TH1F*)(fCommonHists8th->GetHistPtRP())->Clone();
5835 yield2ndPt = (TH1F*)(fCommonHists->GetHistPtRP())->Clone();
5836 yield4thPt = (TH1F*)(fCommonHists->GetHistPtRP())->Clone();
5837 yield6thPt = (TH1F*)(fCommonHists->GetHistPtRP())->Clone();
5838 yield8thPt = (TH1F*)(fCommonHists->GetHistPtRP())->Clone();
5842 Int_t nBinsPt = yield2ndPt->GetNbinsX();
5844 TH1D *flow2ndPt = NULL;
5845 TH1D *flow4thPt = NULL;
5846 TH1D *flow6thPt = NULL;
5847 TH1D *flow8thPt = NULL;
5849 // to be improved (hardwired pt index)
5850 flow2ndPt = (TH1D*)fDiffFlow[t][0][0]->Clone();
5851 flow4thPt = (TH1D*)fDiffFlow[t][0][1]->Clone();
5852 flow6thPt = (TH1D*)fDiffFlow[t][0][2]->Clone();
5853 flow8thPt = (TH1D*)fDiffFlow[t][0][3]->Clone();
5855 Double_t dvn2nd = 0., dvn4th = 0., dvn6th = 0., dvn8th = 0.; // differential flow
5856 Double_t dErrvn2nd = 0., dErrvn4th = 0., dErrvn6th = 0., dErrvn8th = 0.; // error on differential flow
5858 Double_t dVn2nd = 0., dVn4th = 0., dVn6th = 0., dVn8th = 0.; // integrated flow
5859 Double_t dErrVn2nd = 0., dErrVn4th = 0., dErrVn6th = 0., dErrVn8th = 0.; // error on integrated flow
5861 Double_t dYield2nd = 0., dYield4th = 0., dYield6th = 0., dYield8th = 0.; // pt yield
5862 Double_t dSum2nd = 0., dSum4th = 0., dSum6th = 0., dSum8th = 0.; // needed for normalizing integrated flow
5864 // looping over pt bins:
5865 for(Int_t p=1;p<nBinsPt+1;p++)
5867 dvn2nd = flow2ndPt->GetBinContent(p);
5868 dvn4th = flow4thPt->GetBinContent(p);
5869 dvn6th = flow6thPt->GetBinContent(p);
5870 dvn8th = flow8thPt->GetBinContent(p);
5872 dErrvn2nd = flow2ndPt->GetBinError(p);
5873 dErrvn4th = flow4thPt->GetBinError(p);
5874 dErrvn6th = flow6thPt->GetBinError(p);
5875 dErrvn8th = flow8thPt->GetBinError(p);
5877 dYield2nd = yield2ndPt->GetBinContent(p);
5878 dYield4th = yield4thPt->GetBinContent(p);
5879 dYield6th = yield6thPt->GetBinContent(p);
5880 dYield8th = yield8thPt->GetBinContent(p);
5882 dVn2nd += dvn2nd*dYield2nd;
5883 dVn4th += dvn4th*dYield4th;
5884 dVn6th += dvn6th*dYield6th;
5885 dVn8th += dvn8th*dYield8th;
5887 dSum2nd += dYield2nd;
5888 dSum4th += dYield4th;
5889 dSum6th += dYield6th;
5890 dSum8th += dYield8th;
5892 dErrVn2nd += dYield2nd*dYield2nd*dErrvn2nd*dErrvn2nd; // ro be improved (check this relation)
5893 dErrVn4th += dYield4th*dYield4th*dErrvn4th*dErrvn4th;
5894 dErrVn6th += dYield6th*dYield6th*dErrvn6th*dErrvn6th;
5895 dErrVn8th += dYield8th*dYield8th*dErrvn8th*dErrvn8th;
5897 } // end of for(Int_t p=1;p<nBinsPt+1;p++)
5899 // normalizing the results for integrated flow:
5903 dErrVn2nd /= (dSum2nd*dSum2nd);
5904 dErrVn2nd = TMath::Sqrt(dErrVn2nd);
5909 dErrVn4th /= (dSum4th*dSum4th);
5910 dErrVn4th = TMath::Sqrt(dErrVn4th);
5912 //if(dSum6th) dVn6th/=dSum6th;
5913 //if(dSum8th) dVn8th/=dSum8th;
5915 // storing the results for integrated flow in common histos: (to be improved: new method for this?)
5918 fCommonHistsResults2nd->FillIntegratedFlowPOI(dVn2nd,dErrVn2nd);
5919 fCommonHistsResults4th->FillIntegratedFlowPOI(dVn4th,dErrVn4th);
5920 fCommonHistsResults6th->FillIntegratedFlowPOI(dVn6th,0.); // to be improved (errors)
5921 fCommonHistsResults8th->FillIntegratedFlowPOI(dVn8th,0.); // to be improved (errors)
5923 else if (type == "RP")
5925 fCommonHistsResults2nd->FillIntegratedFlowRP(dVn2nd,dErrVn2nd);
5926 fCommonHistsResults4th->FillIntegratedFlowRP(dVn4th,dErrVn4th);
5927 fCommonHistsResults6th->FillIntegratedFlowRP(dVn6th,0.); // to be improved (errors)
5928 fCommonHistsResults8th->FillIntegratedFlowRP(dVn8th,0.); // to be improved (errors)
5941 } // end of AliFlowAnalysisWithQCumulants::CalculateFinalResultsForRPandPOIIntegratedFlow(TString type)
5943 //================================================================================================================================
5945 void AliFlowAnalysisWithQCumulants::InitializeArraysForDistributions()
5947 // Initialize all arrays used for distributions.
5949 // a) Initialize arrays of histograms used to hold distributions of correlations;
5950 // b) Initialize array to hold min and max values of correlations.
5952 // a) Initialize arrays of histograms used to hold distributions of correlations:
5953 for(Int_t di=0;di<4;di++) // distribution index
5955 fDistributions[di] = NULL;
5958 // b) Initialize default min and max values of correlations:
5959 // (Remark: The default values bellow were chosen for v2=5% and M=500)
5960 fMinValueOfCorrelation[0] = -0.01; // <2>_min
5961 fMaxValueOfCorrelation[0] = 0.04; // <2>_max
5962 fMinValueOfCorrelation[1] = -0.00002; // <4>_min
5963 fMaxValueOfCorrelation[1] = 0.00015; // <4>_max
5964 fMinValueOfCorrelation[2] = -0.0000003; // <6>_min
5965 fMaxValueOfCorrelation[2] = 0.0000006; // <6>_max
5966 fMinValueOfCorrelation[3] = -0.000000006; // <8>_min
5967 fMaxValueOfCorrelation[3] = 0.000000003; // <8>_max
5969 } // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForDistributions()
5971 //================================================================================================================================
5973 void AliFlowAnalysisWithQCumulants::InitializeArraysForVarious()
5975 // Initialize all arrays used for various unclassified objects.
5977 for(Int_t p=0;p<4;p++) // [v_min,v_max,refMult_min,refMult_max]
5979 fPhiDistributionForOneEventSettings[p] = 0.;
5982 } // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForVarious()
5984 //================================================================================================================================
5986 void AliFlowAnalysisWithQCumulants::BookEverythingForDistributions()
5988 // a) Book profile to hold all flags for distributions of correlations;
5989 // b) Book all histograms to hold distributions of correlations.
5991 TString correlationIndex[4] = {"<2>","<4>","<6>","<8>"}; // to be improved (should I promote this to data members?)
5993 // a) Book profile to hold all flags for distributions of correlations:
5994 TString distributionsFlagsName = "fDistributionsFlags";
5995 distributionsFlagsName += fAnalysisLabel->Data();
5996 fDistributionsFlags = new TProfile(distributionsFlagsName.Data(),"Flags for Distributions of Correlations",9,0,9);
5997 fDistributionsFlags->SetTickLength(-0.01,"Y");
5998 fDistributionsFlags->SetMarkerStyle(25);
5999 fDistributionsFlags->SetLabelSize(0.05);
6000 fDistributionsFlags->SetLabelOffset(0.02,"Y");
6001 fDistributionsFlags->GetXaxis()->SetBinLabel(1,"Store or not?");
6002 fDistributionsFlags->GetXaxis()->SetBinLabel(2,"<2>_{min}");
6003 fDistributionsFlags->GetXaxis()->SetBinLabel(3,"<2>_{max}");
6004 fDistributionsFlags->GetXaxis()->SetBinLabel(4,"<4>_{min}");
6005 fDistributionsFlags->GetXaxis()->SetBinLabel(5,"<4>_{max}");
6006 fDistributionsFlags->GetXaxis()->SetBinLabel(6,"<6>_{min}");
6007 fDistributionsFlags->GetXaxis()->SetBinLabel(7,"<6>_{max}");
6008 fDistributionsFlags->GetXaxis()->SetBinLabel(8,"<8>_{min}");
6009 fDistributionsFlags->GetXaxis()->SetBinLabel(9,"<8>_{max}");
6010 fDistributionsList->Add(fDistributionsFlags);
6012 // b) Book all histograms to hold distributions of correlations.
6013 if(fStoreDistributions)
6015 TString distributionsName = "fDistributions";
6016 distributionsName += fAnalysisLabel->Data();
6017 for(Int_t di=0;di<4;di++) // distribution index
6019 fDistributions[di] = new TH1D(Form("Distribution of %s",correlationIndex[di].Data()),Form("Distribution of %s",correlationIndex[di].Data()),10000,fMinValueOfCorrelation[di],fMaxValueOfCorrelation[di]);
6020 fDistributions[di]->SetXTitle(correlationIndex[di].Data());
6021 fDistributionsList->Add(fDistributions[di]);
6022 } // end of for(Int_t di=0;di<4;di++) // distribution index
6023 } // end of if(fStoreDistributions)
6025 } // end of void AliFlowAnalysisWithQCumulants::BookEverythingForDistributions()
6027 //================================================================================================================================
6029 void AliFlowAnalysisWithQCumulants::BookEverythingForVarious()
6031 // Book all objects for various unclassified quantities.
6033 if(!fStorePhiDistributionForOneEvent){return;}
6035 // a) Book histogram holding phi distribution for single event to illustrate flow.
6037 // a) Book histogram holding phi distribution for single event to illustrate flow:
6038 fPhiDistributionForOneEvent = new TH1D("fPhiDistributionForOneEvent","",360,0.,TMath::TwoPi());
6039 fPhiDistributionForOneEvent->GetXaxis()->SetTitle("#phi");
6040 fVariousList->Add(fPhiDistributionForOneEvent);
6042 } // end of void AliFlowAnalysisWithQCumulants::BookEverythingForVarious()
6044 //================================================================================================================================
6046 void AliFlowAnalysisWithQCumulants::StoreFlagsForDistributions()
6048 // Store all flags for distributiuons of correlations in profile fDistributionsFlags.
6050 if(!fDistributionsFlags)
6052 cout<<"WARNING: fDistributionsFlags is NULL in AFAWQC::SDF() !!!!"<<endl;
6056 fDistributionsFlags->Fill(0.5,(Int_t)fStoreDistributions); // histos with distributions of correlations stored or not in the output file
6057 // store min and max values of correlations:
6058 for(Int_t di=0;di<4;di++) // distribution index
6060 fDistributionsFlags->Fill(1.5+2.*(Double_t)di,fMinValueOfCorrelation[di]);
6061 fDistributionsFlags->Fill(2.5+2.*(Double_t)di,fMaxValueOfCorrelation[di]);
6064 } // end of void AliFlowAnalysisWithQCumulants::StoreFlagsForDistributions()
6067 //================================================================================================================================
6070 void AliFlowAnalysisWithQCumulants::StoreDistributionsOfCorrelations()
6072 // Store distributions of correlations.
6074 if(!(fIntFlowCorrelationsEBE && fIntFlowEventWeightsForCorrelationsEBE))
6076 cout<<"WARNING: fIntFlowCorrelationsEBE && fIntFlowEventWeightsForCorrelationsEBE"<<endl;
6077 cout<<" is NULL in AFAWQC::SDOC() !!!!"<<endl;
6081 for(Int_t di=0;di<4;di++) // distribution index
6083 if(!fDistributions[di])
6085 cout<<"WARNING: fDistributions[di] is NULL in AFAWQC::SDOC() !!!!"<<endl;
6086 cout<<"di = "<<di<<endl;
6090 fDistributions[di]->Fill(fIntFlowCorrelationsEBE->GetBinContent(di+1),fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(di+1));
6092 } // end of for(Int_t di=0;di<4;di++) // distribution index
6094 } // end of void AliFlowAnalysisWithQCumulants::StoreDistributionsOfCorrelations()
6096 //================================================================================================================================
6098 void AliFlowAnalysisWithQCumulants::BookAndNestAllLists()
6100 // Book and nest all lists nested in the base list fHistList.
6101 // a) Book and nest lists for integrated flow;
6102 // b) Book and nest lists for differential flow;
6103 // c) Book and nest list for particle weights;
6104 // d) Book and nest list for distributions;
6105 // e) Book and nest list for various unclassified objects;
6106 // f) Book and nest list for nested loops.
6108 // a) Book and nest all lists for integrated flow:
6109 // base list for integrated flow:
6110 fIntFlowList = new TList();
6111 fIntFlowList->SetName("Integrated Flow");
6112 fIntFlowList->SetOwner(kTRUE);
6113 fHistList->Add(fIntFlowList);
6114 // list holding profiles:
6115 fIntFlowProfiles = new TList();
6116 fIntFlowProfiles->SetName("Profiles");
6117 fIntFlowProfiles->SetOwner(kTRUE);
6118 fIntFlowList->Add(fIntFlowProfiles);
6119 // list holding histograms with results:
6120 fIntFlowResults = new TList();
6121 fIntFlowResults->SetName("Results");
6122 fIntFlowResults->SetOwner(kTRUE);
6123 fIntFlowList->Add(fIntFlowResults);
6125 // b) Book and nest lists for differential flow;
6126 fDiffFlowList = new TList();
6127 fDiffFlowList->SetName("Differential Flow");
6128 fDiffFlowList->SetOwner(kTRUE);
6129 fHistList->Add(fDiffFlowList);
6130 // list holding profiles:
6131 fDiffFlowProfiles = new TList();
6132 fDiffFlowProfiles->SetName("Profiles");
6133 fDiffFlowProfiles->SetOwner(kTRUE);
6134 fDiffFlowList->Add(fDiffFlowProfiles);
6135 // list holding histograms with results:
6136 fDiffFlowResults = new TList();
6137 fDiffFlowResults->SetName("Results");
6138 fDiffFlowResults->SetOwner(kTRUE);
6139 fDiffFlowList->Add(fDiffFlowResults);
6140 // flags used for naming nested lists in list fDiffFlowProfiles and fDiffFlowResults:
6142 list.SetOwner(kTRUE);
6143 TString typeFlag[2] = {"RP","POI"};
6144 TString ptEtaFlag[2] = {"p_{T}","#eta"};
6145 TString powerFlag[2] = {"linear","quadratic"};
6146 // nested lists in fDiffFlowProfiles (~/Differential Flow/Profiles):
6147 for(Int_t t=0;t<2;t++) // type: RP or POI
6149 for(Int_t pe=0;pe<2;pe++) // pt or eta
6151 // list holding profiles with correlations:
6152 fDiffFlowCorrelationsProList[t][pe] = (TList*)list.Clone();
6153 fDiffFlowCorrelationsProList[t][pe]->SetName(Form("Profiles with correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6154 fDiffFlowProfiles->Add(fDiffFlowCorrelationsProList[t][pe]);
6155 // list holding profiles with products of correlations:
6156 fDiffFlowProductOfCorrelationsProList[t][pe] = (TList*)list.Clone();
6157 fDiffFlowProductOfCorrelationsProList[t][pe]->SetName(Form("Profiles with products of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6158 fDiffFlowProfiles->Add(fDiffFlowProductOfCorrelationsProList[t][pe]);
6159 // list holding profiles with corrections:
6160 fDiffFlowCorrectionsProList[t][pe] = (TList*)list.Clone();
6161 fDiffFlowCorrectionsProList[t][pe]->SetName(Form("Profiles with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6162 fDiffFlowProfiles->Add(fDiffFlowCorrectionsProList[t][pe]);
6163 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
6164 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
6165 // nested lists in fDiffFlowResults (~/Differential Flow/Results):
6166 for(Int_t t=0;t<2;t++) // type: RP or POI
6168 for(Int_t pe=0;pe<2;pe++) // pt or eta
6170 // list holding histograms with correlations:
6171 fDiffFlowCorrelationsHistList[t][pe] = (TList*)list.Clone();
6172 fDiffFlowCorrelationsHistList[t][pe]->SetName(Form("Correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6173 fDiffFlowResults->Add(fDiffFlowCorrelationsHistList[t][pe]);
6174 // list holding histograms with corrections:
6175 fDiffFlowCorrectionsHistList[t][pe] = (TList*)list.Clone();
6176 fDiffFlowCorrectionsHistList[t][pe]->SetName(Form("Histograms with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6177 fDiffFlowResults->Add(fDiffFlowCorrectionsHistList[t][pe]);
6178 for(Int_t power=0;power<2;power++)
6180 // list holding histograms with sums of event weights:
6181 fDiffFlowSumOfEventWeightsHistList[t][pe][power] = (TList*)list.Clone();
6182 fDiffFlowSumOfEventWeightsHistList[t][pe][power]->SetName(Form("Sum of %s event weights (%s, %s)",powerFlag[power].Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6183 fDiffFlowResults->Add(fDiffFlowSumOfEventWeightsHistList[t][pe][power]);
6184 } // end of for(Int_t power=0;power<2;power++)
6185 // list holding histograms with sums of products of event weights:
6186 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe] = (TList*)list.Clone();
6187 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]->SetName(Form("Sum of products of event weights (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6188 fDiffFlowResults->Add(fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]);
6189 // list holding histograms with covariances of correlations:
6190 fDiffFlowCovariancesHistList[t][pe] = (TList*)list.Clone();
6191 fDiffFlowCovariancesHistList[t][pe]->SetName(Form("Covariances of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6192 fDiffFlowResults->Add(fDiffFlowCovariancesHistList[t][pe]);
6193 // list holding histograms with differential Q-cumulants:
6194 fDiffFlowCumulantsHistList[t][pe] = (TList*)list.Clone();
6195 fDiffFlowCumulantsHistList[t][pe]->SetName(Form("Differential Q-cumulants (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6196 fDiffFlowResults->Add(fDiffFlowCumulantsHistList[t][pe]);
6197 // list holding histograms with differential flow estimates from Q-cumulants:
6198 fDiffFlowHistList[t][pe] = (TList*)list.Clone();
6199 fDiffFlowHistList[t][pe]->SetName(Form("Differential flow (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6200 fDiffFlowResults->Add(fDiffFlowHistList[t][pe]);
6201 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
6202 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
6204 // c) Book and nest list for particle weights:
6205 fWeightsList->SetName("Weights");
6206 fWeightsList->SetOwner(kTRUE);
6207 fHistList->Add(fWeightsList);
6209 // d) Book and nest list for distributions:
6210 fDistributionsList = new TList();
6211 fDistributionsList->SetName("Distributions");
6212 fDistributionsList->SetOwner(kTRUE);
6213 fHistList->Add(fDistributionsList);
6215 // e) Book and nest list for various unclassified objects:
6216 if(fStorePhiDistributionForOneEvent)
6218 fVariousList = new TList();
6219 fVariousList->SetName("Various");
6220 fVariousList->SetOwner(kTRUE);
6221 fHistList->Add(fVariousList);
6224 // f) Book and nest list for nested loops:
6225 fNestedLoopsList = new TList();
6226 fNestedLoopsList->SetName("Nested Loops");
6227 fNestedLoopsList->SetOwner(kTRUE);
6228 fHistList->Add(fNestedLoopsList);
6230 } // end of void AliFlowAnalysisWithQCumulants::BookAndNestAllLists()
6233 //================================================================================================================================
6236 void AliFlowAnalysisWithQCumulants::FillCommonHistResultsDiffFlow(TString type)
6238 // fill common result histograms for differential flow
6241 //Int_t ptEtaFlag = 0;
6246 } else if(type == "POI")
6253 //Int_t pe = ptEtaFlag;
6255 // to be improved (implement protection here)
6257 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
6259 cout<<"WARNING: fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th"<<endl;
6260 cout<<" is NULL in AFAWQC::FCHRIF() !!!!"<<endl;
6265 for(Int_t p=1;p<=fnBinsPt;p++)
6267 Double_t v2 = fDiffFlow[t][0][0]->GetBinContent(p);
6268 Double_t v4 = fDiffFlow[t][0][1]->GetBinContent(p);
6269 Double_t v6 = fDiffFlow[t][0][2]->GetBinContent(p);
6270 Double_t v8 = fDiffFlow[t][0][3]->GetBinContent(p);
6272 Double_t v2Error = fDiffFlow[t][0][0]->GetBinError(p);
6273 Double_t v4Error = fDiffFlow[t][0][1]->GetBinError(p);
6274 //Double_t v6Error = fFinalFlow1D[t][pW][nua][0][2]->GetBinError(p);
6275 //Double_t v8Error = fFinalFlow1D[t][pW][nua][0][3]->GetBinError(p);
6279 fCommonHistsResults2nd->FillDifferentialFlowPtRP(p,v2,v2Error);
6280 fCommonHistsResults4th->FillDifferentialFlowPtRP(p,v4,v4Error);
6281 fCommonHistsResults6th->FillDifferentialFlowPtRP(p,v6,0.);
6282 fCommonHistsResults8th->FillDifferentialFlowPtRP(p,v8,0.);
6283 } else if(type == "POI")
6285 fCommonHistsResults2nd->FillDifferentialFlowPtPOI(p,v2,v2Error);
6286 fCommonHistsResults4th->FillDifferentialFlowPtPOI(p,v4,v4Error);
6287 fCommonHistsResults6th->FillDifferentialFlowPtPOI(p,v6,0.);
6288 fCommonHistsResults8th->FillDifferentialFlowPtPOI(p,v8,0.);
6290 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
6293 for(Int_t e=1;e<=fnBinsEta;e++)
6295 Double_t v2 = fDiffFlow[t][1][0]->GetBinContent(e);
6296 Double_t v4 = fDiffFlow[t][1][1]->GetBinContent(e);
6297 Double_t v6 = fDiffFlow[t][1][2]->GetBinContent(e);
6298 Double_t v8 = fDiffFlow[t][1][3]->GetBinContent(e);
6300 Double_t v2Error = fDiffFlow[t][1][0]->GetBinError(e);
6301 Double_t v4Error = fDiffFlow[t][1][1]->GetBinError(e);
6302 //Double_t v6Error = fDiffFlow[t][1][2]->GetBinError(e);
6303 //Double_t v8Error = fDiffFlow[t][1][3]->GetBinError(e);
6307 fCommonHistsResults2nd->FillDifferentialFlowEtaRP(e,v2,v2Error);
6308 fCommonHistsResults4th->FillDifferentialFlowEtaRP(e,v4,v4Error);
6309 fCommonHistsResults6th->FillDifferentialFlowEtaRP(e,v6,0.);
6310 fCommonHistsResults8th->FillDifferentialFlowEtaRP(e,v8,0.);
6311 } else if(type == "POI")
6313 fCommonHistsResults2nd->FillDifferentialFlowEtaPOI(e,v2,v2Error);
6314 fCommonHistsResults4th->FillDifferentialFlowEtaPOI(e,v4,v4Error);
6315 fCommonHistsResults6th->FillDifferentialFlowEtaPOI(e,v6,0.);
6316 fCommonHistsResults8th->FillDifferentialFlowEtaPOI(e,v8,0.);
6318 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
6320 } // end of void AliFlowAnalysisWithQCumulants::FillCommonHistResultsDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights, Bool_t correctedForNUA)
6322 //================================================================================================================================
6324 void AliFlowAnalysisWithQCumulants::AccessConstants()
6326 // Access needed common constants from AliFlowCommonConstants.
6328 fnBinsPhi = AliFlowCommonConstants::GetMaster()->GetNbinsPhi();
6329 fPhiMin = AliFlowCommonConstants::GetMaster()->GetPhiMin();
6330 fPhiMax = AliFlowCommonConstants::GetMaster()->GetPhiMax();
6331 if(fnBinsPhi) fPhiBinWidth = (fPhiMax-fPhiMin)/fnBinsPhi;
6332 fnBinsPt = AliFlowCommonConstants::GetMaster()->GetNbinsPt();
6333 fPtMin = AliFlowCommonConstants::GetMaster()->GetPtMin();
6334 fPtMax = AliFlowCommonConstants::GetMaster()->GetPtMax();
6335 if(fnBinsPt) fPtBinWidth = (fPtMax-fPtMin)/fnBinsPt;
6336 fnBinsEta = AliFlowCommonConstants::GetMaster()->GetNbinsEta();
6337 fEtaMin = AliFlowCommonConstants::GetMaster()->GetEtaMin();
6338 fEtaMax = AliFlowCommonConstants::GetMaster()->GetEtaMax();
6339 if(fnBinsEta) fEtaBinWidth = (fEtaMax-fEtaMin)/fnBinsEta;
6341 } // end of void AliFlowAnalysisWithQCumulants::AccessConstants()
6343 //================================================================================================================================
6345 void AliFlowAnalysisWithQCumulants::CrossCheckSettings()
6347 // a) Cross check if the choice for multiplicity weights make sense;
6349 // a) Cross check if the choice for multiplicity weights make sense:
6350 if(strcmp(fMultiplicityWeight->Data(),"combinations") &&
6351 strcmp(fMultiplicityWeight->Data(),"unit") &&
6352 strcmp(fMultiplicityWeight->Data(),"multiplicity"))
6354 cout<<"WARNING (QC): Multiplicity weight can be either \"combinations\", \"unit\""<<endl;
6355 cout<<" or \"multiplicity\". Certainly not \""<<fMultiplicityWeight->Data()<<"\"."<<endl;
6359 } // end of void AliFlowAnalysisWithQCumulants::CrossCheckSettings()
6361 //================================================================================================================================
6363 void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeights()
6365 // Calculate sum of linear and quadratic event weights for correlations.
6368 Double_t dMult = (*fSMpk)(0,0);
6370 for(Int_t p=0;p<2;p++) // power-1
6372 for(Int_t ci=0;ci<4;ci++) // correlation index
6374 fIntFlowSumOfEventWeights[p]->Fill(ci+0.5,pow(fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci+1),p+1));
6375 if(fCalculateCumulantsVsM)
6377 fIntFlowSumOfEventWeightsVsM[ci][p]->Fill(dMult+0.5,pow(fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci+1),p+1)); // to be improved: dMult => sum of weights?
6382 } // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeights()
6384 //================================================================================================================================
6386 void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeightsNUA()
6388 // Calculate sum of linear and quadratic event weights for NUA terms.
6390 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
6392 for(Int_t p=0;p<2;p++) // power-1
6394 for(Int_t ci=0;ci<4;ci++) // nua term index
6396 fIntFlowSumOfEventWeightsNUA[sc][p]->Fill(ci+0.5,pow(fIntFlowEventWeightForCorrectionTermsForNUAEBE[sc]->GetBinContent(ci+1),p+1));
6401 } // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeightsNUA()
6403 //================================================================================================================================
6405 void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfProductOfEventWeights()
6407 // Calculate sum of product of event weights for correlations.
6410 Double_t dMult = (*fSMpk)(0,0);
6414 for(Int_t ci1=1;ci1<4;ci1++)
6416 for(Int_t ci2=ci1+1;ci2<=4;ci2++)
6418 fIntFlowSumOfProductOfEventWeights->Fill(0.5+counter,
6419 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
6420 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
6421 if(fCalculateCumulantsVsM)
6423 fIntFlowSumOfProductOfEventWeightsVsM[counter]->Fill(dMult+0.5, // to be improved: dMult => sum of weights?
6424 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
6425 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
6426 } // end of if(fCalculateCumulantsVsM)
6431 } // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfProductOfEventWeights()
6433 //================================================================================================================================
6435 void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfProductOfEventWeightsNUA()
6437 // Calculate sum of product of event weights for NUA terms.
6439 // w_{<2>} * w_{<cos(#phi)>}:
6440 fIntFlowSumOfProductOfEventWeightsNUA->Fill(0.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6441 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
6442 // w_{<2>} * w_{<sin(#phi)>}:
6443 fIntFlowSumOfProductOfEventWeightsNUA->Fill(1.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6444 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
6445 // w_{<cos(#phi)> * w_{<sin(#phi)>}:
6446 fIntFlowSumOfProductOfEventWeightsNUA->Fill(2.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6447 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
6448 // w_{<2>} * w{<cos(phi1+phi2)>}
6449 fIntFlowSumOfProductOfEventWeightsNUA->Fill(3.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6450 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
6451 // w_{<2>} * w{<sin(phi1+phi2)>}
6452 fIntFlowSumOfProductOfEventWeightsNUA->Fill(4.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6453 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6454 // w_{<2>} * w{<cos(phi1-phi2-phi3)>}
6455 fIntFlowSumOfProductOfEventWeightsNUA->Fill(5.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6456 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6457 // w_{<2>} * w{<sin(phi1-phi2-phi3)>}
6458 fIntFlowSumOfProductOfEventWeightsNUA->Fill(6.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6459 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6460 // w_{<4>} * w{<cos(phi1)>}
6461 fIntFlowSumOfProductOfEventWeightsNUA->Fill(7.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6462 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
6463 // w_{<4>} * w{<sin(phi1)>}
6464 fIntFlowSumOfProductOfEventWeightsNUA->Fill(8.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6465 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
6466 // w_{<4>} * w{<cos(phi1+phi2)>}
6467 fIntFlowSumOfProductOfEventWeightsNUA->Fill(9.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6468 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
6469 // w_{<4>} * w{<sin(phi1+phi2)>}
6470 fIntFlowSumOfProductOfEventWeightsNUA->Fill(10.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6471 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6472 // w_{<4>} * w{<cos(phi1-phi2-phi3)>}
6473 fIntFlowSumOfProductOfEventWeightsNUA->Fill(11.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6474 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6475 // w_{<4>} * w{<sin(phi1-phi2-phi3)>}
6476 fIntFlowSumOfProductOfEventWeightsNUA->Fill(12.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6477 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6478 // w_{<cos(phi1)>} * w{<cos(phi1+phi2)>}
6479 fIntFlowSumOfProductOfEventWeightsNUA->Fill(13.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6480 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
6481 // w_{<cos(phi1)>} * w{<sin(phi1+phi2)>}
6482 fIntFlowSumOfProductOfEventWeightsNUA->Fill(14.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6483 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6484 // w_{<cos(phi1)>} * w{<cos(phi1-phi2-phi3)>}
6485 fIntFlowSumOfProductOfEventWeightsNUA->Fill(15.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6486 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6487 // w_{<cos(phi1)>} * w{<sin(phi1-phi2-phi3)>}
6488 fIntFlowSumOfProductOfEventWeightsNUA->Fill(16.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6489 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6490 // w_{<sin(phi1)>} * w{<cos(phi1+phi2)>}
6491 fIntFlowSumOfProductOfEventWeightsNUA->Fill(17.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
6492 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
6493 // w_{<sin(phi1)>} * w{<sin(phi1+phi2)>}
6494 fIntFlowSumOfProductOfEventWeightsNUA->Fill(18.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
6495 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6496 // w_{<sin(phi1)>} * w{<cos(phi1-phi2-phi3)>}
6497 fIntFlowSumOfProductOfEventWeightsNUA->Fill(19.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
6498 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6499 // w_{<sin(phi1)>} * w{<sin(phi1-phi2-phi3)>}
6500 fIntFlowSumOfProductOfEventWeightsNUA->Fill(20.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
6501 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6502 // w_{<cos(phi1+phi2)>} * w{<sin(phi1+phi2))>}
6503 fIntFlowSumOfProductOfEventWeightsNUA->Fill(21.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)*
6504 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6505 // w_{<cos(phi1+phi2)>} * w{<cos(phi1-phi2-phi3)>}
6506 fIntFlowSumOfProductOfEventWeightsNUA->Fill(22.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)*
6507 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6508 // w_{<cos(phi1+phi2)>} * w{<sin(phi1-phi2-phi3)>}
6509 fIntFlowSumOfProductOfEventWeightsNUA->Fill(23.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)*
6510 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6511 // w_{<sin(phi1+phi2)>} * w{<cos(phi1-phi2-phi3)>}
6512 fIntFlowSumOfProductOfEventWeightsNUA->Fill(24.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)*
6513 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6514 // w_{<sin(phi1+phi2)>} * w{<sin(phi1-phi2-phi3)>}
6515 fIntFlowSumOfProductOfEventWeightsNUA->Fill(25.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)*
6516 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6517 // w_{<cos(phi1-phi2-phi3)>} * w{<sin(phi1-phi2-phi3)>}
6518 fIntFlowSumOfProductOfEventWeightsNUA->Fill(26.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3)*
6519 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6521 } // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowIntFlowSumOfProductOfEventWeightsNUA()
6524 //================================================================================================================================
6527 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelations(TString type, TString ptOrEta)
6529 // calculate reduced correlations for RPs or POIs in pt or eta bins
6532 Double_t dMult = (*fSMpk)(0,0);
6534 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
6535 Double_t dReQ1n = (*fReQ)(0,0);
6536 Double_t dReQ2n = (*fReQ)(1,0);
6537 //Double_t dReQ3n = (*fReQ)(2,0);
6538 //Double_t dReQ4n = (*fReQ)(3,0);
6539 Double_t dImQ1n = (*fImQ)(0,0);
6540 Double_t dImQ2n = (*fImQ)(1,0);
6541 //Double_t dImQ3n = (*fImQ)(2,0);
6542 //Double_t dImQ4n = (*fImQ)(3,0);
6544 // reduced correlations are stored in fDiffFlowCorrelationsPro[0=RP,1=POI][0=pt,1=eta][correlation index]. Correlation index runs as follows:
6551 Int_t t = 0; // type flag
6552 Int_t pe = 0; // ptEta flag
6557 } else if(type == "POI")
6565 } else if(ptOrEta == "Eta")
6570 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6571 Double_t minPtEta[2] = {fPtMin,fEtaMin};
6572 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
6573 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
6575 // looping over all bins and calculating reduced correlations:
6576 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6578 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
6579 Double_t p1n0kRe = 0.;
6580 Double_t p1n0kIm = 0.;
6582 // number of POIs in particular pt or eta bin:
6585 // real and imaginary parts of q_{m*n,0} (non-weighted Q-vector evaluated for particles which are both RPs and POIs in particular pt or eta bin):
6586 Double_t q1n0kRe = 0.;
6587 Double_t q1n0kIm = 0.;
6588 Double_t q2n0kRe = 0.;
6589 Double_t q2n0kIm = 0.;
6591 // number of particles which are both RPs and POIs in particular pt or eta bin:
6597 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))
6598 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));
6599 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))
6600 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));
6601 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))
6602 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));
6603 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))
6604 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b));
6606 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
6608 else if(type == "RP")
6611 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
6612 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
6613 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
6614 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
6615 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))
6616 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));
6617 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))
6618 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b));
6620 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
6626 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
6627 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
6628 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
6629 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
6631 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
6633 t = 1; // typeFlag = RP or POI
6635 else if(type == "RP")
6637 // p_{m*n,0} = q_{m*n,0}:
6643 t = 0; // typeFlag = RP or POI
6646 // 2'-particle correlation for particular (pt,eta) bin:
6647 Double_t two1n1nPtEta = 0.;
6648 Double_t mWeight2pPrime = 0.; // multiplicity weight for <2'>
6651 two1n1nPtEta = (p1n0kRe*dReQ1n+p1n0kIm*dImQ1n-mq)
6653 // determine multiplicity weight:
6654 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
6656 mWeight2pPrime = mp*dMult-mq;
6657 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
6659 mWeight2pPrime = 1.;
6661 if(type == "POI") // to be improved (I do not this if)
6663 // fill profile to get <<2'>> for POIs
6664 fDiffFlowCorrelationsPro[1][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta,mWeight2pPrime);
6665 // fill profile to get <<2'>^2> for POIs
6666 fDiffFlowSquaredCorrelationsPro[1][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta*two1n1nPtEta,mWeight2pPrime);
6667 // histogram to store <2'> for POIs e-b-e (needed in some other methods):
6668 fDiffFlowCorrelationsEBE[1][pe][0]->SetBinContent(b,two1n1nPtEta);
6669 fDiffFlowEventWeightsForCorrelationsEBE[1][pe][0]->SetBinContent(b,mWeight2pPrime);
6671 else if(type == "RP") // to be improved (I do not this if)
6673 // profile to get <<2'>> for RPs:
6674 fDiffFlowCorrelationsPro[0][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta,mWeight2pPrime);
6675 // profile to get <<2'>^2> for RPs:
6676 fDiffFlowSquaredCorrelationsPro[0][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta*two1n1nPtEta,mWeight2pPrime);
6677 // histogram to store <2'> for RPs e-b-e (needed in some other methods):
6678 fDiffFlowCorrelationsEBE[0][pe][0]->SetBinContent(b,two1n1nPtEta);
6679 fDiffFlowEventWeightsForCorrelationsEBE[0][pe][0]->SetBinContent(b,mWeight2pPrime);
6681 } // end of if(mp*dMult-mq)
6683 // 4'-particle correlation:
6684 Double_t four1n1n1n1nPtEta = 0.;
6685 Double_t mWeight4pPrime = 0.; // multiplicity weight for <4'>
6686 if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6687 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)
6689 four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6690 - q2n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))
6691 - 2.*q2n0kIm*dReQ1n*dImQ1n
6692 - p1n0kRe*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)
6693 + p1n0kIm*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)
6694 - 2.*dMult*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6695 - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*mq
6696 + 6.*(q1n0kRe*dReQ1n+q1n0kIm*dImQ1n)
6697 + 1.*(q2n0kRe*dReQ2n+q2n0kIm*dImQ2n)
6698 + 2.*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6701 / ((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6702 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
6703 // determine multiplicity weight:
6704 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
6706 mWeight4pPrime = (mp-mq)*dMult*(dMult-1.)*(dMult-2.) + mq*(dMult-1.)*(dMult-2.)*(dMult-3.);
6707 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
6709 mWeight4pPrime = 1.;
6713 // profile to get <<4'>> for POIs:
6714 fDiffFlowCorrelationsPro[1][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta,mWeight4pPrime);
6715 // profile to get <<4'>^2> for POIs:
6716 fDiffFlowSquaredCorrelationsPro[1][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta*four1n1n1n1nPtEta,mWeight4pPrime);
6717 // histogram to store <4'> for POIs e-b-e (needed in some other methods):
6718 fDiffFlowCorrelationsEBE[1][pe][1]->SetBinContent(b,four1n1n1n1nPtEta);
6719 fDiffFlowEventWeightsForCorrelationsEBE[1][pe][1]->SetBinContent(b,mWeight4pPrime);
6721 else if(type == "RP")
6723 // profile to get <<4'>> for RPs:
6724 fDiffFlowCorrelationsPro[0][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta,mWeight4pPrime);
6725 // profile to get <<4'>^2> for RPs:
6726 fDiffFlowSquaredCorrelationsPro[0][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta*four1n1n1n1nPtEta,mWeight4pPrime);
6727 // histogram to store <4'> for RPs e-b-e (needed in some other methods):
6728 fDiffFlowCorrelationsEBE[0][pe][1]->SetBinContent(b,four1n1n1n1nPtEta);
6729 fDiffFlowEventWeightsForCorrelationsEBE[0][pe][1]->SetBinContent(b,mWeight4pPrime);
6731 } // end of if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6732 // +mq*(dMult-1.)*(dMult-2.)*(dMult-3.))
6734 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6737 } // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelations(TString type, TString ptOrEta);
6739 //================================================================================================================================
6741 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfEventWeights(TString type, TString ptOrEta)
6743 // Calculate sums of various event weights for reduced correlations.
6744 // (These quantitites are needed in expressions for unbiased estimators relevant for the statistical errors.)
6747 Int_t ptEtaFlag = 0;
6752 } else if(type == "POI")
6760 } else if(ptOrEta == "Eta")
6767 Int_t pe = ptEtaFlag;
6770 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6771 Double_t minPtEta[2] = {fPtMin,fEtaMin};
6772 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
6773 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
6775 for(Int_t rpq=0;rpq<3;rpq++)
6777 for(Int_t m=0;m<4;m++)
6779 for(Int_t k=0;k<9;k++)
6781 if(!fReRPQ1dEBE[rpq][pe][m][k])
6783 cout<<"WARNING: fReRPQ1dEBE[rpq][pe][m][k] is NULL in AFAWQC::CSAPOEWFDF() !!!!"<<endl;
6784 cout<<"pe = "<<pe<<endl;
6785 cout<<"rpq = "<<rpq<<endl;
6786 cout<<"m = "<<m<<endl;
6787 cout<<"k = "<<k<<endl;
6795 Double_t dMult = (*fSMpk)(0,0); // total event multiplicity
6796 //Double_t mr = 0.; // number of RPs in particular pt or eta bin
6797 Double_t mp = 0.; // number of POIs in particular pt or eta bin
6798 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin
6800 // event weights for reduced correlations:
6801 Double_t dw2 = 0.; // event weight for <2'>
6802 Double_t dw4 = 0.; // event weight for <4'>
6803 //Double_t dw6 = 0.; // event weight for <6'>
6804 //Double_t dw8 = 0.; // event weight for <8'>
6806 // looping over bins:
6807 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6811 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);
6812 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
6813 } else if(type == "POI")
6815 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);
6816 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b);
6819 // event weight for <2'>:
6821 fDiffFlowSumOfEventWeights[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2);
6822 fDiffFlowSumOfEventWeights[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw2,2.));
6824 // event weight for <4'>:
6825 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6826 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.);
6827 fDiffFlowSumOfEventWeights[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4);
6828 fDiffFlowSumOfEventWeights[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw4,2.));
6830 // event weight for <6'>:
6832 //fDiffFlowSumOfEventWeights[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6);
6833 //fDiffFlowSumOfEventWeights[t][pe][t][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw6,2.));
6835 // event weight for <8'>:
6837 //fDiffFlowSumOfEventWeights[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw8);
6838 //fDiffFlowSumOfEventWeights[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw8,2.));
6839 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6841 } // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfEventWeights()
6844 //================================================================================================================================
6847 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfProductOfEventWeights(TString type, TString ptOrEta)
6849 // Calculate sum of products of various event weights for both types of correlations (the ones for int. and diff. flow).
6850 // (These quantitites are needed in expressions for unbiased estimators relevant for the statistical errors.)
6852 // Important: To fill fDiffFlowSumOfProductOfEventWeights[][][][] use bellow table (i,j) with following constraints:
6854 // 2.) do not store terms which DO NOT include reduced correlations;
6856 // [0=<2>,1=<2'>,2=<4>,3=<4'>,4=<6>,5=<6'>,6=<8>,7=<8'>] x [0=<2>,1=<2'>,2=<4>,3=<4'>,4=<6>,5=<6'>,6=<8>,7=<8'>]
6859 Int_t ptEtaFlag = 0;
6864 } else if(type == "POI")
6872 } else if(ptOrEta == "Eta")
6879 Int_t pe = ptEtaFlag;
6882 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6883 Double_t minPtEta[2] = {fPtMin,fEtaMin};
6884 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
6885 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
6888 for(Int_t rpq=0;rpq<3;rpq++)
6890 for(Int_t m=0;m<4;m++)
6892 for(Int_t k=0;k<9;k++)
6894 if(!fReRPQ1dEBE[rpq][pe][m][k])
6896 cout<<"WARNING: fReRPQ1dEBE[rpq][pe][m][k] is NULL in AFAWQC::CSAPOEWFDF() !!!!"<<endl;
6897 cout<<"pe = "<<pe<<endl;
6898 cout<<"rpq = "<<rpq<<endl;
6899 cout<<"m = "<<m<<endl;
6900 cout<<"k = "<<k<<endl;
6908 Double_t dMult = (*fSMpk)(0,0); // total event multiplicity
6909 //Double_t mr = 0.; // number of RPs in particular pt or eta bin
6910 Double_t mp = 0.; // number of POIs in particular pt or eta bin
6911 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin
6913 // event weights for correlations:
6914 Double_t dW2 = dMult*(dMult-1); // event weight for <2>
6915 Double_t dW4 = dMult*(dMult-1)*(dMult-2)*(dMult-3); // event weight for <4>
6916 Double_t dW6 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5); // event weight for <6>
6917 Double_t dW8 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7); // event weight for <8>
6919 // event weights for reduced correlations:
6920 Double_t dw2 = 0.; // event weight for <2'>
6921 Double_t dw4 = 0.; // event weight for <4'>
6922 //Double_t dw6 = 0.; // event weight for <6'>
6923 //Double_t dw8 = 0.; // event weight for <8'>
6925 // looping over bins:
6926 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6930 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);
6931 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
6932 } else if(type == "POI")
6934 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);
6935 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b);
6938 // event weight for <2'>:
6940 fDiffFlowSumOfProductOfEventWeights[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw2); // storing product of even weights for <2> and <2'>
6941 fDiffFlowSumOfProductOfEventWeights[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW4); // storing product of even weights for <4> and <2'>
6942 fDiffFlowSumOfProductOfEventWeights[t][pe][1][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW6); // storing product of even weights for <6> and <2'>
6943 fDiffFlowSumOfProductOfEventWeights[t][pe][1][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW8); // storing product of even weights for <8> and <2'>
6945 // event weight for <4'>:
6946 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6947 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.);
6948 fDiffFlowSumOfProductOfEventWeights[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw4); // storing product of even weights for <2> and <4'>
6949 fDiffFlowSumOfProductOfEventWeights[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw4); // storing product of even weights for <2'> and <4'>
6950 fDiffFlowSumOfProductOfEventWeights[t][pe][2][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw4); // storing product of even weights for <4> and <4'>
6951 fDiffFlowSumOfProductOfEventWeights[t][pe][3][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dW6); // storing product of even weights for <6> and <4'>
6952 fDiffFlowSumOfProductOfEventWeights[t][pe][3][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dW8); // storing product of even weights for <8> and <4'>
6954 // event weight for <6'>:
6956 //fDiffFlowSumOfProductOfEventWeights[t][pe][0][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw6); // storing product of even weights for <2> and <6'>
6957 //fDiffFlowSumOfProductOfEventWeights[t][pe][1][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw6); // storing product of even weights for <2'> and <6'>
6958 //fDiffFlowSumOfProductOfEventWeights[t][pe][2][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw6); // storing product of even weights for <4> and <6'>
6959 //fDiffFlowSumOfProductOfEventWeights[t][pe][3][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dw6); // storing product of even weights for <4'> and <6'>
6960 //fDiffFlowSumOfProductOfEventWeights[t][pe][4][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW6*dw6); // storing product of even weights for <6> and <6'>
6961 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dW8); // storing product of even weights for <6'> and <8>
6962 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dw8); // storing product of even weights for <6'> and <8'>
6964 // event weight for <8'>:
6966 //fDiffFlowSumOfProductOfEventWeights[t][pe][0][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw8); // storing product of even weights for <2> and <8'>
6967 //fDiffFlowSumOfProductOfEventWeights[t][pe][1][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw8); // storing product of even weights for <2'> and <8'>
6968 //fDiffFlowSumOfProductOfEventWeights[t][pe][2][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw8); // storing product of even weights for <4> and <8'>
6969 //fDiffFlowSumOfProductOfEventWeights[t][pe][3][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dw8); // storing product of even weights for <4'> and <8'>
6970 //fDiffFlowSumOfProductOfEventWeights[t][pe][4][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW6*dw8); // storing product of even weights for <6> and <8'>
6971 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dw8); // storing product of even weights for <6'> and <8'>
6972 //fDiffFlowSumOfProductOfEventWeights[t][pe][6][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW8*dw8); // storing product of even weights for <8> and <8'>
6975 // [0=<2>,1=<2'>,2=<4>,3=<4'>,4=<6>,5=<6'>,6=<8>,7=<8'>] x [0=<2>,1=<2'>,2=<4>,3=<4'>,4=<6>,5=<6'>,6=<8>,7=<8'>]
6977 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6981 } // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfProductOfEventWeights(TString type, TString ptOrEta)
6984 //================================================================================================================================
6987 void AliFlowAnalysisWithQCumulants::FinalizeReducedCorrelations(TString type, TString ptOrEta)
6989 // Transfer profiles into histograms and calculate statistical errors correctly.
6992 Int_t ptEtaFlag = 0;
6997 } else if(type == "POI")
7005 } else if(ptOrEta == "Eta")
7012 Int_t pe = ptEtaFlag;
7014 for(Int_t rci=0;rci<4;rci++)
7016 if(!fDiffFlowCorrelationsPro[t][pe][rci])
7018 cout<<"WARNING: fDiffFlowCorrelationsPro[t][pe][rci] is NULL in AFAWQC::FRC() !!!!"<<endl;
7019 cout<<"t = "<<t<<endl;
7020 cout<<"pe = "<<pe<<endl;
7021 cout<<"rci = "<<rci<<endl;
7024 if(!fDiffFlowSquaredCorrelationsPro[t][pe][rci])
7026 cout<<"WARNING: fDiffFlowSquaredCorrelationsPro[t][pe][rci] is NULL in AFAWQC::FRC() !!!!"<<endl;
7027 cout<<"t = "<<t<<endl;
7028 cout<<"pe = "<<pe<<endl;
7029 cout<<"rci = "<<rci<<endl;
7032 for(Int_t power=0;power<2;power++)
7034 if(!fDiffFlowSumOfEventWeights[t][pe][power][rci])
7036 cout<<"WARNING: fDiffFlowSumOfEventWeights[t][pe][power][rci] is NULL in AFAWQC::FRC() !!!!"<<endl;
7037 cout<<"t = "<<t<<endl;
7038 cout<<"pe = "<<pe<<endl;
7039 cout<<"power = "<<power<<endl;
7040 cout<<"rci = "<<rci<<endl;
7043 } // end of for(Int_t power=0;power<2;power++)
7044 } // end of for(Int_t rci=0;rci<4;rci++)
7047 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
7048 // transfer 1D profile into 1D histogram:
7049 Double_t correlation = 0.;
7050 Double_t squaredCorrelation = 0.;
7051 Double_t spread = 0.;
7052 Double_t sumOfWeights = 0.; // sum of weights for particular reduced correlations for particular pt or eta bin
7053 Double_t sumOfSquaredWeights = 0.; // sum of squared weights for particular reduced correlations for particular pt or eta bin
7054 Double_t error = 0.; // error = termA * spread * termB
7055 // termA = (sqrt(sumOfSquaredWeights)/sumOfWeights)
7056 // termB = 1/pow(1-termA^2,0.5)
7057 Double_t termA = 0.;
7058 Double_t termB = 0.;
7059 for(Int_t rci=0;rci<4;rci++) // index of reduced correlation
7061 for(Int_t b=1;b<=nBinsPtEta[pe];b++) // number of pt or eta bins
7063 if(fDiffFlowCorrelationsPro[t][pe][rci]->GetBinEffectiveEntries(b) < 2 ||
7064 fDiffFlowSquaredCorrelationsPro[t][pe][rci]->GetBinEffectiveEntries(b) < 2)
7066 fDiffFlowCorrelationsPro[t][pe][rci]->SetBinError(b,0.);
7067 fDiffFlowSquaredCorrelationsPro[t][pe][rci]->SetBinError(b,0.);
7068 continue; // to be improved - should I ignore results in pt bins with one entry for reduced correlations or not?
7070 correlation = fDiffFlowCorrelationsPro[t][pe][rci]->GetBinContent(b);
7071 squaredCorrelation = fDiffFlowSquaredCorrelationsPro[t][pe][rci]->GetBinContent(b);
7072 if(squaredCorrelation-correlation*correlation >= 0.)
7074 spread = pow(squaredCorrelation-correlation*correlation,0.5);
7078 cout<<Form(" WARNING: Imaginary 'spread' for rci = %d, pe = %d, bin = %d !!!!",rci,pe,b)<<endl;
7081 sumOfWeights = fDiffFlowSumOfEventWeights[t][pe][0][rci]->GetBinContent(b);
7082 sumOfSquaredWeights = fDiffFlowSumOfEventWeights[t][pe][1][rci]->GetBinContent(b);
7083 if(sumOfWeights) termA = (pow(sumOfSquaredWeights,0.5)/sumOfWeights);
7084 if(1.-pow(termA,2.)>0.) termB = 1./pow(1.-pow(termA,2.),0.5);
7085 error = termA*spread*termB; // final error (unbiased estimator for standard deviation)
7086 fDiffFlowCorrelationsHist[t][pe][rci]->SetBinContent(b,correlation);
7087 fDiffFlowCorrelationsHist[t][pe][rci]->SetBinError(b,error);
7088 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7089 } // end of for(Int_t rci=0;rci<4;rci++)
7091 } // end of void AliFlowAnalysisWithQCumulants::FinalizeReducedCorrelations(TString type, TString ptOrEta)
7094 //================================================================================================================================
7097 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowProductOfCorrelations(TString type, TString ptOrEta)
7099 // store products: <2><2'>, <2><4'>, <2><6'>, <2><8'>, <2'><4>,
7100 // <2'><4'>, <2'><6>, <2'><6'>, <2'><8>, <2'><8'>,
7101 // <4><4'>, <4><6'>, <4><8'>, <4'><6>, <4'><6'>,
7102 // <4'><8>, <4'><8'>, <6><6'>, <6><8'>, <6'><8>,
7103 // <6'><8'>, <8><8'>.
7106 Int_t ptEtaFlag = 0;
7111 } else if(type == "POI")
7119 } else if(ptOrEta == "Eta")
7126 Int_t pe = ptEtaFlag;
7129 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
7130 Double_t minPtEta[2] = {fPtMin,fEtaMin};
7131 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
7133 // protections // to be improved (add protection for all pointers in this method)
7134 if(!fIntFlowCorrelationsEBE)
7136 cout<<"WARNING: fIntFlowCorrelationsEBE is NULL in AFAWQC::CDFPOC() !!!!"<<endl;
7141 Double_t dMult = (*fSMpk)(0,0); // multiplicity (number of particles used to determine the reaction plane)
7142 //Double_t mr = 0.; // number of RPs in particular pt or eta bin
7143 Double_t mp = 0.; // number of POIs in particular pt or eta bin
7144 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin
7147 // e-b-e correlations:
7148 Double_t twoEBE = fIntFlowCorrelationsEBE->GetBinContent(1); // <2>
7149 Double_t fourEBE = fIntFlowCorrelationsEBE->GetBinContent(2); // <4>
7150 Double_t sixEBE = fIntFlowCorrelationsEBE->GetBinContent(3); // <6>
7151 Double_t eightEBE = fIntFlowCorrelationsEBE->GetBinContent(4); // <8>
7153 // event weights for correlations:
7154 Double_t dW2 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1); // event weight for <2>
7155 Double_t dW4 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2); // event weight for <4>
7156 Double_t dW6 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(3); // event weight for <6>
7157 Double_t dW8 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(4); // event weight for <8>
7159 // e-b-e reduced correlations:
7160 Double_t twoReducedEBE = 0.; // <2'>
7161 Double_t fourReducedEBE = 0.; // <4'>
7162 Double_t sixReducedEBE = 0.; // <6'>
7163 Double_t eightReducedEBE = 0.; // <8'>
7165 // event weights for reduced correlations:
7166 Double_t dw2 = 0.; // event weight for <2'>
7167 Double_t dw4 = 0.; // event weight for <4'>
7168 //Double_t dw6 = 0.; // event weight for <6'>
7169 //Double_t dw8 = 0.; // event weight for <8'>
7171 // looping over bins:
7172 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7174 // e-b-e reduced correlations:
7175 twoReducedEBE = fDiffFlowCorrelationsEBE[t][pe][0]->GetBinContent(b);
7176 fourReducedEBE = fDiffFlowCorrelationsEBE[t][pe][1]->GetBinContent(b);
7177 sixReducedEBE = fDiffFlowCorrelationsEBE[t][pe][2]->GetBinContent(b);
7178 eightReducedEBE = fDiffFlowCorrelationsEBE[t][pe][3]->GetBinContent(b);
7181 // to be improved (I should not do this here again)
7184 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);
7185 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
7186 } else if(type == "POI")
7188 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);
7189 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b);
7192 // event weights for reduced correlations:
7193 dw2 = mp*dMult-mq; // weight for <2'>
7194 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
7195 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.); // weight for <4'>
7201 dw2 = fDiffFlowEventWeightsForCorrelationsEBE[t][pe][0]->GetBinContent(b);
7202 dw4 = fDiffFlowEventWeightsForCorrelationsEBE[t][pe][1]->GetBinContent(b);
7204 // storing all products:
7205 fDiffFlowProductOfCorrelationsPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*twoReducedEBE,dW2*dw2); // storing <2><2'>
7206 fDiffFlowProductOfCorrelationsPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*twoReducedEBE,dW4*dw2); // storing <4><2'>
7207 fDiffFlowProductOfCorrelationsPro[t][pe][1][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*twoReducedEBE,dW6*dw2); // storing <6><2'>
7208 fDiffFlowProductOfCorrelationsPro[t][pe][1][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*twoReducedEBE,dW8*dw2); // storing <8><2'>
7210 // event weight for <4'>:
7211 fDiffFlowProductOfCorrelationsPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*fourReducedEBE,dW2*dw4); // storing <2><4'>
7212 fDiffFlowProductOfCorrelationsPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*fourReducedEBE,dw2*dw4); // storing <2'><4'>
7213 fDiffFlowProductOfCorrelationsPro[t][pe][2][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*fourReducedEBE,dW4*dw4); // storing <4><4'>
7214 fDiffFlowProductOfCorrelationsPro[t][pe][3][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*fourReducedEBE,dW6*dw4); // storing <6><4'>
7215 fDiffFlowProductOfCorrelationsPro[t][pe][3][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*fourReducedEBE,dW8*dw4); // storing <8><4'>
7217 // event weight for <6'>:
7219 //fDiffFlowProductOfCorrelationsPro[t][pe][0][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*sixReducedEBE,dW2*dw6); // storing <2><6'>
7220 //fDiffFlowProductOfCorrelationsPro[t][pe][1][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*sixReducedEBE,dw2*dw6); // storing <2'><6'>
7221 //fDiffFlowProductOfCorrelationsPro[t][pe][2][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*sixReducedEBE,dW4*dw6); // storing <4><6'>
7222 //fDiffFlowProductOfCorrelationsPro[t][pe][3][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourReducedEBE*sixReducedEBE,dw4*dw6); // storing <4'><6'>
7223 //fDiffFlowProductOfCorrelationsPro[t][pe][4][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*sixReducedEBE,dW6*dw6); // storing <6><6'>
7224 //fDiffFlowProductOfCorrelationsPro[t][pe][5][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightEBE,dw6*dW8); // storing <6'><8>
7225 //fDiffFlowProductOfCorrelationsPro[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightReducedEBE,dw6*dw8); // storing <6'><8'>
7227 // event weight for <8'>:
7229 //fDiffFlowProductOfCorrelationsPro[t][pe][0][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*eightReducedEBE,dW2*dw8); // storing <2><8'>
7230 //fDiffFlowProductOfCorrelationsPro[t][pe][1][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*eightReducedEBE,dw2*dw8); // storing <2'><8'>
7231 //fDiffFlowProductOfCorrelationsPro[t][pe][2][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*eightReducedEBE,dW4*dw8); // storing <4><8'>
7232 //fDiffFlowProductOfCorrelationsPro[t][pe][3][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourReducedEBE*eightReducedEBE,dw4*dw8); // storing <4'><8'>
7233 //fDiffFlowProductOfCorrelationsPro[t][pe][4][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*eightReducedEBE,dW6*dw8); // storing <6><8'>
7234 //fDiffFlowProductOfCorrelationsPro[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightReducedEBE,dw6*dw8); // storing <6'><8'>
7235 //fDiffFlowProductOfCorrelationsPro[t][pe][6][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*eightReducedEBE,dW8*dw8); // storing <8><8'>
7236 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++
7238 } // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowProductOfCorrelations(TString type, TString ptOrEta)
7241 //================================================================================================================================
7244 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCovariances(TString type, TString ptOrEta) // to be improved (reimplemented)
7246 // a) Calculate unbiased estimators Cov(<2>,<2'>), Cov(<2>,<4'>), Cov(<4>,<2'>), Cov(<4>,<4'>) and Cov(<2'>,<4'>)
7247 // for covariances V(<2>,<2'>), V(<2>,<4'>), V(<4>,<2'>), V(<4>,<4'>) and V(<2'>,<4'>).
7248 // b) Store in histogram fDiffFlowCovariances[t][pe][index] for instance the following:
7250 // Cov(<2>,<2'>) * (sum_{i=1}^{N} w_{<2>}_i w_{<2'>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<2'>}_j)]
7252 // where N is the number of events, w_{<2>} is event weight for <2> and w_{<2'>} is event weight for <2'>.
7253 // c) Binning of fDiffFlowCovariances[t][pe][index] is organized as follows:
7255 // 1st bin: Cov(<2>,<2'>) * (sum_{i=1}^{N} w_{<2>}_i w_{<2'>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<2'>}_j)]
7256 // 2nd bin: Cov(<2>,<4'>) * (sum_{i=1}^{N} w_{<2>}_i w_{<4'>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<4'>}_j)]
7257 // 3rd bin: Cov(<4>,<2'>) * (sum_{i=1}^{N} w_{<4>}_i w_{<2'>}_i )/[(sum_{i=1}^{N} w_{<4>}_i) * (sum_{j=1}^{N} w_{<2'>}_j)]
7258 // 4th bin: Cov(<4>,<4'>) * (sum_{i=1}^{N} w_{<4>}_i w_{<4'>}_i )/[(sum_{i=1}^{N} w_{<4>}_i) * (sum_{j=1}^{N} w_{<4'>}_j)]
7259 // 5th bin: Cov(<2'>,<4'>) * (sum_{i=1}^{N} w_{<2'>}_i w_{<4'>}_i )/[(sum_{i=1}^{N} w_{<2'>}_i) * (sum_{j=1}^{N} w_{<4'>}_j)]
7263 Int_t ptEtaFlag = 0;
7268 } else if(type == "POI")
7276 } else if(ptOrEta == "Eta")
7283 Int_t pe = ptEtaFlag;
7286 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
7287 //Double_t minPtEta[2] = {fPtMin,fEtaMin};
7288 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
7289 //Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
7291 // average correlations:
7292 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
7293 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
7294 //Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
7295 //Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
7297 // sum of weights for correlation:
7298 Double_t sumOfWeightsForTwo = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // sum_{i=1}^{N} w_{<2>}
7299 Double_t sumOfWeightsForFour = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // sum_{i=1}^{N} w_{<4>}
7300 //Double_t sumOfWeightsForSix = fIntFlowSumOfEventWeights[0]->GetBinContent(3); // sum_{i=1}^{N} w_{<6>}
7301 //Double_t sumOfWeightsForEight = fIntFlowSumOfEventWeights[0]->GetBinContent(4); // sum_{i=1}^{N} w_{<8>}
7303 // average reduced correlations:
7304 Double_t twoReduced = 0.; // <<2'>>
7305 Double_t fourReduced = 0.; // <<4'>>
7306 //Double_t sixReduced = 0.; // <<6'>>
7307 //Double_t eightReduced = 0.; // <<8'>>
7309 // sum of weights for reduced correlation:
7310 Double_t sumOfWeightsForTwoReduced = 0.; // sum_{i=1}^{N} w_{<2'>}
7311 Double_t sumOfWeightsForFourReduced = 0.; // sum_{i=1}^{N} w_{<4'>}
7312 //Double_t sumOfWeightsForSixReduced = 0.; // sum_{i=1}^{N} w_{<6'>}
7313 //Double_t sumOfWeightsForEightReduced = 0.; // sum_{i=1}^{N} w_{<8'>}
7315 // product of weights for reduced correlation:
7316 Double_t productOfWeightsForTwoTwoReduced = 0.; // sum_{i=1}^{N} w_{<2>}w_{<2'>}
7317 Double_t productOfWeightsForTwoFourReduced = 0.; // sum_{i=1}^{N} w_{<2>}w_{<4'>}
7318 Double_t productOfWeightsForFourTwoReduced = 0.; // sum_{i=1}^{N} w_{<4>}w_{<2'>}
7319 Double_t productOfWeightsForFourFourReduced = 0.; // sum_{i=1}^{N} w_{<4>}w_{<4'>}
7320 Double_t productOfWeightsForTwoReducedFourReduced = 0.; // sum_{i=1}^{N} w_{<2'>}w_{<4'>}
7323 // products for differential flow:
7324 Double_t twoTwoReduced = 0; // <<2><2'>>
7325 Double_t twoFourReduced = 0; // <<2><4'>>
7326 Double_t fourTwoReduced = 0; // <<4><2'>>
7327 Double_t fourFourReduced = 0; // <<4><4'>>
7328 Double_t twoReducedFourReduced = 0; // <<2'><4'>>
7330 // denominators in the expressions for the unbiased estimators for covariances:
7331 // denominator = 1 - term1/(term2*term3)
7332 // prefactor = term1/(term2*term3)
7333 Double_t denominator = 0.;
7334 Double_t prefactor = 0.;
7335 Double_t term1 = 0.;
7336 Double_t term2 = 0.;
7337 Double_t term3 = 0.;
7339 // unbiased estimators for covariances for differential flow:
7340 Double_t covTwoTwoReduced = 0.; // Cov(<2>,<2'>)
7341 Double_t wCovTwoTwoReduced = 0.; // Cov(<2>,<2'>) * prefactor(w_{<2>},w_{<2'>})
7342 Double_t covTwoFourReduced = 0.; // Cov(<2>,<4'>)
7343 Double_t wCovTwoFourReduced = 0.; // Cov(<2>,<4'>) * prefactor(w_{<2>},w_{<4'>})
7344 Double_t covFourTwoReduced = 0.; // Cov(<4>,<2'>)
7345 Double_t wCovFourTwoReduced = 0.; // Cov(<4>,<2'>) * prefactor(w_{<4>},w_{<2'>})
7346 Double_t covFourFourReduced = 0.; // Cov(<4>,<4'>)
7347 Double_t wCovFourFourReduced = 0.; // Cov(<4>,<4'>) * prefactor(w_{<4>},w_{<4'>})
7348 Double_t covTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>)
7349 Double_t wCovTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>) * prefactor(w_{<2'>},w_{<4'>})
7351 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7353 // average reduced corelations:
7354 twoReduced = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b);
7355 fourReduced = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b);
7356 // average products:
7357 twoTwoReduced = fDiffFlowProductOfCorrelationsPro[t][pe][0][1]->GetBinContent(b);
7358 twoFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][0][3]->GetBinContent(b);
7359 fourTwoReduced = fDiffFlowProductOfCorrelationsPro[t][pe][1][2]->GetBinContent(b);
7360 fourFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][2][3]->GetBinContent(b);
7361 twoReducedFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][1][3]->GetBinContent(b);
7362 // sum of weights for reduced correlations:
7363 sumOfWeightsForTwoReduced = fDiffFlowSumOfEventWeights[t][pe][0][0]->GetBinContent(b);
7364 sumOfWeightsForFourReduced = fDiffFlowSumOfEventWeights[t][pe][0][1]->GetBinContent(b);
7365 // products of weights for correlations:
7366 productOfWeightsForTwoTwoReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][0][1]->GetBinContent(b);
7367 productOfWeightsForTwoFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][0][3]->GetBinContent(b);
7368 productOfWeightsForFourTwoReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][1][2]->GetBinContent(b);
7369 productOfWeightsForFourFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][2][3]->GetBinContent(b);
7370 productOfWeightsForTwoReducedFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][1][3]->GetBinContent(b);
7371 // denominator for the unbiased estimator for covariances: 1 - term1/(term2*term3)
7372 // prefactor (multiplies Cov's) = term1/(term2*term3)
7374 term1 = productOfWeightsForTwoTwoReduced;
7375 term2 = sumOfWeightsForTwo;
7376 term3 = sumOfWeightsForTwoReduced;
7379 denominator = 1.-term1/(term2*term3);
7380 prefactor = term1/(term2*term3);
7381 if(TMath::Abs(denominator)>1e-6)
7383 covTwoTwoReduced = (twoTwoReduced-two*twoReduced)/denominator;
7384 wCovTwoTwoReduced = covTwoTwoReduced*prefactor;
7385 fDiffFlowCovariances[t][pe][0]->SetBinContent(b,wCovTwoTwoReduced);
7389 term1 = productOfWeightsForTwoFourReduced;
7390 term2 = sumOfWeightsForTwo;
7391 term3 = sumOfWeightsForFourReduced;
7394 denominator = 1.-term1/(term2*term3);
7395 prefactor = term1/(term2*term3);
7396 if(TMath::Abs(denominator)>1e-6)
7398 covTwoFourReduced = (twoFourReduced-two*fourReduced)/denominator;
7399 wCovTwoFourReduced = covTwoFourReduced*prefactor;
7400 fDiffFlowCovariances[t][pe][1]->SetBinContent(b,wCovTwoFourReduced);
7404 term1 = productOfWeightsForFourTwoReduced;
7405 term2 = sumOfWeightsForFour;
7406 term3 = sumOfWeightsForTwoReduced;
7409 denominator = 1.-term1/(term2*term3);
7410 prefactor = term1/(term2*term3);
7411 if(TMath::Abs(denominator)>1e-6)
7413 covFourTwoReduced = (fourTwoReduced-four*twoReduced)/denominator;
7414 wCovFourTwoReduced = covFourTwoReduced*prefactor;
7415 fDiffFlowCovariances[t][pe][2]->SetBinContent(b,wCovFourTwoReduced);
7419 term1 = productOfWeightsForFourFourReduced;
7420 term2 = sumOfWeightsForFour;
7421 term3 = sumOfWeightsForFourReduced;
7424 denominator = 1.-term1/(term2*term3);
7425 prefactor = term1/(term2*term3);
7426 if(TMath::Abs(denominator)>1e-6)
7428 covFourFourReduced = (fourFourReduced-four*fourReduced)/denominator;
7429 wCovFourFourReduced = covFourFourReduced*prefactor;
7430 fDiffFlowCovariances[t][pe][3]->SetBinContent(b,wCovFourFourReduced);
7434 term1 = productOfWeightsForTwoReducedFourReduced;
7435 term2 = sumOfWeightsForTwoReduced;
7436 term3 = sumOfWeightsForFourReduced;
7439 denominator = 1.-term1/(term2*term3);
7440 prefactor = term1/(term2*term3);
7441 if(TMath::Abs(denominator)>1e-6)
7443 covTwoReducedFourReduced = (twoReducedFourReduced-twoReduced*fourReduced)/denominator;
7444 wCovTwoReducedFourReduced = covTwoReducedFourReduced*prefactor;
7445 fDiffFlowCovariances[t][pe][4]->SetBinContent(b,wCovTwoReducedFourReduced);
7448 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7450 } // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCovariances(TString type, TString ptOrEta)
7453 //================================================================================================================================
7456 void AliFlowAnalysisWithQCumulants::CalculateDiffFlow(TString type, TString ptOrEta)
7458 // calculate differential flow from differential cumulants and previously obtained integrated flow: (to be improved: description)
7461 Int_t ptEtaFlag = 0;
7466 } else if(type == "POI")
7474 } else if(ptOrEta == "Eta")
7481 Int_t pe = ptEtaFlag;
7484 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
7487 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
7488 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
7490 // statistical errors of correlations:
7491 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1);
7492 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2);
7494 // reduced correlations:
7495 Double_t twoReduced = 0.; // <<2'>>
7496 Double_t fourReduced = 0.; // <<4'>>
7498 // statistical errors of reduced correlations:
7499 Double_t twoReducedError = 0.;
7500 Double_t fourReducedError = 0.;
7503 Double_t wCovTwoFour = 0.; // Cov(<2>,<4>) * prefactor(<2>,<4>)
7504 if(!fForgetAboutCovariances)
7506 wCovTwoFour = fIntFlowCovariances->GetBinContent(1); // Cov(<2>,<4>) * prefactor(<2>,<4>)
7508 Double_t wCovTwoTwoReduced = 0.; // Cov(<2>,<2'>) * prefactor(<2>,<2'>)
7509 Double_t wCovTwoFourReduced = 0.; // Cov(<2>,<4'>) * prefactor(<2>,<4'>)
7510 Double_t wCovFourTwoReduced = 0.; // Cov(<4>,<2'>) * prefactor(<4>,<2'>)
7511 Double_t wCovFourFourReduced = 0.; // Cov(<4>,<4'>) * prefactor(<4>,<4'>)
7512 Double_t wCovTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>) * prefactor(<2'>,<4'>)
7514 // differential flow:
7515 Double_t v2Prime = 0.; // v'{2}
7516 Double_t v4Prime = 0.; // v'{4}
7518 // statistical error of differential flow:
7519 Double_t v2PrimeError = 0.;
7520 Double_t v4PrimeError = 0.;
7522 // squared statistical error of differential flow:
7523 Double_t v2PrimeErrorSquared = 0.;
7524 Double_t v4PrimeErrorSquared = 0.;
7526 // loop over pt or eta bins:
7527 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7529 // reduced correlations and statistical errors:
7530 twoReduced = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b);
7531 twoReducedError = fDiffFlowCorrelationsHist[t][pe][0]->GetBinError(b);
7532 fourReduced = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b);
7533 fourReducedError = fDiffFlowCorrelationsHist[t][pe][1]->GetBinError(b);
7535 if(!fForgetAboutCovariances)
7537 wCovTwoTwoReduced = fDiffFlowCovariances[t][pe][0]->GetBinContent(b);
7538 wCovTwoFourReduced = fDiffFlowCovariances[t][pe][1]->GetBinContent(b);
7539 wCovFourTwoReduced = fDiffFlowCovariances[t][pe][2]->GetBinContent(b);
7540 wCovFourFourReduced = fDiffFlowCovariances[t][pe][3]->GetBinContent(b);
7541 wCovTwoReducedFourReduced = fDiffFlowCovariances[t][pe][4]->GetBinContent(b);
7543 // differential flow:
7547 v2Prime = twoReduced/pow(two,0.5);
7548 v2PrimeErrorSquared = (1./4.)*pow(two,-3.)*
7549 (pow(twoReduced,2.)*pow(twoError,2.)
7550 + 4.*pow(two,2.)*pow(twoReducedError,2.)
7551 - 4.*two*twoReduced*wCovTwoTwoReduced);
7554 if(v2PrimeErrorSquared>0.) v2PrimeError = pow(v2PrimeErrorSquared,0.5);
7555 fDiffFlow[t][pe][0]->SetBinContent(b,v2Prime);
7556 if(TMath::Abs(v2Prime)>1.e-44)fDiffFlow[t][pe][0]->SetBinError(b,v2PrimeError);
7558 // differential flow:
7560 if(2.*pow(two,2.)-four > 0.)
7562 v4Prime = (2.*two*twoReduced-fourReduced)/pow(2.*pow(two,2.)-four,3./4.);
7563 v4PrimeErrorSquared = pow(2.*pow(two,2.)-four,-7./2.)*
7564 (pow(2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced,2.)*pow(twoError,2.)
7565 + (9./16.)*pow(2.*two*twoReduced-fourReduced,2.)*pow(fourError,2.)
7566 + 4.*pow(two,2.)*pow(2.*pow(two,2.)-four,2.)*pow(twoReducedError,2.)
7567 + pow(2.*pow(two,2.)-four,2.)*pow(fourReducedError,2.)
7568 - (3./2.)*(2.*two*twoReduced-fourReduced)
7569 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoFour
7570 - 4.*two*(2.*pow(two,2.)-four)
7571 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoTwoReduced
7572 + 2.*(2.*pow(two,2.)-four)
7573 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoFourReduced
7574 + 3.*two*(2.*pow(two,2.)-four)*(2.*two*twoReduced-fourReduced)*wCovFourTwoReduced
7575 - (3./2.)*(2.*pow(two,2.)-four)*(2.*two*twoReduced-fourReduced)*wCovFourFourReduced
7576 - 4.*two*pow(2.*pow(two,2.)-four,2.)*wCovTwoReducedFourReduced);
7577 if(v4PrimeErrorSquared>0.) v4PrimeError = pow(v4PrimeErrorSquared,0.5);
7578 fDiffFlow[t][pe][1]->SetBinContent(b,v4Prime);
7579 if(TMath::Abs(v4Prime)>1.e-44)fDiffFlow[t][pe][1]->SetBinError(b,v4PrimeError);
7582 } // end of for(Int_t b=1;b<=fnBinsPtEta[pe];b++)
7589 for(Int_t nua=0;nua<2;nua++)
7591 for(Int_t p=1;p<=fnBinsPt;p++)
7593 for(Int_t e=1;e<=fnBinsEta;e++)
7595 // differential cumulants:
7596 Double_t qc2Prime = fFinalCumulants2D[t][pW][eW][nua][0]->GetBinContent(fFinalCumulants2D[t][pW][eW][nua][0]->GetBin(p,e)); // QC{2'}
7597 Double_t qc4Prime = fFinalCumulants2D[t][pW][eW][nua][1]->GetBinContent(fFinalCumulants2D[t][pW][eW][nua][1]->GetBin(p,e)); // QC{4'}
7598 // differential flow:
7599 Double_t v2Prime = 0.;
7600 Double_t v4Prime = 0.;
7603 v2Prime = qc2Prime/v2;
7604 fFinalFlow2D[t][pW][eW][nua][0]->SetBinContent(fFinalFlow2D[t][pW][eW][nua][0]->GetBin(p,e),v2Prime);
7608 v4Prime = -qc4Prime/pow(v4,3.);
7609 fFinalFlow2D[t][pW][eW][nua][1]->SetBinContent(fFinalFlow2D[t][pW][eW][nua][1]->GetBin(p,e),v4Prime);
7611 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
7612 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
7613 } // end of for(Int_t nua=0;nua<2;nua++)
7616 } // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlow(TString type, Bool_t useParticleWeights)
7618 //================================================================================================================================
7620 void AliFlowAnalysisWithQCumulants::StoreIntFlowFlags()
7622 // a) Store all flags for integrated flow in profile fIntFlowFlags.
7626 cout<<"WARNING: fIntFlowFlags is NULL in AFAWQC::SFFIF() !!!!"<<endl;
7630 // particle weights used or not:
7631 fIntFlowFlags->Fill(0.5,(Int_t)fUsePhiWeights||fUsePtWeights||fUseEtaWeights);
7632 // which event weights were used:
7633 if(strcmp(fMultiplicityWeight->Data(),"combinations"))
7635 fIntFlowFlags->Fill(1.5,0); // 0 = "combinations" (default)
7636 } else if(strcmp(fMultiplicityWeight->Data(),"unit"))
7638 fIntFlowFlags->Fill(1.5,1); // 1 = "unit"
7639 } else if(strcmp(fMultiplicityWeight->Data(),"multiplicity"))
7641 fIntFlowFlags->Fill(1.5,2); // 2 = "multiplicity"
7643 fIntFlowFlags->Fill(2.5,(Int_t)fApplyCorrectionForNUA);
7644 fIntFlowFlags->Fill(3.5,(Int_t)fPrintFinalResults[0]);
7645 fIntFlowFlags->Fill(4.5,(Int_t)fPrintFinalResults[1]);
7646 fIntFlowFlags->Fill(5.5,(Int_t)fPrintFinalResults[2]);
7647 fIntFlowFlags->Fill(6.5,(Int_t)fPrintFinalResults[3]);
7648 fIntFlowFlags->Fill(7.5,(Int_t)fApplyCorrectionForNUAVsM);
7649 fIntFlowFlags->Fill(8.5,(Int_t)fPropagateErrorAlsoFromNIT);
7650 fIntFlowFlags->Fill(9.5,(Int_t)fCalculateCumulantsVsM);
7651 fIntFlowFlags->Fill(10.5,(Int_t)fMinimumBiasReferenceFlow);
7652 fIntFlowFlags->Fill(11.5,(Int_t)fForgetAboutCovariances);
7653 fIntFlowFlags->Fill(12.5,(Int_t)fStorePhiDistributionForOneEvent);
7654 fIntFlowFlags->Fill(13.5,(Int_t)fFillMultipleControlHistograms);
7655 } // end of void AliFlowAnalysisWithQCumulants::StoreIntFlowFlags()
7657 //================================================================================================================================
7659 void AliFlowAnalysisWithQCumulants::StoreDiffFlowFlags()
7661 // Store all flags for differential flow in the profile fDiffFlowFlags.
7665 cout<<"WARNING: fDiffFlowFlags is NULL in AFAWQC::SFFDF() !!!!"<<endl;
7669 fDiffFlowFlags->Fill(0.5,fUsePhiWeights||fUsePtWeights||fUseEtaWeights); // particle weights used or not
7670 //fDiffFlowFlags->Fill(1.5,""); // which event weight was used? // to be improved
7671 fDiffFlowFlags->Fill(2.5,fApplyCorrectionForNUA); // corrected for non-uniform acceptance or not
7672 fDiffFlowFlags->Fill(3.5,fCalculate2DFlow); // calculate also 2D differential flow in (pt,eta) or not
7674 } // end of void AliFlowAnalysisWithQCumulants::StoreDiffFlowFlags()
7676 //================================================================================================================================
7678 void AliFlowAnalysisWithQCumulants::GetPointersForCommonHistograms()
7680 // Access all pointers to common control and common result histograms and profiles.
7682 TString commonHistsName = "AliFlowCommonHistQC";
7683 commonHistsName += fAnalysisLabel->Data();
7684 AliFlowCommonHist *commonHist = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHistsName.Data()));
7687 this->SetCommonHists(commonHist);
7688 if(fCommonHists->GetHarmonic())
7690 fHarmonic = (Int_t)(fCommonHists->GetHarmonic())->GetBinContent(1);
7692 } // end of if(commonHist)
7693 TString commonHists2ndOrderName = "AliFlowCommonHist2ndOrderQC";
7694 commonHists2ndOrderName += fAnalysisLabel->Data();
7695 AliFlowCommonHist *commonHist2nd = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists2ndOrderName.Data()));
7696 if(commonHist2nd) this->SetCommonHists2nd(commonHist2nd);
7697 TString commonHists4thOrderName = "AliFlowCommonHist4thOrderQC";
7698 commonHists4thOrderName += fAnalysisLabel->Data();
7699 AliFlowCommonHist *commonHist4th = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists4thOrderName.Data()));
7700 if(commonHist4th) this->SetCommonHists4th(commonHist4th);
7701 TString commonHists6thOrderName = "AliFlowCommonHist6thOrderQC";
7702 commonHists6thOrderName += fAnalysisLabel->Data();
7703 AliFlowCommonHist *commonHist6th = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists6thOrderName.Data()));
7704 if(commonHist6th) this->SetCommonHists6th(commonHist6th);
7705 TString commonHists8thOrderName = "AliFlowCommonHist8thOrderQC";
7706 commonHists8thOrderName += fAnalysisLabel->Data();
7707 AliFlowCommonHist *commonHist8th = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists8thOrderName.Data()));
7708 if(commonHist8th) this->SetCommonHists8th(commonHist8th);
7710 TString commonHistResults2ndOrderName = "AliFlowCommonHistResults2ndOrderQC";
7711 commonHistResults2ndOrderName += fAnalysisLabel->Data();
7712 AliFlowCommonHistResults *commonHistRes2nd = dynamic_cast<AliFlowCommonHistResults*>
7713 (fHistList->FindObject(commonHistResults2ndOrderName.Data()));
7714 if(commonHistRes2nd) this->SetCommonHistsResults2nd(commonHistRes2nd);
7715 TString commonHistResults4thOrderName = "AliFlowCommonHistResults4thOrderQC";
7716 commonHistResults4thOrderName += fAnalysisLabel->Data();
7717 AliFlowCommonHistResults *commonHistRes4th = dynamic_cast<AliFlowCommonHistResults*>
7718 (fHistList->FindObject(commonHistResults4thOrderName.Data()));
7719 if(commonHistRes4th) this->SetCommonHistsResults4th(commonHistRes4th);
7720 TString commonHistResults6thOrderName = "AliFlowCommonHistResults6thOrderQC";
7721 commonHistResults6thOrderName += fAnalysisLabel->Data();
7722 AliFlowCommonHistResults *commonHistRes6th = dynamic_cast<AliFlowCommonHistResults*>
7723 (fHistList->FindObject(commonHistResults6thOrderName.Data()));
7724 if(commonHistRes6th) this->SetCommonHistsResults6th(commonHistRes6th);
7725 TString commonHistResults8thOrderName = "AliFlowCommonHistResults8thOrderQC";
7726 commonHistResults8thOrderName += fAnalysisLabel->Data();
7727 AliFlowCommonHistResults *commonHistRes8th = dynamic_cast<AliFlowCommonHistResults*>
7728 (fHistList->FindObject(commonHistResults8thOrderName.Data()));
7729 if(commonHistRes8th) this->SetCommonHistsResults8th(commonHistRes8th);
7731 } // end of void AliFlowAnalysisWithQCumulants::GetPointersForCommonHistograms()
7734 //================================================================================================================================
7737 void AliFlowAnalysisWithQCumulants::GetPointersForParticleWeightsHistograms()
7739 // Get pointers for histograms with particle weights.
7741 TList *weightsList = dynamic_cast<TList*>(fHistList->FindObject("Weights"));
7742 if(weightsList) this->SetWeightsList(weightsList);
7743 TString fUseParticleWeightsName = "fUseParticleWeightsQC"; // to be improved (hirdwired label QC)
7744 fUseParticleWeightsName += fAnalysisLabel->Data();
7745 TProfile *useParticleWeights = dynamic_cast<TProfile*>(weightsList->FindObject(fUseParticleWeightsName.Data()));
7746 if(useParticleWeights)
7748 this->SetUseParticleWeights(useParticleWeights);
7749 fUsePhiWeights = (Int_t)fUseParticleWeights->GetBinContent(1);
7750 fUsePtWeights = (Int_t)fUseParticleWeights->GetBinContent(2);
7751 fUseEtaWeights = (Int_t)fUseParticleWeights->GetBinContent(3);
7753 } // end of void AliFlowAnalysisWithQCumulants::GetPointersForParticleWeightsHistograms();
7756 //================================================================================================================================
7759 void AliFlowAnalysisWithQCumulants::GetPointersForIntFlowHistograms()
7761 // Get pointers for histograms and profiles relevant for integrated flow:
7762 // a) Get pointer to base list for integrated flow holding profile fIntFlowFlags and lists fIntFlowProfiles and fIntFlowResults.
7763 // b) Get pointer to profile fIntFlowFlags holding all flags for integrated flow.
7764 // c) Get pointer to list fIntFlowProfiles and pointers to all objects that she holds.
7765 // d) Get pointer to list fIntFlowResults and pointers to all objects that she holds.
7767 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data member?)
7768 TString powerFlag[2] = {"linear","quadratic"}; // to be improved (should I promote this to data member?)
7769 TString correlationFlag[4] = {"#LT#LT2#GT#GT","#LT#LT4#GT#GT","#LT#LT6#GT#GT","#LT#LT8#GT#GT"}; // to be improved (should I promote this to data member?)
7770 TString squaredCorrelationFlag[4] = {"#LT#LT2#GT^{2}#GT","#LT#LT4#GT^{2}#GT","#LT#LT6#GT^{2}#GT","#LT#LT8#GT^{2}#GT"}; // to be improved (should I promote this to data member?)
7772 // a) Get pointer to base list for integrated flow holding profile fIntFlowFlags and lists fIntFlowProfiles and fIntFlowResults:
7773 TList *intFlowList = NULL;
7774 intFlowList = dynamic_cast<TList*>(fHistList->FindObject("Integrated Flow"));
7777 cout<<"WARNING: intFlowList is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7781 // b) Get pointer to profile fIntFlowFlags holding all flags for integrated flow:
7782 TString intFlowFlagsName = "fIntFlowFlags";
7783 intFlowFlagsName += fAnalysisLabel->Data();
7784 TProfile *intFlowFlags = dynamic_cast<TProfile*>(intFlowList->FindObject(intFlowFlagsName.Data()));
7787 this->SetIntFlowFlags(intFlowFlags);
7788 fApplyCorrectionForNUA = (Bool_t)intFlowFlags->GetBinContent(3);
7789 fApplyCorrectionForNUAVsM = (Bool_t)intFlowFlags->GetBinContent(8);
7790 fCalculateCumulantsVsM = (Bool_t)intFlowFlags->GetBinContent(10);
7793 cout<<"WARNING: intFlowFlags is NULL in FAWQC::GPFIFH() !!!!"<<endl;
7796 // c) Get pointer to list fIntFlowProfiles and pointers to all objects that she holds:
7797 TList *intFlowProfiles = NULL;
7798 intFlowProfiles = dynamic_cast<TList*>(intFlowList->FindObject("Profiles"));
7801 // average multiplicities:
7802 TString avMultiplicityName = "fAvMultiplicity";
7803 avMultiplicityName += fAnalysisLabel->Data();
7804 TProfile *avMultiplicity = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(avMultiplicityName.Data()));
7807 this->SetAvMultiplicity(avMultiplicity);
7810 cout<<"WARNING: avMultiplicity is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7812 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with wrong errors!):
7813 TString intFlowCorrelationsProName = "fIntFlowCorrelationsPro";
7814 intFlowCorrelationsProName += fAnalysisLabel->Data();
7815 TProfile *intFlowCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowCorrelationsProName.Data()));
7816 if(intFlowCorrelationsPro)
7818 this->SetIntFlowCorrelationsPro(intFlowCorrelationsPro);
7821 cout<<"WARNING: intFlowCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7823 // average squared correlations <<2>^2>, <<4>^2>, <<6>^2> and <<8^2>>:
7824 TString intFlowSquaredCorrelationsProName = "fIntFlowSquaredCorrelationsPro";
7825 intFlowSquaredCorrelationsProName += fAnalysisLabel->Data();
7826 TProfile *intFlowSquaredCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowSquaredCorrelationsProName.Data()));
7827 if(intFlowSquaredCorrelationsPro)
7829 this->SetIntFlowSquaredCorrelationsPro(intFlowSquaredCorrelationsPro);
7832 cout<<"WARNING: intFlowSquaredCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7834 if(fCalculateCumulantsVsM)
7836 // Average correlations <<2>>, <<4>>, <<6>> and <<8>> versus multiplicity for all events (error is wrong here):
7837 TString intFlowCorrelationsVsMProName = "fIntFlowCorrelationsVsMPro";
7838 intFlowCorrelationsVsMProName += fAnalysisLabel->Data();
7839 for(Int_t ci=0;ci<4;ci++) // correlation index
7841 TProfile *intFlowCorrelationsVsMPro = dynamic_cast<TProfile*>
7842 (intFlowProfiles->FindObject(Form("%s, %s",intFlowCorrelationsVsMProName.Data(),correlationFlag[ci].Data())));
7843 if(intFlowCorrelationsVsMPro)
7845 this->SetIntFlowCorrelationsVsMPro(intFlowCorrelationsVsMPro,ci);
7848 cout<<"WARNING: "<<Form("intFlowCorrelationsVsMPro[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7850 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
7851 // Average squared correlations <<2>^2>, <<4>^2>, <<6>^2> and <<8>^2> versus multiplicity for all events:
7852 TString intFlowSquaredCorrelationsVsMProName = "fIntFlowSquaredCorrelationsVsMPro";
7853 intFlowSquaredCorrelationsVsMProName += fAnalysisLabel->Data();
7854 for(Int_t ci=0;ci<4;ci++) // correlation index
7856 TProfile *intFlowSquaredCorrelationsVsMPro = dynamic_cast<TProfile*>
7857 (intFlowProfiles->FindObject(Form("%s, %s",intFlowSquaredCorrelationsVsMProName.Data(),squaredCorrelationFlag[ci].Data())));
7858 if(intFlowSquaredCorrelationsVsMPro)
7860 this->SetIntFlowSquaredCorrelationsVsMPro(intFlowSquaredCorrelationsVsMPro,ci);
7863 cout<<"WARNING: "<<Form("intFlowSquaredCorrelationsVsMPro[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7865 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
7866 } // end of if(fCalculateCumulantsVsM)
7867 // average all correlations for integrated flow (with wrong errors!):
7868 TString intFlowCorrelationsAllProName = "fIntFlowCorrelationsAllPro";
7869 intFlowCorrelationsAllProName += fAnalysisLabel->Data();
7870 TProfile *intFlowCorrelationsAllPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowCorrelationsAllProName.Data()));
7871 if(intFlowCorrelationsAllPro)
7873 this->SetIntFlowCorrelationsAllPro(intFlowCorrelationsAllPro);
7876 cout<<"WARNING: intFlowCorrelationsAllPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7878 // average extra correlations for integrated flow (which appear only when particle weights are used):
7879 // (to be improved: Weak point in implementation, I am assuming here that method GetPointersForParticleWeightsHistograms() was called)
7880 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
7882 TString intFlowExtraCorrelationsProName = "fIntFlowExtraCorrelationsPro";
7883 intFlowExtraCorrelationsProName += fAnalysisLabel->Data();
7884 TProfile *intFlowExtraCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowExtraCorrelationsProName.Data()));
7885 if(intFlowExtraCorrelationsPro)
7887 this->SetIntFlowExtraCorrelationsPro(intFlowExtraCorrelationsPro);
7890 cout<<"WARNING: intFlowExtraCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7892 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
7893 // average products of correlations <2>, <4>, <6> and <8>:
7894 TString intFlowProductOfCorrelationsProName = "fIntFlowProductOfCorrelationsPro";
7895 intFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
7896 TProfile *intFlowProductOfCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowProductOfCorrelationsProName.Data()));
7897 if(intFlowProductOfCorrelationsPro)
7899 this->SetIntFlowProductOfCorrelationsPro(intFlowProductOfCorrelationsPro);
7902 cout<<"WARNING: intFlowProductOfCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7904 // average product of correlations <2>, <4>, <6> and <8> versus multiplicity
7905 // [0=<<2><4>>,1=<<2><6>>,2=<<2><8>>,3=<<4><6>>,4=<<4><8>>,5=<<6><8>>]
7906 if(fCalculateCumulantsVsM)
7908 TString intFlowProductOfCorrelationsVsMProName = "fIntFlowProductOfCorrelationsVsMPro";
7909 intFlowProductOfCorrelationsVsMProName += fAnalysisLabel->Data();
7910 TString productFlag[6] = {"<<2><4>>","<<2><6>>","<<2><8>>","<<4><6>>","<<4><8>>","<<6><8>>"};
7911 for(Int_t pi=0;pi<6;pi++)
7913 TProfile *intFlowProductOfCorrelationsVsMPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(Form("%s, %s",intFlowProductOfCorrelationsVsMProName.Data(),productFlag[pi].Data())));
7914 if(intFlowProductOfCorrelationsVsMPro)
7916 this->SetIntFlowProductOfCorrelationsVsMPro(intFlowProductOfCorrelationsVsMPro,pi);
7919 cout<<"WARNING: "<<Form("intFlowProductOfCorrelationsVsMPro[%d]",pi)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7921 } // end of for(Int_t pi=0;pi<6;pi++)
7922 } // end of if(fCalculateCumulantsVsM)
7923 // average correction terms for non-uniform acceptance (with wrong errors!):
7924 for(Int_t sc=0;sc<2;sc++)
7926 TString intFlowCorrectionTermsForNUAProName = "fIntFlowCorrectionTermsForNUAPro";
7927 intFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
7928 TProfile *intFlowCorrectionTermsForNUAPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject((Form("%s: %s terms",intFlowCorrectionTermsForNUAProName.Data(),sinCosFlag[sc].Data()))));
7929 if(intFlowCorrectionTermsForNUAPro)
7931 this->SetIntFlowCorrectionTermsForNUAPro(intFlowCorrectionTermsForNUAPro,sc);
7934 cout<<"WARNING: intFlowCorrectionTermsForNUAPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7935 cout<<"sc = "<<sc<<endl;
7937 // versus multiplicity:
7938 if(fCalculateCumulantsVsM)
7940 TString correctionTermFlag[4] = {"(n(phi1))","(n(phi1+phi2))","(n(phi1-phi2-phi3))","(n(2phi1-phi2))"}; // to be improved - hardwired 4
7941 TString intFlowCorrectionTermsForNUAVsMProName = "fIntFlowCorrectionTermsForNUAVsMPro";
7942 intFlowCorrectionTermsForNUAVsMProName += fAnalysisLabel->Data();
7943 for(Int_t ci=0;ci<4;ci++) // correction term index (to be improved - hardwired 4)
7945 TProfile *intFlowCorrectionTermsForNUAVsMPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(Form("%s: #LT#LT%s%s#GT#GT",intFlowCorrectionTermsForNUAVsMProName.Data(),sinCosFlag[sc].Data(),correctionTermFlag[ci].Data())));
7946 if(intFlowCorrectionTermsForNUAVsMPro)
7948 this->SetIntFlowCorrectionTermsForNUAVsMPro(intFlowCorrectionTermsForNUAVsMPro,sc,ci);
7951 cout<<"WARNING: intFlowCorrectionTermsForNUAVsMPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7952 cout<<"sc = "<<sc<<endl;
7953 cout<<"ci = "<<ci<<endl;
7955 } // end of for(Int_t ci=0;ci<4;ci++) // correction term index (to be improved - hardwired 4)
7956 } // end of if(fCalculateCumulantsVsM)
7957 } // end of for(Int_t sc=0;sc<2;sc++)
7958 // average products of correction terms for NUA:
7959 TString intFlowProductOfCorrectionTermsForNUAProName = "fIntFlowProductOfCorrectionTermsForNUAPro";
7960 intFlowProductOfCorrectionTermsForNUAProName += fAnalysisLabel->Data();
7961 TProfile *intFlowProductOfCorrectionTermsForNUAPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowProductOfCorrectionTermsForNUAProName.Data()));
7962 if(intFlowProductOfCorrectionTermsForNUAPro)
7964 this->SetIntFlowProductOfCorrectionTermsForNUAPro(intFlowProductOfCorrectionTermsForNUAPro);
7967 cout<<"WARNING: intFlowProductOfCorrectionTermsForNUAPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7969 } else // to if(intFlowProfiles)
7971 cout<<"WARNING: intFlowProfiles is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7974 // d) Get pointer to list fIntFlowResults and pointers to all objects that she holds.
7975 TList *intFlowResults = NULL;
7976 intFlowResults = dynamic_cast<TList*>(intFlowList->FindObject("Results"));
7979 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with correct errors!):
7980 TString intFlowCorrelationsHistName = "fIntFlowCorrelationsHist";
7981 intFlowCorrelationsHistName += fAnalysisLabel->Data();
7982 TH1D *intFlowCorrelationsHist = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCorrelationsHistName.Data()));
7983 if(intFlowCorrelationsHist)
7985 this->SetIntFlowCorrelationsHist(intFlowCorrelationsHist);
7988 cout<<"WARNING: intFlowCorrelationsHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7990 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with correct errors!) vs M:
7991 if(fCalculateCumulantsVsM)
7993 TString intFlowCorrelationsVsMHistName = "fIntFlowCorrelationsVsMHist";
7994 intFlowCorrelationsVsMHistName += fAnalysisLabel->Data();
7995 for(Int_t ci=0;ci<4;ci++) // correlation index
7997 TH1D *intFlowCorrelationsVsMHist = dynamic_cast<TH1D*>
7998 (intFlowResults->FindObject(Form("%s, %s",intFlowCorrelationsVsMHistName.Data(),correlationFlag[ci].Data())));
7999 if(intFlowCorrelationsVsMHist)
8001 this->SetIntFlowCorrelationsVsMHist(intFlowCorrelationsVsMHist,ci);
8004 cout<<"WARNING: "<<Form("intFlowCorrelationsVsMHist[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8006 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
8007 } // end of if(fCalculateCumulantsVsM)
8008 // average all correlations for integrated flow (with correct errors!):
8009 TString intFlowCorrelationsAllHistName = "fIntFlowCorrelationsAllHist";
8010 intFlowCorrelationsAllHistName += fAnalysisLabel->Data();
8011 TH1D *intFlowCorrelationsAllHist = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCorrelationsAllHistName.Data()));
8012 if(intFlowCorrelationsAllHist)
8014 this->SetIntFlowCorrelationsAllHist(intFlowCorrelationsAllHist);
8017 cout<<"WARNING: intFlowCorrelationsAllHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8019 // average correction terms for non-uniform acceptance (with correct errors!):
8020 TString intFlowCorrectionTermsForNUAHistName = "fIntFlowCorrectionTermsForNUAHist";
8021 intFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
8022 for(Int_t sc=0;sc<2;sc++)
8024 TH1D *intFlowCorrectionTermsForNUAHist = dynamic_cast<TH1D*>(intFlowResults->FindObject((Form("%s: %s terms",intFlowCorrectionTermsForNUAHistName.Data(),sinCosFlag[sc].Data()))));
8025 if(intFlowCorrectionTermsForNUAHist)
8027 this->SetIntFlowCorrectionTermsForNUAHist(intFlowCorrectionTermsForNUAHist,sc);
8030 cout<<"WARNING: intFlowCorrectionTermsForNUAHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8031 cout<<"sc = "<<sc<<endl;
8033 } // end of for(Int_t sc=0;sc<2;sc++)
8034 // covariances (multiplied with weight dependent prefactor):
8035 TString intFlowCovariancesName = "fIntFlowCovariances";
8036 intFlowCovariancesName += fAnalysisLabel->Data();
8037 TH1D *intFlowCovariances = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCovariancesName.Data()));
8038 if(intFlowCovariances)
8040 this->SetIntFlowCovariances(intFlowCovariances);
8043 cout<<"WARNING: intFlowCovariances is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8045 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8>:
8046 TString intFlowSumOfEventWeightsName = "fIntFlowSumOfEventWeights";
8047 intFlowSumOfEventWeightsName += fAnalysisLabel->Data();
8048 for(Int_t power=0;power<2;power++)
8050 TH1D *intFlowSumOfEventWeights = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s: %s",intFlowSumOfEventWeightsName.Data(),powerFlag[power].Data())));
8051 if(intFlowSumOfEventWeights)
8053 this->SetIntFlowSumOfEventWeights(intFlowSumOfEventWeights,power);
8056 cout<<"WARNING: intFlowSumOfEventWeights is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8057 cout<<"power = "<<power<<endl;
8059 } // end of for(Int_t power=0;power<2;power++)
8060 // sum of products of event weights for correlations <2>, <4>, <6> and <8>:
8061 TString intFlowSumOfProductOfEventWeightsName = "fIntFlowSumOfProductOfEventWeights";
8062 intFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
8063 TH1D *intFlowSumOfProductOfEventWeights = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowSumOfProductOfEventWeightsName.Data()));
8064 if(intFlowSumOfProductOfEventWeights)
8066 this->SetIntFlowSumOfProductOfEventWeights(intFlowSumOfProductOfEventWeights);
8069 cout<<"WARNING: intFlowSumOfProductOfEventWeights is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8071 // final result for covariances of correlations (multiplied with weight dependent prefactor) versus M
8072 // [0=Cov(2,4),1=Cov(2,6),2=Cov(2,8),3=Cov(4,6),4=Cov(4,8),5=Cov(6,8)]:
8073 if(fCalculateCumulantsVsM)
8075 TString intFlowCovariancesVsMName = "fIntFlowCovariancesVsM";
8076 intFlowCovariancesVsMName += fAnalysisLabel->Data();
8077 TString covarianceFlag[6] = {"Cov(<2>,<4>)","Cov(<2>,<6>)","Cov(<2>,<8>)","Cov(<4>,<6>)","Cov(<4>,<8>)","Cov(<6>,<8>)"};
8078 for(Int_t ci=0;ci<6;ci++)
8080 TH1D *intFlowCovariancesVsM = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s, %s",intFlowCovariancesVsMName.Data(),covarianceFlag[ci].Data())));
8081 if(intFlowCovariancesVsM)
8083 this->SetIntFlowCovariancesVsM(intFlowCovariancesVsM,ci);
8086 cout<<"WARNING: "<<Form("intFlowCovariancesVsM[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8088 } // end of for(Int_t ci=0;ci<6;ci++)
8089 } // end of if(fCalculateCumulantsVsM)
8090 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8> versus multiplicity
8091 // [0=sum{w_{<2>}},1=sum{w_{<4>}},2=sum{w_{<6>}},3=sum{w_{<8>}}][0=linear 1,1=quadratic]:
8092 if(fCalculateCumulantsVsM)
8094 TString intFlowSumOfEventWeightsVsMName = "fIntFlowSumOfEventWeightsVsM";
8095 intFlowSumOfEventWeightsVsMName += fAnalysisLabel->Data();
8096 TString sumFlag[2][4] = {{"#sum_{i=1}^{N} w_{<2>}","#sum_{i=1}^{N} w_{<4>}","#sum_{i=1}^{N} w_{<6>}","#sum_{i=1}^{N} w_{<8>}"},
8097 {"#sum_{i=1}^{N} w_{<2>}^{2}","#sum_{i=1}^{N} w_{<4>}^{2}","#sum_{i=1}^{N} w_{<6>}^{2}","#sum_{i=1}^{N} w_{<8>}^{2}"}};
8098 for(Int_t si=0;si<4;si++)
8100 for(Int_t power=0;power<2;power++)
8102 TH1D *intFlowSumOfEventWeightsVsM = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s, %s",intFlowSumOfEventWeightsVsMName.Data(),sumFlag[power][si].Data())));
8103 if(intFlowSumOfEventWeightsVsM)
8105 this->SetIntFlowSumOfEventWeightsVsM(intFlowSumOfEventWeightsVsM,si,power);
8108 cout<<"WARNING: "<<Form("intFlowSumOfEventWeightsVsM[%d][%d]",si,power)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8110 } // end of for(Int_t power=0;power<2;power++)
8111 } // end of for(Int_t si=0;si<4;si++)
8112 } // end of if(fCalculateCumulantsVsM)
8113 // sum of products of event weights for correlations <2>, <4>, <6> and <8> vs M
8114 // [0=sum{w_{<2>}w_{<4>}},1=sum{w_{<2>}w_{<6>}},2=sum{w_{<2>}w_{<8>}},
8115 // 3=sum{w_{<4>}w_{<6>}},4=sum{w_{<4>}w_{<8>}},5=sum{w_{<6>}w_{<8>}}]:
8116 if(fCalculateCumulantsVsM)
8118 TString intFlowSumOfProductOfEventWeightsVsMName = "fIntFlowSumOfProductOfEventWeightsVsM";
8119 intFlowSumOfProductOfEventWeightsVsMName += fAnalysisLabel->Data();
8120 TString sopowFlag[6] = {"#sum_{i=1}^{N} w_{<2>} w_{<4>}","#sum_{i=1}^{N} w_{<2>} w_{<6>}","#sum_{i=1}^{N} w_{<2>} w_{<8>}",
8121 "#sum_{i=1}^{N} w_{<4>} w_{<6>}","#sum_{i=1}^{N} w_{<4>} w_{<8>}","#sum_{i=1}^{N} w_{<6>} w_{<8>}"};
8122 for(Int_t pi=0;pi<6;pi++)
8124 TH1D *intFlowSumOfProductOfEventWeightsVsM = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s, %s",intFlowSumOfProductOfEventWeightsVsMName.Data(),sopowFlag[pi].Data())));
8125 if(intFlowSumOfProductOfEventWeightsVsM)
8127 this->SetIntFlowSumOfProductOfEventWeightsVsM(intFlowSumOfProductOfEventWeightsVsM,pi);
8130 cout<<"WARNING: "<<Form("intFlowSumOfProductOfEventWeightsVsM[%d]",pi)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8132 } // end of for(Int_t pi=0;pi<6;pi++)
8133 } // end of if(fCalculateCumulantsVsM)
8134 // covariances for NUA (multiplied with weight dependent prefactor):
8135 TString intFlowCovariancesNUAName = "fIntFlowCovariancesNUA";
8136 intFlowCovariancesNUAName += fAnalysisLabel->Data();
8137 TH1D *intFlowCovariancesNUA = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCovariancesNUAName.Data()));
8138 if(intFlowCovariancesNUA)
8140 this->SetIntFlowCovariancesNUA(intFlowCovariancesNUA);
8143 cout<<"WARNING: intFlowCovariancesNUA is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8145 // sum of linear and quadratic event weights NUA terms:
8146 TString intFlowSumOfEventWeightsNUAName = "fIntFlowSumOfEventWeightsNUA";
8147 intFlowSumOfEventWeightsNUAName += fAnalysisLabel->Data();
8148 for(Int_t sc=0;sc<2;sc++)
8150 for(Int_t power=0;power<2;power++)
8152 TH1D *intFlowSumOfEventWeightsNUA = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s: %s, %s",intFlowSumOfEventWeightsNUAName.Data(),powerFlag[power].Data(),sinCosFlag[sc].Data())));
8153 if(intFlowSumOfEventWeightsNUA)
8155 this->SetIntFlowSumOfEventWeightsNUA(intFlowSumOfEventWeightsNUA,sc,power);
8158 cout<<"WARNING: intFlowSumOfEventWeightsNUA is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8159 cout<<"sc = "<<sc<<endl;
8160 cout<<"power = "<<power<<endl;
8162 } // end of for(Int_t power=0;power<2;power++)
8163 } // end of for(Int_t sc=0;sc<2;sc++)
8164 // sum of products of event weights for NUA terms:
8165 TString intFlowSumOfProductOfEventWeightsNUAName = "fIntFlowSumOfProductOfEventWeightsNUA";
8166 intFlowSumOfProductOfEventWeightsNUAName += fAnalysisLabel->Data();
8167 TH1D *intFlowSumOfProductOfEventWeightsNUA = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowSumOfProductOfEventWeightsNUAName.Data()));
8168 if(intFlowSumOfProductOfEventWeightsNUA)
8170 this->SetIntFlowSumOfProductOfEventWeightsNUA(intFlowSumOfProductOfEventWeightsNUA);
8173 cout<<"WARNING: intFlowSumOfProductOfEventWeightsNUA is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8175 // Final results for reference Q-cumulants:
8176 TString intFlowQcumulantsName = "fIntFlowQcumulants";
8177 intFlowQcumulantsName += fAnalysisLabel->Data();
8178 TH1D *intFlowQcumulants = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowQcumulantsName.Data()));
8179 if(intFlowQcumulants)
8181 this->SetIntFlowQcumulants(intFlowQcumulants);
8184 cout<<"WARNING: intFlowQcumulants is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8186 // Final results for reference Q-cumulants rebinned in M:
8187 if(fCalculateCumulantsVsM)
8189 TString intFlowQcumulantsRebinnedInMName = "fIntFlowQcumulantsRebinnedInM";
8190 intFlowQcumulantsRebinnedInMName += fAnalysisLabel->Data();
8191 TH1D *intFlowQcumulantsRebinnedInM = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowQcumulantsRebinnedInMName.Data()));
8192 if(intFlowQcumulantsRebinnedInM)
8194 this->SetIntFlowQcumulantsRebinnedInM(intFlowQcumulantsRebinnedInM);
8197 cout<<"WARNING: intFlowQcumulantsRebinnedInM is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8199 } // end of if(fCalculateCumulantsVsM)
8200 // Ratio between error squared: with/without non-isotropic terms:
8201 TString intFlowQcumulantsErrorSquaredRatioName = "fIntFlowQcumulantsErrorSquaredRatio";
8202 intFlowQcumulantsErrorSquaredRatioName += fAnalysisLabel->Data();
8203 TH1D *intFlowQcumulantsErrorSquaredRatio = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowQcumulantsErrorSquaredRatioName.Data()));
8204 if(intFlowQcumulantsErrorSquaredRatio)
8206 this->SetIntFlowQcumulantsErrorSquaredRatio(intFlowQcumulantsErrorSquaredRatio);
8209 cout<<" WARNING: intntFlowQcumulantsErrorSquaredRatio is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8211 // final results for integrated Q-cumulants versus multiplicity:
8212 TString cumulantFlag[4] = {"QC{2}","QC{4}","QC{6}","QC{8}"};
8213 if(fCalculateCumulantsVsM)
8215 TString intFlowQcumulantsVsMName = "fIntFlowQcumulantsVsM";
8216 intFlowQcumulantsVsMName += fAnalysisLabel->Data();
8217 for(Int_t co=0;co<4;co++) // cumulant order
8219 TH1D *intFlowQcumulantsVsM = dynamic_cast<TH1D*>
8220 (intFlowResults->FindObject(Form("%s, %s",intFlowQcumulantsVsMName.Data(),cumulantFlag[co].Data())));
8221 if(intFlowQcumulantsVsM)
8223 this->SetIntFlowQcumulantsVsM(intFlowQcumulantsVsM,co);
8226 cout<<"WARNING: "<<Form("intFlowQcumulantsVsM[%d]",co)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8228 } // end of for(Int_t co=0;co<4;co++) // cumulant order
8229 } // end of if(fCalculateCumulantsVsM)
8230 // Final reference flow estimates from Q-cumulants:
8231 TString intFlowName = "fIntFlow";
8232 intFlowName += fAnalysisLabel->Data();
8233 TH1D *intFlow = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowName.Data()));
8236 this->SetIntFlow(intFlow);
8239 cout<<"WARNING: intFlow is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8241 // Final reference flow estimates from Q-cumulants vs M rebinned in M:
8242 if(fCalculateCumulantsVsM)
8244 TString intFlowRebinnedInMName = "fIntFlowRebinnedInM";
8245 intFlowRebinnedInMName += fAnalysisLabel->Data();
8246 TH1D *intFlowRebinnedInM = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowRebinnedInMName.Data()));
8247 if(intFlowRebinnedInM)
8249 this->SetIntFlowRebinnedInM(intFlowRebinnedInM);
8252 cout<<"WARNING: intFlowRebinnedInM is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8254 } // end of if(fCalculateCumulantsVsM)
8255 // integrated flow from Q-cumulants versus multiplicity:
8256 if(fCalculateCumulantsVsM)
8258 TString intFlowVsMName = "fIntFlowVsM";
8259 intFlowVsMName += fAnalysisLabel->Data();
8260 TString flowFlag[4] = {Form("v_{%d}{2,QC}",fHarmonic),Form("v_{%d}{4,QC}",fHarmonic),Form("v_{%d}{6,QC}",fHarmonic),Form("v_{%d}{8,QC}",fHarmonic)};
8261 for(Int_t co=0;co<4;co++) // cumulant order
8263 TH1D *intFlowVsM = dynamic_cast<TH1D*>
8264 (intFlowResults->FindObject(Form("%s, %s",intFlowVsMName.Data(),flowFlag[co].Data())));
8267 this->SetIntFlowVsM(intFlowVsM,co);
8270 cout<<"WARNING: "<<Form("intFlowVsM[%d]",co)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8272 } // end of for(Int_t co=0;co<4;co++) // cumulant order
8273 } // end of if(fCalculateCumulantsVsM)
8274 // quantifying detector effects effects to correlations:
8275 TString intFlowDetectorBiasName = "fIntFlowDetectorBias";
8276 intFlowDetectorBiasName += fAnalysisLabel->Data();
8277 TH1D *intFlowDetectorBias = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowDetectorBiasName.Data()));
8278 if(intFlowDetectorBias)
8280 this->SetIntFlowDetectorBias(intFlowDetectorBias);
8283 cout<<"WARNING: intFlowDetectorBias is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8285 // quantifying detector effects effects to correlations vs multiplicity:
8286 if(fCalculateCumulantsVsM)
8288 TString intFlowDetectorBiasVsMName = "fIntFlowDetectorBiasVsM";
8289 intFlowDetectorBiasVsMName += fAnalysisLabel->Data();
8290 for(Int_t ci=0;ci<4;ci++) // correlation index
8292 TH1D *intFlowDetectorBiasVsM = dynamic_cast<TH1D*>
8293 (intFlowResults->FindObject(Form("%s for %s",intFlowDetectorBiasVsMName.Data(),cumulantFlag[ci].Data())));
8294 if(intFlowDetectorBiasVsM)
8296 this->SetIntFlowDetectorBiasVsM(intFlowDetectorBiasVsM,ci);
8299 cout<<"WARNING: "<<Form("intFlowDetectorBiasVsM[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8301 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
8302 } // end of if(fCalculateCumulantsVsM)
8303 } else // to if(intFlowResults)
8305 cout<<"WARNING: intFlowResults is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8308 } // end of void AliFlowAnalysisWithQCumulants::GetPointersForIntFlowHistograms()
8310 //================================================================================================================================
8312 void AliFlowAnalysisWithQCumulants::GetPointersForDiffFlowHistograms()
8314 // Get pointer to all objects relevant for differential flow.
8315 // a) Define flags locally (to be improved: should I promote flags to data members?);
8316 // b) Get pointer to base list for differential flow fDiffFlowList and nested lists fDiffFlowListProfiles and fDiffFlowListResults;
8317 // c) Get pointer to profile fDiffFlowFlags holding all flags for differential flow;
8318 // d) Get pointers to all nested lists in fDiffFlowListProfiles and to profiles which they hold;
8319 // e) Get pointers to all nested lists in fDiffFlowListResults and to histograms which they hold.
8321 // a) Define flags locally (to be improved: should I promote flags to data members?):
8322 TString typeFlag[2] = {"RP","POI"};
8323 TString ptEtaFlag[2] = {"p_{T}","#eta"};
8324 TString powerFlag[2] = {"linear","quadratic"};
8325 TString sinCosFlag[2] = {"sin","cos"};
8326 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
8327 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
8328 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};
8329 TString reducedSquaredCorrelationIndex[4] = {"<2'>^{2}","<4'>^{2}","<6'>^{2}","<8'>^{2}"};
8330 TString mixedCorrelationIndex[8] = {"<2>","<2'>","<4>","<4'>","<6>","<6'>","<8>","<8'>"};
8331 TString covarianceName[5] = {"Cov(<2>,<2'>)","Cov(<2>,<4'>)","Cov(<4>,<2'>)","Cov(<4>,<4'>)","Cov(<2'>,<4'>)"};
8333 // b) Get pointer to base list for differential flow fDiffFlowList and nested lists fDiffFlowListProfiles and fDiffFlowListResults:
8334 TList *diffFlowList = NULL;
8335 diffFlowList = dynamic_cast<TList*>(fHistList->FindObject("Differential Flow"));
8338 cout<<"WARNING: diffFlowList is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8341 // list holding nested lists containing profiles:
8342 TList *diffFlowListProfiles = NULL;
8343 diffFlowListProfiles = dynamic_cast<TList*>(diffFlowList->FindObject("Profiles"));
8344 if(!diffFlowListProfiles)
8346 cout<<"WARNING: diffFlowListProfiles is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8349 // list holding nested lists containing 2D and 1D histograms with final results:
8350 TList *diffFlowListResults = NULL;
8351 diffFlowListResults = dynamic_cast<TList*>(diffFlowList->FindObject("Results"));
8352 if(!diffFlowListResults)
8354 cout<<"WARNING: diffFlowListResults is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8358 // c) Get pointer to profile holding all flags for differential flow;
8359 TString diffFlowFlagsName = "fDiffFlowFlags";
8360 diffFlowFlagsName += fAnalysisLabel->Data();
8361 TProfile *diffFlowFlags = dynamic_cast<TProfile*>(diffFlowList->FindObject(diffFlowFlagsName.Data()));
8362 Bool_t bCalculate2DFlow = kFALSE;
8365 this->SetDiffFlowFlags(diffFlowFlags);
8366 bCalculate2DFlow = (Int_t)diffFlowFlags->GetBinContent(4);
8367 this->SetCalculate2DFlow(bCalculate2DFlow); // to be improved (shoul I call this setter somewhere else?)
8370 // d) Get pointers to all nested lists in fDiffFlowListProfiles and to profiles which they hold;
8372 TList *diffFlowCorrelationsProList[2][2] = {{NULL}};
8373 TString diffFlowCorrelationsProName = "fDiffFlowCorrelationsPro";
8374 diffFlowCorrelationsProName += fAnalysisLabel->Data();
8375 TProfile *diffFlowCorrelationsPro[2][2][4] = {{{NULL}}};
8376 // squared correlations:
8377 TString diffFlowSquaredCorrelationsProName = "fDiffFlowSquaredCorrelationsPro";
8378 diffFlowSquaredCorrelationsProName += fAnalysisLabel->Data();
8379 TProfile *diffFlowSquaredCorrelationsPro[2][2][4] = {{{NULL}}};
8380 // products of correlations:
8381 TList *diffFlowProductOfCorrelationsProList[2][2] = {{NULL}};
8382 TString diffFlowProductOfCorrelationsProName = "fDiffFlowProductOfCorrelationsPro";
8383 diffFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
8384 TProfile *diffFlowProductOfCorrelationsPro[2][2][8][8] = {{{{NULL}}}};
8386 TList *diffFlowCorrectionsProList[2][2] = {{NULL}};
8387 TString diffFlowCorrectionTermsForNUAProName = "fDiffFlowCorrectionTermsForNUAPro";
8388 diffFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
8389 TProfile *diffFlowCorrectionTermsForNUAPro[2][2][2][10] = {{{{NULL}}}};
8390 for(Int_t t=0;t<2;t++)
8392 for(Int_t pe=0;pe<2;pe++)
8394 diffFlowCorrelationsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8395 if(!diffFlowCorrelationsProList[t][pe])
8397 cout<<"WARNING: diffFlowCorrelationsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8398 cout<<"t = "<<t<<endl;
8399 cout<<"pe = "<<pe<<endl;
8402 for(Int_t ci=0;ci<4;ci++) // correlation index
8404 // reduced correlations:
8405 diffFlowCorrelationsPro[t][pe][ci] = dynamic_cast<TProfile*>(diffFlowCorrelationsProList[t][pe]->FindObject(Form("%s, %s, %s, %s",diffFlowCorrelationsProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[ci].Data())));
8406 if(diffFlowCorrelationsPro[t][pe][ci])
8408 this->SetDiffFlowCorrelationsPro(diffFlowCorrelationsPro[t][pe][ci],t,pe,ci);
8411 cout<<"WARNING: diffFlowCorrelationsPro[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8412 cout<<"t = "<<t<<endl;
8413 cout<<"pe = "<<pe<<endl;
8414 cout<<"ci = "<<ci<<endl;
8416 // reduced squared correlations:
8417 diffFlowSquaredCorrelationsPro[t][pe][ci] = dynamic_cast<TProfile*>(diffFlowCorrelationsProList[t][pe]->FindObject(Form("%s, %s, %s, %s",diffFlowSquaredCorrelationsProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedSquaredCorrelationIndex[ci].Data())));
8418 if(diffFlowSquaredCorrelationsPro[t][pe][ci])
8420 this->SetDiffFlowSquaredCorrelationsPro(diffFlowSquaredCorrelationsPro[t][pe][ci],t,pe,ci);
8423 cout<<"WARNING: diffFlowSquaredCorrelationsPro[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8424 cout<<"t = "<<t<<endl;
8425 cout<<"pe = "<<pe<<endl;
8426 cout<<"ci = "<<ci<<endl;
8428 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
8429 // products of correlations:
8430 diffFlowProductOfCorrelationsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with products of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8431 if(!diffFlowProductOfCorrelationsProList[t][pe])
8433 cout<<"WARNING: ddiffFlowProductOfCorrelationsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8434 cout<<"t = "<<t<<endl;
8435 cout<<"pe = "<<pe<<endl;
8438 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8440 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8442 diffFlowProductOfCorrelationsPro[t][pe][mci1][mci2] = dynamic_cast<TProfile*>(diffFlowProductOfCorrelationsProList[t][pe]->FindObject(Form("%s, %s, %s, %s, %s",diffFlowProductOfCorrelationsProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),mixedCorrelationIndex[mci1].Data(),mixedCorrelationIndex[mci2].Data())));
8443 if(diffFlowProductOfCorrelationsPro[t][pe][mci1][mci2])
8445 this->SetDiffFlowProductOfCorrelationsPro(diffFlowProductOfCorrelationsPro[t][pe][mci1][mci2],t,pe,mci1,mci2);
8448 cout<<"WARNING: diffFlowProductOfCorrelationsPro[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8449 cout<<"t = "<<t<<endl;
8450 cout<<"pe = "<<pe<<endl;
8451 cout<<"mci1 = "<<mci1<<endl;
8452 cout<<"mci2 = "<<mci2<<endl;
8454 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
8455 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8456 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8458 diffFlowCorrectionsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8459 if(!diffFlowCorrectionsProList[t][pe])
8461 cout<<"WARNING: diffFlowCorrectionsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8462 cout<<"t = "<<t<<endl;
8463 cout<<"pe = "<<pe<<endl;
8466 // correction terms for NUA:
8467 for(Int_t sc=0;sc<2;sc++) // sin or cos
8469 for(Int_t cti=0;cti<9;cti++) // correction term index
8471 diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti] = dynamic_cast<TProfile*>(diffFlowCorrectionsProList[t][pe]->FindObject(Form("%s, %s, %s, %s, cti = %d",diffFlowCorrectionTermsForNUAProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),cti+1)));
8472 if(diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti])
8474 this->SetDiffFlowCorrectionTermsForNUAPro(diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti],t,pe,sc,cti);
8477 cout<<"WARNING: diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8478 cout<<"t = "<<t<<endl;
8479 cout<<"pe = "<<pe<<endl;
8480 cout<<"sc = "<<sc<<endl;
8481 cout<<"cti = "<<cti<<endl;
8483 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index
8484 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
8486 } // end of for(Int_t pe=0;pe<2;pe++)
8487 } // end of for(Int_t t=0;t<2;t++)
8489 // e) Get pointers to all nested lists in fDiffFlowListResults and to histograms which they hold.
8490 // reduced correlations:
8491 TList *diffFlowCorrelationsHistList[2][2] = {{NULL}};
8492 TString diffFlowCorrelationsHistName = "fDiffFlowCorrelationsHist";
8493 diffFlowCorrelationsHistName += fAnalysisLabel->Data();
8494 TH1D *diffFlowCorrelationsHist[2][2][4] = {{{NULL}}};
8495 // corrections for NUA:
8496 TList *diffFlowCorrectionsHistList[2][2] = {{NULL}};
8497 TString diffFlowCorrectionTermsForNUAHistName = "fDiffFlowCorrectionTermsForNUAHist";
8498 diffFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
8499 TH1D *diffFlowCorrectionTermsForNUAHist[2][2][2][10] = {{{{NULL}}}};
8500 // differential Q-cumulants:
8501 TList *diffFlowCumulantsHistList[2][2] = {{NULL}};
8502 TString diffFlowCumulantsName = "fDiffFlowCumulants";
8503 diffFlowCumulantsName += fAnalysisLabel->Data();
8504 TH1D *diffFlowCumulants[2][2][4] = {{{NULL}}};
8505 // differential flow estimates from Q-cumulants:
8506 TList *diffFlowHistList[2][2] = {{NULL}};
8507 TString diffFlowName = "fDiffFlow";
8508 diffFlowName += fAnalysisLabel->Data();
8509 TH1D *diffFlow[2][2][4] = {{{NULL}}};
8510 // differential covariances:
8511 TList *diffFlowCovariancesHistList[2][2] = {{NULL}};
8512 TString diffFlowCovariancesName = "fDiffFlowCovariances";
8513 diffFlowCovariancesName += fAnalysisLabel->Data();
8514 TH1D *diffFlowCovariances[2][2][5] = {{{NULL}}};
8515 for(Int_t t=0;t<2;t++) // type: RP or POI
8517 for(Int_t pe=0;pe<2;pe++) // pt or eta
8519 // reduced correlations:
8520 diffFlowCorrelationsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8521 if(!diffFlowCorrelationsHistList[t][pe])
8523 cout<<"WARNING: diffFlowCorrelationsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8524 cout<<"t = "<<t<<endl;
8525 cout<<"pe = "<<pe<<endl;
8528 for(Int_t index=0;index<4;index++)
8530 diffFlowCorrelationsHist[t][pe][index] = dynamic_cast<TH1D*>(diffFlowCorrelationsHistList[t][pe]->FindObject(Form("%s, %s, %s, %s",diffFlowCorrelationsHistName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[index].Data())));
8531 if(diffFlowCorrelationsHist[t][pe][index])
8533 this->SetDiffFlowCorrelationsHist(diffFlowCorrelationsHist[t][pe][index],t,pe,index);
8536 cout<<"WARNING: diffFlowCorrelationsHist[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8537 cout<<"t = "<<t<<endl;
8538 cout<<"pe = "<<pe<<endl;
8539 cout<<"index = "<<index<<endl;
8542 } // end of for(Int_t index=0;index<4;index++)
8544 diffFlowCorrectionsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Histograms with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8545 if(!diffFlowCorrectionsHistList[t][pe])
8547 cout<<"WARNING: diffFlowCorrectionsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8548 cout<<"t = "<<t<<endl;
8549 cout<<"pe = "<<pe<<endl;
8552 // correction terms for NUA:
8553 for(Int_t sc=0;sc<2;sc++) // sin or cos
8555 for(Int_t cti=0;cti<9;cti++) // correction term index
8557 diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti] = dynamic_cast<TH1D*>(diffFlowCorrectionsHistList[t][pe]->FindObject(Form("%s, %s, %s, %s, cti = %d",diffFlowCorrectionTermsForNUAHistName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),cti+1)));
8558 if(diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti])
8560 this->SetDiffFlowCorrectionTermsForNUAHist(diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti],t,pe,sc,cti);
8563 cout<<"WARNING: diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8564 cout<<"t = "<<t<<endl;
8565 cout<<"pe = "<<pe<<endl;
8566 cout<<"sc = "<<sc<<endl;
8567 cout<<"cti = "<<cti<<endl;
8569 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index
8570 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
8572 // differential Q-cumulants:
8573 diffFlowCumulantsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Differential Q-cumulants (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8574 if(!diffFlowCumulantsHistList[t][pe])
8576 cout<<"WARNING: diffFlowCumulantsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8577 cout<<"t = "<<t<<endl;
8578 cout<<"pe = "<<pe<<endl;
8581 for(Int_t index=0;index<4;index++)
8583 diffFlowCumulants[t][pe][index] = dynamic_cast<TH1D*>(diffFlowCumulantsHistList[t][pe]->FindObject(Form("%s, %s, %s, %s",diffFlowCumulantsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),differentialCumulantIndex[index].Data())));
8584 if(diffFlowCumulants[t][pe][index])
8586 this->SetDiffFlowCumulants(diffFlowCumulants[t][pe][index],t,pe,index);
8589 cout<<"WARNING: diffFlowCumulants[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8590 cout<<"t = "<<t<<endl;
8591 cout<<"pe = "<<pe<<endl;
8592 cout<<"index = "<<index<<endl;
8595 } // end of for(Int_t index=0;index<4;index++)
8596 // differential flow estimates from Q-cumulants:
8597 diffFlowHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Differential flow (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8598 if(!diffFlowHistList[t][pe])
8600 cout<<"WARNING: diffFlowHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8601 cout<<"t = "<<t<<endl;
8602 cout<<"pe = "<<pe<<endl;
8605 for(Int_t index=0;index<4;index++)
8607 diffFlow[t][pe][index] = dynamic_cast<TH1D*>(diffFlowHistList[t][pe]->FindObject(Form("%s, %s, %s, %s",diffFlowName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),differentialFlowIndex[index].Data())));
8608 if(diffFlow[t][pe][index])
8610 this->SetDiffFlow(diffFlow[t][pe][index],t,pe,index);
8613 cout<<"WARNING: diffFlow[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8614 cout<<"t = "<<t<<endl;
8615 cout<<"pe = "<<pe<<endl;
8616 cout<<"index = "<<index<<endl;
8619 } // end of for(Int_t index=0;index<4;index++)
8620 // differential covariances:
8621 diffFlowCovariancesHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Covariances of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8622 if(!diffFlowCovariancesHistList[t][pe])
8624 cout<<"WARNING: diffFlowCovariancesHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8625 cout<<"t = "<<t<<endl;
8626 cout<<"pe = "<<pe<<endl;
8629 for(Int_t covIndex=0;covIndex<5;covIndex++)
8631 diffFlowCovariances[t][pe][covIndex] = dynamic_cast<TH1D*>(diffFlowCovariancesHistList[t][pe]->FindObject(Form("%s, %s, %s, %s",diffFlowCovariancesName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),covarianceName[covIndex].Data())));
8632 if(diffFlowCovariances[t][pe][covIndex])
8634 this->SetDiffFlowCovariances(diffFlowCovariances[t][pe][covIndex],t,pe,covIndex);
8637 cout<<"WARNING: diffFlowCovariances[t][pe][covIndex] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8638 cout<<"t = "<<t<<endl;
8639 cout<<"pe = "<<pe<<endl;
8640 cout<<"covIndex = "<<covIndex<<endl;
8643 } // end of for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index
8644 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8645 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8646 // sum of event weights for reduced correlations:
8647 TList *diffFlowSumOfEventWeightsHistList[2][2][2] = {{{NULL}}};
8648 TString diffFlowSumOfEventWeightsName = "fDiffFlowSumOfEventWeights";
8649 diffFlowSumOfEventWeightsName += fAnalysisLabel->Data();
8650 TH1D *diffFlowSumOfEventWeights[2][2][2][4] = {{{{NULL}}}};
8651 for(Int_t t=0;t<2;t++) // type is RP or POI
8653 for(Int_t pe=0;pe<2;pe++) // pt or eta
8655 for(Int_t p=0;p<2;p++) // power of event weights is either 1 or 2
8657 diffFlowSumOfEventWeightsHistList[t][pe][p] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Sum of %s event weights (%s, %s)",powerFlag[p].Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8658 if(!diffFlowSumOfEventWeightsHistList[t][pe][p])
8660 cout<<"WARNING: diffFlowSumOfEventWeightsHistList[t][pe][p] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8661 cout<<"t = "<<t<<endl;
8662 cout<<"pe = "<<pe<<endl;
8663 cout<<"power = "<<p<<endl;
8666 for(Int_t ew=0;ew<4;ew++) // index of reduced correlation
8668 diffFlowSumOfEventWeights[t][pe][p][ew] = dynamic_cast<TH1D*>(diffFlowSumOfEventWeightsHistList[t][pe][p]->FindObject(Form("%s, %s, %s, %s, %s",diffFlowSumOfEventWeightsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),powerFlag[p].Data(),reducedCorrelationIndex[ew].Data())));
8669 if(diffFlowSumOfEventWeights[t][pe][p][ew])
8671 this->SetDiffFlowSumOfEventWeights(diffFlowSumOfEventWeights[t][pe][p][ew],t,pe,p,ew);
8674 cout<<"WARNING: diffFlowSumOfEventWeights[t][pe][p][ew] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8675 cout<<"t = "<<t<<endl;
8676 cout<<"pe = "<<pe<<endl;
8677 cout<<"power = "<<p<<endl;
8678 cout<<"ew = "<<ew<<endl;
8682 } // end of for(Int_t p=0;p<2;p++) // power of event weights is either 1 or 2
8683 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8684 } // end of for(Int_t t=0;t<2;t++) // type is RP or POI
8686 TList *diffFlowSumOfProductOfEventWeightsHistList[2][2] = {{NULL}};
8687 TString diffFlowSumOfProductOfEventWeightsName = "fDiffFlowSumOfProductOfEventWeights";
8688 diffFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
8689 TH1D *diffFlowSumOfProductOfEventWeights[2][2][8][8] = {{{{NULL}}}};
8690 for(Int_t t=0;t<2;t++) // type is RP or POI
8692 for(Int_t pe=0;pe<2;pe++) // pt or eta
8694 diffFlowSumOfProductOfEventWeightsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Sum of products of event weights (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8695 if(!diffFlowSumOfProductOfEventWeightsHistList[t][pe])
8697 cout<<"WARNING: diffFlowSumOfProductOfEventWeightsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8698 cout<<"t = "<<t<<endl;
8699 cout<<"pe = "<<pe<<endl;
8702 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8704 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8706 diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2] = dynamic_cast<TH1D*>(diffFlowSumOfProductOfEventWeightsHistList[t][pe]->FindObject(Form("%s, %s, %s, %s, %s",diffFlowSumOfProductOfEventWeightsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),mixedCorrelationIndex[mci1].Data(),mixedCorrelationIndex[mci2].Data())));
8707 if(diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2])
8709 this->SetDiffFlowSumOfProductOfEventWeights(diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2],t,pe,mci1,mci2);
8712 cout<<"WARNING: diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8713 cout<<"t = "<<t<<endl;
8714 cout<<"pe = "<<pe<<endl;
8715 cout<<"mci1 = "<<mci1<<endl;
8716 cout<<"mci2 = "<<mci2<<endl;
8719 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
8720 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8721 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8722 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8723 } // end of for(Int_t t=0;t<2;t++) // type is RP or POI
8725 } // end void AliFlowAnalysisWithQCumulants::GetPointersForDiffFlowHistograms()
8728 //================================================================================================================================
8731 void AliFlowAnalysisWithQCumulants::BookEverythingForDifferentialFlow()
8733 // Book all histograms and profiles needed for differential flow.
8734 // a) Define flags locally (to be improved: should I promote flags to data members?);
8735 // b) Book profile to hold all flags for differential flow;
8736 // c) Book e-b-e quantities;
8737 // d) Book profiles;
8738 // e) Book histograms holding final results.
8740 // a) Define flags locally (to be improved: should I promote flags to data members?):
8741 TString typeFlag[2] = {"RP","POI"};
8742 TString ptEtaFlag[2] = {"p_{T}","#eta"};
8743 TString powerFlag[2] = {"linear","quadratic"};
8744 TString sinCosFlag[2] = {"sin","cos"};
8745 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
8746 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
8747 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};
8748 TString reducedSquaredCorrelationIndex[4] = {"<2'>^{2}","<4'>^{2}","<6'>^{2}","<8'>^{2}"};
8749 TString mixedCorrelationIndex[8] = {"<2>","<2'>","<4>","<4'>","<6>","<6'>","<8>","<8'>"};
8750 TString covarianceName[5] = {"Cov(<2>,<2'>)","Cov(<2>,<4'>)","Cov(<4>,<2'>)","Cov(<4>,<4'>)","Cov(<2'>,<4'>)"};
8751 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
8752 Double_t minPtEta[2] = {fPtMin,fEtaMin};
8753 Double_t maxPtEta[2] = {fPtMax,fEtaMax};
8755 // b) Book profile to hold all flags for differential flow:
8756 TString diffFlowFlagsName = "fDiffFlowFlags";
8757 diffFlowFlagsName += fAnalysisLabel->Data();
8758 fDiffFlowFlags = new TProfile(diffFlowFlagsName.Data(),"Flags for Differential Flow",4,0,4);
8759 fDiffFlowFlags->SetTickLength(-0.01,"Y");
8760 fDiffFlowFlags->SetMarkerStyle(25);
8761 fDiffFlowFlags->SetLabelSize(0.05);
8762 fDiffFlowFlags->SetLabelOffset(0.02,"Y");
8763 (fDiffFlowFlags->GetXaxis())->SetBinLabel(1,"Particle Weights");
8764 (fDiffFlowFlags->GetXaxis())->SetBinLabel(2,"Event Weights");
8765 (fDiffFlowFlags->GetXaxis())->SetBinLabel(3,"Corrected for NUA?");
8766 (fDiffFlowFlags->GetXaxis())->SetBinLabel(4,"Calculated 2D flow?");
8767 fDiffFlowList->Add(fDiffFlowFlags);
8769 // c) Book e-b-e quantities:
8770 // Event-by-event r_{m*n,k}(pt,eta), p_{m*n,k}(pt,eta) and q_{m*n,k}(pt,eta)
8771 // Explanantion of notation:
8772 // 1.) n is harmonic, m is multiple of harmonic;
8773 // 2.) k is power of particle weight;
8774 // 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);
8775 // 4.) p_{m*n,k}(pt,eta) = Q-vector evaluated in harmonic m*n for POIs in particular (pt,eta) bin
8776 // (if i-th POI is also RP, than it is weighted with w_i^k);
8777 // 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
8778 // (i-th RP&&POI is weighted with w_i^k)
8781 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP && POI )
8783 for(Int_t pe=0;pe<2;pe++) // pt or eta
8785 for(Int_t m=0;m<4;m++) // multiple of harmonic
8787 for(Int_t k=0;k<9;k++) // power of particle weight
8789 fReRPQ1dEBE[t][pe][m][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%dpower%dRe",t,pe,m,k),
8790 Form("TypeFlag%dpteta%dmultiple%dpower%dRe",t,pe,m,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8791 fImRPQ1dEBE[t][pe][m][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%dpower%dIm",t,pe,m,k),
8792 Form("TypeFlag%dpteta%dmultiple%dpower%dIm",t,pe,m,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8797 // to be improved (add explanation of fs1dEBE[t][pe][k]):
8798 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
8800 for(Int_t pe=0;pe<2;pe++) // pt or eta
8802 for(Int_t k=0;k<9;k++) // power of particle weight
8804 fs1dEBE[t][pe][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%d",t,pe,k),
8805 Form("TypeFlag%dpteta%dmultiple%d",t,pe,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8809 // correction terms for nua:
8810 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
8812 for(Int_t pe=0;pe<2;pe++) // pt or eta
8814 for(Int_t sc=0;sc<2;sc++) // sin or cos
8816 for(Int_t cti=0;cti<9;cti++) // correction term index
8818 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti] = new TH1D(Form("typeFlag%d pteta%d sincos%d cti%d",t,pe,sc,cti),
8819 Form("typeFlag%d pteta%d sincos%d cti%d",t,pe,sc,cti),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8825 if(fCalculate2DFlow)
8827 TProfile2D styleRe("typeMultiplePowerRe","typeMultiplePowerRe",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
8828 TProfile2D styleIm("typeMultiplePowerIm","typeMultiplePowerIm",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
8829 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
8831 for(Int_t m=0;m<4;m++)
8833 for(Int_t k=0;k<9;k++)
8835 fReRPQ2dEBE[t][m][k] = (TProfile2D*)styleRe.Clone(Form("typeFlag%dmultiple%dpower%dRe",t,m,k));
8836 fImRPQ2dEBE[t][m][k] = (TProfile2D*)styleIm.Clone(Form("typeFlag%dmultiple%dpower%dIm",t,m,k));
8840 TProfile2D styleS("typePower","typePower",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
8841 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
8843 for(Int_t k=0;k<9;k++)
8845 fs2dEBE[t][k] = (TProfile2D*)styleS.Clone(Form("typeFlag%dpower%d",t,k));
8848 } // end of if(fCalculate2DFlow)
8849 // reduced correlations e-b-e:
8850 TString diffFlowCorrelationsEBEName = "fDiffFlowCorrelationsEBE";
8851 diffFlowCorrelationsEBEName += fAnalysisLabel->Data();
8852 for(Int_t t=0;t<2;t++) // type: RP or POI
8854 for(Int_t pe=0;pe<2;pe++) // pt or eta
8856 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8858 fDiffFlowCorrelationsEBE[t][pe][rci] = new TH1D(Form("%s, %s, %s, %s",diffFlowCorrelationsEBEName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[rci].Data()),Form("%s, %s, %s, %s",diffFlowCorrelationsEBEName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[rci].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8859 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
8860 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8861 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8862 // event weights for reduced correlations e-b-e:
8863 TString diffFlowEventWeightsForCorrelationsEBEName = "fDiffFlowEventWeightsForCorrelationsEBE";
8864 diffFlowEventWeightsForCorrelationsEBEName += fAnalysisLabel->Data();
8865 for(Int_t t=0;t<2;t++) // type: RP or POI
8867 for(Int_t pe=0;pe<2;pe++) // pt or eta
8869 for(Int_t rci=0;rci<4;rci++) // event weight for reduced correlation index
8871 fDiffFlowEventWeightsForCorrelationsEBE[t][pe][rci] = new TH1D(Form("%s, %s, %s, eW for %s",diffFlowEventWeightsForCorrelationsEBEName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[rci].Data()),Form("%s, %s, %s, eW for %s",diffFlowEventWeightsForCorrelationsEBEName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[rci].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8872 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
8873 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8874 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8876 // d) Book profiles;
8877 // reduced correlations:
8878 TString diffFlowCorrelationsProName = "fDiffFlowCorrelationsPro";
8879 diffFlowCorrelationsProName += fAnalysisLabel->Data();
8880 // reduced squared correlations:
8881 TString diffFlowSquaredCorrelationsProName = "fDiffFlowSquaredCorrelationsPro";
8882 diffFlowSquaredCorrelationsProName += fAnalysisLabel->Data();
8883 // corrections terms:
8884 TString diffFlowCorrectionTermsForNUAProName = "fDiffFlowCorrectionTermsForNUAPro";
8885 diffFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
8886 // reduced correlations:
8887 for(Int_t t=0;t<2;t++) // type: RP or POI
8889 for(Int_t pe=0;pe<2;pe++) // pt or eta
8891 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8893 fDiffFlowCorrelationsPro[t][pe][rci] = new TProfile(Form("%s, %s, %s, %s",diffFlowCorrelationsProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[rci].Data()),Form("%s, %s, %s, %s",diffFlowCorrelationsProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[rci].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe],"s");
8894 fDiffFlowCorrelationsPro[t][pe][rci]->Sumw2();
8895 fDiffFlowCorrelationsPro[t][pe][rci]->SetXTitle(ptEtaFlag[pe].Data());
8896 fDiffFlowCorrelationsProList[t][pe]->Add(fDiffFlowCorrelationsPro[t][pe][rci]); // to be improved (add dedicated list to hold reduced correlations)
8897 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
8898 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8899 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8900 // reduced squared correlations:
8901 for(Int_t t=0;t<2;t++) // type: RP or POI
8903 for(Int_t pe=0;pe<2;pe++) // pt or eta
8905 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8907 fDiffFlowSquaredCorrelationsPro[t][pe][rci] = new TProfile(Form("%s, %s, %s, %s",diffFlowSquaredCorrelationsProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedSquaredCorrelationIndex[rci].Data()),Form("%s, %s, %s, %s",diffFlowSquaredCorrelationsProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedSquaredCorrelationIndex[rci].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe],"s");
8908 fDiffFlowSquaredCorrelationsPro[t][pe][rci]->Sumw2();
8909 fDiffFlowSquaredCorrelationsPro[t][pe][rci]->SetXTitle(ptEtaFlag[pe].Data());
8910 fDiffFlowCorrelationsProList[t][pe]->Add(fDiffFlowSquaredCorrelationsPro[t][pe][rci]); // to be improved (add dedicated list to hold reduced correlations)
8911 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
8912 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8913 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8914 // correction terms for nua:
8915 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
8917 for(Int_t pe=0;pe<2;pe++) // pt or eta
8919 for(Int_t sc=0;sc<2;sc++) // sin or cos
8921 for(Int_t cti=0;cti<9;cti++) // correction term index
8923 fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti] = new TProfile(Form("%s, %s, %s, %s, cti = %d",diffFlowCorrectionTermsForNUAProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),cti+1),Form("%s, %s, %s, %s, cti = %d",diffFlowCorrectionTermsForNUAProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),cti+1),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8924 fDiffFlowCorrectionsProList[t][pe]->Add(fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]);
8929 // e) Book histograms holding final results.
8930 // reduced correlations:
8931 TString diffFlowCorrelationsHistName = "fDiffFlowCorrelationsHist";
8932 diffFlowCorrelationsHistName += fAnalysisLabel->Data();
8933 // corrections terms:
8934 TString diffFlowCorrectionTermsForNUAHistName = "fDiffFlowCorrectionTermsForNUAHist";
8935 diffFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
8936 // differential covariances:
8937 TString diffFlowCovariancesName = "fDiffFlowCovariances";
8938 diffFlowCovariancesName += fAnalysisLabel->Data();
8939 // differential Q-cumulants:
8940 TString diffFlowCumulantsName = "fDiffFlowCumulants";
8941 diffFlowCumulantsName += fAnalysisLabel->Data();
8942 // differential flow:
8943 TString diffFlowName = "fDiffFlow";
8944 diffFlowName += fAnalysisLabel->Data();
8945 for(Int_t t=0;t<2;t++) // type: RP or POI
8947 for(Int_t pe=0;pe<2;pe++) // pt or eta
8949 for(Int_t index=0;index<4;index++)
8951 // reduced correlations:
8952 fDiffFlowCorrelationsHist[t][pe][index] = new TH1D(Form("%s, %s, %s, %s",diffFlowCorrelationsHistName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[index].Data()),Form("%s, %s, %s, %s",diffFlowCorrelationsHistName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[index].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8953 fDiffFlowCorrelationsHist[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
8954 fDiffFlowCorrelationsHistList[t][pe]->Add(fDiffFlowCorrelationsHist[t][pe][index]);
8955 // differential Q-cumulants:
8956 fDiffFlowCumulants[t][pe][index] = new TH1D(Form("%s, %s, %s, %s",diffFlowCumulantsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),differentialCumulantIndex[index].Data()),Form("%s, %s, %s, %s",diffFlowCumulantsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),differentialCumulantIndex[index].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8957 fDiffFlowCumulants[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
8958 fDiffFlowCumulantsHistList[t][pe]->Add(fDiffFlowCumulants[t][pe][index]);
8959 // differential flow estimates from Q-cumulants:
8960 fDiffFlow[t][pe][index] = new TH1D(Form("%s, %s, %s, %s",diffFlowName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),differentialFlowIndex[index].Data()),Form("%s, %s, %s, %s",diffFlowName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),differentialFlowIndex[index].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8961 fDiffFlow[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
8962 fDiffFlowHistList[t][pe]->Add(fDiffFlow[t][pe][index]);
8963 } // end of for(Int_t index=0;index<4;index++)
8964 for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index
8966 // differential covariances:
8967 fDiffFlowCovariances[t][pe][covIndex] = new TH1D(Form("%s, %s, %s, %s",diffFlowCovariancesName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),covarianceName[covIndex].Data()),Form("%s, %s, %s, %s",diffFlowCovariancesName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),covarianceName[covIndex].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8968 fDiffFlowCovariances[t][pe][covIndex]->SetXTitle(ptEtaFlag[pe].Data());
8969 fDiffFlowCovariancesHistList[t][pe]->Add(fDiffFlowCovariances[t][pe][covIndex]);
8970 } // end of for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index
8971 // products of both types of correlations:
8972 TString diffFlowProductOfCorrelationsProName = "fDiffFlowProductOfCorrelationsPro";
8973 diffFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
8974 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8976 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8978 fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2] = new TProfile(Form("%s, %s, %s, %s, %s",diffFlowProductOfCorrelationsProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),mixedCorrelationIndex[mci1].Data(),mixedCorrelationIndex[mci2].Data()),Form("%s, %s, %s, %s #times %s",diffFlowProductOfCorrelationsProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),mixedCorrelationIndex[mci1].Data(),mixedCorrelationIndex[mci2].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8979 fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2]->SetXTitle(ptEtaFlag[pe].Data());
8980 fDiffFlowProductOfCorrelationsProList[t][pe]->Add(fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2]);
8981 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
8982 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8983 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8984 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8985 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8986 // sums of event weights for reduced correlations:
8987 TString diffFlowSumOfEventWeightsName = "fDiffFlowSumOfEventWeights";
8988 diffFlowSumOfEventWeightsName += fAnalysisLabel->Data();
8989 for(Int_t t=0;t<2;t++) // type is RP or POI
8991 for(Int_t pe=0;pe<2;pe++) // pt or eta
8993 for(Int_t p=0;p<2;p++) // power of weights is either 1 or 2
8995 for(Int_t ew=0;ew<4;ew++) // index of reduced correlation
8997 fDiffFlowSumOfEventWeights[t][pe][p][ew] = new TH1D(Form("%s, %s, %s, %s, %s",diffFlowSumOfEventWeightsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),powerFlag[p].Data(),reducedCorrelationIndex[ew].Data()),Form("%s, %s, %s, power = %s, %s",diffFlowSumOfEventWeightsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),powerFlag[p].Data(),reducedCorrelationIndex[ew].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8998 fDiffFlowSumOfEventWeights[t][pe][p][ew]->SetXTitle(ptEtaFlag[pe].Data());
8999 fDiffFlowSumOfEventWeightsHistList[t][pe][p]->Add(fDiffFlowSumOfEventWeights[t][pe][p][ew]); // to be improved (add dedicated list to hold all this)
9004 // sum of products of event weights for both types of correlations:
9005 TString diffFlowSumOfProductOfEventWeightsName = "fDiffFlowSumOfProductOfEventWeights";
9006 diffFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
9007 for(Int_t t=0;t<2;t++) // type is RP or POI
9009 for(Int_t pe=0;pe<2;pe++) // pt or eta
9011 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
9013 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
9015 fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2] = new TH1D(Form("%s, %s, %s, %s, %s",diffFlowSumOfProductOfEventWeightsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),mixedCorrelationIndex[mci1].Data(),mixedCorrelationIndex[mci2].Data()),Form("%s, %s, %s, %s #times %s",diffFlowSumOfProductOfEventWeightsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),mixedCorrelationIndex[mci1].Data(),mixedCorrelationIndex[mci2].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
9016 fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2]->SetXTitle(ptEtaFlag[pe].Data());
9017 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]->Add(fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2]);
9018 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
9023 // correction terms for nua:
9024 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
9026 for(Int_t pe=0;pe<2;pe++) // pt or eta
9028 for(Int_t sc=0;sc<2;sc++) // sin or cos
9030 for(Int_t cti=0;cti<9;cti++) // correction term index
9032 fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti] = new TH1D(Form("%s, %s, %s, %s, cti = %d",diffFlowCorrectionTermsForNUAHistName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),cti+1),Form("%s, %s, %s, %s, cti = %d",diffFlowCorrectionTermsForNUAHistName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),cti+1),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
9033 fDiffFlowCorrectionsHistList[t][pe]->Add(fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti]);
9039 } // end of AliFlowAnalysisWithQCumulants::BookEverythingForDifferentialFlow()
9041 //================================================================================================================================
9043 void AliFlowAnalysisWithQCumulants::CalculateQcumulantsCorrectedForNUAIntFlow()
9045 // Calculate generalized Q-cumulants (cumulants corrected for non-unifom acceptance).
9047 // Isotropic cumulants:
9048 Double_t QC2 = fIntFlowQcumulants->GetBinContent(1);
9049 Double_t QC2Error = fIntFlowQcumulants->GetBinError(1);
9050 Double_t QC4 = fIntFlowQcumulants->GetBinContent(2);
9051 Double_t QC4Error = fIntFlowQcumulants->GetBinError(2);
9052 //Double_t QC6 = fIntFlowQcumulants->GetBinContent(3);
9053 //Double_t QC6Error = fIntFlowQcumulants->GetBinError(3);
9054 //Double_t QC8 = fIntFlowQcumulants->GetBinContent(4);
9055 //Double_t QC8Error = fIntFlowQcumulants->GetBinError(4);
9057 // Measured 2-, 4-, 6- and 8-particle correlations:
9058 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
9059 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <<2>>
9060 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
9061 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <<4>>
9062 //Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
9063 //Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <<6>>
9064 //Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
9065 //Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <<8>>
9067 // Non-isotropic terms:
9068 Double_t c1 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1); // <<cos(n*phi1)>>
9069 Double_t c1Error = fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(1); // statistical error of <<cos(n*phi1)>>
9070 Double_t c2 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2); // <<cos(n*(phi1+phi2))>>
9071 Double_t c2Error = fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(2); // statistical error of <<cos(n*(phi1+phi2))>>
9072 Double_t c3 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(3); // <<cos(n*(phi1-phi2-phi3))>>
9073 Double_t c3Error = fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(3); // statistical error of <<cos(n*(phi1-phi2-phi3))>>
9074 Double_t s1 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1); // <<sin(n*phi1)>>
9075 Double_t s1Error = fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(1); // statistical error of <<sin(n*phi1)>>
9076 Double_t s2 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2); // <<sin(n*(phi1+phi2))>>
9077 Double_t s2Error = fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(2); // statistical error of <<sin(n*(phi1+phi2))>>
9078 Double_t s3 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(3); // <<sin(n*(phi1-phi2-phi3))>>
9079 Double_t s3Error = fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(3); // statistical error of <<sin(n*(phi1-phi2-phi3))>>
9082 Double_t a1 = 2.*pow(c1,2.)+2.*pow(s1,2.)-two;
9083 Double_t a2 = 6.*pow(c1,3.)-2.*c1*c2+c3+6.*c1*pow(s1,2.)-2.*s1*s2-4.*c1*two;
9084 Double_t a3 = 2.*pow(s1,2.)-2.*pow(c1,2.)+c2;
9085 Double_t a4 = 6.*pow(s1,3.)+6.*pow(c1,2.)*s1+2.*c2*s1-2.*c1*s2-s3-4.*s1*two;
9086 Double_t a5 = 4.*c1*s1-s2;
9088 // Covariances (including weight dependent prefactor):
9089 Double_t wCov1 = 0.; // w*Cov(<2>,<cos(phi))
9090 Double_t wCov2 = 0.; // w*Cov(<2>,<sin(phi))
9091 Double_t wCov3 = 0.; // w*Cov(<cos(phi),<sin(phi))
9092 Double_t wCov4 = 0.; // w*Cov(<2>,<4>)
9093 Double_t wCov5 = 0.; // w*Cov(<2>,<cos(#phi_{1}+#phi_{2})>)
9094 Double_t wCov6 = 0.; // w*Cov(<2>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9095 Double_t wCov7 = 0.; // w*Cov(<2>,<sin(#phi_{1}+#phi_{2})>)
9096 Double_t wCov8 = 0.; // w*Cov(<2>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9097 Double_t wCov9 = 0.; // w*Cov(<4>,<cos(#phi)>
9098 Double_t wCov10 = 0.; // w*Cov(<4>,<cos(#phi_{1}+#phi_{2})>)
9099 Double_t wCov11 = 0.; // w*Cov(<4>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9100 Double_t wCov12 = 0.; // w*Cov(<4>,<sin(#phi)>
9101 Double_t wCov13 = 0.; // w*Cov(<4>,<sin(#phi_{1}+#phi_{2})>)
9102 Double_t wCov14 = 0.; // w*Cov(<4>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9103 Double_t wCov15 = 0.; // w*Cov(<cos(#phi)>,<cos(#phi_{1}+#phi_{2})>)
9104 Double_t wCov16 = 0.; // w*Cov(<cos(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9105 Double_t wCov17 = 0.; // w*Cov(<cos(#phi)>,<sin(#phi_{1}+#phi_{2})>)
9106 Double_t wCov18 = 0.; // w*Cov(<cos(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9107 Double_t wCov19 = 0.; // w*Cov(<cos(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9108 Double_t wCov20 = 0.; // w*Cov(<sin(#phi)>,<cos(#phi_{1}+#phi_{2})>)
9109 Double_t wCov21 = 0.; // w*Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}+#phi_{2})>)
9110 Double_t wCov22 = 0.; // w*Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9111 Double_t wCov23 = 0.; // w*Cov(<sin(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9112 Double_t wCov24 = 0.; // w*Cov(<sin(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9113 Double_t wCov25 = 0.; // w*Cov(<cos(#phi_{1}-#phi_{2}-#phi_{3}>,<sin(#phi_{1}-#phi_{2}-#phi_{3}>)
9114 Double_t wCov26 = 0.; // w*Cov(<sin(#phi)>,<sin(#phi_{1}+#phi_{2})>)
9115 Double_t wCov27 = 0.; // w*Cov(<sin(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9116 Double_t wCov28 = 0.; // w*Cov(<sin(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9117 if(!fForgetAboutCovariances)
9119 wCov1 = fIntFlowCovariancesNUA->GetBinContent(1); // w*Cov(<2>,<cos(phi))
9120 wCov2 = fIntFlowCovariancesNUA->GetBinContent(2); // w*Cov(<2>,<sin(phi))
9121 wCov3 = fIntFlowCovariancesNUA->GetBinContent(3); // w*Cov(<cos(phi),<sin(phi))
9122 wCov4 = fIntFlowCovariances->GetBinContent(1); // w*Cov(<2>,<4>)
9123 wCov5 = fIntFlowCovariancesNUA->GetBinContent(4); // w*Cov(<2>,<cos(#phi_{1}+#phi_{2})>)
9124 wCov6 = fIntFlowCovariancesNUA->GetBinContent(6); // w*Cov(<2>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9125 wCov7 = fIntFlowCovariancesNUA->GetBinContent(5); // w*Cov(<2>,<sin(#phi_{1}+#phi_{2})>)
9126 wCov8 = fIntFlowCovariancesNUA->GetBinContent(7); // w*Cov(<2>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9127 wCov9 = fIntFlowCovariancesNUA->GetBinContent(8); // w*Cov(<4>,<cos(#phi)>
9128 wCov10 = fIntFlowCovariancesNUA->GetBinContent(10); // w*Cov(<4>,<cos(#phi_{1}+#phi_{2})>)
9129 wCov11 = fIntFlowCovariancesNUA->GetBinContent(12); // w*Cov(<4>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9130 wCov12 = fIntFlowCovariancesNUA->GetBinContent(9); // w*Cov(<4>,<sin(#phi)>
9131 wCov13 = fIntFlowCovariancesNUA->GetBinContent(11); // w*Cov(<4>,<sin(#phi_{1}+#phi_{2})>)
9132 wCov14 = fIntFlowCovariancesNUA->GetBinContent(13); // w*Cov(<4>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9133 wCov15 = fIntFlowCovariancesNUA->GetBinContent(14); // w*Cov(<cos(#phi)>,<cos(#phi_{1}+#phi_{2})>)
9134 wCov16 = fIntFlowCovariancesNUA->GetBinContent(16); // w*Cov(<cos(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9135 wCov17 = fIntFlowCovariancesNUA->GetBinContent(15); // w*Cov(<cos(#phi)>,<sin(#phi_{1}+#phi_{2})>)
9136 wCov18 = fIntFlowCovariancesNUA->GetBinContent(17); // w*Cov(<cos(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9137 wCov19 = fIntFlowCovariancesNUA->GetBinContent(23); // w*Cov(<cos(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9138 wCov20 = fIntFlowCovariancesNUA->GetBinContent(18); // w*Cov(<sin(#phi)>,<cos(#phi_{1}+#phi_{2})>)
9139 wCov21 = fIntFlowCovariancesNUA->GetBinContent(22); // w*Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}+#phi_{2})>)
9140 wCov22 = fIntFlowCovariancesNUA->GetBinContent(24); // w*Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9141 wCov23 = fIntFlowCovariancesNUA->GetBinContent(20); // w*Cov(<sin(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9142 wCov24 = fIntFlowCovariancesNUA->GetBinContent(25); // w*Cov(<sin(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9143 wCov25 = fIntFlowCovariancesNUA->GetBinContent(27); // w*Cov(<cos(#phi_{1}-#phi_{2}-#phi_{3}>,<sin(#phi_{1}-#phi_{2}-#phi_{3}>)
9144 wCov26 = fIntFlowCovariancesNUA->GetBinContent(19); // w*Cov(<sin(#phi)>,<sin(#phi_{1}+#phi_{2})>)
9145 wCov27 = fIntFlowCovariancesNUA->GetBinContent(21); // w*Cov(<sin(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9146 wCov28 = fIntFlowCovariancesNUA->GetBinContent(26); // w*Cov(<sin(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9147 } // end of if(!fForgetAboutCovariances)
9149 // Calculating generalized QC{2}:
9150 // Generalized QC{2}:
9151 Double_t gQC2 = two - pow(c1,2.) - pow(s1,2.);
9152 if(fApplyCorrectionForNUA){fIntFlowQcumulants->SetBinContent(1,gQC2);}
9153 // Statistical error of generalized QC{2}:
9154 Double_t gQC2ErrorSquared = pow(twoError,2.)+4.*pow(c1,2.)*pow(c1Error,2.)
9155 + 4.*pow(s1,2.)*pow(s1Error,2.)
9156 - 4*c1*wCov1-4*s1*wCov2
9158 // Store ratio of error squared - with/without NUA terms:
9159 Double_t ratioErrorSquaredQC2 = 0.;
9160 if(fIntFlowQcumulants->GetBinError(1)>0.)
9162 ratioErrorSquaredQC2 = (gQC2ErrorSquared/pow(fIntFlowQcumulants->GetBinError(1),2.));
9163 fIntFlowQcumulantsErrorSquaredRatio->SetBinContent(1,ratioErrorSquaredQC2);
9165 // If enabled, store error by including non-isotropic terms:
9166 if(fApplyCorrectionForNUA && fPropagateErrorAlsoFromNIT)
9168 if(gQC2ErrorSquared>=0.)
9170 fIntFlowQcumulants->SetBinError(1,pow(gQC2ErrorSquared,0.5));
9173 fIntFlowQcumulants->SetBinError(1,0.);
9175 cout<<" WARNING (QC): Statistical error of generalized QC{2} is imaginary !!!!"<<endl;
9178 } // end of if(fApplyCorrectionForNUA && fPropagateErrorAlsoFromNIT)
9179 // Quantify detector bias to QC{2}:
9180 if(TMath::Abs(QC2)>0.)
9182 fIntFlowDetectorBias->SetBinContent(1,gQC2/QC2);
9185 Double_t errorSquared = gQC2ErrorSquared/pow(QC2,2.)+pow(gQC2,2.)*pow(QC2Error,2.)/pow(QC2,4.);
9188 fIntFlowDetectorBias->SetBinError(1,pow(errorSquared,0.5));
9191 } // end of if(TMath::Abs(QC2)>0.)
9193 // Calculating generalized QC{4}:
9194 // Generalized QC{4}:
9195 Double_t gQC4 = four-2.*pow(two,2.)
9196 - 4.*c1*c3+4.*s1*s3-pow(c2,2.)-pow(s2,2.)
9197 + 4.*c2*(pow(c1,2.)-pow(s1,2.))+8.*s2*s1*c1
9198 + 8.*two*(pow(c1,2.)+pow(s1,2.))-6.*pow((pow(c1,2.)+pow(s1,2.)),2.);
9199 if(fApplyCorrectionForNUA){fIntFlowQcumulants->SetBinContent(2,gQC4);}
9200 // Statistical error of generalized QC{4}:
9201 Double_t gQC4ErrorSquared = 16.*pow(a1,2.)*pow(twoError,2.)+pow(fourError,2.)+16.*pow(a2,2.)*pow(c1Error,2.)
9202 + 4.*pow(a3,2.)*pow(c2Error,2.)+16.*pow(c1,2.)*pow(c3Error,2.)
9203 + 16.*pow(a4,2.)*pow(s1Error,2.)+4.*pow(a5,2.)*pow(s2Error,2.)
9204 + 16.*pow(s1,2.)*pow(s3Error,2.)+8.*a1*wCov4-32.*a1*a2*wCov1
9205 - 16.*a3*a1*wCov5-32.*c1*a1*wCov6-32.*a1*a4*wCov2+16.*a5*a1*wCov7
9206 + 32.*s1*a1*wCov8-8.*a2*wCov9-4.*a3*wCov10-8.*c1*wCov11-8.*a4*wCov12
9207 + 4.*a5*wCov13+8.*s1*wCov14+16.*a3*a2*wCov15+32.*c1*a2*wCov16+32.*a2*a4*wCov3
9208 - 16.*a5*a2*wCov17-32.*s1*a2*wCov18+16.*c1*a3*wCov19+16.*a3*a4*wCov20
9209 - 8.*a3*a5*wCov21-16.*s1*a3*wCov22+32.*c1*a4*wCov23-16.*c1*a5*wCov24
9210 - 32.*c1*s1*wCov25-16.*a5*a4*wCov26-32.*s1*a4*wCov27+16.*s1*a5*wCov28;
9211 // Store ratio of error squared - with/without NUA terms:
9212 Double_t ratioErrorSquaredQC4 = 0.;
9213 if(fIntFlowQcumulants->GetBinError(2)>0.)
9215 ratioErrorSquaredQC4 = (gQC4ErrorSquared/pow(fIntFlowQcumulants->GetBinError(2),2.));
9216 fIntFlowQcumulantsErrorSquaredRatio->SetBinContent(2,ratioErrorSquaredQC4);
9218 if(fApplyCorrectionForNUA && fPropagateErrorAlsoFromNIT)
9220 if(gQC4ErrorSquared>=0.)
9222 fIntFlowQcumulants->SetBinError(2,pow(gQC4ErrorSquared,0.5));
9225 fIntFlowQcumulants->SetBinError(2,0.);
9227 cout<<" WARNING (QC): Statistical error of generalized QC{4} is imaginary !!!!"<<endl;
9230 } // end of if(fApplyCorrectionForNUA && fPropagateErrorAlsoFromNIT)
9231 // Quantify detector bias to QC{4}:
9232 if(TMath::Abs(QC4)>0.)
9234 fIntFlowDetectorBias->SetBinContent(2,gQC4/QC4);
9237 Double_t errorSquared = gQC4ErrorSquared/pow(QC4,2.)+pow(gQC4,2.)*pow(QC4Error,2.)/pow(QC4,4.);
9240 fIntFlowDetectorBias->SetBinError(2,pow(errorSquared,0.5));
9243 } // end of if(TMath::Abs(QC4)>0.)
9246 // .... to be improved (continued for 6th and 8th order) ....
9249 // versus multiplicity:
9250 if(fCalculateCumulantsVsM) // to be improved - propagate error for nua terms vs M
9252 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
9253 Double_t value[4] = {0.}; // QCs vs M
9254 Double_t error[4] = {0.}; // error of QCs vs M
9255 Double_t dSum1[4] = {0.}; // sum value_i/(error_i)^2
9256 Double_t dSum2[4] = {0.}; // sum 1/(error_i)^2
9257 for(Int_t b=1;b<=nBins;b++)
9259 // Measured correlations:
9260 two = fIntFlowCorrelationsVsMHist[0]->GetBinContent(b); // <<2>> vs M
9261 four = fIntFlowCorrelationsVsMHist[1]->GetBinContent(b); // <<4>> vs M
9262 // Isotropic cumulants:
9264 QC4 = four-2.*pow(two,2.);
9265 // Non-isotropic terms:
9266 c1 = fIntFlowCorrectionTermsForNUAVsMPro[1][0]->GetBinContent(b); // <<cos(n*phi1)>>
9267 c2 = fIntFlowCorrectionTermsForNUAVsMPro[1][1]->GetBinContent(b); // <<cos(n*(phi1+phi2))>>
9268 c3 = fIntFlowCorrectionTermsForNUAVsMPro[1][2]->GetBinContent(b); // <<cos(n*(phi1-phi2-phi3))>>
9269 s1 = fIntFlowCorrectionTermsForNUAVsMPro[0][0]->GetBinContent(b); // <<sin(n*phi1)>>
9270 s2 = fIntFlowCorrectionTermsForNUAVsMPro[0][1]->GetBinContent(b); // <<sin(n*(phi1+phi2))>>
9271 s3 = fIntFlowCorrectionTermsForNUAVsMPro[0][2]->GetBinContent(b); // <<sin(n*(phi1-phi2-phi3))>>
9272 // Generalized QC{2} vs M:
9273 gQC2 = two - pow(c1,2.) - pow(s1,2.);
9274 if(fApplyCorrectionForNUAVsM){fIntFlowQcumulantsVsM[0]->SetBinContent(b,gQC2);}
9275 // Generalized QC{4} vs M:
9276 gQC4 = four-2.*pow(two,2.)
9277 - 4.*c1*c3+4.*s1*s3-pow(c2,2.)-pow(s2,2.)
9278 + 4.*c2*(pow(c1,2.)-pow(s1,2.))+8.*s2*s1*c1
9279 + 8.*two*(pow(c1,2.)+pow(s1,2.))-6.*pow((pow(c1,2.)+pow(s1,2.)),2.);
9280 if(fApplyCorrectionForNUAVsM){fIntFlowQcumulantsVsM[1]->SetBinContent(b,gQC4);}
9281 // Detector bias vs M:
9282 if(TMath::Abs(QC2)>0.)
9284 fIntFlowDetectorBiasVsM[0]->SetBinContent(b,gQC2/QC2);
9285 } // end of if(TMath::Abs(QC2)>0.)
9286 if(TMath::Abs(QC4)>0.)
9288 fIntFlowDetectorBiasVsM[1]->SetBinContent(b,gQC4/QC4);
9289 } // end of if(TMath::Abs(QC4)>0.)
9291 for(Int_t co=0;co<4;co++)
9293 value[co] = fIntFlowQcumulantsVsM[co]->GetBinContent(b);
9294 error[co] = fIntFlowQcumulantsVsM[co]->GetBinError(b);
9297 dSum1[co]+=value[co]/(error[co]*error[co]);
9298 dSum2[co]+=1./(error[co]*error[co]);
9300 } // end of for(Int_t co=0;co<4;co++)
9301 } // end of for(Int_t b=1;b<=nBins;b++)
9302 // Store rebinned Q-cumulants:
9303 if(fApplyCorrectionForNUAVsM)
9305 for(Int_t co=0;co<4;co++)
9309 fIntFlowQcumulantsRebinnedInM->SetBinContent(co+1,dSum1[co]/dSum2[co]);
9310 fIntFlowQcumulantsRebinnedInM->SetBinError(co+1,pow(1./dSum2[co],0.5));
9312 } // end of for(Int_t co=0;co<4;co++)
9313 } // end of if(fApplyCorrectionForNUAVsM)
9314 } // end of if(fCalculateCumulantsVsM)
9316 } // end of void AliFlowAnalysisWithQCumulants::CalculateQcumulantsCorrectedForNUAIntFlow()
9318 //================================================================================================================================
9320 void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUAIntFlow()
9322 // From profile fIntFlowCorrectionTermsForNUAPro[sc] access measured correction terms for NUA
9323 // and their spread, correctly calculate the statistical errors and store the final
9324 // results and statistical errors for correction terms for NUA in histogram fIntFlowCorrectionTermsForNUAHist[sc].
9326 // Remark: Statistical error of correction temrs is calculated as:
9328 // statistical error = termA * spread * termB:
9329 // termA = sqrt{sum_{i=1}^{N} w^2}/(sum_{i=1}^{N} w)
9330 // termB = 1/sqrt(1-termA^2)
9332 TString sinCosFlag[2] = {"sin","cos"}; // to be improved - promore this to data member?
9333 TString nonisotropicTermFlag[4] = {"(n(phi1))","(n(phi1+phi2))","(n(phi1-phi2-phi3))","(n(2phi1-phi2))"}; // to be improved - hardwired 4
9335 for(Int_t sc=0;sc<2;sc++) // sin or cos correction terms
9337 for(Int_t ci=1;ci<=4;ci++) // correction term index (to be improved - hardwired 4)
9339 Double_t correction = fIntFlowCorrectionTermsForNUAPro[sc]->GetBinContent(ci);
9340 Double_t spread = fIntFlowCorrectionTermsForNUAPro[sc]->GetBinError(ci);
9341 Double_t sumOfLinearEventWeights = fIntFlowSumOfEventWeightsNUA[sc][0]->GetBinContent(ci);
9342 Double_t sumOfQuadraticEventWeights = fIntFlowSumOfEventWeightsNUA[sc][1]->GetBinContent(ci);
9343 Double_t termA = 0.;
9344 Double_t termB = 0.;
9345 if(TMath::Abs(sumOfLinearEventWeights)>1.e-44)
9347 termA = pow(sumOfQuadraticEventWeights,0.5)/sumOfLinearEventWeights;
9350 cout<<" WARNING (QC): sumOfLinearEventWeights == 0 in AFAWQC::FCTFNIF() !!!!"<<endl;
9351 cout<<Form(" (for <<%s[%s]>> non-isotropic term)",sinCosFlag[sc].Data(),nonisotropicTermFlag[ci-1].Data())<<endl;
9353 if(1.-pow(termA,2.) > 0.)
9355 termB = 1./pow(1-pow(termA,2.),0.5);
9358 cout<<" WARNING (QC): 1.-pow(termA,2.) <= 0 in AFAWQC::FCTFNIF() !!!!"<<endl;
9359 cout<<Form(" (for <<%s[%s]>> non-isotropic term)",sinCosFlag[sc].Data(),nonisotropicTermFlag[ci-1].Data())<<endl;
9361 Double_t statisticalError = termA * spread * termB;
9362 fIntFlowCorrectionTermsForNUAHist[sc]->SetBinContent(ci,correction);
9363 fIntFlowCorrectionTermsForNUAHist[sc]->SetBinError(ci,statisticalError);
9364 } // end of for(Int_t ci=1;ci<=4;ci++) // correction term index
9365 } // end of for(Int sc=0;sc<2;sc++) // sin or cos correction terms
9367 } // end of void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUAIntFlow()
9369 //================================================================================================================================
9371 void AliFlowAnalysisWithQCumulants::GetPointersForNestedLoopsHistograms()
9373 // Get pointers to all objects relevant for calculations with nested loops.
9375 TList *nestedLoopsList = dynamic_cast<TList*>(fHistList->FindObject("Nested Loops"));
9378 this->SetNestedLoopsList(nestedLoopsList);
9381 cout<<"WARNING: nestedLoopsList is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
9385 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)
9386 TString typeFlag[2] = {"RP","POI"}; // to be improved (should I promote this to data members?)
9387 TString ptEtaFlag[2] = {"p_{T}","#eta"}; // to be improved (should I promote this to data members?)
9388 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"}; // to be improved (should I promote this to data members?)
9390 TString evaluateNestedLoopsName = "fEvaluateNestedLoops";
9391 evaluateNestedLoopsName += fAnalysisLabel->Data();
9392 TProfile *evaluateNestedLoops = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(evaluateNestedLoopsName.Data()));
9393 Bool_t bEvaluateIntFlowNestedLoops = kFALSE;
9394 Bool_t bEvaluateDiffFlowNestedLoops = kFALSE;
9395 if(evaluateNestedLoops)
9397 this->SetEvaluateNestedLoops(evaluateNestedLoops);
9398 bEvaluateIntFlowNestedLoops = (Int_t)evaluateNestedLoops->GetBinContent(1);
9399 bEvaluateDiffFlowNestedLoops = (Int_t)evaluateNestedLoops->GetBinContent(2);
9401 // nested loops relevant for integrated flow:
9402 if(bEvaluateIntFlowNestedLoops)
9405 TString intFlowDirectCorrelationsName = "fIntFlowDirectCorrelations";
9406 intFlowDirectCorrelationsName += fAnalysisLabel->Data();
9407 TProfile *intFlowDirectCorrelations = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(intFlowDirectCorrelationsName.Data()));
9408 if(intFlowDirectCorrelations)
9410 this->SetIntFlowDirectCorrelations(intFlowDirectCorrelations);
9413 cout<<"WARNING: intFlowDirectCorrelations is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
9416 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
9418 TString intFlowExtraDirectCorrelationsName = "fIntFlowExtraDirectCorrelations";
9419 intFlowExtraDirectCorrelationsName += fAnalysisLabel->Data();
9420 TProfile *intFlowExtraDirectCorrelations = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(intFlowExtraDirectCorrelationsName.Data()));
9421 if(intFlowExtraDirectCorrelations)
9423 this->SetIntFlowExtraDirectCorrelations(intFlowExtraDirectCorrelations);
9426 cout<<"WARNING: intFlowExtraDirectCorrelations is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
9429 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
9430 // correction terms for non-uniform acceptance:
9431 TString intFlowDirectCorrectionTermsForNUAName = "fIntFlowDirectCorrectionTermsForNUA";
9432 intFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
9433 TProfile *intFlowDirectCorrectionTermsForNUA[2] = {NULL};
9434 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
9436 intFlowDirectCorrectionTermsForNUA[sc] = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(Form("%s: %s terms",intFlowDirectCorrectionTermsForNUAName.Data(),sinCosFlag[sc].Data())));
9437 if(intFlowDirectCorrectionTermsForNUA[sc])
9439 this->SetIntFlowDirectCorrectionTermsForNUA(intFlowDirectCorrectionTermsForNUA[sc],sc);
9442 cout<<"WARNING: intFlowDirectCorrectionTermsForNUA[sc] is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
9443 cout<<"sc = "<<sc<<endl;
9446 } // end of for(Int_t sc=0;sc<2;sc++)
9447 } // end of if(bEvaluateIntFlowNestedLoops)
9449 // nested loops relevant for differential flow:
9450 if(bEvaluateDiffFlowNestedLoops)
9453 TString diffFlowDirectCorrelationsName = "fDiffFlowDirectCorrelations";
9454 diffFlowDirectCorrelationsName += fAnalysisLabel->Data();
9455 TProfile *diffFlowDirectCorrelations[2][2][4] = {{{NULL}}};
9456 for(Int_t t=0;t<2;t++)
9458 for(Int_t pe=0;pe<2;pe++)
9460 for(Int_t ci=0;ci<4;ci++) // correlation index
9462 diffFlowDirectCorrelations[t][pe][ci] = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(Form("%s, %s, %s, %s",diffFlowDirectCorrelationsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[ci].Data())));
9463 if(diffFlowDirectCorrelations[t][pe][ci])
9465 this->SetDiffFlowDirectCorrelations(diffFlowDirectCorrelations[t][pe][ci],t,pe,ci);
9468 cout<<"WARNING: diffFlowDirectCorrelations[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9469 cout<<"t = "<<t<<endl;
9470 cout<<"pe = "<<pe<<endl;
9471 cout<<"ci = "<<ci<<endl;
9473 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
9474 } // end of for(Int_t pe=0;pe<2;pe++)
9475 } // end of for(Int_t t=0;t<2;t++)
9476 // correction terms for non-uniform acceptance:
9477 TString diffFlowDirectCorrectionTermsForNUAName = "fDiffFlowDirectCorrectionTermsForNUA";
9478 diffFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
9479 TProfile *diffFlowDirectCorrectionTermsForNUA[2][2][2][10] = {{{{NULL}}}};
9480 for(Int_t t=0;t<2;t++)
9482 for(Int_t pe=0;pe<2;pe++)
9484 // correction terms for NUA:
9485 for(Int_t sc=0;sc<2;sc++) // sin or cos
9487 for(Int_t cti=0;cti<9;cti++) // correction term index
9489 diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti] = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(Form("%s, %s, %s, %s, cti = %d",diffFlowDirectCorrectionTermsForNUAName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),cti+1)));
9490 if(diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti])
9492 this->SetDiffFlowDirectCorrectionTermsForNUA(diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti],t,pe,sc,cti);
9495 cout<<"WARNING: diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9496 cout<<"t = "<<t<<endl;
9497 cout<<"pe = "<<pe<<endl;
9498 cout<<"sc = "<<sc<<endl;
9499 cout<<"cti = "<<cti<<endl;
9501 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index
9502 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
9503 } // end of for(Int_t pe=0;pe<2;pe++)
9504 } // end of for(Int_t t=0;t<2;t++)
9505 // number of RPs and POIs in selected pt and eta bins for cross-checkings:
9506 TString noOfParticlesInBinName = "fNoOfParticlesInBin";
9507 TH1D *noOfParticlesInBin = NULL;
9508 noOfParticlesInBin = dynamic_cast<TH1D*>(nestedLoopsList->FindObject(noOfParticlesInBinName.Data()));
9509 if(noOfParticlesInBin)
9511 this->SetNoOfParticlesInBin(noOfParticlesInBin);
9515 cout<<" WARNING (QC): noOfParticlesInBin is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9518 } // end of if(bEvaluateDiffFlowNestedLoops)
9520 } // end of void AliFlowAnalysisWithQCumulants::GetPointersForNestedLoopsHistograms()
9522 //================================================================================================================================
9524 void AliFlowAnalysisWithQCumulants::StoreHarmonic()
9526 // Store flow harmonic in common control histograms.
9528 (fCommonHists->GetHarmonic())->Fill(0.5,fHarmonic);
9529 if(fFillMultipleControlHistograms)
9531 (fCommonHists2nd->GetHarmonic())->Fill(0.5,fHarmonic);
9532 (fCommonHists4th->GetHarmonic())->Fill(0.5,fHarmonic);
9533 (fCommonHists6th->GetHarmonic())->Fill(0.5,fHarmonic);
9534 (fCommonHists8th->GetHarmonic())->Fill(0.5,fHarmonic);
9537 } // end of void AliFlowAnalysisWithQCumulants::StoreHarmonic()
9539 //================================================================================================================================
9541 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelationsUsingParticleWeights(TString type, TString ptOrEta) // type = RP or POI
9543 // Calculate all correlations needed for differential flow using particle weights.
9545 Int_t t = 0; // type flag
9546 Int_t pe = 0; // ptEta flag
9551 } else if(type == "POI")
9559 } else if(ptOrEta == "Eta")
9564 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
9565 Double_t minPtEta[2] = {fPtMin,fEtaMin};
9566 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
9567 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
9569 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
9570 Double_t dReQ1n1k = (*fReQ)(0,1);
9571 Double_t dReQ2n2k = (*fReQ)(1,2);
9572 Double_t dReQ1n3k = (*fReQ)(0,3);
9573 //Double_t dReQ4n4k = (*fReQ)(3,4);
9574 Double_t dImQ1n1k = (*fImQ)(0,1);
9575 Double_t dImQ2n2k = (*fImQ)(1,2);
9576 Double_t dImQ1n3k = (*fImQ)(0,3);
9577 //Double_t dImQ4n4k = (*fImQ)(3,4);
9579 // S^M_{p,k} (see .h file for the definition of fSMpk):
9580 Double_t dSM1p1k = (*fSMpk)(0,1);
9581 Double_t dSM1p2k = (*fSMpk)(0,2);
9582 Double_t dSM1p3k = (*fSMpk)(0,3);
9583 Double_t dSM2p1k = (*fSMpk)(1,1);
9584 Double_t dSM3p1k = (*fSMpk)(2,1);
9586 // looping over all bins and calculating reduced correlations:
9587 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9589 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin):
9590 Double_t p1n0kRe = 0.;
9591 Double_t p1n0kIm = 0.;
9593 // number of POIs in particular (pt,eta) bin):
9596 // real and imaginary parts of q_{m*n,k}:
9597 // (weighted Q-vector evaluated for particles which are both RPs and POIs in particular (pt,eta) bin)
9598 Double_t q1n2kRe = 0.;
9599 Double_t q1n2kIm = 0.;
9600 Double_t q2n1kRe = 0.;
9601 Double_t q2n1kIm = 0.;
9603 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
9604 Double_t s1p1k = 0.;
9605 Double_t s1p2k = 0.;
9606 Double_t s1p3k = 0.;
9608 // M0111 from Eq. (118) in QC2c (to be improved (notation))
9609 Double_t dM0111 = 0.;
9613 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
9614 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
9615 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
9616 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
9618 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9620 t = 1; // typeFlag = RP or POI
9622 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
9623 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))
9624 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));
9625 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))
9626 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b));
9627 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))
9628 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));
9629 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))
9630 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b));
9632 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
9633 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.);
9634 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.);
9635 s1p3k = pow(fs1dEBE[2][pe][3]->GetBinContent(b)*fs1dEBE[2][pe][3]->GetBinEntries(b),1.);
9637 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
9638 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
9639 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
9640 + 2.*(s1p3k-s1p2k*dSM1p1k));
9642 else if(type == "RP")
9644 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
9645 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))
9646 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));
9647 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))
9648 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));
9649 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))
9650 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));
9651 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))
9652 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));
9654 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
9655 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.);
9656 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.);
9657 s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.);
9659 // to be improved (cross-checked):
9660 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
9661 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
9662 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
9663 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
9665 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9667 t = 0; // typeFlag = RP or POI
9669 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
9670 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
9671 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
9672 + 2.*(s1p3k-s1p2k*dSM1p1k));
9673 //...............................................................................................
9676 // 2'-particle correlation:
9677 Double_t two1n1nW0W1 = 0.;
9678 if(mp*dSM1p1k-s1p1k)
9680 two1n1nW0W1 = (p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k-s1p1k)
9681 / (mp*dSM1p1k-s1p1k);
9683 // fill profile to get <<2'>>
9684 fDiffFlowCorrelationsPro[t][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nW0W1,mp*dSM1p1k-s1p1k);
9685 // fill profile to get <<2'>^2>
9686 fDiffFlowSquaredCorrelationsPro[t][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nW0W1*two1n1nW0W1,mp*dSM1p1k-s1p1k);
9687 // histogram to store <2'> e-b-e (needed in some other methods):
9688 fDiffFlowCorrelationsEBE[t][pe][0]->SetBinContent(b,two1n1nW0W1);
9689 fDiffFlowEventWeightsForCorrelationsEBE[t][pe][0]->SetBinContent(b,mp*dSM1p1k-s1p1k);
9690 } // end of if(mp*dSM1p1k-s1p1k)
9692 // 4'-particle correlation:
9693 Double_t four1n1n1n1nW0W1W1W1 = 0.;
9696 four1n1n1n1nW0W1W1W1 = ((pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
9697 - q2n1kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))
9698 - 2.*q2n1kIm*dReQ1n1k*dImQ1n1k
9699 - p1n0kRe*(dReQ1n1k*dReQ2n2k+dImQ1n1k*dImQ2n2k)
9700 + p1n0kIm*(dImQ1n1k*dReQ2n2k-dReQ1n1k*dImQ2n2k)
9701 - 2.*dSM1p2k*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
9702 - 2.*(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*s1p1k
9703 + 6.*(q1n2kRe*dReQ1n1k+q1n2kIm*dImQ1n1k)
9704 + 1.*(q2n1kRe*dReQ2n2k+q2n1kIm*dImQ2n2k)
9705 + 2.*(p1n0kRe*dReQ1n3k+p1n0kIm*dImQ1n3k)
9708 / dM0111; // to be improved (notation of dM0111)
9710 // fill profile to get <<4'>>
9711 fDiffFlowCorrelationsPro[t][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nW0W1W1W1,dM0111);
9712 // fill profile to get <<4'>^2>
9713 fDiffFlowSquaredCorrelationsPro[t][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nW0W1W1W1*four1n1n1n1nW0W1W1W1,dM0111);
9714 // histogram to store <4'> e-b-e (needed in some other methods):
9715 fDiffFlowCorrelationsEBE[t][pe][1]->SetBinContent(b,four1n1n1n1nW0W1W1W1);
9716 fDiffFlowEventWeightsForCorrelationsEBE[t][pe][1]->SetBinContent(b,dM0111);
9717 } // end of if(dM0111)
9718 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9720 } // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelationsUsingParticleWeights(TString type, TString ptOrEta); // type = RP or POI
9722 //================================================================================================================================
9724 void AliFlowAnalysisWithQCumulants::FillCommonControlHistograms(AliFlowEventSimple *anEvent)
9726 // Fill common control histograms.
9728 Int_t nRP = anEvent->GetEventNSelTracksRP(); // number of RPs (i.e. number of particles used to determine the reaction plane)
9729 fCommonHists->FillControlHistograms(anEvent);
9730 if(fFillMultipleControlHistograms)
9734 fCommonHists2nd->FillControlHistograms(anEvent);
9737 fCommonHists4th->FillControlHistograms(anEvent);
9740 fCommonHists6th->FillControlHistograms(anEvent);
9743 fCommonHists8th->FillControlHistograms(anEvent);
9744 } // end of if(nRP>7)
9745 } // end of if(nRP>5)
9746 } // end of if(nRP>3)
9747 } // end of if(nRP>1)
9748 } // end of if(fFillMultipleControlHistograms)
9750 } // end of void AliFlowAnalysisWithQCumulants::FillCommonControlHistograms(AliFlowEventSimple *anEvent)
9752 //================================================================================================================================
9754 void AliFlowAnalysisWithQCumulants::ResetEventByEventQuantities()
9756 // Reset all event by event quantities.
9762 fIntFlowCorrelationsEBE->Reset();
9763 fIntFlowEventWeightsForCorrelationsEBE->Reset();
9764 fIntFlowCorrelationsAllEBE->Reset();
9766 for(Int_t sc=0;sc<2;sc++)
9768 fIntFlowCorrectionTermsForNUAEBE[sc]->Reset();
9769 fIntFlowEventWeightForCorrectionTermsForNUAEBE[sc]->Reset();
9772 // differential flow:
9774 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
9776 for(Int_t pe=0;pe<2;pe++) // 1D in pt or eta
9778 for(Int_t m=0;m<4;m++) // multiple of harmonic
9780 for(Int_t k=0;k<9;k++) // power of weight
9782 if(fReRPQ1dEBE[t][pe][m][k]) fReRPQ1dEBE[t][pe][m][k]->Reset();
9783 if(fImRPQ1dEBE[t][pe][m][k]) fImRPQ1dEBE[t][pe][m][k]->Reset();
9789 for(Int_t t=0;t<3;t++) // type (0 = RP, 1 = POI, 2 = RP&&POI )
9791 for(Int_t pe=0;pe<2;pe++) // 1D in pt or eta
9793 for(Int_t k=0;k<9;k++)
9795 if(fs1dEBE[t][pe][k]) fs1dEBE[t][pe][k]->Reset();
9800 // e-b-e reduced correlations:
9801 for(Int_t t=0;t<2;t++) // type (0 = RP, 1 = POI)
9803 for(Int_t pe=0;pe<2;pe++) // pt or eta
9805 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
9807 if(fDiffFlowCorrelationsEBE[t][pe][rci]) fDiffFlowCorrelationsEBE[t][pe][rci]->Reset();
9808 if(fDiffFlowEventWeightsForCorrelationsEBE[t][pe][rci]) fDiffFlowEventWeightsForCorrelationsEBE[t][pe][rci]->Reset();
9813 // correction terms for NUA:
9814 for(Int_t t=0;t<2;t++) // type (0 = RP, 1 = POI)
9816 for(Int_t pe=0;pe<2;pe++) // pt or eta
9818 for(Int_t sc=0;sc<2;sc++) // sin or cos
9820 for(Int_t cti=0;cti<9;cti++) // correction term index
9822 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti]->Reset();
9829 if(fCalculate2DFlow)
9831 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
9833 for(Int_t m=0;m<4;m++) // multiple of harmonic
9835 for(Int_t k=0;k<9;k++) // power of weight
9837 if(fReRPQ2dEBE[t][m][k]){fReRPQ2dEBE[t][m][k]->Reset();}
9838 if(fImRPQ2dEBE[t][m][k]){fImRPQ2dEBE[t][m][k]->Reset();}
9842 for(Int_t t=0;t<3;t++) // type (0 = RP, 1 = POI, 2 = RP&&POI )
9844 for(Int_t k=0;k<9;k++)
9846 if(fs2dEBE[t][k]){fs2dEBE[t][k]->Reset();}
9849 } // end of if(fCalculate2DFlow)
9851 } // end of void AliFlowAnalysisWithQCumulants::ResetEventByEventQuantities();
9854 //================================================================================================================================
9857 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTerms(TString type, TString ptOrEta)
9859 // Calculate correction terms for non-uniform acceptance for differential flow (sin terms).
9861 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][0][cti], where cti runs as follows:
9862 // 0: <<sin n(psi1)>>
9863 // 1: <<sin n(psi1+phi2)>>
9864 // 2: <<sin n(psi1+phi2-phi3)>>
9865 // 3: <<sin n(psi1-phi2-phi3)>>:
9871 Double_t dMult = (*fSMpk)(0,0);
9873 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
9874 Double_t dReQ1n = (*fReQ)(0,0);
9875 Double_t dReQ2n = (*fReQ)(1,0);
9876 //Double_t dReQ3n = (*fReQ)(2,0);
9877 //Double_t dReQ4n = (*fReQ)(3,0);
9878 Double_t dImQ1n = (*fImQ)(0,0);
9879 Double_t dImQ2n = (*fImQ)(1,0);
9880 //Double_t dImQ3n = (*fImQ)(2,0);
9881 //Double_t dImQ4n = (*fImQ)(3,0);
9883 Int_t t = 0; // type flag
9884 Int_t pe = 0; // ptEta flag
9889 } else if(type == "POI")
9897 } else if(ptOrEta == "Eta")
9902 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
9903 Double_t minPtEta[2] = {fPtMin,fEtaMin};
9904 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
9905 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
9907 // looping over all bins and calculating correction terms:
9908 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9910 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
9911 Double_t p1n0kRe = 0.;
9912 Double_t p1n0kIm = 0.;
9914 // number of POIs in particular pt or eta bin:
9917 // real and imaginary parts of q_{m*n,0} (non-weighted Q-vector evaluated for particles which are both RPs and POIs in particular pt or eta bin):
9918 Double_t q1n0kRe = 0.;
9919 Double_t q1n0kIm = 0.;
9920 Double_t q2n0kRe = 0.;
9921 Double_t q2n0kIm = 0.;
9923 // number of particles which are both RPs and POIs in particular pt or eta bin:
9929 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))
9930 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));
9931 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))
9932 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));
9933 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))
9934 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));
9935 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))
9936 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b));
9938 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9940 else if(type == "RP")
9943 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
9944 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
9945 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
9946 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
9947 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))
9948 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));
9949 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))
9950 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b));
9952 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9957 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
9958 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
9959 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
9960 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
9962 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9964 t = 1; // typeFlag = RP or POI
9966 else if(type == "RP")
9968 // p_{m*n,0} = q_{m*n,0}:
9974 t = 0; // typeFlag = RP or POI
9978 Double_t sinP1nPsi = 0.;
9981 sinP1nPsi = p1n0kIm/mp;
9982 // fill profile for <<sin n(psi1)>>:
9983 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi,mp);
9984 // histogram to store <sin n(psi1)> e-b-e (needed in some other methods):
9985 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][0]->SetBinContent(b,sinP1nPsi);
9988 // <<sin n(psi1+phi2)>>:
9989 Double_t sinP1nPsiP1nPhi = 0.;
9992 sinP1nPsiP1nPhi = (p1n0kRe*dImQ1n+p1n0kIm*dReQ1n-q2n0kIm)/(mp*dMult-mq);
9993 // fill profile for <<sin n(psi1+phi2)>>:
9994 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsiP1nPhi,mp*dMult-mq);
9995 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
9996 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][1]->SetBinContent(b,sinP1nPsiP1nPhi);
9997 } // end of if(mp*dMult-mq)
9999 // <<sin n(psi1+phi2-phi3)>>:
10000 Double_t sinP1nPsi1P1nPhi2MPhi3 = 0.;
10001 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
10003 sinP1nPsi1P1nPhi2MPhi3 = (p1n0kIm*(pow(dImQ1n,2.)+pow(dReQ1n,2.)-dMult)
10004 - 1.*(q2n0kIm*dReQ1n-q2n0kRe*dImQ1n)
10005 - mq*dImQ1n+2.*q1n0kIm)
10006 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
10007 // fill profile for <<sin n(psi1+phi2)>>:
10008 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1P1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
10009 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
10010 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][2]->SetBinContent(b,sinP1nPsi1P1nPhi2MPhi3);
10011 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
10013 // <<sin n(psi1-phi2-phi3)>>:
10014 Double_t sinP1nPsi1M1nPhi2MPhi3 = 0.;
10015 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
10017 sinP1nPsi1M1nPhi2MPhi3 = (p1n0kIm*(pow(dReQ1n,2.)-pow(dImQ1n,2.))-2.*p1n0kRe*dReQ1n*dImQ1n
10018 - 1.*(p1n0kIm*dReQ2n-p1n0kRe*dImQ2n)
10019 + 2.*mq*dImQ1n-2.*q1n0kIm)
10020 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
10021 // fill profile for <<sin n(psi1+phi2)>>:
10022 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1M1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
10023 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
10024 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][3]->SetBinContent(b,sinP1nPsi1M1nPhi2MPhi3);
10025 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
10026 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10028 } // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTerms(TString type, TString ptOrEta)
10031 //================================================================================================================================
10034 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTerms(TString type, TString ptOrEta)
10036 // Calculate correction terms for non-uniform acceptance for differential flow (cos terms).
10038 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][1][cti], where cti runs as follows:
10039 // 0: <<cos n(psi)>>
10040 // 1: <<cos n(psi1+phi2)>>
10041 // 2: <<cos n(psi1+phi2-phi3)>>
10042 // 3: <<cos n(psi1-phi2-phi3)>>
10048 Double_t dMult = (*fSMpk)(0,0);
10050 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
10051 Double_t dReQ1n = (*fReQ)(0,0);
10052 Double_t dReQ2n = (*fReQ)(1,0);
10053 //Double_t dReQ3n = (*fReQ)(2,0);
10054 //Double_t dReQ4n = (*fReQ)(3,0);
10055 Double_t dImQ1n = (*fImQ)(0,0);
10056 Double_t dImQ2n = (*fImQ)(1,0);
10057 //Double_t dImQ3n = (*fImQ)(2,0);
10058 //Double_t dImQ4n = (*fImQ)(3,0);
10060 Int_t t = 0; // type flag
10061 Int_t pe = 0; // ptEta flag
10066 } else if(type == "POI")
10071 if(ptOrEta == "Pt")
10074 } else if(ptOrEta == "Eta")
10079 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
10080 Double_t minPtEta[2] = {fPtMin,fEtaMin};
10081 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
10082 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
10084 // looping over all bins and calculating correction terms:
10085 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10087 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
10088 Double_t p1n0kRe = 0.;
10089 Double_t p1n0kIm = 0.;
10091 // number of POIs in particular pt or eta bin:
10094 // real and imaginary parts of q_{m*n,0} (non-weighted Q-vector evaluated for particles which are both RPs and POIs in particular pt or eta bin):
10095 Double_t q1n0kRe = 0.;
10096 Double_t q1n0kIm = 0.;
10097 Double_t q2n0kRe = 0.;
10098 Double_t q2n0kIm = 0.;
10100 // number of particles which are both RPs and POIs in particular pt or eta bin:
10106 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))
10107 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));
10108 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))
10109 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));
10110 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))
10111 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));
10112 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))
10113 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b));
10115 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
10117 else if(type == "RP")
10120 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
10121 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
10122 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
10123 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
10124 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))
10125 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));
10126 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))
10127 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b));
10129 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
10134 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
10135 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
10136 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
10137 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
10139 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
10141 t = 1; // typeFlag = RP or POI
10143 else if(type == "RP")
10145 // p_{m*n,0} = q_{m*n,0}:
10151 t = 0; // typeFlag = RP or POI
10154 // <<cos n(psi1)>>:
10155 Double_t cosP1nPsi = 0.;
10158 cosP1nPsi = p1n0kRe/mp;
10160 // fill profile for <<cos n(psi1)>>:
10161 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi,mp);
10162 // histogram to store <cos n(psi1)> e-b-e (needed in some other methods):
10163 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][0]->SetBinContent(b,cosP1nPsi);
10166 // <<cos n(psi1+phi2)>>:
10167 Double_t cosP1nPsiP1nPhi = 0.;
10170 cosP1nPsiP1nPhi = (p1n0kRe*dReQ1n-p1n0kIm*dImQ1n-q2n0kRe)/(mp*dMult-mq);
10171 // fill profile for <<sin n(psi1+phi2)>>:
10172 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsiP1nPhi,mp*dMult-mq);
10173 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
10174 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][1]->SetBinContent(b,cosP1nPsiP1nPhi);
10175 } // end of if(mp*dMult-mq)
10177 // <<cos n(psi1+phi2-phi3)>>:
10178 Double_t cosP1nPsi1P1nPhi2MPhi3 = 0.;
10179 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
10181 cosP1nPsi1P1nPhi2MPhi3 = (p1n0kRe*(pow(dImQ1n,2.)+pow(dReQ1n,2.)-dMult)
10182 - 1.*(q2n0kRe*dReQ1n+q2n0kIm*dImQ1n)
10183 - mq*dReQ1n+2.*q1n0kRe)
10184 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
10185 // fill profile for <<sin n(psi1+phi2)>>:
10186 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1P1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
10187 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
10188 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][2]->SetBinContent(b,cosP1nPsi1P1nPhi2MPhi3);
10189 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
10191 // <<cos n(psi1-phi2-phi3)>>:
10192 Double_t cosP1nPsi1M1nPhi2MPhi3 = 0.;
10193 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
10195 cosP1nPsi1M1nPhi2MPhi3 = (p1n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))+2.*p1n0kIm*dReQ1n*dImQ1n
10196 - 1.*(p1n0kRe*dReQ2n+p1n0kIm*dImQ2n)
10197 - 2.*mq*dReQ1n+2.*q1n0kRe)
10198 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
10199 // fill profile for <<sin n(psi1+phi2)>>:
10200 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1M1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
10201 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
10202 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][3]->SetBinContent(b,cosP1nPsi1M1nPhi2MPhi3);
10203 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
10204 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10206 } // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTerms(TString type, TString ptOrEta)
10209 //==================================================================================================================================
10212 void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUADiffFlow(TString type, TString ptOrEta)
10214 // Transfer prolfiles into histogams and correctly propagate the error (to be improved: description)
10216 // to be improved: debugged - I do not correctly transfer all profiles into histos (bug appears only after merging)
10218 Int_t t = 0; // type flag
10219 Int_t pe = 0; // ptEta flag
10224 } else if(type == "POI")
10229 if(ptOrEta == "Pt")
10232 } else if(ptOrEta == "Eta")
10237 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
10238 //Double_t minPtEta[2] = {fPtMin,fEtaMin};
10239 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
10240 //Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
10242 for(Int_t sc=0;sc<2;sc++) // sin or cos
10244 for(Int_t cti=0;cti<9;cti++) // correction term index
10246 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10248 Double_t correctionTerm = fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]->GetBinContent(b);
10249 fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti]->SetBinContent(b,correctionTerm);
10250 // to be improved (propagate error correctly)
10252 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10253 } // correction term index
10254 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
10256 }// end of void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUADiffFlow(TString type, TString ptOrEta)
10259 //==================================================================================================================================
10262 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulantsCorrectedForNUA(TString type, TString ptOrEta)
10264 // Calculate generalized differential flow Q-cumulants (corrected for non-uniform acceptance)
10266 Int_t typeFlag = 0;
10267 Int_t ptEtaFlag = 0;
10272 } else if(type == "POI")
10277 if(ptOrEta == "Pt")
10280 } else if(ptOrEta == "Eta")
10286 Int_t t = typeFlag;
10287 Int_t pe = ptEtaFlag;
10290 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
10292 // 2-particle correlation:
10293 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
10294 // sin term coming from integrated flow:
10295 Double_t sinP1nPhi = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1); // <<sin(n*phi1)>>
10296 Double_t sinP1nPhi1P1nPhi2 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2); // <<sin(n*(phi1+phi2))>>
10297 Double_t sinP1nPhi1M1nPhi2M1nPhi3 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(3); // <<sin(n*(phi1-phi2-phi3))>>
10298 // cos term coming from integrated flow:
10299 Double_t cosP1nPhi = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1); // <<cos(n*phi1)>>
10300 Double_t cosP1nPhi1P1nPhi2 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2); // <<cos(n*(phi1+phi2))>>
10301 Double_t cosP1nPhi1M1nPhi2M1nPhi3 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(3); // <<cos(n*(phi1-phi2-phi3))>>
10303 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10305 Double_t twoPrime = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b); // <<2'>>
10306 Double_t fourPrime = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b); // <<4'>>
10307 Double_t sinP1nPsi = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][0]->GetBinContent(b); // <<sin n(Psi)>>
10308 Double_t cosP1nPsi = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][0]->GetBinContent(b); // <<cos n(Psi)>>
10309 Double_t sinP1nPsi1P1nPhi2 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][1]->GetBinContent(b); // <<sin n(psi1+phi2)>>
10310 Double_t cosP1nPsi1P1nPhi2 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][1]->GetBinContent(b); // <<cos n(psi1+phi2)>>
10311 Double_t sinP1nPsi1P1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][2]->GetBinContent(b); // <<sin n(psi1+phi2-phi3)>>
10312 Double_t cosP1nPsi1P1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][2]->GetBinContent(b); // <<cos n(psi1+phi2-phi3)>>
10313 Double_t sinP1nPsi1M1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][3]->GetBinContent(b); // <<sin n(psi1-phi2-phi3)>>
10314 Double_t cosP1nPsi1M1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][3]->GetBinContent(b); // <<cos n(psi1-phi2-phi3)>>
10315 // generalized QC{2'}:
10316 Double_t qc2Prime = twoPrime - sinP1nPsi*sinP1nPhi - cosP1nPsi*cosP1nPhi;
10317 fDiffFlowCumulants[t][pe][0]->SetBinContent(b,qc2Prime);
10318 // generalized QC{4'}:
10319 Double_t qc4Prime = fourPrime-2.*twoPrime*two
10320 - cosP1nPsi*cosP1nPhi1M1nPhi2M1nPhi3
10321 + sinP1nPsi*sinP1nPhi1M1nPhi2M1nPhi3
10322 - cosP1nPhi*cosP1nPsi1M1nPhi2M1nPhi3
10323 + sinP1nPhi*sinP1nPsi1M1nPhi2M1nPhi3
10324 - 2.*cosP1nPhi*cosP1nPsi1P1nPhi2M1nPhi3
10325 - 2.*sinP1nPhi*sinP1nPsi1P1nPhi2M1nPhi3
10326 - cosP1nPsi1P1nPhi2*cosP1nPhi1P1nPhi2
10327 - sinP1nPsi1P1nPhi2*sinP1nPhi1P1nPhi2
10328 + 2.*cosP1nPhi1P1nPhi2*(cosP1nPsi*cosP1nPhi-sinP1nPsi*sinP1nPhi)
10329 + 2.*sinP1nPhi1P1nPhi2*(cosP1nPsi*sinP1nPhi+sinP1nPsi*cosP1nPhi)
10330 + 4.*two*(cosP1nPsi*cosP1nPhi+sinP1nPsi*sinP1nPhi)
10331 + 2.*cosP1nPsi1P1nPhi2*(pow(cosP1nPhi,2.)-pow(sinP1nPhi,2.))
10332 + 4.*sinP1nPsi1P1nPhi2*cosP1nPhi*sinP1nPhi
10333 + 4.*twoPrime*(pow(cosP1nPhi,2.)+pow(sinP1nPhi,2.))
10334 - 6.*(pow(cosP1nPhi,2.)-pow(sinP1nPhi,2.))
10335 * (cosP1nPsi*cosP1nPhi-sinP1nPsi*sinP1nPhi)
10336 - 12.*cosP1nPhi*sinP1nPhi
10337 * (sinP1nPsi*cosP1nPhi+cosP1nPsi*sinP1nPhi);
10338 fDiffFlowCumulants[t][pe][1]->SetBinContent(b,qc4Prime);
10339 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
10341 } // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulantsCorrectedForNUA(TString type, TString ptOrEta)
10344 //==================================================================================================================================
10347 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectedForNUA(TString type, TString ptOrEta)
10349 // Calculate differential flow corrected for non-uniform acceptance.
10351 // to be improved (rewritten completely)
10353 Int_t typeFlag = 0;
10354 Int_t ptEtaFlag = 0;
10359 } else if(type == "POI")
10364 if(ptOrEta == "Pt")
10367 } else if(ptOrEta == "Eta")
10373 Int_t t = typeFlag;
10374 Int_t pe = ptEtaFlag;
10377 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
10379 // to be improved: access here generalized QC{2} and QC{4} instead:
10380 Double_t dV2 = fIntFlow->GetBinContent(1);
10381 Double_t dV4 = fIntFlow->GetBinContent(2);
10383 // loop over pt or eta bins:
10384 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10386 // generalized QC{2'}:
10387 Double_t gQC2Prime = fDiffFlowCumulants[t][pe][0]->GetBinContent(b);
10391 Double_t v2Prime = gQC2Prime/dV2;
10392 fDiffFlow[t][pe][0]->SetBinContent(b,v2Prime);
10394 // generalized QC{4'}:
10395 Double_t gQC4Prime = fDiffFlowCumulants[t][pe][1]->GetBinContent(b);
10399 Double_t v4Prime = -gQC4Prime/pow(dV4,3.);
10400 fDiffFlow[t][pe][1]->SetBinContent(b,v4Prime);
10402 } // end of for(Int_t b=1;b<=fnBinsPtEta[pe];b++)
10404 } // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectedForNUA(TString type, TString ptOrEta);
10407 //==================================================================================================================================
10410 void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoops(AliFlowEventSimple * const anEvent)
10412 // Evaluate with nested loops multiparticle correlations for integrated flow (without using the particle weights).
10414 // Remark: Results are stored in profile fIntFlowDirectCorrelations whose binning is organized as follows:
10416 // 1st bin: <2>_{1n|1n} = two1n1n = cos(n*(phi1-phi2))>
10417 // 2nd bin: <2>_{2n|2n} = two2n2n = cos(2n*(phi1-phi2))>
10418 // 3rd bin: <2>_{3n|3n} = two3n3n = cos(3n*(phi1-phi2))>
10419 // 4th bin: <2>_{4n|4n} = two4n4n = cos(4n*(phi1-phi2))>
10420 // 5th bin: ---- EMPTY ----
10421 // 6th bin: <3>_{2n|1n,1n} = three2n1n1n = <cos(n*(2.*phi1-phi2-phi3))>
10422 // 7th bin: <3>_{3n|2n,1n} = three3n2n1n = <cos(n*(3.*phi1-2.*phi2-phi3))>
10423 // 8th bin: <3>_{4n|2n,2n} = three4n2n2n = <cos(n*(4.*phi1-2.*phi2-2.*phi3))>
10424 // 9th bin: <3>_{4n|3n,1n} = three4n3n1n = <cos(n*(4.*phi1-3.*phi2-phi3))>
10425 // 10th bin: ---- EMPTY ----
10426 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1n = <cos(n*(phi1+phi2-phi3-phi4))>
10427 // 12th bin: <4>_{2n,1n|2n,1n} = four2n1n2n1n = <cos(2.*n*(phi1+phi2-phi3-phi4))>
10428 // 13th bin: <4>_{2n,2n|2n,2n} = four2n2n2n2n = <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>
10429 // 14th bin: <4>_{3n|1n,1n,1n} = four3n1n1n1n = <cos(n*(3.*phi1-phi2-phi3-phi4))>
10430 // 15th bin: <4>_{3n,1n|3n,1n} = four3n1n3n1n = <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>
10431 // 16th bin: <4>_{3n,1n|2n,2n} = four3n1n2n2n = <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>
10432 // 17th bin: <4>_{4n|2n,1n,1n} = four4n2n1n1n = <cos(n*(3.*phi1+phi2-3.*phi3-phi4))>
10433 // 18th bin: ---- EMPTY ----
10434 // 19th bin: <5>_{2n|1n,1n,1n,1n} = five2n1n1n1n1n = <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>
10435 // 20th bin: <5>_{2n,2n|2n,1n,1n} = five2n2n2n1n1n = <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>
10436 // 21st bin: <5>_{3n,1n|2n,1n,1n} = five3n1n2n1n1n = <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>
10437 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = five4n1n1n1n1n = <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>
10438 // 23rd bin: ---- EMPTY ----
10439 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = six1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
10440 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = six2n1n1n2n1n1n = <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>
10441 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = six2n2n1n1n1n1n = <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>
10442 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = six3n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>
10443 // 28th bin: ---- EMPTY ----
10444 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = seven2n1n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
10445 // 30th bin: ---- EMPTY ----
10446 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = eight1n1n1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
10447 // 32nd bin: ---- EMPTY ----
10448 // 33rd bin: <4>_{4n,2n|3n,3n}= four4n2n3n3n = <cos(n*(4.*phi1+2.*phi2-3.*phi3-3.*phi4))>
10449 // 34th bin: <5>_{2n,2n,2n|3n,3n} = five2n2n2n3n3n = <cos(n*(2.*phi1+2.*phi2+2.*phi3-3.*phi4-3.*phi5))>
10451 Int_t nPrim = anEvent->NumberOfTracks();
10452 AliFlowTrackSimple *aftsTrack = NULL;
10453 Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
10454 Int_t n = fHarmonic;
10455 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
10456 Double_t dMult = (*fSMpk)(0,0);
10458 cout<<"Multiparticle correlations: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
10461 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
10462 } else if (dMult>fMaxAllowedMultiplicity)
10464 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
10467 cout<<"... evaluating nested loops (without using particle weights)..."<<endl;
10470 // 2-particle correlations:
10471 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
10473 for(Int_t i1=0;i1<nPrim;i1++)
10475 aftsTrack=anEvent->GetTrack(i1);
10476 if(!(aftsTrack->InRPSelection())) continue;
10477 phi1=aftsTrack->Phi();
10478 for(Int_t i2=0;i2<nPrim;i2++)
10480 if(i2==i1)continue;
10481 aftsTrack=anEvent->GetTrack(i2);
10482 if(!(aftsTrack->InRPSelection())) continue;
10483 phi2=aftsTrack->Phi();
10484 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
10485 // fill the profile with 2-p correlations:
10486 fIntFlowDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),1.); // <cos(n*(phi1-phi2))>
10487 fIntFlowDirectCorrelations->Fill(1.5,cos(2.*n*(phi1-phi2)),1.); // <cos(2n*(phi1-phi2))>
10488 fIntFlowDirectCorrelations->Fill(2.5,cos(3.*n*(phi1-phi2)),1.); // <cos(3n*(phi1-phi2))>
10489 fIntFlowDirectCorrelations->Fill(3.5,cos(4.*n*(phi1-phi2)),1.); // <cos(4n*(phi1-phi2))>
10490 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10491 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10492 } // end of if(nPrim>=2)
10494 // 3-particle correlations:
10495 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
10497 for(Int_t i1=0;i1<nPrim;i1++)
10499 aftsTrack=anEvent->GetTrack(i1);
10500 if(!(aftsTrack->InRPSelection())) continue;
10501 phi1=aftsTrack->Phi();
10502 for(Int_t i2=0;i2<nPrim;i2++)
10504 if(i2==i1)continue;
10505 aftsTrack=anEvent->GetTrack(i2);
10506 if(!(aftsTrack->InRPSelection())) continue;
10507 phi2=aftsTrack->Phi();
10508 for(Int_t i3=0;i3<nPrim;i3++)
10510 if(i3==i1||i3==i2)continue;
10511 aftsTrack=anEvent->GetTrack(i3);
10512 if(!(aftsTrack->InRPSelection())) continue;
10513 phi3=aftsTrack->Phi();
10514 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;
10515 // fill the profile with 3-p correlations:
10516 fIntFlowDirectCorrelations->Fill(5.,cos(2.*n*phi1-n*(phi2+phi3)),1.); //<3>_{2n|nn,n}
10517 fIntFlowDirectCorrelations->Fill(6.,cos(3.*n*phi1-2.*n*phi2-n*phi3),1.); //<3>_{3n|2n,n}
10518 fIntFlowDirectCorrelations->Fill(7.,cos(4.*n*phi1-2.*n*phi2-2.*n*phi3),1.); //<3>_{4n|2n,2n}
10519 fIntFlowDirectCorrelations->Fill(8.,cos(4.*n*phi1-3.*n*phi2-n*phi3),1.); //<3>_{4n|3n,n}
10520 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10521 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10522 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10523 } // end of if(nPrim>=3)
10525 // 4-particle correlations:
10526 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)
10528 for(Int_t i1=0;i1<nPrim;i1++)
10530 aftsTrack=anEvent->GetTrack(i1);
10531 if(!(aftsTrack->InRPSelection())) continue;
10532 phi1=aftsTrack->Phi();
10533 for(Int_t i2=0;i2<nPrim;i2++)
10535 if(i2==i1)continue;
10536 aftsTrack=anEvent->GetTrack(i2);
10537 if(!(aftsTrack->InRPSelection())) continue;
10538 phi2=aftsTrack->Phi();
10539 for(Int_t i3=0;i3<nPrim;i3++)
10541 if(i3==i1||i3==i2)continue;
10542 aftsTrack=anEvent->GetTrack(i3);
10543 if(!(aftsTrack->InRPSelection())) continue;
10544 phi3=aftsTrack->Phi();
10545 for(Int_t i4=0;i4<nPrim;i4++)
10547 if(i4==i1||i4==i2||i4==i3)continue;
10548 aftsTrack=anEvent->GetTrack(i4);
10549 if(!(aftsTrack->InRPSelection())) continue;
10550 phi4=aftsTrack->Phi();
10551 if(nPrim==4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush;
10552 // fill the profile with 4-p correlations:
10553 fIntFlowDirectCorrelations->Fill(10.,cos(n*phi1+n*phi2-n*phi3-n*phi4),1.); // <4>_{n,n|n,n}
10554 fIntFlowDirectCorrelations->Fill(11.,cos(2.*n*phi1+n*phi2-2.*n*phi3-n*phi4),1.); // <4>_{2n,n|2n,n}
10555 fIntFlowDirectCorrelations->Fill(12.,cos(2.*n*phi1+2*n*phi2-2.*n*phi3-2.*n*phi4),1.); // <4>_{2n,2n|2n,2n}
10556 fIntFlowDirectCorrelations->Fill(13.,cos(3.*n*phi1-n*phi2-n*phi3-n*phi4),1.); // <4>_{3n|n,n,n}
10557 fIntFlowDirectCorrelations->Fill(14.,cos(3.*n*phi1+n*phi2-3.*n*phi3-n*phi4),1.); // <4>_{3n,n|3n,n}
10558 fIntFlowDirectCorrelations->Fill(15.,cos(3.*n*phi1+n*phi2-2.*n*phi3-2.*n*phi4),1.); // <4>_{3n,n|2n,2n}
10559 fIntFlowDirectCorrelations->Fill(16.,cos(4.*n*phi1-2.*n*phi2-n*phi3-n*phi4),1.); // <4>_{4n|2n,n,n}
10560 fIntFlowDirectCorrelations->Fill(32.,cos(n*(4.*phi1+2.*phi2-3.*phi3-3.*phi4)),1.); // <4>_{4n,2n|3n,3n}
10561 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10562 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10563 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10564 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10565 } // end of if(nPrim>=)
10567 // 5-particle correlations:
10568 if(nPrim>=5 && nPrim<=fMaxAllowedMultiplicity)
10570 for(Int_t i1=0;i1<nPrim;i1++)
10572 aftsTrack=anEvent->GetTrack(i1);
10573 if(!(aftsTrack->InRPSelection())) continue;
10574 phi1=aftsTrack->Phi();
10575 for(Int_t i2=0;i2<nPrim;i2++)
10577 if(i2==i1)continue;
10578 aftsTrack=anEvent->GetTrack(i2);
10579 if(!(aftsTrack->InRPSelection())) continue;
10580 phi2=aftsTrack->Phi();
10581 for(Int_t i3=0;i3<nPrim;i3++)
10583 if(i3==i1||i3==i2)continue;
10584 aftsTrack=anEvent->GetTrack(i3);
10585 if(!(aftsTrack->InRPSelection())) continue;
10586 phi3=aftsTrack->Phi();
10587 for(Int_t i4=0;i4<nPrim;i4++)
10589 if(i4==i1||i4==i2||i4==i3)continue;
10590 aftsTrack=anEvent->GetTrack(i4);
10591 if(!(aftsTrack->InRPSelection())) continue;
10592 phi4=aftsTrack->Phi();
10593 for(Int_t i5=0;i5<nPrim;i5++)
10595 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
10596 aftsTrack=anEvent->GetTrack(i5);
10597 if(!(aftsTrack->InRPSelection())) continue;
10598 phi5=aftsTrack->Phi();
10599 if(nPrim==5) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<"\r"<<flush;
10600 // fill the profile with 5-p correlations:
10601 fIntFlowDirectCorrelations->Fill(18.,cos(2.*n*phi1+n*phi2-n*phi3-n*phi4-n*phi5),1.); //<5>_{2n,n|n,n,n}
10602 fIntFlowDirectCorrelations->Fill(19.,cos(2.*n*phi1+2.*n*phi2-2.*n*phi3-n*phi4-n*phi5),1.); //<5>_{2n,2n|2n,n,n}
10603 fIntFlowDirectCorrelations->Fill(20.,cos(3.*n*phi1+n*phi2-2.*n*phi3-n*phi4-n*phi5),1.); //<5>_{3n,n|2n,n,n}
10604 fIntFlowDirectCorrelations->Fill(21.,cos(4.*n*phi1-n*phi2-n*phi3-n*phi4-n*phi5),1.); //<5>_{4n|n,n,n,n}
10605 fIntFlowDirectCorrelations->Fill(33.,cos(2.*n*phi1+2.*n*phi2+2.*n*phi3-3.*n*phi4-3.*n*phi5),1.);
10606 } // end of for(Int_t i5=0;i5<nPrim;i5++)
10607 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10608 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10609 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10610 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10611 } // end of if(nPrim>=5)
10613 // 6-particle correlations:
10614 if(nPrim>=6 && nPrim<=fMaxAllowedMultiplicity)
10616 for(Int_t i1=0;i1<nPrim;i1++)
10618 aftsTrack=anEvent->GetTrack(i1);
10619 if(!(aftsTrack->InRPSelection())) continue;
10620 phi1=aftsTrack->Phi();
10621 for(Int_t i2=0;i2<nPrim;i2++)
10623 if(i2==i1)continue;
10624 aftsTrack=anEvent->GetTrack(i2);
10625 if(!(aftsTrack->InRPSelection())) continue;
10626 phi2=aftsTrack->Phi();
10627 for(Int_t i3=0;i3<nPrim;i3++)
10629 if(i3==i1||i3==i2)continue;
10630 aftsTrack=anEvent->GetTrack(i3);
10631 if(!(aftsTrack->InRPSelection())) continue;
10632 phi3=aftsTrack->Phi();
10633 for(Int_t i4=0;i4<nPrim;i4++)
10635 if(i4==i1||i4==i2||i4==i3)continue;
10636 aftsTrack=anEvent->GetTrack(i4);
10637 if(!(aftsTrack->InRPSelection())) continue;
10638 phi4=aftsTrack->Phi();
10639 for(Int_t i5=0;i5<nPrim;i5++)
10641 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
10642 aftsTrack=anEvent->GetTrack(i5);
10643 if(!(aftsTrack->InRPSelection())) continue;
10644 phi5=aftsTrack->Phi();
10645 for(Int_t i6=0;i6<nPrim;i6++)
10647 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
10648 aftsTrack=anEvent->GetTrack(i6);
10649 if(!(aftsTrack->InRPSelection())) continue;
10650 phi6=aftsTrack->Phi();
10651 if(nPrim==6) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<"\r"<<flush;
10652 // fill the profile with 6-p correlations:
10653 fIntFlowDirectCorrelations->Fill(23.,cos(n*phi1+n*phi2+n*phi3-n*phi4-n*phi5-n*phi6),1.); //<6>_{n,n,n|n,n,n}
10654 fIntFlowDirectCorrelations->Fill(24.,cos(2.*n*phi1+n*phi2+n*phi3-2.*n*phi4-n*phi5-n*phi6),1.); //<6>_{2n,n,n|2n,n,n}
10655 fIntFlowDirectCorrelations->Fill(25.,cos(2.*n*phi1+2.*n*phi2-n*phi3-n*phi4-n*phi5-n*phi6),1.); //<6>_{2n,2n|n,n,n,n}
10656 fIntFlowDirectCorrelations->Fill(26.,cos(3.*n*phi1+n*phi2-n*phi3-n*phi4-n*phi5-n*phi6),1.); //<6>_{3n,n|n,n,n,n}
10657 } // end of for(Int_t i6=0;i6<nPrim;i6++)
10658 } // end of for(Int_t i5=0;i5<nPrim;i5++)
10659 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10660 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10661 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10662 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10663 } // end of if(nPrim>=6)
10665 // 7-particle correlations:
10666 if(nPrim>=7 && nPrim<=fMaxAllowedMultiplicity)
10668 for(Int_t i1=0;i1<nPrim;i1++)
10670 aftsTrack=anEvent->GetTrack(i1);
10671 if(!(aftsTrack->InRPSelection())) continue;
10672 phi1=aftsTrack->Phi();
10673 for(Int_t i2=0;i2<nPrim;i2++)
10675 if(i2==i1)continue;
10676 aftsTrack=anEvent->GetTrack(i2);
10677 if(!(aftsTrack->InRPSelection())) continue;
10678 phi2=aftsTrack->Phi();
10679 for(Int_t i3=0;i3<nPrim;i3++)
10681 if(i3==i1||i3==i2)continue;
10682 aftsTrack=anEvent->GetTrack(i3);
10683 if(!(aftsTrack->InRPSelection())) continue;
10684 phi3=aftsTrack->Phi();
10685 for(Int_t i4=0;i4<nPrim;i4++)
10687 if(i4==i1||i4==i2||i4==i3)continue;
10688 aftsTrack=anEvent->GetTrack(i4);
10689 if(!(aftsTrack->InRPSelection())) continue;
10690 phi4=aftsTrack->Phi();
10691 for(Int_t i5=0;i5<nPrim;i5++)
10693 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
10694 aftsTrack=anEvent->GetTrack(i5);
10695 if(!(aftsTrack->InRPSelection())) continue;
10696 phi5=aftsTrack->Phi();
10697 for(Int_t i6=0;i6<nPrim;i6++)
10699 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
10700 aftsTrack=anEvent->GetTrack(i6);
10701 if(!(aftsTrack->InRPSelection())) continue;
10702 phi6=aftsTrack->Phi();
10703 for(Int_t i7=0;i7<nPrim;i7++)
10705 if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;
10706 aftsTrack=anEvent->GetTrack(i7);
10707 if(!(aftsTrack->InRPSelection())) continue;
10708 phi7=aftsTrack->Phi();
10709 if(nPrim==7) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<" "<<i7<<"\r"<<flush;
10710 // fill the profile with 7-p correlation:
10711 fIntFlowDirectCorrelations->Fill(28.,cos(2.*n*phi1+n*phi2+n*phi3-n*phi4-n*phi5-n*phi6-n*phi7),1.); // <7>_{2n,n,n|n,n,n,n}
10712 } // end of for(Int_t i7=0;i7<nPrim;i7++)
10713 } // end of for(Int_t i6=0;i6<nPrim;i6++)
10714 } // end of for(Int_t i5=0;i5<nPrim;i5++)
10715 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10716 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10717 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10718 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10719 } // end of if(nPrim>=7)
10721 // 8-particle correlations:
10722 if(nPrim>=8 && nPrim<=fMaxAllowedMultiplicity)
10724 for(Int_t i1=0;i1<nPrim;i1++)
10726 aftsTrack=anEvent->GetTrack(i1);
10727 if(!(aftsTrack->InRPSelection())) continue;
10728 phi1=aftsTrack->Phi();
10729 for(Int_t i2=0;i2<nPrim;i2++)
10731 if(i2==i1)continue;
10732 aftsTrack=anEvent->GetTrack(i2);
10733 if(!(aftsTrack->InRPSelection())) continue;
10734 phi2=aftsTrack->Phi();
10735 for(Int_t i3=0;i3<nPrim;i3++)
10737 if(i3==i1||i3==i2)continue;
10738 aftsTrack=anEvent->GetTrack(i3);
10739 if(!(aftsTrack->InRPSelection())) continue;
10740 phi3=aftsTrack->Phi();
10741 for(Int_t i4=0;i4<nPrim;i4++)
10743 if(i4==i1||i4==i2||i4==i3)continue;
10744 aftsTrack=anEvent->GetTrack(i4);
10745 if(!(aftsTrack->InRPSelection())) continue;
10746 phi4=aftsTrack->Phi();
10747 for(Int_t i5=0;i5<nPrim;i5++)
10749 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
10750 aftsTrack=anEvent->GetTrack(i5);
10751 if(!(aftsTrack->InRPSelection())) continue;
10752 phi5=aftsTrack->Phi();
10753 for(Int_t i6=0;i6<nPrim;i6++)
10755 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
10756 aftsTrack=anEvent->GetTrack(i6);
10757 if(!(aftsTrack->InRPSelection())) continue;
10758 phi6=aftsTrack->Phi();
10759 for(Int_t i7=0;i7<nPrim;i7++)
10761 if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;
10762 aftsTrack=anEvent->GetTrack(i7);
10763 if(!(aftsTrack->InRPSelection())) continue;
10764 phi7=aftsTrack->Phi();
10765 for(Int_t i8=0;i8<nPrim;i8++)
10767 if(i8==i1||i8==i2||i8==i3||i8==i4||i8==i5||i8==i6||i8==i7)continue;
10768 aftsTrack=anEvent->GetTrack(i8);
10769 if(!(aftsTrack->InRPSelection())) continue;
10770 phi8=aftsTrack->Phi();
10771 cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<" "<<i7<<" "<<i8<<"\r"<<flush;
10772 // fill the profile with 8-p correlation:
10773 fIntFlowDirectCorrelations->Fill(30.,cos(n*phi1+n*phi2+n*phi3+n*phi4-n*phi5-n*phi6-n*phi7-n*phi8),1.); // <8>_{n,n,n,n|n,n,n,n}
10774 } // end of for(Int_t i8=0;i8<nPrim;i8++)
10775 } // end of for(Int_t i7=0;i7<nPrim;i7++)
10776 } // end of for(Int_t i6=0;i6<nPrim;i6++)
10777 } // end of for(Int_t i5=0;i5<nPrim;i5++)
10778 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10779 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10780 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10781 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10782 } // end of if(nPrim>=8)
10786 } // end of AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoops(AliFlowEventSimple* anEvent)
10789 //==================================================================================================================================
10792 void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrelations()
10794 // Cross-check results for multiparticle correlations needed for int. flow: results from Q-vectors vs results from nested loops.
10798 cout<<" *****************************************"<<endl;
10799 cout<<" **** cross-checking the correlations ****"<<endl;
10800 cout<<" **** for integrated flow ****"<<endl;
10801 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
10803 cout<<" **** (particle weights not used) ****"<<endl;
10806 cout<<" **** (particle weights used) ****"<<endl;
10808 cout<<" *****************************************"<<endl;
10812 Int_t ciMax = 34; // to be improved (removed eventually when I calculate 6th and 8th order with particle weights)
10814 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
10819 for(Int_t ci=1;ci<=ciMax;ci++)
10821 if(strcmp((fIntFlowCorrelationsAllPro->GetXaxis())->GetBinLabel(ci), "") == 0) continue; // to be improved (access finalized histogram here)
10822 cout<<(fIntFlowCorrelationsAllPro->GetXaxis())->GetBinLabel(ci)<<":"<<endl; // to be improved (access finalized histogram here)
10823 cout<<"from Q-vectors = "<<fIntFlowCorrelationsAllPro->GetBinContent(ci)<<endl; // to be improved (access finalized histogram here)
10824 cout<<"from nested loops = "<<fIntFlowDirectCorrelations->GetBinContent(ci)<<endl;
10828 } // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrelations()
10831 //================================================================================================================================
10834 void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrectionTermsForNUA()
10836 // Cross-check results for corrections terms for non-uniform acceptance needed for int. flow: results from Q-vectors vs results from nested loops.
10840 cout<<" *********************************************"<<endl;
10841 cout<<" **** cross-checking the correction terms ****"<<endl;
10842 cout<<" **** for non-uniform acceptance relevant ****"<<endl;
10843 cout<<" **** for integrated flow ****"<<endl;
10844 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
10846 cout<<" **** (particle weights not used) ****"<<endl;
10849 cout<<" **** (particle weights used) ****"<<endl;
10851 cout<<" *********************************************"<<endl;
10855 for(Int_t ci=1;ci<=4;ci++) // correction term index (to be improved - hardwired 4)
10857 for(Int_t sc=0;sc<2;sc++) // sin or cos term
10859 if(strcmp((fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->GetBinLabel(ci), "") == 0) continue; // to be improved (access finalized histogram here)
10860 cout<<(fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->GetBinLabel(ci)<<":"<<endl; // to be improved (access finalized histogram here)
10861 cout<<"from Q-vectors = "<<fIntFlowCorrectionTermsForNUAPro[sc]->GetBinContent(ci)<<endl; // to be improved (access finalized histogram here)
10862 cout<<"from nested loops = "<<fIntFlowDirectCorrectionTermsForNUA[sc]->GetBinContent(ci)<<endl;
10864 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos term
10865 } // end of for(Int_t ci=1;ci<=10;ci++) // correction term index
10867 } // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrectionTermsForNUA()
10870 //================================================================================================================================
10873 void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent)
10875 // Evaluate with nested loops multiparticle correlations for integrated flow (using the particle weights).
10877 // Results are stored in profile fIntFlowDirectCorrelations.
10878 // Remark 1: When particle weights are used the binning of fIntFlowDirectCorrelations is organized as follows:
10880 // 1st bin: <2>_{1n|1n} = two1n1nW1W1 = <w1 w2 cos(n*(phi1-phi2))>
10881 // 2nd bin: <2>_{2n|2n} = two2n2nW2W2 = <w1^2 w2^2 cos(2n*(phi1-phi2))>
10882 // 3rd bin: <2>_{3n|3n} = two3n3nW3W3 = <w1^3 w2^3 cos(3n*(phi1-phi2))>
10883 // 4th bin: <2>_{4n|4n} = two4n4nW4W4 = <w1^4 w2^4 cos(4n*(phi1-phi2))>
10884 // 5th bin: ---- EMPTY ----
10885 // 6th bin: <3>_{2n|1n,1n} = three2n1n1nW2W1W1 = <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
10886 // 7th bin: <3>_{3n|2n,1n} = ...
10887 // 8th bin: <3>_{4n|2n,2n} = ...
10888 // 9th bin: <3>_{4n|3n,1n} = ...
10889 // 10th bin: ---- EMPTY ----
10890 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1nW1W1W1W1 = <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
10891 // 12th bin: <4>_{2n,1n|2n,1n} = ...
10892 // 13th bin: <4>_{2n,2n|2n,2n} = ...
10893 // 14th bin: <4>_{3n|1n,1n,1n} = ...
10894 // 15th bin: <4>_{3n,1n|3n,1n} = ...
10895 // 16th bin: <4>_{3n,1n|2n,2n} = ...
10896 // 17th bin: <4>_{4n|2n,1n,1n} = ...
10897 // 18th bin: ---- EMPTY ----
10898 // 19th bin: <5>_{2n|1n,1n,1n,1n} = ...
10899 // 20th bin: <5>_{2n,2n|2n,1n,1n} = ...
10900 // 21st bin: <5>_{3n,1n|2n,1n,1n} = ...
10901 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = ...
10902 // 23rd bin: ---- EMPTY ----
10903 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = ...
10904 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = ...
10905 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = ...
10906 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = ...
10907 // 28th bin: ---- EMPTY ----
10908 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = ...
10909 // 30th bin: ---- EMPTY ----
10910 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = ...
10912 // Remark 2: When particle weights are used there are some extra correlations. They are stored in
10913 // fIntFlowExtraDirectCorrelations binning of which is organized as follows:
10915 // 1st bin: two1n1nW3W1 = <w1^3 w2 cos(n*(phi1-phi2))>
10916 // 2nd bin: two1n1nW1W1W2 = <w1 w2 w3^2 cos(n*(phi1-phi2))>
10919 Int_t nPrim = anEvent->NumberOfTracks();
10920 AliFlowTrackSimple *aftsTrack = NULL;
10921 //Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
10922 //Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1., wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
10923 Double_t phi1=0., phi2=0., phi3=0., phi4=0.;
10924 Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1.;
10925 Int_t n = fHarmonic;
10926 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
10927 Double_t dMult = (*fSMpk)(0,0);
10929 cout<<"Multiparticle correlations: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
10932 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
10933 } else if (dMult>fMaxAllowedMultiplicity)
10935 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
10938 cout<<"... evaluating nested loops (using particle weights) ..."<<endl;
10941 // 2-particle correlations:
10942 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
10944 // 2 nested loops multiparticle correlations using particle weights:
10945 for(Int_t i1=0;i1<nPrim;i1++)
10947 aftsTrack=anEvent->GetTrack(i1);
10948 if(!(aftsTrack->InRPSelection())) continue;
10949 phi1=aftsTrack->Phi();
10950 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
10951 for(Int_t i2=0;i2<nPrim;i2++)
10953 if(i2==i1)continue;
10954 aftsTrack=anEvent->GetTrack(i2);
10955 if(!(aftsTrack->InRPSelection())) continue;
10956 phi2=aftsTrack->Phi();
10957 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
10958 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
10959 // 2-p correlations using particle weights:
10960 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),wPhi1*wPhi2); // <w1 w2 cos( n*(phi1-phi2))>
10961 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(1.5,cos(2.*n*(phi1-phi2)),pow(wPhi1,2)*pow(wPhi2,2)); // <w1^2 w2^2 cos(2n*(phi1-phi2))>
10962 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(2.5,cos(3.*n*(phi1-phi2)),pow(wPhi1,3)*pow(wPhi2,3)); // <w1^3 w2^3 cos(3n*(phi1-phi2))>
10963 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(3.5,cos(4.*n*(phi1-phi2)),pow(wPhi1,4)*pow(wPhi2,4)); // <w1^4 w2^4 cos(4n*(phi1-phi2))>
10964 // extra correlations:
10965 // 2-p extra correlations (do not appear if particle weights are not used):
10966 if(fUsePhiWeights) fIntFlowExtraDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),pow(wPhi1,3)*wPhi2); // <w1^3 w2 cos(n*(phi1-phi2))>
10968 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10969 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10970 } // end of if(nPrim>=2)
10972 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
10974 // 3 nested loops multiparticle correlations using particle weights:
10975 for(Int_t i1=0;i1<nPrim;i1++)
10977 aftsTrack=anEvent->GetTrack(i1);
10978 if(!(aftsTrack->InRPSelection())) continue;
10979 phi1=aftsTrack->Phi();
10980 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
10981 for(Int_t i2=0;i2<nPrim;i2++)
10983 if(i2==i1)continue;
10984 aftsTrack=anEvent->GetTrack(i2);
10985 if(!(aftsTrack->InRPSelection())) continue;
10986 phi2=aftsTrack->Phi();
10987 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
10988 for(Int_t i3=0;i3<nPrim;i3++)
10990 if(i3==i1||i3==i2)continue;
10991 aftsTrack=anEvent->GetTrack(i3);
10992 if(!(aftsTrack->InRPSelection())) continue;
10993 phi3=aftsTrack->Phi();
10994 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
10995 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;
10996 // 3-p correlations using particle weights:
10997 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(5.5,cos(2.*n*phi1-n*(phi2+phi3)),pow(wPhi1,2)*wPhi2*wPhi3); // <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
10999 // extra correlations:
11000 // 2-p extra correlations (do not appear if particle weights are not used):
11001 if(fUsePhiWeights) fIntFlowExtraDirectCorrelations->Fill(1.5,cos(n*(phi1-phi2)),wPhi1*wPhi2*pow(wPhi3,2)); // <w1 w2 w3^2 cos(n*(phi1-phi2))>
11003 // 3-p extra correlations (do not appear if particle weights are not used):
11005 } // end of for(Int_t i3=0;i3<nPrim;i3++)
11006 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11007 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11008 } // end of if(nPrim>=3)
11010 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)
11012 // 4 nested loops multiparticle correlations using particle weights:
11013 for(Int_t i1=0;i1<nPrim;i1++)
11015 aftsTrack=anEvent->GetTrack(i1);
11016 if(!(aftsTrack->InRPSelection())) continue;
11017 phi1=aftsTrack->Phi();
11018 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
11019 for(Int_t i2=0;i2<nPrim;i2++)
11021 if(i2==i1)continue;
11022 aftsTrack=anEvent->GetTrack(i2);
11023 if(!(aftsTrack->InRPSelection())) continue;
11024 phi2=aftsTrack->Phi();
11025 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
11026 for(Int_t i3=0;i3<nPrim;i3++)
11028 if(i3==i1||i3==i2)continue;
11029 aftsTrack=anEvent->GetTrack(i3);
11030 if(!(aftsTrack->InRPSelection())) continue;
11031 phi3=aftsTrack->Phi();
11032 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
11033 for(Int_t i4=0;i4<nPrim;i4++)
11035 if(i4==i1||i4==i2||i4==i3)continue;
11036 aftsTrack=anEvent->GetTrack(i4);
11037 if(!(aftsTrack->InRPSelection())) continue;
11038 phi4=aftsTrack->Phi();
11039 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
11040 if(nPrim>=4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush; // to be improved (replace eventually this if statement with if(nPrim==4))
11041 // 4-p correlations using particle weights:
11042 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(10.5,cos(n*phi1+n*phi2-n*phi3-n*phi4),wPhi1*wPhi2*wPhi3*wPhi4);
11043 // extra correlations:
11044 // 2-p extra correlations (do not appear if particle weights are not used):
11046 // 3-p extra correlations (do not appear if particle weights are not used):
11048 // 4-p extra correlations (do not appear if particle weights are not used):
11050 } // end of for(Int_t i4=0;i4<nPrim;i4++)
11051 } // end of for(Int_t i3=0;i3<nPrim;i3++)
11052 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11053 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11054 } // end of if(nPrim>=4)
11058 } // end of void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent)
11061 //================================================================================================================================
11064 void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowExtraCorrelations()
11066 // Cross-check results for extra multiparticle correlations needed for int. flow
11067 // which appear only when particle weights are used: results from Q-vectors vs results from nested loops.
11071 cout<<" ***********************************************"<<endl;
11072 cout<<" **** cross-checking the extra correlations ****"<<endl;
11073 cout<<" **** for integrated flow ****"<<endl;
11074 cout<<" ***********************************************"<<endl;
11078 for(Int_t eci=1;eci<=2;eci++) // to be improved (increased eciMax eventually when I calculate 6th and 8th)
11080 if(strcmp((fIntFlowExtraCorrelationsPro->GetXaxis())->GetBinLabel(eci), "") == 0) continue;
11081 cout<<(fIntFlowExtraCorrelationsPro->GetXaxis())->GetBinLabel(eci)<<":"<<endl;
11082 cout<<"from Q-vectors = "<<fIntFlowExtraCorrelationsPro->GetBinContent(eci)<<endl;
11083 cout<<"from nested loops = "<<fIntFlowExtraDirectCorrelations->GetBinContent(eci)<<endl;
11087 } // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowExtraCorrelations()
11090 //================================================================================================================================
11093 void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoops(AliFlowEventSimple * const anEvent)
11095 // Evaluate with nested loops correction terms for non-uniform acceptance relevant for NONAME integrated flow (to be improved (name)).
11097 // Remark: Both sin and cos correction terms are calculated in this method. Sin terms are stored in fIntFlowDirectCorrectionTermsForNUA[0],
11098 // and cos terms in fIntFlowDirectCorrectionTermsForNUA[1]. Binning of fIntFlowDirectCorrectionTermsForNUA[sc] is organized as follows
11099 // (sc stands for either sin or cos):
11101 // 1st bin: <<sc(n*(phi1))>>
11102 // 2nd bin: <<sc(n*(phi1+phi2))>>
11103 // 3rd bin: <<sc(n*(phi1-phi2-phi3))>>
11104 // 4th bin: <<sc(n*(2phi1-phi2))>>
11106 Int_t nPrim = anEvent->NumberOfTracks();
11107 AliFlowTrackSimple *aftsTrack = NULL;
11108 Double_t phi1=0., phi2=0., phi3=0.;
11109 Int_t n = fHarmonic;
11110 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
11111 Double_t dMult = (*fSMpk)(0,0);
11113 cout<<"Correction terms for non-uniform acceptance: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
11116 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
11117 } else if (dMult>fMaxAllowedMultiplicity)
11119 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
11122 cout<<"... evaluating nested loops (without using particle weights)..."<<endl;
11125 if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)
11127 // 1-particle correction terms for non-uniform acceptance:
11128 for(Int_t i1=0;i1<nPrim;i1++)
11130 aftsTrack=anEvent->GetTrack(i1);
11131 if(!(aftsTrack->InRPSelection())) continue;
11132 phi1=aftsTrack->Phi();
11133 if(nPrim==1) cout<<i1<<"\r"<<flush;
11135 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(0.5,sin(n*phi1),1.); // <sin(n*phi1)>
11137 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(0.5,cos(n*phi1),1.); // <cos(n*phi1)>
11138 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11139 } // end of if(nPrim>=1)
11141 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
11143 // 2-particle correction terms for non-uniform acceptance:
11144 for(Int_t i1=0;i1<nPrim;i1++)
11146 aftsTrack=anEvent->GetTrack(i1);
11147 if(!(aftsTrack->InRPSelection())) continue;
11148 phi1=aftsTrack->Phi();
11149 for(Int_t i2=0;i2<nPrim;i2++)
11151 if(i2==i1)continue;
11152 aftsTrack=anEvent->GetTrack(i2);
11153 if(!(aftsTrack->InRPSelection())) continue;
11154 phi2=aftsTrack->Phi();
11155 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
11157 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(1.5,sin(n*(phi1+phi2)),1.); // <<sin(n*(phi1+phi2))>>
11158 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(3.5,sin(n*(2*phi1-phi2)),1.); // <<sin(n*(2*phi1-phi2))>>
11160 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(1.5,cos(n*(phi1+phi2)),1.); // <<cos(n*(phi1+phi2))>>
11161 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(3.5,cos(n*(2*phi1-phi2)),1.); // <<cos(n*(2*phi1-phi2))>>
11162 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11163 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11164 } // end of if(nPrim>=2)
11166 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
11168 // 3-particle correction terms for non-uniform acceptance:
11169 for(Int_t i1=0;i1<nPrim;i1++)
11171 aftsTrack=anEvent->GetTrack(i1);
11172 if(!(aftsTrack->InRPSelection())) continue;
11173 phi1=aftsTrack->Phi();
11174 for(Int_t i2=0;i2<nPrim;i2++)
11176 if(i2==i1)continue;
11177 aftsTrack=anEvent->GetTrack(i2);
11178 if(!(aftsTrack->InRPSelection())) continue;
11179 phi2=aftsTrack->Phi();
11180 for(Int_t i3=0;i3<nPrim;i3++)
11182 if(i3==i1||i3==i2)continue;
11183 aftsTrack=anEvent->GetTrack(i3);
11184 if(!(aftsTrack->InRPSelection())) continue;
11185 phi3=aftsTrack->Phi();
11186 if(nPrim>=3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush; // to be improved (eventually I will change this if statement)
11188 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(2.5,sin(n*(phi1-phi2-phi3)),1.); // <<sin(n*(phi1-phi2-phi3))>>
11190 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(2.5,cos(n*(phi1-phi2-phi3)),1.); // <<cos(n*(phi1-phi2-phi3))>>
11191 } // end of for(Int_t i3=0;i3<nPrim;i3++)
11192 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11193 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11194 } // end of if(nPrim>=3)
11198 //================================================================================================================================
11199 void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoops(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
11201 // Evaluate reduced correlations with nested loops without using the particle weights.
11203 // Remark 1: Reduced correlations are evaluated in pt bin number fCrossCheckInPtBinNo and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
11204 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrelations[t][pe][ci], where indices runs as follows:
11205 // [0=RP,1=POI][0=Pt,1=Eta][0=<2'>,1=<4'>,2=<6'>,3=<8'>]
11206 // Remark 3: <2'> = <cos(n*(psi1-phi2))>
11207 // <4'> = <cos(n*(psi1+phi2-phi3-phi4))>
11210 Int_t typeFlag = 0;
11211 Int_t ptEtaFlag = 0;
11215 } else if(type == "POI")
11219 if(ptOrEta == "Pt")
11222 } else if(ptOrEta == "Eta")
11227 Int_t t = typeFlag;
11228 Int_t pe = ptEtaFlag;
11230 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
11231 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
11232 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
11234 Int_t nPrim = anEvent->NumberOfTracks();
11235 AliFlowTrackSimple *aftsTrack = NULL;
11237 Double_t psi1=0., phi2=0., phi3=0., phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
11239 Int_t n = fHarmonic;
11241 // 2'-particle correlations:
11242 for(Int_t i1=0;i1<nPrim;i1++)
11244 aftsTrack=anEvent->GetTrack(i1);
11245 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11246 if(typeFlag==1) // this is diff flow of POIs
11248 if(ptOrEta == "Pt")
11250 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11251 } else if (ptOrEta == "Eta")
11253 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11255 } else // this is diff flow of RPs
11257 if(ptOrEta == "Pt")
11259 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11260 } else if (ptOrEta == "Eta")
11262 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11266 psi1=aftsTrack->Phi();
11267 for(Int_t i2=0;i2<nPrim;i2++)
11269 if(i2==i1)continue;
11270 aftsTrack=anEvent->GetTrack(i2);
11271 // RP condition (!(first) particle in the correlator must be RP):
11272 if(!(aftsTrack->InRPSelection()))continue;
11273 phi2=aftsTrack->Phi();
11274 // 2'-particle correlations:
11275 fDiffFlowDirectCorrelations[t][pe][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(1.*n*(psi1-phi2)),1.); // <cos(n*(psi1-phi2))
11276 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11277 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11281 // 3'-particle correlations:
11282 for(Int_t i1=0;i1<nPrim;i1++)
11284 aftsTrack=anEvent->GetTrack(i1);
11285 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11286 if(ptOrEta == "Pt")
11288 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11289 } else if (ptOrEta == "Eta")
11291 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11293 psi1=aftsTrack->Phi();
11294 for(Int_t i2=0;i2<nPrim;i2++)
11296 if(i2==i1)continue;
11297 aftsTrack=anEvent->GetTrack(i2);
11298 // RP condition (!(first) particle in the correlator must be RP):
11299 if(!(aftsTrack->InRPSelection())) continue;
11300 phi2=aftsTrack->Phi();
11301 for(Int_t i3=0;i3<nPrim;i3++)
11303 if(i3==i1||i3==i2)continue;
11304 aftsTrack=anEvent->GetTrack(i3);
11305 // RP condition (!(first) particle in the correlator must be RP):
11306 if(!(aftsTrack->InRPSelection())) continue;
11307 phi3=aftsTrack->Phi();
11308 // to be improved : where to store it? ->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(2.*phi1-phi2-phi3)),1.); // <w1 w2 w3 cos(n(2psi1-phi2-phi3))>
11309 }//end of for(Int_t i3=0;i3<nPrim;i3++)
11310 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11311 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11315 // 4'-particle correlations:
11316 for(Int_t i1=0;i1<nPrim;i1++)
11318 aftsTrack=anEvent->GetTrack(i1);
11319 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11320 if(typeFlag==1) // this is diff flow of POIs
11322 if(ptOrEta == "Pt")
11324 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11325 } else if (ptOrEta == "Eta")
11327 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11329 } else // this is diff flow of RPs
11331 if(ptOrEta == "Pt")
11333 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11334 } else if (ptOrEta == "Eta")
11336 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11340 psi1=aftsTrack->Phi();
11341 for(Int_t i2=0;i2<nPrim;i2++)
11343 if(i2==i1) continue;
11344 aftsTrack=anEvent->GetTrack(i2);
11345 // RP condition (!(first) particle in the correlator must be RP):
11346 if(!(aftsTrack->InRPSelection())) continue;
11347 phi2=aftsTrack->Phi();
11348 for(Int_t i3=0;i3<nPrim;i3++)
11350 if(i3==i1||i3==i2) continue;
11351 aftsTrack=anEvent->GetTrack(i3);
11352 // RP condition (!(first) particle in the correlator must be RP):
11353 if(!(aftsTrack->InRPSelection())) continue;
11354 phi3=aftsTrack->Phi();
11355 for(Int_t i4=0;i4<nPrim;i4++)
11357 if(i4==i1||i4==i2||i4==i3) continue;
11358 aftsTrack=anEvent->GetTrack(i4);
11359 // RP condition (!(first) particle in the correlator must be RP):
11360 if(!(aftsTrack->InRPSelection())) continue;
11361 phi4=aftsTrack->Phi();
11362 // 4'-particle correlations:
11363 fDiffFlowDirectCorrelations[t][pe][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3-phi4)),1.); // <cos(n(psi1+phi2-phi3-phi4))>
11364 }//end of for(Int_t i4=0;i4<nPrim;i4++)
11365 }//end of for(Int_t i3=0;i3<nPrim;i3++)
11366 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11367 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11369 // count # of RPs and POIs in selected pt and eta bins for cross-checkings:
11370 for(Int_t i=0;i<nPrim;i++)
11372 aftsTrack=anEvent->GetTrack(i);
11373 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11374 if(typeFlag==1) // this is diff flow of POIs
11376 if(ptOrEta == "Pt")
11378 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11379 } else if (ptOrEta == "Eta")
11381 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11383 } else // this is diff flow of RPs
11385 if(ptOrEta == "Pt")
11387 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11388 } else if (ptOrEta == "Eta")
11390 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11394 fNoOfParticlesInBin->Fill(t+pe+0.5);
11397 } // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoops(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
11400 //================================================================================================================================
11403 void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrelations(TString type, TString ptOrEta)
11405 // Compare correlations needed for diff. flow calculated with nested loops and those calculated from Q-vectors
11407 Int_t typeFlag = 0;
11408 Int_t ptEtaFlag = 0;
11412 } else if(type == "POI")
11416 if(ptOrEta == "Pt")
11419 } else if(ptOrEta == "Eta")
11424 Int_t t = typeFlag;
11425 Int_t pe = ptEtaFlag;
11427 TString rpORpoiString[2] = {"RP ","POI"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
11428 TString ptORetaString[2] = {"pt","eta"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
11429 TString reducedCorrelations[4] = {"<<cos(n(psi1-phi2))>>","<<cos(n(psi1+phi2-phi3-phi4))>>","",""}; // to be improved (access this from pro or hist)
11430 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
11431 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
11433 Int_t crossCheckInPtEtaBinNo[2] = {fCrossCheckInPtBinNo,fCrossCheckInEtaBinNo};
11437 cout<<" *****************************************"<<endl;
11438 cout<<" **** cross-checking the correlations ****"<<endl;
11439 cout<<" **** for differential flow ("<<rpORpoiString[t]<<") ****"<<endl;
11440 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
11442 cout<<" **** (particle weights not used) ****"<<endl;
11445 cout<<" **** (particle weights used) ****"<<endl;
11447 cout<<" *****************************************"<<endl;
11449 cout<<" "<<ptORetaString[pe]<<" bin: "<<lowerPtEtaEdge[pe]<<" <= "<<ptORetaString[pe]<<" < "<<upperPtEtaEdge[pe]<<endl;
11452 for(Int_t rci=0;rci<2;rci++) // to be improved (calculate 6th and 8th order)
11454 cout<<" "<<reducedCorrelations[rci].Data()<<":"<<endl;
11455 cout<<" from Q-vectors = "<<fDiffFlowCorrelationsPro[t][pe][rci]->GetBinContent(crossCheckInPtEtaBinNo[pe])<<endl;
11456 cout<<" from nested loops = "<<fDiffFlowDirectCorrelations[t][pe][rci]->GetBinContent(1)<<endl;
11458 } // end of for(Int_t rci=0;rci<4;rci++)
11460 } // end of void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrelations(TString type, TString ptOrEta)
11462 //================================================================================================================================
11464 void AliFlowAnalysisWithQCumulants::PrintNumberOfParticlesInSelectedBin()
11466 // Print on the screen number of RPs and POIs in selected pt and eta bin for cross checkings.
11469 cout<<"Number of RPs in selected pt bin = "<<fNoOfParticlesInBin->GetBinContent(1)<<endl;
11470 cout<<"Number of RPs in selected eta bin = "<<fNoOfParticlesInBin->GetBinContent(2)<<endl;
11471 cout<<"Number of POIs in selected pt bin = "<<fNoOfParticlesInBin->GetBinContent(3)<<endl;
11472 cout<<"Number of POIs in selected eta bin = "<<fNoOfParticlesInBin->GetBinContent(4)<<endl;
11474 } // end of void AliFlowAnalysisWithQCumulants::PrintNumberOfParticlesInSelectedBin()
11476 //================================================================================================================================
11478 void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
11480 // Evaluate reduced correlations with nested loops without using the particle weights.
11482 // Remark 1: Reduced correlations are evaluated in pt bin number fCrossCheckInPtBinNo and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
11483 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrelations[t][pe][ci], where indices runs as follows:
11484 // [0=RP,1=POI][0=Pt,1=Eta][0=<2'>,1=<4'>,2=<6'>,3=<8'>]
11485 // Remark 3: <2'> = <w2 cos(n*(psi1-phi2))>
11486 // <4'> = <w2 w3 w4 cos(n*(psi1+phi2-phi3-phi4))>
11489 Int_t typeFlag = 0;
11490 Int_t ptEtaFlag = 0;
11494 } else if(type == "POI")
11498 if(ptOrEta == "Pt")
11501 } else if(ptOrEta == "Eta")
11506 Int_t t = typeFlag;
11507 Int_t pe = ptEtaFlag;
11509 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
11510 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
11511 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
11513 Int_t nPrim = anEvent->NumberOfTracks();
11514 AliFlowTrackSimple *aftsTrack = NULL;
11516 Double_t psi1=0., phi2=0., phi3=0., phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
11517 Double_t wPhi2=1., wPhi3=1., wPhi4=1.;// wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
11519 Int_t n = fHarmonic;
11521 // 2'-particle correlations:
11522 for(Int_t i1=0;i1<nPrim;i1++)
11524 aftsTrack=anEvent->GetTrack(i1);
11525 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11526 if(typeFlag==1) // this is diff flow of POIs
11528 if(ptOrEta == "Pt")
11530 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11531 } else if (ptOrEta == "Eta")
11533 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11535 } else // this is diff flow of RPs
11537 if(ptOrEta == "Pt")
11539 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11540 } else if (ptOrEta == "Eta")
11542 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11545 psi1=aftsTrack->Phi();
11546 for(Int_t i2=0;i2<nPrim;i2++)
11548 if(i2==i1) continue;
11549 aftsTrack=anEvent->GetTrack(i2);
11550 // RP condition (!(first) particle in the correlator must be RP):
11551 if(!(aftsTrack->InRPSelection())) continue;
11552 phi2=aftsTrack->Phi();
11553 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
11554 // 2'-particle correlations:
11555 fDiffFlowDirectCorrelations[t][pe][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(1.*n*(psi1-phi2)),wPhi2); // <w2 cos(n*(psi1-phi2))
11556 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11557 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11559 // 4'-particle correlations:
11560 for(Int_t i1=0;i1<nPrim;i1++)
11562 aftsTrack=anEvent->GetTrack(i1);
11563 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11564 if(typeFlag==1) // this is diff flow of POIs
11566 if(ptOrEta == "Pt")
11568 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11569 } else if (ptOrEta == "Eta")
11571 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11573 } else // this is diff flow of RPs
11575 if(ptOrEta == "Pt")
11577 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11578 } else if (ptOrEta == "Eta")
11580 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11583 psi1=aftsTrack->Phi();
11584 for(Int_t i2=0;i2<nPrim;i2++)
11586 if(i2==i1) continue;
11587 aftsTrack=anEvent->GetTrack(i2);
11588 // RP condition (!(first) particle in the correlator must be RP):
11589 if(!(aftsTrack->InRPSelection())) continue;
11590 phi2=aftsTrack->Phi();
11591 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
11592 for(Int_t i3=0;i3<nPrim;i3++)
11594 if(i3==i1||i3==i2) continue;
11595 aftsTrack=anEvent->GetTrack(i3);
11596 // RP condition (!(first) particle in the correlator must be RP):
11597 if(!(aftsTrack->InRPSelection())) continue;
11598 phi3=aftsTrack->Phi();
11599 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
11600 for(Int_t i4=0;i4<nPrim;i4++)
11602 if(i4==i1||i4==i2||i4==i3) continue;
11603 aftsTrack=anEvent->GetTrack(i4);
11604 // RP condition (!(first) particle in the correlator must be RP):
11605 if(!(aftsTrack->InRPSelection())) continue;
11606 phi4=aftsTrack->Phi();
11607 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
11608 // 4'-particle correlations <w2 w3 w4 cos(n(psi1+phi2-phi3-phi4))>:
11609 fDiffFlowDirectCorrelations[t][pe][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3-phi4)),wPhi2*wPhi3*wPhi4);
11610 }//end of for(Int_t i4=0;i4<nPrim;i4++)
11611 }//end of for(Int_t i3=0;i3<nPrim;i3++)
11612 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11613 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11615 // count # of RPs and POIs in selected pt and eta bins for cross-checkings: (to be improved - moved to dedicated method)
11616 for(Int_t i=0;i<nPrim;i++)
11618 aftsTrack=anEvent->GetTrack(i);
11619 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11620 if(typeFlag==1) // this is diff flow of POIs
11622 if(ptOrEta == "Pt")
11624 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11625 } else if (ptOrEta == "Eta")
11627 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11629 } else // this is diff flow of RPs
11631 if(ptOrEta == "Pt")
11633 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11634 } else if (ptOrEta == "Eta")
11636 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11640 fNoOfParticlesInBin->Fill(t+pe+0.5);
11643 } // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
11646 //================================================================================================================================
11649 void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
11651 // Evaluate with nested loops correction terms for non-uniform acceptance (both sin and cos terms) relevant for differential flow.
11653 // Remark 1: Reduced correction terms for non-uniform acceptance are evaluated in pt bin number fCrossCheckInPtBinNo
11654 // and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
11655 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrections[t][pe][sc][cti], where first three indices runs as:
11656 // [0=RP,1=POI][0=Pt,1=Eta][0=sin terms,1=cos terms], whilst the cti (correction term index) runs as follows:
11658 // 0: <<sc n(psi1)>>
11659 // 1: <<sc n(psi1+phi2)>>
11660 // 2: <<sc n(psi1+phi2-phi3)>>
11661 // 3: <<sc n(psi1-phi2-phi3)>>
11666 Int_t typeFlag = 0;
11667 Int_t ptEtaFlag = 0;
11671 } else if(type == "POI")
11675 if(ptOrEta == "Pt")
11678 } else if(ptOrEta == "Eta")
11683 Int_t t = typeFlag;
11684 Int_t pe = ptEtaFlag;
11686 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
11687 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
11688 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
11690 Int_t nPrim = anEvent->NumberOfTracks();
11691 AliFlowTrackSimple *aftsTrack = NULL;
11693 Double_t psi1=0., phi2=0., phi3=0.;// phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
11695 Int_t n = fHarmonic;
11697 // 1-particle correction terms:
11698 for(Int_t i1=0;i1<nPrim;i1++)
11700 aftsTrack=anEvent->GetTrack(i1);
11701 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11702 if(typeFlag==1) // this is diff flow of POIs
11704 if(ptOrEta == "Pt")
11706 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11707 } else if (ptOrEta == "Eta")
11709 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11711 } else // this is diff flow of RPs
11713 if(ptOrEta == "Pt")
11715 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11716 } else if (ptOrEta == "Eta")
11718 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11721 psi1=aftsTrack->Phi();
11723 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*psi1),1.); // <<sin(n*(psi1))>>
11725 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*psi1),1.); // <<cos(n*(psi1))>>
11726 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11728 // 2-particle correction terms:
11729 for(Int_t i1=0;i1<nPrim;i1++)
11731 aftsTrack=anEvent->GetTrack(i1);
11732 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11733 if(typeFlag==1) // this is diff flow of POIs
11735 if(ptOrEta == "Pt")
11737 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11738 } else if (ptOrEta == "Eta")
11740 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11742 } else // this is diff flow of RPs
11744 if(ptOrEta == "Pt")
11746 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11747 } else if (ptOrEta == "Eta")
11749 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11752 psi1=aftsTrack->Phi();
11753 for(Int_t i2=0;i2<nPrim;i2++)
11755 if(i2==i1) continue;
11756 aftsTrack=anEvent->GetTrack(i2);
11757 // RP condition (!(first) particle in the correlator must be RP):
11758 if(!(aftsTrack->InRPSelection())) continue;
11759 phi2=aftsTrack->Phi();
11761 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2)),1.); // <<sin(n*(psi1+phi2))>>
11763 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2)),1.); // <<cos(n*(psi1+phi2))>>
11764 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11765 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11767 // 3-particle correction terms:
11768 for(Int_t i1=0;i1<nPrim;i1++)
11770 aftsTrack=anEvent->GetTrack(i1);
11771 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11772 if(typeFlag==1) // this is diff flow of POIs
11774 if(ptOrEta == "Pt")
11776 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11777 } else if (ptOrEta == "Eta")
11779 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11781 } else // this is diff flow of RPs
11783 if(ptOrEta == "Pt")
11785 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11786 } else if (ptOrEta == "Eta")
11788 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11791 psi1=aftsTrack->Phi();
11792 for(Int_t i2=0;i2<nPrim;i2++)
11794 if(i2==i1) continue;
11795 aftsTrack=anEvent->GetTrack(i2);
11796 // RP condition (!(first) particle in the correlator must be RP):
11797 if(!(aftsTrack->InRPSelection())) continue;
11798 phi2=aftsTrack->Phi();
11799 for(Int_t i3=0;i3<nPrim;i3++)
11801 if(i3==i1||i3==i2) continue;
11802 aftsTrack=anEvent->GetTrack(i3);
11803 // RP condition (!(first) particle in the correlator must be RP):
11804 if(!(aftsTrack->InRPSelection())) continue;
11805 phi3=aftsTrack->Phi();
11807 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][2]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2-phi3)),1.); // <<sin(n*(psi1+phi2-phi3))>>
11808 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][3]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1-phi2-phi3)),1.); // <<sin(n*(psi1-phi2-phi3))>>
11810 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][2]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3)),1.); // <<cos(n*(psi1+phi2-phi3))>>
11811 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][3]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1-phi2-phi3)),1.); // <<cos(n*(psi1-phi2-phi3))>>
11812 }//end of for(Int_t i3=0;i3<nPrim;i3++)
11813 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11814 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11816 } // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
11819 //================================================================================================================================
11822 void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrectionTermsForNUA(TString type, TString ptOrEta)
11824 // Compare corrections temrs for non-uniform acceptance needed for diff. flow calculated with nested loops and those calculated from Q-vectors
11826 Int_t typeFlag = 0;
11827 Int_t ptEtaFlag = 0;
11831 } else if(type == "POI")
11835 if(ptOrEta == "Pt")
11838 } else if(ptOrEta == "Eta")
11843 Int_t t = typeFlag;
11844 Int_t pe = ptEtaFlag;
11846 TString rpORpoiString[2] = {"RP ","POI"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
11847 TString ptORetaString[2] = {"pt","eta"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
11848 //TString sinCosFlag[2] = {"sin","cos"}; // to be improved (eventually promote to data member)
11849 TString reducedCorrectionSinTerms[4] = {"<<sin(n(psi1))>>","<<sin(n(psi1+phi2))>>","<<sin(n*(psi1+phi2-phi3))>>","<<sin(n*(psi1-phi2-phi3))>>"}; // to be improved (access this from pro or hist)
11850 TString reducedCorrectionCosTerms[4] = {"<<cos(n(psi1))>>","<<cos(n(psi1+phi2))>>","<<cos(n*(psi1+phi2-phi3))>>","<<cos(n*(psi1-phi2-phi3))>>"}; // to be improved (access this from pro or hist)
11851 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
11852 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
11854 Int_t crossCheckInPtEtaBinNo[2] = {fCrossCheckInPtBinNo,fCrossCheckInEtaBinNo};
11857 cout<<" ******************************************"<<endl;
11858 cout<<" **** cross-checking the correction ****"<<endl;
11859 cout<<" **** terms for non-uniform acceptance ****"<<endl;
11860 cout<<" **** for differential flow ("<<rpORpoiString[t]<<") ****"<<endl;
11861 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
11863 cout<<" **** (particle weights not used) ****"<<endl;
11866 cout<<" **** (particle weights used) ****"<<endl;
11868 cout<<" ******************************************"<<endl;
11870 cout<<" "<<ptORetaString[pe]<<" bin: "<<lowerPtEtaEdge[pe]<<" <= "<<ptORetaString[pe]<<" < "<<upperPtEtaEdge[pe]<<endl;
11873 for(Int_t cti=0;cti<4;cti++) // correction term index
11875 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
11877 if(sc==0) // to be improved (this can be implemented better)
11879 cout<<" "<<reducedCorrectionSinTerms[cti].Data()<<":"<<endl;
11882 cout<<" "<<reducedCorrectionCosTerms[cti].Data()<<":"<<endl;
11884 cout<<" from Q-vectors = "<<fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]->GetBinContent(crossCheckInPtEtaBinNo[pe])<<endl;
11885 cout<<" from nested loops = "<<fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti]->GetBinContent(1)<<endl;
11888 } // end of for(Int_t rci=0;rci<4;rci++)
11890 } // end of void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrectionTermsForNUA(TString type, TString ptOrEta)
11893 //================================================================================================================================
11896 void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights()
11898 // Calculate corrections using particle weights for non-uniform acceptance of the detector for no-name integrated flow (cos terms).
11900 // **********************************************************************
11901 // **** weighted corrections for non-uniform acceptance (cos terms): ****
11902 // **********************************************************************
11904 // Remark 1: When particle weights are used the binning of fIntFlowCorrectionTermsForNUAPro[1] is organized as follows:
11906 // 1st bin: <<w1 cos(n*(phi1))>> = cosP1nW1
11907 // 2nd bin: <<w1 w2 cos(n*(phi1+phi2))>> = cosP1nP1nW1W1
11908 // 3rd bin: <<w1 w2 w3 cos(n*(phi1-phi2-phi3))>> = cosP1nM1nM1nW1W1W1
11911 // multiplicity (number of particles used to determine the reaction plane)
11912 Double_t dMult = (*fSMpk)(0,0);
11914 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
11915 Double_t dReQ1n1k = (*fReQ)(0,1);
11916 Double_t dReQ2n2k = (*fReQ)(1,2);
11917 //Double_t dReQ3n3k = (*fReQ)(2,3);
11918 //Double_t dReQ4n4k = (*fReQ)(3,4);
11919 Double_t dReQ1n3k = (*fReQ)(0,3);
11920 Double_t dImQ1n1k = (*fImQ)(0,1);
11921 Double_t dImQ2n2k = (*fImQ)(1,2);
11922 //Double_t dImQ3n3k = (*fImQ)(2,3);
11923 //Double_t dImQ4n4k = (*fImQ)(3,4);
11924 //Double_t dImQ1n3k = (*fImQ)(0,3);
11926 // dMs are variables introduced in order to simplify some Eqs. bellow:
11927 //..............................................................................................
11928 Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
11929 Double_t dM111 = (*fSMpk)(2,1)-3.*(*fSMpk)(0,2)*(*fSMpk)(0,1)
11930 + 2.*(*fSMpk)(0,3); // dM111 = sum_{i,j,k=1,i!=j!=k}^M w_i w_j w_k
11931 //..............................................................................................
11933 Double_t cosP1nW1 = 0.; // <<w1 cos(n*(phi1))>>
11935 if(dMult>0 && TMath::Abs((*fSMpk)(0,1))>1e-6)
11937 cosP1nW1 = dReQ1n1k/(*fSMpk)(0,1);
11939 // average weighted 1-particle correction (cos terms) for non-uniform acceptance for single event:
11940 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(1,cosP1nW1);
11942 // final average weighted 1-particle correction (cos terms) for non-uniform acceptance for all events:
11943 fIntFlowCorrectionTermsForNUAPro[1]->Fill(0.5,cosP1nW1,(*fSMpk)(0,1));
11947 Double_t cosP1nP1nW1W1 = 0.; // <<w1 w2 cos(n*(phi1+phi2))>>
11949 if(dMult>1 && TMath::Abs(dM11)>1e-6)
11951 cosP1nP1nW1W1 = (pow(dReQ1n1k,2)-pow(dImQ1n1k,2)-dReQ2n2k)/dM11;
11953 // average weighted 2-particle correction (cos terms) for non-uniform acceptance for single event:
11954 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(2,cosP1nP1nW1W1);
11956 // final average weighted 2-particle correction (cos terms) for non-uniform acceptance for all events:
11957 fIntFlowCorrectionTermsForNUAPro[1]->Fill(1.5,cosP1nP1nW1W1,dM11);
11961 Double_t cosP1nM1nM1nW1W1W1 = 0.; // <<w1 w2 w3 cos(n*(phi1-phi2-phi3))>>
11963 if(dMult>2 && TMath::Abs(dM111)>1e-6)
11965 cosP1nM1nM1nW1W1W1 = (dReQ1n1k*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
11966 - dReQ1n1k*dReQ2n2k-dImQ1n1k*dImQ2n2k
11967 - 2.*((*fSMpk)(0,2))*dReQ1n1k
11971 // average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for single event:
11972 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(3,cosP1nM1nM1nW1W1W1);
11974 // final average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for all events:
11975 fIntFlowCorrectionTermsForNUAPro[1]->Fill(2.5,cosP1nM1nM1nW1W1W1,dM111);
11978 } // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights()
11981 //================================================================================================================================
11984 void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights()
11986 // calculate corrections using particle weights for non-uniform acceptance of the detector for no-name integrated flow (sin terms)
11988 // **********************************************************************
11989 // **** weighted corrections for non-uniform acceptance (sin terms): ****
11990 // **********************************************************************
11992 // Remark 1: When particle weights are used the binning of fIntFlowCorrectionTermsForNUAPro[0] is organized as follows:
11994 // 1st bin: <<w1 sin(n*(phi1))>> = sinP1nW1
11995 // 2nd bin: <<w1 w2 sin(n*(phi1+phi2))>> = sinP1nP1nW1W1
11996 // 3rd bin: <<w1 w2 w3 sin(n*(phi1-phi2-phi3))>> = sinP1nM1nM1nW1W1W1
11999 // multiplicity (number of particles used to determine the reaction plane)
12000 Double_t dMult = (*fSMpk)(0,0);
12002 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
12003 Double_t dReQ1n1k = (*fReQ)(0,1);
12004 Double_t dReQ2n2k = (*fReQ)(1,2);
12005 //Double_t dReQ3n3k = (*fReQ)(2,3);
12006 //Double_t dReQ4n4k = (*fReQ)(3,4);
12007 //Double_t dReQ1n3k = (*fReQ)(0,3);
12008 Double_t dImQ1n1k = (*fImQ)(0,1);
12009 Double_t dImQ2n2k = (*fImQ)(1,2);
12010 //Double_t dImQ3n3k = (*fImQ)(2,3);
12011 //Double_t dImQ4n4k = (*fImQ)(3,4);
12012 Double_t dImQ1n3k = (*fImQ)(0,3);
12014 // dMs are variables introduced in order to simplify some Eqs. bellow:
12015 //..............................................................................................
12016 Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
12017 Double_t dM111 = (*fSMpk)(2,1)-3.*(*fSMpk)(0,2)*(*fSMpk)(0,1)
12018 + 2.*(*fSMpk)(0,3); // dM111 = sum_{i,j,k=1,i!=j!=k}^M w_i w_j w_k
12019 //..............................................................................................
12022 Double_t sinP1nW1 = 0.; // <<w1 sin(n*(phi1))>>
12024 if(dMult>0 && TMath::Abs((*fSMpk)(0,1))>1e-6)
12026 sinP1nW1 = dImQ1n1k/((*fSMpk)(0,1));
12028 // average weighted 1-particle correction (sin terms) for non-uniform acceptance for single event:
12029 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(1,sinP1nW1);
12031 // final average weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
12032 fIntFlowCorrectionTermsForNUAPro[0]->Fill(0.5,sinP1nW1,(*fSMpk)(0,1));
12036 Double_t sinP1nP1nW1W1 = 0.; // <<w1 w2 sin(n*(phi1+phi2))>>
12038 if(dMult>1 && TMath::Abs(dM11)>1e-6)
12040 sinP1nP1nW1W1 = (2.*dReQ1n1k*dImQ1n1k-dImQ2n2k)/dM11;
12042 // average weighted 2-particle correction (sin terms) for non-uniform acceptance for single event:
12043 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(2,sinP1nP1nW1W1);
12045 // final average weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
12046 fIntFlowCorrectionTermsForNUAPro[0]->Fill(1.5,sinP1nP1nW1W1,dM11);
12050 Double_t sinP1nM1nM1nW1W1W1 = 0.; // <<w1 w2 w3 sin(n*(phi1-phi2-phi3))>>
12052 if(dMult>2 && TMath::Abs(dM111)>1e-6)
12054 sinP1nM1nM1nW1W1W1 = (-dImQ1n1k*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
12055 + dReQ1n1k*dImQ2n2k-dImQ1n1k*dReQ2n2k
12056 + 2.*((*fSMpk)(0,2))*dImQ1n1k
12060 // average weighted 3-particle correction (sin terms) for non-uniform acceptance for single event:
12061 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(3,sinP1nM1nM1nW1W1W1);
12063 // final average weighted 3-particle correction (sin terms) for non-uniform acceptance for all events:
12064 fIntFlowCorrectionTermsForNUAPro[0]->Fill(2.5,sinP1nM1nM1nW1W1W1,dM111);
12067 } // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights()
12070 //================================================================================================================================
12073 void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent)
12075 // Evaluate with nested loops correction terms for non-uniform acceptance for integrated flow (using the particle weights).
12077 // Results are stored in profiles fIntFlowDirectCorrectionTermsForNUA[0] (sin terms) and
12078 // fIntFlowDirectCorrectionTermsForNUA[1] (cos terms).
12080 // Remark 1: When particle weights are used the binning of fIntFlowDirectCorrectionTermsForNUA[sc] is
12081 // organized as follows (sc stands for either sin or cos):
12083 // 1st bin: <<w1 sc(n*(phi1))>> = scP1nW1
12084 // 2nd bin: <<w1 w2 sc(n*(phi1+phi2))>> = scP1nP1nW1W1
12085 // 3rd bin: <<w1 w2 w3 sc(n*(phi1-phi2-phi3))>> = scP1nM1nM1nW1W1W1
12088 Int_t nPrim = anEvent->NumberOfTracks();
12089 AliFlowTrackSimple *aftsTrack = NULL;
12090 //Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
12091 //Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1., wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
12092 Double_t phi1=0., phi2=0., phi3=0.;
12093 Double_t wPhi1=1., wPhi2=1., wPhi3=1.;
12094 Int_t n = fHarmonic;
12095 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
12096 Double_t dMult = (*fSMpk)(0,0);
12098 cout<<"Correction terms for non-uniform acceptance: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
12101 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
12102 } else if (dMult>fMaxAllowedMultiplicity)
12104 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
12107 cout<<"... evaluating nested loops (using particle weights) ..."<<endl;
12110 // 1-particle correction terms using particle weights:
12111 if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)
12113 for(Int_t i1=0;i1<nPrim;i1++)
12115 aftsTrack=anEvent->GetTrack(i1);
12116 if(!(aftsTrack->InRPSelection())) continue;
12117 phi1=aftsTrack->Phi();
12118 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
12119 // 1-particle correction terms using particle weights:
12120 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(0.5,sin(n*phi1),wPhi1); // <w1 sin(n*phi1)>
12121 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(0.5,cos(n*phi1),wPhi1); // <w1 cos(n*phi1)>
12122 } // end of for(Int_t i1=0;i1<nPrim;i1++)
12123 } // end of if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)
12125 // 2-particle correction terms using particle weights:
12126 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
12128 for(Int_t i1=0;i1<nPrim;i1++)
12130 aftsTrack=anEvent->GetTrack(i1);
12131 if(!(aftsTrack->InRPSelection())) continue;
12132 phi1=aftsTrack->Phi();
12133 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
12134 for(Int_t i2=0;i2<nPrim;i2++)
12136 if(i2==i1)continue;
12137 aftsTrack=anEvent->GetTrack(i2);
12138 if(!(aftsTrack->InRPSelection())) continue;
12139 phi2=aftsTrack->Phi();
12140 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
12141 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
12142 // 2-p correction terms using particle weights:
12143 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(1.5,sin(n*(phi1+phi2)),wPhi1*wPhi2); // <w1 w2 sin(n*(phi1+phi2))>
12144 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(1.5,cos(n*(phi1+phi2)),wPhi1*wPhi2); // <w1 w2 cos(n*(phi1+phi2))>
12145 } // end of for(Int_t i2=0;i2<nPrim;i2++)
12146 } // end of for(Int_t i1=0;i1<nPrim;i1++)
12147 } // end of if(nPrim>=2)
12149 // 3-particle correction terms using particle weights:
12150 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
12152 for(Int_t i1=0;i1<nPrim;i1++)
12154 aftsTrack=anEvent->GetTrack(i1);
12155 if(!(aftsTrack->InRPSelection())) continue;
12156 phi1=aftsTrack->Phi();
12157 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
12158 for(Int_t i2=0;i2<nPrim;i2++)
12160 if(i2==i1)continue;
12161 aftsTrack=anEvent->GetTrack(i2);
12162 if(!(aftsTrack->InRPSelection())) continue;
12163 phi2=aftsTrack->Phi();
12164 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
12165 for(Int_t i3=0;i3<nPrim;i3++)
12167 if(i3==i1||i3==i2)continue;
12168 aftsTrack=anEvent->GetTrack(i3);
12169 if(!(aftsTrack->InRPSelection())) continue;
12170 phi3=aftsTrack->Phi();
12171 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
12172 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;
12173 // 3-p correction terms using particle weights:
12174 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(2.5,sin(n*(phi1-phi2-phi3)),wPhi1*wPhi2*wPhi3); // <w1 w2 w3 sin(n*(phi1-phi2-phi3))>
12175 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(2.5,cos(n*(phi1-phi2-phi3)),wPhi1*wPhi2*wPhi3); // <w1 w2 w3 cos(n*(phi1-phi2-phi3))>
12176 } // end of for(Int_t i3=0;i3<nPrim;i3++)
12177 } // end of for(Int_t i2=0;i2<nPrim;i2++)
12178 } // end of for(Int_t i1=0;i1<nPrim;i1++)
12179 } // end of if(nPrim>=3)
12183 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)
12185 // 4 nested loops multiparticle correlations using particle weights:
12186 for(Int_t i1=0;i1<nPrim;i1++)
12188 aftsTrack=anEvent->GetTrack(i1);
12189 if(!(aftsTrack->InRPSelection())) continue;
12190 phi1=aftsTrack->Phi();
12191 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
12192 for(Int_t i2=0;i2<nPrim;i2++)
12194 if(i2==i1)continue;
12195 aftsTrack=anEvent->GetTrack(i2);
12196 if(!(aftsTrack->InRPSelection())) continue;
12197 phi2=aftsTrack->Phi();
12198 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
12199 for(Int_t i3=0;i3<nPrim;i3++)
12201 if(i3==i1||i3==i2)continue;
12202 aftsTrack=anEvent->GetTrack(i3);
12203 if(!(aftsTrack->InRPSelection())) continue;
12204 phi3=aftsTrack->Phi();
12205 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
12206 for(Int_t i4=0;i4<nPrim;i4++)
12208 if(i4==i1||i4==i2||i4==i3)continue;
12209 aftsTrack=anEvent->GetTrack(i4);
12210 if(!(aftsTrack->InRPSelection())) continue;
12211 phi4=aftsTrack->Phi();
12212 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
12213 if(nPrim>=4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush; // to be improved (replace eventually this if statement with if(nPrim==4))
12214 // 4-p correlations using particle weights:
12215 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(10.5,cos(n*phi1+n*phi2-n*phi3-n*phi4),wPhi1*wPhi2*wPhi3*wPhi4);
12216 // extra correlations:
12217 // 2-p extra correlations (do not appear if particle weights are not used):
12219 // 3-p extra correlations (do not appear if particle weights are not used):
12221 // 4-p extra correlations (do not appear if particle weights are not used):
12223 } // end of for(Int_t i4=0;i4<nPrim;i4++)
12224 } // end of for(Int_t i3=0;i3<nPrim;i3++)
12225 } // end of for(Int_t i2=0;i2<nPrim;i2++)
12226 } // end of for(Int_t i1=0;i1<nPrim;i1++)
12227 } // end of if(nPrim>=4)
12233 } // end of void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent)
12236 //================================================================================================================================
12239 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights(TString type, TString ptOrEta)
12241 // Calculate correction terms for non-uniform acceptance for differential flow (cos terms) using particle weights.
12243 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][1][cti], where cti runs as follows:
12245 // 0: <<cos n(psi)>>
12246 // 1: <<w2 cos n(psi1+phi2)>>
12247 // 2: <<w2 w3 cos n(psi1+phi2-phi3)>>
12248 // 3: <<w2 w3 cos n(psi1-phi2-phi3)>>
12253 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
12254 Double_t dReQ1n1k = (*fReQ)(0,1);
12255 Double_t dReQ2n2k = (*fReQ)(1,2);
12256 //Double_t dReQ1n3k = (*fReQ)(0,3);
12257 //Double_t dReQ4n4k = (*fReQ)(3,4);
12258 Double_t dImQ1n1k = (*fImQ)(0,1);
12259 Double_t dImQ2n2k = (*fImQ)(1,2);
12260 //Double_t dImQ1n3k = (*fImQ)(0,3);
12261 //Double_t dImQ4n4k = (*fImQ)(3,4);
12263 // S^M_{p,k} (see .h file for the definition of fSMpk):
12264 Double_t dSM1p1k = (*fSMpk)(0,1);
12265 Double_t dSM1p2k = (*fSMpk)(0,2);
12266 Double_t dSM2p1k = (*fSMpk)(1,1);
12268 Int_t t = 0; // type flag
12269 Int_t pe = 0; // ptEta flag
12274 } else if(type == "POI")
12279 if(ptOrEta == "Pt")
12282 } else if(ptOrEta == "Eta")
12287 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
12288 Double_t minPtEta[2] = {fPtMin,fEtaMin};
12289 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
12290 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
12292 // looping over all bins and calculating correction terms:
12293 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
12295 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
12296 Double_t p1n0kRe = 0.;
12297 Double_t p1n0kIm = 0.;
12299 // number of POIs in particular pt or eta bin:
12302 // real and imaginary parts of q_{m*n,0} (weighted Q-vector evaluated for particles which are both RPs and POIs in particular pt or eta bin):
12303 Double_t q1n2kRe = 0.;
12304 Double_t q1n2kIm = 0.;
12305 Double_t q2n1kRe = 0.;
12306 Double_t q2n1kIm = 0.;
12308 // s_{1,1}, s_{1,2} // to be improved (add explanation)
12309 Double_t s1p1k = 0.;
12310 Double_t s1p2k = 0.;
12312 // number of particles which are both RPs and POIs in particular pt or eta bin:
12315 // M0111 from Eq. (118) in QC2c (to be improved (notation))
12316 Double_t dM01 = 0.;
12317 Double_t dM011 = 0.;
12322 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))
12323 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));
12324 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))
12325 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b));
12326 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))
12327 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));
12328 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))
12329 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b));
12330 mq = fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
12332 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.);
12333 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.);
12334 }else if(type == "RP")
12336 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
12337 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))
12338 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));
12339 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))
12340 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));
12341 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))
12342 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));
12343 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))
12344 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));
12345 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
12346 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.);
12347 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.);
12348 //s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.);
12350 mq = fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
12356 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
12357 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
12358 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
12359 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
12360 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
12361 // M01 from Eq. (118) in QC2c (to be improved (notation)):
12362 dM01 = mp*dSM1p1k-s1p1k;
12363 dM011 = mp*(dSM2p1k-dSM1p2k)
12364 - 2.*(s1p1k*dSM1p1k-s1p2k);
12366 // typeFlag = RP (0) or POI (1):
12368 } else if(type == "RP")
12370 // to be improved (cross-checked):
12371 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
12372 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
12373 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
12374 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
12375 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
12376 // M01 from Eq. (118) in QC2c (to be improved (notation)):
12377 dM01 = mp*dSM1p1k-s1p1k;
12378 dM011 = mp*(dSM2p1k-dSM1p2k)
12379 - 2.*(s1p1k*dSM1p1k-s1p2k);
12380 // typeFlag = RP (0) or POI (1):
12384 // <<cos n(psi1)>>:
12385 Double_t cosP1nPsi = 0.;
12388 cosP1nPsi = p1n0kRe/mp;
12390 // fill profile for <<cos n(psi1)>>:
12391 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi,mp);
12392 // histogram to store <cos n(psi1)> e-b-e (needed in some other methods):
12393 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][0]->SetBinContent(b,cosP1nPsi);
12396 // <<w2 cos n(psi1+phi2)>>:
12397 Double_t cosP1nPsiP1nPhiW2 = 0.;
12400 cosP1nPsiP1nPhiW2 = (p1n0kRe*dReQ1n1k-p1n0kIm*dImQ1n1k-q2n1kRe)/(dM01);
12401 // fill profile for <<w2 cos n(psi1+phi2)>>:
12402 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsiP1nPhiW2,dM01);
12403 // histogram to store <w2 cos n(psi1+phi2)> e-b-e (needed in some other methods):
12404 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][1]->SetBinContent(b,cosP1nPsiP1nPhiW2);
12405 } // end of if(dM01)
12407 // <<w2 w3 cos n(psi1+phi2-phi3)>>:
12408 Double_t cosP1nPsi1P1nPhi2MPhi3W2W3 = 0.;
12411 cosP1nPsi1P1nPhi2MPhi3W2W3 = (p1n0kRe*(pow(dImQ1n1k,2.)+pow(dReQ1n1k,2.))
12413 - q2n1kRe*dReQ1n1k-q2n1kIm*dImQ1n1k
12417 // fill profile for <<w1 w2 w3 cos n(psi1+phi2)>>:
12418 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1P1nPhi2MPhi3W2W3,dM011);
12419 // histogram to store <w1 w2 w3 cos n(psi1+phi2)> e-b-e (needed in some other methods):
12420 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][2]->SetBinContent(b,cosP1nPsi1P1nPhi2MPhi3W2W3);
12421 } // end of if(dM011)
12423 // <<w2 w3 cos n(psi1-phi2-phi3)>>:
12424 Double_t cosP1nPsi1M1nPhi2MPhi3W2W3 = 0.;
12427 cosP1nPsi1M1nPhi2MPhi3W2W3 = (p1n0kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))+2.*p1n0kIm*dReQ1n1k*dImQ1n1k
12428 - 1.*(p1n0kRe*dReQ2n2k+p1n0kIm*dImQ2n2k)
12429 - 2.*s1p1k*dReQ1n1k
12432 // fill profile for <<w1 w2 w3 cos n(psi1+phi2)>>:
12433 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1M1nPhi2MPhi3W2W3,dM011);
12434 // histogram to store <w1 w2 w3 cos n(psi1+phi2)> e-b-e (needed in some other methods):
12435 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][3]->SetBinContent(b,cosP1nPsi1M1nPhi2MPhi3W2W3);
12436 } // end of if(dM011)
12438 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
12440 } // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights(TString type, TString ptOrEta)
12443 //================================================================================================================================
12446 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights(TString type, TString ptOrEta)
12448 // Calculate correction terms for non-uniform acceptance for differential flow (sin terms).
12450 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][0][cti], where cti runs as follows:
12451 // 0: <<sin n(psi1)>>
12452 // 1: <<w2 sin n(psi1+phi2)>>
12453 // 2: <<w2 w3 sin n(psi1+phi2-phi3)>>
12454 // 3: <<w2 w3 sin n(psi1-phi2-phi3)>>:
12459 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
12460 Double_t dReQ1n1k = (*fReQ)(0,1);
12461 Double_t dReQ2n2k = (*fReQ)(1,2);
12462 //Double_t dReQ1n3k = (*fReQ)(0,3);
12463 //Double_t dReQ4n4k = (*fReQ)(3,4);
12464 Double_t dImQ1n1k = (*fImQ)(0,1);
12465 Double_t dImQ2n2k = (*fImQ)(1,2);
12466 //Double_t dImQ1n3k = (*fImQ)(0,3);
12467 //Double_t dImQ4n4k = (*fImQ)(3,4);
12469 // S^M_{p,k} (see .h file for the definition of fSMpk):
12470 Double_t dSM1p1k = (*fSMpk)(0,1);
12471 Double_t dSM1p2k = (*fSMpk)(0,2);
12472 Double_t dSM2p1k = (*fSMpk)(1,1);
12474 Int_t t = 0; // type flag
12475 Int_t pe = 0; // ptEta flag
12480 } else if(type == "POI")
12485 if(ptOrEta == "Pt")
12488 } else if(ptOrEta == "Eta")
12493 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
12494 Double_t minPtEta[2] = {fPtMin,fEtaMin};
12495 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
12496 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
12498 // looping over all bins and calculating correction terms:
12499 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
12501 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
12502 Double_t p1n0kRe = 0.;
12503 Double_t p1n0kIm = 0.;
12505 // number of POIs in particular pt or eta bin:
12508 // real and imaginary parts of q_{m*n,0} (weighted Q-vector evaluated for particles which are both RPs and POIs in particular pt or eta bin):
12509 Double_t q1n2kRe = 0.;
12510 Double_t q1n2kIm = 0.;
12511 Double_t q2n1kRe = 0.;
12512 Double_t q2n1kIm = 0.;
12514 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
12515 Double_t s1p1k = 0.;
12516 Double_t s1p2k = 0.;
12518 // number of particles which are both RPs and POIs in particular pt or eta bin:
12521 // M0111 from Eq. (118) in QC2c (to be improved (notation))
12522 Double_t dM01 = 0.;
12523 Double_t dM011 = 0.;
12528 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))
12529 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));
12530 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))
12531 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b));
12532 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))
12533 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));
12534 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))
12535 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b));
12536 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
12538 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.);
12539 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.);
12540 }else if(type == "RP")
12542 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
12543 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))
12544 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));
12545 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))
12546 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));
12547 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))
12548 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));
12549 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))
12550 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));
12551 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
12552 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.);
12553 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.);
12554 //s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.);
12560 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
12561 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
12562 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
12563 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
12564 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
12565 // M01 from Eq. (118) in QC2c (to be improved (notation)):
12566 dM01 = mp*dSM1p1k-s1p1k;
12567 dM011 = mp*(dSM2p1k-dSM1p2k)
12568 - 2.*(s1p1k*dSM1p1k-s1p2k);
12569 // typeFlag = RP (0) or POI (1):
12571 } else if(type == "RP")
12573 // to be improved (cross-checked):
12574 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
12575 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
12576 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
12577 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
12578 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
12579 // M01 from Eq. (118) in QC2c (to be improved (notation)):
12580 dM01 = mp*dSM1p1k-s1p1k;
12581 dM011 = mp*(dSM2p1k-dSM1p2k)
12582 - 2.*(s1p1k*dSM1p1k-s1p2k);
12583 // typeFlag = RP (0) or POI (1):
12587 // <<sin n(psi1)>>:
12588 Double_t sinP1nPsi = 0.;
12591 sinP1nPsi = p1n0kIm/mp;
12593 // fill profile for <<sin n(psi1)>>:
12594 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi,mp);
12595 // histogram to store <sin n(psi1)> e-b-e (needed in some other methods):
12596 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][0]->SetBinContent(b,sinP1nPsi);
12599 // <<w2 sin n(psi1+phi2)>>:
12600 Double_t sinP1nPsiP1nPhiW2 = 0.;
12603 sinP1nPsiP1nPhiW2 = (p1n0kRe*dImQ1n1k+p1n0kIm*dReQ1n1k-q2n1kIm)/(dM01);
12604 // fill profile for <<w2 sin n(psi1+phi2)>>:
12605 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsiP1nPhiW2,dM01);
12606 // histogram to store <w2 sin n(psi1+phi2)> e-b-e (needed in some other methods):
12607 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][1]->SetBinContent(b,sinP1nPsiP1nPhiW2);
12608 } // end of if(mp*dMult-mq)
12610 // <<w2 w3 sin n(psi1+phi2-phi3)>>:
12611 Double_t sinP1nPsi1P1nPhi2MPhi3W2W3 = 0.;
12614 sinP1nPsi1P1nPhi2MPhi3W2W3 = (p1n0kIm*(pow(dImQ1n1k,2.)+pow(dReQ1n1k,2.))
12616 + q2n1kRe*dImQ1n1k-q2n1kIm*dReQ1n1k
12620 // fill profile for <<w2 w3 sin n(psi1+phi2-phi3)>>:
12621 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1P1nPhi2MPhi3W2W3,dM011);
12622 // histogram to store <w2 w3 sin n(psi1+phi2-phi3)> e-b-e (needed in some other methods):
12623 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][2]->SetBinContent(b,sinP1nPsi1P1nPhi2MPhi3W2W3);
12624 } // end of if(dM011)
12626 // <<w2 w3 sin n(psi1-phi2-phi3)>>:
12627 Double_t sinP1nPsi1M1nPhi2MPhi3W2W3 = 0.;
12630 sinP1nPsi1M1nPhi2MPhi3W2W3 = (p1n0kIm*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))-2.*p1n0kRe*dReQ1n1k*dImQ1n1k
12631 + 1.*(p1n0kRe*dImQ2n2k-p1n0kIm*dReQ2n2k)
12632 + 2.*s1p1k*dImQ1n1k
12635 // fill profile for <<w2 w3 sin n(psi1-phi2-phi3)>>:
12636 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1M1nPhi2MPhi3W2W3,dM011);
12637 // histogram to store <w2 w3 sin n(psi1-phi2-phi3)> e-b-e (needed in some other methods):
12638 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][3]->SetBinContent(b,sinP1nPsi1M1nPhi2MPhi3W2W3);
12639 } // end of if(dM011)
12641 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
12643 } // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights(TString type, TString ptOrEta)
12646 //================================================================================================================================
12649 void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
12651 // Evaluate with nested loops correction terms for non-uniform acceptance
12652 // with using particle weights (both sin and cos terms) relevant for differential flow.
12654 // Remark 1: "w1" in expressions bellow is a particle weight used only for particles which were
12655 // flagged both as POI and RP.
12656 // Remark 2: Reduced correction terms for non-uniform acceptance are evaluated in pt bin number fCrossCheckInPtBinNo
12657 // and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
12658 // Remark 3: Results are stored in 1 bin profiles fDiffFlowDirectCorrections[t][pe][sc][cti], where first three indices runs as:
12659 // [0=RP,1=POI][0=Pt,1=Eta][0=sin terms,1=cos terms], whilst the cti (correction term index) runs as follows:
12661 // 0: <<sc n(psi1)>>
12662 // 1: <<w2 sc n(psi1+phi2)>>
12663 // 2: <<w2 w3 sc n(psi1+phi2-phi3)>>
12664 // 3: <<w2 w3 sc n(psi1-phi2-phi3)>>
12669 Int_t typeFlag = 0;
12670 Int_t ptEtaFlag = 0;
12674 } else if(type == "POI")
12678 if(ptOrEta == "Pt")
12681 } else if(ptOrEta == "Eta")
12686 Int_t t = typeFlag;
12687 Int_t pe = ptEtaFlag;
12689 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
12690 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
12691 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
12693 Int_t nPrim = anEvent->NumberOfTracks();
12694 AliFlowTrackSimple *aftsTrack = NULL;
12696 Double_t psi1=0., phi2=0., phi3=0.;// phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
12697 Double_t wPhi2=1., wPhi3=1.;
12699 Int_t n = fHarmonic;
12701 // 1'-particle correction terms:
12702 for(Int_t i1=0;i1<nPrim;i1++)
12704 aftsTrack=anEvent->GetTrack(i1);
12705 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12706 if(typeFlag==1) // this is diff flow of POIs
12708 if(ptOrEta == "Pt")
12710 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12711 } else if (ptOrEta == "Eta")
12713 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12715 } else // this is diff flow of RPs
12717 if(ptOrEta == "Pt")
12719 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12720 } else if (ptOrEta == "Eta")
12722 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12725 psi1=aftsTrack->Phi();
12727 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*psi1),1.); // <<sin(n*(psi1))>>
12729 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*psi1),1.); // <<cos(n*(psi1))>>
12730 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12732 // 2'-particle correction terms:
12733 for(Int_t i1=0;i1<nPrim;i1++)
12735 aftsTrack=anEvent->GetTrack(i1);
12736 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12737 if(typeFlag==1) // this is diff flow of POIs
12739 if(ptOrEta == "Pt")
12741 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12742 } else if (ptOrEta == "Eta")
12744 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12746 } else // this is diff flow of RPs
12748 if(ptOrEta == "Pt")
12750 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12751 } else if (ptOrEta == "Eta")
12753 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12756 psi1=aftsTrack->Phi();
12757 for(Int_t i2=0;i2<nPrim;i2++)
12759 if(i2==i1) continue;
12760 aftsTrack=anEvent->GetTrack(i2);
12761 // RP condition (!(first) particle in the correlator must be RP):
12762 if(!(aftsTrack->InRPSelection())) continue;
12763 phi2=aftsTrack->Phi();
12764 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
12766 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2)),wPhi2); // <<w2 sin(n*(psi1+phi2))>>
12768 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2)),wPhi2); // <<w2 cos(n*(psi1+phi2))>>
12769 }//end of for(Int_t i2=0;i2<nPrim;i2++)
12770 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12772 // 3'-particle correction terms:
12773 for(Int_t i1=0;i1<nPrim;i1++)
12775 aftsTrack=anEvent->GetTrack(i1);
12776 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12777 if(typeFlag==1) // this is diff flow of POIs
12779 if(ptOrEta == "Pt")
12781 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12782 } else if (ptOrEta == "Eta")
12784 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12786 } else // this is diff flow of RPs
12788 if(ptOrEta == "Pt")
12790 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12791 } else if (ptOrEta == "Eta")
12793 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12796 psi1=aftsTrack->Phi();
12797 for(Int_t i2=0;i2<nPrim;i2++)
12799 if(i2==i1) continue;
12800 aftsTrack=anEvent->GetTrack(i2);
12801 // RP condition (!(first) particle in the correlator must be RP):
12802 if(!(aftsTrack->InRPSelection())) continue;
12803 phi2=aftsTrack->Phi();
12804 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
12805 for(Int_t i3=0;i3<nPrim;i3++)
12807 if(i3==i1||i3==i2) continue;
12808 aftsTrack=anEvent->GetTrack(i3);
12809 // RP condition (!(first) particle in the correlator must be RP):
12810 if(!(aftsTrack->InRPSelection())) continue;
12811 phi3=aftsTrack->Phi();
12812 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
12814 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][2]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2-phi3)),wPhi2*wPhi3); // <<wPhi2*wPhi3 sin(n*(psi1+phi2-phi3))>>
12815 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][3]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1-phi2-phi3)),wPhi2*wPhi3); // <<wPhi2*wPhi3 sin(n*(psi1-phi2-phi3))>>
12817 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][2]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3)),wPhi2*wPhi3); // <<wPhi2*wPhi3 cos(n*(psi1+phi2-phi3))>>
12818 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][3]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1-phi2-phi3)),wPhi2*wPhi3); // <<wPhi2*wPhi3 cos(n*(psi1-phi2-phi3))>>
12819 }//end of for(Int_t i3=0;i3<nPrim;i3++)
12820 }//end of for(Int_t i2=0;i2<nPrim;i2++)
12821 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12823 } // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
12825 //================================================================================================================================
12827 void AliFlowAnalysisWithQCumulants::CheckPointersUsedInFinish()
12829 // Check all pointers used in method Finish().
12831 if(!fAvMultiplicity)
12834 cout<<" WARNING (QC): fAvMultiplicity is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12838 if(!fIntFlowCorrelationsPro)
12841 cout<<" WARNING (QC): fIntFlowCorrelationsPro is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12845 if(!fIntFlowSquaredCorrelationsPro)
12848 cout<<" WARNING (QC): fIntFlowSquaredCorrelationsPro is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12852 if(!fIntFlowCorrelationsHist)
12855 cout<<" WARNING (QC): fIntFlowCorrelationsHist is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12859 if((fUsePhiWeights||fUsePtWeights||fUseEtaWeights) && !fIntFlowExtraCorrelationsPro)
12862 cout<<" WARNING (QC): fIntFlowExtraCorrelationsPro is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12866 for(Int_t power=0;power<2;power++)
12868 if(!fIntFlowSumOfEventWeights[power])
12871 cout<<Form(" WARNING (QC): fIntFlowSumOfEventWeights[%d] is NULL in CheckPointersUsedInFinish() !!!!",power)<<endl;
12875 } // end of for(Int_t power=0;power<2;power++)
12876 if(!fIntFlowProductOfCorrelationsPro)
12879 cout<<" WARNING (QC): fIntFlowProductOfCorrelationsPro is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12883 if(!fIntFlowSumOfProductOfEventWeights)
12886 cout<<" WARNING (QC): fIntFlowSumOfProductOfEventWeights is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12890 if(!fIntFlowCovariances)
12893 cout<<" WARNING (QC): fIntFlowCovariances is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12897 if(!fIntFlowQcumulants)
12900 cout<<" WARNING (QC): fIntFlowQcumulants is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12907 cout<<" WARNING (QC): fIntFlow is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12914 cout<<" WARNING (QC): fCommonHists is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12918 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
12921 cout<<" WARNING (QC): fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th"<<endl;
12922 cout<<" && fCommonHistsResults8th is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12928 for(Int_t sc=0;sc<2;sc++) // sin/cos
12930 if(!fIntFlowCorrectionTermsForNUAPro[sc])
12933 cout<<Form(" WARNING (QC): fIntFlowCorrectionTermsForNUAPro[%d] is NULL in CheckPointersUsedInFinish() !!!!",sc)<<endl;
12937 if(!fIntFlowCorrectionTermsForNUAHist[sc])
12940 cout<<Form(" WARNING (QC): fIntFlowCorrectionTermsForNUAHist[%d] is NULL in CheckPointersUsedInFinish() !!!!",sc)<<endl;
12944 for(Int_t lq=0;lq<2;lq++) // linear/quadratic
12946 if(!fIntFlowSumOfEventWeightsNUA[sc][lq])
12949 cout<<Form(" WARNING (QC): fIntFlowSumOfEventWeightsNUA[%d][%d] is NULL in CheckPointersUsedInFinish() !!!!",sc,lq)<<endl;
12953 } // end of for(Int_t lq=0;lq<2;lq++) // linear/quadratic
12954 } // end of for(Int_t power=0;power<2;power++)
12955 if(!fIntFlowProductOfCorrectionTermsForNUAPro)
12958 cout<<" WARNING (QC): fIntFlowProductOfCorrectionTermsForNUAPro is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12962 if(!fIntFlowSumOfProductOfEventWeightsNUA)
12965 cout<<" WARNING (QC): fIntFlowSumOfProductOfEventWeightsNUA is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12969 if(!fIntFlowCovariancesNUA)
12972 cout<<" WARNING (QC): fIntFlowCovariancesNUA is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12976 if(!fIntFlowQcumulantsErrorSquaredRatio)
12979 cout<<" WARNING (QC): fIntFlowQcumulantsErrorSquaredRatio is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12983 if(!fIntFlowDetectorBias)
12986 cout<<" WARNING (QC): fIntFlowDetectorBias is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12991 // Versus multiplicity:
12992 if(!fCalculateCumulantsVsM){return;}
12993 for(Int_t co=0;co<=3;co++) // cumulant order
12995 if(!fIntFlowQcumulantsVsM[co])
12998 cout<<Form(" WARNING (QC): fIntFlowQcumulantsVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",co)<<endl;
13002 if(!fIntFlowVsM[co])
13005 cout<<Form(" WARNING (QC): fIntFlowVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",co)<<endl;
13009 if(!fIntFlowDetectorBiasVsM[co])
13012 cout<<Form(" WARNING (QC): fIntFlowDetectorBiasVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",co)<<endl;
13016 } // end of for(Int_t c0=0;c0<=3;c0++) // cumulant order
13017 for(Int_t ci=0;ci<=3;ci++) // correlation index
13019 if(!fIntFlowCorrelationsVsMPro[ci])
13022 cout<<Form(" WARNING (QC): fIntFlowCorrelationsVsMPro[%d] is NULL in CheckPointersUsedInFinish() !!!!",ci)<<endl;
13026 if(!fIntFlowSquaredCorrelationsVsMPro[ci])
13029 cout<<Form(" WARNING (QC): fIntFlowSquaredCorrelationsVsMPro[%d] is NULL in CheckPointersUsedInFinish() !!!!",ci)<<endl;
13033 if(!fIntFlowCorrelationsVsMHist[ci])
13036 cout<<Form(" WARNING (QC): fIntFlowCorrelationsVsMHist[%d] is NULL in CheckPointersUsedInFinish() !!!!",ci)<<endl;
13040 for(Int_t power=0;power<2;power++)
13042 if(!fIntFlowSumOfEventWeightsVsM[ci][power])
13045 cout<<Form(" WARNING (QC): fIntFlowSumOfEventWeightsVsM[%d][%d] is NULL in CheckPointersUsedInFinish() !!!!",ci,power)<<endl;
13049 } // end of for(Int_t power=0;power<2;power++)
13050 } // end of for(Int_t ci=0;ci<=3;ci++) // correlation index
13051 for(Int_t i=0;i<6;i++)
13053 if(!fIntFlowProductOfCorrelationsVsMPro[i])
13056 cout<<Form(" WARNING (QC): fIntFlowProductOfCorrelationsVsMPro[%d] is NULL in CheckPointersUsedInFinish() !!!!",i)<<endl;
13060 if(!fIntFlowSumOfProductOfEventWeightsVsM[i])
13063 cout<<Form(" WARNING (QC): fIntFlowSumOfProductOfEventWeightsVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",i)<<endl;
13067 if(!fIntFlowCovariancesVsM[i])
13070 cout<<Form(" WARNING (QC): fIntFlowCovariancesVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",i)<<endl;
13074 } // end of for(Int_t i=0;i<6;i++)
13075 if(!fIntFlowRebinnedInM)
13078 cout<<" WARNING (QC): fIntFlowRebinnedInM is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
13082 if(!fIntFlowQcumulantsRebinnedInM)
13085 cout<<" WARNING (QC): fIntFlowQcumulantsRebinnedInM is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
13090 } // end of void AliFlowAnalysisWithQCumulants::CheckPointersUsedInFinish()
13092 //================================================================================================================================
13094 void AliFlowAnalysisWithQCumulants::CheckPointersUsedInMake()
13096 // Check all pointers used in method Make().
13098 if(!fAvMultiplicity)
13101 cout<<" WARNING (QC): fAvMultiplicity is NULL in CheckPointersUsedInMake() !!!!"<<endl;
13105 if((fUsePhiWeights||fUsePtWeights||fUseEtaWeights) && !fIntFlowExtraCorrelationsPro)
13108 cout<<" WARNING (QC): fIntFlowExtraCorrelationsPro is NULL in CheckPointersUsedInMake() !!!!"<<endl;
13113 } // end of void AliFlowAnalysisWithQCumulants::CheckPointersUsedInMake()