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"
67 //================================================================================================================
70 ClassImp(AliFlowAnalysisWithQCumulants)
72 AliFlowAnalysisWithQCumulants::AliFlowAnalysisWithQCumulants():
77 fCommonHists2nd(NULL),
78 fCommonHists4th(NULL),
79 fCommonHists6th(NULL),
80 fCommonHists8th(NULL),
81 fCommonHistsResults2nd(NULL),
82 fCommonHistsResults4th(NULL),
83 fCommonHistsResults6th(NULL),
84 fCommonHistsResults8th(NULL),
99 // 2a.) particle weights:
101 fUsePhiWeights(kFALSE),
102 fUsePtWeights(kFALSE),
103 fUseEtaWeights(kFALSE),
104 fUseParticleWeights(NULL),
108 // 2b.) event weights:
109 fMultiplicityWeight(NULL),
110 // 3.) integrated flow:
112 fIntFlowProfiles(NULL),
113 fIntFlowResults(NULL),
115 fApplyCorrectionForNUA(kTRUE),
116 fApplyCorrectionForNUAVsM(kFALSE),
120 fPropagateErrorFromCorrelations(kFALSE),
121 fCalculateCumulantsVsM(kTRUE),
122 fMinimumBiasReferenceFlow(kTRUE),
126 fIntFlowCorrelationsEBE(NULL),
127 fIntFlowEventWeightsForCorrelationsEBE(NULL),
128 fIntFlowCorrelationsAllEBE(NULL),
129 fAvMultiplicity(NULL),
130 fIntFlowCorrelationsPro(NULL),
131 fIntFlowCorrelationsAllPro(NULL),
132 fIntFlowExtraCorrelationsPro(NULL),
133 fIntFlowProductOfCorrelationsPro(NULL),
134 fIntFlowProductOfCorrectionTermsForNUAPro(NULL),
135 fIntFlowCorrelationsHist(NULL),
136 fIntFlowCorrelationsAllHist(NULL),
137 fIntFlowCovariances(NULL),
138 fIntFlowSumOfProductOfEventWeights(NULL),
139 fIntFlowCovariancesNUA(NULL),
140 fIntFlowSumOfProductOfEventWeightsNUA(NULL),
141 fIntFlowQcumulants(NULL),
142 fIntFlowQcumulantsRebinnedInM(NULL),
144 fIntFlowRebinnedInM(NULL),
145 fIntFlowDetectorBias(NULL),
146 // 4.) differential flow:
148 fDiffFlowProfiles(NULL),
149 fDiffFlowResults(NULL),
150 fDiffFlowFlags(NULL),
151 fCalculate2DFlow(kFALSE),
152 // 5.) distributions:
153 fDistributionsList(NULL),
154 fDistributionsFlags(NULL),
155 fStoreDistributions(kFALSE),
156 // x.) debugging and cross-checking:
157 fNestedLoopsList(NULL),
158 fEvaluateIntFlowNestedLoops(kFALSE),
159 fEvaluateDiffFlowNestedLoops(kFALSE),
160 fMaxAllowedMultiplicity(10),
161 fEvaluateNestedLoops(NULL),
162 fIntFlowDirectCorrelations(NULL),
163 fIntFlowExtraDirectCorrelations(NULL),
164 fCrossCheckInPtBinNo(10),
165 fCrossCheckInEtaBinNo(20),
166 fNoOfParticlesInBin(NULL)
170 // base list to hold all output objects:
171 fHistList = new TList();
172 fHistList->SetName("cobjQC");
173 fHistList->SetOwner(kTRUE);
175 // list to hold histograms with phi, pt and eta weights:
176 fWeightsList = new TList();
178 // multiplicity weight:
179 fMultiplicityWeight = new TString("combinations");
182 fAnalysisLabel = new TString();
184 // initialize all arrays:
185 this->InitializeArraysForIntFlow();
186 this->InitializeArraysForDiffFlow();
187 this->InitializeArraysForDistributions();
188 this->InitializeArraysForNestedLoops();
190 } // end of constructor
193 //================================================================================================================
196 AliFlowAnalysisWithQCumulants::~AliFlowAnalysisWithQCumulants()
202 } // end of AliFlowAnalysisWithQCumulants::~AliFlowAnalysisWithQCumulants()
205 //================================================================================================================
208 void AliFlowAnalysisWithQCumulants::Init()
210 // a) Cross check if the settings make sense before starting the QC adventure;
211 // b) Access all common constants;
212 // c) Book all objects;
213 // d) Store flags for integrated and differential flow;
214 // e) Store flags for distributions of corelations;
215 // f) Store harmonic which will be estimated.
217 //save old value and prevent histograms from being added to directory
218 //to avoid name clashes in case multiple analaysis objects are used
220 Bool_t oldHistAddStatus = TH1::AddDirectoryStatus();
221 TH1::AddDirectory(kFALSE);
223 // a) Cross check if the settings make sense before starting the QC adventure;
224 this->CrossCheckSettings();
225 // b) Access all common constants:
226 this->AccessConstants();
227 // c) Book all objects:
228 this->BookAndFillWeightsHistograms();
229 this->BookAndNestAllLists();
230 this->BookCommonHistograms();
231 this->BookEverythingForIntegratedFlow();
232 this->BookEverythingForDifferentialFlow();
233 this->BookEverythingForDistributions();
234 this->BookEverythingForNestedLoops();
235 // d) Store flags for integrated and differential flow:
236 this->StoreIntFlowFlags();
237 this->StoreDiffFlowFlags();
238 // e) Store flags for distributions of corelations:
239 this->StoreFlagsForDistributions();
240 // f) Store harmonic which will be estimated:
241 this->StoreHarmonic();
243 TH1::AddDirectory(oldHistAddStatus);
244 } // end of void AliFlowAnalysisWithQCumulants::Init()
247 //================================================================================================================
250 void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
252 // Running over data only in this method.
254 // a) Check all pointers used in this method;
255 // b) Define local variables;
256 // c) Fill the common control histograms and call the method to fill fAvMultiplicity;
257 // d) Loop over data and calculate e-b-e quantities;
258 // e) Call all the methods which calculate correlations for reference flow;
259 // f) Call all the methods which calculate correlations for differential flow;
260 // g) Distributions of correlations;
261 // h) Debugging and cross-checking (evaluate nested loops);
262 // i) Reset all event-by-event quantities.
264 // a) Check all pointers used in this method:
265 this->CheckPointersUsedInMake();
267 // b) Define local variables:
268 Double_t dPhi = 0.; // azimuthal angle in the laboratory frame
269 Double_t dPt = 0.; // transverse momentum
270 Double_t dEta = 0.; // pseudorapidity
271 Double_t wPhi = 1.; // phi weight
272 Double_t wPt = 1.; // pt weight
273 Double_t wEta = 1.; // eta weight
274 Int_t nRP = anEvent->GetEventNSelTracksRP(); // number of RPs (i.e. number of particles used to determine the reaction plane)
276 // c) Fill the common control histograms and call the method to fill fAvMultiplicity:
277 this->FillCommonControlHistograms(anEvent);
278 this->FillAverageMultiplicities(nRP);
280 // d) Loop over data and calculate e-b-e quantities:
281 Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = total number of primary tracks, i.e. nPrim = nRP + nPOI where:
282 // nRP = # of particles used to determine the reaction plane;
283 // nPOI = # of particles of interest for a detailed flow analysis;
285 AliFlowTrackSimple *aftsTrack = NULL;
287 for(Int_t i=0;i<nPrim;i++)
289 aftsTrack=anEvent->GetTrack(i);
292 if(!(aftsTrack->InRPSelection() || aftsTrack->InPOISelection())) continue; // consider only tracks which are RPs or POIs
293 Int_t n = fHarmonic; // shortcut for the harmonic
294 if(aftsTrack->InRPSelection()) // RP condition:
296 dPhi = aftsTrack->Phi();
297 dPt = aftsTrack->Pt();
298 dEta = aftsTrack->Eta();
299 if(fUsePhiWeights && fPhiWeights && fnBinsPhi) // determine phi weight for this particle:
301 wPhi = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*fnBinsPhi/TMath::TwoPi())));
303 if(fUsePtWeights && fPtWeights && fnBinsPt) // determine pt weight for this particle:
305 wPt = fPtWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/fPtBinWidth)));
307 if(fUseEtaWeights && fEtaWeights && fEtaBinWidth) // determine eta weight for this particle:
309 wEta = fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/fEtaBinWidth)));
313 // calculate Re[Q_{m*n,k}] and Im[Q_{m*n,k}], m = 1,2,3,4, for this event:
314 for(Int_t m=0;m<4;m++)
316 for(Int_t k=0;k<9;k++)
318 (*fReQ)(m,k)+=pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1)*n*dPhi);
319 (*fImQ)(m,k)+=pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1)*n*dPhi);
322 // calculate S^{M}_{p,k} for this event
323 // Remark: final calculation of S^{M}_{p,k} follows after the loop over data bellow:
324 for(Int_t p=0;p<8;p++)
326 for(Int_t k=0;k<9;k++)
328 (*fSMpk)(p,k)+=pow(wPhi*wPt*wEta,k);
332 // differential flow:
335 for(Int_t m=0;m<4;m++)
337 for(Int_t k=0;k<9;k++)
339 fReRPQ1dEBE[0][0][m][k]->Fill(dPt,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
340 fImRPQ1dEBE[0][0][m][k]->Fill(dPt,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
344 // s_{k}(pt) for RPs // to be improved (clarified)
345 // Remark: final calculation of s_{p,k}(pt) follows after the loop over data bellow:
346 for(Int_t k=0;k<9;k++)
348 fs1dEBE[0][0][k]->Fill(dPt,pow(wPhi*wPt*wEta,k),1.);
352 for(Int_t m=0;m<4;m++)
354 for(Int_t k=0;k<9;k++)
356 fReRPQ1dEBE[0][1][m][k]->Fill(dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
357 fImRPQ1dEBE[0][1][m][k]->Fill(dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
360 // s_{k}(eta) for RPs // to be improved (clarified)
361 // Remark: final calculation of s_{p,k}(eta) follows after the loop over data bellow:
362 for(Int_t k=0;k<9;k++)
364 fs1dEBE[0][1][k]->Fill(dEta,pow(wPhi*wPt*wEta,k),1.);
373 // (r_{m*m,k}(pt,eta)):
374 for(Int_t m=0;m<4;m++)
376 for(Int_t k=0;k<9;k++)
378 fReRPQ2dEBE[0][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
379 fImRPQ2dEBE[0][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
382 // s_{k}(pt,eta) for RPs // to be improved (clarified)
383 // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:
384 for(Int_t k=0;k<9;k++)
386 fs2dEBE[0][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k),1.);
388 } // end of if(fCalculate2DFlow)
393 if(aftsTrack->InPOISelection())
397 for(Int_t m=0;m<4;m++)
399 for(Int_t k=0;k<9;k++)
401 fReRPQ1dEBE[2][0][m][k]->Fill(dPt,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
402 fImRPQ1dEBE[2][0][m][k]->Fill(dPt,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
405 // s_{k}(pt) for RP&&POIs // to be improved (clarified)
406 // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:
407 for(Int_t k=0;k<9;k++)
409 fs1dEBE[2][0][k]->Fill(dPt,pow(wPhi*wPt*wEta,k),1.);
413 for(Int_t m=0;m<4;m++)
415 for(Int_t k=0;k<9;k++)
417 fReRPQ1dEBE[2][1][m][k]->Fill(dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
418 fImRPQ1dEBE[2][1][m][k]->Fill(dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
421 // s_{k}(eta) for RP&&POIs // to be improved (clarified)
422 // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:
423 for(Int_t k=0;k<9;k++)
425 fs1dEBE[2][1][k]->Fill(dEta,pow(wPhi*wPt*wEta,k),1.);
432 // (q_{m*m,k}(pt,eta)):
433 for(Int_t m=0;m<4;m++)
435 for(Int_t k=0;k<9;k++)
437 fReRPQ2dEBE[2][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
438 fImRPQ2dEBE[2][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
441 // s_{k}(pt,eta) for RP&&POIs // to be improved (clarified)
442 // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:
443 for(Int_t k=0;k<9;k++)
445 fs2dEBE[2][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k),1.);
447 } // end of if(fCalculate2DFlow)
450 } // end of if(aftsTrack->InPOISelection())
454 } // end of if(pTrack->InRPSelection())
458 if(aftsTrack->InPOISelection())
460 dPhi = aftsTrack->Phi();
461 dPt = aftsTrack->Pt();
462 dEta = aftsTrack->Eta();
466 for(Int_t m=0;m<4;m++)
468 fReRPQ1dEBE[1][0][m][0]->Fill(dPt,TMath::Cos((m+1.)*n*dPhi),1.);
469 fImRPQ1dEBE[1][0][m][0]->Fill(dPt,TMath::Sin((m+1.)*n*dPhi),1.);
473 for(Int_t m=0;m<4;m++)
475 fReRPQ1dEBE[1][1][m][0]->Fill(dEta,TMath::Cos((m+1.)*n*dPhi),1.);
476 fImRPQ1dEBE[1][1][m][0]->Fill(dEta,TMath::Sin((m+1.)*n*dPhi),1.);
485 for(Int_t m=0;m<4;m++)
487 fReRPQ2dEBE[1][m][0]->Fill(dPt,dEta,TMath::Cos((m+1.)*n*dPhi),1.);
488 fImRPQ2dEBE[1][m][0]->Fill(dPt,dEta,TMath::Sin((m+1.)*n*dPhi),1.);
490 } // end of if(fCalculate2DFlow)
494 } // end of if(pTrack->InPOISelection() )
497 } else // to if(aftsTrack)
500 cout<<" WARNING: no particle! (i.e. aftsTrack is a NULL pointer in AFAWQC::Make().)"<<endl;
503 } // end of for(Int_t i=0;i<nPrim;i++)
505 // calculate the final expressions for S^{M}_{p,k}:
506 for(Int_t p=0;p<8;p++)
508 for(Int_t k=0;k<9;k++)
510 (*fSMpk)(p,k)=pow((*fSMpk)(p,k),p+1);
514 // e) Call all the methods which calculate correlations for reference flow:
515 if(!fEvaluateIntFlowNestedLoops)
517 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
519 if(nRP>1) this->CalculateIntFlowCorrelations(); // without using particle weights
520 } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
522 if(nRP>1) this->CalculateIntFlowCorrelationsUsingParticleWeights(); // with using particle weights
525 if(nRP>3) this->CalculateIntFlowProductOfCorrelations();
526 if(nRP>1) this->CalculateIntFlowSumOfEventWeights();
527 if(nRP>1) this->CalculateIntFlowSumOfProductOfEventWeights();
528 if(fApplyCorrectionForNUA)
530 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
532 if(nRP>0) this->CalculateIntFlowCorrectionsForNUASinTerms();
533 if(nRP>0) this->CalculateIntFlowCorrectionsForNUACosTerms();
534 } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
536 if(nRP>0) this->CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights();
537 if(nRP>0) this->CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights();
540 if(nRP>0) this->CalculateIntFlowProductOfCorrectionTermsForNUA();
541 if(nRP>0) this->CalculateIntFlowSumOfEventWeightsNUA();
542 if(nRP>0) this->CalculateIntFlowSumOfProductOfEventWeightsNUA();
543 } // end of if(fApplyCorrectionForNUA)
544 } // end of if(!fEvaluateIntFlowNestedLoops)
546 // f) Call all the methods which calculate correlations for differential flow:
547 if(!fEvaluateDiffFlowNestedLoops)
549 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
551 // without using particle weights:
552 this->CalculateDiffFlowCorrelations("RP","Pt");
553 this->CalculateDiffFlowCorrelations("RP","Eta");
554 this->CalculateDiffFlowCorrelations("POI","Pt");
555 this->CalculateDiffFlowCorrelations("POI","Eta");
556 if(fApplyCorrectionForNUA)
558 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Pt");
559 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Eta");
560 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Pt");
561 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Eta");
562 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Pt");
563 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Eta");
564 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Pt");
565 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Eta");
566 } // end of if(fApplyCorrectionForNUA)
567 } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
569 // with using particle weights:
570 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Pt");
571 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Eta");
572 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Pt");
573 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Eta");
574 if(fApplyCorrectionForNUA)
576 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Pt");
577 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Eta");
578 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Pt");
579 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Eta");
580 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Pt");
581 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Eta");
582 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Pt");
583 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Eta");
584 } // end of if(fApplyCorrectionForNUA)
587 // whether or not using particle weights the following is calculated in the same way:
588 this->CalculateDiffFlowProductOfCorrelations("RP","Pt");
589 this->CalculateDiffFlowProductOfCorrelations("RP","Eta");
590 this->CalculateDiffFlowProductOfCorrelations("POI","Pt");
591 this->CalculateDiffFlowProductOfCorrelations("POI","Eta");
592 this->CalculateDiffFlowSumOfEventWeights("RP","Pt");
593 this->CalculateDiffFlowSumOfEventWeights("RP","Eta");
594 this->CalculateDiffFlowSumOfEventWeights("POI","Pt");
595 this->CalculateDiffFlowSumOfEventWeights("POI","Eta");
596 this->CalculateDiffFlowSumOfProductOfEventWeights("RP","Pt");
597 this->CalculateDiffFlowSumOfProductOfEventWeights("RP","Eta");
598 this->CalculateDiffFlowSumOfProductOfEventWeights("POI","Pt");
599 this->CalculateDiffFlowSumOfProductOfEventWeights("POI","Eta");
600 } // end of if(!fEvaluateDiffFlowNestedLoops)
608 // 2D differential flow
612 if(nRP>1) this->CalculateCorrelationsForDifferentialFlow2D("RP");
613 if(nRP>1) this->CalculateCorrelationsForDifferentialFlow2D("POI");
616 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
618 if(nRP>1) this->CalculateWeightedCorrelationsForDifferentialFlow2D("RP");
619 if(nRP>1) this->CalculateWeightedCorrelationsForDifferentialFlow2D("POI");
621 } // end of if(fCalculate2DFlow)
624 // g) Distributions of correlations;
625 if(fStoreDistributions)
627 this->StoreDistributionsOfCorrelations();
630 // h) Debugging and cross-checking (evaluate nested loops):
631 // h1) cross-checking results for integrated flow:
632 if(fEvaluateIntFlowNestedLoops)
634 if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10
636 // without using particle weights:
637 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
640 this->CalculateIntFlowCorrelations(); // from Q-vectors
641 this->EvaluateIntFlowCorrelationsWithNestedLoops(anEvent); // from nested loops (to be improved: do I have to pass here anEvent or not?)
642 // correction for non-uniform acceptance:
643 this->CalculateIntFlowCorrectionsForNUASinTerms(); // from Q-vectors (sin terms)
644 this->CalculateIntFlowCorrectionsForNUACosTerms(); // from Q-vectors (cos terms)
645 this->EvaluateIntFlowCorrectionsForNUAWithNestedLoops(anEvent); // from nested loops (both sin and cos terms)
647 // using particle weights:
648 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
651 this->CalculateIntFlowCorrelationsUsingParticleWeights(); // from Q-vectors
652 this->EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent); // from nested loops (to be improved: do I have to pass here anEvent or not?)
653 // correction for non-uniform acceptance:
654 this->CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights(); // from Q-vectors (sin terms)
655 this->CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights(); // from Q-vectors (cos terms)
656 this->EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(anEvent); // from nested loops (both sin and cos terms)
658 } else if (nPrim>fMaxAllowedMultiplicity) // to if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity)
661 cout<<"Skipping the event because multiplicity is "<<nPrim<<". Too high to evaluate nested loops!"<<endl;
665 cout<<"Skipping the event because multiplicity is "<<nPrim<<"."<<endl;
667 } // end of if(fEvaluateIntFlowNestedLoops)
669 // h2) cross-checking results for differential flow:
670 if(fEvaluateDiffFlowNestedLoops)
672 if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10
674 // without using particle weights:
675 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
677 // reduced correlations:
679 this->CalculateDiffFlowCorrelations("RP","Pt");
680 this->CalculateDiffFlowCorrelations("RP","Eta");
681 this->CalculateDiffFlowCorrelations("POI","Pt");
682 this->CalculateDiffFlowCorrelations("POI","Eta");
684 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"RP","Pt");
685 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"RP","Eta");
686 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"POI","Pt");
687 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"POI","Eta");
688 // reduced corrections for non-uniform acceptance:
690 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Pt");
691 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Eta");
692 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Pt");
693 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Eta");
694 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Pt");
695 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Eta");
696 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Pt");
697 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Eta");
699 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"RP","Pt");
700 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"RP","Eta");
701 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"POI","Pt");
702 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"POI","Eta");
703 } // end of if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
704 // using particle weights:
705 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
707 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Pt");
708 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Eta");
709 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Pt");
710 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Eta");
711 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Pt");
712 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Eta");
713 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Pt");
714 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Eta");
715 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Pt");
716 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Eta");
717 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Pt");
718 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Eta");
719 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"RP","Pt");
720 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"RP","Eta");
721 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"POI","Pt");
722 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"POI","Eta");
723 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"RP","Pt");
724 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"RP","Eta");
725 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"POI","Pt");
726 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"POI","Eta");
727 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
728 } // end of if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10
729 } // end of if(fEvaluateDiffFlowNestedLoops)
731 // i) Reset all event-by-event quantities.
732 this->ResetEventByEventQuantities();
734 } // end of AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
736 //================================================================================================================================
738 void AliFlowAnalysisWithQCumulants::Finish()
740 // Calculate the final results.
742 // a) Check all pointers used in this method;
743 // b) Acces the constants;
744 // c) Access the flags;
745 // d) Calculate the final results for reference flow (without/with weights);
746 // e) Correct the results for reference flow (without/with weights) for effects of non-uniform acceptance (NUA);
747 // f) Store results for reference flow in AliFlowCommonHistResults and print them on the screen;
748 // g) Calculate the final results for differential flow (without/with weights);
749 // h) Correct the results for differential flow (without/with weights) for effects of non-uniform acceptance (NUA);
750 // i) Calculate the final results for integrated flow (RP/POI) and store in AliFlowCommonHistResults;
751 // j) Store results for differential flow in AliFlowCommonHistResults;
752 // k) Print the final results for integrated flow (RP/POI) on the screen;
753 // l) Cross-checking: Results from Q-vectors vs results from nested loops.
755 // a) Check all pointers used in this method:
756 this->CheckPointersUsedInFinish();
758 // b) Acces the constants:
759 this->AccessConstants();
761 if(fCommonHists && fCommonHists->GetHarmonic()) // to be improved (moved somewhere else)
763 fHarmonic = (Int_t)(fCommonHists->GetHarmonic())->GetBinContent(1);
766 // c) Access the flags: // to be improved (implement a method for this)
767 fUsePhiWeights = (Bool_t)fUseParticleWeights->GetBinContent(1);
768 fUsePtWeights = (Bool_t)fUseParticleWeights->GetBinContent(2);
769 fUseEtaWeights = (Bool_t)fUseParticleWeights->GetBinContent(3);
770 fApplyCorrectionForNUA = (Bool_t)fIntFlowFlags->GetBinContent(3);
771 fPrintFinalResults[0] = (Bool_t)fIntFlowFlags->GetBinContent(4);
772 fPrintFinalResults[1] = (Bool_t)fIntFlowFlags->GetBinContent(5);
773 fPrintFinalResults[2] = (Bool_t)fIntFlowFlags->GetBinContent(6);
774 fPrintFinalResults[3] = (Bool_t)fIntFlowFlags->GetBinContent(7);
775 fApplyCorrectionForNUAVsM = (Bool_t)fIntFlowFlags->GetBinContent(8);
776 fPropagateErrorFromCorrelations = (Bool_t)fIntFlowFlags->GetBinContent(9);
777 fCalculateCumulantsVsM = (Bool_t)fIntFlowFlags->GetBinContent(10);
778 fMinimumBiasReferenceFlow = (Bool_t)fIntFlowFlags->GetBinContent(11);
779 fEvaluateIntFlowNestedLoops = (Bool_t)fEvaluateNestedLoops->GetBinContent(1);
780 fEvaluateDiffFlowNestedLoops = (Bool_t)fEvaluateNestedLoops->GetBinContent(2);
781 fCrossCheckInPtBinNo = (Int_t)fEvaluateNestedLoops->GetBinContent(3);
782 fCrossCheckInEtaBinNo = (Int_t)fEvaluateNestedLoops->GetBinContent(4);
784 // d) Calculate the final results for reference flow (without/with weights):
785 this->FinalizeCorrelationsIntFlow();
786 this->CalculateCovariancesIntFlow();
787 this->CalculateCumulantsIntFlow();
788 this->CalculateIntFlow();
790 // e) Correct the results for reference flow (without/with weights) for effects of non-uniform acceptance (NUA):
791 if(fApplyCorrectionForNUA)
793 this->FinalizeCorrectionTermsForNUAIntFlow();
794 // this->CalculateCovariancesNUAIntFlow(); // to be improved (enabled eventually)
795 this->CalculateQcumulantsCorrectedForNUAIntFlow();
796 this->CalculateIntFlowCorrectedForNUA();
797 this->CalculateDetectorEffectsForTrueCorrelations();
800 // f) Store results for reference flow in AliFlowCommonHistResults and print them on the screen:
801 this->FillCommonHistResultsIntFlow();
802 if(fPrintFinalResults[0]){this->PrintFinalResultsForIntegratedFlow("RF");}
803 if(fPrintFinalResults[3] && fCalculateCumulantsVsM){this->PrintFinalResultsForIntegratedFlow("RF, rebinned in M");}
805 // g) Calculate the final results for differential flow (without/with weights):
806 this->FinalizeReducedCorrelations("RP","Pt");
807 this->FinalizeReducedCorrelations("RP","Eta");
808 this->FinalizeReducedCorrelations("POI","Pt");
809 this->FinalizeReducedCorrelations("POI","Eta");
810 this->CalculateDiffFlowCovariances("RP","Pt");
811 this->CalculateDiffFlowCovariances("RP","Eta");
812 this->CalculateDiffFlowCovariances("POI","Pt");
813 this->CalculateDiffFlowCovariances("POI","Eta");
814 this->CalculateDiffFlowCumulants("RP","Pt");
815 this->CalculateDiffFlowCumulants("RP","Eta");
816 this->CalculateDiffFlowCumulants("POI","Pt");
817 this->CalculateDiffFlowCumulants("POI","Eta");
818 this->CalculateDiffFlow("RP","Pt");
819 this->CalculateDiffFlow("RP","Eta");
820 this->CalculateDiffFlow("POI","Pt");
821 this->CalculateDiffFlow("POI","Eta");
823 // h) Correct the results for differential flow (without/with weights) for effects of non-uniform acceptance (NUA):
824 if(fApplyCorrectionForNUA)
826 this->FinalizeCorrectionTermsForNUADiffFlow("RP","Pt");
827 this->FinalizeCorrectionTermsForNUADiffFlow("RP","Eta");
828 this->FinalizeCorrectionTermsForNUADiffFlow("POI","Pt");
829 this->FinalizeCorrectionTermsForNUADiffFlow("POI","Eta");
830 this->CalculateDiffFlowCumulantsCorrectedForNUA("RP","Pt");
831 this->CalculateDiffFlowCumulantsCorrectedForNUA("RP","Eta");
832 this->CalculateDiffFlowCumulantsCorrectedForNUA("POI","Pt");
833 this->CalculateDiffFlowCumulantsCorrectedForNUA("POI","Eta");
834 this->CalculateDiffFlowCorrectedForNUA("RP","Pt");
835 this->CalculateDiffFlowCorrectedForNUA("RP","Eta");
836 this->CalculateDiffFlowCorrectedForNUA("POI","Pt");
837 this->CalculateDiffFlowCorrectedForNUA("POI","Eta");
840 // i) Calculate the final results for integrated flow (RP/POI) and store in AliFlowCommonHistResults:
841 this->CalculateFinalResultsForRPandPOIIntegratedFlow("RP");
842 this->CalculateFinalResultsForRPandPOIIntegratedFlow("POI");
844 // j) Store results for differential flow in AliFlowCommonHistResults:
845 this->FillCommonHistResultsDiffFlow("RP");
846 this->FillCommonHistResultsDiffFlow("POI");
848 // k) Print the final results for integrated flow (RP/POI) on the screen:
849 if(fPrintFinalResults[1]){this->PrintFinalResultsForIntegratedFlow("RP");}
850 if(fPrintFinalResults[2]){this->PrintFinalResultsForIntegratedFlow("POI");}
852 // l) Cross-checking: Results from Q-vectors vs results from nested loops:
853 // l1) Reference flow:
854 if(fEvaluateIntFlowNestedLoops)
856 this->CrossCheckIntFlowCorrelations();
857 this->CrossCheckIntFlowCorrectionTermsForNUA();
858 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights) this->CrossCheckIntFlowExtraCorrelations();
859 } // end of if(fEvaluateIntFlowNestedLoops)
861 // l2) Differential flow:
862 if(fEvaluateDiffFlowNestedLoops)
865 this->PrintNumberOfParticlesInSelectedBin();
866 this->CrossCheckDiffFlowCorrelations("RP","Pt");
867 this->CrossCheckDiffFlowCorrelations("RP","Eta");
868 this->CrossCheckDiffFlowCorrelations("POI","Pt");
869 this->CrossCheckDiffFlowCorrelations("POI","Eta");
870 // Correction terms for non-uniform acceptance:
871 this->CrossCheckDiffFlowCorrectionTermsForNUA("RP","Pt");
872 this->CrossCheckDiffFlowCorrectionTermsForNUA("RP","Eta");
873 this->CrossCheckDiffFlowCorrectionTermsForNUA("POI","Pt");
874 this->CrossCheckDiffFlowCorrectionTermsForNUA("POI","Eta");
875 } // end of if(fEvaluateDiffFlowNestedLoops)
877 } // end of AliFlowAnalysisWithQCumulants::Finish()
879 //================================================================================================================================
881 void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTerms()
883 // calculate corrections for non-uniform acceptance of the detector for no-name integrated flow (cos terms)
886 Double_t dMult = (*fSMpk)(0,0);
888 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
889 Double_t dReQ1n = (*fReQ)(0,0);
890 Double_t dReQ2n = (*fReQ)(1,0);
891 //Double_t dReQ3n = (*fReQ)(2,0);
892 //Double_t dReQ4n = (*fReQ)(3,0);
893 Double_t dImQ1n = (*fImQ)(0,0);
894 Double_t dImQ2n = (*fImQ)(1,0);
895 //Double_t dImQ3n = (*fImQ)(2,0);
896 //Double_t dImQ4n = (*fImQ)(3,0);
898 // *************************************************************
899 // **** corrections for non-uniform acceptance (cos terms): ****
900 // *************************************************************
902 // Remark 1: corrections for non-uniform acceptance (cos terms) calculated with non-weighted Q-vectors
903 // are stored in 1D profile fQCorrectionsCos.
904 // Remark 2: binning of fIntFlowCorrectionTermsForNUAPro[1] is organized as follows:
905 // --------------------------------------------------------------------------------------------------------------------
906 // 1st bin: <<cos(n*(phi1))>> = cosP1n
907 // 2nd bin: <<cos(n*(phi1+phi2))>> = cosP1nP1n
908 // 3rd bin: <<cos(n*(phi1-phi2-phi3))>> = cosP1nM1nM1n
909 // 4th bin: <<cos(n*(2phi1-phi2))>> = cosP2nM1n
910 // --------------------------------------------------------------------------------------------------------------------
913 Double_t cosP1n = 0.; // <<cos(n*(phi1))>>
917 cosP1n = dReQ1n/dMult;
919 // average non-weighted 1-particle correction (cos terms) for non-uniform acceptance for single event:
920 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(1,cosP1n);
921 // event weights for NUA terms:
922 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(1,dMult);
924 // final average non-weighted 1-particle correction (cos terms) for non-uniform acceptance for all events:
925 fIntFlowCorrectionTermsForNUAPro[1]->Fill(0.5,cosP1n,dMult);
926 if(fCalculateCumulantsVsM){fIntFlowCorrectionTermsForNUAVsMPro[1][0]->Fill(dMult+0.5,cosP1n,dMult);}
930 Double_t cosP1nP1n = 0.; // <<cos(n*(phi1+phi2))>>
931 Double_t cosP2nM1n = 0.; // <<cos(n*(2phi1-phi2))>>
935 cosP1nP1n = (pow(dReQ1n,2)-pow(dImQ1n,2)-dReQ2n)/(dMult*(dMult-1));
936 cosP2nM1n = (dReQ2n*dReQ1n+dImQ2n*dImQ1n-dReQ1n)/(dMult*(dMult-1));
938 // average non-weighted 2-particle correction (cos terms) for non-uniform acceptance for single event:
939 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(2,cosP1nP1n);
940 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(4,cosP2nM1n);
941 // event weights for NUA terms:
942 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(2,dMult*(dMult-1));
943 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(4,dMult*(dMult-1));
945 // final average non-weighted 2-particle correction (cos terms) for non-uniform acceptance for all events:
946 fIntFlowCorrectionTermsForNUAPro[1]->Fill(1.5,cosP1nP1n,dMult*(dMult-1));
947 fIntFlowCorrectionTermsForNUAPro[1]->Fill(3.5,cosP2nM1n,dMult*(dMult-1));
948 if(fCalculateCumulantsVsM)
950 fIntFlowCorrectionTermsForNUAVsMPro[1][1]->Fill(dMult+0.5,cosP1nP1n,dMult*(dMult-1));
951 fIntFlowCorrectionTermsForNUAVsMPro[1][3]->Fill(dMult+0.5,cosP2nM1n,dMult*(dMult-1));
956 Double_t cosP1nM1nM1n = 0.; // <<cos(n*(phi1-phi2-phi3))>>
960 cosP1nM1nM1n = (dReQ1n*(pow(dReQ1n,2)+pow(dImQ1n,2))-dReQ1n*dReQ2n-dImQ1n*dImQ2n-2.*(dMult-1)*dReQ1n)
961 / (dMult*(dMult-1)*(dMult-2));
963 // average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for single event:
964 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(3,cosP1nM1nM1n);
965 // event weights for NUA terms:
966 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(3,dMult*(dMult-1)*(dMult-2));
968 // final average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for all events:
969 fIntFlowCorrectionTermsForNUAPro[1]->Fill(2.5,cosP1nM1nM1n,dMult*(dMult-1)*(dMult-2));
970 if(fCalculateCumulantsVsM){fIntFlowCorrectionTermsForNUAVsMPro[1][2]->Fill(dMult+0.5,cosP1nM1nM1n,dMult*(dMult-1)*(dMult-2));}
973 } // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTerms()
976 //================================================================================================================================
979 void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTerms()
981 // calculate corrections for non-uniform acceptance of the detector for no-name integrated flow (sin terms)
984 Double_t dMult = (*fSMpk)(0,0);
986 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
987 Double_t dReQ1n = (*fReQ)(0,0);
988 Double_t dReQ2n = (*fReQ)(1,0);
989 //Double_t dReQ3n = (*fReQ)(2,0);
990 //Double_t dReQ4n = (*fReQ)(3,0);
991 Double_t dImQ1n = (*fImQ)(0,0);
992 Double_t dImQ2n = (*fImQ)(1,0);
993 //Double_t dImQ3n = (*fImQ)(2,0);
994 //Double_t dImQ4n = (*fImQ)(3,0);
996 // *************************************************************
997 // **** corrections for non-uniform acceptance (sin terms): ****
998 // *************************************************************
1000 // Remark 1: corrections for non-uniform acceptance (sin terms) calculated with non-weighted Q-vectors
1001 // are stored in 1D profile fQCorrectionsSin.
1002 // Remark 2: binning of fIntFlowCorrectionTermsForNUAPro[0] is organized as follows:
1003 // --------------------------------------------------------------------------------------------------------------------
1004 // 1st bin: <<sin(n*(phi1))>> = sinP1n
1005 // 2nd bin: <<sin(n*(phi1+phi2))>> = sinP1nP1n
1006 // 3rd bin: <<sin(n*(phi1-phi2-phi3))>> = sinP1nM1nM1n
1007 // 4th bin: <<sin(n*(2phi1-phi2))>> = sinP2nM1n
1008 // --------------------------------------------------------------------------------------------------------------------
1011 Double_t sinP1n = 0.; // <sin(n*(phi1))>
1015 sinP1n = dImQ1n/dMult;
1017 // average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for single event:
1018 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(1,sinP1n);
1019 // event weights for NUA terms:
1020 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(1,dMult);
1022 // final average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
1023 fIntFlowCorrectionTermsForNUAPro[0]->Fill(0.5,sinP1n,dMult);
1024 if(fCalculateCumulantsVsM){fIntFlowCorrectionTermsForNUAVsMPro[0][0]->Fill(dMult+0.5,sinP1n,dMult);}
1028 Double_t sinP1nP1n = 0.; // <<sin(n*(phi1+phi2))>>
1029 Double_t sinP2nM1n = 0.; // <<sin(n*(2phi1-phi2))>>
1032 sinP1nP1n = (2.*dReQ1n*dImQ1n-dImQ2n)/(dMult*(dMult-1));
1033 sinP2nM1n = (dImQ2n*dReQ1n-dReQ2n*dImQ1n-dImQ1n)/(dMult*(dMult-1));
1035 // average non-weighted 2-particle correction (sin terms) for non-uniform acceptance for single event:
1036 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(2,sinP1nP1n);
1037 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(4,sinP2nM1n);
1038 // event weights for NUA terms:
1039 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(2,dMult*(dMult-1));
1040 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(4,dMult*(dMult-1));
1042 // final average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
1043 fIntFlowCorrectionTermsForNUAPro[0]->Fill(1.5,sinP1nP1n,dMult*(dMult-1));
1044 fIntFlowCorrectionTermsForNUAPro[0]->Fill(3.5,sinP2nM1n,dMult*(dMult-1));
1045 if(fCalculateCumulantsVsM)
1047 fIntFlowCorrectionTermsForNUAVsMPro[0][1]->Fill(dMult+0.5,sinP1nP1n,dMult*(dMult-1));
1048 fIntFlowCorrectionTermsForNUAVsMPro[0][3]->Fill(dMult+0.5,sinP2nM1n,dMult*(dMult-1));
1053 Double_t sinP1nM1nM1n = 0.; // <<sin(n*(phi1-phi2-phi3))>>
1057 sinP1nM1nM1n = (-dImQ1n*(pow(dReQ1n,2)+pow(dImQ1n,2))+dReQ1n*dImQ2n-dImQ1n*dReQ2n+2.*(dMult-1)*dImQ1n)
1058 / (dMult*(dMult-1)*(dMult-2));
1060 // average non-weighted 3-particle correction (sin terms) for non-uniform acceptance for single event:
1061 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(3,sinP1nM1nM1n);
1062 // event weights for NUA terms:
1063 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(3,dMult*(dMult-1)*(dMult-2));
1065 // final average non-weighted 3-particle correction (sin terms) for non-uniform acceptance for all events:
1066 fIntFlowCorrectionTermsForNUAPro[0]->Fill(2.5,sinP1nM1nM1n,dMult*(dMult-1)*(dMult-2));
1067 if(fCalculateCumulantsVsM){fIntFlowCorrectionTermsForNUAVsMPro[0][2]->Fill(dMult+0.5,sinP1nM1nM1n,dMult*(dMult-1)*(dMult-2));}
1070 } // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTerms()
1073 //================================================================================================================================
1076 void AliFlowAnalysisWithQCumulants::GetOutputHistograms(TList *outputListHistos)
1078 // a) Get pointers for common control and common result histograms and profiles.
1079 // b) Get pointers for histograms with particle weights.
1080 // c) Get pointers for histograms and profiles relevant for integrated flow.
1081 // d) Get pointers for histograms and profiles relevant for differental flow.
1082 // e) Get pointers for histograms and profiles holding results obtained with nested loops.
1084 if(outputListHistos)
1086 this->SetHistList(outputListHistos);
1090 cout<<" WARNING (QC): fHistList is NULL in AFAWQC::GOH() !!!!"<<endl;
1094 this->GetPointersForCommonHistograms();
1095 this->GetPointersForParticleWeightsHistograms();
1096 this->GetPointersForIntFlowHistograms();
1097 this->GetPointersForDiffFlowHistograms();
1098 this->GetPointersForNestedLoopsHistograms();
1102 cout<<" WARNING (QC): outputListHistos is NULL in AFAWQC::GOH() !!!!"<<endl;
1107 } // end of void AliFlowAnalysisWithQCumulants::GetOutputHistograms(TList *outputListHistos)
1110 //================================================================================================================================
1113 TProfile* AliFlowAnalysisWithQCumulants::MakePtProjection(TProfile2D *profilePtEta) const
1115 // project 2D profile onto pt axis to get 1D profile
1117 Int_t nBinsPt = profilePtEta->GetNbinsX();
1118 Double_t dPtMin = (profilePtEta->GetXaxis())->GetXmin();
1119 Double_t dPtMax = (profilePtEta->GetXaxis())->GetXmax();
1121 Int_t nBinsEta = profilePtEta->GetNbinsY();
1123 TProfile *profilePt = new TProfile("","",nBinsPt,dPtMin,dPtMax);
1125 for(Int_t p=1;p<=nBinsPt;p++)
1127 Double_t contentPt = 0.;
1128 Double_t entryPt = 0.;
1129 Double_t spreadPt = 0.;
1133 for(Int_t e=1;e<=nBinsEta;e++)
1135 contentPt += (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)))
1136 * (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1137 entryPt += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1139 sum1 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)))
1140 * (pow(profilePtEta->GetBinError(profilePtEta->GetBin(p,e)),2.)
1141 + pow(profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)),2.));
1142 sum2 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1143 sum3 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)))
1144 * (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)));
1146 if(sum2>0. && sum1/sum2-pow(sum3/sum2,2.) > 0.)
1148 spreadPt = pow(sum1/sum2-pow(sum3/sum2,2.),0.5);
1150 profilePt->SetBinContent(p,contentPt);
1151 profilePt->SetBinEntries(p,entryPt);
1153 profilePt->SetBinError(p,spreadPt);
1160 } // end of TProfile* AliFlowAnalysisWithQCumulants::MakePtProjection(TProfile2D *profilePtEta)
1163 //================================================================================================================================
1166 TProfile* AliFlowAnalysisWithQCumulants::MakeEtaProjection(TProfile2D *profilePtEta) const
1168 // project 2D profile onto eta axis to get 1D profile
1170 Int_t nBinsEta = profilePtEta->GetNbinsY();
1171 Double_t dEtaMin = (profilePtEta->GetYaxis())->GetXmin();
1172 Double_t dEtaMax = (profilePtEta->GetYaxis())->GetXmax();
1174 Int_t nBinsPt = profilePtEta->GetNbinsX();
1176 TProfile *profileEta = new TProfile("","",nBinsEta,dEtaMin,dEtaMax);
1178 for(Int_t e=1;e<=nBinsEta;e++)
1180 Double_t contentEta = 0.;
1181 Double_t entryEta = 0.;
1182 for(Int_t p=1;p<=nBinsPt;p++)
1184 contentEta += (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)))
1185 * (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1186 entryEta += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1188 profileEta->SetBinContent(e,contentEta);
1189 profileEta->SetBinEntries(e,entryEta);
1194 } // end of TProfile* AliFlowAnalysisWithQCumulants::MakeEtaProjection(TProfile2D *profilePtEta)
1196 //================================================================================================================================
1198 void AliFlowAnalysisWithQCumulants::PrintFinalResultsForIntegratedFlow(TString type)
1200 // Printing on the screen the final results for integrated flow (RF, POI and RP).
1202 Int_t n = fHarmonic;
1204 Double_t dVn[4] = {0.}; // array to hold Vn{2}, Vn{4}, Vn{6} and Vn{8}
1205 Double_t dVnErr[4] = {0.}; // array to hold errors of Vn{2}, Vn{4}, Vn{6} and Vn{8}
1209 for(Int_t b=0;b<4;b++)
1211 dVn[b] = fIntFlow->GetBinContent(b+1);
1212 dVnErr[b] = fIntFlow->GetBinError(b+1);
1214 } else if(type == "RP")
1216 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinContent(1);
1217 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinError(1);
1218 dVn[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinContent(1);
1219 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinError(1);
1220 dVn[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinContent(1);
1221 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinError(1);
1222 dVn[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinContent(1);
1223 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinError(1);
1224 } else if(type == "POI")
1226 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinContent(1);
1227 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinError(1);
1228 dVn[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinContent(1);
1229 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinError(1);
1230 dVn[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinContent(1);
1231 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinError(1);
1232 dVn[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinContent(1);
1233 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinError(1);
1234 } else if(type == "RF, rebinned in M")
1236 for(Int_t b=0;b<4;b++)
1238 dVn[b] = fIntFlowRebinnedInM->GetBinContent(b+1);
1239 dVnErr[b] = fIntFlowRebinnedInM->GetBinError(b+1);
1243 TString title = " flow estimates from Q-cumulants";
1244 TString subtitle = " (";
1245 TString subtitle2 = " (rebinned in M)";
1247 if(type != "RF, rebinned in M")
1249 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
1251 subtitle.Append(type);
1252 subtitle.Append(", without weights)");
1255 subtitle.Append(type);
1256 subtitle.Append(", with weights)");
1260 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
1262 subtitle.Append("RF");
1263 subtitle.Append(", without weights)");
1266 subtitle.Append("RF");
1267 subtitle.Append(", with weights)");
1272 cout<<"*************************************"<<endl;
1273 cout<<"*************************************"<<endl;
1274 cout<<title.Data()<<endl;
1275 cout<<subtitle.Data()<<endl;
1276 if(type == "RF, rebinned in M"){cout<<subtitle2.Data()<<endl;}
1279 for(Int_t i=0;i<4;i++)
1281 cout<<" v_"<<n<<"{"<<2*(i+1)<<"} = "<<dVn[i]<<" +/- "<<dVnErr[i]<<endl;
1286 if(type == "RF" || type == "RF, rebinned in M")
1288 cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultRP()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultRP()->GetMean()<<endl;
1290 else if (type == "RP")
1292 cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultRP()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultRP()->GetMean()<<endl;
1294 else if (type == "POI")
1296 cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultPOI()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultPOI()->GetMean()<<endl;
1299 cout<<"*************************************"<<endl;
1300 cout<<"*************************************"<<endl;
1303 }// end of AliFlowAnalysisWithQCumulants::PrintFinalResultsForIntegratedFlow(TString type="RF");
1305 //================================================================================================================================
1307 void AliFlowAnalysisWithQCumulants::WriteHistograms(TString outputFileName)
1309 //store the final results in output .root file
1310 TFile *output = new TFile(outputFileName.Data(),"RECREATE");
1311 //output->WriteObject(fHistList, "cobjQC","SingleKey");
1312 fHistList->Write(fHistList->GetName(), TObject::kSingleKey);
1317 //================================================================================================================================
1320 void AliFlowAnalysisWithQCumulants::WriteHistograms(TDirectoryFile *outputFileName)
1322 //store the final results in output .root file
1323 fHistList->SetName("cobjQC");
1324 fHistList->SetOwner(kTRUE);
1325 outputFileName->Add(fHistList);
1326 outputFileName->Write(outputFileName->GetName(), TObject::kSingleKey);
1330 //================================================================================================================================
1333 void AliFlowAnalysisWithQCumulants::BookCommonHistograms()
1335 // Book common control histograms and common histograms for final results.
1336 // common control histogram (ALL events)
1337 TString commonHistsName = "AliFlowCommonHistQC";
1338 commonHistsName += fAnalysisLabel->Data();
1339 fCommonHists = new AliFlowCommonHist(commonHistsName.Data());
1340 fHistList->Add(fCommonHists);
1341 // common control histogram (for events with 2 and more particles)
1342 TString commonHists2ndOrderName = "AliFlowCommonHist2ndOrderQC";
1343 commonHists2ndOrderName += fAnalysisLabel->Data();
1344 fCommonHists2nd = new AliFlowCommonHist(commonHists2ndOrderName.Data());
1345 fHistList->Add(fCommonHists2nd);
1346 // common control histogram (for events with 4 and more particles)
1347 TString commonHists4thOrderName = "AliFlowCommonHist4thOrderQC";
1348 commonHists4thOrderName += fAnalysisLabel->Data();
1349 fCommonHists4th = new AliFlowCommonHist(commonHists4thOrderName.Data());
1350 fHistList->Add(fCommonHists4th);
1351 // common control histogram (for events with 6 and more particles)
1352 TString commonHists6thOrderName = "AliFlowCommonHist6thOrderQC";
1353 commonHists6thOrderName += fAnalysisLabel->Data();
1354 fCommonHists6th = new AliFlowCommonHist(commonHists6thOrderName.Data());
1355 fHistList->Add(fCommonHists6th);
1356 // common control histogram (for events with 8 and more particles)
1357 TString commonHists8thOrderName = "AliFlowCommonHist8thOrderQC";
1358 commonHists8thOrderName += fAnalysisLabel->Data();
1359 fCommonHists8th = new AliFlowCommonHist(commonHists8thOrderName.Data());
1360 fHistList->Add(fCommonHists8th);
1361 // common histograms for final results (calculated for events with 2 and more particles)
1362 TString commonHistResults2ndOrderName = "AliFlowCommonHistResults2ndOrderQC";
1363 commonHistResults2ndOrderName += fAnalysisLabel->Data();
1364 fCommonHistsResults2nd = new AliFlowCommonHistResults(commonHistResults2ndOrderName.Data());
1365 fHistList->Add(fCommonHistsResults2nd);
1366 // common histograms for final results (calculated for events with 4 and more particles)
1367 TString commonHistResults4thOrderName = "AliFlowCommonHistResults4thOrderQC";
1368 commonHistResults4thOrderName += fAnalysisLabel->Data();
1369 fCommonHistsResults4th = new AliFlowCommonHistResults(commonHistResults4thOrderName.Data());
1370 fHistList->Add(fCommonHistsResults4th);
1371 // common histograms for final results (calculated for events with 6 and more particles)
1372 TString commonHistResults6thOrderName = "AliFlowCommonHistResults6thOrderQC";
1373 commonHistResults6thOrderName += fAnalysisLabel->Data();
1374 fCommonHistsResults6th = new AliFlowCommonHistResults(commonHistResults6thOrderName.Data());
1375 fHistList->Add(fCommonHistsResults6th);
1376 // common histograms for final results (calculated for events with 8 and more particles)
1377 TString commonHistResults8thOrderName = "AliFlowCommonHistResults8thOrderQC";
1378 commonHistResults8thOrderName += fAnalysisLabel->Data();
1379 fCommonHistsResults8th = new AliFlowCommonHistResults(commonHistResults8thOrderName.Data());
1380 fHistList->Add(fCommonHistsResults8th);
1382 } // end of void AliFlowAnalysisWithQCumulants::BookCommonHistograms()
1385 //================================================================================================================================
1388 void AliFlowAnalysisWithQCumulants::BookAndFillWeightsHistograms()
1390 // book and fill histograms which hold phi, pt and eta weights
1394 cout<<"WARNING: fWeightsList is NULL in AFAWQC::BAFWH() !!!!"<<endl;
1398 TString fUseParticleWeightsName = "fUseParticleWeightsQC";
1399 fUseParticleWeightsName += fAnalysisLabel->Data();
1400 fUseParticleWeights = new TProfile(fUseParticleWeightsName.Data(),"0 = particle weight not used, 1 = particle weight used ",3,0,3);
1401 fUseParticleWeights->SetLabelSize(0.06);
1402 (fUseParticleWeights->GetXaxis())->SetBinLabel(1,"w_{#phi}");
1403 (fUseParticleWeights->GetXaxis())->SetBinLabel(2,"w_{p_{T}}");
1404 (fUseParticleWeights->GetXaxis())->SetBinLabel(3,"w_{#eta}");
1405 fUseParticleWeights->Fill(0.5,(Int_t)fUsePhiWeights);
1406 fUseParticleWeights->Fill(1.5,(Int_t)fUsePtWeights);
1407 fUseParticleWeights->Fill(2.5,(Int_t)fUseEtaWeights);
1408 fWeightsList->Add(fUseParticleWeights);
1412 if(fWeightsList->FindObject("phi_weights"))
1414 fPhiWeights = dynamic_cast<TH1F*>(fWeightsList->FindObject("phi_weights"));
1415 if(TMath::Abs(fPhiWeights->GetBinWidth(1)-fPhiBinWidth)>pow(10.,-6.))
1418 cout<<"WARNING (QC): Inconsistent binning in histograms for phi-weights throughout the code."<<endl;
1424 cout<<"WARNING: fWeightsList->FindObject(\"phi_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
1427 } // end of if(fUsePhiWeights)
1431 if(fWeightsList->FindObject("pt_weights"))
1433 fPtWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("pt_weights"));
1434 if(TMath::Abs(fPtWeights->GetBinWidth(1)-fPtBinWidth)>pow(10.,-6.))
1437 cout<<"WARNING (QC): Inconsistent binning in histograms for pt-weights throughout the code."<<endl;
1443 cout<<"WARNING: fWeightsList->FindObject(\"pt_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
1446 } // end of if(fUsePtWeights)
1450 if(fWeightsList->FindObject("eta_weights"))
1452 fEtaWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("eta_weights"));
1453 if(TMath::Abs(fEtaWeights->GetBinWidth(1)-fEtaBinWidth)>pow(10.,-6.))
1456 cout<<"WARNING (QC): Inconsistent binning in histograms for eta-weights throughout the code."<<endl;
1462 cout<<"WARNING: fUseEtaWeights && fWeightsList->FindObject(\"eta_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
1465 } // end of if(fUseEtaWeights)
1467 } // end of AliFlowAnalysisWithQCumulants::BookAndFillWeightsHistograms()
1470 //================================================================================================================================
1473 void AliFlowAnalysisWithQCumulants::BookEverythingForIntegratedFlow()
1475 // Book all objects for integrated flow:
1476 // a) Book profile to hold all flags for integrated flow.
1477 // b) Book event-by-event quantities.
1478 // c) Book profiles. // to be improved (comment)
1479 // d) Book histograms holding the final results.
1481 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)
1482 TString powerFlag[2] = {"linear","quadratic"}; // to be improved (should I promote this to data members?)
1484 // a) Book profile to hold all flags for integrated flow:
1485 TString intFlowFlagsName = "fIntFlowFlags";
1486 intFlowFlagsName += fAnalysisLabel->Data();
1487 fIntFlowFlags = new TProfile(intFlowFlagsName.Data(),"Flags for Integrated Flow",11,0,11);
1488 fIntFlowFlags->SetTickLength(-0.01,"Y");
1489 fIntFlowFlags->SetMarkerStyle(25);
1490 fIntFlowFlags->SetLabelSize(0.05);
1491 fIntFlowFlags->SetLabelOffset(0.02,"Y");
1492 fIntFlowFlags->GetXaxis()->SetBinLabel(1,"Particle Weights");
1493 fIntFlowFlags->GetXaxis()->SetBinLabel(2,"Event Weights");
1494 fIntFlowFlags->GetXaxis()->SetBinLabel(3,"Corrected for NUA?");
1495 fIntFlowFlags->GetXaxis()->SetBinLabel(4,"Print RF results");
1496 fIntFlowFlags->GetXaxis()->SetBinLabel(5,"Print RP results");
1497 fIntFlowFlags->GetXaxis()->SetBinLabel(6,"Print POI results");
1498 fIntFlowFlags->GetXaxis()->SetBinLabel(7,"Print RF (rebinned in M) results");
1499 fIntFlowFlags->GetXaxis()->SetBinLabel(8,"Corrected for NUA vs M?");
1500 fIntFlowFlags->GetXaxis()->SetBinLabel(9,"Propagate errors to v_{n} from correlations?");
1501 fIntFlowFlags->GetXaxis()->SetBinLabel(10,"Calculate cumulants vs M");
1502 fIntFlowFlags->GetXaxis()->SetBinLabel(11,"fMinimumBiasReferenceFlow");
1503 fIntFlowList->Add(fIntFlowFlags);
1505 // b) Book event-by-event quantities:
1506 // Re[Q_{m*n,k}], Im[Q_{m*n,k}] and S_{p,k}^M:
1507 fReQ = new TMatrixD(4,9);
1508 fImQ = new TMatrixD(4,9);
1509 fSMpk = new TMatrixD(8,9);
1510 // average correlations <2>, <4>, <6> and <8> for single event (bining is the same as in fIntFlowCorrelationsPro and fIntFlowCorrelationsHist):
1511 TString intFlowCorrelationsEBEName = "fIntFlowCorrelationsEBE";
1512 intFlowCorrelationsEBEName += fAnalysisLabel->Data();
1513 fIntFlowCorrelationsEBE = new TH1D(intFlowCorrelationsEBEName.Data(),intFlowCorrelationsEBEName.Data(),4,0,4);
1514 // weights for average correlations <2>, <4>, <6> and <8> for single event:
1515 TString intFlowEventWeightsForCorrelationsEBEName = "fIntFlowEventWeightsForCorrelationsEBE";
1516 intFlowEventWeightsForCorrelationsEBEName += fAnalysisLabel->Data();
1517 fIntFlowEventWeightsForCorrelationsEBE = new TH1D(intFlowEventWeightsForCorrelationsEBEName.Data(),intFlowEventWeightsForCorrelationsEBEName.Data(),4,0,4);
1518 // average all correlations for single event (bining is the same as in fIntFlowCorrelationsAllPro and fIntFlowCorrelationsAllHist):
1519 TString intFlowCorrelationsAllEBEName = "fIntFlowCorrelationsAllEBE";
1520 intFlowCorrelationsAllEBEName += fAnalysisLabel->Data();
1521 fIntFlowCorrelationsAllEBE = new TH1D(intFlowCorrelationsAllEBEName.Data(),intFlowCorrelationsAllEBEName.Data(),32,0,32);
1522 // average correction terms for non-uniform acceptance for single event
1523 // (binning is the same as in fIntFlowCorrectionTermsForNUAPro[2] and fIntFlowCorrectionTermsForNUAHist[2]):
1524 TString fIntFlowCorrectionTermsForNUAEBEName = "fIntFlowCorrectionTermsForNUAEBE";
1525 fIntFlowCorrectionTermsForNUAEBEName += fAnalysisLabel->Data();
1526 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1528 fIntFlowCorrectionTermsForNUAEBE[sc] = new TH1D(Form("%s: %s terms",fIntFlowCorrectionTermsForNUAEBEName.Data(),sinCosFlag[sc].Data()),Form("Correction terms for non-uniform acceptance (%s terms)",sinCosFlag[sc].Data()),10,0,10);
1530 // event weights for terms for non-uniform acceptance:
1531 TString fIntFlowEventWeightForCorrectionTermsForNUAEBEName = "fIntFlowEventWeightForCorrectionTermsForNUAEBE";
1532 fIntFlowEventWeightForCorrectionTermsForNUAEBEName += fAnalysisLabel->Data();
1533 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1535 fIntFlowEventWeightForCorrectionTermsForNUAEBE[sc] = new TH1D(Form("%s: %s terms",fIntFlowEventWeightForCorrectionTermsForNUAEBEName.Data(),sinCosFlag[sc].Data()),Form("Event weights for terms for non-uniform acceptance (%s terms)",sinCosFlag[sc].Data()),10,0,10);
1537 // c) Book profiles: // to be improved (comment)
1538 // profile to hold average multiplicities and number of events for events with nRP>=0, nRP>=1, ... , and nRP>=8:
1539 TString avMultiplicityName = "fAvMultiplicity";
1540 avMultiplicityName += fAnalysisLabel->Data();
1541 fAvMultiplicity = new TProfile(avMultiplicityName.Data(),"Average Multiplicities of RPs",9,0,9);
1542 fAvMultiplicity->SetTickLength(-0.01,"Y");
1543 fAvMultiplicity->SetMarkerStyle(25);
1544 fAvMultiplicity->SetLabelSize(0.05);
1545 fAvMultiplicity->SetLabelOffset(0.02,"Y");
1546 fAvMultiplicity->SetYTitle("Average Multiplicity");
1547 (fAvMultiplicity->GetXaxis())->SetBinLabel(1,"all evts");
1548 (fAvMultiplicity->GetXaxis())->SetBinLabel(2,"n_{RP} #geq 1");
1549 (fAvMultiplicity->GetXaxis())->SetBinLabel(3,"n_{RP} #geq 2");
1550 (fAvMultiplicity->GetXaxis())->SetBinLabel(4,"n_{RP} #geq 3");
1551 (fAvMultiplicity->GetXaxis())->SetBinLabel(5,"n_{RP} #geq 4");
1552 (fAvMultiplicity->GetXaxis())->SetBinLabel(6,"n_{RP} #geq 5");
1553 (fAvMultiplicity->GetXaxis())->SetBinLabel(7,"n_{RP} #geq 6");
1554 (fAvMultiplicity->GetXaxis())->SetBinLabel(8,"n_{RP} #geq 7");
1555 (fAvMultiplicity->GetXaxis())->SetBinLabel(9,"n_{RP} #geq 8");
1556 fIntFlowProfiles->Add(fAvMultiplicity);
1557 // average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with wrong errors!):
1558 TString correlationFlag[4] = {"<<2>>","<<4>>","<<6>>","<<8>>"};
1559 TString intFlowCorrelationsProName = "fIntFlowCorrelationsPro";
1560 intFlowCorrelationsProName += fAnalysisLabel->Data();
1561 fIntFlowCorrelationsPro = new TProfile(intFlowCorrelationsProName.Data(),"Average correlations for all events",4,0,4,"s");
1562 fIntFlowCorrelationsPro->SetTickLength(-0.01,"Y");
1563 fIntFlowCorrelationsPro->SetMarkerStyle(25);
1564 fIntFlowCorrelationsPro->SetLabelSize(0.06);
1565 fIntFlowCorrelationsPro->SetLabelOffset(0.01,"Y");
1566 for(Int_t b=0;b<4;b++)
1568 (fIntFlowCorrelationsPro->GetXaxis())->SetBinLabel(b+1,correlationFlag[b].Data());
1570 fIntFlowProfiles->Add(fIntFlowCorrelationsPro);
1571 // average correlations <<2>>, <<4>>, <<6>> and <<8>> versus multiplicity for all events (with wrong errors):
1572 if(fCalculateCumulantsVsM)
1574 for(Int_t ci=0;ci<4;ci++) // correlation index
1576 TString intFlowCorrelationsVsMProName = "fIntFlowCorrelationsVsMPro";
1577 intFlowCorrelationsVsMProName += fAnalysisLabel->Data();
1578 fIntFlowCorrelationsVsMPro[ci] = new TProfile(Form("%s, %s",intFlowCorrelationsVsMProName.Data(),correlationFlag[ci].Data()),
1579 Form("%s vs multiplicity",correlationFlag[ci].Data()),
1580 fnBinsMult,fMinMult,fMaxMult,"s");
1581 fIntFlowCorrelationsVsMPro[ci]->GetYaxis()->SetTitle(correlationFlag[ci].Data());
1582 fIntFlowCorrelationsVsMPro[ci]->GetXaxis()->SetTitle("M");
1583 fIntFlowProfiles->Add(fIntFlowCorrelationsVsMPro[ci]);
1584 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
1585 } // end of if(fCalculateCumulantsVsM)
1586 // averaged all correlations for all events (with wrong errors!):
1587 TString intFlowCorrelationsAllProName = "fIntFlowCorrelationsAllPro";
1588 intFlowCorrelationsAllProName += fAnalysisLabel->Data();
1589 fIntFlowCorrelationsAllPro = new TProfile(intFlowCorrelationsAllProName.Data(),"Average correlations for all events",32,0,32,"s");
1590 fIntFlowCorrelationsAllPro->SetTickLength(-0.01,"Y");
1591 fIntFlowCorrelationsAllPro->SetMarkerStyle(25);
1592 fIntFlowCorrelationsAllPro->SetLabelSize(0.03);
1593 fIntFlowCorrelationsAllPro->SetLabelOffset(0.01,"Y");
1594 // 2-p correlations:
1595 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(1,"<<2>>_{n|n}");
1596 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(2,"<<2>>_{2n|2n}");
1597 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(3,"<<2>>_{3n|3n}");
1598 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(4,"<<2>>_{4n|4n}");
1599 // 3-p correlations:
1600 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(6,"<<3>>_{2n|n,n}");
1601 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(7,"<<3>>_{3n|2n,n}");
1602 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(8,"<<3>>_{4n|2n,2n}");
1603 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(9,"<<3>>_{4n|3n,n}");
1604 // 4-p correlations:
1605 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(11,"<<4>>_{n,n|n,n}");
1606 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(12,"<<4>>_{2n,n|2n,n}");
1607 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(13,"<<4>>_{2n,2n|2n,2n}");
1608 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(14,"<<4>>_{3n|n,n,n}");
1609 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(15,"<<4>>_{3n,n|3n,n}");
1610 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(16,"<<4>>_{3n,n|2n,2n}");
1611 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(17,"<<4>>_{4n|2n,n,n}");
1612 // 5-p correlations:
1613 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(19,"<<5>>_{2n|n,n,n,n}");
1614 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(20,"<<5>>_{2n,2n|2n,n,n}");
1615 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(21,"<<5>>_{3n,n|2n,n,n}");
1616 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(22,"<<5>>_{4n|n,n,n,n}");
1617 // 6-p correlations:
1618 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(24,"<<6>>_{n,n,n|n,n,n}");
1619 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(25,"<<6>>_{2n,n,n|2n,n,n}");
1620 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(26,"<<6>>_{2n,2n|n,n,n,n}");
1621 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(27,"<<6>>_{3n,n|n,n,n,n}");
1622 // 7-p correlations:
1623 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(29,"<<7>>_{2n,n,n|n,n,n,n}");
1624 // 8-p correlations:
1625 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(31,"<<8>>_{n,n,n,n|n,n,n,n}");
1626 fIntFlowProfiles->Add(fIntFlowCorrelationsAllPro);
1627 // when particle weights are used some extra correlations appear:
1628 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
1630 TString intFlowExtraCorrelationsProName = "fIntFlowExtraCorrelationsPro";
1631 intFlowExtraCorrelationsProName += fAnalysisLabel->Data();
1632 fIntFlowExtraCorrelationsPro = new TProfile(intFlowExtraCorrelationsProName.Data(),"Average extra correlations for all events",100,0,100,"s");
1633 fIntFlowExtraCorrelationsPro->SetTickLength(-0.01,"Y");
1634 fIntFlowExtraCorrelationsPro->SetMarkerStyle(25);
1635 fIntFlowExtraCorrelationsPro->SetLabelSize(0.03);
1636 fIntFlowExtraCorrelationsPro->SetLabelOffset(0.01,"Y");
1637 // extra 2-p correlations:
1638 (fIntFlowExtraCorrelationsPro->GetXaxis())->SetBinLabel(1,"<<w1^3 w2 cos(n*(phi1-phi2))>>");
1639 (fIntFlowExtraCorrelationsPro->GetXaxis())->SetBinLabel(2,"<<w1 w2 w3^2 cos(n*(phi1-phi2))>>");
1640 fIntFlowProfiles->Add(fIntFlowExtraCorrelationsPro);
1641 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
1642 // average product of correlations <2>, <4>, <6> and <8>:
1643 TString productFlag[6] = {"<<2><4>>","<<2><6>>","<<2><8>>","<<4><6>>","<<4><8>>","<<6><8>>"};
1644 TString intFlowProductOfCorrelationsProName = "fIntFlowProductOfCorrelationsPro";
1645 intFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
1646 fIntFlowProductOfCorrelationsPro = new TProfile(intFlowProductOfCorrelationsProName.Data(),"Average products of correlations",6,0,6);
1647 fIntFlowProductOfCorrelationsPro->SetTickLength(-0.01,"Y");
1648 fIntFlowProductOfCorrelationsPro->SetMarkerStyle(25);
1649 fIntFlowProductOfCorrelationsPro->SetLabelSize(0.05);
1650 fIntFlowProductOfCorrelationsPro->SetLabelOffset(0.01,"Y");
1651 for(Int_t b=0;b<6;b++)
1653 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(b+1,productFlag[b].Data());
1655 fIntFlowProfiles->Add(fIntFlowProductOfCorrelationsPro);
1656 // average product of correlations <2>, <4>, <6> and <8> versus multiplicity
1657 // [0=<<2><4>>,1=<<2><6>>,2=<<2><8>>,3=<<4><6>>,4=<<4><8>>,5=<<6><8>>]
1658 if(fCalculateCumulantsVsM)
1660 TString intFlowProductOfCorrelationsVsMProName = "fIntFlowProductOfCorrelationsVsMPro";
1661 intFlowProductOfCorrelationsVsMProName += fAnalysisLabel->Data();
1662 for(Int_t pi=0;pi<6;pi++)
1664 fIntFlowProductOfCorrelationsVsMPro[pi] = new TProfile(Form("%s, %s",intFlowProductOfCorrelationsVsMProName.Data(),productFlag[pi].Data()),
1665 Form("%s versus multiplicity",productFlag[pi].Data()),
1666 fnBinsMult,fMinMult,fMaxMult);
1667 fIntFlowProductOfCorrelationsVsMPro[pi]->GetXaxis()->SetTitle("M");
1668 fIntFlowProfiles->Add(fIntFlowProductOfCorrelationsVsMPro[pi]);
1669 } // end of for(Int_t pi=0;pi<6;pi++)
1670 } // end of if(fCalculateCumulantsVsM)
1671 // average product of correction terms for NUA:
1672 TString intFlowProductOfCorrectionTermsForNUAProName = "fIntFlowProductOfCorrectionTermsForNUAPro";
1673 intFlowProductOfCorrectionTermsForNUAProName += fAnalysisLabel->Data();
1674 fIntFlowProductOfCorrectionTermsForNUAPro = new TProfile(intFlowProductOfCorrectionTermsForNUAProName.Data(),"Average products of correction terms for NUA",27,0,27);
1675 fIntFlowProductOfCorrectionTermsForNUAPro->SetTickLength(-0.01,"Y");
1676 fIntFlowProductOfCorrectionTermsForNUAPro->SetMarkerStyle(25);
1677 fIntFlowProductOfCorrectionTermsForNUAPro->SetLabelSize(0.05);
1678 fIntFlowProductOfCorrectionTermsForNUAPro->SetLabelOffset(0.01,"Y");
1679 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(1,"<<2><cos(#phi)>>");
1680 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(2,"<<2><sin(#phi)>>");
1681 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(3,"<<cos(#phi)><sin(#phi)>>");
1682 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(4,"Cov(<2>,<cos(#phi_{1}+#phi_{2})>)");
1683 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(5,"Cov(<2>,<sin(#phi_{1}+#phi_{2})>)");
1684 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(6,"Cov(<2>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1685 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(7,"Cov(<2>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1686 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(8,"Cov(<4>,<cos(#phi)>)");
1687 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(9,"Cov(<4>,<sin(#phi)>)");
1688 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(10,"Cov(<4>,<cos(#phi_{1}+#phi_{2})>)");
1689 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(11,"Cov(<4>,<sin(#phi_{1}+#phi_{2})>)");
1690 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(12,"Cov(<4>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>>)");
1691 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(13,"Cov(<4>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>>)");
1692 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(14,"Cov(<cos(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
1693 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(15,"Cov(<cos(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
1694 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(16,"Cov(<cos(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1695 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(17,"Cov(<cos(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1696 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(18,"Cov(<sin(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
1697 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(19,"Cov(<sin(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
1698 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(20,"Cov(<sin(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1699 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(21,"Cov(<sin(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1700 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(22,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}+#phi_{2})>)");
1701 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(23,"Cov(<cos(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1702 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(24,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1703 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(25,"Cov(<sin(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1704 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(26,"Cov(<sin(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1705 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(27,"Cov(<cos(#phi_{1}-#phi_{2}-#phi_{3}>,<sin(#phi_{1}-#phi_{2}-#phi_{3}>)");
1706 fIntFlowProfiles->Add(fIntFlowProductOfCorrectionTermsForNUAPro);
1707 // average correction terms for non-uniform acceptance (with wrong errors!):
1708 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1710 TString intFlowCorrectionTermsForNUAProName = "fIntFlowCorrectionTermsForNUAPro";
1711 intFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
1712 fIntFlowCorrectionTermsForNUAPro[sc] = new TProfile(Form("%s: %s terms",intFlowCorrectionTermsForNUAProName.Data(),sinCosFlag[sc].Data()),Form("Correction terms for non-uniform acceptance (%s terms)",sinCosFlag[sc].Data()),10,0,10,"s");
1713 fIntFlowCorrectionTermsForNUAPro[sc]->SetTickLength(-0.01,"Y");
1714 fIntFlowCorrectionTermsForNUAPro[sc]->SetMarkerStyle(25);
1715 fIntFlowCorrectionTermsForNUAPro[sc]->SetLabelSize(0.03);
1716 fIntFlowCorrectionTermsForNUAPro[sc]->SetLabelOffset(0.01,"Y");
1717 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(1,Form("<<%s(n(phi1))>>",sinCosFlag[sc].Data()));
1718 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(2,Form("<<%s(n(phi1+phi2))>>",sinCosFlag[sc].Data()));
1719 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(3,Form("<<%s(n(phi1-phi2-phi3))>>",sinCosFlag[sc].Data()));
1720 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(4,Form("<<%s(n(2phi1-phi2))>>",sinCosFlag[sc].Data()));
1721 fIntFlowProfiles->Add(fIntFlowCorrectionTermsForNUAPro[sc]);
1722 // versus multiplicity:
1723 if(fCalculateCumulantsVsM)
1725 TString correctionTermFlag[4] = {"(n(phi1))","(n(phi1+phi2))","(n(phi1-phi2-phi3))","(n(2phi1-phi2))"}; // to be improved - hardwired 4
1726 for(Int_t ci=0;ci<4;ci++) // correction term index (to be improved - hardwired 4)
1728 TString intFlowCorrectionTermsForNUAVsMProName = "fIntFlowCorrectionTermsForNUAVsMPro";
1729 intFlowCorrectionTermsForNUAVsMProName += fAnalysisLabel->Data();
1730 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");
1731 fIntFlowProfiles->Add(fIntFlowCorrectionTermsForNUAVsMPro[sc][ci]);
1733 } // end of if(fCalculateCumulantsVsM)
1734 } // end of for(Int_t sc=0;sc<2;sc++)
1736 // d) Book histograms holding the final results:
1737 // average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with correct errors!):
1738 TString intFlowCorrelationsHistName = "fIntFlowCorrelationsHist";
1739 intFlowCorrelationsHistName += fAnalysisLabel->Data();
1740 fIntFlowCorrelationsHist = new TH1D(intFlowCorrelationsHistName.Data(),"Average correlations for all events",4,0,4);
1741 fIntFlowCorrelationsHist->SetTickLength(-0.01,"Y");
1742 fIntFlowCorrelationsHist->SetMarkerStyle(25);
1743 fIntFlowCorrelationsHist->SetLabelSize(0.06);
1744 fIntFlowCorrelationsHist->SetLabelOffset(0.01,"Y");
1745 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(1,"<<2>>");
1746 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(2,"<<4>>");
1747 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(3,"<<6>>");
1748 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(4,"<<8>>");
1749 fIntFlowResults->Add(fIntFlowCorrelationsHist);
1750 // average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with correct errors!) vs M:
1751 if(fCalculateCumulantsVsM)
1753 for(Int_t ci=0;ci<4;ci++) // correlation index
1755 TString intFlowCorrelationsVsMHistName = "fIntFlowCorrelationsVsMHist";
1756 intFlowCorrelationsVsMHistName += fAnalysisLabel->Data();
1757 fIntFlowCorrelationsVsMHist[ci] = new TH1D(Form("%s, %s",intFlowCorrelationsVsMHistName.Data(),correlationFlag[ci].Data()),
1758 Form("%s vs multiplicity",correlationFlag[ci].Data()),
1759 fnBinsMult,fMinMult,fMaxMult);
1760 fIntFlowCorrelationsVsMHist[ci]->GetYaxis()->SetTitle(correlationFlag[ci].Data());
1761 fIntFlowCorrelationsVsMHist[ci]->GetXaxis()->SetTitle("M");
1762 fIntFlowResults->Add(fIntFlowCorrelationsVsMHist[ci]);
1763 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
1764 } // end of if(fCalculateCumulantsVsM)
1765 // average all correlations for all events (with correct errors!):
1766 TString intFlowCorrelationsAllHistName = "fIntFlowCorrelationsAllHist";
1767 intFlowCorrelationsAllHistName += fAnalysisLabel->Data();
1768 fIntFlowCorrelationsAllHist = new TH1D(intFlowCorrelationsAllHistName.Data(),"Average correlations for all events",32,0,32);
1769 fIntFlowCorrelationsAllHist->SetTickLength(-0.01,"Y");
1770 fIntFlowCorrelationsAllHist->SetMarkerStyle(25);
1771 fIntFlowCorrelationsAllHist->SetLabelSize(0.03);
1772 fIntFlowCorrelationsAllHist->SetLabelOffset(0.01,"Y");
1773 // 2-p correlations:
1774 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(1,"<<2>>_{n|n}");
1775 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(2,"<<2>>_{2n|2n}");
1776 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(3,"<<2>>_{3n|3n}");
1777 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(4,"<<2>>_{4n|4n}");
1778 // 3-p correlations:
1779 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(6,"<<3>>_{2n|n,n}");
1780 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(7,"<<3>>_{3n|2n,n}");
1781 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(8,"<<3>>_{4n|2n,2n}");
1782 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(9,"<<3>>_{4n|3n,n}");
1783 // 4-p correlations:
1784 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(11,"<<4>>_{n,n|n,n}");
1785 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(12,"<<4>>_{2n,n|2n,n}");
1786 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(13,"<<4>>_{2n,2n|2n,2n}");
1787 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(14,"<<4>>_{3n|n,n,n}");
1788 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(15,"<<4>>_{3n,n|3n,n}");
1789 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(16,"<<4>>_{3n,n|2n,2n}");
1790 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(17,"<<4>>_{4n|2n,n,n}");
1791 // 5-p correlations:
1792 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(19,"<<5>>_{2n|n,n,n,n}");
1793 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(20,"<<5>>_{2n,2n|2n,n,n}");
1794 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(21,"<<5>>_{3n,n|2n,n,n}");
1795 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(22,"<<5>>_{4n|n,n,n,n}");
1796 // 6-p correlations:
1797 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(24,"<<6>>_{n,n,n|n,n,n}");
1798 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(25,"<<6>>_{2n,n,n|2n,n,n}");
1799 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(26,"<<6>>_{2n,2n|n,n,n,n}");
1800 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(27,"<<6>>_{3n,n|n,n,n,n}");
1801 // 7-p correlations:
1802 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(29,"<<7>>_{2n,n,n|n,n,n,n}");
1803 // 8-p correlations:
1804 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(31,"<<8>>_{n,n,n,n|n,n,n,n}");
1805 fIntFlowResults->Add(fIntFlowCorrelationsAllHist);
1806 // average correction terms for non-uniform acceptance (with correct errors!):
1807 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1809 TString intFlowCorrectionTermsForNUAHistName = "fIntFlowCorrectionTermsForNUAHist";
1810 intFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
1811 fIntFlowCorrectionTermsForNUAHist[sc] = new TH1D(Form("%s: %s terms",intFlowCorrectionTermsForNUAHistName.Data(),sinCosFlag[sc].Data()),Form("Correction terms for non-uniform acceptance (%s terms)",sinCosFlag[sc].Data()),10,0,10);
1812 fIntFlowCorrectionTermsForNUAHist[sc]->SetTickLength(-0.01,"Y");
1813 fIntFlowCorrectionTermsForNUAHist[sc]->SetMarkerStyle(25);
1814 fIntFlowCorrectionTermsForNUAHist[sc]->SetLabelSize(0.03);
1815 fIntFlowCorrectionTermsForNUAHist[sc]->SetLabelOffset(0.01,"Y");
1816 // .........................................................................
1818 (fIntFlowCorrectionTermsForNUAHist[sc]->GetXaxis())->SetBinLabel(1,Form("%s(n(#phi_{1}))>",sinCosFlag[sc].Data()));
1822 // .........................................................................
1823 fIntFlowResults->Add(fIntFlowCorrectionTermsForNUAHist[sc]);
1824 } // end of for(Int_t sc=0;sc<2;sc++)
1825 // covariances (multiplied with weight dependent prefactor):
1826 TString intFlowCovariancesName = "fIntFlowCovariances";
1827 intFlowCovariancesName += fAnalysisLabel->Data();
1828 fIntFlowCovariances = new TH1D(intFlowCovariancesName.Data(),"Covariances (multiplied with weight dependent prefactor)",6,0,6);
1829 fIntFlowCovariances->SetLabelSize(0.04);
1830 fIntFlowCovariances->SetMarkerStyle(25);
1831 (fIntFlowCovariances->GetXaxis())->SetBinLabel(1,"Cov(<2>,<4>)");
1832 (fIntFlowCovariances->GetXaxis())->SetBinLabel(2,"Cov(<2>,<6>)");
1833 (fIntFlowCovariances->GetXaxis())->SetBinLabel(3,"Cov(<2>,<8>)");
1834 (fIntFlowCovariances->GetXaxis())->SetBinLabel(4,"Cov(<4>,<6>)");
1835 (fIntFlowCovariances->GetXaxis())->SetBinLabel(5,"Cov(<4>,<8>)");
1836 (fIntFlowCovariances->GetXaxis())->SetBinLabel(6,"Cov(<6>,<8>)");
1837 fIntFlowResults->Add(fIntFlowCovariances);
1838 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8>:
1839 TString intFlowSumOfEventWeightsName = "fIntFlowSumOfEventWeights";
1840 intFlowSumOfEventWeightsName += fAnalysisLabel->Data();
1841 for(Int_t power=0;power<2;power++)
1843 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);
1844 fIntFlowSumOfEventWeights[power]->SetLabelSize(0.05);
1845 fIntFlowSumOfEventWeights[power]->SetMarkerStyle(25);
1848 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>}");
1849 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<4>}");
1850 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<6>}");
1851 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<8>}");
1852 } else if (power == 1)
1854 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>}^{2}");
1855 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<4>}^{2}");
1856 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<6>}^{2}");
1857 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<8>}^{2}");
1859 fIntFlowResults->Add(fIntFlowSumOfEventWeights[power]);
1861 // sum of products of event weights for correlations <2>, <4>, <6> and <8>:
1862 TString intFlowSumOfProductOfEventWeightsName = "fIntFlowSumOfProductOfEventWeights";
1863 intFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
1864 fIntFlowSumOfProductOfEventWeights = new TH1D(intFlowSumOfProductOfEventWeightsName.Data(),"Sum of product of event weights for correlations",6,0,6);
1865 fIntFlowSumOfProductOfEventWeights->SetLabelSize(0.05);
1866 fIntFlowSumOfProductOfEventWeights->SetMarkerStyle(25);
1867 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>} w_{<4>}");
1868 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<2>} w_{<6>}");
1869 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<2>} w_{<8>}");
1870 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<4>} w_{<6>}");
1871 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(5,"#sum_{i=1}^{N} w_{<4>} w_{<8>}");
1872 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(6,"#sum_{i=1}^{N} w_{<6>} w_{<8>}");
1873 fIntFlowResults->Add(fIntFlowSumOfProductOfEventWeights);
1874 // final result for covariances of correlations (multiplied with weight dependent prefactor) versus M
1875 // [0=Cov(2,4),1=Cov(2,6),2=Cov(2,8),3=Cov(4,6),4=Cov(4,8),5=Cov(6,8)]:
1876 if(fCalculateCumulantsVsM)
1878 TString intFlowCovariancesVsMName = "fIntFlowCovariancesVsM";
1879 intFlowCovariancesVsMName += fAnalysisLabel->Data();
1880 TString covarianceFlag[6] = {"Cov(<2>,<4>)","Cov(<2>,<6>)","Cov(<2>,<8>)","Cov(<4>,<6>)","Cov(<4>,<8>)","Cov(<6>,<8>)"};
1881 for(Int_t ci=0;ci<6;ci++)
1883 fIntFlowCovariancesVsM[ci] = new TH1D(Form("%s, %s",intFlowCovariancesVsMName.Data(),covarianceFlag[ci].Data()),
1884 Form("%s vs multiplicity",covarianceFlag[ci].Data()),
1885 fnBinsMult,fMinMult,fMaxMult);
1886 fIntFlowCovariancesVsM[ci]->GetYaxis()->SetTitle(covarianceFlag[ci].Data());
1887 fIntFlowCovariancesVsM[ci]->GetXaxis()->SetTitle("M");
1888 fIntFlowResults->Add(fIntFlowCovariancesVsM[ci]);
1890 } // end of if(fCalculateCumulantsVsM)
1891 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8> versus multiplicity
1892 // [0=sum{w_{<2>}},1=sum{w_{<4>}},2=sum{w_{<6>}},3=sum{w_{<8>}}][0=linear 1,1=quadratic]:
1893 if(fCalculateCumulantsVsM)
1895 TString intFlowSumOfEventWeightsVsMName = "fIntFlowSumOfEventWeightsVsM";
1896 intFlowSumOfEventWeightsVsMName += fAnalysisLabel->Data();
1897 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>}"},
1898 {"#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}"}};
1899 for(Int_t si=0;si<4;si++)
1901 for(Int_t power=0;power<2;power++)
1903 fIntFlowSumOfEventWeightsVsM[si][power] = new TH1D(Form("%s, %s",intFlowSumOfEventWeightsVsMName.Data(),sumFlag[power][si].Data()),
1904 Form("%s vs multiplicity",sumFlag[power][si].Data()),
1905 fnBinsMult,fMinMult,fMaxMult);
1906 fIntFlowSumOfEventWeightsVsM[si][power]->GetYaxis()->SetTitle(sumFlag[power][si].Data());
1907 fIntFlowSumOfEventWeightsVsM[si][power]->GetXaxis()->SetTitle("M");
1908 fIntFlowResults->Add(fIntFlowSumOfEventWeightsVsM[si][power]);
1909 } // end of for(Int_t power=0;power<2;power++)
1910 } // end of for(Int_t si=0;si<4;si++)
1911 } // end of if(fCalculateCumulantsVsM)
1912 // sum of products of event weights for correlations <2>, <4>, <6> and <8> vs M
1913 // [0=sum{w_{<2>}w_{<4>}},1=sum{w_{<2>}w_{<6>}},2=sum{w_{<2>}w_{<8>}},
1914 // 3=sum{w_{<4>}w_{<6>}},4=sum{w_{<4>}w_{<8>}},5=sum{w_{<6>}w_{<8>}}]:
1915 if(fCalculateCumulantsVsM)
1917 TString intFlowSumOfProductOfEventWeightsVsMName = "fIntFlowSumOfProductOfEventWeightsVsM";
1918 intFlowSumOfProductOfEventWeightsVsMName += fAnalysisLabel->Data();
1919 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>}",
1920 "#sum_{i=1}^{N} w_{<4>} w_{<6>}","#sum_{i=1}^{N} w_{<4>} w_{<8>}","#sum_{i=1}^{N} w_{<6>} w_{<8>}"};
1921 for(Int_t pi=0;pi<6;pi++)
1923 fIntFlowSumOfProductOfEventWeightsVsM[pi] = new TH1D(Form("%s, %s",intFlowSumOfProductOfEventWeightsVsMName.Data(),sopowFlag[pi].Data()),
1924 Form("%s versus multiplicity",sopowFlag[pi].Data()),
1925 fnBinsMult,fMinMult,fMaxMult);
1926 fIntFlowSumOfProductOfEventWeightsVsM[pi]->GetXaxis()->SetTitle("M");
1927 fIntFlowSumOfProductOfEventWeightsVsM[pi]->GetYaxis()->SetTitle(sopowFlag[pi].Data());
1928 fIntFlowResults->Add(fIntFlowSumOfProductOfEventWeightsVsM[pi]);
1929 } // end of for(Int_t pi=0;pi<6;pi++)
1930 } // end of if(fCalculateCumulantsVsM)
1931 // covariances of NUA terms (multiplied with weight dependent prefactor):
1932 TString intFlowCovariancesNUAName = "fIntFlowCovariancesNUA";
1933 intFlowCovariancesNUAName += fAnalysisLabel->Data();
1934 fIntFlowCovariancesNUA = new TH1D(intFlowCovariancesNUAName.Data(),"Covariances for NUA (multiplied with weight dependent prefactor)",27,0,27);
1935 fIntFlowCovariancesNUA->SetLabelSize(0.04);
1936 fIntFlowCovariancesNUA->SetMarkerStyle(25);
1937 fIntFlowCovariancesNUA->GetXaxis()->SetLabelSize(0.02);
1938 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(1,"Cov(<2>,<cos(#phi)>");
1939 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(2,"Cov(<2>,<sin(#phi)>)");
1940 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(3,"Cov(<cos(#phi)>,<sin(#phi)>)");
1941 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(4,"Cov(<2>,<cos(#phi_{1}+#phi_{2})>)");
1942 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(5,"Cov(<2>,<sin(#phi_{1}+#phi_{2})>)");
1943 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(6,"Cov(<2>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1944 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(7,"Cov(<2>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1945 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(8,"Cov(<4>,<cos(#phi)>)");
1946 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(9,"Cov(<4>,<sin(#phi)>)");
1947 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(10,"Cov(<4>,<cos(#phi_{1}+#phi_{2})>)");
1948 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(11,"Cov(<4>,<sin(#phi_{1}+#phi_{2})>)");
1949 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(12,"Cov(<4>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>>)");
1950 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(13,"Cov(<4>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>>)");
1951 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(14,"Cov(<cos(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
1952 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(15,"Cov(<cos(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
1953 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(16,"Cov(<cos(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1954 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(17,"Cov(<cos(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1955 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(18,"Cov(<sin(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
1956 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(19,"Cov(<sin(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
1957 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(20,"Cov(<sin(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1958 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(21,"Cov(<sin(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1959 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(22,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}+#phi_{2})>)");
1960 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(23,"Cov(<cos(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1961 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(24,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1962 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(25,"Cov(<sin(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
1963 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(26,"Cov(<sin(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
1964 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(27,"Cov(<cos(#phi_{1}-#phi_{2}-#phi_{3}>,<sin(#phi_{1}-#phi_{2}-#phi_{3}>)");
1965 fIntFlowResults->Add(fIntFlowCovariancesNUA);
1966 // sum of linear and quadratic event weights for NUA terms:
1967 TString intFlowSumOfEventWeightsNUAName = "fIntFlowSumOfEventWeightsNUA";
1968 intFlowSumOfEventWeightsNUAName += fAnalysisLabel->Data();
1969 for(Int_t sc=0;sc<2;sc++)
1971 for(Int_t power=0;power<2;power++)
1973 fIntFlowSumOfEventWeightsNUA[sc][power] = new TH1D(Form("%s: %s, %s",intFlowSumOfEventWeightsNUAName.Data(),powerFlag[power].Data(),sinCosFlag[sc].Data()),Form("Sum of %s event weights for NUA %s terms",powerFlag[power].Data(),sinCosFlag[sc].Data()),3,0,3);
1974 fIntFlowSumOfEventWeightsNUA[sc][power]->SetLabelSize(0.05);
1975 fIntFlowSumOfEventWeightsNUA[sc][power]->SetMarkerStyle(25);
1978 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(1,Form("#sum_{i=1}^{N} w_{<%s(#phi)>}",sinCosFlag[sc].Data()));
1979 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(2,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}+#phi_{2})>}",sinCosFlag[sc].Data()));
1980 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(3,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}-#phi_{2}-#phi_{3})>}",sinCosFlag[sc].Data()));
1981 } else if(power == 1)
1983 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(1,Form("#sum_{i=1}^{N} w_{<%s(#phi)>}^{2}",sinCosFlag[sc].Data()));
1984 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(2,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}+#phi_{2})>}^{2}",sinCosFlag[sc].Data()));
1985 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(3,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}-#phi_{2}-#phi_{3})>}^{2}",sinCosFlag[sc].Data()));
1987 fIntFlowResults->Add(fIntFlowSumOfEventWeightsNUA[sc][power]);
1990 // sum of products of event weights for NUA terms:
1991 TString intFlowSumOfProductOfEventWeightsNUAName = "fIntFlowSumOfProductOfEventWeightsNUA";
1992 intFlowSumOfProductOfEventWeightsNUAName += fAnalysisLabel->Data();
1993 fIntFlowSumOfProductOfEventWeightsNUA = new TH1D(intFlowSumOfProductOfEventWeightsNUAName.Data(),"Sum of product of event weights for NUA terms",27,0,27);
1994 fIntFlowSumOfProductOfEventWeightsNUA->SetLabelSize(0.05);
1995 fIntFlowSumOfProductOfEventWeightsNUA->SetMarkerStyle(25);
1996 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>} w_{<cos(#phi)>}");
1997 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<2>} w_{<sin(#phi)>}");
1998 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<cos(#phi)>} w_{<sin(#phi)>}");
2000 // to be improved - add labels for remaining bins
2002 fIntFlowResults->Add(fIntFlowSumOfProductOfEventWeightsNUA);
2003 // Final results for reference Q-cumulants:
2004 TString cumulantFlag[4] = {"QC{2}","QC{4}","QC{6}","QC{8}"};
2005 TString intFlowQcumulantsName = "fIntFlowQcumulants";
2006 intFlowQcumulantsName += fAnalysisLabel->Data();
2007 fIntFlowQcumulants = new TH1D(intFlowQcumulantsName.Data(),"Integrated Q-cumulants",4,0,4);
2008 fIntFlowQcumulants->SetLabelSize(0.05);
2009 fIntFlowQcumulants->SetMarkerStyle(25);
2010 for(Int_t b=0;b<4;b++)
2012 (fIntFlowQcumulants->GetXaxis())->SetBinLabel(b+1,cumulantFlag[b].Data());
2014 fIntFlowResults->Add(fIntFlowQcumulants);
2015 // Final results for reference Q-cumulants rebinned in M:
2016 if(fCalculateCumulantsVsM)
2018 TString intFlowQcumulantsRebinnedInMName = "fIntFlowQcumulantsRebinnedInM";
2019 intFlowQcumulantsRebinnedInMName += fAnalysisLabel->Data();
2020 fIntFlowQcumulantsRebinnedInM = new TH1D(intFlowQcumulantsRebinnedInMName.Data(),"Reference Q-cumulants rebinned in M",4,0,4);
2021 fIntFlowQcumulantsRebinnedInM->SetLabelSize(0.05);
2022 fIntFlowQcumulantsRebinnedInM->SetMarkerStyle(25);
2023 for(Int_t b=0;b<4;b++)
2025 (fIntFlowQcumulantsRebinnedInM->GetXaxis())->SetBinLabel(b+1,cumulantFlag[b].Data());
2027 fIntFlowResults->Add(fIntFlowQcumulantsRebinnedInM);
2028 } // end of if(fCalculateCumulantsVsM)
2029 // final results for integrated Q-cumulants versus multiplicity:
2030 if(fCalculateCumulantsVsM)
2032 TString intFlowQcumulantsVsMName = "fIntFlowQcumulantsVsM";
2033 intFlowQcumulantsVsMName += fAnalysisLabel->Data();
2034 for(Int_t co=0;co<4;co++) // cumulant order
2036 fIntFlowQcumulantsVsM[co] = new TH1D(Form("%s, %s",intFlowQcumulantsVsMName.Data(),cumulantFlag[co].Data()),
2037 Form("%s vs multipicity",cumulantFlag[co].Data()),
2038 fnBinsMult,fMinMult,fMaxMult);
2039 fIntFlowQcumulantsVsM[co]->GetXaxis()->SetTitle("M");
2040 fIntFlowQcumulantsVsM[co]->GetYaxis()->SetTitle(cumulantFlag[co].Data());
2041 fIntFlowResults->Add(fIntFlowQcumulantsVsM[co]);
2042 } // end of for(Int_t co=0;co<4;co++) // cumulant order
2043 } // end of if(fCalculateCumulantsVsM)
2044 // final integrated flow estimates from Q-cumulants:
2045 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)};
2046 TString intFlowName = "fIntFlow";
2047 intFlowName += fAnalysisLabel->Data();
2048 // integrated flow from Q-cumulants:
2049 fIntFlow = new TH1D(intFlowName.Data(),"Reference flow estimates from Q-cumulants",4,0,4);
2050 fIntFlow->SetLabelSize(0.05);
2051 fIntFlow->SetMarkerStyle(25);
2052 for(Int_t b=0;b<4;b++)
2054 (fIntFlow->GetXaxis())->SetBinLabel(b+1,flowFlag[b].Data());
2056 fIntFlowResults->Add(fIntFlow);
2057 // Reference flow vs M rebinned in one huge bin:
2058 if(fCalculateCumulantsVsM)
2060 TString intFlowRebinnedInMName = "fIntFlowRebinnedInM";
2061 intFlowRebinnedInMName += fAnalysisLabel->Data();
2062 fIntFlowRebinnedInM = new TH1D(intFlowRebinnedInMName.Data(),"Reference flow estimates from Q-cumulants (rebinned in M)",4,0,4);
2063 fIntFlowRebinnedInM->SetLabelSize(0.05);
2064 fIntFlowRebinnedInM->SetMarkerStyle(25);
2065 for(Int_t b=0;b<4;b++)
2067 (fIntFlowRebinnedInM->GetXaxis())->SetBinLabel(b+1,flowFlag[b].Data());
2069 fIntFlowResults->Add(fIntFlowRebinnedInM);
2071 // integrated flow from Q-cumulants: versus multiplicity:
2072 if(fCalculateCumulantsVsM)
2074 TString intFlowVsMName = "fIntFlowVsM";
2075 intFlowVsMName += fAnalysisLabel->Data();
2076 for(Int_t co=0;co<4;co++) // cumulant order
2078 fIntFlowVsM[co] = new TH1D(Form("%s, %s",intFlowVsMName.Data(),flowFlag[co].Data()),
2079 Form("%s vs multipicity",flowFlag[co].Data()),
2080 fnBinsMult,fMinMult,fMaxMult);
2081 fIntFlowVsM[co]->GetXaxis()->SetTitle("M");
2082 fIntFlowVsM[co]->GetYaxis()->SetTitle(flowFlag[co].Data());
2083 fIntFlowResults->Add(fIntFlowVsM[co]);
2084 } // end of for(Int_t co=0;co<4;co++) // cumulant order
2085 } // end of if(fCalculateCumulantsVsM)
2086 // quantifying detector effects effects to correlations:
2087 TString intFlowDetectorBiasName = "fIntFlowDetectorBias";
2088 intFlowDetectorBiasName += fAnalysisLabel->Data();
2089 fIntFlowDetectorBias = new TH1D(intFlowDetectorBiasName.Data(),"Quantifying detector bias",4,0,4);
2090 fIntFlowDetectorBias->SetLabelSize(0.05);
2091 fIntFlowDetectorBias->SetMarkerStyle(25);
2092 for(Int_t ci=0;ci<4;ci++)
2094 (fIntFlowDetectorBias->GetXaxis())->SetBinLabel(ci+1,Form("#frac{corrected}{measured} %s",cumulantFlag[ci].Data()));
2096 fIntFlowResults->Add(fIntFlowDetectorBias);
2097 // quantifying detector effects to correlations versus multiplicity:
2098 if(fCalculateCumulantsVsM)
2100 TString intFlowDetectorBiasVsMName = "fIntFlowDetectorBiasVsM";
2101 intFlowDetectorBiasVsMName += fAnalysisLabel->Data();
2102 for(Int_t ci=0;ci<4;ci++) // correlation index
2104 fIntFlowDetectorBiasVsM[ci] = new TH1D(Form("%s for %s",intFlowDetectorBiasVsMName.Data(),cumulantFlag[ci].Data()),
2105 Form("Quantifying detector bias for %s vs multipicity",cumulantFlag[ci].Data()),
2106 fnBinsMult,fMinMult,fMaxMult);
2107 fIntFlowDetectorBiasVsM[ci]->GetXaxis()->SetTitle("M");
2108 fIntFlowDetectorBiasVsM[ci]->GetYaxis()->SetTitle("#frac{corrected}{measured}");
2109 if(fApplyCorrectionForNUAVsM){fIntFlowResults->Add(fIntFlowDetectorBiasVsM[ci]);}
2110 } // end of for(Int_t co=0;co<4;co++) // cumulant order
2111 } // end of if(fCalculateCumulantsVsM)
2113 /* // to be improved (removed):
2114 // final average weighted multi-particle correlations for all events calculated from Q-vectors
2115 fQCorrelations[1] = new TProfile("Weighted correlations","final average multi-particle correlations from weighted Q-vectors",200,0,200,"s");
2116 fQCorrelations[1]->SetTickLength(-0.01,"Y");
2117 fQCorrelations[1]->SetMarkerStyle(25);
2118 fQCorrelations[1]->SetLabelSize(0.03);
2119 fQCorrelations[1]->SetLabelOffset(0.01,"Y");
2120 // 2-particle correlations:
2121 (fQCorrelations[1]->GetXaxis())->SetBinLabel(1,"<w_{1}w_{2}cos(n(#phi_{1}-#phi_{2}))>");
2122 (fQCorrelations[1]->GetXaxis())->SetBinLabel(2,"<w_{1}^{2}w_{2}^{2}cos(2n(#phi_{1}-#phi_{2}))>");
2123 (fQCorrelations[1]->GetXaxis())->SetBinLabel(3,"<w_{1}^{3}w_{2}^{3}cos(3n(#phi_{1}-#phi_{2}))>");
2124 (fQCorrelations[1]->GetXaxis())->SetBinLabel(4,"<w_{1}^{4}w_{2}^{4}cos(4n(#phi_{1}-#phi_{2}))>");
2125 (fQCorrelations[1]->GetXaxis())->SetBinLabel(5,"<w_{1}^{3}w_{2}cos(n(#phi_{1}-#phi_{2}))>");
2126 (fQCorrelations[1]->GetXaxis())->SetBinLabel(6,"<w_{1}^{2}w_{2}w_{3}cos(n(#phi_{1}-#phi_{2}))>");
2127 // 3-particle correlations:
2128 (fQCorrelations[1]->GetXaxis())->SetBinLabel(21,"<w_{1}w_{2}w_{3}^{2}cos(n(2#phi_{1}-#phi_{2}-#phi_{3}))>");
2129 // 4-particle correlations:
2130 (fQCorrelations[1]->GetXaxis())->SetBinLabel(41,"<w_{1}w_{2}w_{3}w_{4}cos(n(#phi_{1}+#phi_{2}-#phi_{3}-#phi_{4}))>");
2131 // add fQCorrelations[1] to the list fIntFlowList:
2132 fIntFlowList->Add(fQCorrelations[1]);
2135 } // end of AliFlowAnalysisWithQCumulants::BookEverythingForIntegratedFlow()
2138 //================================================================================================================================
2141 void AliFlowAnalysisWithQCumulants::InitializeArraysForNestedLoops()
2143 // Initialize arrays of all objects relevant for calculations with nested loops.
2146 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2148 fIntFlowDirectCorrectionTermsForNUA[sc] = NULL;
2151 // differential flow:
2153 for(Int_t t=0;t<2;t++) // type: RP or POI
2155 for(Int_t pe=0;pe<2;pe++) // pt or eta
2157 for(Int_t ci=0;ci<4;ci++) // correlation index
2159 fDiffFlowDirectCorrelations[t][pe][ci] = NULL;
2160 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
2161 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
2162 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
2163 // correction terms for non-uniform acceptance:
2164 for(Int_t t=0;t<2;t++) // type: RP or POI
2166 for(Int_t pe=0;pe<2;pe++) // pt or eta
2168 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2170 for(Int_t cti=0;cti<9;cti++) // correction term index
2172 fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti] = NULL;
2175 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
2176 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
2179 } // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForNestedLoops()
2182 //================================================================================================================================
2185 void AliFlowAnalysisWithQCumulants::BookEverythingForNestedLoops()
2187 // Book all objects relevant for calculations with nested loops.
2189 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)
2190 TString typeFlag[2] = {"RP","POI"}; // to be improved (should I promote this to data members?)
2191 TString ptEtaFlag[2] = {"p_{T}","#eta"}; // to be improved (should I promote this to data members?)
2192 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"}; // to be improved (should I promote this to data members?)
2193 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
2194 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
2196 TString evaluateNestedLoopsName = "fEvaluateNestedLoops";
2197 evaluateNestedLoopsName += fAnalysisLabel->Data();
2198 fEvaluateNestedLoops = new TProfile(evaluateNestedLoopsName.Data(),"Flags for nested loops",4,0,4);
2199 fEvaluateNestedLoops->SetLabelSize(0.03);
2200 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(1,"fEvaluateIntFlowNestedLoops");
2201 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(2,"fEvaluateDiffFlowNestedLoops");
2202 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(3,"fCrossCheckInPtBinNo");
2203 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(4,"fCrossCheckInEtaBinNo");
2204 fEvaluateNestedLoops->Fill(0.5,(Int_t)fEvaluateIntFlowNestedLoops);
2205 fEvaluateNestedLoops->Fill(1.5,(Int_t)fEvaluateDiffFlowNestedLoops);
2206 fEvaluateNestedLoops->Fill(2.5,fCrossCheckInPtBinNo);
2207 fEvaluateNestedLoops->Fill(3.5,fCrossCheckInEtaBinNo);
2208 fNestedLoopsList->Add(fEvaluateNestedLoops);
2209 // nested loops for integrated flow:
2210 if(fEvaluateIntFlowNestedLoops)
2213 TString intFlowDirectCorrelationsName = "fIntFlowDirectCorrelations";
2214 intFlowDirectCorrelationsName += fAnalysisLabel->Data();
2215 fIntFlowDirectCorrelations = new TProfile(intFlowDirectCorrelationsName.Data(),"Multiparticle correlations calculated with nested loops (for int. flow)",32,0,32,"s");
2216 fNestedLoopsList->Add(fIntFlowDirectCorrelations);
2217 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
2219 TString intFlowExtraDirectCorrelationsName = "fIntFlowExtraDirectCorrelations";
2220 intFlowExtraDirectCorrelationsName += fAnalysisLabel->Data();
2221 fIntFlowExtraDirectCorrelations = new TProfile(intFlowExtraDirectCorrelationsName.Data(),"Extra multiparticle correlations calculated with nested loops (for int. flow)",100,0,100,"s");
2222 fNestedLoopsList->Add(fIntFlowExtraDirectCorrelations);
2223 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
2224 // correction terms for non-uniform acceptance:
2225 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2227 TString intFlowDirectCorrectionTermsForNUAName = "fIntFlowDirectCorrectionTermsForNUA";
2228 intFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
2229 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");
2230 fNestedLoopsList->Add(fIntFlowDirectCorrectionTermsForNUA[sc]);
2231 } // end of for(Int_t sc=0;sc<2;sc++)
2232 } // end of if(fEvaluateIntFlowNestedLoops)
2234 // nested loops for differential flow:
2235 if(fEvaluateDiffFlowNestedLoops)
2237 // reduced correlations:
2238 TString diffFlowDirectCorrelationsName = "fDiffFlowDirectCorrelations";
2239 diffFlowDirectCorrelationsName += fAnalysisLabel->Data();
2240 for(Int_t t=0;t<2;t++) // type: RP or POI
2242 for(Int_t pe=0;pe<2;pe++) // pt or eta
2244 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
2246 // reduced correlations:
2247 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");
2248 fDiffFlowDirectCorrelations[t][pe][rci]->SetXTitle(ptEtaFlag[pe].Data());
2249 fNestedLoopsList->Add(fDiffFlowDirectCorrelations[t][pe][rci]); // to be improved (add dedicated list to hold reduced correlations)
2250 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
2251 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
2252 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
2253 // correction terms for non-uniform acceptance:
2254 TString diffFlowDirectCorrectionTermsForNUAName = "fDiffFlowDirectCorrectionTermsForNUA";
2255 diffFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
2256 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
2258 for(Int_t pe=0;pe<2;pe++) // pt or eta
2260 for(Int_t sc=0;sc<2;sc++) // sin or cos
2262 for(Int_t cti=0;cti<9;cti++) // correction term index
2264 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");
2265 fNestedLoopsList->Add(fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti]);
2270 // number of RPs and POIs in selected pt and eta bins for cross-checkings:
2271 TString noOfParticlesInBinName = "fNoOfParticlesInBin";
2272 fNoOfParticlesInBin = new TH1D(noOfParticlesInBinName.Data(),"Number of RPs and POIs in selected p_{T} and #eta bin",4,0,4);
2273 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(1,"# of RPs in p_{T} bin");
2274 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(2,"# of RPs in #eta bin");
2275 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(3,"# of POIs in p_{T} bin");
2276 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(4,"# of POIs in #eta bin");
2277 fNestedLoopsList->Add(fNoOfParticlesInBin);
2278 } // end of if(fEvaluateDiffFlowNestedLoops)
2280 } // end of AliFlowAnalysisWithQCumulants::BookEverythingForNestedLoops()
2283 //================================================================================================================================
2286 void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelations()
2288 // calculate all correlations needed for integrated flow
2291 Double_t dMult = (*fSMpk)(0,0);
2293 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
2294 Double_t dReQ1n = (*fReQ)(0,0);
2295 Double_t dReQ2n = (*fReQ)(1,0);
2296 Double_t dReQ3n = (*fReQ)(2,0);
2297 Double_t dReQ4n = (*fReQ)(3,0);
2298 Double_t dImQ1n = (*fImQ)(0,0);
2299 Double_t dImQ2n = (*fImQ)(1,0);
2300 Double_t dImQ3n = (*fImQ)(2,0);
2301 Double_t dImQ4n = (*fImQ)(3,0);
2303 // real and imaginary parts of some expressions involving various combinations of Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
2304 // (these expression appear in the Eqs. for the multi-particle correlations bellow)
2306 // Re[Q_{2n} Q_{n}^* Q_{n}^*]
2307 Double_t reQ2nQ1nstarQ1nstar = pow(dReQ1n,2.)*dReQ2n + 2.*dReQ1n*dImQ1n*dImQ2n - pow(dImQ1n,2.)*dReQ2n;
2309 // Im[Q_{2n} Q_{n}^* Q_{n}^*]
2310 //Double_t imQ2nQ1nstarQ1nstar = pow(dReQ1n,2.)*dImQ2n-2.*dReQ1n*dImQ1n*dReQ2n-pow(dImQ1n,2.)*dImQ2n;
2312 // Re[Q_{n} Q_{n} Q_{2n}^*] = Re[Q_{2n} Q_{n}^* Q_{n}^*]
2313 Double_t reQ1nQ1nQ2nstar = reQ2nQ1nstarQ1nstar;
2315 // Re[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]
2316 Double_t reQ3nQ1nQ2nstarQ2nstar = (pow(dReQ2n,2.)-pow(dImQ2n,2.))*(dReQ3n*dReQ1n-dImQ3n*dImQ1n)
2317 + 2.*dReQ2n*dImQ2n*(dReQ3n*dImQ1n+dImQ3n*dReQ1n);
2319 // Im[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]
2320 //Double_t imQ3nQ1nQ2nstarQ2nstar = calculate and implement this (deleteMe)
2322 // Re[Q_{2n} Q_{2n} Q_{3n}^* Q_{1n}^*] = Re[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]
2323 Double_t reQ2nQ2nQ3nstarQ1nstar = reQ3nQ1nQ2nstarQ2nstar;
2325 // Re[Q_{4n} Q_{2n}^* Q_{2n}^*]
2326 Double_t reQ4nQ2nstarQ2nstar = pow(dReQ2n,2.)*dReQ4n+2.*dReQ2n*dImQ2n*dImQ4n-pow(dImQ2n,2.)*dReQ4n;
2328 // Im[Q_{4n} Q_{2n}^* Q_{2n}^*]
2329 //Double_t imQ4nQ2nstarQ2nstar = calculate and implement this (deleteMe)
2331 // Re[Q_{2n} Q_{2n} Q_{4n}^*] = Re[Q_{4n} Q_{2n}^* Q_{2n}^*]
2332 Double_t reQ2nQ2nQ4nstar = reQ4nQ2nstarQ2nstar;
2334 // Re[Q_{4n} Q_{3n}^* Q_{n}^*]
2335 Double_t reQ4nQ3nstarQ1nstar = dReQ4n*(dReQ3n*dReQ1n-dImQ3n*dImQ1n)+dImQ4n*(dReQ3n*dImQ1n+dImQ3n*dReQ1n);
2337 // Re[Q_{3n} Q_{n} Q_{4n}^*] = Re[Q_{4n} Q_{3n}^* Q_{n}^*]
2338 Double_t reQ3nQ1nQ4nstar = reQ4nQ3nstarQ1nstar;
2340 // Im[Q_{4n} Q_{3n}^* Q_{n}^*]
2341 //Double_t imQ4nQ3nstarQ1nstar = calculate and implement this (deleteMe)
2343 // Re[Q_{3n} Q_{2n}^* Q_{n}^*]
2344 Double_t reQ3nQ2nstarQ1nstar = dReQ3n*dReQ2n*dReQ1n-dReQ3n*dImQ2n*dImQ1n+dImQ3n*dReQ2n*dImQ1n
2345 + dImQ3n*dImQ2n*dReQ1n;
2347 // Re[Q_{2n} Q_{n} Q_{3n}^*] = Re[Q_{3n} Q_{2n}^* Q_{n}^*]
2348 Double_t reQ2nQ1nQ3nstar = reQ3nQ2nstarQ1nstar;
2350 // Im[Q_{3n} Q_{2n}^* Q_{n}^*]
2351 //Double_t imQ3nQ2nstarQ1nstar; //calculate and implement this (deleteMe)
2353 // Re[Q_{3n} Q_{n}^* Q_{n}^* Q_{n}^*]
2354 Double_t reQ3nQ1nstarQ1nstarQ1nstar = dReQ3n*pow(dReQ1n,3)-3.*dReQ1n*dReQ3n*pow(dImQ1n,2)
2355 + 3.*dImQ1n*dImQ3n*pow(dReQ1n,2)-dImQ3n*pow(dImQ1n,3);
2357 // Im[Q_{3n} Q_{n}^* Q_{n}^* Q_{n}^*]
2358 //Double_t imQ3nQ1nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)
2360 // |Q_{2n}|^2 |Q_{n}|^2
2361 Double_t dQ2nQ1nQ2nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.));
2363 // Re[Q_{4n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2364 Double_t reQ4nQ2nstarQ1nstarQ1nstar = (dReQ4n*dReQ2n+dImQ4n*dImQ2n)*(pow(dReQ1n,2)-pow(dImQ1n,2))
2365 + 2.*dReQ1n*dImQ1n*(dImQ4n*dReQ2n-dReQ4n*dImQ2n);
2367 // Im[Q_{4n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2368 //Double_t imQ4nQ2nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)
2370 // Re[Q_{2n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^*]
2371 Double_t reQ2nQ1nQ1nstarQ1nstarQ1nstar = (dReQ2n*dReQ1n-dImQ2n*dImQ1n)*(pow(dReQ1n,3)-3.*dReQ1n*pow(dImQ1n,2))
2372 + (dReQ2n*dImQ1n+dReQ1n*dImQ2n)*(3.*dImQ1n*pow(dReQ1n,2)-pow(dImQ1n,3));
2374 // Im[Q_{2n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^*]
2375 //Double_t imQ2nQ1nQ1nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)
2377 // Re[Q_{2n} Q_{2n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2378 Double_t reQ2nQ2nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))
2379 * (dReQ2n*(pow(dReQ1n,2.)-pow(dImQ1n,2.)) + 2.*dImQ2n*dReQ1n*dImQ1n);
2381 // Im[Q_{2n} Q_{2n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2382 //Double_t imQ2nQ2nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))
2383 // * (dImQ2n*(pow(dReQ1n,2.)-pow(dImQ1n,2.)) - 2.*dReQ2n*dReQ1n*dImQ1n);
2385 // Re[Q_{4n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2386 Double_t reQ4nQ1nstarQ1nstarQ1nstarQ1nstar = pow(dReQ1n,4.)*dReQ4n-6.*pow(dReQ1n,2.)*dReQ4n*pow(dImQ1n,2.)
2387 + pow(dImQ1n,4.)*dReQ4n+4.*pow(dReQ1n,3.)*dImQ1n*dImQ4n
2388 - 4.*pow(dImQ1n,3.)*dReQ1n*dImQ4n;
2390 // Im[Q_{4n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2391 //Double_t imQ4nQ1nstarQ1nstarQ1nstarQ1nstar = pow(dReQ1n,4.)*dImQ4n-6.*pow(dReQ1n,2.)*dImQ4n*pow(dImQ1n,2.)
2392 // + pow(dImQ1n,4.)*dImQ4n+4.*pow(dImQ1n,3.)*dReQ1n*dReQ4n
2393 // - 4.*pow(dReQ1n,3.)*dImQ1n*dReQ4n;
2395 // Re[Q_{3n} Q_{n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2396 Double_t reQ3nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
2397 * (dReQ1n*dReQ2n*dReQ3n-dReQ3n*dImQ1n*dImQ2n+dReQ2n*dImQ1n*dImQ3n+dReQ1n*dImQ2n*dImQ3n);
2399 // Im[Q_{3n} Q_{n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2400 //Double_t imQ3nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
2401 // * (-dReQ2n*dReQ3n*dImQ1n-dReQ1n*dReQ3n*dImQ2n+dReQ1n*dReQ2n*dImQ3n-dImQ1n*dImQ2n*dImQ3n);
2404 // Re[Q_{2n} Q_{2n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2405 Double_t reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)*dReQ2n-2.*dReQ1n*dReQ2n*dImQ1n-dReQ2n*pow(dImQ1n,2.)
2406 + dImQ2n*pow(dReQ1n,2.)+2.*dReQ1n*dImQ1n*dImQ2n-pow(dImQ1n,2.)*dImQ2n)
2407 * (pow(dReQ1n,2.)*dReQ2n+2.*dReQ1n*dReQ2n*dImQ1n-dReQ2n*pow(dImQ1n,2.)
2408 - dImQ2n*pow(dReQ1n,2.)+2.*dReQ1n*dImQ1n*dImQ2n+pow(dImQ1n,2.)*dImQ2n);
2410 // Im[Q_{2n} Q_{2n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2411 //Double_t imQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar = 2.*(pow(dReQ1n,2.)*dReQ2n-dReQ2n*pow(dImQ1n,2.)
2412 // + 2.*dReQ1n*dImQ1n*dImQ2n)*(pow(dReQ1n,2.)*dImQ2n
2413 // - 2.*dReQ1n*dImQ1n*dReQ2n-pow(dImQ1n,2.)*dImQ2n);
2415 // Re[Q_{3n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2416 Double_t reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
2417 * (pow(dReQ1n,3.)*dReQ3n-3.*dReQ1n*dReQ3n*pow(dImQ1n,2.)
2418 + 3.*pow(dReQ1n,2.)*dImQ1n*dImQ3n-pow(dImQ1n,3.)*dImQ3n);
2420 // Im[Q_{3n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2421 //Double_t imQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
2422 // * (pow(dImQ1n,3.)*dReQ3n-3.*dImQ1n*dReQ3n*pow(dReQ1n,2.)
2423 // - 3.*pow(dImQ1n,2.)*dReQ1n*dImQ3n+pow(dReQ1n,3.)*dImQ3n);
2425 // |Q_{2n}|^2 |Q_{n}|^4
2426 Double_t dQ2nQ1nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))*pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.);
2428 // Re[Q_{2n} Q_{n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2429 Double_t reQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
2430 * (pow(dReQ1n,2.)*dReQ2n-dReQ2n*pow(dImQ1n,2.)
2431 + 2.*dReQ1n*dImQ1n*dImQ2n);
2433 // Im[Q_{2n} Q_{n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2434 //Double_t imQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
2435 // * (pow(dReQ1n,2.)*dImQ2n-dImQ2n*pow(dImQ1n,2.)
2436 // - 2.*dReQ1n*dReQ2n*dImQ1n);
2441 // **************************************
2442 // **** multi-particle correlations: ****
2443 // **************************************
2445 // Remark 1: multi-particle correlations calculated with non-weighted Q-vectors are stored in 1D profile fQCorrelations[0]. // to be improved (wrong profiles)
2446 // Remark 2: binning of fQCorrelations[0] is organized as follows: // to be improved (wrong profiles)
2447 // --------------------------------------------------------------------------------------------------------------------
2448 // 1st bin: <2>_{1n|1n} = two1n1n = cos(n*(phi1-phi2))>
2449 // 2nd bin: <2>_{2n|2n} = two2n2n = cos(2n*(phi1-phi2))>
2450 // 3rd bin: <2>_{3n|3n} = two3n3n = cos(3n*(phi1-phi2))>
2451 // 4th bin: <2>_{4n|4n} = two4n4n = cos(4n*(phi1-phi2))>
2452 // 5th bin: ---- EMPTY ----
2453 // 6th bin: <3>_{2n|1n,1n} = three2n1n1n = <cos(n*(2.*phi1-phi2-phi3))>
2454 // 7th bin: <3>_{3n|2n,1n} = three3n2n1n = <cos(n*(3.*phi1-2.*phi2-phi3))>
2455 // 8th bin: <3>_{4n|2n,2n} = three4n2n2n = <cos(n*(4.*phi1-2.*phi2-2.*phi3))>
2456 // 9th bin: <3>_{4n|3n,1n} = three4n3n1n = <cos(n*(4.*phi1-3.*phi2-phi3))>
2457 // 10th bin: ---- EMPTY ----
2458 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1n = <cos(n*(phi1+phi2-phi3-phi4))>
2459 // 12th bin: <4>_{2n,1n|2n,1n} = four2n1n2n1n = <cos(2.*n*(phi1+phi2-phi3-phi4))>
2460 // 13th bin: <4>_{2n,2n|2n,2n} = four2n2n2n2n = <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>
2461 // 14th bin: <4>_{3n|1n,1n,1n} = four3n1n1n1n = <cos(n*(3.*phi1-phi2-phi3-phi4))>
2462 // 15th bin: <4>_{3n,1n|3n,1n} = four3n1n3n1n = <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>
2463 // 16th bin: <4>_{3n,1n|2n,2n} = four3n1n2n2n = <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>
2464 // 17th bin: <4>_{4n|2n,1n,1n} = four4n2n1n1n = <cos(n*(3.*phi1+phi2-3.*phi3-phi4))>
2465 // 18th bin: ---- EMPTY ----
2466 // 19th bin: <5>_{2n|1n,1n,1n,1n} = five2n1n1n1n1n = <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>
2467 // 20th bin: <5>_{2n,2n|2n,1n,1n} = five2n2n2n1n1n = <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>
2468 // 21st bin: <5>_{3n,1n|2n,1n,1n} = five3n1n2n1n1n = <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>
2469 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = five4n1n1n1n1n = <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>
2470 // 23rd bin: ---- EMPTY ----
2471 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = six1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
2472 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = six2n1n1n2n1n1n = <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>
2473 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = six2n2n1n1n1n1n = <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>
2474 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = six3n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>
2475 // 28th bin: ---- EMPTY ----
2476 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = seven2n1n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
2477 // 30th bin: ---- EMPTY ----
2478 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = eight1n1n1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
2479 // --------------------------------------------------------------------------------------------------------------------
2482 Double_t two1n1n = 0.; // <cos(n*(phi1-phi2))>
2483 Double_t two2n2n = 0.; // <cos(2n*(phi1-phi2))>
2484 Double_t two3n3n = 0.; // <cos(3n*(phi1-phi2))>
2485 Double_t two4n4n = 0.; // <cos(4n*(phi1-phi2))>
2489 two1n1n = (pow(dReQ1n,2.)+pow(dImQ1n,2.)-dMult)/(dMult*(dMult-1.));
2490 two2n2n = (pow(dReQ2n,2.)+pow(dImQ2n,2.)-dMult)/(dMult*(dMult-1.));
2491 two3n3n = (pow(dReQ3n,2.)+pow(dImQ3n,2.)-dMult)/(dMult*(dMult-1.));
2492 two4n4n = (pow(dReQ4n,2.)+pow(dImQ4n,2.)-dMult)/(dMult*(dMult-1.));
2494 // average 2-particle correlations for single event:
2495 fIntFlowCorrelationsAllEBE->SetBinContent(1,two1n1n);
2496 fIntFlowCorrelationsAllEBE->SetBinContent(2,two2n2n);
2497 fIntFlowCorrelationsAllEBE->SetBinContent(3,two3n3n);
2498 fIntFlowCorrelationsAllEBE->SetBinContent(4,two4n4n);
2500 // average 2-particle correlations for all events:
2501 fIntFlowCorrelationsAllPro->Fill(0.5,two1n1n,dMult*(dMult-1.));
2502 fIntFlowCorrelationsAllPro->Fill(1.5,two2n2n,dMult*(dMult-1.));
2503 fIntFlowCorrelationsAllPro->Fill(2.5,two3n3n,dMult*(dMult-1.));
2504 fIntFlowCorrelationsAllPro->Fill(3.5,two4n4n,dMult*(dMult-1.));
2506 // store separetately <2> (to be improved: do I really need this?)
2507 fIntFlowCorrelationsEBE->SetBinContent(1,two1n1n); // <2>
2509 // to be improved (this can be implemented better):
2510 Double_t mWeight2p = 0.;
2511 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
2513 mWeight2p = dMult*(dMult-1.);
2514 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
2517 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2522 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(1,mWeight2p); // eW_<2>
2523 fIntFlowCorrelationsPro->Fill(0.5,two1n1n,mWeight2p);
2524 if(fCalculateCumulantsVsM){fIntFlowCorrelationsVsMPro[0]->Fill(dMult+0.5,two1n1n,mWeight2p);}
2526 // distribution of <cos(n*(phi1-phi2))>:
2527 //f2pDistribution->Fill(two1n1n,dMult*(dMult-1.));
2528 } // end of if(dMult>1)
2531 Double_t three2n1n1n = 0.; // <cos(n*(2.*phi1-phi2-phi3))>
2532 Double_t three3n2n1n = 0.; // <cos(n*(3.*phi1-2.*phi2-phi3))>
2533 Double_t three4n2n2n = 0.; // <cos(n*(4.*phi1-2.*phi2-2.*phi3))>
2534 Double_t three4n3n1n = 0.; // <cos(n*(4.*phi1-3.*phi2-phi3))>
2538 three2n1n1n = (reQ2nQ1nstarQ1nstar-2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
2539 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))+2.*dMult)
2540 / (dMult*(dMult-1.)*(dMult-2.));
2541 three3n2n1n = (reQ3nQ2nstarQ1nstar-(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2542 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))
2543 - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)
2544 / (dMult*(dMult-1.)*(dMult-2.));
2545 three4n2n2n = (reQ4nQ2nstarQ2nstar-2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2546 - (pow(dReQ4n,2.)+pow(dImQ4n,2.))+2.*dMult)
2547 / (dMult*(dMult-1.)*(dMult-2.));
2548 three4n3n1n = (reQ4nQ3nstarQ1nstar-(pow(dReQ4n,2.)+pow(dImQ4n,2.))
2549 - (pow(dReQ3n,2.)+pow(dImQ3n,2.))
2550 - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)
2551 / (dMult*(dMult-1.)*(dMult-2.));
2553 // average 3-particle correlations for single event:
2554 fIntFlowCorrelationsAllEBE->SetBinContent(6,three2n1n1n);
2555 fIntFlowCorrelationsAllEBE->SetBinContent(7,three3n2n1n);
2556 fIntFlowCorrelationsAllEBE->SetBinContent(8,three4n2n2n);
2557 fIntFlowCorrelationsAllEBE->SetBinContent(9,three4n3n1n);
2559 // average 3-particle correlations for all events:
2560 fIntFlowCorrelationsAllPro->Fill(5.5,three2n1n1n,dMult*(dMult-1.)*(dMult-2.));
2561 fIntFlowCorrelationsAllPro->Fill(6.5,three3n2n1n,dMult*(dMult-1.)*(dMult-2.));
2562 fIntFlowCorrelationsAllPro->Fill(7.5,three4n2n2n,dMult*(dMult-1.)*(dMult-2.));
2563 fIntFlowCorrelationsAllPro->Fill(8.5,three4n3n1n,dMult*(dMult-1.)*(dMult-2.));
2564 } // end of if(dMult>2)
2567 Double_t four1n1n1n1n = 0.; // <cos(n*(phi1+phi2-phi3-phi4))>
2568 Double_t four2n2n2n2n = 0.; // <cos(2.*n*(phi1+phi2-phi3-phi4))>
2569 Double_t four2n1n2n1n = 0.; // <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>
2570 Double_t four3n1n1n1n = 0.; // <cos(n*(3.*phi1-phi2-phi3-phi4))>
2571 Double_t four4n2n1n1n = 0.; // <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>
2572 Double_t four3n1n2n2n = 0.; // <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>
2573 Double_t four3n1n3n1n = 0.; // <cos(n*(3.*phi1+phi2-3.*phi3-phi4))>
2577 four1n1n1n1n = (2.*dMult*(dMult-3.)+pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)-4.*(dMult-2.)*(pow(dReQ1n,2.)
2578 + pow(dImQ1n,2.))-2.*reQ2nQ1nstarQ1nstar+(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
2579 / (dMult*(dMult-1)*(dMult-2.)*(dMult-3.));
2580 four2n2n2n2n = (2.*dMult*(dMult-3.)+pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)-4.*(dMult-2.)*(pow(dReQ2n,2.)
2581 + pow(dImQ2n,2.))-2.*reQ4nQ2nstarQ2nstar+(pow(dReQ4n,2.)+pow(dImQ4n,2.)))
2582 / (dMult*(dMult-1)*(dMult-2.)*(dMult-3.));
2583 four2n1n2n1n = (dQ2nQ1nQ2nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar-2.*reQ2nQ1nstarQ1nstar)
2584 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2585 - ((dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
2586 + (dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-(pow(dReQ3n,2.)+pow(dImQ3n,2.)))
2587 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2588 + (dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.));
2589 four3n1n1n1n = (reQ3nQ1nstarQ1nstarQ1nstar-3.*reQ3nQ2nstarQ1nstar-3.*reQ2nQ1nstarQ1nstar)
2590 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2591 + (2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+3.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2592 + 6.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-6.*dMult)
2593 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2594 four4n2n1n1n = (reQ4nQ2nstarQ1nstarQ1nstar-2.*reQ4nQ3nstarQ1nstar-reQ4nQ2nstarQ2nstar-2.*reQ3nQ2nstarQ1nstar)
2595 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2596 - (reQ2nQ1nstarQ1nstar-2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2597 - 3.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2598 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2599 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
2600 four3n1n2n2n = (reQ3nQ1nQ2nstarQ2nstar-reQ4nQ2nstarQ2nstar-reQ3nQ1nQ4nstar-2.*reQ3nQ2nstarQ1nstar)
2601 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2602 - (2.*reQ1nQ1nQ2nstar-(pow(dReQ4n,2.)+pow(dImQ4n,2.))-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2603 - 4.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2604 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2605 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
2606 four3n1n3n1n = ((pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
2607 - 2.*reQ4nQ3nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar)
2608 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2609 + ((pow(dReQ4n,2.)+pow(dImQ4n,2.))-(dMult-4.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2610 + (pow(dReQ2n,2.)+pow(dImQ2n,2.))-(dMult-4.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2611 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2612 + (dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.));
2614 // average 4-particle correlations for single event:
2615 fIntFlowCorrelationsAllEBE->SetBinContent(11,four1n1n1n1n);
2616 fIntFlowCorrelationsAllEBE->SetBinContent(12,four2n1n2n1n);
2617 fIntFlowCorrelationsAllEBE->SetBinContent(13,four2n2n2n2n);
2618 fIntFlowCorrelationsAllEBE->SetBinContent(14,four3n1n1n1n);
2619 fIntFlowCorrelationsAllEBE->SetBinContent(15,four3n1n3n1n);
2620 fIntFlowCorrelationsAllEBE->SetBinContent(16,four3n1n2n2n);
2621 fIntFlowCorrelationsAllEBE->SetBinContent(17,four4n2n1n1n);
2623 // average 4-particle correlations for all events:
2624 fIntFlowCorrelationsAllPro->Fill(10.5,four1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2625 fIntFlowCorrelationsAllPro->Fill(11.5,four2n1n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2626 fIntFlowCorrelationsAllPro->Fill(12.5,four2n2n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2627 fIntFlowCorrelationsAllPro->Fill(13.5,four3n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2628 fIntFlowCorrelationsAllPro->Fill(14.5,four3n1n3n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2629 fIntFlowCorrelationsAllPro->Fill(15.5,four3n1n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2630 fIntFlowCorrelationsAllPro->Fill(16.5,four4n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2632 // store separetately <4> (to be improved: do I really need this?)
2633 fIntFlowCorrelationsEBE->SetBinContent(2,four1n1n1n1n); // <4>
2635 // to be improved (this can be implemented better):
2636 Double_t mWeight4p = 0.;
2637 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
2639 mWeight4p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.);
2640 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
2643 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2648 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(2,mWeight4p); // eW_<4>
2649 fIntFlowCorrelationsPro->Fill(1.5,four1n1n1n1n,mWeight4p);
2650 if(fCalculateCumulantsVsM){fIntFlowCorrelationsVsMPro[1]->Fill(dMult+0.5,four1n1n1n1n,mWeight4p);}
2652 // distribution of <cos(n*(phi1+phi2-phi3-phi4))>
2653 //f4pDistribution->Fill(four1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2655 } // end of if(dMult>3)
2658 Double_t five2n1n1n1n1n = 0.; // <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>
2659 Double_t five2n2n2n1n1n = 0.; // <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>
2660 Double_t five3n1n2n1n1n = 0.; // <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>
2661 Double_t five4n1n1n1n1n = 0.; // <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>
2665 five2n1n1n1n1n = (reQ2nQ1nQ1nstarQ1nstarQ1nstar-reQ3nQ1nstarQ1nstarQ1nstar+6.*reQ3nQ2nstarQ1nstar)
2666 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2667 - (reQ2nQ1nQ3nstar+3.*(dMult-6.)*reQ2nQ1nstarQ1nstar+3.*reQ1nQ1nQ2nstar)
2668 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2669 - (2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2670 + 3.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2671 - 3.*(dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
2672 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2673 - 3.*(pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
2674 - 2.*(2*dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult*(dMult-4.))
2675 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2677 five2n2n2n1n1n = (reQ2nQ2nQ2nstarQ1nstarQ1nstar-reQ4nQ2nstarQ1nstarQ1nstar-2.*reQ2nQ2nQ3nstarQ1nstar)
2678 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2679 + 2.*(reQ4nQ2nstarQ2nstar+4.*reQ3nQ2nstarQ1nstar+reQ3nQ1nQ4nstar)
2680 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2681 + (reQ2nQ2nQ4nstar-2.*(dMult-5.)*reQ2nQ1nstarQ1nstar+2.*reQ1nQ1nQ2nstar)
2682 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2683 - (2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+4.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2684 + 1.*pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)
2685 - 2.*(3.*dMult-10.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
2686 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2687 - (4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2688 - 4.*(dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))+4.*dMult*(dMult-6.))
2689 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2691 five4n1n1n1n1n = (reQ4nQ1nstarQ1nstarQ1nstarQ1nstar-6.*reQ4nQ2nstarQ1nstarQ1nstar-4.*reQ3nQ1nstarQ1nstarQ1nstar)
2692 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2693 + (8.*reQ4nQ3nstarQ1nstar+3.*reQ4nQ2nstarQ2nstar+12.*reQ3nQ2nstarQ1nstar+12.*reQ2nQ1nstarQ1nstar)
2694 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2695 - (6.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+8.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2696 + 12.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))+24.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-24.*dMult)
2697 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2699 five3n1n2n1n1n = (reQ3nQ1nQ2nstarQ1nstarQ1nstar-reQ4nQ2nstarQ1nstarQ1nstar-reQ3nQ1nstarQ1nstarQ1nstar)
2700 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2701 - (reQ3nQ1nQ2nstarQ2nstar-3.*reQ4nQ3nstarQ1nstar-reQ4nQ2nstarQ2nstar)
2702 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2703 - ((2.*dMult-13.)*reQ3nQ2nstarQ1nstar-reQ3nQ1nQ4nstar-9.*reQ2nQ1nstarQ1nstar)
2704 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2705 - (2.*reQ1nQ1nQ2nstar+2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
2706 - 2.*(dMult-5.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+2.*(pow(dReQ3n,2.)
2707 + pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2708 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2709 + (2.*(dMult-6.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2710 - 2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
2711 - pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
2712 + 2.*(3.*dMult-11.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2713 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2714 - 4.*(dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2716 // average 5-particle correlations for single event:
2717 fIntFlowCorrelationsAllEBE->SetBinContent(19,five2n1n1n1n1n);
2718 fIntFlowCorrelationsAllEBE->SetBinContent(20,five2n2n2n1n1n);
2719 fIntFlowCorrelationsAllEBE->SetBinContent(21,five3n1n2n1n1n);
2720 fIntFlowCorrelationsAllEBE->SetBinContent(22,five4n1n1n1n1n);
2722 // average 5-particle correlations for all events:
2723 fIntFlowCorrelationsAllPro->Fill(18.5,five2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2724 fIntFlowCorrelationsAllPro->Fill(19.5,five2n2n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2725 fIntFlowCorrelationsAllPro->Fill(20.5,five3n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2726 fIntFlowCorrelationsAllPro->Fill(21.5,five4n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2727 } // end of if(dMult>4)
2730 Double_t six1n1n1n1n1n1n = 0.; // <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
2731 Double_t six2n2n1n1n1n1n = 0.; // <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>
2732 Double_t six3n1n1n1n1n1n = 0.; // <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>
2733 Double_t six2n1n1n2n1n1n = 0.; // <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>
2737 six1n1n1n1n1n1n = (pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),3.)+9.*dQ2nQ1nQ2nstarQ1nstar-6.*reQ2nQ1nQ1nstarQ1nstarQ1nstar)
2738 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))
2739 + 4.*(reQ3nQ1nstarQ1nstarQ1nstar-3.*reQ3nQ2nstarQ1nstar)
2740 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))
2741 + 2.*(9.*(dMult-4.)*reQ2nQ1nstarQ1nstar+2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.)))
2742 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))
2743 - 9.*(pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)+(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
2744 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-5.))
2745 + (18.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2746 / (dMult*(dMult-1)*(dMult-3)*(dMult-4))
2747 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
2749 six2n1n1n2n1n1n = (dQ2nQ1nQ1nQ2nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)
2750 * (2.*five2n2n2n1n1n+4.*five2n1n1n1n1n+4.*five3n1n2n1n1n+4.*four2n1n2n1n+1.*four1n1n1n1n)
2751 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four1n1n1n1n+4.*two1n1n
2752 + 2.*three2n1n1n+2.*three2n1n1n+4.*four3n1n1n1n+8.*three2n1n1n+2.*four4n2n1n1n
2753 + 4.*four2n1n2n1n+2.*two2n2n+8.*four2n1n2n1n+4.*four3n1n3n1n+8.*three3n2n1n
2754 + 4.*four3n1n2n2n+4.*four1n1n1n1n+4.*four2n1n2n1n+1.*four2n2n2n2n)
2755 - dMult*(dMult-1.)*(dMult-2.)*(2.*three2n1n1n+8.*two1n1n+4.*two1n1n+2.
2756 + 4.*two1n1n+4.*three2n1n1n+2.*two2n2n+4.*three2n1n1n+8.*three3n2n1n
2757 + 8.*two2n2n+4.*three4n3n1n+4.*two3n3n+4.*three3n2n1n+4.*two1n1n
2758 + 8.*three2n1n1n+4.*two1n1n+4.*three3n2n1n+4.*three2n1n1n+2.*two2n2n
2759 + 4.*three3n2n1n+2.*three4n2n2n)-dMult*(dMult-1.)
2760 * (4.*two1n1n+4.+4.*two1n1n+2.*two2n2n+1.+4.*two1n1n+4.*two2n2n+4.*two3n3n
2761 + 1.+2.*two2n2n+1.*two4n4n)-dMult)
2762 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)
2764 six2n2n1n1n1n1n = (reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)
2765 * (five4n1n1n1n1n+8.*five2n1n1n1n1n+6.*five2n2n2n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)
2766 * (4.*four3n1n1n1n+6.*four4n2n1n1n+12.*three2n1n1n+12.*four1n1n1n1n+24.*four2n1n2n1n
2767 + 4.*four3n1n2n2n+3.*four2n2n2n2n)-dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+12.*three3n2n1n
2768 + 4.*three4n3n1n+3.*three4n2n2n+8.*three2n1n1n+24.*two1n1n+12.*two2n2n+12.*three2n1n1n+8.*three3n2n1n
2769 + 1.*three4n2n2n)-dMult*(dMult-1.)*(4.*two1n1n+6.*two2n2n+4.*two3n3n+1.*two4n4n+2.*two2n2n+8.*two1n1n+6.)-dMult)
2770 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)
2772 six3n1n1n1n1n1n = (reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)
2773 * (five4n1n1n1n1n+4.*five2n1n1n1n1n+6.*five3n1n2n1n1n+4.*four3n1n1n1n)
2774 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four3n1n1n1n+6.*four4n2n1n1n+6.*four1n1n1n1n
2775 + 12.*three2n1n1n+12.*four2n1n2n1n+6.*four3n1n1n1n+12.*three3n2n1n+4.*four3n1n3n1n+3.*four3n1n2n2n)
2776 - dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+12.*three3n2n1n+4.*three4n3n1n+3.*three4n2n2n+4.*two1n1n
2777 + 12.*two1n1n+6.*three2n1n1n+12.*three2n1n1n+4.*three3n2n1n+12.*two2n2n+4.*three3n2n1n+4.*two3n3n+1.*three4n3n1n
2778 + 6.*three3n2n1n)-dMult*(dMult-1.)*(4.*two1n1n+6.*two2n2n+4.*two3n3n+1.*two4n4n+1.*two1n1n+4.+6.*two1n1n+4.*two2n2n
2779 + 1.*two3n3n)-dMult)/(dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)
2781 // average 6-particle correlations for single event:
2782 fIntFlowCorrelationsAllEBE->SetBinContent(24,six1n1n1n1n1n1n);
2783 fIntFlowCorrelationsAllEBE->SetBinContent(25,six2n1n1n2n1n1n);
2784 fIntFlowCorrelationsAllEBE->SetBinContent(26,six2n2n1n1n1n1n);
2785 fIntFlowCorrelationsAllEBE->SetBinContent(27,six3n1n1n1n1n1n);
2787 // average 6-particle correlations for all events:
2788 fIntFlowCorrelationsAllPro->Fill(23.5,six1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2789 fIntFlowCorrelationsAllPro->Fill(24.5,six2n1n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2790 fIntFlowCorrelationsAllPro->Fill(25.5,six2n2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2791 fIntFlowCorrelationsAllPro->Fill(26.5,six3n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2793 // store separetately <6> (to be improved: do I really need this?)
2794 fIntFlowCorrelationsEBE->SetBinContent(3,six1n1n1n1n1n1n); // <6>
2796 // to be improved (this can be implemented better):
2797 Double_t mWeight6p = 0.;
2798 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
2800 mWeight6p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.);
2801 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
2804 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2809 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(3,mWeight6p); // eW_<6>
2810 fIntFlowCorrelationsPro->Fill(2.5,six1n1n1n1n1n1n,mWeight6p);
2811 if(fCalculateCumulantsVsM){fIntFlowCorrelationsVsMPro[2]->Fill(dMult+0.5,six1n1n1n1n1n1n,mWeight6p);}
2813 // distribution of <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
2814 //f6pDistribution->Fill(six1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2815 } // end of if(dMult>5)
2818 Double_t seven2n1n1n1n1n1n1n = 0.; // <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
2822 seven2n1n1n1n1n1n1n = (reQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)
2823 * (2.*six3n1n1n1n1n1n+4.*six1n1n1n1n1n1n+1.*six2n2n1n1n1n1n+6.*six2n1n1n2n1n1n+8.*five2n1n1n1n1n)
2824 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(1.*five4n1n1n1n1n +8.*five2n1n1n1n1n+8.*four3n1n1n1n
2825 + 12.*five3n1n2n1n1n+4.*five2n1n1n1n1n+3.*five2n2n2n1n1n+6.*five2n2n2n1n1n+6.*four1n1n1n1n+24.*four1n1n1n1n
2826 + 12.*five2n1n1n1n1n+12.*five2n1n1n1n1n+12.*three2n1n1n+24.*four2n1n2n1n+4.*five3n1n2n1n1n+4.*five2n1n1n1n1n)
2827 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four3n1n1n1n+6.*four4n2n1n1n+12.*four1n1n1n1n+24.*three2n1n1n
2828 + 24.*four2n1n2n1n+12.*four3n1n1n1n+24.*three3n2n1n+8.*four3n1n3n1n+6.*four3n1n2n2n+6.*three2n1n1n+12.*four1n1n1n1n
2829 + 12.*four2n1n2n1n+6.*three2n1n1n+12.*four2n1n2n1n+4.*four3n1n2n2n+3.*four2n2n2n2n+4.*four1n1n1n1n+6.*three2n1n1n
2830 + 24.*two1n1n+24.*four1n1n1n1n+4.*four3n1n1n1n+24.*two1n1n+24.*three2n1n1n+12.*two2n2n+24.*three2n1n1n+12.*four2n1n2n1n
2831 + 8.*three3n2n1n+8.*four2n1n2n1n+1.*four4n2n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+1.*three2n1n1n+8.*two1n1n
2832 + 12.*three3n2n1n+24.*two1n1n+12.*three2n1n1n+4.*three2n1n1n+8.*two1n1n+4.*three4n3n1n+24.*three2n1n1n+8.*three3n2n1n
2833 + 12.*two1n1n+12.*two1n1n+3.*three4n2n2n+24.*two2n2n+6.*two2n2n+12.+12.*three3n2n1n+8.*two3n3n+12.*three2n1n1n+24.*two1n1n
2834 + 4.*three3n2n1n+8.*three3n2n1n+2.*three4n3n1n+12.*two1n1n+8.*three2n1n1n+4.*three2n1n1n+2.*three3n2n1n+6.*two2n2n+8.*two2n2n
2835 + 1.*three4n2n2n+4.*three3n2n1n+6.*three2n1n1n)-dMult*(dMult-1.)*(4.*two1n1n+2.*two1n1n+6.*two2n2n+8.+1.*two2n2n+4.*two3n3n
2836 + 12.*two1n1n+4.*two1n1n+1.*two4n4n+8.*two2n2n+6.+2.*two3n3n+4.*two1n1n+1.*two2n2n)-dMult)
2837 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)); // to be improved (direct formula needed)
2839 // average 7-particle correlations for single event:
2840 fIntFlowCorrelationsAllEBE->SetBinContent(29,seven2n1n1n1n1n1n1n);
2842 // average 7-particle correlations for all events:
2843 fIntFlowCorrelationsAllPro->Fill(28.5,seven2n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.));
2844 } // end of if(dMult>6)
2847 Double_t eight1n1n1n1n1n1n1n1n = 0.; // <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
2850 eight1n1n1n1n1n1n1n1n = (pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),4.)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)
2851 * (12.*seven2n1n1n1n1n1n1n+16.*six1n1n1n1n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)
2852 * (8.*six3n1n1n1n1n1n+48.*six1n1n1n1n1n1n+6.*six2n2n1n1n1n1n+96.*five2n1n1n1n1n+72.*four1n1n1n1n+36.*six2n1n1n2n1n1n)
2853 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(2.*five4n1n1n1n1n+32.*five2n1n1n1n1n+36.*four1n1n1n1n
2854 + 32.*four3n1n1n1n+48.*five2n1n1n1n1n+48.*five3n1n2n1n1n+144.*five2n1n1n1n1n+288.*four1n1n1n1n+36.*five2n2n2n1n1n
2855 + 144.*three2n1n1n+96.*two1n1n+144.*four2n1n2n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)
2856 * (8.*four3n1n1n1n+48.*four1n1n1n1n+12.*four4n2n1n1n+96.*four2n1n2n1n+96.*three2n1n1n+72.*three2n1n1n+144.*two1n1n
2857 + 16.*four3n1n3n1n+48.*four3n1n1n1n+144.*four1n1n1n1n+72.*four1n1n1n1n+96.*three3n2n1n+24.*four3n1n2n2n+144.*four2n1n2n1n
2858 + 288.*two1n1n+288.*three2n1n1n+9.*four2n2n2n2n+72.*two2n2n+24.)-dMult*(dMult-1.)*(dMult-2.)*(12.*three2n1n1n+16.*two1n1n
2859 + 24.*three3n2n1n+48.*three2n1n1n+96.*two1n1n+8.*three4n3n1n+32.*three3n2n1n+96.*three2n1n1n+144.*two1n1n+6.*three4n2n2n
2860 + 96.*two2n2n+36.*two2n2n+72.+48.*three3n2n1n+16.*two3n3n+72.*three2n1n1n+144.*two1n1n)-dMult*(dMult-1.)*(8.*two1n1n
2861 + 12.*two2n2n+16.+8.*two3n3n+48.*two1n1n+1.*two4n4n+16.*two2n2n+18.)-dMult)
2862 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.)); // to be improved (direct formula needed)
2864 // average 8-particle correlations for single event:
2865 fIntFlowCorrelationsAllEBE->SetBinContent(31,eight1n1n1n1n1n1n1n1n);
2867 // average 8-particle correlations for all events:
2868 fIntFlowCorrelationsAllPro->Fill(30.5,eight1n1n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.));
2870 // store separetately <8> (to be improved: do I really need this?)
2871 fIntFlowCorrelationsEBE->SetBinContent(4,eight1n1n1n1n1n1n1n1n); // <8>
2873 // to be improved (this can be implemented better):
2874 Double_t mWeight8p = 0.;
2875 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
2877 mWeight8p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.);
2878 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
2881 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2886 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(4,mWeight8p); // eW_<8>
2887 fIntFlowCorrelationsPro->Fill(3.5,eight1n1n1n1n1n1n1n1n,mWeight8p);
2888 if(fCalculateCumulantsVsM){fIntFlowCorrelationsVsMPro[3]->Fill(dMult+0.5,eight1n1n1n1n1n1n1n1n,mWeight8p);}
2890 // distribution of <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
2891 //f8pDistribution->Fill(eight1n1n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.));
2892 } // end of if(dMult>7)
2894 } // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelations()
2897 //================================================================================================================================
2900 void AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrelations()
2902 // Calculate averages of products of correlations for integrated flow.
2905 Double_t dMult = (*fSMpk)(0,0);
2909 for(Int_t ci1=1;ci1<4;ci1++)
2911 for(Int_t ci2=ci1+1;ci2<=4;ci2++)
2913 fIntFlowProductOfCorrelationsPro->Fill(0.5+counter,
2914 fIntFlowCorrelationsEBE->GetBinContent(ci1)*
2915 fIntFlowCorrelationsEBE->GetBinContent(ci2),
2916 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
2917 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
2918 // products versus multiplicity: // [0=<<2><4>>,1=<<2><6>>,2=<<2><8>>,3=<<4><6>>,4=<<4><8>>,5=<<6><8>>]
2919 if(fCalculateCumulantsVsM)
2921 fIntFlowProductOfCorrelationsVsMPro[counter]->Fill(dMult+0.5, // to be improved: dMult => sum of weights ?
2922 fIntFlowCorrelationsEBE->GetBinContent(ci1)*
2923 fIntFlowCorrelationsEBE->GetBinContent(ci2),
2924 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
2925 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
2926 } // end of if(fCalculateCumulantsVsM)
2931 } // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrelations()
2934 //================================================================================================================================
2937 void AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrectionTermsForNUA()
2939 // Calculate averages of products of correction terms for NUA.
2941 // a) Binning of fIntFlowProductOfCorrectionTermsForNUAPro is organized as follows:
2942 // 1st bin: <<2><cos(phi)>>
2943 // 2nd bin: <<2><sin(phi)>>
2944 // 3rd bin: <<cos(phi)><sin(phi)>>
2945 // 4th bin: <<2><cos(phi1+phi2)>>
2946 // 5th bin: <<2><sin(phi1+phi2)>>
2947 // 6th bin: <<2><cos(phi1-phi2-phi3)>>
2948 // 7th bin: <<2><sin(phi1-phi2-phi3)>>
2949 // 8th bin: <<4><cos(phi1)>>
2950 // 9th bin: <<4><sin(phi1)>>
2951 // 10th bin: <<4><cos(phi1+phi2)>>
2952 // 11th bin: <<4><sin(phi1+phi2)>>
2953 // 12th bin: <<4><cos(phi1-phi2-phi3)>>
2954 // 13th bin: <<4><sin(phi1-phi2-phi3)>>
2955 // 14th bin: <<cos(phi1)><cos(phi1+phi2)>>
2956 // 15th bin: <<cos(phi1)><sin(phi1+phi2)>>
2957 // 16th bin: <<cos(phi1)><cos(phi1-phi2-phi3)>>
2958 // 17th bin: <<cos(phi1)><sin(phi1-phi2-phi3)>>
2959 // 18th bin: <<sin(phi1)><cos(phi1+phi2)>>
2960 // 19th bin: <<sin(phi1)><sin(phi1+phi2)>>
2961 // 20th bin: <<sin(phi1)><cos(phi1-phi2-phi3)>>
2962 // 21st bin: <<sin(phi1)><sin(phi1-phi2-phi3)>>
2963 // 22nd bin: <<cos(phi1+phi2)><sin(phi1+phi2)>>
2964 // 23rd bin: <<cos(phi1+phi2)><cos(phi1-phi2-phi3)>>
2965 // 24th bin: <<cos(phi1+phi2)><sin(phi1-phi2-phi3)>>
2966 // 25th bin: <<sin(phi1+phi2)><cos(phi1-phi2-phi3)>>
2967 // 26th bin: <<sin(phi1+phi2)><sin(phi1-phi2-phi3)>>
2968 // 27th bin: <<cos(phi1-phi2-phi3)><sin(phi1-phi2-phi3)>>
2971 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(0.5,
2972 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1),
2973 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
2974 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
2976 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(1.5,
2977 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1),
2978 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
2979 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
2980 // <<cos(phi)><sin(phi)>>:
2981 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(2.5,
2982 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1),
2983 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
2984 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
2985 // <<2><cos(phi1+phi2)>>:
2986 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(3.5,
2987 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
2988 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
2989 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
2990 // <<2><sin(phi1+phi2)>>:
2991 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(4.5,
2992 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
2993 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
2994 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
2995 // <<2><cos(phi1-phi2-phi3)>>:
2996 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(5.5,
2997 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
2998 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
2999 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3000 // <<2><sin(phi1-phi2-phi3)>>:
3001 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(6.5,
3002 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3003 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3004 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3005 // <<4><cos(phi1)>>:
3006 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(7.5,
3007 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1),
3008 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3009 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
3010 // <<4><sin(phi1)>>:
3011 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(8.5,
3012 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1),
3013 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3014 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
3015 // <<4><cos(phi1+phi2)>>:
3016 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(9.5,
3017 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
3018 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3019 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
3020 // <<4><sin(phi1+phi2)>>:
3021 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(10.5,
3022 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
3023 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3024 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
3025 // <<4><cos(phi1-phi2-phi3)>>:
3026 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(11.5,
3027 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3028 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3029 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3030 // <<4><sin(phi1-phi2-phi3)>>:
3031 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(12.5,
3032 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3033 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3034 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3035 // <<cos(phi1)><cos(phi1+phi2)>>:
3036 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(13.5,
3037 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
3038 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
3039 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
3040 // <<cos(phi1)><sin(phi1+phi2)>>:
3041 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(14.5,
3042 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
3043 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
3044 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
3045 // <<cos(phi1)><cos(phi1-phi2-phi3)>>:
3046 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(15.5,
3047 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3048 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
3049 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3050 // <<cos(phi1)><sin(phi1-phi2-phi3)>>:
3051 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(16.5,
3052 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3053 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
3054 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3055 // <<sin(phi1)><cos(phi1+phi2)>>:
3056 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(17.5,
3057 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
3058 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
3059 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
3060 // <<sin(phi1)><sin(phi1+phi2)>>:
3061 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(18.5,
3062 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
3063 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
3064 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
3065 // <<sin(phi1)><cos(phi1-phi2-phi3)>>:
3066 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(19.5,
3067 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3068 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
3069 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3070 // <<sin(phi1)><sin(phi1-phi2-phi3)>>:
3071 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(20.5,
3072 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3073 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
3074 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3075 // <<cos(phi1+phi2)><sin(phi1+phi2)>>:
3076 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(21.5,
3077 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
3078 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)
3079 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
3080 // <<cos(phi1+phi2)><cos(phi1-phi2-phi3)>>:
3081 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(22.5,
3082 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3083 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)
3084 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3085 // <<cos(phi1+phi2)><sin(phi1-phi2-phi3)>>:
3086 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(23.5,
3087 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3088 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)
3089 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3090 // <<sin(phi1+phi2)><cos(phi1-phi2-phi3)>>:
3091 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(24.5,
3092 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3093 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)
3094 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3095 // <<sin(phi1+phi2)><sin(phi1-phi2-phi3)>>:
3096 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(25.5,
3097 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3098 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)
3099 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3100 // <<cos(phi1-phi2-phi3)><sin(phi1-phi2-phi3)>>:
3101 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(26.5,
3102 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3103 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3)
3104 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3106 } // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrectionTermsForNUA()
3108 //================================================================================================================================
3110 void AliFlowAnalysisWithQCumulants::CalculateCovariancesIntFlow()
3112 // a) Calculate unbiased estimators Cov(<2>,<4>), Cov(<2>,<6>), Cov(<2>,<8>), Cov(<4>,<6>), Cov(<4>,<8>) and Cov(<6>,<8>)
3113 // for covariances V_(<2>,<4>), V_(<2>,<6>), V_(<2>,<8>), V_(<4>,<6>), V_(<4>,<8>) and V_(<6>,<8>).
3114 // b) Store in histogram fIntFlowCovariances for instance the following:
3116 // 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)]
3118 // where N is the number of events, w_{<2>} is event weight for <2> and w_{<4>} is event weight for <4>.
3119 // c) Binning of fIntFlowCovariances is organized as follows:
3121 // 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)]
3122 // 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)]
3123 // 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)]
3124 // 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)]
3125 // 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)]
3126 // 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)]
3129 // Average 2-, 4-, 6- and 8-particle correlations for all events:
3130 Double_t correlation[4] = {0.};
3131 for(Int_t ci=0;ci<4;ci++)
3133 correlation[ci] = fIntFlowCorrelationsPro->GetBinContent(ci+1);
3135 // Average products of 2-, 4-, 6- and 8-particle correlations:
3136 Double_t productOfCorrelations[4][4] = {{0.}};
3137 Int_t productOfCorrelationsLabel = 1;
3138 // Denominators in the expressions for the unbiased estimator for covariance:
3139 Double_t denominator[4][4] = {{0.}};
3140 Int_t sumOfProductOfEventWeightsLabel1 = 1;
3141 // Weight dependent prefactor which multiply unbiased estimators for covariances:
3142 Double_t wPrefactor[4][4] = {{0.}};
3143 Int_t sumOfProductOfEventWeightsLabel2 = 1;
3144 for(Int_t c1=0;c1<4;c1++)
3146 for(Int_t c2=c1+1;c2<4;c2++)
3148 productOfCorrelations[c1][c2] = fIntFlowProductOfCorrelationsPro->GetBinContent(productOfCorrelationsLabel);
3149 if(TMath::Abs(fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1)) > 1.e-44 && TMath::Abs(fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1)) > 1.e-44)
3151 denominator[c1][c2] = 1.-(fIntFlowSumOfProductOfEventWeights->GetBinContent(sumOfProductOfEventWeightsLabel1))
3152 / (fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1)
3153 * fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1));
3154 wPrefactor[c1][c2] = fIntFlowSumOfProductOfEventWeights->GetBinContent(sumOfProductOfEventWeightsLabel2)
3155 / (fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1)
3156 * fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1));
3158 productOfCorrelationsLabel++; // to be improved - do I need here all 3 counters?
3159 sumOfProductOfEventWeightsLabel1++;
3160 sumOfProductOfEventWeightsLabel2++;
3161 } // end of for(Int_t c2=c1+1;c2<4;c2++)
3162 } // end of for(Int_t c1=0;c1<4;c1++)
3164 Int_t covarianceLabel = 1;
3165 for(Int_t c1=0;c1<4;c1++)
3167 for(Int_t c2=c1+1;c2<4;c2++)
3169 if(TMath::Abs(denominator[c1][c2]) > 1.e-44)
3172 Double_t cov = (productOfCorrelations[c1][c2]-correlation[c1]*correlation[c2])/denominator[c1][c2];
3173 // Covariances multiplied with weight dependent prefactor:
3174 Double_t wCov = cov * wPrefactor[c1][c2];
3175 fIntFlowCovariances->SetBinContent(covarianceLabel,wCov);
3178 } // end of for(Int_t c2=c1+1;c2<4;c2++)
3179 } // end of for(Int_t c1=0;c1<4;c1++)
3181 // Versus multiplicity:
3182 if(!fCalculateCumulantsVsM){return;}
3183 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
3184 for(Int_t b=1;b<=nBins;b++)
3186 // Average 2-, 4-, 6- and 8-particle correlations for all events:
3187 Double_t correlationVsM[4] = {0.};
3188 for(Int_t ci=0;ci<4;ci++)
3190 correlationVsM[ci] = fIntFlowCorrelationsVsMPro[ci]->GetBinContent(b);
3191 } // end of for(Int_t ci=0;ci<4;ci++)
3192 // Average products of 2-, 4-, 6- and 8-particle correlations:
3193 Double_t productOfCorrelationsVsM[4][4] = {{0.}};
3194 Int_t productOfCorrelationsLabelVsM = 1;
3195 // Denominators in the expressions for the unbiased estimator for covariance:
3196 Double_t denominatorVsM[4][4] = {{0.}};
3197 Int_t sumOfProductOfEventWeightsLabel1VsM = 1;
3198 // Weight dependent prefactor which multiply unbiased estimators for covariances:
3199 Double_t wPrefactorVsM[4][4] = {{0.}};
3200 Int_t sumOfProductOfEventWeightsLabel2VsM = 1;
3201 for(Int_t c1=0;c1<4;c1++)
3203 for(Int_t c2=c1+1;c2<4;c2++)
3205 productOfCorrelationsVsM[c1][c2] = fIntFlowProductOfCorrelationsVsMPro[productOfCorrelationsLabelVsM-1]->GetBinContent(b);
3206 if(TMath::Abs(fIntFlowSumOfEventWeightsVsM[c1][0]->GetBinContent(b)) > 1.e-44 && TMath::Abs(fIntFlowSumOfEventWeightsVsM[c2][0]->GetBinContent(b)) > 1.e-44)
3208 denominatorVsM[c1][c2] = 1.-(fIntFlowSumOfProductOfEventWeightsVsM[sumOfProductOfEventWeightsLabel1VsM-1]->GetBinContent(b))
3209 / (fIntFlowSumOfEventWeightsVsM[c1][0]->GetBinContent(b)
3210 * fIntFlowSumOfEventWeightsVsM[c2][0]->GetBinContent(b));
3211 wPrefactorVsM[c1][c2] = fIntFlowSumOfProductOfEventWeightsVsM[sumOfProductOfEventWeightsLabel2VsM-1]->GetBinContent(b)
3212 / (fIntFlowSumOfEventWeightsVsM[c1][0]->GetBinContent(b)
3213 * fIntFlowSumOfEventWeightsVsM[c2][0]->GetBinContent(b));
3215 productOfCorrelationsLabelVsM++;
3216 sumOfProductOfEventWeightsLabel1VsM++;
3217 sumOfProductOfEventWeightsLabel2VsM++;
3218 } // end of for(Int_t c1=0;c1<4;c1++)
3219 } // end of for(Int_t c2=c1+1;c2<4;c2++)
3221 Int_t covarianceLabelVsM = 1;
3222 for(Int_t c1=0;c1<4;c1++)
3224 for(Int_t c2=c1+1;c2<4;c2++)
3226 if(TMath::Abs(denominatorVsM[c1][c2]) > 1.e-44)
3229 Double_t covVsM = (productOfCorrelationsVsM[c1][c2]-correlationVsM[c1]*correlationVsM[c2])/denominatorVsM[c1][c2];
3230 // Covariances multiplied with weight dependent prefactor:
3231 Double_t wCovVsM = covVsM * wPrefactorVsM[c1][c2];
3232 fIntFlowCovariancesVsM[covarianceLabelVsM-1]->SetBinContent(b,wCovVsM);
3234 covarianceLabelVsM++;
3235 } // end of for(Int_t c2=c1+1;c2<4;c2++)
3236 } // end of for(Int_t c1=0;c1<4;c1++)
3237 } // end of for(Int_t b=1;b<=nBins;b++)
3239 } // end of AliFlowAnalysisWithQCumulants::CalculateCovariancesIntFlow()
3241 //================================================================================================================================
3243 void AliFlowAnalysisWithQCumulants::CalculateCovariancesNUAIntFlow()
3245 // a) Calculate unbiased estimators Cov(*,*) for true covariances V_(*,*) for NUA terms.
3246 // b) Store in histogram fIntFlowCovariancesNUA for instance the following:
3248 // 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)]
3250 // where N is the number of events, w_{<2>} is event weight for <2> and w_{<cos(phi)>} is event weight for <cos(phi)>.
3251 // c) Binning of fIntFlowCovariancesNUA is organized as follows:
3253 // 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)]
3254 // 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)]
3255 // 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)]
3258 // Cov(<2>,<cos(phi)>):
3259 Double_t product1 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(1); // <<2><cos(phi)>>
3260 Double_t term1st1 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3261 Double_t term2nd1 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi)>>
3262 Double_t sumOfW1st1 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3263 Double_t sumOfW2nd1 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi)>}
3264 Double_t sumOfWW1 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(1); // W_{<2>} * W_{<cos(phi)>}
3265 // numerator in the expression for the the unbiased estimator for covariance:
3266 Double_t numerator1 = product1 - term1st1*term2nd1;
3267 // denominator in the expression for the the unbiased estimator for covariance:
3268 Double_t denominator1 = 1.-sumOfWW1/(sumOfW1st1*sumOfW2nd1);
3270 Double_t covariance1 = numerator1/denominator1;
3271 // weight dependent prefactor for covariance:
3272 Double_t wPrefactor1 = sumOfWW1/(sumOfW1st1*sumOfW2nd1);
3273 // finally, store "weighted" covariance:
3274 fIntFlowCovariancesNUA->SetBinContent(1,wPrefactor1*covariance1);
3276 // Cov(<2>,<sin(phi)>):
3277 Double_t product2 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(2); // <<2><sin(phi)>>
3278 Double_t term1st2 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3279 Double_t term2nd2 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi)>>
3280 Double_t sumOfW1st2 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3281 Double_t sumOfW2nd2 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi)>}
3282 Double_t sumOfWW2 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(2); // W_{<2>} * W_{<sin(phi)>}
3283 // numerator in the expression for the the unbiased estimator for covariance:
3284 Double_t numerator2 = product2 - term1st2*term2nd2;
3285 // denominator in the expression for the the unbiased estimator for covariance:
3286 Double_t denominator2 = 1.-sumOfWW2/(sumOfW1st2*sumOfW2nd2);
3288 Double_t covariance2 = numerator2/denominator2;
3289 // weight dependent prefactor for covariance:
3290 Double_t wPrefactor2 = sumOfWW2/(sumOfW1st2*sumOfW2nd2);
3291 // finally, store "weighted" covariance:
3292 fIntFlowCovariancesNUA->SetBinContent(2,wPrefactor2*covariance2);
3294 // Cov(<cos(phi)>,<sin(phi)>):
3295 Double_t product3 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(3); // <<cos(phi)><sin(phi)>>
3296 Double_t term1st3 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi)>>
3297 Double_t term2nd3 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi)>>
3298 Double_t sumOfW1st3 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi)>}
3299 Double_t sumOfW2nd3 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi)>}
3300 Double_t sumOfWW3 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(3); // W_{<cos(phi)>} * W_{<sin(phi)>}
3301 // numerator in the expression for the the unbiased estimator for covariance:
3302 Double_t numerator3 = product3 - term1st3*term2nd3;
3303 // denominator in the expression for the the unbiased estimator for covariance:
3304 Double_t denominator3 = 1.-sumOfWW3/(sumOfW1st3*sumOfW2nd3);
3306 Double_t covariance3 = numerator3/denominator3;
3307 // weight dependent prefactor for covariance:
3308 Double_t wPrefactor3 = sumOfWW3/(sumOfW1st3*sumOfW2nd3);
3309 // finally, store "weighted" covariance:
3310 fIntFlowCovariancesNUA->SetBinContent(3,wPrefactor3*covariance3);
3312 // Cov(<2>,<cos(phi1+phi2)>):
3313 Double_t product4 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(4); // <<2><cos(phi1+phi2)>>
3314 Double_t term1st4 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3315 Double_t term2nd4 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3316 Double_t sumOfW1st4 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3317 Double_t sumOfW2nd4 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3318 Double_t sumOfWW4 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(4); // W_{<2>} * W_{<cos(phi1+phi2)>}
3319 // numerator in the expression for the the unbiased estimator for covariance:
3320 Double_t numerator4 = product4 - term1st4*term2nd4;
3321 // denominator in the expression for the the unbiased estimator for covariance:
3322 Double_t denominator4 = 1.-sumOfWW4/(sumOfW1st4*sumOfW2nd4);
3324 Double_t covariance4 = numerator4/denominator4;
3325 // weight dependent prefactor for covariance:
3326 Double_t wPrefactor4 = sumOfWW4/(sumOfW1st4*sumOfW2nd4);
3327 // finally, store "weighted" covariance:
3328 fIntFlowCovariancesNUA->SetBinContent(4,wPrefactor4*covariance4);
3330 // Cov(<2>,<sin(phi1+phi2)>):
3331 Double_t product5 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(5); // <<2><sin(phi1+phi2)>>
3332 Double_t term1st5 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3333 Double_t term2nd5 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3334 Double_t sumOfW1st5 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3335 Double_t sumOfW2nd5 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3336 Double_t sumOfWW5 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(5); // W_{<2>} * W_{<sin(phi1+phi2)>}
3337 // numerator in the expression for the the unbiased estimator for covariance:
3338 Double_t numerator5 = product5 - term1st5*term2nd5;
3339 // denominator in the expression for the the unbiased estimator for covariance:
3340 Double_t denominator5 = 1.-sumOfWW5/(sumOfW1st5*sumOfW2nd5);
3342 Double_t covariance5 = numerator5/denominator5;
3343 // weight dependent prefactor for covariance:
3344 Double_t wPrefactor5 = sumOfWW5/(sumOfW1st5*sumOfW2nd5);
3345 // finally, store "weighted" covariance:
3346 fIntFlowCovariancesNUA->SetBinContent(5,wPrefactor5*covariance5);
3348 // Cov(<2>,<cos(phi1-phi2-phi3)>):
3349 Double_t product6 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(6); // <<2><cos(phi1-phi2-phi3)>>
3350 Double_t term1st6 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3351 Double_t term2nd6 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3352 Double_t sumOfW1st6 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3353 Double_t sumOfW2nd6 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3354 Double_t sumOfWW6 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(6); // W_{<2>} * W_{<cos(phi1-phi2-phi3)>}
3355 // numerator in the expression for the the unbiased estimator for covariance:
3356 Double_t numerator6 = product6 - term1st6*term2nd6;
3357 // denominator in the expression for the the unbiased estimator for covariance:
3358 Double_t denominator6 = 1.-sumOfWW6/(sumOfW1st6*sumOfW2nd6);
3360 Double_t covariance6 = numerator6/denominator6;
3361 // weight dependent prefactor for covariance:
3362 Double_t wPrefactor6 = sumOfWW6/(sumOfW1st6*sumOfW2nd6);
3363 // finally, store "weighted" covariance:
3364 fIntFlowCovariancesNUA->SetBinContent(6,wPrefactor6*covariance6);
3366 // Cov(<2>,<sin(phi1-phi2-phi3)>):
3367 Double_t product7 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(7); // <<2><sin(phi1-phi2-phi3)>>
3368 Double_t term1st7 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
3369 Double_t term2nd7 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3370 Double_t sumOfW1st7 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
3371 Double_t sumOfW2nd7 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3372 Double_t sumOfWW7 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(7); // W_{<2>} * W_{<sin(phi1-phi2-phi3)>}
3373 // numerator in the expression for the the unbiased estimator for covariance:
3374 Double_t numerator7 = product7 - term1st7*term2nd7;
3375 // denominator in the expression for the the unbiased estimator for covariance:
3376 Double_t denominator7 = 1.-sumOfWW7/(sumOfW1st7*sumOfW2nd7);
3378 Double_t covariance7 = numerator7/denominator7;
3379 // weight dependent prefactor for covariance:
3380 Double_t wPrefactor7 = sumOfWW7/(sumOfW1st7*sumOfW2nd7);
3381 // finally, store "weighted" covariance:
3382 fIntFlowCovariancesNUA->SetBinContent(7,wPrefactor7*covariance7);
3384 // Cov(<4>,<cos(phi1>):
3385 Double_t product8 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(8); // <<4><cos(phi1)>>
3386 Double_t term1st8 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3387 Double_t term2nd8 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
3388 Double_t sumOfW1st8 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3389 Double_t sumOfW2nd8 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
3390 Double_t sumOfWW8 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(8); // W_{<4>} * W_{<cos(phi1)>}
3391 // numerator in the expression for the the unbiased estimator for covariance:
3392 Double_t numerator8 = product8 - term1st8*term2nd8;
3393 // denominator in the expression for the the unbiased estimator for covariance:
3394 Double_t denominator8 = 1.-sumOfWW8/(sumOfW1st8*sumOfW2nd8);
3396 Double_t covariance8 = numerator8/denominator8;
3397 // weight dependent prefactor for covariance:
3398 Double_t wPrefactor8 = sumOfWW8/(sumOfW1st8*sumOfW2nd8);
3399 // finally, store "weighted" covariance:
3400 fIntFlowCovariancesNUA->SetBinContent(8,wPrefactor8*covariance8);
3402 // Cov(<4>,<sin(phi1)>):
3403 Double_t product9 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(9); // <<4><sin(phi1)>>
3404 Double_t term1st9 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3405 Double_t term2nd9 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
3406 Double_t sumOfW1st9 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3407 Double_t sumOfW2nd9 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
3408 Double_t sumOfWW9 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(9); // W_{<4>} * W_{<sin(phi1)>}
3409 // numerator in the expression for the the unbiased estimator for covariance:
3410 Double_t numerator9 = product9 - term1st9*term2nd9;
3411 // denominator in the expression for the the unbiased estimator for covariance:
3412 Double_t denominator9 = 1.-sumOfWW9/(sumOfW1st9*sumOfW2nd9);
3414 Double_t covariance9 = numerator9/denominator9;
3415 // weight dependent prefactor for covariance:
3416 Double_t wPrefactor9 = sumOfWW9/(sumOfW1st9*sumOfW2nd9);
3417 // finally, store "weighted" covariance:
3418 fIntFlowCovariancesNUA->SetBinContent(9,wPrefactor9*covariance9);
3420 // Cov(<4>,<cos(phi1+phi2)>):
3421 Double_t product10 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(10); // <<4><cos(phi1+phi2)>>
3422 Double_t term1st10 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3423 Double_t term2nd10 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3424 Double_t sumOfW1st10 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3425 Double_t sumOfW2nd10 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3426 Double_t sumOfWW10 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(10); // W_{<4>} * W_{<cos(phi1+phi2)>}
3427 // numerator in the expression for the the unbiased estimator for covariance:
3428 Double_t numerator10 = product10 - term1st10*term2nd10;
3429 // denominator in the expression for the the unbiased estimator for covariance:
3430 Double_t denominator10 = 1.-sumOfWW10/(sumOfW1st10*sumOfW2nd10);
3432 Double_t covariance10 = numerator10/denominator10;
3433 // weight dependent prefactor for covariance:
3434 Double_t wPrefactor10 = sumOfWW10/(sumOfW1st10*sumOfW2nd10);
3435 // finally, store "weighted" covariance:
3436 fIntFlowCovariancesNUA->SetBinContent(10,wPrefactor10*covariance10);
3438 // Cov(<4>,<sin(phi1+phi2)>):
3439 Double_t product11 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(11); // <<4><sin(phi1+phi2)>>
3440 Double_t term1st11 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3441 Double_t term2nd11 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3442 Double_t sumOfW1st11 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3443 Double_t sumOfW2nd11 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3444 Double_t sumOfWW11 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(11); // W_{<4>} * W_{<sin(phi1+phi2)>}
3445 // numerator in the expression for the the unbiased estimator for covariance:
3446 Double_t numerator11 = product11 - term1st11*term2nd11;
3447 // denominator in the expression for the the unbiased estimator for covariance:
3448 Double_t denominator11 = 1.-sumOfWW11/(sumOfW1st11*sumOfW2nd11);
3450 Double_t covariance11 = numerator11/denominator11;
3451 // weight dependent prefactor for covariance:
3452 Double_t wPrefactor11 = sumOfWW11/(sumOfW1st11*sumOfW2nd11);
3453 // finally, store "weighted" covariance:
3454 fIntFlowCovariancesNUA->SetBinContent(11,wPrefactor11*covariance11);
3456 // Cov(<4>,<cos(phi1-phi2-phi3)>):
3457 Double_t product12 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(12); // <<4><cos(phi1-phi2-phi3)>>
3458 Double_t term1st12 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3459 Double_t term2nd12 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3460 Double_t sumOfW1st12 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3461 Double_t sumOfW2nd12 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3462 Double_t sumOfWW12 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(12); // W_{<4>} * W_{<cos(phi1-phi2-phi3)>}
3463 // numerator in the expression for the the unbiased estimator for covariance:
3464 Double_t numerator12 = product12 - term1st12*term2nd12;
3465 // denominator in the expression for the the unbiased estimator for covariance:
3466 Double_t denominator12 = 1.-sumOfWW12/(sumOfW1st12*sumOfW2nd12);
3468 Double_t covariance12 = numerator12/denominator12;
3469 // weight dependent prefactor for covariance:
3470 Double_t wPrefactor12 = sumOfWW12/(sumOfW1st12*sumOfW2nd12);
3471 // finally, store "weighted" covariance:
3472 fIntFlowCovariancesNUA->SetBinContent(12,wPrefactor12*covariance12);
3474 // Cov(<4>,<sin(phi1-phi2-phi3)>):
3475 Double_t product13 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(13); // <<4><sin(phi1-phi2-phi3)>>
3476 Double_t term1st13 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
3477 Double_t term2nd13 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3478 Double_t sumOfW1st13 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
3479 Double_t sumOfW2nd13 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3480 Double_t sumOfWW13 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(13); // W_{<4>} * W_{<sin(phi1-phi2-phi3)>}
3481 // numerator in the expression for the the unbiased estimator for covariance:
3482 Double_t numerator13 = product13 - term1st13*term2nd13;
3483 // denominator in the expression for the the unbiased estimator for covariance:
3484 Double_t denominator13 = 1.-sumOfWW13/(sumOfW1st13*sumOfW2nd13);
3486 Double_t covariance13 = numerator13/denominator13;
3487 // weight dependent prefactor for covariance:
3488 Double_t wPrefactor13 = sumOfWW13/(sumOfW1st13*sumOfW2nd13);
3489 // finally, store "weighted" covariance:
3490 fIntFlowCovariancesNUA->SetBinContent(13,wPrefactor13*covariance13);
3492 // Cov(<cos(phi1)>,<cos(phi1+phi2)>):
3493 Double_t product14 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(14); // <<cos(phi1)><cos(phi1+phi2)>>
3494 Double_t term1st14 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
3495 Double_t term2nd14 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3496 Double_t sumOfW1st14 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
3497 Double_t sumOfW2nd14 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3498 Double_t sumOfWW14 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(14); // W_{<cos(phi1)>} * W_{<cos(phi1+phi2)>}
3499 // numerator in the expression for the the unbiased estimator for covariance:
3500 Double_t numerator14 = product14 - term1st14*term2nd14;
3501 // denominator in the expression for the the unbiased estimator for covariance:
3502 Double_t denominator14 = 1.-sumOfWW14/(sumOfW1st14*sumOfW2nd14);
3504 Double_t covariance14 = numerator14/denominator14;
3505 // weight dependent prefactor for covariance:
3506 Double_t wPrefactor14 = sumOfWW14/(sumOfW1st14*sumOfW2nd14);
3507 // finally, store "weighted" covariance:
3508 fIntFlowCovariancesNUA->SetBinContent(14,wPrefactor14*covariance14);
3510 // Cov(<cos(phi1)>,<sin(phi1+phi2)>):
3511 Double_t product15 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(15); // <<cos(phi1)><sin(phi1+phi2)>>
3512 Double_t term1st15 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
3513 Double_t term2nd15 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3514 Double_t sumOfW1st15 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
3515 Double_t sumOfW2nd15 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3516 Double_t sumOfWW15 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(15); // W_{<cos(phi1)>} * W_{<sin(phi1+phi2)>}
3517 // numerator in the expression for the the unbiased estimator for covariance:
3518 Double_t numerator15 = product15 - term1st15*term2nd15;
3519 // denominator in the expression for the the unbiased estimator for covariance:
3520 Double_t denominator15 = 1.-sumOfWW15/(sumOfW1st15*sumOfW2nd15);
3522 Double_t covariance15 = numerator15/denominator15;
3523 // weight dependent prefactor for covariance:
3524 Double_t wPrefactor15 = sumOfWW15/(sumOfW1st15*sumOfW2nd15);
3525 // finally, store "weighted" covariance:
3526 fIntFlowCovariancesNUA->SetBinContent(15,wPrefactor15*covariance15);
3528 // Cov(<cos(phi1)>,<cos(phi1-phi2-phi3)>):
3529 Double_t product16 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(16); // <<cos(phi1)><cos(phi1-phi2-phi3)>>
3530 Double_t term1st16 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
3531 Double_t term2nd16 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3532 Double_t sumOfW1st16 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
3533 Double_t sumOfW2nd16 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3534 Double_t sumOfWW16 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(16); // W_{<cos(phi1)>} * W_{<cos(phi1-phi2-phi3)>}
3535 // numerator in the expression for the the unbiased estimator for covariance:
3536 Double_t numerator16 = product16 - term1st16*term2nd16;
3537 // denominator in the expression for the the unbiased estimator for covariance:
3538 Double_t denominator16 = 1.-sumOfWW16/(sumOfW1st16*sumOfW2nd16);
3540 Double_t covariance16 = numerator16/denominator16;
3541 // weight dependent prefactor for covariance:
3542 Double_t wPrefactor16 = sumOfWW16/(sumOfW1st16*sumOfW2nd16);
3543 // finally, store "weighted" covariance:
3544 fIntFlowCovariancesNUA->SetBinContent(16,wPrefactor16*covariance16);
3546 // Cov(<cos(phi1)>,<sin(phi1-phi2-phi3)>):
3547 Double_t product17 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(17); // <<cos(phi1)><sin(phi1-phi2-phi3)>>
3548 Double_t term1st17 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
3549 Double_t term2nd17 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3550 Double_t sumOfW1st17 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
3551 Double_t sumOfW2nd17 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3552 Double_t sumOfWW17 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(17); // W_{<cos(phi1)>} * W_{<sin(phi1-phi2-phi3)>}
3553 // numerator in the expression for the the unbiased estimator for covariance:
3554 Double_t numerator17 = product17 - term1st17*term2nd17;
3555 // denominator in the expression for the the unbiased estimator for covariance:
3556 Double_t denominator17 = 1.-sumOfWW17/(sumOfW1st17*sumOfW2nd17);
3558 Double_t covariance17 = numerator17/denominator17;
3559 // weight dependent prefactor for covariance:
3560 Double_t wPrefactor17 = sumOfWW17/(sumOfW1st17*sumOfW2nd17);
3561 // finally, store "weighted" covariance:
3562 fIntFlowCovariancesNUA->SetBinContent(17,wPrefactor17*covariance17);
3564 // Cov(<sin(phi1)>,<cos(phi1+phi2)>):
3565 Double_t product18 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(18); // <<sin(phi1)><cos(phi1+phi2)>>
3566 Double_t term1st18 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
3567 Double_t term2nd18 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3568 Double_t sumOfW1st18 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
3569 Double_t sumOfW2nd18 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3570 Double_t sumOfWW18 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(18); // W_{<sin(phi1)>} * W_{<cos(phi1+phi2)>}
3571 // numerator in the expression for the the unbiased estimator for covariance:
3572 Double_t numerator18 = product18 - term1st18*term2nd18;
3573 // denominator in the expression for the the unbiased estimator for covariance:
3574 Double_t denominator18 = 1.-sumOfWW18/(sumOfW1st18*sumOfW2nd18);
3576 Double_t covariance18 = numerator18/denominator18;
3577 // weight dependent prefactor for covariance:
3578 Double_t wPrefactor18 = sumOfWW18/(sumOfW1st18*sumOfW2nd18);
3579 // finally, store "weighted" covariance:
3580 fIntFlowCovariancesNUA->SetBinContent(18,wPrefactor18*covariance18);
3582 // Cov(<sin(phi1)>,<sin(phi1+phi2)>):
3583 Double_t product19 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(19); // <<sin(phi1)><sin(phi1+phi2)>>
3584 Double_t term1st19 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
3585 Double_t term2nd19 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3586 Double_t sumOfW1st19 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
3587 Double_t sumOfW2nd19 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3588 Double_t sumOfWW19 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(19); // W_{<sin(phi1)>} * W_{<sin(phi1+phi2)>}
3589 // numerator in the expression for the the unbiased estimator for covariance:
3590 Double_t numerator19 = product19 - term1st19*term2nd19;
3591 // denominator in the expression for the the unbiased estimator for covariance:
3592 Double_t denominator19 = 1.-sumOfWW19/(sumOfW1st19*sumOfW2nd19);
3594 Double_t covariance19 = numerator19/denominator19;
3595 // weight dependent prefactor for covariance:
3596 Double_t wPrefactor19 = sumOfWW19/(sumOfW1st19*sumOfW2nd19);
3597 // finally, store "weighted" covariance:
3598 fIntFlowCovariancesNUA->SetBinContent(19,wPrefactor19*covariance19);
3600 // Cov(<sin(phi1)>,<cos(phi1-phi2-phi3)>):
3601 Double_t product20 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(20); // <<sin(phi1)><cos(phi1-phi2-phi3)>>
3602 Double_t term1st20 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
3603 Double_t term2nd20 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3604 Double_t sumOfW1st20 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
3605 Double_t sumOfW2nd20 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3606 Double_t sumOfWW20 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(20); // W_{<sin(phi1)>} * W_{<cos(phi1-phi2-phi3)>}
3607 // numerator in the expression for the the unbiased estimator for covariance:
3608 Double_t numerator20 = product20 - term1st20*term2nd20;
3609 // denominator in the expression for the the unbiased estimator for covariance:
3610 Double_t denominator20 = 1.-sumOfWW20/(sumOfW1st20*sumOfW2nd20);
3612 Double_t covariance20 = numerator20/denominator20;
3613 // weight dependent prefactor for covariance:
3614 Double_t wPrefactor20 = sumOfWW20/(sumOfW1st20*sumOfW2nd20);
3615 // finally, store "weighted" covariance:
3616 fIntFlowCovariancesNUA->SetBinContent(20,wPrefactor20*covariance20);
3618 // Cov(<sin(phi1)>,<sin(phi1-phi2-phi3)>):
3619 Double_t product21 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(21); // <<sin(phi1)><sin(phi1-phi2-phi3)>>
3620 Double_t term1st21 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
3621 Double_t term2nd21 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3622 Double_t sumOfW1st21 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
3623 Double_t sumOfW2nd21 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3624 Double_t sumOfWW21 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(21); // W_{<sin(phi1)>} * W_{<sin(phi1-phi2-phi3)>}
3625 // numerator in the expression for the the unbiased estimator for covariance:
3626 Double_t numerator21 = product21 - term1st21*term2nd21;
3627 // denominator in the expression for the the unbiased estimator for covariance:
3628 Double_t denominator21 = 1.-sumOfWW21/(sumOfW1st21*sumOfW2nd21);
3630 Double_t covariance21 = numerator21/denominator21;
3631 // weight dependent prefactor for covariance:
3632 Double_t wPrefactor21 = sumOfWW21/(sumOfW1st21*sumOfW2nd21);
3633 // finally, store "weighted" covariance:
3634 fIntFlowCovariancesNUA->SetBinContent(21,wPrefactor21*covariance21);
3636 // Cov(<cos(phi1+phi2)>,<sin(phi1+phi2)>):
3637 Double_t product22 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(22); // <<cos(phi1+phi2)><sin(phi1+phi2)>>
3638 Double_t term1st22 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3639 Double_t term2nd22 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3640 Double_t sumOfW1st22 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3641 Double_t sumOfW2nd22 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3642 Double_t sumOfWW22 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(22); // W_{<cos(phi1+phi2)>} * W_{<sin(phi1+phi2)>}
3643 // numerator in the expression for the the unbiased estimator for covariance:
3644 Double_t numerator22 = product22 - term1st22*term2nd22;
3645 // denominator in the expression for the the unbiased estimator for covariance:
3646 Double_t denominator22 = 1.-sumOfWW22/(sumOfW1st22*sumOfW2nd22);
3648 Double_t covariance22 = numerator22/denominator22;
3649 // weight dependent prefactor for covariance:
3650 Double_t wPrefactor22 = sumOfWW22/(sumOfW1st22*sumOfW2nd22);
3651 // finally, store "weighted" covariance:
3652 fIntFlowCovariancesNUA->SetBinContent(22,wPrefactor22*covariance22);
3654 // Cov(<cos(phi1+phi2)>,<cos(phi1-phi2-phi3)>):
3655 Double_t product23 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(23); // <<cos(phi1+phi2)><cos(phi1-phi2-phi3)>>
3656 Double_t term1st23 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3657 Double_t term2nd23 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3658 Double_t sumOfW1st23 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3659 Double_t sumOfW2nd23 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3660 Double_t sumOfWW23 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(23); // W_{<cos(phi1+phi2)>} * W_{<cos(phi1-phi2-phi3)>}
3661 // numerator in the expression for the the unbiased estimator for covariance:
3662 Double_t numerator23 = product23 - term1st23*term2nd23;
3663 // denominator in the expression for the the unbiased estimator for covariance:
3664 Double_t denominator23 = 1.-sumOfWW23/(sumOfW1st23*sumOfW2nd23);
3666 Double_t covariance23 = numerator23/denominator23;
3667 // weight dependent prefactor for covariance:
3668 Double_t wPrefactor23 = sumOfWW23/(sumOfW1st23*sumOfW2nd23);
3669 // finally, store "weighted" covariance:
3670 fIntFlowCovariancesNUA->SetBinContent(23,wPrefactor23*covariance23);
3672 // Cov(<cos(phi1+phi2)>,<sin(phi1-phi2-phi3)>):
3673 Double_t product24 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(24); // <<cos(phi1+phi2)><sin(phi1-phi2-phi3)>>
3674 Double_t term1st24 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
3675 Double_t term2nd24 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3676 Double_t sumOfW1st24 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
3677 Double_t sumOfW2nd24 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3678 Double_t sumOfWW24 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(24); // W_{<cos(phi1+phi2)>} * W_{<sin(phi1-phi2-phi3)>}
3679 // numerator in the expression for the the unbiased estimator for covariance:
3680 Double_t numerator24 = product24 - term1st24*term2nd24;
3681 // denominator in the expression for the the unbiased estimator for covariance:
3682 Double_t denominator24 = 1.-sumOfWW24/(sumOfW1st24*sumOfW2nd24);
3684 Double_t covariance24 = numerator24/denominator24;
3685 // weight dependent prefactor for covariance:
3686 Double_t wPrefactor24 = sumOfWW24/(sumOfW1st24*sumOfW2nd24);
3687 // finally, store "weighted" covariance:
3688 fIntFlowCovariancesNUA->SetBinContent(24,wPrefactor24*covariance24);
3690 // Cov(<sin(phi1+phi2)>,<cos(phi1-phi2-phi3)>):
3691 Double_t product25 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(25); // <<sin(phi1+phi2)><cos(phi1-phi2-phi3)>>
3692 Double_t term1st25 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3693 Double_t term2nd25 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
3694 Double_t sumOfW1st25 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3695 Double_t sumOfW2nd25 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
3696 Double_t sumOfWW25 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(25); // W_{<sin(phi1+phi2)>} * W_{<cos(phi1-phi2-phi3)>}
3697 // numerator in the expression for the the unbiased estimator for covariance:
3698 Double_t numerator25 = product25 - term1st25*term2nd25;
3699 // denominator in the expression for the the unbiased estimator for covariance:
3700 Double_t denominator25 = 1.-sumOfWW25/(sumOfW1st25*sumOfW2nd25);
3702 Double_t covariance25 = numerator25/denominator25;
3703 // weight dependent prefactor for covariance:
3704 Double_t wPrefactor25 = sumOfWW25/(sumOfW1st25*sumOfW2nd25);
3705 // finally, store "weighted" covariance:
3706 fIntFlowCovariancesNUA->SetBinContent(25,wPrefactor25*covariance25);
3708 // Cov(<sin(phi1+phi2)>,<sin(phi1-phi2-phi3)>):
3709 Double_t product26 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(26); // <<sin(phi1+phi2)><sin(phi1-phi2-phi3)>>
3710 Double_t term1st26 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
3711 Double_t term2nd26 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3712 Double_t sumOfW1st26 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
3713 Double_t sumOfW2nd26 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3714 Double_t sumOfWW26 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(26); // W_{<sin(phi1+phi2)>} * W_{<sin(phi1-phi2-phi3)>}
3715 // numerator in the expression for the the unbiased estimator for covariance:
3716 Double_t numerator26 = product26 - term1st26*term2nd26;
3717 // denominator in the expression for the the unbiased estimator for covariance:
3718 Double_t denominator26 = 1.-sumOfWW26/(sumOfW1st26*sumOfW2nd26);
3720 Double_t covariance26 = numerator26/denominator26;
3721 // weight dependent prefactor for covariance:
3722 Double_t wPrefactor26 = sumOfWW26/(sumOfW1st26*sumOfW2nd26);
3723 // finally, store "weighted" covariance:
3724 fIntFlowCovariancesNUA->SetBinContent(26,wPrefactor26*covariance26);
3726 // Cov(<cos(phi1-phi2-phi3)>,<sin(phi1-phi2-phi3)>):
3727 Double_t product27 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(27); // <<cos(phi1-phi2-phi3)><sin(phi1-phi2-phi3)>>
3728 Double_t term1st27 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1-phi2-phi3)>>
3729 Double_t term2nd27 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
3730 Double_t sumOfW1st27 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1-phi2-phi3)>}
3731 Double_t sumOfW2nd27 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
3732 Double_t sumOfWW27 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(27); // W_{<cos(phi1-phi2-phi3)>} * W_{<sin(phi1-phi2-phi3)>}
3733 // numerator in the expression for the the unbiased estimator for covariance:
3734 Double_t numerator27 = product27 - term1st27*term2nd27;
3735 // denominator in the expression for the the unbiased estimator for covariance:
3736 Double_t denominator27 = 1.-sumOfWW27/(sumOfW1st27*sumOfW2nd27);
3738 Double_t covariance27 = numerator27/denominator27;
3739 // weight dependent prefactor for covariance:
3740 Double_t wPrefactor27 = sumOfWW27/(sumOfW1st27*sumOfW2nd27);
3741 // finally, store "weighted" covariance:
3742 fIntFlowCovariancesNUA->SetBinContent(27,wPrefactor27*covariance27);
3744 } // end of AliFlowAnalysisWithQCumulants::CalculateCovariancesNUAIntFlow()
3747 //================================================================================================================================
3750 void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsIntFlow()
3752 // From profile fIntFlowCorrelationsPro access measured correlations and spread,
3753 // correctly calculate the statistical errors and store the final results and
3754 // statistical errors for correlations in histogram fIntFlowCorrelationsHist.
3756 // Remark: Statistical error of correlation is calculated as:
3758 // statistical error = termA * spread * termB:
3759 // termA = sqrt{sum_{i=1}^{N} w^2}/(sum_{i=1}^{N} w)
3760 // termB = 1/sqrt(1-termA^2)
3763 for(Int_t ci=1;ci<=4;ci++) // correlation index
3765 Double_t correlation = fIntFlowCorrelationsPro->GetBinContent(ci);
3766 Double_t spread = fIntFlowCorrelationsPro->GetBinError(ci);
3767 Double_t sumOfLinearEventWeights = fIntFlowSumOfEventWeights[0]->GetBinContent(ci);
3768 Double_t sumOfQuadraticEventWeights = fIntFlowSumOfEventWeights[1]->GetBinContent(ci);
3769 Double_t termA = 0.;
3770 Double_t termB = 0.;
3771 if(TMath::Abs(sumOfLinearEventWeights) > 0.) // to be improved - shall I omitt here Abs() ?
3773 termA = pow(sumOfQuadraticEventWeights,0.5)/sumOfLinearEventWeights;
3777 cout<<" WARNING (QC): sumOfLinearEventWeights == 0 in method FinalizeCorrelationsIntFlow() !!!!"<<endl;
3778 cout<<" (for "<<2*ci<<"-particle correlation)"<<endl;
3781 if(1.-pow(termA,2.) > 0.)
3783 termB = 1./pow(1-pow(termA,2.),0.5);
3787 cout<<" WARNING (QC): 1.-pow(termA,2.) <= 0 in method FinalizeCorrelationsIntFlow() !!!!"<<endl;
3788 cout<<" (for "<<2*ci<<"-particle correlation)"<<endl;
3791 Double_t statisticalError = termA * spread * termB;
3792 fIntFlowCorrelationsHist->SetBinContent(ci,correlation);
3793 fIntFlowCorrelationsHist->SetBinError(ci,statisticalError);
3794 } // end of for(Int_t ci=1;ci<=4;ci++) // correlation index
3796 // Versus multiplicity:
3797 if(!fCalculateCumulantsVsM){return;}
3798 for(Int_t ci=0;ci<=3;ci++) // correlation index
3800 Int_t nBins = fIntFlowCorrelationsVsMPro[ci]->GetNbinsX();
3801 for(Int_t b=1;b<=nBins;b++) // looping over multiplicity bins
3803 Double_t correlationVsM = fIntFlowCorrelationsVsMPro[ci]->GetBinContent(b);
3804 Double_t spreadVsM = fIntFlowCorrelationsVsMPro[ci]->GetBinError(b);
3805 Double_t sumOfLinearEventWeightsVsM = fIntFlowSumOfEventWeightsVsM[ci][0]->GetBinContent(b);
3806 Double_t sumOfQuadraticEventWeightsVsM = fIntFlowSumOfEventWeightsVsM[ci][1]->GetBinContent(b);
3807 Double_t termAVsM = 0.;
3808 Double_t termBVsM = 0.;
3809 if(TMath::Abs(sumOfLinearEventWeightsVsM) > 0.) // to be improved - shall I omitt here Abs() ?
3811 termAVsM = pow(sumOfQuadraticEventWeightsVsM,0.5)/sumOfLinearEventWeightsVsM;
3813 if(1.-pow(termAVsM,2.) > 0.)
3815 termBVsM = 1./pow(1-pow(termAVsM,2.),0.5);
3817 Double_t statisticalErrorVsM = termAVsM * spreadVsM * termBVsM;
3818 fIntFlowCorrelationsVsMHist[ci]->SetBinContent(b,correlationVsM);
3819 fIntFlowCorrelationsVsMHist[ci]->SetBinError(b,statisticalErrorVsM);
3820 } // end of for(Int_t b=1;b<=nBins;b++)
3821 } // end of for(Int_t ci=1;ci<=4;ci++) // correlation index
3823 } // end of AliFlowAnalysisWithQCumulants::FinalizeCorrelationsIntFlow()
3825 //================================================================================================================================
3827 void AliFlowAnalysisWithQCumulants::FillAverageMultiplicities(Int_t nRP)
3829 // Fill profile fAverageMultiplicity to hold average multiplicities and number of events for events with nRP>=0, nRP>=1, ... , and nRP>=8
3831 // Binning of fAverageMultiplicity is organized as follows:
3832 // 1st bin: all events (including the empty ones)
3833 // 2nd bin: event with # of RPs greater or equal to 1
3834 // 3rd bin: event with # of RPs greater or equal to 2
3835 // 4th bin: event with # of RPs greater or equal to 3
3836 // 5th bin: event with # of RPs greater or equal to 4
3837 // 6th bin: event with # of RPs greater or equal to 5
3838 // 7th bin: event with # of RPs greater or equal to 6
3839 // 8th bin: event with # of RPs greater or equal to 7
3840 // 9th bin: event with # of RPs greater or equal to 8
3842 if(!fAvMultiplicity)
3844 cout<<"WARNING: fAvMultiplicity is NULL in AFAWQC::FAM() !!!!"<<endl;
3850 cout<<"WARNING: nRP<0 in in AFAWQC::FAM() !!!!"<<endl;
3854 for(Int_t i=0;i<9;i++)
3856 if(nRP>=i) fAvMultiplicity->Fill(i+0.5,nRP,1);
3859 } // end of AliFlowAnalysisWithQCumulants::FillAverageMultiplicities(nRP)
3862 //================================================================================================================================
3865 void AliFlowAnalysisWithQCumulants::CalculateCumulantsIntFlow()
3867 // a) Calculate Q-cumulants from the measured multiparticle correlations.
3868 // b) Propagate the statistical errors of measured multiparticle correlations to statistical errors of Q-cumulants.
3869 // c) REMARK: Q-cumulants calculated in this method are biased by non-uniform acceptance of detector !!!!
3870 // Method ApplyCorrectionForNonUniformAcceptance* (to be improved: finalize the name here)
3871 // is called afterwards to correct for this bias.
3872 // d) Store the results and statistical error of Q-cumulants in histogram fCumulants.
3873 // Binning of fCumulants is organized as follows:
3881 // to be improved: revise the names and check the pointers used in this method
3884 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
3885 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
3886 Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
3887 Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
3888 // Statistical errors of average 2-, 4-, 6- and 8-particle azimuthal correlations:
3889 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <2>
3890 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <4>
3891 Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <6>
3892 Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <8>
3893 // Covariances (multiplied by prefactor depending on weights - see comments in CalculateCovariancesIntFlow()):
3894 Double_t wCov24 = fIntFlowCovariances->GetBinContent(1); // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
3895 Double_t wCov26 = fIntFlowCovariances->GetBinContent(2); // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)
3896 Double_t wCov28 = fIntFlowCovariances->GetBinContent(3); // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)
3897 Double_t wCov46 = fIntFlowCovariances->GetBinContent(4); // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)
3898 Double_t wCov48 = fIntFlowCovariances->GetBinContent(5); // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)
3899 Double_t wCov68 = fIntFlowCovariances->GetBinContent(6); // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)
3901 Double_t qc2 = 0.; // QC{2}
3902 Double_t qc4 = 0.; // QC{4}
3903 Double_t qc6 = 0.; // QC{6}
3904 Double_t qc8 = 0.; // QC{8}
3905 if(TMath::Abs(two) > 0.){qc2 = two;}
3906 if(TMath::Abs(four) > 0.){qc4 = four-2.*pow(two,2.);}
3907 if(TMath::Abs(six) > 0.){qc6 = six-9.*two*four+12.*pow(two,3.);}
3908 if(TMath::Abs(eight) > 0.){qc8 = eight-16.*two*six-18.*pow(four,2.)+144.*pow(two,2.)*four-144.*pow(two,4.);}
3909 // Statistical errors of Q-cumulants:
3910 Double_t qc2Error = 0.;
3911 Double_t qc4Error = 0.;
3912 Double_t qc6Error = 0.;
3913 Double_t qc8Error = 0.;
3914 // Squared statistical errors of Q-cumulants:
3915 //Double_t qc2ErrorSquared = 0.;
3916 Double_t qc4ErrorSquared = 0.;
3917 Double_t qc6ErrorSquared = 0.;
3918 Double_t qc8ErrorSquared = 0.;
3919 // Statistical error of QC{2}:
3920 qc2Error = twoError;
3921 // Statistical error of QC{4}:
3922 qc4ErrorSquared = 16.*pow(two,2.)*pow(twoError,2)+pow(fourError,2.)
3924 if(qc4ErrorSquared>0.)
3926 qc4Error = pow(qc4ErrorSquared,0.5);
3929 cout<<" WARNING (QC): Statistical error of QC{4} is imaginary !!!!"<<endl;
3931 // Statistical error of QC{6}:
3932 qc6ErrorSquared = 81.*pow(4.*pow(two,2.)-four,2.)*pow(twoError,2.)
3933 + 81.*pow(two,2.)*pow(fourError,2.)
3935 - 162.*two*(4.*pow(two,2.)-four)*wCov24
3936 + 18.*(4.*pow(two,2.)-four)*wCov26
3938 if(qc6ErrorSquared>0.)
3940 qc6Error = pow(qc6ErrorSquared,0.5);
3943 cout<<" WARNING (QC): Statistical error of QC{6} is imaginary !!!!"<<endl;
3945 // Statistical error of QC{8}:
3946 qc8ErrorSquared = 256.*pow(36.*pow(two,3.)-18.*four*two+six,2.)*pow(twoError,2.)
3947 + 1296.*pow(4.*pow(two,2.)-four,2.)*pow(fourError,2.)
3948 + 256.*pow(two,2.)*pow(sixError,2.)
3949 + pow(eightError,2.)
3950 - 1152.*(36.*pow(two,3.)-18.*four*two+six)*(4.*pow(two,2.)-four)*wCov24
3951 + 512.*two*(36.*pow(two,3.)-18.*four*two+six)*wCov26
3952 - 32.*(36.*pow(two,3.)-18.*four*two+six)*wCov28
3953 - 1152.*two*(4.*pow(two,2.)-four)*wCov46
3954 + 72.*(4.*pow(two,2.)-four)*wCov48
3956 if(qc8ErrorSquared>0.)
3958 qc8Error = pow(qc8ErrorSquared,0.5);
3961 cout<<"WARNING (QC): Statistical error of QC{8} is imaginary !!!!"<<endl;
3963 // Store the results and statistical errors for Q-cumulants:
3964 if(TMath::Abs(qc2)>0.)
3966 fIntFlowQcumulants->SetBinContent(1,qc2);
3967 fIntFlowQcumulants->SetBinError(1,qc2Error);
3969 if(TMath::Abs(qc4)>0.)
3971 fIntFlowQcumulants->SetBinContent(2,qc4);
3972 fIntFlowQcumulants->SetBinError(2,qc4Error);
3974 if(TMath::Abs(qc6)>0.)
3976 fIntFlowQcumulants->SetBinContent(3,qc6);
3977 fIntFlowQcumulants->SetBinError(3,qc6Error);
3979 if(TMath::Abs(qc8)>0.)
3981 fIntFlowQcumulants->SetBinContent(4,qc8);
3982 fIntFlowQcumulants->SetBinError(4,qc8Error);
3985 // Versus multiplicity:
3986 if(!fCalculateCumulantsVsM){return;}
3987 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
3988 Double_t value[4] = {0.}; // QCs vs M
3989 Double_t error[4] = {0.}; // error of QCs vs M
3990 Double_t dSum1[4] = {0.}; // sum value_i/(error_i)^2
3991 Double_t dSum2[4] = {0.}; // sum 1/(error_i)^2
3992 for(Int_t b=1;b<=nBins;b++)
3995 two = fIntFlowCorrelationsVsMHist[0]->GetBinContent(b); // <<2>>
3996 four = fIntFlowCorrelationsVsMHist[1]->GetBinContent(b); // <<4>>
3997 six = fIntFlowCorrelationsVsMHist[2]->GetBinContent(b); // <<6>>
3998 eight = fIntFlowCorrelationsVsMHist[3]->GetBinContent(b); // <<8>>
3999 // Statistical errors of average 2-, 4-, 6- and 8-particle azimuthal correlations:
4000 twoError = fIntFlowCorrelationsVsMHist[0]->GetBinError(b); // statistical error of <2>
4001 fourError = fIntFlowCorrelationsVsMHist[1]->GetBinError(b); // statistical error of <4>
4002 sixError = fIntFlowCorrelationsVsMHist[2]->GetBinError(b); // statistical error of <6>
4003 eightError = fIntFlowCorrelationsVsMHist[3]->GetBinError(b); // statistical error of <8>
4004 // Covariances (multiplied by prefactor depending on weights - see comments in CalculateCovariancesIntFlow()):
4005 wCov24 = fIntFlowCovariancesVsM[0]->GetBinContent(b); // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
4006 wCov26 = fIntFlowCovariancesVsM[1]->GetBinContent(b); // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)
4007 wCov28 = fIntFlowCovariancesVsM[2]->GetBinContent(b); // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)
4008 wCov46 = fIntFlowCovariancesVsM[3]->GetBinContent(b); // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)
4009 wCov48 = fIntFlowCovariancesVsM[4]->GetBinContent(b); // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)
4010 wCov68 = fIntFlowCovariancesVsM[5]->GetBinContent(b); // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)
4016 if(TMath::Abs(two) > 0.){qc2 = two;}
4017 if(TMath::Abs(four) > 0.){qc4 = four-2.*pow(two,2.);}
4018 if(TMath::Abs(six) > 0.){qc6 = six-9.*two*four+12.*pow(two,3.);}
4019 if(TMath::Abs(eight) > 0.){qc8 = eight-16.*two*six-18.*pow(four,2.)+144.*pow(two,2.)*four-144.*pow(two,4.);}
4020 // Statistical errors of Q-cumulants:
4025 // Squared statistical errors of Q-cumulants:
4026 //Double_t qc2ErrorSquared = 0.;
4027 qc4ErrorSquared = 0.;
4028 qc6ErrorSquared = 0.;
4029 qc8ErrorSquared = 0.;
4030 // Statistical error of QC{2}:
4031 qc2Error = twoError;
4032 // Statistical error of QC{4}:
4033 qc4ErrorSquared = 16.*pow(two,2.)*pow(twoError,2)+pow(fourError,2.)
4035 if(qc4ErrorSquared>0.)
4037 qc4Error = pow(qc4ErrorSquared,0.5);
4040 // cout<<"WARNING: Statistical error of QC{4} is imaginary in multiplicity bin "<<b<<" !!!!"<<endl;
4042 // Statistical error of QC{6}:
4043 qc6ErrorSquared = 81.*pow(4.*pow(two,2.)-four,2.)*pow(twoError,2.)
4044 + 81.*pow(two,2.)*pow(fourError,2.)
4046 - 162.*two*(4.*pow(two,2.)-four)*wCov24
4047 + 18.*(4.*pow(two,2.)-four)*wCov26
4049 if(qc6ErrorSquared>0.)
4051 qc6Error = pow(qc6ErrorSquared,0.5);
4054 // cout<<"WARNING: Statistical error of QC{6} is imaginary in multiplicity bin "<<b<<" !!!!"<<endl;
4056 // Statistical error of QC{8}:
4057 qc8ErrorSquared = 256.*pow(36.*pow(two,3.)-18.*four*two+six,2.)*pow(twoError,2.)
4058 + 1296.*pow(4.*pow(two,2.)-four,2.)*pow(fourError,2.)
4059 + 256.*pow(two,2.)*pow(sixError,2.)
4060 + pow(eightError,2.)
4061 - 1152.*(36.*pow(two,3.)-18.*four*two+six)*(4.*pow(two,2.)-four)*wCov24
4062 + 512.*two*(36.*pow(two,3.)-18.*four*two+six)*wCov26
4063 - 32.*(36.*pow(two,3.)-18.*four*two+six)*wCov28
4064 - 1152.*two*(4.*pow(two,2.)-four)*wCov46
4065 + 72.*(4.*pow(two,2.)-four)*wCov48
4067 if(qc8ErrorSquared>0.)
4069 qc8Error = pow(qc8ErrorSquared,0.5);
4072 // cout<<"WARNING: Statistical error of QC{8} is imaginary in multiplicity bin "<<b<<" !!!!"<<endl;
4074 // Store the results and statistical errors for Q-cumulants:
4075 if(TMath::Abs(qc2)>0.)
4077 fIntFlowQcumulantsVsM[0]->SetBinContent(b,qc2);
4078 fIntFlowQcumulantsVsM[0]->SetBinError(b,qc2Error);
4080 if(TMath::Abs(qc4)>0.)
4082 fIntFlowQcumulantsVsM[1]->SetBinContent(b,qc4);
4083 fIntFlowQcumulantsVsM[1]->SetBinError(b,qc4Error);
4085 if(TMath::Abs(qc6)>0.)
4087 fIntFlowQcumulantsVsM[2]->SetBinContent(b,qc6);
4088 fIntFlowQcumulantsVsM[2]->SetBinError(b,qc6Error);
4090 if(TMath::Abs(qc8)>0.)
4092 fIntFlowQcumulantsVsM[3]->SetBinContent(b,qc8);
4093 fIntFlowQcumulantsVsM[3]->SetBinError(b,qc8Error);
4096 for(Int_t co=0;co<4;co++)
4098 value[co] = fIntFlowQcumulantsVsM[co]->GetBinContent(b);
4099 error[co] = fIntFlowQcumulantsVsM[co]->GetBinError(b);
4102 dSum1[co]+=value[co]/(error[co]*error[co]);
4103 dSum2[co]+=1./(error[co]*error[co]);
4105 } // end of for(Int_t co=0;co<4;co++)
4106 } // end of for(Int_t b=1;b<=nBins;b++)
4107 // Store rebinned Q-cumulants:
4108 for(Int_t co=0;co<4;co++)
4112 fIntFlowQcumulantsRebinnedInM->SetBinContent(co+1,dSum1[co]/dSum2[co]);
4113 fIntFlowQcumulantsRebinnedInM->SetBinError(co+1,pow(1./dSum2[co],0.5));
4115 } // end of for(Int_t co=0;co<4;co++)
4117 } // end of AliFlowAnalysisWithQCumulants::CalculateCumulantsIntFlow()
4119 //================================================================================================================================
4121 void AliFlowAnalysisWithQCumulants::CalculateIntFlow()
4123 // a) Calculate the final results for reference flow estimates from Q-cumulants.
4124 // b) Propagate the statistical errors to reference flow estimates from
4125 // - measured multiparticle correlations (set kTRUE for fPropagateErrorFromCorrelations), or
4126 // - cumulants (set kFALSE for fPropagateErrorFromCorrelations).
4127 // c) Store the results and statistical errors of reference flow estimates in histogram fIntFlow.
4128 // Binning of fIntFlow is organized as follows:
4136 // to be improved: revise the names and check the pointers used in this method, add something about calculation vs M
4138 if(!(fIntFlowCorrelationsHist && fIntFlowCovariances && fIntFlowQcumulants && fIntFlow))
4140 cout<<"WARNING: fIntFlowCorrelationsHist && fIntFlowCovariances && fIntFlowQcumulants && fIntFlow is NULL in AFAWQC::CCIF() !!!!"<<endl;
4144 // Reference flow estimates:
4145 Double_t v2 = 0.; // v{2,QC}
4146 Double_t v4 = 0.; // v{4,QC}
4147 Double_t v6 = 0.; // v{6,QC}
4148 Double_t v8 = 0.; // v{8,QC}
4149 // Reference flow's statistical errors:
4150 Double_t v2Error = 0.; // v{2,QC} stat. error
4151 Double_t v4Error = 0.; // v{4,QC} stat. error
4152 Double_t v6Error = 0.; // v{6,QC} stat. error
4153 Double_t v8Error = 0.; // v{8,QC} stat. error
4155 if(!fPropagateErrorFromCorrelations)
4158 Double_t qc2 = fIntFlowQcumulants->GetBinContent(1); // QC{2}
4159 Double_t qc4 = fIntFlowQcumulants->GetBinContent(2); // QC{4}
4160 Double_t qc6 = fIntFlowQcumulants->GetBinContent(3); // QC{6}
4161 Double_t qc8 = fIntFlowQcumulants->GetBinContent(4); // QC{8}
4162 // Q-cumulants's statistical errors:
4163 Double_t qc2Error = fIntFlowQcumulants->GetBinError(1); // QC{2} stat. error
4164 Double_t qc4Error = fIntFlowQcumulants->GetBinError(2); // QC{4} stat. error
4165 Double_t qc6Error = fIntFlowQcumulants->GetBinError(3); // QC{6} stat. error
4166 Double_t qc8Error = fIntFlowQcumulants->GetBinError(4); // QC{8} stat. error
4167 // Calculate reference flow estimates from Q-cumulants:
4168 if(qc2>=0.){v2 = pow(qc2,1./2.);}
4169 if(qc4<=0.){v4 = pow(-1.*qc4,1./4.);}
4170 if(qc6>=0.){v6 = pow((1./4.)*qc6,1./6.);}
4171 if(qc8<=0.){v8 = pow((-1./33.)*qc8,1./8.);}
4172 // Calculate stat. error for reference flow estimates from stat. error of Q-cumulants:
4173 if(qc2>0.){v2Error = (1./2.)*pow(qc2,-1./2.)*qc2Error;}
4174 if(qc4<0.){v4Error = (1./4.)*pow(-qc4,-3./4.)*qc4Error;}
4175 if(qc6>0.){v6Error = (1./6.)*pow(2.,-1./3.)*pow(qc6,-5./6.)*qc6Error;}
4176 if(qc8<0.){v8Error = (1./8.)*pow(33.,-1./8.)*pow(-qc8,-7./8.)*qc8Error;}
4177 // Print warnings for the 'wrong sign' cumulants:
4178 if(TMath::Abs(v2) < 1.e-44)
4180 cout<<" WARNING: Wrong sign QC{2}, couldn't calculate v{2,QC} !!!!"<<endl;
4182 if(TMath::Abs(v4) < 1.e-44)
4184 cout<<" WARNING: Wrong sign QC{4}, couldn't calculate v{4,QC} !!!!"<<endl;
4186 if(TMath::Abs(v6) < 1.e-44)
4188 cout<<" WARNING: Wrong sign QC{6}, couldn't calculate v{6,QC} !!!!"<<endl;
4190 if(TMath::Abs(v8) < 1.e-44)
4192 cout<<" WARNING: Wrong sign QC{8}, couldn't calculate v{8,QC} !!!!"<<endl;
4194 // Store the results and statistical errors of integrated flow estimates:
4195 fIntFlow->SetBinContent(1,v2);
4196 fIntFlow->SetBinError(1,v2Error);
4197 fIntFlow->SetBinContent(2,v4);
4198 fIntFlow->SetBinError(2,v4Error);
4199 fIntFlow->SetBinContent(3,v6);
4200 fIntFlow->SetBinError(3,v6Error);
4201 fIntFlow->SetBinContent(4,v8);
4202 fIntFlow->SetBinError(4,v8Error);
4204 // Versus multiplicity:
4205 if(!fCalculateCumulantsVsM){return;} // to be improved - not compatible with if(fPropagateErrorFromCorrelations) bellow
4206 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
4207 for(Int_t b=1;b<=nBins;b++)
4210 Double_t qc2VsM = fIntFlowQcumulantsVsM[0]->GetBinContent(b); // QC{2}
4211 Double_t qc4VsM = fIntFlowQcumulantsVsM[1]->GetBinContent(b); // QC{4}
4212 Double_t qc6VsM = fIntFlowQcumulantsVsM[2]->GetBinContent(b); // QC{6}
4213 Double_t qc8VsM = fIntFlowQcumulantsVsM[3]->GetBinContent(b); // QC{8}
4214 // Q-cumulants's statistical errors:
4215 Double_t qc2ErrorVsM = fIntFlowQcumulantsVsM[0]->GetBinError(b); // QC{2} stat. error
4216 Double_t qc4ErrorVsM = fIntFlowQcumulantsVsM[1]->GetBinError(b); // QC{4} stat. error
4217 Double_t qc6ErrorVsM = fIntFlowQcumulantsVsM[2]->GetBinError(b); // QC{6} stat. error
4218 Double_t qc8ErrorVsM = fIntFlowQcumulantsVsM[3]->GetBinError(b); // QC{8} stat. error
4219 // Reference flow estimates:
4220 Double_t v2VsM = 0.; // v{2,QC}
4221 Double_t v4VsM = 0.; // v{4,QC}
4222 Double_t v6VsM = 0.; // v{6,QC}
4223 Double_t v8VsM = 0.; // v{8,QC}
4224 // Reference flow estimates errors:
4225 Double_t v2ErrorVsM = 0.; // v{2,QC} stat. error
4226 Double_t v4ErrorVsM = 0.; // v{4,QC} stat. error
4227 Double_t v6ErrorVsM = 0.; // v{6,QC} stat. error
4228 Double_t v8ErrorVsM = 0.; // v{8,QC} stat. error
4229 // Calculate reference flow estimates from Q-cumulants:
4230 if(qc2VsM>=0.){v2VsM = pow(qc2VsM,1./2.);}
4231 if(qc4VsM<=0.){v4VsM = pow(-1.*qc4VsM,1./4.);}
4232 if(qc6VsM>=0.){v6VsM = pow((1./4.)*qc6VsM,1./6.);}
4233 if(qc8VsM<=0.){v8VsM = pow((-1./33.)*qc8VsM,1./8.);}
4234 // Calculate stat. error for reference flow estimates from stat. error of Q-cumulants:
4235 if(qc2VsM>0.){v2ErrorVsM = (1./2.)*pow(qc2VsM,-1./2.)*qc2ErrorVsM;}
4236 if(qc4VsM<0.){v4ErrorVsM = (1./4.)*pow(-qc4VsM,-3./4.)*qc4ErrorVsM;}
4237 if(qc6VsM>0.){v6ErrorVsM = (1./6.)*pow(2.,-1./3.)*pow(qc6VsM,-5./6.)*qc6ErrorVsM;}
4238 if(qc8VsM<0.){v8ErrorVsM = (1./8.)*pow(33.,-1./8.)*pow(-qc8VsM,-7./8.)*qc8ErrorVsM;}
4239 // Store the results and statistical errors of integrated flow estimates:
4240 fIntFlowVsM[0]->SetBinContent(b,v2VsM);
4241 fIntFlowVsM[0]->SetBinError(b,v2ErrorVsM);
4242 fIntFlowVsM[1]->SetBinContent(b,v4VsM);
4243 fIntFlowVsM[1]->SetBinError(b,v4ErrorVsM);
4244 fIntFlowVsM[2]->SetBinContent(b,v6VsM);
4245 fIntFlowVsM[2]->SetBinError(b,v6ErrorVsM);
4246 fIntFlowVsM[3]->SetBinContent(b,v8VsM);
4247 fIntFlowVsM[3]->SetBinError(b,v8ErrorVsM);
4248 } // end of for(Int_t b=1;b<=nBins;b++)
4250 // 'Rebinned in M' calculation: // to be improved - this can be implemented better:
4251 // Reference flow estimates:
4252 Double_t v2RebinnedInM = 0.; // v{2,QC}
4253 Double_t v4RebinnedInM = 0.; // v{4,QC}
4254 Double_t v6RebinnedInM = 0.; // v{6,QC}
4255 Double_t v8RebinnedInM = 0.; // v{8,QC}
4256 // Reference flow's statistical errors:
4257 Double_t v2ErrorRebinnedInM = 0.; // v{2,QC} stat. error
4258 Double_t v4ErrorRebinnedInM = 0.; // v{4,QC} stat. error
4259 Double_t v6ErrorRebinnedInM = 0.; // v{6,QC} stat. error
4260 Double_t v8ErrorRebinnedInM = 0.; // v{8,QC} stat. error
4262 Double_t qc2RebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinContent(1); // QC{2}
4263 Double_t qc4RebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinContent(2); // QC{4}
4264 Double_t qc6RebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinContent(3); // QC{6}
4265 Double_t qc8RebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinContent(4); // QC{8}
4266 // Q-cumulants's statistical errors:
4267 Double_t qc2ErrorRebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinError(1); // QC{2} stat. error
4268 Double_t qc4ErrorRebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinError(2); // QC{4} stat. error
4269 Double_t qc6ErrorRebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinError(3); // QC{6} stat. error
4270 Double_t qc8ErrorRebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinError(4); // QC{8} stat. error
4271 // Calculate reference flow estimates from Q-cumulants:
4272 if(qc2RebinnedInM>=0.){v2RebinnedInM = pow(qc2RebinnedInM,1./2.);}
4273 if(qc4RebinnedInM<=0.){v4RebinnedInM = pow(-1.*qc4RebinnedInM,1./4.);}
4274 if(qc6RebinnedInM>=0.){v6RebinnedInM = pow((1./4.)*qc6RebinnedInM,1./6.);}
4275 if(qc8RebinnedInM<=0.){v8RebinnedInM = pow((-1./33.)*qc8RebinnedInM,1./8.);}
4276 // Calculate stat. error for reference flow estimates from stat. error of Q-cumulants:
4277 if(qc2RebinnedInM>0.){v2ErrorRebinnedInM = (1./2.)*pow(qc2RebinnedInM,-1./2.)*qc2ErrorRebinnedInM;}
4278 if(qc4RebinnedInM<0.){v4ErrorRebinnedInM = (1./4.)*pow(-qc4RebinnedInM,-3./4.)*qc4ErrorRebinnedInM;}
4279 if(qc6RebinnedInM>0.){v6ErrorRebinnedInM = (1./6.)*pow(2.,-1./3.)*pow(qc6RebinnedInM,-5./6.)*qc6ErrorRebinnedInM;}
4280 if(qc8RebinnedInM<0.){v8ErrorRebinnedInM = (1./8.)*pow(33.,-1./8.)*pow(-qc8RebinnedInM,-7./8.)*qc8ErrorRebinnedInM;}
4281 // Print warnings for the 'wrong sign' cumulants:
4282 if(TMath::Abs(v2RebinnedInM) < 1.e-44)
4284 cout<<" WARNING: Wrong sign QC{2} rebinned in M, couldn't calculate v{2,QC} !!!!"<<endl;
4286 if(TMath::Abs(v4RebinnedInM) < 1.e-44)
4288 cout<<" WARNING: Wrong sign QC{4} rebinned in M, couldn't calculate v{4,QC} !!!!"<<endl;
4290 if(TMath::Abs(v6RebinnedInM) < 1.e-44)
4292 cout<<" WARNING: Wrong sign QC{6} rebinned in M, couldn't calculate v{6,QC} !!!!"<<endl;
4294 if(TMath::Abs(v8RebinnedInM) < 1.e-44)
4296 cout<<" WARNING: Wrong sign QC{8} rebinned in M, couldn't calculate v{8,QC} !!!!"<<endl;
4298 // Store the results and statistical errors of integrated flow estimates:
4299 fIntFlowRebinnedInM->SetBinContent(1,v2RebinnedInM);
4300 fIntFlowRebinnedInM->SetBinError(1,v2ErrorRebinnedInM);
4301 fIntFlowRebinnedInM->SetBinContent(2,v4RebinnedInM);
4302 fIntFlowRebinnedInM->SetBinError(2,v4ErrorRebinnedInM);
4303 fIntFlowRebinnedInM->SetBinContent(3,v6RebinnedInM);
4304 fIntFlowRebinnedInM->SetBinError(3,v6ErrorRebinnedInM);
4305 fIntFlowRebinnedInM->SetBinContent(4,v8RebinnedInM);
4306 fIntFlowRebinnedInM->SetBinError(4,v8ErrorRebinnedInM);
4307 } // end of if(!fPropagateErrorFromCorrelations)
4309 // Used only for debugging/cross-checking:
4310 if(fPropagateErrorFromCorrelations)
4312 // Measured azimuthal correlations:
4313 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
4314 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
4315 Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
4316 Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
4317 // Statistical errors of average 2-, 4-, 6- and 8-particle azimuthal correlations:
4318 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <2>
4319 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <4>
4320 Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <6>
4321 Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <8>
4322 // Covariances (multiplied by prefactor depending on weights - see comments in CalculateCovariancesIntFlow()):
4323 Double_t wCov24 = fIntFlowCovariances->GetBinContent(1); // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
4324 Double_t wCov26 = fIntFlowCovariances->GetBinContent(2); // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)
4325 Double_t wCov28 = fIntFlowCovariances->GetBinContent(3); // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)
4326 Double_t wCov46 = fIntFlowCovariances->GetBinContent(4); // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)
4327 Double_t wCov48 = fIntFlowCovariances->GetBinContent(5); // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)
4328 Double_t wCov68 = fIntFlowCovariances->GetBinContent(6); // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)
4329 // Calculate reference flow estimates:
4330 if(two>=0.){v2 = pow(two,1./2.);}
4331 if(TMath::Abs(four)>0. && four-2.*pow(two,2.) < 0.){v4 = pow(-1.*(four-2.*pow(two,2.)),1./4.);}
4332 if(TMath::Abs(six)>0. && six-9.*two*four+12.*pow(two,3.) > 0.){v6 = pow((1./4.)*(six-9.*two*four+12.*pow(two,3.)),1./6.);}
4333 if(TMath::Abs(eight)>0. && eight-16.*two*six-18.*pow(four,2.)+144.*pow(two,2.)*four-144.*pow(two,4.) < 0.)
4334 {v8 = pow((-1./33.)*(eight-16.*two*six-18.*pow(four,2.)+144.*pow(two,2.)*four-144.*pow(two,4.)),1./8.);}
4335 // Squares of statistical errors of reference flow estimates:
4336 Double_t v2ErrorSquared = 0.; // squared statistical error of v{2,QC}
4337 Double_t v4ErrorSquared = 0.; // squared statistical error of v{4,QC}
4338 Double_t v6ErrorSquared = 0.; // squared statistical error of v{6,QC}
4339 Double_t v8ErrorSquared = 0.; // squared statistical error of v{8,QC}
4340 // Calculate squared statistical errors of reference flow estimates:
4343 v2ErrorSquared = (1./(4.*two))*pow(twoError,2.);
4345 if(2.*pow(two,2.)-four > 0.)
4347 v4ErrorSquared = (1./pow(2.*pow(two,2.)-four,3./2.))
4348 * (pow(two,2.)*pow(twoError,2.)+(1./16.)*pow(fourError,2.)-(1./2.)*two*wCov24);
4350 if(six-9.*four*two+12.*pow(two,3.) > 0.)
4352 v6ErrorSquared = ((1./2.)*(1./pow(2.,2./3.))*(1./pow(six-9.*four*two+12.*pow(two,3.),5./3.)))
4353 * ((9./2.)*pow(4.*pow(two,2.)-four,2.)*pow(twoError,2.)
4354 + (9./2.)*pow(two,2.)*pow(fourError,2.)+(1./18.)*pow(sixError,2.)
4355 - 9.*two*(4.*pow(two,2.)-four)*wCov24+(4.*pow(two,2.)-four)*wCov26-two*wCov46);
4357 if(-1.*eight+16.*six*two+18.*pow(four,2.)-144.*four*pow(two,2.)+144.*pow(two,4.) > 0.)
4359 v8ErrorSquared = (4./pow(33,1./4.))
4360 * (1./pow(-1.*eight+16.*six*two+18.*pow(four,2.)-144.*four*pow(two,2.)+144.*pow(two,4.),7./4.))
4361 * (pow(36.*pow(two,3.)-18.*four*two+six,2.)*pow(twoError,2.)
4362 + (81./16.)*pow(4.*pow(two,2.)-four,2.)*pow(fourError,2.)
4363 + pow(two,2.)*pow(sixError,2.)
4364 + (1./256.)*pow(eightError,2.)
4365 - (9./2.)*(36.*pow(two,3.)-18.*four*two+six)*(4.*pow(two,2.)-four)*wCov24
4366 + 2.*two*(36.*pow(two,3.)-18.*four*two+six)*wCov26
4367 - (1./8.)*(36.*pow(two,3.)-18.*four*two+six)*wCov28
4368 - (9./2.)*two*(4.*pow(two,2.)-four)*wCov46
4369 + (9./32.)*(4.*pow(two,2.)-four)*wCov48
4370 - (1./8.)*two*wCov68);
4372 // Calculate statistical errors of reference flow estimates:
4373 if(v2ErrorSquared > 0.)
4375 v2Error = pow(v2ErrorSquared,0.5);
4377 if(v4ErrorSquared > 0.)
4379 v4Error = pow(v4ErrorSquared,0.5);
4381 if(v6ErrorSquared > 0.)
4383 v6Error = pow(v6ErrorSquared,0.5);
4385 if(v8ErrorSquared > 0.)
4387 v8Error = pow(v8ErrorSquared,0.5);
4389 // Store the results and statistical errors of integrated flow estimates:
4390 fIntFlow->SetBinContent(1,v2);
4391 fIntFlow->SetBinError(1,v2Error);
4392 fIntFlow->SetBinContent(2,v4);
4393 fIntFlow->SetBinError(2,v4Error);
4394 fIntFlow->SetBinContent(3,v6);
4395 fIntFlow->SetBinError(3,v6Error);
4396 fIntFlow->SetBinContent(4,v8);
4397 fIntFlow->SetBinError(4,v8Error);
4398 } // end of if(fPropagateErrorFromCorrelations)
4400 } // end of AliFlowAnalysisWithQCumulants::CalculateIntFlow()
4402 //================================================================================================================================
4404 void AliFlowAnalysisWithQCumulants::FillCommonHistResultsIntFlow()
4406 // Fill in AliFlowCommonHistResults histograms relevant for reference flow.
4408 // There are two possibilities here:
4409 // a) Store minimum bias reference flow - use SetMinimumBiasReferenceFlow(kTRUE). This result is
4410 // biased by the interplay between nonflow correlations and multiplicity fluctuations and is
4411 // also stored in local histogram fIntFlow;
4412 // b) Store reference flow obtained from flow analysis performed at fixed multiplicity and
4413 // rebinned only at the end of the day - use SetMinimumBiasReferenceFlow(kFALSE). This result
4414 // is also stored in local histogram fIntFlowRebinnedInM.
4416 // Reference flow estimates:
4417 Double_t v[4] = {0.};
4418 // Statistical errors of reference flow estimates:
4419 Double_t vError[4] = {0.};
4421 for(Int_t b=0;b<4;b++)
4423 if(fMinimumBiasReferenceFlow)
4425 v[b] = fIntFlow->GetBinContent(b+1);
4426 vError[b] = fIntFlow->GetBinError(b+1);
4429 v[b] = fIntFlowRebinnedInM->GetBinContent(b+1);
4430 vError[b] = fIntFlowRebinnedInM->GetBinError(b+1);
4432 } // end of for(Int_t b=0;b<4;b++)
4434 // Fill AliFlowCommonHistResults histogram:
4435 fCommonHistsResults2nd->FillIntegratedFlow(v[0],vError[0]); // to be improved (hardwired 2nd in the name)
4436 fCommonHistsResults4th->FillIntegratedFlow(v[1],vError[1]); // to be improved (hardwired 4th in the name)
4437 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)) // to be improved (calculate also 6th and 8th order)
4439 fCommonHistsResults6th->FillIntegratedFlow(v[2],vError[2]); // to be improved (hardwired 6th in the name)
4440 fCommonHistsResults8th->FillIntegratedFlow(v[3],vError[3]); // to be improved (hardwired 8th in the name)
4443 } // end of AliFlowAnalysisWithQCumulants::FillCommonHistResultsIntFlow()
4445 //================================================================================================================================
4448 void AliFlowAnalysisWithQCumulants::ApplyCorrectionForNonUniformAcceptanceToCumulantsForIntFlow(Bool_t useParticleWeights, TString eventWeights)
4450 // apply correction for non-uniform acceptance to cumulants for integrated flow
4451 // (Remark: non-corrected cumulants are accessed from fCumulants[pW][0], corrected cumulants are stored in fCumulants[pW][1])
4453 // shortcuts for the flags:
4454 Int_t pW = (Int_t)(useParticleWeights); // 0=pWeights not used, 1=pWeights used
4457 if(eventWeights == "exact")
4462 if(!(fCumulants[pW][eW][0] && fCumulants[pW][eW][1] && fCorrections[pW][eW]))
4464 cout<<"WARNING: fCumulants[pW][eW][0] && fCumulants[pW][eW][1] && fCorrections[pW][eW] is NULL in AFAWQC::ACFNUATCFIF() !!!!"<<endl;
4465 cout<<"pW = "<<pW<<endl;
4466 cout<<"eW = "<<eW<<endl;
4470 // non-corrected cumulants:
4471 Double_t qc2 = fCumulants[pW][eW][0]->GetBinContent(1);
4472 Double_t qc4 = fCumulants[pW][eW][0]->GetBinContent(2);
4473 Double_t qc6 = fCumulants[pW][eW][0]->GetBinContent(3);
4474 Double_t qc8 = fCumulants[pW][eW][0]->GetBinContent(4);
4475 // statistical error of non-corrected cumulants:
4476 Double_t qc2Error = fCumulants[pW][eW][0]->GetBinError(1);
4477 Double_t qc4Error = fCumulants[pW][eW][0]->GetBinError(2);
4478 Double_t qc6Error = fCumulants[pW][eW][0]->GetBinError(3);
4479 Double_t qc8Error = fCumulants[pW][eW][0]->GetBinError(4);
4480 // corrections for non-uniform acceptance:
4481 Double_t qc2Correction = fCorrections[pW][eW]->GetBinContent(1);
4482 Double_t qc4Correction = fCorrections[pW][eW]->GetBinContent(2);
4483 Double_t qc6Correction = fCorrections[pW][eW]->GetBinContent(3);
4484 Double_t qc8Correction = fCorrections[pW][eW]->GetBinContent(4);
4485 // corrected cumulants:
4486 Double_t qc2Corrected = qc2 + qc2Correction;
4487 Double_t qc4Corrected = qc4 + qc4Correction;
4488 Double_t qc6Corrected = qc6 + qc6Correction;
4489 Double_t qc8Corrected = qc8 + qc8Correction;
4491 // ... to be improved (I need here also to correct error of QCs for NUA.
4492 // For simplicity sake I assume at the moment that this correction is negliglible, but it will be added eventually...)
4494 // store corrected results and statistical errors for cumulants:
4495 fCumulants[pW][eW][1]->SetBinContent(1,qc2Corrected);
4496 fCumulants[pW][eW][1]->SetBinContent(2,qc4Corrected);
4497 fCumulants[pW][eW][1]->SetBinContent(3,qc6Corrected);
4498 fCumulants[pW][eW][1]->SetBinContent(4,qc8Corrected);
4499 fCumulants[pW][eW][1]->SetBinError(1,qc2Error); // to be improved (correct also qc2Error for NUA)
4500 fCumulants[pW][eW][1]->SetBinError(2,qc4Error); // to be improved (correct also qc4Error for NUA)
4501 fCumulants[pW][eW][1]->SetBinError(3,qc6Error); // to be improved (correct also qc6Error for NUA)
4502 fCumulants[pW][eW][1]->SetBinError(4,qc8Error); // to be improved (correct also qc8Error for NUA)
4504 } // end of AliFlowAnalysisWithQCumulants::ApplyCorrectionForNonUniformAcceptanceToCumulantsForIntFlow(Bool_t useParticleWeights, TString eventWeights)
4508 //================================================================================================================================
4512 void AliFlowAnalysisWithQCumulants::PrintQuantifyingCorrectionsForNonUniformAcceptance(Bool_t useParticleWeights, TString eventWeights)
4514 // print on the screen QC{n,biased}/QC{n,corrected}
4516 // shortcuts for the flags:
4517 Int_t pW = (Int_t)(useParticleWeights); // 0=pWeights not used, 1=pWeights used
4521 if(eventWeights == "exact")
4526 if(!(fCumulants[pW][eW][0] && fCumulants[pW][eW][1]))
4528 cout<<"WARNING: fCumulants[pW][eW][0] && fCumulants[pW][eW][1] is NULL in AFAWQC::PQCFNUA() !!!!"<<endl;
4529 cout<<"pW = "<<pW<<endl;
4530 cout<<"eW = "<<eW<<endl;
4535 cout<<" Quantifying the bias to Q-cumulants from"<<endl;
4536 cout<<" non-uniform acceptance of the detector:"<<endl;
4539 if(fCumulants[pW][eW][1]->GetBinContent(1))
4541 cout<<" QC{2,biased}/QC{2,corrected} = "<<(fCumulants[pW][eW][0]->GetBinContent(1))/(fCumulants[pW][eW][1]->GetBinContent(1))<<endl;
4543 if(fCumulants[pW][eW][1]->GetBinContent(2))
4545 cout<<" QC{4,biased}/QC{4,corrected} = "<<fCumulants[pW][eW][0]->GetBinContent(2)/fCumulants[pW][eW][1]->GetBinContent(2)<<endl;
4550 } // end of AliFlowAnalysisWithQCumulants::PrintQuantifyingCorrectionsForNonUniformAcceptance(Bool_t useParticleWeights, TString eventWeights)
4554 //================================================================================================================================
4557 void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelationsUsingParticleWeights()
4559 // Calculate all correlations needed for integrated flow using particle weights.
4561 // Remark 1: When particle weights are used the binning of fIntFlowCorrelationAllPro is organized as follows:
4563 // 1st bin: <2>_{1n|1n} = two1n1nW1W1 = <w1 w2 cos(n*(phi1-phi2))>
4564 // 2nd bin: <2>_{2n|2n} = two2n2nW2W2 = <w1^2 w2^2 cos(2n*(phi1-phi2))>
4565 // 3rd bin: <2>_{3n|3n} = two3n3nW3W3 = <w1^3 w2^3 cos(3n*(phi1-phi2))>
4566 // 4th bin: <2>_{4n|4n} = two4n4nW4W4 = <w1^4 w2^4 cos(4n*(phi1-phi2))>
4567 // 5th bin: ---- EMPTY ----
4568 // 6th bin: <3>_{2n|1n,1n} = three2n1n1nW2W1W1 = <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
4569 // 7th bin: <3>_{3n|2n,1n} = ...
4570 // 8th bin: <3>_{4n|2n,2n} = ...
4571 // 9th bin: <3>_{4n|3n,1n} = ...
4572 // 10th bin: ---- EMPTY ----
4573 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1nW1W1W1W1 = <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
4574 // 12th bin: <4>_{2n,1n|2n,1n} = ...
4575 // 13th bin: <4>_{2n,2n|2n,2n} = ...
4576 // 14th bin: <4>_{3n|1n,1n,1n} = ...
4577 // 15th bin: <4>_{3n,1n|3n,1n} = ...
4578 // 16th bin: <4>_{3n,1n|2n,2n} = ...
4579 // 17th bin: <4>_{4n|2n,1n,1n} = ...
4580 // 18th bin: ---- EMPTY ----
4581 // 19th bin: <5>_{2n|1n,1n,1n,1n} = ...
4582 // 20th bin: <5>_{2n,2n|2n,1n,1n} = ...
4583 // 21st bin: <5>_{3n,1n|2n,1n,1n} = ...
4584 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = ...
4585 // 23rd bin: ---- EMPTY ----
4586 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = ...
4587 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = ...
4588 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = ...
4589 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = ...
4590 // 28th bin: ---- EMPTY ----
4591 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = ...
4592 // 30th bin: ---- EMPTY ----
4593 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = ...
4595 // Remark 2: When particle weights are used there are some extra correlations. They are stored in
4596 // fIntFlowExtraCorrelationsPro binning of which is organized as follows:
4598 // 1st bin: two1n1nW3W1 = <w1^3 w2 cos(n*(phi1-phi2))>
4599 // 2nd bin: two1n1nW1W1W2 = <w1 w2 w3^2 cos(n*(phi1-phi2))>
4601 // multiplicity (number of particles used to determine the reaction plane)
4602 Double_t dMult = (*fSMpk)(0,0);
4604 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
4605 Double_t dReQ1n1k = (*fReQ)(0,1);
4606 Double_t dReQ2n2k = (*fReQ)(1,2);
4607 Double_t dReQ3n3k = (*fReQ)(2,3);
4608 Double_t dReQ4n4k = (*fReQ)(3,4);
4609 Double_t dReQ1n3k = (*fReQ)(0,3);
4610 Double_t dImQ1n1k = (*fImQ)(0,1);
4611 Double_t dImQ2n2k = (*fImQ)(1,2);
4612 Double_t dImQ3n3k = (*fImQ)(2,3);
4613 Double_t dImQ4n4k = (*fImQ)(3,4);
4614 Double_t dImQ1n3k = (*fImQ)(0,3);
4616 // dMs are variables introduced in order to simplify some Eqs. bellow:
4617 //..............................................................................................
4618 Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
4619 Double_t dM22 = (*fSMpk)(1,2)-(*fSMpk)(0,4); // dM22 = sum_{i,j=1,i!=j}^M w_i^2 w_j^2
4620 Double_t dM33 = (*fSMpk)(1,3)-(*fSMpk)(0,6); // dM33 = sum_{i,j=1,i!=j}^M w_i^3 w_j^3
4621 Double_t dM44 = (*fSMpk)(1,4)-(*fSMpk)(0,8); // dM44 = sum_{i,j=1,i!=j}^M w_i^4 w_j^4
4622 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
4623 Double_t dM211 = (*fSMpk)(0,2)*(*fSMpk)(1,1)-2.*(*fSMpk)(0,3)*(*fSMpk)(0,1)
4624 - (*fSMpk)(1,2)+2.*(*fSMpk)(0,4); // dM211 = sum_{i,j,k=1,i!=j!=k}^M w_i^2 w_j w_k
4625 Double_t dM1111 = (*fSMpk)(3,1)-6.*(*fSMpk)(0,2)*(*fSMpk)(1,1)
4626 + 8.*(*fSMpk)(0,3)*(*fSMpk)(0,1)
4627 + 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
4628 //..............................................................................................
4630 // 2-particle correlations:
4631 Double_t two1n1nW1W1 = 0.; // <w1 w2 cos(n*(phi1-phi2))>
4632 Double_t two2n2nW2W2 = 0.; // <w1^2 w2^2 cos(2n*(phi1-phi2))>
4633 Double_t two3n3nW3W3 = 0.; // <w1^3 w2^3 cos(3n*(phi1-phi2))>
4634 Double_t two4n4nW4W4 = 0.; // <w1^4 w2^4 cos(4n*(phi1-phi2))>
4639 two1n1nW1W1 = (pow(dReQ1n1k,2)+pow(dImQ1n1k,2)-(*fSMpk)(0,2))/dM11;
4640 // average correlation <w1 w2 cos(n*(phi1-phi2))> for single event:
4641 fIntFlowCorrelationsEBE->SetBinContent(1,two1n1nW1W1);
4642 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(1,dM11);
4643 // average correlation <w1 w2 cos(n*(phi1-phi2))> for all events:
4644 fIntFlowCorrelationsPro->Fill(0.5,two1n1nW1W1,dM11);
4645 fIntFlowCorrelationsAllPro->Fill(0.5,two1n1nW1W1,dM11);
4649 two2n2nW2W2 = (pow(dReQ2n2k,2)+pow(dImQ2n2k,2)-(*fSMpk)(0,4))/dM22;
4651 // average correlation <w1^2 w2^2 cos(2n*(phi1-phi2))> for all events:
4652 fIntFlowCorrelationsAllPro->Fill(1.5,two2n2nW2W2,dM22);
4656 two3n3nW3W3 = (pow(dReQ3n3k,2)+pow(dImQ3n3k,2)-(*fSMpk)(0,6))/dM33;
4658 // average correlation <w1^3 w2^3 cos(3n*(phi1-phi2))> for all events:
4659 fIntFlowCorrelationsAllPro->Fill(2.5,two3n3nW3W3,dM33);
4663 two4n4nW4W4 = (pow(dReQ4n4k,2)+pow(dImQ4n4k,2)-(*fSMpk)(0,8))/dM44;
4665 // average correlation <w1^4 w2^4 cos(4n*(phi1-phi2))> for all events:
4666 fIntFlowCorrelationsAllPro->Fill(3.5,two4n4nW4W4,dM44);
4668 } // end of if(dMult>1)
4670 // extra 2-particle correlations:
4671 Double_t two1n1nW3W1 = 0.; // <w1^3 w2 cos(n*(phi1-phi2))>
4672 Double_t two1n1nW1W1W2 = 0.; // <w1 w2 w3^2 cos(n*(phi1-phi2))>
4677 two1n1nW3W1 = (dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k-(*fSMpk)(0,4))/dM31;
4678 fIntFlowExtraCorrelationsPro->Fill(0.5,two1n1nW3W1,dM31);
4682 two1n1nW1W1W2 = ((*fSMpk)(0,2)*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2)-(*fSMpk)(0,2))
4683 - 2.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k
4684 - (*fSMpk)(0,4)))/dM211;
4685 fIntFlowExtraCorrelationsPro->Fill(1.5,two1n1nW1W1W2,dM211);
4687 } // end of if(dMult>1)
4688 //..............................................................................................
4690 //..............................................................................................
4691 // 3-particle correlations:
4692 Double_t three2n1n1nW2W1W1 = 0.; // <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
4698 three2n1n1nW2W1W1 = (pow(dReQ1n1k,2.)*dReQ2n2k+2.*dReQ1n1k*dImQ1n1k*dImQ2n2k-pow(dImQ1n1k,2.)*dReQ2n2k
4699 - 2.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k)
4700 - pow(dReQ2n2k,2)-pow(dImQ2n2k,2)
4701 + 2.*(*fSMpk)(0,4))/dM211;
4702 fIntFlowCorrelationsAllPro->Fill(5.5,three2n1n1nW2W1W1,dM211);
4704 } // end of if(dMult>2)
4705 //..............................................................................................
4707 //..............................................................................................
4708 // 4-particle correlations:
4709 Double_t four1n1n1n1nW1W1W1W1 = 0.; // <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
4714 four1n1n1n1nW1W1W1W1 = (pow(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.),2)
4715 - 2.*(pow(dReQ1n1k,2.)*dReQ2n2k+2.*dReQ1n1k*dImQ1n1k*dImQ2n2k-pow(dImQ1n1k,2.)*dReQ2n2k)
4716 + 8.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k)
4717 + (pow(dReQ2n2k,2)+pow(dImQ2n2k,2))
4718 - 4.*(*fSMpk)(0,2)*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
4719 - 6.*(*fSMpk)(0,4)+2.*(*fSMpk)(1,2))/dM1111;
4721 // average correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for single event:
4722 fIntFlowCorrelationsEBE->SetBinContent(2,four1n1n1n1nW1W1W1W1);
4723 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(2,dM1111);
4724 // average correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for all events:
4725 fIntFlowCorrelationsPro->Fill(1.5,four1n1n1n1nW1W1W1W1,dM1111);
4726 fIntFlowCorrelationsAllPro->Fill(10.5,four1n1n1n1nW1W1W1W1,dM1111);
4728 } // end of if(dMult>3)
4729 //..............................................................................................
4731 } // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelationsUsingParticleWeights()
4734 //================================================================================================================================
4737 void AliFlowAnalysisWithQCumulants::CalculateWeightedQProductsForIntFlow() // to be improved (completed)
4739 // calculate averages like <<2><4>>, <<2><6>>, <<4><6>>, etc. which are needed to calculate covariances
4740 // Remark: here we take weighted correlations!
4744 // binning of fQProductsW is organized as follows:
4753 Double_t dMult = (*fSMpk)(0,0); // multiplicity (number of particles used to determine the reaction plane)
4755 Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
4756 Double_t dM1111 = (*fSMpk)(3,1)-6.*(*fSMpk)(0,2)*(*fSMpk)(1,1)
4757 + 8.*(*fSMpk)(0,3)*(*fSMpk)(0,1)
4758 + 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
4760 Double_t twoEBEW = 0.; // <2>
4761 Double_t fourEBEW = 0.; // <4>
4763 twoEBEW = fQCorrelationsEBE[1]->GetBinContent(1);
4764 fourEBEW = fQCorrelationsEBE[1]->GetBinContent(11);
4769 fQProducts[1][0]->Fill(0.5,twoEBEW*fourEBEW,dM11*dM1111);
4774 } // end of AliFlowAnalysisWithQCumulants::CalculateWeightedQProductsForIntFlow()
4777 //================================================================================================================================
4780 void AliFlowAnalysisWithQCumulants::InitializeArraysForIntFlow()
4782 // Initialize all arrays used to calculate integrated flow.
4784 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
4786 fIntFlowCorrectionTermsForNUAEBE[sc] = NULL;
4787 fIntFlowEventWeightForCorrectionTermsForNUAEBE[sc] = NULL;
4788 fIntFlowCorrectionTermsForNUAPro[sc] = NULL;
4789 fIntFlowCorrectionTermsForNUAHist[sc] = NULL;
4790 for(Int_t ci=0;ci<4;ci++) // correction term index
4792 fIntFlowCorrectionTermsForNUAVsMPro[sc][ci] = NULL;
4794 for(Int_t power=0;power<2;power++) // linear or quadratic
4796 fIntFlowSumOfEventWeightsNUA[sc][power] = NULL;
4799 for(Int_t power=0;power<2;power++) // linear or quadratic
4801 fIntFlowSumOfEventWeights[power] = NULL;
4803 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))
4805 fPrintFinalResults[i] = kTRUE;
4807 for(Int_t ci=0;ci<4;ci++) // correlation index or cumulant order
4809 fIntFlowCorrelationsVsMPro[ci] = NULL;
4810 fIntFlowCorrelationsVsMHist[ci] = NULL;
4811 fIntFlowQcumulantsVsM[ci] = NULL;
4812 fIntFlowVsM[ci] = NULL;
4813 fIntFlowDetectorBiasVsM[ci] = NULL;
4814 for(Int_t lc=0;lc<2;lc++)
4816 fIntFlowSumOfEventWeightsVsM[ci][lc] = NULL;
4819 for(Int_t pi=0;pi<6;pi++) // product or covariance index
4821 fIntFlowProductOfCorrelationsVsMPro[pi] = NULL;
4822 fIntFlowCovariancesVsM[pi] = NULL;
4823 fIntFlowSumOfProductOfEventWeightsVsM[pi] = NULL;
4826 } // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForIntFlow()
4828 //================================================================================================================================
4830 void AliFlowAnalysisWithQCumulants::InitializeArraysForDiffFlow()
4832 // Initialize all arrays needed to calculate differential flow.
4833 // a) Initialize lists holding profiles;
4834 // b) Initialize lists holding histograms;
4835 // c) Initialize event-by-event quantities;
4836 // d) Initialize profiles;
4837 // e) Initialize histograms holding final results.
4839 // a) Initialize lists holding profiles;
4840 for(Int_t t=0;t<2;t++) // type (RP, POI)
4842 for(Int_t pe=0;pe<2;pe++) // pt or eta
4844 fDiffFlowCorrelationsProList[t][pe] = NULL;
4845 fDiffFlowProductOfCorrelationsProList[t][pe] = NULL;
4846 fDiffFlowCorrectionsProList[t][pe] = NULL;
4850 // b) Initialize lists holding histograms;
4851 for(Int_t t=0;t<2;t++) // type (RP, POI)
4853 for(Int_t pe=0;pe<2;pe++) // pt or eta
4855 fDiffFlowCorrelationsHistList[t][pe] = NULL;
4856 for(Int_t power=0;power<2;power++)
4858 fDiffFlowSumOfEventWeightsHistList[t][pe][power] = NULL;
4859 } // end of for(Int_t power=0;power<2;power++)
4860 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe] = NULL;
4861 fDiffFlowCorrectionsHistList[t][pe] = NULL;
4862 fDiffFlowCovariancesHistList[t][pe] = NULL;
4863 fDiffFlowCumulantsHistList[t][pe] = NULL;
4864 fDiffFlowHistList[t][pe] = NULL;
4865 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
4866 } // enf of for(Int_t t=0;t<2;t++) // type (RP, POI)
4868 // c) Initialize event-by-event quantities:
4870 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
4872 for(Int_t pe=0;pe<2;pe++) // pt or eta
4874 for(Int_t m=0;m<4;m++) // multiple of harmonic
4876 for(Int_t k=0;k<9;k++) // power of weight
4878 fReRPQ1dEBE[t][pe][m][k] = NULL;
4879 fImRPQ1dEBE[t][pe][m][k] = NULL;
4880 fs1dEBE[t][pe][k] = NULL; // to be improved (this doesn't need to be within loop over m)
4886 for(Int_t t=0;t<2;t++) // type (RP or POI)
4888 for(Int_t pe=0;pe<2;pe++) // pt or eta
4890 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
4892 for(Int_t cti=0;cti<9;cti++) // correction term index
4894 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti] = NULL;
4900 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
4902 for(Int_t m=0;m<4;m++) // multiple of harmonic
4904 for(Int_t k=0;k<9;k++) // power of weight
4906 fReRPQ2dEBE[t][m][k] = NULL;
4907 fImRPQ2dEBE[t][m][k] = NULL;
4908 fs2dEBE[t][k] = NULL; // to be improved (this doesn't need to be within loop over m)
4913 // d) Initialize profiles:
4914 for(Int_t t=0;t<2;t++) // type: RP or POI
4916 for(Int_t pe=0;pe<2;pe++) // pt or eta
4918 for(Int_t ci=0;ci<4;ci++) // correlation index
4920 fDiffFlowCorrelationsPro[t][pe][ci] = NULL;
4921 } // end of for(Int_t ci=0;ci<4;ci++)
4922 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
4924 for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index
4926 fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2] = NULL;
4927 } // end of for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index
4928 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
4929 // correction terms for nua:
4930 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
4932 for(Int_t cti=0;cti<9;cti++) // correction term index
4934 fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti] = NULL;
4937 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
4938 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
4940 // e) Initialize histograms holding final results.
4941 for(Int_t t=0;t<2;t++) // type: RP or POI
4943 for(Int_t pe=0;pe<2;pe++) // pt or eta
4945 for(Int_t ci=0;ci<4;ci++) // correlation index
4947 fDiffFlowCorrelationsHist[t][pe][ci] = NULL;
4948 fDiffFlowCumulants[t][pe][ci] = NULL;
4949 fDiffFlow[t][pe][ci] = NULL;
4950 } // end of for(Int_t ci=0;ci<4;ci++)
4951 for(Int_t covarianceIndex=0;covarianceIndex<5;covarianceIndex++)
4953 fDiffFlowCovariances[t][pe][covarianceIndex] = NULL;
4954 } // end of for(Int_t covarianceIndex=0;covarianceIndex<5;covarianceIndex++)
4955 // correction terms for nua:
4956 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
4958 for(Int_t cti=0;cti<9;cti++) // correction term index
4960 fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti] = NULL;
4963 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
4964 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
4966 // sum of event weights for reduced correlations:
4967 for(Int_t t=0;t<2;t++) // type = RP or POI
4969 for(Int_t pe=0;pe<2;pe++) // pt or eta
4971 for(Int_t p=0;p<2;p++) // power of weight is 1 or 2
4973 for(Int_t ew=0;ew<4;ew++) // event weight index for reduced correlations
4975 fDiffFlowSumOfEventWeights[t][pe][p][ew] = NULL;
4980 // product of event weights for both types of correlations:
4981 for(Int_t t=0;t<2;t++) // type = RP or POI
4983 for(Int_t pe=0;pe<2;pe++) // pt or eta
4985 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
4987 for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index
4989 fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2] = NULL;
5000 // nested lists in fDiffFlowProfiles:
5001 for(Int_t t=0;t<2;t++)
5004 for(Int_t pW=0;pW<2;pW++) // particle weights not used (0) or used (1)
5006 fDFPParticleWeights[t][pW] = NULL;
5007 for(Int_t eW=0;eW<2;eW++)
5009 fDFPEventWeights[t][pW][eW] = NULL;
5010 fDiffFlowCorrelations[t][pW][eW] = NULL;
5011 fDiffFlowProductsOfCorrelations[t][pW][eW] = NULL;
5012 for(Int_t sc=0;sc<2;sc++)
5014 fDiffFlowCorrectionTerms[t][pW][eW][sc] = NULL;
5026 for(Int_t pW=0;pW<2;pW++) // particle weights not used (0) or used (1)
5028 for(Int_t eW=0;eW<2;eW++)
5031 for(Int_t correlationIndex=0;correlationIndex<4;correlationIndex++)
5033 fCorrelationsPro[t][pW][eW][correlationIndex] = NULL;
5035 // products of correlations:
5036 for(Int_t productOfCorrelationsIndex=0;productOfCorrelationsIndex<6;productOfCorrelationsIndex++)
5038 fProductsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex] = NULL;
5040 // correction terms:
5041 for(Int_t sc=0;sc<2;sc++)
5043 for(Int_t correctionsIndex=0;correctionsIndex<2;correctionsIndex++)
5045 fCorrectionTermsPro[t][pW][eW][sc][correctionsIndex] = NULL;
5052 } // end of AliFlowAnalysisWithQCumulants::InitializeArraysForDiffFlow()
5055 //================================================================================================================================
5059 void AliFlowAnalysisWithQCumulants::CalculateCorrelationsForDifferentialFlow2D(TString type)
5061 // calculate all reduced correlations needed for differential flow for each (pt,eta) bin:
5063 if(type == "RP") // to be improved (removed)
5070 Int_t typeFlag = -1;
5072 // reduced correlations ares stored in fCorrelationsPro[t][pW][index] and are indexed as follows:
5078 Double_t dMult = (*fSMpk)(0,0);
5080 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
5081 Double_t dReQ1n = (*fReQ)(0,0);
5082 Double_t dReQ2n = (*fReQ)(1,0);
5083 //Double_t dReQ3n = (*fReQ)(2,0);
5084 //Double_t dReQ4n = (*fReQ)(3,0);
5085 Double_t dImQ1n = (*fImQ)(0,0);
5086 Double_t dImQ2n = (*fImQ)(1,0);
5087 //Double_t dImQ3n = (*fImQ)(2,0);
5088 //Double_t dImQ4n = (*fImQ)(3,0);
5090 // looping over all (pt,eta) bins and calculating correlations needed for differential flow:
5091 for(Int_t p=1;p<=fnBinsPt;p++)
5093 for(Int_t e=1;e<=fnBinsEta;e++)
5095 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin):
5096 Double_t p1n0kRe = 0.;
5097 Double_t p1n0kIm = 0.;
5099 // number of POIs in particular (pt,eta) bin:
5102 // 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):
5103 Double_t q1n0kRe = 0.;
5104 Double_t q1n0kIm = 0.;
5105 Double_t q2n0kRe = 0.;
5106 Double_t q2n0kIm = 0.;
5108 // number of particles which are both RPs and POIs in particular (pt,eta) bin:
5112 q1n0kRe = fReEBE2D[2][0][0]->GetBinContent(fReEBE2D[2][0][0]->GetBin(p,e))
5113 * fReEBE2D[2][0][0]->GetBinEntries(fReEBE2D[2][0][0]->GetBin(p,e));
5114 q1n0kIm = fImEBE2D[2][0][0]->GetBinContent(fImEBE2D[2][0][0]->GetBin(p,e))
5115 * fImEBE2D[2][0][0]->GetBinEntries(fImEBE2D[2][0][0]->GetBin(p,e));
5116 q2n0kRe = fReEBE2D[2][1][0]->GetBinContent(fReEBE2D[2][1][0]->GetBin(p,e))
5117 * fReEBE2D[2][1][0]->GetBinEntries(fReEBE2D[2][1][0]->GetBin(p,e));
5118 q2n0kIm = fImEBE2D[2][1][0]->GetBinContent(fImEBE2D[2][1][0]->GetBin(p,e))
5119 * fImEBE2D[2][1][0]->GetBinEntries(fImEBE2D[2][1][0]->GetBin(p,e));
5121 mq = fReEBE2D[2][0][0]->GetBinEntries(fReEBE2D[2][0][0]->GetBin(p,e)); // to be improved (cross-checked by accessing other profiles here)
5126 p1n0kRe = fReEBE2D[1][0][0]->GetBinContent(fReEBE2D[1][0][0]->GetBin(p,e))
5127 * fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e));
5128 p1n0kIm = fImEBE2D[1][0][0]->GetBinContent(fImEBE2D[1][0][0]->GetBin(p,e))
5129 * fImEBE2D[1][0][0]->GetBinEntries(fImEBE2D[1][0][0]->GetBin(p,e));
5131 mp = fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e)); // to be improved (cross-checked by accessing other profiles here)
5135 else if(type == "RP")
5137 // p_{m*n,0} = q_{m*n,0}:
5145 // count events with non-empty (pt,eta) bin:
5148 fNonEmptyBins2D[typeFlag]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,1);
5151 // 2'-particle correlation for particular (pt,eta) bin:
5152 Double_t two1n1nPtEta = 0.;
5155 two1n1nPtEta = (p1n0kRe*dReQ1n+p1n0kIm*dImQ1n-mq)
5158 // fill the 2D profile to get the average correlation for each (pt,eta) bin:
5161 //f2pPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);
5163 fCorrelationsPro[1][0][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);
5165 else if(type == "RP")
5167 //f2pPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);
5168 fCorrelationsPro[0][0][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);
5170 } // end of if(mp*dMult-mq)
5172 // 4'-particle correlation:
5173 Double_t four1n1n1n1nPtEta = 0.;
5174 if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5175 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)
5177 four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
5178 - q2n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))
5179 - 2.*q2n0kIm*dReQ1n*dImQ1n
5180 - p1n0kRe*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)
5181 + p1n0kIm*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)
5182 - 2.*dMult*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
5183 - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*mq
5184 + 6.*(q1n0kRe*dReQ1n+q1n0kIm*dImQ1n)
5185 + 1.*(q2n0kRe*dReQ2n+q2n0kIm*dImQ2n)
5186 + 2.*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
5189 / ((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5190 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
5192 // fill the 2D profile to get the average correlation for each (pt, eta) bin:
5195 //f4pPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
5196 // (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5197 // + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
5199 fCorrelationsPro[1][0][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
5200 (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5201 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
5203 else if(type == "RP")
5205 //f4pPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
5206 // (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5207 // + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
5209 fCorrelationsPro[0][0][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
5210 (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5211 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
5213 } // end of if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5214 // +mq*(dMult-1.)*(dMult-2.)*(dMult-3.))
5216 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
5217 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5223 } // end of AliFlowAnalysisWithQCumulants::CalculateCorrelationsForDifferentialFlow2D()
5230 //================================================================================================================================
5233 void AliFlowAnalysisWithQCumulants::CalculateWeightedCorrelationsForDifferentialFlow2D(TString type)
5235 // calculate all weighted correlations needed for differential flow
5237 if(type == "RP") // to be improved (removed)
5246 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
5247 Double_t dReQ1n1k = (*fReQ)(0,1);
5248 Double_t dReQ2n2k = (*fReQ)(1,2);
5249 Double_t dReQ1n3k = (*fReQ)(0,3);
5250 //Double_t dReQ4n4k = (*fReQ)(3,4);
5251 Double_t dImQ1n1k = (*fImQ)(0,1);
5252 Double_t dImQ2n2k = (*fImQ)(1,2);
5253 Double_t dImQ1n3k = (*fImQ)(0,3);
5254 //Double_t dImQ4n4k = (*fImQ)(3,4);
5256 // S^M_{p,k} (see .h file for the definition of fSMpk):
5257 Double_t dSM1p1k = (*fSMpk)(0,1);
5258 Double_t dSM1p2k = (*fSMpk)(0,2);
5259 Double_t dSM1p3k = (*fSMpk)(0,3);
5260 Double_t dSM2p1k = (*fSMpk)(1,1);
5261 Double_t dSM3p1k = (*fSMpk)(2,1);
5263 // looping over all (pt,eta) bins and calculating weighted correlations needed for differential flow:
5264 for(Int_t p=1;p<=fnBinsPt;p++)
5266 for(Int_t e=1;e<=fnBinsEta;e++)
5268 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin):
5269 Double_t p1n0kRe = 0.;
5270 Double_t p1n0kIm = 0.;
5272 // number of POIs in particular (pt,eta) bin):
5275 // real and imaginary parts of q_{m*n,k}:
5276 // (weighted Q-vector evaluated for particles which are both RPs and POIs in particular (pt,eta) bin)
5277 Double_t q1n2kRe = 0.;
5278 Double_t q1n2kIm = 0.;
5279 Double_t q2n1kRe = 0.;
5280 Double_t q2n1kIm = 0.;
5282 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
5283 Double_t s1p1k = 0.;
5284 Double_t s1p2k = 0.;
5285 Double_t s1p3k = 0.;
5287 // M0111 from Eq. (118) in QC2c (to be improved (notation))
5288 Double_t dM0111 = 0.;
5293 p1n0kRe = fReEBE2D[1][0][0]->GetBinContent(fReEBE2D[1][0][0]->GetBin(p,e))
5294 * fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e));
5295 p1n0kIm = fImEBE2D[1][0][0]->GetBinContent(fImEBE2D[1][0][0]->GetBin(p,e))
5296 * fImEBE2D[1][0][0]->GetBinEntries(fImEBE2D[1][0][0]->GetBin(p,e));
5298 mp = fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e));
5301 q1n2kRe = fReEBE2D[2][0][2]->GetBinContent(fReEBE2D[2][0][2]->GetBin(p,e))
5302 * fReEBE2D[2][0][2]->GetBinEntries(fReEBE2D[2][0][2]->GetBin(p,e));
5303 q1n2kIm = fImEBE2D[2][0][2]->GetBinContent(fImEBE2D[2][0][2]->GetBin(p,e))
5304 * fImEBE2D[2][0][2]->GetBinEntries(fImEBE2D[2][0][2]->GetBin(p,e));
5305 q2n1kRe = fReEBE2D[2][1][1]->GetBinContent(fReEBE2D[2][1][1]->GetBin(p,e))
5306 * fReEBE2D[2][1][1]->GetBinEntries(fReEBE2D[2][1][1]->GetBin(p,e));
5307 q2n1kIm = fImEBE2D[2][1][1]->GetBinContent(fImEBE2D[2][1][1]->GetBin(p,e))
5308 * fImEBE2D[2][1][1]->GetBinEntries(fImEBE2D[2][1][1]->GetBin(p,e));
5310 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
5311 s1p1k = pow(fs2D[2][1]->GetBinContent(fs2D[2][1]->GetBin(p,e)),1.);
5312 s1p2k = pow(fs2D[2][2]->GetBinContent(fs2D[2][2]->GetBin(p,e)),1.);
5313 s1p3k = pow(fs2D[2][3]->GetBinContent(fs2D[2][3]->GetBin(p,e)),1.);
5315 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
5316 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
5317 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
5318 + 2.*(s1p3k-s1p2k*dSM1p1k));
5320 else if(type == "RP")
5322 p1n0kRe = fReEBE2D[0][0][0]->GetBinContent(fReEBE2D[0][0][0]->GetBin(p,e))
5323 * fReEBE2D[0][0][0]->GetBinEntries(fReEBE2D[0][0][0]->GetBin(p,e));
5324 p1n0kIm = fImEBE2D[0][0][0]->GetBinContent(fImEBE2D[0][0][0]->GetBin(p,e))
5325 * fImEBE2D[0][0][0]->GetBinEntries(fImEBE2D[0][0][0]->GetBin(p,e));
5327 mp = fReEBE2D[0][0][0]->GetBinEntries(fReEBE2D[0][0][0]->GetBin(p,e));
5330 q1n2kRe = fReEBE2D[0][0][2]->GetBinContent(fReEBE2D[0][0][2]->GetBin(p,e))
5331 * fReEBE2D[0][0][2]->GetBinEntries(fReEBE2D[0][0][2]->GetBin(p,e));
5332 q1n2kIm = fImEBE2D[0][0][2]->GetBinContent(fImEBE2D[0][0][2]->GetBin(p,e))
5333 * fImEBE2D[0][0][2]->GetBinEntries(fImEBE2D[0][0][2]->GetBin(p,e));
5334 q2n1kRe = fReEBE2D[0][1][1]->GetBinContent(fReEBE2D[0][1][1]->GetBin(p,e))
5335 * fReEBE2D[0][1][1]->GetBinEntries(fReEBE2D[0][1][1]->GetBin(p,e));
5336 q2n1kIm = fImEBE2D[0][1][1]->GetBinContent(fImEBE2D[0][1][1]->GetBin(p,e))
5337 * fImEBE2D[0][1][1]->GetBinEntries(fImEBE2D[0][1][1]->GetBin(p,e));
5339 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
5340 s1p1k = pow(fs2D[0][1]->GetBinContent(fs2D[0][1]->GetBin(p,e)),1.);
5341 s1p2k = pow(fs2D[0][2]->GetBinContent(fs2D[0][2]->GetBin(p,e)),1.);
5342 s1p3k = pow(fs2D[0][3]->GetBinContent(fs2D[0][3]->GetBin(p,e)),1.);
5344 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
5345 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
5346 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
5347 + 2.*(s1p3k-s1p2k*dSM1p1k));
5348 //...............................................................................................
5351 // 2'-particle correlation:
5352 Double_t two1n1nW0W1PtEta = 0.;
5353 if(mp*dSM1p1k-s1p1k)
5355 two1n1nW0W1PtEta = (p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k-s1p1k)
5356 / (mp*dSM1p1k-s1p1k);
5358 // fill the 2D profile to get the average correlation for each (pt, eta) bin:
5361 //f2pPtEtaPOIW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,
5362 // mp*dSM1p1k-s1p1k);
5363 fCorrelationsPro[1][1][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,mp*dSM1p1k-s1p1k);
5365 else if(type == "RP")
5367 //f2pPtEtaRPW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,
5368 // mp*dSM1p1k-s1p1k);
5369 fCorrelationsPro[0][1][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,mp*dSM1p1k-s1p1k);
5371 } // end of if(mp*dMult-dmPrimePrimePtEta)
5373 // 4'-particle correlation:
5374 Double_t four1n1n1n1nW0W1W1W1PtEta = 0.;
5377 four1n1n1n1nW0W1W1W1PtEta = ((pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
5378 - q2n1kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))
5379 - 2.*q2n1kIm*dReQ1n1k*dImQ1n1k
5380 - p1n0kRe*(dReQ1n1k*dReQ2n2k+dImQ1n1k*dImQ2n2k)
5381 + p1n0kIm*(dImQ1n1k*dReQ2n2k-dReQ1n1k*dImQ2n2k)
5382 - 2.*dSM1p2k*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
5383 - 2.*(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*s1p1k
5384 + 6.*(q1n2kRe*dReQ1n1k+q1n2kIm*dImQ1n1k)
5385 + 1.*(q2n1kRe*dReQ2n2k+q2n1kIm*dImQ2n2k)
5386 + 2.*(p1n0kRe*dReQ1n3k+p1n0kIm*dImQ1n3k)
5389 / dM0111; // to be imropoved (notation of dM0111)
5391 // fill the 2D profile to get the average correlation for each (pt, eta) bin:
5394 //f4pPtEtaPOIW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);
5395 fCorrelationsPro[1][1][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);
5397 else if(type == "RP")
5399 //f4pPtEtaRPW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);
5400 fCorrelationsPro[0][1][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);
5402 } // end of if(dM0111)
5404 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
5405 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5410 } // end of AliFlowAnalysisWithQCumulants::CalculateWeightedCorrelationsForDifferentialFlow2D(TString type)
5413 //================================================================================================================================
5418 void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsForDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights)
5420 // 1.) Access average for 2D correlations from profiles and store them in 2D final results histograms;
5421 // 2.) Access spread for 2D correlations from profiles, calculate error and store it in 2D final results histograms;
5422 // 3.) Make projections along pt and eta axis and store results and errors in 1D final results histograms.
5424 Int_t typeFlag = -1;
5425 Int_t pWeightsFlag = -1;
5426 Int_t eWeightsFlag = -1;
5431 } else if(type == "POI")
5436 cout<<"WARNING: type must be either RP or POI in AFAWQC::FCFDF() !!!!"<<endl;
5440 if(!useParticleWeights)
5448 if(eventWeights == "exact")
5455 Int_t pW = pWeightsFlag;
5456 Int_t eW = eWeightsFlag;
5458 // from 2D histogram fNonEmptyBins2D make two 1D histograms fNonEmptyBins1D in pt and eta (to be improved (i.e. moved somewhere else))
5460 for(Int_t p=1;p<fnBinsPt;p++)
5462 Double_t contentPt = 0.;
5463 for(Int_t e=1;e<=fnBinsEta;e++)
5465 contentPt += (fNonEmptyBins2D[t]->GetBinContent(fNonEmptyBins2D[t]->GetBin(p,e)));
5467 fNonEmptyBins1D[t][0]->SetBinContent(p,contentPt);
5470 for(Int_t e=1;e<fnBinsEta;e++)
5472 Double_t contentEta = 0.;
5473 for(Int_t p=1;p<=fnBinsPt;p++)
5475 contentEta += (fNonEmptyBins2D[t]->GetBinContent(fNonEmptyBins2D[t]->GetBin(p,e)));
5477 fNonEmptyBins1D[t][1]->SetBinContent(e,contentEta);
5480 // from 2D profile in (pt,eta) make two 1D profiles in (pt) and (eta):
5481 TProfile *profile[2][4]; // [0=pt,1=eta][correlation index] // to be improved (do not hardwire the correlation index)
5483 for(Int_t pe=0;pe<2;pe++) // pt or eta
5485 for(Int_t ci=0;ci<4;ci++) // correlation index
5487 if(pe==0) profile[pe][ci] = this->MakePtProjection(fCorrelationsPro[t][pW][eW][ci]);
5488 if(pe==1) profile[pe][ci] = this->MakeEtaProjection(fCorrelationsPro[t][pW][eW][ci]);
5492 // transfer 2D profile into 2D histogram:
5493 // to be improved (see in documentation if there is a method to transfer values from 2D profile into 2D histogram)
5494 for(Int_t ci=0;ci<4;ci++)
5496 for(Int_t p=1;p<=fnBinsPt;p++)
5498 for(Int_t e=1;e<=fnBinsEta;e++)
5500 Double_t correlation = fCorrelationsPro[t][pW][eW][ci]->GetBinContent(fCorrelationsPro[t][pW][eW][ci]->GetBin(p,e));
5501 Double_t spread = fCorrelationsPro[t][pW][eW][ci]->GetBinError(fCorrelationsPro[t][pW][eW][ci]->GetBin(p,e));
5502 Double_t nEvts = fNonEmptyBins2D[t]->GetBinContent(fNonEmptyBins2D[t]->GetBin(p,e));
5503 Double_t error = 0.;
5504 fFinalCorrelations2D[t][pW][eW][ci]->SetBinContent(fFinalCorrelations2D[t][pW][eW][ci]->GetBin(p,e),correlation);
5507 error = spread/pow(nEvts,0.5);
5508 fFinalCorrelations2D[t][pW][eW][ci]->SetBinError(fFinalCorrelations2D[t][pW][eW][ci]->GetBin(p,e),error);
5510 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
5511 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5512 } // end of for(Int_t ci=0;ci<4;ci++)
5514 // transfer 1D profile into 1D histogram (pt):
5515 // to be improved (see in documentation if there is a method to transfer values from 1D profile into 1D histogram)
5516 for(Int_t ci=0;ci<4;ci++)
5518 for(Int_t p=1;p<=fnBinsPt;p++)
5522 Double_t correlation = profile[0][ci]->GetBinContent(p);
5523 Double_t spread = profile[0][ci]->GetBinError(p);
5524 Double_t nEvts = fNonEmptyBins1D[t][0]->GetBinContent(p);
5525 Double_t error = 0.;
5526 fFinalCorrelations1D[t][pW][eW][0][ci]->SetBinContent(p,correlation);
5529 error = spread/pow(nEvts,0.5);
5530 fFinalCorrelations1D[t][pW][eW][0][ci]->SetBinError(p,error);
5533 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5534 } // end of for(Int_t ci=0;ci<4;ci++)
5536 // transfer 1D profile into 1D histogram (eta):
5537 // to be improved (see in documentation if there is a method to transfer values from 1D profile into 1D histogram)
5538 for(Int_t ci=0;ci<4;ci++)
5540 for(Int_t e=1;e<=fnBinsEta;e++)
5544 Double_t correlation = profile[1][ci]->GetBinContent(e);
5545 fFinalCorrelations1D[t][pW][eW][1][ci]->SetBinContent(e,correlation);
5547 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
5548 } // end of for(Int_t ci=0;ci<4;ci++)
5550 } // end of void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsForDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights)
5554 //================================================================================================================================
5557 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulants(TString type, TString ptOrEta)
5559 // calcualate cumulants for differential flow from measured correlations
5560 // Remark: cumulants calculated here are NOT corrected for non-uniform acceptance. This correction is applied in the method ...
5561 // to be improved (description)
5563 Int_t typeFlag = -1;
5564 Int_t ptEtaFlag = -1;
5569 } else if(type == "POI")
5577 } else if(ptOrEta == "Eta")
5584 Int_t pe = ptEtaFlag;
5587 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
5589 // correlation <<2>>:
5590 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1);
5593 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
5595 // reduced correlations:
5596 Double_t twoPrime = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b); // <<2'>>(pt)
5597 Double_t fourPrime = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b); // <<4'>>(pt)
5598 // final statistical error of reduced correlations:
5599 //Double_t twoPrimeError = fFinalCorrelations1D[t][pW][eW][0][0]->GetBinError(p);
5601 Double_t qc2Prime = twoPrime; // QC{2'}
5602 //Double_t qc2PrimeError = twoPrimeError; // final stat. error of QC{2'}
5603 fDiffFlowCumulants[t][pe][0]->SetBinContent(b,qc2Prime);
5604 //fFinalCumulantsPt[t][pW][eW][nua][0]->SetBinError(p,qc2PrimeError);
5606 Double_t qc4Prime = fourPrime - 2.*twoPrime*two; // QC{4'} = <<4'>> - 2*<<2'>><<2>>
5607 fDiffFlowCumulants[t][pe][1]->SetBinContent(b,qc4Prime);
5608 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5613 // to be improved (see documentation if I can do all this without looping)
5614 for(Int_t p=1;p<=fnBinsPt;p++)
5616 for(Int_t e=1;e<=fnBinsEta;e++)
5618 // reduced correlations:
5619 Double_t twoPrime = fFinalCorrelations2D[t][pW][eW][0]->GetBinContent(fFinalCorrelations2D[t][pW][eW][0]->GetBin(p,e)); // <<2'>>(pt,eta)
5620 Double_t fourPrime = fFinalCorrelations2D[t][pW][eW][1]->GetBinContent(fFinalCorrelations2D[t][pW][eW][1]->GetBin(p,e)); // <<4'>>(pt,eta)
5621 for(Int_t nua=0;nua<2;nua++)
5624 Double_t qc2Prime = twoPrime; // QC{2'} = <<2'>>
5625 fFinalCumulants2D[t][pW][eW][nua][0]->SetBinContent(fFinalCumulants2D[t][pW][eW][nua][0]->GetBin(p,e),qc2Prime);
5627 Double_t qc4Prime = fourPrime - 2.*twoPrime*two; // QC{4'} = <<4'>> - 2*<<2'>><<2>>
5628 fFinalCumulants2D[t][pW][eW][nua][1]->SetBinContent(fFinalCumulants2D[t][pW][eW][nua][1]->GetBin(p,e),qc4Prime);
5629 } // end of for(Int_t nua=0;nua<2;nua++)
5630 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
5631 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5634 } // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulants(TString type, Bool_t useParticleWeights, TString eventWeights);
5637 //================================================================================================================================
5640 void AliFlowAnalysisWithQCumulants::CalculateFinalResultsForRPandPOIIntegratedFlow(TString type)
5642 // calculate final results for integrated flow of RPs and POIs
5644 Int_t typeFlag = -1;
5649 } else if(type == "POI")
5654 cout<<"WARNING: type must be either RP or POI in AFAWQC::CDF() !!!!"<<endl;
5662 TH1F *yield2ndPt = NULL;
5663 TH1F *yield4thPt = NULL;
5664 TH1F *yield6thPt = NULL;
5665 TH1F *yield8thPt = NULL;
5669 yield2ndPt = (TH1F*)(fCommonHists2nd->GetHistPtPOI())->Clone();
5670 yield4thPt = (TH1F*)(fCommonHists4th->GetHistPtPOI())->Clone();
5671 yield6thPt = (TH1F*)(fCommonHists6th->GetHistPtPOI())->Clone();
5672 yield8thPt = (TH1F*)(fCommonHists8th->GetHistPtPOI())->Clone();
5674 else if(type == "RP")
5676 yield2ndPt = (TH1F*)(fCommonHists2nd->GetHistPtRP())->Clone();
5677 yield4thPt = (TH1F*)(fCommonHists4th->GetHistPtRP())->Clone();
5678 yield6thPt = (TH1F*)(fCommonHists6th->GetHistPtRP())->Clone();
5679 yield8thPt = (TH1F*)(fCommonHists8th->GetHistPtRP())->Clone();
5682 Int_t nBinsPt = yield2ndPt->GetNbinsX();
5684 TH1D *flow2ndPt = NULL;
5685 TH1D *flow4thPt = NULL;
5686 TH1D *flow6thPt = NULL;
5687 TH1D *flow8thPt = NULL;
5689 // to be improved (hardwired pt index)
5690 flow2ndPt = (TH1D*)fDiffFlow[t][0][0]->Clone();
5691 flow4thPt = (TH1D*)fDiffFlow[t][0][1]->Clone();
5692 flow6thPt = (TH1D*)fDiffFlow[t][0][2]->Clone();
5693 flow8thPt = (TH1D*)fDiffFlow[t][0][3]->Clone();
5695 Double_t dvn2nd = 0., dvn4th = 0., dvn6th = 0., dvn8th = 0.; // differential flow
5696 Double_t dErrvn2nd = 0., dErrvn4th = 0., dErrvn6th = 0., dErrvn8th = 0.; // error on differential flow
5698 Double_t dVn2nd = 0., dVn4th = 0., dVn6th = 0., dVn8th = 0.; // integrated flow
5699 Double_t dErrVn2nd = 0., dErrVn4th = 0., dErrVn6th = 0., dErrVn8th = 0.; // error on integrated flow
5701 Double_t dYield2nd = 0., dYield4th = 0., dYield6th = 0., dYield8th = 0.; // pt yield
5702 Double_t dSum2nd = 0., dSum4th = 0., dSum6th = 0., dSum8th = 0.; // needed for normalizing integrated flow
5704 // looping over pt bins:
5705 for(Int_t p=1;p<nBinsPt+1;p++)
5707 dvn2nd = flow2ndPt->GetBinContent(p);
5708 dvn4th = flow4thPt->GetBinContent(p);
5709 dvn6th = flow6thPt->GetBinContent(p);
5710 dvn8th = flow8thPt->GetBinContent(p);
5712 dErrvn2nd = flow2ndPt->GetBinError(p);
5713 dErrvn4th = flow4thPt->GetBinError(p);
5714 dErrvn6th = flow6thPt->GetBinError(p);
5715 dErrvn8th = flow8thPt->GetBinError(p);
5717 dYield2nd = yield2ndPt->GetBinContent(p);
5718 dYield4th = yield4thPt->GetBinContent(p);
5719 dYield6th = yield6thPt->GetBinContent(p);
5720 dYield8th = yield8thPt->GetBinContent(p);
5722 dVn2nd += dvn2nd*dYield2nd;
5723 dVn4th += dvn4th*dYield4th;
5724 dVn6th += dvn6th*dYield6th;
5725 dVn8th += dvn8th*dYield8th;
5727 dSum2nd += dYield2nd;
5728 dSum4th += dYield4th;
5729 dSum6th += dYield6th;
5730 dSum8th += dYield8th;
5732 dErrVn2nd += dYield2nd*dYield2nd*dErrvn2nd*dErrvn2nd; // ro be improved (check this relation)
5733 dErrVn4th += dYield4th*dYield4th*dErrvn4th*dErrvn4th;
5734 dErrVn6th += dYield6th*dYield6th*dErrvn6th*dErrvn6th;
5735 dErrVn8th += dYield8th*dYield8th*dErrvn8th*dErrvn8th;
5737 } // end of for(Int_t p=1;p<nBinsPt+1;p++)
5739 // normalizing the results for integrated flow:
5743 dErrVn2nd /= (dSum2nd*dSum2nd);
5744 dErrVn2nd = TMath::Sqrt(dErrVn2nd);
5749 dErrVn4th /= (dSum4th*dSum4th);
5750 dErrVn4th = TMath::Sqrt(dErrVn4th);
5752 //if(dSum6th) dVn6th/=dSum6th;
5753 //if(dSum8th) dVn8th/=dSum8th;
5755 // storing the results for integrated flow in common histos: (to be improved: new method for this?)
5758 fCommonHistsResults2nd->FillIntegratedFlowPOI(dVn2nd,dErrVn2nd);
5759 fCommonHistsResults4th->FillIntegratedFlowPOI(dVn4th,dErrVn4th);
5760 fCommonHistsResults6th->FillIntegratedFlowPOI(dVn6th,0.); // to be improved (errors)
5761 fCommonHistsResults8th->FillIntegratedFlowPOI(dVn8th,0.); // to be improved (errors)
5763 else if (type == "RP")
5765 fCommonHistsResults2nd->FillIntegratedFlowRP(dVn2nd,dErrVn2nd);
5766 fCommonHistsResults4th->FillIntegratedFlowRP(dVn4th,dErrVn4th);
5767 fCommonHistsResults6th->FillIntegratedFlowRP(dVn6th,0.); // to be improved (errors)
5768 fCommonHistsResults8th->FillIntegratedFlowRP(dVn8th,0.); // to be improved (errors)
5781 } // end of AliFlowAnalysisWithQCumulants::CalculateFinalResultsForRPandPOIIntegratedFlow(TString type)
5784 //================================================================================================================================
5787 void AliFlowAnalysisWithQCumulants::InitializeArraysForDistributions()
5789 // Initialize all arrays used for distributions.
5791 // a) Initialize arrays of histograms used to hold distributions of correlations;
5792 // b) Initialize array to hold min and max values of correlations.
5794 // a) Initialize arrays of histograms used to hold distributions of correlations:
5795 for(Int_t di=0;di<4;di++) // distribution index
5797 fDistributions[di] = NULL;
5800 // b) Initialize default min and max values of correlations:
5801 // (Remark: The default values bellow were chosen for v2=5% and M=500)
5802 fMinValueOfCorrelation[0] = -0.01; // <2>_min
5803 fMaxValueOfCorrelation[0] = 0.04; // <2>_max
5804 fMinValueOfCorrelation[1] = -0.00002; // <4>_min
5805 fMaxValueOfCorrelation[1] = 0.00015; // <4>_max
5806 fMinValueOfCorrelation[2] = -0.0000003; // <6>_min
5807 fMaxValueOfCorrelation[2] = 0.0000006; // <6>_max
5808 fMinValueOfCorrelation[3] = -0.000000006; // <8>_min
5809 fMaxValueOfCorrelation[3] = 0.000000003; // <8>_max
5811 } // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForDistributions()
5814 //================================================================================================================================
5817 void AliFlowAnalysisWithQCumulants::BookEverythingForDistributions()
5819 // a) Book profile to hold all flags for distributions of correlations;
5820 // b) Book all histograms to hold distributions of correlations.
5822 TString correlationIndex[4] = {"<2>","<4>","<6>","<8>"}; // to be improved (should I promote this to data members?)
5824 // a) Book profile to hold all flags for distributions of correlations:
5825 TString distributionsFlagsName = "fDistributionsFlags";
5826 distributionsFlagsName += fAnalysisLabel->Data();
5827 fDistributionsFlags = new TProfile(distributionsFlagsName.Data(),"Flags for Distributions of Correlations",9,0,9);
5828 fDistributionsFlags->SetTickLength(-0.01,"Y");
5829 fDistributionsFlags->SetMarkerStyle(25);
5830 fDistributionsFlags->SetLabelSize(0.05);
5831 fDistributionsFlags->SetLabelOffset(0.02,"Y");
5832 fDistributionsFlags->GetXaxis()->SetBinLabel(1,"Store or not?");
5833 fDistributionsFlags->GetXaxis()->SetBinLabel(2,"<2>_{min}");
5834 fDistributionsFlags->GetXaxis()->SetBinLabel(3,"<2>_{max}");
5835 fDistributionsFlags->GetXaxis()->SetBinLabel(4,"<4>_{min}");
5836 fDistributionsFlags->GetXaxis()->SetBinLabel(5,"<4>_{max}");
5837 fDistributionsFlags->GetXaxis()->SetBinLabel(6,"<6>_{min}");
5838 fDistributionsFlags->GetXaxis()->SetBinLabel(7,"<6>_{max}");
5839 fDistributionsFlags->GetXaxis()->SetBinLabel(8,"<8>_{min}");
5840 fDistributionsFlags->GetXaxis()->SetBinLabel(9,"<8>_{max}");
5841 fDistributionsList->Add(fDistributionsFlags);
5843 // b) Book all histograms to hold distributions of correlations.
5844 if(fStoreDistributions)
5846 TString distributionsName = "fDistributions";
5847 distributionsName += fAnalysisLabel->Data();
5848 for(Int_t di=0;di<4;di++) // distribution index
5850 fDistributions[di] = new TH1D(Form("Distribution of %s",correlationIndex[di].Data()),Form("Distribution of %s",correlationIndex[di].Data()),10000,fMinValueOfCorrelation[di],fMaxValueOfCorrelation[di]);
5851 fDistributions[di]->SetXTitle(correlationIndex[di].Data());
5852 fDistributionsList->Add(fDistributions[di]);
5853 } // end of for(Int_t di=0;di<4;di++) // distribution index
5854 } // end of if(fStoreDistributions)
5856 } // end of void AliFlowAnalysisWithQCumulants::BookEverythingForDistributions()
5859 //================================================================================================================================
5862 void AliFlowAnalysisWithQCumulants::StoreFlagsForDistributions()
5864 // Store all flags for distributiuons of correlations in profile fDistributionsFlags.
5866 if(!fDistributionsFlags)
5868 cout<<"WARNING: fDistributionsFlags is NULL in AFAWQC::SDF() !!!!"<<endl;
5872 fDistributionsFlags->Fill(0.5,(Int_t)fStoreDistributions); // histos with distributions of correlations stored or not in the output file
5873 // store min and max values of correlations:
5874 for(Int_t di=0;di<4;di++) // distribution index
5876 fDistributionsFlags->Fill(1.5+2.*(Double_t)di,fMinValueOfCorrelation[di]);
5877 fDistributionsFlags->Fill(2.5+2.*(Double_t)di,fMaxValueOfCorrelation[di]);
5880 } // end of void AliFlowAnalysisWithQCumulants::StoreFlagsForDistributions()
5883 //================================================================================================================================
5886 void AliFlowAnalysisWithQCumulants::StoreDistributionsOfCorrelations()
5888 // Store distributions of correlations.
5890 if(!(fIntFlowCorrelationsEBE && fIntFlowEventWeightsForCorrelationsEBE))
5892 cout<<"WARNING: fIntFlowCorrelationsEBE && fIntFlowEventWeightsForCorrelationsEBE"<<endl;
5893 cout<<" is NULL in AFAWQC::SDOC() !!!!"<<endl;
5897 for(Int_t di=0;di<4;di++) // distribution index
5899 if(!fDistributions[di])
5901 cout<<"WARNING: fDistributions[di] is NULL in AFAWQC::SDOC() !!!!"<<endl;
5902 cout<<"di = "<<di<<endl;
5906 fDistributions[di]->Fill(fIntFlowCorrelationsEBE->GetBinContent(di+1),fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(di+1));
5908 } // end of for(Int_t di=0;di<4;di++) // distribution index
5910 } // end of void AliFlowAnalysisWithQCumulants::StoreDistributionsOfCorrelations()
5913 //================================================================================================================================
5916 void AliFlowAnalysisWithQCumulants::BookAndNestAllLists()
5918 // Book and nest all lists nested in the base list fHistList.
5919 // a) Book and nest lists for integrated flow;
5920 // b) Book and nest lists for differential flow;
5921 // c) Book and nest list for particle weights;
5922 // d) Book and nest list for distributions;
5923 // e) Book and nest list for nested loops;
5925 // a) Book and nest all lists for integrated flow:
5926 // base list for integrated flow:
5927 fIntFlowList = new TList();
5928 fIntFlowList->SetName("Integrated Flow");
5929 fIntFlowList->SetOwner(kTRUE);
5930 fHistList->Add(fIntFlowList);
5931 // list holding profiles:
5932 fIntFlowProfiles = new TList();
5933 fIntFlowProfiles->SetName("Profiles");
5934 fIntFlowProfiles->SetOwner(kTRUE);
5935 fIntFlowList->Add(fIntFlowProfiles);
5936 // list holding histograms with results:
5937 fIntFlowResults = new TList();
5938 fIntFlowResults->SetName("Results");
5939 fIntFlowResults->SetOwner(kTRUE);
5940 fIntFlowList->Add(fIntFlowResults);
5942 // b) Book and nest lists for differential flow;
5943 fDiffFlowList = new TList();
5944 fDiffFlowList->SetName("Differential Flow");
5945 fDiffFlowList->SetOwner(kTRUE);
5946 fHistList->Add(fDiffFlowList);
5947 // list holding profiles:
5948 fDiffFlowProfiles = new TList();
5949 fDiffFlowProfiles->SetName("Profiles");
5950 fDiffFlowProfiles->SetOwner(kTRUE);
5951 fDiffFlowList->Add(fDiffFlowProfiles);
5952 // list holding histograms with results:
5953 fDiffFlowResults = new TList();
5954 fDiffFlowResults->SetName("Results");
5955 fDiffFlowResults->SetOwner(kTRUE);
5956 fDiffFlowList->Add(fDiffFlowResults);
5957 // flags used for naming nested lists in list fDiffFlowProfiles and fDiffFlowResults:
5959 list.SetOwner(kTRUE);
5960 TString typeFlag[2] = {"RP","POI"};
5961 TString ptEtaFlag[2] = {"p_{T}","#eta"};
5962 TString powerFlag[2] = {"linear","quadratic"};
5963 // nested lists in fDiffFlowProfiles (~/Differential Flow/Profiles):
5964 for(Int_t t=0;t<2;t++) // type: RP or POI
5966 for(Int_t pe=0;pe<2;pe++) // pt or eta
5968 // list holding profiles with correlations:
5969 fDiffFlowCorrelationsProList[t][pe] = (TList*)list.Clone();
5970 fDiffFlowCorrelationsProList[t][pe]->SetName(Form("Profiles with correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5971 fDiffFlowProfiles->Add(fDiffFlowCorrelationsProList[t][pe]);
5972 // list holding profiles with products of correlations:
5973 fDiffFlowProductOfCorrelationsProList[t][pe] = (TList*)list.Clone();
5974 fDiffFlowProductOfCorrelationsProList[t][pe]->SetName(Form("Profiles with products of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5975 fDiffFlowProfiles->Add(fDiffFlowProductOfCorrelationsProList[t][pe]);
5976 // list holding profiles with corrections:
5977 fDiffFlowCorrectionsProList[t][pe] = (TList*)list.Clone();
5978 fDiffFlowCorrectionsProList[t][pe]->SetName(Form("Profiles with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5979 fDiffFlowProfiles->Add(fDiffFlowCorrectionsProList[t][pe]);
5980 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
5981 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
5982 // nested lists in fDiffFlowResults (~/Differential Flow/Results):
5983 for(Int_t t=0;t<2;t++) // type: RP or POI
5985 for(Int_t pe=0;pe<2;pe++) // pt or eta
5987 // list holding histograms with correlations:
5988 fDiffFlowCorrelationsHistList[t][pe] = (TList*)list.Clone();
5989 fDiffFlowCorrelationsHistList[t][pe]->SetName(Form("Correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5990 fDiffFlowResults->Add(fDiffFlowCorrelationsHistList[t][pe]);
5991 // list holding histograms with corrections:
5992 fDiffFlowCorrectionsHistList[t][pe] = (TList*)list.Clone();
5993 fDiffFlowCorrectionsHistList[t][pe]->SetName(Form("Histograms with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
5994 fDiffFlowResults->Add(fDiffFlowCorrectionsHistList[t][pe]);
5995 for(Int_t power=0;power<2;power++)
5997 // list holding histograms with sums of event weights:
5998 fDiffFlowSumOfEventWeightsHistList[t][pe][power] = (TList*)list.Clone();
5999 fDiffFlowSumOfEventWeightsHistList[t][pe][power]->SetName(Form("Sum of %s event weights (%s, %s)",powerFlag[power].Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6000 fDiffFlowResults->Add(fDiffFlowSumOfEventWeightsHistList[t][pe][power]);
6001 } // end of for(Int_t power=0;power<2;power++)
6002 // list holding histograms with sums of products of event weights:
6003 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe] = (TList*)list.Clone();
6004 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]->SetName(Form("Sum of products of event weights (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6005 fDiffFlowResults->Add(fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]);
6006 // list holding histograms with covariances of correlations:
6007 fDiffFlowCovariancesHistList[t][pe] = (TList*)list.Clone();
6008 fDiffFlowCovariancesHistList[t][pe]->SetName(Form("Covariances of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6009 fDiffFlowResults->Add(fDiffFlowCovariancesHistList[t][pe]);
6010 // list holding histograms with differential Q-cumulants:
6011 fDiffFlowCumulantsHistList[t][pe] = (TList*)list.Clone();
6012 fDiffFlowCumulantsHistList[t][pe]->SetName(Form("Differential Q-cumulants (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6013 fDiffFlowResults->Add(fDiffFlowCumulantsHistList[t][pe]);
6014 // list holding histograms with differential flow estimates from Q-cumulants:
6015 fDiffFlowHistList[t][pe] = (TList*)list.Clone();
6016 fDiffFlowHistList[t][pe]->SetName(Form("Differential flow (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6017 fDiffFlowResults->Add(fDiffFlowHistList[t][pe]);
6018 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
6019 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
6021 // c) Book and nest list for particle weights:
6022 fWeightsList->SetName("Weights");
6023 fWeightsList->SetOwner(kTRUE);
6024 fHistList->Add(fWeightsList);
6026 // d) Book and nest list for distributions:
6027 fDistributionsList = new TList();
6028 fDistributionsList->SetName("Distributions");
6029 fDistributionsList->SetOwner(kTRUE);
6030 fHistList->Add(fDistributionsList);
6032 // e) Book and nest list for nested loops:
6033 fNestedLoopsList = new TList();
6034 fNestedLoopsList->SetName("Nested Loops");
6035 fNestedLoopsList->SetOwner(kTRUE);
6036 fHistList->Add(fNestedLoopsList);
6038 } // end of void AliFlowAnalysisWithQCumulants::BookAndNestAllLists()
6041 //================================================================================================================================
6044 void AliFlowAnalysisWithQCumulants::FillCommonHistResultsDiffFlow(TString type)
6046 // fill common result histograms for differential flow
6048 Int_t typeFlag = -1;
6049 //Int_t ptEtaFlag = -1;
6054 } else if(type == "POI")
6061 //Int_t pe = ptEtaFlag;
6063 // to be improved (implement protection here)
6065 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
6067 cout<<"WARNING: fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th"<<endl;
6068 cout<<" is NULL in AFAWQC::FCHRIF() !!!!"<<endl;
6073 for(Int_t p=1;p<=fnBinsPt;p++)
6075 Double_t v2 = fDiffFlow[t][0][0]->GetBinContent(p);
6076 Double_t v4 = fDiffFlow[t][0][1]->GetBinContent(p);
6077 Double_t v6 = fDiffFlow[t][0][2]->GetBinContent(p);
6078 Double_t v8 = fDiffFlow[t][0][3]->GetBinContent(p);
6080 Double_t v2Error = fDiffFlow[t][0][0]->GetBinError(p);
6081 Double_t v4Error = fDiffFlow[t][0][1]->GetBinError(p);
6082 //Double_t v6Error = fFinalFlow1D[t][pW][nua][0][2]->GetBinError(p);
6083 //Double_t v8Error = fFinalFlow1D[t][pW][nua][0][3]->GetBinError(p);
6087 fCommonHistsResults2nd->FillDifferentialFlowPtRP(p,v2,v2Error);
6088 fCommonHistsResults4th->FillDifferentialFlowPtRP(p,v4,v4Error);
6089 fCommonHistsResults6th->FillDifferentialFlowPtRP(p,v6,0.);
6090 fCommonHistsResults8th->FillDifferentialFlowPtRP(p,v8,0.);
6091 } else if(type == "POI")
6093 fCommonHistsResults2nd->FillDifferentialFlowPtPOI(p,v2,v2Error);
6094 fCommonHistsResults4th->FillDifferentialFlowPtPOI(p,v4,v4Error);
6095 fCommonHistsResults6th->FillDifferentialFlowPtPOI(p,v6,0.);
6096 fCommonHistsResults8th->FillDifferentialFlowPtPOI(p,v8,0.);
6098 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
6101 for(Int_t e=1;e<=fnBinsEta;e++)
6103 Double_t v2 = fDiffFlow[t][1][0]->GetBinContent(e);
6104 Double_t v4 = fDiffFlow[t][1][1]->GetBinContent(e);
6105 Double_t v6 = fDiffFlow[t][1][2]->GetBinContent(e);
6106 Double_t v8 = fDiffFlow[t][1][3]->GetBinContent(e);
6108 Double_t v2Error = fDiffFlow[t][1][0]->GetBinError(e);
6109 Double_t v4Error = fDiffFlow[t][1][1]->GetBinError(e);
6110 //Double_t v6Error = fDiffFlow[t][1][2]->GetBinError(e);
6111 //Double_t v8Error = fDiffFlow[t][1][3]->GetBinError(e);
6115 fCommonHistsResults2nd->FillDifferentialFlowEtaRP(e,v2,v2Error);
6116 fCommonHistsResults4th->FillDifferentialFlowEtaRP(e,v4,v4Error);
6117 fCommonHistsResults6th->FillDifferentialFlowEtaRP(e,v6,0.);
6118 fCommonHistsResults8th->FillDifferentialFlowEtaRP(e,v8,0.);
6119 } else if(type == "POI")
6121 fCommonHistsResults2nd->FillDifferentialFlowEtaPOI(e,v2,v2Error);
6122 fCommonHistsResults4th->FillDifferentialFlowEtaPOI(e,v4,v4Error);
6123 fCommonHistsResults6th->FillDifferentialFlowEtaPOI(e,v6,0.);
6124 fCommonHistsResults8th->FillDifferentialFlowEtaPOI(e,v8,0.);
6126 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
6128 } // end of void AliFlowAnalysisWithQCumulants::FillCommonHistResultsDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights, Bool_t correctedForNUA)
6130 //================================================================================================================================
6132 void AliFlowAnalysisWithQCumulants::AccessConstants()
6134 // Access needed common constants from AliFlowCommonConstants.
6136 fnBinsPhi = AliFlowCommonConstants::GetMaster()->GetNbinsPhi();
6137 fPhiMin = AliFlowCommonConstants::GetMaster()->GetPhiMin();
6138 fPhiMax = AliFlowCommonConstants::GetMaster()->GetPhiMax();
6139 if(fnBinsPhi) fPhiBinWidth = (fPhiMax-fPhiMin)/fnBinsPhi;
6140 fnBinsPt = AliFlowCommonConstants::GetMaster()->GetNbinsPt();
6141 fPtMin = AliFlowCommonConstants::GetMaster()->GetPtMin();
6142 fPtMax = AliFlowCommonConstants::GetMaster()->GetPtMax();
6143 if(fnBinsPt) fPtBinWidth = (fPtMax-fPtMin)/fnBinsPt;
6144 fnBinsEta = AliFlowCommonConstants::GetMaster()->GetNbinsEta();
6145 fEtaMin = AliFlowCommonConstants::GetMaster()->GetEtaMin();
6146 fEtaMax = AliFlowCommonConstants::GetMaster()->GetEtaMax();
6147 if(fnBinsEta) fEtaBinWidth = (fEtaMax-fEtaMin)/fnBinsEta;
6149 } // end of void AliFlowAnalysisWithQCumulants::AccessConstants()
6151 //================================================================================================================================
6153 void AliFlowAnalysisWithQCumulants::CrossCheckSettings()
6155 // a) Cross check if the choice for multiplicity weights make sense;
6157 // a) Cross check if the choice for multiplicity weights make sense:
6158 if(strcmp(fMultiplicityWeight->Data(),"combinations") &&
6159 strcmp(fMultiplicityWeight->Data(),"unit") &&
6160 strcmp(fMultiplicityWeight->Data(),"multiplicity"))
6162 cout<<"WARNING (QC): Multiplicity weight can be either \"combinations\", \"unit\""<<endl;
6163 cout<<" or \"multiplicity\". Certainly not \""<<fMultiplicityWeight->Data()<<"\"."<<endl;
6167 } // end of void AliFlowAnalysisWithQCumulants::CrossCheckSettings()
6169 //================================================================================================================================
6171 void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeights()
6173 // Calculate sum of linear and quadratic event weights for correlations.
6176 Double_t dMult = (*fSMpk)(0,0);
6178 for(Int_t p=0;p<2;p++) // power-1
6180 for(Int_t ci=0;ci<4;ci++) // correlation index
6182 fIntFlowSumOfEventWeights[p]->Fill(ci+0.5,pow(fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci+1),p+1));
6183 if(fCalculateCumulantsVsM)
6185 fIntFlowSumOfEventWeightsVsM[ci][p]->Fill(dMult+0.5,pow(fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci+1),p+1)); // to be improved: dMult => sum of weights?
6190 } // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeights()
6192 //================================================================================================================================
6194 void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeightsNUA()
6196 // Calculate sum of linear and quadratic event weights for NUA terms.
6198 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
6200 for(Int_t p=0;p<2;p++) // power-1
6202 for(Int_t ci=0;ci<3;ci++) // nua term index
6204 fIntFlowSumOfEventWeightsNUA[sc][p]->Fill(ci+0.5,pow(fIntFlowEventWeightForCorrectionTermsForNUAEBE[sc]->GetBinContent(ci+1),p+1));
6209 } // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeightsNUA()
6211 //================================================================================================================================
6213 void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfProductOfEventWeights()
6215 // Calculate sum of product of event weights for correlations.
6218 Double_t dMult = (*fSMpk)(0,0);
6222 for(Int_t ci1=1;ci1<4;ci1++)
6224 for(Int_t ci2=ci1+1;ci2<=4;ci2++)
6226 fIntFlowSumOfProductOfEventWeights->Fill(0.5+counter,
6227 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
6228 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
6229 if(fCalculateCumulantsVsM)
6231 fIntFlowSumOfProductOfEventWeightsVsM[counter]->Fill(dMult+0.5, // to be improved: dMult => sum of weights?
6232 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
6233 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
6234 } // end of if(fCalculateCumulantsVsM)
6239 } // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfProductOfEventWeights()
6241 //================================================================================================================================
6243 void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfProductOfEventWeightsNUA()
6245 // Calculate sum of product of event weights for NUA terms.
6247 // w_{<2>} * w_{<cos(#phi)>}:
6248 fIntFlowSumOfProductOfEventWeightsNUA->Fill(0.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6249 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
6250 // w_{<2>} * w_{<sin(#phi)>}:
6251 fIntFlowSumOfProductOfEventWeightsNUA->Fill(1.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6252 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
6253 // w_{<cos(#phi)> * w_{<sin(#phi)>}:
6254 fIntFlowSumOfProductOfEventWeightsNUA->Fill(2.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6255 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
6256 // w_{<2>} * w{<cos(phi1+phi2)>}
6257 fIntFlowSumOfProductOfEventWeightsNUA->Fill(3.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6258 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
6259 // w_{<2>} * w{<sin(phi1+phi2)>}
6260 fIntFlowSumOfProductOfEventWeightsNUA->Fill(4.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6261 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6262 // w_{<2>} * w{<cos(phi1-phi2-phi3)>}
6263 fIntFlowSumOfProductOfEventWeightsNUA->Fill(5.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6264 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6265 // w_{<2>} * w{<sin(phi1-phi2-phi3)>}
6266 fIntFlowSumOfProductOfEventWeightsNUA->Fill(6.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6267 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6268 // w_{<4>} * w{<cos(phi1)>}
6269 fIntFlowSumOfProductOfEventWeightsNUA->Fill(7.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6270 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
6271 // w_{<4>} * w{<sin(phi1)>}
6272 fIntFlowSumOfProductOfEventWeightsNUA->Fill(8.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6273 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
6274 // w_{<4>} * w{<cos(phi1+phi2)>}
6275 fIntFlowSumOfProductOfEventWeightsNUA->Fill(9.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6276 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
6277 // w_{<4>} * w{<sin(phi1+phi2)>}
6278 fIntFlowSumOfProductOfEventWeightsNUA->Fill(10.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6279 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6280 // w_{<4>} * w{<cos(phi1-phi2-phi3)>}
6281 fIntFlowSumOfProductOfEventWeightsNUA->Fill(11.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6282 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6283 // w_{<4>} * w{<sin(phi1-phi2-phi3)>}
6284 fIntFlowSumOfProductOfEventWeightsNUA->Fill(12.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6285 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6286 // w_{<cos(phi1)>} * w{<cos(phi1+phi2)>}
6287 fIntFlowSumOfProductOfEventWeightsNUA->Fill(13.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6288 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
6289 // w_{<cos(phi1)>} * w{<sin(phi1+phi2)>}
6290 fIntFlowSumOfProductOfEventWeightsNUA->Fill(14.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6291 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6292 // w_{<cos(phi1)>} * w{<cos(phi1-phi2-phi3)>}
6293 fIntFlowSumOfProductOfEventWeightsNUA->Fill(15.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6294 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6295 // w_{<cos(phi1)>} * w{<sin(phi1-phi2-phi3)>}
6296 fIntFlowSumOfProductOfEventWeightsNUA->Fill(16.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6297 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6298 // w_{<sin(phi1)>} * w{<cos(phi1+phi2)>}
6299 fIntFlowSumOfProductOfEventWeightsNUA->Fill(17.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
6300 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
6301 // w_{<sin(phi1)>} * w{<sin(phi1+phi2)>}
6302 fIntFlowSumOfProductOfEventWeightsNUA->Fill(18.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
6303 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6304 // w_{<sin(phi1)>} * w{<cos(phi1-phi2-phi3)>}
6305 fIntFlowSumOfProductOfEventWeightsNUA->Fill(19.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
6306 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6307 // w_{<sin(phi1)>} * w{<sin(phi1-phi2-phi3)>}
6308 fIntFlowSumOfProductOfEventWeightsNUA->Fill(20.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
6309 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6310 // w_{<cos(phi1+phi2)>} * w{<sin(phi1+phi2))>}
6311 fIntFlowSumOfProductOfEventWeightsNUA->Fill(21.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)*
6312 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6313 // w_{<cos(phi1+phi2)>} * w{<cos(phi1-phi2-phi3)>}
6314 fIntFlowSumOfProductOfEventWeightsNUA->Fill(22.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)*
6315 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6316 // w_{<cos(phi1+phi2)>} * w{<sin(phi1-phi2-phi3)>}
6317 fIntFlowSumOfProductOfEventWeightsNUA->Fill(23.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)*
6318 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6319 // w_{<sin(phi1+phi2)>} * w{<cos(phi1-phi2-phi3)>}
6320 fIntFlowSumOfProductOfEventWeightsNUA->Fill(24.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)*
6321 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6322 // w_{<sin(phi1+phi2)>} * w{<sin(phi1-phi2-phi3)>}
6323 fIntFlowSumOfProductOfEventWeightsNUA->Fill(25.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)*
6324 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6325 // w_{<cos(phi1-phi2-phi3)>} * w{<sin(phi1-phi2-phi3)>}
6326 fIntFlowSumOfProductOfEventWeightsNUA->Fill(26.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3)*
6327 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6329 } // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowIntFlowSumOfProductOfEventWeightsNUA()
6332 //================================================================================================================================
6335 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelations(TString type, TString ptOrEta)
6337 // calculate reduced correlations for RPs or POIs in pt or eta bins
6340 Double_t dMult = (*fSMpk)(0,0);
6342 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
6343 Double_t dReQ1n = (*fReQ)(0,0);
6344 Double_t dReQ2n = (*fReQ)(1,0);
6345 //Double_t dReQ3n = (*fReQ)(2,0);
6346 //Double_t dReQ4n = (*fReQ)(3,0);
6347 Double_t dImQ1n = (*fImQ)(0,0);
6348 Double_t dImQ2n = (*fImQ)(1,0);
6349 //Double_t dImQ3n = (*fImQ)(2,0);
6350 //Double_t dImQ4n = (*fImQ)(3,0);
6352 // reduced correlations are stored in fDiffFlowCorrelationsPro[0=RP,1=POI][0=pt,1=eta][correlation index]. Correlation index runs as follows:
6359 Int_t t = -1; // type flag
6360 Int_t pe = -1; // ptEta flag
6365 } else if(type == "POI")
6373 } else if(ptOrEta == "Eta")
6378 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6379 Double_t minPtEta[2] = {fPtMin,fEtaMin};
6380 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
6381 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
6383 // looping over all bins and calculating reduced correlations:
6384 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6386 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
6387 Double_t p1n0kRe = 0.;
6388 Double_t p1n0kIm = 0.;
6390 // number of POIs in particular pt or eta bin:
6393 // 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):
6394 Double_t q1n0kRe = 0.;
6395 Double_t q1n0kIm = 0.;
6396 Double_t q2n0kRe = 0.;
6397 Double_t q2n0kIm = 0.;
6399 // number of particles which are both RPs and POIs in particular pt or eta bin:
6405 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))
6406 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));
6407 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))
6408 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));
6409 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))
6410 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));
6411 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))
6412 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b));
6414 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
6416 else if(type == "RP")
6419 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
6420 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
6421 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
6422 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
6423 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))
6424 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));
6425 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))
6426 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b));
6428 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
6434 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
6435 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
6436 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
6437 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
6439 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
6441 t = 1; // typeFlag = RP or POI
6443 else if(type == "RP")
6445 // p_{m*n,0} = q_{m*n,0}:
6451 t = 0; // typeFlag = RP or POI
6454 // 2'-particle correlation for particular (pt,eta) bin:
6455 Double_t two1n1nPtEta = 0.;
6458 two1n1nPtEta = (p1n0kRe*dReQ1n+p1n0kIm*dImQ1n-mq)
6461 if(type == "POI") // to be improved (I do not this if)
6463 // fill profile to get <<2'>> for POIs
6464 fDiffFlowCorrelationsPro[1][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta,mp*dMult-mq);
6465 // histogram to store <2'> for POIs e-b-e (needed in some other methods):
6466 fDiffFlowCorrelationsEBE[1][pe][0]->SetBinContent(b,two1n1nPtEta);
6467 fDiffFlowEventWeightsForCorrelationsEBE[1][pe][0]->SetBinContent(b,mp*dMult-mq);
6469 else if(type == "RP") // to be improved (I do not this if)
6471 // profile to get <<2'>> for RPs:
6472 fDiffFlowCorrelationsPro[0][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta,mp*dMult-mq);
6473 // histogram to store <2'> for RPs e-b-e (needed in some other methods):
6474 fDiffFlowCorrelationsEBE[0][pe][0]->SetBinContent(b,two1n1nPtEta);
6475 fDiffFlowEventWeightsForCorrelationsEBE[0][pe][0]->SetBinContent(b,mp*dMult-mq);
6477 } // end of if(mp*dMult-mq)
6479 // 4'-particle correlation:
6480 Double_t four1n1n1n1nPtEta = 0.;
6481 if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6482 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)
6484 four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6485 - q2n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))
6486 - 2.*q2n0kIm*dReQ1n*dImQ1n
6487 - p1n0kRe*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)
6488 + p1n0kIm*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)
6489 - 2.*dMult*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6490 - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*mq
6491 + 6.*(q1n0kRe*dReQ1n+q1n0kIm*dImQ1n)
6492 + 1.*(q2n0kRe*dReQ2n+q2n0kIm*dImQ2n)
6493 + 2.*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6496 / ((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6497 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
6501 // profile to get <<4'>> for POIs:
6502 fDiffFlowCorrelationsPro[1][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta,
6503 (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6504 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
6505 // histogram to store <4'> for POIs e-b-e (needed in some other methods):
6506 fDiffFlowCorrelationsEBE[1][pe][1]->SetBinContent(b,four1n1n1n1nPtEta);
6507 fDiffFlowEventWeightsForCorrelationsEBE[1][pe][1]->SetBinContent(b,(mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6508 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
6510 else if(type == "RP")
6512 // profile to get <<4'>> for RPs:
6513 fDiffFlowCorrelationsPro[0][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta,
6514 (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6515 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
6516 // histogram to store <4'> for RPs e-b-e (needed in some other methods):
6517 fDiffFlowCorrelationsEBE[0][pe][1]->SetBinContent(b,four1n1n1n1nPtEta);
6518 fDiffFlowEventWeightsForCorrelationsEBE[0][pe][1]->SetBinContent(b,(mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6519 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
6521 } // end of if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6522 // +mq*(dMult-1.)*(dMult-2.)*(dMult-3.))
6524 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6527 } // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelations(TString type, TString ptOrEta);
6530 //================================================================================================================================
6533 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfEventWeights(TString type, TString ptOrEta)
6535 // Calculate sums of various event weights for reduced correlations.
6536 // (These quantitites are needed in expressions for unbiased estimators relevant for the statistical errors.)
6538 Int_t typeFlag = -1;
6539 Int_t ptEtaFlag = -1;
6544 } else if(type == "POI")
6552 } else if(ptOrEta == "Eta")
6559 Int_t pe = ptEtaFlag;
6562 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6563 Double_t minPtEta[2] = {fPtMin,fEtaMin};
6564 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
6565 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
6567 for(Int_t rpq=0;rpq<3;rpq++)
6569 for(Int_t m=0;m<4;m++)
6571 for(Int_t k=0;k<9;k++)
6573 if(!fReRPQ1dEBE[rpq][pe][m][k])
6575 cout<<"WARNING: fReRPQ1dEBE[rpq][pe][m][k] is NULL in AFAWQC::CSAPOEWFDF() !!!!"<<endl;
6576 cout<<"pe = "<<pe<<endl;
6577 cout<<"rpq = "<<rpq<<endl;
6578 cout<<"m = "<<m<<endl;
6579 cout<<"k = "<<k<<endl;
6587 Double_t dMult = (*fSMpk)(0,0); // total event multiplicity
6588 //Double_t mr = 0.; // number of RPs in particular pt or eta bin
6589 Double_t mp = 0.; // number of POIs in particular pt or eta bin
6590 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin
6592 // event weights for reduced correlations:
6593 Double_t dw2 = 0.; // event weight for <2'>
6594 Double_t dw4 = 0.; // event weight for <4'>
6595 //Double_t dw6 = 0.; // event weight for <6'>
6596 //Double_t dw8 = 0.; // event weight for <8'>
6598 // looping over bins:
6599 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6603 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);
6604 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
6605 } else if(type == "POI")
6607 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);
6608 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b);
6611 // event weight for <2'>:
6613 fDiffFlowSumOfEventWeights[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2);
6614 fDiffFlowSumOfEventWeights[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw2,2.));
6616 // event weight for <4'>:
6617 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6618 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.);
6619 fDiffFlowSumOfEventWeights[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4);
6620 fDiffFlowSumOfEventWeights[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw4,2.));
6622 // event weight for <6'>:
6624 //fDiffFlowSumOfEventWeights[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6);
6625 //fDiffFlowSumOfEventWeights[t][pe][t][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw6,2.));
6627 // event weight for <8'>:
6629 //fDiffFlowSumOfEventWeights[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw8);
6630 //fDiffFlowSumOfEventWeights[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw8,2.));
6631 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6633 } // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfEventWeights()
6636 //================================================================================================================================
6639 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfProductOfEventWeights(TString type, TString ptOrEta)
6641 // Calculate sum of products of various event weights for both types of correlations (the ones for int. and diff. flow).
6642 // (These quantitites are needed in expressions for unbiased estimators relevant for the statistical errors.)
6644 // Important: To fill fDiffFlowSumOfProductOfEventWeights[][][][] use bellow table (i,j) with following constraints:
6646 // 2.) do not store terms which DO NOT include reduced correlations;
6648 // [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'>]
6650 Int_t typeFlag = -1;
6651 Int_t ptEtaFlag = -1;
6656 } else if(type == "POI")
6664 } else if(ptOrEta == "Eta")
6671 Int_t pe = ptEtaFlag;
6674 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6675 Double_t minPtEta[2] = {fPtMin,fEtaMin};
6676 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
6677 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
6680 for(Int_t rpq=0;rpq<3;rpq++)
6682 for(Int_t m=0;m<4;m++)
6684 for(Int_t k=0;k<9;k++)
6686 if(!fReRPQ1dEBE[rpq][pe][m][k])
6688 cout<<"WARNING: fReRPQ1dEBE[rpq][pe][m][k] is NULL in AFAWQC::CSAPOEWFDF() !!!!"<<endl;
6689 cout<<"pe = "<<pe<<endl;
6690 cout<<"rpq = "<<rpq<<endl;
6691 cout<<"m = "<<m<<endl;
6692 cout<<"k = "<<k<<endl;
6700 Double_t dMult = (*fSMpk)(0,0); // total event multiplicity
6701 //Double_t mr = 0.; // number of RPs in particular pt or eta bin
6702 Double_t mp = 0.; // number of POIs in particular pt or eta bin
6703 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin
6705 // event weights for correlations:
6706 Double_t dW2 = dMult*(dMult-1); // event weight for <2>
6707 Double_t dW4 = dMult*(dMult-1)*(dMult-2)*(dMult-3); // event weight for <4>
6708 Double_t dW6 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5); // event weight for <6>
6709 Double_t dW8 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7); // event weight for <8>
6711 // event weights for reduced correlations:
6712 Double_t dw2 = 0.; // event weight for <2'>
6713 Double_t dw4 = 0.; // event weight for <4'>
6714 //Double_t dw6 = 0.; // event weight for <6'>
6715 //Double_t dw8 = 0.; // event weight for <8'>
6717 // looping over bins:
6718 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6722 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);
6723 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
6724 } else if(type == "POI")
6726 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);
6727 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b);
6730 // event weight for <2'>:
6732 fDiffFlowSumOfProductOfEventWeights[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw2); // storing product of even weights for <2> and <2'>
6733 fDiffFlowSumOfProductOfEventWeights[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW4); // storing product of even weights for <4> and <2'>
6734 fDiffFlowSumOfProductOfEventWeights[t][pe][1][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW6); // storing product of even weights for <6> and <2'>
6735 fDiffFlowSumOfProductOfEventWeights[t][pe][1][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW8); // storing product of even weights for <8> and <2'>
6737 // event weight for <4'>:
6738 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6739 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.);
6740 fDiffFlowSumOfProductOfEventWeights[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw4); // storing product of even weights for <2> and <4'>
6741 fDiffFlowSumOfProductOfEventWeights[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw4); // storing product of even weights for <2'> and <4'>
6742 fDiffFlowSumOfProductOfEventWeights[t][pe][2][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw4); // storing product of even weights for <4> and <4'>
6743 fDiffFlowSumOfProductOfEventWeights[t][pe][3][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dW6); // storing product of even weights for <6> and <4'>
6744 fDiffFlowSumOfProductOfEventWeights[t][pe][3][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dW8); // storing product of even weights for <8> and <4'>
6746 // event weight for <6'>:
6748 //fDiffFlowSumOfProductOfEventWeights[t][pe][0][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw6); // storing product of even weights for <2> and <6'>
6749 //fDiffFlowSumOfProductOfEventWeights[t][pe][1][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw6); // storing product of even weights for <2'> and <6'>
6750 //fDiffFlowSumOfProductOfEventWeights[t][pe][2][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw6); // storing product of even weights for <4> and <6'>
6751 //fDiffFlowSumOfProductOfEventWeights[t][pe][3][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dw6); // storing product of even weights for <4'> and <6'>
6752 //fDiffFlowSumOfProductOfEventWeights[t][pe][4][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW6*dw6); // storing product of even weights for <6> and <6'>
6753 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dW8); // storing product of even weights for <6'> and <8>
6754 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dw8); // storing product of even weights for <6'> and <8'>
6756 // event weight for <8'>:
6758 //fDiffFlowSumOfProductOfEventWeights[t][pe][0][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw8); // storing product of even weights for <2> and <8'>
6759 //fDiffFlowSumOfProductOfEventWeights[t][pe][1][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw8); // storing product of even weights for <2'> and <8'>
6760 //fDiffFlowSumOfProductOfEventWeights[t][pe][2][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw8); // storing product of even weights for <4> and <8'>
6761 //fDiffFlowSumOfProductOfEventWeights[t][pe][3][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dw8); // storing product of even weights for <4'> and <8'>
6762 //fDiffFlowSumOfProductOfEventWeights[t][pe][4][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW6*dw8); // storing product of even weights for <6> and <8'>
6763 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dw8); // storing product of even weights for <6'> and <8'>
6764 //fDiffFlowSumOfProductOfEventWeights[t][pe][6][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW8*dw8); // storing product of even weights for <8> and <8'>
6767 // [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'>]
6769 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6773 } // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfProductOfEventWeights(TString type, TString ptOrEta)
6776 //================================================================================================================================
6779 void AliFlowAnalysisWithQCumulants::FinalizeReducedCorrelations(TString type, TString ptOrEta)
6781 // Transfer profiles into histograms and calculate statistical errors correctly.
6783 Int_t typeFlag = -1;
6784 Int_t ptEtaFlag = -1;
6789 } else if(type == "POI")
6797 } else if(ptOrEta == "Eta")
6804 Int_t pe = ptEtaFlag;
6806 for(Int_t rci=0;rci<4;rci++)
6808 if(!fDiffFlowCorrelationsPro[t][pe][rci])
6810 cout<<"WARNING: fDiffFlowCorrelationsPro[t][pe][rci] is NULL in AFAWQC::FRC() !!!!"<<endl;
6811 cout<<"t = "<<t<<endl;
6812 cout<<"pe = "<<pe<<endl;
6813 cout<<"rci = "<<rci<<endl;
6816 for(Int_t power=0;power<2;power++)
6818 if(!fDiffFlowSumOfEventWeights[t][pe][power][rci])
6820 cout<<"WARNING: fDiffFlowSumOfEventWeights[t][pe][power][rci] is NULL in AFAWQC::FRC() !!!!"<<endl;
6821 cout<<"t = "<<t<<endl;
6822 cout<<"pe = "<<pe<<endl;
6823 cout<<"power = "<<power<<endl;
6824 cout<<"rci = "<<rci<<endl;
6827 } // end of for(Int_t power=0;power<2;power++)
6828 } // end of for(Int_t rci=0;rci<4;rci++)
6831 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6833 // transfer 1D profile into 1D histogram:
6834 Double_t correlation = 0.;
6835 Double_t spread = 0.;
6836 Double_t sumOfWeights = 0.; // sum of weights for particular reduced correlations for particular pt or eta bin
6837 Double_t sumOfSquaredWeights = 0.; // sum of squared weights for particular reduced correlations for particular pt or eta bin
6838 Double_t error = 0.; // error = termA * spread * termB
6839 // termA = (sqrt(sumOfSquaredWeights)/sumOfWeights)
6840 // termB = 1/pow(1-termA^2,0.5)
6841 Double_t termA = 0.;
6842 Double_t termB = 0.;
6843 for(Int_t rci=0;rci<4;rci++) // index of reduced correlation
6845 for(Int_t b=1;b<=nBinsPtEta[pe];b++) // number of pt or eta bins
6847 correlation = fDiffFlowCorrelationsPro[t][pe][rci]->GetBinContent(b);
6848 spread = fDiffFlowCorrelationsPro[t][pe][rci]->GetBinError(b);
6849 sumOfWeights = fDiffFlowSumOfEventWeights[t][pe][0][rci]->GetBinContent(b);
6850 sumOfSquaredWeights = fDiffFlowSumOfEventWeights[t][pe][1][rci]->GetBinContent(b);
6851 if(sumOfWeights) termA = (pow(sumOfSquaredWeights,0.5)/sumOfWeights);
6852 if(1.-pow(termA,2.)>0.) termB = 1./pow(1.-pow(termA,2.),0.5);
6853 error = termA*spread*termB; // final error (unbiased estimator for standard deviation)
6854 fDiffFlowCorrelationsHist[t][pe][rci]->SetBinContent(b,correlation);
6855 fDiffFlowCorrelationsHist[t][pe][rci]->SetBinError(b,error);
6856 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6857 } // end of for(Int_t rci=0;rci<4;rci++)
6859 } // end of void AliFlowAnalysisWithQCumulants::FinalizeReducedCorrelations(TString type, TString ptOrEta)
6862 //================================================================================================================================
6865 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowProductOfCorrelations(TString type, TString ptOrEta)
6867 // store products: <2><2'>, <2><4'>, <2><6'>, <2><8'>, <2'><4>,
6868 // <2'><4'>, <2'><6>, <2'><6'>, <2'><8>, <2'><8'>,
6869 // <4><4'>, <4><6'>, <4><8'>, <4'><6>, <4'><6'>,
6870 // <4'><8>, <4'><8'>, <6><6'>, <6><8'>, <6'><8>,
6871 // <6'><8'>, <8><8'>.
6873 Int_t typeFlag = -1;
6874 Int_t ptEtaFlag = -1;
6879 } else if(type == "POI")
6887 } else if(ptOrEta == "Eta")
6894 Int_t pe = ptEtaFlag;
6897 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6898 Double_t minPtEta[2] = {fPtMin,fEtaMin};
6899 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
6901 // protections // to be improved (add protection for all pointers in this method)
6902 if(!fIntFlowCorrelationsEBE)
6904 cout<<"WARNING: fIntFlowCorrelationsEBE is NULL in AFAWQC::CDFPOC() !!!!"<<endl;
6909 Double_t dMult = (*fSMpk)(0,0); // multiplicity (number of particles used to determine the reaction plane)
6910 //Double_t mr = 0.; // number of RPs in particular pt or eta bin
6911 Double_t mp = 0.; // number of POIs in particular pt or eta bin
6912 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin
6915 // e-b-e correlations:
6916 Double_t twoEBE = fIntFlowCorrelationsEBE->GetBinContent(1); // <2>
6917 Double_t fourEBE = fIntFlowCorrelationsEBE->GetBinContent(2); // <4>
6918 Double_t sixEBE = fIntFlowCorrelationsEBE->GetBinContent(3); // <6>
6919 Double_t eightEBE = fIntFlowCorrelationsEBE->GetBinContent(4); // <8>
6921 // event weights for correlations:
6922 Double_t dW2 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1); // event weight for <2>
6923 Double_t dW4 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2); // event weight for <4>
6924 Double_t dW6 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(3); // event weight for <6>
6925 Double_t dW8 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(4); // event weight for <8>
6927 // e-b-e reduced correlations:
6928 Double_t twoReducedEBE = 0.; // <2'>
6929 Double_t fourReducedEBE = 0.; // <4'>
6930 Double_t sixReducedEBE = 0.; // <6'>
6931 Double_t eightReducedEBE = 0.; // <8'>
6933 // event weights for reduced correlations:
6934 Double_t dw2 = 0.; // event weight for <2'>
6935 Double_t dw4 = 0.; // event weight for <4'>
6936 //Double_t dw6 = 0.; // event weight for <6'>
6937 //Double_t dw8 = 0.; // event weight for <8'>
6939 // looping over bins:
6940 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6942 // e-b-e reduced correlations:
6943 twoReducedEBE = fDiffFlowCorrelationsEBE[t][pe][0]->GetBinContent(b);
6944 fourReducedEBE = fDiffFlowCorrelationsEBE[t][pe][1]->GetBinContent(b);
6945 sixReducedEBE = fDiffFlowCorrelationsEBE[t][pe][2]->GetBinContent(b);
6946 eightReducedEBE = fDiffFlowCorrelationsEBE[t][pe][3]->GetBinContent(b);
6949 // to be improved (I should not do this here again)
6952 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);
6953 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
6954 } else if(type == "POI")
6956 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);
6957 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b);
6960 // event weights for reduced correlations:
6961 dw2 = mp*dMult-mq; // weight for <2'>
6962 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6963 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.); // weight for <4'>
6969 dw2 = fDiffFlowEventWeightsForCorrelationsEBE[t][pe][0]->GetBinContent(b);
6970 dw4 = fDiffFlowEventWeightsForCorrelationsEBE[t][pe][1]->GetBinContent(b);
6972 // storing all products:
6973 fDiffFlowProductOfCorrelationsPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*twoReducedEBE,dW2*dw2); // storing <2><2'>
6974 fDiffFlowProductOfCorrelationsPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*twoReducedEBE,dW4*dw2); // storing <4><2'>
6975 fDiffFlowProductOfCorrelationsPro[t][pe][1][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*twoReducedEBE,dW6*dw2); // storing <6><2'>
6976 fDiffFlowProductOfCorrelationsPro[t][pe][1][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*twoReducedEBE,dW8*dw2); // storing <8><2'>
6978 // event weight for <4'>:
6979 fDiffFlowProductOfCorrelationsPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*fourReducedEBE,dW2*dw4); // storing <2><4'>
6980 fDiffFlowProductOfCorrelationsPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*fourReducedEBE,dw2*dw4); // storing <2'><4'>
6981 fDiffFlowProductOfCorrelationsPro[t][pe][2][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*fourReducedEBE,dW4*dw4); // storing <4><4'>
6982 fDiffFlowProductOfCorrelationsPro[t][pe][3][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*fourReducedEBE,dW6*dw4); // storing <6><4'>
6983 fDiffFlowProductOfCorrelationsPro[t][pe][3][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*fourReducedEBE,dW8*dw4); // storing <8><4'>
6985 // event weight for <6'>:
6987 //fDiffFlowProductOfCorrelationsPro[t][pe][0][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*sixReducedEBE,dW2*dw6); // storing <2><6'>
6988 //fDiffFlowProductOfCorrelationsPro[t][pe][1][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*sixReducedEBE,dw2*dw6); // storing <2'><6'>
6989 //fDiffFlowProductOfCorrelationsPro[t][pe][2][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*sixReducedEBE,dW4*dw6); // storing <4><6'>
6990 //fDiffFlowProductOfCorrelationsPro[t][pe][3][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourReducedEBE*sixReducedEBE,dw4*dw6); // storing <4'><6'>
6991 //fDiffFlowProductOfCorrelationsPro[t][pe][4][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*sixReducedEBE,dW6*dw6); // storing <6><6'>
6992 //fDiffFlowProductOfCorrelationsPro[t][pe][5][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightEBE,dw6*dW8); // storing <6'><8>
6993 //fDiffFlowProductOfCorrelationsPro[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightReducedEBE,dw6*dw8); // storing <6'><8'>
6995 // event weight for <8'>:
6997 //fDiffFlowProductOfCorrelationsPro[t][pe][0][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*eightReducedEBE,dW2*dw8); // storing <2><8'>
6998 //fDiffFlowProductOfCorrelationsPro[t][pe][1][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*eightReducedEBE,dw2*dw8); // storing <2'><8'>
6999 //fDiffFlowProductOfCorrelationsPro[t][pe][2][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*eightReducedEBE,dW4*dw8); // storing <4><8'>
7000 //fDiffFlowProductOfCorrelationsPro[t][pe][3][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourReducedEBE*eightReducedEBE,dw4*dw8); // storing <4'><8'>
7001 //fDiffFlowProductOfCorrelationsPro[t][pe][4][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*eightReducedEBE,dW6*dw8); // storing <6><8'>
7002 //fDiffFlowProductOfCorrelationsPro[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightReducedEBE,dw6*dw8); // storing <6'><8'>
7003 //fDiffFlowProductOfCorrelationsPro[t][pe][6][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*eightReducedEBE,dW8*dw8); // storing <8><8'>
7004 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++
7006 } // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowProductOfCorrelations(TString type, TString ptOrEta)
7009 //================================================================================================================================
7012 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCovariances(TString type, TString ptOrEta) // to be improved (reimplemented)
7014 // a) Calculate unbiased estimators Cov(<2>,<2'>), Cov(<2>,<4'>), Cov(<4>,<2'>), Cov(<4>,<4'>) and Cov(<2'>,<4'>)
7015 // for covariances V(<2>,<2'>), V(<2>,<4'>), V(<4>,<2'>), V(<4>,<4'>) and V(<2'>,<4'>).
7016 // b) Store in histogram fDiffFlowCovariances[t][pe][index] for instance the following:
7018 // 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)]
7020 // where N is the number of events, w_{<2>} is event weight for <2> and w_{<2'>} is event weight for <2'>.
7021 // c) Binning of fDiffFlowCovariances[t][pe][index] is organized as follows:
7023 // 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)]
7024 // 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)]
7025 // 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)]
7026 // 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)]
7027 // 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)]
7030 Int_t typeFlag = -1;
7031 Int_t ptEtaFlag = -1;
7036 } else if(type == "POI")
7044 } else if(ptOrEta == "Eta")
7051 Int_t pe = ptEtaFlag;
7054 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
7055 //Double_t minPtEta[2] = {fPtMin,fEtaMin};
7056 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
7057 //Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
7059 // average correlations:
7060 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
7061 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
7062 //Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
7063 //Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
7065 // sum of weights for correlation:
7066 Double_t sumOfWeightsForTwo = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // sum_{i=1}^{N} w_{<2>}
7067 Double_t sumOfWeightsForFour = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // sum_{i=1}^{N} w_{<4>}
7068 //Double_t sumOfWeightsForSix = fIntFlowSumOfEventWeights[0]->GetBinContent(3); // sum_{i=1}^{N} w_{<6>}
7069 //Double_t sumOfWeightsForEight = fIntFlowSumOfEventWeights[0]->GetBinContent(4); // sum_{i=1}^{N} w_{<8>}
7071 // average reduced correlations:
7072 Double_t twoReduced = 0.; // <<2'>>
7073 Double_t fourReduced = 0.; // <<4'>>
7074 //Double_t sixReduced = 0.; // <<6'>>
7075 //Double_t eightReduced = 0.; // <<8'>>
7077 // sum of weights for reduced correlation:
7078 Double_t sumOfWeightsForTwoReduced = 0.; // sum_{i=1}^{N} w_{<2'>}
7079 Double_t sumOfWeightsForFourReduced = 0.; // sum_{i=1}^{N} w_{<4'>}
7080 //Double_t sumOfWeightsForSixReduced = 0.; // sum_{i=1}^{N} w_{<6'>}
7081 //Double_t sumOfWeightsForEightReduced = 0.; // sum_{i=1}^{N} w_{<8'>}
7083 // product of weights for reduced correlation:
7084 Double_t productOfWeightsForTwoTwoReduced = 0.; // sum_{i=1}^{N} w_{<2>}w_{<2'>}
7085 Double_t productOfWeightsForTwoFourReduced = 0.; // sum_{i=1}^{N} w_{<2>}w_{<4'>}
7086 Double_t productOfWeightsForFourTwoReduced = 0.; // sum_{i=1}^{N} w_{<4>}w_{<2'>}
7087 Double_t productOfWeightsForFourFourReduced = 0.; // sum_{i=1}^{N} w_{<4>}w_{<4'>}
7088 Double_t productOfWeightsForTwoReducedFourReduced = 0.; // sum_{i=1}^{N} w_{<2'>}w_{<4'>}
7091 // products for differential flow:
7092 Double_t twoTwoReduced = 0; // <<2><2'>>
7093 Double_t twoFourReduced = 0; // <<2><4'>>
7094 Double_t fourTwoReduced = 0; // <<4><2'>>
7095 Double_t fourFourReduced = 0; // <<4><4'>>
7096 Double_t twoReducedFourReduced = 0; // <<2'><4'>>
7098 // denominators in the expressions for the unbiased estimators for covariances:
7099 // denominator = 1 - term1/(term2*term3)
7100 // prefactor = term1/(term2*term3)
7101 Double_t denominator = 0.;
7102 Double_t prefactor = 0.;
7103 Double_t term1 = 0.;
7104 Double_t term2 = 0.;
7105 Double_t term3 = 0.;
7107 // unbiased estimators for covariances for differential flow:
7108 Double_t covTwoTwoReduced = 0.; // Cov(<2>,<2'>)
7109 Double_t wCovTwoTwoReduced = 0.; // Cov(<2>,<2'>) * prefactor(w_{<2>},w_{<2'>})
7110 Double_t covTwoFourReduced = 0.; // Cov(<2>,<4'>)
7111 Double_t wCovTwoFourReduced = 0.; // Cov(<2>,<4'>) * prefactor(w_{<2>},w_{<4'>})
7112 Double_t covFourTwoReduced = 0.; // Cov(<4>,<2'>)
7113 Double_t wCovFourTwoReduced = 0.; // Cov(<4>,<2'>) * prefactor(w_{<4>},w_{<2'>})
7114 Double_t covFourFourReduced = 0.; // Cov(<4>,<4'>)
7115 Double_t wCovFourFourReduced = 0.; // Cov(<4>,<4'>) * prefactor(w_{<4>},w_{<4'>})
7116 Double_t covTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>)
7117 Double_t wCovTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>) * prefactor(w_{<2'>},w_{<4'>})
7119 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7121 // average reduced corelations:
7122 twoReduced = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b);
7123 fourReduced = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b);
7124 // average products:
7125 twoTwoReduced = fDiffFlowProductOfCorrelationsPro[t][pe][0][1]->GetBinContent(b);
7126 twoFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][0][3]->GetBinContent(b);
7127 fourTwoReduced = fDiffFlowProductOfCorrelationsPro[t][pe][1][2]->GetBinContent(b);
7128 fourFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][2][3]->GetBinContent(b);
7129 twoReducedFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][1][3]->GetBinContent(b);
7130 // sum of weights for reduced correlations:
7131 sumOfWeightsForTwoReduced = fDiffFlowSumOfEventWeights[t][pe][0][0]->GetBinContent(b);
7132 sumOfWeightsForFourReduced = fDiffFlowSumOfEventWeights[t][pe][0][1]->GetBinContent(b);
7133 // products of weights for correlations:
7134 productOfWeightsForTwoTwoReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][0][1]->GetBinContent(b);
7135 productOfWeightsForTwoFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][0][3]->GetBinContent(b);
7136 productOfWeightsForFourTwoReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][1][2]->GetBinContent(b);
7137 productOfWeightsForFourFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][2][3]->GetBinContent(b);
7138 productOfWeightsForTwoReducedFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][1][3]->GetBinContent(b);
7139 // denominator for the unbiased estimator for covariances: 1 - term1/(term2*term3)
7140 // prefactor (multiplies Cov's) = term1/(term2*term3)
7142 term1 = productOfWeightsForTwoTwoReduced;
7143 term2 = sumOfWeightsForTwo;
7144 term3 = sumOfWeightsForTwoReduced;
7147 denominator = 1.-term1/(term2*term3);
7148 prefactor = term1/(term2*term3);
7149 if(TMath::Abs(denominator)>1e-6)
7151 covTwoTwoReduced = (twoTwoReduced-two*twoReduced)/denominator;
7152 wCovTwoTwoReduced = covTwoTwoReduced*prefactor;
7153 fDiffFlowCovariances[t][pe][0]->SetBinContent(b,wCovTwoTwoReduced);
7157 term1 = productOfWeightsForTwoFourReduced;
7158 term2 = sumOfWeightsForTwo;
7159 term3 = sumOfWeightsForFourReduced;
7162 denominator = 1.-term1/(term2*term3);
7163 prefactor = term1/(term2*term3);
7164 if(TMath::Abs(denominator)>1e-6)
7166 covTwoFourReduced = (twoFourReduced-two*fourReduced)/denominator;
7167 wCovTwoFourReduced = covTwoFourReduced*prefactor;
7168 fDiffFlowCovariances[t][pe][1]->SetBinContent(b,wCovTwoFourReduced);
7172 term1 = productOfWeightsForFourTwoReduced;
7173 term2 = sumOfWeightsForFour;
7174 term3 = sumOfWeightsForTwoReduced;
7177 denominator = 1.-term1/(term2*term3);
7178 prefactor = term1/(term2*term3);
7179 if(TMath::Abs(denominator)>1e-6)
7181 covFourTwoReduced = (fourTwoReduced-four*twoReduced)/denominator;
7182 wCovFourTwoReduced = covFourTwoReduced*prefactor;
7183 fDiffFlowCovariances[t][pe][2]->SetBinContent(b,wCovFourTwoReduced);
7187 term1 = productOfWeightsForFourFourReduced;
7188 term2 = sumOfWeightsForFour;
7189 term3 = sumOfWeightsForFourReduced;
7192 denominator = 1.-term1/(term2*term3);
7193 prefactor = term1/(term2*term3);
7194 if(TMath::Abs(denominator)>1e-6)
7196 covFourFourReduced = (fourFourReduced-four*fourReduced)/denominator;
7197 wCovFourFourReduced = covFourFourReduced*prefactor;
7198 fDiffFlowCovariances[t][pe][3]->SetBinContent(b,wCovFourFourReduced);
7202 term1 = productOfWeightsForTwoReducedFourReduced;
7203 term2 = sumOfWeightsForTwoReduced;
7204 term3 = sumOfWeightsForFourReduced;
7207 denominator = 1.-term1/(term2*term3);
7208 prefactor = term1/(term2*term3);
7209 if(TMath::Abs(denominator)>1e-6)
7211 covTwoReducedFourReduced = (twoReducedFourReduced-twoReduced*fourReduced)/denominator;
7212 wCovTwoReducedFourReduced = covTwoReducedFourReduced*prefactor;
7213 fDiffFlowCovariances[t][pe][4]->SetBinContent(b,wCovTwoReducedFourReduced);
7216 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7218 } // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCovariances(TString type, TString ptOrEta)
7221 //================================================================================================================================
7224 void AliFlowAnalysisWithQCumulants::CalculateDiffFlow(TString type, TString ptOrEta)
7226 // calculate differential flow from differential cumulants and previously obtained integrated flow: (to be improved: description)
7228 Int_t typeFlag = -1;
7229 Int_t ptEtaFlag = -1;
7234 } else if(type == "POI")
7242 } else if(ptOrEta == "Eta")
7249 Int_t pe = ptEtaFlag;
7252 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
7255 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
7256 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
7258 // statistical errors of correlations:
7259 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1);
7260 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2);
7262 // reduced correlations:
7263 Double_t twoReduced = 0.; // <<2'>>
7264 Double_t fourReduced = 0.; // <<4'>>
7266 // statistical errors of reduced correlations:
7267 Double_t twoReducedError = 0.;
7268 Double_t fourReducedError = 0.;
7271 Double_t wCovTwoFour = fIntFlowCovariances->GetBinContent(1);// // Cov(<2>,<4>) * prefactor(<2>,<4>)
7272 Double_t wCovTwoTwoReduced = 0.; // Cov(<2>,<2'>) * prefactor(<2>,<2'>)
7273 Double_t wCovTwoFourReduced = 0.; // Cov(<2>,<4'>) * prefactor(<2>,<4'>)
7274 Double_t wCovFourTwoReduced = 0.; // Cov(<4>,<2'>) * prefactor(<4>,<2'>)
7275 Double_t wCovFourFourReduced = 0.; // Cov(<4>,<4'>) * prefactor(<4>,<4'>)
7276 Double_t wCovTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>) * prefactor(<2'>,<4'>)
7278 // differential flow:
7279 Double_t v2Prime = 0.; // v'{2}
7280 Double_t v4Prime = 0.; // v'{4}
7282 // statistical error of differential flow:
7283 Double_t v2PrimeError = 0.;
7284 Double_t v4PrimeError = 0.;
7286 // squared statistical error of differential flow:
7287 Double_t v2PrimeErrorSquared = 0.;
7288 Double_t v4PrimeErrorSquared = 0.;
7290 // loop over pt or eta bins:
7291 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7293 // reduced correlations and statistical errors:
7294 twoReduced = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b);
7295 twoReducedError = fDiffFlowCorrelationsHist[t][pe][0]->GetBinError(b);
7296 fourReduced = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b);
7297 fourReducedError = fDiffFlowCorrelationsHist[t][pe][1]->GetBinError(b);
7299 wCovTwoTwoReduced = fDiffFlowCovariances[t][pe][0]->GetBinContent(b);
7300 wCovTwoFourReduced = fDiffFlowCovariances[t][pe][1]->GetBinContent(b);
7301 wCovFourTwoReduced = fDiffFlowCovariances[t][pe][2]->GetBinContent(b);
7302 wCovFourFourReduced = fDiffFlowCovariances[t][pe][3]->GetBinContent(b);
7303 wCovTwoReducedFourReduced = fDiffFlowCovariances[t][pe][4]->GetBinContent(b);
7304 // differential flow:
7308 v2Prime = twoReduced/pow(two,0.5);
7309 v2PrimeErrorSquared = (1./4.)*pow(two,-3.)*
7310 (pow(twoReduced,2.)*pow(twoError,2.)
7311 + 4.*pow(two,2.)*pow(twoReducedError,2.)
7312 - 4.*two*twoReduced*wCovTwoTwoReduced);
7315 if(v2PrimeErrorSquared>0.) v2PrimeError = pow(v2PrimeErrorSquared,0.5);
7316 fDiffFlow[t][pe][0]->SetBinContent(b,v2Prime);
7317 if(TMath::Abs(v2Prime)>1.e-44)fDiffFlow[t][pe][0]->SetBinError(b,v2PrimeError);
7319 // differential flow:
7321 if(2.*pow(two,2.)-four > 0.)
7323 v4Prime = (2.*two*twoReduced-fourReduced)/pow(2.*pow(two,2.)-four,3./4.);
7324 v4PrimeErrorSquared = pow(2.*pow(two,2.)-four,-7./2.)*
7325 (pow(2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced,2.)*pow(twoError,2.)
7326 + (9./16.)*pow(2.*two*twoReduced-fourReduced,2.)*pow(fourError,2.)
7327 + 4.*pow(two,2.)*pow(2.*pow(two,2.)-four,2.)*pow(twoReducedError,2.)
7328 + pow(2.*pow(two,2.)-four,2.)*pow(fourReducedError,2.)
7329 - (3./2.)*(2.*two*twoReduced-fourReduced)
7330 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoFour
7331 - 4.*two*(2.*pow(two,2.)-four)
7332 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoTwoReduced
7333 + 2.*(2.*pow(two,2.)-four)
7334 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoFourReduced
7335 + 3.*two*(2.*pow(two,2.)-four)*(2.*two*twoReduced-fourReduced)*wCovFourTwoReduced
7336 - (3./2.)*(2.*pow(two,2.)-four)*(2.*two*twoReduced-fourReduced)*wCovFourFourReduced
7337 - 4.*two*pow(2.*pow(two,2.)-four,2.)*wCovTwoReducedFourReduced);
7338 if(v4PrimeErrorSquared>0.) v4PrimeError = pow(v4PrimeErrorSquared,0.5);
7339 fDiffFlow[t][pe][1]->SetBinContent(b,v4Prime);
7340 if(TMath::Abs(v4Prime)>1.e-44)fDiffFlow[t][pe][1]->SetBinError(b,v4PrimeError);
7343 } // end of for(Int_t b=1;b<=fnBinsPtEta[pe];b++)
7350 for(Int_t nua=0;nua<2;nua++)
7352 for(Int_t p=1;p<=fnBinsPt;p++)
7354 for(Int_t e=1;e<=fnBinsEta;e++)
7356 // differential cumulants:
7357 Double_t qc2Prime = fFinalCumulants2D[t][pW][eW][nua][0]->GetBinContent(fFinalCumulants2D[t][pW][eW][nua][0]->GetBin(p,e)); // QC{2'}
7358 Double_t qc4Prime = fFinalCumulants2D[t][pW][eW][nua][1]->GetBinContent(fFinalCumulants2D[t][pW][eW][nua][1]->GetBin(p,e)); // QC{4'}
7359 // differential flow:
7360 Double_t v2Prime = 0.;
7361 Double_t v4Prime = 0.;
7364 v2Prime = qc2Prime/v2;
7365 fFinalFlow2D[t][pW][eW][nua][0]->SetBinContent(fFinalFlow2D[t][pW][eW][nua][0]->GetBin(p,e),v2Prime);
7369 v4Prime = -qc4Prime/pow(v4,3.);
7370 fFinalFlow2D[t][pW][eW][nua][1]->SetBinContent(fFinalFlow2D[t][pW][eW][nua][1]->GetBin(p,e),v4Prime);
7372 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
7373 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
7374 } // end of for(Int_t nua=0;nua<2;nua++)
7377 } // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlow(TString type, Bool_t useParticleWeights)
7379 //================================================================================================================================
7381 void AliFlowAnalysisWithQCumulants::StoreIntFlowFlags()
7383 // a) Store all flags for integrated flow in profile fIntFlowFlags.
7387 cout<<"WARNING: fIntFlowFlags is NULL in AFAWQC::SFFIF() !!!!"<<endl;
7391 // particle weights used or not:
7392 fIntFlowFlags->Fill(0.5,(Int_t)fUsePhiWeights||fUsePtWeights||fUseEtaWeights);
7393 // which event weights were used:
7394 if(strcmp(fMultiplicityWeight->Data(),"combinations"))
7396 fIntFlowFlags->Fill(1.5,0); // 0 = "combinations" (default)
7397 } else if(strcmp(fMultiplicityWeight->Data(),"unit"))
7399 fIntFlowFlags->Fill(1.5,1); // 1 = "unit"
7400 } else if(strcmp(fMultiplicityWeight->Data(),"multiplicity"))
7402 fIntFlowFlags->Fill(1.5,2); // 2 = "multiplicity"
7404 // corrected for non-uniform acceptance or not:
7405 fIntFlowFlags->Fill(2.5,(Int_t)fApplyCorrectionForNUA);
7406 fIntFlowFlags->Fill(3.5,(Int_t)fPrintFinalResults[0]);
7407 fIntFlowFlags->Fill(4.5,(Int_t)fPrintFinalResults[1]);
7408 fIntFlowFlags->Fill(5.5,(Int_t)fPrintFinalResults[2]);
7409 fIntFlowFlags->Fill(6.5,(Int_t)fPrintFinalResults[3]);
7410 fIntFlowFlags->Fill(7.5,(Int_t)fApplyCorrectionForNUAVsM);
7411 fIntFlowFlags->Fill(8.5,(Int_t)fPropagateErrorFromCorrelations);
7412 fIntFlowFlags->Fill(9.5,(Int_t)fCalculateCumulantsVsM);
7413 fIntFlowFlags->Fill(10.5,(Int_t)fMinimumBiasReferenceFlow);
7415 } // end of void AliFlowAnalysisWithQCumulants::StoreIntFlowFlags()
7417 //================================================================================================================================
7419 void AliFlowAnalysisWithQCumulants::StoreDiffFlowFlags()
7421 // Store all flags for differential flow in the profile fDiffFlowFlags.
7425 cout<<"WARNING: fDiffFlowFlags is NULL in AFAWQC::SFFDF() !!!!"<<endl;
7429 fDiffFlowFlags->Fill(0.5,fUsePhiWeights||fUsePtWeights||fUseEtaWeights); // particle weights used or not
7430 //fDiffFlowFlags->Fill(1.5,""); // which event weight was used? // to be improved
7431 fDiffFlowFlags->Fill(2.5,fApplyCorrectionForNUA); // corrected for non-uniform acceptance or not
7432 fDiffFlowFlags->Fill(3.5,fCalculate2DFlow); // calculate also 2D differential flow in (pt,eta) or not
7434 } // end of void AliFlowAnalysisWithQCumulants::StoreDiffFlowFlags()
7437 //================================================================================================================================
7440 void AliFlowAnalysisWithQCumulants::GetPointersForCommonHistograms()
7442 // Access all pointers to common control and common result histograms and profiles.
7444 TString commonHistsName = "AliFlowCommonHistQC";
7445 commonHistsName += fAnalysisLabel->Data();
7446 AliFlowCommonHist *commonHist = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHistsName.Data()));
7447 if(commonHist) this->SetCommonHists(commonHist);
7448 TString commonHists2ndOrderName = "AliFlowCommonHist2ndOrderQC";
7449 commonHists2ndOrderName += fAnalysisLabel->Data();
7450 AliFlowCommonHist *commonHist2nd = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists2ndOrderName.Data()));
7451 if(commonHist2nd) this->SetCommonHists2nd(commonHist2nd);
7452 TString commonHists4thOrderName = "AliFlowCommonHist4thOrderQC";
7453 commonHists4thOrderName += fAnalysisLabel->Data();
7454 AliFlowCommonHist *commonHist4th = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists4thOrderName.Data()));
7455 if(commonHist4th) this->SetCommonHists4th(commonHist4th);
7456 TString commonHists6thOrderName = "AliFlowCommonHist6thOrderQC";
7457 commonHists6thOrderName += fAnalysisLabel->Data();
7458 AliFlowCommonHist *commonHist6th = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists6thOrderName.Data()));
7459 if(commonHist6th) this->SetCommonHists6th(commonHist6th);
7460 TString commonHists8thOrderName = "AliFlowCommonHist8thOrderQC";
7461 commonHists8thOrderName += fAnalysisLabel->Data();
7462 AliFlowCommonHist *commonHist8th = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists8thOrderName.Data()));
7463 if(commonHist8th) this->SetCommonHists8th(commonHist8th);
7464 TString commonHistResults2ndOrderName = "AliFlowCommonHistResults2ndOrderQC";
7465 commonHistResults2ndOrderName += fAnalysisLabel->Data();
7466 AliFlowCommonHistResults *commonHistRes2nd = dynamic_cast<AliFlowCommonHistResults*> (fHistList->FindObject(commonHistResults2ndOrderName.Data()));
7467 if(commonHistRes2nd) this->SetCommonHistsResults2nd(commonHistRes2nd);
7468 TString commonHistResults4thOrderName = "AliFlowCommonHistResults4thOrderQC";
7469 commonHistResults4thOrderName += fAnalysisLabel->Data();
7470 AliFlowCommonHistResults *commonHistRes4th = dynamic_cast<AliFlowCommonHistResults*>
7471 (fHistList->FindObject(commonHistResults4thOrderName.Data()));
7472 if(commonHistRes4th) this->SetCommonHistsResults4th(commonHistRes4th);
7473 TString commonHistResults6thOrderName = "AliFlowCommonHistResults6thOrderQC";
7474 commonHistResults6thOrderName += fAnalysisLabel->Data();
7475 AliFlowCommonHistResults *commonHistRes6th = dynamic_cast<AliFlowCommonHistResults*>
7476 (fHistList->FindObject(commonHistResults6thOrderName.Data()));
7477 if(commonHistRes6th) this->SetCommonHistsResults6th(commonHistRes6th);
7478 TString commonHistResults8thOrderName = "AliFlowCommonHistResults8thOrderQC";
7479 commonHistResults8thOrderName += fAnalysisLabel->Data();
7480 AliFlowCommonHistResults *commonHistRes8th = dynamic_cast<AliFlowCommonHistResults*>
7481 (fHistList->FindObject(commonHistResults8thOrderName.Data()));
7482 if(commonHistRes8th) this->SetCommonHistsResults8th(commonHistRes8th);
7484 } // end of void AliFlowAnalysisWithQCumulants::GetPointersForCommonHistograms()
7487 //================================================================================================================================
7490 void AliFlowAnalysisWithQCumulants::GetPointersForParticleWeightsHistograms()
7492 // Get pointers for histograms with particle weights.
7494 TList *weightsList = dynamic_cast<TList*>(fHistList->FindObject("Weights"));
7495 if(weightsList) this->SetWeightsList(weightsList);
7496 TString fUseParticleWeightsName = "fUseParticleWeightsQC"; // to be improved (hirdwired label QC)
7497 fUseParticleWeightsName += fAnalysisLabel->Data();
7498 TProfile *useParticleWeights = dynamic_cast<TProfile*>(weightsList->FindObject(fUseParticleWeightsName.Data()));
7499 if(useParticleWeights)
7501 this->SetUseParticleWeights(useParticleWeights);
7502 fUsePhiWeights = (Int_t)fUseParticleWeights->GetBinContent(1);
7503 fUsePtWeights = (Int_t)fUseParticleWeights->GetBinContent(2);
7504 fUseEtaWeights = (Int_t)fUseParticleWeights->GetBinContent(3);
7506 } // end of void AliFlowAnalysisWithQCumulants::GetPointersForParticleWeightsHistograms();
7509 //================================================================================================================================
7512 void AliFlowAnalysisWithQCumulants::GetPointersForIntFlowHistograms()
7514 // Get pointers for histograms and profiles relevant for integrated flow:
7515 // a) Get pointer to base list for integrated flow holding profile fIntFlowFlags and lists fIntFlowProfiles and fIntFlowResults.
7516 // b) Get pointer to profile fIntFlowFlags holding all flags for integrated flow.
7517 // c) Get pointer to list fIntFlowProfiles and pointers to all objects that she holds.
7518 // d) Get pointer to list fIntFlowResults and pointers to all objects that she holds.
7520 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data member?)
7521 TString powerFlag[2] = {"linear","quadratic"}; // to be improved (should I promote this to data member?)
7522 TString correlationFlag[4] = {"<<2>>","<<4>>","<<6>>","<<8>>"}; // to be improved (should I promote this to data member?)
7524 // a) Get pointer to base list for integrated flow holding profile fIntFlowFlags and lists fIntFlowProfiles and fIntFlowResults:
7525 TList *intFlowList = NULL;
7526 intFlowList = dynamic_cast<TList*>(fHistList->FindObject("Integrated Flow"));
7529 cout<<"WARNING: intFlowList is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7533 // b) Get pointer to profile fIntFlowFlags holding all flags for integrated flow:
7534 TString intFlowFlagsName = "fIntFlowFlags";
7535 intFlowFlagsName += fAnalysisLabel->Data();
7536 TProfile *intFlowFlags = dynamic_cast<TProfile*>(intFlowList->FindObject(intFlowFlagsName.Data()));
7539 this->SetIntFlowFlags(intFlowFlags);
7540 fApplyCorrectionForNUA = (Bool_t)intFlowFlags->GetBinContent(3); // to be improved (hardwired 3)
7541 fCalculateCumulantsVsM = (Bool_t)intFlowFlags->GetBinContent(10); // to be improved (hardwired 9)
7544 cout<<"WARNING: intFlowFlags is NULL in FAWQC::GPFIFH() !!!!"<<endl;
7547 // c) Get pointer to list fIntFlowProfiles and pointers to all objects that she holds:
7548 TList *intFlowProfiles = NULL;
7549 intFlowProfiles = dynamic_cast<TList*>(intFlowList->FindObject("Profiles"));
7552 // average multiplicities:
7553 TString avMultiplicityName = "fAvMultiplicity";
7554 avMultiplicityName += fAnalysisLabel->Data();
7555 TProfile *avMultiplicity = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(avMultiplicityName.Data()));
7558 this->SetAvMultiplicity(avMultiplicity);
7561 cout<<"WARNING: avMultiplicity is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7563 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with wrong errors!):
7564 TString intFlowCorrelationsProName = "fIntFlowCorrelationsPro";
7565 intFlowCorrelationsProName += fAnalysisLabel->Data();
7566 TProfile *intFlowCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowCorrelationsProName.Data()));
7567 if(intFlowCorrelationsPro)
7569 this->SetIntFlowCorrelationsPro(intFlowCorrelationsPro);
7572 cout<<"WARNING: intFlowCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7574 // average correlations <<2>>, <<4>>, <<6>> and <<8>> versus multiplicity for all events (error is wrong here):
7575 if(fCalculateCumulantsVsM)
7577 TString intFlowCorrelationsVsMProName = "fIntFlowCorrelationsVsMPro";
7578 intFlowCorrelationsVsMProName += fAnalysisLabel->Data();
7579 for(Int_t ci=0;ci<4;ci++) // correlation index
7581 TProfile *intFlowCorrelationsVsMPro = dynamic_cast<TProfile*>
7582 (intFlowProfiles->FindObject(Form("%s, %s",intFlowCorrelationsVsMProName.Data(),correlationFlag[ci].Data())));
7583 if(intFlowCorrelationsVsMPro)
7585 this->SetIntFlowCorrelationsVsMPro(intFlowCorrelationsVsMPro,ci);
7588 cout<<"WARNING: "<<Form("intFlowCorrelationsVsMPro[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7590 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
7591 } // end of if(fCalculateCumulantsVsM)
7592 // average all correlations for integrated flow (with wrong errors!):
7593 TString intFlowCorrelationsAllProName = "fIntFlowCorrelationsAllPro";
7594 intFlowCorrelationsAllProName += fAnalysisLabel->Data();
7595 TProfile *intFlowCorrelationsAllPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowCorrelationsAllProName.Data()));
7596 if(intFlowCorrelationsAllPro)
7598 this->SetIntFlowCorrelationsAllPro(intFlowCorrelationsAllPro);
7601 cout<<"WARNING: intFlowCorrelationsAllPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7603 // average extra correlations for integrated flow (which appear only when particle weights are used):
7604 // (to be improved: Weak point in implementation, I am assuming here that method GetPointersForParticleWeightsHistograms() was called)
7605 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
7607 TString intFlowExtraCorrelationsProName = "fIntFlowExtraCorrelationsPro";
7608 intFlowExtraCorrelationsProName += fAnalysisLabel->Data();
7609 TProfile *intFlowExtraCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowExtraCorrelationsProName.Data()));
7610 if(intFlowExtraCorrelationsPro)
7612 this->SetIntFlowExtraCorrelationsPro(intFlowExtraCorrelationsPro);
7615 cout<<"WARNING: intFlowExtraCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7617 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
7618 // average products of correlations <2>, <4>, <6> and <8>:
7619 TString intFlowProductOfCorrelationsProName = "fIntFlowProductOfCorrelationsPro";
7620 intFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
7621 TProfile *intFlowProductOfCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowProductOfCorrelationsProName.Data()));
7622 if(intFlowProductOfCorrelationsPro)
7624 this->SetIntFlowProductOfCorrelationsPro(intFlowProductOfCorrelationsPro);
7627 cout<<"WARNING: intFlowProductOfCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7629 // average product of correlations <2>, <4>, <6> and <8> versus multiplicity
7630 // [0=<<2><4>>,1=<<2><6>>,2=<<2><8>>,3=<<4><6>>,4=<<4><8>>,5=<<6><8>>]
7631 if(fCalculateCumulantsVsM)
7633 TString intFlowProductOfCorrelationsVsMProName = "fIntFlowProductOfCorrelationsVsMPro";
7634 intFlowProductOfCorrelationsVsMProName += fAnalysisLabel->Data();
7635 TString productFlag[6] = {"<<2><4>>","<<2><6>>","<<2><8>>","<<4><6>>","<<4><8>>","<<6><8>>"};
7636 for(Int_t pi=0;pi<6;pi++)
7638 TProfile *intFlowProductOfCorrelationsVsMPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(Form("%s, %s",intFlowProductOfCorrelationsVsMProName.Data(),productFlag[pi].Data())));
7639 if(intFlowProductOfCorrelationsVsMPro)
7641 this->SetIntFlowProductOfCorrelationsVsMPro(intFlowProductOfCorrelationsVsMPro,pi);
7644 cout<<"WARNING: "<<Form("intFlowProductOfCorrelationsVsMPro[%d]",pi)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7646 } // end of for(Int_t pi=0;pi<6;pi++)
7647 } // end of if(fCalculateCumulantsVsM)
7648 // average correction terms for non-uniform acceptance (with wrong errors!):
7649 for(Int_t sc=0;sc<2;sc++)
7651 TString intFlowCorrectionTermsForNUAProName = "fIntFlowCorrectionTermsForNUAPro";
7652 intFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
7653 TProfile *intFlowCorrectionTermsForNUAPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject((Form("%s: %s terms",intFlowCorrectionTermsForNUAProName.Data(),sinCosFlag[sc].Data()))));
7654 if(intFlowCorrectionTermsForNUAPro)
7656 this->SetIntFlowCorrectionTermsForNUAPro(intFlowCorrectionTermsForNUAPro,sc);
7659 cout<<"WARNING: intFlowCorrectionTermsForNUAPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7660 cout<<"sc = "<<sc<<endl;
7662 // versus multiplicity:
7663 if(fCalculateCumulantsVsM)
7665 TString correctionTermFlag[4] = {"(n(phi1))","(n(phi1+phi2))","(n(phi1-phi2-phi3))","(n(2phi1-phi2))"}; // to be improved - hardwired 4
7666 TString intFlowCorrectionTermsForNUAVsMProName = "fIntFlowCorrectionTermsForNUAVsMPro";
7667 intFlowCorrectionTermsForNUAVsMProName += fAnalysisLabel->Data();
7668 for(Int_t ci=0;ci<4;ci++) // correction term index (to be improved - hardwired 4)
7670 TProfile *intFlowCorrectionTermsForNUAVsMPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(Form("%s: #LT#LT%s%s#GT#GT",intFlowCorrectionTermsForNUAVsMProName.Data(),sinCosFlag[sc].Data(),correctionTermFlag[ci].Data())));
7671 if(intFlowCorrectionTermsForNUAVsMPro)
7673 this->SetIntFlowCorrectionTermsForNUAVsMPro(intFlowCorrectionTermsForNUAVsMPro,sc,ci);
7676 cout<<"WARNING: intFlowCorrectionTermsForNUAVsMPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7677 cout<<"sc = "<<sc<<endl;
7678 cout<<"ci = "<<ci<<endl;
7680 } // end of for(Int_t ci=0;ci<4;ci++) // correction term index (to be improved - hardwired 4)
7681 } // end of if(fCalculateCumulantsVsM)
7682 } // end of for(Int_t sc=0;sc<2;sc++)
7683 // average products of correction terms for NUA:
7684 TString intFlowProductOfCorrectionTermsForNUAProName = "fIntFlowProductOfCorrectionTermsForNUAPro";
7685 intFlowProductOfCorrectionTermsForNUAProName += fAnalysisLabel->Data();
7686 TProfile *intFlowProductOfCorrectionTermsForNUAPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowProductOfCorrectionTermsForNUAProName.Data()));
7687 if(intFlowProductOfCorrectionTermsForNUAPro)
7689 this->SetIntFlowProductOfCorrectionTermsForNUAPro(intFlowProductOfCorrectionTermsForNUAPro);
7692 cout<<"WARNING: intFlowProductOfCorrectionTermsForNUAPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7694 } else // to if(intFlowProfiles)
7696 cout<<"WARNING: intFlowProfiles is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7699 // d) Get pointer to list fIntFlowResults and pointers to all objects that she holds.
7700 TList *intFlowResults = NULL;
7701 intFlowResults = dynamic_cast<TList*>(intFlowList->FindObject("Results"));
7704 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with correct errors!):
7705 TString intFlowCorrelationsHistName = "fIntFlowCorrelationsHist";
7706 intFlowCorrelationsHistName += fAnalysisLabel->Data();
7707 TH1D *intFlowCorrelationsHist = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCorrelationsHistName.Data()));
7708 if(intFlowCorrelationsHist)
7710 this->SetIntFlowCorrelationsHist(intFlowCorrelationsHist);
7713 cout<<"WARNING: intFlowCorrelationsHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7715 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with correct errors!) vs M:
7716 if(fCalculateCumulantsVsM)
7718 TString intFlowCorrelationsVsMHistName = "fIntFlowCorrelationsVsMHist";
7719 intFlowCorrelationsVsMHistName += fAnalysisLabel->Data();
7720 for(Int_t ci=0;ci<4;ci++) // correlation index
7722 TH1D *intFlowCorrelationsVsMHist = dynamic_cast<TH1D*>
7723 (intFlowResults->FindObject(Form("%s, %s",intFlowCorrelationsVsMHistName.Data(),correlationFlag[ci].Data())));
7724 if(intFlowCorrelationsVsMHist)
7726 this->SetIntFlowCorrelationsVsMHist(intFlowCorrelationsVsMHist,ci);
7729 cout<<"WARNING: "<<Form("intFlowCorrelationsVsMHist[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7731 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
7732 } // end of if(fCalculateCumulantsVsM)
7733 // average all correlations for integrated flow (with correct errors!):
7734 TString intFlowCorrelationsAllHistName = "fIntFlowCorrelationsAllHist";
7735 intFlowCorrelationsAllHistName += fAnalysisLabel->Data();
7736 TH1D *intFlowCorrelationsAllHist = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCorrelationsAllHistName.Data()));
7737 if(intFlowCorrelationsAllHist)
7739 this->SetIntFlowCorrelationsAllHist(intFlowCorrelationsAllHist);
7742 cout<<"WARNING: intFlowCorrelationsAllHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7744 // average correction terms for non-uniform acceptance (with correct errors!):
7745 TString intFlowCorrectionTermsForNUAHistName = "fIntFlowCorrectionTermsForNUAHist";
7746 intFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
7747 for(Int_t sc=0;sc<2;sc++)
7749 TH1D *intFlowCorrectionTermsForNUAHist = dynamic_cast<TH1D*>(intFlowResults->FindObject((Form("%s: %s terms",intFlowCorrectionTermsForNUAHistName.Data(),sinCosFlag[sc].Data()))));
7750 if(intFlowCorrectionTermsForNUAHist)
7752 this->SetIntFlowCorrectionTermsForNUAHist(intFlowCorrectionTermsForNUAHist,sc);
7755 cout<<"WARNING: intFlowCorrectionTermsForNUAHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7756 cout<<"sc = "<<sc<<endl;
7758 } // end of for(Int_t sc=0;sc<2;sc++)
7759 // covariances (multiplied with weight dependent prefactor):
7760 TString intFlowCovariancesName = "fIntFlowCovariances";
7761 intFlowCovariancesName += fAnalysisLabel->Data();
7762 TH1D *intFlowCovariances = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCovariancesName.Data()));
7763 if(intFlowCovariances)
7765 this->SetIntFlowCovariances(intFlowCovariances);
7768 cout<<"WARNING: intFlowCovariances is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7770 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8>:
7771 TString intFlowSumOfEventWeightsName = "fIntFlowSumOfEventWeights";
7772 intFlowSumOfEventWeightsName += fAnalysisLabel->Data();
7773 for(Int_t power=0;power<2;power++)
7775 TH1D *intFlowSumOfEventWeights = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s: %s",intFlowSumOfEventWeightsName.Data(),powerFlag[power].Data())));
7776 if(intFlowSumOfEventWeights)
7778 this->SetIntFlowSumOfEventWeights(intFlowSumOfEventWeights,power);
7781 cout<<"WARNING: intFlowSumOfEventWeights is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7782 cout<<"power = "<<power<<endl;
7784 } // end of for(Int_t power=0;power<2;power++)
7785 // sum of products of event weights for correlations <2>, <4>, <6> and <8>:
7786 TString intFlowSumOfProductOfEventWeightsName = "fIntFlowSumOfProductOfEventWeights";
7787 intFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
7788 TH1D *intFlowSumOfProductOfEventWeights = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowSumOfProductOfEventWeightsName.Data()));
7789 if(intFlowSumOfProductOfEventWeights)
7791 this->SetIntFlowSumOfProductOfEventWeights(intFlowSumOfProductOfEventWeights);
7794 cout<<"WARNING: intFlowSumOfProductOfEventWeights is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7796 // final result for covariances of correlations (multiplied with weight dependent prefactor) versus M
7797 // [0=Cov(2,4),1=Cov(2,6),2=Cov(2,8),3=Cov(4,6),4=Cov(4,8),5=Cov(6,8)]:
7798 if(fCalculateCumulantsVsM)
7800 TString intFlowCovariancesVsMName = "fIntFlowCovariancesVsM";
7801 intFlowCovariancesVsMName += fAnalysisLabel->Data();
7802 TString covarianceFlag[6] = {"Cov(<2>,<4>)","Cov(<2>,<6>)","Cov(<2>,<8>)","Cov(<4>,<6>)","Cov(<4>,<8>)","Cov(<6>,<8>)"};
7803 for(Int_t ci=0;ci<6;ci++)
7805 TH1D *intFlowCovariancesVsM = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s, %s",intFlowCovariancesVsMName.Data(),covarianceFlag[ci].Data())));
7806 if(intFlowCovariancesVsM)
7808 this->SetIntFlowCovariancesVsM(intFlowCovariancesVsM,ci);
7811 cout<<"WARNING: "<<Form("intFlowCovariancesVsM[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7813 } // end of for(Int_t ci=0;ci<6;ci++)
7814 } // end of if(fCalculateCumulantsVsM)
7815 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8> versus multiplicity
7816 // [0=sum{w_{<2>}},1=sum{w_{<4>}},2=sum{w_{<6>}},3=sum{w_{<8>}}][0=linear 1,1=quadratic]:
7817 if(fCalculateCumulantsVsM)
7819 TString intFlowSumOfEventWeightsVsMName = "fIntFlowSumOfEventWeightsVsM";
7820 intFlowSumOfEventWeightsVsMName += fAnalysisLabel->Data();
7821 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>}"},
7822 {"#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}"}};
7823 for(Int_t si=0;si<4;si++)
7825 for(Int_t power=0;power<2;power++)
7827 TH1D *intFlowSumOfEventWeightsVsM = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s, %s",intFlowSumOfEventWeightsVsMName.Data(),sumFlag[power][si].Data())));
7828 if(intFlowSumOfEventWeightsVsM)
7830 this->SetIntFlowSumOfEventWeightsVsM(intFlowSumOfEventWeightsVsM,si,power);
7833 cout<<"WARNING: "<<Form("intFlowSumOfEventWeightsVsM[%d][%d]",si,power)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7835 } // end of for(Int_t power=0;power<2;power++)
7836 } // end of for(Int_t si=0;si<4;si++)
7837 } // end of if(fCalculateCumulantsVsM)
7838 // sum of products of event weights for correlations <2>, <4>, <6> and <8> vs M
7839 // [0=sum{w_{<2>}w_{<4>}},1=sum{w_{<2>}w_{<6>}},2=sum{w_{<2>}w_{<8>}},
7840 // 3=sum{w_{<4>}w_{<6>}},4=sum{w_{<4>}w_{<8>}},5=sum{w_{<6>}w_{<8>}}]:
7841 if(fCalculateCumulantsVsM)
7843 TString intFlowSumOfProductOfEventWeightsVsMName = "fIntFlowSumOfProductOfEventWeightsVsM";
7844 intFlowSumOfProductOfEventWeightsVsMName += fAnalysisLabel->Data();
7845 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>}",
7846 "#sum_{i=1}^{N} w_{<4>} w_{<6>}","#sum_{i=1}^{N} w_{<4>} w_{<8>}","#sum_{i=1}^{N} w_{<6>} w_{<8>}"};
7847 for(Int_t pi=0;pi<6;pi++)
7849 TH1D *intFlowSumOfProductOfEventWeightsVsM = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s, %s",intFlowSumOfProductOfEventWeightsVsMName.Data(),sopowFlag[pi].Data())));
7850 if(intFlowSumOfProductOfEventWeightsVsM)
7852 this->SetIntFlowSumOfProductOfEventWeightsVsM(intFlowSumOfProductOfEventWeightsVsM,pi);
7855 cout<<"WARNING: "<<Form("intFlowSumOfProductOfEventWeightsVsM[%d]",pi)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7857 } // end of for(Int_t pi=0;pi<6;pi++)
7858 } // end of if(fCalculateCumulantsVsM)
7859 // covariances for NUA (multiplied with weight dependent prefactor):
7860 TString intFlowCovariancesNUAName = "fIntFlowCovariancesNUA";
7861 intFlowCovariancesNUAName += fAnalysisLabel->Data();
7862 TH1D *intFlowCovariancesNUA = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCovariancesNUAName.Data()));
7863 if(intFlowCovariancesNUA)
7865 this->SetIntFlowCovariancesNUA(intFlowCovariancesNUA);
7868 cout<<"WARNING: intFlowCovariancesNUA is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7870 // sum of linear and quadratic event weights NUA terms:
7871 TString intFlowSumOfEventWeightsNUAName = "fIntFlowSumOfEventWeightsNUA";
7872 intFlowSumOfEventWeightsNUAName += fAnalysisLabel->Data();
7873 for(Int_t sc=0;sc<2;sc++)
7875 for(Int_t power=0;power<2;power++)
7877 TH1D *intFlowSumOfEventWeightsNUA = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s: %s, %s",intFlowSumOfEventWeightsNUAName.Data(),powerFlag[power].Data(),sinCosFlag[sc].Data())));
7878 if(intFlowSumOfEventWeightsNUA)
7880 this->SetIntFlowSumOfEventWeightsNUA(intFlowSumOfEventWeightsNUA,sc,power);
7883 cout<<"WARNING: intFlowSumOfEventWeightsNUA is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7884 cout<<"sc = "<<sc<<endl;
7885 cout<<"power = "<<power<<endl;
7887 } // end of for(Int_t power=0;power<2;power++)
7888 } // end of for(Int_t sc=0;sc<2;sc++)
7889 // sum of products of event weights for NUA terms:
7890 TString intFlowSumOfProductOfEventWeightsNUAName = "fIntFlowSumOfProductOfEventWeightsNUA";
7891 intFlowSumOfProductOfEventWeightsNUAName += fAnalysisLabel->Data();
7892 TH1D *intFlowSumOfProductOfEventWeightsNUA = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowSumOfProductOfEventWeightsNUAName.Data()));
7893 if(intFlowSumOfProductOfEventWeightsNUA)
7895 this->SetIntFlowSumOfProductOfEventWeightsNUA(intFlowSumOfProductOfEventWeightsNUA);
7898 cout<<"WARNING: intFlowSumOfProductOfEventWeightsNUA is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7900 // Final results for reference Q-cumulants:
7901 TString intFlowQcumulantsName = "fIntFlowQcumulants";
7902 intFlowQcumulantsName += fAnalysisLabel->Data();
7903 TH1D *intFlowQcumulants = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowQcumulantsName.Data()));
7904 if(intFlowQcumulants)
7906 this->SetIntFlowQcumulants(intFlowQcumulants);
7909 cout<<"WARNING: intFlowQcumulants is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7911 // Final results for reference Q-cumulants rebinned in M:
7912 if(fCalculateCumulantsVsM)
7914 TString intFlowQcumulantsRebinnedInMName = "fIntFlowQcumulantsRebinnedInM";
7915 intFlowQcumulantsRebinnedInMName += fAnalysisLabel->Data();
7916 TH1D *intFlowQcumulantsRebinnedInM = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowQcumulantsRebinnedInMName.Data()));
7917 if(intFlowQcumulantsRebinnedInM)
7919 this->SetIntFlowQcumulantsRebinnedInM(intFlowQcumulantsRebinnedInM);
7922 cout<<"WARNING: intFlowQcumulantsRebinnedInM is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7924 } // end of if(fCalculateCumulantsVsM)
7925 // final results for integrated Q-cumulants versus multiplicity:
7926 TString cumulantFlag[4] = {"QC{2}","QC{4}","QC{6}","QC{8}"};
7927 if(fCalculateCumulantsVsM)
7929 TString intFlowQcumulantsVsMName = "fIntFlowQcumulantsVsM";
7930 intFlowQcumulantsVsMName += fAnalysisLabel->Data();
7931 for(Int_t co=0;co<4;co++) // cumulant order
7933 TH1D *intFlowQcumulantsVsM = dynamic_cast<TH1D*>
7934 (intFlowResults->FindObject(Form("%s, %s",intFlowQcumulantsVsMName.Data(),cumulantFlag[co].Data())));
7935 if(intFlowQcumulantsVsM)
7937 this->SetIntFlowQcumulantsVsM(intFlowQcumulantsVsM,co);
7940 cout<<"WARNING: "<<Form("intFlowQcumulantsVsM[%d]",co)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7942 } // end of for(Int_t co=0;co<4;co++) // cumulant order
7943 } // end of if(fCalculateCumulantsVsM)
7944 // Final reference flow estimates from Q-cumulants:
7945 TString intFlowName = "fIntFlow";
7946 intFlowName += fAnalysisLabel->Data();
7947 TH1D *intFlow = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowName.Data()));
7950 this->SetIntFlow(intFlow);
7953 cout<<"WARNING: intFlow is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7955 // Final reference flow estimates from Q-cumulants vs M rebinned in M:
7956 if(fCalculateCumulantsVsM)
7958 TString intFlowRebinnedInMName = "fIntFlowRebinnedInM";
7959 intFlowRebinnedInMName += fAnalysisLabel->Data();
7960 TH1D *intFlowRebinnedInM = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowRebinnedInMName.Data()));
7961 if(intFlowRebinnedInM)
7963 this->SetIntFlowRebinnedInM(intFlowRebinnedInM);
7966 cout<<"WARNING: intFlowRebinnedInM is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7968 } // end of if(fCalculateCumulantsVsM)
7969 // integrated flow from Q-cumulants versus multiplicity:
7970 if(fCalculateCumulantsVsM)
7972 TString intFlowVsMName = "fIntFlowVsM";
7973 intFlowVsMName += fAnalysisLabel->Data();
7974 TString flowFlag[4] = {"v_{2}{2,QC}","v_{2}{4,QC}","v_{2}{6,QC}","v_{2}{8,QC}"}; // to be improved (harwired harmonic)
7975 for(Int_t co=0;co<4;co++) // cumulant order
7977 TH1D *intFlowVsM = dynamic_cast<TH1D*>
7978 (intFlowResults->FindObject(Form("%s, %s",intFlowVsMName.Data(),flowFlag[co].Data())));
7981 this->SetIntFlowVsM(intFlowVsM,co);
7984 cout<<"WARNING: "<<Form("intFlowVsM[%d]",co)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7986 } // end of for(Int_t co=0;co<4;co++) // cumulant order
7987 } // end of if(fCalculateCumulantsVsM)
7988 // quantifying detector effects effects to correlations:
7989 TString intFlowDetectorBiasName = "fIntFlowDetectorBias";
7990 intFlowDetectorBiasName += fAnalysisLabel->Data();
7991 TH1D *intFlowDetectorBias = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowDetectorBiasName.Data()));
7992 if(intFlowDetectorBias)
7994 this->SetIntFlowDetectorBias(intFlowDetectorBias);
7997 cout<<"WARNING: intFlowDetectorBias is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
7999 // quantifying detector effects effects to correlations vs multiplicity:
8000 if(fApplyCorrectionForNUAVsM && fCalculateCumulantsVsM)
8002 TString intFlowDetectorBiasVsMName = "fIntFlowDetectorBiasVsM";
8003 intFlowDetectorBiasVsMName += fAnalysisLabel->Data();
8004 for(Int_t ci=0;ci<4;ci++) // correlation index
8006 TH1D *intFlowDetectorBiasVsM = dynamic_cast<TH1D*>
8007 (intFlowResults->FindObject(Form("%s for %s",intFlowDetectorBiasVsMName.Data(),cumulantFlag[ci].Data())));
8008 if(intFlowDetectorBiasVsM)
8010 this->SetIntFlowDetectorBiasVsM(intFlowDetectorBiasVsM,ci);
8013 cout<<"WARNING: "<<Form("intFlowDetectorBiasVsM[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8015 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
8016 } // end of if(ApplyCorrectionForNUAVsM)
8017 } else // to if(intFlowResults)
8019 cout<<"WARNING: intFlowResults is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8022 } // end of void AliFlowAnalysisWithQCumulants::GetPointersForIntFlowHistograms()
8024 //================================================================================================================================
8026 void AliFlowAnalysisWithQCumulants::GetPointersForDiffFlowHistograms()
8028 // Get pointer to all objects relevant for differential flow.
8029 // a) Define flags locally (to be improved: should I promote flags to data members?);
8030 // b) Get pointer to base list for differential flow fDiffFlowList and nested lists fDiffFlowListProfiles and fDiffFlowListResults;
8031 // c) Get pointer to profile fDiffFlowFlags holding all flags for differential flow;
8032 // d) Get pointers to all nested lists in fDiffFlowListProfiles and to profiles which they hold;
8033 // e) Get pointers to all nested lists in fDiffFlowListResults and to histograms which they hold.
8035 // a) Define flags locally (to be improved: should I promote flags to data members?):
8036 TString typeFlag[2] = {"RP","POI"};
8037 TString ptEtaFlag[2] = {"p_{T}","#eta"};
8038 TString powerFlag[2] = {"linear","quadratic"};
8039 TString sinCosFlag[2] = {"sin","cos"};
8040 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
8041 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
8042 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};
8043 TString mixedCorrelationIndex[8] = {"<2>","<2'>","<4>","<4'>","<6>","<6'>","<8>","<8'>"};
8044 TString covarianceName[5] = {"Cov(<2>,<2'>)","Cov(<2>,<4'>)","Cov(<4>,<2'>)","Cov(<4>,<4'>)","Cov(<2'>,<4'>)"};
8046 // b) Get pointer to base list for differential flow fDiffFlowList and nested lists fDiffFlowListProfiles and fDiffFlowListResults:
8047 TList *diffFlowList = NULL;
8048 diffFlowList = dynamic_cast<TList*>(fHistList->FindObject("Differential Flow"));
8051 cout<<"WARNING: diffFlowList is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8054 // list holding nested lists containing profiles:
8055 TList *diffFlowListProfiles = NULL;
8056 diffFlowListProfiles = dynamic_cast<TList*>(diffFlowList->FindObject("Profiles"));
8057 if(!diffFlowListProfiles)
8059 cout<<"WARNING: diffFlowListProfiles is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8062 // list holding nested lists containing 2D and 1D histograms with final results:
8063 TList *diffFlowListResults = NULL;
8064 diffFlowListResults = dynamic_cast<TList*>(diffFlowList->FindObject("Results"));
8065 if(!diffFlowListResults)
8067 cout<<"WARNING: diffFlowListResults is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8071 // c) Get pointer to profile holding all flags for differential flow;
8072 TString diffFlowFlagsName = "fDiffFlowFlags";
8073 diffFlowFlagsName += fAnalysisLabel->Data();
8074 TProfile *diffFlowFlags = dynamic_cast<TProfile*>(diffFlowList->FindObject(diffFlowFlagsName.Data()));
8075 Bool_t bCalculate2DFlow = kFALSE;
8078 this->SetDiffFlowFlags(diffFlowFlags);
8079 bCalculate2DFlow = (Int_t)diffFlowFlags->GetBinContent(4);
8080 this->SetCalculate2DFlow(bCalculate2DFlow); // to be improved (shoul I call this setter somewhere else?)
8083 // d) Get pointers to all nested lists in fDiffFlowListProfiles and to profiles which they hold;
8085 TList *diffFlowCorrelationsProList[2][2] = {{NULL}};
8086 TString diffFlowCorrelationsProName = "fDiffFlowCorrelationsPro";
8087 diffFlowCorrelationsProName += fAnalysisLabel->Data();
8088 TProfile *diffFlowCorrelationsPro[2][2][4] = {{{NULL}}};
8089 // products of correlations:
8090 TList *diffFlowProductOfCorrelationsProList[2][2] = {{NULL}};
8091 TString diffFlowProductOfCorrelationsProName = "fDiffFlowProductOfCorrelationsPro";
8092 diffFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
8093 TProfile *diffFlowProductOfCorrelationsPro[2][2][8][8] = {{{{NULL}}}};
8095 TList *diffFlowCorrectionsProList[2][2] = {{NULL}};
8096 TString diffFlowCorrectionTermsForNUAProName = "fDiffFlowCorrectionTermsForNUAPro";
8097 diffFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
8098 TProfile *diffFlowCorrectionTermsForNUAPro[2][2][2][10] = {{{{NULL}}}};
8099 for(Int_t t=0;t<2;t++)
8101 for(Int_t pe=0;pe<2;pe++)
8103 diffFlowCorrelationsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8104 if(!diffFlowCorrelationsProList[t][pe])
8106 cout<<"WARNING: diffFlowCorrelationsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8107 cout<<"t = "<<t<<endl;
8108 cout<<"pe = "<<pe<<endl;
8111 for(Int_t ci=0;ci<4;ci++) // correlation index
8113 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())));
8114 if(diffFlowCorrelationsPro[t][pe][ci])
8116 this->SetDiffFlowCorrelationsPro(diffFlowCorrelationsPro[t][pe][ci],t,pe,ci);
8119 cout<<"WARNING: diffFlowCorrelationsPro[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8120 cout<<"t = "<<t<<endl;
8121 cout<<"pe = "<<pe<<endl;
8122 cout<<"ci = "<<ci<<endl;
8124 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
8125 // products of correlations:
8126 diffFlowProductOfCorrelationsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with products of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8127 if(!diffFlowProductOfCorrelationsProList[t][pe])
8129 cout<<"WARNING: ddiffFlowProductOfCorrelationsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8130 cout<<"t = "<<t<<endl;
8131 cout<<"pe = "<<pe<<endl;
8134 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8136 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8138 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())));
8139 if(diffFlowProductOfCorrelationsPro[t][pe][mci1][mci2])
8141 this->SetDiffFlowProductOfCorrelationsPro(diffFlowProductOfCorrelationsPro[t][pe][mci1][mci2],t,pe,mci1,mci2);
8144 cout<<"WARNING: diffFlowCorrelationsPro[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8145 cout<<"t = "<<t<<endl;
8146 cout<<"pe = "<<pe<<endl;
8147 cout<<"mci1 = "<<mci1<<endl;
8148 cout<<"mci2 = "<<mci2<<endl;
8150 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
8151 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8152 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8154 diffFlowCorrectionsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8155 if(!diffFlowCorrectionsProList[t][pe])
8157 cout<<"WARNING: diffFlowCorrectionsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8158 cout<<"t = "<<t<<endl;
8159 cout<<"pe = "<<pe<<endl;
8162 // correction terms for NUA:
8163 for(Int_t sc=0;sc<2;sc++) // sin or cos
8165 for(Int_t cti=0;cti<9;cti++) // correction term index
8167 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)));
8168 if(diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti])
8170 this->SetDiffFlowCorrectionTermsForNUAPro(diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti],t,pe,sc,cti);
8173 cout<<"WARNING: diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8174 cout<<"t = "<<t<<endl;
8175 cout<<"pe = "<<pe<<endl;
8176 cout<<"sc = "<<sc<<endl;
8177 cout<<"cti = "<<cti<<endl;
8179 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index
8180 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
8182 } // end of for(Int_t pe=0;pe<2;pe++)
8183 } // end of for(Int_t t=0;t<2;t++)
8185 // e) Get pointers to all nested lists in fDiffFlowListResults and to histograms which they hold.
8186 // reduced correlations:
8187 TList *diffFlowCorrelationsHistList[2][2] = {{NULL}};
8188 TString diffFlowCorrelationsHistName = "fDiffFlowCorrelationsHist";
8189 diffFlowCorrelationsHistName += fAnalysisLabel->Data();
8190 TH1D *diffFlowCorrelationsHist[2][2][4] = {{{NULL}}};
8191 // corrections for NUA:
8192 TList *diffFlowCorrectionsHistList[2][2] = {{NULL}};
8193 TString diffFlowCorrectionTermsForNUAHistName = "fDiffFlowCorrectionTermsForNUAHist";
8194 diffFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
8195 TH1D *diffFlowCorrectionTermsForNUAHist[2][2][2][10] = {{{{NULL}}}};
8196 // differential Q-cumulants:
8197 TList *diffFlowCumulantsHistList[2][2] = {{NULL}};
8198 TString diffFlowCumulantsName = "fDiffFlowCumulants";
8199 diffFlowCumulantsName += fAnalysisLabel->Data();
8200 TH1D *diffFlowCumulants[2][2][4] = {{{NULL}}};
8201 // differential flow estimates from Q-cumulants:
8202 TList *diffFlowHistList[2][2] = {{NULL}};
8203 TString diffFlowName = "fDiffFlow";
8204 diffFlowName += fAnalysisLabel->Data();
8205 TH1D *diffFlow[2][2][4] = {{{NULL}}};
8206 // differential covariances:
8207 TList *diffFlowCovariancesHistList[2][2] = {{NULL}};
8208 TString diffFlowCovariancesName = "fDiffFlowCovariances";
8209 diffFlowCovariancesName += fAnalysisLabel->Data();
8210 TH1D *diffFlowCovariances[2][2][5] = {{{NULL}}};
8211 for(Int_t t=0;t<2;t++) // type: RP or POI
8213 for(Int_t pe=0;pe<2;pe++) // pt or eta
8215 // reduced correlations:
8216 diffFlowCorrelationsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8217 if(!diffFlowCorrelationsHistList[t][pe])
8219 cout<<"WARNING: diffFlowCorrelationsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8220 cout<<"t = "<<t<<endl;
8221 cout<<"pe = "<<pe<<endl;
8224 for(Int_t index=0;index<4;index++)
8226 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())));
8227 if(diffFlowCorrelationsHist[t][pe][index])
8229 this->SetDiffFlowCorrelationsHist(diffFlowCorrelationsHist[t][pe][index],t,pe,index);
8232 cout<<"WARNING: diffFlowCorrelationsHist[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8233 cout<<"t = "<<t<<endl;
8234 cout<<"pe = "<<pe<<endl;
8235 cout<<"index = "<<index<<endl;
8238 } // end of for(Int_t index=0;index<4;index++)
8240 diffFlowCorrectionsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Histograms with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8241 if(!diffFlowCorrectionsHistList[t][pe])
8243 cout<<"WARNING: diffFlowCorrectionsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8244 cout<<"t = "<<t<<endl;
8245 cout<<"pe = "<<pe<<endl;
8248 // correction terms for NUA:
8249 for(Int_t sc=0;sc<2;sc++) // sin or cos
8251 for(Int_t cti=0;cti<9;cti++) // correction term index
8253 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)));
8254 if(diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti])
8256 this->SetDiffFlowCorrectionTermsForNUAHist(diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti],t,pe,sc,cti);
8259 cout<<"WARNING: diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8260 cout<<"t = "<<t<<endl;
8261 cout<<"pe = "<<pe<<endl;
8262 cout<<"sc = "<<sc<<endl;
8263 cout<<"cti = "<<cti<<endl;
8265 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index
8266 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
8268 // differential Q-cumulants:
8269 diffFlowCumulantsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Differential Q-cumulants (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8270 if(!diffFlowCumulantsHistList[t][pe])
8272 cout<<"WARNING: diffFlowCumulantsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8273 cout<<"t = "<<t<<endl;
8274 cout<<"pe = "<<pe<<endl;
8277 for(Int_t index=0;index<4;index++)
8279 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())));
8280 if(diffFlowCumulants[t][pe][index])
8282 this->SetDiffFlowCumulants(diffFlowCumulants[t][pe][index],t,pe,index);
8285 cout<<"WARNING: diffFlowCumulants[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8286 cout<<"t = "<<t<<endl;
8287 cout<<"pe = "<<pe<<endl;
8288 cout<<"index = "<<index<<endl;
8291 } // end of for(Int_t index=0;index<4;index++)
8292 // differential flow estimates from Q-cumulants:
8293 diffFlowHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Differential flow (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8294 if(!diffFlowHistList[t][pe])
8296 cout<<"WARNING: diffFlowHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8297 cout<<"t = "<<t<<endl;
8298 cout<<"pe = "<<pe<<endl;
8301 for(Int_t index=0;index<4;index++)
8303 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())));
8304 if(diffFlow[t][pe][index])
8306 this->SetDiffFlow(diffFlow[t][pe][index],t,pe,index);
8309 cout<<"WARNING: diffFlow[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8310 cout<<"t = "<<t<<endl;
8311 cout<<"pe = "<<pe<<endl;
8312 cout<<"index = "<<index<<endl;
8315 } // end of for(Int_t index=0;index<4;index++)
8316 // differential covariances:
8317 diffFlowCovariancesHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Covariances of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8318 if(!diffFlowCovariancesHistList[t][pe])
8320 cout<<"WARNING: diffFlowCovariancesHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8321 cout<<"t = "<<t<<endl;
8322 cout<<"pe = "<<pe<<endl;
8325 for(Int_t covIndex=0;covIndex<5;covIndex++)
8327 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())));
8328 if(diffFlowCovariances[t][pe][covIndex])
8330 this->SetDiffFlowCovariances(diffFlowCovariances[t][pe][covIndex],t,pe,covIndex);
8333 cout<<"WARNING: diffFlowCovariances[t][pe][covIndex] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8334 cout<<"t = "<<t<<endl;
8335 cout<<"pe = "<<pe<<endl;
8336 cout<<"covIndex = "<<covIndex<<endl;
8339 } // end of for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index
8340 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8341 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8342 // sum of event weights for reduced correlations:
8343 TList *diffFlowSumOfEventWeightsHistList[2][2][2] = {{{NULL}}};
8344 TString diffFlowSumOfEventWeightsName = "fDiffFlowSumOfEventWeights";
8345 diffFlowSumOfEventWeightsName += fAnalysisLabel->Data();
8346 TH1D *diffFlowSumOfEventWeights[2][2][2][4] = {{{{NULL}}}};
8347 for(Int_t t=0;t<2;t++) // type is RP or POI
8349 for(Int_t pe=0;pe<2;pe++) // pt or eta
8351 for(Int_t p=0;p<2;p++) // power of event weights is either 1 or 2
8353 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())));
8354 if(!diffFlowSumOfEventWeightsHistList[t][pe][p])
8356 cout<<"WARNING: diffFlowSumOfEventWeightsHistList[t][pe][p] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8357 cout<<"t = "<<t<<endl;
8358 cout<<"pe = "<<pe<<endl;
8359 cout<<"power = "<<p<<endl;
8362 for(Int_t ew=0;ew<4;ew++) // index of reduced correlation
8364 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())));
8365 if(diffFlowSumOfEventWeights[t][pe][p][ew])
8367 this->SetDiffFlowSumOfEventWeights(diffFlowSumOfEventWeights[t][pe][p][ew],t,pe,p,ew);
8370 cout<<"WARNING: diffFlowSumOfEventWeights[t][pe][p][ew] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8371 cout<<"t = "<<t<<endl;
8372 cout<<"pe = "<<pe<<endl;
8373 cout<<"power = "<<p<<endl;
8374 cout<<"ew = "<<ew<<endl;
8378 } // end of for(Int_t p=0;p<2;p++) // power of event weights is either 1 or 2
8379 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8380 } // end of for(Int_t t=0;t<2;t++) // type is RP or POI
8382 TList *diffFlowSumOfProductOfEventWeightsHistList[2][2] = {{NULL}};
8383 TString diffFlowSumOfProductOfEventWeightsName = "fDiffFlowSumOfProductOfEventWeights";
8384 diffFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
8385 TH1D *diffFlowSumOfProductOfEventWeights[2][2][8][8] = {{{{NULL}}}};
8386 for(Int_t t=0;t<2;t++) // type is RP or POI
8388 for(Int_t pe=0;pe<2;pe++) // pt or eta
8390 diffFlowSumOfProductOfEventWeightsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Sum of products of event weights (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
8391 if(!diffFlowSumOfProductOfEventWeightsHistList[t][pe])
8393 cout<<"WARNING: diffFlowSumOfProductOfEventWeightsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8394 cout<<"t = "<<t<<endl;
8395 cout<<"pe = "<<pe<<endl;
8398 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8400 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8402 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())));
8403 if(diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2])
8405 this->SetDiffFlowSumOfProductOfEventWeights(diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2],t,pe,mci1,mci2);
8408 cout<<"WARNING: diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
8409 cout<<"t = "<<t<<endl;
8410 cout<<"pe = "<<pe<<endl;
8411 cout<<"mci1 = "<<mci1<<endl;
8412 cout<<"mci2 = "<<mci2<<endl;
8415 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
8416 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8417 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8418 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8419 } // end of for(Int_t t=0;t<2;t++) // type is RP or POI
8421 } // end void AliFlowAnalysisWithQCumulants::GetPointersForDiffFlowHistograms()
8424 //================================================================================================================================
8427 void AliFlowAnalysisWithQCumulants::BookEverythingForDifferentialFlow()
8429 // Book all histograms and profiles needed for differential flow.
8430 // a) Define flags locally (to be improved: should I promote flags to data members?);
8431 // b) Book profile to hold all flags for differential flow;
8432 // c) Book e-b-e quantities;
8433 // d) Book profiles;
8434 // e) Book histograms holding final results.
8436 // a) Define flags locally (to be improved: should I promote flags to data members?):
8437 TString typeFlag[2] = {"RP","POI"};
8438 TString ptEtaFlag[2] = {"p_{T}","#eta"};
8439 TString powerFlag[2] = {"linear","quadratic"};
8440 TString sinCosFlag[2] = {"sin","cos"};
8441 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
8442 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
8443 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};
8444 TString mixedCorrelationIndex[8] = {"<2>","<2'>","<4>","<4'>","<6>","<6'>","<8>","<8'>"};
8445 TString covarianceName[5] = {"Cov(<2>,<2'>)","Cov(<2>,<4'>)","Cov(<4>,<2'>)","Cov(<4>,<4'>)","Cov(<2'>,<4'>)"};
8446 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
8447 Double_t minPtEta[2] = {fPtMin,fEtaMin};
8448 Double_t maxPtEta[2] = {fPtMax,fEtaMax};
8450 // b) Book profile to hold all flags for differential flow:
8451 TString diffFlowFlagsName = "fDiffFlowFlags";
8452 diffFlowFlagsName += fAnalysisLabel->Data();
8453 fDiffFlowFlags = new TProfile(diffFlowFlagsName.Data(),"Flags for Differential Flow",4,0,4);
8454 fDiffFlowFlags->SetTickLength(-0.01,"Y");
8455 fDiffFlowFlags->SetMarkerStyle(25);
8456 fDiffFlowFlags->SetLabelSize(0.05);
8457 fDiffFlowFlags->SetLabelOffset(0.02,"Y");
8458 (fDiffFlowFlags->GetXaxis())->SetBinLabel(1,"Particle Weights");
8459 (fDiffFlowFlags->GetXaxis())->SetBinLabel(2,"Event Weights");
8460 (fDiffFlowFlags->GetXaxis())->SetBinLabel(3,"Corrected for NUA?");
8461 (fDiffFlowFlags->GetXaxis())->SetBinLabel(4,"Calculated 2D flow?");
8462 fDiffFlowList->Add(fDiffFlowFlags);
8464 // c) Book e-b-e quantities:
8465 // Event-by-event r_{m*n,k}(pt,eta), p_{m*n,k}(pt,eta) and q_{m*n,k}(pt,eta)
8466 // Explanantion of notation:
8467 // 1.) n is harmonic, m is multiple of harmonic;
8468 // 2.) k is power of particle weight;
8469 // 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);
8470 // 4.) p_{m*n,k}(pt,eta) = Q-vector evaluated in harmonic m*n for POIs in particular (pt,eta) bin
8471 // (if i-th POI is also RP, than it is weighted with w_i^k);
8472 // 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
8473 // (i-th RP&&POI is weighted with w_i^k)
8476 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP && POI )
8478 for(Int_t pe=0;pe<2;pe++) // pt or eta
8480 for(Int_t m=0;m<4;m++) // multiple of harmonic
8482 for(Int_t k=0;k<9;k++) // power of particle weight
8484 fReRPQ1dEBE[t][pe][m][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%dpower%dRe",t,pe,m,k),
8485 Form("TypeFlag%dpteta%dmultiple%dpower%dRe",t,pe,m,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8486 fImRPQ1dEBE[t][pe][m][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%dpower%dIm",t,pe,m,k),
8487 Form("TypeFlag%dpteta%dmultiple%dpower%dIm",t,pe,m,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8492 // to be improved (add explanation of fs1dEBE[t][pe][k]):
8493 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
8495 for(Int_t pe=0;pe<2;pe++) // pt or eta
8497 for(Int_t k=0;k<9;k++) // power of particle weight
8499 fs1dEBE[t][pe][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%d",t,pe,k),
8500 Form("TypeFlag%dpteta%dmultiple%d",t,pe,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8504 // correction terms for nua:
8505 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
8507 for(Int_t pe=0;pe<2;pe++) // pt or eta
8509 for(Int_t sc=0;sc<2;sc++) // sin or cos
8511 for(Int_t cti=0;cti<9;cti++) // correction term index
8513 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti] = new TH1D(Form("typeFlag%d pteta%d sincos%d cti%d",t,pe,sc,cti),
8514 Form("typeFlag%d pteta%d sincos%d cti%d",t,pe,sc,cti),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
8520 TProfile2D styleRe("typeMultiplePowerRe","typeMultiplePowerRe",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
8521 TProfile2D styleIm("typeMultiplePowerIm","typeMultiplePowerIm",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
8522 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
8524 for(Int_t m=0;m<4;m++)
8526 for(Int_t k=0;k<9;k++)
8528 fReRPQ2dEBE[t][m][k] = (TProfile2D*)styleRe.Clone(Form("typeFlag%dmultiple%dpower%dRe",t,m,k));
8529 fImRPQ2dEBE[t][m][k] = (TProfile2D*)styleIm.Clone(Form("typeFlag%dmultiple%dpower%dIm",t,m,k));
8533 TProfile2D styleS("typePower","typePower",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
8534 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
8536 for(Int_t k=0;k<9;k++)
8538 fs2dEBE[t][k] = (TProfile2D*)styleS.Clone(Form("typeFlag%dpower%d",t,k));
8541 // reduced correlations e-b-e:
8542 TString diffFlowCorrelationsEBEName = "fDiffFlowCorrelationsEBE";
8543 diffFlowCorrelationsEBEName += fAnalysisLabel->Data();
8544 for(Int_t t=0;t<2;t++) // type: RP or POI
8546 for(Int_t pe=0;pe<2;pe++) // pt or eta
8548 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8550 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]);
8551 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
8552 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8553 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8554 // event weights for reduced correlations e-b-e:
8555 TString diffFlowEventWeightsForCorrelationsEBEName = "fDiffFlowEventWeightsForCorrelationsEBE";
8556 diffFlowEventWeightsForCorrelationsEBEName += fAnalysisLabel->Data();
8557 for(Int_t t=0;t<2;t++) // type: RP or POI
8559 for(Int_t pe=0;pe<2;pe++) // pt or eta
8561 for(Int_t rci=0;rci<4;rci++) // event weight for reduced correlation index
8563 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]);
8564 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
8565 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8566 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8568 // d) Book profiles;
8569 // reduced correlations:
8570 TString diffFlowCorrelationsProName = "fDiffFlowCorrelationsPro";
8571 diffFlowCorrelationsProName += fAnalysisLabel->Data();
8572 // corrections terms:
8573 TString diffFlowCorrectionTermsForNUAProName = "fDiffFlowCorrectionTermsForNUAPro";
8574 diffFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
8575 for(Int_t t=0;t<2;t++) // type: RP or POI
8577 for(Int_t pe=0;pe<2;pe++) // pt or eta
8579 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8581 // reduced correlations:
8582 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");
8583 fDiffFlowCorrelationsPro[t][pe][rci]->SetXTitle(ptEtaFlag[pe].Data());
8584 fDiffFlowCorrelationsProList[t][pe]->Add(fDiffFlowCorrelationsPro[t][pe][rci]); // to be improved (add dedicated list to hold reduced correlations)
8585 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
8586 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8587 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8588 // correction terms for nua:
8589 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
8591 for(Int_t pe=0;pe<2;pe++) // pt or eta
8593 for(Int_t sc=0;sc<2;sc++) // sin or cos
8595 for(Int_t cti=0;cti<9;cti++) // correction term index
8597 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]);
8598 fDiffFlowCorrectionsProList[t][pe]->Add(fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]);
8603 // e) Book histograms holding final results.
8604 // reduced correlations:
8605 TString diffFlowCorrelationsHistName = "fDiffFlowCorrelationsHist";
8606 diffFlowCorrelationsHistName += fAnalysisLabel->Data();
8607 // corrections terms:
8608 TString diffFlowCorrectionTermsForNUAHistName = "fDiffFlowCorrectionTermsForNUAHist";
8609 diffFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
8610 // differential covariances:
8611 TString diffFlowCovariancesName = "fDiffFlowCovariances";
8612 diffFlowCovariancesName += fAnalysisLabel->Data();
8613 // differential Q-cumulants:
8614 TString diffFlowCumulantsName = "fDiffFlowCumulants";
8615 diffFlowCumulantsName += fAnalysisLabel->Data();
8616 // differential flow:
8617 TString diffFlowName = "fDiffFlow";
8618 diffFlowName += fAnalysisLabel->Data();
8619 for(Int_t t=0;t<2;t++) // type: RP or POI
8621 for(Int_t pe=0;pe<2;pe++) // pt or eta
8623 for(Int_t index=0;index<4;index++)
8625 // reduced correlations:
8626 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]);
8627 fDiffFlowCorrelationsHist[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
8628 fDiffFlowCorrelationsHistList[t][pe]->Add(fDiffFlowCorrelationsHist[t][pe][index]);
8629 // differential Q-cumulants:
8630 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]);
8631 fDiffFlowCumulants[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
8632 fDiffFlowCumulantsHistList[t][pe]->Add(fDiffFlowCumulants[t][pe][index]);
8633 // differential flow estimates from Q-cumulants:
8634 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]);
8635 fDiffFlow[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
8636 fDiffFlowHistList[t][pe]->Add(fDiffFlow[t][pe][index]);
8637 } // end of for(Int_t index=0;index<4;index++)
8638 for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index
8640 // differential covariances:
8641 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]);
8642 fDiffFlowCovariances[t][pe][covIndex]->SetXTitle(ptEtaFlag[pe].Data());
8643 fDiffFlowCovariancesHistList[t][pe]->Add(fDiffFlowCovariances[t][pe][covIndex]);
8644 } // end of for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index
8645 // products of both types of correlations:
8646 TString diffFlowProductOfCorrelationsProName = "fDiffFlowProductOfCorrelationsPro";
8647 diffFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
8648 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8650 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8652 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]);
8653 fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2]->SetXTitle(ptEtaFlag[pe].Data());
8654 fDiffFlowProductOfCorrelationsProList[t][pe]->Add(fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2]);
8655 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
8656 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8657 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8658 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
8659 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8660 // sums of event weights for reduced correlations:
8661 TString diffFlowSumOfEventWeightsName = "fDiffFlowSumOfEventWeights";
8662 diffFlowSumOfEventWeightsName += fAnalysisLabel->Data();
8663 for(Int_t t=0;t<2;t++) // type is RP or POI
8665 for(Int_t pe=0;pe<2;pe++) // pt or eta
8667 for(Int_t p=0;p<2;p++) // power of weights is either 1 or 2
8669 for(Int_t ew=0;ew<4;ew++) // index of reduced correlation
8671 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]);
8672 fDiffFlowSumOfEventWeights[t][pe][p][ew]->SetXTitle(ptEtaFlag[pe].Data());
8673 fDiffFlowSumOfEventWeightsHistList[t][pe][p]->Add(fDiffFlowSumOfEventWeights[t][pe][p][ew]); // to be improved (add dedicated list to hold all this)
8678 // sum of products of event weights for both types of correlations:
8679 TString diffFlowSumOfProductOfEventWeightsName = "fDiffFlowSumOfProductOfEventWeights";
8680 diffFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
8681 for(Int_t t=0;t<2;t++) // type is RP or POI
8683 for(Int_t pe=0;pe<2;pe++) // pt or eta
8685 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
8687 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
8689 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]);
8690 fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2]->SetXTitle(ptEtaFlag[pe].Data());
8691 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]->Add(fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2]);
8692 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
8697 // correction terms for nua:
8698 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
8700 for(Int_t pe=0;pe<2;pe++) // pt or eta
8702 for(Int_t sc=0;sc<2;sc++) // sin or cos
8704 for(Int_t cti=0;cti<9;cti++) // correction term index
8706 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]);
8707 fDiffFlowCorrectionsHistList[t][pe]->Add(fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti]);
8713 } // end of AliFlowAnalysisWithQCumulants::BookEverythingForDifferentialFlow()
8716 //================================================================================================================================
8719 void AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNUAForIntQcumulants() // to be improved (do I really need this method?)
8721 // Calculate final corrections for non-uniform acceptance for Q-cumulants.
8723 // Corrections for non-uniform acceptance are stored in histogram fCorrectionsForNUA,
8724 // binning of fCorrectionsForNUA is organized as follows:
8726 // 1st bin: correction to QC{2}
8727 // 2nd bin: correction to QC{4}
8728 // 3rd bin: correction to QC{6}
8729 // 4th bin: correction to QC{8}
8732 Int_t pW = (Int_t)(useParticleWeights);
8736 if(eventWeights == "exact")
8741 for(Int_t sc=0;sc<2;sc++) // sin or cos terms flag
8743 if(!(fQCorrelations[pW][eW] && fQCorrections[pW][eW][sc] && fCorrections[pW][eW]))
8745 cout<<"WARNING: fQCorrelations[pW][eW] && fQCorrections[pW][eW][sc] && fCorrections[pW][eW] is NULL in AFAWQC::CFCFNUAFIF() !!!!"<<endl;
8746 cout<<"pW = "<<pW<<endl;
8747 cout<<"eW = "<<eW<<endl;
8748 cout<<"sc = "<<sc<<endl;
8753 // measured 2-, 4-, 6- and 8-particle azimuthal correlations (biased with non-uniform acceptance!):
8754 Double_t two = fQCorrelations[pW][eW]->GetBinContent(1); // <<2>>
8755 //Double_t four = fQCorrelations[pW][eW]->GetBinContent(11); // <<4>>
8756 //Double_t six = fQCorrelations[pW][eW]->GetBinContent(24); // <<6>>
8757 //Double_t eight = fQCorrelations[pW][eW]->GetBinContent(31); // <<8>>
8759 // correction terms to QC{2}:
8760 // <<cos(n*phi1)>>^2
8761 Double_t two1stTerm = pow(fQCorrections[pW][eW][1]->GetBinContent(1),2);
8762 // <<sin(n*phi1)>>^2
8763 Double_t two2ndTerm = pow(fQCorrections[pW][eW][0]->GetBinContent(1),2);
8764 // final corrections for non-uniform acceptance to QC{2}:
8765 Double_t correctionQC2 = -1.*two1stTerm-1.*two2ndTerm;
8766 fCorrections[pW][eW]->SetBinContent(1,correctionQC2);
8768 // correction terms to QC{4}:
8769 // <<cos(n*phi1)>> <<cos(n*(phi1-phi2-phi3))>>
8770 Double_t four1stTerm = fQCorrections[pW][eW][1]->GetBinContent(1)*fQCorrections[pW][eW][1]->GetBinContent(3);
8771 // <<sin(n*phi1)>> <<sin(n*(phi1-phi2-phi3))>>
8772 Double_t four2ndTerm = fQCorrections[pW][eW][0]->GetBinContent(1)*fQCorrections[pW][eW][0]->GetBinContent(3);
8773 // <<cos(n*(phi1+phi2))>>^2
8774 Double_t four3rdTerm = pow(fQCorrections[pW][eW][1]->GetBinContent(2),2);
8775 // <<sin(n*(phi1+phi2))>>^2
8776 Double_t four4thTerm = pow(fQCorrections[pW][eW][0]->GetBinContent(2),2);
8777 // <<cos(n*(phi1+phi2))>> (<<cos(n*phi1)>>^2 - <<sin(n*phi1)>>^2)
8778 Double_t four5thTerm = fQCorrections[pW][eW][1]->GetBinContent(2)
8779 * (pow(fQCorrections[pW][eW][1]->GetBinContent(1),2)-pow(fQCorrections[pW][eW][0]->GetBinContent(1),2));
8780 // <<sin(n*(phi1+phi2))>> <<cos(n*phi1)>> <<sin(n*phi1)>>
8781 Double_t four6thTerm = fQCorrections[pW][eW][0]->GetBinContent(2)
8782 * fQCorrections[pW][eW][1]->GetBinContent(1)
8783 * fQCorrections[pW][eW][0]->GetBinContent(1);
8784 // <<cos(n*(phi1-phi2))>> (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2)
8785 Double_t four7thTerm = two*(pow(fQCorrections[pW][eW][1]->GetBinContent(1),2)+pow(fQCorrections[pW][eW][0]->GetBinContent(1),2));
8786 // (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2)^2
8787 Double_t four8thTerm = pow(pow(fQCorrections[pW][eW][1]->GetBinContent(1),2)+pow(fQCorrections[pW][eW][0]->GetBinContent(1),2),2);
8788 // final correction to QC{4}:
8789 Double_t correctionQC4 = -4.*four1stTerm+4.*four2ndTerm-four3rdTerm-four4thTerm
8790 + 4.*four5thTerm+8.*four6thTerm+8.*four7thTerm-6.*four8thTerm;
8791 fCorrections[pW][eW]->SetBinContent(2,correctionQC4);
8793 // ... to be improved (continued for 6th and 8th order)
8796 } // end of AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNUAForIntQcumulants()
8799 //================================================================================================================================
8802 void AliFlowAnalysisWithQCumulants::CalculateQcumulantsCorrectedForNUAIntFlow()
8804 // Calculate generalized Q-cumulants (cumulants corrected for non-unifom acceptance).
8806 // measured 2-, 4-, 6- and 8-particle correlations (biased by non-uniform acceptance!):
8807 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
8808 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
8809 //Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
8810 //Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
8812 // statistical error of measured 2-, 4-, 6- and 8-particle correlations:
8813 //Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <<2>>
8814 //Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <<4>>
8815 //Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <<6>>
8816 //Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <<8>>
8819 // <<cos(n*phi1)>>^2
8820 Double_t two1stTerm = pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1),2);
8821 //Double_t two1stTermErrorSquared = pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(1),2);
8822 // <<sin(n*phi1)>>^2
8823 Double_t two2ndTerm = pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1),2);
8824 //Double_t two2ndTermErrorSquared = pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(1),2);
8825 // generalized QC{2}:
8826 Double_t gQC2 = two - two1stTerm - two2ndTerm; // to be improved (terminology, notation)
8827 fIntFlowQcumulants->SetBinContent(1,gQC2);
8828 //fIntFlowQcumulants->SetBinError(1,0.); // to be improved (propagate error)
8831 // <<cos(n*phi1)>> <<cos(n*(phi1-phi2-phi3))>>
8832 Double_t four1stTerm = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1)
8833 * fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(3);
8834 // <<sin(n*phi1)>> <<sin(n*(phi1-phi2-phi3))>>
8835 Double_t four2ndTerm = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1)
8836 * fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(3);
8837 // <<cos(n*(phi1+phi2))>>^2
8838 Double_t four3rdTerm = pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2),2);
8839 // <<sin(n*(phi1+phi2))>>^2
8840 Double_t four4thTerm = pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2),2);
8841 // <<cos(n*(phi1+phi2))>> (<<cos(n*phi1)>>^2 - <<sin(n*phi1)>>^2)
8842 Double_t four5thTerm = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2)
8843 * (pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1),2)
8844 - pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1),2));
8845 // <<sin(n*(phi1+phi2))>> <<cos(n*phi1)>> <<sin(n*phi1)>>
8846 Double_t four6thTerm = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2)
8847 * fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1)
8848 * fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1);
8849 // <<cos(n*(phi1-phi2))>> (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2)
8850 Double_t four7thTerm = two*(pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1),2)
8851 + pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1),2));
8852 // (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2)^2
8853 Double_t four8thTerm = pow(pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1),2)
8854 + pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1),2),2);
8855 // generalized QC{4}:
8856 Double_t gQC4 = four-2.*pow(two,2.)-4.*four1stTerm+4.*four2ndTerm-four3rdTerm
8857 - four4thTerm+4.*four5thTerm+8.*four6thTerm+8.*four7thTerm-6.*four8thTerm;
8858 fIntFlowQcumulants->SetBinContent(2,gQC4);
8859 //fIntFlowQcumulants->SetBinError(2,0.); // to be improved (propagate error)
8861 // ... to be improved (continued for 6th and 8th order)
8863 // versus multiplicity:
8864 if(fApplyCorrectionForNUAVsM && fCalculateCumulantsVsM)
8866 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
8867 for(Int_t b=1;b<=nBins;b++)
8869 two = fIntFlowCorrelationsVsMHist[0]->GetBinContent(b); // <<2>> vs M
8870 four = fIntFlowCorrelationsVsMHist[1]->GetBinContent(b); // <<4>> vs M
8871 // generalized QC{2} vs M:
8872 two1stTerm = pow(fIntFlowCorrectionTermsForNUAVsMPro[1][0]->GetBinContent(b),2); // <<cos(n*phi1)>>^2 vs M
8873 two2ndTerm = pow(fIntFlowCorrectionTermsForNUAVsMPro[0][0]->GetBinContent(b),2); // <<sin(n*phi1)>>^2 vs M
8874 gQC2 = two - two1stTerm - two2ndTerm;
8875 fIntFlowQcumulantsVsM[0]->SetBinContent(b,gQC2);
8876 // generalized QC{4} vs M:
8877 four1stTerm = fIntFlowCorrectionTermsForNUAVsMPro[1][0]->GetBinContent(b)
8878 * fIntFlowCorrectionTermsForNUAVsMPro[1][2]->GetBinContent(b); // <<cos(n*phi1)>> <<cos(n*(phi1-phi2-phi3))>> vs M
8879 four2ndTerm = fIntFlowCorrectionTermsForNUAVsMPro[0][0]->GetBinContent(b)
8880 * fIntFlowCorrectionTermsForNUAVsMPro[0][2]->GetBinContent(b); // <<sin(n*phi1)>> <<sin(n*(phi1-phi2-phi3))>> vs M
8881 four3rdTerm = pow(fIntFlowCorrectionTermsForNUAVsMPro[1][1]->GetBinContent(b),2); // <<cos(n*(phi1+phi2))>>^2 vs M
8882 four4thTerm = pow(fIntFlowCorrectionTermsForNUAVsMPro[0][1]->GetBinContent(b),2); // <<sin(n*(phi1+phi2))>>^2 vs M
8883 four5thTerm = fIntFlowCorrectionTermsForNUAVsMPro[1][1]->GetBinContent(b)
8884 * (pow(fIntFlowCorrectionTermsForNUAVsMPro[1][0]->GetBinContent(b),2)
8885 - pow(fIntFlowCorrectionTermsForNUAVsMPro[0][0]->GetBinContent(b),2)); //<<cos(n*(phi1+phi2))>> (<<cos(n*phi1)>>^2-<<sin(n*phi1)>>^2) vs M
8886 four6thTerm = fIntFlowCorrectionTermsForNUAVsMPro[0][1]->GetBinContent(b)
8887 * fIntFlowCorrectionTermsForNUAVsMPro[1][0]->GetBinContent(b)
8888 * fIntFlowCorrectionTermsForNUAVsMPro[0][0]->GetBinContent(b); // <<sin(n*(phi1+phi2))>> <<cos(n*phi1)>> <<sin(n*phi1)>> vs M
8889 four7thTerm = two*(pow(fIntFlowCorrectionTermsForNUAVsMPro[1][0]->GetBinContent(b),2)
8890 + pow(fIntFlowCorrectionTermsForNUAVsMPro[0][0]->GetBinContent(b),2)); // <<cos(n*(phi1-phi2))>> (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2) vs M
8891 four8thTerm = pow(pow(fIntFlowCorrectionTermsForNUAVsMPro[1][0]->GetBinContent(b),2)
8892 + pow(fIntFlowCorrectionTermsForNUAVsMPro[0][0]->GetBinContent(b),2),2); // (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2)^2
8893 gQC4 = four-2.*pow(two,2.)-4.*four1stTerm+4.*four2ndTerm-four3rdTerm
8894 - four4thTerm+4.*four5thTerm+8.*four6thTerm+8.*four7thTerm-6.*four8thTerm;
8895 fIntFlowQcumulantsVsM[1]->SetBinContent(b,gQC4);
8896 } // end of for(Int_t b=1;b<=nBins;b++)
8897 } // end of if(fApplyCorrectionForNUAVsM && fCalculateCumulantsVsM)
8899 } // end of void AliFlowAnalysisWithQCumulants::CalculateQcumulantsCorrectedForNUAIntFlow()
8901 //================================================================================================================================
8903 void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectedForNUA()
8905 // Calculate integrated flow from generalized Q-cumulants (corrected for non-uniform acceptance).
8907 // to be improved: add protection for NULL pointers, propagate statistical errors from
8908 // measured correlations and correction terms
8910 // generalized Q-cumulants:
8911 Double_t qc2 = fIntFlowQcumulants->GetBinContent(1); // QC{2}
8912 Double_t qc4 = fIntFlowQcumulants->GetBinContent(2); // QC{4}
8913 //Double_t qc6 = fIntFlowQcumulants->GetBinContent(3); // QC{6}
8914 //Double_t qc8 = fIntFlowQcumulants->GetBinContent(4); // QC{8}
8916 // integrated flow estimates:
8917 Double_t v2 = 0.; // v{2,QC}
8918 Double_t v4 = 0.; // v{4,QC}
8919 //Double_t v6 = 0.; // v{6,QC}
8920 //Double_t v8 = 0.; // v{8,QC}
8922 // calculate integrated flow estimates from generalized Q-cumulants:
8923 if(qc2>=0.) v2 = pow(qc2,1./2.);
8924 if(qc4<=0.) v4 = pow(-1.*qc4,1./4.);
8925 //if(qc6>=0.) v6 = pow((1./4.)*qc6,1./6.);
8926 //if(qc8<=0.) v8 = pow((-1./33.)*qc8,1./8.);
8928 // store integrated flow estimates from generalized Q-cumulants:
8929 fIntFlow->SetBinContent(1,v2);
8930 fIntFlow->SetBinContent(2,v4);
8931 //fIntFlow->SetBinContent(3,v6);
8932 //fIntFlow->SetBinContent(4,v8);
8935 // propagate correctly error by including non-isotropic terms (to be improved - moved somewhere else):
8937 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
8938 //Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
8939 //Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
8940 //Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
8941 // statistical errors of average 2-, 4-, 6- and 8-particle azimuthal correlations:
8942 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <2>
8943 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <4>
8944 //Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <6>
8945 //Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <8>
8947 Double_t c1 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1); // <<cos(phi1)>>
8948 Double_t c2 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
8949 Double_t c3 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
8950 Double_t s1 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1); // <<sin(phi1)>>
8951 Double_t s2 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
8952 Double_t s3 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
8953 // statistical errors of nua terms:
8954 Double_t c1Error = fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(1); // statistical error of <cos(phi1)>
8955 Double_t c2Error = fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(2); // statistical error of <cos(phi1+phi2)>
8956 Double_t c3Error = fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(3); // statistical error of <cos(phi1-phi2-phi3)>
8957 Double_t s1Error = fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(1); // statistical error of <sin(phi1)>
8958 Double_t s2Error = fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(2); // statistical error of <sin(phi1+phi2)>
8959 Double_t s3Error = fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(3); // statistical error of <sin(phi1-phi2-phi3)>
8961 // covariances for nua:
8962 Double_t wCov24 = fIntFlowCovariances->GetBinContent(1); // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
8963 Double_t wCov2c1 = fIntFlowCovariancesNUA->GetBinContent(1);
8964 Double_t wCov2s1 = fIntFlowCovariancesNUA->GetBinContent(2);
8965 Double_t wCovc1s1 = fIntFlowCovariancesNUA->GetBinContent(3);
8966 Double_t wCov2c2 = fIntFlowCovariancesNUA->GetBinContent(4);
8967 Double_t wCov2s2 = fIntFlowCovariancesNUA->GetBinContent(5);
8968 Double_t wCov2c3 = fIntFlowCovariancesNUA->GetBinContent(6);
8969 Double_t wCov2s3 = fIntFlowCovariancesNUA->GetBinContent(7);
8970 Double_t wCov4c1 = fIntFlowCovariancesNUA->GetBinContent(8);
8971 Double_t wCov4s1 = fIntFlowCovariancesNUA->GetBinContent(9);
8972 Double_t wCov4c2 = fIntFlowCovariancesNUA->GetBinContent(10);
8973 Double_t wCov4s2 = fIntFlowCovariancesNUA->GetBinContent(11);
8974 Double_t wCov4c3 = fIntFlowCovariancesNUA->GetBinContent(12);
8975 Double_t wCov4s3 = fIntFlowCovariancesNUA->GetBinContent(13);
8976 Double_t wCovc1c2 = fIntFlowCovariancesNUA->GetBinContent(14);
8977 Double_t wCovc1s2 = fIntFlowCovariancesNUA->GetBinContent(15);
8978 Double_t wCovc1c3 = fIntFlowCovariancesNUA->GetBinContent(16);
8979 Double_t wCovc1s3 = fIntFlowCovariancesNUA->GetBinContent(17);
8980 Double_t wCovs1c2 = fIntFlowCovariancesNUA->GetBinContent(18);
8981 Double_t wCovs1s2 = fIntFlowCovariancesNUA->GetBinContent(19);
8982 Double_t wCovs1c3 = fIntFlowCovariancesNUA->GetBinContent(20);
8983 Double_t wCovs1s3 = fIntFlowCovariancesNUA->GetBinContent(21);
8984 Double_t wCovc2s2 = fIntFlowCovariancesNUA->GetBinContent(22);
8985 Double_t wCovc2c3 = fIntFlowCovariancesNUA->GetBinContent(23);
8986 Double_t wCovc2s3 = fIntFlowCovariancesNUA->GetBinContent(24);
8987 Double_t wCovs2c3 = fIntFlowCovariancesNUA->GetBinContent(25);
8988 Double_t wCovs2s3 = fIntFlowCovariancesNUA->GetBinContent(26);
8989 Double_t wCovc3s3 = fIntFlowCovariancesNUA->GetBinContent(27);
8994 Double_t err2ndSquared = (1./(4.*pow(v2,2.)))
8995 * (pow(twoError,2.)+4.*pow(s1*s1Error,2.)+4.*pow(c1*c1Error,2.)
8996 // to be improved (add eventually also covariance terms)
8997 //- 4.*c1*wCov2c1-4.*s1*wCov2s1+8.*c1*s1*wCovc1s1
8999 if(err2ndSquared>=0.)
9001 fIntFlow->SetBinError(1,pow(err2ndSquared,0.5)); // to be improved (enabled eventually)
9004 cout<<"WARNING: Statistical error of v{2,QC} (with non-isotropic terms included) is imaginary !!!! "<<endl;
9007 Double_t err4thSquared = (1./(16.*pow(v4,6.)))
9008 * (pow(4.*pow(two,2.)-8.*(pow(c1,2.)+pow(s1,2.)),2.)*pow(twoError,2.)
9010 + 16.*pow(6.*pow(c1,3.)-2.*c1*c2+c3+6.*c1*pow(s1,2.)-2.*s1*s2-4.*c1*two,2.)*pow(c1Error,2.)
9011 + 16.*pow(6.*pow(c1,2.)*s1+2.*c2*s1+6.*pow(s1,3.)-2.*c1*s2-s3-4.*s1*two,2.)*pow(s1Error,2.)
9012 + 4.*pow(c2-2.*(pow(c1,2.)-pow(s1,2.)),2.)*pow(c2Error,2.)
9013 + 4.*pow(4*c1*s1-s2,2.)*pow(s2Error,2.)
9014 + 16.*pow(c1,2.)*pow(c3Error,2.)
9015 + 16.*pow(s1,2.)*pow(s3Error,2.)
9016 // to be improved (add eventually also covariance terms)
9019 if(err4thSquared>=0.)
9021 fIntFlow->SetBinError(2,pow(err4thSquared,0.5)); // to be improved (enabled eventually)
9024 cout<<"WARNING: Statistical error of v{4,QC} (with non-isotropic terms included) is imaginary !!!! "<<endl;
9028 } // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectedForNUA()
9031 //================================================================================================================================
9034 void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUAIntFlow()
9036 // From profile fIntFlowCorrectionTermsForNUAPro[sc] access measured correction terms for NUA
9037 // and their spread, correctly calculate the statistical errors and store the final
9038 // results and statistical errors for correction terms for NUA in histogram fIntFlowCorrectionTermsForNUAHist[sc].
9040 // Remark: Statistical error of correction temrs is calculated as:
9042 // statistical error = termA * spread * termB:
9043 // termA = sqrt{sum_{i=1}^{N} w^2}/(sum_{i=1}^{N} w)
9044 // termB = 1/sqrt(1-termA^2)
9046 for(Int_t sc=0;sc<2;sc++) // sin or cos correction terms
9048 for(Int_t ci=1;ci<=3;ci++) // correction term index
9050 Double_t correction = fIntFlowCorrectionTermsForNUAPro[sc]->GetBinContent(ci);
9051 Double_t spread = fIntFlowCorrectionTermsForNUAPro[sc]->GetBinError(ci);
9052 Double_t sumOfLinearEventWeights = fIntFlowSumOfEventWeightsNUA[sc][0]->GetBinContent(ci);
9053 Double_t sumOfQuadraticEventWeights = fIntFlowSumOfEventWeightsNUA[sc][1]->GetBinContent(ci);
9054 Double_t termA = 0.;
9055 Double_t termB = 0.;
9056 if(sumOfLinearEventWeights)
9058 termA = pow(sumOfQuadraticEventWeights,0.5)/sumOfLinearEventWeights;
9061 cout<<"WARNING: sumOfLinearEventWeights == 0 in AFAWQC::FCTFNIF() !!!!"<<endl;
9062 cout<<" (for "<<ci<<"-th correction term)"<<endl;
9064 if(1.-pow(termA,2.) > 0.)
9066 termB = 1./pow(1-pow(termA,2.),0.5);
9069 cout<<"WARNING: 1.-pow(termA,2.) <= 0 in AFAWQC::FCTFNIF() !!!!"<<endl;
9070 cout<<" (for "<<ci<<"-th correction term)"<<endl;
9072 Double_t statisticalError = termA * spread * termB;
9073 fIntFlowCorrectionTermsForNUAHist[sc]->SetBinContent(ci,correction);
9074 fIntFlowCorrectionTermsForNUAHist[sc]->SetBinError(ci,statisticalError);
9075 } // end of for(Int_t ci=1;ci<=10;ci++) // correction term index
9076 } // end of for(Int sc=0;sc<2;sc++) // sin or cos correction terms
9078 } // end of void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUAIntFlow()
9081 //================================================================================================================================
9084 void AliFlowAnalysisWithQCumulants::GetPointersForNestedLoopsHistograms()
9086 // Get pointers to all objects relevant for calculations with nested loops.
9088 TList *nestedLoopsList = dynamic_cast<TList*>(fHistList->FindObject("Nested Loops"));
9091 this->SetNestedLoopsList(nestedLoopsList);
9094 cout<<"WARNING: nestedLoopsList is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
9098 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)
9099 TString typeFlag[2] = {"RP","POI"}; // to be improved (should I promote this to data members?)
9100 TString ptEtaFlag[2] = {"p_{T}","#eta"}; // to be improved (should I promote this to data members?)
9101 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"}; // to be improved (should I promote this to data members?)
9103 TString evaluateNestedLoopsName = "fEvaluateNestedLoops";
9104 evaluateNestedLoopsName += fAnalysisLabel->Data();
9105 TProfile *evaluateNestedLoops = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(evaluateNestedLoopsName.Data()));
9106 Bool_t bEvaluateIntFlowNestedLoops = kFALSE;
9107 Bool_t bEvaluateDiffFlowNestedLoops = kFALSE;
9108 if(evaluateNestedLoops)
9110 this->SetEvaluateNestedLoops(evaluateNestedLoops);
9111 bEvaluateIntFlowNestedLoops = (Int_t)evaluateNestedLoops->GetBinContent(1);
9112 bEvaluateDiffFlowNestedLoops = (Int_t)evaluateNestedLoops->GetBinContent(2);
9114 // nested loops relevant for integrated flow:
9115 if(bEvaluateIntFlowNestedLoops)
9118 TString intFlowDirectCorrelationsName = "fIntFlowDirectCorrelations";
9119 intFlowDirectCorrelationsName += fAnalysisLabel->Data();
9120 TProfile *intFlowDirectCorrelations = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(intFlowDirectCorrelationsName.Data()));
9121 if(intFlowDirectCorrelations)
9123 this->SetIntFlowDirectCorrelations(intFlowDirectCorrelations);
9126 cout<<"WARNING: intFlowDirectCorrelations is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
9129 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
9131 TString intFlowExtraDirectCorrelationsName = "fIntFlowExtraDirectCorrelations";
9132 intFlowExtraDirectCorrelationsName += fAnalysisLabel->Data();
9133 TProfile *intFlowExtraDirectCorrelations = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(intFlowExtraDirectCorrelationsName.Data()));
9134 if(intFlowExtraDirectCorrelations)
9136 this->SetIntFlowExtraDirectCorrelations(intFlowExtraDirectCorrelations);
9139 cout<<"WARNING: intFlowExtraDirectCorrelations is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
9142 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
9143 // correction terms for non-uniform acceptance:
9144 TString intFlowDirectCorrectionTermsForNUAName = "fIntFlowDirectCorrectionTermsForNUA";
9145 intFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
9146 TProfile *intFlowDirectCorrectionTermsForNUA[2] = {NULL};
9147 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
9149 intFlowDirectCorrectionTermsForNUA[sc] = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(Form("%s: %s terms",intFlowDirectCorrectionTermsForNUAName.Data(),sinCosFlag[sc].Data())));
9150 if(intFlowDirectCorrectionTermsForNUA[sc])
9152 this->SetIntFlowDirectCorrectionTermsForNUA(intFlowDirectCorrectionTermsForNUA[sc],sc);
9155 cout<<"WARNING: intFlowDirectCorrectionTermsForNUA[sc] is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
9156 cout<<"sc = "<<sc<<endl;
9159 } // end of for(Int_t sc=0;sc<2;sc++)
9160 } // end of if(bEvaluateIntFlowNestedLoops)
9162 // nested loops relevant for differential flow:
9163 if(bEvaluateDiffFlowNestedLoops)
9166 TString diffFlowDirectCorrelationsName = "fDiffFlowDirectCorrelations";
9167 diffFlowDirectCorrelationsName += fAnalysisLabel->Data();
9168 TProfile *diffFlowDirectCorrelations[2][2][4] = {{{NULL}}};
9169 for(Int_t t=0;t<2;t++)
9171 for(Int_t pe=0;pe<2;pe++)
9173 for(Int_t ci=0;ci<4;ci++) // correlation index
9175 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())));
9176 if(diffFlowDirectCorrelations[t][pe][ci])
9178 this->SetDiffFlowDirectCorrelations(diffFlowDirectCorrelations[t][pe][ci],t,pe,ci);
9181 cout<<"WARNING: diffFlowDirectCorrelations[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9182 cout<<"t = "<<t<<endl;
9183 cout<<"pe = "<<pe<<endl;
9184 cout<<"ci = "<<ci<<endl;
9186 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
9187 } // end of for(Int_t pe=0;pe<2;pe++)
9188 } // end of for(Int_t t=0;t<2;t++)
9189 // correction terms for non-uniform acceptance:
9190 TString diffFlowDirectCorrectionTermsForNUAName = "fDiffFlowDirectCorrectionTermsForNUA";
9191 diffFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
9192 TProfile *diffFlowDirectCorrectionTermsForNUA[2][2][2][10] = {{{{NULL}}}};
9193 for(Int_t t=0;t<2;t++)
9195 for(Int_t pe=0;pe<2;pe++)
9197 // correction terms for NUA:
9198 for(Int_t sc=0;sc<2;sc++) // sin or cos
9200 for(Int_t cti=0;cti<9;cti++) // correction term index
9202 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)));
9203 if(diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti])
9205 this->SetDiffFlowDirectCorrectionTermsForNUA(diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti],t,pe,sc,cti);
9208 cout<<"WARNING: diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9209 cout<<"t = "<<t<<endl;
9210 cout<<"pe = "<<pe<<endl;
9211 cout<<"sc = "<<sc<<endl;
9212 cout<<"cti = "<<cti<<endl;
9214 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index
9215 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
9216 } // end of for(Int_t pe=0;pe<2;pe++)
9217 } // end of for(Int_t t=0;t<2;t++)
9218 // number of RPs and POIs in selected pt and eta bins for cross-checkings:
9219 TString noOfParticlesInBinName = "fNoOfParticlesInBin";
9220 TH1D *noOfParticlesInBin = NULL;
9221 noOfParticlesInBin = dynamic_cast<TH1D*>(nestedLoopsList->FindObject(noOfParticlesInBinName.Data()));
9222 if(noOfParticlesInBin)
9224 this->SetNoOfParticlesInBin(noOfParticlesInBin);
9228 cout<<" WARNING (QC): noOfParticlesInBin is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9231 } // end of if(bEvaluateDiffFlowNestedLoops)
9233 } // end of void AliFlowAnalysisWithQCumulants::GetPointersForNestedLoopsHistograms()
9236 //================================================================================================================================
9239 void AliFlowAnalysisWithQCumulants::StoreHarmonic()
9241 // Store flow harmonic in common control histograms.
9243 (fCommonHists->GetHarmonic())->Fill(0.5,fHarmonic);
9244 (fCommonHists2nd->GetHarmonic())->Fill(0.5,fHarmonic);
9245 (fCommonHists4th->GetHarmonic())->Fill(0.5,fHarmonic);
9246 (fCommonHists6th->GetHarmonic())->Fill(0.5,fHarmonic);
9247 (fCommonHists8th->GetHarmonic())->Fill(0.5,fHarmonic);
9249 } // end of void AliFlowAnalysisWithQCumulants::StoreHarmonic()
9252 //================================================================================================================================
9255 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelationsUsingParticleWeights(TString type, TString ptOrEta) // type = RP or POI
9257 // Calculate all correlations needed for differential flow using particle weights.
9259 Int_t t = -1; // type flag
9260 Int_t pe = -1; // ptEta flag
9265 } else if(type == "POI")
9273 } else if(ptOrEta == "Eta")
9278 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
9279 Double_t minPtEta[2] = {fPtMin,fEtaMin};
9280 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
9281 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
9283 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
9284 Double_t dReQ1n1k = (*fReQ)(0,1);
9285 Double_t dReQ2n2k = (*fReQ)(1,2);
9286 Double_t dReQ1n3k = (*fReQ)(0,3);
9287 //Double_t dReQ4n4k = (*fReQ)(3,4);
9288 Double_t dImQ1n1k = (*fImQ)(0,1);
9289 Double_t dImQ2n2k = (*fImQ)(1,2);
9290 Double_t dImQ1n3k = (*fImQ)(0,3);
9291 //Double_t dImQ4n4k = (*fImQ)(3,4);
9293 // S^M_{p,k} (see .h file for the definition of fSMpk):
9294 Double_t dSM1p1k = (*fSMpk)(0,1);
9295 Double_t dSM1p2k = (*fSMpk)(0,2);
9296 Double_t dSM1p3k = (*fSMpk)(0,3);
9297 Double_t dSM2p1k = (*fSMpk)(1,1);
9298 Double_t dSM3p1k = (*fSMpk)(2,1);
9300 // looping over all bins and calculating reduced correlations:
9301 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9303 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin):
9304 Double_t p1n0kRe = 0.;
9305 Double_t p1n0kIm = 0.;
9307 // number of POIs in particular (pt,eta) bin):
9310 // real and imaginary parts of q_{m*n,k}:
9311 // (weighted Q-vector evaluated for particles which are both RPs and POIs in particular (pt,eta) bin)
9312 Double_t q1n2kRe = 0.;
9313 Double_t q1n2kIm = 0.;
9314 Double_t q2n1kRe = 0.;
9315 Double_t q2n1kIm = 0.;
9317 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
9318 Double_t s1p1k = 0.;
9319 Double_t s1p2k = 0.;
9320 Double_t s1p3k = 0.;
9322 // M0111 from Eq. (118) in QC2c (to be improved (notation))
9323 Double_t dM0111 = 0.;
9327 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
9328 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
9329 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
9330 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
9332 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9334 t = 1; // typeFlag = RP or POI
9336 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
9337 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))
9338 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));
9339 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))
9340 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b));
9341 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))
9342 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));
9343 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))
9344 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b));
9346 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
9347 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.);
9348 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.);
9349 s1p3k = pow(fs1dEBE[2][pe][3]->GetBinContent(b)*fs1dEBE[2][pe][3]->GetBinEntries(b),1.);
9351 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
9352 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
9353 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
9354 + 2.*(s1p3k-s1p2k*dSM1p1k));
9356 else if(type == "RP")
9358 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
9359 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))
9360 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));
9361 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))
9362 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));
9363 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))
9364 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));
9365 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))
9366 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));
9368 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
9369 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.);
9370 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.);
9371 s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.);
9373 // to be improved (cross-checked):
9374 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
9375 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
9376 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
9377 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
9379 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9381 t = 0; // typeFlag = RP or POI
9383 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
9384 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
9385 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
9386 + 2.*(s1p3k-s1p2k*dSM1p1k));
9387 //...............................................................................................
9390 // 2'-particle correlation:
9391 Double_t two1n1nW0W1 = 0.;
9392 if(mp*dSM1p1k-s1p1k)
9394 two1n1nW0W1 = (p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k-s1p1k)
9395 / (mp*dSM1p1k-s1p1k);
9397 // fill profile to get <<2'>>
9398 fDiffFlowCorrelationsPro[t][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nW0W1,mp*dSM1p1k-s1p1k);
9399 // histogram to store <2'> e-b-e (needed in some other methods):
9400 fDiffFlowCorrelationsEBE[t][pe][0]->SetBinContent(b,two1n1nW0W1);
9401 fDiffFlowEventWeightsForCorrelationsEBE[t][pe][0]->SetBinContent(b,mp*dSM1p1k-s1p1k);
9402 } // end of if(mp*dSM1p1k-s1p1k)
9404 // 4'-particle correlation:
9405 Double_t four1n1n1n1nW0W1W1W1 = 0.;
9408 four1n1n1n1nW0W1W1W1 = ((pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
9409 - q2n1kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))
9410 - 2.*q2n1kIm*dReQ1n1k*dImQ1n1k
9411 - p1n0kRe*(dReQ1n1k*dReQ2n2k+dImQ1n1k*dImQ2n2k)
9412 + p1n0kIm*(dImQ1n1k*dReQ2n2k-dReQ1n1k*dImQ2n2k)
9413 - 2.*dSM1p2k*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
9414 - 2.*(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*s1p1k
9415 + 6.*(q1n2kRe*dReQ1n1k+q1n2kIm*dImQ1n1k)
9416 + 1.*(q2n1kRe*dReQ2n2k+q2n1kIm*dImQ2n2k)
9417 + 2.*(p1n0kRe*dReQ1n3k+p1n0kIm*dImQ1n3k)
9420 / dM0111; // to be improved (notation of dM0111)
9422 // fill profile to get <<4'>>
9423 fDiffFlowCorrelationsPro[t][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nW0W1W1W1,dM0111);
9424 // histogram to store <4'> e-b-e (needed in some other methods):
9425 fDiffFlowCorrelationsEBE[t][pe][1]->SetBinContent(b,four1n1n1n1nW0W1W1W1);
9426 fDiffFlowEventWeightsForCorrelationsEBE[t][pe][1]->SetBinContent(b,dM0111);
9427 } // end of if(dM0111)
9428 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9430 } // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelationsUsingParticleWeights(TString type, TString ptOrEta); // type = RP or POI
9433 //================================================================================================================================
9436 void AliFlowAnalysisWithQCumulants::FillCommonControlHistograms(AliFlowEventSimple *anEvent)
9438 // Fill common control histograms.
9440 Int_t nRP = anEvent->GetEventNSelTracksRP(); // number of RPs (i.e. number of particles used to determine the reaction plane)
9441 fCommonHists->FillControlHistograms(anEvent);
9444 fCommonHists2nd->FillControlHistograms(anEvent);
9447 fCommonHists4th->FillControlHistograms(anEvent);
9450 fCommonHists6th->FillControlHistograms(anEvent);
9453 fCommonHists8th->FillControlHistograms(anEvent);
9454 } // end of if(nRP>7)
9455 } // end of if(nRP>5)
9456 } // end of if(nRP>3)
9457 } // end of if(nRP>1)
9459 } // end of void AliFlowAnalysisWithQCumulants::FillCommonControlHistograms(AliFlowEventSimple *anEvent)
9462 //================================================================================================================================
9465 void AliFlowAnalysisWithQCumulants::ResetEventByEventQuantities()
9467 // Reset all event by event quantities.
9473 fIntFlowCorrelationsEBE->Reset();
9474 fIntFlowEventWeightsForCorrelationsEBE->Reset();
9475 fIntFlowCorrelationsAllEBE->Reset();
9477 if(fApplyCorrectionForNUA)
9479 for(Int_t sc=0;sc<2;sc++)
9481 fIntFlowCorrectionTermsForNUAEBE[sc]->Reset();
9482 fIntFlowEventWeightForCorrectionTermsForNUAEBE[sc]->Reset();
9486 // differential flow:
9488 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
9490 for(Int_t pe=0;pe<2;pe++) // 1D in pt or eta
9492 for(Int_t m=0;m<4;m++) // multiple of harmonic
9494 for(Int_t k=0;k<9;k++) // power of weight
9496 if(fReRPQ1dEBE[t][pe][m][k]) fReRPQ1dEBE[t][pe][m][k]->Reset();
9497 if(fImRPQ1dEBE[t][pe][m][k]) fImRPQ1dEBE[t][pe][m][k]->Reset();
9503 for(Int_t t=0;t<3;t++) // type (0 = RP, 1 = POI, 2 = RP&&POI )
9505 for(Int_t pe=0;pe<2;pe++) // 1D in pt or eta
9507 for(Int_t k=0;k<9;k++)
9509 if(fs1dEBE[t][pe][k]) fs1dEBE[t][pe][k]->Reset();
9514 // e-b-e reduced correlations:
9515 for(Int_t t=0;t<2;t++) // type (0 = RP, 1 = POI)
9517 for(Int_t pe=0;pe<2;pe++) // pt or eta
9519 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
9521 if(fDiffFlowCorrelationsEBE[t][pe][rci]) fDiffFlowCorrelationsEBE[t][pe][rci]->Reset();
9522 if(fDiffFlowEventWeightsForCorrelationsEBE[t][pe][rci]) fDiffFlowEventWeightsForCorrelationsEBE[t][pe][rci]->Reset();
9527 // correction terms for NUA:
9528 for(Int_t t=0;t<2;t++) // type (0 = RP, 1 = POI)
9530 for(Int_t pe=0;pe<2;pe++) // pt or eta
9532 for(Int_t sc=0;sc<2;sc++) // sin or cos
9534 for(Int_t cti=0;cti<9;cti++) // correction term index
9536 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti]->Reset();
9543 if(fCalculate2DFlow)
9545 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
9547 for(Int_t m=0;m<4;m++) // multiple of harmonic
9549 for(Int_t k=0;k<9;k++) // power of weight
9551 if(fReRPQ2dEBE[t][m][k]) fReRPQ2dEBE[t][m][k]->Reset();
9552 if(fImRPQ2dEBE[t][m][k]) fImRPQ2dEBE[t][m][k]->Reset();
9556 for(Int_t t=0;t<3;t++) // type (0 = RP, 1 = POI, 2 = RP&&POI )
9558 for(Int_t k=0;k<9;k++)
9560 if(fs2dEBE[t][k]) fs2dEBE[t][k]->Reset();
9563 } // end of if(fCalculate2DFlow)
9565 } // end of void AliFlowAnalysisWithQCumulants::ResetEventByEventQuantities();
9568 //================================================================================================================================
9571 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTerms(TString type, TString ptOrEta)
9573 // Calculate correction terms for non-uniform acceptance for differential flow (sin terms).
9575 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][0][cti], where cti runs as follows:
9576 // 0: <<sin n(psi1)>>
9577 // 1: <<sin n(psi1+phi2)>>
9578 // 2: <<sin n(psi1+phi2-phi3)>>
9579 // 3: <<sin n(psi1-phi2-phi3)>>:
9585 Double_t dMult = (*fSMpk)(0,0);
9587 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
9588 Double_t dReQ1n = (*fReQ)(0,0);
9589 Double_t dReQ2n = (*fReQ)(1,0);
9590 //Double_t dReQ3n = (*fReQ)(2,0);
9591 //Double_t dReQ4n = (*fReQ)(3,0);
9592 Double_t dImQ1n = (*fImQ)(0,0);
9593 Double_t dImQ2n = (*fImQ)(1,0);
9594 //Double_t dImQ3n = (*fImQ)(2,0);
9595 //Double_t dImQ4n = (*fImQ)(3,0);
9597 Int_t t = -1; // type flag
9598 Int_t pe = -1; // ptEta flag
9603 } else if(type == "POI")
9611 } else if(ptOrEta == "Eta")
9616 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
9617 Double_t minPtEta[2] = {fPtMin,fEtaMin};
9618 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
9619 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
9621 // looping over all bins and calculating correction terms:
9622 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9624 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
9625 Double_t p1n0kRe = 0.;
9626 Double_t p1n0kIm = 0.;
9628 // number of POIs in particular pt or eta bin:
9631 // 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):
9632 Double_t q1n0kRe = 0.;
9633 Double_t q1n0kIm = 0.;
9634 Double_t q2n0kRe = 0.;
9635 Double_t q2n0kIm = 0.;
9637 // number of particles which are both RPs and POIs in particular pt or eta bin:
9643 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))
9644 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));
9645 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))
9646 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));
9647 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))
9648 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));
9649 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))
9650 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b));
9652 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9654 else if(type == "RP")
9657 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
9658 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
9659 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
9660 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
9661 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))
9662 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));
9663 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))
9664 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b));
9666 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9671 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
9672 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
9673 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
9674 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
9676 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9678 t = 1; // typeFlag = RP or POI
9680 else if(type == "RP")
9682 // p_{m*n,0} = q_{m*n,0}:
9688 t = 0; // typeFlag = RP or POI
9692 Double_t sinP1nPsi = 0.;
9695 sinP1nPsi = p1n0kIm/mp;
9696 // fill profile for <<sin n(psi1)>>:
9697 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi,mp);
9698 // histogram to store <sin n(psi1)> e-b-e (needed in some other methods):
9699 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][0]->SetBinContent(b,sinP1nPsi);
9702 // <<sin n(psi1+phi2)>>:
9703 Double_t sinP1nPsiP1nPhi = 0.;
9706 sinP1nPsiP1nPhi = (p1n0kRe*dImQ1n+p1n0kIm*dReQ1n-q2n0kIm)/(mp*dMult-mq);
9707 // fill profile for <<sin n(psi1+phi2)>>:
9708 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsiP1nPhi,mp*dMult-mq);
9709 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
9710 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][1]->SetBinContent(b,sinP1nPsiP1nPhi);
9711 } // end of if(mp*dMult-mq)
9713 // <<sin n(psi1+phi2-phi3)>>:
9714 Double_t sinP1nPsi1P1nPhi2MPhi3 = 0.;
9715 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9717 sinP1nPsi1P1nPhi2MPhi3 = (p1n0kIm*(pow(dImQ1n,2.)+pow(dReQ1n,2.)-dMult)
9718 - 1.*(q2n0kIm*dReQ1n-q2n0kRe*dImQ1n)
9719 - mq*dImQ1n+2.*q1n0kIm)
9720 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9721 // fill profile for <<sin n(psi1+phi2)>>:
9722 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1P1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9723 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
9724 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][2]->SetBinContent(b,sinP1nPsi1P1nPhi2MPhi3);
9725 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9727 // <<sin n(psi1-phi2-phi3)>>:
9728 Double_t sinP1nPsi1M1nPhi2MPhi3 = 0.;
9729 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9731 sinP1nPsi1M1nPhi2MPhi3 = (p1n0kIm*(pow(dReQ1n,2.)-pow(dImQ1n,2.))-2.*p1n0kRe*dReQ1n*dImQ1n
9732 - 1.*(p1n0kIm*dReQ2n-p1n0kRe*dImQ2n)
9733 + 2.*mq*dImQ1n-2.*q1n0kIm)
9734 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9735 // fill profile for <<sin n(psi1+phi2)>>:
9736 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1M1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9737 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
9738 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][3]->SetBinContent(b,sinP1nPsi1M1nPhi2MPhi3);
9739 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9740 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9742 } // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTerms(TString type, TString ptOrEta)
9745 //================================================================================================================================
9748 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTerms(TString type, TString ptOrEta)
9750 // Calculate correction terms for non-uniform acceptance for differential flow (cos terms).
9752 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][1][cti], where cti runs as follows:
9753 // 0: <<cos n(psi)>>
9754 // 1: <<cos n(psi1+phi2)>>
9755 // 2: <<cos n(psi1+phi2-phi3)>>
9756 // 3: <<cos n(psi1-phi2-phi3)>>
9762 Double_t dMult = (*fSMpk)(0,0);
9764 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
9765 Double_t dReQ1n = (*fReQ)(0,0);
9766 Double_t dReQ2n = (*fReQ)(1,0);
9767 //Double_t dReQ3n = (*fReQ)(2,0);
9768 //Double_t dReQ4n = (*fReQ)(3,0);
9769 Double_t dImQ1n = (*fImQ)(0,0);
9770 Double_t dImQ2n = (*fImQ)(1,0);
9771 //Double_t dImQ3n = (*fImQ)(2,0);
9772 //Double_t dImQ4n = (*fImQ)(3,0);
9774 Int_t t = -1; // type flag
9775 Int_t pe = -1; // ptEta flag
9780 } else if(type == "POI")
9788 } else if(ptOrEta == "Eta")
9793 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
9794 Double_t minPtEta[2] = {fPtMin,fEtaMin};
9795 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
9796 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
9798 // looping over all bins and calculating correction terms:
9799 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9801 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
9802 Double_t p1n0kRe = 0.;
9803 Double_t p1n0kIm = 0.;
9805 // number of POIs in particular pt or eta bin:
9808 // 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):
9809 Double_t q1n0kRe = 0.;
9810 Double_t q1n0kIm = 0.;
9811 Double_t q2n0kRe = 0.;
9812 Double_t q2n0kIm = 0.;
9814 // number of particles which are both RPs and POIs in particular pt or eta bin:
9820 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))
9821 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));
9822 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))
9823 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));
9824 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))
9825 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));
9826 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))
9827 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b));
9829 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9831 else if(type == "RP")
9834 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
9835 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
9836 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
9837 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
9838 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))
9839 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));
9840 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))
9841 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b));
9843 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9848 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
9849 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
9850 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
9851 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
9853 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
9855 t = 1; // typeFlag = RP or POI
9857 else if(type == "RP")
9859 // p_{m*n,0} = q_{m*n,0}:
9865 t = 0; // typeFlag = RP or POI
9869 Double_t cosP1nPsi = 0.;
9872 cosP1nPsi = p1n0kRe/mp;
9874 // fill profile for <<cos n(psi1)>>:
9875 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi,mp);
9876 // histogram to store <cos n(psi1)> e-b-e (needed in some other methods):
9877 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][0]->SetBinContent(b,cosP1nPsi);
9880 // <<cos n(psi1+phi2)>>:
9881 Double_t cosP1nPsiP1nPhi = 0.;
9884 cosP1nPsiP1nPhi = (p1n0kRe*dReQ1n-p1n0kIm*dImQ1n-q2n0kRe)/(mp*dMult-mq);
9885 // fill profile for <<sin n(psi1+phi2)>>:
9886 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsiP1nPhi,mp*dMult-mq);
9887 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
9888 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][1]->SetBinContent(b,cosP1nPsiP1nPhi);
9889 } // end of if(mp*dMult-mq)
9891 // <<cos n(psi1+phi2-phi3)>>:
9892 Double_t cosP1nPsi1P1nPhi2MPhi3 = 0.;
9893 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9895 cosP1nPsi1P1nPhi2MPhi3 = (p1n0kRe*(pow(dImQ1n,2.)+pow(dReQ1n,2.)-dMult)
9896 - 1.*(q2n0kRe*dReQ1n+q2n0kIm*dImQ1n)
9897 - mq*dReQ1n+2.*q1n0kRe)
9898 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9899 // fill profile for <<sin n(psi1+phi2)>>:
9900 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1P1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9901 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
9902 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][2]->SetBinContent(b,cosP1nPsi1P1nPhi2MPhi3);
9903 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9905 // <<cos n(psi1-phi2-phi3)>>:
9906 Double_t cosP1nPsi1M1nPhi2MPhi3 = 0.;
9907 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9909 cosP1nPsi1M1nPhi2MPhi3 = (p1n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))+2.*p1n0kIm*dReQ1n*dImQ1n
9910 - 1.*(p1n0kRe*dReQ2n+p1n0kIm*dImQ2n)
9911 - 2.*mq*dReQ1n+2.*q1n0kRe)
9912 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9913 // fill profile for <<sin n(psi1+phi2)>>:
9914 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1M1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
9915 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
9916 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][3]->SetBinContent(b,cosP1nPsi1M1nPhi2MPhi3);
9917 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
9918 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9920 } // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTerms(TString type, TString ptOrEta)
9923 //==================================================================================================================================
9926 void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUADiffFlow(TString type, TString ptOrEta)
9928 // Transfer prolfiles into histogams and correctly propagate the error (to be improved: description)
9930 // to be improved: debugged - I do not correctly transfer all profiles into histos (bug appears only after merging)
9932 Int_t t = -1; // type flag
9933 Int_t pe = -1; // ptEta flag
9938 } else if(type == "POI")
9946 } else if(ptOrEta == "Eta")
9951 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
9952 //Double_t minPtEta[2] = {fPtMin,fEtaMin};
9953 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
9954 //Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
9956 for(Int_t sc=0;sc<2;sc++) // sin or cos
9958 for(Int_t cti=0;cti<9;cti++) // correction term index
9960 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9962 Double_t correctionTerm = fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]->GetBinContent(b);
9963 fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti]->SetBinContent(b,correctionTerm);
9964 // to be improved (propagate error correctly)
9966 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
9967 } // correction term index
9968 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
9970 }// end of void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUADiffFlow(TString type, TString ptOrEta)
9973 //==================================================================================================================================
9976 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulantsCorrectedForNUA(TString type, TString ptOrEta)
9978 // Calculate generalized differential flow Q-cumulants (corrected for non-uniform acceptance)
9980 Int_t typeFlag = -1;
9981 Int_t ptEtaFlag = -1;
9986 } else if(type == "POI")
9994 } else if(ptOrEta == "Eta")
10000 Int_t t = typeFlag;
10001 Int_t pe = ptEtaFlag;
10004 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
10006 // 2-particle correlation:
10007 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
10008 // sin term coming from integrated flow:
10009 Double_t sinP1nPhi = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1); // <<sin(n*phi1)>>
10010 Double_t sinP1nPhi1P1nPhi2 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2); // <<sin(n*(phi1+phi2))>>
10011 Double_t sinP1nPhi1M1nPhi2M1nPhi3 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(3); // <<sin(n*(phi1-phi2-phi3))>>
10012 // cos term coming from integrated flow:
10013 Double_t cosP1nPhi = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1); // <<cos(n*phi1)>>
10014 Double_t cosP1nPhi1P1nPhi2 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2); // <<cos(n*(phi1+phi2))>>
10015 Double_t cosP1nPhi1M1nPhi2M1nPhi3 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(3); // <<cos(n*(phi1-phi2-phi3))>>
10017 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10019 Double_t twoPrime = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b); // <<2'>>
10020 Double_t fourPrime = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b); // <<4'>>
10021 Double_t sinP1nPsi = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][0]->GetBinContent(b); // <<sin n(Psi)>>
10022 Double_t cosP1nPsi = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][0]->GetBinContent(b); // <<cos n(Psi)>>
10023 Double_t sinP1nPsi1P1nPhi2 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][1]->GetBinContent(b); // <<sin n(psi1+phi2)>>
10024 Double_t cosP1nPsi1P1nPhi2 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][1]->GetBinContent(b); // <<cos n(psi1+phi2)>>
10025 Double_t sinP1nPsi1P1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][2]->GetBinContent(b); // <<sin n(psi1+phi2-phi3)>>
10026 Double_t cosP1nPsi1P1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][2]->GetBinContent(b); // <<cos n(psi1+phi2-phi3)>>
10027 Double_t sinP1nPsi1M1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][3]->GetBinContent(b); // <<sin n(psi1-phi2-phi3)>>
10028 Double_t cosP1nPsi1M1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][3]->GetBinContent(b); // <<cos n(psi1-phi2-phi3)>>
10029 // generalized QC{2'}:
10030 Double_t qc2Prime = twoPrime - sinP1nPsi*sinP1nPhi - cosP1nPsi*cosP1nPhi;
10031 fDiffFlowCumulants[t][pe][0]->SetBinContent(b,qc2Prime);
10032 // generalized QC{4'}:
10033 Double_t qc4Prime = fourPrime-2.*twoPrime*two
10034 - cosP1nPsi*cosP1nPhi1M1nPhi2M1nPhi3
10035 + sinP1nPsi*sinP1nPhi1M1nPhi2M1nPhi3
10036 - cosP1nPhi*cosP1nPsi1M1nPhi2M1nPhi3
10037 + sinP1nPhi*sinP1nPsi1M1nPhi2M1nPhi3
10038 - 2.*cosP1nPhi*cosP1nPsi1P1nPhi2M1nPhi3
10039 - 2.*sinP1nPhi*sinP1nPsi1P1nPhi2M1nPhi3
10040 - cosP1nPsi1P1nPhi2*cosP1nPhi1P1nPhi2
10041 - sinP1nPsi1P1nPhi2*sinP1nPhi1P1nPhi2
10042 + 2.*cosP1nPhi1P1nPhi2*(cosP1nPsi*cosP1nPhi-sinP1nPsi*sinP1nPhi)
10043 + 2.*sinP1nPhi1P1nPhi2*(cosP1nPsi*sinP1nPhi+sinP1nPsi*cosP1nPhi)
10044 + 4.*two*(cosP1nPsi*cosP1nPhi+sinP1nPsi*sinP1nPhi)
10045 + 2.*cosP1nPsi1P1nPhi2*(pow(cosP1nPhi,2.)-pow(sinP1nPhi,2.))
10046 + 4.*sinP1nPsi1P1nPhi2*cosP1nPhi*sinP1nPhi
10047 + 4.*twoPrime*(pow(cosP1nPhi,2.)+pow(sinP1nPhi,2.))
10048 - 6.*(pow(cosP1nPhi,2.)-pow(sinP1nPhi,2.))
10049 * (cosP1nPsi*cosP1nPhi-sinP1nPsi*sinP1nPhi)
10050 - 12.*cosP1nPhi*sinP1nPhi
10051 * (sinP1nPsi*cosP1nPhi+cosP1nPsi*sinP1nPhi);
10052 fDiffFlowCumulants[t][pe][1]->SetBinContent(b,qc4Prime);
10053 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
10055 } // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulantsCorrectedForNUA(TString type, TString ptOrEta)
10058 //==================================================================================================================================
10061 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectedForNUA(TString type, TString ptOrEta)
10063 // Calculate differential flow corrected for non-uniform acceptance.
10065 // to be improved (rewritten completely)
10067 Int_t typeFlag = -1;
10068 Int_t ptEtaFlag = -1;
10073 } else if(type == "POI")
10078 if(ptOrEta == "Pt")
10081 } else if(ptOrEta == "Eta")
10087 Int_t t = typeFlag;
10088 Int_t pe = ptEtaFlag;
10091 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
10093 // to be improved: access here generalized QC{2} and QC{4} instead:
10094 Double_t dV2 = fIntFlow->GetBinContent(1);
10095 Double_t dV4 = fIntFlow->GetBinContent(2);
10097 // loop over pt or eta bins:
10098 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10100 // generalized QC{2'}:
10101 Double_t gQC2Prime = fDiffFlowCumulants[t][pe][0]->GetBinContent(b);
10105 Double_t v2Prime = gQC2Prime/dV2;
10106 fDiffFlow[t][pe][0]->SetBinContent(b,v2Prime);
10108 // generalized QC{4'}:
10109 Double_t gQC4Prime = fDiffFlowCumulants[t][pe][1]->GetBinContent(b);
10113 Double_t v4Prime = -gQC4Prime/pow(dV4,3.);
10114 fDiffFlow[t][pe][1]->SetBinContent(b,v4Prime);
10116 } // end of for(Int_t b=1;b<=fnBinsPtEta[pe];b++)
10118 } // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectedForNUA(TString type, TString ptOrEta);
10121 //==================================================================================================================================
10124 void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoops(AliFlowEventSimple * const anEvent)
10126 // Evaluate with nested loops multiparticle correlations for integrated flow (without using the particle weights).
10128 // Remark: Results are stored in profile fIntFlowDirectCorrelations whose binning is organized as follows:
10130 // 1st bin: <2>_{1n|1n} = two1n1n = cos(n*(phi1-phi2))>
10131 // 2nd bin: <2>_{2n|2n} = two2n2n = cos(2n*(phi1-phi2))>
10132 // 3rd bin: <2>_{3n|3n} = two3n3n = cos(3n*(phi1-phi2))>
10133 // 4th bin: <2>_{4n|4n} = two4n4n = cos(4n*(phi1-phi2))>
10134 // 5th bin: ---- EMPTY ----
10135 // 6th bin: <3>_{2n|1n,1n} = three2n1n1n = <cos(n*(2.*phi1-phi2-phi3))>
10136 // 7th bin: <3>_{3n|2n,1n} = three3n2n1n = <cos(n*(3.*phi1-2.*phi2-phi3))>
10137 // 8th bin: <3>_{4n|2n,2n} = three4n2n2n = <cos(n*(4.*phi1-2.*phi2-2.*phi3))>
10138 // 9th bin: <3>_{4n|3n,1n} = three4n3n1n = <cos(n*(4.*phi1-3.*phi2-phi3))>
10139 // 10th bin: ---- EMPTY ----
10140 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1n = <cos(n*(phi1+phi2-phi3-phi4))>
10141 // 12th bin: <4>_{2n,1n|2n,1n} = four2n1n2n1n = <cos(2.*n*(phi1+phi2-phi3-phi4))>
10142 // 13th bin: <4>_{2n,2n|2n,2n} = four2n2n2n2n = <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>
10143 // 14th bin: <4>_{3n|1n,1n,1n} = four3n1n1n1n = <cos(n*(3.*phi1-phi2-phi3-phi4))>
10144 // 15th bin: <4>_{3n,1n|3n,1n} = four3n1n3n1n = <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>
10145 // 16th bin: <4>_{3n,1n|2n,2n} = four3n1n2n2n = <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>
10146 // 17th bin: <4>_{4n|2n,1n,1n} = four4n2n1n1n = <cos(n*(3.*phi1+phi2-3.*phi3-phi4))>
10147 // 18th bin: ---- EMPTY ----
10148 // 19th bin: <5>_{2n|1n,1n,1n,1n} = five2n1n1n1n1n = <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>
10149 // 20th bin: <5>_{2n,2n|2n,1n,1n} = five2n2n2n1n1n = <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>
10150 // 21st bin: <5>_{3n,1n|2n,1n,1n} = five3n1n2n1n1n = <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>
10151 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = five4n1n1n1n1n = <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>
10152 // 23rd bin: ---- EMPTY ----
10153 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = six1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
10154 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = six2n1n1n2n1n1n = <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>
10155 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = six2n2n1n1n1n1n = <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>
10156 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = six3n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>
10157 // 28th bin: ---- EMPTY ----
10158 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = seven2n1n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
10159 // 30th bin: ---- EMPTY ----
10160 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = eight1n1n1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
10162 Int_t nPrim = anEvent->NumberOfTracks();
10163 AliFlowTrackSimple *aftsTrack = NULL;
10164 Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
10165 Int_t n = fHarmonic;
10166 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
10167 Double_t dMult = (*fSMpk)(0,0);
10169 cout<<"Multiparticle correlations: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
10172 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
10173 } else if (dMult>fMaxAllowedMultiplicity)
10175 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
10178 cout<<"... evaluating nested loops (without using particle weights)..."<<endl;
10181 // 2-particle correlations:
10182 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
10184 for(Int_t i1=0;i1<nPrim;i1++)
10186 aftsTrack=anEvent->GetTrack(i1);
10187 if(!(aftsTrack->InRPSelection())) continue;
10188 phi1=aftsTrack->Phi();
10189 for(Int_t i2=0;i2<nPrim;i2++)
10191 if(i2==i1)continue;
10192 aftsTrack=anEvent->GetTrack(i2);
10193 if(!(aftsTrack->InRPSelection())) continue;
10194 phi2=aftsTrack->Phi();
10195 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
10196 // fill the profile with 2-p correlations:
10197 fIntFlowDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),1.); // <cos(n*(phi1-phi2))>
10198 fIntFlowDirectCorrelations->Fill(1.5,cos(2.*n*(phi1-phi2)),1.); // <cos(2n*(phi1-phi2))>
10199 fIntFlowDirectCorrelations->Fill(2.5,cos(3.*n*(phi1-phi2)),1.); // <cos(3n*(phi1-phi2))>
10200 fIntFlowDirectCorrelations->Fill(3.5,cos(4.*n*(phi1-phi2)),1.); // <cos(4n*(phi1-phi2))>
10201 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10202 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10203 } // end of if(nPrim>=2)
10205 // 3-particle correlations:
10206 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
10208 for(Int_t i1=0;i1<nPrim;i1++)
10210 aftsTrack=anEvent->GetTrack(i1);
10211 if(!(aftsTrack->InRPSelection())) continue;
10212 phi1=aftsTrack->Phi();
10213 for(Int_t i2=0;i2<nPrim;i2++)
10215 if(i2==i1)continue;
10216 aftsTrack=anEvent->GetTrack(i2);
10217 if(!(aftsTrack->InRPSelection())) continue;
10218 phi2=aftsTrack->Phi();
10219 for(Int_t i3=0;i3<nPrim;i3++)
10221 if(i3==i1||i3==i2)continue;
10222 aftsTrack=anEvent->GetTrack(i3);
10223 if(!(aftsTrack->InRPSelection())) continue;
10224 phi3=aftsTrack->Phi();
10225 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;
10226 // fill the profile with 3-p correlations:
10227 fIntFlowDirectCorrelations->Fill(5.,cos(2.*n*phi1-n*(phi2+phi3)),1.); //<3>_{2n|nn,n}
10228 fIntFlowDirectCorrelations->Fill(6.,cos(3.*n*phi1-2.*n*phi2-n*phi3),1.); //<3>_{3n|2n,n}
10229 fIntFlowDirectCorrelations->Fill(7.,cos(4.*n*phi1-2.*n*phi2-2.*n*phi3),1.); //<3>_{4n|2n,2n}
10230 fIntFlowDirectCorrelations->Fill(8.,cos(4.*n*phi1-3.*n*phi2-n*phi3),1.); //<3>_{4n|3n,n}
10231 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10232 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10233 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10234 } // end of if(nPrim>=3)
10236 // 4-particle correlations:
10237 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)
10239 for(Int_t i1=0;i1<nPrim;i1++)
10241 aftsTrack=anEvent->GetTrack(i1);
10242 if(!(aftsTrack->InRPSelection())) continue;
10243 phi1=aftsTrack->Phi();
10244 for(Int_t i2=0;i2<nPrim;i2++)
10246 if(i2==i1)continue;
10247 aftsTrack=anEvent->GetTrack(i2);
10248 if(!(aftsTrack->InRPSelection())) continue;
10249 phi2=aftsTrack->Phi();
10250 for(Int_t i3=0;i3<nPrim;i3++)
10252 if(i3==i1||i3==i2)continue;
10253 aftsTrack=anEvent->GetTrack(i3);
10254 if(!(aftsTrack->InRPSelection())) continue;
10255 phi3=aftsTrack->Phi();
10256 for(Int_t i4=0;i4<nPrim;i4++)
10258 if(i4==i1||i4==i2||i4==i3)continue;
10259 aftsTrack=anEvent->GetTrack(i4);
10260 if(!(aftsTrack->InRPSelection())) continue;
10261 phi4=aftsTrack->Phi();
10262 if(nPrim==4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush;
10263 // fill the profile with 4-p correlations:
10264 fIntFlowDirectCorrelations->Fill(10.,cos(n*phi1+n*phi2-n*phi3-n*phi4),1.); // <4>_{n,n|n,n}
10265 fIntFlowDirectCorrelations->Fill(11.,cos(2.*n*phi1+n*phi2-2.*n*phi3-n*phi4),1.); // <4>_{2n,n|2n,n}
10266 fIntFlowDirectCorrelations->Fill(12.,cos(2.*n*phi1+2*n*phi2-2.*n*phi3-2.*n*phi4),1.); // <4>_{2n,2n|2n,2n}
10267 fIntFlowDirectCorrelations->Fill(13.,cos(3.*n*phi1-n*phi2-n*phi3-n*phi4),1.); // <4>_{3n|n,n,n}
10268 fIntFlowDirectCorrelations->Fill(14.,cos(3.*n*phi1+n*phi2-3.*n*phi3-n*phi4),1.); // <4>_{3n,n|3n,n}
10269 fIntFlowDirectCorrelations->Fill(15.,cos(3.*n*phi1+n*phi2-2.*n*phi3-2.*n*phi4),1.); // <4>_{3n,n|2n,2n}
10270 fIntFlowDirectCorrelations->Fill(16.,cos(4.*n*phi1-2.*n*phi2-n*phi3-n*phi4),1.); // <4>_{4n|2n,n,n}
10271 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10272 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10273 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10274 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10275 } // end of if(nPrim>=)
10277 // 5-particle correlations:
10278 if(nPrim>=5 && nPrim<=fMaxAllowedMultiplicity)
10280 for(Int_t i1=0;i1<nPrim;i1++)
10282 aftsTrack=anEvent->GetTrack(i1);
10283 if(!(aftsTrack->InRPSelection())) continue;
10284 phi1=aftsTrack->Phi();
10285 for(Int_t i2=0;i2<nPrim;i2++)
10287 if(i2==i1)continue;
10288 aftsTrack=anEvent->GetTrack(i2);
10289 if(!(aftsTrack->InRPSelection())) continue;
10290 phi2=aftsTrack->Phi();
10291 for(Int_t i3=0;i3<nPrim;i3++)
10293 if(i3==i1||i3==i2)continue;
10294 aftsTrack=anEvent->GetTrack(i3);
10295 if(!(aftsTrack->InRPSelection())) continue;
10296 phi3=aftsTrack->Phi();
10297 for(Int_t i4=0;i4<nPrim;i4++)
10299 if(i4==i1||i4==i2||i4==i3)continue;
10300 aftsTrack=anEvent->GetTrack(i4);
10301 if(!(aftsTrack->InRPSelection())) continue;
10302 phi4=aftsTrack->Phi();
10303 for(Int_t i5=0;i5<nPrim;i5++)
10305 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
10306 aftsTrack=anEvent->GetTrack(i5);
10307 if(!(aftsTrack->InRPSelection())) continue;
10308 phi5=aftsTrack->Phi();
10309 if(nPrim==5) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<"\r"<<flush;
10310 // fill the profile with 5-p correlations:
10311 fIntFlowDirectCorrelations->Fill(18.,cos(2.*n*phi1+n*phi2-n*phi3-n*phi4-n*phi5),1.); //<5>_{2n,n|n,n,n}
10312 fIntFlowDirectCorrelations->Fill(19.,cos(2.*n*phi1+2.*n*phi2-2.*n*phi3-n*phi4-n*phi5),1.); //<5>_{2n,2n|2n,n,n}
10313 fIntFlowDirectCorrelations->Fill(20.,cos(3.*n*phi1+n*phi2-2.*n*phi3-n*phi4-n*phi5),1.); //<5>_{3n,n|2n,n,n}
10314 fIntFlowDirectCorrelations->Fill(21.,cos(4.*n*phi1-n*phi2-n*phi3-n*phi4-n*phi5),1.); //<5>_{4n|n,n,n,n}
10315 } // end of for(Int_t i5=0;i5<nPrim;i5++)
10316 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10317 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10318 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10319 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10320 } // end of if(nPrim>=5)
10322 // 6-particle correlations:
10323 if(nPrim>=6 && nPrim<=fMaxAllowedMultiplicity)
10325 for(Int_t i1=0;i1<nPrim;i1++)
10327 aftsTrack=anEvent->GetTrack(i1);
10328 if(!(aftsTrack->InRPSelection())) continue;
10329 phi1=aftsTrack->Phi();
10330 for(Int_t i2=0;i2<nPrim;i2++)
10332 if(i2==i1)continue;
10333 aftsTrack=anEvent->GetTrack(i2);
10334 if(!(aftsTrack->InRPSelection())) continue;
10335 phi2=aftsTrack->Phi();
10336 for(Int_t i3=0;i3<nPrim;i3++)
10338 if(i3==i1||i3==i2)continue;
10339 aftsTrack=anEvent->GetTrack(i3);
10340 if(!(aftsTrack->InRPSelection())) continue;
10341 phi3=aftsTrack->Phi();
10342 for(Int_t i4=0;i4<nPrim;i4++)
10344 if(i4==i1||i4==i2||i4==i3)continue;
10345 aftsTrack=anEvent->GetTrack(i4);
10346 if(!(aftsTrack->InRPSelection())) continue;
10347 phi4=aftsTrack->Phi();
10348 for(Int_t i5=0;i5<nPrim;i5++)
10350 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
10351 aftsTrack=anEvent->GetTrack(i5);
10352 if(!(aftsTrack->InRPSelection())) continue;
10353 phi5=aftsTrack->Phi();
10354 for(Int_t i6=0;i6<nPrim;i6++)
10356 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
10357 aftsTrack=anEvent->GetTrack(i6);
10358 if(!(aftsTrack->InRPSelection())) continue;
10359 phi6=aftsTrack->Phi();
10360 if(nPrim==6) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<"\r"<<flush;
10361 // fill the profile with 6-p correlations:
10362 fIntFlowDirectCorrelations->Fill(23.,cos(n*phi1+n*phi2+n*phi3-n*phi4-n*phi5-n*phi6),1.); //<6>_{n,n,n|n,n,n}
10363 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}
10364 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}
10365 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}
10366 } // end of for(Int_t i6=0;i6<nPrim;i6++)
10367 } // end of for(Int_t i5=0;i5<nPrim;i5++)
10368 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10369 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10370 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10371 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10372 } // end of if(nPrim>=6)
10374 // 7-particle correlations:
10375 if(nPrim>=7 && nPrim<=fMaxAllowedMultiplicity)
10377 for(Int_t i1=0;i1<nPrim;i1++)
10379 aftsTrack=anEvent->GetTrack(i1);
10380 if(!(aftsTrack->InRPSelection())) continue;
10381 phi1=aftsTrack->Phi();
10382 for(Int_t i2=0;i2<nPrim;i2++)
10384 if(i2==i1)continue;
10385 aftsTrack=anEvent->GetTrack(i2);
10386 if(!(aftsTrack->InRPSelection())) continue;
10387 phi2=aftsTrack->Phi();
10388 for(Int_t i3=0;i3<nPrim;i3++)
10390 if(i3==i1||i3==i2)continue;
10391 aftsTrack=anEvent->GetTrack(i3);
10392 if(!(aftsTrack->InRPSelection())) continue;
10393 phi3=aftsTrack->Phi();
10394 for(Int_t i4=0;i4<nPrim;i4++)
10396 if(i4==i1||i4==i2||i4==i3)continue;
10397 aftsTrack=anEvent->GetTrack(i4);
10398 if(!(aftsTrack->InRPSelection())) continue;
10399 phi4=aftsTrack->Phi();
10400 for(Int_t i5=0;i5<nPrim;i5++)
10402 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
10403 aftsTrack=anEvent->GetTrack(i5);
10404 if(!(aftsTrack->InRPSelection())) continue;
10405 phi5=aftsTrack->Phi();
10406 for(Int_t i6=0;i6<nPrim;i6++)
10408 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
10409 aftsTrack=anEvent->GetTrack(i6);
10410 if(!(aftsTrack->InRPSelection())) continue;
10411 phi6=aftsTrack->Phi();
10412 for(Int_t i7=0;i7<nPrim;i7++)
10414 if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;
10415 aftsTrack=anEvent->GetTrack(i7);
10416 if(!(aftsTrack->InRPSelection())) continue;
10417 phi7=aftsTrack->Phi();
10418 if(nPrim==7) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<" "<<i7<<"\r"<<flush;
10419 // fill the profile with 7-p correlation:
10420 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}
10421 } // end of for(Int_t i7=0;i7<nPrim;i7++)
10422 } // end of for(Int_t i6=0;i6<nPrim;i6++)
10423 } // end of for(Int_t i5=0;i5<nPrim;i5++)
10424 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10425 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10426 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10427 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10428 } // end of if(nPrim>=7)
10430 // 8-particle correlations:
10431 if(nPrim>=8 && nPrim<=fMaxAllowedMultiplicity)
10433 for(Int_t i1=0;i1<nPrim;i1++)
10435 aftsTrack=anEvent->GetTrack(i1);
10436 if(!(aftsTrack->InRPSelection())) continue;
10437 phi1=aftsTrack->Phi();
10438 for(Int_t i2=0;i2<nPrim;i2++)
10440 if(i2==i1)continue;
10441 aftsTrack=anEvent->GetTrack(i2);
10442 if(!(aftsTrack->InRPSelection())) continue;
10443 phi2=aftsTrack->Phi();
10444 for(Int_t i3=0;i3<nPrim;i3++)
10446 if(i3==i1||i3==i2)continue;
10447 aftsTrack=anEvent->GetTrack(i3);
10448 if(!(aftsTrack->InRPSelection())) continue;
10449 phi3=aftsTrack->Phi();
10450 for(Int_t i4=0;i4<nPrim;i4++)
10452 if(i4==i1||i4==i2||i4==i3)continue;
10453 aftsTrack=anEvent->GetTrack(i4);
10454 if(!(aftsTrack->InRPSelection())) continue;
10455 phi4=aftsTrack->Phi();
10456 for(Int_t i5=0;i5<nPrim;i5++)
10458 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
10459 aftsTrack=anEvent->GetTrack(i5);
10460 if(!(aftsTrack->InRPSelection())) continue;
10461 phi5=aftsTrack->Phi();
10462 for(Int_t i6=0;i6<nPrim;i6++)
10464 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
10465 aftsTrack=anEvent->GetTrack(i6);
10466 if(!(aftsTrack->InRPSelection())) continue;
10467 phi6=aftsTrack->Phi();
10468 for(Int_t i7=0;i7<nPrim;i7++)
10470 if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;
10471 aftsTrack=anEvent->GetTrack(i7);
10472 if(!(aftsTrack->InRPSelection())) continue;
10473 phi7=aftsTrack->Phi();
10474 for(Int_t i8=0;i8<nPrim;i8++)
10476 if(i8==i1||i8==i2||i8==i3||i8==i4||i8==i5||i8==i6||i8==i7)continue;
10477 aftsTrack=anEvent->GetTrack(i8);
10478 if(!(aftsTrack->InRPSelection())) continue;
10479 phi8=aftsTrack->Phi();
10480 cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<" "<<i7<<" "<<i8<<"\r"<<flush;
10481 // fill the profile with 8-p correlation:
10482 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}
10483 } // end of for(Int_t i8=0;i8<nPrim;i8++)
10484 } // end of for(Int_t i7=0;i7<nPrim;i7++)
10485 } // end of for(Int_t i6=0;i6<nPrim;i6++)
10486 } // end of for(Int_t i5=0;i5<nPrim;i5++)
10487 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10488 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10489 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10490 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10491 } // end of if(nPrim>=8)
10495 } // end of AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoops(AliFlowEventSimple* anEvent)
10498 //==================================================================================================================================
10501 void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrelations()
10503 // Cross-check results for multiparticle correlations needed for int. flow: results from Q-vectors vs results from nested loops.
10507 cout<<" *****************************************"<<endl;
10508 cout<<" **** cross-checking the correlations ****"<<endl;
10509 cout<<" **** for integrated flow ****"<<endl;
10510 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
10512 cout<<" **** (particle weights not used) ****"<<endl;
10515 cout<<" **** (particle weights used) ****"<<endl;
10517 cout<<" *****************************************"<<endl;
10521 Int_t ciMax = 32; // to be improved (removed eventually when I calculate 6th and 8th order with particle weights)
10523 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
10528 for(Int_t ci=1;ci<=ciMax;ci++)
10530 if(strcmp((fIntFlowCorrelationsAllPro->GetXaxis())->GetBinLabel(ci), "") == 0) continue; // to be improved (access finalized histogram here)
10531 cout<<(fIntFlowCorrelationsAllPro->GetXaxis())->GetBinLabel(ci)<<":"<<endl; // to be improved (access finalized histogram here)
10532 cout<<"from Q-vectors = "<<fIntFlowCorrelationsAllPro->GetBinContent(ci)<<endl; // to be improved (access finalized histogram here)
10533 cout<<"from nested loops = "<<fIntFlowDirectCorrelations->GetBinContent(ci)<<endl;
10537 } // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrelations()
10540 //================================================================================================================================
10543 void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrectionTermsForNUA()
10545 // Cross-check results for corrections terms for non-uniform acceptance needed for int. flow: results from Q-vectors vs results from nested loops.
10549 cout<<" *********************************************"<<endl;
10550 cout<<" **** cross-checking the correction terms ****"<<endl;
10551 cout<<" **** for non-uniform acceptance relevant ****"<<endl;
10552 cout<<" **** for integrated flow ****"<<endl;
10553 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
10555 cout<<" **** (particle weights not used) ****"<<endl;
10558 cout<<" **** (particle weights used) ****"<<endl;
10560 cout<<" *********************************************"<<endl;
10564 for(Int_t ci=1;ci<=10;ci++) // correction term index
10566 for(Int_t sc=0;sc<2;sc++) // sin or cos term
10568 if(strcmp((fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->GetBinLabel(ci), "") == 0) continue; // to be improved (access finalized histogram here)
10569 cout<<(fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->GetBinLabel(ci)<<":"<<endl; // to be improved (access finalized histogram here)
10570 cout<<"from Q-vectors = "<<fIntFlowCorrectionTermsForNUAPro[sc]->GetBinContent(ci)<<endl; // to be improved (access finalized histogram here)
10571 cout<<"from nested loops = "<<fIntFlowDirectCorrectionTermsForNUA[sc]->GetBinContent(ci)<<endl;
10573 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos term
10574 } // end of for(Int_t ci=1;ci<=10;ci++) // correction term index
10576 } // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrectionTermsForNUA()
10579 //================================================================================================================================
10582 void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent)
10584 // Evaluate with nested loops multiparticle correlations for integrated flow (using the particle weights).
10586 // Results are stored in profile fIntFlowDirectCorrelations.
10587 // Remark 1: When particle weights are used the binning of fIntFlowDirectCorrelations is organized as follows:
10589 // 1st bin: <2>_{1n|1n} = two1n1nW1W1 = <w1 w2 cos(n*(phi1-phi2))>
10590 // 2nd bin: <2>_{2n|2n} = two2n2nW2W2 = <w1^2 w2^2 cos(2n*(phi1-phi2))>
10591 // 3rd bin: <2>_{3n|3n} = two3n3nW3W3 = <w1^3 w2^3 cos(3n*(phi1-phi2))>
10592 // 4th bin: <2>_{4n|4n} = two4n4nW4W4 = <w1^4 w2^4 cos(4n*(phi1-phi2))>
10593 // 5th bin: ---- EMPTY ----
10594 // 6th bin: <3>_{2n|1n,1n} = three2n1n1nW2W1W1 = <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
10595 // 7th bin: <3>_{3n|2n,1n} = ...
10596 // 8th bin: <3>_{4n|2n,2n} = ...
10597 // 9th bin: <3>_{4n|3n,1n} = ...
10598 // 10th bin: ---- EMPTY ----
10599 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1nW1W1W1W1 = <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
10600 // 12th bin: <4>_{2n,1n|2n,1n} = ...
10601 // 13th bin: <4>_{2n,2n|2n,2n} = ...
10602 // 14th bin: <4>_{3n|1n,1n,1n} = ...
10603 // 15th bin: <4>_{3n,1n|3n,1n} = ...
10604 // 16th bin: <4>_{3n,1n|2n,2n} = ...
10605 // 17th bin: <4>_{4n|2n,1n,1n} = ...
10606 // 18th bin: ---- EMPTY ----
10607 // 19th bin: <5>_{2n|1n,1n,1n,1n} = ...
10608 // 20th bin: <5>_{2n,2n|2n,1n,1n} = ...
10609 // 21st bin: <5>_{3n,1n|2n,1n,1n} = ...
10610 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = ...
10611 // 23rd bin: ---- EMPTY ----
10612 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = ...
10613 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = ...
10614 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = ...
10615 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = ...
10616 // 28th bin: ---- EMPTY ----
10617 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = ...
10618 // 30th bin: ---- EMPTY ----
10619 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = ...
10621 // Remark 2: When particle weights are used there are some extra correlations. They are stored in
10622 // fIntFlowExtraDirectCorrelations binning of which is organized as follows:
10624 // 1st bin: two1n1nW3W1 = <w1^3 w2 cos(n*(phi1-phi2))>
10625 // 2nd bin: two1n1nW1W1W2 = <w1 w2 w3^2 cos(n*(phi1-phi2))>
10628 Int_t nPrim = anEvent->NumberOfTracks();
10629 AliFlowTrackSimple *aftsTrack = NULL;
10630 //Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
10631 //Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1., wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
10632 Double_t phi1=0., phi2=0., phi3=0., phi4=0.;
10633 Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1.;
10634 Int_t n = fHarmonic;
10635 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
10636 Double_t dMult = (*fSMpk)(0,0);
10638 cout<<"Multiparticle correlations: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
10641 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
10642 } else if (dMult>fMaxAllowedMultiplicity)
10644 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
10647 cout<<"... evaluating nested loops (using particle weights) ..."<<endl;
10650 // 2-particle correlations:
10651 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
10653 // 2 nested loops multiparticle correlations using particle weights:
10654 for(Int_t i1=0;i1<nPrim;i1++)
10656 aftsTrack=anEvent->GetTrack(i1);
10657 if(!(aftsTrack->InRPSelection())) continue;
10658 phi1=aftsTrack->Phi();
10659 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
10660 for(Int_t i2=0;i2<nPrim;i2++)
10662 if(i2==i1)continue;
10663 aftsTrack=anEvent->GetTrack(i2);
10664 if(!(aftsTrack->InRPSelection())) continue;
10665 phi2=aftsTrack->Phi();
10666 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
10667 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
10668 // 2-p correlations using particle weights:
10669 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),wPhi1*wPhi2); // <w1 w2 cos( n*(phi1-phi2))>
10670 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))>
10671 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))>
10672 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))>
10673 // extra correlations:
10674 // 2-p extra correlations (do not appear if particle weights are not used):
10675 if(fUsePhiWeights) fIntFlowExtraDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),pow(wPhi1,3)*wPhi2); // <w1^3 w2 cos(n*(phi1-phi2))>
10677 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10678 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10679 } // end of if(nPrim>=2)
10681 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
10683 // 3 nested loops multiparticle correlations using particle weights:
10684 for(Int_t i1=0;i1<nPrim;i1++)
10686 aftsTrack=anEvent->GetTrack(i1);
10687 if(!(aftsTrack->InRPSelection())) continue;
10688 phi1=aftsTrack->Phi();
10689 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
10690 for(Int_t i2=0;i2<nPrim;i2++)
10692 if(i2==i1)continue;
10693 aftsTrack=anEvent->GetTrack(i2);
10694 if(!(aftsTrack->InRPSelection())) continue;
10695 phi2=aftsTrack->Phi();
10696 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
10697 for(Int_t i3=0;i3<nPrim;i3++)
10699 if(i3==i1||i3==i2)continue;
10700 aftsTrack=anEvent->GetTrack(i3);
10701 if(!(aftsTrack->InRPSelection())) continue;
10702 phi3=aftsTrack->Phi();
10703 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
10704 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;
10705 // 3-p correlations using particle weights:
10706 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))>
10708 // extra correlations:
10709 // 2-p extra correlations (do not appear if particle weights are not used):
10710 if(fUsePhiWeights) fIntFlowExtraDirectCorrelations->Fill(1.5,cos(n*(phi1-phi2)),wPhi1*wPhi2*pow(wPhi3,2)); // <w1 w2 w3^2 cos(n*(phi1-phi2))>
10712 // 3-p extra correlations (do not appear if particle weights are not used):
10714 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10715 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10716 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10717 } // end of if(nPrim>=3)
10719 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)
10721 // 4 nested loops multiparticle correlations using particle weights:
10722 for(Int_t i1=0;i1<nPrim;i1++)
10724 aftsTrack=anEvent->GetTrack(i1);
10725 if(!(aftsTrack->InRPSelection())) continue;
10726 phi1=aftsTrack->Phi();
10727 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
10728 for(Int_t i2=0;i2<nPrim;i2++)
10730 if(i2==i1)continue;
10731 aftsTrack=anEvent->GetTrack(i2);
10732 if(!(aftsTrack->InRPSelection())) continue;
10733 phi2=aftsTrack->Phi();
10734 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
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 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
10742 for(Int_t i4=0;i4<nPrim;i4++)
10744 if(i4==i1||i4==i2||i4==i3)continue;
10745 aftsTrack=anEvent->GetTrack(i4);
10746 if(!(aftsTrack->InRPSelection())) continue;
10747 phi4=aftsTrack->Phi();
10748 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
10749 if(nPrim>=4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush; // to be improved (replace eventually this if statement with if(nPrim==4))
10750 // 4-p correlations using particle weights:
10751 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(10.5,cos(n*phi1+n*phi2-n*phi3-n*phi4),wPhi1*wPhi2*wPhi3*wPhi4);
10752 // extra correlations:
10753 // 2-p extra correlations (do not appear if particle weights are not used):
10755 // 3-p extra correlations (do not appear if particle weights are not used):
10757 // 4-p extra correlations (do not appear if particle weights are not used):
10759 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10760 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10761 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10762 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10763 } // end of if(nPrim>=4)
10767 } // end of void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent)
10770 //================================================================================================================================
10773 void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowExtraCorrelations()
10775 // Cross-check results for extra multiparticle correlations needed for int. flow
10776 // which appear only when particle weights are used: results from Q-vectors vs results from nested loops.
10780 cout<<" ***********************************************"<<endl;
10781 cout<<" **** cross-checking the extra correlations ****"<<endl;
10782 cout<<" **** for integrated flow ****"<<endl;
10783 cout<<" ***********************************************"<<endl;
10787 for(Int_t eci=1;eci<=2;eci++) // to be improved (increased eciMax eventually when I calculate 6th and 8th)
10789 if(strcmp((fIntFlowExtraCorrelationsPro->GetXaxis())->GetBinLabel(eci), "") == 0) continue;
10790 cout<<(fIntFlowExtraCorrelationsPro->GetXaxis())->GetBinLabel(eci)<<":"<<endl;
10791 cout<<"from Q-vectors = "<<fIntFlowExtraCorrelationsPro->GetBinContent(eci)<<endl;
10792 cout<<"from nested loops = "<<fIntFlowExtraDirectCorrelations->GetBinContent(eci)<<endl;
10796 } // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowExtraCorrelations()
10799 //================================================================================================================================
10802 void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoops(AliFlowEventSimple * const anEvent)
10804 // Evaluate with nested loops correction terms for non-uniform acceptance relevant for NONAME integrated flow (to be improved (name)).
10806 // Remark: Both sin and cos correction terms are calculated in this method. Sin terms are stored in fIntFlowDirectCorrectionTermsForNUA[0],
10807 // and cos terms in fIntFlowDirectCorrectionTermsForNUA[1]. Binning of fIntFlowDirectCorrectionTermsForNUA[sc] is organized as follows
10808 // (sc stands for either sin or cos):
10810 // 1st bin: <<sc(n*(phi1))>>
10811 // 2nd bin: <<sc(n*(phi1+phi2))>>
10812 // 3rd bin: <<sc(n*(phi1-phi2-phi3))>>
10813 // 4th bin: <<sc(n*(2phi1-phi2))>>
10815 Int_t nPrim = anEvent->NumberOfTracks();
10816 AliFlowTrackSimple *aftsTrack = NULL;
10817 Double_t phi1=0., phi2=0., phi3=0.;
10818 Int_t n = fHarmonic;
10819 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
10820 Double_t dMult = (*fSMpk)(0,0);
10822 cout<<"Correction terms for non-uniform acceptance: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
10825 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
10826 } else if (dMult>fMaxAllowedMultiplicity)
10828 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
10831 cout<<"... evaluating nested loops (without using particle weights)..."<<endl;
10834 if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)
10836 // 1-particle correction terms for non-uniform acceptance:
10837 for(Int_t i1=0;i1<nPrim;i1++)
10839 aftsTrack=anEvent->GetTrack(i1);
10840 if(!(aftsTrack->InRPSelection())) continue;
10841 phi1=aftsTrack->Phi();
10842 if(nPrim==1) cout<<i1<<"\r"<<flush;
10844 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(0.5,sin(n*phi1),1.); // <sin(n*phi1)>
10846 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(0.5,cos(n*phi1),1.); // <cos(n*phi1)>
10847 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10848 } // end of if(nPrim>=1)
10850 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
10852 // 2-particle correction terms for non-uniform acceptance:
10853 for(Int_t i1=0;i1<nPrim;i1++)
10855 aftsTrack=anEvent->GetTrack(i1);
10856 if(!(aftsTrack->InRPSelection())) continue;
10857 phi1=aftsTrack->Phi();
10858 for(Int_t i2=0;i2<nPrim;i2++)
10860 if(i2==i1)continue;
10861 aftsTrack=anEvent->GetTrack(i2);
10862 if(!(aftsTrack->InRPSelection())) continue;
10863 phi2=aftsTrack->Phi();
10864 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
10866 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(1.5,sin(n*(phi1+phi2)),1.); // <<sin(n*(phi1+phi2))>>
10867 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(3.5,sin(n*(2*phi1-phi2)),1.); // <<sin(n*(2*phi1-phi2))>>
10869 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(1.5,cos(n*(phi1+phi2)),1.); // <<cos(n*(phi1+phi2))>>
10870 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(3.5,cos(n*(2*phi1-phi2)),1.); // <<cos(n*(2*phi1-phi2))>>
10871 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10872 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10873 } // end of if(nPrim>=2)
10875 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
10877 // 3-particle correction terms for non-uniform acceptance:
10878 for(Int_t i1=0;i1<nPrim;i1++)
10880 aftsTrack=anEvent->GetTrack(i1);
10881 if(!(aftsTrack->InRPSelection())) continue;
10882 phi1=aftsTrack->Phi();
10883 for(Int_t i2=0;i2<nPrim;i2++)
10885 if(i2==i1)continue;
10886 aftsTrack=anEvent->GetTrack(i2);
10887 if(!(aftsTrack->InRPSelection())) continue;
10888 phi2=aftsTrack->Phi();
10889 for(Int_t i3=0;i3<nPrim;i3++)
10891 if(i3==i1||i3==i2)continue;
10892 aftsTrack=anEvent->GetTrack(i3);
10893 if(!(aftsTrack->InRPSelection())) continue;
10894 phi3=aftsTrack->Phi();
10895 if(nPrim>=3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush; // to be improved (eventually I will change this if statement)
10897 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(2.5,sin(n*(phi1-phi2-phi3)),1.); // <<sin(n*(phi1-phi2-phi3))>>
10899 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(2.5,cos(n*(phi1-phi2-phi3)),1.); // <<cos(n*(phi1-phi2-phi3))>>
10900 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10901 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10902 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10903 } // end of if(nPrim>=3)
10907 //================================================================================================================================
10908 void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoops(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
10910 // Evaluate reduced correlations with nested loops without using the particle weights.
10912 // Remark 1: Reduced correlations are evaluated in pt bin number fCrossCheckInPtBinNo and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
10913 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrelations[t][pe][ci], where indices runs as follows:
10914 // [0=RP,1=POI][0=Pt,1=Eta][0=<2'>,1=<4'>,2=<6'>,3=<8'>]
10915 // Remark 3: <2'> = <cos(n*(psi1-phi2))>
10916 // <4'> = <cos(n*(psi1+phi2-phi3-phi4))>
10919 Int_t typeFlag = -1;
10920 Int_t ptEtaFlag = -1;
10924 } else if(type == "POI")
10928 if(ptOrEta == "Pt")
10931 } else if(ptOrEta == "Eta")
10936 Int_t t = typeFlag;
10937 Int_t pe = ptEtaFlag;
10939 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
10940 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
10941 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
10943 Int_t nPrim = anEvent->NumberOfTracks();
10944 AliFlowTrackSimple *aftsTrack = NULL;
10946 Double_t psi1=0., phi2=0., phi3=0., phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
10948 Int_t n = fHarmonic;
10950 // 2'-particle correlations:
10951 for(Int_t i1=0;i1<nPrim;i1++)
10953 aftsTrack=anEvent->GetTrack(i1);
10954 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
10955 if(typeFlag==1) // this is diff flow of POIs
10957 if(ptOrEta == "Pt")
10959 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
10960 } else if (ptOrEta == "Eta")
10962 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
10964 } else // this is diff flow of RPs
10966 if(ptOrEta == "Pt")
10968 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
10969 } else if (ptOrEta == "Eta")
10971 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
10975 psi1=aftsTrack->Phi();
10976 for(Int_t i2=0;i2<nPrim;i2++)
10978 if(i2==i1)continue;
10979 aftsTrack=anEvent->GetTrack(i2);
10980 // RP condition (!(first) particle in the correlator must be RP):
10981 if(!(aftsTrack->InRPSelection()))continue;
10982 phi2=aftsTrack->Phi();
10983 // 2'-particle correlations:
10984 fDiffFlowDirectCorrelations[t][pe][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(1.*n*(psi1-phi2)),1.); // <cos(n*(psi1-phi2))
10985 }//end of for(Int_t i2=0;i2<nPrim;i2++)
10986 }//end of for(Int_t i1=0;i1<nPrim;i1++)
10990 // 3'-particle correlations:
10991 for(Int_t i1=0;i1<nPrim;i1++)
10993 aftsTrack=anEvent->GetTrack(i1);
10994 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
10995 if(ptOrEta == "Pt")
10997 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
10998 } else if (ptOrEta == "Eta")
11000 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11002 psi1=aftsTrack->Phi();
11003 for(Int_t i2=0;i2<nPrim;i2++)
11005 if(i2==i1)continue;
11006 aftsTrack=anEvent->GetTrack(i2);
11007 // RP condition (!(first) particle in the correlator must be RP):
11008 if(!(aftsTrack->InRPSelection())) continue;
11009 phi2=aftsTrack->Phi();
11010 for(Int_t i3=0;i3<nPrim;i3++)
11012 if(i3==i1||i3==i2)continue;
11013 aftsTrack=anEvent->GetTrack(i3);
11014 // RP condition (!(first) particle in the correlator must be RP):
11015 if(!(aftsTrack->InRPSelection())) continue;
11016 phi3=aftsTrack->Phi();
11017 // 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))>
11018 }//end of for(Int_t i3=0;i3<nPrim;i3++)
11019 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11020 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11024 // 4'-particle correlations:
11025 for(Int_t i1=0;i1<nPrim;i1++)
11027 aftsTrack=anEvent->GetTrack(i1);
11028 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11029 if(typeFlag==1) // this is diff flow of POIs
11031 if(ptOrEta == "Pt")
11033 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11034 } else if (ptOrEta == "Eta")
11036 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11038 } else // this is diff flow of RPs
11040 if(ptOrEta == "Pt")
11042 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11043 } else if (ptOrEta == "Eta")
11045 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11049 psi1=aftsTrack->Phi();
11050 for(Int_t i2=0;i2<nPrim;i2++)
11052 if(i2==i1) continue;
11053 aftsTrack=anEvent->GetTrack(i2);
11054 // RP condition (!(first) particle in the correlator must be RP):
11055 if(!(aftsTrack->InRPSelection())) continue;
11056 phi2=aftsTrack->Phi();
11057 for(Int_t i3=0;i3<nPrim;i3++)
11059 if(i3==i1||i3==i2) continue;
11060 aftsTrack=anEvent->GetTrack(i3);
11061 // RP condition (!(first) particle in the correlator must be RP):
11062 if(!(aftsTrack->InRPSelection())) continue;
11063 phi3=aftsTrack->Phi();
11064 for(Int_t i4=0;i4<nPrim;i4++)
11066 if(i4==i1||i4==i2||i4==i3) continue;
11067 aftsTrack=anEvent->GetTrack(i4);
11068 // RP condition (!(first) particle in the correlator must be RP):
11069 if(!(aftsTrack->InRPSelection())) continue;
11070 phi4=aftsTrack->Phi();
11071 // 4'-particle correlations:
11072 fDiffFlowDirectCorrelations[t][pe][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3-phi4)),1.); // <cos(n(psi1+phi2-phi3-phi4))>
11073 }//end of for(Int_t i4=0;i4<nPrim;i4++)
11074 }//end of for(Int_t i3=0;i3<nPrim;i3++)
11075 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11076 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11078 // count # of RPs and POIs in selected pt and eta bins for cross-checkings:
11079 for(Int_t i=0;i<nPrim;i++)
11081 aftsTrack=anEvent->GetTrack(i);
11082 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11083 if(typeFlag==1) // this is diff flow of POIs
11085 if(ptOrEta == "Pt")
11087 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11088 } else if (ptOrEta == "Eta")
11090 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11092 } else // this is diff flow of RPs
11094 if(ptOrEta == "Pt")
11096 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11097 } else if (ptOrEta == "Eta")
11099 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11103 fNoOfParticlesInBin->Fill(t+pe+0.5);
11106 } // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoops(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
11109 //================================================================================================================================
11112 void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrelations(TString type, TString ptOrEta)
11114 // Compare correlations needed for diff. flow calculated with nested loops and those calculated from Q-vectors
11116 Int_t typeFlag = -1;
11117 Int_t ptEtaFlag = -1;
11121 } else if(type == "POI")
11125 if(ptOrEta == "Pt")
11128 } else if(ptOrEta == "Eta")
11133 Int_t t = typeFlag;
11134 Int_t pe = ptEtaFlag;
11136 TString rpORpoiString[2] = {"RP ","POI"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
11137 TString ptORetaString[2] = {"pt","eta"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
11138 TString reducedCorrelations[4] = {"<<cos(n(psi1-phi2))>>","<<cos(n(psi1+phi2-phi3-phi4))>>","",""}; // to be improved (access this from pro or hist)
11139 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
11140 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
11142 Int_t crossCheckInPtEtaBinNo[2] = {fCrossCheckInPtBinNo,fCrossCheckInEtaBinNo};
11146 cout<<" *****************************************"<<endl;
11147 cout<<" **** cross-checking the correlations ****"<<endl;
11148 cout<<" **** for differential flow ("<<rpORpoiString[t]<<") ****"<<endl;
11149 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
11151 cout<<" **** (particle weights not used) ****"<<endl;
11154 cout<<" **** (particle weights used) ****"<<endl;
11156 cout<<" *****************************************"<<endl;
11158 cout<<" "<<ptORetaString[pe]<<" bin: "<<lowerPtEtaEdge[pe]<<" <= "<<ptORetaString[pe]<<" < "<<upperPtEtaEdge[pe]<<endl;
11161 for(Int_t rci=0;rci<2;rci++) // to be improved (calculate 6th and 8th order)
11163 cout<<" "<<reducedCorrelations[rci].Data()<<":"<<endl;
11164 cout<<" from Q-vectors = "<<fDiffFlowCorrelationsPro[t][pe][rci]->GetBinContent(crossCheckInPtEtaBinNo[pe])<<endl;
11165 cout<<" from nested loops = "<<fDiffFlowDirectCorrelations[t][pe][rci]->GetBinContent(1)<<endl;
11167 } // end of for(Int_t rci=0;rci<4;rci++)
11169 } // end of void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrelations(TString type, TString ptOrEta)
11171 //================================================================================================================================
11173 void AliFlowAnalysisWithQCumulants::PrintNumberOfParticlesInSelectedBin()
11175 // Print on the screen number of RPs and POIs in selected pt and eta bin for cross checkings.
11178 cout<<"Number of RPs in selected pt bin = "<<fNoOfParticlesInBin->GetBinContent(1)<<endl;
11179 cout<<"Number of RPs in selected eta bin = "<<fNoOfParticlesInBin->GetBinContent(2)<<endl;
11180 cout<<"Number of POIs in selected pt bin = "<<fNoOfParticlesInBin->GetBinContent(3)<<endl;
11181 cout<<"Number of POIs in selected eta bin = "<<fNoOfParticlesInBin->GetBinContent(4)<<endl;
11183 } // end of void AliFlowAnalysisWithQCumulants::PrintNumberOfParticlesInSelectedBin()
11185 //================================================================================================================================
11187 void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
11189 // Evaluate reduced correlations with nested loops without using the particle weights.
11191 // Remark 1: Reduced correlations are evaluated in pt bin number fCrossCheckInPtBinNo and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
11192 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrelations[t][pe][ci], where indices runs as follows:
11193 // [0=RP,1=POI][0=Pt,1=Eta][0=<2'>,1=<4'>,2=<6'>,3=<8'>]
11194 // Remark 3: <2'> = <w2 cos(n*(psi1-phi2))>
11195 // <4'> = <w2 w3 w4 cos(n*(psi1+phi2-phi3-phi4))>
11198 Int_t typeFlag = -1;
11199 Int_t ptEtaFlag = -1;
11203 } else if(type == "POI")
11207 if(ptOrEta == "Pt")
11210 } else if(ptOrEta == "Eta")
11215 Int_t t = typeFlag;
11216 Int_t pe = ptEtaFlag;
11218 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
11219 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
11220 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
11222 Int_t nPrim = anEvent->NumberOfTracks();
11223 AliFlowTrackSimple *aftsTrack = NULL;
11225 Double_t psi1=0., phi2=0., phi3=0., phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
11226 Double_t wPhi2=1., wPhi3=1., wPhi4=1.;// wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
11228 Int_t n = fHarmonic;
11230 // 2'-particle correlations:
11231 for(Int_t i1=0;i1<nPrim;i1++)
11233 aftsTrack=anEvent->GetTrack(i1);
11234 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11235 if(typeFlag==1) // this is diff flow of POIs
11237 if(ptOrEta == "Pt")
11239 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11240 } else if (ptOrEta == "Eta")
11242 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11244 } else // this is diff flow of RPs
11246 if(ptOrEta == "Pt")
11248 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11249 } else if (ptOrEta == "Eta")
11251 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11254 psi1=aftsTrack->Phi();
11255 for(Int_t i2=0;i2<nPrim;i2++)
11257 if(i2==i1) continue;
11258 aftsTrack=anEvent->GetTrack(i2);
11259 // RP condition (!(first) particle in the correlator must be RP):
11260 if(!(aftsTrack->InRPSelection())) continue;
11261 phi2=aftsTrack->Phi();
11262 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
11263 // 2'-particle correlations:
11264 fDiffFlowDirectCorrelations[t][pe][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(1.*n*(psi1-phi2)),wPhi2); // <w2 cos(n*(psi1-phi2))
11265 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11266 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11268 // 4'-particle correlations:
11269 for(Int_t i1=0;i1<nPrim;i1++)
11271 aftsTrack=anEvent->GetTrack(i1);
11272 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11273 if(typeFlag==1) // this is diff flow of POIs
11275 if(ptOrEta == "Pt")
11277 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11278 } else if (ptOrEta == "Eta")
11280 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11282 } else // this is diff flow of RPs
11284 if(ptOrEta == "Pt")
11286 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11287 } else if (ptOrEta == "Eta")
11289 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11292 psi1=aftsTrack->Phi();
11293 for(Int_t i2=0;i2<nPrim;i2++)
11295 if(i2==i1) continue;
11296 aftsTrack=anEvent->GetTrack(i2);
11297 // RP condition (!(first) particle in the correlator must be RP):
11298 if(!(aftsTrack->InRPSelection())) continue;
11299 phi2=aftsTrack->Phi();
11300 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
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 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
11309 for(Int_t i4=0;i4<nPrim;i4++)
11311 if(i4==i1||i4==i2||i4==i3) continue;
11312 aftsTrack=anEvent->GetTrack(i4);
11313 // RP condition (!(first) particle in the correlator must be RP):
11314 if(!(aftsTrack->InRPSelection())) continue;
11315 phi4=aftsTrack->Phi();
11316 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
11317 // 4'-particle correlations <w2 w3 w4 cos(n(psi1+phi2-phi3-phi4))>:
11318 fDiffFlowDirectCorrelations[t][pe][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3-phi4)),wPhi2*wPhi3*wPhi4);
11319 }//end of for(Int_t i4=0;i4<nPrim;i4++)
11320 }//end of for(Int_t i3=0;i3<nPrim;i3++)
11321 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11322 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11324 // count # of RPs and POIs in selected pt and eta bins for cross-checkings: (to be improved - moved to dedicated method)
11325 for(Int_t i=0;i<nPrim;i++)
11327 aftsTrack=anEvent->GetTrack(i);
11328 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11329 if(typeFlag==1) // this is diff flow of POIs
11331 if(ptOrEta == "Pt")
11333 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11334 } else if (ptOrEta == "Eta")
11336 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11338 } else // this is diff flow of RPs
11340 if(ptOrEta == "Pt")
11342 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11343 } else if (ptOrEta == "Eta")
11345 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11349 fNoOfParticlesInBin->Fill(t+pe+0.5);
11352 } // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
11355 //================================================================================================================================
11358 void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
11360 // Evaluate with nested loops correction terms for non-uniform acceptance (both sin and cos terms) relevant for differential flow.
11362 // Remark 1: Reduced correction terms for non-uniform acceptance are evaluated in pt bin number fCrossCheckInPtBinNo
11363 // and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
11364 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrections[t][pe][sc][cti], where first three indices runs as:
11365 // [0=RP,1=POI][0=Pt,1=Eta][0=sin terms,1=cos terms], whilst the cti (correction term index) runs as follows:
11367 // 0: <<sc n(psi1)>>
11368 // 1: <<sc n(psi1+phi2)>>
11369 // 2: <<sc n(psi1+phi2-phi3)>>
11370 // 3: <<sc n(psi1-phi2-phi3)>>
11375 Int_t typeFlag = -1;
11376 Int_t ptEtaFlag = -1;
11380 } else if(type == "POI")
11384 if(ptOrEta == "Pt")
11387 } else if(ptOrEta == "Eta")
11392 Int_t t = typeFlag;
11393 Int_t pe = ptEtaFlag;
11395 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
11396 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
11397 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
11399 Int_t nPrim = anEvent->NumberOfTracks();
11400 AliFlowTrackSimple *aftsTrack = NULL;
11402 Double_t psi1=0., phi2=0., phi3=0.;// phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
11404 Int_t n = fHarmonic;
11406 // 1-particle correction terms:
11407 for(Int_t i1=0;i1<nPrim;i1++)
11409 aftsTrack=anEvent->GetTrack(i1);
11410 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11411 if(typeFlag==1) // this is diff flow of POIs
11413 if(ptOrEta == "Pt")
11415 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11416 } else if (ptOrEta == "Eta")
11418 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11420 } else // this is diff flow of RPs
11422 if(ptOrEta == "Pt")
11424 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11425 } else if (ptOrEta == "Eta")
11427 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11430 psi1=aftsTrack->Phi();
11432 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*psi1),1.); // <<sin(n*(psi1))>>
11434 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*psi1),1.); // <<cos(n*(psi1))>>
11435 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11437 // 2-particle correction terms:
11438 for(Int_t i1=0;i1<nPrim;i1++)
11440 aftsTrack=anEvent->GetTrack(i1);
11441 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11442 if(typeFlag==1) // this is diff flow of POIs
11444 if(ptOrEta == "Pt")
11446 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11447 } else if (ptOrEta == "Eta")
11449 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11451 } else // this is diff flow of RPs
11453 if(ptOrEta == "Pt")
11455 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11456 } else if (ptOrEta == "Eta")
11458 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11461 psi1=aftsTrack->Phi();
11462 for(Int_t i2=0;i2<nPrim;i2++)
11464 if(i2==i1) continue;
11465 aftsTrack=anEvent->GetTrack(i2);
11466 // RP condition (!(first) particle in the correlator must be RP):
11467 if(!(aftsTrack->InRPSelection())) continue;
11468 phi2=aftsTrack->Phi();
11470 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2)),1.); // <<sin(n*(psi1+phi2))>>
11472 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2)),1.); // <<cos(n*(psi1+phi2))>>
11473 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11474 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11476 // 3-particle correction terms:
11477 for(Int_t i1=0;i1<nPrim;i1++)
11479 aftsTrack=anEvent->GetTrack(i1);
11480 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
11481 if(typeFlag==1) // this is diff flow of POIs
11483 if(ptOrEta == "Pt")
11485 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11486 } else if (ptOrEta == "Eta")
11488 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
11490 } else // this is diff flow of RPs
11492 if(ptOrEta == "Pt")
11494 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11495 } else if (ptOrEta == "Eta")
11497 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
11500 psi1=aftsTrack->Phi();
11501 for(Int_t i2=0;i2<nPrim;i2++)
11503 if(i2==i1) continue;
11504 aftsTrack=anEvent->GetTrack(i2);
11505 // RP condition (!(first) particle in the correlator must be RP):
11506 if(!(aftsTrack->InRPSelection())) continue;
11507 phi2=aftsTrack->Phi();
11508 for(Int_t i3=0;i3<nPrim;i3++)
11510 if(i3==i1||i3==i2) continue;
11511 aftsTrack=anEvent->GetTrack(i3);
11512 // RP condition (!(first) particle in the correlator must be RP):
11513 if(!(aftsTrack->InRPSelection())) continue;
11514 phi3=aftsTrack->Phi();
11516 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][2]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2-phi3)),1.); // <<sin(n*(psi1+phi2-phi3))>>
11517 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][3]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1-phi2-phi3)),1.); // <<sin(n*(psi1-phi2-phi3))>>
11519 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][2]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3)),1.); // <<cos(n*(psi1+phi2-phi3))>>
11520 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][3]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1-phi2-phi3)),1.); // <<cos(n*(psi1-phi2-phi3))>>
11521 }//end of for(Int_t i3=0;i3<nPrim;i3++)
11522 }//end of for(Int_t i2=0;i2<nPrim;i2++)
11523 }//end of for(Int_t i1=0;i1<nPrim;i1++)
11525 } // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
11528 //================================================================================================================================
11531 void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrectionTermsForNUA(TString type, TString ptOrEta)
11533 // Compare corrections temrs for non-uniform acceptance needed for diff. flow calculated with nested loops and those calculated from Q-vectors
11535 Int_t typeFlag = -1;
11536 Int_t ptEtaFlag = -1;
11540 } else if(type == "POI")
11544 if(ptOrEta == "Pt")
11547 } else if(ptOrEta == "Eta")
11552 Int_t t = typeFlag;
11553 Int_t pe = ptEtaFlag;
11555 TString rpORpoiString[2] = {"RP ","POI"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
11556 TString ptORetaString[2] = {"pt","eta"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
11557 //TString sinCosFlag[2] = {"sin","cos"}; // to be improved (eventually promote to data member)
11558 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)
11559 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)
11560 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
11561 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
11563 Int_t crossCheckInPtEtaBinNo[2] = {fCrossCheckInPtBinNo,fCrossCheckInEtaBinNo};
11566 cout<<" ******************************************"<<endl;
11567 cout<<" **** cross-checking the correction ****"<<endl;
11568 cout<<" **** terms for non-uniform acceptance ****"<<endl;
11569 cout<<" **** for differential flow ("<<rpORpoiString[t]<<") ****"<<endl;
11570 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
11572 cout<<" **** (particle weights not used) ****"<<endl;
11575 cout<<" **** (particle weights used) ****"<<endl;
11577 cout<<" ******************************************"<<endl;
11579 cout<<" "<<ptORetaString[pe]<<" bin: "<<lowerPtEtaEdge[pe]<<" <= "<<ptORetaString[pe]<<" < "<<upperPtEtaEdge[pe]<<endl;
11582 for(Int_t cti=0;cti<4;cti++) // correction term index
11584 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
11586 if(sc==0) // to be improved (this can be implemented better)
11588 cout<<" "<<reducedCorrectionSinTerms[cti].Data()<<":"<<endl;
11591 cout<<" "<<reducedCorrectionCosTerms[cti].Data()<<":"<<endl;
11593 cout<<" from Q-vectors = "<<fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]->GetBinContent(crossCheckInPtEtaBinNo[pe])<<endl;
11594 cout<<" from nested loops = "<<fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti]->GetBinContent(1)<<endl;
11597 } // end of for(Int_t rci=0;rci<4;rci++)
11599 } // end of void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrectionTermsForNUA(TString type, TString ptOrEta)
11602 //================================================================================================================================
11605 void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights()
11607 // Calculate corrections using particle weights for non-uniform acceptance of the detector for no-name integrated flow (cos terms).
11609 // **********************************************************************
11610 // **** weighted corrections for non-uniform acceptance (cos terms): ****
11611 // **********************************************************************
11613 // Remark 1: When particle weights are used the binning of fIntFlowCorrectionTermsForNUAPro[1] is organized as follows:
11615 // 1st bin: <<w1 cos(n*(phi1))>> = cosP1nW1
11616 // 2nd bin: <<w1 w2 cos(n*(phi1+phi2))>> = cosP1nP1nW1W1
11617 // 3rd bin: <<w1 w2 w3 cos(n*(phi1-phi2-phi3))>> = cosP1nM1nM1nW1W1W1
11620 // multiplicity (number of particles used to determine the reaction plane)
11621 Double_t dMult = (*fSMpk)(0,0);
11623 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
11624 Double_t dReQ1n1k = (*fReQ)(0,1);
11625 Double_t dReQ2n2k = (*fReQ)(1,2);
11626 //Double_t dReQ3n3k = (*fReQ)(2,3);
11627 //Double_t dReQ4n4k = (*fReQ)(3,4);
11628 Double_t dReQ1n3k = (*fReQ)(0,3);
11629 Double_t dImQ1n1k = (*fImQ)(0,1);
11630 Double_t dImQ2n2k = (*fImQ)(1,2);
11631 //Double_t dImQ3n3k = (*fImQ)(2,3);
11632 //Double_t dImQ4n4k = (*fImQ)(3,4);
11633 //Double_t dImQ1n3k = (*fImQ)(0,3);
11635 // dMs are variables introduced in order to simplify some Eqs. bellow:
11636 //..............................................................................................
11637 Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
11638 Double_t dM111 = (*fSMpk)(2,1)-3.*(*fSMpk)(0,2)*(*fSMpk)(0,1)
11639 + 2.*(*fSMpk)(0,3); // dM111 = sum_{i,j,k=1,i!=j!=k}^M w_i w_j w_k
11640 //..............................................................................................
11642 Double_t cosP1nW1 = 0.; // <<w1 cos(n*(phi1))>>
11644 if(dMult>0 && TMath::Abs((*fSMpk)(0,1))>1e-6)
11646 cosP1nW1 = dReQ1n1k/(*fSMpk)(0,1);
11648 // average weighted 1-particle correction (cos terms) for non-uniform acceptance for single event:
11649 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(1,cosP1nW1);
11651 // final average weighted 1-particle correction (cos terms) for non-uniform acceptance for all events:
11652 fIntFlowCorrectionTermsForNUAPro[1]->Fill(0.5,cosP1nW1,(*fSMpk)(0,1));
11656 Double_t cosP1nP1nW1W1 = 0.; // <<w1 w2 cos(n*(phi1+phi2))>>
11658 if(dMult>1 && TMath::Abs(dM11)>1e-6)
11660 cosP1nP1nW1W1 = (pow(dReQ1n1k,2)-pow(dImQ1n1k,2)-dReQ2n2k)/dM11;
11662 // average weighted 2-particle correction (cos terms) for non-uniform acceptance for single event:
11663 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(2,cosP1nP1nW1W1);
11665 // final average weighted 2-particle correction (cos terms) for non-uniform acceptance for all events:
11666 fIntFlowCorrectionTermsForNUAPro[1]->Fill(1.5,cosP1nP1nW1W1,dM11);
11670 Double_t cosP1nM1nM1nW1W1W1 = 0.; // <<w1 w2 w3 cos(n*(phi1-phi2-phi3))>>
11672 if(dMult>2 && TMath::Abs(dM111)>1e-6)
11674 cosP1nM1nM1nW1W1W1 = (dReQ1n1k*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
11675 - dReQ1n1k*dReQ2n2k-dImQ1n1k*dImQ2n2k
11676 - 2.*((*fSMpk)(0,2))*dReQ1n1k
11680 // average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for single event:
11681 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(3,cosP1nM1nM1nW1W1W1);
11683 // final average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for all events:
11684 fIntFlowCorrectionTermsForNUAPro[1]->Fill(2.5,cosP1nM1nM1nW1W1W1,dM111);
11687 } // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights()
11690 //================================================================================================================================
11693 void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights()
11695 // calculate corrections using particle weights for non-uniform acceptance of the detector for no-name integrated flow (sin terms)
11697 // **********************************************************************
11698 // **** weighted corrections for non-uniform acceptance (sin terms): ****
11699 // **********************************************************************
11701 // Remark 1: When particle weights are used the binning of fIntFlowCorrectionTermsForNUAPro[0] is organized as follows:
11703 // 1st bin: <<w1 sin(n*(phi1))>> = sinP1nW1
11704 // 2nd bin: <<w1 w2 sin(n*(phi1+phi2))>> = sinP1nP1nW1W1
11705 // 3rd bin: <<w1 w2 w3 sin(n*(phi1-phi2-phi3))>> = sinP1nM1nM1nW1W1W1
11708 // multiplicity (number of particles used to determine the reaction plane)
11709 Double_t dMult = (*fSMpk)(0,0);
11711 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
11712 Double_t dReQ1n1k = (*fReQ)(0,1);
11713 Double_t dReQ2n2k = (*fReQ)(1,2);
11714 //Double_t dReQ3n3k = (*fReQ)(2,3);
11715 //Double_t dReQ4n4k = (*fReQ)(3,4);
11716 //Double_t dReQ1n3k = (*fReQ)(0,3);
11717 Double_t dImQ1n1k = (*fImQ)(0,1);
11718 Double_t dImQ2n2k = (*fImQ)(1,2);
11719 //Double_t dImQ3n3k = (*fImQ)(2,3);
11720 //Double_t dImQ4n4k = (*fImQ)(3,4);
11721 Double_t dImQ1n3k = (*fImQ)(0,3);
11723 // dMs are variables introduced in order to simplify some Eqs. bellow:
11724 //..............................................................................................
11725 Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
11726 Double_t dM111 = (*fSMpk)(2,1)-3.*(*fSMpk)(0,2)*(*fSMpk)(0,1)
11727 + 2.*(*fSMpk)(0,3); // dM111 = sum_{i,j,k=1,i!=j!=k}^M w_i w_j w_k
11728 //..............................................................................................
11731 Double_t sinP1nW1 = 0.; // <<w1 sin(n*(phi1))>>
11733 if(dMult>0 && TMath::Abs((*fSMpk)(0,1))>1e-6)
11735 sinP1nW1 = dImQ1n1k/((*fSMpk)(0,1));
11737 // average weighted 1-particle correction (sin terms) for non-uniform acceptance for single event:
11738 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(1,sinP1nW1);
11740 // final average weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
11741 fIntFlowCorrectionTermsForNUAPro[0]->Fill(0.5,sinP1nW1,(*fSMpk)(0,1));
11745 Double_t sinP1nP1nW1W1 = 0.; // <<w1 w2 sin(n*(phi1+phi2))>>
11747 if(dMult>1 && TMath::Abs(dM11)>1e-6)
11749 sinP1nP1nW1W1 = (2.*dReQ1n1k*dImQ1n1k-dImQ2n2k)/dM11;
11751 // average weighted 2-particle correction (sin terms) for non-uniform acceptance for single event:
11752 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(2,sinP1nP1nW1W1);
11754 // final average weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
11755 fIntFlowCorrectionTermsForNUAPro[0]->Fill(1.5,sinP1nP1nW1W1,dM11);
11759 Double_t sinP1nM1nM1nW1W1W1 = 0.; // <<w1 w2 w3 sin(n*(phi1-phi2-phi3))>>
11761 if(dMult>2 && TMath::Abs(dM111)>1e-6)
11763 sinP1nM1nM1nW1W1W1 = (-dImQ1n1k*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
11764 + dReQ1n1k*dImQ2n2k-dImQ1n1k*dReQ2n2k
11765 + 2.*((*fSMpk)(0,2))*dImQ1n1k
11769 // average weighted 3-particle correction (sin terms) for non-uniform acceptance for single event:
11770 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(3,sinP1nM1nM1nW1W1W1);
11772 // final average weighted 3-particle correction (sin terms) for non-uniform acceptance for all events:
11773 fIntFlowCorrectionTermsForNUAPro[0]->Fill(2.5,sinP1nM1nM1nW1W1W1,dM111);
11776 } // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights()
11779 //================================================================================================================================
11782 void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent)
11784 // Evaluate with nested loops correction terms for non-uniform acceptance for integrated flow (using the particle weights).
11786 // Results are stored in profiles fIntFlowDirectCorrectionTermsForNUA[0] (sin terms) and
11787 // fIntFlowDirectCorrectionTermsForNUA[1] (cos terms).
11789 // Remark 1: When particle weights are used the binning of fIntFlowDirectCorrectionTermsForNUA[sc] is
11790 // organized as follows (sc stands for either sin or cos):
11792 // 1st bin: <<w1 sc(n*(phi1))>> = scP1nW1
11793 // 2nd bin: <<w1 w2 sc(n*(phi1+phi2))>> = scP1nP1nW1W1
11794 // 3rd bin: <<w1 w2 w3 sc(n*(phi1-phi2-phi3))>> = scP1nM1nM1nW1W1W1
11797 Int_t nPrim = anEvent->NumberOfTracks();
11798 AliFlowTrackSimple *aftsTrack = NULL;
11799 //Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
11800 //Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1., wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
11801 Double_t phi1=0., phi2=0., phi3=0.;
11802 Double_t wPhi1=1., wPhi2=1., wPhi3=1.;
11803 Int_t n = fHarmonic;
11804 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
11805 Double_t dMult = (*fSMpk)(0,0);
11807 cout<<"Correction terms for non-uniform acceptance: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
11810 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
11811 } else if (dMult>fMaxAllowedMultiplicity)
11813 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
11816 cout<<"... evaluating nested loops (using particle weights) ..."<<endl;
11819 // 1-particle correction terms using particle weights:
11820 if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)
11822 for(Int_t i1=0;i1<nPrim;i1++)
11824 aftsTrack=anEvent->GetTrack(i1);
11825 if(!(aftsTrack->InRPSelection())) continue;
11826 phi1=aftsTrack->Phi();
11827 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
11828 // 1-particle correction terms using particle weights:
11829 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(0.5,sin(n*phi1),wPhi1); // <w1 sin(n*phi1)>
11830 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(0.5,cos(n*phi1),wPhi1); // <w1 cos(n*phi1)>
11831 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11832 } // end of if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)
11834 // 2-particle correction terms using particle weights:
11835 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
11837 for(Int_t i1=0;i1<nPrim;i1++)
11839 aftsTrack=anEvent->GetTrack(i1);
11840 if(!(aftsTrack->InRPSelection())) continue;
11841 phi1=aftsTrack->Phi();
11842 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
11843 for(Int_t i2=0;i2<nPrim;i2++)
11845 if(i2==i1)continue;
11846 aftsTrack=anEvent->GetTrack(i2);
11847 if(!(aftsTrack->InRPSelection())) continue;
11848 phi2=aftsTrack->Phi();
11849 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
11850 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
11851 // 2-p correction terms using particle weights:
11852 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(1.5,sin(n*(phi1+phi2)),wPhi1*wPhi2); // <w1 w2 sin(n*(phi1+phi2))>
11853 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(1.5,cos(n*(phi1+phi2)),wPhi1*wPhi2); // <w1 w2 cos(n*(phi1+phi2))>
11854 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11855 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11856 } // end of if(nPrim>=2)
11858 // 3-particle correction terms using particle weights:
11859 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
11861 for(Int_t i1=0;i1<nPrim;i1++)
11863 aftsTrack=anEvent->GetTrack(i1);
11864 if(!(aftsTrack->InRPSelection())) continue;
11865 phi1=aftsTrack->Phi();
11866 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
11867 for(Int_t i2=0;i2<nPrim;i2++)
11869 if(i2==i1)continue;
11870 aftsTrack=anEvent->GetTrack(i2);
11871 if(!(aftsTrack->InRPSelection())) continue;
11872 phi2=aftsTrack->Phi();
11873 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
11874 for(Int_t i3=0;i3<nPrim;i3++)
11876 if(i3==i1||i3==i2)continue;
11877 aftsTrack=anEvent->GetTrack(i3);
11878 if(!(aftsTrack->InRPSelection())) continue;
11879 phi3=aftsTrack->Phi();
11880 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
11881 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;
11882 // 3-p correction terms using particle weights:
11883 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(2.5,sin(n*(phi1-phi2-phi3)),wPhi1*wPhi2*wPhi3); // <w1 w2 w3 sin(n*(phi1-phi2-phi3))>
11884 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(2.5,cos(n*(phi1-phi2-phi3)),wPhi1*wPhi2*wPhi3); // <w1 w2 w3 cos(n*(phi1-phi2-phi3))>
11885 } // end of for(Int_t i3=0;i3<nPrim;i3++)
11886 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11887 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11888 } // end of if(nPrim>=3)
11892 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)
11894 // 4 nested loops multiparticle correlations using particle weights:
11895 for(Int_t i1=0;i1<nPrim;i1++)
11897 aftsTrack=anEvent->GetTrack(i1);
11898 if(!(aftsTrack->InRPSelection())) continue;
11899 phi1=aftsTrack->Phi();
11900 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
11901 for(Int_t i2=0;i2<nPrim;i2++)
11903 if(i2==i1)continue;
11904 aftsTrack=anEvent->GetTrack(i2);
11905 if(!(aftsTrack->InRPSelection())) continue;
11906 phi2=aftsTrack->Phi();
11907 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
11908 for(Int_t i3=0;i3<nPrim;i3++)
11910 if(i3==i1||i3==i2)continue;
11911 aftsTrack=anEvent->GetTrack(i3);
11912 if(!(aftsTrack->InRPSelection())) continue;
11913 phi3=aftsTrack->Phi();
11914 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
11915 for(Int_t i4=0;i4<nPrim;i4++)
11917 if(i4==i1||i4==i2||i4==i3)continue;
11918 aftsTrack=anEvent->GetTrack(i4);
11919 if(!(aftsTrack->InRPSelection())) continue;
11920 phi4=aftsTrack->Phi();
11921 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
11922 if(nPrim>=4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush; // to be improved (replace eventually this if statement with if(nPrim==4))
11923 // 4-p correlations using particle weights:
11924 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(10.5,cos(n*phi1+n*phi2-n*phi3-n*phi4),wPhi1*wPhi2*wPhi3*wPhi4);
11925 // extra correlations:
11926 // 2-p extra correlations (do not appear if particle weights are not used):
11928 // 3-p extra correlations (do not appear if particle weights are not used):
11930 // 4-p extra correlations (do not appear if particle weights are not used):
11932 } // end of for(Int_t i4=0;i4<nPrim;i4++)
11933 } // end of for(Int_t i3=0;i3<nPrim;i3++)
11934 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11935 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11936 } // end of if(nPrim>=4)
11942 } // end of void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent)
11945 //================================================================================================================================
11948 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights(TString type, TString ptOrEta)
11950 // Calculate correction terms for non-uniform acceptance for differential flow (cos terms) using particle weights.
11952 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][1][cti], where cti runs as follows:
11954 // 0: <<cos n(psi)>>
11955 // 1: <<w2 cos n(psi1+phi2)>>
11956 // 2: <<w2 w3 cos n(psi1+phi2-phi3)>>
11957 // 3: <<w2 w3 cos n(psi1-phi2-phi3)>>
11962 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
11963 Double_t dReQ1n1k = (*fReQ)(0,1);
11964 Double_t dReQ2n2k = (*fReQ)(1,2);
11965 //Double_t dReQ1n3k = (*fReQ)(0,3);
11966 //Double_t dReQ4n4k = (*fReQ)(3,4);
11967 Double_t dImQ1n1k = (*fImQ)(0,1);
11968 Double_t dImQ2n2k = (*fImQ)(1,2);
11969 //Double_t dImQ1n3k = (*fImQ)(0,3);
11970 //Double_t dImQ4n4k = (*fImQ)(3,4);
11972 // S^M_{p,k} (see .h file for the definition of fSMpk):
11973 Double_t dSM1p1k = (*fSMpk)(0,1);
11974 Double_t dSM1p2k = (*fSMpk)(0,2);
11975 Double_t dSM2p1k = (*fSMpk)(1,1);
11977 Int_t t = -1; // type flag
11978 Int_t pe = -1; // ptEta flag
11983 } else if(type == "POI")
11988 if(ptOrEta == "Pt")
11991 } else if(ptOrEta == "Eta")
11996 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
11997 Double_t minPtEta[2] = {fPtMin,fEtaMin};
11998 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
11999 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
12001 // looping over all bins and calculating correction terms:
12002 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
12004 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
12005 Double_t p1n0kRe = 0.;
12006 Double_t p1n0kIm = 0.;
12008 // number of POIs in particular pt or eta bin:
12011 // 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):
12012 Double_t q1n2kRe = 0.;
12013 Double_t q1n2kIm = 0.;
12014 Double_t q2n1kRe = 0.;
12015 Double_t q2n1kIm = 0.;
12017 // s_{1,1}, s_{1,2} // to be improved (add explanation)
12018 Double_t s1p1k = 0.;
12019 Double_t s1p2k = 0.;
12021 // number of particles which are both RPs and POIs in particular pt or eta bin:
12024 // M0111 from Eq. (118) in QC2c (to be improved (notation))
12025 Double_t dM01 = 0.;
12026 Double_t dM011 = 0.;
12031 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))
12032 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));
12033 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))
12034 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b));
12035 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))
12036 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));
12037 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))
12038 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b));
12039 mq = fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
12041 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.);
12042 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.);
12043 }else if(type == "RP")
12045 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
12046 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))
12047 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));
12048 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))
12049 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));
12050 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))
12051 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));
12052 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))
12053 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));
12054 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
12055 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.);
12056 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.);
12057 //s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.);
12059 mq = fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
12065 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
12066 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
12067 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
12068 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
12069 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
12070 // M01 from Eq. (118) in QC2c (to be improved (notation)):
12071 dM01 = mp*dSM1p1k-s1p1k;
12072 dM011 = mp*(dSM2p1k-dSM1p2k)
12073 - 2.*(s1p1k*dSM1p1k-s1p2k);
12075 // typeFlag = RP (0) or POI (1):
12077 } else if(type == "RP")
12079 // to be improved (cross-checked):
12080 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
12081 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
12082 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
12083 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
12084 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
12085 // M01 from Eq. (118) in QC2c (to be improved (notation)):
12086 dM01 = mp*dSM1p1k-s1p1k;
12087 dM011 = mp*(dSM2p1k-dSM1p2k)
12088 - 2.*(s1p1k*dSM1p1k-s1p2k);
12089 // typeFlag = RP (0) or POI (1):
12093 // <<cos n(psi1)>>:
12094 Double_t cosP1nPsi = 0.;
12097 cosP1nPsi = p1n0kRe/mp;
12099 // fill profile for <<cos n(psi1)>>:
12100 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi,mp);
12101 // histogram to store <cos n(psi1)> e-b-e (needed in some other methods):
12102 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][0]->SetBinContent(b,cosP1nPsi);
12105 // <<w2 cos n(psi1+phi2)>>:
12106 Double_t cosP1nPsiP1nPhiW2 = 0.;
12109 cosP1nPsiP1nPhiW2 = (p1n0kRe*dReQ1n1k-p1n0kIm*dImQ1n1k-q2n1kRe)/(dM01);
12110 // fill profile for <<w2 cos n(psi1+phi2)>>:
12111 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsiP1nPhiW2,dM01);
12112 // histogram to store <w2 cos n(psi1+phi2)> e-b-e (needed in some other methods):
12113 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][1]->SetBinContent(b,cosP1nPsiP1nPhiW2);
12114 } // end of if(dM01)
12116 // <<w2 w3 cos n(psi1+phi2-phi3)>>:
12117 Double_t cosP1nPsi1P1nPhi2MPhi3W2W3 = 0.;
12120 cosP1nPsi1P1nPhi2MPhi3W2W3 = (p1n0kRe*(pow(dImQ1n1k,2.)+pow(dReQ1n1k,2.))
12122 - q2n1kRe*dReQ1n1k-q2n1kIm*dImQ1n1k
12126 // fill profile for <<w1 w2 w3 cos n(psi1+phi2)>>:
12127 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1P1nPhi2MPhi3W2W3,dM011);
12128 // histogram to store <w1 w2 w3 cos n(psi1+phi2)> e-b-e (needed in some other methods):
12129 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][2]->SetBinContent(b,cosP1nPsi1P1nPhi2MPhi3W2W3);
12130 } // end of if(dM011)
12132 // <<w2 w3 cos n(psi1-phi2-phi3)>>:
12133 Double_t cosP1nPsi1M1nPhi2MPhi3W2W3 = 0.;
12136 cosP1nPsi1M1nPhi2MPhi3W2W3 = (p1n0kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))+2.*p1n0kIm*dReQ1n1k*dImQ1n1k
12137 - 1.*(p1n0kRe*dReQ2n2k+p1n0kIm*dImQ2n2k)
12138 - 2.*s1p1k*dReQ1n1k
12141 // fill profile for <<w1 w2 w3 cos n(psi1+phi2)>>:
12142 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1M1nPhi2MPhi3W2W3,dM011);
12143 // histogram to store <w1 w2 w3 cos n(psi1+phi2)> e-b-e (needed in some other methods):
12144 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][3]->SetBinContent(b,cosP1nPsi1M1nPhi2MPhi3W2W3);
12145 } // end of if(dM011)
12147 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
12149 } // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights(TString type, TString ptOrEta)
12152 //================================================================================================================================
12155 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights(TString type, TString ptOrEta)
12157 // Calculate correction terms for non-uniform acceptance for differential flow (sin terms).
12159 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][0][cti], where cti runs as follows:
12160 // 0: <<sin n(psi1)>>
12161 // 1: <<w2 sin n(psi1+phi2)>>
12162 // 2: <<w2 w3 sin n(psi1+phi2-phi3)>>
12163 // 3: <<w2 w3 sin n(psi1-phi2-phi3)>>:
12168 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
12169 Double_t dReQ1n1k = (*fReQ)(0,1);
12170 Double_t dReQ2n2k = (*fReQ)(1,2);
12171 //Double_t dReQ1n3k = (*fReQ)(0,3);
12172 //Double_t dReQ4n4k = (*fReQ)(3,4);
12173 Double_t dImQ1n1k = (*fImQ)(0,1);
12174 Double_t dImQ2n2k = (*fImQ)(1,2);
12175 //Double_t dImQ1n3k = (*fImQ)(0,3);
12176 //Double_t dImQ4n4k = (*fImQ)(3,4);
12178 // S^M_{p,k} (see .h file for the definition of fSMpk):
12179 Double_t dSM1p1k = (*fSMpk)(0,1);
12180 Double_t dSM1p2k = (*fSMpk)(0,2);
12181 Double_t dSM2p1k = (*fSMpk)(1,1);
12183 Int_t t = -1; // type flag
12184 Int_t pe = -1; // ptEta flag
12189 } else if(type == "POI")
12194 if(ptOrEta == "Pt")
12197 } else if(ptOrEta == "Eta")
12202 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
12203 Double_t minPtEta[2] = {fPtMin,fEtaMin};
12204 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
12205 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
12207 // looping over all bins and calculating correction terms:
12208 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
12210 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
12211 Double_t p1n0kRe = 0.;
12212 Double_t p1n0kIm = 0.;
12214 // number of POIs in particular pt or eta bin:
12217 // 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):
12218 Double_t q1n2kRe = 0.;
12219 Double_t q1n2kIm = 0.;
12220 Double_t q2n1kRe = 0.;
12221 Double_t q2n1kIm = 0.;
12223 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
12224 Double_t s1p1k = 0.;
12225 Double_t s1p2k = 0.;
12227 // number of particles which are both RPs and POIs in particular pt or eta bin:
12230 // M0111 from Eq. (118) in QC2c (to be improved (notation))
12231 Double_t dM01 = 0.;
12232 Double_t dM011 = 0.;
12237 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))
12238 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));
12239 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))
12240 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b));
12241 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))
12242 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));
12243 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))
12244 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b));
12245 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
12247 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.);
12248 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.);
12249 }else if(type == "RP")
12251 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
12252 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))
12253 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));
12254 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))
12255 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));
12256 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))
12257 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));
12258 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))
12259 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));
12260 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
12261 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.);
12262 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.);
12263 //s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.);
12269 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
12270 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
12271 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
12272 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
12273 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
12274 // M01 from Eq. (118) in QC2c (to be improved (notation)):
12275 dM01 = mp*dSM1p1k-s1p1k;
12276 dM011 = mp*(dSM2p1k-dSM1p2k)
12277 - 2.*(s1p1k*dSM1p1k-s1p2k);
12278 // typeFlag = RP (0) or POI (1):
12280 } else if(type == "RP")
12282 // to be improved (cross-checked):
12283 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
12284 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
12285 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
12286 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
12287 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
12288 // M01 from Eq. (118) in QC2c (to be improved (notation)):
12289 dM01 = mp*dSM1p1k-s1p1k;
12290 dM011 = mp*(dSM2p1k-dSM1p2k)
12291 - 2.*(s1p1k*dSM1p1k-s1p2k);
12292 // typeFlag = RP (0) or POI (1):
12296 // <<sin n(psi1)>>:
12297 Double_t sinP1nPsi = 0.;
12300 sinP1nPsi = p1n0kIm/mp;
12302 // fill profile for <<sin n(psi1)>>:
12303 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi,mp);
12304 // histogram to store <sin n(psi1)> e-b-e (needed in some other methods):
12305 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][0]->SetBinContent(b,sinP1nPsi);
12308 // <<w2 sin n(psi1+phi2)>>:
12309 Double_t sinP1nPsiP1nPhiW2 = 0.;
12312 sinP1nPsiP1nPhiW2 = (p1n0kRe*dImQ1n1k+p1n0kIm*dReQ1n1k-q2n1kIm)/(dM01);
12313 // fill profile for <<w2 sin n(psi1+phi2)>>:
12314 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsiP1nPhiW2,dM01);
12315 // histogram to store <w2 sin n(psi1+phi2)> e-b-e (needed in some other methods):
12316 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][1]->SetBinContent(b,sinP1nPsiP1nPhiW2);
12317 } // end of if(mp*dMult-mq)
12319 // <<w2 w3 sin n(psi1+phi2-phi3)>>:
12320 Double_t sinP1nPsi1P1nPhi2MPhi3W2W3 = 0.;
12323 sinP1nPsi1P1nPhi2MPhi3W2W3 = (p1n0kIm*(pow(dImQ1n1k,2.)+pow(dReQ1n1k,2.))
12325 + q2n1kRe*dImQ1n1k-q2n1kIm*dReQ1n1k
12329 // fill profile for <<w2 w3 sin n(psi1+phi2-phi3)>>:
12330 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1P1nPhi2MPhi3W2W3,dM011);
12331 // histogram to store <w2 w3 sin n(psi1+phi2-phi3)> e-b-e (needed in some other methods):
12332 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][2]->SetBinContent(b,sinP1nPsi1P1nPhi2MPhi3W2W3);
12333 } // end of if(dM011)
12335 // <<w2 w3 sin n(psi1-phi2-phi3)>>:
12336 Double_t sinP1nPsi1M1nPhi2MPhi3W2W3 = 0.;
12339 sinP1nPsi1M1nPhi2MPhi3W2W3 = (p1n0kIm*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))-2.*p1n0kRe*dReQ1n1k*dImQ1n1k
12340 + 1.*(p1n0kRe*dImQ2n2k-p1n0kIm*dReQ2n2k)
12341 + 2.*s1p1k*dImQ1n1k
12344 // fill profile for <<w2 w3 sin n(psi1-phi2-phi3)>>:
12345 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1M1nPhi2MPhi3W2W3,dM011);
12346 // histogram to store <w2 w3 sin n(psi1-phi2-phi3)> e-b-e (needed in some other methods):
12347 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][3]->SetBinContent(b,sinP1nPsi1M1nPhi2MPhi3W2W3);
12348 } // end of if(dM011)
12350 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
12352 } // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights(TString type, TString ptOrEta)
12355 //================================================================================================================================
12358 void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
12360 // Evaluate with nested loops correction terms for non-uniform acceptance
12361 // with using particle weights (both sin and cos terms) relevant for differential flow.
12363 // Remark 1: "w1" in expressions bellow is a particle weight used only for particles which were
12364 // flagged both as POI and RP.
12365 // Remark 2: Reduced correction terms for non-uniform acceptance are evaluated in pt bin number fCrossCheckInPtBinNo
12366 // and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
12367 // Remark 3: Results are stored in 1 bin profiles fDiffFlowDirectCorrections[t][pe][sc][cti], where first three indices runs as:
12368 // [0=RP,1=POI][0=Pt,1=Eta][0=sin terms,1=cos terms], whilst the cti (correction term index) runs as follows:
12370 // 0: <<sc n(psi1)>>
12371 // 1: <<w2 sc n(psi1+phi2)>>
12372 // 2: <<w2 w3 sc n(psi1+phi2-phi3)>>
12373 // 3: <<w2 w3 sc n(psi1-phi2-phi3)>>
12378 Int_t typeFlag = -1;
12379 Int_t ptEtaFlag = -1;
12383 } else if(type == "POI")
12387 if(ptOrEta == "Pt")
12390 } else if(ptOrEta == "Eta")
12395 Int_t t = typeFlag;
12396 Int_t pe = ptEtaFlag;
12398 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
12399 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
12400 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
12402 Int_t nPrim = anEvent->NumberOfTracks();
12403 AliFlowTrackSimple *aftsTrack = NULL;
12405 Double_t psi1=0., phi2=0., phi3=0.;// phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
12406 Double_t wPhi2=1., wPhi3=1.;
12408 Int_t n = fHarmonic;
12410 // 1'-particle correction terms:
12411 for(Int_t i1=0;i1<nPrim;i1++)
12413 aftsTrack=anEvent->GetTrack(i1);
12414 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12415 if(typeFlag==1) // this is diff flow of POIs
12417 if(ptOrEta == "Pt")
12419 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12420 } else if (ptOrEta == "Eta")
12422 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12424 } else // this is diff flow of RPs
12426 if(ptOrEta == "Pt")
12428 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12429 } else if (ptOrEta == "Eta")
12431 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12434 psi1=aftsTrack->Phi();
12436 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*psi1),1.); // <<sin(n*(psi1))>>
12438 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*psi1),1.); // <<cos(n*(psi1))>>
12439 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12441 // 2'-particle correction terms:
12442 for(Int_t i1=0;i1<nPrim;i1++)
12444 aftsTrack=anEvent->GetTrack(i1);
12445 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12446 if(typeFlag==1) // this is diff flow of POIs
12448 if(ptOrEta == "Pt")
12450 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12451 } else if (ptOrEta == "Eta")
12453 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12455 } else // this is diff flow of RPs
12457 if(ptOrEta == "Pt")
12459 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12460 } else if (ptOrEta == "Eta")
12462 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12465 psi1=aftsTrack->Phi();
12466 for(Int_t i2=0;i2<nPrim;i2++)
12468 if(i2==i1) continue;
12469 aftsTrack=anEvent->GetTrack(i2);
12470 // RP condition (!(first) particle in the correlator must be RP):
12471 if(!(aftsTrack->InRPSelection())) continue;
12472 phi2=aftsTrack->Phi();
12473 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
12475 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2)),wPhi2); // <<w2 sin(n*(psi1+phi2))>>
12477 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2)),wPhi2); // <<w2 cos(n*(psi1+phi2))>>
12478 }//end of for(Int_t i2=0;i2<nPrim;i2++)
12479 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12481 // 3'-particle correction terms:
12482 for(Int_t i1=0;i1<nPrim;i1++)
12484 aftsTrack=anEvent->GetTrack(i1);
12485 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12486 if(typeFlag==1) // this is diff flow of POIs
12488 if(ptOrEta == "Pt")
12490 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12491 } else if (ptOrEta == "Eta")
12493 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12495 } else // this is diff flow of RPs
12497 if(ptOrEta == "Pt")
12499 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12500 } else if (ptOrEta == "Eta")
12502 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12505 psi1=aftsTrack->Phi();
12506 for(Int_t i2=0;i2<nPrim;i2++)
12508 if(i2==i1) continue;
12509 aftsTrack=anEvent->GetTrack(i2);
12510 // RP condition (!(first) particle in the correlator must be RP):
12511 if(!(aftsTrack->InRPSelection())) continue;
12512 phi2=aftsTrack->Phi();
12513 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
12514 for(Int_t i3=0;i3<nPrim;i3++)
12516 if(i3==i1||i3==i2) continue;
12517 aftsTrack=anEvent->GetTrack(i3);
12518 // RP condition (!(first) particle in the correlator must be RP):
12519 if(!(aftsTrack->InRPSelection())) continue;
12520 phi3=aftsTrack->Phi();
12521 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
12523 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))>>
12524 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))>>
12526 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))>>
12527 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))>>
12528 }//end of for(Int_t i3=0;i3<nPrim;i3++)
12529 }//end of for(Int_t i2=0;i2<nPrim;i2++)
12530 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12532 } // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
12534 //================================================================================================================================
12536 void AliFlowAnalysisWithQCumulants::CalculateDetectorEffectsForTrueCorrelations()
12538 // Quantify detector effects for true correlations.
12540 // to be improved: add protection for the pointers used in this method
12542 Double_t measured[4] = {0.}; // measured true correlation (a.k.a. cumulant)
12543 Double_t corrected[4] = {0.}; // true correlation corrected for detector effects (a.k.a. generalized cumulant)
12545 // measured correlations:
12546 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
12547 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
12548 Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
12549 Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
12550 // measured true correlations (a.k.a. cumulants):
12551 if(two) measured[0] = two;
12552 if(four) measured[1] = four-2.*pow(two,2.);
12553 if(six) measured[2] = six-9.*two*four+12.*pow(two,3.);
12554 if(eight) measured[3] = eight-16.*two*six-18.*pow(four,2.)+144.*pow(two,2.)*four-144.*pow(two,4.);
12556 for(Int_t ci=0;ci<=1;ci++) // correlation index // to be improved (enabled also for QC{6} and QC{8} eventually)
12558 corrected[ci] = fIntFlowQcumulants->GetBinContent(ci+1);
12559 if(TMath::Abs(measured[ci])>1.e-44)
12561 fIntFlowDetectorBias->SetBinContent(ci+1,corrected[ci]/measured[ci]);
12563 } // end of for(Int_t ci=1;ci<=4;ci++) // correlation index
12565 // Versus multiplicity:
12566 if(!fCalculateCumulantsVsM){return;}
12567 if(!fApplyCorrectionForNUAVsM){return;}
12568 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
12569 for(Int_t b=1;b<=nBins;b++)
12571 // measured correlations vs M:
12572 two = fIntFlowCorrelationsVsMHist[0]->GetBinContent(b); // <<2>>
12573 four = fIntFlowCorrelationsVsMHist[1]->GetBinContent(b); // <<4>>
12574 six = fIntFlowCorrelationsVsMHist[2]->GetBinContent(b); // <<6>>
12575 eight = fIntFlowCorrelationsVsMHist[3]->GetBinContent(b); // <<8>>
12576 // measured true correlations (a.k.a. cumulants) vs M:
12577 measured[0] = 0.; // QC{2} vs M
12578 measured[1] = 0.; // QC{4} vs M
12579 measured[2] = 0.; // QC{6} vs M
12580 measured[3] = 0.; // QC{8} vs M
12581 if(two) measured[0] = two;
12582 if(four) measured[1] = four-2.*pow(two,2.);
12583 if(six) measured[2] = six-9.*two*four+12.*pow(two,3.);
12584 if(eight) measured[3] = eight-16.*two*six-18.*pow(four,2.)+144.*pow(two,2.)*four-144.*pow(two,4.);
12585 corrected[0] = 0.; // generalized QC{2} vs M
12586 corrected[1] = 0.; // generalized QC{4} vs M
12587 corrected[2] = 0.; // generalized QC{6} vs M
12588 corrected[3] = 0.; // generalized QC{8} vs M
12589 for(Int_t ci=0;ci<=1;ci++) // correlation index // to be improved (enabled also for QC{6} and QC{8} eventually)
12591 corrected[ci] = fIntFlowQcumulantsVsM[ci]->GetBinContent(b);
12592 if(TMath::Abs(measured[ci])>1.e-44)
12594 fIntFlowDetectorBiasVsM[ci]->SetBinContent(b,corrected[ci]/measured[ci]);
12596 } // end of for(Int_t ci=1;ci<=4;ci++) // correlation index
12597 } // end of for(Int_t b=1;b<=nBins;b++)
12599 } // end of AliFlowAnalysisWithQCumulants::CalculateDetectorEffectsForTrueCorrelations()
12601 //================================================================================================================================
12603 void AliFlowAnalysisWithQCumulants::CheckPointersUsedInFinish()
12605 // Check all pointers used in method Finish().
12607 if(!fIntFlowCorrelationsPro)
12610 cout<<" WARNING (QC): fIntFlowCorrelationsPro is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12614 if(!fIntFlowCorrelationsHist)
12617 cout<<" WARNING (QC): fIntFlowCorrelationsHist is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12621 for(Int_t power=0;power<2;power++)
12623 if(!fIntFlowSumOfEventWeights[power])
12626 cout<<Form(" WARNING (QC): fIntFlowSumOfEventWeights[%d] is NULL in CheckPointersUsedInFinish() !!!!",power)<<endl;
12630 } // end of for(Int_t power=0;power<2;power++)
12631 if(!fIntFlowProductOfCorrelationsPro)
12634 cout<<" WARNING (QC): fIntFlowProductOfCorrelationsPro is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12638 if(!fIntFlowSumOfProductOfEventWeights)
12641 cout<<" WARNING (QC): fIntFlowSumOfProductOfEventWeights is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12645 if(!fIntFlowCovariances)
12648 cout<<" WARNING (QC): fIntFlowCovariances is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12652 if(!fIntFlowQcumulants)
12655 cout<<" WARNING (QC): fIntFlowQcumulants is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12662 cout<<" WARNING (QC): fIntFlow is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12669 cout<<" WARNING (QC): fCommonHists is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12673 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
12676 cout<<" WARNING (QC): fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th"<<endl;
12677 cout<<" && fCommonHistsResults8th is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12682 // Versus multiplicity:
12683 if(!fCalculateCumulantsVsM){return;}
12684 for(Int_t ci=0;ci<=3;ci++) // correlation index
12686 if(!fIntFlowCorrelationsVsMPro[ci])
12689 cout<<Form(" WARNING (QC): fIntFlowCorrelationsVsMPro[%d] is NULL in CheckPointersUsedInFinish() !!!!",ci)<<endl;
12693 if(!fIntFlowCorrelationsVsMHist[ci])
12696 cout<<Form(" WARNING (QC): fIntFlowCorrelationsVsMHist[%d] is NULL in CheckPointersUsedInFinish() !!!!",ci)<<endl;
12700 for(Int_t power=0;power<2;power++)
12702 if(!fIntFlowSumOfEventWeightsVsM[ci][power])
12705 cout<<Form(" WARNING (QC): fIntFlowSumOfEventWeightsVsM[%d][%d] is NULL in CheckPointersUsedInFinish() !!!!",ci,power)<<endl;
12709 } // end of for(Int_t power=0;power<2;power++)
12710 } // end of for(Int_t ci=0;ci<=3;ci++) // correlation index
12711 for(Int_t i=0;i<6;i++)
12713 if(!fIntFlowProductOfCorrelationsVsMPro[i])
12716 cout<<Form(" WARNING (QC): fIntFlowProductOfCorrelationsVsMPro[%d] is NULL in CheckPointersUsedInFinish() !!!!",i)<<endl;
12720 if(!fIntFlowSumOfProductOfEventWeightsVsM[i])
12723 cout<<Form(" WARNING (QC): fIntFlowSumOfProductOfEventWeightsVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",i)<<endl;
12727 if(!fIntFlowCovariancesVsM[i])
12730 cout<<Form(" WARNING (QC): fIntFlowCovariancesVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",i)<<endl;
12734 } // end of for(Int_t i=0;i<6;i++)
12735 if(!fIntFlowRebinnedInM)
12738 cout<<" WARNING (QC): fIntFlowRebinnedInM is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12742 if(!fIntFlowQcumulantsRebinnedInM)
12745 cout<<" WARNING (QC): fIntFlowQcumulantsRebinnedInM is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
12750 } // end of void AliFlowAnalysisWithQCumulants::CheckPointersUsedInFinish()
12752 //================================================================================================================================
12754 void AliFlowAnalysisWithQCumulants::CheckPointersUsedInMake()
12756 // Check all pointers used in method Make().
12759 } // end of void AliFlowAnalysisWithQCumulants::CheckPointersUsedInMake()