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 *
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),
119 fIntFlowCorrelationsEBE(NULL),
120 fIntFlowEventWeightsForCorrelationsEBE(NULL),
121 fIntFlowCorrelationsAllEBE(NULL),
122 fAvMultiplicity(NULL),
123 fIntFlowCorrelationsPro(NULL),
124 fIntFlowCorrelationsAllPro(NULL),
125 fIntFlowExtraCorrelationsPro(NULL),
126 fIntFlowProductOfCorrelationsPro(NULL),
127 fIntFlowCorrelationsHist(NULL),
128 fIntFlowCorrelationsAllHist(NULL),
129 fIntFlowCovariances(NULL),
130 fIntFlowSumOfProductOfEventWeights(NULL),
131 fIntFlowQcumulants(NULL),
133 // 4.) differential flow:
135 fDiffFlowProfiles(NULL),
136 fDiffFlowResults(NULL),
137 fDiffFlowFlags(NULL),
138 fCalculate2DFlow(kFALSE),
139 // 5.) distributions:
140 fDistributionsList(NULL),
141 fDistributionsFlags(NULL),
142 fStoreDistributions(kFALSE),
143 // x.) debugging and cross-checking:
144 fNestedLoopsList(NULL),
145 fEvaluateIntFlowNestedLoops(kFALSE),
146 fEvaluateDiffFlowNestedLoops(kFALSE),
147 fMaxAllowedMultiplicity(10),
148 fEvaluateNestedLoops(NULL),
149 fIntFlowDirectCorrelations(NULL),
150 fIntFlowExtraDirectCorrelations(NULL),
151 fCrossCheckInPtBinNo(10),
152 fCrossCheckInEtaBinNo(20),
153 fNoOfParticlesInBin(NULL)
157 // base list to hold all output objects:
158 fHistList = new TList();
159 fHistList->SetName("cobjQC");
160 fHistList->SetOwner(kTRUE);
162 // list to hold histograms with phi, pt and eta weights:
163 fWeightsList = new TList();
165 // multiplicity weight:
166 fMultiplicityWeight = new TString("combinations");
169 fAnalysisLabel = new TString();
171 // initialize all arrays:
172 this->InitializeArraysForIntFlow();
173 this->InitializeArraysForDiffFlow();
174 this->InitializeArraysForDistributions();
175 this->InitializeArraysForNestedLoops();
177 } // end of constructor
180 //================================================================================================================
183 AliFlowAnalysisWithQCumulants::~AliFlowAnalysisWithQCumulants()
189 } // end of AliFlowAnalysisWithQCumulants::~AliFlowAnalysisWithQCumulants()
192 //================================================================================================================
195 void AliFlowAnalysisWithQCumulants::Init()
197 // a) Cross check if the settings make sense before starting the QC adventure;
198 // b) Access all common constants;
199 // c) Book all objects;
200 // d) Store flags for integrated and differential flow;
201 // e) Store flags for distributions of corelations;
202 // f) Store harmonic which will be estimated.
204 //save old value and prevent histograms from being added to directory
205 //to avoid name clashes in case multiple analaysis objects are used
207 Bool_t oldHistAddStatus = TH1::AddDirectoryStatus();
208 TH1::AddDirectory(kFALSE);
210 // a) Cross check if the settings make sense before starting the QC adventure;
211 this->CrossCheckSettings();
212 // b) Access all common constants:
213 this->AccessConstants();
214 // c) Book all objects:
215 this->BookAndFillWeightsHistograms();
216 this->BookAndNestAllLists();
217 this->BookCommonHistograms();
218 this->BookEverythingForIntegratedFlow();
219 this->BookEverythingForDifferentialFlow();
220 this->BookEverythingForDistributions();
221 this->BookEverythingForNestedLoops();
222 // d) Store flags for integrated and differential flow:
223 this->StoreIntFlowFlags();
224 this->StoreDiffFlowFlags();
225 // e) Store flags for distributions of corelations:
226 this->StoreFlagsForDistributions();
227 // f) Store harmonic which will be estimated:
228 this->StoreHarmonic();
230 TH1::AddDirectory(oldHistAddStatus);
231 } // end of void AliFlowAnalysisWithQCumulants::Init()
234 //================================================================================================================
237 void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
239 // Running over data only in this method.
241 // a) Fill the common control histograms and call the method to fill fAvMultiplicity;
242 // b) Loop over data and calculate e-b-e quantities;
243 // c) Call all the methods;
244 // d) Debugging and cross-checking (evaluate nested loops);
245 // e) Reset all event by event quantities.
247 Double_t dPhi = 0.; // azimuthal angle in the laboratory frame
248 Double_t dPt = 0.; // transverse momentum
249 Double_t dEta = 0.; // pseudorapidity
251 Double_t wPhi = 1.; // phi weight
252 Double_t wPt = 1.; // pt weight
253 Double_t wEta = 1.; // eta weight
255 Int_t nRP = anEvent->GetEventNSelTracksRP(); // number of RPs (i.e. number of particles used to determine the reaction plane)
257 // a) Fill the common control histograms and call the method to fill fAvMultiplicity:
258 this->FillCommonControlHistograms(anEvent);
259 this->FillAverageMultiplicities(nRP);
261 // b) Loop over data and calculate e-b-e quantities:
262 Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = total number of primary tracks, i.e. nPrim = nRP + nPOI + rest, where:
263 // nRP = # of particles used to determine the reaction plane;
264 // nPOI = # of particles of interest for a detailed flow analysis;
265 // rest = # of particles which are not niether RPs nor POIs.
267 AliFlowTrackSimple *aftsTrack = NULL;
269 for(Int_t i=0;i<nPrim;i++)
271 aftsTrack=anEvent->GetTrack(i);
274 if(!(aftsTrack->InRPSelection() || aftsTrack->InPOISelection())) continue; // consider only tracks which are RPs or POIs
275 Int_t n = fHarmonic; // shortcut for the harmonic
276 if(aftsTrack->InRPSelection()) // RP condition:
278 dPhi = aftsTrack->Phi();
279 dPt = aftsTrack->Pt();
280 dEta = aftsTrack->Eta();
281 if(fUsePhiWeights && fPhiWeights && fnBinsPhi) // determine phi weight for this particle:
283 wPhi = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*fnBinsPhi/TMath::TwoPi())));
285 if(fUsePtWeights && fPtWeights && fnBinsPt) // determine pt weight for this particle:
287 wPt = fPtWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/fPtBinWidth)));
289 if(fUseEtaWeights && fEtaWeights && fEtaBinWidth) // determine eta weight for this particle:
291 wEta = fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/fEtaBinWidth)));
295 // calculate Re[Q_{m*n,k}] and Im[Q_{m*n,k}], m = 1,2,3,4, for this event:
296 for(Int_t m=0;m<4;m++)
298 for(Int_t k=0;k<9;k++)
300 (*fReQ)(m,k)+=pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1)*n*dPhi);
301 (*fImQ)(m,k)+=pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1)*n*dPhi);
304 // calculate S^{M}_{p,k} for this event
305 // Remark: final calculation of S^{M}_{p,k} follows after the loop over data bellow:
306 for(Int_t p=0;p<8;p++)
308 for(Int_t k=0;k<9;k++)
310 (*fSMpk)(p,k)+=pow(wPhi*wPt*wEta,k);
314 // differential flow:
317 for(Int_t m=0;m<4;m++)
319 for(Int_t k=0;k<9;k++)
321 fReRPQ1dEBE[0][0][m][k]->Fill(dPt,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
322 fImRPQ1dEBE[0][0][m][k]->Fill(dPt,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
326 // s_{k}(pt) for RPs // to be improved (clarified)
327 // Remark: final calculation of s_{p,k}(pt) follows after the loop over data bellow:
328 for(Int_t k=0;k<9;k++)
330 fs1dEBE[0][0][k]->Fill(dPt,pow(wPhi*wPt*wEta,k),1.);
334 for(Int_t m=0;m<4;m++)
336 for(Int_t k=0;k<9;k++)
338 fReRPQ1dEBE[0][1][m][k]->Fill(dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
339 fImRPQ1dEBE[0][1][m][k]->Fill(dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
342 // s_{k}(eta) for RPs // to be improved (clarified)
343 // Remark: final calculation of s_{p,k}(eta) follows after the loop over data bellow:
344 for(Int_t k=0;k<9;k++)
346 fs1dEBE[0][1][k]->Fill(dEta,pow(wPhi*wPt*wEta,k),1.);
355 // (r_{m*m,k}(pt,eta)):
356 for(Int_t m=0;m<4;m++)
358 for(Int_t k=0;k<9;k++)
360 fReRPQ2dEBE[0][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
361 fImRPQ2dEBE[0][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
364 // s_{k}(pt,eta) for RPs // to be improved (clarified)
365 // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:
366 for(Int_t k=0;k<9;k++)
368 fs2dEBE[0][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k),1.);
370 } // end of if(fCalculate2DFlow)
375 if(aftsTrack->InPOISelection())
379 for(Int_t m=0;m<4;m++)
381 for(Int_t k=0;k<9;k++)
383 fReRPQ1dEBE[2][0][m][k]->Fill(dPt,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
384 fImRPQ1dEBE[2][0][m][k]->Fill(dPt,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
387 // s_{k}(pt) for RP&&POIs // to be improved (clarified)
388 // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:
389 for(Int_t k=0;k<9;k++)
391 fs1dEBE[2][0][k]->Fill(dPt,pow(wPhi*wPt*wEta,k),1.);
395 for(Int_t m=0;m<4;m++)
397 for(Int_t k=0;k<9;k++)
399 fReRPQ1dEBE[2][1][m][k]->Fill(dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
400 fImRPQ1dEBE[2][1][m][k]->Fill(dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
403 // s_{k}(eta) for RP&&POIs // to be improved (clarified)
404 // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:
405 for(Int_t k=0;k<9;k++)
407 fs1dEBE[2][1][k]->Fill(dEta,pow(wPhi*wPt*wEta,k),1.);
414 // (q_{m*m,k}(pt,eta)):
415 for(Int_t m=0;m<4;m++)
417 for(Int_t k=0;k<9;k++)
419 fReRPQ2dEBE[2][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
420 fImRPQ2dEBE[2][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
423 // s_{k}(pt,eta) for RP&&POIs // to be improved (clarified)
424 // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:
425 for(Int_t k=0;k<9;k++)
427 fs2dEBE[2][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k),1.);
429 } // end of if(fCalculate2DFlow)
432 } // end of if(aftsTrack->InPOISelection())
436 } // end of if(pTrack->InRPSelection())
440 if(aftsTrack->InPOISelection())
442 dPhi = aftsTrack->Phi();
443 dPt = aftsTrack->Pt();
444 dEta = aftsTrack->Eta();
448 for(Int_t m=0;m<4;m++)
450 fReRPQ1dEBE[1][0][m][0]->Fill(dPt,TMath::Cos((m+1.)*n*dPhi),1.);
451 fImRPQ1dEBE[1][0][m][0]->Fill(dPt,TMath::Sin((m+1.)*n*dPhi),1.);
455 for(Int_t m=0;m<4;m++)
457 fReRPQ1dEBE[1][1][m][0]->Fill(dEta,TMath::Cos((m+1.)*n*dPhi),1.);
458 fImRPQ1dEBE[1][1][m][0]->Fill(dEta,TMath::Sin((m+1.)*n*dPhi),1.);
467 for(Int_t m=0;m<4;m++)
469 fReRPQ2dEBE[1][m][0]->Fill(dPt,dEta,TMath::Cos((m+1.)*n*dPhi),1.);
470 fImRPQ2dEBE[1][m][0]->Fill(dPt,dEta,TMath::Sin((m+1.)*n*dPhi),1.);
472 } // end of if(fCalculate2DFlow)
476 } // end of if(pTrack->InPOISelection() )
479 } else // to if(aftsTrack)
482 cout<<" WARNING: no particle! (i.e. aftsTrack is a NULL pointer in AFAWQC::Make().)"<<endl;
485 } // end of for(Int_t i=0;i<nPrim;i++)
487 // calculate the final expressions for S^{M}_{p,k}:
488 for(Int_t p=0;p<8;p++)
490 for(Int_t k=0;k<9;k++)
492 (*fSMpk)(p,k)=pow((*fSMpk)(p,k),p+1);
496 // *****************************
497 // **** CALL THE METHODS *******
498 // *****************************
500 if(!fEvaluateIntFlowNestedLoops)
502 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
504 if(nRP>1) this->CalculateIntFlowCorrelations(); // without using particle weights
507 if(nRP>1) this->CalculateIntFlowCorrelationsUsingParticleWeights(); // with using particle weights
510 if(nRP>3) this->CalculateIntFlowProductOfCorrelations();
511 if(nRP>1) this->CalculateIntFlowSumOfEventWeights();
512 if(nRP>1) this->CalculateIntFlowSumOfProductOfEventWeights();
513 if(fApplyCorrectionForNUA)
515 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
517 if(nRP>0) this->CalculateIntFlowCorrectionsForNUASinTerms();
518 if(nRP>0) this->CalculateIntFlowCorrectionsForNUACosTerms();
519 } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
521 if(nRP>0) this->CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights();
522 if(nRP>0) this->CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights();
524 } // end of if(fApplyCorrectionForNUA)
525 } // end of if(!fEvaluateIntFlowNestedLoops)
527 // differential flow:
528 if(!fEvaluateDiffFlowNestedLoops)
530 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
532 // without using particle weights:
533 this->CalculateDiffFlowCorrelations("RP","Pt");
534 this->CalculateDiffFlowCorrelations("RP","Eta");
535 this->CalculateDiffFlowCorrelations("POI","Pt");
536 this->CalculateDiffFlowCorrelations("POI","Eta");
537 if(fApplyCorrectionForNUA)
539 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Pt");
540 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Eta");
541 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Pt");
542 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Eta");
543 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Pt");
544 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Eta");
545 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Pt");
546 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Eta");
547 } // end of if(fApplyCorrectionForNUA)
548 } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
550 // with using particle weights:
551 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Pt");
552 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Eta");
553 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Pt");
554 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Eta");
555 if(fApplyCorrectionForNUA)
557 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Pt");
558 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Eta");
559 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Pt");
560 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Eta");
561 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Pt");
562 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Eta");
563 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Pt");
564 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Eta");
565 } // end of if(fApplyCorrectionForNUA)
568 // whether or not using particle weights the following is calculated in the same way:
569 this->CalculateDiffFlowProductOfCorrelations("RP","Pt");
570 this->CalculateDiffFlowProductOfCorrelations("RP","Eta");
571 this->CalculateDiffFlowProductOfCorrelations("POI","Pt");
572 this->CalculateDiffFlowProductOfCorrelations("POI","Eta");
573 this->CalculateDiffFlowSumOfEventWeights("RP","Pt");
574 this->CalculateDiffFlowSumOfEventWeights("RP","Eta");
575 this->CalculateDiffFlowSumOfEventWeights("POI","Pt");
576 this->CalculateDiffFlowSumOfEventWeights("POI","Eta");
577 this->CalculateDiffFlowSumOfProductOfEventWeights("RP","Pt");
578 this->CalculateDiffFlowSumOfProductOfEventWeights("RP","Eta");
579 this->CalculateDiffFlowSumOfProductOfEventWeights("POI","Pt");
580 this->CalculateDiffFlowSumOfProductOfEventWeights("POI","Eta");
581 } // end of if(!fEvaluateDiffFlowNestedLoops)
589 // 2D differential flow
593 if(nRP>1) this->CalculateCorrelationsForDifferentialFlow2D("RP");
594 if(nRP>1) this->CalculateCorrelationsForDifferentialFlow2D("POI");
597 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
599 if(nRP>1) this->CalculateWeightedCorrelationsForDifferentialFlow2D("RP");
600 if(nRP>1) this->CalculateWeightedCorrelationsForDifferentialFlow2D("POI");
602 } // end of if(fCalculate2DFlow)
605 // distributions of correlations:
606 if(fStoreDistributions)
608 this->StoreDistributionsOfCorrelations();
611 // d) Debugging and cross-checking (evaluate nested loops):
612 // d1) cross-checking results for integrated flow:
613 if(fEvaluateIntFlowNestedLoops)
615 if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10
617 // without using particle weights:
618 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
621 this->CalculateIntFlowCorrelations(); // from Q-vectors
622 this->EvaluateIntFlowCorrelationsWithNestedLoops(anEvent); // from nested loops (to be improved: do I have to pass here anEvent or not?)
623 // correction for non-uniform acceptance:
624 this->CalculateIntFlowCorrectionsForNUASinTerms(); // from Q-vectors (sin terms)
625 this->CalculateIntFlowCorrectionsForNUACosTerms(); // from Q-vectors (cos terms)
626 this->EvaluateIntFlowCorrectionsForNUAWithNestedLoops(anEvent); // from nested loops (both sin and cos terms)
628 // using particle weights:
629 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
632 this->CalculateIntFlowCorrelationsUsingParticleWeights(); // from Q-vectors
633 this->EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent); // from nested loops (to be improved: do I have to pass here anEvent or not?)
634 // correction for non-uniform acceptance:
635 this->CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights(); // from Q-vectors (sin terms)
636 this->CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights(); // from Q-vectors (cos terms)
637 this->EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(anEvent); // from nested loops (both sin and cos terms)
639 } else if (nPrim>fMaxAllowedMultiplicity) // to if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity)
642 cout<<"Skipping the event because multiplicity is "<<nPrim<<". Too high to evaluate nested loops!"<<endl;
646 cout<<"Skipping the event because multiplicity is "<<nPrim<<"."<<endl;
648 } // end of if(fEvaluateIntFlowNestedLoops)
650 // d2) cross-checking results for differential flow:
651 if(fEvaluateDiffFlowNestedLoops)
653 if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10
655 // without using particle weights:
656 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
658 // reduced correlations:
660 this->CalculateDiffFlowCorrelations("RP","Pt");
661 this->CalculateDiffFlowCorrelations("RP","Eta");
662 this->CalculateDiffFlowCorrelations("POI","Pt");
663 this->CalculateDiffFlowCorrelations("POI","Eta");
665 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"RP","Pt");
666 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"RP","Eta");
667 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"POI","Pt");
668 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"POI","Eta");
669 // reduced corrections for non-uniform acceptance:
671 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Pt");
672 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Eta");
673 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Pt");
674 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Eta");
675 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Pt");
676 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Eta");
677 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Pt");
678 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Eta");
680 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"RP","Pt");
681 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"RP","Eta");
682 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"POI","Pt");
683 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"POI","Eta");
684 } // end of if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
685 // using particle weights:
686 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
688 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Pt");
689 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Eta");
690 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Pt");
691 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Eta");
692 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Pt");
693 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Eta");
694 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Pt");
695 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Eta");
696 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Pt");
697 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Eta");
698 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Pt");
699 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Eta");
700 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"RP","Pt");
701 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"RP","Eta");
702 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"POI","Pt");
703 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"POI","Eta");
704 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"RP","Pt");
705 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"RP","Eta");
706 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"POI","Pt");
707 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"POI","Eta");
708 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
709 } // end of if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10
710 } // end of if(fEvaluateDiffFlowNestedLoops)
712 // e) Reset all event by event quantities:
713 this->ResetEventByEventQuantities();
715 } // end of AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
718 //================================================================================================================================
721 void AliFlowAnalysisWithQCumulants::Finish()
723 // Calculate the final results.
724 // a) acces the constants;
725 // b) access the flags;
726 // c) calculate the final results for integrated flow (without and with weights);
727 // d) store in AliFlowCommonHistResults and print the final results for integrated flow;
728 // e) calculate the final results for differential flow (without and with weights);
729 // f) print the final results for integrated flow obtained from differential flow (to be improved (terminology));
730 // g) cross-check the results: results from Q-vectors vs results from nested loops
732 // ******************************
733 // **** ACCESS THE CONSTANTS ****
734 // ******************************
736 this->AccessConstants();
738 if(fCommonHists && fCommonHists->GetHarmonic())
740 fHarmonic = (Int_t)(fCommonHists->GetHarmonic())->GetBinContent(1); // to be improved (moved somewhere else)
743 // **************************
744 // **** ACCESS THE FLAGS ****
745 // **************************
746 fUsePhiWeights = (Int_t)fUseParticleWeights->GetBinContent(1);
747 fUsePtWeights = (Int_t)fUseParticleWeights->GetBinContent(2);
748 fUseEtaWeights = (Int_t)fUseParticleWeights->GetBinContent(3);
749 fApplyCorrectionForNUA = (Int_t)fIntFlowFlags->GetBinContent(3);
750 fPrintFinalResults[0] = (Int_t)fIntFlowFlags->GetBinContent(4);
751 fPrintFinalResults[1] = (Int_t)fIntFlowFlags->GetBinContent(5);
752 fPrintFinalResults[2] = (Int_t)fIntFlowFlags->GetBinContent(6);
753 fEvaluateIntFlowNestedLoops = (Int_t)fEvaluateNestedLoops->GetBinContent(1);
754 fEvaluateDiffFlowNestedLoops = (Int_t)fEvaluateNestedLoops->GetBinContent(2);
755 fCrossCheckInPtBinNo = (Int_t)fEvaluateNestedLoops->GetBinContent(3);
756 fCrossCheckInEtaBinNo = (Int_t)fEvaluateNestedLoops->GetBinContent(4);
758 // *********************************************************
759 // **** CALCULATE THE FINAL RESULTS FOR INTEGRATED FLOW ****
760 // *********************************************************
762 this->FinalizeCorrelationsIntFlow();
763 this->CalculateCovariancesIntFlow();
764 this->CalculateCumulantsIntFlow();
765 this->CalculateIntFlow();
767 if(fApplyCorrectionForNUA) // to be improved (reorganized, etc)
769 this->FinalizeCorrectionTermsForNUAIntFlow();
770 this->CalculateQcumulantsCorrectedForNUAIntFlow();
771 this->CalculateIntFlowCorrectedForNUA();
774 // ***************************************************************
775 // **** STORE AND PRINT THE FINAL RESULTS FOR INTEGRATED FLOW ****
776 // ***************************************************************
778 this->FillCommonHistResultsIntFlow();
780 if(fPrintFinalResults[0])
782 this->PrintFinalResultsForIntegratedFlow("NONAME"); // to be improved (name)
785 // ***********************************************************
786 // **** CALCULATE THE FINAL RESULTS FOR DIFFERENTIAL FLOW ****
787 // ***********************************************************
789 this->FinalizeReducedCorrelations("RP","Pt");
790 this->FinalizeReducedCorrelations("RP","Eta");
791 this->FinalizeReducedCorrelations("POI","Pt");
792 this->FinalizeReducedCorrelations("POI","Eta");
793 this->CalculateDiffFlowCovariances("RP","Pt");
794 this->CalculateDiffFlowCovariances("RP","Eta");
795 this->CalculateDiffFlowCovariances("POI","Pt");
796 this->CalculateDiffFlowCovariances("POI","Eta");
797 this->CalculateDiffFlowCumulants("RP","Pt");
798 this->CalculateDiffFlowCumulants("RP","Eta");
799 this->CalculateDiffFlowCumulants("POI","Pt");
800 this->CalculateDiffFlowCumulants("POI","Eta");
801 this->CalculateDiffFlow("RP","Pt");
802 this->CalculateDiffFlow("RP","Eta");
803 this->CalculateDiffFlow("POI","Pt");
804 this->CalculateDiffFlow("POI","Eta");
806 if(fApplyCorrectionForNUA) // to be improved (reorganized, etc)
808 this->FinalizeCorrectionTermsForNUADiffFlow("RP","Pt");
809 this->FinalizeCorrectionTermsForNUADiffFlow("RP","Eta");
810 this->FinalizeCorrectionTermsForNUADiffFlow("POI","Pt");
811 this->FinalizeCorrectionTermsForNUADiffFlow("POI","Eta");
812 this->CalculateDiffFlowCumulantsCorrectedForNUA("RP","Pt");
813 this->CalculateDiffFlowCumulantsCorrectedForNUA("RP","Eta");
814 this->CalculateDiffFlowCumulantsCorrectedForNUA("POI","Pt");
815 this->CalculateDiffFlowCumulantsCorrectedForNUA("POI","Eta");
816 this->CalculateDiffFlowCorrectedForNUA("RP","Pt");
817 this->CalculateDiffFlowCorrectedForNUA("RP","Eta");
818 this->CalculateDiffFlowCorrectedForNUA("POI","Pt");
819 this->CalculateDiffFlowCorrectedForNUA("POI","Eta");
822 this->CalculateFinalResultsForRPandPOIIntegratedFlow("RP");
823 this->CalculateFinalResultsForRPandPOIIntegratedFlow("POI");
825 // *****************************************************************
826 // **** STORE AND PRINT THE FINAL RESULTS FOR DIFFERENTIAL FLOW ****
827 // *****************************************************************
828 this->FillCommonHistResultsDiffFlow("RP");
829 this->FillCommonHistResultsDiffFlow("POI");
831 if(fPrintFinalResults[1])
833 this->PrintFinalResultsForIntegratedFlow("RP");
835 if(fPrintFinalResults[2])
837 this->PrintFinalResultsForIntegratedFlow("POI");
839 // g) cross-check the results: results from Q-vectors vs results from nested loops
841 // g1) integrated flow:
842 if(fEvaluateIntFlowNestedLoops)
844 this->CrossCheckIntFlowCorrelations();
845 this->CrossCheckIntFlowCorrectionTermsForNUA();
846 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights) this->CrossCheckIntFlowExtraCorrelations();
847 } // end of if(fEvaluateIntFlowNestedLoops)
849 // g2) differential flow:
850 if(fEvaluateDiffFlowNestedLoops)
853 this->PrintNumberOfParticlesInSelectedBin();
854 this->CrossCheckDiffFlowCorrelations("RP","Pt");
855 this->CrossCheckDiffFlowCorrelations("RP","Eta");
856 this->CrossCheckDiffFlowCorrelations("POI","Pt");
857 this->CrossCheckDiffFlowCorrelations("POI","Eta");
858 // correction terms for non-uniform acceptance:
859 this->CrossCheckDiffFlowCorrectionTermsForNUA("RP","Pt");
860 this->CrossCheckDiffFlowCorrectionTermsForNUA("RP","Eta");
861 this->CrossCheckDiffFlowCorrectionTermsForNUA("POI","Pt");
862 this->CrossCheckDiffFlowCorrectionTermsForNUA("POI","Eta");
863 } // end of if(fEvaluateDiffFlowNestedLoops)
865 } // end of AliFlowAnalysisWithQCumulants::Finish()
868 //================================================================================================================================
871 void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTerms()
873 // calculate corrections for non-uniform acceptance of the detector for no-name integrated flow (cos terms)
876 Double_t dMult = (*fSMpk)(0,0);
878 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
879 Double_t dReQ1n = (*fReQ)(0,0);
880 Double_t dReQ2n = (*fReQ)(1,0);
881 //Double_t dReQ3n = (*fReQ)(2,0);
882 //Double_t dReQ4n = (*fReQ)(3,0);
883 Double_t dImQ1n = (*fImQ)(0,0);
884 Double_t dImQ2n = (*fImQ)(1,0);
885 //Double_t dImQ3n = (*fImQ)(2,0);
886 //Double_t dImQ4n = (*fImQ)(3,0);
888 // *************************************************************
889 // **** corrections for non-uniform acceptance (cos terms): ****
890 // *************************************************************
892 // Remark 1: corrections for non-uniform acceptance (cos terms) calculated with non-weighted Q-vectors
893 // are stored in 1D profile fQCorrectionsCos.
894 // Remark 2: binning of fIntFlowCorrectionTermsForNUAPro[1] is organized as follows:
895 // --------------------------------------------------------------------------------------------------------------------
896 // 1st bin: <<cos(n*(phi1))>> = cosP1n
897 // 2nd bin: <<cos(n*(phi1+phi2))>> = cosP1nP1n
898 // 3rd bin: <<cos(n*(phi1-phi2-phi3))>> = cosP1nM1nM1n
899 // 4th bin: <<cos(n*(2phi1-phi2))>> = cosP2nM1n
900 // --------------------------------------------------------------------------------------------------------------------
903 Double_t cosP1n = 0.; // <<cos(n*(phi1))>>
907 cosP1n = dReQ1n/dMult;
909 // average non-weighted 1-particle correction (cos terms) for non-uniform acceptance for single event:
910 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(1,cosP1n);
912 // final average non-weighted 1-particle correction (cos terms) for non-uniform acceptance for all events:
913 fIntFlowCorrectionTermsForNUAPro[1]->Fill(0.5,cosP1n,dMult);
917 Double_t cosP1nP1n = 0.; // <<cos(n*(phi1+phi2))>>
918 Double_t cosP2nM1n = 0.; // <<cos(n*(2phi1-phi2))>>
922 cosP1nP1n = (pow(dReQ1n,2)-pow(dImQ1n,2)-dReQ2n)/(dMult*(dMult-1));
923 cosP2nM1n = (dReQ2n*dReQ1n+dImQ2n*dImQ1n-dReQ1n)/(dMult*(dMult-1));
925 // average non-weighted 2-particle correction (cos terms) for non-uniform acceptance for single event:
926 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(2,cosP1nP1n);
927 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(4,cosP2nM1n);
929 // final average non-weighted 2-particle correction (cos terms) for non-uniform acceptance for all events:
930 fIntFlowCorrectionTermsForNUAPro[1]->Fill(1.5,cosP1nP1n,dMult*(dMult-1));
931 fIntFlowCorrectionTermsForNUAPro[1]->Fill(3.5,cosP2nM1n,dMult*(dMult-1));
935 Double_t cosP1nM1nM1n = 0.; // <<cos(n*(phi1-phi2-phi3))>>
939 cosP1nM1nM1n = (dReQ1n*(pow(dReQ1n,2)+pow(dImQ1n,2))-dReQ1n*dReQ2n-dImQ1n*dImQ2n-2.*(dMult-1)*dReQ1n)
940 / (dMult*(dMult-1)*(dMult-2));
942 // average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for single event:
943 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(3,cosP1nM1nM1n);
945 // final average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for all events:
946 fIntFlowCorrectionTermsForNUAPro[1]->Fill(2.5,cosP1nM1nM1n,dMult*(dMult-1)*(dMult-2));
949 } // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTerms()
952 //================================================================================================================================
955 void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTerms()
957 // calculate corrections for non-uniform acceptance of the detector for no-name integrated flow (sin terms)
960 Double_t dMult = (*fSMpk)(0,0);
962 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
963 Double_t dReQ1n = (*fReQ)(0,0);
964 Double_t dReQ2n = (*fReQ)(1,0);
965 //Double_t dReQ3n = (*fReQ)(2,0);
966 //Double_t dReQ4n = (*fReQ)(3,0);
967 Double_t dImQ1n = (*fImQ)(0,0);
968 Double_t dImQ2n = (*fImQ)(1,0);
969 //Double_t dImQ3n = (*fImQ)(2,0);
970 //Double_t dImQ4n = (*fImQ)(3,0);
972 // *************************************************************
973 // **** corrections for non-uniform acceptance (sin terms): ****
974 // *************************************************************
976 // Remark 1: corrections for non-uniform acceptance (sin terms) calculated with non-weighted Q-vectors
977 // are stored in 1D profile fQCorrectionsSin.
978 // Remark 2: binning of fIntFlowCorrectionTermsForNUAPro[0] is organized as follows:
979 // --------------------------------------------------------------------------------------------------------------------
980 // 1st bin: <<sin(n*(phi1))>> = sinP1n
981 // 2nd bin: <<sin(n*(phi1+phi2))>> = sinP1nP1n
982 // 3rd bin: <<sin(n*(phi1-phi2-phi3))>> = sinP1nM1nM1n
983 // 4th bin: <<sin(n*(2phi1-phi2))>> = sinP2nM1n
984 // --------------------------------------------------------------------------------------------------------------------
987 Double_t sinP1n = 0.; // <sin(n*(phi1))>
991 sinP1n = dImQ1n/dMult;
993 // average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for single event:
994 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(1,sinP1n);
996 // final average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
997 fIntFlowCorrectionTermsForNUAPro[0]->Fill(0.5,sinP1n,dMult);
1001 Double_t sinP1nP1n = 0.; // <<sin(n*(phi1+phi2))>>
1002 Double_t sinP2nM1n = 0.; // <<sin(n*(2phi1-phi2))>>
1005 sinP1nP1n = (2.*dReQ1n*dImQ1n-dImQ2n)/(dMult*(dMult-1));
1006 sinP2nM1n = (dImQ2n*dReQ1n-dReQ2n*dImQ1n-dImQ1n)/(dMult*(dMult-1));
1008 // average non-weighted 2-particle correction (sin terms) for non-uniform acceptance for single event:
1009 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(2,sinP1nP1n);
1010 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(4,sinP2nM1n);
1012 // final average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
1013 fIntFlowCorrectionTermsForNUAPro[0]->Fill(1.5,sinP1nP1n,dMult*(dMult-1));
1014 fIntFlowCorrectionTermsForNUAPro[0]->Fill(3.5,sinP2nM1n,dMult*(dMult-1));
1018 Double_t sinP1nM1nM1n = 0.; // <<sin(n*(phi1-phi2-phi3))>>
1022 sinP1nM1nM1n = (-dImQ1n*(pow(dReQ1n,2)+pow(dImQ1n,2))+dReQ1n*dImQ2n-dImQ1n*dReQ2n+2.*(dMult-1)*dImQ1n)
1023 / (dMult*(dMult-1)*(dMult-2));
1025 // average non-weighted 3-particle correction (sin terms) for non-uniform acceptance for single event:
1026 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(3,sinP1nM1nM1n);
1028 // final average non-weighted 3-particle correction (sin terms) for non-uniform acceptance for all events:
1029 fIntFlowCorrectionTermsForNUAPro[0]->Fill(2.5,sinP1nM1nM1n,dMult*(dMult-1)*(dMult-2));
1032 } // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTerms()
1035 //================================================================================================================================
1038 void AliFlowAnalysisWithQCumulants::GetOutputHistograms(TList *outputListHistos)
1040 // a) Get pointers for common control and common result histograms and profiles.
1041 // b) Get pointers for histograms with particle weights.
1042 // c) Get pointers for histograms and profiles relevant for integrated flow.
1043 // d) Get pointers for histograms and profiles relevant for differental flow.
1044 // e) Get pointers for histograms and profiles holding results obtained with nested loops.
1046 if(outputListHistos)
1048 this->SetHistList(outputListHistos);
1052 cout<<" WARNING (QC): fHistList is NULL in AFAWQC::GOH() !!!!"<<endl;
1056 this->GetPointersForCommonHistograms();
1057 this->GetPointersForParticleWeightsHistograms();
1058 this->GetPointersForIntFlowHistograms();
1059 this->GetPointersForDiffFlowHistograms();
1060 this->GetPointersForNestedLoopsHistograms();
1064 cout<<" WARNING (QC): outputListHistos is NULL in AFAWQC::GOH() !!!!"<<endl;
1069 } // end of void AliFlowAnalysisWithQCumulants::GetOutputHistograms(TList *outputListHistos)
1072 //================================================================================================================================
1075 TProfile* AliFlowAnalysisWithQCumulants::MakePtProjection(TProfile2D *profilePtEta) const
1077 // project 2D profile onto pt axis to get 1D profile
1079 Int_t nBinsPt = profilePtEta->GetNbinsX();
1080 Double_t dPtMin = (profilePtEta->GetXaxis())->GetXmin();
1081 Double_t dPtMax = (profilePtEta->GetXaxis())->GetXmax();
1083 Int_t nBinsEta = profilePtEta->GetNbinsY();
1085 TProfile *profilePt = new TProfile("","",nBinsPt,dPtMin,dPtMax);
1087 for(Int_t p=1;p<=nBinsPt;p++)
1089 Double_t contentPt = 0.;
1090 Double_t entryPt = 0.;
1091 Double_t spreadPt = 0.;
1095 for(Int_t e=1;e<=nBinsEta;e++)
1097 contentPt += (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)))
1098 * (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1099 entryPt += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1101 sum1 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)))
1102 * (pow(profilePtEta->GetBinError(profilePtEta->GetBin(p,e)),2.)
1103 + pow(profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)),2.));
1104 sum2 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1105 sum3 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)))
1106 * (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)));
1108 if(sum2>0. && sum1/sum2-pow(sum3/sum2,2.) > 0.)
1110 spreadPt = pow(sum1/sum2-pow(sum3/sum2,2.),0.5);
1112 profilePt->SetBinContent(p,contentPt);
1113 profilePt->SetBinEntries(p,entryPt);
1115 profilePt->SetBinError(p,spreadPt);
1122 } // end of TProfile* AliFlowAnalysisWithQCumulants::MakePtProjection(TProfile2D *profilePtEta)
1125 //================================================================================================================================
1128 TProfile* AliFlowAnalysisWithQCumulants::MakeEtaProjection(TProfile2D *profilePtEta) const
1130 // project 2D profile onto eta axis to get 1D profile
1132 Int_t nBinsEta = profilePtEta->GetNbinsY();
1133 Double_t dEtaMin = (profilePtEta->GetYaxis())->GetXmin();
1134 Double_t dEtaMax = (profilePtEta->GetYaxis())->GetXmax();
1136 Int_t nBinsPt = profilePtEta->GetNbinsX();
1138 TProfile *profileEta = new TProfile("","",nBinsEta,dEtaMin,dEtaMax);
1140 for(Int_t e=1;e<=nBinsEta;e++)
1142 Double_t contentEta = 0.;
1143 Double_t entryEta = 0.;
1144 for(Int_t p=1;p<=nBinsPt;p++)
1146 contentEta += (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)))
1147 * (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1148 entryEta += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1150 profileEta->SetBinContent(e,contentEta);
1151 profileEta->SetBinEntries(e,entryEta);
1156 } // end of TProfile* AliFlowAnalysisWithQCumulants::MakeEtaProjection(TProfile2D *profilePtEta)
1159 //================================================================================================================================
1162 void AliFlowAnalysisWithQCumulants::PrintFinalResultsForIntegratedFlow(TString type)
1164 // printing on the screen the final results for integrated flow (NONAME, POI and RP) // to be improved (NONAME)
1166 Int_t n = fHarmonic;
1168 if(type == "NONAME" || type == "RP" || type == "POI")
1170 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
1172 cout<<"WARNING: fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th"<<endl;
1173 cout<<" is NULL in AFAWQC::PFRFIF() !!!!"<<endl;
1177 cout<<"WARNING: type in not from {NONAME, RP, POI} in AFAWQC::PFRFIF() !!!!"<<endl;
1181 Double_t dVn[4] = {0.}; // array to hold Vn{2}, Vn{4}, Vn{6} and Vn{8}
1182 Double_t dVnErr[4] = {0.}; // array to hold errors of Vn{2}, Vn{4}, Vn{6} and Vn{8}
1184 if(type == "NONAME")
1186 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinContent(1);
1187 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinError(1);
1188 dVn[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinContent(1);
1189 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinError(1);
1190 dVn[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinContent(1);
1191 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinError(1);
1192 dVn[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinContent(1);
1193 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinError(1);
1194 } else if(type == "RP")
1196 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinContent(1);
1197 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinError(1);
1198 dVn[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinContent(1);
1199 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinError(1);
1200 dVn[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinContent(1);
1201 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinError(1);
1202 dVn[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinContent(1);
1203 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinError(1);
1204 } else if(type == "POI")
1206 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinContent(1);
1207 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinError(1);
1208 dVn[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinContent(1);
1209 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinError(1);
1210 dVn[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinContent(1);
1211 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinError(1);
1212 dVn[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinContent(1);
1213 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinError(1);
1216 TString title = " flow estimates from Q-cumulants";
1217 TString subtitle = " (";
1219 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
1221 subtitle.Append(type);
1222 subtitle.Append(", without weights)");
1225 subtitle.Append(type);
1226 subtitle.Append(", with weights)");
1230 cout<<"*************************************"<<endl;
1231 cout<<"*************************************"<<endl;
1232 cout<<title.Data()<<endl;
1233 cout<<subtitle.Data()<<endl;
1236 for(Int_t i=0;i<4;i++)
1240 cout<<" v_"<<n<<"{"<<2*(i+1)<<"} = "<<dVn[i]<<" +/- "<<dVnErr[i]<<endl;
1244 cout<<" v_"<<n<<"{"<<2*(i+1)<<"} = Im"<<endl;
1250 if(type == "NONAME")
1252 cout<<" nEvts = "<<nEvtsNoName<<", AvM = "<<dMultNoName<<endl; // to be improved
1254 else if (type == "RP")
1256 cout<<" nEvts = "<<nEvtsRP<<", AvM = "<<dMultRP<<endl; // to be improved
1258 else if (type == "POI")
1260 cout<<" nEvts = "<<nEvtsPOI<<", AvM = "<<dMultPOI<<endl; // to be improved
1263 cout<<"*************************************"<<endl;
1264 cout<<"*************************************"<<endl;
1267 }// end of AliFlowAnalysisWithQCumulants::PrintFinalResultsForIntegratedFlow(TString type="NONAME");
1270 //================================================================================================================================
1273 void AliFlowAnalysisWithQCumulants::WriteHistograms(TString outputFileName)
1275 //store the final results in output .root file
1276 TFile *output = new TFile(outputFileName.Data(),"RECREATE");
1277 //output->WriteObject(fHistList, "cobjQC","SingleKey");
1278 fHistList->Write(fHistList->GetName(), TObject::kSingleKey);
1283 //================================================================================================================================
1286 void AliFlowAnalysisWithQCumulants::WriteHistograms(TDirectoryFile *outputFileName)
1288 //store the final results in output .root file
1289 fHistList->SetName("cobjQC");
1290 fHistList->SetOwner(kTRUE);
1291 outputFileName->Add(fHistList);
1292 outputFileName->Write(outputFileName->GetName(), TObject::kSingleKey);
1296 //================================================================================================================================
1299 void AliFlowAnalysisWithQCumulants::BookCommonHistograms()
1301 // Book common control histograms and common histograms for final results.
1302 // common control histogram (ALL events)
1303 TString commonHistsName = "AliFlowCommonHistQC";
1304 commonHistsName += fAnalysisLabel->Data();
1305 fCommonHists = new AliFlowCommonHist(commonHistsName.Data());
1306 fHistList->Add(fCommonHists);
1307 // common control histogram (for events with 2 and more particles)
1308 TString commonHists2ndOrderName = "AliFlowCommonHist2ndOrderQC";
1309 commonHists2ndOrderName += fAnalysisLabel->Data();
1310 fCommonHists2nd = new AliFlowCommonHist(commonHists2ndOrderName.Data());
1311 fHistList->Add(fCommonHists2nd);
1312 // common control histogram (for events with 4 and more particles)
1313 TString commonHists4thOrderName = "AliFlowCommonHist4thOrderQC";
1314 commonHists4thOrderName += fAnalysisLabel->Data();
1315 fCommonHists4th = new AliFlowCommonHist(commonHists4thOrderName.Data());
1316 fHistList->Add(fCommonHists4th);
1317 // common control histogram (for events with 6 and more particles)
1318 TString commonHists6thOrderName = "AliFlowCommonHist6thOrderQC";
1319 commonHists6thOrderName += fAnalysisLabel->Data();
1320 fCommonHists6th = new AliFlowCommonHist(commonHists6thOrderName.Data());
1321 fHistList->Add(fCommonHists6th);
1322 // common control histogram (for events with 8 and more particles)
1323 TString commonHists8thOrderName = "AliFlowCommonHist8thOrderQC";
1324 commonHists8thOrderName += fAnalysisLabel->Data();
1325 fCommonHists8th = new AliFlowCommonHist(commonHists8thOrderName.Data());
1326 fHistList->Add(fCommonHists8th);
1327 // common histograms for final results (calculated for events with 2 and more particles)
1328 TString commonHistResults2ndOrderName = "AliFlowCommonHistResults2ndOrderQC";
1329 commonHistResults2ndOrderName += fAnalysisLabel->Data();
1330 fCommonHistsResults2nd = new AliFlowCommonHistResults(commonHistResults2ndOrderName.Data());
1331 fHistList->Add(fCommonHistsResults2nd);
1332 // common histograms for final results (calculated for events with 4 and more particles)
1333 TString commonHistResults4thOrderName = "AliFlowCommonHistResults4thOrderQC";
1334 commonHistResults4thOrderName += fAnalysisLabel->Data();
1335 fCommonHistsResults4th = new AliFlowCommonHistResults(commonHistResults4thOrderName.Data());
1336 fHistList->Add(fCommonHistsResults4th);
1337 // common histograms for final results (calculated for events with 6 and more particles)
1338 TString commonHistResults6thOrderName = "AliFlowCommonHistResults6thOrderQC";
1339 commonHistResults6thOrderName += fAnalysisLabel->Data();
1340 fCommonHistsResults6th = new AliFlowCommonHistResults(commonHistResults6thOrderName.Data());
1341 fHistList->Add(fCommonHistsResults6th);
1342 // common histograms for final results (calculated for events with 8 and more particles)
1343 TString commonHistResults8thOrderName = "AliFlowCommonHistResults8thOrderQC";
1344 commonHistResults8thOrderName += fAnalysisLabel->Data();
1345 fCommonHistsResults8th = new AliFlowCommonHistResults(commonHistResults8thOrderName.Data());
1346 fHistList->Add(fCommonHistsResults8th);
1348 } // end of void AliFlowAnalysisWithQCumulants::BookCommonHistograms()
1351 //================================================================================================================================
1354 void AliFlowAnalysisWithQCumulants::BookAndFillWeightsHistograms()
1356 // book and fill histograms which hold phi, pt and eta weights
1360 cout<<"WARNING: fWeightsList is NULL in AFAWQC::BAFWH() !!!!"<<endl;
1364 TString fUseParticleWeightsName = "fUseParticleWeightsQC";
1365 fUseParticleWeightsName += fAnalysisLabel->Data();
1366 fUseParticleWeights = new TProfile(fUseParticleWeightsName.Data(),"0 = particle weight not used, 1 = particle weight used ",3,0,3);
1367 fUseParticleWeights->SetLabelSize(0.06);
1368 (fUseParticleWeights->GetXaxis())->SetBinLabel(1,"w_{#phi}");
1369 (fUseParticleWeights->GetXaxis())->SetBinLabel(2,"w_{p_{T}}");
1370 (fUseParticleWeights->GetXaxis())->SetBinLabel(3,"w_{#eta}");
1371 fUseParticleWeights->Fill(0.5,(Int_t)fUsePhiWeights);
1372 fUseParticleWeights->Fill(1.5,(Int_t)fUsePtWeights);
1373 fUseParticleWeights->Fill(2.5,(Int_t)fUseEtaWeights);
1374 fWeightsList->Add(fUseParticleWeights);
1378 if(fWeightsList->FindObject("phi_weights"))
1380 fPhiWeights = dynamic_cast<TH1F*>(fWeightsList->FindObject("phi_weights"));
1381 if(TMath::Abs(fPhiWeights->GetBinWidth(1)-fPhiBinWidth)>pow(10.,-6.))
1384 cout<<"WARNING (QC): Inconsistent binning in histograms for phi-weights throughout the code."<<endl;
1390 cout<<"WARNING: fWeightsList->FindObject(\"phi_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
1393 } // end of if(fUsePhiWeights)
1397 if(fWeightsList->FindObject("pt_weights"))
1399 fPtWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("pt_weights"));
1400 if(TMath::Abs(fPtWeights->GetBinWidth(1)-fPtBinWidth)>pow(10.,-6.))
1403 cout<<"WARNING (QC): Inconsistent binning in histograms for pt-weights throughout the code."<<endl;
1409 cout<<"WARNING: fWeightsList->FindObject(\"pt_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
1412 } // end of if(fUsePtWeights)
1416 if(fWeightsList->FindObject("eta_weights"))
1418 fEtaWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("eta_weights"));
1419 if(TMath::Abs(fEtaWeights->GetBinWidth(1)-fEtaBinWidth)>pow(10.,-6.))
1422 cout<<"WARNING (QC): Inconsistent binning in histograms for eta-weights throughout the code."<<endl;
1428 cout<<"WARNING: fUseEtaWeights && fWeightsList->FindObject(\"eta_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
1431 } // end of if(fUseEtaWeights)
1433 } // end of AliFlowAnalysisWithQCumulants::BookAndFillWeightsHistograms()
1436 //================================================================================================================================
1439 void AliFlowAnalysisWithQCumulants::BookEverythingForIntegratedFlow()
1441 // Book all objects for integrated flow:
1442 // a) Book profile to hold all flags for integrated flow.
1443 // b) Book event-by-event quantities.
1444 // c) Book profiles. // to be improved (comment)
1445 // d) Book histograms holding the final results.
1447 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)
1448 TString powerFlag[2] = {"linear","quadratic"}; // to be improved (should I promote this to data members?)
1450 // a) Book profile to hold all flags for integrated flow:
1451 TString intFlowFlagsName = "fIntFlowFlags";
1452 intFlowFlagsName += fAnalysisLabel->Data();
1453 fIntFlowFlags = new TProfile(intFlowFlagsName.Data(),"Flags for Integrated Flow",6,0,6);
1454 fIntFlowFlags->SetTickLength(-0.01,"Y");
1455 fIntFlowFlags->SetMarkerStyle(25);
1456 fIntFlowFlags->SetLabelSize(0.05);
1457 fIntFlowFlags->SetLabelOffset(0.02,"Y");
1458 fIntFlowFlags->GetXaxis()->SetBinLabel(1,"Particle Weights");
1459 fIntFlowFlags->GetXaxis()->SetBinLabel(2,"Event Weights");
1460 fIntFlowFlags->GetXaxis()->SetBinLabel(3,"Corrected for NUA?");
1461 fIntFlowFlags->GetXaxis()->SetBinLabel(4,"Print NONAME results");
1462 fIntFlowFlags->GetXaxis()->SetBinLabel(5,"Print RP results");
1463 fIntFlowFlags->GetXaxis()->SetBinLabel(6,"Print POI results");
1464 fIntFlowList->Add(fIntFlowFlags);
1466 // b) Book event-by-event quantities:
1467 // Re[Q_{m*n,k}], Im[Q_{m*n,k}] and S_{p,k}^M:
1468 fReQ = new TMatrixD(4,9);
1469 fImQ = new TMatrixD(4,9);
1470 fSMpk = new TMatrixD(8,9);
1471 // average correlations <2>, <4>, <6> and <8> for single event (bining is the same as in fIntFlowCorrelationsPro and fIntFlowCorrelationsHist):
1472 TString intFlowCorrelationsEBEName = "fIntFlowCorrelationsEBE";
1473 intFlowCorrelationsEBEName += fAnalysisLabel->Data();
1474 fIntFlowCorrelationsEBE = new TH1D(intFlowCorrelationsEBEName.Data(),intFlowCorrelationsEBEName.Data(),4,0,4);
1475 // weights for average correlations <2>, <4>, <6> and <8> for single event:
1476 TString intFlowEventWeightsForCorrelationsEBEName = "fIntFlowEventWeightsForCorrelationsEBE";
1477 intFlowEventWeightsForCorrelationsEBEName += fAnalysisLabel->Data();
1478 fIntFlowEventWeightsForCorrelationsEBE = new TH1D(intFlowEventWeightsForCorrelationsEBEName.Data(),intFlowEventWeightsForCorrelationsEBEName.Data(),4,0,4);
1479 // average all correlations for single event (bining is the same as in fIntFlowCorrelationsAllPro and fIntFlowCorrelationsAllHist):
1480 TString intFlowCorrelationsAllEBEName = "fIntFlowCorrelationsAllEBE";
1481 intFlowCorrelationsAllEBEName += fAnalysisLabel->Data();
1482 fIntFlowCorrelationsAllEBE = new TH1D(intFlowCorrelationsAllEBEName.Data(),intFlowCorrelationsAllEBEName.Data(),32,0,32);
1483 // average correction terms for non-uniform acceptance for single event
1484 // (binning is the same as in fIntFlowCorrectionTermsForNUAPro[2] and fIntFlowCorrectionTermsForNUAHist[2]):
1485 TString fIntFlowCorrectionTermsForNUAEBEName = "fIntFlowCorrectionTermsForNUAEBE";
1486 fIntFlowCorrectionTermsForNUAEBEName += fAnalysisLabel->Data();
1487 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1489 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);
1492 // c) Book profiles: // to be improved (comment)
1493 // profile to hold average multiplicities and number of events for events with nRP>=0, nRP>=1, ... , and nRP>=8:
1494 TString avMultiplicityName = "fAvMultiplicity";
1495 avMultiplicityName += fAnalysisLabel->Data();
1496 fAvMultiplicity = new TProfile(avMultiplicityName.Data(),"Average Multiplicities of RPs",9,0,9);
1497 fAvMultiplicity->SetTickLength(-0.01,"Y");
1498 fAvMultiplicity->SetMarkerStyle(25);
1499 fAvMultiplicity->SetLabelSize(0.05);
1500 fAvMultiplicity->SetLabelOffset(0.02,"Y");
1501 fAvMultiplicity->SetYTitle("Average Multiplicity");
1502 (fAvMultiplicity->GetXaxis())->SetBinLabel(1,"all evts");
1503 (fAvMultiplicity->GetXaxis())->SetBinLabel(2,"n_{RP} #geq 1");
1504 (fAvMultiplicity->GetXaxis())->SetBinLabel(3,"n_{RP} #geq 2");
1505 (fAvMultiplicity->GetXaxis())->SetBinLabel(4,"n_{RP} #geq 3");
1506 (fAvMultiplicity->GetXaxis())->SetBinLabel(5,"n_{RP} #geq 4");
1507 (fAvMultiplicity->GetXaxis())->SetBinLabel(6,"n_{RP} #geq 5");
1508 (fAvMultiplicity->GetXaxis())->SetBinLabel(7,"n_{RP} #geq 6");
1509 (fAvMultiplicity->GetXaxis())->SetBinLabel(8,"n_{RP} #geq 7");
1510 (fAvMultiplicity->GetXaxis())->SetBinLabel(9,"n_{RP} #geq 8");
1511 fIntFlowProfiles->Add(fAvMultiplicity);
1512 // average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with wrong errors!):
1513 TString intFlowCorrelationsProName = "fIntFlowCorrelationsPro";
1514 intFlowCorrelationsProName += fAnalysisLabel->Data();
1515 fIntFlowCorrelationsPro = new TProfile(intFlowCorrelationsProName.Data(),"Average correlations for all events",4,0,4,"s");
1516 fIntFlowCorrelationsPro->SetTickLength(-0.01,"Y");
1517 fIntFlowCorrelationsPro->SetMarkerStyle(25);
1518 fIntFlowCorrelationsPro->SetLabelSize(0.06);
1519 fIntFlowCorrelationsPro->SetLabelOffset(0.01,"Y");
1520 (fIntFlowCorrelationsPro->GetXaxis())->SetBinLabel(1,"<<2>>");
1521 (fIntFlowCorrelationsPro->GetXaxis())->SetBinLabel(2,"<<4>>");
1522 (fIntFlowCorrelationsPro->GetXaxis())->SetBinLabel(3,"<<6>>");
1523 (fIntFlowCorrelationsPro->GetXaxis())->SetBinLabel(4,"<<8>>");
1524 fIntFlowProfiles->Add(fIntFlowCorrelationsPro);
1525 // averaged all correlations for all events (with wrong errors!):
1526 TString intFlowCorrelationsAllProName = "fIntFlowCorrelationsAllPro";
1527 intFlowCorrelationsAllProName += fAnalysisLabel->Data();
1528 fIntFlowCorrelationsAllPro = new TProfile(intFlowCorrelationsAllProName.Data(),"Average correlations for all events",32,0,32,"s");
1529 fIntFlowCorrelationsAllPro->SetTickLength(-0.01,"Y");
1530 fIntFlowCorrelationsAllPro->SetMarkerStyle(25);
1531 fIntFlowCorrelationsAllPro->SetLabelSize(0.03);
1532 fIntFlowCorrelationsAllPro->SetLabelOffset(0.01,"Y");
1533 // 2-p correlations:
1534 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(1,"<<2>>_{n|n}");
1535 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(2,"<<2>>_{2n|2n}");
1536 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(3,"<<2>>_{3n|3n}");
1537 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(4,"<<2>>_{4n|4n}");
1538 // 3-p correlations:
1539 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(6,"<<3>>_{2n|n,n}");
1540 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(7,"<<3>>_{3n|2n,n}");
1541 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(8,"<<3>>_{4n|2n,2n}");
1542 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(9,"<<3>>_{4n|3n,n}");
1543 // 4-p correlations:
1544 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(11,"<<4>>_{n,n|n,n}");
1545 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(12,"<<4>>_{2n,n|2n,n}");
1546 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(13,"<<4>>_{2n,2n|2n,2n}");
1547 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(14,"<<4>>_{3n|n,n,n}");
1548 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(15,"<<4>>_{3n,n|3n,n}");
1549 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(16,"<<4>>_{3n,n|2n,2n}");
1550 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(17,"<<4>>_{4n|2n,n,n}");
1551 // 5-p correlations:
1552 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(19,"<<5>>_{2n|n,n,n,n}");
1553 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(20,"<<5>>_{2n,2n|2n,n,n}");
1554 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(21,"<<5>>_{3n,n|2n,n,n}");
1555 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(22,"<<5>>_{4n|n,n,n,n}");
1556 // 6-p correlations:
1557 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(24,"<<6>>_{n,n,n|n,n,n}");
1558 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(25,"<<6>>_{2n,n,n|2n,n,n}");
1559 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(26,"<<6>>_{2n,2n|n,n,n,n}");
1560 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(27,"<<6>>_{3n,n|n,n,n,n}");
1561 // 7-p correlations:
1562 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(29,"<<7>>_{2n,n,n|n,n,n,n}");
1563 // 8-p correlations:
1564 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(31,"<<8>>_{n,n,n,n|n,n,n,n}");
1565 fIntFlowProfiles->Add(fIntFlowCorrelationsAllPro);
1566 // when particle weights are used some extra correlations appear:
1567 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
1569 TString intFlowExtraCorrelationsProName = "fIntFlowExtraCorrelationsPro";
1570 intFlowExtraCorrelationsProName += fAnalysisLabel->Data();
1571 fIntFlowExtraCorrelationsPro = new TProfile(intFlowExtraCorrelationsProName.Data(),"Average extra correlations for all events",100,0,100,"s");
1572 fIntFlowExtraCorrelationsPro->SetTickLength(-0.01,"Y");
1573 fIntFlowExtraCorrelationsPro->SetMarkerStyle(25);
1574 fIntFlowExtraCorrelationsPro->SetLabelSize(0.03);
1575 fIntFlowExtraCorrelationsPro->SetLabelOffset(0.01,"Y");
1576 // extra 2-p correlations:
1577 (fIntFlowExtraCorrelationsPro->GetXaxis())->SetBinLabel(1,"<<w1^3 w2 cos(n*(phi1-phi2))>>");
1578 (fIntFlowExtraCorrelationsPro->GetXaxis())->SetBinLabel(2,"<<w1 w2 w3^2 cos(n*(phi1-phi2))>>");
1579 fIntFlowProfiles->Add(fIntFlowExtraCorrelationsPro);
1580 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
1581 // average product of correlations <2>, <4>, <6> and <8>:
1582 TString intFlowProductOfCorrelationsProName = "fIntFlowProductOfCorrelationsPro";
1583 intFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
1584 fIntFlowProductOfCorrelationsPro = new TProfile(intFlowProductOfCorrelationsProName.Data(),"Average products of correlations",6,0,6);
1585 fIntFlowProductOfCorrelationsPro->SetTickLength(-0.01,"Y");
1586 fIntFlowProductOfCorrelationsPro->SetMarkerStyle(25);
1587 fIntFlowProductOfCorrelationsPro->SetLabelSize(0.05);
1588 fIntFlowProductOfCorrelationsPro->SetLabelOffset(0.01,"Y");
1589 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(1,"<<2><4>>");
1590 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(2,"<<2><6>>");
1591 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(3,"<<2><8>>");
1592 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(4,"<<4><6>>");
1593 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(5,"<<4><8>>");
1594 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(6,"<<6><8>>");
1595 fIntFlowProfiles->Add(fIntFlowProductOfCorrelationsPro);
1596 // average correction terms for non-uniform acceptance (with wrong errors!):
1597 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1599 TString intFlowCorrectionTermsForNUAProName = "fIntFlowCorrectionTermsForNUAPro";
1600 intFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
1601 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");
1602 fIntFlowCorrectionTermsForNUAPro[sc]->SetTickLength(-0.01,"Y");
1603 fIntFlowCorrectionTermsForNUAPro[sc]->SetMarkerStyle(25);
1604 fIntFlowCorrectionTermsForNUAPro[sc]->SetLabelSize(0.03);
1605 fIntFlowCorrectionTermsForNUAPro[sc]->SetLabelOffset(0.01,"Y");
1606 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(1,Form("<<%s(n(phi1))>>",sinCosFlag[sc].Data()));
1607 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(2,Form("<<%s(n(phi1+phi2))>>",sinCosFlag[sc].Data()));
1608 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(3,Form("<<%s(n(phi1-phi2-phi3))>>",sinCosFlag[sc].Data()));
1609 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(4,Form("<<%s(n(2phi1-phi2))>>",sinCosFlag[sc].Data()));
1610 fIntFlowProfiles->Add(fIntFlowCorrectionTermsForNUAPro[sc]);
1611 } // end of for(Int_t sc=0;sc<2;sc++)
1613 // d) Book histograms holding the final results:
1614 // average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with correct errors!):
1615 TString intFlowCorrelationsHistName = "fIntFlowCorrelationsHist";
1616 intFlowCorrelationsHistName += fAnalysisLabel->Data();
1617 fIntFlowCorrelationsHist = new TH1D(intFlowCorrelationsHistName.Data(),"Average correlations for all events",4,0,4);
1618 fIntFlowCorrelationsHist->SetTickLength(-0.01,"Y");
1619 fIntFlowCorrelationsHist->SetMarkerStyle(25);
1620 fIntFlowCorrelationsHist->SetLabelSize(0.06);
1621 fIntFlowCorrelationsHist->SetLabelOffset(0.01,"Y");
1622 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(1,"<<2>>");
1623 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(2,"<<4>>");
1624 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(3,"<<6>>");
1625 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(4,"<<8>>");
1626 fIntFlowResults->Add(fIntFlowCorrelationsHist);
1627 // average all correlations for all events (with correct errors!):
1628 TString intFlowCorrelationsAllHistName = "fIntFlowCorrelationsAllHist";
1629 intFlowCorrelationsAllHistName += fAnalysisLabel->Data();
1630 fIntFlowCorrelationsAllHist = new TH1D(intFlowCorrelationsAllHistName.Data(),"Average correlations for all events",32,0,32);
1631 fIntFlowCorrelationsAllHist->SetTickLength(-0.01,"Y");
1632 fIntFlowCorrelationsAllHist->SetMarkerStyle(25);
1633 fIntFlowCorrelationsAllHist->SetLabelSize(0.03);
1634 fIntFlowCorrelationsAllHist->SetLabelOffset(0.01,"Y");
1635 // 2-p correlations:
1636 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(1,"<<2>>_{n|n}");
1637 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(2,"<<2>>_{2n|2n}");
1638 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(3,"<<2>>_{3n|3n}");
1639 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(4,"<<2>>_{4n|4n}");
1640 // 3-p correlations:
1641 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(6,"<<3>>_{2n|n,n}");
1642 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(7,"<<3>>_{3n|2n,n}");
1643 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(8,"<<3>>_{4n|2n,2n}");
1644 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(9,"<<3>>_{4n|3n,n}");
1645 // 4-p correlations:
1646 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(11,"<<4>>_{n,n|n,n}");
1647 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(12,"<<4>>_{2n,n|2n,n}");
1648 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(13,"<<4>>_{2n,2n|2n,2n}");
1649 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(14,"<<4>>_{3n|n,n,n}");
1650 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(15,"<<4>>_{3n,n|3n,n}");
1651 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(16,"<<4>>_{3n,n|2n,2n}");
1652 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(17,"<<4>>_{4n|2n,n,n}");
1653 // 5-p correlations:
1654 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(19,"<<5>>_{2n|n,n,n,n}");
1655 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(20,"<<5>>_{2n,2n|2n,n,n}");
1656 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(21,"<<5>>_{3n,n|2n,n,n}");
1657 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(22,"<<5>>_{4n|n,n,n,n}");
1658 // 6-p correlations:
1659 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(24,"<<6>>_{n,n,n|n,n,n}");
1660 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(25,"<<6>>_{2n,n,n|2n,n,n}");
1661 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(26,"<<6>>_{2n,2n|n,n,n,n}");
1662 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(27,"<<6>>_{3n,n|n,n,n,n}");
1663 // 7-p correlations:
1664 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(29,"<<7>>_{2n,n,n|n,n,n,n}");
1665 // 8-p correlations:
1666 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(31,"<<8>>_{n,n,n,n|n,n,n,n}");
1667 fIntFlowResults->Add(fIntFlowCorrelationsAllHist);
1668 // average correction terms for non-uniform acceptance (with correct errors!):
1669 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1671 TString intFlowCorrectionTermsForNUAHistName = "fIntFlowCorrectionTermsForNUAHist";
1672 intFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
1673 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);
1674 fIntFlowCorrectionTermsForNUAHist[sc]->SetTickLength(-0.01,"Y");
1675 fIntFlowCorrectionTermsForNUAHist[sc]->SetMarkerStyle(25);
1676 fIntFlowCorrectionTermsForNUAHist[sc]->SetLabelSize(0.03);
1677 fIntFlowCorrectionTermsForNUAHist[sc]->SetLabelOffset(0.01,"Y");
1678 // .........................................................................
1680 (fIntFlowCorrectionTermsForNUAHist[sc]->GetXaxis())->SetBinLabel(1,Form("%s(n(#phi_{1}))>",sinCosFlag[sc].Data()));
1684 // .........................................................................
1685 fIntFlowResults->Add(fIntFlowCorrectionTermsForNUAHist[sc]);
1686 } // end of for(Int_t sc=0;sc<2;sc++)
1687 // covariances (multiplied with weight dependent prefactor):
1688 TString intFlowCovariancesName = "fIntFlowCovariances";
1689 intFlowCovariancesName += fAnalysisLabel->Data();
1690 fIntFlowCovariances = new TH1D(intFlowCovariancesName.Data(),"Covariances (multiplied with weight dependent prefactor)",6,0,6);
1691 fIntFlowCovariances->SetLabelSize(0.04);
1692 fIntFlowCovariances->SetMarkerStyle(25);
1693 (fIntFlowCovariances->GetXaxis())->SetBinLabel(1,"Cov(<2>,<4>)");
1694 (fIntFlowCovariances->GetXaxis())->SetBinLabel(2,"Cov(<2>,<6>)");
1695 (fIntFlowCovariances->GetXaxis())->SetBinLabel(3,"Cov(<2>,<8>)");
1696 (fIntFlowCovariances->GetXaxis())->SetBinLabel(4,"Cov(<4>,<6>)");
1697 (fIntFlowCovariances->GetXaxis())->SetBinLabel(5,"Cov(<4>,<8>)");
1698 (fIntFlowCovariances->GetXaxis())->SetBinLabel(6,"Cov(<6>,<8>)");
1699 fIntFlowResults->Add(fIntFlowCovariances);
1700 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8>:
1701 TString intFlowSumOfEventWeightsName = "fIntFlowSumOfEventWeights";
1702 intFlowSumOfEventWeightsName += fAnalysisLabel->Data();
1703 for(Int_t power=0;power<2;power++)
1705 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);
1706 fIntFlowSumOfEventWeights[power]->SetLabelSize(0.05);
1707 fIntFlowSumOfEventWeights[power]->SetMarkerStyle(25);
1710 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>}");
1711 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<4>}");
1712 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<6>}");
1713 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<8>}");
1714 } else if (power == 1)
1716 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>}^{2}");
1717 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<4>}^{2}");
1718 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<6>}^{2}");
1719 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<8>}^{2}");
1721 fIntFlowResults->Add(fIntFlowSumOfEventWeights[power]);
1723 // sum of products of event weights for correlations <2>, <4>, <6> and <8>:
1724 TString intFlowSumOfProductOfEventWeightsName = "fIntFlowSumOfProductOfEventWeights";
1725 intFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
1726 fIntFlowSumOfProductOfEventWeights = new TH1D(intFlowSumOfProductOfEventWeightsName.Data(),"Sum of product of event weights for correlations",6,0,6);
1727 fIntFlowSumOfProductOfEventWeights->SetLabelSize(0.05);
1728 fIntFlowSumOfProductOfEventWeights->SetMarkerStyle(25);
1729 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>} w_{<4>}");
1730 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<2>} w_{<6>}");
1731 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<2>} w_{<8>}");
1732 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<4>} w_{<6>}");
1733 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(5,"#sum_{i=1}^{N} w_{<4>} w_{<8>}");
1734 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(6,"#sum_{i=1}^{N} w_{<6>} w_{<8>}");
1735 fIntFlowResults->Add(fIntFlowSumOfProductOfEventWeights);
1736 // final results for integrated Q-cumulants:
1737 TString intFlowQcumulantsName = "fIntFlowQcumulants";
1738 intFlowQcumulantsName += fAnalysisLabel->Data();
1739 fIntFlowQcumulants = new TH1D(intFlowQcumulantsName.Data(),"Integrated Q-cumulants",4,0,4);
1740 fIntFlowQcumulants->SetLabelSize(0.05);
1741 fIntFlowQcumulants->SetMarkerStyle(25);
1742 (fIntFlowQcumulants->GetXaxis())->SetBinLabel(1,"QC{2}");
1743 (fIntFlowQcumulants->GetXaxis())->SetBinLabel(2,"QC{4}");
1744 (fIntFlowQcumulants->GetXaxis())->SetBinLabel(3,"QC{6}");
1745 (fIntFlowQcumulants->GetXaxis())->SetBinLabel(4,"QC{8}");
1746 fIntFlowResults->Add(fIntFlowQcumulants);
1747 // final integrated flow estimates from Q-cumulants:
1748 TString intFlowName = "fIntFlow";
1749 intFlowName += fAnalysisLabel->Data();
1750 // integrated flow from Q-cumulants:
1751 fIntFlow = new TH1D(intFlowName.Data(),"Integrated flow estimates from Q-cumulants",4,0,4);
1752 fIntFlow->SetLabelSize(0.05);
1753 fIntFlow->SetMarkerStyle(25);
1754 (fIntFlow->GetXaxis())->SetBinLabel(1,"v_{2}{2,QC}");
1755 (fIntFlow->GetXaxis())->SetBinLabel(2,"v_{2}{4,QC}");
1756 (fIntFlow->GetXaxis())->SetBinLabel(3,"v_{2}{6,QC}");
1757 (fIntFlow->GetXaxis())->SetBinLabel(4,"v_{2}{8,QC}");
1758 fIntFlowResults->Add(fIntFlow);
1760 /* // to be improved (removed):
1761 // final average weighted multi-particle correlations for all events calculated from Q-vectors
1762 fQCorrelations[1] = new TProfile("Weighted correlations","final average multi-particle correlations from weighted Q-vectors",200,0,200,"s");
1763 fQCorrelations[1]->SetTickLength(-0.01,"Y");
1764 fQCorrelations[1]->SetMarkerStyle(25);
1765 fQCorrelations[1]->SetLabelSize(0.03);
1766 fQCorrelations[1]->SetLabelOffset(0.01,"Y");
1767 // 2-particle correlations:
1768 (fQCorrelations[1]->GetXaxis())->SetBinLabel(1,"<w_{1}w_{2}cos(n(#phi_{1}-#phi_{2}))>");
1769 (fQCorrelations[1]->GetXaxis())->SetBinLabel(2,"<w_{1}^{2}w_{2}^{2}cos(2n(#phi_{1}-#phi_{2}))>");
1770 (fQCorrelations[1]->GetXaxis())->SetBinLabel(3,"<w_{1}^{3}w_{2}^{3}cos(3n(#phi_{1}-#phi_{2}))>");
1771 (fQCorrelations[1]->GetXaxis())->SetBinLabel(4,"<w_{1}^{4}w_{2}^{4}cos(4n(#phi_{1}-#phi_{2}))>");
1772 (fQCorrelations[1]->GetXaxis())->SetBinLabel(5,"<w_{1}^{3}w_{2}cos(n(#phi_{1}-#phi_{2}))>");
1773 (fQCorrelations[1]->GetXaxis())->SetBinLabel(6,"<w_{1}^{2}w_{2}w_{3}cos(n(#phi_{1}-#phi_{2}))>");
1774 // 3-particle correlations:
1775 (fQCorrelations[1]->GetXaxis())->SetBinLabel(21,"<w_{1}w_{2}w_{3}^{2}cos(n(2#phi_{1}-#phi_{2}-#phi_{3}))>");
1776 // 4-particle correlations:
1777 (fQCorrelations[1]->GetXaxis())->SetBinLabel(41,"<w_{1}w_{2}w_{3}w_{4}cos(n(#phi_{1}+#phi_{2}-#phi_{3}-#phi_{4}))>");
1778 // add fQCorrelations[1] to the list fIntFlowList:
1779 fIntFlowList->Add(fQCorrelations[1]);
1782 } // end of AliFlowAnalysisWithQCumulants::BookEverythingForIntegratedFlow()
1785 //================================================================================================================================
1788 void AliFlowAnalysisWithQCumulants::InitializeArraysForNestedLoops()
1790 // Initialize arrays of all objects relevant for calculations with nested loops.
1793 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1795 fIntFlowDirectCorrectionTermsForNUA[sc] = NULL;
1798 // differential flow:
1800 for(Int_t t=0;t<2;t++) // type: RP or POI
1802 for(Int_t pe=0;pe<2;pe++) // pt or eta
1804 for(Int_t ci=0;ci<4;ci++) // correlation index
1806 fDiffFlowDirectCorrelations[t][pe][ci] = NULL;
1807 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
1808 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
1809 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
1810 // correction terms for non-uniform acceptance:
1811 for(Int_t t=0;t<2;t++) // type: RP or POI
1813 for(Int_t pe=0;pe<2;pe++) // pt or eta
1815 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1817 for(Int_t cti=0;cti<9;cti++) // correction term index
1819 fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti] = NULL;
1822 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
1823 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
1826 } // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForNestedLoops()
1829 //================================================================================================================================
1832 void AliFlowAnalysisWithQCumulants::BookEverythingForNestedLoops()
1834 // Book all objects relevant for calculations with nested loops.
1836 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)
1837 TString typeFlag[2] = {"RP","POI"}; // to be improved (should I promote this to data members?)
1838 TString ptEtaFlag[2] = {"p_{T}","#eta"}; // to be improved (should I promote this to data members?)
1839 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"}; // to be improved (should I promote this to data members?)
1840 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
1841 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
1843 TString evaluateNestedLoopsName = "fEvaluateNestedLoops";
1844 evaluateNestedLoopsName += fAnalysisLabel->Data();
1845 fEvaluateNestedLoops = new TProfile(evaluateNestedLoopsName.Data(),"Flags for nested loops",4,0,4);
1846 fEvaluateNestedLoops->SetLabelSize(0.03);
1847 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(1,"fEvaluateIntFlowNestedLoops");
1848 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(2,"fEvaluateDiffFlowNestedLoops");
1849 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(3,"fCrossCheckInPtBinNo");
1850 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(4,"fCrossCheckInEtaBinNo");
1851 fEvaluateNestedLoops->Fill(0.5,(Int_t)fEvaluateIntFlowNestedLoops);
1852 fEvaluateNestedLoops->Fill(1.5,(Int_t)fEvaluateDiffFlowNestedLoops);
1853 fEvaluateNestedLoops->Fill(2.5,fCrossCheckInPtBinNo);
1854 fEvaluateNestedLoops->Fill(3.5,fCrossCheckInEtaBinNo);
1855 fNestedLoopsList->Add(fEvaluateNestedLoops);
1856 // nested loops for integrated flow:
1857 if(fEvaluateIntFlowNestedLoops)
1860 TString intFlowDirectCorrelationsName = "fIntFlowDirectCorrelations";
1861 intFlowDirectCorrelationsName += fAnalysisLabel->Data();
1862 fIntFlowDirectCorrelations = new TProfile(intFlowDirectCorrelationsName.Data(),"Multiparticle correlations calculated with nested loops (for int. flow)",32,0,32,"s");
1863 fNestedLoopsList->Add(fIntFlowDirectCorrelations);
1864 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
1866 TString intFlowExtraDirectCorrelationsName = "fIntFlowExtraDirectCorrelations";
1867 intFlowExtraDirectCorrelationsName += fAnalysisLabel->Data();
1868 fIntFlowExtraDirectCorrelations = new TProfile(intFlowExtraDirectCorrelationsName.Data(),"Extra multiparticle correlations calculated with nested loops (for int. flow)",100,0,100,"s");
1869 fNestedLoopsList->Add(fIntFlowExtraDirectCorrelations);
1870 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
1871 // correction terms for non-uniform acceptance:
1872 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1874 TString intFlowDirectCorrectionTermsForNUAName = "fIntFlowDirectCorrectionTermsForNUA";
1875 intFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
1876 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");
1877 fNestedLoopsList->Add(fIntFlowDirectCorrectionTermsForNUA[sc]);
1878 } // end of for(Int_t sc=0;sc<2;sc++)
1879 } // end of if(fEvaluateIntFlowNestedLoops)
1881 // nested loops for differential flow:
1882 if(fEvaluateDiffFlowNestedLoops)
1884 // reduced correlations:
1885 TString diffFlowDirectCorrelationsName = "fDiffFlowDirectCorrelations";
1886 diffFlowDirectCorrelationsName += fAnalysisLabel->Data();
1887 for(Int_t t=0;t<2;t++) // type: RP or POI
1889 for(Int_t pe=0;pe<2;pe++) // pt or eta
1891 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
1893 // reduced correlations:
1894 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");
1895 fDiffFlowDirectCorrelations[t][pe][rci]->SetXTitle(ptEtaFlag[pe].Data());
1896 fNestedLoopsList->Add(fDiffFlowDirectCorrelations[t][pe][rci]); // to be improved (add dedicated list to hold reduced correlations)
1897 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
1898 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
1899 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
1900 // correction terms for non-uniform acceptance:
1901 TString diffFlowDirectCorrectionTermsForNUAName = "fDiffFlowDirectCorrectionTermsForNUA";
1902 diffFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
1903 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
1905 for(Int_t pe=0;pe<2;pe++) // pt or eta
1907 for(Int_t sc=0;sc<2;sc++) // sin or cos
1909 for(Int_t cti=0;cti<9;cti++) // correction term index
1911 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");
1912 fNestedLoopsList->Add(fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti]);
1917 // number of RPs and POIs in selected pt and eta bins for cross-checkings:
1918 TString noOfParticlesInBinName = "fNoOfParticlesInBin";
1919 fNoOfParticlesInBin = new TH1D(noOfParticlesInBinName.Data(),"Number of RPs and POIs in selected p_{T} and #eta bin",4,0,4);
1920 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(1,"# of RPs in p_{T} bin");
1921 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(2,"# of RPs in #eta bin");
1922 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(3,"# of POIs in p_{T} bin");
1923 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(4,"# of POIs in #eta bin");
1924 fNestedLoopsList->Add(fNoOfParticlesInBin);
1925 } // end of if(fEvaluateDiffFlowNestedLoops)
1927 } // end of AliFlowAnalysisWithQCumulants::BookEverythingForNestedLoops()
1930 //================================================================================================================================
1933 void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelations()
1935 // calculate all correlations needed for integrated flow
1938 Double_t dMult = (*fSMpk)(0,0);
1940 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
1941 Double_t dReQ1n = (*fReQ)(0,0);
1942 Double_t dReQ2n = (*fReQ)(1,0);
1943 Double_t dReQ3n = (*fReQ)(2,0);
1944 Double_t dReQ4n = (*fReQ)(3,0);
1945 Double_t dImQ1n = (*fImQ)(0,0);
1946 Double_t dImQ2n = (*fImQ)(1,0);
1947 Double_t dImQ3n = (*fImQ)(2,0);
1948 Double_t dImQ4n = (*fImQ)(3,0);
1950 // real and imaginary parts of some expressions involving various combinations of Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
1951 // (these expression appear in the Eqs. for the multi-particle correlations bellow)
1953 // Re[Q_{2n} Q_{n}^* Q_{n}^*]
1954 Double_t reQ2nQ1nstarQ1nstar = pow(dReQ1n,2.)*dReQ2n + 2.*dReQ1n*dImQ1n*dImQ2n - pow(dImQ1n,2.)*dReQ2n;
1956 // Im[Q_{2n} Q_{n}^* Q_{n}^*]
1957 //Double_t imQ2nQ1nstarQ1nstar = pow(dReQ1n,2.)*dImQ2n-2.*dReQ1n*dImQ1n*dReQ2n-pow(dImQ1n,2.)*dImQ2n;
1959 // Re[Q_{n} Q_{n} Q_{2n}^*] = Re[Q_{2n} Q_{n}^* Q_{n}^*]
1960 Double_t reQ1nQ1nQ2nstar = reQ2nQ1nstarQ1nstar;
1962 // Re[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]
1963 Double_t reQ3nQ1nQ2nstarQ2nstar = (pow(dReQ2n,2.)-pow(dImQ2n,2.))*(dReQ3n*dReQ1n-dImQ3n*dImQ1n)
1964 + 2.*dReQ2n*dImQ2n*(dReQ3n*dImQ1n+dImQ3n*dReQ1n);
1966 // Im[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]
1967 //Double_t imQ3nQ1nQ2nstarQ2nstar = calculate and implement this (deleteMe)
1969 // Re[Q_{2n} Q_{2n} Q_{3n}^* Q_{1n}^*] = Re[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]
1970 Double_t reQ2nQ2nQ3nstarQ1nstar = reQ3nQ1nQ2nstarQ2nstar;
1972 // Re[Q_{4n} Q_{2n}^* Q_{2n}^*]
1973 Double_t reQ4nQ2nstarQ2nstar = pow(dReQ2n,2.)*dReQ4n+2.*dReQ2n*dImQ2n*dImQ4n-pow(dImQ2n,2.)*dReQ4n;
1975 // Im[Q_{4n} Q_{2n}^* Q_{2n}^*]
1976 //Double_t imQ4nQ2nstarQ2nstar = calculate and implement this (deleteMe)
1978 // Re[Q_{2n} Q_{2n} Q_{4n}^*] = Re[Q_{4n} Q_{2n}^* Q_{2n}^*]
1979 Double_t reQ2nQ2nQ4nstar = reQ4nQ2nstarQ2nstar;
1981 // Re[Q_{4n} Q_{3n}^* Q_{n}^*]
1982 Double_t reQ4nQ3nstarQ1nstar = dReQ4n*(dReQ3n*dReQ1n-dImQ3n*dImQ1n)+dImQ4n*(dReQ3n*dImQ1n+dImQ3n*dReQ1n);
1984 // Re[Q_{3n} Q_{n} Q_{4n}^*] = Re[Q_{4n} Q_{3n}^* Q_{n}^*]
1985 Double_t reQ3nQ1nQ4nstar = reQ4nQ3nstarQ1nstar;
1987 // Im[Q_{4n} Q_{3n}^* Q_{n}^*]
1988 //Double_t imQ4nQ3nstarQ1nstar = calculate and implement this (deleteMe)
1990 // Re[Q_{3n} Q_{2n}^* Q_{n}^*]
1991 Double_t reQ3nQ2nstarQ1nstar = dReQ3n*dReQ2n*dReQ1n-dReQ3n*dImQ2n*dImQ1n+dImQ3n*dReQ2n*dImQ1n
1992 + dImQ3n*dImQ2n*dReQ1n;
1994 // Re[Q_{2n} Q_{n} Q_{3n}^*] = Re[Q_{3n} Q_{2n}^* Q_{n}^*]
1995 Double_t reQ2nQ1nQ3nstar = reQ3nQ2nstarQ1nstar;
1997 // Im[Q_{3n} Q_{2n}^* Q_{n}^*]
1998 //Double_t imQ3nQ2nstarQ1nstar; //calculate and implement this (deleteMe)
2000 // Re[Q_{3n} Q_{n}^* Q_{n}^* Q_{n}^*]
2001 Double_t reQ3nQ1nstarQ1nstarQ1nstar = dReQ3n*pow(dReQ1n,3)-3.*dReQ1n*dReQ3n*pow(dImQ1n,2)
2002 + 3.*dImQ1n*dImQ3n*pow(dReQ1n,2)-dImQ3n*pow(dImQ1n,3);
2004 // Im[Q_{3n} Q_{n}^* Q_{n}^* Q_{n}^*]
2005 //Double_t imQ3nQ1nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)
2007 // |Q_{2n}|^2 |Q_{n}|^2
2008 Double_t dQ2nQ1nQ2nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.));
2010 // Re[Q_{4n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2011 Double_t reQ4nQ2nstarQ1nstarQ1nstar = (dReQ4n*dReQ2n+dImQ4n*dImQ2n)*(pow(dReQ1n,2)-pow(dImQ1n,2))
2012 + 2.*dReQ1n*dImQ1n*(dImQ4n*dReQ2n-dReQ4n*dImQ2n);
2014 // Im[Q_{4n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2015 //Double_t imQ4nQ2nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)
2017 // Re[Q_{2n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^*]
2018 Double_t reQ2nQ1nQ1nstarQ1nstarQ1nstar = (dReQ2n*dReQ1n-dImQ2n*dImQ1n)*(pow(dReQ1n,3)-3.*dReQ1n*pow(dImQ1n,2))
2019 + (dReQ2n*dImQ1n+dReQ1n*dImQ2n)*(3.*dImQ1n*pow(dReQ1n,2)-pow(dImQ1n,3));
2021 // Im[Q_{2n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^*]
2022 //Double_t imQ2nQ1nQ1nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)
2024 // Re[Q_{2n} Q_{2n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2025 Double_t reQ2nQ2nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))
2026 * (dReQ2n*(pow(dReQ1n,2.)-pow(dImQ1n,2.)) + 2.*dImQ2n*dReQ1n*dImQ1n);
2028 // Im[Q_{2n} Q_{2n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2029 //Double_t imQ2nQ2nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))
2030 // * (dImQ2n*(pow(dReQ1n,2.)-pow(dImQ1n,2.)) - 2.*dReQ2n*dReQ1n*dImQ1n);
2032 // Re[Q_{4n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2033 Double_t reQ4nQ1nstarQ1nstarQ1nstarQ1nstar = pow(dReQ1n,4.)*dReQ4n-6.*pow(dReQ1n,2.)*dReQ4n*pow(dImQ1n,2.)
2034 + pow(dImQ1n,4.)*dReQ4n+4.*pow(dReQ1n,3.)*dImQ1n*dImQ4n
2035 - 4.*pow(dImQ1n,3.)*dReQ1n*dImQ4n;
2037 // Im[Q_{4n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2038 //Double_t imQ4nQ1nstarQ1nstarQ1nstarQ1nstar = pow(dReQ1n,4.)*dImQ4n-6.*pow(dReQ1n,2.)*dImQ4n*pow(dImQ1n,2.)
2039 // + pow(dImQ1n,4.)*dImQ4n+4.*pow(dImQ1n,3.)*dReQ1n*dReQ4n
2040 // - 4.*pow(dReQ1n,3.)*dImQ1n*dReQ4n;
2042 // Re[Q_{3n} Q_{n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2043 Double_t reQ3nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
2044 * (dReQ1n*dReQ2n*dReQ3n-dReQ3n*dImQ1n*dImQ2n+dReQ2n*dImQ1n*dImQ3n+dReQ1n*dImQ2n*dImQ3n);
2046 // Im[Q_{3n} Q_{n} Q_{2n}^* Q_{n}^* Q_{n}^*]
2047 //Double_t imQ3nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
2048 // * (-dReQ2n*dReQ3n*dImQ1n-dReQ1n*dReQ3n*dImQ2n+dReQ1n*dReQ2n*dImQ3n-dImQ1n*dImQ2n*dImQ3n);
2051 // Re[Q_{2n} Q_{2n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2052 Double_t reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)*dReQ2n-2.*dReQ1n*dReQ2n*dImQ1n-dReQ2n*pow(dImQ1n,2.)
2053 + dImQ2n*pow(dReQ1n,2.)+2.*dReQ1n*dImQ1n*dImQ2n-pow(dImQ1n,2.)*dImQ2n)
2054 * (pow(dReQ1n,2.)*dReQ2n+2.*dReQ1n*dReQ2n*dImQ1n-dReQ2n*pow(dImQ1n,2.)
2055 - dImQ2n*pow(dReQ1n,2.)+2.*dReQ1n*dImQ1n*dImQ2n+pow(dImQ1n,2.)*dImQ2n);
2057 // Im[Q_{2n} Q_{2n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2058 //Double_t imQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar = 2.*(pow(dReQ1n,2.)*dReQ2n-dReQ2n*pow(dImQ1n,2.)
2059 // + 2.*dReQ1n*dImQ1n*dImQ2n)*(pow(dReQ1n,2.)*dImQ2n
2060 // - 2.*dReQ1n*dImQ1n*dReQ2n-pow(dImQ1n,2.)*dImQ2n);
2062 // Re[Q_{3n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2063 Double_t reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
2064 * (pow(dReQ1n,3.)*dReQ3n-3.*dReQ1n*dReQ3n*pow(dImQ1n,2.)
2065 + 3.*pow(dReQ1n,2.)*dImQ1n*dImQ3n-pow(dImQ1n,3.)*dImQ3n);
2067 // Im[Q_{3n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2068 //Double_t imQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
2069 // * (pow(dImQ1n,3.)*dReQ3n-3.*dImQ1n*dReQ3n*pow(dReQ1n,2.)
2070 // - 3.*pow(dImQ1n,2.)*dReQ1n*dImQ3n+pow(dReQ1n,3.)*dImQ3n);
2072 // |Q_{2n}|^2 |Q_{n}|^4
2073 Double_t dQ2nQ1nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))*pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.);
2075 // Re[Q_{2n} Q_{n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2076 Double_t reQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
2077 * (pow(dReQ1n,2.)*dReQ2n-dReQ2n*pow(dImQ1n,2.)
2078 + 2.*dReQ1n*dImQ1n*dImQ2n);
2080 // Im[Q_{2n} Q_{n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
2081 //Double_t imQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
2082 // * (pow(dReQ1n,2.)*dImQ2n-dImQ2n*pow(dImQ1n,2.)
2083 // - 2.*dReQ1n*dReQ2n*dImQ1n);
2088 // **************************************
2089 // **** multi-particle correlations: ****
2090 // **************************************
2092 // Remark 1: multi-particle correlations calculated with non-weighted Q-vectors are stored in 1D profile fQCorrelations[0]. // to be improved (wrong profiles)
2093 // Remark 2: binning of fQCorrelations[0] is organized as follows: // to be improved (wrong profiles)
2094 // --------------------------------------------------------------------------------------------------------------------
2095 // 1st bin: <2>_{1n|1n} = two1n1n = cos(n*(phi1-phi2))>
2096 // 2nd bin: <2>_{2n|2n} = two2n2n = cos(2n*(phi1-phi2))>
2097 // 3rd bin: <2>_{3n|3n} = two3n3n = cos(3n*(phi1-phi2))>
2098 // 4th bin: <2>_{4n|4n} = two4n4n = cos(4n*(phi1-phi2))>
2099 // 5th bin: ---- EMPTY ----
2100 // 6th bin: <3>_{2n|1n,1n} = three2n1n1n = <cos(n*(2.*phi1-phi2-phi3))>
2101 // 7th bin: <3>_{3n|2n,1n} = three3n2n1n = <cos(n*(3.*phi1-2.*phi2-phi3))>
2102 // 8th bin: <3>_{4n|2n,2n} = three4n2n2n = <cos(n*(4.*phi1-2.*phi2-2.*phi3))>
2103 // 9th bin: <3>_{4n|3n,1n} = three4n3n1n = <cos(n*(4.*phi1-3.*phi2-phi3))>
2104 // 10th bin: ---- EMPTY ----
2105 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1n = <cos(n*(phi1+phi2-phi3-phi4))>
2106 // 12th bin: <4>_{2n,1n|2n,1n} = four2n1n2n1n = <cos(2.*n*(phi1+phi2-phi3-phi4))>
2107 // 13th bin: <4>_{2n,2n|2n,2n} = four2n2n2n2n = <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>
2108 // 14th bin: <4>_{3n|1n,1n,1n} = four3n1n1n1n = <cos(n*(3.*phi1-phi2-phi3-phi4))>
2109 // 15th bin: <4>_{3n,1n|3n,1n} = four3n1n3n1n = <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>
2110 // 16th bin: <4>_{3n,1n|2n,2n} = four3n1n2n2n = <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>
2111 // 17th bin: <4>_{4n|2n,1n,1n} = four4n2n1n1n = <cos(n*(3.*phi1+phi2-3.*phi3-phi4))>
2112 // 18th bin: ---- EMPTY ----
2113 // 19th bin: <5>_{2n|1n,1n,1n,1n} = five2n1n1n1n1n = <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>
2114 // 20th bin: <5>_{2n,2n|2n,1n,1n} = five2n2n2n1n1n = <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>
2115 // 21st bin: <5>_{3n,1n|2n,1n,1n} = five3n1n2n1n1n = <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>
2116 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = five4n1n1n1n1n = <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>
2117 // 23rd bin: ---- EMPTY ----
2118 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = six1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
2119 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = six2n1n1n2n1n1n = <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>
2120 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = six2n2n1n1n1n1n = <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>
2121 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = six3n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>
2122 // 28th bin: ---- EMPTY ----
2123 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = seven2n1n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
2124 // 30th bin: ---- EMPTY ----
2125 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = eight1n1n1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
2126 // --------------------------------------------------------------------------------------------------------------------
2129 Double_t two1n1n = 0.; // <cos(n*(phi1-phi2))>
2130 Double_t two2n2n = 0.; // <cos(2n*(phi1-phi2))>
2131 Double_t two3n3n = 0.; // <cos(3n*(phi1-phi2))>
2132 Double_t two4n4n = 0.; // <cos(4n*(phi1-phi2))>
2136 two1n1n = (pow(dReQ1n,2.)+pow(dImQ1n,2.)-dMult)/(dMult*(dMult-1.));
2137 two2n2n = (pow(dReQ2n,2.)+pow(dImQ2n,2.)-dMult)/(dMult*(dMult-1.));
2138 two3n3n = (pow(dReQ3n,2.)+pow(dImQ3n,2.)-dMult)/(dMult*(dMult-1.));
2139 two4n4n = (pow(dReQ4n,2.)+pow(dImQ4n,2.)-dMult)/(dMult*(dMult-1.));
2141 // average 2-particle correlations for single event:
2142 fIntFlowCorrelationsAllEBE->SetBinContent(1,two1n1n);
2143 fIntFlowCorrelationsAllEBE->SetBinContent(2,two2n2n);
2144 fIntFlowCorrelationsAllEBE->SetBinContent(3,two3n3n);
2145 fIntFlowCorrelationsAllEBE->SetBinContent(4,two4n4n);
2147 // average 2-particle correlations for all events:
2148 fIntFlowCorrelationsAllPro->Fill(0.5,two1n1n,dMult*(dMult-1.));
2149 fIntFlowCorrelationsAllPro->Fill(1.5,two2n2n,dMult*(dMult-1.));
2150 fIntFlowCorrelationsAllPro->Fill(2.5,two3n3n,dMult*(dMult-1.));
2151 fIntFlowCorrelationsAllPro->Fill(3.5,two4n4n,dMult*(dMult-1.));
2153 // store separetately <2> (to be improved: do I really need this?)
2154 fIntFlowCorrelationsEBE->SetBinContent(1,two1n1n); // <2>
2156 // to be improved (this can be implemented better):
2157 Double_t mWeight2p = 0.;
2158 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
2160 mWeight2p = dMult*(dMult-1.);
2161 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
2164 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2169 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(1,mWeight2p); // eW_<2>
2170 fIntFlowCorrelationsPro->Fill(0.5,two1n1n,mWeight2p);
2172 // distribution of <cos(n*(phi1-phi2))>:
2173 //f2pDistribution->Fill(two1n1n,dMult*(dMult-1.));
2174 } // end of if(dMult>1)
2177 Double_t three2n1n1n = 0.; // <cos(n*(2.*phi1-phi2-phi3))>
2178 Double_t three3n2n1n = 0.; // <cos(n*(3.*phi1-2.*phi2-phi3))>
2179 Double_t three4n2n2n = 0.; // <cos(n*(4.*phi1-2.*phi2-2.*phi3))>
2180 Double_t three4n3n1n = 0.; // <cos(n*(4.*phi1-3.*phi2-phi3))>
2184 three2n1n1n = (reQ2nQ1nstarQ1nstar-2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
2185 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))+2.*dMult)
2186 / (dMult*(dMult-1.)*(dMult-2.));
2187 three3n2n1n = (reQ3nQ2nstarQ1nstar-(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2188 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))
2189 - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)
2190 / (dMult*(dMult-1.)*(dMult-2.));
2191 three4n2n2n = (reQ4nQ2nstarQ2nstar-2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2192 - (pow(dReQ4n,2.)+pow(dImQ4n,2.))+2.*dMult)
2193 / (dMult*(dMult-1.)*(dMult-2.));
2194 three4n3n1n = (reQ4nQ3nstarQ1nstar-(pow(dReQ4n,2.)+pow(dImQ4n,2.))
2195 - (pow(dReQ3n,2.)+pow(dImQ3n,2.))
2196 - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)
2197 / (dMult*(dMult-1.)*(dMult-2.));
2199 // average 3-particle correlations for single event:
2200 fIntFlowCorrelationsAllEBE->SetBinContent(6,three2n1n1n);
2201 fIntFlowCorrelationsAllEBE->SetBinContent(7,three3n2n1n);
2202 fIntFlowCorrelationsAllEBE->SetBinContent(8,three4n2n2n);
2203 fIntFlowCorrelationsAllEBE->SetBinContent(9,three4n3n1n);
2205 // average 3-particle correlations for all events:
2206 fIntFlowCorrelationsAllPro->Fill(5.5,three2n1n1n,dMult*(dMult-1.)*(dMult-2.));
2207 fIntFlowCorrelationsAllPro->Fill(6.5,three3n2n1n,dMult*(dMult-1.)*(dMult-2.));
2208 fIntFlowCorrelationsAllPro->Fill(7.5,three4n2n2n,dMult*(dMult-1.)*(dMult-2.));
2209 fIntFlowCorrelationsAllPro->Fill(8.5,three4n3n1n,dMult*(dMult-1.)*(dMult-2.));
2210 } // end of if(dMult>2)
2213 Double_t four1n1n1n1n = 0.; // <cos(n*(phi1+phi2-phi3-phi4))>
2214 Double_t four2n2n2n2n = 0.; // <cos(2.*n*(phi1+phi2-phi3-phi4))>
2215 Double_t four2n1n2n1n = 0.; // <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>
2216 Double_t four3n1n1n1n = 0.; // <cos(n*(3.*phi1-phi2-phi3-phi4))>
2217 Double_t four4n2n1n1n = 0.; // <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>
2218 Double_t four3n1n2n2n = 0.; // <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>
2219 Double_t four3n1n3n1n = 0.; // <cos(n*(3.*phi1+phi2-3.*phi3-phi4))>
2223 four1n1n1n1n = (2.*dMult*(dMult-3.)+pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)-4.*(dMult-2.)*(pow(dReQ1n,2.)
2224 + pow(dImQ1n,2.))-2.*reQ2nQ1nstarQ1nstar+(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
2225 / (dMult*(dMult-1)*(dMult-2.)*(dMult-3.));
2226 four2n2n2n2n = (2.*dMult*(dMult-3.)+pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)-4.*(dMult-2.)*(pow(dReQ2n,2.)
2227 + pow(dImQ2n,2.))-2.*reQ4nQ2nstarQ2nstar+(pow(dReQ4n,2.)+pow(dImQ4n,2.)))
2228 / (dMult*(dMult-1)*(dMult-2.)*(dMult-3.));
2229 four2n1n2n1n = (dQ2nQ1nQ2nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar-2.*reQ2nQ1nstarQ1nstar)
2230 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2231 - ((dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
2232 + (dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-(pow(dReQ3n,2.)+pow(dImQ3n,2.)))
2233 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2234 + (dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.));
2235 four3n1n1n1n = (reQ3nQ1nstarQ1nstarQ1nstar-3.*reQ3nQ2nstarQ1nstar-3.*reQ2nQ1nstarQ1nstar)
2236 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2237 + (2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+3.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2238 + 6.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-6.*dMult)
2239 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2240 four4n2n1n1n = (reQ4nQ2nstarQ1nstarQ1nstar-2.*reQ4nQ3nstarQ1nstar-reQ4nQ2nstarQ2nstar-2.*reQ3nQ2nstarQ1nstar)
2241 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2242 - (reQ2nQ1nstarQ1nstar-2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2243 - 3.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2244 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2245 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
2246 four3n1n2n2n = (reQ3nQ1nQ2nstarQ2nstar-reQ4nQ2nstarQ2nstar-reQ3nQ1nQ4nstar-2.*reQ3nQ2nstarQ1nstar)
2247 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2248 - (2.*reQ1nQ1nQ2nstar-(pow(dReQ4n,2.)+pow(dImQ4n,2.))-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2249 - 4.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2250 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2251 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
2252 four3n1n3n1n = ((pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
2253 - 2.*reQ4nQ3nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar)
2254 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2255 + ((pow(dReQ4n,2.)+pow(dImQ4n,2.))-(dMult-4.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2256 + (pow(dReQ2n,2.)+pow(dImQ2n,2.))-(dMult-4.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2257 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
2258 + (dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.));
2260 // average 4-particle correlations for single event:
2261 fIntFlowCorrelationsAllEBE->SetBinContent(11,four1n1n1n1n);
2262 fIntFlowCorrelationsAllEBE->SetBinContent(12,four2n1n2n1n);
2263 fIntFlowCorrelationsAllEBE->SetBinContent(13,four2n2n2n2n);
2264 fIntFlowCorrelationsAllEBE->SetBinContent(14,four3n1n1n1n);
2265 fIntFlowCorrelationsAllEBE->SetBinContent(15,four3n1n3n1n);
2266 fIntFlowCorrelationsAllEBE->SetBinContent(16,four3n1n2n2n);
2267 fIntFlowCorrelationsAllEBE->SetBinContent(17,four4n2n1n1n);
2269 // average 4-particle correlations for all events:
2270 fIntFlowCorrelationsAllPro->Fill(10.5,four1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2271 fIntFlowCorrelationsAllPro->Fill(11.5,four2n1n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2272 fIntFlowCorrelationsAllPro->Fill(12.5,four2n2n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2273 fIntFlowCorrelationsAllPro->Fill(13.5,four3n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2274 fIntFlowCorrelationsAllPro->Fill(14.5,four3n1n3n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2275 fIntFlowCorrelationsAllPro->Fill(15.5,four3n1n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2276 fIntFlowCorrelationsAllPro->Fill(16.5,four4n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2278 // store separetately <4> (to be improved: do I really need this?)
2279 fIntFlowCorrelationsEBE->SetBinContent(2,four1n1n1n1n); // <4>
2281 // to be improved (this can be implemented better):
2282 Double_t mWeight4p = 0.;
2283 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
2285 mWeight4p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.);
2286 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
2289 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2294 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(2,mWeight4p); // eW_<4>
2295 fIntFlowCorrelationsPro->Fill(1.5,four1n1n1n1n,mWeight4p);
2297 // distribution of <cos(n*(phi1+phi2-phi3-phi4))>
2298 //f4pDistribution->Fill(four1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
2300 } // end of if(dMult>3)
2303 Double_t five2n1n1n1n1n = 0.; // <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>
2304 Double_t five2n2n2n1n1n = 0.; // <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>
2305 Double_t five3n1n2n1n1n = 0.; // <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>
2306 Double_t five4n1n1n1n1n = 0.; // <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>
2310 five2n1n1n1n1n = (reQ2nQ1nQ1nstarQ1nstarQ1nstar-reQ3nQ1nstarQ1nstarQ1nstar+6.*reQ3nQ2nstarQ1nstar)
2311 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2312 - (reQ2nQ1nQ3nstar+3.*(dMult-6.)*reQ2nQ1nstarQ1nstar+3.*reQ1nQ1nQ2nstar)
2313 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2314 - (2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2315 + 3.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2316 - 3.*(dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
2317 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2318 - 3.*(pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
2319 - 2.*(2*dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult*(dMult-4.))
2320 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2322 five2n2n2n1n1n = (reQ2nQ2nQ2nstarQ1nstarQ1nstar-reQ4nQ2nstarQ1nstarQ1nstar-2.*reQ2nQ2nQ3nstarQ1nstar)
2323 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2324 + 2.*(reQ4nQ2nstarQ2nstar+4.*reQ3nQ2nstarQ1nstar+reQ3nQ1nQ4nstar)
2325 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2326 + (reQ2nQ2nQ4nstar-2.*(dMult-5.)*reQ2nQ1nstarQ1nstar+2.*reQ1nQ1nQ2nstar)
2327 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2328 - (2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+4.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2329 + 1.*pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)
2330 - 2.*(3.*dMult-10.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
2331 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2332 - (4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2333 - 4.*(dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))+4.*dMult*(dMult-6.))
2334 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2336 five4n1n1n1n1n = (reQ4nQ1nstarQ1nstarQ1nstarQ1nstar-6.*reQ4nQ2nstarQ1nstarQ1nstar-4.*reQ3nQ1nstarQ1nstarQ1nstar)
2337 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2338 + (8.*reQ4nQ3nstarQ1nstar+3.*reQ4nQ2nstarQ2nstar+12.*reQ3nQ2nstarQ1nstar+12.*reQ2nQ1nstarQ1nstar)
2339 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2340 - (6.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+8.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2341 + 12.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))+24.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-24.*dMult)
2342 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2344 five3n1n2n1n1n = (reQ3nQ1nQ2nstarQ1nstarQ1nstar-reQ4nQ2nstarQ1nstarQ1nstar-reQ3nQ1nstarQ1nstarQ1nstar)
2345 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2346 - (reQ3nQ1nQ2nstarQ2nstar-3.*reQ4nQ3nstarQ1nstar-reQ4nQ2nstarQ2nstar)
2347 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2348 - ((2.*dMult-13.)*reQ3nQ2nstarQ1nstar-reQ3nQ1nQ4nstar-9.*reQ2nQ1nstarQ1nstar)
2349 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2350 - (2.*reQ1nQ1nQ2nstar+2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
2351 - 2.*(dMult-5.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+2.*(pow(dReQ3n,2.)
2352 + pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2353 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2354 + (2.*(dMult-6.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2355 - 2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
2356 - pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
2357 + 2.*(3.*dMult-11.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2358 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
2359 - 4.*(dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2361 // average 5-particle correlations for single event:
2362 fIntFlowCorrelationsAllEBE->SetBinContent(19,five2n1n1n1n1n);
2363 fIntFlowCorrelationsAllEBE->SetBinContent(20,five2n2n2n1n1n);
2364 fIntFlowCorrelationsAllEBE->SetBinContent(21,five3n1n2n1n1n);
2365 fIntFlowCorrelationsAllEBE->SetBinContent(22,five4n1n1n1n1n);
2367 // average 5-particle correlations for all events:
2368 fIntFlowCorrelationsAllPro->Fill(18.5,five2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2369 fIntFlowCorrelationsAllPro->Fill(19.5,five2n2n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2370 fIntFlowCorrelationsAllPro->Fill(20.5,five3n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2371 fIntFlowCorrelationsAllPro->Fill(21.5,five4n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
2372 } // end of if(dMult>4)
2375 Double_t six1n1n1n1n1n1n = 0.; // <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
2376 Double_t six2n2n1n1n1n1n = 0.; // <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>
2377 Double_t six3n1n1n1n1n1n = 0.; // <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>
2378 Double_t six2n1n1n2n1n1n = 0.; // <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>
2382 six1n1n1n1n1n1n = (pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),3.)+9.*dQ2nQ1nQ2nstarQ1nstar-6.*reQ2nQ1nQ1nstarQ1nstarQ1nstar)
2383 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))
2384 + 4.*(reQ3nQ1nstarQ1nstarQ1nstar-3.*reQ3nQ2nstarQ1nstar)
2385 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))
2386 + 2.*(9.*(dMult-4.)*reQ2nQ1nstarQ1nstar+2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.)))
2387 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))
2388 - 9.*(pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)+(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
2389 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-5.))
2390 + (18.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
2391 / (dMult*(dMult-1)*(dMult-3)*(dMult-4))
2392 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
2394 six2n1n1n2n1n1n = (dQ2nQ1nQ1nQ2nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)
2395 * (2.*five2n2n2n1n1n+4.*five2n1n1n1n1n+4.*five3n1n2n1n1n+4.*four2n1n2n1n+1.*four1n1n1n1n)
2396 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four1n1n1n1n+4.*two1n1n
2397 + 2.*three2n1n1n+2.*three2n1n1n+4.*four3n1n1n1n+8.*three2n1n1n+2.*four4n2n1n1n
2398 + 4.*four2n1n2n1n+2.*two2n2n+8.*four2n1n2n1n+4.*four3n1n3n1n+8.*three3n2n1n
2399 + 4.*four3n1n2n2n+4.*four1n1n1n1n+4.*four2n1n2n1n+1.*four2n2n2n2n)
2400 - dMult*(dMult-1.)*(dMult-2.)*(2.*three2n1n1n+8.*two1n1n+4.*two1n1n+2.
2401 + 4.*two1n1n+4.*three2n1n1n+2.*two2n2n+4.*three2n1n1n+8.*three3n2n1n
2402 + 8.*two2n2n+4.*three4n3n1n+4.*two3n3n+4.*three3n2n1n+4.*two1n1n
2403 + 8.*three2n1n1n+4.*two1n1n+4.*three3n2n1n+4.*three2n1n1n+2.*two2n2n
2404 + 4.*three3n2n1n+2.*three4n2n2n)-dMult*(dMult-1.)
2405 * (4.*two1n1n+4.+4.*two1n1n+2.*two2n2n+1.+4.*two1n1n+4.*two2n2n+4.*two3n3n
2406 + 1.+2.*two2n2n+1.*two4n4n)-dMult)
2407 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)
2409 six2n2n1n1n1n1n = (reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)
2410 * (five4n1n1n1n1n+8.*five2n1n1n1n1n+6.*five2n2n2n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)
2411 * (4.*four3n1n1n1n+6.*four4n2n1n1n+12.*three2n1n1n+12.*four1n1n1n1n+24.*four2n1n2n1n
2412 + 4.*four3n1n2n2n+3.*four2n2n2n2n)-dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+12.*three3n2n1n
2413 + 4.*three4n3n1n+3.*three4n2n2n+8.*three2n1n1n+24.*two1n1n+12.*two2n2n+12.*three2n1n1n+8.*three3n2n1n
2414 + 1.*three4n2n2n)-dMult*(dMult-1.)*(4.*two1n1n+6.*two2n2n+4.*two3n3n+1.*two4n4n+2.*two2n2n+8.*two1n1n+6.)-dMult)
2415 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)
2417 six3n1n1n1n1n1n = (reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)
2418 * (five4n1n1n1n1n+4.*five2n1n1n1n1n+6.*five3n1n2n1n1n+4.*four3n1n1n1n)
2419 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four3n1n1n1n+6.*four4n2n1n1n+6.*four1n1n1n1n
2420 + 12.*three2n1n1n+12.*four2n1n2n1n+6.*four3n1n1n1n+12.*three3n2n1n+4.*four3n1n3n1n+3.*four3n1n2n2n)
2421 - dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+12.*three3n2n1n+4.*three4n3n1n+3.*three4n2n2n+4.*two1n1n
2422 + 12.*two1n1n+6.*three2n1n1n+12.*three2n1n1n+4.*three3n2n1n+12.*two2n2n+4.*three3n2n1n+4.*two3n3n+1.*three4n3n1n
2423 + 6.*three3n2n1n)-dMult*(dMult-1.)*(4.*two1n1n+6.*two2n2n+4.*two3n3n+1.*two4n4n+1.*two1n1n+4.+6.*two1n1n+4.*two2n2n
2424 + 1.*two3n3n)-dMult)/(dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)
2426 // average 6-particle correlations for single event:
2427 fIntFlowCorrelationsAllEBE->SetBinContent(24,six1n1n1n1n1n1n);
2428 fIntFlowCorrelationsAllEBE->SetBinContent(25,six2n1n1n2n1n1n);
2429 fIntFlowCorrelationsAllEBE->SetBinContent(26,six2n2n1n1n1n1n);
2430 fIntFlowCorrelationsAllEBE->SetBinContent(27,six3n1n1n1n1n1n);
2432 // average 6-particle correlations for all events:
2433 fIntFlowCorrelationsAllPro->Fill(23.5,six1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2434 fIntFlowCorrelationsAllPro->Fill(24.5,six2n1n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2435 fIntFlowCorrelationsAllPro->Fill(25.5,six2n2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2436 fIntFlowCorrelationsAllPro->Fill(26.5,six3n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2438 // store separetately <6> (to be improved: do I really need this?)
2439 fIntFlowCorrelationsEBE->SetBinContent(3,six1n1n1n1n1n1n); // <6>
2441 // to be improved (this can be implemented better):
2442 Double_t mWeight6p = 0.;
2443 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
2445 mWeight6p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.);
2446 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
2449 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2454 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(3,mWeight6p); // eW_<6>
2455 fIntFlowCorrelationsPro->Fill(2.5,six1n1n1n1n1n1n,mWeight6p);
2457 // distribution of <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
2458 //f6pDistribution->Fill(six1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
2459 } // end of if(dMult>5)
2462 Double_t seven2n1n1n1n1n1n1n = 0.; // <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
2466 seven2n1n1n1n1n1n1n = (reQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)
2467 * (2.*six3n1n1n1n1n1n+4.*six1n1n1n1n1n1n+1.*six2n2n1n1n1n1n+6.*six2n1n1n2n1n1n+8.*five2n1n1n1n1n)
2468 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(1.*five4n1n1n1n1n +8.*five2n1n1n1n1n+8.*four3n1n1n1n
2469 + 12.*five3n1n2n1n1n+4.*five2n1n1n1n1n+3.*five2n2n2n1n1n+6.*five2n2n2n1n1n+6.*four1n1n1n1n+24.*four1n1n1n1n
2470 + 12.*five2n1n1n1n1n+12.*five2n1n1n1n1n+12.*three2n1n1n+24.*four2n1n2n1n+4.*five3n1n2n1n1n+4.*five2n1n1n1n1n)
2471 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four3n1n1n1n+6.*four4n2n1n1n+12.*four1n1n1n1n+24.*three2n1n1n
2472 + 24.*four2n1n2n1n+12.*four3n1n1n1n+24.*three3n2n1n+8.*four3n1n3n1n+6.*four3n1n2n2n+6.*three2n1n1n+12.*four1n1n1n1n
2473 + 12.*four2n1n2n1n+6.*three2n1n1n+12.*four2n1n2n1n+4.*four3n1n2n2n+3.*four2n2n2n2n+4.*four1n1n1n1n+6.*three2n1n1n
2474 + 24.*two1n1n+24.*four1n1n1n1n+4.*four3n1n1n1n+24.*two1n1n+24.*three2n1n1n+12.*two2n2n+24.*three2n1n1n+12.*four2n1n2n1n
2475 + 8.*three3n2n1n+8.*four2n1n2n1n+1.*four4n2n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+1.*three2n1n1n+8.*two1n1n
2476 + 12.*three3n2n1n+24.*two1n1n+12.*three2n1n1n+4.*three2n1n1n+8.*two1n1n+4.*three4n3n1n+24.*three2n1n1n+8.*three3n2n1n
2477 + 12.*two1n1n+12.*two1n1n+3.*three4n2n2n+24.*two2n2n+6.*two2n2n+12.+12.*three3n2n1n+8.*two3n3n+12.*three2n1n1n+24.*two1n1n
2478 + 4.*three3n2n1n+8.*three3n2n1n+2.*three4n3n1n+12.*two1n1n+8.*three2n1n1n+4.*three2n1n1n+2.*three3n2n1n+6.*two2n2n+8.*two2n2n
2479 + 1.*three4n2n2n+4.*three3n2n1n+6.*three2n1n1n)-dMult*(dMult-1.)*(4.*two1n1n+2.*two1n1n+6.*two2n2n+8.+1.*two2n2n+4.*two3n3n
2480 + 12.*two1n1n+4.*two1n1n+1.*two4n4n+8.*two2n2n+6.+2.*two3n3n+4.*two1n1n+1.*two2n2n)-dMult)
2481 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)); // to be improved (direct formula needed)
2483 // average 7-particle correlations for single event:
2484 fIntFlowCorrelationsAllEBE->SetBinContent(29,seven2n1n1n1n1n1n1n);
2486 // average 7-particle correlations for all events:
2487 fIntFlowCorrelationsAllPro->Fill(28.5,seven2n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.));
2488 } // end of if(dMult>6)
2491 Double_t eight1n1n1n1n1n1n1n1n = 0.; // <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
2494 eight1n1n1n1n1n1n1n1n = (pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),4.)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)
2495 * (12.*seven2n1n1n1n1n1n1n+16.*six1n1n1n1n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)
2496 * (8.*six3n1n1n1n1n1n+48.*six1n1n1n1n1n1n+6.*six2n2n1n1n1n1n+96.*five2n1n1n1n1n+72.*four1n1n1n1n+36.*six2n1n1n2n1n1n)
2497 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(2.*five4n1n1n1n1n+32.*five2n1n1n1n1n+36.*four1n1n1n1n
2498 + 32.*four3n1n1n1n+48.*five2n1n1n1n1n+48.*five3n1n2n1n1n+144.*five2n1n1n1n1n+288.*four1n1n1n1n+36.*five2n2n2n1n1n
2499 + 144.*three2n1n1n+96.*two1n1n+144.*four2n1n2n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)
2500 * (8.*four3n1n1n1n+48.*four1n1n1n1n+12.*four4n2n1n1n+96.*four2n1n2n1n+96.*three2n1n1n+72.*three2n1n1n+144.*two1n1n
2501 + 16.*four3n1n3n1n+48.*four3n1n1n1n+144.*four1n1n1n1n+72.*four1n1n1n1n+96.*three3n2n1n+24.*four3n1n2n2n+144.*four2n1n2n1n
2502 + 288.*two1n1n+288.*three2n1n1n+9.*four2n2n2n2n+72.*two2n2n+24.)-dMult*(dMult-1.)*(dMult-2.)*(12.*three2n1n1n+16.*two1n1n
2503 + 24.*three3n2n1n+48.*three2n1n1n+96.*two1n1n+8.*three4n3n1n+32.*three3n2n1n+96.*three2n1n1n+144.*two1n1n+6.*three4n2n2n
2504 + 96.*two2n2n+36.*two2n2n+72.+48.*three3n2n1n+16.*two3n3n+72.*three2n1n1n+144.*two1n1n)-dMult*(dMult-1.)*(8.*two1n1n
2505 + 12.*two2n2n+16.+8.*two3n3n+48.*two1n1n+1.*two4n4n+16.*two2n2n+18.)-dMult)
2506 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.)); // to be improved (direct formula needed)
2508 // average 8-particle correlations for single event:
2509 fIntFlowCorrelationsAllEBE->SetBinContent(31,eight1n1n1n1n1n1n1n1n);
2511 // average 8-particle correlations for all events:
2512 fIntFlowCorrelationsAllPro->Fill(30.5,eight1n1n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.));
2514 // store separetately <8> (to be improved: do I really need this?)
2515 fIntFlowCorrelationsEBE->SetBinContent(4,eight1n1n1n1n1n1n1n1n); // <8>
2517 // to be improved (this can be implemented better):
2518 Double_t mWeight8p = 0.;
2519 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
2521 mWeight8p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.);
2522 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
2525 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2530 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(4,mWeight8p); // eW_<8>
2531 fIntFlowCorrelationsPro->Fill(3.5,eight1n1n1n1n1n1n1n1n,mWeight8p);
2533 // distribution of <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
2534 //f8pDistribution->Fill(eight1n1n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.));
2535 } // end of if(dMult>7)
2537 } // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelations()
2540 //================================================================================================================================
2543 void AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrelations()
2545 // Calculate averages of products of correlations for integrated flow // to be improved (this method can be implemented better)
2547 // a) Binning of fIntFlowProductOfCorrelationsPro is organized as follows:
2548 // 1st bin: <<2><4>>
2549 // 2nd bin: <<2><6>>
2550 // 3rd bin: <<2><8>>
2551 // 4th bin: <<4><6>>
2552 // 5th bin: <<4><8>>
2553 // 6th bin: <<6><8>>
2556 Double_t dMult = (*fSMpk)(0,0); // multiplicity
2558 Double_t twoEBE = fIntFlowCorrelationsEBE->GetBinContent(1); // <2>
2559 Double_t fourEBE = fIntFlowCorrelationsEBE->GetBinContent(2); // <4>
2560 Double_t sixEBE = fIntFlowCorrelationsEBE->GetBinContent(3); // <6>
2561 Double_t eightEBE = fIntFlowCorrelationsEBE->GetBinContent(4); // <8>
2563 Double_t eW2 = 0.; // event weight for <2>
2564 Double_t eW4 = 0.; // event weight for <4>
2565 Double_t eW6 = 0.; // event weight for <6>
2566 Double_t eW8 = 0.; // event weight for <8>
2568 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
2570 eW2 = dMult*(dMult-1);
2571 eW4 = dMult*(dMult-1)*(dMult-2)*(dMult-3);
2572 eW6 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5);
2573 eW8 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7);
2576 eW2 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j;
2577 eW4 = (*fSMpk)(3,1)-6.*(*fSMpk)(0,2)*(*fSMpk)(1,1)
2578 + 8.*(*fSMpk)(0,3)*(*fSMpk)(0,1)
2579 + 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
2582 fIntFlowProductOfCorrelationsPro->Fill(0.5,twoEBE*fourEBE,eW2*eW4); // <<2><4>>
2583 fIntFlowProductOfCorrelationsPro->Fill(1.5,twoEBE*sixEBE,eW2*eW6); // <<2><6>>
2584 fIntFlowProductOfCorrelationsPro->Fill(2.5,twoEBE*eightEBE,eW2*eW8); // <<2><8>>
2585 fIntFlowProductOfCorrelationsPro->Fill(3.5,fourEBE*sixEBE,eW4*eW6); // <<4><6>>
2586 fIntFlowProductOfCorrelationsPro->Fill(4.5,fourEBE*eightEBE,eW4*eW8); // <<4><8>>
2587 fIntFlowProductOfCorrelationsPro->Fill(5.5,sixEBE*eightEBE,eW6*eW8); // <<6><8>>
2593 for(Int_t ci1=1;ci1<4;ci1++)
2595 for(Int_t ci2=ci1+1;ci2<=4;ci2++)
2597 fIntFlowProductOfCorrelationsPro->Fill(0.5+counter++,
2598 fIntFlowCorrelationsEBE->GetBinContent(ci1)*fIntFlowCorrelationsEBE->GetBinContent(ci2),
2599 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
2603 } // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrelations()
2606 //================================================================================================================================
2609 void AliFlowAnalysisWithQCumulants::CalculateCovariancesIntFlow()
2611 // a) Calculate unbiased estimators Cov(<2>,<4>), Cov(<2>,<6>), Cov(<2>,<8>), Cov(<4>,<6>), Cov(<4>,<8>) and Cov(<6>,<8>)
2612 // for covariances V_(<2>,<4>), V_(<2>,<6>), V_(<2>,<8>), V_(<4>,<6>), V_(<4>,<8>) and V_(<6>,<8>).
2613 // b) Store in histogram fIntFlowCovariances for instance the following:
2615 // 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)]
2617 // where N is the number of events, w_{<2>} is event weight for <2> and w_{<4>} is event weight for <4>.
2618 // c) Binning of fIntFlowCovariances is organized as follows:
2620 // 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)]
2621 // 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)]
2622 // 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)]
2623 // 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)]
2624 // 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)]
2625 // 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)]
2627 for(Int_t power=0;power<2;power++)
2629 if(!(fIntFlowCorrelationsPro && fIntFlowProductOfCorrelationsPro
2630 && fIntFlowSumOfEventWeights[power] && fIntFlowSumOfProductOfEventWeights
2631 && fIntFlowCovariances))
2633 cout<<"WARNING: fIntFlowCorrelationsPro && fIntFlowProductOfCorrelationsPro "<<endl;
2634 cout<<" && fIntFlowSumOfEventWeights[power] && fIntFlowSumOfProductOfEventWeights"<<endl;
2635 cout<<" && fIntFlowCovariances is NULL in AFAWQC::FCIF() !!!!"<<endl;
2636 cout<<"power = "<<power<<endl;
2641 // average 2-, 4-, 6- and 8-particle correlations for all events:
2642 Double_t correlation[4] = {0.};
2643 for(Int_t ci=0;ci<4;ci++)
2645 correlation[ci] = fIntFlowCorrelationsPro->GetBinContent(ci+1);
2647 // average products of 2-, 4-, 6- and 8-particle correlations:
2648 Double_t productOfCorrelations[4][4] = {{0.}};
2649 Int_t productOfCorrelationsLabel = 1;
2650 // denominators in the expressions for the unbiased estimator for covariance:
2651 Double_t denominator[4][4] = {{0.}};
2652 Int_t sumOfProductOfEventWeightsLabel1 = 1;
2653 // weight dependent prefactor which multiply unbiased estimators for covariances:
2654 Double_t wPrefactor[4][4] = {{0.}};
2655 Int_t sumOfProductOfEventWeightsLabel2 = 1;
2656 for(Int_t c1=0;c1<4;c1++)
2658 for(Int_t c2=c1+1;c2<4;c2++)
2660 productOfCorrelations[c1][c2] = fIntFlowProductOfCorrelationsPro->GetBinContent(productOfCorrelationsLabel);
2661 if(fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1) && fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1))
2663 denominator[c1][c2] = 1.-(fIntFlowSumOfProductOfEventWeights->GetBinContent(sumOfProductOfEventWeightsLabel1))/
2664 (fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1)
2665 * fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1));
2667 wPrefactor[c1][c2] = fIntFlowSumOfProductOfEventWeights->GetBinContent(sumOfProductOfEventWeightsLabel2)/
2668 (fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1)
2669 * fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1));
2673 productOfCorrelationsLabel++;
2674 sumOfProductOfEventWeightsLabel1++;
2675 sumOfProductOfEventWeightsLabel2++;
2679 // covariance label:
2680 Int_t covarianceLabel = 1;
2681 for(Int_t c1=0;c1<4;c1++)
2683 for(Int_t c2=c1+1;c2<4;c2++)
2685 if(denominator[c1][c2])
2688 Double_t cov = (productOfCorrelations[c1][c2]-correlation[c1]*correlation[c2])/denominator[c1][c2];
2689 // covarianced multiplied with weight dependent prefactor:
2690 Double_t wCov = cov * wPrefactor[c1][c2];
2691 fIntFlowCovariances->SetBinContent(covarianceLabel,wCov);
2697 } // end of AliFlowAnalysisWithQCumulants::CalculateCovariancesIntFlow()
2700 //================================================================================================================================
2703 void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsIntFlow()
2705 // From profile fIntFlowCorrelationsPro access measured correlations and spread,
2706 // correctly calculate the statistical errors and store the final results and
2707 // statistical errors for correlations in histogram fIntFlowCorrelationsHist.
2709 // Remark: Statistical error of correlation is calculated as:
2711 // statistical error = termA * spread * termB:
2712 // termA = sqrt{sum_{i=1}^{N} w^2}/(sum_{i=1}^{N} w)
2713 // termB = 1/sqrt(1-termA^2)
2715 for(Int_t power=0;power<2;power++)
2717 if(!(fIntFlowCorrelationsHist && fIntFlowCorrelationsPro && fIntFlowSumOfEventWeights[power]))
2719 cout<<"WARNING: fIntFlowCorrelationsHist && fIntFlowCorrelationsPro && fIntFlowSumOfEventWeights[power] is NULL in AFAWQC::FCIF() !!!!"<<endl;
2720 cout<<"power = "<<power<<endl;
2725 for(Int_t ci=1;ci<=4;ci++) // correlation index
2727 Double_t correlation = fIntFlowCorrelationsPro->GetBinContent(ci);
2728 Double_t spread = fIntFlowCorrelationsPro->GetBinError(ci);
2729 Double_t sumOfLinearEventWeights = fIntFlowSumOfEventWeights[0]->GetBinContent(ci);
2730 Double_t sumOfQuadraticEventWeights = fIntFlowSumOfEventWeights[1]->GetBinContent(ci);
2731 Double_t termA = 0.;
2732 Double_t termB = 0.;
2733 if(sumOfLinearEventWeights)
2735 termA = pow(sumOfQuadraticEventWeights,0.5)/sumOfLinearEventWeights;
2738 cout<<"WARNING: sumOfLinearEventWeights == 0 in AFAWQC::FCIF() !!!!"<<endl;
2739 cout<<" (for "<<2*ci<<"-particle correlation)"<<endl;
2741 if(1.-pow(termA,2.) > 0.)
2743 termB = 1./pow(1-pow(termA,2.),0.5);
2746 cout<<"WARNING: 1.-pow(termA,2.) <= 0 in AFAWQC::FCIF() !!!!"<<endl;
2747 cout<<" (for "<<2*ci<<"-particle correlation)"<<endl;
2749 Double_t statisticalError = termA * spread * termB;
2750 fIntFlowCorrelationsHist->SetBinContent(ci,correlation);
2751 fIntFlowCorrelationsHist->SetBinError(ci,statisticalError);
2752 } // end of for(Int_t ci=1;ci<=4;ci++) // correlation index
2754 } // end of AliFlowAnalysisWithQCumulants::FinalizeCorrelationsIntFlow()
2757 //================================================================================================================================
2760 void AliFlowAnalysisWithQCumulants::FillAverageMultiplicities(Int_t nRP)
2762 // Fill profile fAverageMultiplicity to hold average multiplicities and number of events for events with nRP>=0, nRP>=1, ... , and nRP>=8
2764 // Binning of fAverageMultiplicity is organized as follows:
2765 // 1st bin: all events (including the empty ones)
2766 // 2nd bin: event with # of RPs greater or equal to 1
2767 // 3rd bin: event with # of RPs greater or equal to 2
2768 // 4th bin: event with # of RPs greater or equal to 3
2769 // 5th bin: event with # of RPs greater or equal to 4
2770 // 6th bin: event with # of RPs greater or equal to 5
2771 // 7th bin: event with # of RPs greater or equal to 6
2772 // 8th bin: event with # of RPs greater or equal to 7
2773 // 9th bin: event with # of RPs greater or equal to 8
2775 if(!fAvMultiplicity)
2777 cout<<"WARNING: fAvMultiplicity is NULL in AFAWQC::FAM() !!!!"<<endl;
2783 cout<<"WARNING: nRP<0 in in AFAWQC::FAM() !!!!"<<endl;
2787 for(Int_t i=0;i<9;i++)
2789 if(nRP>=i) fAvMultiplicity->Fill(i+0.5,nRP,1);
2792 } // end of AliFlowAnalysisWithQCumulants::FillAverageMultiplicities(nRP)
2795 //================================================================================================================================
2798 void AliFlowAnalysisWithQCumulants::CalculateCumulantsIntFlow()
2800 // a) Calculate Q-cumulants from the measured multiparticle correlations.
2801 // b) Propagate the statistical errors of measured multiparticle correlations to statistical errors of Q-cumulants.
2802 // c) REMARK: Q-cumulants calculated in this method are biased by non-uniform acceptance of detector !!!!
2803 // Method ApplyCorrectionForNonUniformAcceptance* (to be improved: finalize the name here)
2804 // is called afterwards to correct for this bias.
2805 // d) Store the results and statistical error of Q-cumulants in histogram fCumulants.
2806 // Binning of fCumulants is organized as follows:
2813 if(!(fIntFlowCorrelationsHist && fIntFlowCovariances && fIntFlowQcumulants))
2815 cout<<"WARNING: fIntFlowCorrelationsHist && fIntFlowCovariances && fIntFlowQcumulants is NULL in AFAWQC::CCIF() !!!!"<<endl;
2820 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
2821 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
2822 Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
2823 Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
2825 // statistical errors of average 2-, 4-, 6- and 8-particle azimuthal correlations:
2826 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <2>
2827 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <4>
2828 Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <6>
2829 Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <8>
2831 // covariances (multiplied by prefactor depending on weights - see comments in CalculateCovariancesIntFlow()):
2832 Double_t wCov24 = fIntFlowCovariances->GetBinContent(1); // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
2833 Double_t wCov26 = fIntFlowCovariances->GetBinContent(2); // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)
2834 Double_t wCov28 = fIntFlowCovariances->GetBinContent(3); // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)
2835 Double_t wCov46 = fIntFlowCovariances->GetBinContent(4); // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)
2836 Double_t wCov48 = fIntFlowCovariances->GetBinContent(5); // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)
2837 Double_t wCov68 = fIntFlowCovariances->GetBinContent(6); // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)
2840 Double_t qc2 = 0.; // QC{2}
2841 Double_t qc4 = 0.; // QC{4}
2842 Double_t qc6 = 0.; // QC{6}
2843 Double_t qc8 = 0.; // QC{8}
2845 if(four) qc4 = four-2.*pow(two,2.);
2846 if(six) qc6 = six-9.*two*four+12.*pow(two,3.);
2847 if(eight) qc8 = eight-16.*two*six-18.*pow(four,2.)+144.*pow(two,2.)*four-144.*pow(two,4.);
2849 // statistical errors of Q-cumulants:
2850 Double_t qc2Error = 0.;
2851 Double_t qc4Error = 0.;
2852 Double_t qc6Error = 0.;
2853 Double_t qc8Error = 0.;
2855 // squared statistical errors of Q-cumulants:
2856 //Double_t qc2ErrorSquared = 0.;
2857 Double_t qc4ErrorSquared = 0.;
2858 Double_t qc6ErrorSquared = 0.;
2859 Double_t qc8ErrorSquared = 0.;
2861 // statistical error of QC{2}:
2862 qc2Error = twoError;
2864 // statistical error of QC{4}:
2865 qc4ErrorSquared = 16.*pow(two,2.)*pow(twoError,2)+pow(fourError,2.)
2867 if(qc4ErrorSquared>0.)
2869 qc4Error = pow(qc4ErrorSquared,0.5);
2872 cout<<"WARNING: Statistical error of QC{4} is imaginary !!!!"<<endl;
2875 // statistical error of QC{6}:
2876 qc6ErrorSquared = 81.*pow(4.*pow(two,2.)-four,2.)*pow(twoError,2.)
2877 + 81.*pow(two,2.)*pow(fourError,2.)
2879 - 162.*two*(4.*pow(two,2.)-four)*wCov24
2880 + 18.*(4.*pow(two,2.)-four)*wCov26
2883 if(qc6ErrorSquared>0.)
2885 qc6Error = pow(qc6ErrorSquared,0.5);
2888 cout<<"WARNING: Statistical error of QC{6} is imaginary !!!!"<<endl;
2891 // statistical error of QC{8}:
2892 qc8ErrorSquared = 256.*pow(36.*pow(two,3.)-18.*four*two+six,2.)*pow(twoError,2.)
2893 + 1296.*pow(4.*pow(two,2.)-four,2.)*pow(fourError,2.)
2894 + 256.*pow(two,2.)*pow(sixError,2.)
2895 + pow(eightError,2.)
2896 - 1152.*(36.*pow(two,3.)-18.*four*two+six)*(4.*pow(two,2.)-four)*wCov24
2897 + 512.*two*(36.*pow(two,3.)-18.*four*two+six)*wCov26
2898 - 32.*(36.*pow(two,3.)-18.*four*two+six)*wCov28
2899 - 1152.*two*(4.*pow(two,2.)-four)*wCov46
2900 + 72.*(4.*pow(two,2.)-four)*wCov48
2902 if(qc8ErrorSquared>0.)
2904 qc8Error = pow(qc8ErrorSquared,0.5);
2907 cout<<"WARNING: Statistical error of QC{8} is imaginary !!!!"<<endl;
2910 // store the results and statistical errors for Q-cumulants:
2911 fIntFlowQcumulants->SetBinContent(1,qc2);
2912 fIntFlowQcumulants->SetBinError(1,qc2Error);
2913 fIntFlowQcumulants->SetBinContent(2,qc4);
2914 fIntFlowQcumulants->SetBinError(2,qc4Error);
2915 fIntFlowQcumulants->SetBinContent(3,qc6);
2916 fIntFlowQcumulants->SetBinError(3,qc6Error);
2917 fIntFlowQcumulants->SetBinContent(4,qc8);
2918 fIntFlowQcumulants->SetBinError(4,qc8Error);
2920 } // end of AliFlowAnalysisWithQCumulants::CalculateCumulantsIntFlow()
2923 //================================================================================================================================
2926 void AliFlowAnalysisWithQCumulants::CalculateIntFlow()
2928 // a) Calculate the final results for integrated flow estimates from Q-cumulants.
2929 // b) Propagate the statistical errors of measured multiparticle correlations to statistical errors of integrated flow estimates.
2930 // c) Store the results and statistical errors of integrated flow estimates in histogram fIntFlow.
2931 // Binning of fIntFlow is organized as follows:
2938 if(!(fIntFlowCorrelationsHist && fIntFlowCovariances && fIntFlowQcumulants && fIntFlow))
2940 cout<<"WARNING: fIntFlowCorrelationsHist && fIntFlowCovariances && fIntFlowQcumulants && fIntFlow is NULL in AFAWQC::CCIF() !!!!"<<endl;
2945 Double_t qc2 = fIntFlowQcumulants->GetBinContent(1); // QC{2}
2946 Double_t qc4 = fIntFlowQcumulants->GetBinContent(2); // QC{4}
2947 Double_t qc6 = fIntFlowQcumulants->GetBinContent(3); // QC{6}
2948 Double_t qc8 = fIntFlowQcumulants->GetBinContent(4); // QC{8}
2951 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
2952 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
2953 Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
2954 Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
2956 // statistical errors of average 2-, 4-, 6- and 8-particle azimuthal correlations:
2957 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <2>
2958 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <4>
2959 Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <6>
2960 Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <8>
2962 // covariances (multiplied by prefactor depending on weights - see comments in CalculateCovariancesIntFlow()):
2963 Double_t wCov24 = fIntFlowCovariances->GetBinContent(1); // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
2964 Double_t wCov26 = fIntFlowCovariances->GetBinContent(2); // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)
2965 Double_t wCov28 = fIntFlowCovariances->GetBinContent(3); // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)
2966 Double_t wCov46 = fIntFlowCovariances->GetBinContent(4); // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)
2967 Double_t wCov48 = fIntFlowCovariances->GetBinContent(5); // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)
2968 Double_t wCov68 = fIntFlowCovariances->GetBinContent(6); // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)
2970 // integrated flow estimates:
2971 Double_t v2 = 0.; // v{2,QC}
2972 Double_t v4 = 0.; // v{4,QC}
2973 Double_t v6 = 0.; // v{6,QC}
2974 Double_t v8 = 0.; // v{8,QC}
2976 // calculate integrated flow estimates from Q-cumulants:
2977 if(qc2>=0.) v2 = pow(qc2,1./2.);
2978 if(qc4<=0.) v4 = pow(-1.*qc4,1./4.);
2979 if(qc6>=0.) v6 = pow((1./4.)*qc6,1./6.);
2980 if(qc8<=0.) v8 = pow((-1./33.)*qc8,1./8.);
2982 // statistical errors of integrated flow estimates:
2983 Double_t v2Error = 0.; // statistical error of v{2,QC}
2984 Double_t v4Error = 0.; // statistical error of v{4,QC}
2985 Double_t v6Error = 0.; // statistical error of v{6,QC}
2986 Double_t v8Error = 0.; // statistical error of v{8,QC}
2988 // squares of statistical errors of integrated flow estimates:
2989 Double_t v2ErrorSquared = 0.; // squared statistical error of v{2,QC}
2990 Double_t v4ErrorSquared = 0.; // squared statistical error of v{4,QC}
2991 Double_t v6ErrorSquared = 0.; // squared statistical error of v{6,QC}
2992 Double_t v8ErrorSquared = 0.; // squared statistical error of v{8,QC}
2994 // calculate squared statistical errors of integrated flow estimates:
2997 v2ErrorSquared = (1./(4.*two))*pow(twoError,2.);
2999 if(2.*pow(two,2.)-four > 0.)
3001 v4ErrorSquared = (1./pow(2.*pow(two,2.)-four,3./2.))*
3002 (pow(two,2.)*pow(twoError,2.)+(1./16.)*pow(fourError,2.)-(1./2.)*two*wCov24);
3004 if(six-9.*four*two+12.*pow(two,3.) > 0.)
3006 v6ErrorSquared = ((1./2.)*(1./pow(2.,2./3.))*(1./pow(six-9.*four*two+12.*pow(two,3.),5./3.)))*
3007 ((9./2.)*pow(4.*pow(two,2.)-four,2.)*pow(twoError,2.)
3008 + (9./2.)*pow(two,2.)*pow(fourError,2.)+(1./18.)*pow(sixError,2.)
3009 - 9.*two*(4.*pow(two,2.)-four)*wCov24+(4.*pow(two,2.)-four)*wCov26-two*wCov46);
3011 if(-1.*eight+16.*six*two+18.*pow(four,2.)-144.*four*pow(two,2.)+144.*pow(two,4.) > 0.)
3013 v8ErrorSquared = (4./pow(33,1./4.))*(1./pow(-1.*eight+16.*six*two+18.*pow(four,2.)-144.*four*pow(two,2.)+144.*pow(two,4.),7./4.))*
3014 (pow(36.*pow(two,3.)-18.*four*two+six,2.)*pow(twoError,2.)
3015 + (81./16.)*pow(4.*pow(two,2.)-four,2.)*pow(fourError,2.)
3016 + pow(two,2.)*pow(sixError,2.)
3017 + (1./256.)*pow(eightError,2.)
3018 - (9./2.)*(36.*pow(two,3.)-18.*four*two+six)*(4.*pow(two,2.)-four)*wCov24
3019 + 2.*two*(36.*pow(two,3.)-18.*four*two+six)*wCov26
3020 - (1./8.)*(36.*pow(two,3.)-18.*four*two+six)*wCov28
3021 - (9./2.)*two*(4.*pow(two,2.)-four)*wCov46
3022 + (9./32.)*(4.*pow(two,2.)-four)*wCov48
3023 - (1./8.)*two*wCov68);
3026 // calculate statistical errors of integrated flow estimates:
3027 if(v2ErrorSquared > 0.)
3029 v2Error = pow(v2ErrorSquared,0.5);
3032 cout<<"WARNING: Statistical error of v{2,QC} is imaginary !!!!"<<endl;
3034 if(v4ErrorSquared > 0.)
3036 v4Error = pow(v4ErrorSquared,0.5);
3039 cout<<"WARNING: Statistical error of v{4,QC} is imaginary !!!!"<<endl;
3041 if(v6ErrorSquared > 0.)
3043 v6Error = pow(v6ErrorSquared,0.5);
3046 cout<<"WARNING: Statistical error of v{6,QC} is imaginary !!!!"<<endl;
3048 if(v8ErrorSquared > 0.)
3050 v8Error = pow(v8ErrorSquared,0.5);
3053 cout<<"WARNING: Statistical error of v{8,QC} is imaginary !!!!"<<endl;
3056 // store the results and statistical errors of integrated flow estimates:
3057 fIntFlow->SetBinContent(1,v2);
3058 fIntFlow->SetBinError(1,v2Error);
3059 fIntFlow->SetBinContent(2,v4);
3060 fIntFlow->SetBinError(2,v4Error);
3061 fIntFlow->SetBinContent(3,v6);
3062 fIntFlow->SetBinError(3,v6Error);
3063 fIntFlow->SetBinContent(4,v8);
3064 fIntFlow->SetBinError(4,v8Error);
3066 } // end of AliFlowAnalysisWithQCumulants::CalculateIntFlow()
3069 //================================================================================================================================
3072 void AliFlowAnalysisWithQCumulants::FillCommonHistResultsIntFlow()
3074 // Fill in AliFlowCommonHistResults histograms relevant for 'NONAME' integrated flow (to be improved (name))
3078 cout<<"WARNING: fIntFlow is NULL in AFAWQC::FCHRIF() !!!!"<<endl;
3082 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
3084 cout<<"WARNING: fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th"<<endl;
3085 cout<<" is NULL in AFAWQC::FCHRIF() !!!!"<<endl;
3089 Double_t v2 = fIntFlow->GetBinContent(1);
3090 Double_t v4 = fIntFlow->GetBinContent(2);
3091 Double_t v6 = fIntFlow->GetBinContent(3);
3092 Double_t v8 = fIntFlow->GetBinContent(4);
3094 Double_t v2Error = fIntFlow->GetBinError(1);
3095 Double_t v4Error = fIntFlow->GetBinError(2);
3096 Double_t v6Error = fIntFlow->GetBinError(3);
3097 Double_t v8Error = fIntFlow->GetBinError(4);
3099 fCommonHistsResults2nd->FillIntegratedFlow(v2,v2Error); // to be improved (hardwired 2nd in the name)
3100 fCommonHistsResults4th->FillIntegratedFlow(v4,v4Error); // to be improved (hardwired 4th in the name)
3101 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)) // to be improved (calculate also 6th and 8th order)
3103 fCommonHistsResults6th->FillIntegratedFlow(v6,v6Error); // to be improved (hardwired 6th in the name)
3104 fCommonHistsResults8th->FillIntegratedFlow(v8,v8Error); // to be improved (hardwired 8th in the name)
3107 } // end of AliFlowAnalysisWithQCumulants::FillCommonHistResultsIntFlow()
3110 //================================================================================================================================
3114 void AliFlowAnalysisWithQCumulants::ApplyCorrectionForNonUniformAcceptanceToCumulantsForIntFlow(Bool_t useParticleWeights, TString eventWeights)
3116 // apply correction for non-uniform acceptance to cumulants for integrated flow
3117 // (Remark: non-corrected cumulants are accessed from fCumulants[pW][0], corrected cumulants are stored in fCumulants[pW][1])
3119 // shortcuts for the flags:
3120 Int_t pW = (Int_t)(useParticleWeights); // 0=pWeights not used, 1=pWeights used
3123 if(eventWeights == "exact")
3128 if(!(fCumulants[pW][eW][0] && fCumulants[pW][eW][1] && fCorrections[pW][eW]))
3130 cout<<"WARNING: fCumulants[pW][eW][0] && fCumulants[pW][eW][1] && fCorrections[pW][eW] is NULL in AFAWQC::ACFNUATCFIF() !!!!"<<endl;
3131 cout<<"pW = "<<pW<<endl;
3132 cout<<"eW = "<<eW<<endl;
3136 // non-corrected cumulants:
3137 Double_t qc2 = fCumulants[pW][eW][0]->GetBinContent(1);
3138 Double_t qc4 = fCumulants[pW][eW][0]->GetBinContent(2);
3139 Double_t qc6 = fCumulants[pW][eW][0]->GetBinContent(3);
3140 Double_t qc8 = fCumulants[pW][eW][0]->GetBinContent(4);
3141 // statistical error of non-corrected cumulants:
3142 Double_t qc2Error = fCumulants[pW][eW][0]->GetBinError(1);
3143 Double_t qc4Error = fCumulants[pW][eW][0]->GetBinError(2);
3144 Double_t qc6Error = fCumulants[pW][eW][0]->GetBinError(3);
3145 Double_t qc8Error = fCumulants[pW][eW][0]->GetBinError(4);
3146 // corrections for non-uniform acceptance:
3147 Double_t qc2Correction = fCorrections[pW][eW]->GetBinContent(1);
3148 Double_t qc4Correction = fCorrections[pW][eW]->GetBinContent(2);
3149 Double_t qc6Correction = fCorrections[pW][eW]->GetBinContent(3);
3150 Double_t qc8Correction = fCorrections[pW][eW]->GetBinContent(4);
3151 // corrected cumulants:
3152 Double_t qc2Corrected = qc2 + qc2Correction;
3153 Double_t qc4Corrected = qc4 + qc4Correction;
3154 Double_t qc6Corrected = qc6 + qc6Correction;
3155 Double_t qc8Corrected = qc8 + qc8Correction;
3157 // ... to be improved (I need here also to correct error of QCs for NUA.
3158 // For simplicity sake I assume at the moment that this correction is negliglible, but it will be added eventually...)
3160 // store corrected results and statistical errors for cumulants:
3161 fCumulants[pW][eW][1]->SetBinContent(1,qc2Corrected);
3162 fCumulants[pW][eW][1]->SetBinContent(2,qc4Corrected);
3163 fCumulants[pW][eW][1]->SetBinContent(3,qc6Corrected);
3164 fCumulants[pW][eW][1]->SetBinContent(4,qc8Corrected);
3165 fCumulants[pW][eW][1]->SetBinError(1,qc2Error); // to be improved (correct also qc2Error for NUA)
3166 fCumulants[pW][eW][1]->SetBinError(2,qc4Error); // to be improved (correct also qc4Error for NUA)
3167 fCumulants[pW][eW][1]->SetBinError(3,qc6Error); // to be improved (correct also qc6Error for NUA)
3168 fCumulants[pW][eW][1]->SetBinError(4,qc8Error); // to be improved (correct also qc8Error for NUA)
3170 } // end of AliFlowAnalysisWithQCumulants::ApplyCorrectionForNonUniformAcceptanceToCumulantsForIntFlow(Bool_t useParticleWeights, TString eventWeights)
3174 //================================================================================================================================
3178 void AliFlowAnalysisWithQCumulants::PrintQuantifyingCorrectionsForNonUniformAcceptance(Bool_t useParticleWeights, TString eventWeights)
3180 // print on the screen QC{n,biased}/QC{n,corrected}
3182 // shortcuts for the flags:
3183 Int_t pW = (Int_t)(useParticleWeights); // 0=pWeights not used, 1=pWeights used
3187 if(eventWeights == "exact")
3192 if(!(fCumulants[pW][eW][0] && fCumulants[pW][eW][1]))
3194 cout<<"WARNING: fCumulants[pW][eW][0] && fCumulants[pW][eW][1] is NULL in AFAWQC::PQCFNUA() !!!!"<<endl;
3195 cout<<"pW = "<<pW<<endl;
3196 cout<<"eW = "<<eW<<endl;
3201 cout<<" Quantifying the bias to Q-cumulants from"<<endl;
3202 cout<<" non-uniform acceptance of the detector:"<<endl;
3205 if(fCumulants[pW][eW][1]->GetBinContent(1))
3207 cout<<" QC{2,biased}/QC{2,corrected} = "<<(fCumulants[pW][eW][0]->GetBinContent(1))/(fCumulants[pW][eW][1]->GetBinContent(1))<<endl;
3209 if(fCumulants[pW][eW][1]->GetBinContent(2))
3211 cout<<" QC{4,biased}/QC{4,corrected} = "<<fCumulants[pW][eW][0]->GetBinContent(2)/fCumulants[pW][eW][1]->GetBinContent(2)<<endl;
3216 } // end of AliFlowAnalysisWithQCumulants::PrintQuantifyingCorrectionsForNonUniformAcceptance(Bool_t useParticleWeights, TString eventWeights)
3220 //================================================================================================================================
3223 void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelationsUsingParticleWeights()
3225 // Calculate all correlations needed for integrated flow using particle weights.
3227 // Remark 1: When particle weights are used the binning of fIntFlowCorrelationAllPro is organized as follows:
3229 // 1st bin: <2>_{1n|1n} = two1n1nW1W1 = <w1 w2 cos(n*(phi1-phi2))>
3230 // 2nd bin: <2>_{2n|2n} = two2n2nW2W2 = <w1^2 w2^2 cos(2n*(phi1-phi2))>
3231 // 3rd bin: <2>_{3n|3n} = two3n3nW3W3 = <w1^3 w2^3 cos(3n*(phi1-phi2))>
3232 // 4th bin: <2>_{4n|4n} = two4n4nW4W4 = <w1^4 w2^4 cos(4n*(phi1-phi2))>
3233 // 5th bin: ---- EMPTY ----
3234 // 6th bin: <3>_{2n|1n,1n} = three2n1n1nW2W1W1 = <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
3235 // 7th bin: <3>_{3n|2n,1n} = ...
3236 // 8th bin: <3>_{4n|2n,2n} = ...
3237 // 9th bin: <3>_{4n|3n,1n} = ...
3238 // 10th bin: ---- EMPTY ----
3239 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1nW1W1W1W1 = <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
3240 // 12th bin: <4>_{2n,1n|2n,1n} = ...
3241 // 13th bin: <4>_{2n,2n|2n,2n} = ...
3242 // 14th bin: <4>_{3n|1n,1n,1n} = ...
3243 // 15th bin: <4>_{3n,1n|3n,1n} = ...
3244 // 16th bin: <4>_{3n,1n|2n,2n} = ...
3245 // 17th bin: <4>_{4n|2n,1n,1n} = ...
3246 // 18th bin: ---- EMPTY ----
3247 // 19th bin: <5>_{2n|1n,1n,1n,1n} = ...
3248 // 20th bin: <5>_{2n,2n|2n,1n,1n} = ...
3249 // 21st bin: <5>_{3n,1n|2n,1n,1n} = ...
3250 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = ...
3251 // 23rd bin: ---- EMPTY ----
3252 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = ...
3253 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = ...
3254 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = ...
3255 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = ...
3256 // 28th bin: ---- EMPTY ----
3257 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = ...
3258 // 30th bin: ---- EMPTY ----
3259 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = ...
3261 // Remark 2: When particle weights are used there are some extra correlations. They are stored in
3262 // fIntFlowExtraCorrelationsPro binning of which is organized as follows:
3264 // 1st bin: two1n1nW3W1 = <w1^3 w2 cos(n*(phi1-phi2))>
3265 // 2nd bin: two1n1nW1W1W2 = <w1 w2 w3^2 cos(n*(phi1-phi2))>
3267 // multiplicity (number of particles used to determine the reaction plane)
3268 Double_t dMult = (*fSMpk)(0,0);
3270 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
3271 Double_t dReQ1n1k = (*fReQ)(0,1);
3272 Double_t dReQ2n2k = (*fReQ)(1,2);
3273 Double_t dReQ3n3k = (*fReQ)(2,3);
3274 Double_t dReQ4n4k = (*fReQ)(3,4);
3275 Double_t dReQ1n3k = (*fReQ)(0,3);
3276 Double_t dImQ1n1k = (*fImQ)(0,1);
3277 Double_t dImQ2n2k = (*fImQ)(1,2);
3278 Double_t dImQ3n3k = (*fImQ)(2,3);
3279 Double_t dImQ4n4k = (*fImQ)(3,4);
3280 Double_t dImQ1n3k = (*fImQ)(0,3);
3282 // dMs are variables introduced in order to simplify some Eqs. bellow:
3283 //..............................................................................................
3284 Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
3285 Double_t dM22 = (*fSMpk)(1,2)-(*fSMpk)(0,4); // dM22 = sum_{i,j=1,i!=j}^M w_i^2 w_j^2
3286 Double_t dM33 = (*fSMpk)(1,3)-(*fSMpk)(0,6); // dM33 = sum_{i,j=1,i!=j}^M w_i^3 w_j^3
3287 Double_t dM44 = (*fSMpk)(1,4)-(*fSMpk)(0,8); // dM44 = sum_{i,j=1,i!=j}^M w_i^4 w_j^4
3288 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
3289 Double_t dM211 = (*fSMpk)(0,2)*(*fSMpk)(1,1)-2.*(*fSMpk)(0,3)*(*fSMpk)(0,1)
3290 - (*fSMpk)(1,2)+2.*(*fSMpk)(0,4); // dM211 = sum_{i,j,k=1,i!=j!=k}^M w_i^2 w_j w_k
3291 Double_t dM1111 = (*fSMpk)(3,1)-6.*(*fSMpk)(0,2)*(*fSMpk)(1,1)
3292 + 8.*(*fSMpk)(0,3)*(*fSMpk)(0,1)
3293 + 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
3294 //..............................................................................................
3296 // 2-particle correlations:
3297 Double_t two1n1nW1W1 = 0.; // <w1 w2 cos(n*(phi1-phi2))>
3298 Double_t two2n2nW2W2 = 0.; // <w1^2 w2^2 cos(2n*(phi1-phi2))>
3299 Double_t two3n3nW3W3 = 0.; // <w1^3 w2^3 cos(3n*(phi1-phi2))>
3300 Double_t two4n4nW4W4 = 0.; // <w1^4 w2^4 cos(4n*(phi1-phi2))>
3305 two1n1nW1W1 = (pow(dReQ1n1k,2)+pow(dImQ1n1k,2)-(*fSMpk)(0,2))/dM11;
3306 // average correlation <w1 w2 cos(n*(phi1-phi2))> for single event:
3307 fIntFlowCorrelationsEBE->SetBinContent(1,two1n1nW1W1);
3308 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(1,dM11);
3309 // average correlation <w1 w2 cos(n*(phi1-phi2))> for all events:
3310 fIntFlowCorrelationsPro->Fill(0.5,two1n1nW1W1,dM11);
3311 fIntFlowCorrelationsAllPro->Fill(0.5,two1n1nW1W1,dM11);
3315 two2n2nW2W2 = (pow(dReQ2n2k,2)+pow(dImQ2n2k,2)-(*fSMpk)(0,4))/dM22;
3317 // average correlation <w1^2 w2^2 cos(2n*(phi1-phi2))> for all events:
3318 fIntFlowCorrelationsAllPro->Fill(1.5,two2n2nW2W2,dM22);
3322 two3n3nW3W3 = (pow(dReQ3n3k,2)+pow(dImQ3n3k,2)-(*fSMpk)(0,6))/dM33;
3324 // average correlation <w1^3 w2^3 cos(3n*(phi1-phi2))> for all events:
3325 fIntFlowCorrelationsAllPro->Fill(2.5,two3n3nW3W3,dM33);
3329 two4n4nW4W4 = (pow(dReQ4n4k,2)+pow(dImQ4n4k,2)-(*fSMpk)(0,8))/dM44;
3331 // average correlation <w1^4 w2^4 cos(4n*(phi1-phi2))> for all events:
3332 fIntFlowCorrelationsAllPro->Fill(3.5,two4n4nW4W4,dM44);
3334 } // end of if(dMult>1)
3336 // extra 2-particle correlations:
3337 Double_t two1n1nW3W1 = 0.; // <w1^3 w2 cos(n*(phi1-phi2))>
3338 Double_t two1n1nW1W1W2 = 0.; // <w1 w2 w3^2 cos(n*(phi1-phi2))>
3343 two1n1nW3W1 = (dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k-(*fSMpk)(0,4))/dM31;
3344 fIntFlowExtraCorrelationsPro->Fill(0.5,two1n1nW3W1,dM31);
3348 two1n1nW1W1W2 = ((*fSMpk)(0,2)*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2)-(*fSMpk)(0,2))
3349 - 2.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k
3350 - (*fSMpk)(0,4)))/dM211;
3351 fIntFlowExtraCorrelationsPro->Fill(1.5,two1n1nW1W1W2,dM211);
3353 } // end of if(dMult>1)
3354 //..............................................................................................
3356 //..............................................................................................
3357 // 3-particle correlations:
3358 Double_t three2n1n1nW2W1W1 = 0.; // <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
3364 three2n1n1nW2W1W1 = (pow(dReQ1n1k,2.)*dReQ2n2k+2.*dReQ1n1k*dImQ1n1k*dImQ2n2k-pow(dImQ1n1k,2.)*dReQ2n2k
3365 - 2.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k)
3366 - pow(dReQ2n2k,2)-pow(dImQ2n2k,2)
3367 + 2.*(*fSMpk)(0,4))/dM211;
3368 fIntFlowCorrelationsAllPro->Fill(5.5,three2n1n1nW2W1W1,dM211);
3370 } // end of if(dMult>2)
3371 //..............................................................................................
3373 //..............................................................................................
3374 // 4-particle correlations:
3375 Double_t four1n1n1n1nW1W1W1W1 = 0.; // <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
3380 four1n1n1n1nW1W1W1W1 = (pow(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.),2)
3381 - 2.*(pow(dReQ1n1k,2.)*dReQ2n2k+2.*dReQ1n1k*dImQ1n1k*dImQ2n2k-pow(dImQ1n1k,2.)*dReQ2n2k)
3382 + 8.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k)
3383 + (pow(dReQ2n2k,2)+pow(dImQ2n2k,2))
3384 - 4.*(*fSMpk)(0,2)*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
3385 - 6.*(*fSMpk)(0,4)+2.*(*fSMpk)(1,2))/dM1111;
3387 // average correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for single event:
3388 fIntFlowCorrelationsEBE->SetBinContent(2,four1n1n1n1nW1W1W1W1);
3389 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(2,dM1111);
3390 // average correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for all events:
3391 fIntFlowCorrelationsPro->Fill(1.5,four1n1n1n1nW1W1W1W1,dM1111);
3392 fIntFlowCorrelationsAllPro->Fill(10.5,four1n1n1n1nW1W1W1W1,dM1111);
3394 } // end of if(dMult>3)
3395 //..............................................................................................
3397 } // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelationsUsingParticleWeights()
3400 //================================================================================================================================
3403 void AliFlowAnalysisWithQCumulants::CalculateWeightedQProductsForIntFlow() // to be improved (completed)
3405 // calculate averages like <<2><4>>, <<2><6>>, <<4><6>>, etc. which are needed to calculate covariances
3406 // Remark: here we take weighted correlations!
3410 // binning of fQProductsW is organized as follows:
3419 Double_t dMult = (*fSMpk)(0,0); // multiplicity (number of particles used to determine the reaction plane)
3421 Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
3422 Double_t dM1111 = (*fSMpk)(3,1)-6.*(*fSMpk)(0,2)*(*fSMpk)(1,1)
3423 + 8.*(*fSMpk)(0,3)*(*fSMpk)(0,1)
3424 + 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
3426 Double_t twoEBEW = 0.; // <2>
3427 Double_t fourEBEW = 0.; // <4>
3429 twoEBEW = fQCorrelationsEBE[1]->GetBinContent(1);
3430 fourEBEW = fQCorrelationsEBE[1]->GetBinContent(11);
3435 fQProducts[1][0]->Fill(0.5,twoEBEW*fourEBEW,dM11*dM1111);
3440 } // end of AliFlowAnalysisWithQCumulants::CalculateWeightedQProductsForIntFlow()
3443 //================================================================================================================================
3446 void AliFlowAnalysisWithQCumulants::InitializeArraysForIntFlow()
3448 // Initialize all arrays used to calculate integrated flow.
3450 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
3452 fIntFlowCorrectionTermsForNUAEBE[sc] = NULL;
3453 fIntFlowCorrectionTermsForNUAPro[sc] = NULL;
3454 fIntFlowCorrectionTermsForNUAHist[sc] = NULL;
3456 for(Int_t power=0;power<2;power++) // linear or quadratic
3458 fIntFlowSumOfEventWeights[power] = NULL;
3460 for(Int_t i=0;i<3;i++) // print on the screen the final results (0=NONAME, 1=RP, 2=POI)
3462 fPrintFinalResults[i] = kTRUE;
3465 } // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForIntFlow()
3468 //================================================================================================================================
3471 void AliFlowAnalysisWithQCumulants::InitializeArraysForDiffFlow()
3473 // Initialize all arrays needed to calculate differential flow.
3474 // a) Initialize lists holding profiles;
3475 // b) Initialize lists holding histograms;
3476 // c) Initialize event-by-event quantities;
3477 // d) Initialize profiles;
3478 // e) Initialize histograms holding final results.
3480 // a) Initialize lists holding profiles;
3481 for(Int_t t=0;t<2;t++) // type (RP, POI)
3483 for(Int_t pe=0;pe<2;pe++) // pt or eta
3485 fDiffFlowCorrelationsProList[t][pe] = NULL;
3486 fDiffFlowProductOfCorrelationsProList[t][pe] = NULL;
3487 fDiffFlowCorrectionsProList[t][pe] = NULL;
3491 // b) Initialize lists holding histograms;
3492 for(Int_t t=0;t<2;t++) // type (RP, POI)
3494 for(Int_t pe=0;pe<2;pe++) // pt or eta
3496 fDiffFlowCorrelationsHistList[t][pe] = NULL;
3497 for(Int_t power=0;power<2;power++)
3499 fDiffFlowSumOfEventWeightsHistList[t][pe][power] = NULL;
3500 } // end of for(Int_t power=0;power<2;power++)
3501 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe] = NULL;
3502 fDiffFlowCorrectionsHistList[t][pe] = NULL;
3503 fDiffFlowCovariancesHistList[t][pe] = NULL;
3504 fDiffFlowCumulantsHistList[t][pe] = NULL;
3505 fDiffFlowHistList[t][pe] = NULL;
3506 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
3507 } // enf of for(Int_t t=0;t<2;t++) // type (RP, POI)
3509 // c) Initialize event-by-event quantities:
3511 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
3513 for(Int_t pe=0;pe<2;pe++) // pt or eta
3515 for(Int_t m=0;m<4;m++) // multiple of harmonic
3517 for(Int_t k=0;k<9;k++) // power of weight
3519 fReRPQ1dEBE[t][pe][m][k] = NULL;
3520 fImRPQ1dEBE[t][pe][m][k] = NULL;
3521 fs1dEBE[t][pe][k] = NULL; // to be improved (this doesn't need to be within loop over m)
3527 for(Int_t t=0;t<2;t++) // type (RP or POI)
3529 for(Int_t pe=0;pe<2;pe++) // pt or eta
3531 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
3533 for(Int_t cti=0;cti<9;cti++) // correction term index
3535 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti] = NULL;
3541 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
3543 for(Int_t m=0;m<4;m++) // multiple of harmonic
3545 for(Int_t k=0;k<9;k++) // power of weight
3547 fReRPQ2dEBE[t][m][k] = NULL;
3548 fImRPQ2dEBE[t][m][k] = NULL;
3549 fs2dEBE[t][k] = NULL; // to be improved (this doesn't need to be within loop over m)
3554 // d) Initialize profiles:
3555 for(Int_t t=0;t<2;t++) // type: RP or POI
3557 for(Int_t pe=0;pe<2;pe++) // pt or eta
3559 for(Int_t ci=0;ci<4;ci++) // correlation index
3561 fDiffFlowCorrelationsPro[t][pe][ci] = NULL;
3562 } // end of for(Int_t ci=0;ci<4;ci++)
3563 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
3565 for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index
3567 fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2] = NULL;
3568 } // end of for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index
3569 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
3570 // correction terms for nua:
3571 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
3573 for(Int_t cti=0;cti<9;cti++) // correction term index
3575 fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti] = NULL;
3578 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
3579 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
3581 // e) Initialize histograms holding final results.
3582 for(Int_t t=0;t<2;t++) // type: RP or POI
3584 for(Int_t pe=0;pe<2;pe++) // pt or eta
3586 for(Int_t ci=0;ci<4;ci++) // correlation index
3588 fDiffFlowCorrelationsHist[t][pe][ci] = NULL;
3589 fDiffFlowCumulants[t][pe][ci] = NULL;
3590 fDiffFlow[t][pe][ci] = NULL;
3591 } // end of for(Int_t ci=0;ci<4;ci++)
3592 for(Int_t covarianceIndex=0;covarianceIndex<5;covarianceIndex++)
3594 fDiffFlowCovariances[t][pe][covarianceIndex] = NULL;
3595 } // end of for(Int_t covarianceIndex=0;covarianceIndex<5;covarianceIndex++)
3596 // correction terms for nua:
3597 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
3599 for(Int_t cti=0;cti<9;cti++) // correction term index
3601 fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti] = NULL;
3604 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
3605 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
3607 // sum of event weights for reduced correlations:
3608 for(Int_t t=0;t<2;t++) // type = RP or POI
3610 for(Int_t pe=0;pe<2;pe++) // pt or eta
3612 for(Int_t p=0;p<2;p++) // power of weight is 1 or 2
3614 for(Int_t ew=0;ew<4;ew++) // event weight index for reduced correlations
3616 fDiffFlowSumOfEventWeights[t][pe][p][ew] = NULL;
3621 // product of event weights for both types of correlations:
3622 for(Int_t t=0;t<2;t++) // type = RP or POI
3624 for(Int_t pe=0;pe<2;pe++) // pt or eta
3626 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
3628 for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index
3630 fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2] = NULL;
3641 // nested lists in fDiffFlowProfiles:
3642 for(Int_t t=0;t<2;t++)
3645 for(Int_t pW=0;pW<2;pW++) // particle weights not used (0) or used (1)
3647 fDFPParticleWeights[t][pW] = NULL;
3648 for(Int_t eW=0;eW<2;eW++)
3650 fDFPEventWeights[t][pW][eW] = NULL;
3651 fDiffFlowCorrelations[t][pW][eW] = NULL;
3652 fDiffFlowProductsOfCorrelations[t][pW][eW] = NULL;
3653 for(Int_t sc=0;sc<2;sc++)
3655 fDiffFlowCorrectionTerms[t][pW][eW][sc] = NULL;
3667 for(Int_t pW=0;pW<2;pW++) // particle weights not used (0) or used (1)
3669 for(Int_t eW=0;eW<2;eW++)
3672 for(Int_t correlationIndex=0;correlationIndex<4;correlationIndex++)
3674 fCorrelationsPro[t][pW][eW][correlationIndex] = NULL;
3676 // products of correlations:
3677 for(Int_t productOfCorrelationsIndex=0;productOfCorrelationsIndex<6;productOfCorrelationsIndex++)
3679 fProductsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex] = NULL;
3681 // correction terms:
3682 for(Int_t sc=0;sc<2;sc++)
3684 for(Int_t correctionsIndex=0;correctionsIndex<2;correctionsIndex++)
3686 fCorrectionTermsPro[t][pW][eW][sc][correctionsIndex] = NULL;
3693 } // end of AliFlowAnalysisWithQCumulants::InitializeArraysForDiffFlow()
3696 //================================================================================================================================
3700 void AliFlowAnalysisWithQCumulants::CalculateCorrelationsForDifferentialFlow2D(TString type)
3702 // calculate all reduced correlations needed for differential flow for each (pt,eta) bin:
3704 if(type == "RP") // to be improved (removed)
3711 Int_t typeFlag = -1;
3713 // reduced correlations ares stored in fCorrelationsPro[t][pW][index] and are indexed as follows:
3719 Double_t dMult = (*fSMpk)(0,0);
3721 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
3722 Double_t dReQ1n = (*fReQ)(0,0);
3723 Double_t dReQ2n = (*fReQ)(1,0);
3724 //Double_t dReQ3n = (*fReQ)(2,0);
3725 //Double_t dReQ4n = (*fReQ)(3,0);
3726 Double_t dImQ1n = (*fImQ)(0,0);
3727 Double_t dImQ2n = (*fImQ)(1,0);
3728 //Double_t dImQ3n = (*fImQ)(2,0);
3729 //Double_t dImQ4n = (*fImQ)(3,0);
3731 // looping over all (pt,eta) bins and calculating correlations needed for differential flow:
3732 for(Int_t p=1;p<=fnBinsPt;p++)
3734 for(Int_t e=1;e<=fnBinsEta;e++)
3736 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin):
3737 Double_t p1n0kRe = 0.;
3738 Double_t p1n0kIm = 0.;
3740 // number of POIs in particular (pt,eta) bin:
3743 // 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):
3744 Double_t q1n0kRe = 0.;
3745 Double_t q1n0kIm = 0.;
3746 Double_t q2n0kRe = 0.;
3747 Double_t q2n0kIm = 0.;
3749 // number of particles which are both RPs and POIs in particular (pt,eta) bin:
3753 q1n0kRe = fReEBE2D[2][0][0]->GetBinContent(fReEBE2D[2][0][0]->GetBin(p,e))
3754 * fReEBE2D[2][0][0]->GetBinEntries(fReEBE2D[2][0][0]->GetBin(p,e));
3755 q1n0kIm = fImEBE2D[2][0][0]->GetBinContent(fImEBE2D[2][0][0]->GetBin(p,e))
3756 * fImEBE2D[2][0][0]->GetBinEntries(fImEBE2D[2][0][0]->GetBin(p,e));
3757 q2n0kRe = fReEBE2D[2][1][0]->GetBinContent(fReEBE2D[2][1][0]->GetBin(p,e))
3758 * fReEBE2D[2][1][0]->GetBinEntries(fReEBE2D[2][1][0]->GetBin(p,e));
3759 q2n0kIm = fImEBE2D[2][1][0]->GetBinContent(fImEBE2D[2][1][0]->GetBin(p,e))
3760 * fImEBE2D[2][1][0]->GetBinEntries(fImEBE2D[2][1][0]->GetBin(p,e));
3762 mq = fReEBE2D[2][0][0]->GetBinEntries(fReEBE2D[2][0][0]->GetBin(p,e)); // to be improved (cross-checked by accessing other profiles here)
3767 p1n0kRe = fReEBE2D[1][0][0]->GetBinContent(fReEBE2D[1][0][0]->GetBin(p,e))
3768 * fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e));
3769 p1n0kIm = fImEBE2D[1][0][0]->GetBinContent(fImEBE2D[1][0][0]->GetBin(p,e))
3770 * fImEBE2D[1][0][0]->GetBinEntries(fImEBE2D[1][0][0]->GetBin(p,e));
3772 mp = fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e)); // to be improved (cross-checked by accessing other profiles here)
3776 else if(type == "RP")
3778 // p_{m*n,0} = q_{m*n,0}:
3786 // count events with non-empty (pt,eta) bin:
3789 fNonEmptyBins2D[typeFlag]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,1);
3792 // 2'-particle correlation for particular (pt,eta) bin:
3793 Double_t two1n1nPtEta = 0.;
3796 two1n1nPtEta = (p1n0kRe*dReQ1n+p1n0kIm*dImQ1n-mq)
3799 // fill the 2D profile to get the average correlation for each (pt,eta) bin:
3802 //f2pPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);
3804 fCorrelationsPro[1][0][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);
3806 else if(type == "RP")
3808 //f2pPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);
3809 fCorrelationsPro[0][0][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);
3811 } // end of if(mp*dMult-mq)
3813 // 4'-particle correlation:
3814 Double_t four1n1n1n1nPtEta = 0.;
3815 if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
3816 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)
3818 four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
3819 - q2n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))
3820 - 2.*q2n0kIm*dReQ1n*dImQ1n
3821 - p1n0kRe*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)
3822 + p1n0kIm*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)
3823 - 2.*dMult*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
3824 - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*mq
3825 + 6.*(q1n0kRe*dReQ1n+q1n0kIm*dImQ1n)
3826 + 1.*(q2n0kRe*dReQ2n+q2n0kIm*dImQ2n)
3827 + 2.*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
3830 / ((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
3831 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
3833 // fill the 2D profile to get the average correlation for each (pt, eta) bin:
3836 //f4pPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
3837 // (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
3838 // + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
3840 fCorrelationsPro[1][0][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
3841 (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
3842 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
3844 else if(type == "RP")
3846 //f4pPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
3847 // (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
3848 // + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
3850 fCorrelationsPro[0][0][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
3851 (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
3852 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
3854 } // end of if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
3855 // +mq*(dMult-1.)*(dMult-2.)*(dMult-3.))
3857 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
3858 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
3864 } // end of AliFlowAnalysisWithQCumulants::CalculateCorrelationsForDifferentialFlow2D()
3871 //================================================================================================================================
3874 void AliFlowAnalysisWithQCumulants::CalculateWeightedCorrelationsForDifferentialFlow2D(TString type)
3876 // calculate all weighted correlations needed for differential flow
3878 if(type == "RP") // to be improved (removed)
3887 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
3888 Double_t dReQ1n1k = (*fReQ)(0,1);
3889 Double_t dReQ2n2k = (*fReQ)(1,2);
3890 Double_t dReQ1n3k = (*fReQ)(0,3);
3891 //Double_t dReQ4n4k = (*fReQ)(3,4);
3892 Double_t dImQ1n1k = (*fImQ)(0,1);
3893 Double_t dImQ2n2k = (*fImQ)(1,2);
3894 Double_t dImQ1n3k = (*fImQ)(0,3);
3895 //Double_t dImQ4n4k = (*fImQ)(3,4);
3897 // S^M_{p,k} (see .h file for the definition of fSMpk):
3898 Double_t dSM1p1k = (*fSMpk)(0,1);
3899 Double_t dSM1p2k = (*fSMpk)(0,2);
3900 Double_t dSM1p3k = (*fSMpk)(0,3);
3901 Double_t dSM2p1k = (*fSMpk)(1,1);
3902 Double_t dSM3p1k = (*fSMpk)(2,1);
3904 // looping over all (pt,eta) bins and calculating weighted correlations needed for differential flow:
3905 for(Int_t p=1;p<=fnBinsPt;p++)
3907 for(Int_t e=1;e<=fnBinsEta;e++)
3909 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin):
3910 Double_t p1n0kRe = 0.;
3911 Double_t p1n0kIm = 0.;
3913 // number of POIs in particular (pt,eta) bin):
3916 // real and imaginary parts of q_{m*n,k}:
3917 // (weighted Q-vector evaluated for particles which are both RPs and POIs in particular (pt,eta) bin)
3918 Double_t q1n2kRe = 0.;
3919 Double_t q1n2kIm = 0.;
3920 Double_t q2n1kRe = 0.;
3921 Double_t q2n1kIm = 0.;
3923 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
3924 Double_t s1p1k = 0.;
3925 Double_t s1p2k = 0.;
3926 Double_t s1p3k = 0.;
3928 // M0111 from Eq. (118) in QC2c (to be improved (notation))
3929 Double_t dM0111 = 0.;
3934 p1n0kRe = fReEBE2D[1][0][0]->GetBinContent(fReEBE2D[1][0][0]->GetBin(p,e))
3935 * fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e));
3936 p1n0kIm = fImEBE2D[1][0][0]->GetBinContent(fImEBE2D[1][0][0]->GetBin(p,e))
3937 * fImEBE2D[1][0][0]->GetBinEntries(fImEBE2D[1][0][0]->GetBin(p,e));
3939 mp = fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e));
3942 q1n2kRe = fReEBE2D[2][0][2]->GetBinContent(fReEBE2D[2][0][2]->GetBin(p,e))
3943 * fReEBE2D[2][0][2]->GetBinEntries(fReEBE2D[2][0][2]->GetBin(p,e));
3944 q1n2kIm = fImEBE2D[2][0][2]->GetBinContent(fImEBE2D[2][0][2]->GetBin(p,e))
3945 * fImEBE2D[2][0][2]->GetBinEntries(fImEBE2D[2][0][2]->GetBin(p,e));
3946 q2n1kRe = fReEBE2D[2][1][1]->GetBinContent(fReEBE2D[2][1][1]->GetBin(p,e))
3947 * fReEBE2D[2][1][1]->GetBinEntries(fReEBE2D[2][1][1]->GetBin(p,e));
3948 q2n1kIm = fImEBE2D[2][1][1]->GetBinContent(fImEBE2D[2][1][1]->GetBin(p,e))
3949 * fImEBE2D[2][1][1]->GetBinEntries(fImEBE2D[2][1][1]->GetBin(p,e));
3951 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
3952 s1p1k = pow(fs2D[2][1]->GetBinContent(fs2D[2][1]->GetBin(p,e)),1.);
3953 s1p2k = pow(fs2D[2][2]->GetBinContent(fs2D[2][2]->GetBin(p,e)),1.);
3954 s1p3k = pow(fs2D[2][3]->GetBinContent(fs2D[2][3]->GetBin(p,e)),1.);
3956 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
3957 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
3958 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
3959 + 2.*(s1p3k-s1p2k*dSM1p1k));
3961 else if(type == "RP")
3963 p1n0kRe = fReEBE2D[0][0][0]->GetBinContent(fReEBE2D[0][0][0]->GetBin(p,e))
3964 * fReEBE2D[0][0][0]->GetBinEntries(fReEBE2D[0][0][0]->GetBin(p,e));
3965 p1n0kIm = fImEBE2D[0][0][0]->GetBinContent(fImEBE2D[0][0][0]->GetBin(p,e))
3966 * fImEBE2D[0][0][0]->GetBinEntries(fImEBE2D[0][0][0]->GetBin(p,e));
3968 mp = fReEBE2D[0][0][0]->GetBinEntries(fReEBE2D[0][0][0]->GetBin(p,e));
3971 q1n2kRe = fReEBE2D[0][0][2]->GetBinContent(fReEBE2D[0][0][2]->GetBin(p,e))
3972 * fReEBE2D[0][0][2]->GetBinEntries(fReEBE2D[0][0][2]->GetBin(p,e));
3973 q1n2kIm = fImEBE2D[0][0][2]->GetBinContent(fImEBE2D[0][0][2]->GetBin(p,e))
3974 * fImEBE2D[0][0][2]->GetBinEntries(fImEBE2D[0][0][2]->GetBin(p,e));
3975 q2n1kRe = fReEBE2D[0][1][1]->GetBinContent(fReEBE2D[0][1][1]->GetBin(p,e))
3976 * fReEBE2D[0][1][1]->GetBinEntries(fReEBE2D[0][1][1]->GetBin(p,e));
3977 q2n1kIm = fImEBE2D[0][1][1]->GetBinContent(fImEBE2D[0][1][1]->GetBin(p,e))
3978 * fImEBE2D[0][1][1]->GetBinEntries(fImEBE2D[0][1][1]->GetBin(p,e));
3980 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
3981 s1p1k = pow(fs2D[0][1]->GetBinContent(fs2D[0][1]->GetBin(p,e)),1.);
3982 s1p2k = pow(fs2D[0][2]->GetBinContent(fs2D[0][2]->GetBin(p,e)),1.);
3983 s1p3k = pow(fs2D[0][3]->GetBinContent(fs2D[0][3]->GetBin(p,e)),1.);
3985 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
3986 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
3987 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
3988 + 2.*(s1p3k-s1p2k*dSM1p1k));
3989 //...............................................................................................
3992 // 2'-particle correlation:
3993 Double_t two1n1nW0W1PtEta = 0.;
3994 if(mp*dSM1p1k-s1p1k)
3996 two1n1nW0W1PtEta = (p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k-s1p1k)
3997 / (mp*dSM1p1k-s1p1k);
3999 // fill the 2D profile to get the average correlation for each (pt, eta) bin:
4002 //f2pPtEtaPOIW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,
4003 // mp*dSM1p1k-s1p1k);
4004 fCorrelationsPro[1][1][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,mp*dSM1p1k-s1p1k);
4006 else if(type == "RP")
4008 //f2pPtEtaRPW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,
4009 // mp*dSM1p1k-s1p1k);
4010 fCorrelationsPro[0][1][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,mp*dSM1p1k-s1p1k);
4012 } // end of if(mp*dMult-dmPrimePrimePtEta)
4014 // 4'-particle correlation:
4015 Double_t four1n1n1n1nW0W1W1W1PtEta = 0.;
4018 four1n1n1n1nW0W1W1W1PtEta = ((pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
4019 - q2n1kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))
4020 - 2.*q2n1kIm*dReQ1n1k*dImQ1n1k
4021 - p1n0kRe*(dReQ1n1k*dReQ2n2k+dImQ1n1k*dImQ2n2k)
4022 + p1n0kIm*(dImQ1n1k*dReQ2n2k-dReQ1n1k*dImQ2n2k)
4023 - 2.*dSM1p2k*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
4024 - 2.*(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*s1p1k
4025 + 6.*(q1n2kRe*dReQ1n1k+q1n2kIm*dImQ1n1k)
4026 + 1.*(q2n1kRe*dReQ2n2k+q2n1kIm*dImQ2n2k)
4027 + 2.*(p1n0kRe*dReQ1n3k+p1n0kIm*dImQ1n3k)
4030 / dM0111; // to be imropoved (notation of dM0111)
4032 // fill the 2D profile to get the average correlation for each (pt, eta) bin:
4035 //f4pPtEtaPOIW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);
4036 fCorrelationsPro[1][1][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);
4038 else if(type == "RP")
4040 //f4pPtEtaRPW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);
4041 fCorrelationsPro[0][1][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);
4043 } // end of if(dM0111)
4045 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
4046 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
4051 } // end of AliFlowAnalysisWithQCumulants::CalculateWeightedCorrelationsForDifferentialFlow2D(TString type)
4054 //================================================================================================================================
4059 void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsForDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights)
4061 // 1.) Access average for 2D correlations from profiles and store them in 2D final results histograms;
4062 // 2.) Access spread for 2D correlations from profiles, calculate error and store it in 2D final results histograms;
4063 // 3.) Make projections along pt and eta axis and store results and errors in 1D final results histograms.
4065 Int_t typeFlag = -1;
4066 Int_t pWeightsFlag = -1;
4067 Int_t eWeightsFlag = -1;
4072 } else if(type == "POI")
4077 cout<<"WARNING: type must be either RP or POI in AFAWQC::FCFDF() !!!!"<<endl;
4081 if(!useParticleWeights)
4089 if(eventWeights == "exact")
4096 Int_t pW = pWeightsFlag;
4097 Int_t eW = eWeightsFlag;
4099 // from 2D histogram fNonEmptyBins2D make two 1D histograms fNonEmptyBins1D in pt and eta (to be improved (i.e. moved somewhere else))
4101 for(Int_t p=1;p<fnBinsPt;p++)
4103 Double_t contentPt = 0.;
4104 for(Int_t e=1;e<=fnBinsEta;e++)
4106 contentPt += (fNonEmptyBins2D[t]->GetBinContent(fNonEmptyBins2D[t]->GetBin(p,e)));
4108 fNonEmptyBins1D[t][0]->SetBinContent(p,contentPt);
4111 for(Int_t e=1;e<fnBinsEta;e++)
4113 Double_t contentEta = 0.;
4114 for(Int_t p=1;p<=fnBinsPt;p++)
4116 contentEta += (fNonEmptyBins2D[t]->GetBinContent(fNonEmptyBins2D[t]->GetBin(p,e)));
4118 fNonEmptyBins1D[t][1]->SetBinContent(e,contentEta);
4121 // from 2D profile in (pt,eta) make two 1D profiles in (pt) and (eta):
4122 TProfile *profile[2][4]; // [0=pt,1=eta][correlation index] // to be improved (do not hardwire the correlation index)
4124 for(Int_t pe=0;pe<2;pe++) // pt or eta
4126 for(Int_t ci=0;ci<4;ci++) // correlation index
4128 if(pe==0) profile[pe][ci] = this->MakePtProjection(fCorrelationsPro[t][pW][eW][ci]);
4129 if(pe==1) profile[pe][ci] = this->MakeEtaProjection(fCorrelationsPro[t][pW][eW][ci]);
4133 // transfer 2D profile into 2D histogram:
4134 // to be improved (see in documentation if there is a method to transfer values from 2D profile into 2D histogram)
4135 for(Int_t ci=0;ci<4;ci++)
4137 for(Int_t p=1;p<=fnBinsPt;p++)
4139 for(Int_t e=1;e<=fnBinsEta;e++)
4141 Double_t correlation = fCorrelationsPro[t][pW][eW][ci]->GetBinContent(fCorrelationsPro[t][pW][eW][ci]->GetBin(p,e));
4142 Double_t spread = fCorrelationsPro[t][pW][eW][ci]->GetBinError(fCorrelationsPro[t][pW][eW][ci]->GetBin(p,e));
4143 Double_t nEvts = fNonEmptyBins2D[t]->GetBinContent(fNonEmptyBins2D[t]->GetBin(p,e));
4144 Double_t error = 0.;
4145 fFinalCorrelations2D[t][pW][eW][ci]->SetBinContent(fFinalCorrelations2D[t][pW][eW][ci]->GetBin(p,e),correlation);
4148 error = spread/pow(nEvts,0.5);
4149 fFinalCorrelations2D[t][pW][eW][ci]->SetBinError(fFinalCorrelations2D[t][pW][eW][ci]->GetBin(p,e),error);
4151 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
4152 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
4153 } // end of for(Int_t ci=0;ci<4;ci++)
4155 // transfer 1D profile into 1D histogram (pt):
4156 // to be improved (see in documentation if there is a method to transfer values from 1D profile into 1D histogram)
4157 for(Int_t ci=0;ci<4;ci++)
4159 for(Int_t p=1;p<=fnBinsPt;p++)
4163 Double_t correlation = profile[0][ci]->GetBinContent(p);
4164 Double_t spread = profile[0][ci]->GetBinError(p);
4165 Double_t nEvts = fNonEmptyBins1D[t][0]->GetBinContent(p);
4166 Double_t error = 0.;
4167 fFinalCorrelations1D[t][pW][eW][0][ci]->SetBinContent(p,correlation);
4170 error = spread/pow(nEvts,0.5);
4171 fFinalCorrelations1D[t][pW][eW][0][ci]->SetBinError(p,error);
4174 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
4175 } // end of for(Int_t ci=0;ci<4;ci++)
4177 // transfer 1D profile into 1D histogram (eta):
4178 // to be improved (see in documentation if there is a method to transfer values from 1D profile into 1D histogram)
4179 for(Int_t ci=0;ci<4;ci++)
4181 for(Int_t e=1;e<=fnBinsEta;e++)
4185 Double_t correlation = profile[1][ci]->GetBinContent(e);
4186 fFinalCorrelations1D[t][pW][eW][1][ci]->SetBinContent(e,correlation);
4188 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
4189 } // end of for(Int_t ci=0;ci<4;ci++)
4191 } // end of void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsForDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights)
4195 //================================================================================================================================
4198 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulants(TString type, TString ptOrEta)
4200 // calcualate cumulants for differential flow from measured correlations
4201 // Remark: cumulants calculated here are NOT corrected for non-uniform acceptance. This correction is applied in the method ...
4202 // to be improved (description)
4204 Int_t typeFlag = -1;
4205 Int_t ptEtaFlag = -1;
4210 } else if(type == "POI")
4218 } else if(ptOrEta == "Eta")
4225 Int_t pe = ptEtaFlag;
4228 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
4230 // correlation <<2>>:
4231 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1);
4234 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
4236 // reduced correlations:
4237 Double_t twoPrime = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b); // <<2'>>(pt)
4238 Double_t fourPrime = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b); // <<4'>>(pt)
4239 // final statistical error of reduced correlations:
4240 //Double_t twoPrimeError = fFinalCorrelations1D[t][pW][eW][0][0]->GetBinError(p);
4242 Double_t qc2Prime = twoPrime; // QC{2'}
4243 //Double_t qc2PrimeError = twoPrimeError; // final stat. error of QC{2'}
4244 fDiffFlowCumulants[t][pe][0]->SetBinContent(b,qc2Prime);
4245 //fFinalCumulantsPt[t][pW][eW][nua][0]->SetBinError(p,qc2PrimeError);
4247 Double_t qc4Prime = fourPrime - 2.*twoPrime*two; // QC{4'} = <<4'>> - 2*<<2'>><<2>>
4248 fDiffFlowCumulants[t][pe][1]->SetBinContent(b,qc4Prime);
4249 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
4254 // to be improved (see documentation if I can do all this without looping)
4255 for(Int_t p=1;p<=fnBinsPt;p++)
4257 for(Int_t e=1;e<=fnBinsEta;e++)
4259 // reduced correlations:
4260 Double_t twoPrime = fFinalCorrelations2D[t][pW][eW][0]->GetBinContent(fFinalCorrelations2D[t][pW][eW][0]->GetBin(p,e)); // <<2'>>(pt,eta)
4261 Double_t fourPrime = fFinalCorrelations2D[t][pW][eW][1]->GetBinContent(fFinalCorrelations2D[t][pW][eW][1]->GetBin(p,e)); // <<4'>>(pt,eta)
4262 for(Int_t nua=0;nua<2;nua++)
4265 Double_t qc2Prime = twoPrime; // QC{2'} = <<2'>>
4266 fFinalCumulants2D[t][pW][eW][nua][0]->SetBinContent(fFinalCumulants2D[t][pW][eW][nua][0]->GetBin(p,e),qc2Prime);
4268 Double_t qc4Prime = fourPrime - 2.*twoPrime*two; // QC{4'} = <<4'>> - 2*<<2'>><<2>>
4269 fFinalCumulants2D[t][pW][eW][nua][1]->SetBinContent(fFinalCumulants2D[t][pW][eW][nua][1]->GetBin(p,e),qc4Prime);
4270 } // end of for(Int_t nua=0;nua<2;nua++)
4271 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
4272 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
4275 } // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulants(TString type, Bool_t useParticleWeights, TString eventWeights);
4278 //================================================================================================================================
4281 void AliFlowAnalysisWithQCumulants::CalculateFinalResultsForRPandPOIIntegratedFlow(TString type)
4283 // calculate final results for integrated flow of RPs and POIs
4285 Int_t typeFlag = -1;
4290 } else if(type == "POI")
4295 cout<<"WARNING: type must be either RP or POI in AFAWQC::CDF() !!!!"<<endl;
4303 TH1F *yield2ndPt = NULL;
4304 TH1F *yield4thPt = NULL;
4305 TH1F *yield6thPt = NULL;
4306 TH1F *yield8thPt = NULL;
4310 yield2ndPt = (TH1F*)(fCommonHists2nd->GetHistPtPOI())->Clone();
4311 yield4thPt = (TH1F*)(fCommonHists4th->GetHistPtPOI())->Clone();
4312 yield6thPt = (TH1F*)(fCommonHists6th->GetHistPtPOI())->Clone();
4313 yield8thPt = (TH1F*)(fCommonHists8th->GetHistPtPOI())->Clone();
4315 else if(type == "RP")
4317 yield2ndPt = (TH1F*)(fCommonHists2nd->GetHistPtRP())->Clone();
4318 yield4thPt = (TH1F*)(fCommonHists4th->GetHistPtRP())->Clone();
4319 yield6thPt = (TH1F*)(fCommonHists6th->GetHistPtRP())->Clone();
4320 yield8thPt = (TH1F*)(fCommonHists8th->GetHistPtRP())->Clone();
4323 Int_t nBinsPt = yield2ndPt->GetNbinsX();
4325 TH1D *flow2ndPt = NULL;
4326 TH1D *flow4thPt = NULL;
4327 TH1D *flow6thPt = NULL;
4328 TH1D *flow8thPt = NULL;
4330 // to be improved (hardwired pt index)
4331 flow2ndPt = (TH1D*)fDiffFlow[t][0][0]->Clone();
4332 flow4thPt = (TH1D*)fDiffFlow[t][0][1]->Clone();
4333 flow6thPt = (TH1D*)fDiffFlow[t][0][2]->Clone();
4334 flow8thPt = (TH1D*)fDiffFlow[t][0][3]->Clone();
4336 Double_t dvn2nd = 0., dvn4th = 0., dvn6th = 0., dvn8th = 0.; // differential flow
4337 Double_t dErrvn2nd = 0., dErrvn4th = 0., dErrvn6th = 0., dErrvn8th = 0.; // error on differential flow
4339 Double_t dVn2nd = 0., dVn4th = 0., dVn6th = 0., dVn8th = 0.; // integrated flow
4340 Double_t dErrVn2nd = 0., dErrVn4th = 0., dErrVn6th = 0., dErrVn8th = 0.; // error on integrated flow
4342 Double_t dYield2nd = 0., dYield4th = 0., dYield6th = 0., dYield8th = 0.; // pt yield
4343 Double_t dSum2nd = 0., dSum4th = 0., dSum6th = 0., dSum8th = 0.; // needed for normalizing integrated flow
4345 // looping over pt bins:
4346 for(Int_t p=1;p<nBinsPt+1;p++)
4348 dvn2nd = flow2ndPt->GetBinContent(p);
4349 dvn4th = flow4thPt->GetBinContent(p);
4350 dvn6th = flow6thPt->GetBinContent(p);
4351 dvn8th = flow8thPt->GetBinContent(p);
4353 dErrvn2nd = flow2ndPt->GetBinError(p);
4354 dErrvn4th = flow4thPt->GetBinError(p);
4355 dErrvn6th = flow6thPt->GetBinError(p);
4356 dErrvn8th = flow8thPt->GetBinError(p);
4358 dYield2nd = yield2ndPt->GetBinContent(p);
4359 dYield4th = yield4thPt->GetBinContent(p);
4360 dYield6th = yield6thPt->GetBinContent(p);
4361 dYield8th = yield8thPt->GetBinContent(p);
4363 dVn2nd += dvn2nd*dYield2nd;
4364 dVn4th += dvn4th*dYield4th;
4365 dVn6th += dvn6th*dYield6th;
4366 dVn8th += dvn8th*dYield8th;
4368 dSum2nd += dYield2nd;
4369 dSum4th += dYield4th;
4370 dSum6th += dYield6th;
4371 dSum8th += dYield8th;
4373 dErrVn2nd += dYield2nd*dYield2nd*dErrvn2nd*dErrvn2nd; // ro be improved (check this relation)
4374 dErrVn4th += dYield4th*dYield4th*dErrvn4th*dErrvn4th;
4375 dErrVn6th += dYield6th*dYield6th*dErrvn6th*dErrvn6th;
4376 dErrVn8th += dYield8th*dYield8th*dErrvn8th*dErrvn8th;
4378 } // end of for(Int_t p=1;p<nBinsPt+1;p++)
4380 // normalizing the results for integrated flow:
4384 dErrVn2nd /= (dSum2nd*dSum2nd);
4385 dErrVn2nd = TMath::Sqrt(dErrVn2nd);
4390 dErrVn4th /= (dSum4th*dSum4th);
4391 dErrVn4th = TMath::Sqrt(dErrVn4th);
4393 //if(dSum6th) dVn6th/=dSum6th;
4394 //if(dSum8th) dVn8th/=dSum8th;
4396 // storing the results for integrated flow in common histos: (to be improved: new method for this?)
4399 fCommonHistsResults2nd->FillIntegratedFlowPOI(dVn2nd,dErrVn2nd);
4400 fCommonHistsResults4th->FillIntegratedFlowPOI(dVn4th,dErrVn4th);
4401 fCommonHistsResults6th->FillIntegratedFlowPOI(dVn6th,0.); // to be improved (errors)
4402 fCommonHistsResults8th->FillIntegratedFlowPOI(dVn8th,0.); // to be improved (errors)
4404 else if (type == "RP")
4406 fCommonHistsResults2nd->FillIntegratedFlowRP(dVn2nd,dErrVn2nd);
4407 fCommonHistsResults4th->FillIntegratedFlowRP(dVn4th,dErrVn4th);
4408 fCommonHistsResults6th->FillIntegratedFlowRP(dVn6th,0.); // to be improved (errors)
4409 fCommonHistsResults8th->FillIntegratedFlowRP(dVn8th,0.); // to be improved (errors)
4422 } // end of AliFlowAnalysisWithQCumulants::CalculateFinalResultsForRPandPOIIntegratedFlow(TString type)
4425 //================================================================================================================================
4428 void AliFlowAnalysisWithQCumulants::InitializeArraysForDistributions()
4430 // Initialize all arrays used for distributions.
4432 // a) Initialize arrays of histograms used to hold distributions of correlations;
4433 // b) Initialize array to hold min and max values of correlations.
4435 // a) Initialize arrays of histograms used to hold distributions of correlations:
4436 for(Int_t di=0;di<4;di++) // distribution index
4438 fDistributions[di] = NULL;
4441 // b) Initialize default min and max values of correlations:
4442 // (Remark: The default values bellow were chosen for v2=5% and M=500)
4443 fMinValueOfCorrelation[0] = -0.01; // <2>_min
4444 fMaxValueOfCorrelation[0] = 0.04; // <2>_max
4445 fMinValueOfCorrelation[1] = -0.00002; // <4>_min
4446 fMaxValueOfCorrelation[1] = 0.00015; // <4>_max
4447 fMinValueOfCorrelation[2] = -0.0000003; // <6>_min
4448 fMaxValueOfCorrelation[2] = 0.0000006; // <6>_max
4449 fMinValueOfCorrelation[3] = -0.000000006; // <8>_min
4450 fMaxValueOfCorrelation[3] = 0.000000003; // <8>_max
4452 } // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForDistributions()
4455 //================================================================================================================================
4458 void AliFlowAnalysisWithQCumulants::BookEverythingForDistributions()
4460 // a) Book profile to hold all flags for distributions of correlations;
4461 // b) Book all histograms to hold distributions of correlations.
4463 TString correlationIndex[4] = {"<2>","<4>","<6>","<8>"}; // to be improved (should I promote this to data members?)
4465 // a) Book profile to hold all flags for distributions of correlations:
4466 TString distributionsFlagsName = "fDistributionsFlags";
4467 distributionsFlagsName += fAnalysisLabel->Data();
4468 fDistributionsFlags = new TProfile(distributionsFlagsName.Data(),"Flags for Distributions of Correlations",9,0,9);
4469 fDistributionsFlags->SetTickLength(-0.01,"Y");
4470 fDistributionsFlags->SetMarkerStyle(25);
4471 fDistributionsFlags->SetLabelSize(0.05);
4472 fDistributionsFlags->SetLabelOffset(0.02,"Y");
4473 fDistributionsFlags->GetXaxis()->SetBinLabel(1,"Store or not?");
4474 fDistributionsFlags->GetXaxis()->SetBinLabel(2,"<2>_{min}");
4475 fDistributionsFlags->GetXaxis()->SetBinLabel(3,"<2>_{max}");
4476 fDistributionsFlags->GetXaxis()->SetBinLabel(4,"<4>_{min}");
4477 fDistributionsFlags->GetXaxis()->SetBinLabel(5,"<4>_{max}");
4478 fDistributionsFlags->GetXaxis()->SetBinLabel(6,"<6>_{min}");
4479 fDistributionsFlags->GetXaxis()->SetBinLabel(7,"<6>_{max}");
4480 fDistributionsFlags->GetXaxis()->SetBinLabel(8,"<8>_{min}");
4481 fDistributionsFlags->GetXaxis()->SetBinLabel(9,"<8>_{max}");
4482 fDistributionsList->Add(fDistributionsFlags);
4484 // b) Book all histograms to hold distributions of correlations.
4485 if(fStoreDistributions)
4487 TString distributionsName = "fDistributions";
4488 distributionsName += fAnalysisLabel->Data();
4489 for(Int_t di=0;di<4;di++) // distribution index
4491 fDistributions[di] = new TH1D(Form("Distribution of %s",correlationIndex[di].Data()),Form("Distribution of %s",correlationIndex[di].Data()),10000,fMinValueOfCorrelation[di],fMaxValueOfCorrelation[di]);
4492 fDistributions[di]->SetXTitle(correlationIndex[di].Data());
4493 fDistributionsList->Add(fDistributions[di]);
4494 } // end of for(Int_t di=0;di<4;di++) // distribution index
4495 } // end of if(fStoreDistributions)
4497 } // end of void AliFlowAnalysisWithQCumulants::BookEverythingForDistributions()
4500 //================================================================================================================================
4503 void AliFlowAnalysisWithQCumulants::StoreFlagsForDistributions()
4505 // Store all flags for distributiuons of correlations in profile fDistributionsFlags.
4507 if(!fDistributionsFlags)
4509 cout<<"WARNING: fDistributionsFlags is NULL in AFAWQC::SDF() !!!!"<<endl;
4513 fDistributionsFlags->Fill(0.5,(Int_t)fStoreDistributions); // histos with distributions of correlations stored or not in the output file
4514 // store min and max values of correlations:
4515 for(Int_t di=0;di<4;di++) // distribution index
4517 fDistributionsFlags->Fill(1.5+2.*(Double_t)di,fMinValueOfCorrelation[di]);
4518 fDistributionsFlags->Fill(2.5+2.*(Double_t)di,fMaxValueOfCorrelation[di]);
4521 } // end of void AliFlowAnalysisWithQCumulants::StoreFlagsForDistributions()
4524 //================================================================================================================================
4527 void AliFlowAnalysisWithQCumulants::StoreDistributionsOfCorrelations()
4529 // Store distributions of correlations.
4531 if(!(fIntFlowCorrelationsEBE && fIntFlowEventWeightsForCorrelationsEBE))
4533 cout<<"WARNING: fIntFlowCorrelationsEBE && fIntFlowEventWeightsForCorrelationsEBE"<<endl;
4534 cout<<" is NULL in AFAWQC::SDOC() !!!!"<<endl;
4538 for(Int_t di=0;di<4;di++) // distribution index
4540 if(!fDistributions[di])
4542 cout<<"WARNING: fDistributions[di] is NULL in AFAWQC::SDOC() !!!!"<<endl;
4543 cout<<"di = "<<di<<endl;
4547 fDistributions[di]->Fill(fIntFlowCorrelationsEBE->GetBinContent(di+1),fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(di+1));
4549 } // end of for(Int_t di=0;di<4;di++) // distribution index
4551 } // end of void AliFlowAnalysisWithQCumulants::StoreDistributionsOfCorrelations()
4554 //================================================================================================================================
4557 void AliFlowAnalysisWithQCumulants::BookAndNestAllLists()
4559 // Book and nest all lists nested in the base list fHistList.
4560 // a) Book and nest lists for integrated flow;
4561 // b) Book and nest lists for differential flow;
4562 // c) Book and nest list for particle weights;
4563 // d) Book and nest list for distributions;
4564 // e) Book and nest list for nested loops;
4566 // a) Book and nest all lists for integrated flow:
4567 // base list for integrated flow:
4568 fIntFlowList = new TList();
4569 fIntFlowList->SetName("Integrated Flow");
4570 fIntFlowList->SetOwner(kTRUE);
4571 fHistList->Add(fIntFlowList);
4572 // list holding profiles:
4573 fIntFlowProfiles = new TList();
4574 fIntFlowProfiles->SetName("Profiles");
4575 fIntFlowProfiles->SetOwner(kTRUE);
4576 fIntFlowList->Add(fIntFlowProfiles);
4577 // list holding histograms with results:
4578 fIntFlowResults = new TList();
4579 fIntFlowResults->SetName("Results");
4580 fIntFlowResults->SetOwner(kTRUE);
4581 fIntFlowList->Add(fIntFlowResults);
4583 // b) Book and nest lists for differential flow;
4584 fDiffFlowList = new TList();
4585 fDiffFlowList->SetName("Differential Flow");
4586 fDiffFlowList->SetOwner(kTRUE);
4587 fHistList->Add(fDiffFlowList);
4588 // list holding profiles:
4589 fDiffFlowProfiles = new TList();
4590 fDiffFlowProfiles->SetName("Profiles");
4591 fDiffFlowProfiles->SetOwner(kTRUE);
4592 fDiffFlowList->Add(fDiffFlowProfiles);
4593 // list holding histograms with results:
4594 fDiffFlowResults = new TList();
4595 fDiffFlowResults->SetName("Results");
4596 fDiffFlowResults->SetOwner(kTRUE);
4597 fDiffFlowList->Add(fDiffFlowResults);
4598 // flags used for naming nested lists in list fDiffFlowProfiles and fDiffFlowResults:
4600 list.SetOwner(kTRUE);
4601 TString typeFlag[2] = {"RP","POI"};
4602 TString ptEtaFlag[2] = {"p_{T}","#eta"};
4603 TString powerFlag[2] = {"linear","quadratic"};
4604 // nested lists in fDiffFlowProfiles (~/Differential Flow/Profiles):
4605 for(Int_t t=0;t<2;t++) // type: RP or POI
4607 for(Int_t pe=0;pe<2;pe++) // pt or eta
4609 // list holding profiles with correlations:
4610 fDiffFlowCorrelationsProList[t][pe] = (TList*)list.Clone();
4611 fDiffFlowCorrelationsProList[t][pe]->SetName(Form("Profiles with correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
4612 fDiffFlowProfiles->Add(fDiffFlowCorrelationsProList[t][pe]);
4613 // list holding profiles with products of correlations:
4614 fDiffFlowProductOfCorrelationsProList[t][pe] = (TList*)list.Clone();
4615 fDiffFlowProductOfCorrelationsProList[t][pe]->SetName(Form("Profiles with products of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
4616 fDiffFlowProfiles->Add(fDiffFlowProductOfCorrelationsProList[t][pe]);
4617 // list holding profiles with corrections:
4618 fDiffFlowCorrectionsProList[t][pe] = (TList*)list.Clone();
4619 fDiffFlowCorrectionsProList[t][pe]->SetName(Form("Profiles with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
4620 fDiffFlowProfiles->Add(fDiffFlowCorrectionsProList[t][pe]);
4621 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
4622 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
4623 // nested lists in fDiffFlowResults (~/Differential Flow/Results):
4624 for(Int_t t=0;t<2;t++) // type: RP or POI
4626 for(Int_t pe=0;pe<2;pe++) // pt or eta
4628 // list holding histograms with correlations:
4629 fDiffFlowCorrelationsHistList[t][pe] = (TList*)list.Clone();
4630 fDiffFlowCorrelationsHistList[t][pe]->SetName(Form("Correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
4631 fDiffFlowResults->Add(fDiffFlowCorrelationsHistList[t][pe]);
4632 // list holding histograms with corrections:
4633 fDiffFlowCorrectionsHistList[t][pe] = (TList*)list.Clone();
4634 fDiffFlowCorrectionsHistList[t][pe]->SetName(Form("Histograms with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
4635 fDiffFlowResults->Add(fDiffFlowCorrectionsHistList[t][pe]);
4636 for(Int_t power=0;power<2;power++)
4638 // list holding histograms with sums of event weights:
4639 fDiffFlowSumOfEventWeightsHistList[t][pe][power] = (TList*)list.Clone();
4640 fDiffFlowSumOfEventWeightsHistList[t][pe][power]->SetName(Form("Sum of %s event weights (%s, %s)",powerFlag[power].Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data()));
4641 fDiffFlowResults->Add(fDiffFlowSumOfEventWeightsHistList[t][pe][power]);
4642 } // end of for(Int_t power=0;power<2;power++)
4643 // list holding histograms with sums of products of event weights:
4644 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe] = (TList*)list.Clone();
4645 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]->SetName(Form("Sum of products of event weights (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
4646 fDiffFlowResults->Add(fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]);
4647 // list holding histograms with covariances of correlations:
4648 fDiffFlowCovariancesHistList[t][pe] = (TList*)list.Clone();
4649 fDiffFlowCovariancesHistList[t][pe]->SetName(Form("Covariances of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
4650 fDiffFlowResults->Add(fDiffFlowCovariancesHistList[t][pe]);
4651 // list holding histograms with differential Q-cumulants:
4652 fDiffFlowCumulantsHistList[t][pe] = (TList*)list.Clone();
4653 fDiffFlowCumulantsHistList[t][pe]->SetName(Form("Differential Q-cumulants (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
4654 fDiffFlowResults->Add(fDiffFlowCumulantsHistList[t][pe]);
4655 // list holding histograms with differential flow estimates from Q-cumulants:
4656 fDiffFlowHistList[t][pe] = (TList*)list.Clone();
4657 fDiffFlowHistList[t][pe]->SetName(Form("Differential flow (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
4658 fDiffFlowResults->Add(fDiffFlowHistList[t][pe]);
4659 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
4660 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
4662 // c) Book and nest list for particle weights:
4663 fWeightsList->SetName("Weights");
4664 fWeightsList->SetOwner(kTRUE);
4665 fHistList->Add(fWeightsList);
4667 // d) Book and nest list for distributions:
4668 fDistributionsList = new TList();
4669 fDistributionsList->SetName("Distributions");
4670 fDistributionsList->SetOwner(kTRUE);
4671 fHistList->Add(fDistributionsList);
4673 // e) Book and nest list for nested loops:
4674 fNestedLoopsList = new TList();
4675 fNestedLoopsList->SetName("Nested Loops");
4676 fNestedLoopsList->SetOwner(kTRUE);
4677 fHistList->Add(fNestedLoopsList);
4679 } // end of void AliFlowAnalysisWithQCumulants::BookAndNestAllLists()
4682 //================================================================================================================================
4685 void AliFlowAnalysisWithQCumulants::FillCommonHistResultsDiffFlow(TString type)
4687 // fill common result histograms for differential flow
4689 Int_t typeFlag = -1;
4690 //Int_t ptEtaFlag = -1;
4695 } else if(type == "POI")
4702 //Int_t pe = ptEtaFlag;
4704 // to be improved (implement protection here)
4706 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
4708 cout<<"WARNING: fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th"<<endl;
4709 cout<<" is NULL in AFAWQC::FCHRIF() !!!!"<<endl;
4714 for(Int_t p=1;p<=fnBinsPt;p++)
4716 Double_t v2 = fDiffFlow[t][0][0]->GetBinContent(p);
4717 Double_t v4 = fDiffFlow[t][0][1]->GetBinContent(p);
4718 Double_t v6 = fDiffFlow[t][0][2]->GetBinContent(p);
4719 Double_t v8 = fDiffFlow[t][0][3]->GetBinContent(p);
4721 Double_t v2Error = fDiffFlow[t][0][0]->GetBinError(p);
4722 Double_t v4Error = fDiffFlow[t][0][1]->GetBinError(p);
4723 //Double_t v6Error = fFinalFlow1D[t][pW][nua][0][2]->GetBinError(p);
4724 //Double_t v8Error = fFinalFlow1D[t][pW][nua][0][3]->GetBinError(p);
4728 fCommonHistsResults2nd->FillDifferentialFlowPtRP(p,v2,v2Error);
4729 fCommonHistsResults4th->FillDifferentialFlowPtRP(p,v4,v4Error);
4730 fCommonHistsResults6th->FillDifferentialFlowPtRP(p,v6,0.);
4731 fCommonHistsResults8th->FillDifferentialFlowPtRP(p,v8,0.);
4732 } else if(type == "POI")
4734 fCommonHistsResults2nd->FillDifferentialFlowPtPOI(p,v2,v2Error);
4735 fCommonHistsResults4th->FillDifferentialFlowPtPOI(p,v4,v4Error);
4736 fCommonHistsResults6th->FillDifferentialFlowPtPOI(p,v6,0.);
4737 fCommonHistsResults8th->FillDifferentialFlowPtPOI(p,v8,0.);
4739 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
4742 for(Int_t e=1;e<=fnBinsEta;e++)
4744 Double_t v2 = fDiffFlow[t][1][0]->GetBinContent(e);
4745 Double_t v4 = fDiffFlow[t][1][1]->GetBinContent(e);
4746 Double_t v6 = fDiffFlow[t][1][2]->GetBinContent(e);
4747 Double_t v8 = fDiffFlow[t][1][3]->GetBinContent(e);
4749 Double_t v2Error = fDiffFlow[t][1][0]->GetBinError(e);
4750 Double_t v4Error = fDiffFlow[t][1][1]->GetBinError(e);
4751 //Double_t v6Error = fDiffFlow[t][1][2]->GetBinError(e);
4752 //Double_t v8Error = fDiffFlow[t][1][3]->GetBinError(e);
4756 fCommonHistsResults2nd->FillDifferentialFlowEtaRP(e,v2,v2Error);
4757 fCommonHistsResults4th->FillDifferentialFlowEtaRP(e,v4,v4Error);
4758 fCommonHistsResults6th->FillDifferentialFlowEtaRP(e,v6,0.);
4759 fCommonHistsResults8th->FillDifferentialFlowEtaRP(e,v8,0.);
4760 } else if(type == "POI")
4762 fCommonHistsResults2nd->FillDifferentialFlowEtaPOI(e,v2,v2Error);
4763 fCommonHistsResults4th->FillDifferentialFlowEtaPOI(e,v4,v4Error);
4764 fCommonHistsResults6th->FillDifferentialFlowEtaPOI(e,v6,0.);
4765 fCommonHistsResults8th->FillDifferentialFlowEtaPOI(e,v8,0.);
4767 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
4769 } // end of void AliFlowAnalysisWithQCumulants::FillCommonHistResultsDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights, Bool_t correctedForNUA)
4772 //================================================================================================================================
4775 void AliFlowAnalysisWithQCumulants::AccessConstants()
4777 // Access needed common constants from AliFlowCommonConstants
4779 fnBinsPhi = AliFlowCommonConstants::GetMaster()->GetNbinsPhi();
4780 fPhiMin = AliFlowCommonConstants::GetMaster()->GetPhiMin();
4781 fPhiMax = AliFlowCommonConstants::GetMaster()->GetPhiMax();
4782 if(fnBinsPhi) fPhiBinWidth = (fPhiMax-fPhiMin)/fnBinsPhi;
4783 fnBinsPt = AliFlowCommonConstants::GetMaster()->GetNbinsPt();
4784 fPtMin = AliFlowCommonConstants::GetMaster()->GetPtMin();
4785 fPtMax = AliFlowCommonConstants::GetMaster()->GetPtMax();
4786 if(fnBinsPt) fPtBinWidth = (fPtMax-fPtMin)/fnBinsPt;
4787 fnBinsEta = AliFlowCommonConstants::GetMaster()->GetNbinsEta();
4788 fEtaMin = AliFlowCommonConstants::GetMaster()->GetEtaMin();
4789 fEtaMax = AliFlowCommonConstants::GetMaster()->GetEtaMax();
4790 if(fnBinsEta) fEtaBinWidth = (fEtaMax-fEtaMin)/fnBinsEta;
4792 } // end of void AliFlowAnalysisWithQCumulants::AccessConstants()
4795 //================================================================================================================================
4798 void AliFlowAnalysisWithQCumulants::CrossCheckSettings()
4800 // a) Cross check if the choice for multiplicity weights make sense;
4802 // a) Cross check if the choice for multiplicity weights make sense:
4803 if(strcmp(fMultiplicityWeight->Data(),"combinations") &&
4804 strcmp(fMultiplicityWeight->Data(),"unit") &&
4805 strcmp(fMultiplicityWeight->Data(),"multiplicity"))
4807 cout<<"WARNING (QC): Multiplicity weight can be either \"combinations\", \"unit\""<<endl;
4808 cout<<" or \"multiplicity\". Certainly not \""<<fMultiplicityWeight->Data()<<"\"."<<endl;
4812 } // end of void AliFlowAnalysisWithQCumulants::CrossCheckSettings()
4815 //================================================================================================================================
4818 void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeights()
4820 // Calculate sum of linear and quadratic event weights for correlations
4824 Double_t dMult = (*fSMpk)(0,0); // multiplicity
4826 Double_t eventWeight[4] = {0};
4828 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
4830 eventWeight[0] = dMult*(dMult-1); // event weight for <2>
4831 eventWeight[1] = dMult*(dMult-1)*(dMult-2)*(dMult-3); // event weight for <4>
4832 eventWeight[2] = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5); // event weight for <6>
4833 eventWeight[3] = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7); // event weight for <8>
4836 eventWeight[0] = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j;
4837 eventWeight[1] = (*fSMpk)(3,1)-6.*(*fSMpk)(0,2)*(*fSMpk)(1,1)
4838 + 8.*(*fSMpk)(0,3)*(*fSMpk)(0,1)
4839 + 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
4840 //eventWeight[2] = ... // to be improved (calculated)
4841 //eventWeight[3] = ... // to be improved (calculated)
4846 for(Int_t p=0;p<2;p++) // power-1
4848 for(Int_t ci=0;ci<4;ci++) // correlation index
4850 fIntFlowSumOfEventWeights[p]->Fill(ci+0.5,pow(fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci+1),p+1));
4854 } // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeights()
4857 //================================================================================================================================
4860 void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfProductOfEventWeights()
4862 // Calculate sum of product of event weights for correlations
4866 Double_t dMult = (*fSMpk)(0,0); // multiplicity
4868 Double_t eventWeight[4] = {0};
4870 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
4872 eventWeight[0] = dMult*(dMult-1); // event weight for <2>
4873 eventWeight[1] = dMult*(dMult-1)*(dMult-2)*(dMult-3); // event weight for <4>
4874 eventWeight[2] = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5); // event weight for <6>
4875 eventWeight[3] = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7); // event weight for <8>
4878 eventWeight[0] = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j;
4879 eventWeight[1] = (*fSMpk)(3,1)-6.*(*fSMpk)(0,2)*(*fSMpk)(1,1)
4880 + 8.*(*fSMpk)(0,3)*(*fSMpk)(0,1)
4881 + 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
4882 //eventWeight[2] = ... // to be improved (calculated)
4883 //eventWeight[3] = ... // to be improved (calculated)
4886 fIntFlowSumOfProductOfEventWeights->Fill(0.5,eventWeight[0]*eventWeight[1]);
4887 fIntFlowSumOfProductOfEventWeights->Fill(1.5,eventWeight[0]*eventWeight[2]);
4888 fIntFlowSumOfProductOfEventWeights->Fill(2.5,eventWeight[0]*eventWeight[3]);
4889 fIntFlowSumOfProductOfEventWeights->Fill(3.5,eventWeight[1]*eventWeight[2]);
4890 fIntFlowSumOfProductOfEventWeights->Fill(4.5,eventWeight[1]*eventWeight[3]);
4891 fIntFlowSumOfProductOfEventWeights->Fill(5.5,eventWeight[2]*eventWeight[3]);
4897 for(Int_t ci1=1;ci1<4;ci1++)
4899 for(Int_t ci2=ci1+1;ci2<=4;ci2++)
4901 fIntFlowSumOfProductOfEventWeights->Fill(0.5+counter++,
4902 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
4908 } // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowIntFlowSumOfProductOfEventWeights()
4911 //================================================================================================================================
4914 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelations(TString type, TString ptOrEta)
4916 // calculate reduced correlations for RPs or POIs in pt or eta bins
4919 Double_t dMult = (*fSMpk)(0,0);
4921 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
4922 Double_t dReQ1n = (*fReQ)(0,0);
4923 Double_t dReQ2n = (*fReQ)(1,0);
4924 //Double_t dReQ3n = (*fReQ)(2,0);
4925 //Double_t dReQ4n = (*fReQ)(3,0);
4926 Double_t dImQ1n = (*fImQ)(0,0);
4927 Double_t dImQ2n = (*fImQ)(1,0);
4928 //Double_t dImQ3n = (*fImQ)(2,0);
4929 //Double_t dImQ4n = (*fImQ)(3,0);
4931 // reduced correlations are stored in fDiffFlowCorrelationsPro[0=RP,1=POI][0=pt,1=eta][correlation index]. Correlation index runs as follows:
4938 Int_t t = -1; // type flag
4939 Int_t pe = -1; // ptEta flag
4944 } else if(type == "POI")
4952 } else if(ptOrEta == "Eta")
4957 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
4958 Double_t minPtEta[2] = {fPtMin,fEtaMin};
4959 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
4960 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
4962 // looping over all bins and calculating reduced correlations:
4963 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
4965 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
4966 Double_t p1n0kRe = 0.;
4967 Double_t p1n0kIm = 0.;
4969 // number of POIs in particular pt or eta bin:
4972 // 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):
4973 Double_t q1n0kRe = 0.;
4974 Double_t q1n0kIm = 0.;
4975 Double_t q2n0kRe = 0.;
4976 Double_t q2n0kIm = 0.;
4978 // number of particles which are both RPs and POIs in particular pt or eta bin:
4984 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))
4985 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));
4986 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))
4987 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));
4988 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))
4989 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));
4990 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))
4991 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b));
4993 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
4995 else if(type == "RP")
4998 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
4999 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
5000 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
5001 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
5002 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))
5003 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));
5004 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))
5005 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b));
5007 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
5013 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
5014 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
5015 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
5016 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
5018 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
5020 t = 1; // typeFlag = RP or POI
5022 else if(type == "RP")
5024 // p_{m*n,0} = q_{m*n,0}:
5030 t = 0; // typeFlag = RP or POI
5033 // 2'-particle correlation for particular (pt,eta) bin:
5034 Double_t two1n1nPtEta = 0.;
5037 two1n1nPtEta = (p1n0kRe*dReQ1n+p1n0kIm*dImQ1n-mq)
5040 if(type == "POI") // to be improved (I do not this if)
5042 // fill profile to get <<2'>> for POIs
5043 fDiffFlowCorrelationsPro[1][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta,mp*dMult-mq);
5044 // histogram to store <2'> for POIs e-b-e (needed in some other methods):
5045 fDiffFlowCorrelationsEBE[1][pe][0]->SetBinContent(b,two1n1nPtEta);
5046 fDiffFlowEventWeightsForCorrelationsEBE[1][pe][0]->SetBinContent(b,mp*dMult-mq);
5048 else if(type == "RP") // to be improved (I do not this if)
5050 // profile to get <<2'>> for RPs:
5051 fDiffFlowCorrelationsPro[0][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta,mp*dMult-mq);
5052 // histogram to store <2'> for RPs e-b-e (needed in some other methods):
5053 fDiffFlowCorrelationsEBE[0][pe][0]->SetBinContent(b,two1n1nPtEta);
5054 fDiffFlowEventWeightsForCorrelationsEBE[0][pe][0]->SetBinContent(b,mp*dMult-mq);
5056 } // end of if(mp*dMult-mq)
5058 // 4'-particle correlation:
5059 Double_t four1n1n1n1nPtEta = 0.;
5060 if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5061 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)
5063 four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
5064 - q2n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))
5065 - 2.*q2n0kIm*dReQ1n*dImQ1n
5066 - p1n0kRe*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)
5067 + p1n0kIm*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)
5068 - 2.*dMult*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
5069 - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*mq
5070 + 6.*(q1n0kRe*dReQ1n+q1n0kIm*dImQ1n)
5071 + 1.*(q2n0kRe*dReQ2n+q2n0kIm*dImQ2n)
5072 + 2.*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
5075 / ((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5076 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
5080 // profile to get <<4'>> for POIs:
5081 fDiffFlowCorrelationsPro[1][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta,
5082 (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5083 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
5084 // histogram to store <4'> for POIs e-b-e (needed in some other methods):
5085 fDiffFlowCorrelationsEBE[1][pe][1]->SetBinContent(b,four1n1n1n1nPtEta);
5086 fDiffFlowEventWeightsForCorrelationsEBE[1][pe][1]->SetBinContent(b,(mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5087 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
5089 else if(type == "RP")
5091 // profile to get <<4'>> for RPs:
5092 fDiffFlowCorrelationsPro[0][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta,
5093 (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5094 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
5095 // histogram to store <4'> for RPs e-b-e (needed in some other methods):
5096 fDiffFlowCorrelationsEBE[0][pe][1]->SetBinContent(b,four1n1n1n1nPtEta);
5097 fDiffFlowEventWeightsForCorrelationsEBE[0][pe][1]->SetBinContent(b,(mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5098 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
5100 } // end of if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5101 // +mq*(dMult-1.)*(dMult-2.)*(dMult-3.))
5103 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
5106 } // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelations(TString type, TString ptOrEta);
5109 //================================================================================================================================
5112 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfEventWeights(TString type, TString ptOrEta)
5114 // Calculate sums of various event weights for reduced correlations.
5115 // (These quantitites are needed in expressions for unbiased estimators relevant for the statistical errors.)
5117 Int_t typeFlag = -1;
5118 Int_t ptEtaFlag = -1;
5123 } else if(type == "POI")
5131 } else if(ptOrEta == "Eta")
5138 Int_t pe = ptEtaFlag;
5141 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
5142 Double_t minPtEta[2] = {fPtMin,fEtaMin};
5143 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
5144 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
5146 for(Int_t rpq=0;rpq<3;rpq++)
5148 for(Int_t m=0;m<4;m++)
5150 for(Int_t k=0;k<9;k++)
5152 if(!fReRPQ1dEBE[rpq][pe][m][k])
5154 cout<<"WARNING: fReRPQ1dEBE[rpq][pe][m][k] is NULL in AFAWQC::CSAPOEWFDF() !!!!"<<endl;
5155 cout<<"pe = "<<pe<<endl;
5156 cout<<"rpq = "<<rpq<<endl;
5157 cout<<"m = "<<m<<endl;
5158 cout<<"k = "<<k<<endl;
5166 Double_t dMult = (*fSMpk)(0,0); // total event multiplicity
5167 //Double_t mr = 0.; // number of RPs in particular pt or eta bin
5168 Double_t mp = 0.; // number of POIs in particular pt or eta bin
5169 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin
5171 // event weights for reduced correlations:
5172 Double_t dw2 = 0.; // event weight for <2'>
5173 Double_t dw4 = 0.; // event weight for <4'>
5174 //Double_t dw6 = 0.; // event weight for <6'>
5175 //Double_t dw8 = 0.; // event weight for <8'>
5177 // looping over bins:
5178 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
5182 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);
5183 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
5184 } else if(type == "POI")
5186 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);
5187 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b);
5190 // event weight for <2'>:
5192 fDiffFlowSumOfEventWeights[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2);
5193 fDiffFlowSumOfEventWeights[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw2,2.));
5195 // event weight for <4'>:
5196 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5197 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.);
5198 fDiffFlowSumOfEventWeights[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4);
5199 fDiffFlowSumOfEventWeights[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw4,2.));
5201 // event weight for <6'>:
5203 //fDiffFlowSumOfEventWeights[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6);
5204 //fDiffFlowSumOfEventWeights[t][pe][t][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw6,2.));
5206 // event weight for <8'>:
5208 //fDiffFlowSumOfEventWeights[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw8);
5209 //fDiffFlowSumOfEventWeights[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw8,2.));
5210 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
5212 } // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfEventWeights()
5215 //================================================================================================================================
5218 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfProductOfEventWeights(TString type, TString ptOrEta)
5220 // Calculate sum of products of various event weights for both types of correlations (the ones for int. and diff. flow).
5221 // (These quantitites are needed in expressions for unbiased estimators relevant for the statistical errors.)
5223 // Important: To fill fDiffFlowSumOfProductOfEventWeights[][][][] use bellow table (i,j) with following constraints:
5225 // 2.) do not store terms which DO NOT include reduced correlations;
5227 // [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'>]
5229 Int_t typeFlag = -1;
5230 Int_t ptEtaFlag = -1;
5235 } else if(type == "POI")
5243 } else if(ptOrEta == "Eta")
5250 Int_t pe = ptEtaFlag;
5253 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
5254 Double_t minPtEta[2] = {fPtMin,fEtaMin};
5255 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
5256 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
5259 for(Int_t rpq=0;rpq<3;rpq++)
5261 for(Int_t m=0;m<4;m++)
5263 for(Int_t k=0;k<9;k++)
5265 if(!fReRPQ1dEBE[rpq][pe][m][k])
5267 cout<<"WARNING: fReRPQ1dEBE[rpq][pe][m][k] is NULL in AFAWQC::CSAPOEWFDF() !!!!"<<endl;
5268 cout<<"pe = "<<pe<<endl;
5269 cout<<"rpq = "<<rpq<<endl;
5270 cout<<"m = "<<m<<endl;
5271 cout<<"k = "<<k<<endl;
5279 Double_t dMult = (*fSMpk)(0,0); // total event multiplicity
5280 //Double_t mr = 0.; // number of RPs in particular pt or eta bin
5281 Double_t mp = 0.; // number of POIs in particular pt or eta bin
5282 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin
5284 // event weights for correlations:
5285 Double_t dW2 = dMult*(dMult-1); // event weight for <2>
5286 Double_t dW4 = dMult*(dMult-1)*(dMult-2)*(dMult-3); // event weight for <4>
5287 Double_t dW6 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5); // event weight for <6>
5288 Double_t dW8 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7); // event weight for <8>
5290 // event weights for reduced correlations:
5291 Double_t dw2 = 0.; // event weight for <2'>
5292 Double_t dw4 = 0.; // event weight for <4'>
5293 //Double_t dw6 = 0.; // event weight for <6'>
5294 //Double_t dw8 = 0.; // event weight for <8'>
5296 // looping over bins:
5297 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
5301 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);
5302 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
5303 } else if(type == "POI")
5305 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);
5306 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b);
5309 // event weight for <2'>:
5311 fDiffFlowSumOfProductOfEventWeights[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw2); // storing product of even weights for <2> and <2'>
5312 fDiffFlowSumOfProductOfEventWeights[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW4); // storing product of even weights for <4> and <2'>
5313 fDiffFlowSumOfProductOfEventWeights[t][pe][1][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW6); // storing product of even weights for <6> and <2'>
5314 fDiffFlowSumOfProductOfEventWeights[t][pe][1][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW8); // storing product of even weights for <8> and <2'>
5316 // event weight for <4'>:
5317 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5318 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.);
5319 fDiffFlowSumOfProductOfEventWeights[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw4); // storing product of even weights for <2> and <4'>
5320 fDiffFlowSumOfProductOfEventWeights[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw4); // storing product of even weights for <2'> and <4'>
5321 fDiffFlowSumOfProductOfEventWeights[t][pe][2][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw4); // storing product of even weights for <4> and <4'>
5322 fDiffFlowSumOfProductOfEventWeights[t][pe][3][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dW6); // storing product of even weights for <6> and <4'>
5323 fDiffFlowSumOfProductOfEventWeights[t][pe][3][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dW8); // storing product of even weights for <8> and <4'>
5325 // event weight for <6'>:
5327 //fDiffFlowSumOfProductOfEventWeights[t][pe][0][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw6); // storing product of even weights for <2> and <6'>
5328 //fDiffFlowSumOfProductOfEventWeights[t][pe][1][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw6); // storing product of even weights for <2'> and <6'>
5329 //fDiffFlowSumOfProductOfEventWeights[t][pe][2][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw6); // storing product of even weights for <4> and <6'>
5330 //fDiffFlowSumOfProductOfEventWeights[t][pe][3][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dw6); // storing product of even weights for <4'> and <6'>
5331 //fDiffFlowSumOfProductOfEventWeights[t][pe][4][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW6*dw6); // storing product of even weights for <6> and <6'>
5332 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dW8); // storing product of even weights for <6'> and <8>
5333 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dw8); // storing product of even weights for <6'> and <8'>
5335 // event weight for <8'>:
5337 //fDiffFlowSumOfProductOfEventWeights[t][pe][0][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw8); // storing product of even weights for <2> and <8'>
5338 //fDiffFlowSumOfProductOfEventWeights[t][pe][1][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw8); // storing product of even weights for <2'> and <8'>
5339 //fDiffFlowSumOfProductOfEventWeights[t][pe][2][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw8); // storing product of even weights for <4> and <8'>
5340 //fDiffFlowSumOfProductOfEventWeights[t][pe][3][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dw8); // storing product of even weights for <4'> and <8'>
5341 //fDiffFlowSumOfProductOfEventWeights[t][pe][4][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW6*dw8); // storing product of even weights for <6> and <8'>
5342 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dw8); // storing product of even weights for <6'> and <8'>
5343 //fDiffFlowSumOfProductOfEventWeights[t][pe][6][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW8*dw8); // storing product of even weights for <8> and <8'>
5346 // [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'>]
5348 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
5352 } // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfProductOfEventWeights(TString type, TString ptOrEta)
5355 //================================================================================================================================
5358 void AliFlowAnalysisWithQCumulants::FinalizeReducedCorrelations(TString type, TString ptOrEta)
5360 // Transfer profiles into histograms and calculate statistical errors correctly.
5362 Int_t typeFlag = -1;
5363 Int_t ptEtaFlag = -1;
5368 } else if(type == "POI")
5376 } else if(ptOrEta == "Eta")
5383 Int_t pe = ptEtaFlag;
5385 for(Int_t rci=0;rci<4;rci++)
5387 if(!fDiffFlowCorrelationsPro[t][pe][rci])
5389 cout<<"WARNING: fDiffFlowCorrelationsPro[t][pe][rci] is NULL in AFAWQC::FRC() !!!!"<<endl;
5390 cout<<"t = "<<t<<endl;
5391 cout<<"pe = "<<pe<<endl;
5392 cout<<"rci = "<<rci<<endl;
5395 for(Int_t power=0;power<2;power++)
5397 if(!fDiffFlowSumOfEventWeights[t][pe][power][rci])
5399 cout<<"WARNING: fDiffFlowSumOfEventWeights[t][pe][power][rci] is NULL in AFAWQC::FRC() !!!!"<<endl;
5400 cout<<"t = "<<t<<endl;
5401 cout<<"pe = "<<pe<<endl;
5402 cout<<"power = "<<power<<endl;
5403 cout<<"rci = "<<rci<<endl;
5406 } // end of for(Int_t power=0;power<2;power++)
5407 } // end of for(Int_t rci=0;rci<4;rci++)
5410 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
5412 // transfer 1D profile into 1D histogram:
5413 Double_t correlation = 0.;
5414 Double_t spread = 0.;
5415 Double_t sumOfWeights = 0.; // sum of weights for particular reduced correlations for particular pt or eta bin
5416 Double_t sumOfSquaredWeights = 0.; // sum of squared weights for particular reduced correlations for particular pt or eta bin
5417 Double_t error = 0.; // error = termA * spread * termB
5418 // termA = (sqrt(sumOfSquaredWeights)/sumOfWeights)
5419 // termB = 1/pow(1-termA^2,0.5)
5420 Double_t termA = 0.;
5421 Double_t termB = 0.;
5422 for(Int_t rci=0;rci<4;rci++) // index of reduced correlation
5424 for(Int_t b=1;b<=nBinsPtEta[pe];b++) // number of pt or eta bins
5426 correlation = fDiffFlowCorrelationsPro[t][pe][rci]->GetBinContent(b);
5427 spread = fDiffFlowCorrelationsPro[t][pe][rci]->GetBinError(b);
5428 sumOfWeights = fDiffFlowSumOfEventWeights[t][pe][0][rci]->GetBinContent(b);
5429 sumOfSquaredWeights = fDiffFlowSumOfEventWeights[t][pe][1][rci]->GetBinContent(b);
5430 if(sumOfWeights) termA = (pow(sumOfSquaredWeights,0.5)/sumOfWeights);
5431 if(1.-pow(termA,2.)>0.) termB = 1./pow(1.-pow(termA,2.),0.5);
5432 error = termA*spread*termB; // final error (unbiased estimator for standard deviation)
5433 fDiffFlowCorrelationsHist[t][pe][rci]->SetBinContent(b,correlation);
5434 fDiffFlowCorrelationsHist[t][pe][rci]->SetBinError(b,error);
5435 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
5436 } // end of for(Int_t rci=0;rci<4;rci++)
5438 } // end of void AliFlowAnalysisWithQCumulants::FinalizeReducedCorrelations(TString type, TString ptOrEta)
5441 //================================================================================================================================
5444 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowProductOfCorrelations(TString type, TString ptOrEta)
5446 // store products: <2><2'>, <2><4'>, <2><6'>, <2><8'>, <2'><4>,
5447 // <2'><4'>, <2'><6>, <2'><6'>, <2'><8>, <2'><8'>,
5448 // <4><4'>, <4><6'>, <4><8'>, <4'><6>, <4'><6'>,
5449 // <4'><8>, <4'><8'>, <6><6'>, <6><8'>, <6'><8>,
5450 // <6'><8'>, <8><8'>.
5452 Int_t typeFlag = -1;
5453 Int_t ptEtaFlag = -1;
5458 } else if(type == "POI")
5466 } else if(ptOrEta == "Eta")
5473 Int_t pe = ptEtaFlag;
5476 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
5477 Double_t minPtEta[2] = {fPtMin,fEtaMin};
5478 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
5480 // protections // to be improved (add protection for all pointers in this method)
5481 if(!fIntFlowCorrelationsEBE)
5483 cout<<"WARNING: fIntFlowCorrelationsEBE is NULL in AFAWQC::CDFPOC() !!!!"<<endl;
5488 Double_t dMult = (*fSMpk)(0,0); // multiplicity (number of particles used to determine the reaction plane)
5489 //Double_t mr = 0.; // number of RPs in particular pt or eta bin
5490 Double_t mp = 0.; // number of POIs in particular pt or eta bin
5491 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin
5494 // e-b-e correlations:
5495 Double_t twoEBE = fIntFlowCorrelationsEBE->GetBinContent(1); // <2>
5496 Double_t fourEBE = fIntFlowCorrelationsEBE->GetBinContent(2); // <4>
5497 Double_t sixEBE = fIntFlowCorrelationsEBE->GetBinContent(3); // <6>
5498 Double_t eightEBE = fIntFlowCorrelationsEBE->GetBinContent(4); // <8>
5500 // event weights for correlations:
5501 Double_t dW2 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1); // event weight for <2>
5502 Double_t dW4 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2); // event weight for <4>
5503 Double_t dW6 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(3); // event weight for <6>
5504 Double_t dW8 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(4); // event weight for <8>
5506 // e-b-e reduced correlations:
5507 Double_t twoReducedEBE = 0.; // <2'>
5508 Double_t fourReducedEBE = 0.; // <4'>
5509 Double_t sixReducedEBE = 0.; // <6'>
5510 Double_t eightReducedEBE = 0.; // <8'>
5512 // event weights for reduced correlations:
5513 Double_t dw2 = 0.; // event weight for <2'>
5514 Double_t dw4 = 0.; // event weight for <4'>
5515 //Double_t dw6 = 0.; // event weight for <6'>
5516 //Double_t dw8 = 0.; // event weight for <8'>
5518 // looping over bins:
5519 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
5521 // e-b-e reduced correlations:
5522 twoReducedEBE = fDiffFlowCorrelationsEBE[t][pe][0]->GetBinContent(b);
5523 fourReducedEBE = fDiffFlowCorrelationsEBE[t][pe][1]->GetBinContent(b);
5524 sixReducedEBE = fDiffFlowCorrelationsEBE[t][pe][2]->GetBinContent(b);
5525 eightReducedEBE = fDiffFlowCorrelationsEBE[t][pe][3]->GetBinContent(b);
5528 // to be improved (I should not do this here again)
5531 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);
5532 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
5533 } else if(type == "POI")
5535 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);
5536 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b);
5539 // event weights for reduced correlations:
5540 dw2 = mp*dMult-mq; // weight for <2'>
5541 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
5542 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.); // weight for <4'>
5548 dw2 = fDiffFlowEventWeightsForCorrelationsEBE[t][pe][0]->GetBinContent(b);
5549 dw4 = fDiffFlowEventWeightsForCorrelationsEBE[t][pe][1]->GetBinContent(b);
5551 // storing all products:
5552 fDiffFlowProductOfCorrelationsPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*twoReducedEBE,dW2*dw2); // storing <2><2'>
5553 fDiffFlowProductOfCorrelationsPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*twoReducedEBE,dW4*dw2); // storing <4><2'>
5554 fDiffFlowProductOfCorrelationsPro[t][pe][1][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*twoReducedEBE,dW6*dw2); // storing <6><2'>
5555 fDiffFlowProductOfCorrelationsPro[t][pe][1][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*twoReducedEBE,dW8*dw2); // storing <8><2'>
5557 // event weight for <4'>:
5558 fDiffFlowProductOfCorrelationsPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*fourReducedEBE,dW2*dw4); // storing <2><4'>
5559 fDiffFlowProductOfCorrelationsPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*fourReducedEBE,dw2*dw4); // storing <2'><4'>
5560 fDiffFlowProductOfCorrelationsPro[t][pe][2][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*fourReducedEBE,dW4*dw4); // storing <4><4'>
5561 fDiffFlowProductOfCorrelationsPro[t][pe][3][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*fourReducedEBE,dW6*dw4); // storing <6><4'>
5562 fDiffFlowProductOfCorrelationsPro[t][pe][3][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*fourReducedEBE,dW8*dw4); // storing <8><4'>
5564 // event weight for <6'>:
5566 //fDiffFlowProductOfCorrelationsPro[t][pe][0][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*sixReducedEBE,dW2*dw6); // storing <2><6'>
5567 //fDiffFlowProductOfCorrelationsPro[t][pe][1][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*sixReducedEBE,dw2*dw6); // storing <2'><6'>
5568 //fDiffFlowProductOfCorrelationsPro[t][pe][2][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*sixReducedEBE,dW4*dw6); // storing <4><6'>
5569 //fDiffFlowProductOfCorrelationsPro[t][pe][3][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourReducedEBE*sixReducedEBE,dw4*dw6); // storing <4'><6'>
5570 //fDiffFlowProductOfCorrelationsPro[t][pe][4][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*sixReducedEBE,dW6*dw6); // storing <6><6'>
5571 //fDiffFlowProductOfCorrelationsPro[t][pe][5][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightEBE,dw6*dW8); // storing <6'><8>
5572 //fDiffFlowProductOfCorrelationsPro[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightReducedEBE,dw6*dw8); // storing <6'><8'>
5574 // event weight for <8'>:
5576 //fDiffFlowProductOfCorrelationsPro[t][pe][0][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*eightReducedEBE,dW2*dw8); // storing <2><8'>
5577 //fDiffFlowProductOfCorrelationsPro[t][pe][1][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*eightReducedEBE,dw2*dw8); // storing <2'><8'>
5578 //fDiffFlowProductOfCorrelationsPro[t][pe][2][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*eightReducedEBE,dW4*dw8); // storing <4><8'>
5579 //fDiffFlowProductOfCorrelationsPro[t][pe][3][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourReducedEBE*eightReducedEBE,dw4*dw8); // storing <4'><8'>
5580 //fDiffFlowProductOfCorrelationsPro[t][pe][4][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*eightReducedEBE,dW6*dw8); // storing <6><8'>
5581 //fDiffFlowProductOfCorrelationsPro[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightReducedEBE,dw6*dw8); // storing <6'><8'>
5582 //fDiffFlowProductOfCorrelationsPro[t][pe][6][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*eightReducedEBE,dW8*dw8); // storing <8><8'>
5583 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++
5585 } // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowProductOfCorrelations(TString type, TString ptOrEta)
5588 //================================================================================================================================
5591 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCovariances(TString type, TString ptOrEta) // to be improved (reimplemented)
5593 // a) Calculate unbiased estimators Cov(<2>,<2'>), Cov(<2>,<4'>), Cov(<4>,<2'>), Cov(<4>,<4'>) and Cov(<2'>,<4'>)
5594 // for covariances V(<2>,<2'>), V(<2>,<4'>), V(<4>,<2'>), V(<4>,<4'>) and V(<2'>,<4'>).
5595 // b) Store in histogram fDiffFlowCovariances[t][pe][index] for instance the following:
5597 // 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)]
5599 // where N is the number of events, w_{<2>} is event weight for <2> and w_{<2'>} is event weight for <2'>.
5600 // c) Binning of fDiffFlowCovariances[t][pe][index] is organized as follows:
5602 // 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)]
5603 // 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)]
5604 // 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)]
5605 // 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)]
5606 // 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)]
5609 Int_t typeFlag = -1;
5610 Int_t ptEtaFlag = -1;
5615 } else if(type == "POI")
5623 } else if(ptOrEta == "Eta")
5630 Int_t pe = ptEtaFlag;
5633 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
5634 //Double_t minPtEta[2] = {fPtMin,fEtaMin};
5635 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
5636 //Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
5638 // average correlations:
5639 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
5640 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
5641 //Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
5642 //Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
5644 // sum of weights for correlation:
5645 Double_t sumOfWeightsForTwo = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // sum_{i=1}^{N} w_{<2>}
5646 Double_t sumOfWeightsForFour = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // sum_{i=1}^{N} w_{<4>}
5647 //Double_t sumOfWeightsForSix = fIntFlowSumOfEventWeights[0]->GetBinContent(3); // sum_{i=1}^{N} w_{<6>}
5648 //Double_t sumOfWeightsForEight = fIntFlowSumOfEventWeights[0]->GetBinContent(4); // sum_{i=1}^{N} w_{<8>}
5650 // average reduced correlations:
5651 Double_t twoReduced = 0.; // <<2'>>
5652 Double_t fourReduced = 0.; // <<4'>>
5653 //Double_t sixReduced = 0.; // <<6'>>
5654 //Double_t eightReduced = 0.; // <<8'>>
5656 // sum of weights for reduced correlation:
5657 Double_t sumOfWeightsForTwoReduced = 0.; // sum_{i=1}^{N} w_{<2'>}
5658 Double_t sumOfWeightsForFourReduced = 0.; // sum_{i=1}^{N} w_{<4'>}
5659 //Double_t sumOfWeightsForSixReduced = 0.; // sum_{i=1}^{N} w_{<6'>}
5660 //Double_t sumOfWeightsForEightReduced = 0.; // sum_{i=1}^{N} w_{<8'>}
5662 // product of weights for reduced correlation:
5663 Double_t productOfWeightsForTwoTwoReduced = 0.; // sum_{i=1}^{N} w_{<2>}w_{<2'>}
5664 Double_t productOfWeightsForTwoFourReduced = 0.; // sum_{i=1}^{N} w_{<2>}w_{<4'>}
5665 Double_t productOfWeightsForFourTwoReduced = 0.; // sum_{i=1}^{N} w_{<4>}w_{<2'>}
5666 Double_t productOfWeightsForFourFourReduced = 0.; // sum_{i=1}^{N} w_{<4>}w_{<4'>}
5667 Double_t productOfWeightsForTwoReducedFourReduced = 0.; // sum_{i=1}^{N} w_{<2'>}w_{<4'>}
5670 // products for differential flow:
5671 Double_t twoTwoReduced = 0; // <<2><2'>>
5672 Double_t twoFourReduced = 0; // <<2><4'>>
5673 Double_t fourTwoReduced = 0; // <<4><2'>>
5674 Double_t fourFourReduced = 0; // <<4><4'>>
5675 Double_t twoReducedFourReduced = 0; // <<2'><4'>>
5677 // denominators in the expressions for the unbiased estimators for covariances:
5678 // denominator = 1 - term1/(term2*term3)
5679 // prefactor = term1/(term2*term3)
5680 Double_t denominator = 0.;
5681 Double_t prefactor = 0.;
5682 Double_t term1 = 0.;
5683 Double_t term2 = 0.;
5684 Double_t term3 = 0.;
5686 // unbiased estimators for covariances for differential flow:
5687 Double_t covTwoTwoReduced = 0.; // Cov(<2>,<2'>)
5688 Double_t wCovTwoTwoReduced = 0.; // Cov(<2>,<2'>) * prefactor(w_{<2>},w_{<2'>})
5689 Double_t covTwoFourReduced = 0.; // Cov(<2>,<4'>)
5690 Double_t wCovTwoFourReduced = 0.; // Cov(<2>,<4'>) * prefactor(w_{<2>},w_{<4'>})
5691 Double_t covFourTwoReduced = 0.; // Cov(<4>,<2'>)
5692 Double_t wCovFourTwoReduced = 0.; // Cov(<4>,<2'>) * prefactor(w_{<4>},w_{<2'>})
5693 Double_t covFourFourReduced = 0.; // Cov(<4>,<4'>)
5694 Double_t wCovFourFourReduced = 0.; // Cov(<4>,<4'>) * prefactor(w_{<4>},w_{<4'>})
5695 Double_t covTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>)
5696 Double_t wCovTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>) * prefactor(w_{<2'>},w_{<4'>})
5698 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
5700 // average reduced corelations:
5701 twoReduced = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b);
5702 fourReduced = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b);
5703 // average products:
5704 twoTwoReduced = fDiffFlowProductOfCorrelationsPro[t][pe][0][1]->GetBinContent(b);
5705 twoFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][0][3]->GetBinContent(b);
5706 fourTwoReduced = fDiffFlowProductOfCorrelationsPro[t][pe][1][2]->GetBinContent(b);
5707 fourFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][2][3]->GetBinContent(b);
5708 twoReducedFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][1][3]->GetBinContent(b);
5709 // sum of weights for reduced correlations:
5710 sumOfWeightsForTwoReduced = fDiffFlowSumOfEventWeights[t][pe][0][0]->GetBinContent(b);
5711 sumOfWeightsForFourReduced = fDiffFlowSumOfEventWeights[t][pe][0][1]->GetBinContent(b);
5712 // products of weights for correlations:
5713 productOfWeightsForTwoTwoReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][0][1]->GetBinContent(b);
5714 productOfWeightsForTwoFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][0][3]->GetBinContent(b);
5715 productOfWeightsForFourTwoReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][1][2]->GetBinContent(b);
5716 productOfWeightsForFourFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][2][3]->GetBinContent(b);
5717 productOfWeightsForTwoReducedFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][1][3]->GetBinContent(b);
5718 // denominator for the unbiased estimator for covariances: 1 - term1/(term2*term3)
5719 // prefactor (multiplies Cov's) = term1/(term2*term3)
5721 term1 = productOfWeightsForTwoTwoReduced;
5722 term2 = sumOfWeightsForTwo;
5723 term3 = sumOfWeightsForTwoReduced;
5726 denominator = 1.-term1/(term2*term3);
5727 prefactor = term1/(term2*term3);
5730 covTwoTwoReduced = (twoTwoReduced-two*twoReduced)/denominator;
5731 wCovTwoTwoReduced = covTwoTwoReduced*prefactor;
5732 fDiffFlowCovariances[t][pe][0]->SetBinContent(b,wCovTwoTwoReduced);
5736 term1 = productOfWeightsForTwoFourReduced;
5737 term2 = sumOfWeightsForTwo;
5738 term3 = sumOfWeightsForFourReduced;
5741 denominator = 1.-term1/(term2*term3);
5742 prefactor = term1/(term2*term3);
5745 covTwoFourReduced = (twoFourReduced-two*fourReduced)/denominator;
5746 wCovTwoFourReduced = covTwoFourReduced*prefactor;
5747 fDiffFlowCovariances[t][pe][1]->SetBinContent(b,wCovTwoFourReduced);
5751 term1 = productOfWeightsForFourTwoReduced;
5752 term2 = sumOfWeightsForFour;
5753 term3 = sumOfWeightsForTwoReduced;
5756 denominator = 1.-term1/(term2*term3);
5757 prefactor = term1/(term2*term3);
5760 covFourTwoReduced = (fourTwoReduced-four*twoReduced)/denominator;
5761 wCovFourTwoReduced = covFourTwoReduced*prefactor;
5762 fDiffFlowCovariances[t][pe][2]->SetBinContent(b,wCovFourTwoReduced);
5766 term1 = productOfWeightsForFourFourReduced;
5767 term2 = sumOfWeightsForFour;
5768 term3 = sumOfWeightsForFourReduced;
5771 denominator = 1.-term1/(term2*term3);
5772 prefactor = term1/(term2*term3);
5775 covFourFourReduced = (fourFourReduced-four*fourReduced)/denominator;
5776 wCovFourFourReduced = covFourFourReduced*prefactor;
5777 fDiffFlowCovariances[t][pe][3]->SetBinContent(b,wCovFourFourReduced);
5781 term1 = productOfWeightsForTwoReducedFourReduced;
5782 term2 = sumOfWeightsForTwoReduced;
5783 term3 = sumOfWeightsForFourReduced;
5786 denominator = 1.-term1/(term2*term3);
5787 prefactor = term1/(term2*term3);
5790 covTwoReducedFourReduced = (twoReducedFourReduced-twoReduced*fourReduced)/denominator;
5791 wCovTwoReducedFourReduced = covTwoReducedFourReduced*prefactor;
5792 fDiffFlowCovariances[t][pe][4]->SetBinContent(b,wCovTwoReducedFourReduced);
5795 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
5797 } // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCovariances(TString type, TString ptOrEta)
5800 //================================================================================================================================
5803 void AliFlowAnalysisWithQCumulants::CalculateDiffFlow(TString type, TString ptOrEta)
5805 // calculate differential flow from differential cumulants and previously obtained integrated flow: (to be improved: description)
5807 Int_t typeFlag = -1;
5808 Int_t ptEtaFlag = -1;
5813 } else if(type == "POI")
5821 } else if(ptOrEta == "Eta")
5828 Int_t pe = ptEtaFlag;
5831 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
5834 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
5835 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
5837 // statistical errors of correlations:
5838 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1);
5839 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2);
5841 // reduced correlations:
5842 Double_t twoReduced = 0.; // <<2'>>
5843 Double_t fourReduced = 0.; // <<4'>>
5845 // statistical errors of reduced correlations:
5846 Double_t twoReducedError = 0.;
5847 Double_t fourReducedError = 0.;
5850 Double_t wCovTwoFour = fIntFlowCovariances->GetBinContent(1);// // Cov(<2>,<4>) * prefactor(<2>,<4>)
5851 Double_t wCovTwoTwoReduced = 0.; // Cov(<2>,<2'>) * prefactor(<2>,<2'>)
5852 Double_t wCovTwoFourReduced = 0.; // Cov(<2>,<4'>) * prefactor(<2>,<4'>)
5853 Double_t wCovFourTwoReduced = 0.; // Cov(<4>,<2'>) * prefactor(<4>,<2'>)
5854 Double_t wCovFourFourReduced = 0.; // Cov(<4>,<4'>) * prefactor(<4>,<4'>)
5855 Double_t wCovTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>) * prefactor(<2'>,<4'>)
5857 // differential flow:
5858 Double_t v2Prime = 0.; // v'{2}
5859 Double_t v4Prime = 0.; // v'{4}
5861 // statistical error of differential flow:
5862 Double_t v2PrimeError = 0.;
5863 Double_t v4PrimeError = 0.;
5865 // squared statistical error of differential flow:
5866 Double_t v2PrimeErrorSquared = 0.;
5867 Double_t v4PrimeErrorSquared = 0.;
5869 // loop over pt or eta bins:
5870 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
5872 // reduced correlations and statistical errors:
5873 twoReduced = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b);
5874 twoReducedError = fDiffFlowCorrelationsHist[t][pe][0]->GetBinError(b);
5875 fourReduced = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b);
5876 fourReducedError = fDiffFlowCorrelationsHist[t][pe][1]->GetBinError(b);
5878 wCovTwoTwoReduced = fDiffFlowCovariances[t][pe][0]->GetBinContent(b);
5879 wCovTwoFourReduced = fDiffFlowCovariances[t][pe][1]->GetBinContent(b);
5880 wCovFourTwoReduced = fDiffFlowCovariances[t][pe][2]->GetBinContent(b);
5881 wCovFourFourReduced = fDiffFlowCovariances[t][pe][3]->GetBinContent(b);
5882 wCovTwoReducedFourReduced = fDiffFlowCovariances[t][pe][4]->GetBinContent(b);
5883 // differential flow:
5887 v2Prime = twoReduced/pow(two,0.5);
5888 v2PrimeErrorSquared = (1./4.)*pow(two,-3.)*
5889 (pow(twoReduced,2.)*pow(twoError,2.)
5890 + 4.*pow(two,2.)*pow(twoReducedError,2.)
5891 - 4.*two*twoReduced*wCovTwoTwoReduced);
5894 if(v2PrimeErrorSquared>0.) v2PrimeError = pow(v2PrimeErrorSquared,0.5);
5895 fDiffFlow[t][pe][0]->SetBinContent(b,v2Prime);
5896 fDiffFlow[t][pe][0]->SetBinError(b,v2PrimeError);
5898 // differential flow:
5900 if(2.*pow(two,2.)-four > 0.)
5902 v4Prime = (2.*two*twoReduced-fourReduced)/pow(2.*pow(two,2.)-four,3./4.);
5903 v4PrimeErrorSquared = pow(2.*pow(two,2.)-four,-7./2.)*
5904 (pow(2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced,2.)*pow(twoError,2.)
5905 + (9./16.)*pow(2.*two*twoReduced-fourReduced,2.)*pow(fourError,2.)
5906 + 4.*pow(two,2.)*pow(2.*pow(two,2.)-four,2.)*pow(twoReducedError,2.)
5907 + pow(2.*pow(two,2.)-four,2.)*pow(fourReducedError,2.)
5908 - (3./2.)*(2.*two*twoReduced-fourReduced)
5909 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoFour
5910 - 4.*two*(2.*pow(two,2.)-four)
5911 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoTwoReduced
5912 + 2.*(2.*pow(two,2.)-four)
5913 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoFourReduced
5914 + 3.*two*(2.*pow(two,2.)-four)*(2.*two*twoReduced-fourReduced)*wCovFourTwoReduced
5915 - (3./2.)*(2.*pow(two,2.)-four)*(2.*two*twoReduced-fourReduced)*wCovFourFourReduced
5916 - 4.*two*pow(2.*pow(two,2.)-four,2.)*wCovTwoReducedFourReduced);
5917 if(v4PrimeErrorSquared>0.) v4PrimeError = pow(v4PrimeErrorSquared,0.5);
5918 fDiffFlow[t][pe][1]->SetBinContent(b,v4Prime);
5919 fDiffFlow[t][pe][1]->SetBinError(b,v4PrimeError);
5922 } // end of for(Int_t b=1;b<=fnBinsPtEta[pe];b++)
5929 for(Int_t nua=0;nua<2;nua++)
5931 for(Int_t p=1;p<=fnBinsPt;p++)
5933 for(Int_t e=1;e<=fnBinsEta;e++)
5935 // differential cumulants:
5936 Double_t qc2Prime = fFinalCumulants2D[t][pW][eW][nua][0]->GetBinContent(fFinalCumulants2D[t][pW][eW][nua][0]->GetBin(p,e)); // QC{2'}
5937 Double_t qc4Prime = fFinalCumulants2D[t][pW][eW][nua][1]->GetBinContent(fFinalCumulants2D[t][pW][eW][nua][1]->GetBin(p,e)); // QC{4'}
5938 // differential flow:
5939 Double_t v2Prime = 0.;
5940 Double_t v4Prime = 0.;
5943 v2Prime = qc2Prime/v2;
5944 fFinalFlow2D[t][pW][eW][nua][0]->SetBinContent(fFinalFlow2D[t][pW][eW][nua][0]->GetBin(p,e),v2Prime);
5948 v4Prime = -qc4Prime/pow(v4,3.);
5949 fFinalFlow2D[t][pW][eW][nua][1]->SetBinContent(fFinalFlow2D[t][pW][eW][nua][1]->GetBin(p,e),v4Prime);
5951 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
5952 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5953 } // end of for(Int_t nua=0;nua<2;nua++)
5956 } // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlow(TString type, Bool_t useParticleWeights)
5959 //================================================================================================================================
5962 void AliFlowAnalysisWithQCumulants::StoreIntFlowFlags()
5964 // a) Store all flags for integrated flow in profile fIntFlowFlags.
5968 cout<<"WARNING: fIntFlowFlags is NULL in AFAWQC::SFFIF() !!!!"<<endl;
5972 // particle weights used or not:
5973 fIntFlowFlags->Fill(0.5,(Int_t)fUsePhiWeights||fUsePtWeights||fUseEtaWeights);
5974 // which event weights were used:
5975 if(strcmp(fMultiplicityWeight->Data(),"combinations"))
5977 fIntFlowFlags->Fill(1.5,0); // 0 = "combinations" (default)
5978 } else if(strcmp(fMultiplicityWeight->Data(),"unit"))
5980 fIntFlowFlags->Fill(1.5,1); // 1 = "unit"
5981 } else if(strcmp(fMultiplicityWeight->Data(),"multiplicity"))
5983 fIntFlowFlags->Fill(1.5,2); // 2 = "multiplicity"
5985 // corrected for non-uniform acceptance or not:
5986 fIntFlowFlags->Fill(2.5,(Int_t)fApplyCorrectionForNUA);
5987 fIntFlowFlags->Fill(3.5,(Int_t)fPrintFinalResults[0]);
5988 fIntFlowFlags->Fill(4.5,(Int_t)fPrintFinalResults[1]);
5989 fIntFlowFlags->Fill(5.5,(Int_t)fPrintFinalResults[2]);
5991 } // end of void AliFlowAnalysisWithQCumulants::StoreIntFlowFlags()
5994 //================================================================================================================================
5997 void AliFlowAnalysisWithQCumulants::StoreDiffFlowFlags()
5999 // Store all flags for differential flow in the profile fDiffFlowFlags.
6003 cout<<"WARNING: fDiffFlowFlags is NULL in AFAWQC::SFFDF() !!!!"<<endl;
6007 fDiffFlowFlags->Fill(0.5,fUsePhiWeights||fUsePtWeights||fUseEtaWeights); // particle weights used or not
6008 //fDiffFlowFlags->Fill(1.5,""); // which event weight was used? // to be improved
6009 fDiffFlowFlags->Fill(2.5,fApplyCorrectionForNUA); // corrected for non-uniform acceptance or not
6010 fDiffFlowFlags->Fill(3.5,fCalculate2DFlow); // calculate also 2D differential flow in (pt,eta) or not
6012 } // end of void AliFlowAnalysisWithQCumulants::StoreDiffFlowFlags()
6015 //================================================================================================================================
6018 void AliFlowAnalysisWithQCumulants::GetPointersForCommonHistograms()
6020 // Access all pointers to common control and common result histograms and profiles.
6022 TString commonHistsName = "AliFlowCommonHistQC";
6023 commonHistsName += fAnalysisLabel->Data();
6024 AliFlowCommonHist *commonHist = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHistsName.Data()));
6025 if(commonHist) this->SetCommonHists(commonHist);
6026 TString commonHists2ndOrderName = "AliFlowCommonHist2ndOrderQC";
6027 commonHists2ndOrderName += fAnalysisLabel->Data();
6028 AliFlowCommonHist *commonHist2nd = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists2ndOrderName.Data()));
6029 if(commonHist2nd) this->SetCommonHists2nd(commonHist2nd);
6030 TString commonHists4thOrderName = "AliFlowCommonHist4thOrderQC";
6031 commonHists4thOrderName += fAnalysisLabel->Data();
6032 AliFlowCommonHist *commonHist4th = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists4thOrderName.Data()));
6033 if(commonHist4th) this->SetCommonHists4th(commonHist4th);
6034 TString commonHists6thOrderName = "AliFlowCommonHist6thOrderQC";
6035 commonHists6thOrderName += fAnalysisLabel->Data();
6036 AliFlowCommonHist *commonHist6th = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists6thOrderName.Data()));
6037 if(commonHist6th) this->SetCommonHists6th(commonHist6th);
6038 TString commonHists8thOrderName = "AliFlowCommonHist8thOrderQC";
6039 commonHists8thOrderName += fAnalysisLabel->Data();
6040 AliFlowCommonHist *commonHist8th = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists8thOrderName.Data()));
6041 if(commonHist8th) this->SetCommonHists8th(commonHist8th);
6042 TString commonHistResults2ndOrderName = "AliFlowCommonHistResults2ndOrderQC";
6043 commonHistResults2ndOrderName += fAnalysisLabel->Data();
6044 AliFlowCommonHistResults *commonHistRes2nd = dynamic_cast<AliFlowCommonHistResults*>
\r (fHistList->FindObject(commonHistResults2ndOrderName.Data()));
6045 if(commonHistRes2nd) this->SetCommonHistsResults2nd(commonHistRes2nd);
6046 TString commonHistResults4thOrderName = "AliFlowCommonHistResults4thOrderQC";
6047 commonHistResults4thOrderName += fAnalysisLabel->Data();
6048 AliFlowCommonHistResults *commonHistRes4th = dynamic_cast<AliFlowCommonHistResults*>
6049 (fHistList->FindObject(commonHistResults4thOrderName.Data()));
6050 if(commonHistRes4th) this->SetCommonHistsResults4th(commonHistRes4th);
6051 TString commonHistResults6thOrderName = "AliFlowCommonHistResults6thOrderQC";
6052 commonHistResults6thOrderName += fAnalysisLabel->Data();
6053 AliFlowCommonHistResults *commonHistRes6th = dynamic_cast<AliFlowCommonHistResults*>
6054 (fHistList->FindObject(commonHistResults6thOrderName.Data()));
6055 if(commonHistRes6th) this->SetCommonHistsResults6th(commonHistRes6th);
6056 TString commonHistResults8thOrderName = "AliFlowCommonHistResults8thOrderQC";
6057 commonHistResults8thOrderName += fAnalysisLabel->Data();
6058 AliFlowCommonHistResults *commonHistRes8th = dynamic_cast<AliFlowCommonHistResults*>
6059 (fHistList->FindObject(commonHistResults8thOrderName.Data()));
6060 if(commonHistRes8th) this->SetCommonHistsResults8th(commonHistRes8th);
6062 } // end of void AliFlowAnalysisWithQCumulants::GetPointersForCommonHistograms()
6065 //================================================================================================================================
6068 void AliFlowAnalysisWithQCumulants::GetPointersForParticleWeightsHistograms()
6070 // Get pointers for histograms with particle weights.
6072 TList *weightsList = dynamic_cast<TList*>(fHistList->FindObject("Weights"));
6073 if(weightsList) this->SetWeightsList(weightsList);
6074 TString fUseParticleWeightsName = "fUseParticleWeightsQC"; // to be improved (hirdwired label QC)
6075 fUseParticleWeightsName += fAnalysisLabel->Data();
6076 TProfile *useParticleWeights = dynamic_cast<TProfile*>(weightsList->FindObject(fUseParticleWeightsName.Data()));
6077 if(useParticleWeights)
6079 this->SetUseParticleWeights(useParticleWeights);
6080 fUsePhiWeights = (Int_t)fUseParticleWeights->GetBinContent(1);
6081 fUsePtWeights = (Int_t)fUseParticleWeights->GetBinContent(2);
6082 fUseEtaWeights = (Int_t)fUseParticleWeights->GetBinContent(3);
6084 } // end of void AliFlowAnalysisWithQCumulants::GetPointersForParticleWeightsHistograms();
6087 //================================================================================================================================
6090 void AliFlowAnalysisWithQCumulants::GetPointersForIntFlowHistograms()
6092 // Get pointers for histograms and profiles relevant for integrated flow:
6093 // a) Get pointer to base list for integrated flow holding profile fIntFlowFlags and lists fIntFlowProfiles and fIntFlowResults.
6094 // b) Get pointer to profile fIntFlowFlags holding all flags for integrated flow.
6095 // c) Get pointer to list fIntFlowProfiles and pointers to all objects that she holds.
6096 // d) Get pointer to list fIntFlowResults and pointers to all objects that she holds.
6098 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data member?)
6099 TString powerFlag[2] = {"linear","quadratic"}; // to be improved (should I promote this to data member?)
6101 // a) Get pointer to base list for integrated flow holding profile fIntFlowFlags and lists fIntFlowProfiles and fIntFlowResults:
6102 TList *intFlowList = NULL;
6103 intFlowList = dynamic_cast<TList*>(fHistList->FindObject("Integrated Flow"));
6106 cout<<"WARNING: intFlowList is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
6110 // b) Get pointer to profile fIntFlowFlags holding all flags for integrated flow:
6111 TString intFlowFlagsName = "fIntFlowFlags";
6112 intFlowFlagsName += fAnalysisLabel->Data();
6113 TProfile *intFlowFlags = dynamic_cast<TProfile*>(intFlowList->FindObject(intFlowFlagsName.Data()));
6114 Bool_t bApplyCorrectionForNUA = kFALSE;
6117 this->SetIntFlowFlags(intFlowFlags);
6118 bApplyCorrectionForNUA = (Int_t)intFlowFlags->GetBinContent(3);
6119 this->SetApplyCorrectionForNUA(bApplyCorrectionForNUA);
6122 cout<<"WARNING: intFlowFlags is NULL in FAWQC::GPFIFH() !!!!"<<endl;
6125 // c) Get pointer to list fIntFlowProfiles and pointers to all objects that she holds:
6126 TList *intFlowProfiles = NULL;
6127 intFlowProfiles = dynamic_cast<TList*>(intFlowList->FindObject("Profiles"));
6130 // average multiplicities:
6131 TString avMultiplicityName = "fAvMultiplicity";
6132 avMultiplicityName += fAnalysisLabel->Data();
6133 TProfile *avMultiplicity = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(avMultiplicityName.Data()));
6136 this->SetAvMultiplicity(avMultiplicity);
6139 cout<<"WARNING: avMultiplicity is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
6141 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with wrong errors!):
6142 TString intFlowCorrelationsProName = "fIntFlowCorrelationsPro";
6143 intFlowCorrelationsProName += fAnalysisLabel->Data();
6144 TProfile *intFlowCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowCorrelationsProName.Data()));
6145 if(intFlowCorrelationsPro)
6147 this->SetIntFlowCorrelationsPro(intFlowCorrelationsPro);
6150 cout<<"WARNING: intFlowCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
6152 // average all correlations for integrated flow (with wrong errors!):
6153 TString intFlowCorrelationsAllProName = "fIntFlowCorrelationsAllPro";
6154 intFlowCorrelationsAllProName += fAnalysisLabel->Data();
6155 TProfile *intFlowCorrelationsAllPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowCorrelationsAllProName.Data()));
6156 if(intFlowCorrelationsAllPro)
6158 this->SetIntFlowCorrelationsAllPro(intFlowCorrelationsAllPro);
6161 cout<<"WARNING: intFlowCorrelationsAllPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
6163 // average extra correlations for integrated flow (which appear only when particle weights are used):
6164 // (to be improved: Weak point in implementation, I am assuming here that method GetPointersForParticleWeightsHistograms() was called)
6165 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
6167 TString intFlowExtraCorrelationsProName = "fIntFlowExtraCorrelationsPro";
6168 intFlowExtraCorrelationsProName += fAnalysisLabel->Data();
6169 TProfile *intFlowExtraCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowExtraCorrelationsProName.Data()));
6170 if(intFlowExtraCorrelationsPro)
6172 this->SetIntFlowExtraCorrelationsPro(intFlowExtraCorrelationsPro);
6175 cout<<"WARNING: intFlowExtraCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
6177 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
6178 // average products of correlations <2>, <4>, <6> and <8>:
6179 TString intFlowProductOfCorrelationsProName = "fIntFlowProductOfCorrelationsPro";
6180 intFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
6181 TProfile *intFlowProductOfCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowProductOfCorrelationsProName.Data()));
6182 if(intFlowProductOfCorrelationsPro)
6184 this->SetIntFlowProductOfCorrelationsPro(intFlowProductOfCorrelationsPro);
6187 cout<<"WARNING: intFlowProductOfCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
6189 // average correction terms for non-uniform acceptance (with wrong errors!):
6190 for(Int_t sc=0;sc<2;sc++)
6192 TString intFlowCorrectionTermsForNUAProName = "fIntFlowCorrectionTermsForNUAPro";
6193 intFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
6194 TProfile *intFlowCorrectionTermsForNUAPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject((Form("%s: %s terms",intFlowCorrectionTermsForNUAProName.Data(),sinCosFlag[sc].Data()))));
6195 if(intFlowCorrectionTermsForNUAPro)
6197 this->SetIntFlowCorrectionTermsForNUAPro(intFlowCorrectionTermsForNUAPro,sc);
6200 cout<<"WARNING: intFlowCorrectionTermsForNUAPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
6201 cout<<"sc = "<<sc<<endl;
6203 } // end of for(Int_t sc=0;sc<2;sc++)
6204 } else // to if(intFlowProfiles)
6206 cout<<"WARNING: intFlowProfiles is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
6209 // d) Get pointer to list fIntFlowResults and pointers to all objects that she holds.
6210 TList *intFlowResults = NULL;
6211 intFlowResults = dynamic_cast<TList*>(intFlowList->FindObject("Results"));
6214 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with correct errors!):
6215 TString intFlowCorrelationsHistName = "fIntFlowCorrelationsHist";
6216 intFlowCorrelationsHistName += fAnalysisLabel->Data();
6217 TH1D *intFlowCorrelationsHist = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCorrelationsHistName.Data()));
6218 if(intFlowCorrelationsHist)
6220 this->SetIntFlowCorrelationsHist(intFlowCorrelationsHist);
6223 cout<<"WARNING: intFlowCorrelationsHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
6225 // average all correlations for integrated flow (with correct errors!):
6226 TString intFlowCorrelationsAllHistName = "fIntFlowCorrelationsAllHist";
6227 intFlowCorrelationsAllHistName += fAnalysisLabel->Data();
6228 TH1D *intFlowCorrelationsAllHist = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCorrelationsAllHistName.Data()));
6229 if(intFlowCorrelationsAllHist)
6231 this->SetIntFlowCorrelationsAllHist(intFlowCorrelationsAllHist);
6234 cout<<"WARNING: intFlowCorrelationsAllHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
6236 // average correction terms for non-uniform acceptance (with correct errors!):
6237 TString intFlowCorrectionTermsForNUAHistName = "fIntFlowCorrectionTermsForNUAHist";
6238 intFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
6239 for(Int_t sc=0;sc<2;sc++)
6241 TH1D *intFlowCorrectionTermsForNUAHist = dynamic_cast<TH1D*>(intFlowResults->FindObject((Form("%s: %s terms",intFlowCorrectionTermsForNUAHistName.Data(),sinCosFlag[sc].Data()))));
6242 if(intFlowCorrectionTermsForNUAHist)
6244 this->SetIntFlowCorrectionTermsForNUAHist(intFlowCorrectionTermsForNUAHist,sc);
6247 cout<<"WARNING: intFlowCorrectionTermsForNUAHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
6248 cout<<"sc = "<<sc<<endl;
6250 } // end of for(Int_t sc=0;sc<2;sc++)
6251 // covariances (multiplied with weight dependent prefactor):
6252 TString intFlowCovariancesName = "fIntFlowCovariances";
6253 intFlowCovariancesName += fAnalysisLabel->Data();
6254 TH1D *intFlowCovariances = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCovariancesName.Data()));
6255 if(intFlowCovariances)
6257 this->SetIntFlowCovariances(intFlowCovariances);
6260 cout<<"WARNING: intFlowCovariances is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
6262 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8>:
6263 TString intFlowSumOfEventWeightsName = "fIntFlowSumOfEventWeights";
6264 intFlowSumOfEventWeightsName += fAnalysisLabel->Data();
6265 for(Int_t power=0;power<2;power++)
6267 TH1D *intFlowSumOfEventWeights = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s: %s",intFlowSumOfEventWeightsName.Data(),powerFlag[power].Data())));
6268 if(intFlowSumOfEventWeights)
6270 this->SetIntFlowSumOfEventWeights(intFlowSumOfEventWeights,power);
6273 cout<<"WARNING: intFlowSumOfEventWeights is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
6274 cout<<"power = "<<power<<endl;
6276 } // end of for(Int_t power=0;power<2;power++)
6277 // sum of products of event weights for correlations <2>, <4>, <6> and <8>:
6278 TString intFlowSumOfProductOfEventWeightsName = "fIntFlowSumOfProductOfEventWeights";
6279 intFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
6280 TH1D *intFlowSumOfProductOfEventWeights = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowSumOfProductOfEventWeightsName.Data()));
6281 if(intFlowSumOfProductOfEventWeights)
6283 this->SetIntFlowSumOfProductOfEventWeights(intFlowSumOfProductOfEventWeights);
6286 cout<<"WARNING: intFlowSumOfProductOfEventWeights is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
6288 // final results for integrated Q-cumulants:
6289 TString intFlowQcumulantsName = "fIntFlowQcumulants";
6290 intFlowQcumulantsName += fAnalysisLabel->Data();
6291 TH1D *intFlowQcumulants = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowQcumulantsName.Data()));
6292 if(intFlowQcumulants)
6294 this->SetIntFlowQcumulants(intFlowQcumulants);
6297 cout<<"WARNING: intFlowQcumulants is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
6299 // final integrated flow estimates from Q-cumulants:
6300 TString intFlowName = "fIntFlow";
6301 intFlowName += fAnalysisLabel->Data();
6302 TH1D *intFlow = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowName.Data()));
6305 this->SetIntFlow(intFlow);
6308 cout<<"WARNING: intFlow is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
6310 } else // to if(intFlowResults)
6312 cout<<"WARNING: intFlowResults is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
6315 } // end of void AliFlowAnalysisWithQCumulants::GetPointersForIntFlowHistograms()
6318 //================================================================================================================================
6321 void AliFlowAnalysisWithQCumulants::GetPointersForDiffFlowHistograms()
6323 // Get pointer to all objects relevant for differential flow.
6324 // a) Define flags locally (to be improved: should I promote flags to data members?);
6325 // b) Get pointer to base list for differential flow fDiffFlowList and nested lists fDiffFlowListProfiles and fDiffFlowListResults;
6326 // c) Get pointer to profile fDiffFlowFlags holding all flags for differential flow;
6327 // d) Get pointers to all nested lists in fDiffFlowListProfiles and to profiles which they hold;
6328 // e) Get pointers to all nested lists in fDiffFlowListResults and to histograms which they hold.
6330 // a) Define flags locally (to be improved: should I promote flags to data members?):
6331 TString typeFlag[2] = {"RP","POI"};
6332 TString ptEtaFlag[2] = {"p_{T}","#eta"};
6333 TString powerFlag[2] = {"linear","quadratic"};
6334 TString sinCosFlag[2] = {"sin","cos"};
6335 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
6336 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
6337 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};
6338 TString mixedCorrelationIndex[8] = {"<2>","<2'>","<4>","<4'>","<6>","<6'>","<8>","<8'>"};
6339 TString covarianceName[5] = {"Cov(<2>,<2'>)","Cov(<2>,<4'>)","Cov(<4>,<2'>)","Cov(<4>,<4'>)","Cov(<2'>,<4'>)"};
6341 // b) Get pointer to base list for differential flow fDiffFlowList and nested lists fDiffFlowListProfiles and fDiffFlowListResults:
6342 TList *diffFlowList = NULL;
6343 diffFlowList = dynamic_cast<TList*>(fHistList->FindObject("Differential Flow"));
6346 cout<<"WARNING: diffFlowList is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
6349 // list holding nested lists containing profiles:
6350 TList *diffFlowListProfiles = NULL;
6351 diffFlowListProfiles = dynamic_cast<TList*>(diffFlowList->FindObject("Profiles"));
6352 if(!diffFlowListProfiles)
6354 cout<<"WARNING: diffFlowListProfiles is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
6357 // list holding nested lists containing 2D and 1D histograms with final results:
6358 TList *diffFlowListResults = NULL;
6359 diffFlowListResults = dynamic_cast<TList*>(diffFlowList->FindObject("Results"));
6360 if(!diffFlowListResults)
6362 cout<<"WARNING: diffFlowListResults is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
6366 // c) Get pointer to profile holding all flags for differential flow;
6367 TString diffFlowFlagsName = "fDiffFlowFlags";
6368 diffFlowFlagsName += fAnalysisLabel->Data();
6369 TProfile *diffFlowFlags = dynamic_cast<TProfile*>(diffFlowList->FindObject(diffFlowFlagsName.Data()));
6370 Bool_t bCalculate2DFlow = kFALSE;
6373 this->SetDiffFlowFlags(diffFlowFlags);
6374 bCalculate2DFlow = (Int_t)diffFlowFlags->GetBinContent(4);
6375 this->SetCalculate2DFlow(bCalculate2DFlow); // to be improved (shoul I call this setter somewhere else?)
6378 // d) Get pointers to all nested lists in fDiffFlowListProfiles and to profiles which they hold;
6380 TList *diffFlowCorrelationsProList[2][2] = {{NULL}};
6381 TString diffFlowCorrelationsProName = "fDiffFlowCorrelationsPro";
6382 diffFlowCorrelationsProName += fAnalysisLabel->Data();
6383 TProfile *diffFlowCorrelationsPro[2][2][4] = {{{NULL}}};
6384 // products of correlations:
6385 TList *diffFlowProductOfCorrelationsProList[2][2] = {{NULL}};
6386 TString diffFlowProductOfCorrelationsProName = "fDiffFlowProductOfCorrelationsPro";
6387 diffFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
6388 TProfile *diffFlowProductOfCorrelationsPro[2][2][8][8] = {{{{NULL}}}};
6390 TList *diffFlowCorrectionsProList[2][2] = {{NULL}};
6391 TString diffFlowCorrectionTermsForNUAProName = "fDiffFlowCorrectionTermsForNUAPro";
6392 diffFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
6393 TProfile *diffFlowCorrectionTermsForNUAPro[2][2][2][10] = {{{{NULL}}}};
6394 for(Int_t t=0;t<2;t++)
6396 for(Int_t pe=0;pe<2;pe++)
6398 diffFlowCorrelationsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
6399 if(!diffFlowCorrelationsProList[t][pe])
6401 cout<<"WARNING: diffFlowCorrelationsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
6402 cout<<"t = "<<t<<endl;
6403 cout<<"pe = "<<pe<<endl;
6406 for(Int_t ci=0;ci<4;ci++) // correlation index
6408 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())));
6409 if(diffFlowCorrelationsPro[t][pe][ci])
6411 this->SetDiffFlowCorrelationsPro(diffFlowCorrelationsPro[t][pe][ci],t,pe,ci);
6414 cout<<"WARNING: diffFlowCorrelationsPro[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
6415 cout<<"t = "<<t<<endl;
6416 cout<<"pe = "<<pe<<endl;
6417 cout<<"ci = "<<ci<<endl;
6419 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
6420 // products of correlations:
6421 diffFlowProductOfCorrelationsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with products of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
6422 if(!diffFlowProductOfCorrelationsProList[t][pe])
6424 cout<<"WARNING: ddiffFlowProductOfCorrelationsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
6425 cout<<"t = "<<t<<endl;
6426 cout<<"pe = "<<pe<<endl;
6429 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
6431 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
6433 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())));
6434 if(diffFlowProductOfCorrelationsPro[t][pe][mci1][mci2])
6436 this->SetDiffFlowProductOfCorrelationsPro(diffFlowProductOfCorrelationsPro[t][pe][mci1][mci2],t,pe,mci1,mci2);
6439 cout<<"WARNING: diffFlowCorrelationsPro[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
6440 cout<<"t = "<<t<<endl;
6441 cout<<"pe = "<<pe<<endl;
6442 cout<<"mci1 = "<<mci1<<endl;
6443 cout<<"mci2 = "<<mci2<<endl;
6445 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
6446 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
6447 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
6449 diffFlowCorrectionsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
6450 if(!diffFlowCorrectionsProList[t][pe])
6452 cout<<"WARNING: diffFlowCorrectionsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
6453 cout<<"t = "<<t<<endl;
6454 cout<<"pe = "<<pe<<endl;
6457 // correction terms for NUA:
6458 for(Int_t sc=0;sc<2;sc++) // sin or cos
6460 for(Int_t cti=0;cti<9;cti++) // correction term index
6462 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)));
6463 if(diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti])
6465 this->SetDiffFlowCorrectionTermsForNUAPro(diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti],t,pe,sc,cti);
6468 cout<<"WARNING: diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
6469 cout<<"t = "<<t<<endl;
6470 cout<<"pe = "<<pe<<endl;
6471 cout<<"sc = "<<sc<<endl;
6472 cout<<"cti = "<<cti<<endl;
6474 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index
6475 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
6477 } // end of for(Int_t pe=0;pe<2;pe++)
6478 } // end of for(Int_t t=0;t<2;t++)
6480 // e) Get pointers to all nested lists in fDiffFlowListResults and to histograms which they hold.
6481 // reduced correlations:
6482 TList *diffFlowCorrelationsHistList[2][2] = {{NULL}};
6483 TString diffFlowCorrelationsHistName = "fDiffFlowCorrelationsHist";
6484 diffFlowCorrelationsHistName += fAnalysisLabel->Data();
6485 TH1D *diffFlowCorrelationsHist[2][2][4] = {{{NULL}}};
6486 // corrections for NUA:
6487 TList *diffFlowCorrectionsHistList[2][2] = {{NULL}};
6488 TString diffFlowCorrectionTermsForNUAHistName = "fDiffFlowCorrectionTermsForNUAHist";
6489 diffFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
6490 TH1D *diffFlowCorrectionTermsForNUAHist[2][2][2][10] = {{{{NULL}}}};
6491 // differential Q-cumulants:
6492 TList *diffFlowCumulantsHistList[2][2] = {{NULL}};
6493 TString diffFlowCumulantsName = "fDiffFlowCumulants";
6494 diffFlowCumulantsName += fAnalysisLabel->Data();
6495 TH1D *diffFlowCumulants[2][2][4] = {{{NULL}}};
6496 // differential flow estimates from Q-cumulants:
6497 TList *diffFlowHistList[2][2] = {{NULL}};
6498 TString diffFlowName = "fDiffFlow";
6499 diffFlowName += fAnalysisLabel->Data();
6500 TH1D *diffFlow[2][2][4] = {{{NULL}}};
6501 // differential covariances:
6502 TList *diffFlowCovariancesHistList[2][2] = {{NULL}};
6503 TString diffFlowCovariancesName = "fDiffFlowCovariances";
6504 diffFlowCovariancesName += fAnalysisLabel->Data();
6505 TH1D *diffFlowCovariances[2][2][5] = {{{NULL}}};
6506 for(Int_t t=0;t<2;t++) // type: RP or POI
6508 for(Int_t pe=0;pe<2;pe++) // pt or eta
6510 // reduced correlations:
6511 diffFlowCorrelationsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
6512 if(!diffFlowCorrelationsHistList[t][pe])
6514 cout<<"WARNING: diffFlowCorrelationsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
6515 cout<<"t = "<<t<<endl;
6516 cout<<"pe = "<<pe<<endl;
6519 for(Int_t index=0;index<4;index++)
6521 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())));
6522 if(diffFlowCorrelationsHist[t][pe][index])
6524 this->SetDiffFlowCorrelationsHist(diffFlowCorrelationsHist[t][pe][index],t,pe,index);
6527 cout<<"WARNING: diffFlowCorrelationsHist[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
6528 cout<<"t = "<<t<<endl;
6529 cout<<"pe = "<<pe<<endl;
6530 cout<<"index = "<<index<<endl;
6533 } // end of for(Int_t index=0;index<4;index++)
6535 diffFlowCorrectionsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Histograms with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
6536 if(!diffFlowCorrectionsHistList[t][pe])
6538 cout<<"WARNING: diffFlowCorrectionsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
6539 cout<<"t = "<<t<<endl;
6540 cout<<"pe = "<<pe<<endl;
6543 // correction terms for NUA:
6544 for(Int_t sc=0;sc<2;sc++) // sin or cos
6546 for(Int_t cti=0;cti<9;cti++) // correction term index
6548 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)));
6549 if(diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti])
6551 this->SetDiffFlowCorrectionTermsForNUAHist(diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti],t,pe,sc,cti);
6554 cout<<"WARNING: diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
6555 cout<<"t = "<<t<<endl;
6556 cout<<"pe = "<<pe<<endl;
6557 cout<<"sc = "<<sc<<endl;
6558 cout<<"cti = "<<cti<<endl;
6560 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index
6561 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
6563 // differential Q-cumulants:
6564 diffFlowCumulantsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Differential Q-cumulants (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
6565 if(!diffFlowCumulantsHistList[t][pe])
6567 cout<<"WARNING: diffFlowCumulantsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
6568 cout<<"t = "<<t<<endl;
6569 cout<<"pe = "<<pe<<endl;
6572 for(Int_t index=0;index<4;index++)
6574 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())));
6575 if(diffFlowCumulants[t][pe][index])
6577 this->SetDiffFlowCumulants(diffFlowCumulants[t][pe][index],t,pe,index);
6580 cout<<"WARNING: diffFlowCumulants[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
6581 cout<<"t = "<<t<<endl;
6582 cout<<"pe = "<<pe<<endl;
6583 cout<<"index = "<<index<<endl;
6586 } // end of for(Int_t index=0;index<4;index++)
6587 // differential flow estimates from Q-cumulants:
6588 diffFlowHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Differential flow (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
6589 if(!diffFlowHistList[t][pe])
6591 cout<<"WARNING: diffFlowHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
6592 cout<<"t = "<<t<<endl;
6593 cout<<"pe = "<<pe<<endl;
6596 for(Int_t index=0;index<4;index++)
6598 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())));
6599 if(diffFlow[t][pe][index])
6601 this->SetDiffFlow(diffFlow[t][pe][index],t,pe,index);
6604 cout<<"WARNING: diffFlow[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
6605 cout<<"t = "<<t<<endl;
6606 cout<<"pe = "<<pe<<endl;
6607 cout<<"index = "<<index<<endl;
6610 } // end of for(Int_t index=0;index<4;index++)
6611 // differential covariances:
6612 diffFlowCovariancesHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Covariances of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
6613 if(!diffFlowCovariancesHistList[t][pe])
6615 cout<<"WARNING: diffFlowCovariancesHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
6616 cout<<"t = "<<t<<endl;
6617 cout<<"pe = "<<pe<<endl;
6620 for(Int_t covIndex=0;covIndex<5;covIndex++)
6622 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())));
6623 if(diffFlowCovariances[t][pe][covIndex])
6625 this->SetDiffFlowCovariances(diffFlowCovariances[t][pe][covIndex],t,pe,covIndex);
6628 cout<<"WARNING: diffFlowCovariances[t][pe][covIndex] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
6629 cout<<"t = "<<t<<endl;
6630 cout<<"pe = "<<pe<<endl;
6631 cout<<"covIndex = "<<covIndex<<endl;
6634 } // end of for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index
6635 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
6636 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
6637 // sum of event weights for reduced correlations:
6638 TList *diffFlowSumOfEventWeightsHistList[2][2][2] = {{{NULL}}};
6639 TString diffFlowSumOfEventWeightsName = "fDiffFlowSumOfEventWeights";
6640 diffFlowSumOfEventWeightsName += fAnalysisLabel->Data();
6641 TH1D *diffFlowSumOfEventWeights[2][2][2][4] = {{{{NULL}}}};
6642 for(Int_t t=0;t<2;t++) // type is RP or POI
6644 for(Int_t pe=0;pe<2;pe++) // pt or eta
6646 for(Int_t p=0;p<2;p++) // power of event weights is either 1 or 2
6648 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())));
6649 if(!diffFlowSumOfEventWeightsHistList[t][pe][p])
6651 cout<<"WARNING: diffFlowSumOfEventWeightsHistList[t][pe][p] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
6652 cout<<"t = "<<t<<endl;
6653 cout<<"pe = "<<pe<<endl;
6654 cout<<"power = "<<p<<endl;
6657 for(Int_t ew=0;ew<4;ew++) // index of reduced correlation
6659 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())));
6660 if(diffFlowSumOfEventWeights[t][pe][p][ew])
6662 this->SetDiffFlowSumOfEventWeights(diffFlowSumOfEventWeights[t][pe][p][ew],t,pe,p,ew);
6665 cout<<"WARNING: diffFlowSumOfEventWeights[t][pe][p][ew] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
6666 cout<<"t = "<<t<<endl;
6667 cout<<"pe = "<<pe<<endl;
6668 cout<<"power = "<<p<<endl;
6669 cout<<"ew = "<<ew<<endl;
6673 } // end of for(Int_t p=0;p<2;p++) // power of event weights is either 1 or 2
6674 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
6675 } // end of for(Int_t t=0;t<2;t++) // type is RP or POI
6677 TList *diffFlowSumOfProductOfEventWeightsHistList[2][2] = {{NULL}};
6678 TString diffFlowSumOfProductOfEventWeightsName = "fDiffFlowSumOfProductOfEventWeights";
6679 diffFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
6680 TH1D *diffFlowSumOfProductOfEventWeights[2][2][8][8] = {{{{NULL}}}};
6681 for(Int_t t=0;t<2;t++) // type is RP or POI
6683 for(Int_t pe=0;pe<2;pe++) // pt or eta
6685 diffFlowSumOfProductOfEventWeightsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Sum of products of event weights (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
6686 if(!diffFlowSumOfProductOfEventWeightsHistList[t][pe])
6688 cout<<"WARNING: diffFlowSumOfProductOfEventWeightsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
6689 cout<<"t = "<<t<<endl;
6690 cout<<"pe = "<<pe<<endl;
6693 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
6695 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
6697 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())));
6698 if(diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2])
6700 this->SetDiffFlowSumOfProductOfEventWeights(diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2],t,pe,mci1,mci2);
6703 cout<<"WARNING: diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
6704 cout<<"t = "<<t<<endl;
6705 cout<<"pe = "<<pe<<endl;
6706 cout<<"mci1 = "<<mci1<<endl;
6707 cout<<"mci2 = "<<mci2<<endl;
6710 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
6711 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
6712 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
6713 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
6714 } // end of for(Int_t t=0;t<2;t++) // type is RP or POI
6716 } // end void AliFlowAnalysisWithQCumulants::GetPointersForDiffFlowHistograms()
6719 //================================================================================================================================
6722 void AliFlowAnalysisWithQCumulants::BookEverythingForDifferentialFlow()
6724 // Book all histograms and profiles needed for differential flow.
6725 // a) Define flags locally (to be improved: should I promote flags to data members?);
6726 // b) Book profile to hold all flags for differential flow;
6727 // c) Book e-b-e quantities;
6728 // d) Book profiles;
6729 // e) Book histograms holding final results.
6731 // a) Define flags locally (to be improved: should I promote flags to data members?):
6732 TString typeFlag[2] = {"RP","POI"};
6733 TString ptEtaFlag[2] = {"p_{T}","#eta"};
6734 TString powerFlag[2] = {"linear","quadratic"};
6735 TString sinCosFlag[2] = {"sin","cos"};
6736 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
6737 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
6738 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};
6739 TString mixedCorrelationIndex[8] = {"<2>","<2'>","<4>","<4'>","<6>","<6'>","<8>","<8'>"};
6740 TString covarianceName[5] = {"Cov(<2>,<2'>)","Cov(<2>,<4'>)","Cov(<4>,<2'>)","Cov(<4>,<4'>)","Cov(<2'>,<4'>)"};
6741 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6742 Double_t minPtEta[2] = {fPtMin,fEtaMin};
6743 Double_t maxPtEta[2] = {fPtMax,fEtaMax};
6745 // b) Book profile to hold all flags for differential flow:
6746 TString diffFlowFlagsName = "fDiffFlowFlags";
6747 diffFlowFlagsName += fAnalysisLabel->Data();
6748 fDiffFlowFlags = new TProfile(diffFlowFlagsName.Data(),"Flags for Differential Flow",4,0,4);
6749 fDiffFlowFlags->SetTickLength(-0.01,"Y");
6750 fDiffFlowFlags->SetMarkerStyle(25);
6751 fDiffFlowFlags->SetLabelSize(0.05);
6752 fDiffFlowFlags->SetLabelOffset(0.02,"Y");
6753 (fDiffFlowFlags->GetXaxis())->SetBinLabel(1,"Particle Weights");
6754 (fDiffFlowFlags->GetXaxis())->SetBinLabel(2,"Event Weights");
6755 (fDiffFlowFlags->GetXaxis())->SetBinLabel(3,"Corrected for NUA?");
6756 (fDiffFlowFlags->GetXaxis())->SetBinLabel(4,"Calculated 2D flow?");
6757 fDiffFlowList->Add(fDiffFlowFlags);
6759 // c) Book e-b-e quantities:
6760 // Event-by-event r_{m*n,k}(pt,eta), p_{m*n,k}(pt,eta) and q_{m*n,k}(pt,eta)
6761 // Explanantion of notation:
6762 // 1.) n is harmonic, m is multiple of harmonic;
6763 // 2.) k is power of particle weight;
6764 // 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);
6765 // 4.) p_{m*n,k}(pt,eta) = Q-vector evaluated in harmonic m*n for POIs in particular (pt,eta) bin
6766 // (if i-th POI is also RP, than it is weighted with w_i^k);
6767 // 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
6768 // (i-th RP&&POI is weighted with w_i^k)
6771 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP && POI )
6773 for(Int_t pe=0;pe<2;pe++) // pt or eta
6775 for(Int_t m=0;m<4;m++) // multiple of harmonic
6777 for(Int_t k=0;k<9;k++) // power of particle weight
6779 fReRPQ1dEBE[t][pe][m][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%dpower%dRe",t,pe,m,k),
6780 Form("TypeFlag%dpteta%dmultiple%dpower%dRe",t,pe,m,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
6781 fImRPQ1dEBE[t][pe][m][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%dpower%dIm",t,pe,m,k),
6782 Form("TypeFlag%dpteta%dmultiple%dpower%dIm",t,pe,m,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
6787 // to be improved (add explanation of fs1dEBE[t][pe][k]):
6788 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
6790 for(Int_t pe=0;pe<2;pe++) // pt or eta
6792 for(Int_t k=0;k<9;k++) // power of particle weight
6794 fs1dEBE[t][pe][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%d",t,pe,k),
6795 Form("TypeFlag%dpteta%dmultiple%d",t,pe,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
6799 // correction terms for nua:
6800 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
6802 for(Int_t pe=0;pe<2;pe++) // pt or eta
6804 for(Int_t sc=0;sc<2;sc++) // sin or cos
6806 for(Int_t cti=0;cti<9;cti++) // correction term index
6808 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti] = new TH1D(Form("typeFlag%d pteta%d sincos%d cti%d",t,pe,sc,cti),
6809 Form("typeFlag%d pteta%d sincos%d cti%d",t,pe,sc,cti),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
6815 TProfile2D styleRe("typeMultiplePowerRe","typeMultiplePowerRe",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
6816 TProfile2D styleIm("typeMultiplePowerIm","typeMultiplePowerIm",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
6817 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
6819 for(Int_t m=0;m<4;m++)
6821 for(Int_t k=0;k<9;k++)
6823 fReRPQ2dEBE[t][m][k] = (TProfile2D*)styleRe.Clone(Form("typeFlag%dmultiple%dpower%dRe",t,m,k));
6824 fImRPQ2dEBE[t][m][k] = (TProfile2D*)styleIm.Clone(Form("typeFlag%dmultiple%dpower%dIm",t,m,k));
6828 TProfile2D styleS("typePower","typePower",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
6829 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
6831 for(Int_t k=0;k<9;k++)
6833 fs2dEBE[t][k] = (TProfile2D*)styleS.Clone(Form("typeFlag%dpower%d",t,k));
6836 // reduced correlations e-b-e:
6837 TString diffFlowCorrelationsEBEName = "fDiffFlowCorrelationsEBE";
6838 diffFlowCorrelationsEBEName += fAnalysisLabel->Data();
6839 for(Int_t t=0;t<2;t++) // type: RP or POI
6841 for(Int_t pe=0;pe<2;pe++) // pt or eta
6843 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
6845 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]);
6846 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
6847 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
6848 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
6849 // event weights for reduced correlations e-b-e:
6850 TString diffFlowEventWeightsForCorrelationsEBEName = "fDiffFlowEventWeightsForCorrelationsEBE";
6851 diffFlowEventWeightsForCorrelationsEBEName += fAnalysisLabel->Data();
6852 for(Int_t t=0;t<2;t++) // type: RP or POI
6854 for(Int_t pe=0;pe<2;pe++) // pt or eta
6856 for(Int_t rci=0;rci<4;rci++) // event weight for reduced correlation index
6858 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]);
6859 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
6860 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
6861 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
6863 // d) Book profiles;
6864 // reduced correlations:
6865 TString diffFlowCorrelationsProName = "fDiffFlowCorrelationsPro";
6866 diffFlowCorrelationsProName += fAnalysisLabel->Data();
6867 // corrections terms:
6868 TString diffFlowCorrectionTermsForNUAProName = "fDiffFlowCorrectionTermsForNUAPro";
6869 diffFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
6870 for(Int_t t=0;t<2;t++) // type: RP or POI
6872 for(Int_t pe=0;pe<2;pe++) // pt or eta
6874 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
6876 // reduced correlations:
6877 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");
6878 fDiffFlowCorrelationsPro[t][pe][rci]->SetXTitle(ptEtaFlag[pe].Data());
6879 fDiffFlowCorrelationsProList[t][pe]->Add(fDiffFlowCorrelationsPro[t][pe][rci]); // to be improved (add dedicated list to hold reduced correlations)
6880 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
6881 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
6882 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
6883 // correction terms for nua:
6884 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
6886 for(Int_t pe=0;pe<2;pe++) // pt or eta
6888 for(Int_t sc=0;sc<2;sc++) // sin or cos
6890 for(Int_t cti=0;cti<9;cti++) // correction term index
6892 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]);
6893 fDiffFlowCorrectionsProList[t][pe]->Add(fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]);
6898 // e) Book histograms holding final results.
6899 // reduced correlations:
6900 TString diffFlowCorrelationsHistName = "fDiffFlowCorrelationsHist";
6901 diffFlowCorrelationsHistName += fAnalysisLabel->Data();
6902 // corrections terms:
6903 TString diffFlowCorrectionTermsForNUAHistName = "fDiffFlowCorrectionTermsForNUAHist";
6904 diffFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
6905 // differential covariances:
6906 TString diffFlowCovariancesName = "fDiffFlowCovariances";
6907 diffFlowCovariancesName += fAnalysisLabel->Data();
6908 // differential Q-cumulants:
6909 TString diffFlowCumulantsName = "fDiffFlowCumulants";
6910 diffFlowCumulantsName += fAnalysisLabel->Data();
6911 // differential flow:
6912 TString diffFlowName = "fDiffFlow";
6913 diffFlowName += fAnalysisLabel->Data();
6914 for(Int_t t=0;t<2;t++) // type: RP or POI
6916 for(Int_t pe=0;pe<2;pe++) // pt or eta
6918 for(Int_t index=0;index<4;index++)
6920 // reduced correlations:
6921 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]);
6922 fDiffFlowCorrelationsHist[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
6923 fDiffFlowCorrelationsHistList[t][pe]->Add(fDiffFlowCorrelationsHist[t][pe][index]);
6924 // differential Q-cumulants:
6925 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]);
6926 fDiffFlowCumulants[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
6927 fDiffFlowCumulantsHistList[t][pe]->Add(fDiffFlowCumulants[t][pe][index]);
6928 // differential flow estimates from Q-cumulants:
6929 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]);
6930 fDiffFlow[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
6931 fDiffFlowHistList[t][pe]->Add(fDiffFlow[t][pe][index]);
6932 } // end of for(Int_t index=0;index<4;index++)
6933 for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index
6935 // differential covariances:
6936 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]);
6937 fDiffFlowCovariances[t][pe][covIndex]->SetXTitle(ptEtaFlag[pe].Data());
6938 fDiffFlowCovariancesHistList[t][pe]->Add(fDiffFlowCovariances[t][pe][covIndex]);
6939 } // end of for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index
6940 // products of both types of correlations:
6941 TString diffFlowProductOfCorrelationsProName = "fDiffFlowProductOfCorrelationsPro";
6942 diffFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
6943 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
6945 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
6947 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]);
6948 fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2]->SetXTitle(ptEtaFlag[pe].Data());
6949 fDiffFlowProductOfCorrelationsProList[t][pe]->Add(fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2]);
6950 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
6951 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
6952 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
6953 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
6954 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
6955 // sums of event weights for reduced correlations:
6956 TString diffFlowSumOfEventWeightsName = "fDiffFlowSumOfEventWeights";
6957 diffFlowSumOfEventWeightsName += fAnalysisLabel->Data();
6958 for(Int_t t=0;t<2;t++) // type is RP or POI
6960 for(Int_t pe=0;pe<2;pe++) // pt or eta
6962 for(Int_t p=0;p<2;p++) // power of weights is either 1 or 2
6964 for(Int_t ew=0;ew<4;ew++) // index of reduced correlation
6966 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]);
6967 fDiffFlowSumOfEventWeights[t][pe][p][ew]->SetXTitle(ptEtaFlag[pe].Data());
6968 fDiffFlowSumOfEventWeightsHistList[t][pe][p]->Add(fDiffFlowSumOfEventWeights[t][pe][p][ew]); // to be improved (add dedicated list to hold all this)
6973 // sum of products of event weights for both types of correlations:
6974 TString diffFlowSumOfProductOfEventWeightsName = "fDiffFlowSumOfProductOfEventWeights";
6975 diffFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
6976 for(Int_t t=0;t<2;t++) // type is RP or POI
6978 for(Int_t pe=0;pe<2;pe++) // pt or eta
6980 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
6982 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
6984 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]);
6985 fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2]->SetXTitle(ptEtaFlag[pe].Data());
6986 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]->Add(fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2]);
6987 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
6992 // correction terms for nua:
6993 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
6995 for(Int_t pe=0;pe<2;pe++) // pt or eta
6997 for(Int_t sc=0;sc<2;sc++) // sin or cos
6999 for(Int_t cti=0;cti<9;cti++) // correction term index
7001 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]);
7002 fDiffFlowCorrectionsHistList[t][pe]->Add(fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti]);
7008 } // end of AliFlowAnalysisWithQCumulants::BookEverythingForDifferentialFlow()
7011 //================================================================================================================================
7014 void AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNUAForIntQcumulants() // to be improved (do I really need this method?)
7016 // Calculate final corrections for non-uniform acceptance for Q-cumulants.
7018 // Corrections for non-uniform acceptance are stored in histogram fCorrectionsForNUA,
7019 // binning of fCorrectionsForNUA is organized as follows:
7021 // 1st bin: correction to QC{2}
7022 // 2nd bin: correction to QC{4}
7023 // 3rd bin: correction to QC{6}
7024 // 4th bin: correction to QC{8}
7027 Int_t pW = (Int_t)(useParticleWeights);
7031 if(eventWeights == "exact")
7036 for(Int_t sc=0;sc<2;sc++) // sin or cos terms flag
7038 if(!(fQCorrelations[pW][eW] && fQCorrections[pW][eW][sc] && fCorrections[pW][eW]))
7040 cout<<"WARNING: fQCorrelations[pW][eW] && fQCorrections[pW][eW][sc] && fCorrections[pW][eW] is NULL in AFAWQC::CFCFNUAFIF() !!!!"<<endl;
7041 cout<<"pW = "<<pW<<endl;
7042 cout<<"eW = "<<eW<<endl;
7043 cout<<"sc = "<<sc<<endl;
7048 // measured 2-, 4-, 6- and 8-particle azimuthal correlations (biased with non-uniform acceptance!):
7049 Double_t two = fQCorrelations[pW][eW]->GetBinContent(1); // <<2>>
7050 //Double_t four = fQCorrelations[pW][eW]->GetBinContent(11); // <<4>>
7051 //Double_t six = fQCorrelations[pW][eW]->GetBinContent(24); // <<6>>
7052 //Double_t eight = fQCorrelations[pW][eW]->GetBinContent(31); // <<8>>
7054 // correction terms to QC{2}:
7055 // <<cos(n*phi1)>>^2
7056 Double_t two1stTerm = pow(fQCorrections[pW][eW][1]->GetBinContent(1),2);
7057 // <<sin(n*phi1)>>^2
7058 Double_t two2ndTerm = pow(fQCorrections[pW][eW][0]->GetBinContent(1),2);
7059 // final corrections for non-uniform acceptance to QC{2}:
7060 Double_t correctionQC2 = -1.*two1stTerm-1.*two2ndTerm;
7061 fCorrections[pW][eW]->SetBinContent(1,correctionQC2);
7063 // correction terms to QC{4}:
7064 // <<cos(n*phi1)>> <<cos(n*(phi1-phi2-phi3))>>
7065 Double_t four1stTerm = fQCorrections[pW][eW][1]->GetBinContent(1)*fQCorrections[pW][eW][1]->GetBinContent(3);
7066 // <<sin(n*phi1)>> <<sin(n*(phi1-phi2-phi3))>>
7067 Double_t four2ndTerm = fQCorrections[pW][eW][0]->GetBinContent(1)*fQCorrections[pW][eW][0]->GetBinContent(3);
7068 // <<cos(n*(phi1+phi2))>>^2
7069 Double_t four3rdTerm = pow(fQCorrections[pW][eW][1]->GetBinContent(2),2);
7070 // <<sin(n*(phi1+phi2))>>^2
7071 Double_t four4thTerm = pow(fQCorrections[pW][eW][0]->GetBinContent(2),2);
7072 // <<cos(n*(phi1+phi2))>> (<<cos(n*phi1)>>^2 - <<sin(n*phi1)>>^2)
7073 Double_t four5thTerm = fQCorrections[pW][eW][1]->GetBinContent(2)
7074 * (pow(fQCorrections[pW][eW][1]->GetBinContent(1),2)-pow(fQCorrections[pW][eW][0]->GetBinContent(1),2));
7075 // <<sin(n*(phi1+phi2))>> <<cos(n*phi1)>> <<sin(n*phi1)>>
7076 Double_t four6thTerm = fQCorrections[pW][eW][0]->GetBinContent(2)
7077 * fQCorrections[pW][eW][1]->GetBinContent(1)
7078 * fQCorrections[pW][eW][0]->GetBinContent(1);
7079 // <<cos(n*(phi1-phi2))>> (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2)
7080 Double_t four7thTerm = two*(pow(fQCorrections[pW][eW][1]->GetBinContent(1),2)+pow(fQCorrections[pW][eW][0]->GetBinContent(1),2));
7081 // (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2)^2
7082 Double_t four8thTerm = pow(pow(fQCorrections[pW][eW][1]->GetBinContent(1),2)+pow(fQCorrections[pW][eW][0]->GetBinContent(1),2),2);
7083 // final correction to QC{4}:
7084 Double_t correctionQC4 = -4.*four1stTerm+4.*four2ndTerm-four3rdTerm-four4thTerm
7085 + 4.*four5thTerm+8.*four6thTerm+8.*four7thTerm-6.*four8thTerm;
7086 fCorrections[pW][eW]->SetBinContent(2,correctionQC4);
7088 // ... to be improved (continued for 6th and 8th order)
7091 } // end of AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNUAForIntQcumulants()
7094 //================================================================================================================================
7097 void AliFlowAnalysisWithQCumulants::CalculateQcumulantsCorrectedForNUAIntFlow()
7099 // Calculate generalized Q-cumulants (cumulants corrected for non-unifom acceptance).
7101 // measured 2-, 4-, 6- and 8-particle correlations (biased by non-uniform acceptance!):
7102 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
7103 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
7104 //Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
7105 //Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
7107 // statistical error of measured 2-, 4-, 6- and 8-particle correlations:
7108 //Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <<2>>
7109 //Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <<4>>
7110 //Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <<6>>
7111 //Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <<8>>
7114 // <<cos(n*phi1)>>^2
7115 Double_t two1stTerm = pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1),2);
7116 //Double_t two1stTermErrorSquared = pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(1),2);
7117 // <<sin(n*phi1)>>^2
7118 Double_t two2ndTerm = pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1),2);
7119 //Double_t two2ndTermErrorSquared = pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(1),2);
7120 // generalized QC{2}:
7121 Double_t gQC2 = two - two1stTerm - two2ndTerm; // to be improved (terminology, notation)
7122 fIntFlowQcumulants->SetBinContent(1,gQC2);
7123 //fIntFlowQcumulants->SetBinError(1,0.); // to be improved (propagate error)
7126 // <<cos(n*phi1)>> <<cos(n*(phi1-phi2-phi3))>>
7127 Double_t four1stTerm = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1)
7128 * fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(3);
7129 // <<sin(n*phi1)>> <<sin(n*(phi1-phi2-phi3))>>
7130 Double_t four2ndTerm = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1)
7131 * fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(3);
7132 // <<cos(n*(phi1+phi2))>>^2
7133 Double_t four3rdTerm = pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2),2);
7134 // <<sin(n*(phi1+phi2))>>^2
7135 Double_t four4thTerm = pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2),2);
7136 // <<cos(n*(phi1+phi2))>> (<<cos(n*phi1)>>^2 - <<sin(n*phi1)>>^2)
7137 Double_t four5thTerm = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2)
7138 * (pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1),2)
7139 - pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1),2));
7140 // <<sin(n*(phi1+phi2))>> <<cos(n*phi1)>> <<sin(n*phi1)>>
7141 Double_t four6thTerm = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2)
7142 * fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1)
7143 * fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1);
7144 // <<cos(n*(phi1-phi2))>> (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2)
7145 Double_t four7thTerm = two*(pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1),2)
7146 + pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1),2));
7147 // (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2)^2
7148 Double_t four8thTerm = pow(pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1),2)
7149 + pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1),2),2);
7150 // generalized QC{4}:
7151 Double_t gQC4 = four-2.*pow(two,2.)-4.*four1stTerm+4.*four2ndTerm-four3rdTerm
7152 - four4thTerm+4.*four5thTerm+8.*four6thTerm+8.*four7thTerm-6.*four8thTerm;
7153 fIntFlowQcumulants->SetBinContent(2,gQC4);
7154 //fIntFlowQcumulants->SetBinError(2,0.); // to be improved (propagate error)
7156 // ... to be improved (continued for 6th and 8th order)
7158 } // end of void AliFlowAnalysisWithQCumulants::CalculateQcumulantsCorrectedForNUAIntFlow()
7161 //================================================================================================================================
7164 void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectedForNUA()
7166 // Calculate integrated flow from generalized Q-cumulants (corrected for non-uniform acceptance).
7168 // to be improved: add protection for NULL pointers, propagate statistical errors from
7169 // measured correlations and correction terms
7171 // generalized Q-cumulants:
7172 Double_t qc2 = fIntFlowQcumulants->GetBinContent(1); // QC{2}
7173 Double_t qc4 = fIntFlowQcumulants->GetBinContent(2); // QC{4}
7174 //Double_t qc6 = fIntFlowQcumulants->GetBinContent(3); // QC{6}
7175 //Double_t qc8 = fIntFlowQcumulants->GetBinContent(4); // QC{8}
7177 // integrated flow estimates:
7178 Double_t v2 = 0.; // v{2,QC}
7179 Double_t v4 = 0.; // v{4,QC}
7180 //Double_t v6 = 0.; // v{6,QC}
7181 //Double_t v8 = 0.; // v{8,QC}
7183 // calculate integrated flow estimates from generalized Q-cumulants:
7184 if(qc2>=0.) v2 = pow(qc2,1./2.);
7185 if(qc4<=0.) v4 = pow(-1.*qc4,1./4.);
7186 //if(qc6>=0.) v6 = pow((1./4.)*qc6,1./6.);
7187 //if(qc8<=0.) v8 = pow((-1./33.)*qc8,1./8.);
7189 // store integrated flow estimates from generalized Q-cumulants:
7190 fIntFlow->SetBinContent(1,v2);
7191 fIntFlow->SetBinContent(2,v4);
7192 //fIntFlow->SetBinContent(3,v6);
7193 //fIntFlow->SetBinContent(4,v8);
7195 } // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectedForNUA()
7198 //================================================================================================================================
7201 void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUAIntFlow()
7203 // From profile fIntFlowCorrectionTermsForNUAPro[2] access measured corretion terms
7204 // and their spread, correctly calculate the statistical errors and store the final
7205 // results and statistical errors for correction terms in histogram fIntFlowCorrectionTermsForNUAHist[2].
7207 // Remark: Statistical error of correction temrs is calculated as:
7209 // statistical error = termA * spread * termB:
7210 // termA = sqrt{sum_{i=1}^{N} w^2}/(sum_{i=1}^{N} w)
7211 // termB = 1/sqrt(1-termA^2)
7213 /* // to be improved (implement protection here)
7214 for(Int_t power=0;power<2;power++)
7216 if(!(fIntFlowCorrelationsHist && fIntFlowCorrelationsPro && fIntFlowSumOfEventWeights[power]))
7218 cout<<"WARNING: fIntFlowCorrelationsHist && fIntFlowCorrelationsPro && fIntFlowSumOfEventWeights[power] is NULL in AFAWQC::FCIF() !!!!"<<endl;
7219 cout<<"power = "<<power<<endl;
7225 for(Int_t sc=0;sc<2;sc++) // sin or cos correction terms
7227 for(Int_t ci=1;ci<=10;ci++) // correction term index
7229 Double_t correction = fIntFlowCorrectionTermsForNUAPro[sc]->GetBinContent(ci);
7230 //Double_t spread = fIntFlowCorrectionTermsForNUAPro[sc]->GetBinError(ci);
7231 //Double_t sumOfLinearEventWeights = fIntFlowSumOfEventWeights[0]->GetBinContent(ci);
7232 //Double_t sumOfQuadraticEventWeights = fIntFlowSumOfEventWeights[1]->GetBinContent(ci);
7233 //Double_t termA = 0.;
7234 //Double_t termB = 0.;
7235 //if(sumOfLinearEventWeights)
7237 // termA = pow(sumOfQuadraticEventWeights,0.5)/sumOfLinearEventWeights;
7240 // cout<<"WARNING: sumOfLinearEventWeights == 0 in AFAWQC::FCIF() !!!!"<<endl;
7241 // cout<<" (for "<<2*ci<<"-particle correlation)"<<endl;
7244 if(1.-pow(termA,2.) > 0.)
7246 termB = 1./pow(1-pow(termA,2.),0.5);
7249 cout<<"WARNING: 1.-pow(termA,2.) <= 0 in AFAWQC::FCIF() !!!!"<<endl;
7250 cout<<" (for "<<2*ci<<"-particle correlation)"<<endl;
7252 Double_t statisticalError = termA * spread * termB;
7254 fIntFlowCorrectionTermsForNUAHist[sc]->SetBinContent(ci,correction);
7255 //fIntFlowCorrectionTermsForNUAHist[sc]->SetBinError(ci,statisticalError);
7256 } // end of for(Int_t ci=1;ci<=10;ci++) // correction term index
7257 } // end of for(Int sc=0;sc<2;sc++) // sin or cos correction terms
7259 } // end of void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUAIntFlow()
7262 //================================================================================================================================
7265 void AliFlowAnalysisWithQCumulants::GetPointersForNestedLoopsHistograms()
7267 // Get pointers to all objects relevant for calculations with nested loops.
7269 TList *nestedLoopsList = dynamic_cast<TList*>(fHistList->FindObject("Nested Loops"));
7272 this->SetNestedLoopsList(nestedLoopsList);
7275 cout<<"WARNING: nestedLoopsList is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
7279 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)
7280 TString typeFlag[2] = {"RP","POI"}; // to be improved (should I promote this to data members?)
7281 TString ptEtaFlag[2] = {"p_{T}","#eta"}; // to be improved (should I promote this to data members?)
7282 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"}; // to be improved (should I promote this to data members?)
7284 TString evaluateNestedLoopsName = "fEvaluateNestedLoops";
7285 evaluateNestedLoopsName += fAnalysisLabel->Data();
7286 TProfile *evaluateNestedLoops = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(evaluateNestedLoopsName.Data()));
7287 Bool_t bEvaluateIntFlowNestedLoops = kFALSE;
7288 Bool_t bEvaluateDiffFlowNestedLoops = kFALSE;
7289 if(evaluateNestedLoops)
7291 this->SetEvaluateNestedLoops(evaluateNestedLoops);
7292 bEvaluateIntFlowNestedLoops = (Int_t)evaluateNestedLoops->GetBinContent(1);
7293 bEvaluateDiffFlowNestedLoops = (Int_t)evaluateNestedLoops->GetBinContent(2);
7295 // nested loops relevant for integrated flow:
7296 if(bEvaluateIntFlowNestedLoops)
7299 TString intFlowDirectCorrelationsName = "fIntFlowDirectCorrelations";
7300 intFlowDirectCorrelationsName += fAnalysisLabel->Data();
7301 TProfile *intFlowDirectCorrelations = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(intFlowDirectCorrelationsName.Data()));
7302 if(intFlowDirectCorrelations)
7304 this->SetIntFlowDirectCorrelations(intFlowDirectCorrelations);
7307 cout<<"WARNING: intFlowDirectCorrelations is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
7310 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
7312 TString intFlowExtraDirectCorrelationsName = "fIntFlowExtraDirectCorrelations";
7313 intFlowExtraDirectCorrelationsName += fAnalysisLabel->Data();
7314 TProfile *intFlowExtraDirectCorrelations = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(intFlowExtraDirectCorrelationsName.Data()));
7315 if(intFlowExtraDirectCorrelations)
7317 this->SetIntFlowExtraDirectCorrelations(intFlowExtraDirectCorrelations);
7320 cout<<"WARNING: intFlowExtraDirectCorrelations is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
7323 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
7324 // correction terms for non-uniform acceptance:
7325 TString intFlowDirectCorrectionTermsForNUAName = "fIntFlowDirectCorrectionTermsForNUA";
7326 intFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
7327 TProfile *intFlowDirectCorrectionTermsForNUA[2] = {NULL};
7328 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
7330 intFlowDirectCorrectionTermsForNUA[sc] = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(Form("%s: %s terms",intFlowDirectCorrectionTermsForNUAName.Data(),sinCosFlag[sc].Data())));
7331 if(intFlowDirectCorrectionTermsForNUA[sc])
7333 this->SetIntFlowDirectCorrectionTermsForNUA(intFlowDirectCorrectionTermsForNUA[sc],sc);
7336 cout<<"WARNING: intFlowDirectCorrectionTermsForNUA[sc] is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
7337 cout<<"sc = "<<sc<<endl;
7340 } // end of for(Int_t sc=0;sc<2;sc++)
7341 } // end of if(bEvaluateIntFlowNestedLoops)
7343 // nested loops relevant for differential flow:
7344 if(bEvaluateDiffFlowNestedLoops)
7347 TString diffFlowDirectCorrelationsName = "fDiffFlowDirectCorrelations";
7348 diffFlowDirectCorrelationsName += fAnalysisLabel->Data();
7349 TProfile *diffFlowDirectCorrelations[2][2][4] = {{{NULL}}};
7350 for(Int_t t=0;t<2;t++)
7352 for(Int_t pe=0;pe<2;pe++)
7354 for(Int_t ci=0;ci<4;ci++) // correlation index
7356 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())));
7357 if(diffFlowDirectCorrelations[t][pe][ci])
7359 this->SetDiffFlowDirectCorrelations(diffFlowDirectCorrelations[t][pe][ci],t,pe,ci);
7362 cout<<"WARNING: diffFlowDirectCorrelations[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
7363 cout<<"t = "<<t<<endl;
7364 cout<<"pe = "<<pe<<endl;
7365 cout<<"ci = "<<ci<<endl;
7367 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
7368 } // end of for(Int_t pe=0;pe<2;pe++)
7369 } // end of for(Int_t t=0;t<2;t++)
7370 // correction terms for non-uniform acceptance:
7371 TString diffFlowDirectCorrectionTermsForNUAName = "fDiffFlowDirectCorrectionTermsForNUA";
7372 diffFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
7373 TProfile *diffFlowDirectCorrectionTermsForNUA[2][2][2][10] = {{{{NULL}}}};
7374 for(Int_t t=0;t<2;t++)
7376 for(Int_t pe=0;pe<2;pe++)
7378 // correction terms for NUA:
7379 for(Int_t sc=0;sc<2;sc++) // sin or cos
7381 for(Int_t cti=0;cti<9;cti++) // correction term index
7383 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)));
7384 if(diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti])
7386 this->SetDiffFlowDirectCorrectionTermsForNUA(diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti],t,pe,sc,cti);
7389 cout<<"WARNING: diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
7390 cout<<"t = "<<t<<endl;
7391 cout<<"pe = "<<pe<<endl;
7392 cout<<"sc = "<<sc<<endl;
7393 cout<<"cti = "<<cti<<endl;
7395 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index
7396 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
7397 } // end of for(Int_t pe=0;pe<2;pe++)
7398 } // end of for(Int_t t=0;t<2;t++)
7399 // number of RPs and POIs in selected pt and eta bins for cross-checkings:
7400 TString noOfParticlesInBinName = "fNoOfParticlesInBin";
7401 TH1D *noOfParticlesInBin = NULL;
7402 noOfParticlesInBin = dynamic_cast<TH1D*>(nestedLoopsList->FindObject(noOfParticlesInBinName.Data()));
7403 if(noOfParticlesInBin)
7405 this->SetNoOfParticlesInBin(noOfParticlesInBin);
7409 cout<<" WARNING (QC): noOfParticlesInBin is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
7412 } // end of if(bEvaluateDiffFlowNestedLoops)
7414 } // end of void AliFlowAnalysisWithQCumulants::GetPointersForNestedLoopsHistograms()
7417 //================================================================================================================================
7420 void AliFlowAnalysisWithQCumulants::StoreHarmonic()
7422 // Store flow harmonic in common control histograms.
7424 (fCommonHists->GetHarmonic())->Fill(0.5,fHarmonic);
7425 (fCommonHists2nd->GetHarmonic())->Fill(0.5,fHarmonic);
7426 (fCommonHists4th->GetHarmonic())->Fill(0.5,fHarmonic);
7427 (fCommonHists6th->GetHarmonic())->Fill(0.5,fHarmonic);
7428 (fCommonHists8th->GetHarmonic())->Fill(0.5,fHarmonic);
7430 } // end of void AliFlowAnalysisWithQCumulants::StoreHarmonic()
7433 //================================================================================================================================
7436 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelationsUsingParticleWeights(TString type, TString ptOrEta) // type = RP or POI
7438 // Calculate all correlations needed for differential flow using particle weights.
7440 Int_t t = -1; // type flag
7441 Int_t pe = -1; // ptEta flag
7446 } else if(type == "POI")
7454 } else if(ptOrEta == "Eta")
7459 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
7460 Double_t minPtEta[2] = {fPtMin,fEtaMin};
7461 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
7462 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
7464 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
7465 Double_t dReQ1n1k = (*fReQ)(0,1);
7466 Double_t dReQ2n2k = (*fReQ)(1,2);
7467 Double_t dReQ1n3k = (*fReQ)(0,3);
7468 //Double_t dReQ4n4k = (*fReQ)(3,4);
7469 Double_t dImQ1n1k = (*fImQ)(0,1);
7470 Double_t dImQ2n2k = (*fImQ)(1,2);
7471 Double_t dImQ1n3k = (*fImQ)(0,3);
7472 //Double_t dImQ4n4k = (*fImQ)(3,4);
7474 // S^M_{p,k} (see .h file for the definition of fSMpk):
7475 Double_t dSM1p1k = (*fSMpk)(0,1);
7476 Double_t dSM1p2k = (*fSMpk)(0,2);
7477 Double_t dSM1p3k = (*fSMpk)(0,3);
7478 Double_t dSM2p1k = (*fSMpk)(1,1);
7479 Double_t dSM3p1k = (*fSMpk)(2,1);
7481 // looping over all bins and calculating reduced correlations:
7482 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7484 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin):
7485 Double_t p1n0kRe = 0.;
7486 Double_t p1n0kIm = 0.;
7488 // number of POIs in particular (pt,eta) bin):
7491 // real and imaginary parts of q_{m*n,k}:
7492 // (weighted Q-vector evaluated for particles which are both RPs and POIs in particular (pt,eta) bin)
7493 Double_t q1n2kRe = 0.;
7494 Double_t q1n2kIm = 0.;
7495 Double_t q2n1kRe = 0.;
7496 Double_t q2n1kIm = 0.;
7498 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
7499 Double_t s1p1k = 0.;
7500 Double_t s1p2k = 0.;
7501 Double_t s1p3k = 0.;
7503 // M0111 from Eq. (118) in QC2c (to be improved (notation))
7504 Double_t dM0111 = 0.;
7508 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
7509 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
7510 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
7511 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
7513 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
7515 t = 1; // typeFlag = RP or POI
7517 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
7518 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))
7519 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));
7520 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))
7521 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b));
7522 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))
7523 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));
7524 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))
7525 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b));
7527 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
7528 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.);
7529 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.);
7530 s1p3k = pow(fs1dEBE[2][pe][3]->GetBinContent(b)*fs1dEBE[2][pe][3]->GetBinEntries(b),1.);
7532 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
7533 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
7534 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
7535 + 2.*(s1p3k-s1p2k*dSM1p1k));
7537 else if(type == "RP")
7539 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
7540 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))
7541 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));
7542 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))
7543 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));
7544 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))
7545 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));
7546 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))
7547 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));
7549 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
7550 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.);
7551 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.);
7552 s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.);
7554 // to be improved (cross-checked):
7555 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
7556 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
7557 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
7558 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
7560 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
7562 t = 0; // typeFlag = RP or POI
7564 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
7565 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
7566 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
7567 + 2.*(s1p3k-s1p2k*dSM1p1k));
7568 //...............................................................................................
7571 // 2'-particle correlation:
7572 Double_t two1n1nW0W1 = 0.;
7573 if(mp*dSM1p1k-s1p1k)
7575 two1n1nW0W1 = (p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k-s1p1k)
7576 / (mp*dSM1p1k-s1p1k);
7578 // fill profile to get <<2'>>
7579 fDiffFlowCorrelationsPro[t][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nW0W1,mp*dSM1p1k-s1p1k);
7580 // histogram to store <2'> e-b-e (needed in some other methods):
7581 fDiffFlowCorrelationsEBE[t][pe][0]->SetBinContent(b,two1n1nW0W1);
7582 fDiffFlowEventWeightsForCorrelationsEBE[t][pe][0]->SetBinContent(b,mp*dSM1p1k-s1p1k);
7583 } // end of if(mp*dSM1p1k-s1p1k)
7585 // 4'-particle correlation:
7586 Double_t four1n1n1n1nW0W1W1W1 = 0.;
7589 four1n1n1n1nW0W1W1W1 = ((pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
7590 - q2n1kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))
7591 - 2.*q2n1kIm*dReQ1n1k*dImQ1n1k
7592 - p1n0kRe*(dReQ1n1k*dReQ2n2k+dImQ1n1k*dImQ2n2k)
7593 + p1n0kIm*(dImQ1n1k*dReQ2n2k-dReQ1n1k*dImQ2n2k)
7594 - 2.*dSM1p2k*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
7595 - 2.*(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*s1p1k
7596 + 6.*(q1n2kRe*dReQ1n1k+q1n2kIm*dImQ1n1k)
7597 + 1.*(q2n1kRe*dReQ2n2k+q2n1kIm*dImQ2n2k)
7598 + 2.*(p1n0kRe*dReQ1n3k+p1n0kIm*dImQ1n3k)
7601 / dM0111; // to be improved (notation of dM0111)
7603 // fill profile to get <<4'>>
7604 fDiffFlowCorrelationsPro[t][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nW0W1W1W1,dM0111);
7605 // histogram to store <4'> e-b-e (needed in some other methods):
7606 fDiffFlowCorrelationsEBE[t][pe][1]->SetBinContent(b,four1n1n1n1nW0W1W1W1);
7607 fDiffFlowEventWeightsForCorrelationsEBE[t][pe][1]->SetBinContent(b,dM0111);
7608 } // end of if(dM0111)
7609 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7611 } // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelationsUsingParticleWeights(TString type, TString ptOrEta); // type = RP or POI
7614 //================================================================================================================================
7617 void AliFlowAnalysisWithQCumulants::FillCommonControlHistograms(AliFlowEventSimple *anEvent)
7619 // Fill common control histograms.
7621 Int_t nRP = anEvent->GetEventNSelTracksRP(); // number of RPs (i.e. number of particles used to determine the reaction plane)
7622 fCommonHists->FillControlHistograms(anEvent);
7625 fCommonHists2nd->FillControlHistograms(anEvent);
7628 fCommonHists4th->FillControlHistograms(anEvent);
7631 fCommonHists6th->FillControlHistograms(anEvent);
7634 fCommonHists8th->FillControlHistograms(anEvent);
7635 } // end of if(nRP>7)
7636 } // end of if(nRP>5)
7637 } // end of if(nRP>3)
7638 } // end of if(nRP>1)
7640 } // end of void AliFlowAnalysisWithQCumulants::FillCommonControlHistograms(AliFlowEventSimple *anEvent)
7643 //================================================================================================================================
7646 void AliFlowAnalysisWithQCumulants::ResetEventByEventQuantities()
7648 // Reset all event by event quantities.
7654 fIntFlowCorrelationsEBE->Reset();
7655 fIntFlowEventWeightsForCorrelationsEBE->Reset();
7656 fIntFlowCorrelationsAllEBE->Reset();
7658 if(fApplyCorrectionForNUA)
7660 for(Int_t sc=0;sc<2;sc++)
7662 fIntFlowCorrectionTermsForNUAEBE[sc]->Reset();
7666 // differential flow:
7668 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
7670 for(Int_t pe=0;pe<2;pe++) // 1D in pt or eta
7672 for(Int_t m=0;m<4;m++) // multiple of harmonic
7674 for(Int_t k=0;k<9;k++) // power of weight
7676 if(fReRPQ1dEBE[t][pe][m][k]) fReRPQ1dEBE[t][pe][m][k]->Reset();
7677 if(fImRPQ1dEBE[t][pe][m][k]) fImRPQ1dEBE[t][pe][m][k]->Reset();
7683 for(Int_t t=0;t<3;t++) // type (0 = RP, 1 = POI, 2 = RP&&POI )
7685 for(Int_t pe=0;pe<2;pe++) // 1D in pt or eta
7687 for(Int_t k=0;k<9;k++)
7689 if(fs1dEBE[t][pe][k]) fs1dEBE[t][pe][k]->Reset();
7694 // e-b-e reduced correlations:
7695 for(Int_t t=0;t<2;t++) // type (0 = RP, 1 = POI)
7697 for(Int_t pe=0;pe<2;pe++) // pt or eta
7699 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
7701 if(fDiffFlowCorrelationsEBE[t][pe][rci]) fDiffFlowCorrelationsEBE[t][pe][rci]->Reset();
7702 if(fDiffFlowEventWeightsForCorrelationsEBE[t][pe][rci]) fDiffFlowEventWeightsForCorrelationsEBE[t][pe][rci]->Reset();
7707 // correction terms for NUA:
7708 for(Int_t t=0;t<2;t++) // type (0 = RP, 1 = POI)
7710 for(Int_t pe=0;pe<2;pe++) // pt or eta
7712 for(Int_t sc=0;sc<2;sc++) // sin or cos
7714 for(Int_t cti=0;cti<9;cti++) // correction term index
7716 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti]->Reset();
7723 if(fCalculate2DFlow)
7725 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
7727 for(Int_t m=0;m<4;m++) // multiple of harmonic
7729 for(Int_t k=0;k<9;k++) // power of weight
7731 if(fReRPQ2dEBE[t][m][k]) fReRPQ2dEBE[t][m][k]->Reset();
7732 if(fImRPQ2dEBE[t][m][k]) fImRPQ2dEBE[t][m][k]->Reset();
7736 for(Int_t t=0;t<3;t++) // type (0 = RP, 1 = POI, 2 = RP&&POI )
7738 for(Int_t k=0;k<9;k++)
7740 if(fs2dEBE[t][k]) fs2dEBE[t][k]->Reset();
7743 } // end of if(fCalculate2DFlow)
7745 } // end of void AliFlowAnalysisWithQCumulants::ResetEventByEventQuantities();
7748 //================================================================================================================================
7751 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTerms(TString type, TString ptOrEta)
7753 // Calculate correction terms for non-uniform acceptance for differential flow (sin terms).
7755 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][0][cti], where cti runs as follows:
7756 // 0: <<sin n(psi1)>>
7757 // 1: <<sin n(psi1+phi2)>>
7758 // 2: <<sin n(psi1+phi2-phi3)>>
7759 // 3: <<sin n(psi1-phi2-phi3)>>:
7765 Double_t dMult = (*fSMpk)(0,0);
7767 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
7768 Double_t dReQ1n = (*fReQ)(0,0);
7769 Double_t dReQ2n = (*fReQ)(1,0);
7770 //Double_t dReQ3n = (*fReQ)(2,0);
7771 //Double_t dReQ4n = (*fReQ)(3,0);
7772 Double_t dImQ1n = (*fImQ)(0,0);
7773 Double_t dImQ2n = (*fImQ)(1,0);
7774 //Double_t dImQ3n = (*fImQ)(2,0);
7775 //Double_t dImQ4n = (*fImQ)(3,0);
7777 Int_t t = -1; // type flag
7778 Int_t pe = -1; // ptEta flag
7783 } else if(type == "POI")
7791 } else if(ptOrEta == "Eta")
7796 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
7797 Double_t minPtEta[2] = {fPtMin,fEtaMin};
7798 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
7799 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
7801 // looping over all bins and calculating correction terms:
7802 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7804 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
7805 Double_t p1n0kRe = 0.;
7806 Double_t p1n0kIm = 0.;
7808 // number of POIs in particular pt or eta bin:
7811 // 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):
7812 Double_t q1n0kRe = 0.;
7813 Double_t q1n0kIm = 0.;
7814 Double_t q2n0kRe = 0.;
7815 Double_t q2n0kIm = 0.;
7817 // number of particles which are both RPs and POIs in particular pt or eta bin:
7823 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))
7824 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));
7825 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))
7826 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));
7827 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))
7828 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));
7829 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))
7830 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b));
7832 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
7834 else if(type == "RP")
7837 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
7838 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
7839 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
7840 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
7841 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))
7842 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));
7843 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))
7844 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b));
7846 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
7851 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
7852 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
7853 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
7854 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
7856 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
7858 t = 1; // typeFlag = RP or POI
7860 else if(type == "RP")
7862 // p_{m*n,0} = q_{m*n,0}:
7868 t = 0; // typeFlag = RP or POI
7872 Double_t sinP1nPsi = 0.;
7875 sinP1nPsi = p1n0kIm/mp;
7876 // fill profile for <<sin n(psi1)>>:
7877 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi,mp);
7878 // histogram to store <sin n(psi1)> e-b-e (needed in some other methods):
7879 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][0]->SetBinContent(b,sinP1nPsi);
7882 // <<sin n(psi1+phi2)>>:
7883 Double_t sinP1nPsiP1nPhi = 0.;
7886 sinP1nPsiP1nPhi = (p1n0kRe*dImQ1n+p1n0kIm*dReQ1n-q2n0kIm)/(mp*dMult-mq);
7887 // fill profile for <<sin n(psi1+phi2)>>:
7888 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsiP1nPhi,mp*dMult-mq);
7889 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
7890 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][1]->SetBinContent(b,sinP1nPsiP1nPhi);
7891 } // end of if(mp*dMult-mq)
7893 // <<sin n(psi1+phi2-phi3)>>:
7894 Double_t sinP1nPsi1P1nPhi2MPhi3 = 0.;
7895 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
7897 sinP1nPsi1P1nPhi2MPhi3 = (p1n0kIm*(pow(dImQ1n,2.)+pow(dReQ1n,2.)-dMult)
7898 - 1.*(q2n0kIm*dReQ1n-q2n0kRe*dImQ1n)
7899 - mq*dImQ1n+2.*q1n0kIm)
7900 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
7901 // fill profile for <<sin n(psi1+phi2)>>:
7902 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1P1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
7903 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
7904 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][2]->SetBinContent(b,sinP1nPsi1P1nPhi2MPhi3);
7905 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
7907 // <<sin n(psi1-phi2-phi3)>>:
7908 Double_t sinP1nPsi1M1nPhi2MPhi3 = 0.;
7909 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
7911 sinP1nPsi1M1nPhi2MPhi3 = (p1n0kIm*(pow(dReQ1n,2.)-pow(dImQ1n,2.))-2.*p1n0kRe*dReQ1n*dImQ1n
7912 - 1.*(p1n0kIm*dReQ2n-p1n0kRe*dImQ2n)
7913 + 2.*mq*dImQ1n-2.*q1n0kIm)
7914 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
7915 // fill profile for <<sin n(psi1+phi2)>>:
7916 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1M1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
7917 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
7918 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][3]->SetBinContent(b,sinP1nPsi1M1nPhi2MPhi3);
7919 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
7920 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7922 } // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTerms(TString type, TString ptOrEta)
7925 //================================================================================================================================
7928 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTerms(TString type, TString ptOrEta)
7930 // Calculate correction terms for non-uniform acceptance for differential flow (cos terms).
7932 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][1][cti], where cti runs as follows:
7933 // 0: <<cos n(psi)>>
7934 // 1: <<cos n(psi1+phi2)>>
7935 // 2: <<cos n(psi1+phi2-phi3)>>
7936 // 3: <<cos n(psi1-phi2-phi3)>>
7942 Double_t dMult = (*fSMpk)(0,0);
7944 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
7945 Double_t dReQ1n = (*fReQ)(0,0);
7946 Double_t dReQ2n = (*fReQ)(1,0);
7947 //Double_t dReQ3n = (*fReQ)(2,0);
7948 //Double_t dReQ4n = (*fReQ)(3,0);
7949 Double_t dImQ1n = (*fImQ)(0,0);
7950 Double_t dImQ2n = (*fImQ)(1,0);
7951 //Double_t dImQ3n = (*fImQ)(2,0);
7952 //Double_t dImQ4n = (*fImQ)(3,0);
7954 Int_t t = -1; // type flag
7955 Int_t pe = -1; // ptEta flag
7960 } else if(type == "POI")
7968 } else if(ptOrEta == "Eta")
7973 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
7974 Double_t minPtEta[2] = {fPtMin,fEtaMin};
7975 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
7976 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
7978 // looping over all bins and calculating correction terms:
7979 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7981 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
7982 Double_t p1n0kRe = 0.;
7983 Double_t p1n0kIm = 0.;
7985 // number of POIs in particular pt or eta bin:
7988 // 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):
7989 Double_t q1n0kRe = 0.;
7990 Double_t q1n0kIm = 0.;
7991 Double_t q2n0kRe = 0.;
7992 Double_t q2n0kIm = 0.;
7994 // number of particles which are both RPs and POIs in particular pt or eta bin:
8000 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))
8001 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));
8002 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))
8003 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));
8004 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))
8005 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));
8006 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))
8007 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b));
8009 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
8011 else if(type == "RP")
8014 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
8015 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
8016 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
8017 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
8018 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))
8019 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));
8020 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))
8021 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b));
8023 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
8028 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
8029 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
8030 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
8031 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
8033 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
8035 t = 1; // typeFlag = RP or POI
8037 else if(type == "RP")
8039 // p_{m*n,0} = q_{m*n,0}:
8045 t = 0; // typeFlag = RP or POI
8049 Double_t cosP1nPsi = 0.;
8052 cosP1nPsi = p1n0kRe/mp;
8054 // fill profile for <<cos n(psi1)>>:
8055 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi,mp);
8056 // histogram to store <cos n(psi1)> e-b-e (needed in some other methods):
8057 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][0]->SetBinContent(b,cosP1nPsi);
8060 // <<cos n(psi1+phi2)>>:
8061 Double_t cosP1nPsiP1nPhi = 0.;
8064 cosP1nPsiP1nPhi = (p1n0kRe*dReQ1n-p1n0kIm*dImQ1n-q2n0kRe)/(mp*dMult-mq);
8065 // fill profile for <<sin n(psi1+phi2)>>:
8066 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsiP1nPhi,mp*dMult-mq);
8067 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
8068 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][1]->SetBinContent(b,cosP1nPsiP1nPhi);
8069 } // end of if(mp*dMult-mq)
8071 // <<cos n(psi1+phi2-phi3)>>:
8072 Double_t cosP1nPsi1P1nPhi2MPhi3 = 0.;
8073 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
8075 cosP1nPsi1P1nPhi2MPhi3 = (p1n0kRe*(pow(dImQ1n,2.)+pow(dReQ1n,2.)-dMult)
8076 - 1.*(q2n0kRe*dReQ1n+q2n0kIm*dImQ1n)
8077 - mq*dReQ1n+2.*q1n0kRe)
8078 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
8079 // fill profile for <<sin n(psi1+phi2)>>:
8080 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1P1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
8081 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
8082 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][2]->SetBinContent(b,cosP1nPsi1P1nPhi2MPhi3);
8083 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
8085 // <<cos n(psi1-phi2-phi3)>>:
8086 Double_t cosP1nPsi1M1nPhi2MPhi3 = 0.;
8087 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
8089 cosP1nPsi1M1nPhi2MPhi3 = (p1n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))+2.*p1n0kIm*dReQ1n*dImQ1n
8090 - 1.*(p1n0kRe*dReQ2n+p1n0kIm*dImQ2n)
8091 - 2.*mq*dReQ1n+2.*q1n0kRe)
8092 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
8093 // fill profile for <<sin n(psi1+phi2)>>:
8094 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1M1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
8095 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
8096 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][3]->SetBinContent(b,cosP1nPsi1M1nPhi2MPhi3);
8097 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
8098 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
8100 } // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTerms(TString type, TString ptOrEta)
8103 //==================================================================================================================================
8106 void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUADiffFlow(TString type, TString ptOrEta)
8108 // Transfer prolfiles into histogams and correctly propagate the error (to be improved: description)
8110 // to be improved: debugged - I do not correctly transfer all profiles into histos (bug appears only after merging)
8112 Int_t t = -1; // type flag
8113 Int_t pe = -1; // ptEta flag
8118 } else if(type == "POI")
8126 } else if(ptOrEta == "Eta")
8131 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
8132 //Double_t minPtEta[2] = {fPtMin,fEtaMin};
8133 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
8134 //Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
8136 for(Int_t sc=0;sc<2;sc++) // sin or cos
8138 for(Int_t cti=0;cti<9;cti++) // correction term index
8140 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
8142 Double_t correctionTerm = fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]->GetBinContent(b);
8143 fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti]->SetBinContent(b,correctionTerm);
8144 // to be improved (propagate error correctly)
8146 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
8147 } // correction term index
8148 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
8150 }// end of void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUADiffFlow(TString type, TString ptOrEta)
8153 //==================================================================================================================================
8156 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulantsCorrectedForNUA(TString type, TString ptOrEta)
8158 // Calculate generalized differential flow Q-cumulants (corrected for non-uniform acceptance)
8160 Int_t typeFlag = -1;
8161 Int_t ptEtaFlag = -1;
8166 } else if(type == "POI")
8174 } else if(ptOrEta == "Eta")
8181 Int_t pe = ptEtaFlag;
8184 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
8186 // 2-particle correlation:
8187 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
8188 // sin term coming from integrated flow:
8189 Double_t sinP1nPhi = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1); // <<sin(n*phi1)>>
8190 Double_t sinP1nPhi1P1nPhi2 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2); // <<sin(n*(phi1+phi2))>>
8191 Double_t sinP1nPhi1M1nPhi2M1nPhi3 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(3); // <<sin(n*(phi1-phi2-phi3))>>
8192 // cos term coming from integrated flow:
8193 Double_t cosP1nPhi = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1); // <<cos(n*phi1)>>
8194 Double_t cosP1nPhi1P1nPhi2 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2); // <<cos(n*(phi1+phi2))>>
8195 Double_t cosP1nPhi1M1nPhi2M1nPhi3 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(3); // <<cos(n*(phi1-phi2-phi3))>>
8197 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
8199 Double_t twoPrime = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b); // <<2'>>
8200 Double_t fourPrime = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b); // <<4'>>
8201 Double_t sinP1nPsi = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][0]->GetBinContent(b); // <<sin n(Psi)>>
8202 Double_t cosP1nPsi = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][0]->GetBinContent(b); // <<cos n(Psi)>>
8203 Double_t sinP1nPsi1P1nPhi2 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][1]->GetBinContent(b); // <<sin n(psi1+phi2)>>
8204 Double_t cosP1nPsi1P1nPhi2 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][1]->GetBinContent(b); // <<cos n(psi1+phi2)>>
8205 Double_t sinP1nPsi1P1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][2]->GetBinContent(b); // <<sin n(psi1+phi2-phi3)>>
8206 Double_t cosP1nPsi1P1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][2]->GetBinContent(b); // <<cos n(psi1+phi2-phi3)>>
8207 Double_t sinP1nPsi1M1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][3]->GetBinContent(b); // <<sin n(psi1-phi2-phi3)>>
8208 Double_t cosP1nPsi1M1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][3]->GetBinContent(b); // <<cos n(psi1-phi2-phi3)>>
8209 // generalized QC{2'}:
8210 Double_t qc2Prime = twoPrime - sinP1nPsi*sinP1nPhi - cosP1nPsi*cosP1nPhi;
8211 fDiffFlowCumulants[t][pe][0]->SetBinContent(b,qc2Prime);
8212 // generalized QC{4'}:
8213 Double_t qc4Prime = fourPrime-2.*twoPrime*two
8214 - cosP1nPsi*cosP1nPhi1M1nPhi2M1nPhi3
8215 + sinP1nPsi*sinP1nPhi1M1nPhi2M1nPhi3
8216 - cosP1nPhi*cosP1nPsi1M1nPhi2M1nPhi3
8217 + sinP1nPhi*sinP1nPsi1M1nPhi2M1nPhi3
8218 - 2.*cosP1nPhi*cosP1nPsi1P1nPhi2M1nPhi3
8219 - 2.*sinP1nPhi*sinP1nPsi1P1nPhi2M1nPhi3
8220 - cosP1nPsi1P1nPhi2*cosP1nPhi1P1nPhi2
8221 - sinP1nPsi1P1nPhi2*sinP1nPhi1P1nPhi2
8222 + 2.*cosP1nPhi1P1nPhi2*(cosP1nPsi*cosP1nPhi-sinP1nPsi*sinP1nPhi)
8223 + 2.*sinP1nPhi1P1nPhi2*(cosP1nPsi*sinP1nPhi+sinP1nPsi*cosP1nPhi)
8224 + 4.*two*(cosP1nPsi*cosP1nPhi+sinP1nPsi*sinP1nPhi)
8225 + 2.*cosP1nPsi1P1nPhi2*(pow(cosP1nPhi,2.)-pow(sinP1nPhi,2.))
8226 + 4.*sinP1nPsi1P1nPhi2*cosP1nPhi*sinP1nPhi
8227 + 4.*twoPrime*(pow(cosP1nPhi,2.)+pow(sinP1nPhi,2.))
8228 - 6.*(pow(cosP1nPhi,2.)-pow(sinP1nPhi,2.))
8229 * (cosP1nPsi*cosP1nPhi-sinP1nPsi*sinP1nPhi)
8230 - 12.*cosP1nPhi*sinP1nPhi
8231 * (sinP1nPsi*cosP1nPhi+cosP1nPsi*sinP1nPhi);
8232 fDiffFlowCumulants[t][pe][1]->SetBinContent(b,qc4Prime);
8233 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
8235 } // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulantsCorrectedForNUA(TString type, TString ptOrEta)
8238 //==================================================================================================================================
8241 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectedForNUA(TString type, TString ptOrEta)
8243 // Calculate differential flow corrected for non-uniform acceptance.
8245 // to be improved (rewritten completely)
8247 Int_t typeFlag = -1;
8248 Int_t ptEtaFlag = -1;
8253 } else if(type == "POI")
8261 } else if(ptOrEta == "Eta")
8268 Int_t pe = ptEtaFlag;
8271 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
8273 // to be improved: access here generalized QC{2} and QC{4} instead:
8274 Double_t dV2 = fIntFlow->GetBinContent(1);
8275 Double_t dV4 = fIntFlow->GetBinContent(2);
8277 // loop over pt or eta bins:
8278 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
8280 // generalized QC{2'}:
8281 Double_t gQC2Prime = fDiffFlowCumulants[t][pe][0]->GetBinContent(b);
8285 Double_t v2Prime = gQC2Prime/dV2;
8286 fDiffFlow[t][pe][0]->SetBinContent(b,v2Prime);
8288 // generalized QC{4'}:
8289 Double_t gQC4Prime = fDiffFlowCumulants[t][pe][1]->GetBinContent(b);
8293 Double_t v4Prime = -gQC4Prime/pow(dV4,3.);
8294 fDiffFlow[t][pe][1]->SetBinContent(b,v4Prime);
8296 } // end of for(Int_t b=1;b<=fnBinsPtEta[pe];b++)
8298 } // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectedForNUA(TString type, TString ptOrEta);
8301 //==================================================================================================================================
8304 void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoops(AliFlowEventSimple* anEvent)
8306 // Evaluate with nested loops multiparticle correlations for integrated flow (without using the particle weights).
8308 // Remark: Results are stored in profile fIntFlowDirectCorrelations whose binning is organized as follows:
8310 // 1st bin: <2>_{1n|1n} = two1n1n = cos(n*(phi1-phi2))>
8311 // 2nd bin: <2>_{2n|2n} = two2n2n = cos(2n*(phi1-phi2))>
8312 // 3rd bin: <2>_{3n|3n} = two3n3n = cos(3n*(phi1-phi2))>
8313 // 4th bin: <2>_{4n|4n} = two4n4n = cos(4n*(phi1-phi2))>
8314 // 5th bin: ---- EMPTY ----
8315 // 6th bin: <3>_{2n|1n,1n} = three2n1n1n = <cos(n*(2.*phi1-phi2-phi3))>
8316 // 7th bin: <3>_{3n|2n,1n} = three3n2n1n = <cos(n*(3.*phi1-2.*phi2-phi3))>
8317 // 8th bin: <3>_{4n|2n,2n} = three4n2n2n = <cos(n*(4.*phi1-2.*phi2-2.*phi3))>
8318 // 9th bin: <3>_{4n|3n,1n} = three4n3n1n = <cos(n*(4.*phi1-3.*phi2-phi3))>
8319 // 10th bin: ---- EMPTY ----
8320 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1n = <cos(n*(phi1+phi2-phi3-phi4))>
8321 // 12th bin: <4>_{2n,1n|2n,1n} = four2n1n2n1n = <cos(2.*n*(phi1+phi2-phi3-phi4))>
8322 // 13th bin: <4>_{2n,2n|2n,2n} = four2n2n2n2n = <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>
8323 // 14th bin: <4>_{3n|1n,1n,1n} = four3n1n1n1n = <cos(n*(3.*phi1-phi2-phi3-phi4))>
8324 // 15th bin: <4>_{3n,1n|3n,1n} = four3n1n3n1n = <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>
8325 // 16th bin: <4>_{3n,1n|2n,2n} = four3n1n2n2n = <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>
8326 // 17th bin: <4>_{4n|2n,1n,1n} = four4n2n1n1n = <cos(n*(3.*phi1+phi2-3.*phi3-phi4))>
8327 // 18th bin: ---- EMPTY ----
8328 // 19th bin: <5>_{2n|1n,1n,1n,1n} = five2n1n1n1n1n = <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>
8329 // 20th bin: <5>_{2n,2n|2n,1n,1n} = five2n2n2n1n1n = <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>
8330 // 21st bin: <5>_{3n,1n|2n,1n,1n} = five3n1n2n1n1n = <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>
8331 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = five4n1n1n1n1n = <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>
8332 // 23rd bin: ---- EMPTY ----
8333 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = six1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
8334 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = six2n1n1n2n1n1n = <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>
8335 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = six2n2n1n1n1n1n = <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>
8336 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = six3n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>
8337 // 28th bin: ---- EMPTY ----
8338 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = seven2n1n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
8339 // 30th bin: ---- EMPTY ----
8340 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = eight1n1n1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
8342 Int_t nPrim = anEvent->NumberOfTracks();
8343 AliFlowTrackSimple *aftsTrack = NULL;
8344 Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
8345 Int_t n = fHarmonic;
8346 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
8347 Double_t dMult = (*fSMpk)(0,0);
8349 cout<<"Multiparticle correlations: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
8352 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
8353 } else if (dMult>fMaxAllowedMultiplicity)
8355 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
8358 cout<<"... evaluating nested loops (without using particle weights)..."<<endl;
8361 // 2-particle correlations:
8362 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
8364 for(Int_t i1=0;i1<nPrim;i1++)
8366 aftsTrack=anEvent->GetTrack(i1);
8367 if(!(aftsTrack->InRPSelection())) continue;
8368 phi1=aftsTrack->Phi();
8369 for(Int_t i2=0;i2<nPrim;i2++)
8372 aftsTrack=anEvent->GetTrack(i2);
8373 if(!(aftsTrack->InRPSelection())) continue;
8374 phi2=aftsTrack->Phi();
8375 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
8376 // fill the profile with 2-p correlations:
8377 fIntFlowDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),1.); // <cos(n*(phi1-phi2))>
8378 fIntFlowDirectCorrelations->Fill(1.5,cos(2.*n*(phi1-phi2)),1.); // <cos(2n*(phi1-phi2))>
8379 fIntFlowDirectCorrelations->Fill(2.5,cos(3.*n*(phi1-phi2)),1.); // <cos(3n*(phi1-phi2))>
8380 fIntFlowDirectCorrelations->Fill(3.5,cos(4.*n*(phi1-phi2)),1.); // <cos(4n*(phi1-phi2))>
8381 } // end of for(Int_t i2=0;i2<nPrim;i2++)
8382 } // end of for(Int_t i1=0;i1<nPrim;i1++)
8383 } // end of if(nPrim>=2)
8385 // 3-particle correlations:
8386 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
8388 for(Int_t i1=0;i1<nPrim;i1++)
8390 aftsTrack=anEvent->GetTrack(i1);
8391 if(!(aftsTrack->InRPSelection())) continue;
8392 phi1=aftsTrack->Phi();
8393 for(Int_t i2=0;i2<nPrim;i2++)
8396 aftsTrack=anEvent->GetTrack(i2);
8397 if(!(aftsTrack->InRPSelection())) continue;
8398 phi2=aftsTrack->Phi();
8399 for(Int_t i3=0;i3<nPrim;i3++)
8401 if(i3==i1||i3==i2)continue;
8402 aftsTrack=anEvent->GetTrack(i3);
8403 if(!(aftsTrack->InRPSelection())) continue;
8404 phi3=aftsTrack->Phi();
8405 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;
8406 // fill the profile with 3-p correlations:
8407 fIntFlowDirectCorrelations->Fill(5.,cos(2.*n*phi1-n*(phi2+phi3)),1.); //<3>_{2n|nn,n}
8408 fIntFlowDirectCorrelations->Fill(6.,cos(3.*n*phi1-2.*n*phi2-n*phi3),1.); //<3>_{3n|2n,n}
8409 fIntFlowDirectCorrelations->Fill(7.,cos(4.*n*phi1-2.*n*phi2-2.*n*phi3),1.); //<3>_{4n|2n,2n}
8410 fIntFlowDirectCorrelations->Fill(8.,cos(4.*n*phi1-3.*n*phi2-n*phi3),1.); //<3>_{4n|3n,n}
8411 } // end of for(Int_t i3=0;i3<nPrim;i3++)
8412 } // end of for(Int_t i2=0;i2<nPrim;i2++)
8413 } // end of for(Int_t i1=0;i1<nPrim;i1++)
8414 } // end of if(nPrim>=3)
8416 // 4-particle correlations:
8417 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)
8419 for(Int_t i1=0;i1<nPrim;i1++)
8421 aftsTrack=anEvent->GetTrack(i1);
8422 if(!(aftsTrack->InRPSelection())) continue;
8423 phi1=aftsTrack->Phi();
8424 for(Int_t i2=0;i2<nPrim;i2++)
8427 aftsTrack=anEvent->GetTrack(i2);
8428 if(!(aftsTrack->InRPSelection())) continue;
8429 phi2=aftsTrack->Phi();
8430 for(Int_t i3=0;i3<nPrim;i3++)
8432 if(i3==i1||i3==i2)continue;
8433 aftsTrack=anEvent->GetTrack(i3);
8434 if(!(aftsTrack->InRPSelection())) continue;
8435 phi3=aftsTrack->Phi();
8436 for(Int_t i4=0;i4<nPrim;i4++)
8438 if(i4==i1||i4==i2||i4==i3)continue;
8439 aftsTrack=anEvent->GetTrack(i4);
8440 if(!(aftsTrack->InRPSelection())) continue;
8441 phi4=aftsTrack->Phi();
8442 if(nPrim==4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush;
8443 // fill the profile with 4-p correlations:
8444 fIntFlowDirectCorrelations->Fill(10.,cos(n*phi1+n*phi2-n*phi3-n*phi4),1.); // <4>_{n,n|n,n}
8445 fIntFlowDirectCorrelations->Fill(11.,cos(2.*n*phi1+n*phi2-2.*n*phi3-n*phi4),1.); // <4>_{2n,n|2n,n}
8446 fIntFlowDirectCorrelations->Fill(12.,cos(2.*n*phi1+2*n*phi2-2.*n*phi3-2.*n*phi4),1.); // <4>_{2n,2n|2n,2n}
8447 fIntFlowDirectCorrelations->Fill(13.,cos(3.*n*phi1-n*phi2-n*phi3-n*phi4),1.); // <4>_{3n|n,n,n}
8448 fIntFlowDirectCorrelations->Fill(14.,cos(3.*n*phi1+n*phi2-3.*n*phi3-n*phi4),1.); // <4>_{3n,n|3n,n}
8449 fIntFlowDirectCorrelations->Fill(15.,cos(3.*n*phi1+n*phi2-2.*n*phi3-2.*n*phi4),1.); // <4>_{3n,n|2n,2n}
8450 fIntFlowDirectCorrelations->Fill(16.,cos(4.*n*phi1-2.*n*phi2-n*phi3-n*phi4),1.); // <4>_{4n|2n,n,n}
8451 } // end of for(Int_t i4=0;i4<nPrim;i4++)
8452 } // end of for(Int_t i3=0;i3<nPrim;i3++)
8453 } // end of for(Int_t i2=0;i2<nPrim;i2++)
8454 } // end of for(Int_t i1=0;i1<nPrim;i1++)
8455 } // end of if(nPrim>=)
8457 // 5-particle correlations:
8458 if(nPrim>=5 && nPrim<=fMaxAllowedMultiplicity)
8460 for(Int_t i1=0;i1<nPrim;i1++)
8462 aftsTrack=anEvent->GetTrack(i1);
8463 if(!(aftsTrack->InRPSelection())) continue;
8464 phi1=aftsTrack->Phi();
8465 for(Int_t i2=0;i2<nPrim;i2++)
8468 aftsTrack=anEvent->GetTrack(i2);
8469 if(!(aftsTrack->InRPSelection())) continue;
8470 phi2=aftsTrack->Phi();
8471 for(Int_t i3=0;i3<nPrim;i3++)
8473 if(i3==i1||i3==i2)continue;
8474 aftsTrack=anEvent->GetTrack(i3);
8475 if(!(aftsTrack->InRPSelection())) continue;
8476 phi3=aftsTrack->Phi();
8477 for(Int_t i4=0;i4<nPrim;i4++)
8479 if(i4==i1||i4==i2||i4==i3)continue;
8480 aftsTrack=anEvent->GetTrack(i4);
8481 if(!(aftsTrack->InRPSelection())) continue;
8482 phi4=aftsTrack->Phi();
8483 for(Int_t i5=0;i5<nPrim;i5++)
8485 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
8486 aftsTrack=anEvent->GetTrack(i5);
8487 if(!(aftsTrack->InRPSelection())) continue;
8488 phi5=aftsTrack->Phi();
8489 if(nPrim==5) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<"\r"<<flush;
8490 // fill the profile with 5-p correlations:
8491 fIntFlowDirectCorrelations->Fill(18.,cos(2.*n*phi1+n*phi2-n*phi3-n*phi4-n*phi5),1.); //<5>_{2n,n|n,n,n}
8492 fIntFlowDirectCorrelations->Fill(19.,cos(2.*n*phi1+2.*n*phi2-2.*n*phi3-n*phi4-n*phi5),1.); //<5>_{2n,2n|2n,n,n}
8493 fIntFlowDirectCorrelations->Fill(20.,cos(3.*n*phi1+n*phi2-2.*n*phi3-n*phi4-n*phi5),1.); //<5>_{3n,n|2n,n,n}
8494 fIntFlowDirectCorrelations->Fill(21.,cos(4.*n*phi1-n*phi2-n*phi3-n*phi4-n*phi5),1.); //<5>_{4n|n,n,n,n}
8495 } // end of for(Int_t i5=0;i5<nPrim;i5++)
8496 } // end of for(Int_t i4=0;i4<nPrim;i4++)
8497 } // end of for(Int_t i3=0;i3<nPrim;i3++)
8498 } // end of for(Int_t i2=0;i2<nPrim;i2++)
8499 } // end of for(Int_t i1=0;i1<nPrim;i1++)
8500 } // end of if(nPrim>=5)
8502 // 6-particle correlations:
8503 if(nPrim>=6 && nPrim<=fMaxAllowedMultiplicity)
8505 for(Int_t i1=0;i1<nPrim;i1++)
8507 aftsTrack=anEvent->GetTrack(i1);
8508 if(!(aftsTrack->InRPSelection())) continue;
8509 phi1=aftsTrack->Phi();
8510 for(Int_t i2=0;i2<nPrim;i2++)
8513 aftsTrack=anEvent->GetTrack(i2);
8514 if(!(aftsTrack->InRPSelection())) continue;
8515 phi2=aftsTrack->Phi();
8516 for(Int_t i3=0;i3<nPrim;i3++)
8518 if(i3==i1||i3==i2)continue;
8519 aftsTrack=anEvent->GetTrack(i3);
8520 if(!(aftsTrack->InRPSelection())) continue;
8521 phi3=aftsTrack->Phi();
8522 for(Int_t i4=0;i4<nPrim;i4++)
8524 if(i4==i1||i4==i2||i4==i3)continue;
8525 aftsTrack=anEvent->GetTrack(i4);
8526 if(!(aftsTrack->InRPSelection())) continue;
8527 phi4=aftsTrack->Phi();
8528 for(Int_t i5=0;i5<nPrim;i5++)
8530 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
8531 aftsTrack=anEvent->GetTrack(i5);
8532 if(!(aftsTrack->InRPSelection())) continue;
8533 phi5=aftsTrack->Phi();
8534 for(Int_t i6=0;i6<nPrim;i6++)
8536 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
8537 aftsTrack=anEvent->GetTrack(i6);
8538 if(!(aftsTrack->InRPSelection())) continue;
8539 phi6=aftsTrack->Phi();
8540 if(nPrim==6) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<"\r"<<flush;
8541 // fill the profile with 6-p correlations:
8542 fIntFlowDirectCorrelations->Fill(23.,cos(n*phi1+n*phi2+n*phi3-n*phi4-n*phi5-n*phi6),1.); //<6>_{n,n,n|n,n,n}
8543 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}
8544 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}
8545 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}
8546 } // end of for(Int_t i6=0;i6<nPrim;i6++)
8547 } // end of for(Int_t i5=0;i5<nPrim;i5++)
8548 } // end of for(Int_t i4=0;i4<nPrim;i4++)
8549 } // end of for(Int_t i3=0;i3<nPrim;i3++)
8550 } // end of for(Int_t i2=0;i2<nPrim;i2++)
8551 } // end of for(Int_t i1=0;i1<nPrim;i1++)
8552 } // end of if(nPrim>=6)
8554 // 7-particle correlations:
8555 if(nPrim>=7 && nPrim<=fMaxAllowedMultiplicity)
8557 for(Int_t i1=0;i1<nPrim;i1++)
8559 aftsTrack=anEvent->GetTrack(i1);
8560 if(!(aftsTrack->InRPSelection())) continue;
8561 phi1=aftsTrack->Phi();
8562 for(Int_t i2=0;i2<nPrim;i2++)
8565 aftsTrack=anEvent->GetTrack(i2);
8566 if(!(aftsTrack->InRPSelection())) continue;
8567 phi2=aftsTrack->Phi();
8568 for(Int_t i3=0;i3<nPrim;i3++)
8570 if(i3==i1||i3==i2)continue;
8571 aftsTrack=anEvent->GetTrack(i3);
8572 if(!(aftsTrack->InRPSelection())) continue;
8573 phi3=aftsTrack->Phi();
8574 for(Int_t i4=0;i4<nPrim;i4++)
8576 if(i4==i1||i4==i2||i4==i3)continue;
8577 aftsTrack=anEvent->GetTrack(i4);
8578 if(!(aftsTrack->InRPSelection())) continue;
8579 phi4=aftsTrack->Phi();
8580 for(Int_t i5=0;i5<nPrim;i5++)
8582 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
8583 aftsTrack=anEvent->GetTrack(i5);
8584 if(!(aftsTrack->InRPSelection())) continue;
8585 phi5=aftsTrack->Phi();
8586 for(Int_t i6=0;i6<nPrim;i6++)
8588 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
8589 aftsTrack=anEvent->GetTrack(i6);
8590 if(!(aftsTrack->InRPSelection())) continue;
8591 phi6=aftsTrack->Phi();
8592 for(Int_t i7=0;i7<nPrim;i7++)
8594 if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;
8595 aftsTrack=anEvent->GetTrack(i7);
8596 if(!(aftsTrack->InRPSelection())) continue;
8597 phi7=aftsTrack->Phi();
8598 if(nPrim==7) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<" "<<i7<<"\r"<<flush;
8599 // fill the profile with 7-p correlation:
8600 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}
8601 } // end of for(Int_t i7=0;i7<nPrim;i7++)
8602 } // end of for(Int_t i6=0;i6<nPrim;i6++)
8603 } // end of for(Int_t i5=0;i5<nPrim;i5++)
8604 } // end of for(Int_t i4=0;i4<nPrim;i4++)
8605 } // end of for(Int_t i3=0;i3<nPrim;i3++)
8606 } // end of for(Int_t i2=0;i2<nPrim;i2++)
8607 } // end of for(Int_t i1=0;i1<nPrim;i1++)
8608 } // end of if(nPrim>=7)
8610 // 8-particle correlations:
8611 if(nPrim>=8 && nPrim<=fMaxAllowedMultiplicity)
8613 for(Int_t i1=0;i1<nPrim;i1++)
8615 aftsTrack=anEvent->GetTrack(i1);
8616 if(!(aftsTrack->InRPSelection())) continue;
8617 phi1=aftsTrack->Phi();
8618 for(Int_t i2=0;i2<nPrim;i2++)
8621 aftsTrack=anEvent->GetTrack(i2);
8622 if(!(aftsTrack->InRPSelection())) continue;
8623 phi2=aftsTrack->Phi();
8624 for(Int_t i3=0;i3<nPrim;i3++)
8626 if(i3==i1||i3==i2)continue;
8627 aftsTrack=anEvent->GetTrack(i3);
8628 if(!(aftsTrack->InRPSelection())) continue;
8629 phi3=aftsTrack->Phi();
8630 for(Int_t i4=0;i4<nPrim;i4++)
8632 if(i4==i1||i4==i2||i4==i3)continue;
8633 aftsTrack=anEvent->GetTrack(i4);
8634 if(!(aftsTrack->InRPSelection())) continue;
8635 phi4=aftsTrack->Phi();
8636 for(Int_t i5=0;i5<nPrim;i5++)
8638 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
8639 aftsTrack=anEvent->GetTrack(i5);
8640 if(!(aftsTrack->InRPSelection())) continue;
8641 phi5=aftsTrack->Phi();
8642 for(Int_t i6=0;i6<nPrim;i6++)
8644 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
8645 aftsTrack=anEvent->GetTrack(i6);
8646 if(!(aftsTrack->InRPSelection())) continue;
8647 phi6=aftsTrack->Phi();
8648 for(Int_t i7=0;i7<nPrim;i7++)
8650 if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;
8651 aftsTrack=anEvent->GetTrack(i7);
8652 if(!(aftsTrack->InRPSelection())) continue;
8653 phi7=aftsTrack->Phi();
8654 for(Int_t i8=0;i8<nPrim;i8++)
8656 if(i8==i1||i8==i2||i8==i3||i8==i4||i8==i5||i8==i6||i8==i7)continue;
8657 aftsTrack=anEvent->GetTrack(i8);
8658 if(!(aftsTrack->InRPSelection())) continue;
8659 phi8=aftsTrack->Phi();
8660 cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<" "<<i7<<" "<<i8<<"\r"<<flush;
8661 // fill the profile with 8-p correlation:
8662 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}
8663 } // end of for(Int_t i8=0;i8<nPrim;i8++)
8664 } // end of for(Int_t i7=0;i7<nPrim;i7++)
8665 } // end of for(Int_t i6=0;i6<nPrim;i6++)
8666 } // end of for(Int_t i5=0;i5<nPrim;i5++)
8667 } // end of for(Int_t i4=0;i4<nPrim;i4++)
8668 } // end of for(Int_t i3=0;i3<nPrim;i3++)
8669 } // end of for(Int_t i2=0;i2<nPrim;i2++)
8670 } // end of for(Int_t i1=0;i1<nPrim;i1++)
8671 } // end of if(nPrim>=8)
8675 } // end of AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoops(AliFlowEventSimple* anEvent)
8678 //==================================================================================================================================
8681 void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrelations()
8683 // Cross-check results for multiparticle correlations needed for int. flow: results from Q-vectors vs results from nested loops.
8687 cout<<" *****************************************"<<endl;
8688 cout<<" **** cross-checking the correlations ****"<<endl;
8689 cout<<" **** for integrated flow ****"<<endl;
8690 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
8692 cout<<" **** (particle weights not used) ****"<<endl;
8695 cout<<" **** (particle weights used) ****"<<endl;
8697 cout<<" *****************************************"<<endl;
8701 Int_t ciMax = 32; // to be improved (removed eventually when I calculate 6th and 8th order with particle weights)
8703 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
8708 for(Int_t ci=1;ci<=ciMax;ci++)
8710 if(strcmp((fIntFlowCorrelationsAllPro->GetXaxis())->GetBinLabel(ci), "") == 0) continue; // to be improved (access finalized histogram here)
8711 cout<<(fIntFlowCorrelationsAllPro->GetXaxis())->GetBinLabel(ci)<<":"<<endl; // to be improved (access finalized histogram here)
8712 cout<<"from Q-vectors = "<<fIntFlowCorrelationsAllPro->GetBinContent(ci)<<endl; // to be improved (access finalized histogram here)
8713 cout<<"from nested loops = "<<fIntFlowDirectCorrelations->GetBinContent(ci)<<endl;
8717 } // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrelations()
8720 //================================================================================================================================
8723 void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrectionTermsForNUA()
8725 // Cross-check results for corrections terms for non-uniform acceptance needed for int. flow: results from Q-vectors vs results from nested loops.
8729 cout<<" *********************************************"<<endl;
8730 cout<<" **** cross-checking the correction terms ****"<<endl;
8731 cout<<" **** for non-uniform acceptance relevant ****"<<endl;
8732 cout<<" **** for integrated flow ****"<<endl;
8733 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
8735 cout<<" **** (particle weights not used) ****"<<endl;
8738 cout<<" **** (particle weights used) ****"<<endl;
8740 cout<<" *********************************************"<<endl;
8744 for(Int_t ci=1;ci<=10;ci++) // correction term index
8746 for(Int_t sc=0;sc<2;sc++) // sin or cos term
8748 if(strcmp((fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->GetBinLabel(ci), "") == 0) continue; // to be improved (access finalized histogram here)
8749 cout<<(fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->GetBinLabel(ci)<<":"<<endl; // to be improved (access finalized histogram here)
8750 cout<<"from Q-vectors = "<<fIntFlowCorrectionTermsForNUAPro[sc]->GetBinContent(ci)<<endl; // to be improved (access finalized histogram here)
8751 cout<<"from nested loops = "<<fIntFlowDirectCorrectionTermsForNUA[sc]->GetBinContent(ci)<<endl;
8753 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos term
8754 } // end of for(Int_t ci=1;ci<=10;ci++) // correction term index
8756 } // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrectionTermsForNUA()
8759 //================================================================================================================================
8762 void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent)
8764 // Evaluate with nested loops multiparticle correlations for integrated flow (using the particle weights).
8766 // Results are stored in profile fIntFlowDirectCorrelations.
8767 // Remark 1: When particle weights are used the binning of fIntFlowDirectCorrelations is organized as follows:
8769 // 1st bin: <2>_{1n|1n} = two1n1nW1W1 = <w1 w2 cos(n*(phi1-phi2))>
8770 // 2nd bin: <2>_{2n|2n} = two2n2nW2W2 = <w1^2 w2^2 cos(2n*(phi1-phi2))>
8771 // 3rd bin: <2>_{3n|3n} = two3n3nW3W3 = <w1^3 w2^3 cos(3n*(phi1-phi2))>
8772 // 4th bin: <2>_{4n|4n} = two4n4nW4W4 = <w1^4 w2^4 cos(4n*(phi1-phi2))>
8773 // 5th bin: ---- EMPTY ----
8774 // 6th bin: <3>_{2n|1n,1n} = three2n1n1nW2W1W1 = <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
8775 // 7th bin: <3>_{3n|2n,1n} = ...
8776 // 8th bin: <3>_{4n|2n,2n} = ...
8777 // 9th bin: <3>_{4n|3n,1n} = ...
8778 // 10th bin: ---- EMPTY ----
8779 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1nW1W1W1W1 = <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
8780 // 12th bin: <4>_{2n,1n|2n,1n} = ...
8781 // 13th bin: <4>_{2n,2n|2n,2n} = ...
8782 // 14th bin: <4>_{3n|1n,1n,1n} = ...
8783 // 15th bin: <4>_{3n,1n|3n,1n} = ...
8784 // 16th bin: <4>_{3n,1n|2n,2n} = ...
8785 // 17th bin: <4>_{4n|2n,1n,1n} = ...
8786 // 18th bin: ---- EMPTY ----
8787 // 19th bin: <5>_{2n|1n,1n,1n,1n} = ...
8788 // 20th bin: <5>_{2n,2n|2n,1n,1n} = ...
8789 // 21st bin: <5>_{3n,1n|2n,1n,1n} = ...
8790 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = ...
8791 // 23rd bin: ---- EMPTY ----
8792 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = ...
8793 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = ...
8794 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = ...
8795 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = ...
8796 // 28th bin: ---- EMPTY ----
8797 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = ...
8798 // 30th bin: ---- EMPTY ----
8799 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = ...
8801 // Remark 2: When particle weights are used there are some extra correlations. They are stored in
8802 // fIntFlowExtraDirectCorrelations binning of which is organized as follows:
8804 // 1st bin: two1n1nW3W1 = <w1^3 w2 cos(n*(phi1-phi2))>
8805 // 2nd bin: two1n1nW1W1W2 = <w1 w2 w3^2 cos(n*(phi1-phi2))>
8808 Int_t nPrim = anEvent->NumberOfTracks();
8809 AliFlowTrackSimple *aftsTrack = NULL;
8810 //Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
8811 //Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1., wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
8812 Double_t phi1=0., phi2=0., phi3=0., phi4=0.;
8813 Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1.;
8814 Int_t n = fHarmonic;
8815 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
8816 Double_t dMult = (*fSMpk)(0,0);
8818 cout<<"Multiparticle correlations: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
8821 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
8822 } else if (dMult>fMaxAllowedMultiplicity)
8824 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
8827 cout<<"... evaluating nested loops (using particle weights) ..."<<endl;
8830 // 2-particle correlations:
8831 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
8833 // 2 nested loops multiparticle correlations using particle weights:
8834 for(Int_t i1=0;i1<nPrim;i1++)
8836 aftsTrack=anEvent->GetTrack(i1);
8837 if(!(aftsTrack->InRPSelection())) continue;
8838 phi1=aftsTrack->Phi();
8839 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
8840 for(Int_t i2=0;i2<nPrim;i2++)
8843 aftsTrack=anEvent->GetTrack(i2);
8844 if(!(aftsTrack->InRPSelection())) continue;
8845 phi2=aftsTrack->Phi();
8846 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
8847 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
8848 // 2-p correlations using particle weights:
8849 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),wPhi1*wPhi2); // <w1 w2 cos( n*(phi1-phi2))>
8850 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))>
8851 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))>
8852 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))>
8853 // extra correlations:
8854 // 2-p extra correlations (do not appear if particle weights are not used):
8855 if(fUsePhiWeights) fIntFlowExtraDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),pow(wPhi1,3)*wPhi2); // <w1^3 w2 cos(n*(phi1-phi2))>
8857 } // end of for(Int_t i2=0;i2<nPrim;i2++)
8858 } // end of for(Int_t i1=0;i1<nPrim;i1++)
8859 } // end of if(nPrim>=2)
8861 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
8863 // 3 nested loops multiparticle correlations using particle weights:
8864 for(Int_t i1=0;i1<nPrim;i1++)
8866 aftsTrack=anEvent->GetTrack(i1);
8867 if(!(aftsTrack->InRPSelection())) continue;
8868 phi1=aftsTrack->Phi();
8869 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
8870 for(Int_t i2=0;i2<nPrim;i2++)
8873 aftsTrack=anEvent->GetTrack(i2);
8874 if(!(aftsTrack->InRPSelection())) continue;
8875 phi2=aftsTrack->Phi();
8876 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
8877 for(Int_t i3=0;i3<nPrim;i3++)
8879 if(i3==i1||i3==i2)continue;
8880 aftsTrack=anEvent->GetTrack(i3);
8881 if(!(aftsTrack->InRPSelection())) continue;
8882 phi3=aftsTrack->Phi();
8883 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
8884 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;
8885 // 3-p correlations using particle weights:
8886 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))>
8888 // extra correlations:
8889 // 2-p extra correlations (do not appear if particle weights are not used):
8890 if(fUsePhiWeights) fIntFlowExtraDirectCorrelations->Fill(1.5,cos(n*(phi1-phi2)),wPhi1*wPhi2*pow(wPhi3,2)); // <w1 w2 w3^2 cos(n*(phi1-phi2))>
8892 // 3-p extra correlations (do not appear if particle weights are not used):
8894 } // end of for(Int_t i3=0;i3<nPrim;i3++)
8895 } // end of for(Int_t i2=0;i2<nPrim;i2++)
8896 } // end of for(Int_t i1=0;i1<nPrim;i1++)
8897 } // end of if(nPrim>=3)
8899 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)
8901 // 4 nested loops multiparticle correlations using particle weights:
8902 for(Int_t i1=0;i1<nPrim;i1++)
8904 aftsTrack=anEvent->GetTrack(i1);
8905 if(!(aftsTrack->InRPSelection())) continue;
8906 phi1=aftsTrack->Phi();
8907 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
8908 for(Int_t i2=0;i2<nPrim;i2++)
8911 aftsTrack=anEvent->GetTrack(i2);
8912 if(!(aftsTrack->InRPSelection())) continue;
8913 phi2=aftsTrack->Phi();
8914 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
8915 for(Int_t i3=0;i3<nPrim;i3++)
8917 if(i3==i1||i3==i2)continue;
8918 aftsTrack=anEvent->GetTrack(i3);
8919 if(!(aftsTrack->InRPSelection())) continue;
8920 phi3=aftsTrack->Phi();
8921 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
8922 for(Int_t i4=0;i4<nPrim;i4++)
8924 if(i4==i1||i4==i2||i4==i3)continue;
8925 aftsTrack=anEvent->GetTrack(i4);
8926 if(!(aftsTrack->InRPSelection())) continue;
8927 phi4=aftsTrack->Phi();
8928 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
8929 if(nPrim>=4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush; // to be improved (replace eventually this if statement with if(nPrim==4))
8930 // 4-p correlations using particle weights:
8931 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(10.5,cos(n*phi1+n*phi2-n*phi3-n*phi4),wPhi1*wPhi2*wPhi3*wPhi4);
8932 // extra correlations:
8933 // 2-p extra correlations (do not appear if particle weights are not used):
8935 // 3-p extra correlations (do not appear if particle weights are not used):
8937 // 4-p extra correlations (do not appear if particle weights are not used):
8939 } // end of for(Int_t i4=0;i4<nPrim;i4++)
8940 } // end of for(Int_t i3=0;i3<nPrim;i3++)
8941 } // end of for(Int_t i2=0;i2<nPrim;i2++)
8942 } // end of for(Int_t i1=0;i1<nPrim;i1++)
8943 } // end of if(nPrim>=4)
8947 } // end of void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent)
8950 //================================================================================================================================
8953 void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowExtraCorrelations()
8955 // Cross-check results for extra multiparticle correlations needed for int. flow
8956 // which appear only when particle weights are used: results from Q-vectors vs results from nested loops.
8960 cout<<" ***********************************************"<<endl;
8961 cout<<" **** cross-checking the extra correlations ****"<<endl;
8962 cout<<" **** for integrated flow ****"<<endl;
8963 cout<<" ***********************************************"<<endl;
8967 for(Int_t eci=1;eci<=2;eci++) // to be improved (increased eciMax eventually when I calculate 6th and 8th)
8969 if(strcmp((fIntFlowExtraCorrelationsPro->GetXaxis())->GetBinLabel(eci), "") == 0) continue;
8970 cout<<(fIntFlowExtraCorrelationsPro->GetXaxis())->GetBinLabel(eci)<<":"<<endl;
8971 cout<<"from Q-vectors = "<<fIntFlowExtraCorrelationsPro->GetBinContent(eci)<<endl;
8972 cout<<"from nested loops = "<<fIntFlowExtraDirectCorrelations->GetBinContent(eci)<<endl;
8976 } // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowExtraCorrelations()
8979 //================================================================================================================================
8982 void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoops(AliFlowEventSimple* anEvent)
8984 // Evaluate with nested loops correction terms for non-uniform acceptance relevant for NONAME integrated flow (to be improved (name)).
8986 // Remark: Both sin and cos correction terms are calculated in this method. Sin terms are stored in fIntFlowDirectCorrectionTermsForNUA[0],
8987 // and cos terms in fIntFlowDirectCorrectionTermsForNUA[1]. Binning of fIntFlowDirectCorrectionTermsForNUA[sc] is organized as follows
8988 // (sc stands for either sin or cos):
8990 // 1st bin: <<sc(n*(phi1))>>
8991 // 2nd bin: <<sc(n*(phi1+phi2))>>
8992 // 3rd bin: <<sc(n*(phi1-phi2-phi3))>>
8993 // 4th bin: <<sc(n*(2phi1-phi2))>>
8995 Int_t nPrim = anEvent->NumberOfTracks();
8996 AliFlowTrackSimple *aftsTrack = NULL;
8997 Double_t phi1=0., phi2=0., phi3=0.;
8998 Int_t n = fHarmonic;
8999 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
9000 Double_t dMult = (*fSMpk)(0,0);
9002 cout<<"Correction terms for non-uniform acceptance: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
9005 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
9006 } else if (dMult>fMaxAllowedMultiplicity)
9008 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
9011 cout<<"... evaluating nested loops (without using particle weights)..."<<endl;
9014 if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)
9016 // 1-particle correction terms for non-uniform acceptance:
9017 for(Int_t i1=0;i1<nPrim;i1++)
9019 aftsTrack=anEvent->GetTrack(i1);
9020 if(!(aftsTrack->InRPSelection())) continue;
9021 phi1=aftsTrack->Phi();
9022 if(nPrim==1) cout<<i1<<"\r"<<flush;
9024 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(0.5,sin(n*phi1),1.); // <sin(n*phi1)>
9026 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(0.5,cos(n*phi1),1.); // <cos(n*phi1)>
9027 } // end of for(Int_t i1=0;i1<nPrim;i1++)
9028 } // end of if(nPrim>=1)
9030 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
9032 // 2-particle correction terms for non-uniform acceptance:
9033 for(Int_t i1=0;i1<nPrim;i1++)
9035 aftsTrack=anEvent->GetTrack(i1);
9036 if(!(aftsTrack->InRPSelection())) continue;
9037 phi1=aftsTrack->Phi();
9038 for(Int_t i2=0;i2<nPrim;i2++)
9041 aftsTrack=anEvent->GetTrack(i2);
9042 if(!(aftsTrack->InRPSelection())) continue;
9043 phi2=aftsTrack->Phi();
9044 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
9046 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(1.5,sin(n*(phi1+phi2)),1.); // <<sin(n*(phi1+phi2))>>
9047 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(3.5,sin(n*(2*phi1-phi2)),1.); // <<sin(n*(2*phi1-phi2))>>
9049 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(1.5,cos(n*(phi1+phi2)),1.); // <<cos(n*(phi1+phi2))>>
9050 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(3.5,cos(n*(2*phi1-phi2)),1.); // <<cos(n*(2*phi1-phi2))>>
9051 } // end of for(Int_t i2=0;i2<nPrim;i2++)
9052 } // end of for(Int_t i1=0;i1<nPrim;i1++)
9053 } // end of if(nPrim>=2)
9055 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
9057 // 3-particle correction terms for non-uniform acceptance:
9058 for(Int_t i1=0;i1<nPrim;i1++)
9060 aftsTrack=anEvent->GetTrack(i1);
9061 if(!(aftsTrack->InRPSelection())) continue;
9062 phi1=aftsTrack->Phi();
9063 for(Int_t i2=0;i2<nPrim;i2++)
9066 aftsTrack=anEvent->GetTrack(i2);
9067 if(!(aftsTrack->InRPSelection())) continue;
9068 phi2=aftsTrack->Phi();
9069 for(Int_t i3=0;i3<nPrim;i3++)
9071 if(i3==i1||i3==i2)continue;
9072 aftsTrack=anEvent->GetTrack(i3);
9073 if(!(aftsTrack->InRPSelection())) continue;
9074 phi3=aftsTrack->Phi();
9075 if(nPrim>=3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush; // to be improved (eventually I will change this if statement)
9077 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(2.5,sin(n*(phi1-phi2-phi3)),1.); // <<sin(n*(phi1-phi2-phi3))>>
9079 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(2.5,cos(n*(phi1-phi2-phi3)),1.); // <<cos(n*(phi1-phi2-phi3))>>
9080 } // end of for(Int_t i3=0;i3<nPrim;i3++)
9081 } // end of for(Int_t i2=0;i2<nPrim;i2++)
9082 } // end of for(Int_t i1=0;i1<nPrim;i1++)
9083 } // end of if(nPrim>=3)
9087 //================================================================================================================================
9088 void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoops(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
9090 // Evaluate reduced correlations with nested loops without using the particle weights.
9092 // Remark 1: Reduced correlations are evaluated in pt bin number fCrossCheckInPtBinNo and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
9093 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrelations[t][pe][ci], where indices runs as follows:
9094 // [0=RP,1=POI][0=Pt,1=Eta][0=<2'>,1=<4'>,2=<6'>,3=<8'>]
9095 // Remark 3: <2'> = <cos(n*(psi1-phi2))>
9096 // <4'> = <cos(n*(psi1+phi2-phi3-phi4))>
9099 Int_t typeFlag = -1;
9100 Int_t ptEtaFlag = -1;
9104 } else if(type == "POI")
9111 } else if(ptOrEta == "Eta")
9117 Int_t pe = ptEtaFlag;
9119 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
9120 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
9121 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
9123 Int_t nPrim = anEvent->NumberOfTracks();
9124 AliFlowTrackSimple *aftsTrack = NULL;
9126 Double_t psi1=0., phi2=0., phi3=0., phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
9128 Int_t n = fHarmonic;
9130 // 2'-particle correlations:
9131 for(Int_t i1=0;i1<nPrim;i1++)
9133 aftsTrack=anEvent->GetTrack(i1);
9134 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
9135 if(typeFlag==1) // this is diff flow of POIs
9139 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
9140 } else if (ptOrEta == "Eta")
9142 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
9144 } else // this is diff flow of RPs
9148 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
9149 } else if (ptOrEta == "Eta")
9151 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
9155 psi1=aftsTrack->Phi();
9156 for(Int_t i2=0;i2<nPrim;i2++)
9159 aftsTrack=anEvent->GetTrack(i2);
9160 // RP condition (!(first) particle in the correlator must be RP):
9161 if(!(aftsTrack->InRPSelection()))continue;
9162 phi2=aftsTrack->Phi();
9163 // 2'-particle correlations:
9164 fDiffFlowDirectCorrelations[t][pe][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(1.*n*(psi1-phi2)),1.); // <cos(n*(psi1-phi2))
9165 }//end of for(Int_t i2=0;i2<nPrim;i2++)
9166 }//end of for(Int_t i1=0;i1<nPrim;i1++)
9170 // 3'-particle correlations:
9171 for(Int_t i1=0;i1<nPrim;i1++)
9173 aftsTrack=anEvent->GetTrack(i1);
9174 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
9177 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
9178 } else if (ptOrEta == "Eta")
9180 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
9182 psi1=aftsTrack->Phi();
9183 for(Int_t i2=0;i2<nPrim;i2++)
9186 aftsTrack=anEvent->GetTrack(i2);
9187 // RP condition (!(first) particle in the correlator must be RP):
9188 if(!(aftsTrack->InRPSelection())) continue;
9189 phi2=aftsTrack->Phi();
9190 for(Int_t i3=0;i3<nPrim;i3++)
9192 if(i3==i1||i3==i2)continue;
9193 aftsTrack=anEvent->GetTrack(i3);
9194 // RP condition (!(first) particle in the correlator must be RP):
9195 if(!(aftsTrack->InRPSelection())) continue;
9196 phi3=aftsTrack->Phi();
9197 // 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))>
9198 }//end of for(Int_t i3=0;i3<nPrim;i3++)
9199 }//end of for(Int_t i2=0;i2<nPrim;i2++)
9200 }//end of for(Int_t i1=0;i1<nPrim;i1++)
9204 // 4'-particle correlations:
9205 for(Int_t i1=0;i1<nPrim;i1++)
9207 aftsTrack=anEvent->GetTrack(i1);
9208 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
9209 if(typeFlag==1) // this is diff flow of POIs
9213 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
9214 } else if (ptOrEta == "Eta")
9216 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
9218 } else // this is diff flow of RPs
9222 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
9223 } else if (ptOrEta == "Eta")
9225 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
9229 psi1=aftsTrack->Phi();
9230 for(Int_t i2=0;i2<nPrim;i2++)
9232 if(i2==i1) continue;
9233 aftsTrack=anEvent->GetTrack(i2);
9234 // RP condition (!(first) particle in the correlator must be RP):
9235 if(!(aftsTrack->InRPSelection())) continue;
9236 phi2=aftsTrack->Phi();
9237 for(Int_t i3=0;i3<nPrim;i3++)
9239 if(i3==i1||i3==i2) continue;
9240 aftsTrack=anEvent->GetTrack(i3);
9241 // RP condition (!(first) particle in the correlator must be RP):
9242 if(!(aftsTrack->InRPSelection())) continue;
9243 phi3=aftsTrack->Phi();
9244 for(Int_t i4=0;i4<nPrim;i4++)
9246 if(i4==i1||i4==i2||i4==i3) continue;
9247 aftsTrack=anEvent->GetTrack(i4);
9248 // RP condition (!(first) particle in the correlator must be RP):
9249 if(!(aftsTrack->InRPSelection())) continue;
9250 phi4=aftsTrack->Phi();
9251 // 4'-particle correlations:
9252 fDiffFlowDirectCorrelations[t][pe][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3-phi4)),1.); // <cos(n(psi1+phi2-phi3-phi4))>
9253 }//end of for(Int_t i4=0;i4<nPrim;i4++)
9254 }//end of for(Int_t i3=0;i3<nPrim;i3++)
9255 }//end of for(Int_t i2=0;i2<nPrim;i2++)
9256 }//end of for(Int_t i1=0;i1<nPrim;i1++)
9258 // count # of RPs and POIs in selected pt and eta bins for cross-checkings:
9259 for(Int_t i=0;i<nPrim;i++)
9261 aftsTrack=anEvent->GetTrack(i);
9262 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
9263 if(typeFlag==1) // this is diff flow of POIs
9267 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
9268 } else if (ptOrEta == "Eta")
9270 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
9272 } else // this is diff flow of RPs
9276 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
9277 } else if (ptOrEta == "Eta")
9279 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
9283 fNoOfParticlesInBin->Fill(t+pe+0.5);
9286 } // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoops(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
9289 //================================================================================================================================
9292 void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrelations(TString type, TString ptOrEta)
9294 // Compare correlations needed for diff. flow calculated with nested loops and those calculated from Q-vectors
9296 Int_t typeFlag = -1;
9297 Int_t ptEtaFlag = -1;
9301 } else if(type == "POI")
9308 } else if(ptOrEta == "Eta")
9314 Int_t pe = ptEtaFlag;
9316 TString rpORpoiString[2] = {"RP ","POI"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
9317 TString ptORetaString[2] = {"pt","eta"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
9318 TString reducedCorrelations[4] = {"<<cos(n(psi1-phi2))>>","<<cos(n(psi1+phi2-phi3-phi4))>>","",""}; // to be improved (access this from pro or hist)
9319 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
9320 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
9322 Int_t crossCheckInPtEtaBinNo[2] = {fCrossCheckInPtBinNo,fCrossCheckInEtaBinNo};
9326 cout<<" *****************************************"<<endl;
9327 cout<<" **** cross-checking the correlations ****"<<endl;
9328 cout<<" **** for differential flow ("<<rpORpoiString[t]<<") ****"<<endl;
9329 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
9331 cout<<" **** (particle weights not used) ****"<<endl;
9334 cout<<" **** (particle weights used) ****"<<endl;
9336 cout<<" *****************************************"<<endl;
9338 cout<<" "<<ptORetaString[pe]<<" bin: "<<lowerPtEtaEdge[pe]<<" <= "<<ptORetaString[pe]<<" < "<<upperPtEtaEdge[pe]<<endl;
9341 for(Int_t rci=0;rci<2;rci++) // to be improved (calculate 6th and 8th order)
9343 cout<<" "<<reducedCorrelations[rci].Data()<<":"<<endl;
9344 cout<<" from Q-vectors = "<<fDiffFlowCorrelationsPro[t][pe][rci]->GetBinContent(crossCheckInPtEtaBinNo[pe])<<endl;
9345 cout<<" from nested loops = "<<fDiffFlowDirectCorrelations[t][pe][rci]->GetBinContent(1)<<endl;
9347 } // end of for(Int_t rci=0;rci<4;rci++)
9349 } // end of void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrelations(TString type, TString ptOrEta)
9351 //================================================================================================================================
9353 void AliFlowAnalysisWithQCumulants::PrintNumberOfParticlesInSelectedBin()
9355 // Print on the screen number of RPs and POIs in selected pt and eta bin for cross checkings.
9358 cout<<"Number of RPs in selected pt bin = "<<fNoOfParticlesInBin->GetBinContent(1)<<endl;
9359 cout<<"Number of RPs in selected eta bin = "<<fNoOfParticlesInBin->GetBinContent(2)<<endl;
9360 cout<<"Number of POIs in selected pt bin = "<<fNoOfParticlesInBin->GetBinContent(3)<<endl;
9361 cout<<"Number of POIs in selected eta bin = "<<fNoOfParticlesInBin->GetBinContent(4)<<endl;
9363 } // end of void AliFlowAnalysisWithQCumulants::PrintNumberOfParticlesInSelectedBin()
9365 //================================================================================================================================
9367 void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
9369 // Evaluate reduced correlations with nested loops without using the particle weights.
9371 // Remark 1: Reduced correlations are evaluated in pt bin number fCrossCheckInPtBinNo and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
9372 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrelations[t][pe][ci], where indices runs as follows:
9373 // [0=RP,1=POI][0=Pt,1=Eta][0=<2'>,1=<4'>,2=<6'>,3=<8'>]
9374 // Remark 3: <2'> = <w2 cos(n*(psi1-phi2))>
9375 // <4'> = <w2 w3 w4 cos(n*(psi1+phi2-phi3-phi4))>
9378 Int_t typeFlag = -1;
9379 Int_t ptEtaFlag = -1;
9383 } else if(type == "POI")
9390 } else if(ptOrEta == "Eta")
9396 Int_t pe = ptEtaFlag;
9398 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
9399 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
9400 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
9402 Int_t nPrim = anEvent->NumberOfTracks();
9403 AliFlowTrackSimple *aftsTrack = NULL;
9405 Double_t psi1=0., phi2=0., phi3=0., phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
9406 Double_t wPhi2=1., wPhi3=1., wPhi4=1.;// wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
9408 Int_t n = fHarmonic;
9410 // 2'-particle correlations:
9411 for(Int_t i1=0;i1<nPrim;i1++)
9413 aftsTrack=anEvent->GetTrack(i1);
9414 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
9415 if(typeFlag==1) // this is diff flow of POIs
9419 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
9420 } else if (ptOrEta == "Eta")
9422 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
9424 } else // this is diff flow of RPs
9428 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
9429 } else if (ptOrEta == "Eta")
9431 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
9434 psi1=aftsTrack->Phi();
9435 for(Int_t i2=0;i2<nPrim;i2++)
9437 if(i2==i1) continue;
9438 aftsTrack=anEvent->GetTrack(i2);
9439 // RP condition (!(first) particle in the correlator must be RP):
9440 if(!(aftsTrack->InRPSelection())) continue;
9441 phi2=aftsTrack->Phi();
9442 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
9443 // 2'-particle correlations:
9444 fDiffFlowDirectCorrelations[t][pe][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(1.*n*(psi1-phi2)),wPhi2); // <w2 cos(n*(psi1-phi2))
9445 }//end of for(Int_t i2=0;i2<nPrim;i2++)
9446 }//end of for(Int_t i1=0;i1<nPrim;i1++)
9448 // 4'-particle correlations:
9449 for(Int_t i1=0;i1<nPrim;i1++)
9451 aftsTrack=anEvent->GetTrack(i1);
9452 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
9453 if(typeFlag==1) // this is diff flow of POIs
9457 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
9458 } else if (ptOrEta == "Eta")
9460 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
9462 } else // this is diff flow of RPs
9466 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
9467 } else if (ptOrEta == "Eta")
9469 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
9472 psi1=aftsTrack->Phi();
9473 for(Int_t i2=0;i2<nPrim;i2++)
9475 if(i2==i1) continue;
9476 aftsTrack=anEvent->GetTrack(i2);
9477 // RP condition (!(first) particle in the correlator must be RP):
9478 if(!(aftsTrack->InRPSelection())) continue;
9479 phi2=aftsTrack->Phi();
9480 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
9481 for(Int_t i3=0;i3<nPrim;i3++)
9483 if(i3==i1||i3==i2) continue;
9484 aftsTrack=anEvent->GetTrack(i3);
9485 // RP condition (!(first) particle in the correlator must be RP):
9486 if(!(aftsTrack->InRPSelection())) continue;
9487 phi3=aftsTrack->Phi();
9488 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
9489 for(Int_t i4=0;i4<nPrim;i4++)
9491 if(i4==i1||i4==i2||i4==i3) continue;
9492 aftsTrack=anEvent->GetTrack(i4);
9493 // RP condition (!(first) particle in the correlator must be RP):
9494 if(!(aftsTrack->InRPSelection())) continue;
9495 phi4=aftsTrack->Phi();
9496 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
9497 // 4'-particle correlations <w2 w3 w4 cos(n(psi1+phi2-phi3-phi4))>:
9498 fDiffFlowDirectCorrelations[t][pe][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3-phi4)),wPhi2*wPhi3*wPhi4);
9499 }//end of for(Int_t i4=0;i4<nPrim;i4++)
9500 }//end of for(Int_t i3=0;i3<nPrim;i3++)
9501 }//end of for(Int_t i2=0;i2<nPrim;i2++)
9502 }//end of for(Int_t i1=0;i1<nPrim;i1++)
9504 // count # of RPs and POIs in selected pt and eta bins for cross-checkings: (to be improved - moved to dedicated method)
9505 for(Int_t i=0;i<nPrim;i++)
9507 aftsTrack=anEvent->GetTrack(i);
9508 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
9509 if(typeFlag==1) // this is diff flow of POIs
9513 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
9514 } else if (ptOrEta == "Eta")
9516 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
9518 } else // this is diff flow of RPs
9522 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
9523 } else if (ptOrEta == "Eta")
9525 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
9529 fNoOfParticlesInBin->Fill(t+pe+0.5);
9532 } // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
9535 //================================================================================================================================
9538 void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
9540 // Evaluate with nested loops correction terms for non-uniform acceptance (both sin and cos terms) relevant for differential flow.
9542 // Remark 1: Reduced correction terms for non-uniform acceptance are evaluated in pt bin number fCrossCheckInPtBinNo
9543 // and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
9544 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrections[t][pe][sc][cti], where first three indices runs as:
9545 // [0=RP,1=POI][0=Pt,1=Eta][0=sin terms,1=cos terms], whilst the cti (correction term index) runs as follows:
9547 // 0: <<sc n(psi1)>>
9548 // 1: <<sc n(psi1+phi2)>>
9549 // 2: <<sc n(psi1+phi2-phi3)>>
9550 // 3: <<sc n(psi1-phi2-phi3)>>
9555 Int_t typeFlag = -1;
9556 Int_t ptEtaFlag = -1;
9560 } else if(type == "POI")
9567 } else if(ptOrEta == "Eta")
9573 Int_t pe = ptEtaFlag;
9575 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
9576 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
9577 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
9579 Int_t nPrim = anEvent->NumberOfTracks();
9580 AliFlowTrackSimple *aftsTrack = NULL;
9582 Double_t psi1=0., phi2=0., phi3=0.;// phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
9584 Int_t n = fHarmonic;
9586 // 1-particle correction terms:
9587 for(Int_t i1=0;i1<nPrim;i1++)
9589 aftsTrack=anEvent->GetTrack(i1);
9590 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
9591 if(typeFlag==1) // this is diff flow of POIs
9595 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
9596 } else if (ptOrEta == "Eta")
9598 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
9600 } else // this is diff flow of RPs
9604 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
9605 } else if (ptOrEta == "Eta")
9607 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
9610 psi1=aftsTrack->Phi();
9612 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*psi1),1.); // <<sin(n*(psi1))>>
9614 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*psi1),1.); // <<cos(n*(psi1))>>
9615 }//end of for(Int_t i1=0;i1<nPrim;i1++)
9617 // 2-particle correction terms:
9618 for(Int_t i1=0;i1<nPrim;i1++)
9620 aftsTrack=anEvent->GetTrack(i1);
9621 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
9622 if(typeFlag==1) // this is diff flow of POIs
9626 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
9627 } else if (ptOrEta == "Eta")
9629 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
9631 } else // this is diff flow of RPs
9635 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
9636 } else if (ptOrEta == "Eta")
9638 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
9641 psi1=aftsTrack->Phi();
9642 for(Int_t i2=0;i2<nPrim;i2++)
9644 if(i2==i1) continue;
9645 aftsTrack=anEvent->GetTrack(i2);
9646 // RP condition (!(first) particle in the correlator must be RP):
9647 if(!(aftsTrack->InRPSelection())) continue;
9648 phi2=aftsTrack->Phi();
9650 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2)),1.); // <<sin(n*(psi1+phi2))>>
9652 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2)),1.); // <<cos(n*(psi1+phi2))>>
9653 }//end of for(Int_t i2=0;i2<nPrim;i2++)
9654 }//end of for(Int_t i1=0;i1<nPrim;i1++)
9656 // 3-particle correction terms:
9657 for(Int_t i1=0;i1<nPrim;i1++)
9659 aftsTrack=anEvent->GetTrack(i1);
9660 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
9661 if(typeFlag==1) // this is diff flow of POIs
9665 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
9666 } else if (ptOrEta == "Eta")
9668 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
9670 } else // this is diff flow of RPs
9674 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
9675 } else if (ptOrEta == "Eta")
9677 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
9680 psi1=aftsTrack->Phi();
9681 for(Int_t i2=0;i2<nPrim;i2++)
9683 if(i2==i1) continue;
9684 aftsTrack=anEvent->GetTrack(i2);
9685 // RP condition (!(first) particle in the correlator must be RP):
9686 if(!(aftsTrack->InRPSelection())) continue;
9687 phi2=aftsTrack->Phi();
9688 for(Int_t i3=0;i3<nPrim;i3++)
9690 if(i3==i1||i3==i2) continue;
9691 aftsTrack=anEvent->GetTrack(i3);
9692 // RP condition (!(first) particle in the correlator must be RP):
9693 if(!(aftsTrack->InRPSelection())) continue;
9694 phi3=aftsTrack->Phi();
9696 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][2]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2-phi3)),1.); // <<sin(n*(psi1+phi2-phi3))>>
9697 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][3]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1-phi2-phi3)),1.); // <<sin(n*(psi1-phi2-phi3))>>
9699 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][2]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3)),1.); // <<cos(n*(psi1+phi2-phi3))>>
9700 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][3]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1-phi2-phi3)),1.); // <<cos(n*(psi1-phi2-phi3))>>
9701 }//end of for(Int_t i3=0;i3<nPrim;i3++)
9702 }//end of for(Int_t i2=0;i2<nPrim;i2++)
9703 }//end of for(Int_t i1=0;i1<nPrim;i1++)
9705 } // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
9708 //================================================================================================================================
9711 void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrectionTermsForNUA(TString type, TString ptOrEta)
9713 // Compare corrections temrs for non-uniform acceptance needed for diff. flow calculated with nested loops and those calculated from Q-vectors
9715 Int_t typeFlag = -1;
9716 Int_t ptEtaFlag = -1;
9720 } else if(type == "POI")
9727 } else if(ptOrEta == "Eta")
9733 Int_t pe = ptEtaFlag;
9735 TString rpORpoiString[2] = {"RP ","POI"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
9736 TString ptORetaString[2] = {"pt","eta"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
9737 //TString sinCosFlag[2] = {"sin","cos"}; // to be improved (eventually promote to data member)
9738 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)
9739 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)
9740 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
9741 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
9743 Int_t crossCheckInPtEtaBinNo[2] = {fCrossCheckInPtBinNo,fCrossCheckInEtaBinNo};
9746 cout<<" ******************************************"<<endl;
9747 cout<<" **** cross-checking the correction ****"<<endl;
9748 cout<<" **** terms for non-uniform acceptance ****"<<endl;
9749 cout<<" **** for differential flow ("<<rpORpoiString[t]<<") ****"<<endl;
9750 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
9752 cout<<" **** (particle weights not used) ****"<<endl;
9755 cout<<" **** (particle weights used) ****"<<endl;
9757 cout<<" ******************************************"<<endl;
9759 cout<<" "<<ptORetaString[pe]<<" bin: "<<lowerPtEtaEdge[pe]<<" <= "<<ptORetaString[pe]<<" < "<<upperPtEtaEdge[pe]<<endl;
9762 for(Int_t cti=0;cti<4;cti++) // correction term index
9764 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
9766 if(sc==0) // to be improved (this can be implemented better)
9768 cout<<" "<<reducedCorrectionSinTerms[cti].Data()<<":"<<endl;
9771 cout<<" "<<reducedCorrectionCosTerms[cti].Data()<<":"<<endl;
9773 cout<<" from Q-vectors = "<<fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]->GetBinContent(crossCheckInPtEtaBinNo[pe])<<endl;
9774 cout<<" from nested loops = "<<fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti]->GetBinContent(1)<<endl;
9777 } // end of for(Int_t rci=0;rci<4;rci++)
9779 } // end of void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrectionTermsForNUA(TString type, TString ptOrEta)
9782 //================================================================================================================================
9785 void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights()
9787 // Calculate corrections using particle weights for non-uniform acceptance of the detector for no-name integrated flow (cos terms).
9789 // **********************************************************************
9790 // **** weighted corrections for non-uniform acceptance (cos terms): ****
9791 // **********************************************************************
9793 // Remark 1: When particle weights are used the binning of fIntFlowCorrectionTermsForNUAPro[1] is organized as follows:
9795 // 1st bin: <<w1 cos(n*(phi1))>> = cosP1nW1
9796 // 2nd bin: <<w1 w2 cos(n*(phi1+phi2))>> = cosP1nP1nW1W1
9797 // 3rd bin: <<w1 w2 w3 cos(n*(phi1-phi2-phi3))>> = cosP1nM1nM1nW1W1W1
9800 // multiplicity (number of particles used to determine the reaction plane)
9801 Double_t dMult = (*fSMpk)(0,0);
9803 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
9804 Double_t dReQ1n1k = (*fReQ)(0,1);
9805 Double_t dReQ2n2k = (*fReQ)(1,2);
9806 //Double_t dReQ3n3k = (*fReQ)(2,3);
9807 //Double_t dReQ4n4k = (*fReQ)(3,4);
9808 Double_t dReQ1n3k = (*fReQ)(0,3);
9809 Double_t dImQ1n1k = (*fImQ)(0,1);
9810 Double_t dImQ2n2k = (*fImQ)(1,2);
9811 //Double_t dImQ3n3k = (*fImQ)(2,3);
9812 //Double_t dImQ4n4k = (*fImQ)(3,4);
9813 //Double_t dImQ1n3k = (*fImQ)(0,3);
9815 // dMs are variables introduced in order to simplify some Eqs. bellow:
9816 //..............................................................................................
9817 Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
9818 Double_t dM111 = (*fSMpk)(2,1)-3.*(*fSMpk)(0,2)*(*fSMpk)(0,1)
9819 + 2.*(*fSMpk)(0,3); // dM111 = sum_{i,j,k=1,i!=j!=k}^M w_i w_j w_k
9820 //..............................................................................................
9822 Double_t cosP1nW1 = 0.; // <<w1 cos(n*(phi1))>>
9824 if(dMult>0 && (*fSMpk)(0,1) !=0.)
9826 cosP1nW1 = dReQ1n1k/(*fSMpk)(0,1);
9828 // average weighted 1-particle correction (cos terms) for non-uniform acceptance for single event:
9829 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(1,cosP1nW1);
9831 // final average weighted 1-particle correction (cos terms) for non-uniform acceptance for all events:
9832 fIntFlowCorrectionTermsForNUAPro[1]->Fill(0.5,cosP1nW1,(*fSMpk)(0,1));
9836 Double_t cosP1nP1nW1W1 = 0.; // <<w1 w2 cos(n*(phi1+phi2))>>
9838 if(dMult>1 && dM11 !=0.)
9840 cosP1nP1nW1W1 = (pow(dReQ1n1k,2)-pow(dImQ1n1k,2)-dReQ2n2k)/dM11;
9842 // average weighted 2-particle correction (cos terms) for non-uniform acceptance for single event:
9843 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(2,cosP1nP1nW1W1);
9845 // final average weighted 2-particle correction (cos terms) for non-uniform acceptance for all events:
9846 fIntFlowCorrectionTermsForNUAPro[1]->Fill(1.5,cosP1nP1nW1W1,dM11);
9850 Double_t cosP1nM1nM1nW1W1W1 = 0.; // <<w1 w2 w3 cos(n*(phi1-phi2-phi3))>>
9852 if(dMult>2 && dM111 !=0.)
9854 cosP1nM1nM1nW1W1W1 = (dReQ1n1k*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
9855 - dReQ1n1k*dReQ2n2k-dImQ1n1k*dImQ2n2k
9856 - 2.*((*fSMpk)(0,2))*dReQ1n1k
9860 // average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for single event:
9861 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(3,cosP1nM1nM1nW1W1W1);
9863 // final average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for all events:
9864 fIntFlowCorrectionTermsForNUAPro[1]->Fill(2.5,cosP1nM1nM1nW1W1W1,dM111);
9867 } // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights()
9870 //================================================================================================================================
9873 void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights()
9875 // calculate corrections using particle weights for non-uniform acceptance of the detector for no-name integrated flow (sin terms)
9877 // **********************************************************************
9878 // **** weighted corrections for non-uniform acceptance (sin terms): ****
9879 // **********************************************************************
9881 // Remark 1: When particle weights are used the binning of fIntFlowCorrectionTermsForNUAPro[0] is organized as follows:
9883 // 1st bin: <<w1 sin(n*(phi1))>> = sinP1nW1
9884 // 2nd bin: <<w1 w2 sin(n*(phi1+phi2))>> = sinP1nP1nW1W1
9885 // 3rd bin: <<w1 w2 w3 sin(n*(phi1-phi2-phi3))>> = sinP1nM1nM1nW1W1W1
9888 // multiplicity (number of particles used to determine the reaction plane)
9889 Double_t dMult = (*fSMpk)(0,0);
9891 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
9892 Double_t dReQ1n1k = (*fReQ)(0,1);
9893 Double_t dReQ2n2k = (*fReQ)(1,2);
9894 //Double_t dReQ3n3k = (*fReQ)(2,3);
9895 //Double_t dReQ4n4k = (*fReQ)(3,4);
9896 //Double_t dReQ1n3k = (*fReQ)(0,3);
9897 Double_t dImQ1n1k = (*fImQ)(0,1);
9898 Double_t dImQ2n2k = (*fImQ)(1,2);
9899 //Double_t dImQ3n3k = (*fImQ)(2,3);
9900 //Double_t dImQ4n4k = (*fImQ)(3,4);
9901 Double_t dImQ1n3k = (*fImQ)(0,3);
9903 // dMs are variables introduced in order to simplify some Eqs. bellow:
9904 //..............................................................................................
9905 Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
9906 Double_t dM111 = (*fSMpk)(2,1)-3.*(*fSMpk)(0,2)*(*fSMpk)(0,1)
9907 + 2.*(*fSMpk)(0,3); // dM111 = sum_{i,j,k=1,i!=j!=k}^M w_i w_j w_k
9908 //..............................................................................................
9911 Double_t sinP1nW1 = 0.; // <<w1 sin(n*(phi1))>>
9913 if(dMult>0 && (*fSMpk)(0,1) !=0.)
9915 sinP1nW1 = dImQ1n1k/((*fSMpk)(0,1));
9917 // average weighted 1-particle correction (sin terms) for non-uniform acceptance for single event:
9918 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(1,sinP1nW1);
9920 // final average weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
9921 fIntFlowCorrectionTermsForNUAPro[0]->Fill(0.5,sinP1nW1,(*fSMpk)(0,1));
9925 Double_t sinP1nP1nW1W1 = 0.; // <<w1 w2 sin(n*(phi1+phi2))>>
9927 if(dMult>1 && dM11 !=0.)
9929 sinP1nP1nW1W1 = (2.*dReQ1n1k*dImQ1n1k-dImQ2n2k)/dM11;
9931 // average weighted 2-particle correction (sin terms) for non-uniform acceptance for single event:
9932 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(2,sinP1nP1nW1W1);
9934 // final average weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
9935 fIntFlowCorrectionTermsForNUAPro[0]->Fill(1.5,sinP1nP1nW1W1,dM11);
9939 Double_t sinP1nM1nM1nW1W1W1 = 0.; // <<w1 w2 w3 sin(n*(phi1-phi2-phi3))>>
9941 if(dMult>2 && dM111 !=0.)
9943 sinP1nM1nM1nW1W1W1 = (-dImQ1n1k*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
9944 + dReQ1n1k*dImQ2n2k-dImQ1n1k*dReQ2n2k
9945 + 2.*((*fSMpk)(0,2))*dImQ1n1k
9949 // average weighted 3-particle correction (sin terms) for non-uniform acceptance for single event:
9950 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(3,sinP1nM1nM1nW1W1W1);
9952 // final average weighted 3-particle correction (sin terms) for non-uniform acceptance for all events:
9953 fIntFlowCorrectionTermsForNUAPro[0]->Fill(2.5,sinP1nM1nM1nW1W1W1,dM111);
9956 } // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights()
9959 //================================================================================================================================
9962 void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent)
9964 // Evaluate with nested loops correction terms for non-uniform acceptance for integrated flow (using the particle weights).
9966 // Results are stored in profiles fIntFlowDirectCorrectionTermsForNUA[0] (sin terms) and
9967 // fIntFlowDirectCorrectionTermsForNUA[1] (cos terms).
9969 // Remark 1: When particle weights are used the binning of fIntFlowDirectCorrectionTermsForNUA[sc] is
9970 // organized as follows (sc stands for either sin or cos):
9972 // 1st bin: <<w1 sc(n*(phi1))>> = scP1nW1
9973 // 2nd bin: <<w1 w2 sc(n*(phi1+phi2))>> = scP1nP1nW1W1
9974 // 3rd bin: <<w1 w2 w3 sc(n*(phi1-phi2-phi3))>> = scP1nM1nM1nW1W1W1
9977 Int_t nPrim = anEvent->NumberOfTracks();
9978 AliFlowTrackSimple *aftsTrack = NULL;
9979 //Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
9980 //Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1., wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
9981 Double_t phi1=0., phi2=0., phi3=0.;
9982 Double_t wPhi1=1., wPhi2=1., wPhi3=1.;
9983 Int_t n = fHarmonic;
9984 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
9985 Double_t dMult = (*fSMpk)(0,0);
9987 cout<<"Correction terms for non-uniform acceptance: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
9990 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
9991 } else if (dMult>fMaxAllowedMultiplicity)
9993 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
9996 cout<<"... evaluating nested loops (using particle weights) ..."<<endl;
9999 // 1-particle correction terms using particle weights:
10000 if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)
10002 for(Int_t i1=0;i1<nPrim;i1++)
10004 aftsTrack=anEvent->GetTrack(i1);
10005 if(!(aftsTrack->InRPSelection())) continue;
10006 phi1=aftsTrack->Phi();
10007 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
10008 // 1-particle correction terms using particle weights:
10009 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(0.5,sin(n*phi1),wPhi1); // <w1 sin(n*phi1)>
10010 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(0.5,cos(n*phi1),wPhi1); // <w1 cos(n*phi1)>
10011 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10012 } // end of if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)
10014 // 2-particle correction terms using particle weights:
10015 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
10017 for(Int_t i1=0;i1<nPrim;i1++)
10019 aftsTrack=anEvent->GetTrack(i1);
10020 if(!(aftsTrack->InRPSelection())) continue;
10021 phi1=aftsTrack->Phi();
10022 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
10023 for(Int_t i2=0;i2<nPrim;i2++)
10025 if(i2==i1)continue;
10026 aftsTrack=anEvent->GetTrack(i2);
10027 if(!(aftsTrack->InRPSelection())) continue;
10028 phi2=aftsTrack->Phi();
10029 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
10030 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
10031 // 2-p correction terms using particle weights:
10032 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(1.5,sin(n*(phi1+phi2)),wPhi1*wPhi2); // <w1 w2 sin(n*(phi1+phi2))>
10033 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(1.5,cos(n*(phi1+phi2)),wPhi1*wPhi2); // <w1 w2 cos(n*(phi1+phi2))>
10034 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10035 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10036 } // end of if(nPrim>=2)
10038 // 3-particle correction terms using particle weights:
10039 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
10041 for(Int_t i1=0;i1<nPrim;i1++)
10043 aftsTrack=anEvent->GetTrack(i1);
10044 if(!(aftsTrack->InRPSelection())) continue;
10045 phi1=aftsTrack->Phi();
10046 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
10047 for(Int_t i2=0;i2<nPrim;i2++)
10049 if(i2==i1)continue;
10050 aftsTrack=anEvent->GetTrack(i2);
10051 if(!(aftsTrack->InRPSelection())) continue;
10052 phi2=aftsTrack->Phi();
10053 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
10054 for(Int_t i3=0;i3<nPrim;i3++)
10056 if(i3==i1||i3==i2)continue;
10057 aftsTrack=anEvent->GetTrack(i3);
10058 if(!(aftsTrack->InRPSelection())) continue;
10059 phi3=aftsTrack->Phi();
10060 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
10061 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;
10062 // 3-p correction terms using particle weights:
10063 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(2.5,sin(n*(phi1-phi2-phi3)),wPhi1*wPhi2*wPhi3); // <w1 w2 w3 sin(n*(phi1-phi2-phi3))>
10064 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(2.5,cos(n*(phi1-phi2-phi3)),wPhi1*wPhi2*wPhi3); // <w1 w2 w3 cos(n*(phi1-phi2-phi3))>
10065 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10066 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10067 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10068 } // end of if(nPrim>=3)
10072 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)
10074 // 4 nested loops multiparticle correlations using particle weights:
10075 for(Int_t i1=0;i1<nPrim;i1++)
10077 aftsTrack=anEvent->GetTrack(i1);
10078 if(!(aftsTrack->InRPSelection())) continue;
10079 phi1=aftsTrack->Phi();
10080 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
10081 for(Int_t i2=0;i2<nPrim;i2++)
10083 if(i2==i1)continue;
10084 aftsTrack=anEvent->GetTrack(i2);
10085 if(!(aftsTrack->InRPSelection())) continue;
10086 phi2=aftsTrack->Phi();
10087 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
10088 for(Int_t i3=0;i3<nPrim;i3++)
10090 if(i3==i1||i3==i2)continue;
10091 aftsTrack=anEvent->GetTrack(i3);
10092 if(!(aftsTrack->InRPSelection())) continue;
10093 phi3=aftsTrack->Phi();
10094 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
10095 for(Int_t i4=0;i4<nPrim;i4++)
10097 if(i4==i1||i4==i2||i4==i3)continue;
10098 aftsTrack=anEvent->GetTrack(i4);
10099 if(!(aftsTrack->InRPSelection())) continue;
10100 phi4=aftsTrack->Phi();
10101 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
10102 if(nPrim>=4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush; // to be improved (replace eventually this if statement with if(nPrim==4))
10103 // 4-p correlations using particle weights:
10104 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(10.5,cos(n*phi1+n*phi2-n*phi3-n*phi4),wPhi1*wPhi2*wPhi3*wPhi4);
10105 // extra correlations:
10106 // 2-p extra correlations (do not appear if particle weights are not used):
10108 // 3-p extra correlations (do not appear if particle weights are not used):
10110 // 4-p extra correlations (do not appear if particle weights are not used):
10112 } // end of for(Int_t i4=0;i4<nPrim;i4++)
10113 } // end of for(Int_t i3=0;i3<nPrim;i3++)
10114 } // end of for(Int_t i2=0;i2<nPrim;i2++)
10115 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10116 } // end of if(nPrim>=4)
10122 } // end of void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent)
10125 //================================================================================================================================
10128 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights(TString type, TString ptOrEta)
10130 // Calculate correction terms for non-uniform acceptance for differential flow (cos terms) using particle weights.
10132 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][1][cti], where cti runs as follows:
10134 // 0: <<cos n(psi)>>
10135 // 1: <<w2 cos n(psi1+phi2)>>
10136 // 2: <<w2 w3 cos n(psi1+phi2-phi3)>>
10137 // 3: <<w2 w3 cos n(psi1-phi2-phi3)>>
10142 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
10143 Double_t dReQ1n1k = (*fReQ)(0,1);
10144 Double_t dReQ2n2k = (*fReQ)(1,2);
10145 //Double_t dReQ1n3k = (*fReQ)(0,3);
10146 //Double_t dReQ4n4k = (*fReQ)(3,4);
10147 Double_t dImQ1n1k = (*fImQ)(0,1);
10148 Double_t dImQ2n2k = (*fImQ)(1,2);
10149 //Double_t dImQ1n3k = (*fImQ)(0,3);
10150 //Double_t dImQ4n4k = (*fImQ)(3,4);
10152 // S^M_{p,k} (see .h file for the definition of fSMpk):
10153 Double_t dSM1p1k = (*fSMpk)(0,1);
10154 Double_t dSM1p2k = (*fSMpk)(0,2);
10155 Double_t dSM2p1k = (*fSMpk)(1,1);
10157 Int_t t = -1; // type flag
10158 Int_t pe = -1; // ptEta flag
10163 } else if(type == "POI")
10168 if(ptOrEta == "Pt")
10171 } else if(ptOrEta == "Eta")
10176 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
10177 Double_t minPtEta[2] = {fPtMin,fEtaMin};
10178 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
10179 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
10181 // looping over all bins and calculating correction terms:
10182 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10184 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
10185 Double_t p1n0kRe = 0.;
10186 Double_t p1n0kIm = 0.;
10188 // number of POIs in particular pt or eta bin:
10191 // 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):
10192 Double_t q1n2kRe = 0.;
10193 Double_t q1n2kIm = 0.;
10194 Double_t q2n1kRe = 0.;
10195 Double_t q2n1kIm = 0.;
10197 // s_{1,1}, s_{1,2} // to be improved (add explanation)
10198 Double_t s1p1k = 0.;
10199 Double_t s1p2k = 0.;
10201 // number of particles which are both RPs and POIs in particular pt or eta bin:
10204 // M0111 from Eq. (118) in QC2c (to be improved (notation))
10205 Double_t dM01 = 0.;
10206 Double_t dM011 = 0.;
10211 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))
10212 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));
10213 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))
10214 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b));
10215 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))
10216 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));
10217 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))
10218 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b));
10219 mq = fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
10221 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.);
10222 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.);
10223 }else if(type == "RP")
10225 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
10226 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))
10227 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));
10228 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))
10229 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));
10230 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))
10231 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));
10232 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))
10233 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));
10234 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
10235 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.);
10236 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.);
10237 //s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.);
10239 mq = fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
10245 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
10246 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
10247 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
10248 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
10249 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
10250 // M01 from Eq. (118) in QC2c (to be improved (notation)):
10251 dM01 = mp*dSM1p1k-s1p1k;
10252 dM011 = mp*(dSM2p1k-dSM1p2k)
10253 - 2.*(s1p1k*dSM1p1k-s1p2k);
10255 // typeFlag = RP (0) or POI (1):
10257 } else if(type == "RP")
10259 // to be improved (cross-checked):
10260 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
10261 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
10262 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
10263 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
10264 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
10265 // M01 from Eq. (118) in QC2c (to be improved (notation)):
10266 dM01 = mp*dSM1p1k-s1p1k;
10267 dM011 = mp*(dSM2p1k-dSM1p2k)
10268 - 2.*(s1p1k*dSM1p1k-s1p2k);
10269 // typeFlag = RP (0) or POI (1):
10273 // <<cos n(psi1)>>:
10274 Double_t cosP1nPsi = 0.;
10277 cosP1nPsi = p1n0kRe/mp;
10279 // fill profile for <<cos n(psi1)>>:
10280 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi,mp);
10281 // histogram to store <cos n(psi1)> e-b-e (needed in some other methods):
10282 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][0]->SetBinContent(b,cosP1nPsi);
10285 // <<w2 cos n(psi1+phi2)>>:
10286 Double_t cosP1nPsiP1nPhiW2 = 0.;
10289 cosP1nPsiP1nPhiW2 = (p1n0kRe*dReQ1n1k-p1n0kIm*dImQ1n1k-q2n1kRe)/(dM01);
10290 // fill profile for <<w2 cos n(psi1+phi2)>>:
10291 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsiP1nPhiW2,dM01);
10292 // histogram to store <w2 cos n(psi1+phi2)> e-b-e (needed in some other methods):
10293 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][1]->SetBinContent(b,cosP1nPsiP1nPhiW2);
10294 } // end of if(dM01)
10296 // <<w2 w3 cos n(psi1+phi2-phi3)>>:
10297 Double_t cosP1nPsi1P1nPhi2MPhi3W2W3 = 0.;
10300 cosP1nPsi1P1nPhi2MPhi3W2W3 = (p1n0kRe*(pow(dImQ1n1k,2.)+pow(dReQ1n1k,2.))
10302 - q2n1kRe*dReQ1n1k-q2n1kIm*dImQ1n1k
10306 // fill profile for <<w1 w2 w3 cos n(psi1+phi2)>>:
10307 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1P1nPhi2MPhi3W2W3,dM011);
10308 // histogram to store <w1 w2 w3 cos n(psi1+phi2)> e-b-e (needed in some other methods):
10309 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][2]->SetBinContent(b,cosP1nPsi1P1nPhi2MPhi3W2W3);
10310 } // end of if(dM011)
10312 // <<w2 w3 cos n(psi1-phi2-phi3)>>:
10313 Double_t cosP1nPsi1M1nPhi2MPhi3W2W3 = 0.;
10316 cosP1nPsi1M1nPhi2MPhi3W2W3 = (p1n0kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))+2.*p1n0kIm*dReQ1n1k*dImQ1n1k
10317 - 1.*(p1n0kRe*dReQ2n2k+p1n0kIm*dImQ2n2k)
10318 - 2.*s1p1k*dReQ1n1k
10321 // fill profile for <<w1 w2 w3 cos n(psi1+phi2)>>:
10322 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1M1nPhi2MPhi3W2W3,dM011);
10323 // histogram to store <w1 w2 w3 cos n(psi1+phi2)> e-b-e (needed in some other methods):
10324 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][3]->SetBinContent(b,cosP1nPsi1M1nPhi2MPhi3W2W3);
10325 } // end of if(dM011)
10327 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10329 } // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights(TString type, TString ptOrEta)
10332 //================================================================================================================================
10335 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights(TString type, TString ptOrEta)
10337 // Calculate correction terms for non-uniform acceptance for differential flow (sin terms).
10339 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][0][cti], where cti runs as follows:
10340 // 0: <<sin n(psi1)>>
10341 // 1: <<w2 sin n(psi1+phi2)>>
10342 // 2: <<w2 w3 sin n(psi1+phi2-phi3)>>
10343 // 3: <<w2 w3 sin n(psi1-phi2-phi3)>>:
10348 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
10349 Double_t dReQ1n1k = (*fReQ)(0,1);
10350 Double_t dReQ2n2k = (*fReQ)(1,2);
10351 //Double_t dReQ1n3k = (*fReQ)(0,3);
10352 //Double_t dReQ4n4k = (*fReQ)(3,4);
10353 Double_t dImQ1n1k = (*fImQ)(0,1);
10354 Double_t dImQ2n2k = (*fImQ)(1,2);
10355 //Double_t dImQ1n3k = (*fImQ)(0,3);
10356 //Double_t dImQ4n4k = (*fImQ)(3,4);
10358 // S^M_{p,k} (see .h file for the definition of fSMpk):
10359 Double_t dSM1p1k = (*fSMpk)(0,1);
10360 Double_t dSM1p2k = (*fSMpk)(0,2);
10361 Double_t dSM2p1k = (*fSMpk)(1,1);
10363 Int_t t = -1; // type flag
10364 Int_t pe = -1; // ptEta flag
10369 } else if(type == "POI")
10374 if(ptOrEta == "Pt")
10377 } else if(ptOrEta == "Eta")
10382 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
10383 Double_t minPtEta[2] = {fPtMin,fEtaMin};
10384 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
10385 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
10387 // looping over all bins and calculating correction terms:
10388 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10390 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
10391 Double_t p1n0kRe = 0.;
10392 Double_t p1n0kIm = 0.;
10394 // number of POIs in particular pt or eta bin:
10397 // 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):
10398 Double_t q1n2kRe = 0.;
10399 Double_t q1n2kIm = 0.;
10400 Double_t q2n1kRe = 0.;
10401 Double_t q2n1kIm = 0.;
10403 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
10404 Double_t s1p1k = 0.;
10405 Double_t s1p2k = 0.;
10407 // number of particles which are both RPs and POIs in particular pt or eta bin:
10410 // M0111 from Eq. (118) in QC2c (to be improved (notation))
10411 Double_t dM01 = 0.;
10412 Double_t dM011 = 0.;
10417 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))
10418 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));
10419 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))
10420 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b));
10421 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))
10422 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));
10423 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))
10424 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b));
10425 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
10427 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.);
10428 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.);
10429 }else if(type == "RP")
10431 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
10432 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))
10433 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));
10434 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))
10435 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));
10436 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))
10437 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));
10438 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))
10439 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));
10440 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
10441 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.);
10442 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.);
10443 //s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.);
10449 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
10450 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
10451 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
10452 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
10453 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
10454 // M01 from Eq. (118) in QC2c (to be improved (notation)):
10455 dM01 = mp*dSM1p1k-s1p1k;
10456 dM011 = mp*(dSM2p1k-dSM1p2k)
10457 - 2.*(s1p1k*dSM1p1k-s1p2k);
10458 // typeFlag = RP (0) or POI (1):
10460 } else if(type == "RP")
10462 // to be improved (cross-checked):
10463 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
10464 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
10465 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
10466 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
10467 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
10468 // M01 from Eq. (118) in QC2c (to be improved (notation)):
10469 dM01 = mp*dSM1p1k-s1p1k;
10470 dM011 = mp*(dSM2p1k-dSM1p2k)
10471 - 2.*(s1p1k*dSM1p1k-s1p2k);
10472 // typeFlag = RP (0) or POI (1):
10476 // <<sin n(psi1)>>:
10477 Double_t sinP1nPsi = 0.;
10480 sinP1nPsi = p1n0kIm/mp;
10482 // fill profile for <<sin n(psi1)>>:
10483 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi,mp);
10484 // histogram to store <sin n(psi1)> e-b-e (needed in some other methods):
10485 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][0]->SetBinContent(b,sinP1nPsi);
10488 // <<w2 sin n(psi1+phi2)>>:
10489 Double_t sinP1nPsiP1nPhiW2 = 0.;
10492 sinP1nPsiP1nPhiW2 = (p1n0kRe*dImQ1n1k+p1n0kIm*dReQ1n1k-q2n1kIm)/(dM01);
10493 // fill profile for <<w2 sin n(psi1+phi2)>>:
10494 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsiP1nPhiW2,dM01);
10495 // histogram to store <w2 sin n(psi1+phi2)> e-b-e (needed in some other methods):
10496 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][1]->SetBinContent(b,sinP1nPsiP1nPhiW2);
10497 } // end of if(mp*dMult-mq)
10499 // <<w2 w3 sin n(psi1+phi2-phi3)>>:
10500 Double_t sinP1nPsi1P1nPhi2MPhi3W2W3 = 0.;
10503 sinP1nPsi1P1nPhi2MPhi3W2W3 = (p1n0kIm*(pow(dImQ1n1k,2.)+pow(dReQ1n1k,2.))
10505 + q2n1kRe*dImQ1n1k-q2n1kIm*dReQ1n1k
10509 // fill profile for <<w2 w3 sin n(psi1+phi2-phi3)>>:
10510 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1P1nPhi2MPhi3W2W3,dM011);
10511 // histogram to store <w2 w3 sin n(psi1+phi2-phi3)> e-b-e (needed in some other methods):
10512 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][2]->SetBinContent(b,sinP1nPsi1P1nPhi2MPhi3W2W3);
10513 } // end of if(dM011)
10515 // <<w2 w3 sin n(psi1-phi2-phi3)>>:
10516 Double_t sinP1nPsi1M1nPhi2MPhi3W2W3 = 0.;
10519 sinP1nPsi1M1nPhi2MPhi3W2W3 = (p1n0kIm*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))-2.*p1n0kRe*dReQ1n1k*dImQ1n1k
10520 + 1.*(p1n0kRe*dImQ2n2k-p1n0kIm*dReQ2n2k)
10521 + 2.*s1p1k*dImQ1n1k
10524 // fill profile for <<w2 w3 sin n(psi1-phi2-phi3)>>:
10525 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1M1nPhi2MPhi3W2W3,dM011);
10526 // histogram to store <w2 w3 sin n(psi1-phi2-phi3)> e-b-e (needed in some other methods):
10527 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][3]->SetBinContent(b,sinP1nPsi1M1nPhi2MPhi3W2W3);
10528 } // end of if(dM011)
10530 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10532 } // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights(TString type, TString ptOrEta)
10535 //================================================================================================================================
10538 void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
10540 // Evaluate with nested loops correction terms for non-uniform acceptance
10541 // with using particle weights (both sin and cos terms) relevant for differential flow.
10543 // Remark 1: "w1" in expressions bellow is a particle weight used only for particles which were
10544 // flagged both as POI and RP.
10545 // Remark 2: Reduced correction terms for non-uniform acceptance are evaluated in pt bin number fCrossCheckInPtBinNo
10546 // and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
10547 // Remark 3: Results are stored in 1 bin profiles fDiffFlowDirectCorrections[t][pe][sc][cti], where first three indices runs as:
10548 // [0=RP,1=POI][0=Pt,1=Eta][0=sin terms,1=cos terms], whilst the cti (correction term index) runs as follows:
10550 // 0: <<sc n(psi1)>>
10551 // 1: <<w2 sc n(psi1+phi2)>>
10552 // 2: <<w2 w3 sc n(psi1+phi2-phi3)>>
10553 // 3: <<w2 w3 sc n(psi1-phi2-phi3)>>
10558 Int_t typeFlag = -1;
10559 Int_t ptEtaFlag = -1;
10563 } else if(type == "POI")
10567 if(ptOrEta == "Pt")
10570 } else if(ptOrEta == "Eta")
10575 Int_t t = typeFlag;
10576 Int_t pe = ptEtaFlag;
10578 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
10579 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
10580 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
10582 Int_t nPrim = anEvent->NumberOfTracks();
10583 AliFlowTrackSimple *aftsTrack = NULL;
10585 Double_t psi1=0., phi2=0., phi3=0.;// phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
10586 Double_t wPhi2=1., wPhi3=1.;
10588 Int_t n = fHarmonic;
10590 // 1'-particle correction terms:
10591 for(Int_t i1=0;i1<nPrim;i1++)
10593 aftsTrack=anEvent->GetTrack(i1);
10594 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
10595 if(typeFlag==1) // this is diff flow of POIs
10597 if(ptOrEta == "Pt")
10599 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
10600 } else if (ptOrEta == "Eta")
10602 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
10604 } else // this is diff flow of RPs
10606 if(ptOrEta == "Pt")
10608 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
10609 } else if (ptOrEta == "Eta")
10611 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
10614 psi1=aftsTrack->Phi();
10616 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*psi1),1.); // <<sin(n*(psi1))>>
10618 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*psi1),1.); // <<cos(n*(psi1))>>
10619 }//end of for(Int_t i1=0;i1<nPrim;i1++)
10621 // 2'-particle correction terms:
10622 for(Int_t i1=0;i1<nPrim;i1++)
10624 aftsTrack=anEvent->GetTrack(i1);
10625 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
10626 if(typeFlag==1) // this is diff flow of POIs
10628 if(ptOrEta == "Pt")
10630 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
10631 } else if (ptOrEta == "Eta")
10633 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
10635 } else // this is diff flow of RPs
10637 if(ptOrEta == "Pt")
10639 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
10640 } else if (ptOrEta == "Eta")
10642 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
10645 psi1=aftsTrack->Phi();
10646 for(Int_t i2=0;i2<nPrim;i2++)
10648 if(i2==i1) continue;
10649 aftsTrack=anEvent->GetTrack(i2);
10650 // RP condition (!(first) particle in the correlator must be RP):
10651 if(!(aftsTrack->InRPSelection())) continue;
10652 phi2=aftsTrack->Phi();
10653 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
10655 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2)),wPhi2); // <<w2 sin(n*(psi1+phi2))>>
10657 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2)),wPhi2); // <<w2 cos(n*(psi1+phi2))>>
10658 }//end of for(Int_t i2=0;i2<nPrim;i2++)
10659 }//end of for(Int_t i1=0;i1<nPrim;i1++)
10661 // 3'-particle correction terms:
10662 for(Int_t i1=0;i1<nPrim;i1++)
10664 aftsTrack=anEvent->GetTrack(i1);
10665 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
10666 if(typeFlag==1) // this is diff flow of POIs
10668 if(ptOrEta == "Pt")
10670 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
10671 } else if (ptOrEta == "Eta")
10673 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
10675 } else // this is diff flow of RPs
10677 if(ptOrEta == "Pt")
10679 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
10680 } else if (ptOrEta == "Eta")
10682 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
10685 psi1=aftsTrack->Phi();
10686 for(Int_t i2=0;i2<nPrim;i2++)
10688 if(i2==i1) continue;
10689 aftsTrack=anEvent->GetTrack(i2);
10690 // RP condition (!(first) particle in the correlator must be RP):
10691 if(!(aftsTrack->InRPSelection())) continue;
10692 phi2=aftsTrack->Phi();
10693 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
10694 for(Int_t i3=0;i3<nPrim;i3++)
10696 if(i3==i1||i3==i2) continue;
10697 aftsTrack=anEvent->GetTrack(i3);
10698 // RP condition (!(first) particle in the correlator must be RP):
10699 if(!(aftsTrack->InRPSelection())) continue;
10700 phi3=aftsTrack->Phi();
10701 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
10703 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))>>
10704 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))>>
10706 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))>>
10707 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))>>
10708 }//end of for(Int_t i3=0;i3<nPrim;i3++)
10709 }//end of for(Int_t i2=0;i2<nPrim;i2++)
10710 }//end of for(Int_t i1=0;i1<nPrim;i1++)
10712 } // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)