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"
33 #include "TParticle.h"
37 #include "TProfile2D.h"
38 #include "TProfile3D.h"
41 #include "TPaveLabel.h"
43 #include "AliFlowEventSimple.h"
44 #include "AliFlowTrackSimple.h"
45 #include "AliFlowAnalysisWithQCumulants.h"
66 //================================================================================================================
69 ClassImp(AliFlowAnalysisWithQCumulants)
71 AliFlowAnalysisWithQCumulants::AliFlowAnalysisWithQCumulants():
76 fCommonHists2nd(NULL),
77 fCommonHists4th(NULL),
78 fCommonHists6th(NULL),
79 fCommonHists8th(NULL),
80 fCommonHistsResults2nd(NULL),
81 fCommonHistsResults4th(NULL),
82 fCommonHistsResults6th(NULL),
83 fCommonHistsResults8th(NULL),
100 fUsePhiWeights(kFALSE),
101 fUsePtWeights(kFALSE),
102 fUseEtaWeights(kFALSE),
103 fUseParticleWeights(NULL),
107 // 3.) integrated flow:
109 fIntFlowProfiles(NULL),
110 fIntFlowResults(NULL),
114 fAvMultiplicity(NULL),
115 // 4.) differential flow:
117 fDiffFlowProfiles(NULL),
118 fDiffFlowResults(NULL),
119 // 5.) distributions:
120 fDistributionsList(NULL),
121 // x.) debugging and cross-checking:
122 fNestedLoopsList(NULL),
123 fEvaluateNestedLoopsForIntFlow(kFALSE),
124 fEvaluateNestedLoopsForDiffFlow(kFALSE),
125 fEvaluateNestedLoops(NULL),
126 fDirectCorrelations(NULL),
127 fDirectCorrectionsCos(NULL),
128 fDirectCorrectionsSin(NULL),
129 fDirectCorrelationsDiffFlow(NULL),
130 fDirectCorrectionsDiffFlowCos(NULL),
131 fDirectCorrectionsDiffFlowSin(NULL),
132 fDirectCorrelationsW(NULL),
133 fDirectCorrectionsCosW(NULL),
134 fDirectCorrectionsSinW(NULL),
135 fDirectCorrelationsDiffFlowW(NULL),
136 fDirectCorrectionsDiffFlowCosW(NULL),
137 fDirectCorrectionsDiffFlowSinW(NULL)
141 // base list to hold all output objects:
142 fHistList = new TList();
143 fHistList->SetName("cobjQC");
144 fHistList->SetOwner(kTRUE);
146 // list to hold histograms with phi, pt and eta weights:
147 fWeightsList = new TList();
148 fWeightsList->SetName("Weights");
149 fWeightsList->SetOwner(kTRUE);
152 fAnalysisLabel = new TString();
154 // initialize all arrays:
155 this->InitializeArraysForIntFlow();
156 this->InitializeArraysForDiffFlow();
157 this->InitializeArraysForDistributions();
159 } // end of constructor
162 //================================================================================================================
165 AliFlowAnalysisWithQCumulants::~AliFlowAnalysisWithQCumulants()
171 } // end of AliFlowAnalysisWithQCumulants::~AliFlowAnalysisWithQCumulants()
174 //================================================================================================================
177 void AliFlowAnalysisWithQCumulants::Init()
179 // initialize all constants and book everything
182 this->AccessConstants();
185 this->BookAndNestAllLists();
186 this->BookCommonHistograms();
187 this->BookAndFillWeightsHistograms();
188 this->BookEverythingForIntegratedFlow();
189 this->BookEverythingForDifferentialFlow();
190 this->BookEverythingForDistributions();
191 this->BookEverythingForNestedLoops();
193 // set harmonic in common control histograms (to be improved (should I do this somewhere else?)):
194 (fCommonHists->GetHarmonic())->Fill(0.5,fHarmonic);
195 (fCommonHists2nd->GetHarmonic())->Fill(0.5,fHarmonic);
196 (fCommonHists4th->GetHarmonic())->Fill(0.5,fHarmonic);
197 (fCommonHists6th->GetHarmonic())->Fill(0.5,fHarmonic);
198 (fCommonHists8th->GetHarmonic())->Fill(0.5,fHarmonic);
200 } // end of void AliFlowAnalysisWithQCumulants::Init()
203 //================================================================================================================
206 void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
208 // running over data only in this method
210 // a) fill the common control histograms and call method to fill fAvMultiplicity;
211 // b) loop over data to calculate e-b-e quantities;
212 // c) call the methods;
213 // d) debugging and cross-checking (evaluate nested loops);
214 // e) reset e-b-e quantities.
216 Double_t dPhi = 0.; // azimuthal angle in the laboratory frame
217 Double_t dPt = 0.; // transverse momentum
218 Double_t dEta = 0.; // pseudorapidity
220 Double_t wPhi = 1.; // phi weight
221 Double_t wPt = 1.; // pt weight
222 Double_t wEta = 1.; // eta weight
224 // ********************************************
225 // **** FILL THE COMMON CONTROL HISTOGRAMS ****
226 // ********************************************
228 Int_t nRP = anEvent->GetEventNSelTracksRP(); // number of RPs (i.e. number of particles used to determine the reaction plane)
230 fCommonHists->FillControlHistograms(anEvent);
234 fCommonHists2nd->FillControlHistograms(anEvent);
237 fCommonHists4th->FillControlHistograms(anEvent);
240 fCommonHists6th->FillControlHistograms(anEvent);
243 fCommonHists8th->FillControlHistograms(anEvent);
244 } // end of if(nRP>7)
245 } // end of if(nRP>5)
246 } // end of if(nRP>3)
247 } // end of if(nRP>1)
249 this->FillAverageMultiplicities(nRP);
251 // *******************************************************
252 // **** LOOP OVER DATA AND CALCULATE E-B-E QUANTITIES ****
253 // *******************************************************
255 Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = total number of primary tracks, i.e. nPrim = nRP + nPOI + rest, where:
256 // nRP = # of particles used to determine the reaction plane;
257 // nPOI = # of particles of interest for a detailed flow analysis;
258 // rest = # of particles which are not niether RPs nor POIs.
260 AliFlowTrackSimple *aftsTrack = NULL;
262 for(Int_t i=0;i<nPrim;i++)
264 aftsTrack=anEvent->GetTrack(i);
267 if(!(aftsTrack->InRPSelection() || aftsTrack->InPOISelection())) continue; // consider only tracks which are RPs or POIs
269 Int_t n = fHarmonic; // shortcut for the harmonic
271 if(aftsTrack->InRPSelection()) // RP condition:
273 dPhi = aftsTrack->Phi();
274 dPt = aftsTrack->Pt();
275 dEta = aftsTrack->Eta();
277 if(fUsePhiWeights && fPhiWeights && fnBinsPhi) // determine phi weight for this particle:
279 wPhi = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*fnBinsPhi/TMath::TwoPi())));
281 if(fUsePtWeights && fPtWeights && fnBinsPt) // determine pt weight for this particle:
283 wPt = fPtWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/fPtBinWidth)));
285 if(fUseEtaWeights && fEtaWeights && fEtaBinWidth) // determine eta weight for this particle:
287 wEta = fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/fEtaBinWidth)));
291 // calculate Re[Q_{m*n,k}] and Im[Q_{m*n,k}], m = 1,2,3,4, for this event:
292 for(Int_t m=0;m<4;m++)
294 for(Int_t k=0;k<9;k++)
296 (*fReQ)(m,k)+=pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1)*n*dPhi);
297 (*fImQ)(m,k)+=pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1)*n*dPhi);
300 // calculate S^{M}_{p,k} for this event
301 // Remark: final calculation of S^{M}_{p,k} follows after the loop over data bellow:
302 for(Int_t p=0;p<8;p++)
304 for(Int_t k=0;k<9;k++)
306 (*fSMpk)(p,k)+=pow(wPhi*wPt*wEta,k);
310 // differential flow:
311 // (r_{m*m,k}(pt,eta)):
312 for(Int_t m=0;m<4;m++)
314 for(Int_t k=0;k<9;k++)
316 fReEBE[0][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
317 fImEBE[0][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
320 // s_{k}(pt,eta) for RPs // to be improved (clarified)
321 // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:
322 for(Int_t k=0;k<9;k++)
324 fs[0][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k),1.);
327 if(aftsTrack->InPOISelection())
329 // (q_{m*m,k}(pt,eta)):
330 for(Int_t m=0;m<4;m++)
332 for(Int_t k=0;k<9;k++)
334 fReEBE[2][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);
335 fImEBE[2][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);
338 // s_{k}(pt,eta) for RP&&POIs // to be improved (clarified)
339 // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:
340 for(Int_t k=0;k<9;k++)
342 fs[2][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k),1.);
345 } // end of if(aftsTrack->InPOISelection())
346 } // end of if(pTrack->InRPSelection())
348 if(aftsTrack->InPOISelection())
350 dPhi = aftsTrack->Phi();
351 dPt = aftsTrack->Pt();
352 dEta = aftsTrack->Eta();
355 for(Int_t m=0;m<4;m++)
357 fReEBE[1][m][0]->Fill(dPt,dEta,TMath::Cos((m+1.)*n*dPhi),1.);
358 fImEBE[1][m][0]->Fill(dPt,dEta,TMath::Sin((m+1.)*n*dPhi),1.);
361 } // end of if(pTrack->InPOISelection() )
363 } else // to if(aftsTrack)
366 cout<<" WARNING: no particle! (i.e. aftsTrack is a NULL pointer in AFAWQC::Make().)"<<endl;
369 } // end of for(Int_t i=0;i<nPrim;i++)
371 // calculate the final expressions for S^{M}_{p,k}:
372 for(Int_t p=0;p<8;p++)
374 for(Int_t k=0;k<9;k++)
376 (*fSMpk)(p,k)=pow((*fSMpk)(p,k),p+1);
380 // *****************************
381 // **** CALL THE METHODS *******
382 // *****************************
384 if(!fEvaluateNestedLoopsForIntFlow)
387 if(nRP>1) this->CalculateCorrelationsForIntegratedFlow();
388 if(nRP>0) this->CalculateCorrectionsForNonUniformAcceptanceForIntFlowCosTerms();
389 if(nRP>0) this->CalculateCorrectionsForNonUniformAcceptanceForIntFlowSinTerms();
390 if(nRP>3) this->CalculateQProductsForIntFlow();
391 if(nRP>1) this->CalculateSumAndProductOfEventWeights();
393 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
395 if(nRP>1) this->CalculateWeightedCorrelationsForIntegratedFlow();
396 if(nRP>3) this->CalculateWeightedQProductsForIntFlow();
400 if(!fEvaluateNestedLoopsForDiffFlow)
403 if(nRP>1) this->CalculateCorrelationsForDifferentialFlow("RP");
404 if(nRP>1) this->CalculateCorrelationsForDifferentialFlow("POI");
407 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
409 if(nRP>1) this->CalculateWeightedCorrelationsForDifferentialFlow("RP");
410 if(nRP>1) this->CalculateWeightedCorrelationsForDifferentialFlow("POI");
414 // **************************************************************
415 // **** DEBUGGING AND CROSS-CHECKING (EVALUATE NESTED LOOPS) ****
416 // **************************************************************
418 if(fEvaluateNestedLoopsForIntFlow)
420 if(nPrim>0 && nPrim<15) // only for these multiplicities it is feasible to evaluate 8 nested loops in short time
423 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
425 this->CalculateCorrelationsForIntegratedFlow();
426 this->CalculateCorrectionsForNonUniformAcceptanceForIntFlowCosTerms();
427 this->CalculateCorrectionsForNonUniformAcceptanceForIntFlowSinTerms();
430 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
432 this->CalculateWeightedCorrelationsForIntegratedFlow();
435 this->EvaluateNestedLoopsForIntegratedFlow(anEvent);
439 if(fEvaluateNestedLoopsForDiffFlow)
441 if(nPrim>0 && nPrim<15) // only for these multiplicities it is feasible to evaluate 8 nested loops in short time
444 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
446 this->CalculateCorrelationsForDifferentialFlow("RP");
447 this->CalculateCorrelationsForDifferentialFlow("POI");
450 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
452 this->CalculateWeightedCorrelationsForDifferentialFlow("RP");
453 this->CalculateWeightedCorrelationsForDifferentialFlow("POI");
456 this->EvaluateNestedLoopsForDifferentialFlow(anEvent);
460 // ********************************
461 // **** RESET E-B-E QUANTITIES ****
462 // ********************************
468 for(Int_t pW=0;pW<1+(Int_t)(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);pW++)
470 fQCorrelationsEBE[pW]->Reset();
471 for(Int_t sc=0;sc<2;sc++)
473 fQCorrectionsEBE[pW][sc]->Reset();
477 // differential flow:
478 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
480 for(Int_t m=0;m<4;m++) // multiple of harmonic
482 for(Int_t k=0;k<9;k++) // power of weight
484 if(fReEBE[t][m][k]) fReEBE[t][m][k]->Reset();
485 if(fImEBE[t][m][k]) fImEBE[t][m][k]->Reset();
490 for(Int_t t=0;t<3;t++) // type (0 = RP, 1 = POI, 2 = RP&&POI )
492 for(Int_t k=0;k<9;k++)
494 if(fs[t][k]) fs[t][k]->Reset();
498 } // end of AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
501 //================================================================================================================================
504 void AliFlowAnalysisWithQCumulants::Finish()
506 // calculate the final results
508 // a) acces the constants;
509 // b) access the flags;
510 // c) calculate the final results for integrated flow (without and with weights);
511 // d) store in AliFlowCommonHistResults and print the final results for integrated flow;
512 // e) calculate the final results for differential flow (without and with weights);
513 // f) print the final results for integrated flow obtained from differential flow (to be improved (terminology));
514 // g) COMPARE RESULTS FROM NESTED LOOPS vs RESULTS FROM Q-VECTORS FOR INTEGRATED FLOW
516 // ******************************
517 // **** ACCESS THE CONSTANTS ****
518 // ******************************
520 this->AccessConstants();
522 // **************************
523 // **** ACCESS THE FLAGS ****
524 // **************************
526 fUsePhiWeights = (Int_t)fUseParticleWeights->GetBinContent(1);
527 fUsePtWeights = (Int_t)fUseParticleWeights->GetBinContent(2);
528 fUseEtaWeights = (Int_t)fUseParticleWeights->GetBinContent(3);
529 fEvaluateNestedLoopsForIntFlow = (Int_t)fEvaluateNestedLoops->GetBinContent(1);
530 fEvaluateNestedLoopsForDiffFlow = (Int_t)fEvaluateNestedLoops->GetBinContent(2);
532 // *********************************************************
533 // **** CALCULATE THE FINAL RESULTS FOR INTEGRATED FLOW ****
534 // *********************************************************
537 this->FinalizeCorrelationsForIntFlow(kFALSE,"exact");
538 this->CalculateFinalCorrectionsForNonUniformAcceptanceForCumulantsForIntFlow(kFALSE,"exact");
539 this->CalculateCovariancesForIntFlow(kFALSE,"exact");
540 this->CalculateCumulantsForIntFlow(kFALSE,"exact");
541 this->ApplyCorrectionForNonUniformAcceptanceToCumulantsForIntFlow(kFALSE,"exact");
542 this->CalculateIntFlow(kFALSE,"exact",kFALSE); // pW = 0, eW = 0, not corrected for non-uniform acceptance
543 this->CalculateIntFlow(kFALSE,"exact",kTRUE); // pW = 0, eW = 0, corrected for non-uniform acceptance
546 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
548 this->FinalizeCorrelationsForIntFlow(kTRUE,"exact");
549 // this->CalculateFinalCorrectionsForNonUniformAcceptanceForCumulantsForIntFlow(kTRUE,"exact");
550 this->CalculateCovariancesForIntFlow(kTRUE,"exact");
551 this->CalculateCumulantsForIntFlow(kTRUE,"exact");
552 // this->ApplyCorrectionForNonUniformAcceptanceToCumulantsForIntFlow(kTRUE,"exact");
553 this->CalculateIntFlow(kTRUE,"exact",kFALSE); // weighted and not corrected for non-uniform acceptance
554 // this->CalculateIntFlow(kTRUE,"exact",kTRUE); // weighted and corrected for non-uniform acceptance
557 // ***************************************************************
558 // **** STORE AND PRINT THE FINAL RESULTS FOR INTEGRATED FLOW ****
559 // ***************************************************************
561 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
563 this->FillCommonHistResultsIntFlow(kTRUE,"exact",kFALSE); // weighted and not corrected for non-uniform acceptance
564 // this->FillCommonHistResultsIntFlow(kTRUE,kTRUE); // weighted and corrected for non-uniform acceptance (to be improved (enabled))
565 // this->PrintQuantifyingCorrectionsForNonUniformAcceptance(kTRUE,"exact"); // (to be improved (enabled))
568 this->FillCommonHistResultsIntFlow(kFALSE,"exact",kTRUE); // non-weighted and corrected for non-uniform acceptance
569 this->PrintQuantifyingCorrectionsForNonUniformAcceptance(kFALSE,"exact");
572 this->PrintFinalResultsForIntegratedFlow("NONAME"); // to be improved (name)
574 // ***********************************************************
575 // **** CALCULATE THE FINAL RESULTS FOR DIFFERENTIAL FLOW ****
576 // ***********************************************************
579 this->FinalizeCorrelationsForDiffFlow("RP",kFALSE,"exact");
580 this->FinalizeCorrelationsForDiffFlow("POI",kFALSE,"exact");
581 this->CalculateCumulantsForDiffFlow("RP",kFALSE,"exact");
582 this->CalculateCumulantsForDiffFlow("POI",kFALSE,"exact");
583 this->CalculateDiffFlow("RP",kFALSE,"exact");
584 this->CalculateDiffFlow("POI",kFALSE,"exact");
585 this->CalculateFinalResultsForRPandPOIIntegratedFlow("RP",kFALSE,"exact");
586 this->CalculateFinalResultsForRPandPOIIntegratedFlow("POI",kFALSE,"exact");
589 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
591 this->FinalizeCorrelationsForDiffFlow("RP",kTRUE,"exact");
592 this->FinalizeCorrelationsForDiffFlow("POI",kTRUE,"exact");
593 this->CalculateCumulantsForDiffFlow("RP",kTRUE,"exact");
594 this->CalculateCumulantsForDiffFlow("POI",kTRUE,"exact");
595 this->CalculateDiffFlow("RP",kTRUE,"exact");
596 this->CalculateDiffFlow("POI",kTRUE,"exact");
597 this->CalculateFinalResultsForRPandPOIIntegratedFlow("RP",kTRUE,"exact");
598 this->CalculateFinalResultsForRPandPOIIntegratedFlow("POI",kTRUE,"exact");
602 //this->CalculateFinalCorrectionsForNonUniformAcceptanceForDifferentialFlow(kFALSE,"POI"); // to be improved (to calculate also when weights are used)
603 //this->CalculateFinalCorrectionsForNonUniformAcceptanceForDifferentialFlow(kFALSE,"RP"); // to be improved (to calculate also when weights are used)
606 // *****************************************************************
607 // **** STORE AND PRINT THE FINAL RESULTS FOR DIFFERENTIAL FLOW ****
608 // *****************************************************************
609 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
611 this->FillCommonHistResultsDiffFlow("RP",kTRUE,"exact",kFALSE);
612 this->FillCommonHistResultsDiffFlow("POI",kTRUE,"exact",kFALSE);
615 this->FillCommonHistResultsDiffFlow("RP",kFALSE,"exact",kFALSE);
616 this->FillCommonHistResultsDiffFlow("POI",kFALSE,"exact",kFALSE);
619 this->PrintFinalResultsForIntegratedFlow("RP");
620 this->PrintFinalResultsForIntegratedFlow("POI");
622 // *****************************************************************************************
623 // **** COMPARE RESULTS FROM NESTED LOOPS vs RESULTS FROM Q-VECTORS FOR INTEGRATED FLOW ****
624 // *****************************************************************************************
626 if(fEvaluateNestedLoopsForIntFlow)
628 this->CompareResultsFromNestedLoopsAndFromQVectorsForIntFlow(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);
631 if(fEvaluateNestedLoopsForDiffFlow)
633 this->CompareResultsFromNestedLoopsAndFromQVectorsForDiffFlow(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);
636 } // end of AliFlowAnalysisWithQCumulants::Finish()
639 //================================================================================================================================
642 void AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNonUniformAcceptanceForIntFlowCosTerms()
644 // calculate corrections for non-uniform acceptance of the detector for no-name integrated flow (cos terms)
647 Double_t dMult = (*fSMpk)(0,0);
649 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
650 Double_t dReQ1n = (*fReQ)(0,0);
651 Double_t dReQ2n = (*fReQ)(1,0);
652 //Double_t dReQ3n = (*fReQ)(2,0);
653 //Double_t dReQ4n = (*fReQ)(3,0);
654 Double_t dImQ1n = (*fImQ)(0,0);
655 Double_t dImQ2n = (*fImQ)(1,0);
656 //Double_t dImQ3n = (*fImQ)(2,0);
657 //Double_t dImQ4n = (*fImQ)(3,0);
659 // *************************************************************
660 // **** corrections for non-uniform acceptance (cos terms): ****
661 // *************************************************************
663 // Remark 1: corrections for non-uniform acceptance (cos terms) calculated with non-weighted Q-vectors
664 // are stored in 1D profile fQCorrectionsCos.
665 // Remark 2: binning of fQCorrectionsCos is organized as follows:
666 // --------------------------------------------------------------------------------------------------------------------
667 // 1st bin: <<cos(n*(phi1))>> = cosP1n
668 // 2nd bin: <<cos(n*(phi1+phi2))>> = cosP1nP1n
669 // 3rd bin: <<cos(n*(phi1-phi2-phi3))>> = cosP1nM1nM1n
671 // --------------------------------------------------------------------------------------------------------------------
674 Double_t cosP1n = 0.; // <<cos(n*(phi1))>>
678 cosP1n = dReQ1n/dMult;
680 // average non-weighted 1-particle correction (cos terms) for non-uniform acceptance for single event:
681 fQCorrectionsEBE[0][1]->SetBinContent(1,cosP1n);
683 // final average non-weighted 1-particle correction (cos terms) for non-uniform acceptance for all events:
684 fQCorrections[0][0][1]->Fill(0.5,cosP1n,dMult);
688 Double_t cosP1nP1n = 0.; // <<cos(n*(phi1+phi2))>>
692 cosP1nP1n = (pow(dReQ1n,2)-pow(dImQ1n,2)-dReQ2n)/(dMult*(dMult-1));
694 // average non-weighted 2-particle correction (cos terms) for non-uniform acceptance for single event:
695 fQCorrectionsEBE[0][1]->SetBinContent(2,cosP1nP1n);
697 // final average non-weighted 2-particle correction (cos terms) for non-uniform acceptance for all events:
698 fQCorrections[0][0][1]->Fill(1.5,cosP1nP1n,dMult*(dMult-1));
702 Double_t cosP1nM1nM1n = 0.; // <<cos(n*(phi1-phi2-phi3))>>
706 cosP1nM1nM1n = (dReQ1n*(pow(dReQ1n,2)+pow(dImQ1n,2))-dReQ1n*dReQ2n-dImQ1n*dImQ2n-2.*(dMult-1)*dReQ1n)
707 / (dMult*(dMult-1)*(dMult-2));
709 // average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for single event:
710 fQCorrectionsEBE[0][1]->SetBinContent(3,cosP1nM1nM1n);
712 // final average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for all events:
713 fQCorrections[0][0][1]->Fill(2.5,cosP1nM1nM1n,dMult*(dMult-1)*(dMult-2));
716 } // end of AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNonUniformAcceptanceForIntFlowCosTerms()
719 //================================================================================================================================
722 void AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNonUniformAcceptanceForIntFlowSinTerms()
724 // calculate corrections for non-uniform acceptance of the detector for no-name integrated flow (sin terms)
727 Double_t dMult = (*fSMpk)(0,0);
729 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
730 Double_t dReQ1n = (*fReQ)(0,0);
731 Double_t dReQ2n = (*fReQ)(1,0);
732 //Double_t dReQ3n = (*fReQ)(2,0);
733 //Double_t dReQ4n = (*fReQ)(3,0);
734 Double_t dImQ1n = (*fImQ)(0,0);
735 Double_t dImQ2n = (*fImQ)(1,0);
736 //Double_t dImQ3n = (*fImQ)(2,0);
737 //Double_t dImQ4n = (*fImQ)(3,0);
739 // *************************************************************
740 // **** corrections for non-uniform acceptance (sin terms): ****
741 // *************************************************************
743 // Remark 1: corrections for non-uniform acceptance (sin terms) calculated with non-weighted Q-vectors
744 // are stored in 1D profile fQCorrectionsSin.
745 // Remark 2: binning of fQCorrectionsSin is organized as follows:
746 // --------------------------------------------------------------------------------------------------------------------
747 // 1st bin: <<sin(n*(phi1))>> = sinP1n
748 // 2nd bin: <<sin(n*(phi1+phi2))>> = sinP1nP1n
749 // 3rd bin: <<sin(n*(phi1-phi2-phi3))>> = sinP1nM1nM1n
751 // --------------------------------------------------------------------------------------------------------------------
754 Double_t sinP1n = 0.; // <sin(n*(phi1))>
758 sinP1n = dImQ1n/dMult;
760 // average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for single event:
761 fQCorrectionsEBE[0][0]->SetBinContent(1,sinP1n);
763 // final average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
764 fQCorrections[0][0][0]->Fill(0.5,sinP1n,dMult);
768 Double_t sinP1nP1n = 0.; // <<sin(n*(phi1+phi2))>>
772 sinP1nP1n = (2.*dReQ1n*dImQ1n-dImQ2n)/(dMult*(dMult-1));
774 // average non-weighted 2-particle correction (sin terms) for non-uniform acceptance for single event:
775 fQCorrectionsEBE[0][0]->SetBinContent(2,sinP1nP1n);
777 // final average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
778 fQCorrections[0][0][0]->Fill(1.5,sinP1nP1n,dMult*(dMult-1));
782 Double_t sinP1nM1nM1n = 0.; // <<sin(n*(phi1-phi2-phi3))>>
786 sinP1nM1nM1n = (-dImQ1n*(pow(dReQ1n,2)+pow(dImQ1n,2))+dReQ1n*dImQ2n-dImQ1n*dReQ2n+2.*(dMult-1)*dImQ1n)
787 / (dMult*(dMult-1)*(dMult-2));
789 // average non-weighted 3-particle correction (sin terms) for non-uniform acceptance for single event:
790 fQCorrectionsEBE[0][0]->SetBinContent(3,sinP1nM1nM1n);
792 // final average non-weighted 3-particle correction (sin terms) for non-uniform acceptance for all events:
793 fQCorrections[0][0][0]->Fill(2.5,sinP1nM1nM1n,dMult*(dMult-1)*(dMult-2));
796 } // end of AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNonUniformAcceptanceForIntFlowSinTerms()
799 //================================================================================================================================
802 void AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNonUniformAcceptanceForDifferentialFlowCosTerms(TString type)
804 // calculate corrections for non-uniform acceptance of the detector for differential flow (cos terms)
807 //Double_t dMult = (*fSMpk)(0,0);
809 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
810 //Double_t dReQ1n = (*fReQ)(0,0);
811 //Double_t dReQ2n = (*fReQ)(1,0);
812 //Double_t dReQ3n = (*fReQ)(2,0);
813 //Double_t dReQ4n = (*fReQ)(3,0);
814 //Double_t dImQ1n = (*fImQ)(0,0);
815 //Double_t dImQ2n = (*fImQ)(1,0);
816 //Double_t dImQ3n = (*fImQ)(2,0);
817 //Double_t dImQ4n = (*fImQ)(3,0);
819 // looping over all (pt,eta) bins and calculating correlations needed for differential flow:
820 for(Int_t p=1;p<=fnBinsPt;p++)
822 for(Int_t e=1;e<=fnBinsEta;e++)
824 // real and imaginary parts of q_n (non-weighted Q-vector evaluated only for POIs in harmonic n for each (pt,eta) bin):
825 //Double_t dReqnPtEta = 0.;
826 //Double_t dImqnPtEta = 0.;
828 // number of POIs in each (pt,eta) bin:
829 Double_t dmPtEta = 0.;
831 // real and imaginary parts of q''_{n}, q''_{2n}, ...
832 // (non-weighted Q-vectors evaluated only for particles which are both RPs and POIs in harmonic n, 2n, ... for each (pt,eta) bin):
833 //Double_t dReqPrimePrime1nPtEta = 0.;
834 //Double_t dImqPrimePrime1nPtEta = 0.;
835 //Double_t dReqPrimePrime2nPtEta = 0.;
836 //Double_t dImqPrimePrime2nPtEta = 0.;
838 // number of particles which are both RPs and POIs in each (pt,eta) bin:
839 //Double_t dmPrimePrimePtEta = 0.;
843 // q''_{n}, q''_{2n}:
844 //...............................................................................................
845 //dReqPrimePrime1nPtEta = fReqPrimePrime1nPtEta->GetBinContent(fReqPrimePrime1nPtEta->GetBin(p,e));
846 //dImqPrimePrime1nPtEta = fImqPrimePrime1nPtEta->GetBinContent(fImqPrimePrime1nPtEta->GetBin(p,e));
847 //dReqPrimePrime2nPtEta = fReqPrimePrime2nPtEta->GetBinContent(fReqPrimePrime2nPtEta->GetBin(p,e));
848 //dImqPrimePrime2nPtEta = fImqPrimePrime2nPtEta->GetBinContent(fImqPrimePrime2nPtEta->GetBin(p,e));
849 //...............................................................................................
852 //dmPrimePrimePtEta = fmPrimePrimePtEta->GetBinContent(fmPrimePrimePtEta->GetBin(p,e));
855 //dReqnPtEta = fReqnPtEta->GetBinContent(fReqnPtEta->GetBin(p,e));
856 //dImqnPtEta = fImqnPtEta->GetBinContent(fImqnPtEta->GetBin(p,e));
857 //dmPtEta = fmPtEta->GetBinContent(fmPtEta->GetBin(p,e));
859 else if(type == "RP")
861 // q_RP{n}, q_RP{2n}:
862 //...............................................................................................
863 //dReqPrimePrime1nPtEta = fReqRP1nPtEta->GetBinContent(fReqRP1nPtEta->GetBin(p,e));
864 //dImqPrimePrime1nPtEta = fImqRP1nPtEta->GetBinContent(fImqRP1nPtEta->GetBin(p,e));
865 //dReqPrimePrime2nPtEta = fReqRP2nPtEta->GetBinContent(fReqRP2nPtEta->GetBin(p,e));
866 //dImqPrimePrime2nPtEta = fImqRP2nPtEta->GetBinContent(fImqRP2nPtEta->GetBin(p,e));
867 //...............................................................................................
870 //dmPrimePrimePtEta = fmRPPtEta->GetBinContent(fmRPPtEta->GetBin(p,e));
872 //dReqnPtEta = fReqRP1nPtEta->GetBinContent(fReqRP1nPtEta->GetBin(p,e)); // not a bug ;-)
873 //dImqnPtEta = fImqRP1nPtEta->GetBinContent(fImqRP1nPtEta->GetBin(p,e)); // not a bug ;-)
874 //dmPtEta = fmRPPtEta->GetBinContent(fmRPPtEta->GetBin(p,e)); // not a bug ;-)
878 //Double_t oneCosP1nPsiPtEta = 0.;
882 //oneCosP1nPsiPtEta = dReqnPtEta/dmPtEta;
884 // fill the 2D profile to get the average 1'-p correction for each (pt, eta) bin:
887 //fCorrectionsCosP1nPsiPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,
888 // oneCosP1nPsiPtEta,dmPtEta);
890 else if(type == "RP")
892 //fCorrectionsCosP1nPsiPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,
893 // oneCosP1nPsiPtEta,dmPtEta);
895 } // end of if(dmPtEta*dMult-dmPrimePrimePtEta)
899 // 4'-particle correlation:
900 Double_t four1n1n1n1nPtEta = 0.;
901 if((dmPtEta-dmPrimePrimePtEta)*dMult*(dMult-1.)*(dMult-2.)
902 + dmPrimePrimePtEta*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)
904 four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(dReqnPtEta*dReQ1n+dImqnPtEta*dImQ1n)
905 - dReqPrimePrime2nPtEta*(pow(dReQ1n,2.)-pow(dImQ1n,2.))
906 - 2.*dImqPrimePrime2nPtEta*dReQ1n*dImQ1n
907 - dReqnPtEta*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)
908 + dImqnPtEta*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)
909 - 2.*dMult*(dReqnPtEta*dReQ1n+dImqnPtEta*dImQ1n)
910 - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*dmPrimePrimePtEta
911 + 6.*(dReqPrimePrime1nPtEta*dReQ1n+dImqPrimePrime1nPtEta*dImQ1n)
912 + 1.*(dReqPrimePrime2nPtEta*dReQ2n+dImqPrimePrime2nPtEta*dImQ2n)
913 + 2.*(dReqnPtEta*dReQ1n+dImqnPtEta*dImQ1n)
914 + 2.*dmPrimePrimePtEta*dMult
915 - 6.*dmPrimePrimePtEta)
916 / ((dmPtEta-dmPrimePrimePtEta)*dMult*(dMult-1.)*(dMult-2.)
917 + dmPrimePrimePtEta*(dMult-1.)*(dMult-2.)*(dMult-3.));
919 // fill the 2D profile to get the average correlation for each (pt, eta) bin:
922 f4pPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
923 (dmPtEta-dmPrimePrimePtEta)*dMult*(dMult-1.)*(dMult-2.)
924 + dmPrimePrimePtEta*(dMult-1.)*(dMult-2.)*(dMult-3.));
926 else if(type == "RP")
928 f4pPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
929 (dmPtEta-dmPrimePrimePtEta)*dMult*(dMult-1.)*(dMult-2.)
930 + dmPrimePrimePtEta*(dMult-1.)*(dMult-2.)*(dMult-3.));
932 } // end of if((dmPtEta-dmPrimePrimePtEta)*dMult*(dMult-1.)*(dMult-2.)
933 // +dmPrimePrimePtEta*(dMult-1.)*(dMult-2.)*(dMult-3.))
937 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
938 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
940 } // end of AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNonUniformAcceptanceForDifferentialFlowCosTerms(TString type)
943 //================================================================================================================================
946 void AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNonUniformAcceptanceForDifferentialFlowSinTerms(TString type)
948 // calculate corrections for non-uniform acceptance of the detector for differential flow (sin terms)
951 //Double_t dMult = (*fSMpk)(0,0);
953 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
954 //Double_t dReQ1n = (*fReQ)(0,0);
955 //Double_t dReQ2n = (*fReQ)(1,0);
956 //Double_t dReQ3n = (*fReQ)(2,0);
957 //Double_t dReQ4n = (*fReQ)(3,0);
958 //Double_t dImQ1n = (*fImQ)(0,0);
959 //Double_t dImQ2n = (*fImQ)(1,0);
960 //Double_t dImQ3n = (*fImQ)(2,0);
961 //Double_t dImQ4n = (*fImQ)(3,0);
963 // looping over all (pt,eta) bins and calculating correlations needed for differential flow:
964 for(Int_t p=1;p<=fnBinsPt;p++)
966 for(Int_t e=1;e<=fnBinsEta;e++)
968 // real and imaginary parts of q_n (non-weighted Q-vector evaluated only for POIs in harmonic n for each (pt,eta) bin):
969 //Double_t dReqnPtEta = 0.;
970 //Double_t dImqnPtEta = 0.;
972 // number of POIs in each (pt,eta) bin:
973 Double_t dmPtEta = 0.;
975 // real and imaginary parts of q''_{n}, q''_{2n}, ...
976 // (non-weighted Q-vectors evaluated only for particles which are both RPs and POIs in harmonic n, 2n, ... for each (pt,eta) bin):
977 //Double_t dReqPrimePrime1nPtEta = 0.;
978 //Double_t dImqPrimePrime1nPtEta = 0.;
979 //Double_t dReqPrimePrime2nPtEta = 0.;
980 //Double_t dImqPrimePrime2nPtEta = 0.;
982 // number of particles which are both RPs and POIs in each (pt,eta) bin:
983 //Double_t dmPrimePrimePtEta = 0.;
987 // q''_{n}, q''_{2n}:
988 //...............................................................................................
989 //dReqPrimePrime1nPtEta = fReqPrimePrime1nPtEta->GetBinContent(fReqPrimePrime1nPtEta->GetBin(p,e));
990 //dImqPrimePrime1nPtEta = fImqPrimePrime1nPtEta->GetBinContent(fImqPrimePrime1nPtEta->GetBin(p,e));
991 //dReqPrimePrime2nPtEta = fReqPrimePrime2nPtEta->GetBinContent(fReqPrimePrime2nPtEta->GetBin(p,e));
992 //dImqPrimePrime2nPtEta = fImqPrimePrime2nPtEta->GetBinContent(fImqPrimePrime2nPtEta->GetBin(p,e));
993 //...............................................................................................
996 //dmPrimePrimePtEta = fmPrimePrimePtEta->GetBinContent(fmPrimePrimePtEta->GetBin(p,e));
999 //dReqnPtEta = fReqnPtEta->GetBinContent(fReqnPtEta->GetBin(p,e));
1000 //dImqnPtEta = fImqnPtEta->GetBinContent(fImqnPtEta->GetBin(p,e));
1001 //dmPtEta = fmPtEta->GetBinContent(fmPtEta->GetBin(p,e));
1003 else if(type == "RP")
1005 // q_RP{n}, q_RP{2n}:
1006 //...............................................................................................
1007 //dReqPrimePrime1nPtEta = fReqRP1nPtEta->GetBinContent(fReqRP1nPtEta->GetBin(p,e));
1008 //dImqPrimePrime1nPtEta = fImqRP1nPtEta->GetBinContent(fImqRP1nPtEta->GetBin(p,e));
1009 //dReqPrimePrime2nPtEta = fReqRP2nPtEta->GetBinContent(fReqRP2nPtEta->GetBin(p,e));
1010 //dImqPrimePrime2nPtEta = fImqRP2nPtEta->GetBinContent(fImqRP2nPtEta->GetBin(p,e));
1011 //...............................................................................................
1014 //dmPrimePrimePtEta = fmRPPtEta->GetBinContent(fmRPPtEta->GetBin(p,e));
1016 //dReqnPtEta = fReqRP1nPtEta->GetBinContent(fReqRP1nPtEta->GetBin(p,e)); // not a bug ;-)
1017 //dImqnPtEta = fImqRP1nPtEta->GetBinContent(fImqRP1nPtEta->GetBin(p,e)); // not a bug ;-)
1018 //dmPtEta = fmRPPtEta->GetBinContent(fmRPPtEta->GetBin(p,e)); // not a bug ;-)
1022 //Double_t oneSinP1nPsiPtEta = 0.;
1026 //oneSinP1nPsiPtEta = dImqnPtEta/dmPtEta;
1028 // fill the 2D profile to get the average 1'-p correction for each (pt, eta) bin:
1031 //fCorrectionsSinP1nPsiPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,
1032 // oneSinP1nPsiPtEta,dmPtEta);
1034 else if(type == "RP")
1036 //fCorrectionsSinP1nPsiPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,
1037 // oneSinP1nPsiPtEta,dmPtEta);
1039 } // end of if(dmPtEta*dMult-dmPrimePrimePtEta)
1043 // 4'-particle correlation:
1044 Double_t four1n1n1n1nPtEta = 0.;
1045 if((dmPtEta-dmPrimePrimePtEta)*dMult*(dMult-1.)*(dMult-2.)
1046 + dmPrimePrimePtEta*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)
1048 four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(dReqnPtEta*dReQ1n+dImqnPtEta*dImQ1n)
1049 - dReqPrimePrime2nPtEta*(pow(dReQ1n,2.)-pow(dImQ1n,2.))
1050 - 2.*dImqPrimePrime2nPtEta*dReQ1n*dImQ1n
1051 - dReqnPtEta*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)
1052 + dImqnPtEta*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)
1053 - 2.*dMult*(dReqnPtEta*dReQ1n+dImqnPtEta*dImQ1n)
1054 - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*dmPrimePrimePtEta
1055 + 6.*(dReqPrimePrime1nPtEta*dReQ1n+dImqPrimePrime1nPtEta*dImQ1n)
1056 + 1.*(dReqPrimePrime2nPtEta*dReQ2n+dImqPrimePrime2nPtEta*dImQ2n)
1057 + 2.*(dReqnPtEta*dReQ1n+dImqnPtEta*dImQ1n)
1058 + 2.*dmPrimePrimePtEta*dMult
1059 - 6.*dmPrimePrimePtEta)
1060 / ((dmPtEta-dmPrimePrimePtEta)*dMult*(dMult-1.)*(dMult-2.)
1061 + dmPrimePrimePtEta*(dMult-1.)*(dMult-2.)*(dMult-3.));
1063 // fill the 2D profile to get the average correlation for each (pt, eta) bin:
1066 f4pPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
1067 (dmPtEta-dmPrimePrimePtEta)*dMult*(dMult-1.)*(dMult-2.)
1068 + dmPrimePrimePtEta*(dMult-1.)*(dMult-2.)*(dMult-3.));
1070 else if(type == "RP")
1072 f4pPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
1073 (dmPtEta-dmPrimePrimePtEta)*dMult*(dMult-1.)*(dMult-2.)
1074 + dmPrimePrimePtEta*(dMult-1.)*(dMult-2.)*(dMult-3.));
1076 } // end of if((dmPtEta-dmPrimePrimePtEta)*dMult*(dMult-1.)*(dMult-2.)
1077 // +dmPrimePrimePtEta*(dMult-1.)*(dMult-2.)*(dMult-3.))
1081 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
1082 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
1084 } // end of AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNonUniformAcceptanceForDifferentialFlowSinTerms(TString type)
1087 //================================================================================================================================
1090 void AliFlowAnalysisWithQCumulants::EvaluateNestedLoopsForDifferentialFlow(AliFlowEventSimple* anEvent)
1092 // evaluate the nested loops relevant for differential flow (needed for cross-checking the results)
1094 Int_t nPrim = anEvent->NumberOfTracks();
1095 AliFlowTrackSimple *aftsTrack = NULL;
1097 Double_t psi1=0., phi2=0., phi3=0., phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
1098 Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1.;// wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
1100 Int_t n = fHarmonic; // to be improved
1102 // ********************************************
1103 // **** NESTED LOOPS FOR DIFFERENTIAL FLOW ****
1104 // ********************************************
1106 // Remark 1: (pt,eta) bin in which the cross-checking will be performed is given by 1.1 < pt < 1.2 GeV and -0.55 < eta < -0.525
1108 // Remark 2: multi-particle correlations needed for diff. flow calculated with nested loops without weights are stored in 1D profile
1109 // fDirectCorrelationsDiffFlow
1111 // Remark 3: multi-particle correlations needed for diff. flow calculated with nested loops with weights are stored in 1D profile
1112 // fDirectCorrelationsDiffFlowW;
1114 // Remark 4: binning of fDirectCorrelationsDiffFlow is organized as follows:
1115 //......................................................................................
1116 // ---- bins 1-20: 2-particle correlations ----
1117 // 1st bin: <2'>_{1n|1n} = twoPrime1n1n = <cos(n*(psi1-phi2))>
1118 // ---- bins 21-40: 3-particle correlations ----
1119 // ---- bins 41-60: 4-particle correlations ----
1120 // 41st bin: <4'>_{1n,1n|1n,1n} = fourPrime1n1n1n1n = <cos(n*(psi1+phi2-phi3-phi4))>
1121 //......................................................................................
1123 // Remark 5: binning of fDirectCorrelationsDiffFlow is organized as follows:
1124 //......................................................................................
1125 // ---- bins 1-20: 2-particle correlations ----
1126 // 1st bin: twoPrime1n1nW0W1 = <w2 cos(n*(psi1-phi2))>
1127 // ---- bins 21-40: 3-particle correlations ----
1128 // ---- bins 41-60: 4-particle correlations ----
1129 // 41st bin: fourPrime1n1n1n1nW0W1W1W1 = <w2 w3 w4 cos(n*(psi1+phi2-phi3-phi4))>
1130 //......................................................................................
1133 for(Int_t i1=0;i1<nPrim;i1++)
1135 aftsTrack=anEvent->GetTrack(i1);
1136 // POI condition (first particle in the correlator must be POI):
1137 if(!((aftsTrack->Pt()>=1.1 && aftsTrack->Pt()<1.2) && (aftsTrack->Eta()>=-0.55 && aftsTrack->Eta()<-0.525) && (aftsTrack->InPOISelection())))continue;
1138 psi1=aftsTrack->Phi();
1139 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(psi1*fnBinsPhi/TMath::TwoPi())));
1141 fDirectCorrectionsDiffFlowCos->Fill(0.,cos(1.*n*(psi1)),1.); // <<cos(n*(psi1))>>
1142 fDirectCorrectionsDiffFlowSin->Fill(0.,sin(1.*n*(psi1)),1.); // <<sin(n*(psi1))>>
1144 for(Int_t i2=0;i2<nPrim;i2++)
1147 aftsTrack=anEvent->GetTrack(i2);
1148 // RP condition (!(first) particle in the correlator must be RP):
1149 if(!(aftsTrack->InRPSelection()))continue;
1150 phi2=aftsTrack->Phi();
1151 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
1154 //.....................................................................................
1155 fDirectCorrelationsDiffFlow->Fill(0.,cos(1.*n*(psi1-phi2)),1.); // <cos(n*(psi1-phi2))>
1156 //.....................................................................................
1158 //.....................................................................................
1159 if(fUsePhiWeights) fDirectCorrelationsDiffFlowW->Fill(0.,cos(1.*n*(psi1-phi2)),wPhi2); // <w2 cos(n*(psi1-phi2))>
1160 //.....................................................................................
1162 //fDirectCorrelations->Fill(103.,cos(1.*n*(phi1-phi2)),pow(wPhi1,2)*wPhi2);//<2'>_{n,n}
1163 //fDirectCorrelations->Fill(104.,cos(2.*n*(phi1-phi2)),wPhi1*pow(wPhi2,2));//<2'>_{n,n}
1164 //fDirectCorrelations->Fill(105.,cos(1.*n*(phi1-phi2)),pow(wPhi2,3));//<2'>_{n,n}
1165 //fDirectCorrelations->Fill(41.,cos(2.*n*(phi1-phi2)),1);//<2'>_{2n,2n}
1166 //fDirectCorrelations->Fill(42.,cos(3.*n*(phi1-phi2)),1);//<2'>_{3n,3n}
1167 //fDirectCorrelations->Fill(43.,cos(4.*n*(phi1-phi2)),1);//<2'>_{4n,4n}
1169 }//end of for(Int_t i2=0;i2<nPrim;i2++)
1170 }//end of for(Int_t i1=0;i1<nPrim;i1++)
1177 for(Int_t i1=0;i1<nPrim;i1++)
1179 aftsTrack=anEvent->GetTrack(i1);
1180 if(!((aftsTrack->Pt()>=0.5&&aftsTrack->Pt()<0.6)&&(aftsTrack->InPOISelection())))continue;//POI condition
1181 psi1=aftsTrack->Phi();
1182 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(psi1*fnBinsPhi/TMath::TwoPi())));
1183 for(Int_t i2=0;i2<nPrim;i2++)
1186 aftsTrack=anEvent->GetTrack(i2);
1187 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1188 phi2=aftsTrack->Phi();
1189 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
1190 for(Int_t i3=0;i3<nPrim;i3++)
1192 if(i3==i1||i3==i2)continue;
1193 aftsTrack=anEvent->GetTrack(i3);
1194 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1195 phi3=aftsTrack->Phi();
1196 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
1197 //fill the fDirectCorrelations:
1200 //fDirectCorrelations->Fill(101.,cos(n*(phi2-phi3)),wPhi1*wPhi2*wPhi3); // <w1 w2 w3 cos(n(phi2-phi3))>
1201 //fDirectCorrelations->Fill(102.,cos(n*(phi1-phi3)),pow(wPhi2,2.)*wPhi3); // <w2^2 w3 cos(n(psi1-phi2))>
1204 //fDirectCorrelations->Fill(110.,cos(n*(2.*phi1-phi2-phi3)),wPhi1*wPhi2*wPhi3); // <w1 w2 w3 cos(n(2psi1-phi2-phi3))>
1205 //fDirectCorrelations->Fill(111.,cos(n*(phi1+phi2-2.*phi3)),wPhi2*pow(wPhi3,2.)); // <w2 w3^2 cos(n(psi1+phi2-2.*phi3))>
1208 //fDirectCorrelations->Fill(46.,cos(n*(phi1+phi2-2.*phi3)),1);//<3'>_{n,n|2n}
1209 }//end of for(Int_t i3=0;i3<nPrim;i3++)
1210 }//end of for(Int_t i2=0;i2<nPrim;i2++)
1211 }//end of for(Int_t i1=0;i1<nPrim;i1++)
1215 for(Int_t i1=0;i1<nPrim;i1++)
1217 aftsTrack=anEvent->GetTrack(i1);
1218 // POI condition (first particle in the correlator must be POI):
1219 if(!((aftsTrack->Pt()>=1.1 && aftsTrack->Pt()<1.2) && (aftsTrack->Eta()>=-0.55 && aftsTrack->Eta()<-0.525) && (aftsTrack->InPOISelection())))continue;
1220 psi1=aftsTrack->Phi();
1221 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(psi1*fnBinsPhi/TMath::TwoPi())));
1222 for(Int_t i2=0;i2<nPrim;i2++)
1225 aftsTrack=anEvent->GetTrack(i2);
1226 // RP condition (!(first) particle in the correlator must be RP):
1227 if(!(aftsTrack->InRPSelection()))continue;
1228 phi2=aftsTrack->Phi();
1229 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
1230 for(Int_t i3=0;i3<nPrim;i3++)
1232 if(i3==i1||i3==i2)continue;
1233 aftsTrack=anEvent->GetTrack(i3);
1234 // RP condition (!(first) particle in the correlator must be RP):
1235 if(!(aftsTrack->InRPSelection()))continue;
1236 phi3=aftsTrack->Phi();
1237 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
1238 for(Int_t i4=0;i4<nPrim;i4++)
1240 if(i4==i1||i4==i2||i4==i3)continue;
1241 aftsTrack=anEvent->GetTrack(i4);
1242 // RP condition (!(first) particle in the correlator must be RP):
1243 if(!(aftsTrack->InRPSelection()))continue;
1244 phi4=aftsTrack->Phi();
1245 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
1248 //.........................................................................................................................
1249 fDirectCorrelationsDiffFlow->Fill(40.,cos(n*(psi1+phi2-phi3-phi4)),1.); // <cos(n(psi1+phi1-phi2-phi3))>
1250 //.........................................................................................................................
1252 //...............................................................................................................................
1253 if(fUsePhiWeights) fDirectCorrelationsDiffFlowW->Fill(40.,cos(n*(psi1+phi2-phi3-phi4)),wPhi2*wPhi3*wPhi4); // <w2 w3 w4 cos(n(psi1+phi2-phi3-phi4))>
1254 //...............................................................................................................................
1256 }//end of for(Int_t i4=0;i4<nPrim;i4++)
1257 }//end of for(Int_t i3=0;i3<nPrim;i3++)
1258 }//end of for(Int_t i2=0;i2<nPrim;i2++)
1259 }//end of for(Int_t i1=0;i1<nPrim;i1++)
1263 for(Int_t i1=0;i1<nPrim;i1++)
1265 aftsTrack=anEvent->GetTrack(i1);
1266 if(!((aftsTrack->Pt()>=0.5&&aftsTrack->Pt()<0.6)&&(aftsTrack->InPOISelection())))continue;//POI condition
1267 phi1=aftsTrack->Phi();
1268 for(Int_t i2=0;i2<nPrim;i2++)
1271 aftsTrack=anEvent->GetTrack(i2);
1272 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1273 phi2=aftsTrack->Phi();
1274 for(Int_t i3=0;i3<nPrim;i3++)
1276 if(i3==i1||i3==i2)continue;
1277 aftsTrack=anEvent->GetTrack(i3);
1278 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1279 phi3=aftsTrack->Phi();
1280 for(Int_t i4=0;i4<nPrim;i4++)
1282 if(i4==i1||i4==i2||i4==i3)continue;
1283 aftsTrack=anEvent->GetTrack(i4);
1284 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1285 phi4=aftsTrack->Phi();//
1286 for(Int_t i5=0;i5<nPrim;i5++)
1288 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
1289 aftsTrack=anEvent->GetTrack(i5);
1290 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1291 phi5=aftsTrack->Phi();
1292 //fill the fDirectCorrelations:if(bNestedLoops)
1293 //fDirectCorrelations->Fill(55.,cos(2.*n*phi1+n*phi2-n*phi3-n*phi4-n*phi5),1);//<5'>_{2n,n|n,n,n}
1294 }//end of for(Int_t i5=0;i5<nPrim;i5++)
1295 }//end of for(Int_t i4=0;i4<nPrim;i4++)
1296 }//end of for(Int_t i3=0;i3<nPrim;i3++)
1297 }//end of for(Int_t i2=0;i2<nPrim;i2++)
1298 }//end of for(Int_t i1=0;i1<nPrim;i1++)
1307 //<6'>_{n,n,n|n,n,n}
1308 for(Int_t i1=0;i1<nPrim;i1++)
1310 aftsTrack=anEvent->GetTrack(i1);
1311 if(!((aftsTrack->Pt()>=0.5&&aftsTrack->Pt()<0.6)&&(aftsTrack->InPOISelection())))continue;//POI condition
1312 phi1=aftsTrack->Phi();
1313 for(Int_t i2=0;i2<nPrim;i2++)
1316 aftsTrack=anEvent->GetTrack(i2);
1317 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1318 phi2=aftsTrack->Phi();
1319 for(Int_t i3=0;i3<nPrim;i3++)
1321 if(i3==i1||i3==i2)continue;
1322 aftsTrack=anEvent->GetTrack(i3);
1323 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1324 phi3=aftsTrack->Phi();
1325 for(Int_t i4=0;i4<nPrim;i4++)
1327 if(i4==i1||i4==i2||i4==i3)continue;
1328 aftsTrack=anEvent->GetTrack(i4);
1329 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1330 phi4=aftsTrack->Phi();
1331 for(Int_t i5=0;i5<nPrim;i5++)
1333 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
1334 aftsTrack=anEvent->GetTrack(i5);
1335 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1336 phi5=aftsTrack->Phi();
1337 for(Int_t i6=0;i6<nPrim;i6++)
1339 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
1340 aftsTrack=anEvent->GetTrack(i6);
1341 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1342 phi6=aftsTrack->Phi();
1343 //fill the fDirectCorrelations:
1344 //fDirectCorrelations->Fill(60.,cos(n*(phi1+phi2+phi3-phi4-phi5-phi6)),1);//<6'>_{n,n,n|n,n,n}
1345 }//end of for(Int_t i6=0;i6<nPrim;i6++)
1346 }//end of for(Int_t i5=0;i5<nPrim;i5++)
1347 }//end of for(Int_t i4=0;i4<nPrim;i4++)
1348 }//end of for(Int_t i3=0;i3<nPrim;i3++)
1349 }//end of for(Int_t i2=0;i2<nPrim;i2++)
1350 }//end of for(Int_t i1=0;i1<nPrim;i1++)
1357 //<7'>_{2n,n,n|n,n,n,n}
1358 for(Int_t i1=0;i1<nPrim;i1++)
1360 aftsTrack=anEvent->GetTrack(i1);
1361 if(!((aftsTrack->Pt()>=0.5&&aftsTrack->Pt()<0.6)&&(aftsTrack->InPOISelection())))continue;//POI condition
1362 phi1=aftsTrack->Phi();
1363 for(Int_t i2=0;i2<nPrim;i2++)
1366 aftsTrack=anEvent->GetTrack(i2);
1367 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1368 phi2=aftsTrack->Phi();
1369 for(Int_t i3=0;i3<nPrim;i3++)
1371 if(i3==i1||i3==i2)continue;
1372 aftsTrack=anEvent->GetTrack(i3);
1373 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1374 phi3=aftsTrack->Phi();
1375 for(Int_t i4=0;i4<nPrim;i4++)
1377 if(i4==i1||i4==i2||i4==i3)continue;
1378 aftsTrack=anEvent->GetTrack(i4);
1379 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1380 phi4=aftsTrack->Phi();
1381 for(Int_t i5=0;i5<nPrim;i5++)
1383 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
1384 aftsTrack=anEvent->GetTrack(i5);
1385 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1386 phi5=aftsTrack->Phi();
1387 for(Int_t i6=0;i6<nPrim;i6++)
1389 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
1390 aftsTrack=anEvent->GetTrack(i6);
1391 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1392 phi6=aftsTrack->Phi();
1393 for(Int_t i7=0;i7<nPrim;i7++)
1395 if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;
1396 aftsTrack=anEvent->GetTrack(i7);
1397 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1398 phi7=aftsTrack->Phi();
1399 //fill the fDirectCorrelations:
1400 //fDirectCorrelations->Fill(65.,cos(2.*n*phi1+n*phi2+n*phi3-n*phi4-n*phi5-n*phi6-n*phi7),1);//<7'>_{2n,n,n|n,n,n,n}
1401 }//end of for(Int_t i7=0;i7<nPrim;i7++)
1402 }//end of for(Int_t i6=0;i6<nPrim;i6++)
1403 }//end of for(Int_t i5=0;i5<nPrim;i5++)
1404 }//end of for(Int_t i4=0;i4<nPrim;i4++)
1405 }//end of for(Int_t i3=0;i3<nPrim;i3++)
1406 }//end of for(Int_t i2=0;i2<nPrim;i2++)
1407 }//end of for(Int_t i1=0;i1<nPrim;i1++)
1416 //<8'>_{n,n,n,n|n,n,n,n}
1417 for(Int_t i1=0;i1<nPrim;i1++)
1419 aftsTrack=anEvent->GetTrack(i1);
1420 if(!((aftsTrack->Pt()>=0.5&&aftsTrack->Pt()<0.6)&&(aftsTrack->InPOISelection())))continue;//POI condition
1421 phi1=aftsTrack->Phi();
1422 for(Int_t i2=0;i2<nPrim;i2++)
1425 aftsTrack=anEvent->GetTrack(i2);
1426 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1427 phi2=aftsTrack->Phi();
1428 for(Int_t i3=0;i3<nPrim;i3++)
1430 if(i3==i1||i3==i2)continue;
1431 aftsTrack=anEvent->GetTrack(i3);
1432 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1433 phi3=aftsTrack->Phi();
1434 for(Int_t i4=0;i4<nPrim;i4++)
1436 if(i4==i1||i4==i2||i4==i3)continue;
1437 aftsTrack=anEvent->GetTrack(i4);
1438 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1439 phi4=aftsTrack->Phi();
1440 for(Int_t i5=0;i5<nPrim;i5++)
1442 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
1443 aftsTrack=anEvent->GetTrack(i5);
1444 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1445 phi5=aftsTrack->Phi();
1446 for(Int_t i6=0;i6<nPrim;i6++)
1448 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
1449 aftsTrack=anEvent->GetTrack(i6);
1450 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1451 phi6=aftsTrack->Phi();
1452 for(Int_t i7=0;i7<nPrim;i7++)
1454 if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;
1455 aftsTrack=anEvent->GetTrack(i7);
1456 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1457 phi7=aftsTrack->Phi();
1458 for(Int_t i8=0;i8<nPrim;i8++)
1460 if(i8==i1||i8==i2||i8==i3||i8==i4||i8==i5||i8==i6||i8==i7)continue;
1461 aftsTrack=anEvent->GetTrack(i8);
1462 if(!(aftsTrack->InRPSelection()))continue;//RP condition
1463 phi8=aftsTrack->Phi();
1464 //fill the fDirectCorrelations:
1465 //fDirectCorrelations->Fill(70.,cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8)),1);//<8'>_{n,n,n,n|n,n,n,n}
1466 }//end of for(Int_t i8=0;i8<nPrim;i8++)
1467 }//end of for(Int_t i7=0;i7<nPrim;i7++)
1468 }//end of for(Int_t i6=0;i6<nPrim;i6++)
1469 }//end of for(Int_t i5=0;i5<nPrim;i5++)
1470 }//end of for(Int_t i4=0;i4<nPrim;i4++)
1471 }//end of for(Int_t i3=0;i3<nPrim;i3++)
1472 }//end of for(Int_t i2=0;i2<nPrim;i2++)
1473 }//end of for(Int_t i1=0;i1<nPrim;i1++)
1482 } // end of AliFlowAnalysisWithQCumulants::EvaluateNestedLoopsForDifferentialFlow(AliFlowEventSimple* anEvent)
1485 //================================================================================================================================
1488 void AliFlowAnalysisWithQCumulants::GetOutputHistograms(TList *outputListHistos)
1490 // get pointers to all output histograms (called before Finish())
1491 if(outputListHistos)
1493 // 1.) common control histograms and common histograms for final results:
1494 AliFlowCommonHist *commonHist = dynamic_cast<AliFlowCommonHist*>(outputListHistos->FindObject("AliFlowCommonHistQC"));
1495 if(commonHist) this->SetCommonHists(commonHist);
1496 AliFlowCommonHist *commonHist2nd = dynamic_cast<AliFlowCommonHist*>(outputListHistos->FindObject("AliFlowCommonHist2ndOrderQC"));
1497 if(commonHist2nd) this->SetCommonHists2nd(commonHist2nd);
1498 AliFlowCommonHist *commonHist4th = dynamic_cast<AliFlowCommonHist*>(outputListHistos->FindObject("AliFlowCommonHist4thOrderQC"));
1499 if(commonHist4th) this->SetCommonHists4th(commonHist4th);
1500 AliFlowCommonHist *commonHist6th = dynamic_cast<AliFlowCommonHist*>(outputListHistos->FindObject("AliFlowCommonHist6thOrderQC"));
1501 if(commonHist6th) this->SetCommonHists6th(commonHist6th);
1502 AliFlowCommonHist *commonHist8th = dynamic_cast<AliFlowCommonHist*>(outputListHistos->FindObject("AliFlowCommonHist8thOrderQC"));
1503 if(commonHist8th) this->SetCommonHists8th(commonHist8th);
1504 AliFlowCommonHistResults *commonHistRes2nd = dynamic_cast<AliFlowCommonHistResults*>
1505 (outputListHistos->FindObject("AliFlowCommonHistResults2ndOrderQC"));
1506 if(commonHistRes2nd) this->SetCommonHistsResults2nd(commonHistRes2nd);
1507 AliFlowCommonHistResults *commonHistRes4th = dynamic_cast<AliFlowCommonHistResults*>
1508 (outputListHistos->FindObject("AliFlowCommonHistResults4thOrderQC"));
1509 if(commonHistRes4th) this->SetCommonHistsResults4th(commonHistRes4th);
1510 AliFlowCommonHistResults *commonHistRes6th = dynamic_cast<AliFlowCommonHistResults*>
1511 (outputListHistos->FindObject("AliFlowCommonHistResults6thOrderQC"));
1512 if(commonHistRes6th) this->SetCommonHistsResults6th(commonHistRes6th);
1513 AliFlowCommonHistResults *commonHistRes8th = dynamic_cast<AliFlowCommonHistResults*>
1514 (outputListHistos->FindObject("AliFlowCommonHistResults8thOrderQC"));
1515 if(commonHistRes8th) this->SetCommonHistsResults8th(commonHistRes8th);
1518 TList *weightsList = dynamic_cast<TList*>(outputListHistos->FindObject("Weights"));
1519 if(weightsList) this->SetWeightsList(weightsList);
1520 Bool_t bUsePhiWeights = kFALSE;
1521 Bool_t bUsePtWeights = kFALSE;
1522 Bool_t bUseEtaWeights = kFALSE;
1523 TProfile *useParticleWeights = dynamic_cast<TProfile*>(weightsList->FindObject("fUseParticleWeights"));
1524 if(useParticleWeights)
1526 this->SetUseParticleWeights(useParticleWeights);
1527 bUsePhiWeights = (Int_t)useParticleWeights->GetBinContent(1);
1528 bUsePtWeights = (Int_t)useParticleWeights->GetBinContent(2);
1529 bUseEtaWeights = (Int_t)useParticleWeights->GetBinContent(3);
1532 // 3.) integrated flow:
1533 TList *intFlowList = NULL;
1534 TList *intFlowProfiles = NULL;
1535 TList *intFlowResults = NULL;
1537 intFlowList = dynamic_cast<TList*>(outputListHistos->FindObject("Integrated Flow"));
1540 intFlowProfiles = dynamic_cast<TList*>(intFlowList->FindObject("Profiles"));
1541 intFlowResults = dynamic_cast<TList*>(intFlowList->FindObject("Results"));
1544 cout<<"WARNING: intFlowList is NULL in AFAWQC::GOH() !!!!"<<endl;
1550 // average multiplicities:
1551 TProfile *avMultiplicity = dynamic_cast<TProfile*>(intFlowProfiles->FindObject("fAvMultiplicity"));
1554 this->SetAvMultiplicity(avMultiplicity);
1557 cout<<"WARNING: avMultiplicity is NULL in AFAWQC::GOH() !!!!"<<endl;
1560 // flags: (to be improved (united with other flags in this method))
1561 TString pWeightsFlag[2] = {"pWeights not used","pWeights used"};
1562 TString eWeightsFlag[2] = {"exact eWeights","non-exact eWeights"};
1563 //TString nuaFlag[2] = {"not corrected","corrected"};
1564 TString sinCosFlag[2] = {"sin","cos"};
1566 for(Int_t pW=0;pW<1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights);pW++)
1568 for(Int_t eW=0;eW<1;eW++)
1570 // correlations (profiles):
1571 TProfile *qCorrelations = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(Form("fQCorrelations: %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));
1574 this->SetQCorrelations(qCorrelations,pW,eW);
1577 cout<<"WARNING: qCorrelations is NULL in AFAWQC::GOH() !!!!"<<endl;
1578 cout<<"pW = "<<pW<<endl;
1579 cout<<"eW = "<<eW<<endl;
1581 // products (profiles):
1582 TProfile *qProducts = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(Form("fQProducts: %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));
1585 this->SetQProducts(qProducts,pW,eW);
1588 cout<<"WARNING: qProducts is NULL in AFAWQC::GOH() !!!!"<<endl;
1589 cout<<"pW = "<<pW<<endl;
1590 cout<<"eW = "<<eW<<endl;
1592 // corrections (profiles):
1593 for(Int_t sc=0;sc<2;sc++)
1595 TProfile *qCorrections = dynamic_cast<TProfile*>(intFlowProfiles->FindObject((Form("fQCorrections: %s, %s, %s terms",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),sinCosFlag[sc].Data()))));
1598 this->SetQCorrections(qCorrections,pW,eW,sc);
1601 cout<<"WARNING: qCorrections is NULL in AFAWQC::GOH() !!!!"<<endl;
1602 cout<<"pW = "<<pW<<endl;
1603 cout<<"eW = "<<eW<<endl;
1604 cout<<"sc = "<<sc<<endl;
1606 } // end of for(Int_t sc=0;sc<2;sc++)
1607 } // end of for(Int_t eW=0;eW<1;eW++)
1608 } // end of for(Int_t pW=0;pW<1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights);pW++)
1609 } else // to if(intFlowProfiles)
1611 cout<<"WARNING: intFlowProfiles is NULL in AFAWQC::GOH() !!!!"<<endl;
1617 for(Int_t pW=0;pW<1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights);pW++)
1619 for(Int_t eW=0;eW<2;eW++)
1621 // flags: (to be improved (united with other flags in this method))
1622 TString pWeightsFlag[2] = {"pWeights not used","pWeights used"};
1623 TString eWeightsFlag[2] = {"exact eWeights","non-exact eWeights"};
1624 TString nuaFlag[2] = {"not corrected","corrected"};
1625 TString powerFlag[2] = {"linear","quadratic"};
1626 //TString sinCosFlag[2] = {"sin","cos"};
1627 // correlations (results):
1628 TH1D *correlations = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("fCorrelations: %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));
1631 this->SetCorrelations(correlations,pW,eW);
1634 cout<<"WARNING: correlations is NULL in AFAWQC::GOH() !!!!"<<endl;
1635 cout<<"pW = "<<pW<<endl;
1636 cout<<"eW = "<<eW<<endl;
1638 // corrections (results):
1639 TH1D *corrections = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("fCorrections: %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));
1642 this->SetCorrections(corrections,pW,eW);
1645 cout<<"WARNING: corrections is NULL in AFAWQC::GOH() !!!!"<<endl;
1646 cout<<"pW = "<<pW<<endl;
1647 cout<<"eW = "<<eW<<endl;
1649 // covariances (results):
1650 TH1D *covariances = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("fCovariances: %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));
1653 this->SetCovariances(covariances,pW,eW);
1656 cout<<"WARNING: covariances is NULL in AFAWQC::GOH() !!!!"<<endl;
1657 cout<<"pW = "<<pW<<endl;
1658 cout<<"eW = "<<eW<<endl;
1660 // sum of linear and quadratic event weights (results):
1661 for(Int_t power=0;power<2;power++)
1663 TH1D *sumOfEventWeights = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("fSumOfEventWeights: %s, %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),powerFlag[power].Data())));
1664 if(sumOfEventWeights)
1666 this->SetSumOfEventWeights(sumOfEventWeights,pW,eW,power);
1669 cout<<"WARNING: sumOfEventWeights is NULL in AFAWQC::GOH() !!!!"<<endl;
1670 cout<<"pW = "<<pW<<endl;
1671 cout<<"eW = "<<eW<<endl;
1672 cout<<"power = "<<power<<endl;
1674 } // end of for(Int_t power=0;power<2;power++)
1675 // products of event weights (results):
1676 TH1D *productOfEventWeights = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("fProductOfEventWeights: %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));
1677 if(productOfEventWeights)
1679 this->SetProductOfEventWeights(productOfEventWeights,pW,eW);
1682 cout<<"WARNING: productOfEventWeights is NULL in AFAWQC::GOH() !!!!"<<endl;
1683 cout<<"pW = "<<pW<<endl;
1684 cout<<"eW = "<<eW<<endl;
1687 for(Int_t nua=0;nua<2;nua++)
1689 // integrated Q-cumulants:
1690 TH1D *cumulants = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("fCumulants: %s, %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data())));
1693 this->SetCumulants(cumulants,pW,eW,nua);
1696 cout<<"WARNING: cumulants is NULL in AFAWQC::GOH() !!!!"<<endl;
1697 cout<<"pW = "<<pW<<endl;
1698 cout<<"eW = "<<eW<<endl;
1699 cout<<"nua = "<<nua<<endl;
1701 // integrated flow estimates from Q-cumulants:
1702 TH1D *intFlow = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("fIntFlow: %s, %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data())));
1705 this->SetIntFlow(intFlow,pW,eW,nua);
1708 cout<<"WARNING: intFlow is NULL in AFAWQC::GOH() !!!!"<<endl;
1709 cout<<"pW = "<<pW<<endl;
1710 cout<<"eW = "<<eW<<endl;
1711 cout<<"nua = "<<nua<<endl;
1713 } // end of for(Int_t nua=0;nua<2;nua++)
1714 } // end of for(Int_t eW=0;eW<1;eW++)
1715 } // end of for(Int_t pW=0;pW<1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights);pW++)
1716 } else // to if(intFlowResults)
1718 cout<<"WARNING: intFlowResults is NULL in AFAWQC::GOH() !!!!"<<endl;
1721 // differential flow:
1722 TString typeFlag[2] = {"RP","POI"};
1723 TString pWeightsFlag[2] = {"not used","used"};
1724 TString eWeightsFlag[2] = {"exact","non-exact"};
1725 TString sinCosFlag[2] = {"sin","cos"};
1726 TString nuaFlag[2] = {"not corrected","corrected"}; // nua = non-uniform acceptance
1727 TString ptEtaFlag[2] = {"p_{t}","#eta"};
1728 // base list fDiffFlowList "Differential Flow":
1729 TList *diffFlowList = NULL;
1730 diffFlowList = dynamic_cast<TList*>(outputListHistos->FindObject("Differential Flow"));
1731 // list holding nested lists containing profiles:
1732 TList *diffFlowListProfiles = NULL;
1733 // list holding nested lists containing 2D and 1D histograms with final results:
1734 TList *diffFlowListResults = NULL;
1737 diffFlowListProfiles = dynamic_cast<TList*>(diffFlowList->FindObject("Profiles"));
1738 diffFlowListResults = dynamic_cast<TList*>(diffFlowList->FindObject("Results"));
1741 cout<<"WARNING: diffFlowList is NULL in AFAWQC::GOH() !!!!"<<endl;
1744 // nested list in the list of profiles fDiffFlowListProfiles "Profiles":
1745 TList *dfpType[2] = {NULL};
1746 TList *dfpParticleWeights[2][2] = {{NULL}};
1747 TList *dfpEventWeights[2][2][2] = {{{NULL}}};
1748 TList *diffFlowCorrelations[2][2][2] = {{{NULL}}};
1749 TList *diffFlowProductsOfCorrelations[2][2][2] = {{{NULL}}};
1750 TList *diffFlowCorrectionTerms[2][2][2][2] = {{{{NULL}}}};
1752 if(diffFlowListProfiles)
1754 for(Int_t t=0;t<2;t++)
1756 dfpType[t] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(typeFlag[t].Data()));
1759 for(Int_t pW=0;pW<(1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights));pW++)
1761 dfpParticleWeights[t][pW] = dynamic_cast<TList*>(dfpType[t]->FindObject(Form("%s, pWeights %s",typeFlag[t].Data(),pWeightsFlag[pW].Data())));
1762 if(dfpParticleWeights[t][pW])
1764 for(Int_t eW=0;eW<2;eW++)
1766 dfpEventWeights[t][pW][eW] = dynamic_cast<TList*>(dfpParticleWeights[t][pW]->FindObject(Form("%s, pWeights %s, eWeights %s",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));
1767 if(dfpEventWeights[t][pW][eW])
1770 diffFlowCorrelations[t][pW][eW] = dynamic_cast<TList*>(dfpEventWeights[t][pW][eW]->FindObject(Form("Correlations (%s, pWeights %s, eWeights %s)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));
1771 // products of correlations:
1772 diffFlowProductsOfCorrelations[t][pW][eW] = dynamic_cast<TList*>(dfpEventWeights[t][pW][eW]->FindObject(Form("Products of correlations (%s, pWeights %s, eWeights %s)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));
1773 // correction terms:
1774 for(Int_t sc=0;sc<2;sc++)
1776 diffFlowCorrectionTerms[t][pW][eW][sc] = dynamic_cast<TList*>(dfpEventWeights[t][pW][eW]->FindObject(Form("Corrections for NUA (%s, pWeights %s, eWeights %s, %s terms)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),sinCosFlag[sc].Data())));
1777 //this->SetDiffFlowCorrectionTerms(diffFlowCorrectionTerms[t][pW][sc],t,pW,sc);
1779 } else // to if(dfpEventWeights[t][pW][eW])
1781 cout<<"WARNING: dfpEventWeights[t][pW][eW] is NULL in AFAWQC::GOH() !!!!"<<endl;
1782 cout<<"t = "<<t<<endl;
1783 cout<<"pW = "<<pW<<endl;
1784 cout<<"eW = "<<eW<<endl;
1786 } // end of for(Int_t eW=0;eW<2;eW++)
1787 } else // to if(dfpParticleWeights[t][pW])
1789 cout<<"WARNING: dfpParticleWeights[t][pW] is NULL in AFAWQC::GOH() !!!!"<<endl;
1790 cout<<"t = "<<t<<endl;
1791 cout<<"pW = "<<pW<<endl;
1793 } // end of for(Int_t pW=0;pW<(1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights));pW++)
1794 } else // if(dfpType[t])
1796 cout<<"WARNING: dfpType[t] is NULL in AFAWQC::GOH() !!!!"<<endl;
1797 cout<<"t = "<<t<<endl;
1799 } // end of for(Int_t t=0;t<2;t++)
1800 } else // to if(diffFlowListProfiles)
1802 cout<<"WARNING: diffFlowListProfiles is NULL in AFAWQC::GOH() !!!!"<<endl;
1805 TProfile2D *correlationsPro[2][2][2][4] = {{{{NULL}}}};
1806 TProfile2D *productsOfCorrelationsPro[2][2][2][5] = {{{{NULL}}}};
1807 TProfile2D *correctionTermsPro[2][2][2][2][2] = {{{{{NULL}}}}};
1809 TString correlationName[4] = {"<2'>","<4'>","<6'>","<8'>"};
1810 TString cumulantName[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
1811 TString productOfCorrelationsName[5] = {"<2><2'>","<2><4'>","<4><2'>","<4><4'>","<2'><4'>"};
1812 TString correctionsSinTermsName[2] = {"sin(1)","sin(2)"};
1813 TString correctionsCosTermsName[2] = {"cos(1)","cos(2)"};
1814 TString correctionName[4] = {"corr. to QC{2'}","corr. to QC{4'}","corr. to QC{6'}","corr. to QC{8'}"};
1815 TString covarianceName[4] = {"Cov(2,2')","Cov(2,4')","Cov(2',4')","Cov(4,2')"}; // to be improved (reorganized)
1816 TString flowName[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
1818 for(Int_t t=0;t<2;t++)
1820 for(Int_t pW=0;pW<(1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights));pW++)
1822 for(Int_t eW=0;eW<2;eW++)
1825 if(diffFlowCorrelations[t][pW][eW])
1827 for(Int_t correlationIndex=0;correlationIndex<4;correlationIndex++)
1829 correlationsPro[t][pW][eW][correlationIndex] = dynamic_cast<TProfile2D*>(diffFlowCorrelations[t][pW][eW]->FindObject(correlationName[correlationIndex].Data()));
1830 if(correlationsPro[t][pW][eW][correlationIndex])
1832 this->SetCorrelationsPro(correlationsPro[t][pW][eW][correlationIndex],t,pW,eW,correlationIndex);
1833 } else // to if(correlationsPro[t][pW][ew][correlationIndex])
1835 cout<<"WARNING: correlationsPro[t][pW][eW][correlationIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
1836 cout<<"t = "<<t<<endl;
1837 cout<<"pW = "<<pW<<endl;
1838 cout<<"eW = "<<eW<<endl;
1839 cout<<"ci = "<<correlationIndex<<endl;
1842 } else // to if(diffFlowCorrelations[t][pW][eW])
1844 cout<<"WARNING: diffFlowCorrelations[t][pW][eW] is NULL in AFAWQC::GOH() !!!!"<<endl;
1845 cout<<"t = "<<t<<endl;
1846 cout<<"pW = "<<pW<<endl;
1847 cout<<"eW = "<<eW<<endl;
1849 // products of correlations:
1850 if(diffFlowProductsOfCorrelations[t][pW][eW])
1852 for(Int_t productOfCorrelationsIndex=0;productOfCorrelationsIndex<5;productOfCorrelationsIndex++)
1854 productsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex] = dynamic_cast<TProfile2D*>(diffFlowProductsOfCorrelations[t][pW][eW]->FindObject(productOfCorrelationsName[productOfCorrelationsIndex].Data()));
1855 if(productsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex])
1857 this->SetProductsOfCorrelationsPro(productsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex],t,pW,eW,productOfCorrelationsIndex);
1858 } else // to if(productsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex])
1860 cout<<"WARNING: productsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
1861 cout<<"t = "<<t<<endl;
1862 cout<<"pW = "<<pW<<endl;
1863 cout<<"eW = "<<eW<<endl;
1864 cout<<"ci = "<<productOfCorrelationsIndex<<endl;
1867 } else // to if(diffFlowProductsOfCorrelations[t][pW][eW])
1869 cout<<"WARNING: diffFlowProductsOfCorrelations[t][pW][eW] is NULL in AFAWQC::GOH() !!!!"<<endl;
1870 cout<<"t = "<<t<<endl;
1871 cout<<"pW = "<<pW<<endl;
1872 cout<<"eW = "<<eW<<endl;
1874 // correction terms:
1875 for(Int_t sc=0;sc<2;sc++)
1877 if(diffFlowCorrectionTerms[t][pW][eW][sc])
1879 for(Int_t correctionIndex=0;correctionIndex<2;correctionIndex++)
1883 correctionTermsPro[t][pW][eW][sc][correctionIndex] = dynamic_cast<TProfile2D*>(diffFlowCorrectionTerms[t][pW][eW][sc]->FindObject(correctionsSinTermsName[correctionIndex].Data()));
1884 if(correctionTermsPro[t][pW][eW][sc][correctionIndex])
1886 this->SetCorrectionTermsPro(correctionTermsPro[t][pW][eW][sc][correctionIndex],t,pW,eW,sc,correctionIndex);
1889 cout<<"WARNING: correctionTermsPro[t][pW][eW][sc][correctionIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
1890 cout<<"t = "<<t<<endl;
1891 cout<<"pW = "<<pW<<endl;
1892 cout<<"eW = "<<eW<<endl;
1893 cout<<"sc = "<<sc<<endl;
1894 cout<<"ci = "<<correctionIndex<<endl;
1899 correctionTermsPro[t][pW][eW][sc][correctionIndex] = dynamic_cast<TProfile2D*>(diffFlowCorrectionTerms[t][pW][eW][sc]->FindObject(correctionsCosTermsName[correctionIndex].Data()));
1900 if(correctionTermsPro[t][pW][eW][sc][correctionIndex])
1902 this->SetCorrectionTermsPro(correctionTermsPro[t][pW][eW][sc][correctionIndex],t,pW,eW,sc,correctionIndex);
1905 cout<<"WARNING: correctionTermsPro[t][pW][eW][sc][correctionIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
1906 cout<<"t = "<<t<<endl;
1907 cout<<"pW = "<<pW<<endl;
1908 cout<<"eW = "<<eW<<endl;
1909 cout<<"sc = "<<sc<<endl;
1910 cout<<"ci = "<<correctionIndex<<endl;
1913 } // end of for(Int_t correctionIndex=0;correctionIndex<2;correctionIndex++)
1914 } else // to if(diffFlowCorrectionTerms[t][pW][eW][sc])
1916 cout<<"WARNING: diffFlowCorrectionTerms[t][pW][eW][sc] is NULL in AFAWQC::GOH() !!!!"<<endl;
1917 cout<<"t = "<<t<<endl;
1918 cout<<"pW = "<<pW<<endl;
1919 cout<<"eW = "<<eW<<endl;
1920 cout<<"sc = "<<sc<<endl;
1922 } // end of for(Int_t sc=0;sc<2;sc++)
1923 } // end of for(Int_t eW=0;eW<2;eW++)
1924 } // end of for(Int_t pW=0;pW<(1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights));pW++)
1925 } // end of for(Int_t t=0;t<2;t++)
1927 // nested list in the list of results fDiffFlowListResults "Results":
1928 TList *dfrType[2] = {NULL};
1929 TList *dfrParticleWeights[2][2] = {{NULL}};
1930 TList *dfrEventWeights[2][2][2] = {{{NULL}}};
1931 TList *dfrCorrections[2][2][2][2] = {{{{NULL}}}};
1932 TList *diffFlowFinalCorrelations[2][2][2] = {{{NULL}}};
1933 TList *diffFlowFinalCorrections[2][2][2] = {{{NULL}}};
1934 TList *diffFlowFinalCovariances[2][2][2] = {{{NULL}}};
1935 TList *diffFlowFinalCumulants[2][2][2][2] = {{{{NULL}}}};
1936 TList *diffFlowFinalFlow[2][2][2][2] = {{{{NULL}}}};
1938 if(diffFlowListResults)
1940 for(Int_t t=0;t<2;t++)
1942 dfrType[t] = dynamic_cast<TList*>(diffFlowListResults->FindObject(typeFlag[t].Data()));
1945 for(Int_t pW=0;pW<(1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights));pW++)
1947 dfrParticleWeights[t][pW] = dynamic_cast<TList*>(dfrType[t]->FindObject(Form("%s, pWeights %s",typeFlag[t].Data(),pWeightsFlag[pW].Data())));
1948 if(dfrParticleWeights[t][pW])
1950 for(Int_t eW=0;eW<2;eW++)
1952 dfrEventWeights[t][pW][eW] = dynamic_cast<TList*>(dfrParticleWeights[t][pW]->FindObject(Form("%s, pWeights %s, eWeights %s",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));
1953 if(dfrEventWeights[t][pW][eW])
1955 diffFlowFinalCorrelations[t][pW][eW] = dynamic_cast<TList*>(dfrEventWeights[t][pW][eW]->FindObject(Form("Correlations (%s, pWeights %s, eWeights %s)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));
1956 diffFlowFinalCorrections[t][pW][eW] = dynamic_cast<TList*>(dfrEventWeights[t][pW][eW]->FindObject(Form("Corrections (%s, pWeights %s, eWeights %s)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));
1957 diffFlowFinalCovariances[t][pW][eW] = dynamic_cast<TList*>(dfrEventWeights[t][pW][eW]->FindObject(Form("Covariances (%s, pWeights %s, eWeights %s)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data())));
1958 for(Int_t nua=0;nua<2;nua++)
1960 dfrCorrections[t][pW][eW][nua] = dynamic_cast<TList*>(dfrEventWeights[t][pW][eW]->FindObject(Form("%s, pWeights %s, eWeights %s, %s for NUA",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data())));
1961 if(dfrCorrections[t][pW][eW][nua])
1963 diffFlowFinalCumulants[t][pW][eW][nua] = dynamic_cast<TList*>(dfrCorrections[t][pW][eW][nua]->FindObject(Form("Cumulants (%s, pWeights %s, eWeights %s, %s for NUA)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data())));
1964 diffFlowFinalFlow[t][pW][eW][nua] = dynamic_cast<TList*>(dfrCorrections[t][pW][eW][nua]->FindObject(Form("Differential Flow (%s, pWeights %s, eWeights %s, %s for NUA)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data())));
1965 } else // to if(dfrCorrections[t][pW][eW][nua])
1967 cout<<"WARNING: dfrCorrections[t][pW][eW][nua] is NULL in AFAWQC::GOH() !!!!"<<endl;
1968 cout<<"t = "<<t<<endl;
1969 cout<<"pW = "<<pW<<endl;
1970 cout<<"eW = "<<eW<<endl;
1971 cout<<"nua = "<<nua<<endl;
1973 } // end of for(Int_t nua=0;nua<2;nua++)
1974 } else // to if(dfrEventWeights[t][pW][eW])
1976 cout<<"WARNING: dfrEventWeights[t][pW][eW] is NULL in AFAWQC::GOH() !!!!"<<endl;
1977 cout<<"t = "<<t<<endl;
1978 cout<<"pW = "<<pW<<endl;
1979 cout<<"eW = "<<eW<<endl;
1981 } // end of for(Int_t eW=0;eW<2;eW++)
1982 } else // to if(dfrParticleWeights[t][pW])
1984 cout<<"WARNING: dfrParticleWeights[t][pW] is NULL in AFAWQC::GOH() !!!!"<<endl;
1985 cout<<"t = "<<t<<endl;
1986 cout<<"pW = "<<pW<<endl;
1988 } // end of for(Int_t pW=0;pW<(1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights));pW++)
1989 } else // to if(dfrType[t])
1991 cout<<"WARNING: dfrType[t] is NULL in AFAWQC::GOH() !!!!"<<endl;
1992 cout<<"t = "<<t<<endl;
1994 } // end of for(Int_t t=0;t<2;t++)
1995 } else // to if(diffFlowListResults)
1997 cout<<"WARNING: diffFlowListResults is NULL in AFAWQC::GOH() !!!!"<<endl;
2000 TH2D *finalCorrelations2D[2][2][2][4] = {{{{NULL}}}};
2001 TH1D *finalCorrelations1D[2][2][2][2][4] = {{{{{NULL}}}}};
2002 TH2D *finalCumulants2D[2][2][2][2][4] = {{{{{NULL}}}}};
2003 TH1D *finalCumulantsPt[2][2][2][2][4] = {{{{{NULL}}}}};
2004 TH1D *finalCumulantsEta[2][2][2][2][4] = {{{{{NULL}}}}};
2005 TH2D *finalCorrections2D[2][2][2][4] = {{{{NULL}}}};
2006 TH1D *finalCorrections1D[2][2][2][2][4] = {{{{{NULL}}}}};
2007 TH2D *finalCovariances2D[2][2][2][4] = {{{{NULL}}}};
2008 TH1D *finalCovariances1D[2][2][2][2][4] = {{{{{NULL}}}}};
2009 TH2D *finalFlow2D[2][2][2][2][4] = {{{{{NULL}}}}};
2010 TH1D *finalFlowPt[2][2][2][2][4] = {{{{{NULL}}}}};
2011 TH1D *finalFlowEta[2][2][2][2][4] = {{{{{NULL}}}}};
2012 TH2D *nonEmptyBins2D[2] = {NULL};
2013 TH1D *nonEmptyBins1D[2][2] = {{NULL}};
2015 for(Int_t t=0;t<2;t++)
2018 nonEmptyBins2D[t] = dynamic_cast<TH2D*>(dfrType[t]->FindObject(Form("%s, (p_{t},#eta)",typeFlag[t].Data())));
2019 if(nonEmptyBins2D[t])
2021 this->SetNonEmptyBins2D(nonEmptyBins2D[t],t);
2024 cout<<"WARNING: nonEmptyBins2D[t] is NULL in AFAWQC::GOH() !!!!"<<endl;
2025 cout<<"t = "<<t<<endl;
2028 for(Int_t pe=0;pe<2;pe++)
2030 nonEmptyBins1D[t][pe] = dynamic_cast<TH1D*>(dfrType[t]->FindObject(Form("%s, %s",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
2031 if(nonEmptyBins1D[t][pe])
2033 this->SetNonEmptyBins1D(nonEmptyBins1D[t][pe],t,pe);
2036 cout<<"WARNING: nonEmptyBins1D[t][pe] is NULL in AFAWQC::GOH() !!!!"<<endl;
2037 cout<<"t = "<<t<<endl;
2038 cout<<"pe = "<<pe<<endl;
2042 for(Int_t pW=0;pW<(1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights));pW++)
2044 for(Int_t eW=0;eW<2;eW++)
2047 if(diffFlowFinalCorrelations[t][pW][eW])
2049 for(Int_t correlationIndex=0;correlationIndex<4;correlationIndex++)
2052 finalCorrelations2D[t][pW][eW][correlationIndex] = dynamic_cast<TH2D*>(diffFlowFinalCorrelations[t][pW][eW]->FindObject(Form("%s, (p_{t},#eta)",correlationName[correlationIndex].Data())));
2053 if(finalCorrelations2D[t][pW][eW][correlationIndex])
2055 this->SetFinalCorrelations2D(finalCorrelations2D[t][pW][eW][correlationIndex],t,pW,eW,correlationIndex);
2058 cout<<"WARNING: finalCorrelations2D[t][pW][eW][correlationIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
2059 cout<<"t = "<<t<<endl;
2060 cout<<"pW = "<<pW<<endl;
2061 cout<<"eW = "<<eW<<endl;
2062 cout<<"ci = "<<correlationIndex<<endl;
2065 for(Int_t pe=0;pe<2;pe++)
2069 finalCorrelations1D[t][pW][eW][pe][correlationIndex] = dynamic_cast<TH1D*>(diffFlowFinalCorrelations[t][pW][eW]->FindObject(Form("%s, (p_{t})",correlationName[correlationIndex].Data())));
2073 finalCorrelations1D[t][pW][eW][pe][correlationIndex] = dynamic_cast<TH1D*>(diffFlowFinalCorrelations[t][pW][eW]->FindObject(Form("%s, (#eta)",correlationName[correlationIndex].Data())));
2075 if(finalCorrelations1D[t][pW][eW][pe][correlationIndex])
2077 this->SetFinalCorrelations1D(finalCorrelations1D[t][pW][eW][pe][correlationIndex],t,pW,eW,pe,correlationIndex);
2080 cout<<"WARNING: finalCorrelations1D[t][pW][eW][pe][correlationIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
2081 cout<<"t = "<<t<<endl;
2082 cout<<"pW = "<<pW<<endl;
2083 cout<<"eW = "<<eW<<endl;
2084 cout<<"pe = "<<pe<<endl;
2085 cout<<"ci = "<<correlationIndex<<endl;
2087 } // end of for(Int_t pe=0;pe<2;pe++)
2088 } // end of for(Int_t correlationIndex=0;correlationIndex<4;correlationIndex++)
2089 } else // to if(diffFlowFinalCorrelations[t][pW][eW])
2091 cout<<"WARNING: diffFlowFinalCorrelations[t][pW] is NULL in AFAWQC::GOH() !!!!"<<endl;
2092 cout<<"t = "<<t<<endl;
2093 cout<<"pW = "<<pW<<endl;
2094 cout<<"eW = "<<eW<<endl;
2097 if(diffFlowFinalCorrections[t][pW][eW])
2099 for(Int_t correctionIndex=0;correctionIndex<4;correctionIndex++)
2102 finalCorrections2D[t][pW][eW][correctionIndex] = dynamic_cast<TH2D*>(diffFlowFinalCorrections[t][pW][eW]->FindObject(Form("%s, (p_{t},#eta)",correctionName[correctionIndex].Data())));
2103 if(finalCorrections2D[t][pW][eW][correctionIndex])
2105 this->SetFinalCorrections2D(finalCorrections2D[t][pW][eW][correctionIndex],t,pW,eW,correctionIndex);
2108 cout<<"WARNING: finalCorrections2D[t][pW][eW][correctionIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
2109 cout<<"t = "<<t<<endl;
2110 cout<<"pW = "<<pW<<endl;
2111 cout<<"eW = "<<eW<<endl;
2112 cout<<"ci = "<<correctionIndex<<endl;
2115 for(Int_t pe=0;pe<2;pe++)
2119 finalCorrections1D[t][pW][eW][pe][correctionIndex] = dynamic_cast<TH1D*>(diffFlowFinalCorrections[t][pW][eW]->FindObject(Form("%s, (p_{t})",correctionName[correctionIndex].Data())));
2123 finalCorrections1D[t][pW][eW][pe][correctionIndex] = dynamic_cast<TH1D*>(diffFlowFinalCorrections[t][pW][eW]->FindObject(Form("%s, (#eta)",correctionName[correctionIndex].Data())));
2125 if(finalCorrections1D[t][pW][eW][pe][correctionIndex])
2127 this->SetFinalCorrections1D(finalCorrections1D[t][pW][eW][pe][correctionIndex],t,pW,eW,pe,correctionIndex);
2130 cout<<"WARNING: finalCorrections1D[t][pW][eW][pe][correctionIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
2131 cout<<"t = "<<t<<endl;
2132 cout<<"pW = "<<pW<<endl;
2133 cout<<"eW = "<<eW<<endl;
2134 cout<<"pe = "<<pe<<endl;
2135 cout<<"ci = "<<correctionIndex<<endl;
2137 } // end of for(Int_t pe=0;pe<2;pe++)
2138 } // end of for(Int_t correctionIndex=0;correctionIndex<4;correctionIndex++)
2139 } else // to if(diffFlowFinalCorrections[t][pW][eW])
2141 cout<<"WARNING: diffFlowFinalCorrections[t][pW][eW] is NULL in AFAWQC::GOH() !!!!"<<endl;
2142 cout<<"t = "<<t<<endl;
2143 cout<<"pW = "<<pW<<endl;
2144 cout<<"eW = "<<eW<<endl;
2147 if(diffFlowFinalCovariances[t][pW][eW])
2149 for(Int_t covarianceIndex=0;covarianceIndex<4;covarianceIndex++)
2152 finalCovariances2D[t][pW][eW][covarianceIndex] = dynamic_cast<TH2D*>(diffFlowFinalCovariances[t][pW][eW]->FindObject(Form("%s, (p_{t},#eta)",covarianceName[covarianceIndex].Data())));
2153 if(finalCovariances2D[t][pW][eW][covarianceIndex])
2155 this->SetFinalCovariances2D(finalCovariances2D[t][pW][eW][covarianceIndex],t,pW,eW,covarianceIndex);
2158 cout<<"WARNING: finalCovariances2D[t][pW][eW][nua][covarianceIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
2159 cout<<"t = "<<t<<endl;
2160 cout<<"pW = "<<pW<<endl;
2161 cout<<"eW = "<<eW<<endl;
2162 cout<<"ci = "<<covarianceIndex<<endl;
2165 for(Int_t pe=0;pe<2;pe++)
2169 finalCovariances1D[t][pW][eW][pe][covarianceIndex] = dynamic_cast<TH1D*>(diffFlowFinalCovariances[t][pW][eW]->FindObject(Form("%s, (p_{t})",covarianceName[covarianceIndex].Data())));
2173 finalCovariances1D[t][pW][eW][pe][covarianceIndex] = dynamic_cast<TH1D*>(diffFlowFinalCovariances[t][pW][eW]->FindObject(Form("%s, (#eta)",covarianceName[covarianceIndex].Data())));
2175 if(finalCovariances1D[t][pW][eW][pe][covarianceIndex])
2177 this->SetFinalCovariances1D(finalCovariances1D[t][pW][eW][pe][covarianceIndex],t,pW,eW,pe,covarianceIndex);
2180 cout<<"WARNING: finalCovariances1D[t][pW][eW][pe][covarianceIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
2181 cout<<"t = "<<t<<endl;
2182 cout<<"pW = "<<pW<<endl;
2183 cout<<"eW = "<<eW<<endl;
2184 cout<<"pe = "<<pe<<endl;
2185 cout<<"ci = "<<covarianceIndex<<endl;
2187 } // end of for(Int_t pe=0;pe<2;pe++)
2188 } // end of for(Int_t covarianceIndex=0;covarianceIndex<4;covarianceIndex++)
2189 } else // to if(diffFlowFinalCovariances[t][pW][eW])
2191 cout<<"WARNING: diffFlowFinalCovariances[t][pW][eW] is NULL in AFAWQC::GOH() !!!!"<<endl;
2192 cout<<"t = "<<t<<endl;
2193 cout<<"pW = "<<pW<<endl;
2194 cout<<"eW = "<<eW<<endl;
2197 for(Int_t nua=0;nua<2;nua++)
2200 if(diffFlowFinalCumulants[t][pW][eW][nua])
2202 for(Int_t cumulantIndex=0;cumulantIndex<4;cumulantIndex++)
2205 finalCumulants2D[t][pW][eW][nua][cumulantIndex] = dynamic_cast<TH2D*>(diffFlowFinalCumulants[t][pW][eW][nua]->FindObject(Form("%s, (p_{t},#eta)",cumulantName[cumulantIndex].Data())));
2206 if(finalCumulants2D[t][pW][eW][nua][cumulantIndex])
2208 this->SetFinalCumulants2D(finalCumulants2D[t][pW][eW][nua][cumulantIndex],t,pW,eW,nua,cumulantIndex);
2211 cout<<"WARNING: finalCumulants2D[t][pW][eW][nua][cumulantIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
2212 cout<<"t = "<<t<<endl;
2213 cout<<"pW = "<<pW<<endl;
2214 cout<<"eW = "<<eW<<endl;
2215 cout<<"nua = "<<nua<<endl;
2216 cout<<"ci = "<<cumulantIndex<<endl;
2219 finalCumulantsPt[t][pW][eW][nua][cumulantIndex] = dynamic_cast<TH1D*>(diffFlowFinalCumulants[t][pW][eW][nua]->FindObject(Form("%s, (p_{t})",cumulantName[cumulantIndex].Data())));
2220 if(finalCumulantsPt[t][pW][eW][nua][cumulantIndex])
2222 this->SetFinalCumulantsPt(finalCumulantsPt[t][pW][eW][nua][cumulantIndex],t,pW,eW,nua,cumulantIndex);
2225 cout<<"WARNING: finalCumulantsPt[t][pW][eW][nua][cumulantIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
2226 cout<<"t = "<<t<<endl;
2227 cout<<"pW = "<<pW<<endl;
2228 cout<<"eW = "<<eW<<endl;
2229 cout<<"nua = "<<nua<<endl;
2230 cout<<"ci = "<<cumulantIndex<<endl;
2233 finalCumulantsEta[t][pW][eW][nua][cumulantIndex] = dynamic_cast<TH1D*>(diffFlowFinalCumulants[t][pW][eW][nua]->FindObject(Form("%s, (#eta)",cumulantName[cumulantIndex].Data())));
2234 if(finalCumulantsEta[t][pW][eW][nua][cumulantIndex])
2236 this->SetFinalCumulantsEta(finalCumulantsEta[t][pW][eW][nua][cumulantIndex],t,pW,eW,nua,cumulantIndex);
2239 cout<<"WARNING: finalCumulantsEta[t][pW][eW][nua][cumulantIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
2240 cout<<"t = "<<t<<endl;
2241 cout<<"pW = "<<pW<<endl;
2242 cout<<"eW = "<<eW<<endl;
2243 cout<<"nua = "<<nua<<endl;
2244 cout<<"ci = "<<cumulantIndex<<endl;
2246 } // end of for(Int_t cumulantIndex=0;cumulantIndex<4;cumulantIndex++)
2247 } else // to if(diffFlowFinalCumulants[t][pW][eW][nua])
2249 cout<<"WARNING: diffFlowFinalCumulants[t][pW][eW][nua] is NULL in AFAWQC::GOH() !!!!"<<endl;
2250 cout<<"t = "<<t<<endl;
2251 cout<<"pW = "<<pW<<endl;
2252 cout<<"eW = "<<eW<<endl;
2253 cout<<"nua = "<<nua<<endl;
2256 if(diffFlowFinalFlow[t][pW][eW][nua])
2258 for(Int_t flowIndex=0;flowIndex<4;flowIndex++)
2261 finalFlow2D[t][pW][eW][nua][flowIndex] = dynamic_cast<TH2D*>(diffFlowFinalFlow[t][pW][eW][nua]->FindObject(Form("%s, (p_{t},#eta)",flowName[flowIndex].Data())));
2262 if(finalFlow2D[t][pW][eW][nua][flowIndex])
2264 this->SetFinalFlow2D(finalFlow2D[t][pW][eW][nua][flowIndex],t,pW,eW,nua,flowIndex);
2267 cout<<"WARNING: finalFlow2D[t][pW][eW][nua][flowIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
2268 cout<<"t = "<<t<<endl;
2269 cout<<"pW = "<<pW<<endl;
2270 cout<<"eW = "<<eW<<endl;
2271 cout<<"nua = "<<nua<<endl;
2272 cout<<"ci = "<<flowIndex<<endl;
2275 finalFlowPt[t][pW][eW][nua][flowIndex] = dynamic_cast<TH1D*>(diffFlowFinalFlow[t][pW][eW][nua]->FindObject(Form("%s, (p_{t})",flowName[flowIndex].Data())));
2276 if(finalFlowPt[t][pW][eW][nua][flowIndex])
2278 this->SetFinalFlowPt(finalFlowPt[t][pW][eW][nua][flowIndex],t,pW,eW,nua,flowIndex);
2281 cout<<"WARNING: finalFlow1D[t][pW][nua][flowIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
2282 cout<<"t = "<<t<<endl;
2283 cout<<"pW = "<<pW<<endl;
2284 cout<<"eW = "<<eW<<endl;
2285 cout<<"nua = "<<nua<<endl;
2286 cout<<"ci = "<<flowIndex<<endl;
2289 finalFlowEta[t][pW][eW][nua][flowIndex] = dynamic_cast<TH1D*>(diffFlowFinalFlow[t][pW][eW][nua]->FindObject(Form("%s, (#eta)",flowName[flowIndex].Data())));
2290 if(finalFlowEta[t][pW][eW][nua][flowIndex])
2292 this->SetFinalFlowEta(finalFlowEta[t][pW][eW][nua][flowIndex],t,pW,eW,nua,flowIndex);
2295 cout<<"WARNING: finalFlow1D[t][pW][nua][flowIndex] is NULL in AFAWQC::GOH() !!!!"<<endl;
2296 cout<<"t = "<<t<<endl;
2297 cout<<"pW = "<<pW<<endl;
2298 cout<<"eW = "<<eW<<endl;
2299 cout<<"nua = "<<nua<<endl;
2300 cout<<"ci = "<<flowIndex<<endl;
2302 } // end of for(Int_t flowIndex=0;flowIndex<4;flowIndex++)
2303 } else // to if(diffFlowFinalFlow[t][pW][eW][nua])
2305 cout<<"WARNING: diffFlowFinalFlow[t][pW][eW][nua] is NULL in AFAWQC::GOH() !!!!"<<endl;
2306 cout<<"t = "<<t<<endl;
2307 cout<<"pW = "<<pW<<endl;
2308 cout<<"eW = "<<eW<<endl;
2309 cout<<"nua = "<<nua<<endl;
2311 } // end of for(Int_t nua=0;nua<2;nua++)
2312 } // end of for(Int_t eW=0;eW<2;eW++)
2313 } // end of for(Int_t pW=0;pW<(1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights));pW++)
2314 } // end of for(Int_t t=0;t<2;t++)
2316 // x.) nested loops:
2317 TList *nestedLoopsList = dynamic_cast<TList*>(outputListHistos->FindObject("Nested Loops"));
2318 if(nestedLoopsList) this->SetNestedLoopsList(nestedLoopsList);
2319 TProfile *evaluateNestedLoops = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fEvaluateNestedLoops"));
2320 Bool_t bEvaluateNestedLoopsForIntFlow = kFALSE;
2321 Bool_t bEvaluateNestedLoopsForDiffFlow = kFALSE;
2322 if(evaluateNestedLoops)
2324 this->SetEvaluateNestedLoops(evaluateNestedLoops);
2325 bEvaluateNestedLoopsForIntFlow = (Int_t)evaluateNestedLoops->GetBinContent(1);
2326 bEvaluateNestedLoopsForDiffFlow = (Int_t)evaluateNestedLoops->GetBinContent(2);
2329 if(bEvaluateNestedLoopsForIntFlow)
2331 TProfile *directCorrelations = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrelation"));
2332 if(directCorrelations) this->SetDirectCorrelations(directCorrelations);
2333 TProfile *directCorrectionsCos = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrectionsCos"));
2334 if(directCorrectionsCos) this->SetDirectCorrectionsCos(directCorrectionsCos);
2335 TProfile *directCorrectionsSin = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrectionsSin"));
2336 if(directCorrectionsSin) this->SetDirectCorrectionsSin(directCorrectionsSin);
2337 if(bUsePhiWeights||bUsePtWeights||bUseEtaWeights)
2339 TProfile *directCorrelationsW = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrelationW"));
2340 if(directCorrelationsW) this->SetDirectCorrelationsW(directCorrelationsW);
2341 TProfile *directCorrectionsCosW = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrectionsCosW"));
2342 if(directCorrectionsCosW) this->SetDirectCorrectionsCosW(directCorrectionsCosW);
2343 TProfile *directCorrectionsSinW = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrectionsSinW"));
2344 if(directCorrectionsSinW) this->SetDirectCorrectionsSinW(directCorrectionsSinW);
2348 if(bEvaluateNestedLoopsForDiffFlow)
2350 TProfile *directCorrelationsDiffFlow = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrelationsDiffFlow"));
2351 if(directCorrelationsDiffFlow) this->SetDirectCorrelationsDiffFlow(directCorrelationsDiffFlow);
2352 TProfile *directCorrectionsDiffFlowCos = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrectionsDiffFlowCos"));
2353 if(directCorrectionsDiffFlowCos) this->SetDirectCorrectionsDiffFlowCos(directCorrectionsDiffFlowCos);
2354 TProfile *directCorrectionsDiffFlowSin = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrectionsDiffFlowSin"));
2355 if(directCorrectionsDiffFlowSin) this->SetDirectCorrectionsDiffFlowSin(directCorrectionsDiffFlowSin);
2356 if(bUsePhiWeights||bUsePtWeights||bUseEtaWeights)
2358 TProfile *directCorrelationsDiffFlowW = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrelationsDiffFlowW"));
2359 if(directCorrelationsDiffFlowW) this->SetDirectCorrelationsDiffFlowW(directCorrelationsDiffFlowW);
2360 TProfile *directCorrectionsDiffFlowCosW = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrectionsDiffFlowCosW"));
2361 if(directCorrectionsDiffFlowCosW) this->SetDirectCorrectionsDiffFlowCosW(directCorrectionsDiffFlowCosW);
2362 TProfile *directCorrectionsDiffFlowSinW = dynamic_cast<TProfile*>(nestedLoopsList->FindObject("fDirectCorrectionsDiffFlowSinW"));
2363 if(directCorrectionsDiffFlowSinW) this->SetDirectCorrectionsDiffFlowSinW(directCorrectionsDiffFlowSinW);
2371 //================================================================================================================================
2374 TProfile* AliFlowAnalysisWithQCumulants::MakePtProjection(TProfile2D *profilePtEta) const
2376 // project 2D profile onto pt axis to get 1D profile
2378 Int_t nBinsPt = profilePtEta->GetNbinsX();
2379 Double_t dPtMin = (profilePtEta->GetXaxis())->GetXmin();
2380 Double_t dPtMax = (profilePtEta->GetXaxis())->GetXmax();
2382 Int_t nBinsEta = profilePtEta->GetNbinsY();
2384 TProfile *profilePt = new TProfile("","",nBinsPt,dPtMin,dPtMax);
2386 for(Int_t p=1;p<=nBinsPt;p++)
2388 Double_t contentPt = 0.;
2389 Double_t entryPt = 0.;
2390 Double_t spreadPt = 0.;
2394 for(Int_t e=1;e<=nBinsEta;e++)
2396 contentPt += (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)))
2397 * (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
2398 entryPt += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
2400 sum1 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)))
2401 * (pow(profilePtEta->GetBinError(profilePtEta->GetBin(p,e)),2.)
2402 + pow(profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)),2.));
2403 sum2 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
2404 sum3 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)))
2405 * (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)));
2407 if(sum2>0. && sum1/sum2-pow(sum3/sum2,2.) > 0.)
2409 spreadPt = pow(sum1/sum2-pow(sum3/sum2,2.),0.5);
2411 profilePt->SetBinContent(p,contentPt);
2412 profilePt->SetBinEntries(p,entryPt);
2414 profilePt->SetBinError(p,spreadPt);
2421 } // end of TProfile* AliFlowAnalysisWithQCumulants::MakePtProjection(TProfile2D *profilePtEta)
2424 //================================================================================================================================
2427 TProfile* AliFlowAnalysisWithQCumulants::MakeEtaProjection(TProfile2D *profilePtEta) const
2429 // project 2D profile onto eta axis to get 1D profile
2431 Int_t nBinsEta = profilePtEta->GetNbinsY();
2432 Double_t dEtaMin = (profilePtEta->GetYaxis())->GetXmin();
2433 Double_t dEtaMax = (profilePtEta->GetYaxis())->GetXmax();
2435 Int_t nBinsPt = profilePtEta->GetNbinsX();
2437 TProfile *profileEta = new TProfile("","",nBinsEta,dEtaMin,dEtaMax);
2439 for(Int_t e=1;e<=nBinsEta;e++)
2441 Double_t contentEta = 0.;
2442 Double_t entryEta = 0.;
2443 for(Int_t p=1;p<=nBinsPt;p++)
2445 contentEta += (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)))
2446 * (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
2447 entryEta += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
2449 profileEta->SetBinContent(e,contentEta);
2450 profileEta->SetBinEntries(e,entryEta);
2455 } // end of TProfile* AliFlowAnalysisWithQCumulants::MakeEtaProjection(TProfile2D *profilePtEta)
2458 //================================================================================================================================
2461 void AliFlowAnalysisWithQCumulants::CalculateFinalCorrectionsForNonUniformAcceptanceForCumulantsForIntFlow(Bool_t useParticleWeights, TString eventWeights)
2463 // calculate final corrections for non-uniform acceptance for QC{2}, QC{4}, QC{6} and QC{8}
2465 // corrections for non-uniform acceptance (NUA) are stored in histogram fCorrectionsForNUA,
2466 // binning of fCorrectionsForNUA is organized as follows:
2468 // 1st bin: correction to QC{2}
2469 // 2nd bin: correction to QC{4}
2470 // 3rd bin: correction to QC{6}
2471 // 4th bin: correction to QC{8}
2474 Int_t pW = (Int_t)(useParticleWeights);
2478 if(eventWeights == "exact")
2483 for(Int_t sc=0;sc<2;sc++) // sin or cos terms flag
2485 if(!(fQCorrelations[pW][eW] && fQCorrections[pW][eW][sc] && fCorrections[pW][eW]))
2487 cout<<"WARNING: fQCorrelations[pW][eW] && fQCorrections[pW][eW][sc] && fCorrections[pW][eW] is NULL in AFAWQC::CFCFNUAFIF() !!!!"<<endl;
2488 cout<<"pW = "<<pW<<endl;
2489 cout<<"eW = "<<eW<<endl;
2490 cout<<"sc = "<<sc<<endl;
2495 // measured 2-, 4-, 6- and 8-particle azimuthal correlations (biased with non-uniform acceptance!):
2496 Double_t two = fQCorrelations[pW][eW]->GetBinContent(1); // <<2>>
2497 //Double_t four = fQCorrelations[pW][eW]->GetBinContent(11); // <<4>>
2498 //Double_t six = fQCorrelations[pW][eW]->GetBinContent(24); // <<6>>
2499 //Double_t eight = fQCorrelations[pW][eW]->GetBinContent(31); // <<8>>
2501 // correction terms to QC{2}:
2502 // <<cos(n*phi1)>>^2
2503 Double_t two1stTerm = pow(fQCorrections[pW][eW][1]->GetBinContent(1),2);
2504 // <<sin(n*phi1)>>^2
2505 Double_t two2ndTerm = pow(fQCorrections[pW][eW][0]->GetBinContent(1),2);
2506 // final corrections for non-uniform acceptance to QC{2}:
2507 Double_t correctionQC2 = -1.*two1stTerm-1.*two2ndTerm;
2508 fCorrections[pW][eW]->SetBinContent(1,correctionQC2);
2510 // correction terms to QC{4}:
2511 // <<cos(n*phi1)>> <<cos(n*(phi1-phi2-phi3))>>
2512 Double_t four1stTerm = fQCorrections[pW][eW][1]->GetBinContent(1)*fQCorrections[pW][eW][1]->GetBinContent(3);
2513 // <<sin(n*phi1)>> <<sin(n*(phi1-phi2-phi3))>>
2514 Double_t four2ndTerm = fQCorrections[pW][eW][0]->GetBinContent(1)*fQCorrections[pW][eW][0]->GetBinContent(3);
2515 // <<cos(n*(phi1+phi2))>>^2
2516 Double_t four3rdTerm = pow(fQCorrections[pW][eW][1]->GetBinContent(2),2);
2517 // <<sin(n*(phi1+phi2))>>^2
2518 Double_t four4thTerm = pow(fQCorrections[pW][eW][0]->GetBinContent(2),2);
2519 // <<cos(n*(phi1+phi2))>> (<<cos(n*phi1)>>^2 - <<sin(n*phi1)>>^2)
2520 Double_t four5thTerm = fQCorrections[pW][eW][1]->GetBinContent(2)
2521 * (pow(fQCorrections[pW][eW][1]->GetBinContent(1),2)-pow(fQCorrections[pW][eW][0]->GetBinContent(1),2));
2522 // <<sin(n*(phi1+phi2))>> <<cos(n*phi1)>> <<sin(n*phi1)>>
2523 Double_t four6thTerm = fQCorrections[pW][eW][0]->GetBinContent(2)
2524 * fQCorrections[pW][eW][1]->GetBinContent(1)
2525 * fQCorrections[pW][eW][0]->GetBinContent(1);
2526 // <<cos(n*(phi1-phi2))>> (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2)
2527 Double_t four7thTerm = two*(pow(fQCorrections[pW][eW][1]->GetBinContent(1),2)+pow(fQCorrections[pW][eW][0]->GetBinContent(1),2));
2528 // (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2)^2
2529 Double_t four8thTerm = pow(pow(fQCorrections[pW][eW][1]->GetBinContent(1),2)+pow(fQCorrections[pW][eW][0]->GetBinContent(1),2),2);
2530 // final correction to QC{4}:
2531 Double_t correctionQC4 = -4.*four1stTerm+4.*four2ndTerm-four3rdTerm-four4thTerm
2532 + 4.*four5thTerm+8.*four6thTerm+8.*four7thTerm-6.*four8thTerm;
2533 fCorrections[pW][eW]->SetBinContent(2,correctionQC4);
2535 // ... to be improved (continued for 6th and 8th order)
2537 } // end of AliFlowAnalysisWithQCumulants::CalculateFinalCorrectionsForNonUniformAcceptanceForCumulantsForIntFlow(Bool_t useParticleWeights, TString eventWeights)
2540 //================================================================================================================================
2543 void AliFlowAnalysisWithQCumulants::CalculateFinalCorrectionsForNonUniformAcceptanceForDifferentialFlow(Bool_t useParticleWeights,TString type)
2546 useParticleWeights=kFALSE;
2549 // calculate final corrections due to non-uniform acceptance of the detector to reduced multi-particle correlations
2551 if(!(useParticleWeights))
2555 // **** corrections for non-uniform acceptance for 2nd order QC' for POI's ****
2557 // 1st term: <<cos(n*psi)>><<cos(n*phi)>>:
2558 if(fCorrectionsCosP1nPsiPtEtaPOI && fQCorrectionsCos)
2561 if(f2pFinalCorrectionsForNUAPtEtaPOI) f2pFinalCorrectionsForNUAPtEtaPOI->Reset(); // to be improved
2562 TH2D *correctionPtEta1stTerm = new TH2D(*(fCorrectionsCosP1nPsiPtEtaPOI->ProjectionXY("","e")));
2563 correctionPtEta1stTerm->Scale(fQCorrectionsCos->GetBinContent(1)); // to be improved: are errors propagated correctly here?
2564 if(f2pFinalCorrectionsForNUAPtEtaPOI) f2pFinalCorrectionsForNUAPtEtaPOI->Add(correctionPtEta1stTerm); // to be improved (if condition goes somewhere else)
2565 delete correctionPtEta1stTerm;
2567 if(f2pFinalCorrectionsForNUAPtPOI) f2pFinalCorrectionsForNUAPtPOI->Reset(); // to be improved
2568 TH1D *correctionPt1stTerm = new TH1D(*((this->MakePtProjection(fCorrectionsCosP1nPsiPtEtaPOI))->ProjectionX("","e"))); // to be improved: are errors propagated correctly here?
2569 correctionPt1stTerm->Scale(fQCorrectionsCos->GetBinContent(1)); // to be improved: are errors propagated correctly here?
2570 if(f2pFinalCorrectionsForNUAPtPOI) f2pFinalCorrectionsForNUAPtPOI->Add(correctionPt1stTerm); // to be improved (if condition goes somewhere else)
2571 delete correctionPt1stTerm;
2573 if(f2pFinalCorrectionsForNUAEtaPOI) f2pFinalCorrectionsForNUAEtaPOI->Reset(); // to be improved
2574 TH1D *correctionEta1stTerm = new TH1D(*((this->MakeEtaProjection(fCorrectionsCosP1nPsiPtEtaPOI))->ProjectionX("","e"))); // to be improved: are errors propagated correctly here?
2575 correctionEta1stTerm->Scale(fQCorrectionsCos->GetBinContent(1)); // to be improved: are errors propagated correctly here?
2576 if(f2pFinalCorrectionsForNUAEtaPOI) f2pFinalCorrectionsForNUAEtaPOI->Add(correctionEta1stTerm); // to be improved (if condition goes somewhere else)
2577 delete correctionEta1stTerm;
2580 cout<<"WARNING: (fCorrectionsCosP1nPsiPtEtaPOI && fQCorrectionsCos && f2pFinalCorrectionsForNUAPtEtaPOI) is NULL in QC::CFCFNUAFDF() !!!! "<<endl;
2581 cout<<" Corrections for non-uniform acceptance for differential flow are not correct."<<endl;
2584 // 2nd term: <<sin(n*psi)>><<sin(n*phi)>>:
2585 if(fCorrectionsSinP1nPsiPtEtaPOI && fQCorrectionsSin)
2588 TH2D *correctionPtEta2ndTerm = new TH2D(*(fCorrectionsSinP1nPsiPtEtaPOI->ProjectionXY("","e")));
2589 correctionPtEta2ndTerm->Scale(fQCorrectionsSin->GetBinContent(1)); // to be improved: are errors propagated correctly here?
2590 if(f2pFinalCorrectionsForNUAPtEtaPOI) f2pFinalCorrectionsForNUAPtEtaPOI->Add(correctionPtEta2ndTerm); // to be improved (if condition goes somewhere else)
2591 delete correctionPtEta2ndTerm;
2593 TH1D *correctionPt2ndTerm = new TH1D(*((this->MakePtProjection(fCorrectionsSinP1nPsiPtEtaPOI))->ProjectionX("","e"))); // to be improved: are errors propagated correctly here?
2594 correctionPt2ndTerm->Scale(fQCorrectionsSin->GetBinContent(1)); // to be improved: are errors propagated correctly here?
2595 if(f2pFinalCorrectionsForNUAPtPOI) f2pFinalCorrectionsForNUAPtPOI->Add(correctionPt2ndTerm); // to be improved (if condition goes somewhere else)
2596 delete correctionPt2ndTerm;
2598 TH1D *correctionEta2ndTerm = new TH1D(*((this->MakeEtaProjection(fCorrectionsSinP1nPsiPtEtaPOI))->ProjectionX("","e"))); // to be improved: are errors propagated correctly here?
2599 correctionEta2ndTerm->Scale(fQCorrectionsSin->GetBinContent(1)); // to be improved: are errors propagated correctly here?
2600 if(f2pFinalCorrectionsForNUAEtaPOI) f2pFinalCorrectionsForNUAEtaPOI->Add(correctionEta2ndTerm); // to be improved (if condition goes somewhere else)
2601 delete correctionEta2ndTerm;
2604 cout<<"WARNING: (fCorrectionsSinP1nPsiPtEtaPOI && fQCorrectionsSin) is NULL in QC::CFCFNUAFDF() !!!! "<<endl;
2605 cout<<" Corrections for non-uniform acceptance for differential flow are not correct."<<endl;
2607 } else if(type == "RP")
2609 // **** corrections for non-uniform acceptance for 2nd order QC' for RP's ****
2611 // 1st term: <<cos(n*psi)>><<cos(n*phi)>>:
2612 if(fCorrectionsCosP1nPsiPtEtaRP && fQCorrectionsCos)
2615 if(f2pFinalCorrectionsForNUAPtEtaRP) f2pFinalCorrectionsForNUAPtEtaRP->Reset(); // to be improved
2616 TH2D *correctionPtEta1stTerm = new TH2D(*(fCorrectionsCosP1nPsiPtEtaRP->ProjectionXY("","e")));
2617 correctionPtEta1stTerm->Scale(fQCorrectionsCos->GetBinContent(1)); // to be improved: are errors propagated correctly here?
2618 if(f2pFinalCorrectionsForNUAPtEtaRP) f2pFinalCorrectionsForNUAPtEtaRP->Add(correctionPtEta1stTerm); // to be improved (if condition goes somewhere else)
2619 delete correctionPtEta1stTerm;
2621 if(f2pFinalCorrectionsForNUAPtRP) f2pFinalCorrectionsForNUAPtRP->Reset(); // to be improved
2622 TH1D *correctionPt1stTerm = new TH1D(*((this->MakePtProjection(fCorrectionsCosP1nPsiPtEtaRP))->ProjectionX("","e"))); // to be improved: are errors propagated correctly here?
2623 correctionPt1stTerm->Scale(fQCorrectionsCos->GetBinContent(1)); // to be improved: are errors propagated correctly here?
2624 if(f2pFinalCorrectionsForNUAPtRP) f2pFinalCorrectionsForNUAPtRP->Add(correctionPt1stTerm); // to be improved (if condition goes somewhere else)
2625 delete correctionPt1stTerm;
2627 if(f2pFinalCorrectionsForNUAEtaRP) f2pFinalCorrectionsForNUAEtaRP->Reset(); // to be improved
2628 TH1D *correctionEta1stTerm = new TH1D(*((this->MakeEtaProjection(fCorrectionsCosP1nPsiPtEtaRP))->ProjectionX("","e"))); // to be improved: are errors propagated correctly here?
2629 correctionEta1stTerm->Scale(fQCorrectionsCos->GetBinContent(1)); // to be improved: are errors propagated correctly here?
2630 if(f2pFinalCorrectionsForNUAEtaRP) f2pFinalCorrectionsForNUAEtaRP->Add(correctionEta1stTerm); // to be improved (if condition goes somewhere else)
2631 delete correctionEta1stTerm;
2634 cout<<"WARNING: (fCorrectionsCosP1nPsiPtEtaRP && fQCorrectionsCos) is NULL in QC::CFCFNUAFDF() !!!! "<<endl;
2635 cout<<" Corrections for non-uniform acceptance for differential flow are not correct."<<endl;
2637 // 2nd term: <<sin(n*psi)>><<sin(n*phi)>>:
2638 if(fCorrectionsSinP1nPsiPtEtaRP && fQCorrectionsSin)
2641 TH2D *correctionPtEta2ndTerm = new TH2D(*(fCorrectionsSinP1nPsiPtEtaRP->ProjectionXY("","e")));
2642 correctionPtEta2ndTerm->Scale(fQCorrectionsSin->GetBinContent(1)); // to be improved: are errors propagated correctly here?
2643 if(f2pFinalCorrectionsForNUAPtEtaRP) f2pFinalCorrectionsForNUAPtEtaRP->Add(correctionPtEta2ndTerm); // to be improved (if condition goes somewhere else)
2644 delete correctionPtEta2ndTerm;
2646 TH1D *correctionPt2ndTerm = new TH1D(*((this->MakePtProjection(fCorrectionsSinP1nPsiPtEtaRP))->ProjectionX("","e"))); // to be improved: are errors propagated correctly here?
2647 correctionPt2ndTerm->Scale(fQCorrectionsSin->GetBinContent(1)); // to be improved: are errors propagated correctly here?
2648 if(f2pFinalCorrectionsForNUAPtRP) f2pFinalCorrectionsForNUAPtRP->Add(correctionPt2ndTerm); // to be improved (if condition goes somewhere else)
2649 delete correctionPt2ndTerm;
2651 TH1D *correctionEta2ndTerm = new TH1D(*((this->MakeEtaProjection(fCorrectionsSinP1nPsiPtEtaRP))->ProjectionX("","e"))); // to be improved: are errors propagated correctly here?
2652 correctionEta2ndTerm->Scale(fQCorrectionsSin->GetBinContent(1)); // to be improved: are errors propagated correctly here?
2653 if(f2pFinalCorrectionsForNUAEtaRP) f2pFinalCorrectionsForNUAEtaRP->Add(correctionEta2ndTerm); // to be improved (if condition goes somewhere else)
2654 delete correctionEta2ndTerm;
2657 cout<<"WARNING: (fCorrectionsSinP1nPsiPtEtaRP && fQCorrectionsSin) is NULL in QC::CFCFNUAFDF() !!!! "<<endl;
2658 cout<<" Corrections for non-uniform acceptance for differential flow are not correct."<<endl;
2660 } else // to else if(type == "RP")
2662 cout<<"WARNING: Type must be either POI or RP in QC::CFCFNUAFDF() !!!! "<<endl;
2663 cout<<" Corrections for non-uniform acceptance for differential flow were not calculated."<<endl;
2665 } else // to if(!(useParticleWeights))
2670 } // end of AliFlowAnalysisWithQCumulants::CalculateFinalCorrectionsForNonUniformAcceptanceForDifferentialFlow(Bool_t useParticleWeights,TString type)
2673 //==================================================================================================================================
2676 void AliFlowAnalysisWithQCumulants::CalculateFinalResultsForDifferentialFlow(
2677 TH2D *flowPtEta, TH1D *flowPt, TH1D *flowEta,
2678 TProfile2D *profile2ndPtEta, TProfile2D *profile4thPtEta,
2679 TProfile2D *profile6thPtEta, TProfile2D *profile8thPtEta)
2681 // calculate and store the final results for integrated flow
2683 TString *namePtEta = new TString();
2684 TString *type = new TString();
2685 TString *order2nd = new TString();
2686 TString *order4th = new TString();
2687 TString *order6th = new TString();
2688 TString *order8th = new TString();
2689 TString *pW = new TString();
2691 if(profile2ndPtEta) *namePtEta = profile2ndPtEta->GetName();
2692 if(namePtEta->Contains("POI")) *type = "POI";
2693 if(namePtEta->Contains("RP")) *type = "RP";
2694 if(namePtEta->Contains("W")) *pW = "W";
2695 if(namePtEta->Contains("2")) *order2nd = "2";
2696 if(profile4thPtEta) *namePtEta = profile4thPtEta->GetName();
2697 if(namePtEta->Contains("4")) *order4th = "4";
2699 if(profile6thPtEta) *namePtEta = profile6thPtEta->GetName();
2700 if(namePtEta->Contains("6")) *order6th = "6";
2702 if(profile8thPtEta) *namePtEta = profile8thPtEta->GetName();
2703 if(namePtEta->Contains("8")) *order8th = "8";
2705 TProfile *profile2ndPt = NULL;
2706 TProfile *profile4thPt = NULL;
2707 TProfile *profile6thPt = NULL;
2708 TProfile *profile8thPt = NULL;
2710 TProfile *profile2ndEta = NULL;
2711 TProfile *profile4thEta = NULL;
2712 TProfile *profile6thEta = NULL;
2713 TProfile *profile8thEta = NULL;
2715 if(*order2nd == "2")
2717 profile2ndPt = new TProfile(*(this->MakePtProjection(profile2ndPtEta)));
2718 profile2ndEta = new TProfile(*(this->MakeEtaProjection(profile2ndPtEta)));
2719 if(*order4th == "4")
2721 profile4thPt = new TProfile(*(this->MakePtProjection(profile4thPtEta)));
2722 profile4thEta = new TProfile(*(this->MakeEtaProjection(profile4thPtEta)));
2723 if(*order6th == "6")
2725 profile6thPt = new TProfile(*(this->MakePtProjection(profile6thPtEta)));
2726 profile6thEta = new TProfile(*(this->MakeEtaProjection(profile6thPtEta)));
2727 if(*order8th == "8")
2729 profile8thPt = new TProfile(*(this->MakePtProjection(profile8thPtEta)));
2730 profile8thEta = new TProfile(*(this->MakeEtaProjection(profile8thPtEta)));
2736 Int_t nBinsPt = profile2ndPt->GetNbinsX();
2737 Int_t nBinsEta = profile2ndEta->GetNbinsX();
2746 dV2 = fIntFlowResultsQC->GetBinContent(1);
2747 dV4 = fIntFlowResultsQC->GetBinContent(2);
2748 dV6 = fIntFlowResultsQC->GetBinContent(3);
2749 dV8 = fIntFlowResultsQC->GetBinContent(4);
2753 dV2 = fIntFlowResultsQCW->GetBinContent(1);
2754 dV4 = fIntFlowResultsQCW->GetBinContent(2);
2755 dV6 = fIntFlowResultsQCW->GetBinContent(3);
2756 dV8 = fIntFlowResultsQCW->GetBinContent(4);
2760 Double_t twoPrimePtEta = 0.; // <<2'>> (pt,eta)
2761 Double_t fourPrimePtEta = 0.; // <<4'>> (pt,eta)
2762 //Double_t sixPrimePtEta = 0.; // <<6'>> (pt,eta)
2763 //Double_t eightPrimePtEta = 0.; // <<8'>> (pt,eta)
2764 Double_t secondOrderDiffFlowCumulantPtEta = 0.; // d_n{2,Q} (pt,eta)
2765 Double_t fourthOrderDiffFlowCumulantPtEta = 0.; // d_n{4,Q} (pt,eta)
2766 //Double_t sixthOrderDiffFlowCumulantPtEta = 0.; // d_n{6,Q} (pt,eta)
2767 //Double_t eightOrderDiffFlowCumulantPtEta = 0.; // d_n{8,Q} (pt,eta)2nd
2768 Double_t dv2PtEta = 0.; // v'_n{2} (pt,eta)
2769 Double_t dv4PtEta = 0.; // v'_n{4} (pt,eta)
2770 //Double_t dv6PtEta = 0.; // v'_n{6} (pt,eta)
2771 //Double_t dv8PtEta = 0.; // v'_n{8} (pt,eta)
2774 Double_t twoPrimePt = 0.; // <<2'>> (pt)
2775 Double_t fourPrimePt = 0.; // <<4'>> (pt)
2776 //Double_t sixPrimePt = 0.; // <<6'>> (pt)
2777 //Double_t eightPrimePt = 0.; // <<8'>> (pt)
2778 Double_t secondOrderDiffFlowCumulantPt = 0.; // d_n{2,Q} (pt)
2779 Double_t fourthOrderDiffFlowCumulantPt = 0.; // d_n{4,Q} (pt)
2780 //Double_t sixthOrderDiffFlowCumulantPt = 0.; // d_n{6,Q} (pt)
2781 //Double_t eightOrderDiffFlowCumulantPt = 0.; // d_n{8,Q} (pt)
2782 Double_t dv2Pt = 0.; // v'_n{2} (pt)
2783 Double_t dv4Pt = 0.; // v'_n{4} (pt)
2784 //Double_t dv6Pt = 0.; // v'_n{6} (pt)
2785 //Double_t dv8Pt = 0.; // v'_n{8} (pt)
2788 Double_t twoPrimeEta = 0.; // <<2'>> (eta)
2789 Double_t fourPrimeEta = 0.; // <<4>> (eta)
2790 //Double_t sixPrimeEta = 0.; // <<6>> (eta)
2791 //Double_t eightPrimeEta = 0.; // <<8'>> (eta)
2792 Double_t secondOrderDiffFlowCumulantEta = 0.; // d_n{2,Q} (eta)
2793 Double_t fourthOrderDiffFlowCumulantEta = 0.; // d_n{4,Q} (eta)
2794 //Double_t sixthOrderDiffFlowCumulantEta = 0.; // d_n{6,Q} (eta)
2795 //Double_t eightOrderDiffFlowCumulantEta = 0.; // d_n{8,Q} (eta)
2796 Double_t dv2Eta = 0.; // v'_n{2} (eta)
2797 Double_t dv4Eta = 0.; // v'_n{4} (eta)
2798 //Double_t dv6Eta = 0.; // v'_n{6} (eta)
2799 //Double_t dv8Eta = 0.; // v'_n{8} (eta)
2802 // looping over (pt,eta) bins to calculate v'(pt,eta)
2803 for(Int_t p=1;p<nBinsPt+1;p++)
2805 for(Int_t e=1;e<nBinsEta+1;e++)
2809 twoPrimePtEta = profile2ndPtEta->GetBinContent(profile2ndPtEta->GetBin(p,e));
2810 secondOrderDiffFlowCumulantPtEta = twoPrimePtEta;
2813 //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2814 // to be improved (applying correction for NUA):
2815 if(namePtEta->Contains("POI"))
2817 if(f2pFinalCorrectionsForNUAPtEtaPOI) secondOrderDiffFlowCumulantPtEta = twoPrimePtEta
2818 - f2pFinalCorrectionsForNUAPtEtaPOI->GetBinContent(f2pFinalCorrectionsForNUAPtEtaPOI->GetBin(p,e)) ;
2819 } else if (namePtEta->Contains("RP"))
2821 if(f2pFinalCorrectionsForNUAPtEtaRP) secondOrderDiffFlowCumulantPtEta = twoPrimePtEta
2822 - f2pFinalCorrectionsForNUAPtEtaRP->GetBinContent(f2pFinalCorrectionsForNUAPtEtaRP->GetBin(p,e));
2824 //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2829 dv2PtEta = secondOrderDiffFlowCumulantPtEta/dV2;
2830 if(*order2nd == "2")
2832 flowPtEta->SetBinContent(p,e,dv2PtEta);
2837 if(*order4th == "4" || *order6th == "6" || *order8th == "8")
2839 fourPrimePtEta = profile4thPtEta->GetBinContent(profile4thPtEta->GetBin(p,e));
2840 fourthOrderDiffFlowCumulantPtEta = fourPrimePtEta - 2.*twoPrimePtEta*pow(dV2,2.); // to be improved (correlations instead of pow(dV2,2.))
2843 dv4PtEta = -fourthOrderDiffFlowCumulantPtEta/pow(dV4,3);
2844 if(*order4th == "4")
2846 flowPtEta->SetBinContent(p,e,dv4PtEta);
2851 } // end of for(Int_t e=1;e<nBinsEta+1;e++)
2852 } // end of for(Int_t p=1;p<nBinsPt+1;p++)
2855 // looping over (pt) bins to calcualate v'(pt)
2856 for(Int_t p=1;p<nBinsPt+1;p++)
2860 twoPrimePt = profile2ndPt->GetBinContent(p);
2861 secondOrderDiffFlowCumulantPt = twoPrimePt;
2864 //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2865 // to be improved (applying correction for NUA):
2866 if(namePtEta->Contains("POI"))
2868 if(f2pFinalCorrectionsForNUAPtPOI) secondOrderDiffFlowCumulantPt = twoPrimePt
2869 - f2pFinalCorrectionsForNUAPtPOI->GetBinContent(p) ;
2870 } else if (namePtEta->Contains("RP"))
2872 if(f2pFinalCorrectionsForNUAPtRP) secondOrderDiffFlowCumulantPt = twoPrimePt
2873 - f2pFinalCorrectionsForNUAPtRP->GetBinContent(p);
2875 //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2880 dv2Pt = secondOrderDiffFlowCumulantPt/dV2;
2881 if(*order2nd == "2")
2883 flowPt->SetBinContent(p,dv2Pt);
2886 // common control histos: (to be improved fill only once. now they are filled first without weights and then with weights):
2887 if(namePtEta->Contains("POI") && *order2nd == "2")
2889 fCommonHistsResults2nd->FillDifferentialFlowPtPOI(p,dv2Pt,0.); //to be improved (errors && bb or bb+1 ?)
2891 else if(namePtEta->Contains("RP") && *order2nd == "2")
2893 fCommonHistsResults2nd->FillDifferentialFlowPtRP(p,dv2Pt,0.); //to be improved (errors && bb or bb+1 ?)
2899 if(*order4th == "4" || *order6th == "6" || *order8th == "8")
2901 fourPrimePt = profile4thPt->GetBinContent(profile4thPt->GetBin(p));
2902 fourthOrderDiffFlowCumulantPt = fourPrimePt - 2.*twoPrimePt*pow(dV2,2.); // to be improved (correlations instead of pow(dV2,2.))
2905 dv4Pt = -fourthOrderDiffFlowCumulantPt/pow(dV4,3);
2906 if(*order4th == "4")
2908 flowPt->SetBinContent(p,dv4Pt);
2911 // common control histos: (to be improved):
2912 if(namePtEta->Contains("POI") && *order4th == "4")
2914 fCommonHistsResults4th->FillDifferentialFlowPtPOI(p,dv4Pt,0.); //to be improved (errors && bb or bb+1 ?)
2916 else if(namePtEta->Contains("RP") && *order4th == "4" )
2918 fCommonHistsResults4th->FillDifferentialFlowPtRP(p,dv4Pt,0.); //to be improved (errors && bb or bb+1 ?)
2924 } // end of for(Int_t p=1;p<nBinsPt+1;p++)
2927 // looping over (eta) bins to calcualate v'(eta)
2928 for(Int_t e=1;e<nBinsEta+1;e++)
2932 twoPrimeEta = profile2ndEta->GetBinContent(e);
2933 secondOrderDiffFlowCumulantEta = twoPrimeEta;
2936 //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2937 // to be improved (applying correction for NUA):
2938 if(namePtEta->Contains("POI"))
2940 if(f2pFinalCorrectionsForNUAEtaPOI) secondOrderDiffFlowCumulantEta = twoPrimeEta
2941 - f2pFinalCorrectionsForNUAEtaPOI->GetBinContent(e) ;
2942 } else if (namePtEta->Contains("RP"))
2944 if(f2pFinalCorrectionsForNUAEtaRP) secondOrderDiffFlowCumulantEta = twoPrimeEta
2945 - f2pFinalCorrectionsForNUAEtaRP->GetBinContent(e);
2947 //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2952 dv2Eta = secondOrderDiffFlowCumulantEta/dV2;
2953 if(*order2nd == "2")
2955 flowEta->SetBinContent(e,dv2Eta);
2958 // common control histos: (to be improved):
2959 if(namePtEta->Contains("POI") && *order2nd == "2")
2961 fCommonHistsResults2nd->FillDifferentialFlowEtaPOI(e,dv2Eta,0.); //to be improved (errors && bb or bb+1 ?)
2963 else if(namePtEta->Contains("RP") && *order2nd == "2")
2965 fCommonHistsResults2nd->FillDifferentialFlowEtaRP(e,dv2Eta,0.); //to be improved (errors && bb or bb+1 ?)
2972 if(*order4th == "4" || *order6th == "6" || *order8th == "8")
2974 fourPrimeEta = profile4thEta->GetBinContent(profile4thEta->GetBin(e));
2975 fourthOrderDiffFlowCumulantEta = fourPrimeEta - 2.*twoPrimeEta*pow(dV2,2.); // to be improved (correlations instead of pow(dV2,2.))
2978 dv4Eta = -fourthOrderDiffFlowCumulantEta/pow(dV4,3);
2979 if(*order4th == "4")
2981 flowEta->SetBinContent(e,dv4Eta);
2984 // common control histos: (to be improved):
2985 if(namePtEta->Contains("POI") && *order4th == "4")
2987 fCommonHistsResults4th->FillDifferentialFlowEtaPOI(e,dv4Eta,0.); //to be improved (errors && bb or bb+1 ?)
2989 else if(namePtEta->Contains("RP") && *order4th == "4")
2991 fCommonHistsResults4th->FillDifferentialFlowEtaRP(e,dv4Eta,0.); //to be improved (errors && bb or bb+1 ?)
2997 } // end of for(Int_t e=1;e<nBinsEta+1;e++)
3006 delete profile2ndPt;
3007 delete profile4thPt;
3008 delete profile6thPt;
3009 delete profile8thPt;
3010 delete profile2ndEta;
3011 delete profile4thEta;
3012 delete profile6thEta;
3013 delete profile8thEta;
3015 } // end of AliFlowAnalysisWithQCumulants::CalculateFinalResultsForDifferentialFlow(Bool_t useParticleWeights, TString type)
3018 //================================================================================================================================
3021 void AliFlowAnalysisWithQCumulants::PrintFinalResultsForIntegratedFlow(TString type)
3023 // printing on the screen the final results for integrated flow (NONAME, POI and RP) // to be improved (NONAME)
3025 Int_t n = fHarmonic;
3027 if(type == "NONAME" || type == "RP" || type == "POI")
3029 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
3031 cout<<"WARNING: fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th"<<endl;
3032 cout<<" is NULL in AFAWQC::PFRFIF() !!!!"<<endl;
3036 cout<<"WARNING: type in not from {NONAME, RP, POI} in AFAWQC::PFRFIF() !!!!"<<endl;
3040 Double_t dVn[4] = {0.}; // array to hold Vn{2}, Vn{4}, Vn{6} and Vn{8}
3041 Double_t dVnErr[4] = {0.}; // array to hold errors of Vn{2}, Vn{4}, Vn{6} and Vn{8}
3043 if(type == "NONAME")
3045 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinContent(1);
3046 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinError(1);
3047 dVn[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinContent(1);
3048 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinError(1);
3049 dVn[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinContent(1);
3050 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinError(1);
3051 dVn[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinContent(1);
3052 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinError(1);
3053 } else if(type == "RP")
3055 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinContent(1);
3056 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinError(1);
3057 dVn[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinContent(1);
3058 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinError(1);
3059 dVn[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinContent(1);
3060 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinError(1);
3061 dVn[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinContent(1);
3062 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinError(1);
3063 } else if(type == "POI")
3065 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinContent(1);
3066 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinError(1);
3067 dVn[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinContent(1);
3068 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinError(1);
3069 dVn[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinContent(1);
3070 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinError(1);
3071 dVn[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinContent(1);
3072 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinError(1);
3075 TString title = " flow estimates from Q-cumulants";
3076 TString subtitle = " (";
3078 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
3080 subtitle.Append(type);
3081 subtitle.Append(", without weights)");
3084 subtitle.Append(type);
3085 subtitle.Append(", with weights)");
3089 cout<<"*************************************"<<endl;
3090 cout<<"*************************************"<<endl;
3091 cout<<title.Data()<<endl;
3092 cout<<subtitle.Data()<<endl;
3095 for(Int_t i=0;i<4;i++)
3099 cout<<" v_"<<n<<"{"<<2*(i+1)<<"} = "<<dVn[i]<<" +/- "<<dVnErr[i]<<endl;
3103 cout<<" v_"<<n<<"{"<<2*(i+1)<<"} = Im"<<endl;
3109 if(type == "NONAME")
3111 cout<<" nEvts = "<<nEvtsNoName<<", AvM = "<<dMultNoName<<endl; // to be improved
3113 else if (type == "RP")
3115 cout<<" nEvts = "<<nEvtsRP<<", AvM = "<<dMultRP<<endl; // to be improved
3117 else if (type == "POI")
3119 cout<<" nEvts = "<<nEvtsPOI<<", AvM = "<<dMultPOI<<endl; // to be improved
3122 cout<<"*************************************"<<endl;
3123 cout<<"*************************************"<<endl;
3126 }// end of AliFlowAnalysisWithQCumulants::PrintFinalResultsForIntegratedFlow(TString type="NONAME");
3129 //================================================================================================================================
3132 void AliFlowAnalysisWithQCumulants::CompareResultsFromNestedLoopsAndFromQVectorsForDiffFlow(Bool_t useParticleWeights)
3134 // compare correlations needed for diff. flow calculated with nested loops and those calculated from Q-vectors
3137 cout<<" *************************************"<<endl;
3138 cout<<" **** cross-checking the formulas ****"<<endl;
3139 cout<<" **** for differential flow ****"<<endl;
3140 cout<<" **** ****"<<endl;
3141 cout<<" **** (pt,eta) bin: ****"<<endl;
3142 cout<<" **** 1.1 < pt < 1.2 GeV ****"<<endl;
3143 cout<<" **** -0.55 < eta < -0.525 ****"<<endl;
3144 cout<<" *************************************"<<endl;
3147 if(!useParticleWeights)
3149 cout<<"<cos(n(psi1-phi2))> from Q-vectors = "<<fCorrelationsPro[0][0][0][0]->GetBinContent(fCorrelationsPro[0][0][0][0]->GetBin(12,19))<<endl;
3150 cout<<"<cos(n(psi1-phi2))> from nested loops = "<<fDirectCorrelationsDiffFlow->GetBinContent(1)<<endl;
3152 cout<<"<cos(n(psi1+phi2-phi3-phi4))> from Q-vectors = "<<fCorrelationsPro[0][0][0][1]->GetBinContent(fCorrelationsPro[0][0][0][1]->GetBin(12,19))<<endl;
3153 cout<<"<cos(n(psi1+phi2-phi3-phi4))> from nested loops = "<<fDirectCorrelationsDiffFlow->GetBinContent(41)<<endl;
3155 cout<<"****************************************************"<<endl;
3156 cout<<"****************************************************"<<endl;
3159 cout<<"<cos(n(psi1))> from Q-vectors = "<<fCorrectionsCosP1nPsiPtEtaPOI->GetBinContent(fCorrectionsCosP1nPsiPtEtaPOI->GetBin(12,19))<<endl;
3160 cout<<"<cos(n(psi1))> from nested loops = "<<fDirectCorrectionsDiffFlowCos->GetBinContent(1)<<endl;
3162 cout<<"<sin(n(psi1))> from Q-vectors = "<<fCorrectionsSinP1nPsiPtEtaPOI->GetBinContent(fCorrectionsSinP1nPsiPtEtaPOI->GetBin(12,19))<<endl;
3163 cout<<"<sin(n(psi1))> from nested loops = "<<fDirectCorrectionsDiffFlowSin->GetBinContent(1)<<endl;
3168 if(useParticleWeights)
3170 cout<<"<w2 cos(n(psi1-phi2))> from Q-vectors (RP) = "<<fCorrelationsPro[0][1][0][0]->GetBinContent(fCorrelationsPro[0][1][0][0]->GetBin(12,19))<<endl;
3171 cout<<"<w2 cos(n(psi1-phi2))> from Q-vectors (POI) = "<<fCorrelationsPro[1][1][0][0]->GetBinContent(fCorrelationsPro[1][1][0][0]->GetBin(12,19))<<endl;
3172 cout<<"<w2 cos(n(psi1-phi2))> from nested loops = "<<fDirectCorrelationsDiffFlowW->GetBinContent(1)<<endl;
3174 cout<<"<w2 w3 w4 cos(n(psi1+phi2-phi3-phi4))> from Q-vectors (RP) = "<<fCorrelationsPro[0][1][0][1]->GetBinContent(fCorrelationsPro[0][1][0][1]->GetBin(12,19))<<endl;
3175 cout<<"<w2 w3 w4 cos(n(psi1+phi2-phi3-phi4))> from Q-vectors (POI) = "<<fCorrelationsPro[1][1][0][1]->GetBinContent(fCorrelationsPro[1][1][0][1]->GetBin(12,19))<<endl;
3176 cout<<"<w2 w3 w4 cos(n(psi1+phi2-phi3-phi4))> from nested loops = "<<fDirectCorrelationsDiffFlowW->GetBinContent(41)<<endl;
3180 } // end of void AliFlowAnalysisWithQCumulants::CompareResultsFromNestedLoopsAndFromQVectorsForDiffFlow()
3183 //================================================================================================================================
3186 void AliFlowAnalysisWithQCumulants::WriteHistograms(TString outputFileName)
3188 //store the final results in output .root file
3189 TFile *output = new TFile(outputFileName.Data(),"RECREATE");
3190 //output->WriteObject(fHistList, "cobjQC","SingleKey");
3191 fHistList->Write(fHistList->GetName(), TObject::kSingleKey);
3196 //================================================================================================================================
3199 void AliFlowAnalysisWithQCumulants::BookCommonHistograms()
3201 // book common control histograms and common histograms for final results
3203 // common control histogram (ALL events)
3204 fCommonHists = new AliFlowCommonHist("AliFlowCommonHistQC");
3205 fHistList->Add(fCommonHists);
3207 // common control histogram (for events with 2 and more particles)
3208 fCommonHists2nd = new AliFlowCommonHist("AliFlowCommonHist2ndOrderQC");
3209 fHistList->Add(fCommonHists2nd);
3211 // common control histogram (for events with 4 and more particles)
3212 fCommonHists4th = new AliFlowCommonHist("AliFlowCommonHist4thOrderQC");
3213 fHistList->Add(fCommonHists4th);
3215 // common control histogram (for events with 6 and more particles)
3216 fCommonHists6th = new AliFlowCommonHist("AliFlowCommonHist6thOrderQC");
3217 fHistList->Add(fCommonHists6th);
3219 // common control histogram (for events with 8 and more particles)
3220 fCommonHists8th = new AliFlowCommonHist("AliFlowCommonHist8thOrderQC");
3221 fHistList->Add(fCommonHists8th);
3223 // common histograms for final results (calculated for events with 2 and more particles)
3224 fCommonHistsResults2nd = new AliFlowCommonHistResults("AliFlowCommonHistResults2ndOrderQC");
3225 fHistList->Add(fCommonHistsResults2nd);
3227 // common histograms for final results (calculated for events with 4 and more particles)
3228 fCommonHistsResults4th = new AliFlowCommonHistResults("AliFlowCommonHistResults4thOrderQC");
3229 fHistList->Add(fCommonHistsResults4th);
3231 // common histograms for final results (calculated for events with 6 and more particles)
3232 fCommonHistsResults6th = new AliFlowCommonHistResults("AliFlowCommonHistResults6thOrderQC");
3233 fHistList->Add(fCommonHistsResults6th);
3235 // common histograms for final results (calculated for events with 8 and more particles)
3236 fCommonHistsResults8th = new AliFlowCommonHistResults("AliFlowCommonHistResults8thOrderQC");
3237 fHistList->Add(fCommonHistsResults8th);
3239 } // end of void AliFlowAnalysisWithQCumulants::BookCommonHistograms()
3242 //================================================================================================================================
3245 void AliFlowAnalysisWithQCumulants::BookAndFillWeightsHistograms()
3247 // book and fill histograms which hold phi, pt and eta weights
3251 cout<<"WARNING: fWeightsList is NULL in AFAWQC::BAFWH() !!!!"<<endl;
3255 fUseParticleWeights = new TProfile("fUseParticleWeights","1 = weight used, 0 = weight not used",3,0,3);
3256 fUseParticleWeights->SetLabelSize(0.06);
3257 (fUseParticleWeights->GetXaxis())->SetBinLabel(1,"w_{#phi}");
3258 (fUseParticleWeights->GetXaxis())->SetBinLabel(2,"w_{p_{T}}");
3259 (fUseParticleWeights->GetXaxis())->SetBinLabel(3,"w_{#eta}");
3260 fUseParticleWeights->Fill(0.5,(Int_t)fUsePhiWeights);
3261 fUseParticleWeights->Fill(1.5,(Int_t)fUsePtWeights);
3262 fUseParticleWeights->Fill(2.5,(Int_t)fUseEtaWeights);
3263 fWeightsList->Add(fUseParticleWeights);
3267 if(fWeightsList->FindObject("phi_weights"))
3269 fPhiWeights = dynamic_cast<TH1F*>(fWeightsList->FindObject("phi_weights"));
3270 if(fPhiWeights->GetBinWidth(1) != fPhiBinWidth)
3272 cout<<"WARNING: fPhiWeights->GetBinWidth(1) != fPhiBinWidth in AFAWQC::BAFWH() !!!! "<<endl;
3273 cout<<" This indicates inconsistent binning in phi histograms throughout the code."<<endl;
3278 cout<<"WARNING: fWeightsList->FindObject(\"phi_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
3281 } // end of if(fUsePhiWeights)
3285 if(fWeightsList->FindObject("pt_weights"))
3287 fPtWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("pt_weights"));
3288 if(fPtWeights->GetBinWidth(1) != fPtBinWidth)
3290 cout<<"WARNING: fPtWeights->GetBinWidth(1) != fPtBinWidth in AFAWQC::BAFWH() !!!! "<<endl;
3291 cout<<" This indicates insconsistent binning in pt histograms throughout the code."<<endl;
3296 cout<<"WARNING: fWeightsList->FindObject(\"pt_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
3299 } // end of if(fUsePtWeights)
3303 if(fWeightsList->FindObject("eta_weights"))
3305 fEtaWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("eta_weights"));
3306 if(fEtaWeights->GetBinWidth(1) != fEtaBinWidth)
3308 cout<<"WARNING: fEtaWeights->GetBinWidth(1) != fEtaBinWidth in AFAWQC::BAFWH() !!!! "<<endl;
3309 cout<<" This indicates insconsistent binning in eta histograms throughout the code."<<endl;
3314 cout<<"WARNING: fUseEtaWeights && fWeightsList->FindObject(\"eta_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
3317 } // end of if(fUseEtaWeights)
3319 } // end of AliFlowAnalysisWithQCumulants::BookAndFillWeightsHistograms()
3322 //================================================================================================================================
3325 void AliFlowAnalysisWithQCumulants::BookEverythingForIntegratedFlow()
3327 // book all objects for integrated flow
3337 // Re[Q_{m*n,k}], Im[Q_{m*n,k}] and S_{p,k}^M:
3338 fReQ = new TMatrixD(4,9);
3339 fImQ = new TMatrixD(4,9);
3340 fSMpk = new TMatrixD(8,9);
3342 // profile to hold average multiplicities and number of events for events with nRP>=0, nRP>=1, ... , and nRP>=8
3343 fAvMultiplicity = new TProfile("fAvMultiplicity","Average Multiplicities of RPs",9,0,9);
3344 fAvMultiplicity->SetTickLength(-0.01,"Y");
3345 fAvMultiplicity->SetMarkerStyle(25);
3346 fAvMultiplicity->SetLabelSize(0.05);
3347 fAvMultiplicity->SetLabelOffset(0.02,"Y");
3348 fAvMultiplicity->SetYTitle("Average Multiplicity");
3349 (fAvMultiplicity->GetXaxis())->SetBinLabel(1,"all evts");
3350 (fAvMultiplicity->GetXaxis())->SetBinLabel(2,"n_{RP} #geq 1");
3351 (fAvMultiplicity->GetXaxis())->SetBinLabel(3,"n_{RP} #geq 2");
3352 (fAvMultiplicity->GetXaxis())->SetBinLabel(4,"n_{RP} #geq 3");
3353 (fAvMultiplicity->GetXaxis())->SetBinLabel(5,"n_{RP} #geq 4");
3354 (fAvMultiplicity->GetXaxis())->SetBinLabel(6,"n_{RP} #geq 5");
3355 (fAvMultiplicity->GetXaxis())->SetBinLabel(7,"n_{RP} #geq 6");
3356 (fAvMultiplicity->GetXaxis())->SetBinLabel(8,"n_{RP} #geq 7");
3357 (fAvMultiplicity->GetXaxis())->SetBinLabel(9,"n_{RP} #geq 8");
3358 fIntFlowProfiles->Add(fAvMultiplicity);
3360 TString pWeightsFlag[2] = {"pWeights not used","pWeights used"};
3361 TString eWeightsFlag[2] = {"exact eWeights","non-exact eWeights"};
3362 TString nuaFlag[2] = {"not corrected","corrected"};
3363 TString sinCosFlag[2] = {"sin","cos"};
3364 TString powerFlag[2] = {"linear","quadratic"};
3366 for(Int_t pW=0;pW<1+(Int_t)(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);pW++)
3372 // average multiparticle correlations for single event calculated from Q-vectors
3373 // (Remark: binning is organized in the same way as in fQCorrelations[pW][eW] bellow):
3374 fQCorrelationsEBE[pW] = new TH1D(Form("fQCorrelationsEBE: %s",pWeightsFlag[pW].Data()),Form("Average multi-particle correlations for single event calculated from Q-vectors (%s)",pWeightsFlag[pW].Data()),32,0,32);
3376 for(Int_t sc=0;sc<2;sc++)
3378 // correction terms for non-uniform acceptance for single event calculated from Q-vectors
3379 // (Remark: binning is organized in the same way as in fQCorrections[pW][sc]):
3380 fQCorrectionsEBE[pW][sc] = new TH1D(Form("fQCorrectionsEBE: %s, %s terms",pWeightsFlag[pW].Data(),sinCosFlag[sc].Data()),Form("Correction terms for non-uniform acceptance for single event (%s, %s terms)",pWeightsFlag[pW].Data(),sinCosFlag[sc].Data()),10,0,10);
3383 for(Int_t eW=0;eW<2;eW++)
3385 // ******************
3386 // **** PROFILES ****
3387 // ******************
3389 // final average multiparticle correlations for all events calculated from Q-vectors:
3390 fQCorrelations[pW][eW] = new TProfile(Form("fQCorrelations: %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()),Form("Final average multi-particle correlations calculated from Q-vectors (%s, %s)",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()),32,0,32,"s");
3391 fQCorrelations[pW][eW]->SetTickLength(-0.01,"Y");
3392 fQCorrelations[pW][eW]->SetMarkerStyle(25);
3393 fQCorrelations[pW][eW]->SetLabelSize(0.03);
3394 fQCorrelations[pW][eW]->SetLabelOffset(0.01,"Y");
3395 // 2-p correlations:
3396 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(1,"<<2>>_{n|n}");
3397 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(2,"<<2>>_{2n|2n}");
3398 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(3,"<<2>>_{3n|3n}");
3399 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(4,"<<2>>_{4n|4n}");
3400 // 3-p correlations:
3401 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(6,"<<3>>_{2n|n,n}");
3402 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(7,"<<3>>_{3n|2n,n}");
3403 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(8,"<<3>>_{4n|2n,2n}");
3404 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(9,"<<3>>_{4n|3n,n}");
3405 // 4-p correlations:
3406 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(11,"<<4>>_{n,n|n,n}");
3407 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(12,"<<4>>_{2n,n|2n,n}");
3408 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(13,"<<4>>_{2n,2n|2n,2n}");
3409 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(14,"<<4>>_{3n|n,n,n}");
3410 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(15,"<<4>>_{3n,n|3n,n}");
3411 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(16,"<<4>>_{3n,n|2n,2n}");
3412 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(17,"<<4>>_{4n|2n,n,n}");
3413 // 5-p correlations:
3414 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(19,"<<5>>_{2n|n,n,n,n}");
3415 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(20,"<<5>>_{2n,2n|2n,n,n}");
3416 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(21,"<<5>>_{3n,n|2n,n,n}");
3417 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(22,"<<5>>_{4n|n,n,n,n}");
3418 // 6-p correlations:
3419 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(24,"<<6>>_{n,n,n|n,n,n}");
3420 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(25,"<<6>>_{2n,n,n|2n,n,n}");
3421 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(26,"<<6>>_{2n,2n|n,n,n,n}");
3422 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(27,"<<6>>_{3n,n|n,n,n,n}");
3423 // 7-p correlations:
3424 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(29,"<<7>>_{2n,n,n|n,n,n,n}");
3425 // 8-p correlations:
3426 (fQCorrelations[pW][eW]->GetXaxis())->SetBinLabel(31,"<<8>>_{n,n,n,n|n,n,n,n}");
3427 // add fQCorrelations[0] to the list fIntFlowList:
3428 fIntFlowProfiles->Add(fQCorrelations[pW][eW]);
3430 // averages <<2><4>>, <<2><6>>, <<4><6>>, etc, needed to calculate covariances:
3431 fQProducts[pW][eW] = new TProfile(Form("fQProducts: %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()),Form("Averages of products (%s, %s)",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()),6,0,6);
3432 fQProducts[pW][eW]->SetTickLength(-0.01,"Y");
3433 fQProducts[pW][eW]->SetMarkerStyle(25);
3434 fQProducts[pW][eW]->SetLabelSize(0.05);
3435 fQProducts[pW][eW]->SetLabelOffset(0.01,"Y");
3436 (fQProducts[pW][eW]->GetXaxis())->SetBinLabel(1,"<<2><4>>");
3437 (fQProducts[pW][eW]->GetXaxis())->SetBinLabel(2,"<<2><6>>");
3438 (fQProducts[pW][eW]->GetXaxis())->SetBinLabel(3,"<<2><8>>");
3439 (fQProducts[pW][eW]->GetXaxis())->SetBinLabel(4,"<<4><6>>");
3440 (fQProducts[pW][eW]->GetXaxis())->SetBinLabel(5,"<<4><8>>");
3441 (fQProducts[pW][eW]->GetXaxis())->SetBinLabel(6,"<<6><8>>");
3442 fIntFlowProfiles->Add(fQProducts[pW][eW]);
3444 for(Int_t sc=0;sc<2;sc++)
3446 // final average correction terms for non-uniform acceptance calculated from Q-vectors:
3447 fQCorrections[pW][eW][sc] = new TProfile(Form("fQCorrections: %s, %s, %s terms",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),sinCosFlag[sc].Data()),Form("Correction terms for non-uniform acceptance (%s, %s, %s terms)",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),sinCosFlag[sc].Data()),10,0,10,"s");
3448 fQCorrections[pW][eW][sc]->SetTickLength(-0.01,"Y");
3449 fQCorrections[pW][eW][sc]->SetMarkerStyle(25);
3450 fQCorrections[pW][eW][sc]->SetLabelSize(0.03);
3451 fQCorrections[pW][eW][sc]->SetLabelOffset(0.01,"Y");
3452 // .........................................................................
3454 (fQCorrections[pW][eW][sc]->GetXaxis())->SetBinLabel(1,Form("%s(n(#phi_{1}))>",sinCosFlag[sc].Data()));
3458 // .........................................................................
3459 // add fQCorrectionsCos to the list fIntFlowList:
3460 fIntFlowProfiles->Add(fQCorrections[pW][eW][sc]);
3461 } // end of for(Int_t sc=0;sc<2;sc++)
3463 // *****************
3464 // **** RESULTS ****
3465 // *****************
3467 // final results for average multi-particle correlations with correct statistical errors:
3468 fCorrelations[pW][eW] = new TH1D(Form("fCorrelations: %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()),Form("Average multi-particle correlations (%s, %s)",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()),32,0,32);
3469 fCorrelations[pW][eW]->SetTickLength(-0.01,"Y");
3470 fCorrelations[pW][eW]->SetMarkerStyle(25);
3471 fCorrelations[pW][eW]->SetLabelSize(0.03);
3472 fCorrelations[pW][eW]->SetLabelOffset(0.01,"Y");
3473 // 2-p correlations:
3474 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(1,"<<2>>_{n|n}");
3475 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(2,"<<2>>_{2n|2n}");
3476 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(3,"<<2>>_{3n|3n}");
3477 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(4,"<<2>>_{4n|4n}");
3478 // 3-p correlations:
3479 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(6,"<<3>>_{2n|n,n}");
3480 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(7,"<<3>>_{3n|2n,n}");
3481 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(8,"<<3>>_{4n|2n,2n}");
3482 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(9,"<<3>>_{4n|3n,n}");
3483 // 4-p correlations:
3484 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(11,"<<4>>_{n,n|n,n}");
3485 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(12,"<<4>>_{2n,n|2n,n}");
3486 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(13,"<<4>>_{2n,2n|2n,2n}");
3487 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(14,"<<4>>_{3n|n,n,n}");
3488 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(15,"<<4>>_{3n,n|3n,n}");
3489 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(16,"<<4>>_{3n,n|2n,2n}");
3490 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(17,"<<4>>_{4n|2n,n,n}");
3491 // 5-p correlations:
3492 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(19,"<<5>>_{2n|n,n,n,n}");
3493 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(20,"<<5>>_{2n,2n|2n,n,n}");
3494 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(21,"<<5>>_{3n,n|2n,n,n}");
3495 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(22,"<<5>>_{4n|n,n,n,n}");
3496 // 6-p correlations:
3497 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(24,"<<6>>_{n,n,n|n,n,n}");
3498 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(25,"<<6>>_{2n,n,n|2n,n,n}");
3499 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(26,"<<6>>_{2n,2n|n,n,n,n}");
3500 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(27,"<<6>>_{3n,n|n,n,n,n}");
3501 // 7-p correlations:
3502 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(29,"<<7>>_{2n,n,n|n,n,n,n}");
3503 // 8-p correlations:
3504 (fCorrelations[pW][eW]->GetXaxis())->SetBinLabel(31,"<<8>>_{n,n,n,n|n,n,n,n}");
3505 // add fCorrelations to the list fIntFlowList:
3506 fIntFlowResults->Add(fCorrelations[pW][eW]);
3508 // final corrections for non-uniform acceptance for QC{2}, QC{4}, QC{6} and QC{8}:
3509 fCorrections[pW][eW] = new TH1D(Form("fCorrections: %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()),Form("Corrections for non-uniform acceptance for Q-cumulants (%s, %s)",eWeightsFlag[eW].Data()),4,0,4);
3510 fCorrections[pW][eW]->SetLabelSize(0.05);
3511 fCorrections[pW][eW]->SetMarkerStyle(25);
3512 (fCorrections[pW][eW]->GetXaxis())->SetBinLabel(1,"corr. for QC{2}");
3513 (fCorrections[pW][eW]->GetXaxis())->SetBinLabel(2,"corr. for QC{4}");
3514 (fCorrections[pW][eW]->GetXaxis())->SetBinLabel(3,"corr. for QC{6}");
3515 (fCorrections[pW][eW]->GetXaxis())->SetBinLabel(4,"corr. for QC{8}");
3516 // add fCorrections[pW] to list fIntFlowResults:
3517 fIntFlowResults->Add(fCorrections[pW][eW]);
3519 // final results for covariances:
3520 fCovariances[pW][eW] = new TH1D(Form("fCovariances: %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()),Form("Covariances (%s, %s)",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()),6,0,6);
3521 fCovariances[pW][eW]->SetLabelSize(0.05);
3522 fCovariances[pW][eW]->SetMarkerStyle(25);
3523 (fCovariances[pW][eW]->GetXaxis())->SetBinLabel(1,"Cov(2,4)");
3524 (fCovariances[pW][eW]->GetXaxis())->SetBinLabel(2,"Cov(2,6)");
3525 (fCovariances[pW][eW]->GetXaxis())->SetBinLabel(3,"Cov(2,8)");
3526 (fCovariances[pW][eW]->GetXaxis())->SetBinLabel(4,"Cov(4,6)");
3527 (fCovariances[pW][eW]->GetXaxis())->SetBinLabel(5,"Cov(4,8)");
3528 (fCovariances[pW][eW]->GetXaxis())->SetBinLabel(6,"Cov(6,8)");
3529 // add fCovariances[pW][eW] to list fIntFlowResults:
3530 fIntFlowResults->Add(fCovariances[pW][eW]);
3532 // final results for sum of event weights:
3533 for(Int_t power=0;power<2;power++)
3535 fSumOfEventWeights[pW][eW][power] = new TH1D(Form("fSumOfEventWeights: %s, %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),powerFlag[power].Data()),Form("SumOfEventWeights (%s, %s, %s)",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),powerFlag[power].Data()),4,0,4);
3536 fSumOfEventWeights[pW][eW][power]->SetLabelSize(0.05);
3537 fSumOfEventWeights[pW][eW][power]->SetMarkerStyle(25);
3538 (fSumOfEventWeights[pW][eW][power]->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>}");
3539 (fSumOfEventWeights[pW][eW][power]->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<4>}");
3540 (fSumOfEventWeights[pW][eW][power]->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<6>}");
3541 (fSumOfEventWeights[pW][eW][power]->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<8>}");
3542 // add fSumOfEventWeights[pW][eW] to list fIntFlowResults:
3543 fIntFlowResults->Add(fSumOfEventWeights[pW][eW][power]);
3546 // final results for sum of product of event weights:
3547 fProductOfEventWeights[pW][eW] = new TH1D(Form("fProductOfEventWeights: %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()),Form("ProductOfEventWeights (%s, %s)",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()),6,0,6);
3548 fProductOfEventWeights[pW][eW]->SetLabelSize(0.05);
3549 fProductOfEventWeights[pW][eW]->SetMarkerStyle(25);
3550 (fProductOfEventWeights[pW][eW]->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>} w_{<4>}");
3551 (fProductOfEventWeights[pW][eW]->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<2>} w_{<6>}");
3552 (fProductOfEventWeights[pW][eW]->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<2>} w_{<8>}");
3553 (fProductOfEventWeights[pW][eW]->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<4>} w_{<6>}");
3554 (fProductOfEventWeights[pW][eW]->GetXaxis())->SetBinLabel(5,"#sum_{i=1}^{N} w_{<4>} w_{<8>}");
3555 (fProductOfEventWeights[pW][eW]->GetXaxis())->SetBinLabel(6,"#sum_{i=1}^{N} w_{<6>} w_{<8>}");
3556 // add fProductOfEventWeights[pW][eW] to list fIntFlowResults:
3557 fIntFlowResults->Add(fProductOfEventWeights[pW][eW]);
3559 for(Int_t nua=0;nua<2;nua++)
3561 // integrated Q-cumulants:
3562 fCumulants[pW][eW][nua] = new TH1D(Form("fCumulants: %s, %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data()),Form("Q-cumulants (%s, %s, %s)",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data()),4,0,4);
3563 fCumulants[pW][eW][nua]->SetLabelSize(0.05);
3564 fCumulants[pW][eW][nua]->SetMarkerStyle(25);
3565 (fCumulants[pW][eW][nua]->GetXaxis())->SetBinLabel(1,"QC{2}");
3566 (fCumulants[pW][eW][nua]->GetXaxis())->SetBinLabel(2,"QC{4}");
3567 (fCumulants[pW][eW][nua]->GetXaxis())->SetBinLabel(3,"QC{6}");
3568 (fCumulants[pW][eW][nua]->GetXaxis())->SetBinLabel(4,"QC{8}");
3569 // add fCumulants[pW][nua] to list fIntFlowResults:
3570 fIntFlowResults->Add(fCumulants[pW][eW][nua]);
3572 // integrated flow from Q-cumulants:
3573 fIntFlow[pW][eW][nua] = new TH1D(Form("fIntFlow: %s, %s, %s",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data()),Form("Integrated flow from Q-cumulants (%s, %s, %s)",pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data()),4,0,4);
3574 fIntFlow[pW][eW][nua]->SetLabelSize(0.05);
3575 fIntFlow[pW][eW][nua]->SetMarkerStyle(25);
3576 (fIntFlow[pW][eW][nua]->GetXaxis())->SetBinLabel(1,"v_{2}{2,QC}");
3577 (fIntFlow[pW][eW][nua]->GetXaxis())->SetBinLabel(2,"v_{2}{4,QC}");
3578 (fIntFlow[pW][eW][nua]->GetXaxis())->SetBinLabel(3,"v_{2}{6,QC}");
3579 (fIntFlow[pW][eW][nua]->GetXaxis())->SetBinLabel(4,"v_{2}{8,QC}");
3580 // add fIntFlow[pW][nua] to list fIntFlowResults:
3581 fIntFlowResults->Add(fIntFlow[pW][eW][nua]);
3583 } // end of for(Int_t nua=0;nua<2;nua++)
3584 } // end of for(Int_t eW=0;eW<2;eW++)
3585 } // end of for(Int_t pW=0;pW<1+(Int_t)(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);pW++)
3590 // final average weighted multi-particle correlations for all events calculated from Q-vectors
3591 fQCorrelations[1] = new TProfile("Weighted correlations","final average multi-particle correlations from weighted Q-vectors",200,0,200,"s");
3592 fQCorrelations[1]->SetTickLength(-0.01,"Y");
3593 fQCorrelations[1]->SetMarkerStyle(25);
3594 fQCorrelations[1]->SetLabelSize(0.03);
3595 fQCorrelations[1]->SetLabelOffset(0.01,"Y");
3596 // 2-particle correlations:
3597 (fQCorrelations[1]->GetXaxis())->SetBinLabel(1,"<w_{1}w_{2}cos(n(#phi_{1}-#phi_{2}))>");
3598 (fQCorrelations[1]->GetXaxis())->SetBinLabel(2,"<w_{1}^{2}w_{2}^{2}cos(2n(#phi_{1}-#phi_{2}))>");
3599 (fQCorrelations[1]->GetXaxis())->SetBinLabel(3,"<w_{1}^{3}w_{2}^{3}cos(3n(#phi_{1}-#phi_{2}))>");
3600 (fQCorrelations[1]->GetXaxis())->SetBinLabel(4,"<w_{1}^{4}w_{2}^{4}cos(4n(#phi_{1}-#phi_{2}))>");
3601 (fQCorrelations[1]->GetXaxis())->SetBinLabel(5,"<w_{1}^{3}w_{2}cos(n(#phi_{1}-#phi_{2}))>");
3602 (fQCorrelations[1]->GetXaxis())->SetBinLabel(6,"<w_{1}^{2}w_{2}w_{3}cos(n(#phi_{1}-#phi_{2}))>");
3603 // 3-particle correlations:
3604 (fQCorrelations[1]->GetXaxis())->SetBinLabel(21,"<w_{1}w_{2}w_{3}^{2}cos(n(2#phi_{1}-#phi_{2}-#phi_{3}))>");
3605 // 4-particle correlations:
3606 (fQCorrelations[1]->GetXaxis())->SetBinLabel(41,"<w_{1}w_{2}w_{3}w_{4}cos(n(#phi_{1}+#phi_{2}-#phi_{3}-#phi_{4}))>");
3607 // add fQCorrelations[1] to the list fIntFlowList:
3608 fIntFlowList->Add(fQCorrelations[1]);
3612 } // end of AliFlowAnalysisWithQCumulants::BookEverythingForIntegratedFlow()
3615 //================================================================================================================================
3618 void AliFlowAnalysisWithQCumulants::BookEverythingForNestedLoops()
3620 // book all profiles relevant for calculations with nested loops
3622 fEvaluateNestedLoops = new TProfile("fEvaluateNestedLoops","1 = evaluate, 0 = do not evaluate",2,0,2);
3623 fEvaluateNestedLoops->SetLabelSize(0.05);
3624 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(1,"Nested Loops (Int. Flow)");
3625 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(2,"Nested Loops (Diff. Flow)");
3626 fEvaluateNestedLoops->Fill(0.5,(Int_t)fEvaluateNestedLoopsForIntFlow);
3627 fEvaluateNestedLoops->Fill(1.5,(Int_t)fEvaluateNestedLoopsForDiffFlow);
3628 // add fEvaluateNestedLoops to the list fNestedLoopsList:
3629 fNestedLoopsList->Add(fEvaluateNestedLoops);
3631 if(fEvaluateNestedLoopsForIntFlow)
3633 fDirectCorrelations = new TProfile("fDirectCorrelations","multi-particle correlations with nested loops",100,0,100,"s");
3634 fNestedLoopsList->Add(fDirectCorrelations);
3635 fDirectCorrectionsCos = new TProfile("fDirectCorrectionsCos"," corrections for non-uniform acceptance (cos terms)",100,0,100,"s");
3636 fNestedLoopsList->Add(fDirectCorrectionsCos);
3637 fDirectCorrectionsSin = new TProfile("fDirectCorrectionsSin"," corrections for non-uniform acceptance (sin terms)",100,0,100,"s");
3638 fNestedLoopsList->Add(fDirectCorrectionsSin);
3639 if(fUsePhiWeights) // Remark: cross-checking performed only with phi-weights (this is sufficient)
3641 fDirectCorrelationsW = new TProfile("fDirectCorrelationsW","multi-particle correlations with nested loops",200,0,200,"s");
3642 fNestedLoopsList->Add(fDirectCorrelationsW);
3643 fDirectCorrectionsCosW = new TProfile("fDirectCorrectionsCosW"," corrections for non-uniform acceptance (cos terms)",100,0,100,"s");
3644 fNestedLoopsList->Add(fDirectCorrectionsCosW);
3645 fDirectCorrectionsSinW = new TProfile("fDirectCorrectionsSinW"," corrections for non-uniform acceptance (sin terms)",100,0,100,"s");
3646 fNestedLoopsList->Add(fDirectCorrectionsSinW);
3650 if(fEvaluateNestedLoopsForDiffFlow)
3652 fDirectCorrelationsDiffFlow = new TProfile("fDirectCorrelationsDiffFlow","multi-particle correlations with nested loops",200,0,200,"s");
3653 fNestedLoopsList->Add(fDirectCorrelationsDiffFlow);
3654 fDirectCorrectionsDiffFlowCos = new TProfile("fDirectCorrectionsDiffFlowCos",
3655 "corrections for non-uniform acceptance (cos terms) with nested loops",200,0,200,"s");
3656 fNestedLoopsList->Add(fDirectCorrectionsDiffFlowCos);
3657 fDirectCorrectionsDiffFlowSin = new TProfile("fDirectCorrectionsDiffFlowSin",
3658 "corrections for non-uniform acceptance (sin terms) with nested loops",200,0,200,"s");
3659 fNestedLoopsList->Add(fDirectCorrectionsDiffFlowSin);
3660 if(fUsePhiWeights) // Remark: cross-checking performed only with phi-weights (this is sufficient)
3662 fDirectCorrelationsDiffFlowW = new TProfile("fDirectCorrelationsDiffFlowW","multi-particle correlations with nested loops",200,0,200,"s");
3663 fNestedLoopsList->Add(fDirectCorrelationsDiffFlowW);
3664 fDirectCorrectionsDiffFlowCosW = new TProfile("fDirectCorrectionsDiffFlowCosW",
3665 "corrections for non-uniform acceptance (cos terms) with nested loops",200,0,200,"s");
3666 fNestedLoopsList->Add(fDirectCorrectionsDiffFlowCosW);
3667 fDirectCorrectionsDiffFlowSinW = new TProfile("fDirectCorrectionsDiffFlowSinW",
3668 "corrections for non-uniform acceptance (sin terms) with nested loops",200,0,200,"s");
3669 fNestedLoopsList->Add(fDirectCorrectionsDiffFlowSinW);
3673 } // end of AliFlowAnalysisWithQCumulants::BookEverythingForNestedLoops()
3676 //================================================================================================================================
3679 void AliFlowAnalysisWithQCumulants::CalculateCorrelationsForIntegratedFlow()
3681 // calculate all correlations needed for integrated flow
3684 Double_t dMult = (*fSMpk)(0,0);
3686 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
3687 Double_t dReQ1n = (*fReQ)(0,0);
3688 Double_t dReQ2n = (*fReQ)(1,0);
3689 Double_t dReQ3n = (*fReQ)(2,0);
3690 Double_t dReQ4n = (*fReQ)(3,0);
3691 Double_t dImQ1n = (*fImQ)(0,0);
3692 Double_t dImQ2n = (*fImQ)(1,0);
3693 Double_t dImQ3n = (*fImQ)(2,0);
3694 Double_t dImQ4n = (*fImQ)(3,0);
3696 // real and imaginary parts of some expressions involving various combinations of Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
3697 // (these expression appear in the Eqs. for the multi-particle correlations bellow)
3699 // Re[Q_{2n} Q_{n}^* Q_{n}^*]
3700 Double_t reQ2nQ1nstarQ1nstar = pow(dReQ1n,2.)*dReQ2n + 2.*dReQ1n*dImQ1n*dImQ2n - pow(dImQ1n,2.)*dReQ2n;
3702 // Im[Q_{2n} Q_{n}^* Q_{n}^*]
3703 //Double_t imQ2nQ1nstarQ1nstar = pow(dReQ1n,2.)*dImQ2n-2.*dReQ1n*dImQ1n*dReQ2n-pow(dImQ1n,2.)*dImQ2n;
3705 // Re[Q_{n} Q_{n} Q_{2n}^*] = Re[Q_{2n} Q_{n}^* Q_{n}^*]
3706 Double_t reQ1nQ1nQ2nstar = reQ2nQ1nstarQ1nstar;
3708 // Re[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]
3709 Double_t reQ3nQ1nQ2nstarQ2nstar = (pow(dReQ2n,2.)-pow(dImQ2n,2.))*(dReQ3n*dReQ1n-dImQ3n*dImQ1n)
3710 + 2.*dReQ2n*dImQ2n*(dReQ3n*dImQ1n+dImQ3n*dReQ1n);
3712 // Im[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]
3713 //Double_t imQ3nQ1nQ2nstarQ2nstar = calculate and implement this (deleteMe)
3715 // Re[Q_{2n} Q_{2n} Q_{3n}^* Q_{1n}^*] = Re[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]
3716 Double_t reQ2nQ2nQ3nstarQ1nstar = reQ3nQ1nQ2nstarQ2nstar;
3718 // Re[Q_{4n} Q_{2n}^* Q_{2n}^*]
3719 Double_t reQ4nQ2nstarQ2nstar = pow(dReQ2n,2.)*dReQ4n+2.*dReQ2n*dImQ2n*dImQ4n-pow(dImQ2n,2.)*dReQ4n;
3721 // Im[Q_{4n} Q_{2n}^* Q_{2n}^*]
3722 //Double_t imQ4nQ2nstarQ2nstar = calculate and implement this (deleteMe)
3724 // Re[Q_{2n} Q_{2n} Q_{4n}^*] = Re[Q_{4n} Q_{2n}^* Q_{2n}^*]
3725 Double_t reQ2nQ2nQ4nstar = reQ4nQ2nstarQ2nstar;
3727 // Re[Q_{4n} Q_{3n}^* Q_{n}^*]
3728 Double_t reQ4nQ3nstarQ1nstar = dReQ4n*(dReQ3n*dReQ1n-dImQ3n*dImQ1n)+dImQ4n*(dReQ3n*dImQ1n+dImQ3n*dReQ1n);
3730 // Re[Q_{3n} Q_{n} Q_{4n}^*] = Re[Q_{4n} Q_{3n}^* Q_{n}^*]
3731 Double_t reQ3nQ1nQ4nstar = reQ4nQ3nstarQ1nstar;
3733 // Im[Q_{4n} Q_{3n}^* Q_{n}^*]
3734 //Double_t imQ4nQ3nstarQ1nstar = calculate and implement this (deleteMe)
3736 // Re[Q_{3n} Q_{2n}^* Q_{n}^*]
3737 Double_t reQ3nQ2nstarQ1nstar = dReQ3n*dReQ2n*dReQ1n-dReQ3n*dImQ2n*dImQ1n+dImQ3n*dReQ2n*dImQ1n
3738 + dImQ3n*dImQ2n*dReQ1n;
3740 // Re[Q_{2n} Q_{n} Q_{3n}^*] = Re[Q_{3n} Q_{2n}^* Q_{n}^*]
3741 Double_t reQ2nQ1nQ3nstar = reQ3nQ2nstarQ1nstar;
3743 // Im[Q_{3n} Q_{2n}^* Q_{n}^*]
3744 //Double_t imQ3nQ2nstarQ1nstar; //calculate and implement this (deleteMe)
3746 // Re[Q_{3n} Q_{n}^* Q_{n}^* Q_{n}^*]
3747 Double_t reQ3nQ1nstarQ1nstarQ1nstar = dReQ3n*pow(dReQ1n,3)-3.*dReQ1n*dReQ3n*pow(dImQ1n,2)
3748 + 3.*dImQ1n*dImQ3n*pow(dReQ1n,2)-dImQ3n*pow(dImQ1n,3);
3750 // Im[Q_{3n} Q_{n}^* Q_{n}^* Q_{n}^*]
3751 //Double_t imQ3nQ1nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)
3753 // |Q_{2n}|^2 |Q_{n}|^2
3754 Double_t dQ2nQ1nQ2nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.));
3756 // Re[Q_{4n} Q_{2n}^* Q_{n}^* Q_{n}^*]
3757 Double_t reQ4nQ2nstarQ1nstarQ1nstar = (dReQ4n*dReQ2n+dImQ4n*dImQ2n)*(pow(dReQ1n,2)-pow(dImQ1n,2))
3758 + 2.*dReQ1n*dImQ1n*(dImQ4n*dReQ2n-dReQ4n*dImQ2n);
3760 // Im[Q_{4n} Q_{2n}^* Q_{n}^* Q_{n}^*]
3761 //Double_t imQ4nQ2nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)
3763 // Re[Q_{2n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^*]
3764 Double_t reQ2nQ1nQ1nstarQ1nstarQ1nstar = (dReQ2n*dReQ1n-dImQ2n*dImQ1n)*(pow(dReQ1n,3)-3.*dReQ1n*pow(dImQ1n,2))
3765 + (dReQ2n*dImQ1n+dReQ1n*dImQ2n)*(3.*dImQ1n*pow(dReQ1n,2)-pow(dImQ1n,3));
3767 // Im[Q_{2n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^*]
3768 //Double_t imQ2nQ1nQ1nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)
3770 // Re[Q_{2n} Q_{2n} Q_{2n}^* Q_{n}^* Q_{n}^*]
3771 Double_t reQ2nQ2nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))
3772 * (dReQ2n*(pow(dReQ1n,2.)-pow(dImQ1n,2.)) + 2.*dImQ2n*dReQ1n*dImQ1n);
3774 // Im[Q_{2n} Q_{2n} Q_{2n}^* Q_{n}^* Q_{n}^*]
3775 //Double_t imQ2nQ2nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))
3776 // * (dImQ2n*(pow(dReQ1n,2.)-pow(dImQ1n,2.)) - 2.*dReQ2n*dReQ1n*dImQ1n);
3778 // Re[Q_{4n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
3779 Double_t reQ4nQ1nstarQ1nstarQ1nstarQ1nstar = pow(dReQ1n,4.)*dReQ4n-6.*pow(dReQ1n,2.)*dReQ4n*pow(dImQ1n,2.)
3780 + pow(dImQ1n,4.)*dReQ4n+4.*pow(dReQ1n,3.)*dImQ1n*dImQ4n
3781 - 4.*pow(dImQ1n,3.)*dReQ1n*dImQ4n;
3783 // Im[Q_{4n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
3784 //Double_t imQ4nQ1nstarQ1nstarQ1nstarQ1nstar = pow(dReQ1n,4.)*dImQ4n-6.*pow(dReQ1n,2.)*dImQ4n*pow(dImQ1n,2.)
3785 // + pow(dImQ1n,4.)*dImQ4n+4.*pow(dImQ1n,3.)*dReQ1n*dReQ4n
3786 // - 4.*pow(dReQ1n,3.)*dImQ1n*dReQ4n;
3788 // Re[Q_{3n} Q_{n} Q_{2n}^* Q_{n}^* Q_{n}^*]
3789 Double_t reQ3nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
3790 * (dReQ1n*dReQ2n*dReQ3n-dReQ3n*dImQ1n*dImQ2n+dReQ2n*dImQ1n*dImQ3n+dReQ1n*dImQ2n*dImQ3n);
3792 // Im[Q_{3n} Q_{n} Q_{2n}^* Q_{n}^* Q_{n}^*]
3793 //Double_t imQ3nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
3794 // * (-dReQ2n*dReQ3n*dImQ1n-dReQ1n*dReQ3n*dImQ2n+dReQ1n*dReQ2n*dImQ3n-dImQ1n*dImQ2n*dImQ3n);
3797 // Re[Q_{2n} Q_{2n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
3798 Double_t reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)*dReQ2n-2.*dReQ1n*dReQ2n*dImQ1n-dReQ2n*pow(dImQ1n,2.)
3799 + dImQ2n*pow(dReQ1n,2.)+2.*dReQ1n*dImQ1n*dImQ2n-pow(dImQ1n,2.)*dImQ2n)
3800 * (pow(dReQ1n,2.)*dReQ2n+2.*dReQ1n*dReQ2n*dImQ1n-dReQ2n*pow(dImQ1n,2.)
3801 - dImQ2n*pow(dReQ1n,2.)+2.*dReQ1n*dImQ1n*dImQ2n+pow(dImQ1n,2.)*dImQ2n);
3803 // Im[Q_{2n} Q_{2n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
3804 //Double_t imQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar = 2.*(pow(dReQ1n,2.)*dReQ2n-dReQ2n*pow(dImQ1n,2.)
3805 // + 2.*dReQ1n*dImQ1n*dImQ2n)*(pow(dReQ1n,2.)*dImQ2n
3806 // - 2.*dReQ1n*dImQ1n*dReQ2n-pow(dImQ1n,2.)*dImQ2n);
3808 // Re[Q_{3n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
3809 Double_t reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
3810 * (pow(dReQ1n,3.)*dReQ3n-3.*dReQ1n*dReQ3n*pow(dImQ1n,2.)
3811 + 3.*pow(dReQ1n,2.)*dImQ1n*dImQ3n-pow(dImQ1n,3.)*dImQ3n);
3813 // Im[Q_{3n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
3814 //Double_t imQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
3815 // * (pow(dImQ1n,3.)*dReQ3n-3.*dImQ1n*dReQ3n*pow(dReQ1n,2.)
3816 // - 3.*pow(dImQ1n,2.)*dReQ1n*dImQ3n+pow(dReQ1n,3.)*dImQ3n);
3818 // |Q_{2n}|^2 |Q_{n}|^4
3819 Double_t dQ2nQ1nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))*pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.);
3821 // Re[Q_{2n} Q_{n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
3822 Double_t reQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
3823 * (pow(dReQ1n,2.)*dReQ2n-dReQ2n*pow(dImQ1n,2.)
3824 + 2.*dReQ1n*dImQ1n*dImQ2n);
3826 // Im[Q_{2n} Q_{n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]
3827 //Double_t imQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
3828 // * (pow(dReQ1n,2.)*dImQ2n-dImQ2n*pow(dImQ1n,2.)
3829 // - 2.*dReQ1n*dReQ2n*dImQ1n);
3834 // **************************************
3835 // **** multi-particle correlations: ****
3836 // **************************************
3838 // Remark 1: multi-particle correlations calculated with non-weighted Q-vectors are stored in 1D profile fQCorrelations[0].
3839 // Remark 2: binning of fQCorrelations[0] is organized as follows:
3840 // --------------------------------------------------------------------------------------------------------------------
3841 // 1st bin: <2>_{1n|1n} = two1n1n = cos(n*(phi1-phi2))>
3842 // 2nd bin: <2>_{2n|2n} = two2n2n = cos(2n*(phi1-phi2))>
3843 // 3rd bin: <2>_{3n|3n} = two3n3n = cos(3n*(phi1-phi2))>
3844 // 4th bin: <2>_{4n|4n} = two4n4n = cos(4n*(phi1-phi2))>
3845 // 5th bin: ---- EMPTY ----
3846 // 6th bin: <3>_{2n|1n,1n} = three2n1n1n = <cos(n*(2.*phi1-phi2-phi3))>
3847 // 7th bin: <3>_{3n|2n,1n} = three3n2n1n = <cos(n*(3.*phi1-2.*phi2-phi3))>
3848 // 8th bin: <3>_{4n|2n,2n} = three4n2n2n = <cos(n*(4.*phi1-2.*phi2-2.*phi3))>
3849 // 9th bin: <3>_{4n|3n,1n} = three4n3n1n = <cos(n*(4.*phi1-3.*phi2-phi3))>
3850 // 10th bin: ---- EMPTY ----
3851 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1n = <cos(n*(phi1+phi2-phi3-phi4))>
3852 // 12th bin: <4>_{2n,1n|2n,1n} = four2n1n2n1n = <cos(2.*n*(phi1+phi2-phi3-phi4))>
3853 // 13th bin: <4>_{2n,2n|2n,2n} = four2n2n2n2n = <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>
3854 // 14th bin: <4>_{3n|1n,1n,1n} = four3n1n1n1n = <cos(n*(3.*phi1-phi2-phi3-phi4))>
3855 // 15th bin: <4>_{3n,1n|3n,1n} = four3n1n3n1n = <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>
3856 // 16th bin: <4>_{3n,1n|2n,2n} = four3n1n2n2n = <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>
3857 // 17th bin: <4>_{4n|2n,1n,1n} = four4n2n1n1n = <cos(n*(3.*phi1+phi2-3.*phi3-phi4))>
3858 // 18th bin: ---- EMPTY ----
3859 // 19th bin: <5>_{2n|1n,1n,1n,1n} = five2n1n1n1n1n = <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>
3860 // 20th bin: <5>_{2n,2n|2n,1n,1n} = five2n2n2n1n1n = <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>
3861 // 21st bin: <5>_{3n,1n|2n,1n,1n} = five3n1n2n1n1n = <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>
3862 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = five4n1n1n1n1n = <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>
3863 // 23rd bin: ---- EMPTY ----
3864 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = six1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
3865 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = six2n1n1n2n1n1n = <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>
3866 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = six2n2n1n1n1n1n = <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>
3867 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = six3n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>
3868 // 28th bin: ---- EMPTY ----
3869 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = seven2n1n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
3870 // 30th bin: ---- EMPTY ----
3871 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = eight1n1n1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
3872 // --------------------------------------------------------------------------------------------------------------------
3875 Double_t two1n1n = 0.; // <cos(n*(phi1-phi2))>
3876 Double_t two2n2n = 0.; // <cos(2n*(phi1-phi2))>
3877 Double_t two3n3n = 0.; // <cos(3n*(phi1-phi2))>
3878 Double_t two4n4n = 0.; // <cos(4n*(phi1-phi2))>
3882 two1n1n = (pow(dReQ1n,2.)+pow(dImQ1n,2.)-dMult)/(dMult*(dMult-1.));
3883 two2n2n = (pow(dReQ2n,2.)+pow(dImQ2n,2.)-dMult)/(dMult*(dMult-1.));
3884 two3n3n = (pow(dReQ3n,2.)+pow(dImQ3n,2.)-dMult)/(dMult*(dMult-1.));
3885 two4n4n = (pow(dReQ4n,2.)+pow(dImQ4n,2.)-dMult)/(dMult*(dMult-1.));
3887 // average non-weighted 2-particle correlations for single event:
3888 fQCorrelationsEBE[0]->SetBinContent(1,two1n1n);
3889 fQCorrelationsEBE[0]->SetBinContent(2,two2n2n);
3890 fQCorrelationsEBE[0]->SetBinContent(3,two3n3n);
3891 fQCorrelationsEBE[0]->SetBinContent(4,two4n4n);
3893 // final average non-weighted 2-particle correlations for all events:
3894 fQCorrelations[0][0]->Fill(0.5,two1n1n,dMult*(dMult-1.));
3895 fQCorrelations[0][0]->Fill(1.5,two2n2n,dMult*(dMult-1.));
3896 fQCorrelations[0][0]->Fill(2.5,two3n3n,dMult*(dMult-1.));
3897 fQCorrelations[0][0]->Fill(3.5,two4n4n,dMult*(dMult-1.));
3899 // distribution of <cos(n*(phi1-phi2))>:
3900 //f2pDistribution->Fill(two1n1n,dMult*(dMult-1.));
3901 } // end of if(dMult>1)
3904 Double_t three2n1n1n = 0.; // <cos(n*(2.*phi1-phi2-phi3))>
3905 Double_t three3n2n1n = 0.; // <cos(n*(3.*phi1-2.*phi2-phi3))>
3906 Double_t three4n2n2n = 0.; // <cos(n*(4.*phi1-2.*phi2-2.*phi3))>
3907 Double_t three4n3n1n = 0.; // <cos(n*(4.*phi1-3.*phi2-phi3))>
3911 three2n1n1n = (reQ2nQ1nstarQ1nstar-2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3912 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))+2.*dMult)
3913 / (dMult*(dMult-1.)*(dMult-2.));
3914 three3n2n1n = (reQ3nQ2nstarQ1nstar-(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3915 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))
3916 - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)
3917 / (dMult*(dMult-1.)*(dMult-2.));
3918 three4n2n2n = (reQ4nQ2nstarQ2nstar-2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3919 - (pow(dReQ4n,2.)+pow(dImQ4n,2.))+2.*dMult)
3920 / (dMult*(dMult-1.)*(dMult-2.));
3921 three4n3n1n = (reQ4nQ3nstarQ1nstar-(pow(dReQ4n,2.)+pow(dImQ4n,2.))
3922 - (pow(dReQ3n,2.)+pow(dImQ3n,2.))
3923 - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)
3924 / (dMult*(dMult-1.)*(dMult-2.));
3926 // average non-weighted 3-particle correlations for single event:
3927 fQCorrelationsEBE[0]->SetBinContent(6,three2n1n1n);
3928 fQCorrelationsEBE[0]->SetBinContent(7,three3n2n1n);
3929 fQCorrelationsEBE[0]->SetBinContent(8,three4n2n2n);
3930 fQCorrelationsEBE[0]->SetBinContent(9,three4n3n1n);
3932 // final average non-weighted 3-particle correlations for all events:
3933 fQCorrelations[0][0]->Fill(5.5,three2n1n1n,dMult*(dMult-1.)*(dMult-2.));
3934 fQCorrelations[0][0]->Fill(6.5,three3n2n1n,dMult*(dMult-1.)*(dMult-2.));
3935 fQCorrelations[0][0]->Fill(7.5,three4n2n2n,dMult*(dMult-1.)*(dMult-2.));
3936 fQCorrelations[0][0]->Fill(8.5,three4n3n1n,dMult*(dMult-1.)*(dMult-2.));
3937 } // end of if(dMult>2)
3940 Double_t four1n1n1n1n = 0.; // <cos(n*(phi1+phi2-phi3-phi4))>
3941 Double_t four2n2n2n2n = 0.; // <cos(2.*n*(phi1+phi2-phi3-phi4))>
3942 Double_t four2n1n2n1n = 0.; // <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>
3943 Double_t four3n1n1n1n = 0.; // <cos(n*(3.*phi1-phi2-phi3-phi4))>
3944 Double_t four4n2n1n1n = 0.; // <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>
3945 Double_t four3n1n2n2n = 0.; // <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>
3946 Double_t four3n1n3n1n = 0.; // <cos(n*(3.*phi1+phi2-3.*phi3-phi4))>
3950 four1n1n1n1n = (2.*dMult*(dMult-3.)+pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)-4.*(dMult-2.)*(pow(dReQ1n,2.)
3951 + pow(dImQ1n,2.))-2.*reQ2nQ1nstarQ1nstar+(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
3952 / (dMult*(dMult-1)*(dMult-2.)*(dMult-3.));
3953 four2n2n2n2n = (2.*dMult*(dMult-3.)+pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)-4.*(dMult-2.)*(pow(dReQ2n,2.)
3954 + pow(dImQ2n,2.))-2.*reQ4nQ2nstarQ2nstar+(pow(dReQ4n,2.)+pow(dImQ4n,2.)))
3955 / (dMult*(dMult-1)*(dMult-2.)*(dMult-3.));
3956 four2n1n2n1n = (dQ2nQ1nQ2nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar-2.*reQ2nQ1nstarQ1nstar)
3957 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
3958 - ((dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3959 + (dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-(pow(dReQ3n,2.)+pow(dImQ3n,2.)))
3960 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
3961 + (dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.));
3962 four3n1n1n1n = (reQ3nQ1nstarQ1nstarQ1nstar-3.*reQ3nQ2nstarQ1nstar-3.*reQ2nQ1nstarQ1nstar)
3963 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
3964 + (2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+3.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3965 + 6.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-6.*dMult)
3966 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3967 four4n2n1n1n = (reQ4nQ2nstarQ1nstarQ1nstar-2.*reQ4nQ3nstarQ1nstar-reQ4nQ2nstarQ2nstar-2.*reQ3nQ2nstarQ1nstar)
3968 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
3969 - (reQ2nQ1nstarQ1nstar-2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3970 - 3.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
3971 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
3972 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
3973 four3n1n2n2n = (reQ3nQ1nQ2nstarQ2nstar-reQ4nQ2nstarQ2nstar-reQ3nQ1nQ4nstar-2.*reQ3nQ2nstarQ1nstar)
3974 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
3975 - (2.*reQ1nQ1nQ2nstar-(pow(dReQ4n,2.)+pow(dImQ4n,2.))-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3976 - 4.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
3977 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
3978 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
3979 four3n1n3n1n = ((pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3980 - 2.*reQ4nQ3nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar)
3981 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
3982 + ((pow(dReQ4n,2.)+pow(dImQ4n,2.))-(dMult-4.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3983 + (pow(dReQ2n,2.)+pow(dImQ2n,2.))-(dMult-4.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
3984 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
3985 + (dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.));
3987 // average non-weighted 4-particle correlations for single event:
3988 fQCorrelationsEBE[0]->SetBinContent(11,four1n1n1n1n);
3989 fQCorrelationsEBE[0]->SetBinContent(12,four2n1n2n1n);
3990 fQCorrelationsEBE[0]->SetBinContent(13,four2n2n2n2n);
3991 fQCorrelationsEBE[0]->SetBinContent(14,four3n1n1n1n);
3992 fQCorrelationsEBE[0]->SetBinContent(15,four3n1n3n1n);
3993 fQCorrelationsEBE[0]->SetBinContent(16,four3n1n2n2n);
3994 fQCorrelationsEBE[0]->SetBinContent(17,four4n2n1n1n);
3996 // final average non-weighted 4-particle correlations for all events:
3997 fQCorrelations[0][0]->Fill(10.5,four1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3998 fQCorrelations[0][0]->Fill(11.5,four2n1n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3999 fQCorrelations[0][0]->Fill(12.5,four2n2n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
4000 fQCorrelations[0][0]->Fill(13.5,four3n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
4001 fQCorrelations[0][0]->Fill(14.5,four3n1n3n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
4002 fQCorrelations[0][0]->Fill(15.5,four3n1n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
4003 fQCorrelations[0][0]->Fill(16.5,four4n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
4005 // distribution of <cos(n*(phi1+phi2-phi3-phi4))>
4006 //f4pDistribution->Fill(four1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
4008 } // end of if(dMult>3)
4011 Double_t five2n1n1n1n1n = 0.; // <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>
4012 Double_t five2n2n2n1n1n = 0.; // <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>
4013 Double_t five3n1n2n1n1n = 0.; // <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>
4014 Double_t five4n1n1n1n1n = 0.; // <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>
4018 five2n1n1n1n1n = (reQ2nQ1nQ1nstarQ1nstarQ1nstar-reQ3nQ1nstarQ1nstarQ1nstar+6.*reQ3nQ2nstarQ1nstar)
4019 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
4020 - (reQ2nQ1nQ3nstar+3.*(dMult-6.)*reQ2nQ1nstarQ1nstar+3.*reQ1nQ1nQ2nstar)
4021 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
4022 - (2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
4023 + 3.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
4024 - 3.*(dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
4025 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
4026 - 3.*(pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
4027 - 2.*(2*dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult*(dMult-4.))
4028 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
4030 five2n2n2n1n1n = (reQ2nQ2nQ2nstarQ1nstarQ1nstar-reQ4nQ2nstarQ1nstarQ1nstar-2.*reQ2nQ2nQ3nstarQ1nstar)
4031 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
4032 + 2.*(reQ4nQ2nstarQ2nstar+4.*reQ3nQ2nstarQ1nstar+reQ3nQ1nQ4nstar)
4033 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
4034 + (reQ2nQ2nQ4nstar-2.*(dMult-5.)*reQ2nQ1nstarQ1nstar+2.*reQ1nQ1nQ2nstar)
4035 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
4036 - (2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+4.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
4037 + 1.*pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)
4038 - 2.*(3.*dMult-10.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
4039 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
4040 - (4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
4041 - 4.*(dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))+4.*dMult*(dMult-6.))
4042 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
4044 five4n1n1n1n1n = (reQ4nQ1nstarQ1nstarQ1nstarQ1nstar-6.*reQ4nQ2nstarQ1nstarQ1nstar-4.*reQ3nQ1nstarQ1nstarQ1nstar)
4045 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
4046 + (8.*reQ4nQ3nstarQ1nstar+3.*reQ4nQ2nstarQ2nstar+12.*reQ3nQ2nstarQ1nstar+12.*reQ2nQ1nstarQ1nstar)
4047 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
4048 - (6.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+8.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
4049 + 12.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))+24.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-24.*dMult)
4050 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
4052 five3n1n2n1n1n = (reQ3nQ1nQ2nstarQ1nstarQ1nstar-reQ4nQ2nstarQ1nstarQ1nstar-reQ3nQ1nstarQ1nstarQ1nstar)
4053 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
4054 - (reQ3nQ1nQ2nstarQ2nstar-3.*reQ4nQ3nstarQ1nstar-reQ4nQ2nstarQ2nstar)
4055 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
4056 - ((2.*dMult-13.)*reQ3nQ2nstarQ1nstar-reQ3nQ1nQ4nstar-9.*reQ2nQ1nstarQ1nstar)
4057 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
4058 - (2.*reQ1nQ1nQ2nstar+2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
4059 - 2.*(dMult-5.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+2.*(pow(dReQ3n,2.)
4060 + pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
4061 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
4062 + (2.*(dMult-6.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
4063 - 2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
4064 - pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
4065 + 2.*(3.*dMult-11.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
4066 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))
4067 - 4.*(dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
4069 // average non-weighted 5-particle correlations for single event:
4070 fQCorrelationsEBE[0]->SetBinContent(19,five2n1n1n1n1n);
4071 fQCorrelationsEBE[0]->SetBinContent(20,five2n2n2n1n1n);
4072 fQCorrelationsEBE[0]->SetBinContent(21,five3n1n2n1n1n);
4073 fQCorrelationsEBE[0]->SetBinContent(22,five4n1n1n1n1n);
4075 // final average non-weighted 5-particle correlations for all events:
4076 fQCorrelations[0][0]->Fill(18.5,five2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
4077 fQCorrelations[0][0]->Fill(19.5,five2n2n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
4078 fQCorrelations[0][0]->Fill(20.5,five3n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
4079 fQCorrelations[0][0]->Fill(21.5,five4n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
4080 } // end of if(dMult>4)
4083 Double_t six1n1n1n1n1n1n = 0.; // <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
4084 Double_t six2n2n1n1n1n1n = 0.; // <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>
4085 Double_t six3n1n1n1n1n1n = 0.; // <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>
4086 Double_t six2n1n1n2n1n1n = 0.; // <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>
4090 six1n1n1n1n1n1n = (pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),3.)+9.*dQ2nQ1nQ2nstarQ1nstar-6.*reQ2nQ1nQ1nstarQ1nstarQ1nstar)
4091 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))
4092 + 4.*(reQ3nQ1nstarQ1nstarQ1nstar-3.*reQ3nQ2nstarQ1nstar)
4093 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))
4094 + 2.*(9.*(dMult-4.)*reQ2nQ1nstarQ1nstar+2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.)))
4095 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))
4096 - 9.*(pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)+(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
4097 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-5.))
4098 + (18.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
4099 / (dMult*(dMult-1)*(dMult-3)*(dMult-4))
4100 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
4102 six2n1n1n2n1n1n = (dQ2nQ1nQ1nQ2nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)
4103 * (2.*five2n2n2n1n1n+4.*five2n1n1n1n1n+4.*five3n1n2n1n1n+4.*four2n1n2n1n+1.*four1n1n1n1n)
4104 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four1n1n1n1n+4.*two1n1n
4105 + 2.*three2n1n1n+2.*three2n1n1n+4.*four3n1n1n1n+8.*three2n1n1n+2.*four4n2n1n1n
4106 + 4.*four2n1n2n1n+2.*two2n2n+8.*four2n1n2n1n+4.*four3n1n3n1n+8.*three3n2n1n
4107 + 4.*four3n1n2n2n+4.*four1n1n1n1n+4.*four2n1n2n1n+1.*four2n2n2n2n)
4108 - dMult*(dMult-1.)*(dMult-2.)*(2.*three2n1n1n+8.*two1n1n+4.*two1n1n+2.
4109 + 4.*two1n1n+4.*three2n1n1n+2.*two2n2n+4.*three2n1n1n+8.*three3n2n1n
4110 + 8.*two2n2n+4.*three4n3n1n+4.*two3n3n+4.*three3n2n1n+4.*two1n1n
4111 + 8.*three2n1n1n+4.*two1n1n+4.*three3n2n1n+4.*three2n1n1n+2.*two2n2n
4112 + 4.*three3n2n1n+2.*three4n2n2n)-dMult*(dMult-1.)
4113 * (4.*two1n1n+4.+4.*two1n1n+2.*two2n2n+1.+4.*two1n1n+4.*two2n2n+4.*two3n3n
4114 + 1.+2.*two2n2n+1.*two4n4n)-dMult)
4115 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)
4117 six2n2n1n1n1n1n = (reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)
4118 * (five4n1n1n1n1n+8.*five2n1n1n1n1n+6.*five2n2n2n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)
4119 * (4.*four3n1n1n1n+6.*four4n2n1n1n+12.*three2n1n1n+12.*four1n1n1n1n+24.*four2n1n2n1n
4120 + 4.*four3n1n2n2n+3.*four2n2n2n2n)-dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+12.*three3n2n1n
4121 + 4.*three4n3n1n+3.*three4n2n2n+8.*three2n1n1n+24.*two1n1n+12.*two2n2n+12.*three2n1n1n+8.*three3n2n1n
4122 + 1.*three4n2n2n)-dMult*(dMult-1.)*(4.*two1n1n+6.*two2n2n+4.*two3n3n+1.*two4n4n+2.*two2n2n+8.*two1n1n+6.)-dMult)
4123 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)
4125 six3n1n1n1n1n1n = (reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)
4126 * (five4n1n1n1n1n+4.*five2n1n1n1n1n+6.*five3n1n2n1n1n+4.*four3n1n1n1n)
4127 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four3n1n1n1n+6.*four4n2n1n1n+6.*four1n1n1n1n
4128 + 12.*three2n1n1n+12.*four2n1n2n1n+6.*four3n1n1n1n+12.*three3n2n1n+4.*four3n1n3n1n+3.*four3n1n2n2n)
4129 - dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+12.*three3n2n1n+4.*three4n3n1n+3.*three4n2n2n+4.*two1n1n
4130 + 12.*two1n1n+6.*three2n1n1n+12.*three2n1n1n+4.*three3n2n1n+12.*two2n2n+4.*three3n2n1n+4.*two3n3n+1.*three4n3n1n
4131 + 6.*three3n2n1n)-dMult*(dMult-1.)*(4.*two1n1n+6.*two2n2n+4.*two3n3n+1.*two4n4n+1.*two1n1n+4.+6.*two1n1n+4.*two2n2n
4132 + 1.*two3n3n)-dMult)/(dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)
4134 // average non-weighted 6-particle correlations for single event:
4135 fQCorrelationsEBE[0]->SetBinContent(24,six1n1n1n1n1n1n);
4136 fQCorrelationsEBE[0]->SetBinContent(25,six2n1n1n2n1n1n);
4137 fQCorrelationsEBE[0]->SetBinContent(26,six2n2n1n1n1n1n);
4138 fQCorrelationsEBE[0]->SetBinContent(27,six3n1n1n1n1n1n);
4140 // final average non-weighted 6-particle correlations for all events:
4141 fQCorrelations[0][0]->Fill(23.5,six1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
4142 fQCorrelations[0][0]->Fill(24.5,six2n1n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
4143 fQCorrelations[0][0]->Fill(25.5,six2n2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
4144 fQCorrelations[0][0]->Fill(26.5,six3n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
4146 // distribution of <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
4147 //f6pDistribution->Fill(six1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
4148 } // end of if(dMult>5)
4151 Double_t seven2n1n1n1n1n1n1n = 0.; // <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
4155 seven2n1n1n1n1n1n1n = (reQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)
4156 * (2.*six3n1n1n1n1n1n+4.*six1n1n1n1n1n1n+1.*six2n2n1n1n1n1n+6.*six2n1n1n2n1n1n+8.*five2n1n1n1n1n)
4157 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(1.*five4n1n1n1n1n +8.*five2n1n1n1n1n+8.*four3n1n1n1n
4158 + 12.*five3n1n2n1n1n+4.*five2n1n1n1n1n+3.*five2n2n2n1n1n+6.*five2n2n2n1n1n+6.*four1n1n1n1n+24.*four1n1n1n1n
4159 + 12.*five2n1n1n1n1n+12.*five2n1n1n1n1n+12.*three2n1n1n+24.*four2n1n2n1n+4.*five3n1n2n1n1n+4.*five2n1n1n1n1n)
4160 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four3n1n1n1n+6.*four4n2n1n1n+12.*four1n1n1n1n+24.*three2n1n1n
4161 + 24.*four2n1n2n1n+12.*four3n1n1n1n+24.*three3n2n1n+8.*four3n1n3n1n+6.*four3n1n2n2n+6.*three2n1n1n+12.*four1n1n1n1n
4162 + 12.*four2n1n2n1n+6.*three2n1n1n+12.*four2n1n2n1n+4.*four3n1n2n2n+3.*four2n2n2n2n+4.*four1n1n1n1n+6.*three2n1n1n
4163 + 24.*two1n1n+24.*four1n1n1n1n+4.*four3n1n1n1n+24.*two1n1n+24.*three2n1n1n+12.*two2n2n+24.*three2n1n1n+12.*four2n1n2n1n
4164 + 8.*three3n2n1n+8.*four2n1n2n1n+1.*four4n2n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+1.*three2n1n1n+8.*two1n1n
4165 + 12.*three3n2n1n+24.*two1n1n+12.*three2n1n1n+4.*three2n1n1n+8.*two1n1n+4.*three4n3n1n+24.*three2n1n1n+8.*three3n2n1n
4166 + 12.*two1n1n+12.*two1n1n+3.*three4n2n2n+24.*two2n2n+6.*two2n2n+12.+12.*three3n2n1n+8.*two3n3n+12.*three2n1n1n+24.*two1n1n
4167 + 4.*three3n2n1n+8.*three3n2n1n+2.*three4n3n1n+12.*two1n1n+8.*three2n1n1n+4.*three2n1n1n+2.*three3n2n1n+6.*two2n2n+8.*two2n2n
4168 + 1.*three4n2n2n+4.*three3n2n1n+6.*three2n1n1n)-dMult*(dMult-1.)*(4.*two1n1n+2.*two1n1n+6.*two2n2n+8.+1.*two2n2n+4.*two3n3n
4169 + 12.*two1n1n+4.*two1n1n+1.*two4n4n+8.*two2n2n+6.+2.*two3n3n+4.*two1n1n+1.*two2n2n)-dMult)
4170 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)); // to be improved (direct formula needed)
4172 // average non-weighted 7-particle correlations for single event:
4173 fQCorrelationsEBE[0]->SetBinContent(29,seven2n1n1n1n1n1n1n);
4175 // final average non-weighted 7-particle correlations for all events:
4176 fQCorrelations[0][0]->Fill(28.5,seven2n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.));
4177 } // end of if(dMult>6)
4180 Double_t eight1n1n1n1n1n1n1n1n = 0.; // <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
4183 eight1n1n1n1n1n1n1n1n = (pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),4.)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)
4184 * (12.*seven2n1n1n1n1n1n1n+16.*six1n1n1n1n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)
4185 * (8.*six3n1n1n1n1n1n+48.*six1n1n1n1n1n1n+6.*six2n2n1n1n1n1n+96.*five2n1n1n1n1n+72.*four1n1n1n1n+36.*six2n1n1n2n1n1n)
4186 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(2.*five4n1n1n1n1n+32.*five2n1n1n1n1n+36.*four1n1n1n1n
4187 + 32.*four3n1n1n1n+48.*five2n1n1n1n1n+48.*five3n1n2n1n1n+144.*five2n1n1n1n1n+288.*four1n1n1n1n+36.*five2n2n2n1n1n
4188 + 144.*three2n1n1n+96.*two1n1n+144.*four2n1n2n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)
4189 * (8.*four3n1n1n1n+48.*four1n1n1n1n+12.*four4n2n1n1n+96.*four2n1n2n1n+96.*three2n1n1n+72.*three2n1n1n+144.*two1n1n
4190 + 16.*four3n1n3n1n+48.*four3n1n1n1n+144.*four1n1n1n1n+72.*four1n1n1n1n+96.*three3n2n1n+24.*four3n1n2n2n+144.*four2n1n2n1n
4191 + 288.*two1n1n+288.*three2n1n1n+9.*four2n2n2n2n+72.*two2n2n+24.)-dMult*(dMult-1.)*(dMult-2.)*(12.*three2n1n1n+16.*two1n1n
4192 + 24.*three3n2n1n+48.*three2n1n1n+96.*two1n1n+8.*three4n3n1n+32.*three3n2n1n+96.*three2n1n1n+144.*two1n1n+6.*three4n2n2n
4193 + 96.*two2n2n+36.*two2n2n+72.+48.*three3n2n1n+16.*two3n3n+72.*three2n1n1n+144.*two1n1n)-dMult*(dMult-1.)*(8.*two1n1n
4194 + 12.*two2n2n+16.+8.*two3n3n+48.*two1n1n+1.*two4n4n+16.*two2n2n+18.)-dMult)
4195 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.)); // to be improved (direct formula needed)
4197 // average non-weighted 8-particle correlations for single event:
4198 fQCorrelationsEBE[0]->SetBinContent(31,eight1n1n1n1n1n1n1n1n);
4200 // final average non-weighted 8-particle correlations for all events:
4201 fQCorrelations[0][0]->Fill(30.5,eight1n1n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.));
4203 // distribution of <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
4204 //f8pDistribution->Fill(eight1n1n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.));
4205 } // end of if(dMult>7)
4207 } // end of AliFlowAnalysisWithQCumulants::CalculateCorrelationsForIntegratedFlow()
4251 //================================================================================================================================
4254 void AliFlowAnalysisWithQCumulants::EvaluateNestedLoopsForIntegratedFlow(AliFlowEventSimple* anEvent)
4256 // 1.) Evaluate with nested loops the relevant correlations for integrated flow without and with using the particle weights.
4257 // Results are stored in profiles fDirectCorrelations and fDirectCorrelationsW, respectively.
4259 // 2.) Evaluate with nested loops corrections for non-uniform acceptance relevant for integrated flow,
4260 // without and with using the particle weights.
4261 // Without weights: cos terms are stored in profile fDirectCorrectionsCos, and sin terms in profile fDirectCorrectionsSin.
4262 // With weights: cos terms are stored in profile fDirectCorrectionsCosW, and sin terms in profile fDirectCorrectionsSinW.
4264 // 3.) Binning of fDirectCorrelations is organized as follows:
4266 // 1st bin: <2>_{1n|1n} = two1n1n = cos(n*(phi1-phi2))>
4267 // 2nd bin: <2>_{2n|2n} = two2n2n = cos(2n*(phi1-phi2))>
4268 // 3rd bin: <2>_{3n|3n} = two3n3n = cos(3n*(phi1-phi2))>
4269 // 4th bin: <2>_{4n|4n} = two4n4n = cos(4n*(phi1-phi2))>
4270 // 5th bin: ---- EMPTY ----
4271 // 6th bin: <3>_{2n|1n,1n} = three2n1n1n = <cos(n*(2.*phi1-phi2-phi3))>
4272 // 7th bin: <3>_{3n|2n,1n} = three3n2n1n = <cos(n*(3.*phi1-2.*phi2-phi3))>
4273 // 8th bin: <3>_{4n|2n,2n} = three4n2n2n = <cos(n*(4.*phi1-2.*phi2-2.*phi3))>
4274 // 9th bin: <3>_{4n|3n,1n} = three4n3n1n = <cos(n*(4.*phi1-3.*phi2-phi3))>
4275 // 10th bin: ---- EMPTY ----
4276 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1n = <cos(n*(phi1+phi2-phi3-phi4))>
4277 // 12th bin: <4>_{2n,1n|2n,1n} = four2n1n2n1n = <cos(2.*n*(phi1+phi2-phi3-phi4))>
4278 // 13th bin: <4>_{2n,2n|2n,2n} = four2n2n2n2n = <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>
4279 // 14th bin: <4>_{3n|1n,1n,1n} = four3n1n1n1n = <cos(n*(3.*phi1-phi2-phi3-phi4))>
4280 // 15th bin: <4>_{3n,1n|3n,1n} = four3n1n3n1n = <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>
4281 // 16th bin: <4>_{3n,1n|2n,2n} = four3n1n2n2n = <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>
4282 // 17th bin: <4>_{4n|2n,1n,1n} = four4n2n1n1n = <cos(n*(3.*phi1+phi2-3.*phi3-phi4))>
4283 // 18th bin: ---- EMPTY ----
4284 // 19th bin: <5>_{2n|1n,1n,1n,1n} = five2n1n1n1n1n = <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>
4285 // 20th bin: <5>_{2n,2n|2n,1n,1n} = five2n2n2n1n1n = <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>
4286 // 21st bin: <5>_{3n,1n|2n,1n,1n} = five3n1n2n1n1n = <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>
4287 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = five4n1n1n1n1n = <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>
4288 // 23rd bin: ---- EMPTY ----
4289 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = six1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
4290 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = six2n1n1n2n1n1n = <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>
4291 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = six2n2n1n1n1n1n = <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>
4292 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = six3n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>
4293 // 28th bin: ---- EMPTY ----
4294 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = seven2n1n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
4295 // 30th bin: ---- EMPTY ----
4296 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = eight1n1n1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
4298 // 4.) Binning of fDirectCorrelationsW is organized as follows:
4299 // ..............................................................................................
4300 // ---- bins 1-20: 2-particle correlations ----
4301 // 1st bin: two1n1nW1W1 = <w1 w2 cos(n*(phi1-phi2))>
4302 // 2nd bin: two2n2nW2W2 = <w1^2 w2^2 cos(2n*(phi1-phi2))>
4303 // 3rd bin: two3n3nW3W3 = <w1^3 w2^3 cos(3n*(phi1-phi2))>
4304 // 4th bin: two4n4nW4W4 = <w1^4 w2^4 cos(4n*(phi1-phi2))>
4305 // 5th bin: two1n1nW3W1 = <w1^3 w2 cos(n*(phi1-phi2))>
4306 // 6th bin: two1n1nW1W1W2 = <w1 w2 w3^2 cos(n*(phi1-phi2))>
4307 // ---- bins 21-40: 3-particle correlations ----
4308 // 21st bin: three2n1n1nW2W1W1 = <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
4309 // ---- bins 41-60: 4-particle correlations ----
4310 // 41st bin: four1n1n1n1nW1W1W1W1 = <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
4311 // ---- bins 61-80: 5-particle correlations ----
4312 // ---- bins 81-100: 6-particle correlations ----
4313 // ---- bins 101-120: 7-particle correlations ----
4314 // ---- bins 121-140: 8-particle correlations ----
4315 // ..............................................................................................
4317 // 5.) Binning of fDirectCorrectionsCos is organized as follows:
4318 // ..............................................................................................
4319 // 1st bin: <<cos(n*(phi1))>> = cosP1n
4320 // 2nd bin: <<cos(n*(phi1+phi2))>> = cosP1nP1n
4321 // 3rd bin: <<cos(n*(phi1-phi2-phi3))>> = cosP1nM1nM1n
4323 // ..............................................................................................
4325 // 6.) Binning of fDirectCorrectionsSin is organized as follows:
4326 // ..............................................................................................
4327 // 1st bin: <<sin(n*(phi1))>> = sinP1n
4328 // 2nd bin: <<sin(n*(phi1+phi2))>> = sinP1nP1n
4329 // 3rd bin: <<sin(n*(phi1-phi2-phi3))>> = sinP1nM1nM1n
4331 // ..............................................................................................
4333 // 7.) Binning of fDirectCorrectionsCosW is organized as follows:
4334 // ..............................................................................................
4336 // ..............................................................................................
4338 // 8.) Binning of fDirectCorrectionsSinW is organized as follows:
4339 // ..............................................................................................
4341 // ..............................................................................................
4343 Int_t nPrim = anEvent->NumberOfTracks();
4344 AliFlowTrackSimple *aftsTrack = NULL;
4346 Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
4347 Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1., wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
4349 Int_t n = fHarmonic;
4351 // 2-particle correlations and 1- and 2-particle correction terms:
4352 for(Int_t i1=0;i1<nPrim;i1++)
4354 aftsTrack=anEvent->GetTrack(i1);
4355 if(!(aftsTrack->InRPSelection())) continue;
4356 phi1=aftsTrack->Phi();
4357 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
4359 // corrections for non-uniform acceptance:
4361 fDirectCorrectionsCos->Fill(0.5,cos(n*phi1),1.); // <cos(n*phi1)>
4362 fDirectCorrectionsSin->Fill(0.5,sin(n*phi1),1.); // <sin(n*phi1)>
4364 // fDirectCorrectionsCosW->Fill(0.5,???,1); // to be improved (continued)
4365 // fDirectCorrectionsSinW->Fill(0.5,???,1); // to be improved (continued)
4367 for(Int_t i2=0;i2<nPrim;i2++)
4370 aftsTrack=anEvent->GetTrack(i2);
4371 if(!(aftsTrack->InRPSelection())) continue;
4372 phi2=aftsTrack->Phi();
4373 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
4375 // non-weighted correlations:
4376 fDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),1.); // <cos(n*(phi1-phi2))>
4377 fDirectCorrelations->Fill(1.5,cos(2.*n*(phi1-phi2)),1.); // <cos(2n*(phi1-phi2))>
4378 fDirectCorrelations->Fill(2.5,cos(3.*n*(phi1-phi2)),1.); // <cos(3n*(phi1-phi2))>
4379 fDirectCorrelations->Fill(3.5,cos(4.*n*(phi1-phi2)),1.); // <cos(4n*(phi1-phi2))>
4381 // weighted correlations:
4382 // ................................................................................................................
4383 if(fUsePhiWeights) fDirectCorrelationsW->Fill(0.5,cos(n*(phi1-phi2)),wPhi1*wPhi2); // <w1 w2 cos( n*(phi1-phi2))>
4384 if(fUsePhiWeights) fDirectCorrelationsW->Fill(1.5,cos(2.*n*(phi1-phi2)),pow(wPhi1,2)*pow(wPhi2,2)); // <w1^2 w2^2 cos(2n*(phi1-phi2))>
4385 if(fUsePhiWeights) fDirectCorrelationsW->Fill(2.5,cos(3.*n*(phi1-phi2)),pow(wPhi1,3)*pow(wPhi2,3)); // <w1^3 w2^3 cos(3n*(phi1-phi2))>
4386 if(fUsePhiWeights) fDirectCorrelationsW->Fill(3.5,cos(4.*n*(phi1-phi2)),pow(wPhi1,4)*pow(wPhi2,4)); // <w1^4 w2^4 cos(4n*(phi1-phi2))>
4387 if(fUsePhiWeights) fDirectCorrelationsW->Fill(4.5,cos(n*(phi1-phi2)),pow(wPhi1,3)*wPhi2); // <w1^3 w2 cos(n*(phi1-phi2))>
4389 // ................................................................................................................
4391 // non-weighted corrections for non-uniform acceptance (cos terms)
4392 // ................................................................................................................
4393 fDirectCorrectionsCos->Fill(1.5,cos(n*(phi1+phi2)),1.); // <<cos(n*(phi1+phi2))>>
4395 // ................................................................................................................
4397 // non-weighted corrections for non-uniform acceptance (sin terms)
4398 // ................................................................................................................
4399 fDirectCorrectionsSin->Fill(1.5,sin(n*(phi1+phi2)),1.); // <<sin(n*(phi1+phi2))>>
4401 // ................................................................................................................
4403 // weighted corrections for non-uniform acceptance (cos terms)
4404 // ................................................................................................................
4405 // fDirectCorrectionsCosW->Fill(1.5,???,1.); // to be improved (continued)
4407 // ................................................................................................................
4409 // non-weighted corrections for non-uniform acceptance (sin terms)
4410 // ................................................................................................................
4411 // fDirectCorrectionsSinW->Fill(1.5,???,1.); // to be improved (continued)
4413 // ................................................................................................................
4415 } // end of for(Int_t i2=0;i2<nPrim;i2++)
4416 } // end of for(Int_t i1=0;i1<nPrim;i1++)
4418 // 3-particle correlations:
4419 for(Int_t i1=0;i1<nPrim;i1++)
4421 aftsTrack=anEvent->GetTrack(i1);
4422 if(!(aftsTrack->InRPSelection())) continue;
4423 phi1=aftsTrack->Phi();
4424 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
4425 for(Int_t i2=0;i2<nPrim;i2++)
4428 aftsTrack=anEvent->GetTrack(i2);
4429 if(!(aftsTrack->InRPSelection())) continue;
4430 phi2=aftsTrack->Phi();
4431 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
4432 for(Int_t i3=0;i3<nPrim;i3++)
4434 if(i3==i1||i3==i2)continue;
4435 aftsTrack=anEvent->GetTrack(i3);
4436 if(!(aftsTrack->InRPSelection())) continue;
4437 phi3=aftsTrack->Phi();
4438 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
4440 // non-weighted correlations:
4441 fDirectCorrelations->Fill(5.,cos(2.*n*phi1-n*(phi2+phi3)),1.); //<3>_{2n|nn,n}
4442 fDirectCorrelations->Fill(6.,cos(3.*n*phi1-2.*n*phi2-n*phi3),1.); //<3>_{3n|2n,n}
4443 fDirectCorrelations->Fill(7.,cos(4.*n*phi1-2.*n*phi2-2.*n*phi3),1.); //<3>_{4n|2n,2n}
4444 fDirectCorrelations->Fill(8.,cos(4.*n*phi1-3.*n*phi2-n*phi3),1.); //<3>_{4n|3n,n}
4446 // weighted correlations:
4447 // ..............................................................................................................................
4449 if(fUsePhiWeights) fDirectCorrelationsW->Fill(5.,cos(n*(phi1-phi2)),wPhi1*wPhi2*pow(wPhi3,2)); // <w1 w2 w3^2 cos(n*(phi1-phi2))>
4451 if(fUsePhiWeights) fDirectCorrelationsW->Fill(20.,cos(2.*n*phi1-n*(phi2+phi3)),pow(wPhi1,2)*wPhi2*wPhi3); // <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
4453 // ..............................................................................................................................
4455 // non-weighted corrections for non-uniform acceptance (cos terms)
4456 // ................................................................................................................
4457 fDirectCorrectionsCos->Fill(2.,cos(n*(phi1-phi2-phi3)),1.); // <<cos(n*(phi1-phi2-phi3))>>
4459 // ................................................................................................................
4461 // non-weighted corrections for non-uniform acceptance (sin terms)
4462 // ................................................................................................................
4463 fDirectCorrectionsSin->Fill(2.,sin(n*(phi1-phi2-phi3)),1.); // <<sin(n*(phi1-phi2-phi3))>>
4465 // ................................................................................................................
4467 // weighted corrections for non-uniform acceptance (cos terms)
4468 // ................................................................................................................
4470 // ................................................................................................................
4472 // weighted corrections for non-uniform acceptance (sin terms)
4473 // ................................................................................................................
4475 // ................................................................................................................
4477 } // end of for(Int_t i3=0;i3<nPrim;i3++)
4478 } // end of for(Int_t i2=0;i2<nPrim;i2++)
4479 } // end of for(Int_t i1=0;i1<nPrim;i1++)
4481 // 4-particle correlations:
4482 for(Int_t i1=0;i1<nPrim;i1++)
4484 aftsTrack=anEvent->GetTrack(i1);
4485 if(!(aftsTrack->InRPSelection())) continue;
4486 phi1=aftsTrack->Phi();
4487 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
4488 for(Int_t i2=0;i2<nPrim;i2++)
4491 aftsTrack=anEvent->GetTrack(i2);
4492 if(!(aftsTrack->InRPSelection())) continue;
4493 phi2=aftsTrack->Phi();
4494 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
4495 for(Int_t i3=0;i3<nPrim;i3++)
4497 if(i3==i1||i3==i2)continue;
4498 aftsTrack=anEvent->GetTrack(i3);
4499 if(!(aftsTrack->InRPSelection())) continue;
4500 phi3=aftsTrack->Phi();
4501 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
4502 for(Int_t i4=0;i4<nPrim;i4++)
4504 if(i4==i1||i4==i2||i4==i3)continue;
4505 aftsTrack=anEvent->GetTrack(i4);
4506 if(!(aftsTrack->InRPSelection())) continue;
4507 phi4=aftsTrack->Phi();
4508 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
4511 fDirectCorrelations->Fill(10.,cos(n*phi1+n*phi2-n*phi3-n*phi4),1.); // <4>_{n,n|n,n}
4512 fDirectCorrelations->Fill(11.,cos(2.*n*phi1+n*phi2-2.*n*phi3-n*phi4),1.); // <4>_{2n,n|2n,n}
4513 fDirectCorrelations->Fill(12.,cos(2.*n*phi1+2*n*phi2-2.*n*phi3-2.*n*phi4),1.); // <4>_{2n,2n|2n,2n}
4514 fDirectCorrelations->Fill(13.,cos(3.*n*phi1-n*phi2-n*phi3-n*phi4),1.); // <4>_{3n|n,n,n}
4515 fDirectCorrelations->Fill(14.,cos(3.*n*phi1+n*phi2-3.*n*phi3-n*phi4),1.); // <4>_{3n,n|3n,n}
4516 fDirectCorrelations->Fill(15.,cos(3.*n*phi1+n*phi2-2.*n*phi3-2.*n*phi4),1.); // <4>_{3n,n|2n,2n}
4517 fDirectCorrelations->Fill(16.,cos(4.*n*phi1-2.*n*phi2-n*phi3-n*phi4),1.); // <4>_{4n|2n,n,n}
4520 //.......................................................................................
4522 if(fUsePhiWeights) fDirectCorrelationsW->Fill(40.,cos(n*phi1+n*phi2-n*phi3-n*phi4),wPhi1*wPhi2*wPhi3*wPhi4);
4524 //.......................................................................................
4531 // 5-particle correlations:
4532 for(Int_t i1=0;i1<nPrim;i1++)
4534 //cout<<"i1 = "<<i1<<endl;
4535 aftsTrack=anEvent->GetTrack(i1);
4536 if(!(aftsTrack->InRPSelection())) continue;
4537 phi1=aftsTrack->Phi();
4538 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
4539 for(Int_t i2=0;i2<nPrim;i2++)
4542 aftsTrack=anEvent->GetTrack(i2);
4543 if(!(aftsTrack->InRPSelection())) continue;
4544 phi2=aftsTrack->Phi();
4545 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
4546 for(Int_t i3=0;i3<nPrim;i3++)
4548 if(i3==i1||i3==i2)continue;
4549 aftsTrack=anEvent->GetTrack(i3);
4550 if(!(aftsTrack->InRPSelection())) continue;
4551 phi3=aftsTrack->Phi();
4552 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
4553 for(Int_t i4=0;i4<nPrim;i4++)
4555 if(i4==i1||i4==i2||i4==i3)continue;
4556 aftsTrack=anEvent->GetTrack(i4);
4557 if(!(aftsTrack->InRPSelection())) continue;
4558 phi4=aftsTrack->Phi();
4559 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
4560 for(Int_t i5=0;i5<nPrim;i5++)
4562 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
4563 aftsTrack=anEvent->GetTrack(i5);
4564 if(!(aftsTrack->InRPSelection())) continue;
4565 phi5=aftsTrack->Phi();
4566 if(fUsePhiWeights && fPhiWeights) wPhi5 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi5*fnBinsPhi/TMath::TwoPi())));
4569 //------------------------------------------------------------------------------------------------------
4570 fDirectCorrelations->Fill(18.,cos(2.*n*phi1+n*phi2-n*phi3-n*phi4-n*phi5),1.); //<5>_{2n,n|n,n,n}
4571 fDirectCorrelations->Fill(19.,cos(2.*n*phi1+2.*n*phi2-2.*n*phi3-n*phi4-n*phi5),1.); //<5>_{2n,2n|2n,n,n}
4572 fDirectCorrelations->Fill(20.,cos(3.*n*phi1+n*phi2-2.*n*phi3-n*phi4-n*phi5),1.); //<5>_{3n,n|2n,n,n}
4573 fDirectCorrelations->Fill(21.,cos(4.*n*phi1-n*phi2-n*phi3-n*phi4-n*phi5),1.); //<5>_{4n|n,n,n,n}
4574 //------------------------------------------------------------------------------------------------------
4577 //..............................................................................................................
4579 if(fUsePhiWeights) fDirectCorrelationsW->Fill(60.,cos(2.*n*phi1+n*phi2-n*phi3-n*phi4-n*phi5),pow(wPhi1,2)*wPhi2*wPhi3*wPhi4*wPhi5);
4580 //..............................................................................................................
4588 // 6-particle correlations:
4589 for(Int_t i1=0;i1<nPrim;i1++)
4591 //cout<<"i1 = "<<i1<<endl;
4592 aftsTrack=anEvent->GetTrack(i1);
4593 if(!(aftsTrack->InRPSelection())) continue;
4594 phi1=aftsTrack->Phi();
4595 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
4596 for(Int_t i2=0;i2<nPrim;i2++)
4599 aftsTrack=anEvent->GetTrack(i2);
4600 if(!(aftsTrack->InRPSelection())) continue;
4601 phi2=aftsTrack->Phi();
4602 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
4603 for(Int_t i3=0;i3<nPrim;i3++)
4605 if(i3==i1||i3==i2)continue;
4606 aftsTrack=anEvent->GetTrack(i3);
4607 if(!(aftsTrack->InRPSelection())) continue;
4608 phi3=aftsTrack->Phi();
4609 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
4610 for(Int_t i4=0;i4<nPrim;i4++)
4612 if(i4==i1||i4==i2||i4==i3)continue;
4613 aftsTrack=anEvent->GetTrack(i4);
4614 if(!(aftsTrack->InRPSelection())) continue;
4615 phi4=aftsTrack->Phi();
4616 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
4617 for(Int_t i5=0;i5<nPrim;i5++)
4619 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
4620 aftsTrack=anEvent->GetTrack(i5);
4621 if(!(aftsTrack->InRPSelection())) continue;
4622 phi5=aftsTrack->Phi();
4623 if(fUsePhiWeights && fPhiWeights) wPhi5 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi5*fnBinsPhi/TMath::TwoPi())));
4624 for(Int_t i6=0;i6<nPrim;i6++)
4626 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
4627 aftsTrack=anEvent->GetTrack(i6);
4628 if(!(aftsTrack->InRPSelection())) continue;
4629 phi6=aftsTrack->Phi();
4630 if(fUsePhiWeights && fPhiWeights) wPhi6 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi6*fnBinsPhi/TMath::TwoPi())));
4633 //-----------------------------------------------------------------------------------------------------------
4634 fDirectCorrelations->Fill(23.,cos(n*phi1+n*phi2+n*phi3-n*phi4-n*phi5-n*phi6),1.); //<6>_{n,n,n|n,n,n}
4635 fDirectCorrelations->Fill(24.,cos(2.*n*phi1+n*phi2+n*phi3-2.*n*phi4-n*phi5-n*phi6),1.); //<6>_{2n,n,n|2n,n,n}
4636 fDirectCorrelations->Fill(25.,cos(2.*n*phi1+2.*n*phi2-n*phi3-n*phi4-n*phi5-n*phi6),1.); //<6>_{2n,2n|n,n,n,n}
4637 fDirectCorrelations->Fill(26.,cos(3.*n*phi1+n*phi2-n*phi3-n*phi4-n*phi5-n*phi6),1.); //<6>_{3n,n|n,n,n,n}
4638 //-----------------------------------------------------------------------------------------------------------
4641 //.................................................................................................................
4643 if(fUsePhiWeights) fDirectCorrelationsW->Fill(80.,cos(n*phi1+n*phi2+n*phi3-n*phi4-n*phi5-n*phi6),wPhi1*wPhi2*wPhi3*wPhi4*wPhi5*wPhi6);
4644 //.................................................................................................................
4653 // 7-particle correlations:
4654 for(Int_t i1=0;i1<nPrim;i1++)
4656 //cout<<"i1 = "<<i1<<endl;
4657 aftsTrack=anEvent->GetTrack(i1);
4658 if(!(aftsTrack->InRPSelection())) continue;
4659 phi1=aftsTrack->Phi();
4660 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
4661 for(Int_t i2=0;i2<nPrim;i2++)
4664 aftsTrack=anEvent->GetTrack(i2);
4665 if(!(aftsTrack->InRPSelection())) continue;
4666 phi2=aftsTrack->Phi();
4667 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
4668 for(Int_t i3=0;i3<nPrim;i3++)
4670 if(i3==i1||i3==i2)continue;
4671 aftsTrack=anEvent->GetTrack(i3);
4672 if(!(aftsTrack->InRPSelection())) continue;
4673 phi3=aftsTrack->Phi();
4674 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
4675 for(Int_t i4=0;i4<nPrim;i4++)
4677 if(i4==i1||i4==i2||i4==i3)continue;
4678 aftsTrack=anEvent->GetTrack(i4);
4679 if(!(aftsTrack->InRPSelection())) continue;
4680 phi4=aftsTrack->Phi();
4681 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
4682 for(Int_t i5=0;i5<nPrim;i5++)
4684 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
4685 aftsTrack=anEvent->GetTrack(i5);
4686 if(!(aftsTrack->InRPSelection())) continue;
4687 phi5=aftsTrack->Phi();
4688 if(fUsePhiWeights && fPhiWeights) wPhi5 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi5*fnBinsPhi/TMath::TwoPi())));
4689 for(Int_t i6=0;i6<nPrim;i6++)
4691 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
4692 aftsTrack=anEvent->GetTrack(i6);
4693 if(!(aftsTrack->InRPSelection())) continue;
4694 phi6=aftsTrack->Phi();
4695 if(fUsePhiWeights && fPhiWeights) wPhi6 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi6*fnBinsPhi/TMath::TwoPi())));
4696 for(Int_t i7=0;i7<nPrim;i7++)
4698 if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;
4699 aftsTrack=anEvent->GetTrack(i7);
4700 if(!(aftsTrack->InRPSelection())) continue;
4701 phi7=aftsTrack->Phi();
4702 if(fUsePhiWeights && fPhiWeights) wPhi7 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi7*fnBinsPhi/TMath::TwoPi())));
4705 //---------------------------------------------------------------------------------------------------------------
4706 fDirectCorrelations->Fill(28.,cos(2.*n*phi1+n*phi2+n*phi3-n*phi4-n*phi5-n*phi6-n*phi7),1.);//<7>_{2n,n,n|n,n,n,n}
4707 //---------------------------------------------------------------------------------------------------------------
4710 //..........................................................................................................................................
4711 if(fUsePhiWeights) fDirectCorrelationsW->Fill(100.,cos(2.*n*phi1+n*phi2+n*phi3-n*phi4-n*phi5-n*phi6-n*phi7),
4712 pow(wPhi1,2.)*wPhi2*wPhi3*wPhi4*wPhi5*wPhi6*wPhi7);
4713 //..........................................................................................................................................
4725 // 8-particle correlations:
4726 for(Int_t i1=0;i1<nPrim;i1++)
4728 cout<<"i1 = "<<i1<<endl;
4729 aftsTrack=anEvent->GetTrack(i1);
4730 if(!(aftsTrack->InRPSelection())) continue;
4731 phi1=aftsTrack->Phi();
4732 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
4733 for(Int_t i2=0;i2<nPrim;i2++)
4736 aftsTrack=anEvent->GetTrack(i2);
4737 if(!(aftsTrack->InRPSelection())) continue;
4738 phi2=aftsTrack->Phi();
4739 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
4740 for(Int_t i3=0;i3<nPrim;i3++)
4742 if(i3==i1||i3==i2)continue;
4743 aftsTrack=anEvent->GetTrack(i3);
4744 if(!(aftsTrack->InRPSelection())) continue;
4745 phi3=aftsTrack->Phi();
4746 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
4747 for(Int_t i4=0;i4<nPrim;i4++)
4749 if(i4==i1||i4==i2||i4==i3)continue;
4750 aftsTrack=anEvent->GetTrack(i4);
4751 if(!(aftsTrack->InRPSelection())) continue;
4752 phi4=aftsTrack->Phi();
4753 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
4754 for(Int_t i5=0;i5<nPrim;i5++)
4756 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
4757 aftsTrack=anEvent->GetTrack(i5);
4758 if(!(aftsTrack->InRPSelection())) continue;
4759 phi5=aftsTrack->Phi();
4760 if(fUsePhiWeights && fPhiWeights) wPhi5 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi5*fnBinsPhi/TMath::TwoPi())));
4761 for(Int_t i6=0;i6<nPrim;i6++)
4763 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
4764 aftsTrack=anEvent->GetTrack(i6);
4765 if(!(aftsTrack->InRPSelection())) continue;
4766 phi6=aftsTrack->Phi();
4767 if(fUsePhiWeights && fPhiWeights) wPhi6 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi6*fnBinsPhi/TMath::TwoPi())));
4768 for(Int_t i7=0;i7<nPrim;i7++)
4770 if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;
4771 aftsTrack=anEvent->GetTrack(i7);
4772 if(!(aftsTrack->InRPSelection())) continue;
4773 phi7=aftsTrack->Phi();
4774 if(fUsePhiWeights && fPhiWeights) wPhi7 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi7*fnBinsPhi/TMath::TwoPi())));
4775 for(Int_t i8=0;i8<nPrim;i8++)
4777 if(i8==i1||i8==i2||i8==i3||i8==i4||i8==i5||i8==i6||i8==i7)continue;
4778 aftsTrack=anEvent->GetTrack(i8);
4779 if(!(aftsTrack->InRPSelection())) continue;
4780 phi8=aftsTrack->Phi();
4781 if(fUsePhiWeights && fPhiWeights) wPhi8 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi8*fnBinsPhi/TMath::TwoPi())));
4784 //--------------------------------------------------------------------------------------------------------------------
4785 fDirectCorrelations->Fill(30.,cos(n*phi1+n*phi2+n*phi3+n*phi4-n*phi5-n*phi6-n*phi7-n*phi8),1.);//<8>_{n,n,n,n|n,n,n,n}
4786 //--------------------------------------------------------------------------------------------------------------------
4789 //...........................................................................................................................................
4790 if(fUsePhiWeights) fDirectCorrelationsW->Fill(120.,cos(n*phi1+n*phi2+n*phi3+n*phi4-n*phi5-n*phi6-n*phi7-n*phi8),
4791 wPhi1*wPhi2*wPhi3*wPhi4*wPhi5*wPhi6*wPhi7*wPhi8);
4792 //...........................................................................................................................................
4803 } // end of AliFlowAnalysisWithQCumulants::EvaluateNestedLoopsForIntegratedFlow(AliFlowEventSimple* anEvent)
4806 //================================================================================================================================
4809 void AliFlowAnalysisWithQCumulants::CompareResultsFromNestedLoopsAndFromQVectorsForIntFlow(Bool_t useParticleWeights)
4811 // compare results needed for int. flow calculated with nested loops and with those calculated from Q-vectors
4815 cout<<" *************************************"<<endl;
4816 cout<<" **** cross-checking the formulas ****"<<endl;
4817 cout<<" **** for integrated flow ****"<<endl;
4818 cout<<" *************************************"<<endl;
4822 if(!(useParticleWeights))
4824 cout<<" **** results for non-weighted correlations: ****"<<endl;
4826 cout<<"<2>_{1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(1)<<endl;
4827 cout<<"<2>_{1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(1)<<endl;
4829 cout<<"<2>_{2n,2n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(2)<<endl;
4830 cout<<"<2>_{2n,2n} from nested loops = "<<fDirectCorrelations->GetBinContent(2)<<endl;
4832 cout<<"<2>_{3n,3n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(3)<<endl;
4833 cout<<"<2>_{3n,3n} from nested loops = "<<fDirectCorrelations->GetBinContent(3)<<endl;
4835 cout<<"<2>_{4n,4n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(4)<<endl;
4836 cout<<"<2>_{4n,4n} from nested loops = "<<fDirectCorrelations->GetBinContent(4)<<endl;
4838 cout<<"<3>_{2n|1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(6)<<endl;
4839 cout<<"<3>_{2n|1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(6)<<endl;
4841 cout<<"<3>_{3n|2n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(7)<<endl;
4842 cout<<"<3>_{3n|2n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(7)<<endl;
4844 cout<<"<3>_{4n,2n,2n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(8)<<endl;
4845 cout<<"<3>_{4n,2n,2n} from nested loops = "<<fDirectCorrelations->GetBinContent(8)<<endl;
4847 cout<<"<3>_{4n,3n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(9)<<endl;
4848 cout<<"<3>_{4n,3n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(9)<<endl;
4850 cout<<"<4>_{1n,1n|1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(11)<<endl;
4851 cout<<"<4>_{1n,1n|1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(11)<<endl;
4853 cout<<"<4>_{2n,1n|2n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(12)<<endl;
4854 cout<<"<4>_{2n,1n|2n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(12)<<endl;
4856 cout<<"<4>_{2n,2n|2n,2n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(13)<<endl;
4857 cout<<"<4>_{2n,2n|2n,2n} from nested loops = "<<fDirectCorrelations->GetBinContent(13)<<endl;
4859 cout<<"<4>_{3n|1n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(14)<<endl;
4860 cout<<"<4>_{3n|1n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(14)<<endl;
4862 cout<<"<4>_{3n,1n|3n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(15)<<endl;
4863 cout<<"<4>_{3n,1n|3n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(15)<<endl;
4865 cout<<"<4>_{3n,1n|2n,2n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(16)<<endl;
4866 cout<<"<4>_{3n,1n|2n,2n} from nested loops = "<<fDirectCorrelations->GetBinContent(16)<<endl;
4868 cout<<"<4>_{4n|2n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(17)<<endl;
4869 cout<<"<4>_{4n|2n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(17)<<endl;
4871 cout<<"<5>_{2n,1n|1n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(19)<<endl;
4872 cout<<"<5>_{2n,1n|1n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(19)<<endl;
4874 cout<<"<5>_{2n,2n|2n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(20)<<endl;
4875 cout<<"<5>_{2n,2n|2n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(20)<<endl;
4877 cout<<"<5>_{3n,1n|2n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(21)<<endl;
4878 cout<<"<5>_{3n,1n|2n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(21)<<endl;
4880 cout<<"<5>_{4n|1n,1n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(22)<<endl;
4881 cout<<"<5>_{4n|1n,1n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(22)<<endl;
4883 cout<<"<6>_{1n,1n,1n|1n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(24)<<endl;
4884 cout<<"<6>_{1n,1n,1n|1n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(24)<<endl;
4886 cout<<"<6>_{2n,1n,1n|2n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(25)<<endl;
4887 cout<<"<6>_{2n,1n,1n|2n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(25)<<endl;
4889 cout<<"<6>_{2n,2n|1n,1n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(26)<<endl;
4890 cout<<"<6>_{2n,2n|1n,1n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(26)<<endl;
4892 cout<<"<6>_{3n,1n|1n,1n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(27)<<endl;
4893 cout<<"<6>_{3n,1n|1n,1n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(27)<<endl;
4895 cout<<"<7>_{2n,1n,1n|1n,1n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(29)<<endl;
4896 cout<<"<7>_{2n,1n,1n|1n,1n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(29)<<endl;
4898 cout<<"<8>_{1n,1n,1n,1n|1n,1n,1n,1n} from Q-vectors = "<<fQCorrelations[0][0]->GetBinContent(31)<<endl;
4899 cout<<"<8>_{1n,1n,1n,1n|1n,1n,1n,1n} from nested loops = "<<fDirectCorrelations->GetBinContent(31)<<endl;
4902 cout<<" **** results for non-weighted correction terms: ****"<<endl;
4904 //.........................................................................................
4905 cout<<"<cos(n*phi1)> from Q-vectors = "<<fQCorrections[0][0][1]->GetBinContent(1)<<endl;
4906 cout<<"<cos(n*phi1)> from nested loops = "<<fDirectCorrectionsCos->GetBinContent(1)<<endl;
4908 cout<<"<sin(n*phi1)> from Q-vectors = "<<fQCorrections[0][0][0]->GetBinContent(1)<<endl;
4909 cout<<"<sin(n*phi1)> from nested loops = "<<fDirectCorrectionsSin->GetBinContent(1)<<endl;
4911 cout<<"<cos(n*(phi1+phi2))> from Q-vectors = "<<fQCorrections[0][0][1]->GetBinContent(2)<<endl;
4912 cout<<"<cos(n*(phi1+phi2))> from nested loops = "<<fDirectCorrectionsCos->GetBinContent(2)<<endl;
4914 cout<<"<sin(n*(phi1+phi2))> from Q-vectors = "<<fQCorrections[0][0][0]->GetBinContent(2)<<endl;
4915 cout<<"<sin(n*(phi1+phi2))> from nested loops = "<<fDirectCorrectionsSin->GetBinContent(2)<<endl;
4917 cout<<"<cos(n*(phi1-phi2-phi3))> from Q-vectors = "<<fQCorrections[0][0][1]->GetBinContent(3)<<endl;
4918 cout<<"<cos(n*(phi1-phi2-phi3))> from nested loops = "<<fDirectCorrectionsCos->GetBinContent(3)<<endl;
4920 cout<<"<sin(n*(phi1-phi2-phi3))> from Q-vectors = "<<fQCorrections[0][0][0]->GetBinContent(3)<<endl;
4921 cout<<"<sin(n*(phi1-phi2-phi3))> from nested loops = "<<fDirectCorrectionsSin->GetBinContent(3)<<endl;
4923 //.........................................................................................
4926 if(useParticleWeights)
4928 cout<<" **** results for weighted correlations: ****"<<endl;
4930 //.........................................................................................
4931 cout<<"<w1 w2 cos(n*(phi1-phi2))> from Q-vectors = "<<fQCorrelations[1][0]->GetBinContent(1)<<endl;
4932 cout<<"<<w1 w2 cos(n*(phi1-phi2))> from nested loops = "<<fDirectCorrelationsW->GetBinContent(1)<<endl;
4934 cout<<"<w1^2 w2^2 cos(2n*(phi1-phi2))> from Q-vectors = "<<fQCorrelations[1][0]->GetBinContent(2)<<endl;
4935 cout<<"<w1^2 w2^2 cos(2n*(phi1-phi2))> from nested loops = "<<fDirectCorrelationsW->GetBinContent(2)<<endl;
4937 cout<<"<w1^3 w2^3 cos(3n*(phi1-phi2))> from Q-vectors = "<<fQCorrelations[1][0]->GetBinContent(3)<<endl;
4938 cout<<"<w1^3 w2^3 cos(3n*(phi1-phi2))> from nested loops = "<<fDirectCorrelationsW->GetBinContent(3)<<endl;
4940 cout<<"<w1^4 w2^4 cos(4n*(phi1-phi2))> from Q-vectors = "<<fQCorrelations[1][0]->GetBinContent(4)<<endl;
4941 cout<<"<w1^4 w2^4 cos(4n*(phi1-phi2))> from nested loops = "<<fDirectCorrelationsW->GetBinContent(4)<<endl;
4944 cout<<"<w1^3 w2 cos(n*(phi1-phi2))> from Q-vectors = "<<fQCorrelationsW->GetBinContent(5)<<endl;
4945 cout<<"<w1^3 w2 cos(n*(phi1-phi2))> from nested loops = "<<fDirectCorrelationsW->GetBinContent(5)<<endl;
4947 cout<<"<w1 w2 w3^2 cos(n*(phi1-phi2))> from Q-vectors = "<<fQCorrelationsW->GetBinContent(6)<<endl;
4948 cout<<"<w1 w2 w3^2 cos(n*(phi1-phi2))> from nested loops = "<<fDirectCorrelationsW->GetBinContent(6)<<endl;
4950 cout<<"<w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))> from Q-vectors = "<<fQCorrelationsW->GetBinContent(21)<<endl;
4951 cout<<"<w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))> from nested loops = "<<fDirectCorrelationsW->GetBinContent(21)<<endl;
4954 cout<<"<w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> from Q-vectors = "<<fQCorrelations[1][0]->GetBinContent(11)<<endl;
4955 cout<<"<w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> from nested loops = "<<fDirectCorrelationsW->GetBinContent(41)<<endl;
4957 //.........................................................................................
4960 //cout<<" **** results for weighted correction terms: ****"<<endl;
4962 //.........................................................................................
4965 } // end of AliFlowAnalysisWithQCumulants::CompareResultsFromNestedLoopsAndFromQVectorsForIntFlow(Bool_t useParticleWeights)
4968 //================================================================================================================================
4971 void AliFlowAnalysisWithQCumulants::CalculateQProductsForIntFlow()
4973 // calculate averages like <<2><4>>, <<2><6>>, <<4><6>>, etc. which are needed to calculate covariances
4975 // binning of fQProducts is organized as follows:
4984 Double_t dMult = (*fSMpk)(0,0); // multiplicity (number of particles used to determine the reaction plane)
4986 Double_t twoEBE = 0.; // <2>
4987 Double_t fourEBE = 0.; // <4>
4988 Double_t sixEBE = 0.; // <6>
4989 Double_t eightEBE = 0.; // <8>
4991 twoEBE = fQCorrelationsEBE[0]->GetBinContent(1);
4992 fourEBE = fQCorrelationsEBE[0]->GetBinContent(11);
4995 sixEBE = fQCorrelationsEBE[0]->GetBinContent(24);
4998 eightEBE = fQCorrelationsEBE[0]->GetBinContent(31);
5005 fQProducts[0][0]->Fill(0.5,twoEBE*fourEBE,dMult*(dMult-1)*dMult*(dMult-1)*(dMult-2)*(dMult-3));
5011 fQProducts[0][0]->Fill(1.5,twoEBE*sixEBE,dMult*(dMult-1)*dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5));
5017 fQProducts[0][0]->Fill(2.5,twoEBE*eightEBE,dMult*(dMult-1)*dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7));
5023 fQProducts[0][0]->Fill(3.5,fourEBE*sixEBE,dMult*(dMult-1)*(dMult-2)*(dMult-3)*dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5));
5029 fQProducts[0][0]->Fill(4.5,fourEBE*eightEBE,dMult*(dMult-1)*(dMult-2)*(dMult-3)*
5030 dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7));
5036 fQProducts[0][0]->Fill(5.5,sixEBE*eightEBE,dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*
5037 dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7));
5040 } // end of AliFlowAnalysisWithQCumulants::CalculateQProductsForIntFlow()
5043 //================================================================================================================================
5046 void AliFlowAnalysisWithQCumulants::CalculateCovariancesForIntFlow(Bool_t useParticleWeights, TString eventWeights)
5048 // calculate covariances Cov(2,4), Cov(2,6), etc (needed to propagate errors for integrated flow)
5050 // binning of fCovariances[pW] is organized as follows:
5052 // 1st bin: <<2><4>>-<<2>><<4>>
5053 // 2nd bin: <<2><6>>-<<2>><<6>>
5054 // 3rd bin: <<2><8>>-<<2>><<8>>
5055 // 4th bin: <<4><6>>-<<4>><<6>>
5056 // 5th bin: <<4><8>>-<<4>><<8>>
5057 // 6th bin: <<6><8>>-<<6>><<8>>
5059 // shortcuts for flags:
5060 Int_t pW = (Int_t)(useParticleWeights);
5063 if(eventWeights == "exact")
5068 for(Int_t power=0;power<2;power++)
5070 if(!(fQCorrelations[pW][eW] && fQProducts[pW][eW] && fCovariances[pW][eW] && fSumOfEventWeights[pW][eW][power] && fProductOfEventWeights[pW][eW]))
5072 cout<<"WARNING: fQCorrelations[pW][eW] && fQProducts[pW][eW] && fCovariances[pW][eW] && fSumOfEventWeights[pW][eW][power] && fProductOfEventWeights[pW][eW] is NULL in AFAWQC::CCFIF() !!!!"<<endl;
5073 cout<<"pW = "<<pW<<endl;
5074 cout<<"eW = "<<eW<<endl;
5075 cout<<"power = "<<power<<endl;
5080 // average 2-, 4-, 6- and 8-particle azimuthal correlations for all events:
5081 Double_t two = fCorrelations[pW][eW]->GetBinContent(1); // <<2>>
5082 Double_t four = fCorrelations[pW][eW]->GetBinContent(11); // <<4>>
5083 Double_t six = fCorrelations[pW][eW]->GetBinContent(24); // <<6>>
5084 Double_t eight = fCorrelations[pW][eW]->GetBinContent(31); // <<8>>
5085 // average products of 2-, 4-, 6- and 8-particle azimuthal correlations:
5086 Double_t product24 = fQProducts[pW][eW]->GetBinContent(1); // <<2><4>>
5087 Double_t product26 = fQProducts[pW][eW]->GetBinContent(2); // <<2><6>>
5088 Double_t product28 = fQProducts[pW][eW]->GetBinContent(3); // <<2><8>>
5089 Double_t product46 = fQProducts[pW][eW]->GetBinContent(4); // <<4><6>>
5090 Double_t product48 = fQProducts[pW][eW]->GetBinContent(5); // <<4><8>>
5091 Double_t product68 = fQProducts[pW][eW]->GetBinContent(6); // <<6><8>>
5092 // denominator in the expression for the unbiased estimator for covariance:
5093 Double_t denom24 = 0.;
5094 if(fSumOfEventWeights[pW][eW][0]->GetBinContent(1) && fSumOfEventWeights[pW][eW][0]->GetBinContent(2))
5096 denom24 = 1-(fProductOfEventWeights[pW][eW]->GetBinContent(1))/
5097 (fSumOfEventWeights[pW][eW][0]->GetBinContent(1) * fSumOfEventWeights[pW][eW][0]->GetBinContent(2));
5099 Double_t denom26 = 0.;
5100 if(fSumOfEventWeights[pW][eW][0]->GetBinContent(1) && fSumOfEventWeights[pW][eW][0]->GetBinContent(3))
5102 denom26 = 1-(fProductOfEventWeights[pW][eW]->GetBinContent(2))/
5103 (fSumOfEventWeights[pW][eW][0]->GetBinContent(1) * fSumOfEventWeights[pW][eW][0]->GetBinContent(3));
5105 Double_t denom28 = 0.;
5106 if(fSumOfEventWeights[pW][eW][0]->GetBinContent(1) && fSumOfEventWeights[pW][eW][0]->GetBinContent(4))
5108 denom28 = 1-(fProductOfEventWeights[pW][eW]->GetBinContent(3))/
5109 (fSumOfEventWeights[pW][eW][0]->GetBinContent(1) * fSumOfEventWeights[pW][eW][0]->GetBinContent(4));
5111 Double_t denom46 = 0.;
5112 if(fSumOfEventWeights[pW][eW][0]->GetBinContent(2) && fSumOfEventWeights[pW][eW][0]->GetBinContent(3))
5114 denom46 = 1-(fProductOfEventWeights[pW][eW]->GetBinContent(4))/
5115 (fSumOfEventWeights[pW][eW][0]->GetBinContent(2) * fSumOfEventWeights[pW][eW][0]->GetBinContent(3));
5117 Double_t denom48 = 0.;
5118 if(fSumOfEventWeights[pW][eW][0]->GetBinContent(2) && fSumOfEventWeights[pW][eW][0]->GetBinContent(4))
5120 denom48 = 1-(fProductOfEventWeights[pW][eW]->GetBinContent(5))/
5121 (fSumOfEventWeights[pW][eW][0]->GetBinContent(2) * fSumOfEventWeights[pW][eW][0]->GetBinContent(4));
5123 Double_t denom68 = 0.;
5124 if(fSumOfEventWeights[pW][eW][0]->GetBinContent(3) && fSumOfEventWeights[pW][eW][0]->GetBinContent(4))
5126 denom68 = 1-(fProductOfEventWeights[pW][eW]->GetBinContent(6))/
5127 (fSumOfEventWeights[pW][eW][0]->GetBinContent(3) * fSumOfEventWeights[pW][eW][0]->GetBinContent(4));
5130 // final covariances:
5131 Double_t cov24 = 0.;
5134 cov24 = (product24-two*four)/denom24; // Cov(<2>,<4>)
5135 fCovariances[pW][eW]->SetBinContent(1,cov24);
5137 Double_t cov26 = 0.;
5140 cov26 = (product26-two*six)/denom26; // Cov(<2>,<6>)
5141 fCovariances[pW][eW]->SetBinContent(2,cov26);
5143 Double_t cov28 = 0.;
5146 cov28 = (product28-two*eight)/denom28; // Cov(<2>,<8>)
5147 fCovariances[pW][eW]->SetBinContent(3,cov28);
5149 Double_t cov46 = 0.;
5152 cov46 = (product46-four*six)/denom46; // Cov(<4>,<6>)
5153 fCovariances[pW][eW]->SetBinContent(4,cov46);
5155 Double_t cov48 = 0.;
5158 cov48 = (product48-four*eight)/denom48; // Cov(<4>,<8>)
5159 fCovariances[pW][eW]->SetBinContent(5,cov48);
5161 Double_t cov68 = 0.;
5164 cov68 = (product68-six*eight)/denom68; // Cov(<6>,<8>)
5165 fCovariances[pW][eW]->SetBinContent(6,cov68);
5168 } // end of AliFlowAnalysisWithQCumulants::CalculateCovariancesForIntFlow(Bool_t useParticleWeights, TString eventWeights)
5171 //================================================================================================================================
5174 void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsForIntFlow(Bool_t useParticleWeights, TString eventWeights) // to be improved (there is better way to implement this method)
5176 // From fQCorrelations[pW][eW] access measured correlations and spread, calculate statistical errors and store the
5177 // final results and statistical errors for correlations in fCorrelations[pW][eW] (binning is the same as in fQCorrelations[pW][eW]).
5179 // shortcuts for flags:
5180 Int_t pW = (Int_t)(useParticleWeights);
5184 if(eventWeights == "exact")
5189 for(Int_t power=0;power<2;power++)
5191 if(!(fQCorrelations[pW][eW] && fCorrelations[pW][eW] && fSumOfEventWeights[pW][eW][power]))
5193 cout<<"WARNING: fQCorrelations[pW][eW] && fCorrelations[pW][eW] && fSumOfEventWeights[pW][eW][power] is NULL in AFAWQC::FCFIF() !!!!"<<endl;
5194 cout<<"pW = "<<pW<<endl;
5195 cout<<"eW = "<<eW<<endl;
5196 cout<<"power = "<<power<<endl;
5202 Double_t correlation2p = fQCorrelations[pW][eW]->GetBinContent(1);
5203 Double_t spread2p = fQCorrelations[pW][eW]->GetBinError(1);
5204 Double_t sumOfEventWeightsLinear2p = fSumOfEventWeights[pW][eW][0]->GetBinContent(1);
5205 Double_t sumOfEventWeightsQuadratic2p = fSumOfEventWeights[pW][eW][1]->GetBinContent(1);
5206 // stat.error = termA * spread * termB:
5207 // termB = 1/sqrt(1-termA^2)
5208 Double_t termA2p = 0.;
5209 Double_t termB2p = 0.;
5210 Double_t statError2p = 0.;
5211 if(sumOfEventWeightsLinear2p)
5213 termA2p = pow(sumOfEventWeightsQuadratic2p,0.5)/sumOfEventWeightsLinear2p;
5216 cout<<"WARNING: sumOfEventWeightsLinear2p == 0 in in AFAWQC::FCFIF() !!!!"<<endl;
5219 if(1-pow(termA2p,2.) > 0)
5221 termB2p = 1./pow(1-pow(termA2p,2.),0.5);
5224 cout<<"WARNING: 1-pow(termA2p,2.) <= 0 in in AFAWQC::FCFIF() !!!!"<<endl;
5227 statError2p = termA2p*spread2p*termB2p;
5228 fCorrelations[pW][eW]->SetBinContent(1,correlation2p);
5229 fCorrelations[pW][eW]->SetBinError(1,statError2p);
5232 Double_t correlation4p = fQCorrelations[pW][eW]->GetBinContent(11);
5233 Double_t spread4p = fQCorrelations[pW][eW]->GetBinError(11);
5234 Double_t sumOfEventWeightsLinear4p = fSumOfEventWeights[pW][eW][0]->GetBinContent(2);
5235 Double_t sumOfEventWeightsQuadratic4p = fSumOfEventWeights[pW][eW][1]->GetBinContent(2);
5236 Double_t termA4p = 0.;
5237 Double_t termB4p = 0.;
5238 Double_t statError4p = 0.;
5239 if(sumOfEventWeightsLinear4p)
5241 termA4p = pow(sumOfEventWeightsQuadratic4p,0.5)/sumOfEventWeightsLinear4p;
5244 cout<<"WARNING: sumOfEventWeightsLinear4p == 0 in in AFAWQC::FCFIF() !!!!"<<endl;
5246 if(1-pow(termA4p,2.) > 0)
5248 termB4p = 1./pow(1-pow(termA4p,2.),0.5);
5251 cout<<"WARNING: 1-pow(termA4p,2.) <= 0 in in AFAWQC::FCFIF() !!!!"<<endl;
5254 statError4p = termA4p*spread4p*termB4p;
5255 fCorrelations[pW][eW]->SetBinContent(11,correlation4p);
5256 fCorrelations[pW][eW]->SetBinError(11,statError4p);
5259 Double_t correlation6p = fQCorrelations[pW][eW]->GetBinContent(24);
5260 Double_t spread6p = fQCorrelations[pW][eW]->GetBinError(24);
5261 Double_t sumOfEventWeightsLinear6p = fSumOfEventWeights[pW][eW][0]->GetBinContent(3);
5262 Double_t sumOfEventWeightsQuadratic6p = fSumOfEventWeights[pW][eW][1]->GetBinContent(3);
5263 Double_t termA6p = 0.;
5264 Double_t termB6p = 0.;
5265 Double_t statError6p = 0.;
5266 if(sumOfEventWeightsLinear6p)
5268 termA6p = pow(sumOfEventWeightsQuadratic6p,0.5)/sumOfEventWeightsLinear6p;
5271 cout<<"WARNING: sumOfEventWeightsLinear6p == 0 in in AFAWQC::FCFIF() !!!!"<<endl;
5273 if(1-pow(termA6p,2.) > 0)
5275 termB6p = 1./pow(1-pow(termA6p,2.),0.5);
5278 cout<<"WARNING: 1-pow(termA6p,2.) <= 0 in in AFAWQC::FCFIF() !!!!"<<endl;
5281 statError6p = termA6p*spread6p*termB6p;
5282 fCorrelations[pW][eW]->SetBinContent(24,correlation6p);
5283 fCorrelations[pW][eW]->SetBinError(24,statError6p);
5286 Double_t correlation8p = fQCorrelations[pW][eW]->GetBinContent(31);
5288 fCorrelations[pW][eW]->SetBinContent(31,correlation8p);
5291 } // end of AliFlowAnalysisWithQCumulants::FinalizeCorrelationsForIntFlow(Bool_t useParticleWeights, TString eventWeights)
5294 //================================================================================================================================
5297 void AliFlowAnalysisWithQCumulants::FillAverageMultiplicities(Int_t nRP)
5299 // Fill profile fAverageMultiplicity to hold average multiplicities and number of events for events with nRP>=0, nRP>=1, ... , and nRP>=8
5301 // Binning of fAverageMultiplicity is organized as follows:
5302 // 1st bin: all events (including the empty ones)
5303 // 2nd bin: event with # of RPs greater or equal to 1
5304 // 3rd bin: event with # of RPs greater or equal to 2
5305 // 4th bin: event with # of RPs greater or equal to 3
5306 // 5th bin: event with # of RPs greater or equal to 4
5307 // 6th bin: event with # of RPs greater or equal to 5
5308 // 7th bin: event with # of RPs greater or equal to 6
5309 // 8th bin: event with # of RPs greater or equal to 7
5310 // 9th bin: event with # of RPs greater or equal to 8
5312 if(!fAvMultiplicity)
5314 cout<<"WARNING: fAvMultiplicity is NULL in AFAWQC::FAM() !!!!"<<endl;
5320 cout<<"WARNING: nRP<0 in in AFAWQC::FAM() !!!!"<<endl;
5324 for(Int_t i=0;i<9;i++)
5326 if(nRP>=i) fAvMultiplicity->Fill(i+0.5,nRP,1);
5329 } // end of AliFlowAnalysisWithQCumulants::FillAverageMultiplicities(nRP)
5332 //================================================================================================================================
5335 void AliFlowAnalysisWithQCumulants::CalculateCumulantsForIntFlow(Bool_t useParticleWeights, TString eventWeights)
5337 // calculate cumulants from measured correlations and store results in fCumulants[pW][eW][0].
5338 // (Remark: these cumulants are biased by non-uniform acceptance, corrected cumulants are stored in fCumulants[pW][eW][1].)
5340 // Binning of fCumulants[pW][nua] is organized as follows:
5346 // shortcuts for the flags:
5347 Int_t pW = (Int_t)(useParticleWeights); // (0=weights not used, 1=weights used)
5351 if(eventWeights == "exact")
5356 if(!(fCorrelations[pW][eW] && fCovariances[pW][eW] && fCumulants[pW][eW][0] && fAvMultiplicity))
5358 cout<<"WARNING: fCorrelations[pW][eW] && fCovariances[pW][eW] && fCumulants[pW][eW][0] && fAvMultiplicity is NULL in AFAWQC::CCFIF() !!!!"<<endl;
5359 cout<<"pW = "<<pW<<endl;
5360 cout<<"eW = "<<eW<<endl;
5365 Double_t two = fCorrelations[pW][eW]->GetBinContent(1); // <<2>>
5366 Double_t four = fCorrelations[pW][eW]->GetBinContent(11); // <<4>>
5367 Double_t six = fCorrelations[pW][eW]->GetBinContent(24); // <<6>>
5368 Double_t eight = fCorrelations[pW][eW]->GetBinContent(31); // <<8>>
5369 // stat. error of correlations:
5370 Double_t twoError = fCorrelations[pW][eW]->GetBinError(1); // stat. error of <<2>>
5371 Double_t fourError = fCorrelations[pW][eW]->GetBinError(11); // stat. error of <<4>>
5372 Double_t sixError = fCorrelations[pW][eW]->GetBinError(24); // stat. error of <<6>>
5373 //Double_t eightError = fQCorrelations[pW]->GetBinError(31); // stat. error of <<8>>
5374 // spread of correlations:
5375 Double_t twoSpread = 0.; // spread of <<2>>
5376 Double_t fourSpread = 0.; // spread of <<6>>
5377 Double_t sixSpread = 0.; // spread of <<8>>
5378 //Double_t eightSpread = 0.;
5379 // stat. error = prefactor * spread:
5380 Double_t twoPrefactor = 0;
5381 if(fSumOfEventWeights[pW][eW][0]->GetBinContent(1))
5383 twoPrefactor = pow(fSumOfEventWeights[pW][eW][1]->GetBinContent(1),0.5)/fSumOfEventWeights[pW][eW][0]->GetBinContent(1);
5384 if(twoPrefactor) twoSpread = twoError/twoPrefactor;
5386 Double_t fourPrefactor = 0;
5387 if(fSumOfEventWeights[pW][eW][0]->GetBinContent(2))
5389 fourPrefactor = pow(fSumOfEventWeights[pW][eW][1]->GetBinContent(2),0.5)/fSumOfEventWeights[pW][eW][0]->GetBinContent(2);
5390 if(fourPrefactor) fourSpread = fourError/fourPrefactor;
5392 Double_t sixPrefactor = 0;
5393 if(fSumOfEventWeights[pW][eW][0]->GetBinContent(3))
5395 sixPrefactor = pow(fSumOfEventWeights[pW][eW][1]->GetBinContent(3),0.5)/fSumOfEventWeights[pW][eW][0]->GetBinContent(3);
5396 if(sixPrefactor) sixSpread = sixError/sixPrefactor;
5400 Double_t cov24 = fCovariances[pW][eW]->GetBinContent(1); // Cov(<2>,<4>)
5401 Double_t cov26 = fCovariances[pW][eW]->GetBinContent(2); // Cov(<2>,<6>)
5402 //Double_t cov28 = fCovariances[pW]->GetBinContent(3); // Cov(<2>,<8>)
5403 Double_t cov46 = fCovariances[pW][eW]->GetBinContent(4); // Cov(<4>,<6>)
5404 //Double_t cov48 = fCovariances[pW]->GetBinContent(5); // Cov(<4>,<8>)
5405 //Double_t cov68 = fCovariances[pW]->GetBinContent(6); // Cov(<6>,<8>)
5407 Double_t qc2 = 0.; // QC{2}
5408 Double_t qc4 = 0.; // QC{4}
5409 Double_t qc6 = 0.; // QC{6}
5410 Double_t qc8 = 0.; // QC{8}
5413 if(four) qc4 = four-2.*pow(two,2.);
5414 if(six) qc6 = six-9.*two*four+12.*pow(two,3.);
5415 if(eight) qc8 = eight-16.*two*six-18.*pow(four,2.)+144.*pow(two,2.)*four-144.*pow(two,4.);
5417 // stat. error of cumulants:
5418 Double_t qc2Error = 0; // stat. error of QC{2}
5419 Double_t qc4Error = 0; // stat. error of QC{4}
5420 Double_t qc6Error = 0; // stat. error of QC{6}
5421 // Double_t qc8Error = 0; // stat. error of QC{8} // to be improved (calculated)
5422 // spread of cumulants:
5423 //Double_t qc2Spread = 0; // spread of QC{2}
5424 Double_t qc4Spread = 0; // spread of QC{4}
5425 Double_t qc6Spread = 0; // spread of QC{6}
5426 // Double_t qc8Spread = 0; // spread of QC{8} // to be improved (calculated)
5428 qc2Error = twoError; // final stat. error of QC{2}
5430 if(16.*pow(two,2.)*pow(twoSpread,2.)+pow(fourSpread,2.)-8.*two*cov24 >= 0.)
5432 qc4Spread = pow(16.*pow(two,2.)*pow(twoSpread,2.)+pow(fourSpread,2.)-8.*two*cov24,0.5);
5435 cout<<"WARNING: spread of QC{4} is imaginary !!!!"<<endl;
5438 qc4Error = fourPrefactor*qc4Spread; // final stat. error of QC{4}
5440 if(81.*pow(4.*pow(two,2.)-four,2.)*pow(twoSpread,2.)
5441 + 81.*pow(two,2.)*pow(fourSpread,2.)+pow(sixSpread,2.)
5442 - 162.*(4.*pow(two,2.)-four)*two*cov24
5443 + 18.*(4.*pow(two,2.)-four)*cov26
5444 - 18.*two*cov46 >= 0.)
5446 qc6Spread = pow(81.*pow(4.*pow(two,2.)-four,2.)*pow(twoSpread,2.)
5447 + 81.*pow(two,2.)*pow(fourSpread,2.)+pow(sixSpread,2.)
5448 - 162.*(4.*pow(two,2.)-four)*two*cov24
5449 + 18.*(4.*pow(two,2.)-four)*cov26
5450 - 18.*two*cov46,0.5);
5453 cout<<"WARNING: stat. error of QC{6} is imaginary !!!!"<<endl;
5456 qc6Error = sixPrefactor*qc6Spread; // final stat. error of QC{6}
5458 // store the results and statistical errors for cumulants:
5459 fCumulants[pW][eW][0]->SetBinContent(1,qc2);
5460 fCumulants[pW][eW][0]->SetBinError(1,qc2Error);
5461 fCumulants[pW][eW][0]->SetBinContent(2,qc4);
5462 fCumulants[pW][eW][0]->SetBinError(2,qc4Error);
5463 fCumulants[pW][eW][0]->SetBinContent(3,qc6);
5464 fCumulants[pW][eW][0]->SetBinError(3,qc6Error);
5465 fCumulants[pW][eW][0]->SetBinContent(4,qc8);
5466 // fCumulants[pW]->SetBinError(4,qc8Error); // to be improved (calculated)
5468 } // end of AliFlowAnalysisWithQCumulants::CalculateCumulantsForIntFlow(Bool_t useParticleWeights, TString eventWeights)
5471 //================================================================================================================================
5474 void AliFlowAnalysisWithQCumulants::CalculateIntFlow(Bool_t useParticleWeights, TString eventWeights, Bool_t correctedForNUA)
5476 // calculate final results for integrated flow
5478 // Results for integrated flow are stored in fInfFlow[pW][nua]. Binning of fIntFlow[pW][nua] is organized as follows:
5484 // shortcuts for the flags:
5485 Int_t pW = (Int_t)(useParticleWeights); // 0=pWeights not useed, 1=pWeights used
5486 Int_t nua = (Int_t)(correctedForNUA); // 0=not corrected for NUA, 1=corrected for NUA
5489 if(eventWeights = "exact")
5494 if(!(fCumulants[pW][eW][nua] && fIntFlow[pW][eW][nua]))
5496 cout<<"WARNING: fCumulants[pW][eW][nua] && fIntFlow[pW][eW][nua] is NULL in AFAWQC::CIF() !!!!"<<endl;
5497 cout<<"pW = "<<pW<<endl;
5498 cout<<"eW = "<<eW<<endl;
5499 cout<<"nua = "<<nua<<endl;
5504 Double_t qc2 = fCumulants[pW][eW][nua]->GetBinContent(1); // QC{2}
5505 Double_t qc4 = fCumulants[pW][eW][nua]->GetBinContent(2); // QC{4}
5506 Double_t qc6 = fCumulants[pW][eW][nua]->GetBinContent(3); // QC{6}
5507 Double_t qc8 = fCumulants[pW][eW][nua]->GetBinContent(4); // QC{8}
5509 // cumulants' statistical errors:
5510 Double_t qc2Error = fCumulants[pW][eW][nua]->GetBinError(1); // error of QC{2}
5511 Double_t qc4Error = fCumulants[pW][eW][nua]->GetBinError(2); // error of QC{4}
5512 Double_t qc6Error = fCumulants[pW][eW][nua]->GetBinError(3); // error of QC{6}
5513 //Double_t qc8Error = fCumulants[pW][nua]->GetBinError(4); // error of QC{8}
5515 // integrated flow estimates:
5516 Double_t v2 = 0.; // v{2}
5517 Double_t v4 = 0.; // v{4}
5518 Double_t v6 = 0.; // v{6}
5519 Double_t v8 = 0.; // v{8}
5521 // calculate integrated flow estimates from cumulants:
5522 if(qc2>=0.) v2 = pow(qc2,1./2.);
5523 if(qc4<=0.) v4 = pow(-1.*qc4,1./4.);
5524 if(qc6>=0.) v6 = pow((1./4.)*qc6,1./6.);
5525 if(qc8<=0.) v8 = pow((-1./33.)*qc8,1./8.);
5527 // statistical errors of integrated flow estimates:
5528 Double_t v2Error = 0.; // error of v{2}
5529 Double_t v4Error = 0.; // error of v{4}
5530 Double_t v6Error = 0.; // error of v{6}
5531 Double_t v8Error = 0.; // error of v{8}
5533 // calculate statistical errors for integrated flow estimates:
5534 if(qc2>0.) v2Error = (1./(2.*pow(qc2,0.5)))*qc2Error;
5535 if(qc4<0.) v4Error = (1./(4.*pow(-1.*qc4,3./4.)))*qc4Error;
5536 if(qc6>0.) v6Error = (1./(6.*pow(2.,1./3.)*pow(qc6,5./6.)))*qc6Error;
5537 if(qc8<0.) v8Error = 0.; // to be improved (calculated)
5539 // store final results and statistical errors for integrated flow:
5540 fIntFlow[pW][eW][nua]->SetBinContent(1,v2);
5541 fIntFlow[pW][eW][nua]->SetBinError(1,v2Error);
5542 fIntFlow[pW][eW][nua]->SetBinContent(2,v4);
5543 fIntFlow[pW][eW][nua]->SetBinError(2,v4Error);
5544 fIntFlow[pW][eW][nua]->SetBinContent(3,v6);
5545 fIntFlow[pW][eW][nua]->SetBinError(3,v6Error);
5546 fIntFlow[pW][eW][nua]->SetBinContent(4,v8);
5547 fIntFlow[pW][eW][nua]->SetBinError(4,v8Error);
5549 } // end of AliFlowAnalysisWithQCumulants::CalculateIntFlow(Bool_t useParticleWeights, TString eventWeights, Bool_t correctedForNUA)
5552 //================================================================================================================================
5555 void AliFlowAnalysisWithQCumulants::FillCommonHistResultsIntFlow(Bool_t useParticleWeights, TString eventWeights, Bool_t correctedForNUA)
5557 // fill in AliFlowCommonHistResults histograms relevant for 'NONAME' integrated flow (to be improved (name))
5559 // shortcuts for the flags:
5560 Int_t pW = (Int_t)(useParticleWeights); // 0=pWeights not useed, 1=pWeights used
5561 Int_t nua = (Int_t)(correctedForNUA); // 0=not corrected for NUA, 1=corrected for NUA
5564 if(eventWeights == "exact")
5569 if(!fIntFlow[pW][eW][nua])
5571 cout<<"WARNING: fIntFlow[pW][eW][nua] is NULL in AFAWQC::FCHRIF() !!!!"<<endl;
5572 cout<<"pW = "<<pW<<endl;
5573 cout<<"eW = "<<eW<<endl;
5574 cout<<"nua = "<<nua<<endl;
5578 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
5580 cout<<"WARNING: fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th"<<endl;
5581 cout<<" is NULL in AFAWQC::FCHRIF() !!!!"<<endl;
5585 Double_t v2 = fIntFlow[pW][eW][nua]->GetBinContent(1);
5586 Double_t v4 = fIntFlow[pW][eW][nua]->GetBinContent(2);
5587 Double_t v6 = fIntFlow[pW][eW][nua]->GetBinContent(3);
5588 Double_t v8 = fIntFlow[pW][eW][nua]->GetBinContent(4);
5590 Double_t v2Error = fIntFlow[pW][eW][nua]->GetBinError(1);
5591 Double_t v4Error = fIntFlow[pW][eW][nua]->GetBinError(2);
5592 Double_t v6Error = fIntFlow[pW][eW][nua]->GetBinError(3);
5593 Double_t v8Error = fIntFlow[pW][eW][nua]->GetBinError(4);
5595 fCommonHistsResults2nd->FillIntegratedFlow(v2,v2Error);
5596 fCommonHistsResults4th->FillIntegratedFlow(v4,v4Error);
5597 fCommonHistsResults6th->FillIntegratedFlow(v6,v6Error);
5598 fCommonHistsResults8th->FillIntegratedFlow(v8,v8Error);
5600 } // end of AliFlowAnalysisWithQCumulants::FillCommonHistResultsIntFlow(Bool_t useParticleWeights, TString eventWeights, Bool_t correctedForNUA)
5603 //================================================================================================================================
5606 void AliFlowAnalysisWithQCumulants::ApplyCorrectionForNonUniformAcceptanceToCumulantsForIntFlow(Bool_t useParticleWeights, TString eventWeights)
5608 // apply correction for non-uniform acceptance to cumulants for integrated flow
5609 // (Remark: non-corrected cumulants are accessed from fCumulants[pW][0], corrected cumulants are stored in fCumulants[pW][1])
5611 // shortcuts for the flags:
5612 Int_t pW = (Int_t)(useParticleWeights); // 0=pWeights not used, 1=pWeights used
5615 if(eventWeights == "exact")
5620 if(!(fCumulants[pW][eW][0] && fCumulants[pW][eW][1] && fCorrections[pW][eW]))
5622 cout<<"WARNING: fCumulants[pW][eW][0] && fCumulants[pW][eW][1] && fCorrections[pW][eW] is NULL in AFAWQC::ACFNUATCFIF() !!!!"<<endl;
5623 cout<<"pW = "<<pW<<endl;
5624 cout<<"eW = "<<eW<<endl;
5628 // non-corrected cumulants:
5629 Double_t qc2 = fCumulants[pW][eW][0]->GetBinContent(1);
5630 Double_t qc4 = fCumulants[pW][eW][0]->GetBinContent(2);
5631 Double_t qc6 = fCumulants[pW][eW][0]->GetBinContent(3);
5632 Double_t qc8 = fCumulants[pW][eW][0]->GetBinContent(4);
5633 // statistical error of non-corrected cumulants:
5634 Double_t qc2Error = fCumulants[pW][eW][0]->GetBinError(1);
5635 Double_t qc4Error = fCumulants[pW][eW][0]->GetBinError(2);
5636 Double_t qc6Error = fCumulants[pW][eW][0]->GetBinError(3);
5637 Double_t qc8Error = fCumulants[pW][eW][0]->GetBinError(4);
5638 // corrections for non-uniform acceptance:
5639 Double_t qc2Correction = fCorrections[pW][eW]->GetBinContent(1);
5640 Double_t qc4Correction = fCorrections[pW][eW]->GetBinContent(2);
5641 Double_t qc6Correction = fCorrections[pW][eW]->GetBinContent(3);
5642 Double_t qc8Correction = fCorrections[pW][eW]->GetBinContent(4);
5643 // corrected cumulants:
5644 Double_t qc2Corrected = qc2 + qc2Correction;
5645 Double_t qc4Corrected = qc4 + qc4Correction;
5646 Double_t qc6Corrected = qc6 + qc6Correction;
5647 Double_t qc8Corrected = qc8 + qc8Correction;
5649 // ... to be improved (I need here also to correct error of QCs for NUA.
5650 // For simplicity sake I assume at the moment that this correction is negliglible, but it will be added eventually...)
5652 // store corrected results and statistical errors for cumulants:
5653 fCumulants[pW][eW][1]->SetBinContent(1,qc2Corrected);
5654 fCumulants[pW][eW][1]->SetBinContent(2,qc4Corrected);
5655 fCumulants[pW][eW][1]->SetBinContent(3,qc6Corrected);
5656 fCumulants[pW][eW][1]->SetBinContent(4,qc8Corrected);
5657 fCumulants[pW][eW][1]->SetBinError(1,qc2Error); // to be improved (correct also qc2Error for NUA)
5658 fCumulants[pW][eW][1]->SetBinError(2,qc4Error); // to be improved (correct also qc4Error for NUA)
5659 fCumulants[pW][eW][1]->SetBinError(3,qc6Error); // to be improved (correct also qc6Error for NUA)
5660 fCumulants[pW][eW][1]->SetBinError(4,qc8Error); // to be improved (correct also qc8Error for NUA)
5662 } // end of AliFlowAnalysisWithQCumulants::ApplyCorrectionForNonUniformAcceptanceToCumulantsForIntFlow(Bool_t useParticleWeights, TString eventWeights)
5665 //================================================================================================================================
5668 void AliFlowAnalysisWithQCumulants::PrintQuantifyingCorrectionsForNonUniformAcceptance(Bool_t useParticleWeights, TString eventWeights)
5670 // print on the screen QC{n,biased}/QC{n,corrected}
5672 // shortcuts for the flags:
5673 Int_t pW = (Int_t)(useParticleWeights); // 0=pWeights not used, 1=pWeights used
5677 if(eventWeights == "exact")
5682 if(!(fCumulants[pW][eW][0] && fCumulants[pW][eW][1]))
5684 cout<<"WARNING: fCumulants[pW][eW][0] && fCumulants[pW][eW][1] is NULL in AFAWQC::PQCFNUA() !!!!"<<endl;
5685 cout<<"pW = "<<pW<<endl;
5686 cout<<"eW = "<<eW<<endl;
5691 cout<<" Quantifying the bias to Q-cumulants from"<<endl;
5692 cout<<" non-uniform acceptance of the detector:"<<endl;
5695 if(fCumulants[pW][eW][1]->GetBinContent(1))
5697 cout<<" QC{2,biased}/QC{2,corrected} = "<<(fCumulants[pW][eW][0]->GetBinContent(1))/(fCumulants[pW][eW][1]->GetBinContent(1))<<endl;
5699 if(fCumulants[pW][eW][1]->GetBinContent(2))
5701 cout<<" QC{4,biased}/QC{4,corrected} = "<<fCumulants[pW][eW][0]->GetBinContent(2)/fCumulants[pW][eW][1]->GetBinContent(2)<<endl;
5706 } // end of AliFlowAnalysisWithQCumulants::PrintQuantifyingCorrectionsForNonUniformAcceptance(Bool_t useParticleWeights, TString eventWeights)
5709 //================================================================================================================================
5712 void AliFlowAnalysisWithQCumulants::CalculateWeightedCorrelationsForIntegratedFlow()
5714 // calculate all weighted correlations needed for integrated flow and store them in 1D profile fQCorrelations[1][eW] and fQExtraCorrelations[1][eW]
5716 for(Int_t eW=0;eW<2;eW++)
5718 if(!(fQCorrelationsEBE[1] && fQCorrelations[1][eW]))
5720 cout<<"WARNING: fQCorrelationsEBE[1] && fQCorrelations[1][eW] is NULL in AFAWQC::CWCFIF() !!!!"<<endl;
5721 cout<<"eW = "<<eW<<endl;
5726 // Remark 1: binning of fQCorrelations[W] is organized as follows:
5727 //..............................................................................................
5728 // ---- bins 1-20: 2-particle correlations ----
5729 // 1st bin: two1n1nW1W1 = <w1 w2 cos(n*(phi1-phi2))>
5730 // 2nd bin: two2n2nW2W2 = <w1^2 w2^2 cos(2n*(phi1-phi2))>
5731 // 3rd bin: two3n3nW3W3 = <w1^3 w2^3 cos(3n*(phi1-phi2))>
5732 // 4th bin: two4n4nW4W4 = <w1^4 w2^4 cos(4n*(phi1-phi2))>
5733 // 5th bin: two1n1nW3W1 = <w1^3 w2 cos(n*(phi1-phi2))>
5734 // 6th bin: two1n1nW1W1W2 = <w1 w2 w3^2 cos(n*(phi1-phi2))>
5735 // ---- bins 21-40: 3-particle correlations ----
5736 // 21st bin: three2n1n1nW2W1W1 = <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
5737 // ---- bins 41-60: 4-particle correlations ----
5738 // 41st bin: four1n1n1n1nW1W1W1W1 = <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
5739 // ---- bins 61-80: 5-particle correlations ----
5740 // ---- bins 81-100: 6-particle correlations ----
5741 // ---- bins 101-120: 7-particle correlations ----
5742 // ---- bins 121-140: 8-particle correlations ----
5743 //..............................................................................................
5745 // multiplicity (number of particles used to determine the reaction plane)
5746 Double_t dMult = (*fSMpk)(0,0);
5748 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
5749 Double_t dReQ1n1k = (*fReQ)(0,1);
5750 Double_t dReQ2n2k = (*fReQ)(1,2);
5751 Double_t dReQ3n3k = (*fReQ)(2,3);
5752 Double_t dReQ4n4k = (*fReQ)(3,4);
5753 Double_t dReQ1n3k = (*fReQ)(0,3);
5754 Double_t dImQ1n1k = (*fImQ)(0,1);
5755 Double_t dImQ2n2k = (*fImQ)(1,2);
5756 Double_t dImQ3n3k = (*fImQ)(2,3);
5757 Double_t dImQ4n4k = (*fImQ)(3,4);
5758 Double_t dImQ1n3k = (*fImQ)(0,3);
5760 // dMs are variables introduced in order to simplify some Eqs. bellow:
5761 //..............................................................................................
5762 Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
5763 Double_t dM22 = (*fSMpk)(1,2)-(*fSMpk)(0,4); // dM22 = sum_{i,j=1,i!=j}^M w_i^2 w_j^2
5764 Double_t dM33 = (*fSMpk)(1,3)-(*fSMpk)(0,6); // dM33 = sum_{i,j=1,i!=j}^M w_i^3 w_j^3
5765 Double_t dM44 = (*fSMpk)(1,4)-(*fSMpk)(0,8); // dM44 = sum_{i,j=1,i!=j}^M w_i^4 w_j^4
5766 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
5767 Double_t dM211 = (*fSMpk)(0,2)*(*fSMpk)(1,1)-2.*(*fSMpk)(0,3)*(*fSMpk)(0,1)
5768 - (*fSMpk)(1,2)+2.*(*fSMpk)(0,4); // dM211 = sum_{i,j,k=1,i!=j!=k}^M w_i^2 w_j w_k
5769 Double_t dM1111 = (*fSMpk)(3,1)-6.*(*fSMpk)(0,2)*(*fSMpk)(1,1)
5770 + 8.*(*fSMpk)(0,3)*(*fSMpk)(0,1)
5771 + 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
5772 //..............................................................................................
5774 // ***********************************************
5775 // **** weighted multi-particle correlations: ****
5776 // ***********************************************
5777 //..............................................................................................
5778 // weighted 2-particle correlations:
5779 Double_t two1n1nW1W1 = 0.; // <w1 w2 cos(n*(phi1-phi2))>
5780 Double_t two2n2nW2W2 = 0.; // <w1^2 w2^2 cos(2n*(phi1-phi2))>
5781 Double_t two3n3nW3W3 = 0.; // <w1^3 w2^3 cos(3n*(phi1-phi2))>
5782 Double_t two4n4nW4W4 = 0.; // <w1^4 w2^4 cos(4n*(phi1-phi2))>
5783 Double_t two1n1nW3W1 = 0.; // <w1^3 w2 cos(n*(phi1-phi2))>
5784 Double_t two1n1nW1W1W2 = 0.; // <w1 w2 w3^2 cos(n*(phi1-phi2))>
5790 two1n1nW1W1 = (pow(dReQ1n1k,2)+pow(dImQ1n1k,2)-(*fSMpk)(0,2))/dM11;
5792 // average weighted correlation <w1 w2 cos(n*(phi1-phi2))> for single event:
5793 fQCorrelationsEBE[1]->SetBinContent(1,two1n1nW1W1);
5795 // average weighted correlation <w1 w2 cos(n*(phi1-phi2))> for all events:
5796 //fQCorrelationsW->Fill(0.,two1n1nW1W1,dM11);
5797 fQCorrelations[1][0]->Fill(0.5,two1n1nW1W1,dM11);
5801 two2n2nW2W2 = (pow(dReQ2n2k,2)+pow(dImQ2n2k,2)-(*fSMpk)(0,4))/dM22;
5802 //fQCorrelationsW->Fill(1.,two2n2nW2W2,dM22);
5803 fQCorrelations[1][0]->Fill(1.5,two2n2nW2W2,dM22);
5807 two3n3nW3W3 = (pow(dReQ3n3k,2)+pow(dImQ3n3k,2)-(*fSMpk)(0,6))/dM33;
5808 //fQCorrelationsW->Fill(2.,two3n3nW3W3,dM33);
5809 fQCorrelations[1][0]->Fill(2.5,two3n3nW3W3,dM33);
5813 two4n4nW4W4 = (pow(dReQ4n4k,2)+pow(dImQ4n4k,2)-(*fSMpk)(0,8))/dM44;
5814 //fQCorrelationsW->Fill(3.,two4n4nW4W4,dM44);
5815 fQCorrelations[1][0]->Fill(3.5,two4n4nW4W4,dM44);
5819 two1n1nW3W1 = (dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k-(*fSMpk)(0,4))/dM31;
5820 //fQCorrelationsW->Fill(4.,two1n1nW3W1,dM31);
5824 two1n1nW1W1W2 = ((*fSMpk)(0,2)*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2)-(*fSMpk)(0,2))
5825 - 2.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k
5826 - (*fSMpk)(0,4)))/dM211;
5827 //fQCorrelationsW->Fill(5.,two1n1nW1W1W2,dM211);
5829 } // end of if(dMult>1)
5830 //..............................................................................................
5832 //..............................................................................................
5833 // weighted 3-particle correlations:
5834 Double_t three2n1n1nW2W1W1 = 0.; // <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
5840 three2n1n1nW2W1W1 = (pow(dReQ1n1k,2.)*dReQ2n2k+2.*dReQ1n1k*dImQ1n1k*dImQ2n2k-pow(dImQ1n1k,2.)*dReQ2n2k
5841 - 2.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k)
5842 - pow(dReQ2n2k,2)-pow(dImQ2n2k,2)
5843 + 2.*(*fSMpk)(0,4))/dM211;
5844 //fQCorrelationsW->Fill(20.,three2n1n1nW2W1W1,dM211);
5846 } // end of if(dMult>2)
5847 //..............................................................................................
5849 //..............................................................................................
5850 // weighted 4-particle correlations:
5851 Double_t four1n1n1n1nW1W1W1W1 = 0.; // <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
5856 four1n1n1n1nW1W1W1W1 = (pow(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.),2)
5857 - 2.*(pow(dReQ1n1k,2.)*dReQ2n2k+2.*dReQ1n1k*dImQ1n1k*dImQ2n2k-pow(dImQ1n1k,2.)*dReQ2n2k)
5858 + 8.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k)
5859 + (pow(dReQ2n2k,2)+pow(dImQ2n2k,2))
5860 - 4.*(*fSMpk)(0,2)*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
5861 - 6.*(*fSMpk)(0,4)+2.*(*fSMpk)(1,2))/dM1111;
5863 // average weighted correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for single event:
5864 fQCorrelationsEBE[1]->SetBinContent(11,four1n1n1n1nW1W1W1W1);
5866 // average weighted correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for all events:
5867 //fQCorrelationsW->Fill(40.,four1n1n1n1nW1W1W1W1,dM1111);
5869 fQCorrelations[1][0]->Fill(10.5,four1n1n1n1nW1W1W1W1,dM1111);
5871 } // end of if(dMult>3)
5872 //..............................................................................................
5874 } // end of AliFlowAnalysisWithQCumulants::CalculateWeightedCorrelationsForIntegratedFlow()
5877 //================================================================================================================================
5880 void AliFlowAnalysisWithQCumulants::CalculateWeightedQProductsForIntFlow() // to be improved (completed)
5882 // calculate averages like <<2><4>>, <<2><6>>, <<4><6>>, etc. which are needed to calculate covariances
5883 // Remark: here we take weighted correlations!
5885 // binning of fQProductsW is organized as follows:
5894 Double_t dMult = (*fSMpk)(0,0); // multiplicity (number of particles used to determine the reaction plane)
5896 Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
5897 Double_t dM1111 = (*fSMpk)(3,1)-6.*(*fSMpk)(0,2)*(*fSMpk)(1,1)
5898 + 8.*(*fSMpk)(0,3)*(*fSMpk)(0,1)
5899 + 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
5901 Double_t twoEBEW = 0.; // <2>
5902 Double_t fourEBEW = 0.; // <4>
5904 twoEBEW = fQCorrelationsEBE[1]->GetBinContent(1);
5905 fourEBEW = fQCorrelationsEBE[1]->GetBinContent(11);
5910 fQProducts[1][0]->Fill(0.5,twoEBEW*fourEBEW,dM11*dM1111);
5913 } // end of AliFlowAnalysisWithQCumulants::CalculateWeightedQProductsForIntFlow()
5916 //================================================================================================================================
5919 void AliFlowAnalysisWithQCumulants::InitializeArraysForIntFlow()
5921 // initialize all arrays needed to calculate the integrated flow
5923 for(Int_t pW=0;pW<1+(Int_t)(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);pW++) // not weighted or weighted
5925 fQCorrelationsEBE[pW] = NULL;
5926 for(Int_t sc=0;sc<2;sc++)
5928 fQCorrectionsEBE[pW][sc] = NULL;
5930 for(Int_t eW=0;eW<2;eW++)
5933 fQCorrelations[pW][eW] = NULL;
5934 fQProducts[pW][eW] = NULL;
5935 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
5937 fQCorrections[pW][eW][sc] = NULL;
5939 // histograms with results:
5940 fCorrelations[pW][eW] = NULL;
5941 fCovariances[pW][eW] = NULL;
5942 fCorrections[pW][eW] = NULL;
5943 fProductOfEventWeights[pW][eW] = NULL;
5944 for(Int_t power=0;power<2;power++)
5946 fSumOfEventWeights[pW][eW][power] = NULL;
5948 for(Int_t nua=0;nua<2;nua++) // not corrected or corrected
5950 fCumulants[pW][eW][nua] = NULL;
5951 fIntFlow[pW][eW][nua] = NULL;
5956 } // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForIntFlow()
5959 //================================================================================================================================
5962 void AliFlowAnalysisWithQCumulants::InitializeArraysForDiffFlow()
5964 // initialize all arrays needed to calcualted differential flow
5966 // nested lists in fDiffFlowProfiles:
5967 for(Int_t t=0;t<2;t++)
5970 for(Int_t pW=0;pW<1+(Int_t)(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);pW++)
5972 fDFPParticleWeights[t][pW] = NULL;
5973 for(Int_t eW=0;eW<2;eW++)
5975 fDFPEventWeights[t][pW][eW] = NULL;
5976 fDiffFlowCorrelations[t][pW][eW] = NULL;
5977 fDiffFlowProductsOfCorrelations[t][pW][eW] = NULL;
5978 for(Int_t sc=0;sc<2;sc++)
5980 fDiffFlowCorrectionTerms[t][pW][eW][sc] = NULL;
5986 // profiles in nested lists in fDiffFlowProfiles:
5987 for(Int_t t=0;t<2;t++) // type: RP or POI
5989 for(Int_t pW=0;pW<1+(Int_t)(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);pW++) // particle weights: not used or used
5991 for(Int_t eW=0;eW<2;eW++)
5994 for(Int_t correlationIndex=0;correlationIndex<4;correlationIndex++)
5996 fCorrelationsPro[t][pW][eW][correlationIndex] = NULL;
5998 // products of correlations:
5999 for(Int_t productOfCorrelationsIndex=0;productOfCorrelationsIndex<6;productOfCorrelationsIndex++)
6001 fProductsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex] = NULL;
6003 // correction terms:
6004 for(Int_t sc=0;sc<2;sc++)
6006 for(Int_t correctionsIndex=0;correctionsIndex<2;correctionsIndex++)
6008 fCorrectionTermsPro[t][pW][eW][sc][correctionsIndex] = NULL;
6015 // nested lists in fDiffFlowResults:
6016 for(Int_t t=0;t<2;t++)
6019 for(Int_t pW=0;pW<1+(Int_t)(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);pW++)
6021 fDFRParticleWeights[t][pW] = NULL;
6022 for(Int_t eW=0;eW<2;eW++)
6024 fDFREventWeights[t][pW][eW] = NULL;
6025 fDiffFlowFinalCorrelations[t][pW][eW] = NULL;
6026 fDiffFlowFinalCorrections[t][pW][eW] = NULL;
6027 fDiffFlowFinalCovariances[t][pW][eW] = NULL;
6028 for(Int_t nua=0;nua<2;nua++)
6030 fDFRCorrections[t][pW][eW][nua] = NULL;
6031 fDiffFlowFinalCumulants[t][pW][eW][nua] = NULL;
6032 fDiffFlowFinalFlow[t][pW][eW][nua] = NULL;
6038 // 2D and 1D histograms in nested lists in fDiffFlowResults:
6039 for(Int_t t=0;t<2;t++)
6041 fNonEmptyBins2D[t] = NULL;
6042 for(Int_t pe=0;pe<2;pe++)
6044 fNonEmptyBins1D[t][pe] = NULL;
6046 for(Int_t pW=0;pW<1+(Int_t)(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);pW++)
6048 for(Int_t eW=0;eW<2;eW++)
6051 for(Int_t correlationIndex=0;correlationIndex<4;correlationIndex++)
6053 fFinalCorrelations2D[t][pW][eW][correlationIndex] = NULL;
6054 for(Int_t pe=0;pe<2;pe++)
6056 fFinalCorrelations1D[t][pW][eW][pe][correlationIndex] = NULL;
6060 for(Int_t correctionIndex=0;correctionIndex<4;correctionIndex++)
6062 fFinalCorrections2D[t][pW][eW][correctionIndex] = NULL;
6063 for(Int_t pe=0;pe<2;pe++)
6065 fFinalCorrections1D[t][pW][eW][pe][correctionIndex] = NULL;
6069 for(Int_t covarianceIndex=0;covarianceIndex<4;covarianceIndex++)
6071 fFinalCovariances2D[t][pW][eW][covarianceIndex] = NULL;
6072 for(Int_t pe=0;pe<2;pe++)
6074 fFinalCovariances1D[t][pW][eW][pe][covarianceIndex] = NULL;
6077 for(Int_t nua=0;nua<2;nua++)
6080 for(Int_t cumulantIndex=0;cumulantIndex<4;cumulantIndex++)
6082 fFinalCumulants2D[t][pW][eW][nua][cumulantIndex] = NULL;
6083 fFinalCumulantsPt[t][pW][eW][nua][cumulantIndex] = NULL;
6084 fFinalCumulantsEta[t][pW][eW][nua][cumulantIndex] = NULL;
6087 for(Int_t finalFlowIndex=0;finalFlowIndex<4;finalFlowIndex++)
6089 fFinalFlow2D[t][pW][eW][nua][finalFlowIndex] = NULL;
6090 fFinalFlowPt[t][pW][eW][nua][finalFlowIndex] = NULL;
6091 fFinalFlowEta[t][pW][eW][nua][finalFlowIndex] = NULL;
6098 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
6100 for(Int_t m=0;m<4;m++) // multiple of harmonic
6102 for(Int_t k=0;k<9;k++) // power of weight
6104 fReEBE[t][m][k] = NULL;
6105 fImEBE[t][m][k] = NULL;
6106 fs[t][k] = NULL; // to be improved (this doesn't need to be within loop over m)
6111 } // end of AliFlowAnalysisWithQCumulants::InitializeArraysForDiffFlow()
6114 //================================================================================================================================
6117 void AliFlowAnalysisWithQCumulants::BookEverythingForDifferentialFlow()
6119 // organize and book everything needed for differential flow
6121 // book and nest all lists belonging to the list fDiffFlowProfiles "Profiles":
6122 TList list; // to be improved (do I need this here?)
6123 list.SetOwner(kTRUE); // to be improved (do I need this here?)
6124 TString typeFlag[2] = {"RP","POI"}; // to be improved (do I need this here?)
6125 TString pWeightsFlag[2] = {"not used","used"}; // to be improved (do I need this here?)
6126 TString eWeightsFlag[2] = {"exact","non-exact"}; // to be improved (do I need this here?)
6127 //TString sinCosFlag[2] = {"sin","cos"}; // to be improved (do I need this here?)
6128 TString nuaFlag[2] = {"not corrected","corrected"}; // nua = non-uniform acceptance // to be improved (do I need this here?)
6130 // book all 2D profiles and add to appropriate lists:
6131 TProfile2D styleProfile("","",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
6132 styleProfile.SetXTitle("p_{t}");
6133 styleProfile.SetYTitle("#eta");
6134 TString correlationName[4] = {"<2'>","<4'>","<6'>","<8'>"};
6135 TString cumulantName[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
6136 TString productOfCorrelationsName[5] = {"<2><2'>","<2><4'>","<4><2'>","<4><4'>","<2'><4'>"};
6137 TString correctionsSinTermsName[2] = {"sin(1)","sin(2)"};
6138 TString correctionsCosTermsName[2] = {"cos(1)","cos(2)"};
6139 TString correctionName[4] = {"corr. to QC{2'}","corr. to QC{4'}","corr. to QC{6'}","corr. to QC{8'}"};
6140 TString covarianceName[4] = {"Cov(2,2')","Cov(2,4')","Cov(2',4')","Cov(4,2')"}; // to be improved (reorganized)
6141 TString flowName[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
6143 for(Int_t t=0;t<2;t++) // type: RP or POI
6145 for(Int_t pW=0;pW<1+(Int_t)(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);pW++) // weights: not used or used
6147 for(Int_t eW=0;eW<2;eW++)
6150 for(Int_t correlationIndex=0;correlationIndex<4;correlationIndex++)
6152 fCorrelationsPro[t][pW][eW][correlationIndex] = (TProfile2D*)styleProfile.Clone(correlationName[correlationIndex].Data());
6153 fCorrelationsPro[t][pW][eW][correlationIndex]->SetTitle(correlationName[correlationIndex].Data());
6154 fDiffFlowCorrelations[t][pW][eW]->Add(fCorrelationsPro[t][pW][eW][correlationIndex]);
6156 // products of correlations:
6157 for(Int_t productOfCorrelationsIndex=0;productOfCorrelationsIndex<5;productOfCorrelationsIndex++)
6159 fProductsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex] = (TProfile2D*)styleProfile.Clone(productOfCorrelationsName[productOfCorrelationsIndex].Data());
6160 fProductsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex]->SetTitle(productOfCorrelationsName[productOfCorrelationsIndex].Data());
6161 fDiffFlowProductsOfCorrelations[t][pW][eW]->Add(fProductsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex]);
6163 // correction terms:
6164 for(Int_t sc=0;sc<2;sc++)
6166 for(Int_t correctionsIndex=0;correctionsIndex<2;correctionsIndex++)
6170 fCorrectionTermsPro[t][pW][eW][sc][correctionsIndex] = (TProfile2D*)styleProfile.Clone(correctionsSinTermsName[correctionsIndex].Data());
6171 fCorrectionTermsPro[t][pW][eW][sc][correctionsIndex]->SetTitle(correctionsSinTermsName[correctionsIndex].Data());
6172 fDiffFlowCorrectionTerms[t][pW][eW][sc]->Add(fCorrectionTermsPro[t][pW][eW][sc][correctionsIndex]);
6176 fCorrectionTermsPro[t][pW][eW][sc][correctionsIndex] = (TProfile2D*)styleProfile.Clone(correctionsCosTermsName[correctionsIndex].Data());
6177 fCorrectionTermsPro[t][pW][eW][sc][correctionsIndex]->SetTitle(correctionsCosTermsName[correctionsIndex].Data());
6178 fDiffFlowCorrectionTerms[t][pW][eW][sc]->Add(fCorrectionTermsPro[t][pW][eW][sc][correctionsIndex]);
6186 // book all 2D and 1D histograms for final results and store them in appropriate lists:
6187 TH2D styleHistPtEta("","",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
6188 styleHistPtEta.SetXTitle("p_{t}");
6189 styleHistPtEta.SetYTitle("#eta");
6190 TH1D styleHistPt("","",fnBinsPt,fPtMin,fPtMax);
6191 styleHistPt.SetXTitle("p_{t}");
6192 TH1D styleHistEta("","",fnBinsEta,fEtaMin,fEtaMax);
6193 styleHistEta.SetXTitle("#eta");
6194 for(Int_t t=0;t<2;t++) // RP or POI
6197 fNonEmptyBins2D[t] = (TH2D*)styleHistPtEta.Clone(Form("%s, (p_{t},#eta)",typeFlag[t].Data()));
6198 fNonEmptyBins2D[t]->SetTitle(Form("Non-empty bins: %s (p_{t},#eta)",typeFlag[t].Data()));
6199 fDFRType[t]->Add(fNonEmptyBins2D[t]);
6201 fNonEmptyBins1D[t][0] = (TH1D*)styleHistPt.Clone(Form("%s, p_{t}",typeFlag[t].Data()));
6202 fNonEmptyBins1D[t][0]->SetTitle(Form("Non-empty bins: %s (p_{t})",typeFlag[t].Data()));
6203 fDFRType[t]->Add(fNonEmptyBins1D[t][0]);
6204 fNonEmptyBins1D[t][1] = (TH1D*)styleHistEta.Clone(Form("%s, #eta",typeFlag[t].Data()));
6205 fNonEmptyBins1D[t][1]->SetTitle(Form("Non-empty bins: %s (#eta)",typeFlag[t].Data()));
6206 fDFRType[t]->Add(fNonEmptyBins1D[t][1]);
6208 for(Int_t pW=0;pW<1+(Int_t)(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);pW++) // particle weights not used or used
6210 for(Int_t eW=0;eW<2;eW++)
6213 for(Int_t correlationIndex=0;correlationIndex<4;correlationIndex++)
6216 fFinalCorrelations2D[t][pW][eW][correlationIndex] = (TH2D*)styleHistPtEta.Clone(Form("%s, (p_{t},#eta)",correlationName[correlationIndex].Data()));
6217 fFinalCorrelations2D[t][pW][eW][correlationIndex]->SetTitle(Form("%s (p_{t},#eta): %s, pWeights %s, eWeights %s",correlationName[correlationIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
6218 fDiffFlowFinalCorrelations[t][pW][eW]->Add(fFinalCorrelations2D[t][pW][eW][correlationIndex]);
6220 for(Int_t pe=0;pe<2;pe++) // pt or eta:
6224 fFinalCorrelations1D[t][pW][eW][pe][correlationIndex] = (TH1D*)styleHistPt.Clone(Form("%s, (p_{t})",correlationName[correlationIndex].Data()));
6225 fFinalCorrelations1D[t][pW][eW][pe][correlationIndex]->SetTitle(Form("%s (p_{t}): %s, pWeights %s, eWeights %s",correlationName[correlationIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
6226 fDiffFlowFinalCorrelations[t][pW][eW]->Add(fFinalCorrelations1D[t][pW][eW][pe][correlationIndex]);
6230 fFinalCorrelations1D[t][pW][eW][pe][correlationIndex] = (TH1D*)styleHistEta.Clone(Form("%s, (#eta)",correlationName[correlationIndex].Data()));
6231 fFinalCorrelations1D[t][pW][eW][pe][correlationIndex]->SetTitle(Form("%s (#eta): %s, pWeights %s, eWeights %s",correlationName[correlationIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
6232 fDiffFlowFinalCorrelations[t][pW][eW]->Add(fFinalCorrelations1D[t][pW][eW][pe][correlationIndex]);
6237 for(Int_t correctionIndex=0;correctionIndex<4;correctionIndex++)
6240 fFinalCorrections2D[t][pW][eW][correctionIndex] = (TH2D*)styleHistPtEta.Clone(Form("%s, (p_{t},#eta)",correctionName[correctionIndex].Data()));
6241 fFinalCorrections2D[t][pW][eW][correctionIndex]->SetTitle(Form("%s (p_{t},#eta): %s, pWeights %s, eWeights %s",correctionName[correctionIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
6242 fDiffFlowFinalCorrections[t][pW][eW]->Add(fFinalCorrections2D[t][pW][eW][correctionIndex]);
6244 for(Int_t pe=0;pe<2;pe++) // pt or eta:
6248 fFinalCorrections1D[t][pW][eW][pe][correctionIndex] = (TH1D*)styleHistPt.Clone(Form("%s, (p_{t})",correctionName[correctionIndex].Data()));
6249 fFinalCorrections1D[t][pW][eW][pe][correctionIndex]->SetTitle(Form("%s (p_{t}): %s, pWeights %s, eWeights %s",correctionName[correctionIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
6250 fDiffFlowFinalCorrections[t][pW][eW]->Add(fFinalCorrections1D[t][pW][eW][pe][correctionIndex]);
6254 fFinalCorrections1D[t][pW][eW][pe][correctionIndex] = (TH1D*)styleHistEta.Clone(Form("%s, (#eta)",correctionName[correctionIndex].Data()));
6255 fFinalCorrections1D[t][pW][eW][pe][correctionIndex]->SetTitle(Form("%s (#eta): %s, pWeights %s, eWeights %s",correctionName[correctionIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
6256 fDiffFlowFinalCorrections[t][pW][eW]->Add(fFinalCorrections1D[t][pW][eW][pe][correctionIndex]);
6261 for(Int_t covarianceIndex=0;covarianceIndex<4;covarianceIndex++)
6264 fFinalCovariances2D[t][pW][eW][covarianceIndex] = (TH2D*)styleHistPtEta.Clone(Form("%s, (p_{t},#eta)",covarianceName[covarianceIndex].Data()));
6265 fFinalCovariances2D[t][pW][eW][covarianceIndex]->SetTitle(Form("%s (p_{t},#eta): %s, pWeights %s, eWeights %s",covarianceName[covarianceIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
6266 fDiffFlowFinalCovariances[t][pW][eW]->Add(fFinalCovariances2D[t][pW][eW][covarianceIndex]);
6268 for(Int_t pe=0;pe<2;pe++) // pt or eta:
6272 fFinalCovariances1D[t][pW][eW][pe][covarianceIndex] = (TH1D*)styleHistPt.Clone(Form("%s, (p_{t})",covarianceName[covarianceIndex].Data()));
6273 fFinalCovariances1D[t][pW][eW][pe][covarianceIndex]->SetTitle(Form("%s (p_{t}): %s, pWeights %s, eWeights %s",covarianceName[covarianceIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
6274 fDiffFlowFinalCovariances[t][pW][eW]->Add(fFinalCovariances1D[t][pW][eW][pe][covarianceIndex]);
6278 fFinalCovariances1D[t][pW][eW][pe][covarianceIndex] = (TH1D*)styleHistEta.Clone(Form("%s, (#eta)",covarianceName[covarianceIndex].Data()));
6279 fFinalCovariances1D[t][pW][eW][pe][covarianceIndex]->SetTitle(Form("%s (#eta): %s, pWeights %s, eWeights %s",covarianceName[covarianceIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
6280 fDiffFlowFinalCovariances[t][pW][eW]->Add(fFinalCovariances1D[t][pW][eW][pe][covarianceIndex]);
6284 for(Int_t nua=0;nua<2;nua++) // corrected or not
6287 for(Int_t cumulantIndex=0;cumulantIndex<4;cumulantIndex++)
6290 fFinalCumulants2D[t][pW][eW][nua][cumulantIndex] = (TH2D*)styleHistPtEta.Clone(Form("%s, (p_{t},#eta)",cumulantName[cumulantIndex].Data()));
6291 fFinalCumulants2D[t][pW][eW][nua][cumulantIndex]->SetTitle(Form("%s (p_{t},#eta): %s, pWeights %s, eWeights %s, %s for NUA",cumulantName[cumulantIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data()));
6292 fDiffFlowFinalCumulants[t][pW][eW][nua]->Add(fFinalCumulants2D[t][pW][eW][nua][cumulantIndex]);
6294 fFinalCumulantsPt[t][pW][eW][nua][cumulantIndex] = (TH1D*)styleHistPt.Clone(Form("%s, (p_{t})",cumulantName[cumulantIndex].Data()));
6295 fFinalCumulantsPt[t][pW][eW][nua][cumulantIndex]->SetTitle(Form("%s (p_{t}): %s, pWeights %s, eWeights %s, %s for NUA",cumulantName[cumulantIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data()));
6296 fDiffFlowFinalCumulants[t][pW][eW][nua]->Add(fFinalCumulantsPt[t][pW][eW][nua][cumulantIndex]);
6298 fFinalCumulantsEta[t][pW][eW][nua][cumulantIndex] = (TH1D*)styleHistEta.Clone(Form("%s, (#eta)",cumulantName[cumulantIndex].Data()));
6299 fFinalCumulantsEta[t][pW][eW][nua][cumulantIndex]->SetTitle(Form("%s (#eta): %s, pWeights %s, eWeights %s, %s for NUA",cumulantName[cumulantIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data()));
6300 fDiffFlowFinalCumulants[t][pW][eW][nua]->Add(fFinalCumulantsEta[t][pW][eW][nua][cumulantIndex]);
6303 for(Int_t flowIndex=0;flowIndex<4;flowIndex++)
6306 fFinalFlow2D[t][pW][eW][nua][flowIndex] = (TH2D*)styleHistPtEta.Clone(Form("%s, (p_{t},#eta)",flowName[flowIndex].Data()));
6307 fFinalFlow2D[t][pW][eW][nua][flowIndex]->SetTitle(Form("%s (p_{t},#eta): %s, pWeights %s, eWeights %s, %s for NUA",flowName[flowIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data()));
6308 fDiffFlowFinalFlow[t][pW][eW][nua]->Add(fFinalFlow2D[t][pW][eW][nua][flowIndex]);
6310 fFinalFlowPt[t][pW][eW][nua][flowIndex] = (TH1D*)styleHistPt.Clone(Form("%s, (p_{t})",flowName[flowIndex].Data()));
6311 fFinalFlowPt[t][pW][eW][nua][flowIndex]->SetTitle(Form("%s (p_{t}): %s, pWeights %s, eWeights %s, %s for NUA",flowName[flowIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data()));
6312 fDiffFlowFinalFlow[t][pW][eW][nua]->Add(fFinalFlowPt[t][pW][eW][nua][flowIndex]);
6314 fFinalFlowEta[t][pW][eW][nua][flowIndex] = (TH1D*)styleHistEta.Clone(Form("%s, (#eta)",flowName[flowIndex].Data()));
6315 fFinalFlowEta[t][pW][eW][nua][flowIndex]->SetTitle(Form("%s (#eta): %s, pWeights %s, eWeights %s, %s for NUA",flowName[flowIndex].Data(),typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data()));
6316 fDiffFlowFinalFlow[t][pW][eW][nua]->Add(fFinalFlowEta[t][pW][eW][nua][flowIndex]);
6323 // Event-by-event r_{m*n,k}(pt,eta), p_{m*n,k}(pt,eta) and q_{m*n,k}(pt,eta)
6324 // Explanantion of notation:
6325 // 1.) n is harmonic, m is multiple of harmonic;
6326 // 2.) k is power of weight;
6327 // 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);
6328 // 4.) p_{m*n,k}(pt,eta) = Q-vector evaluated in harmonic m*n for POIs in particular (pt,eta) bin
6329 // (if i-th POI is also RP, than it is weighted with w_i^k);
6330 // 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
6331 // (i-th RP&&POI is weighted with w_i^k)
6333 TProfile2D styleRe("typeMultiplePowerRe","typeMultiplePowerRe",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
6334 TProfile2D styleIm("typeMultiplePowerIm","typeMultiplePowerIm",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
6336 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
6338 for(Int_t m=0;m<4;m++)
6340 for(Int_t k=0;k<9;k++)
6342 fReEBE[t][m][k] = (TProfile2D*)styleRe.Clone(Form("typeFlag%dmultiple%dpower%dRe",t,m,k));
6343 fImEBE[t][m][k] = (TProfile2D*)styleIm.Clone(Form("typeFlag%dmultiple%dpower%dIm",t,m,k));
6348 TProfile2D styleS("typePower","typePower",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
6350 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
6352 for(Int_t k=0;k<9;k++)
6354 fs[t][k] = (TProfile2D*)styleS.Clone(Form("typeFlag%dpower%d",t,k));
6358 } // end of AliFlowAnalysisWithQCumulants::BookEverythingForDifferentialFlow()
6361 //================================================================================================================================
6364 void AliFlowAnalysisWithQCumulants::CalculateCorrelationsForDifferentialFlow(TString type)
6366 // calculate all reduced correlations needed for differential flow for each (pt,eta) bin:
6368 Int_t typeFlag = -1;
6370 // reduced correlations ares stored in fCorrelationsPro[t][pW][index] and are indexed as follows:
6376 Double_t dMult = (*fSMpk)(0,0);
6378 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
6379 Double_t dReQ1n = (*fReQ)(0,0);
6380 Double_t dReQ2n = (*fReQ)(1,0);
6381 //Double_t dReQ3n = (*fReQ)(2,0);
6382 //Double_t dReQ4n = (*fReQ)(3,0);
6383 Double_t dImQ1n = (*fImQ)(0,0);
6384 Double_t dImQ2n = (*fImQ)(1,0);
6385 //Double_t dImQ3n = (*fImQ)(2,0);
6386 //Double_t dImQ4n = (*fImQ)(3,0);
6388 // looping over all (pt,eta) bins and calculating correlations needed for differential flow:
6389 for(Int_t p=1;p<=fnBinsPt;p++)
6391 for(Int_t e=1;e<=fnBinsEta;e++)
6393 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin):
6394 Double_t p1n0kRe = 0.;
6395 Double_t p1n0kIm = 0.;
6397 // number of POIs in particular (pt,eta) bin:
6400 // 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):
6401 Double_t q1n0kRe = 0.;
6402 Double_t q1n0kIm = 0.;
6403 Double_t q2n0kRe = 0.;
6404 Double_t q2n0kIm = 0.;
6406 // number of particles which are both RPs and POIs in particular (pt,eta) bin:
6410 q1n0kRe = fReEBE[2][0][0]->GetBinContent(fReEBE[2][0][0]->GetBin(p,e))
6411 * fReEBE[2][0][0]->GetBinEntries(fReEBE[2][0][0]->GetBin(p,e));
6412 q1n0kIm = fImEBE[2][0][0]->GetBinContent(fImEBE[2][0][0]->GetBin(p,e))
6413 * fImEBE[2][0][0]->GetBinEntries(fImEBE[2][0][0]->GetBin(p,e));
6414 q2n0kRe = fReEBE[2][1][0]->GetBinContent(fReEBE[2][1][0]->GetBin(p,e))
6415 * fReEBE[2][1][0]->GetBinEntries(fReEBE[2][1][0]->GetBin(p,e));
6416 q2n0kIm = fImEBE[2][1][0]->GetBinContent(fImEBE[2][1][0]->GetBin(p,e))
6417 * fImEBE[2][1][0]->GetBinEntries(fImEBE[2][1][0]->GetBin(p,e));
6419 mq = fReEBE[2][0][0]->GetBinEntries(fReEBE[2][0][0]->GetBin(p,e)); // to be improved (cross-checked by accessing other profiles here)
6424 p1n0kRe = fReEBE[1][0][0]->GetBinContent(fReEBE[1][0][0]->GetBin(p,e))
6425 * fReEBE[1][0][0]->GetBinEntries(fReEBE[1][0][0]->GetBin(p,e));
6426 p1n0kIm = fImEBE[1][0][0]->GetBinContent(fImEBE[1][0][0]->GetBin(p,e))
6427 * fImEBE[1][0][0]->GetBinEntries(fImEBE[1][0][0]->GetBin(p,e));
6429 mp = fReEBE[1][0][0]->GetBinEntries(fReEBE[1][0][0]->GetBin(p,e)); // to be improved (cross-checked by accessing other profiles here)
6433 else if(type == "RP")
6435 // p_{m*n,0} = q_{m*n,0}:
6443 // count events with non-empty (pt,eta) bin:
6446 fNonEmptyBins2D[typeFlag]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,1);
6449 // 2'-particle correlation for particular (pt,eta) bin:
6450 Double_t two1n1nPtEta = 0.;
6453 two1n1nPtEta = (p1n0kRe*dReQ1n+p1n0kIm*dImQ1n-mq)
6456 // fill the 2D profile to get the average correlation for each (pt,eta) bin:
6459 //f2pPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);
6461 fCorrelationsPro[1][0][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);
6463 else if(type == "RP")
6465 //f2pPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);
6466 fCorrelationsPro[0][0][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);
6468 } // end of if(mp*dMult-mq)
6470 // 4'-particle correlation:
6471 Double_t four1n1n1n1nPtEta = 0.;
6472 if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6473 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)
6475 four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6476 - q2n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))
6477 - 2.*q2n0kIm*dReQ1n*dImQ1n
6478 - p1n0kRe*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)
6479 + p1n0kIm*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)
6480 - 2.*dMult*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6481 - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*mq
6482 + 6.*(q1n0kRe*dReQ1n+q1n0kIm*dImQ1n)
6483 + 1.*(q2n0kRe*dReQ2n+q2n0kIm*dImQ2n)
6484 + 2.*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6487 / ((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6488 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
6490 // fill the 2D profile to get the average correlation for each (pt, eta) bin:
6493 //f4pPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
6494 // (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6495 // + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
6497 fCorrelationsPro[1][0][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
6498 (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6499 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
6501 else if(type == "RP")
6503 //f4pPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
6504 // (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6505 // + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
6507 fCorrelationsPro[0][0][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,
6508 (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6509 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
6511 } // end of if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6512 // +mq*(dMult-1.)*(dMult-2.)*(dMult-3.))
6514 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
6515 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
6517 } // end of AliFlowAnalysisWithQCumulants::CalculateCorrelationsForDifferentialFlow()
6520 //================================================================================================================================
6523 void AliFlowAnalysisWithQCumulants::CalculateWeightedCorrelationsForDifferentialFlow(TString type)
6525 // calculate all weighted correlations needed for differential flow
6527 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
6528 Double_t dReQ1n1k = (*fReQ)(0,1);
6529 Double_t dReQ2n2k = (*fReQ)(1,2);
6530 Double_t dReQ1n3k = (*fReQ)(0,3);
6531 //Double_t dReQ4n4k = (*fReQ)(3,4);
6532 Double_t dImQ1n1k = (*fImQ)(0,1);
6533 Double_t dImQ2n2k = (*fImQ)(1,2);
6534 Double_t dImQ1n3k = (*fImQ)(0,3);
6535 //Double_t dImQ4n4k = (*fImQ)(3,4);
6537 // S^M_{p,k} (see .h file for the definition of fSMpk):
6538 Double_t dSM1p1k = (*fSMpk)(0,1);
6539 Double_t dSM1p2k = (*fSMpk)(0,2);
6540 Double_t dSM1p3k = (*fSMpk)(0,3);
6541 Double_t dSM2p1k = (*fSMpk)(1,1);
6542 Double_t dSM3p1k = (*fSMpk)(2,1);
6544 // looping over all (pt,eta) bins and calculating weighted correlations needed for differential flow:
6545 for(Int_t p=1;p<=fnBinsPt;p++)
6547 for(Int_t e=1;e<=fnBinsEta;e++)
6549 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin):
6550 Double_t p1n0kRe = 0.;
6551 Double_t p1n0kIm = 0.;
6553 // number of POIs in particular (pt,eta) bin):
6556 // real and imaginary parts of q_{m*n,k}:
6557 // (weighted Q-vector evaluated for particles which are both RPs and POIs in particular (pt,eta) bin)
6558 Double_t q1n2kRe = 0.;
6559 Double_t q1n2kIm = 0.;
6560 Double_t q2n1kRe = 0.;
6561 Double_t q2n1kIm = 0.;
6563 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
6564 Double_t s1p1k = 0.;
6565 Double_t s1p2k = 0.;
6566 Double_t s1p3k = 0.;
6568 // M0111 from Eq. (118) in QC2c (to be improved (notation))
6569 Double_t dM0111 = 0.;
6574 p1n0kRe = fReEBE[1][0][0]->GetBinContent(fReEBE[1][0][0]->GetBin(p,e))
6575 * fReEBE[1][0][0]->GetBinEntries(fReEBE[1][0][0]->GetBin(p,e));
6576 p1n0kIm = fImEBE[1][0][0]->GetBinContent(fImEBE[1][0][0]->GetBin(p,e))
6577 * fImEBE[1][0][0]->GetBinEntries(fImEBE[1][0][0]->GetBin(p,e));
6579 mp = fReEBE[1][0][0]->GetBinEntries(fReEBE[1][0][0]->GetBin(p,e));
6582 q1n2kRe = fReEBE[2][0][2]->GetBinContent(fReEBE[2][0][2]->GetBin(p,e))
6583 * fReEBE[2][0][2]->GetBinEntries(fReEBE[2][0][2]->GetBin(p,e));
6584 q1n2kIm = fImEBE[2][0][2]->GetBinContent(fImEBE[2][0][2]->GetBin(p,e))
6585 * fImEBE[2][0][2]->GetBinEntries(fImEBE[2][0][2]->GetBin(p,e));
6586 q2n1kRe = fReEBE[2][1][1]->GetBinContent(fReEBE[2][1][1]->GetBin(p,e))
6587 * fReEBE[2][1][1]->GetBinEntries(fReEBE[2][1][1]->GetBin(p,e));
6588 q2n1kIm = fImEBE[2][1][1]->GetBinContent(fImEBE[2][1][1]->GetBin(p,e))
6589 * fImEBE[2][1][1]->GetBinEntries(fImEBE[2][1][1]->GetBin(p,e));
6591 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
6592 s1p1k = pow(fs[2][1]->GetBinContent(fs[2][1]->GetBin(p,e)),1.);
6593 s1p2k = pow(fs[2][2]->GetBinContent(fs[2][2]->GetBin(p,e)),1.);
6594 s1p3k = pow(fs[2][3]->GetBinContent(fs[2][3]->GetBin(p,e)),1.);
6596 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
6597 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
6598 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
6599 + 2.*(s1p3k-s1p2k*dSM1p1k));
6601 else if(type == "RP")
6603 p1n0kRe = fReEBE[0][0][0]->GetBinContent(fReEBE[0][0][0]->GetBin(p,e))
6604 * fReEBE[0][0][0]->GetBinEntries(fReEBE[0][0][0]->GetBin(p,e));
6605 p1n0kIm = fImEBE[0][0][0]->GetBinContent(fImEBE[0][0][0]->GetBin(p,e))
6606 * fImEBE[0][0][0]->GetBinEntries(fImEBE[0][0][0]->GetBin(p,e));
6608 mp = fReEBE[0][0][0]->GetBinEntries(fReEBE[0][0][0]->GetBin(p,e));
6611 q1n2kRe = fReEBE[0][0][2]->GetBinContent(fReEBE[0][0][2]->GetBin(p,e))
6612 * fReEBE[0][0][2]->GetBinEntries(fReEBE[0][0][2]->GetBin(p,e));
6613 q1n2kIm = fImEBE[0][0][2]->GetBinContent(fImEBE[0][0][2]->GetBin(p,e))
6614 * fImEBE[0][0][2]->GetBinEntries(fImEBE[0][0][2]->GetBin(p,e));
6615 q2n1kRe = fReEBE[0][1][1]->GetBinContent(fReEBE[0][1][1]->GetBin(p,e))
6616 * fReEBE[0][1][1]->GetBinEntries(fReEBE[0][1][1]->GetBin(p,e));
6617 q2n1kIm = fImEBE[0][1][1]->GetBinContent(fImEBE[0][1][1]->GetBin(p,e))
6618 * fImEBE[0][1][1]->GetBinEntries(fImEBE[0][1][1]->GetBin(p,e));
6620 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
6621 s1p1k = pow(fs[0][1]->GetBinContent(fs[0][1]->GetBin(p,e)),1.);
6622 s1p2k = pow(fs[0][2]->GetBinContent(fs[0][2]->GetBin(p,e)),1.);
6623 s1p3k = pow(fs[0][3]->GetBinContent(fs[0][3]->GetBin(p,e)),1.);
6625 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
6626 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
6627 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
6628 + 2.*(s1p3k-s1p2k*dSM1p1k));
6629 //...............................................................................................
6632 // 2'-particle correlation:
6633 Double_t two1n1nW0W1PtEta = 0.;
6634 if(mp*dSM1p1k-s1p1k)
6636 two1n1nW0W1PtEta = (p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k-s1p1k)
6637 / (mp*dSM1p1k-s1p1k);
6639 // fill the 2D profile to get the average correlation for each (pt, eta) bin:
6642 //f2pPtEtaPOIW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,
6643 // mp*dSM1p1k-s1p1k);
6644 fCorrelationsPro[1][1][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,mp*dSM1p1k-s1p1k);
6646 else if(type == "RP")
6648 //f2pPtEtaRPW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,
6649 // mp*dSM1p1k-s1p1k);
6650 fCorrelationsPro[0][1][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,mp*dSM1p1k-s1p1k);
6652 } // end of if(mp*dMult-dmPrimePrimePtEta)
6654 // 4'-particle correlation:
6655 Double_t four1n1n1n1nW0W1W1W1PtEta = 0.;
6658 four1n1n1n1nW0W1W1W1PtEta = ((pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
6659 - q2n1kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))
6660 - 2.*q2n1kIm*dReQ1n1k*dImQ1n1k
6661 - p1n0kRe*(dReQ1n1k*dReQ2n2k+dImQ1n1k*dImQ2n2k)
6662 + p1n0kIm*(dImQ1n1k*dReQ2n2k-dReQ1n1k*dImQ2n2k)
6663 - 2.*dSM1p2k*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
6664 - 2.*(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*s1p1k
6665 + 6.*(q1n2kRe*dReQ1n1k+q1n2kIm*dImQ1n1k)
6666 + 1.*(q2n1kRe*dReQ2n2k+q2n1kIm*dImQ2n2k)
6667 + 2.*(p1n0kRe*dReQ1n3k+p1n0kIm*dImQ1n3k)
6670 / dM0111; // to be imropoved (notation of dM0111)
6672 // fill the 2D profile to get the average correlation for each (pt, eta) bin:
6675 //f4pPtEtaPOIW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);
6676 fCorrelationsPro[1][1][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);
6678 else if(type == "RP")
6680 //f4pPtEtaRPW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);
6681 fCorrelationsPro[0][1][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);
6683 } // end of if(dM0111)
6685 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
6686 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
6688 } // end of AliFlowAnalysisWithQCumulants::CalculateWeightedCorrelationsForDifferentialFlow(TString type)
6691 //================================================================================================================================
6694 void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsForDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights)
6696 // 1.) Access average for 2D correlations from profiles and store them in 2D final results histograms;
6697 // 2.) Access spread for 2D correlations from profiles, calculate error and store it in 2D final results histograms;
6698 // 3.) Make projections along pt and eta axis and store results and errors in 1D final results histograms.
6700 Int_t typeFlag = -1;
6701 Int_t pWeightsFlag = -1;
6702 Int_t eWeightsFlag = -1;
6707 } else if(type == "POI")
6712 cout<<"WARNING: type must be either RP or POI in AFAWQC::FCFDF() !!!!"<<endl;
6716 if(!useParticleWeights)
6724 if(eventWeights == "exact")
6731 Int_t pW = pWeightsFlag;
6732 Int_t eW = eWeightsFlag;
6734 // from 2D histogram fNonEmptyBins2D make two 1D histograms fNonEmptyBins1D in pt and eta (to be improved (i.e. moved somewhere else))
6736 for(Int_t p=1;p<fnBinsPt;p++)
6738 Double_t contentPt = 0.;
6739 for(Int_t e=1;e<=fnBinsEta;e++)
6741 contentPt += (fNonEmptyBins2D[t]->GetBinContent(fNonEmptyBins2D[t]->GetBin(p,e)));
6743 fNonEmptyBins1D[t][0]->SetBinContent(p,contentPt);
6746 for(Int_t e=1;e<fnBinsEta;e++)
6748 Double_t contentEta = 0.;
6749 for(Int_t p=1;p<=fnBinsPt;p++)
6751 contentEta += (fNonEmptyBins2D[t]->GetBinContent(fNonEmptyBins2D[t]->GetBin(p,e)));
6753 fNonEmptyBins1D[t][1]->SetBinContent(e,contentEta);
6756 // from 2D profile in (pt,eta) make two 1D profiles in (pt) and (eta):
6757 TProfile *profile[2][4]; // [0=pt,1=eta][correlation index] // to be improved (do not hardwire the correlation index)
6759 for(Int_t pe=0;pe<2;pe++) // pt or eta
6761 for(Int_t ci=0;ci<4;ci++) // correlation index
6763 if(pe==0) profile[pe][ci] = this->MakePtProjection(fCorrelationsPro[t][pW][eW][ci]);
6764 if(pe==1) profile[pe][ci] = this->MakeEtaProjection(fCorrelationsPro[t][pW][eW][ci]);
6768 // transfer 2D profile into 2D histogram:
6769 // to be improved (see in documentation if there is a method to transfer values from 2D profile into 2D histogram)
6770 for(Int_t ci=0;ci<4;ci++)
6772 for(Int_t p=1;p<=fnBinsPt;p++)
6774 for(Int_t e=1;e<=fnBinsEta;e++)
6776 Double_t correlation = fCorrelationsPro[t][pW][eW][ci]->GetBinContent(fCorrelationsPro[t][pW][eW][ci]->GetBin(p,e));
6777 Double_t spread = fCorrelationsPro[t][pW][eW][ci]->GetBinError(fCorrelationsPro[t][pW][eW][ci]->GetBin(p,e));
6778 Double_t nEvts = fNonEmptyBins2D[t]->GetBinContent(fNonEmptyBins2D[t]->GetBin(p,e));
6779 Double_t error = 0.;
6780 fFinalCorrelations2D[t][pW][eW][ci]->SetBinContent(fFinalCorrelations2D[t][pW][eW][ci]->GetBin(p,e),correlation);
6783 error = spread/pow(nEvts,0.5);
6784 fFinalCorrelations2D[t][pW][eW][ci]->SetBinError(fFinalCorrelations2D[t][pW][eW][ci]->GetBin(p,e),error);
6786 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
6787 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
6788 } // end of for(Int_t ci=0;ci<4;ci++)
6790 // transfer 1D profile into 1D histogram (pt):
6791 // to be improved (see in documentation if there is a method to transfer values from 1D profile into 1D histogram)
6792 for(Int_t ci=0;ci<4;ci++)
6794 for(Int_t p=1;p<=fnBinsPt;p++)
6798 Double_t correlation = profile[0][ci]->GetBinContent(p);
6799 Double_t spread = profile[0][ci]->GetBinError(p);
6800 Double_t nEvts = fNonEmptyBins1D[t][0]->GetBinContent(p);
6801 Double_t error = 0.;
6802 fFinalCorrelations1D[t][pW][eW][0][ci]->SetBinContent(p,correlation);
6805 error = spread/pow(nEvts,0.5);
6806 fFinalCorrelations1D[t][pW][eW][0][ci]->SetBinError(p,error);
6809 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
6810 } // end of for(Int_t ci=0;ci<4;ci++)
6812 // transfer 1D profile into 1D histogram (eta):
6813 // to be improved (see in documentation if there is a method to transfer values from 1D profile into 1D histogram)
6814 for(Int_t ci=0;ci<4;ci++)
6816 for(Int_t e=1;e<=fnBinsEta;e++)
6820 Double_t correlation = profile[1][ci]->GetBinContent(e);
6821 fFinalCorrelations1D[t][pW][eW][1][ci]->SetBinContent(e,correlation);
6823 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
6824 } // end of for(Int_t ci=0;ci<4;ci++)
6826 } // end of void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsForDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights)
6829 //================================================================================================================================
6832 void AliFlowAnalysisWithQCumulants::CalculateCumulantsForDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights)
6834 // calcualate cumulants for differential flow from measured correlations
6835 // Remark: cumulants calculated here are NOT corrected for non-uniform acceptance. This correction is applied in the method ...
6837 Int_t typeFlag = -1;
6838 Int_t pWeightsFlag = -1;
6839 Int_t eWeightsFlag = -1;
6844 } else if(type == "POI")
6849 cout<<"WARNING: type must be either RP or POI in AFAWQC::CCFDF() !!!!"<<endl;
6853 if(!useParticleWeights)
6861 if(eventWeights == "exact")
6868 Int_t pW = pWeightsFlag;
6869 Int_t eW = eWeightsFlag;
6871 // correlation <<2>>:
6872 Double_t two = fQCorrelations[pW][eW]->GetBinContent(1);
6875 // to be improved (see documentation if I can do all this without looping)
6876 for(Int_t p=1;p<=fnBinsPt;p++)
6878 for(Int_t e=1;e<=fnBinsEta;e++)
6880 // reduced correlations:
6881 Double_t twoPrime = fFinalCorrelations2D[t][pW][eW][0]->GetBinContent(fFinalCorrelations2D[t][pW][eW][0]->GetBin(p,e)); // <<2'>>(pt,eta)
6882 Double_t fourPrime = fFinalCorrelations2D[t][pW][eW][1]->GetBinContent(fFinalCorrelations2D[t][pW][eW][1]->GetBin(p,e)); // <<4'>>(pt,eta)
6883 for(Int_t nua=0;nua<2;nua++)
6886 Double_t qc2Prime = twoPrime; // QC{2'} = <<2'>>
6887 fFinalCumulants2D[t][pW][eW][nua][0]->SetBinContent(fFinalCumulants2D[t][pW][eW][nua][0]->GetBin(p,e),qc2Prime);
6889 Double_t qc4Prime = fourPrime - 2.*twoPrime*two; // QC{4'} = <<4'>> - 2*<<2'>><<2>>
6890 fFinalCumulants2D[t][pW][eW][nua][1]->SetBinContent(fFinalCumulants2D[t][pW][eW][nua][1]->GetBin(p,e),qc4Prime);
6891 } // end of for(Int_t nua=0;nua<2;nua++)
6892 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
6893 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
6896 // to be improved (see documentation if I can do all this without looping)
6897 // to be improved (treat pt and eta in one go)
6898 // to be improved (combine loops over nua for 2D and 1D)
6899 for(Int_t p=1;p<=fnBinsPt;p++)
6901 // reduced correlations:
6902 Double_t twoPrime = fFinalCorrelations1D[t][pW][eW][0][0]->GetBinContent(p); // <<2'>>(pt)
6903 Double_t fourPrime = fFinalCorrelations1D[t][pW][eW][0][1]->GetBinContent(p); // <<4'>>(pt)
6904 // spread of reduced correlations:
6905 Double_t twoPrimeError = fFinalCorrelations1D[t][pW][eW][0][0]->GetBinError(p); // sigma_2'/sqrt{N_2'}(pt)
6906 for(Int_t nua=0;nua<2;nua++)
6909 Double_t qc2Prime = twoPrime; // QC{2'}
6910 Double_t qc2PrimeError = twoPrimeError; // sigma_{d_n{2}}/sqrt{N_2'} // to be improved
6911 fFinalCumulantsPt[t][pW][eW][nua][0]->SetBinContent(p,qc2Prime);
6912 fFinalCumulantsPt[t][pW][eW][nua][0]->SetBinError(p,qc2PrimeError);
6914 Double_t qc4Prime = fourPrime - 2.*twoPrime*two; // QC{4'} = <<4'>> - 2*<<2'>><<2>>
6915 fFinalCumulantsPt[t][pW][eW][nua][1]->SetBinContent(p,qc4Prime);
6916 } // end of for(Int_t nua=0;nua<2;nua++)
6917 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
6921 // to be improved (see documentation if I can do all this without looping)
6922 // to be improved (treat pt and eta in one go)
6923 // to be improved (combine loops over nua for 2D and 1D)
6924 for(Int_t e=1;e<=fnBinsEta;e++)
6926 // reduced correlations:
6927 Double_t twoPrime = fFinalCorrelations1D[t][pW][eW][1][0]->GetBinContent(e); // <<2'>>(eta)
6928 Double_t fourPrime = fFinalCorrelations1D[t][pW][eW][1][1]->GetBinContent(e); // <<4'>>(eta)
6929 for(Int_t nua=0;nua<2;nua++)
6932 Double_t qc2Prime = twoPrime; // QC{2'}
6933 fFinalCumulantsEta[t][pW][eW][nua][0]->SetBinContent(e,qc2Prime);
6935 Double_t qc4Prime = fourPrime - 2.*twoPrime*two; // QC{4'} = <<4'>> - 2*<<2'>><<2>>
6936 fFinalCumulantsEta[t][pW][eW][nua][1]->SetBinContent(e,qc4Prime);
6937 } // end of for(Int_t nua=0;nua<2;nua++)
6938 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
6941 } // end of void AliFlowAnalysisWithQCumulants::CalculateCumulantsForDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights);
6944 //================================================================================================================================
6947 void AliFlowAnalysisWithQCumulants::CalculateDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights)
6949 // calculate differential flow from differential cumulants and previously obtained integrated flow:
6951 Int_t typeFlag = -1;
6952 Int_t pWeightsFlag = -1;
6953 Int_t eWeightsFlag = -1;
6958 } else if(type == "POI")
6963 cout<<"WARNING: type must be either RP or POI in AFAWQC::CDF() !!!!"<<endl;
6967 if(!useParticleWeights)
6975 if(eventWeights == "exact")
6982 Int_t pW = pWeightsFlag;
6983 Int_t eW = eWeightsFlag;
6991 v2 = fIntFlow[pW][eW][1]->GetBinContent(1);
6992 v4 = fIntFlow[pW][eW][1]->GetBinContent(2);
6997 v2 = fIntFlow[pW][eW][0]->GetBinContent(1);
6998 v4 = fIntFlow[pW][eW][0]->GetBinContent(2);
7002 for(Int_t nua=0;nua<2;nua++)
7004 for(Int_t p=1;p<=fnBinsPt;p++)
7006 for(Int_t e=1;e<=fnBinsEta;e++)
7008 // differential cumulants:
7009 Double_t qc2Prime = fFinalCumulants2D[t][pW][eW][nua][0]->GetBinContent(fFinalCumulants2D[t][pW][eW][nua][0]->GetBin(p,e)); // QC{2'}
7010 Double_t qc4Prime = fFinalCumulants2D[t][pW][eW][nua][1]->GetBinContent(fFinalCumulants2D[t][pW][eW][nua][1]->GetBin(p,e)); // QC{4'}
7011 // differential flow:
7012 Double_t v2Prime = 0.;
7013 Double_t v4Prime = 0.;
7016 v2Prime = qc2Prime/v2;
7017 fFinalFlow2D[t][pW][eW][nua][0]->SetBinContent(fFinalFlow2D[t][pW][eW][nua][0]->GetBin(p,e),v2Prime);
7021 v4Prime = -qc4Prime/pow(v4,3.);
7022 fFinalFlow2D[t][pW][eW][nua][1]->SetBinContent(fFinalFlow2D[t][pW][eW][nua][1]->GetBin(p,e),v4Prime);
7024 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
7025 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
7026 } // end of for(Int_t nua=0;nua<2;nua++)
7028 // 1D (pt): // to be improved (combined with eta, combined nua loop with 2D)
7029 for(Int_t nua=0;nua<2;nua++)
7031 for(Int_t p=1;p<=fnBinsPt;p++)
7033 // differential cumulants:
7034 Double_t qc2Prime = fFinalCumulantsPt[t][pW][eW][nua][0]->GetBinContent(p); // QC{2'}
7035 Double_t qc4Prime = fFinalCumulantsPt[t][pW][eW][nua][1]->GetBinContent(p); // QC{4'}
7036 // differential flow:
7037 Double_t v2Prime = 0.;
7038 Double_t v4Prime = 0.;
7041 v2Prime = qc2Prime/v2;
7042 fFinalFlowPt[t][pW][eW][nua][0]->SetBinContent(p,v2Prime);
7046 v4Prime = -qc4Prime/pow(v4,3.);
7047 fFinalFlowPt[t][pW][eW][nua][1]->SetBinContent(p,v4Prime);
7049 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
7050 } // end of for(Int_t nua=0;nua<2;nua++)
7052 // 1D (eta): // to be improved (combined with pt, combined nua loop with 2D)
7053 for(Int_t nua=0;nua<2;nua++)
7055 for(Int_t e=1;e<=fnBinsEta;e++)
7057 // differential cumulants:
7058 Double_t qc2Prime = fFinalCumulantsEta[t][pW][eW][nua][0]->GetBinContent(e); // QC{2'}
7059 Double_t qc4Prime = fFinalCumulantsEta[t][pW][eW][nua][1]->GetBinContent(e); // QC{4'}
7060 // differential flow:
7061 Double_t v2Prime = 0.;
7062 Double_t v4Prime = 0.;
7065 v2Prime = qc2Prime/v2;
7066 fFinalFlowEta[t][pW][eW][nua][0]->SetBinContent(e,v2Prime);
7070 v4Prime = -qc4Prime/pow(v4,3.);
7071 fFinalFlowEta[t][pW][eW][nua][1]->SetBinContent(e,v4Prime);
7073 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
7074 } // end of for(Int_t nua=0;nua<2;nua++)
7076 } // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlow(TString type, Bool_t useParticleWeights)
7079 //================================================================================================================================
7082 void AliFlowAnalysisWithQCumulants::CalculateFinalResultsForRPandPOIIntegratedFlow(TString type, Bool_t useParticleWeights, TString eventWeights)
7084 // calculate final results for integrated flow of RPs and POIs
7086 Int_t typeFlag = -1;
7087 Int_t pWeightsFlag = -1;
7088 Int_t eWeightsFlag = -1;
7093 } else if(type == "POI")
7098 cout<<"WARNING: type must be either RP or POI in AFAWQC::CDF() !!!!"<<endl;
7102 if(!useParticleWeights)
7110 if(eventWeights == "exact")
7117 Int_t pW = pWeightsFlag;
7118 Int_t eW = eWeightsFlag;
7121 TH1F *yield2ndPt = NULL;
7122 TH1F *yield4thPt = NULL;
7123 TH1F *yield6thPt = NULL;
7124 TH1F *yield8thPt = NULL;
7128 yield2ndPt = (TH1F*)(fCommonHists2nd->GetHistPtPOI())->Clone();
7129 yield4thPt = (TH1F*)(fCommonHists4th->GetHistPtPOI())->Clone();
7130 yield6thPt = (TH1F*)(fCommonHists6th->GetHistPtPOI())->Clone();
7131 yield8thPt = (TH1F*)(fCommonHists8th->GetHistPtPOI())->Clone();
7133 else if(type == "RP")
7135 yield2ndPt = (TH1F*)(fCommonHists2nd->GetHistPtRP())->Clone();
7136 yield4thPt = (TH1F*)(fCommonHists4th->GetHistPtRP())->Clone();
7137 yield6thPt = (TH1F*)(fCommonHists6th->GetHistPtRP())->Clone();
7138 yield8thPt = (TH1F*)(fCommonHists8th->GetHistPtRP())->Clone();
7141 Int_t nBinsPt = yield2ndPt->GetNbinsX();
7143 TH1D *flow2ndPt = NULL;
7144 TH1D *flow4thPt = NULL;
7145 TH1D *flow6thPt = NULL;
7146 TH1D *flow8thPt = NULL;
7148 // to be improve (nua = 0 is hardwired)
7149 flow2ndPt = (TH1D*)fFinalFlowPt[t][pW][eW][0][0]->Clone();
7150 flow4thPt = (TH1D*)fFinalFlowPt[t][pW][eW][0][1]->Clone();
7151 flow6thPt = (TH1D*)fFinalFlowPt[t][pW][eW][0][2]->Clone();
7152 flow8thPt = (TH1D*)fFinalFlowPt[t][pW][eW][0][3]->Clone();
7154 Double_t dvn2nd = 0., dvn4th = 0., dvn6th = 0., dvn8th = 0.; // differential flow
7155 Double_t dVn2nd = 0., dVn4th = 0., dVn6th = 0., dVn8th = 0.; // integrated flow
7156 //Double_t dSd2nd = 0., dSd4th = 0., dSd6th = 0., dSd8th = 0.; // error on integrated flow (to be improved - calculation needed)
7158 Double_t dYield2nd = 0., dYield4th = 0., dYield6th = 0., dYield8th = 0.; // pt yield
7159 Double_t dSum2nd = 0., dSum4th = 0., dSum6th = 0., dSum8th = 0.; // needed for normalizing integrated flow
7161 // looping over pt bins:
7162 for(Int_t p=1;p<nBinsPt+1;p++)
7164 dvn2nd = flow2ndPt->GetBinContent(p);
7165 dvn4th = flow4thPt->GetBinContent(p);
7166 dvn6th = flow6thPt->GetBinContent(p);
7167 dvn8th = flow8thPt->GetBinContent(p);
7169 dYield2nd = yield2ndPt->GetBinContent(p);
7170 dYield4th = yield4thPt->GetBinContent(p);
7171 dYield6th = yield6thPt->GetBinContent(p);
7172 dYield8th = yield8thPt->GetBinContent(p);
7174 dVn2nd += dvn2nd*dYield2nd;
7175 dVn4th += dvn4th*dYield4th;
7176 dVn6th += dvn6th*dYield6th;
7177 dVn8th += dvn8th*dYield8th;
7179 dSum2nd += dYield2nd;
7180 dSum4th += dYield4th;
7181 dSum6th += dYield6th;
7182 dSum8th += dYield8th;
7184 // ... to be improved - errors needed to be calculated
7186 } // end of for(Int_t p=1;p<nBinsPt+1;p++)
7188 // normalizing the results for integrated flow:
7194 if(dSum2nd) dVn2nd/=dSum2nd;
7195 if(dSum4th) dVn4th/=dSum4th;
7196 //if(dSum6th) dVn6th/=dSum6th;
7197 //if(dSum8th) dVn8th/=dSum8th;
7200 // storing the results for integrated flow:
7201 if(!(useParticleWeights))
7206 fIntFlowResultsPOIQC->SetBinContent(1,dVn2nd);
7207 fIntFlowResultsPOIQC->SetBinError(1,dSd2nd);
7209 fIntFlowResultsPOIQC->SetBinContent(2,dVn4th);
7210 fIntFlowResultsPOIQC->SetBinError(2,dSd4th);
7212 fIntFlowResultsPOIQC->SetBinContent(3,dVn6th);
7213 fIntFlowResultsPOIQC->SetBinError(3,dSd6th);
7215 fIntFlowResultsPOIQC->SetBinContent(4,dVn8th);
7216 fIntFlowResultsPOIQC->SetBinError(4,dSd8th);
7218 else if (type == "RP")
7221 fIntFlowResultsRPQC->SetBinContent(1,dVn2nd);
7222 fIntFlowResultsRPQC->SetBinError(1,dSd2nd);
7224 fIntFlowResultsRPQC->SetBinContent(2,dVn4th);
7225 fIntFlowResultsRPQC->SetBinError(2,dSd4th);
7227 fIntFlowResultsRPQC->SetBinContent(3,dVn6th);
7228 fIntFlowResultsRPQC->SetBinError(3,dSd6th);
7230 fIntFlowResultsRPQC->SetBinContent(4,dVn8th);
7231 fIntFlowResultsRPQC->SetBinError(4,dSd8th);
7234 else if (useParticleWeights)
7239 fIntFlowResultsPOIQCW->SetBinContent(1,dVn2nd);
7240 fIntFlowResultsPOIQCW->SetBinError(1,dSd2nd);
7242 fIntFlowResultsPOIQCW->SetBinContent(2,dVn4th);
7243 fIntFlowResultsPOIQCW->SetBinError(2,dSd4th);
7245 fIntFlowResultsPOIQCW->SetBinContent(3,dVn6th);
7246 fIntFlowResultsPOIQCW->SetBinError(3,dSd6th);
7248 fIntFlowResultsPOIQCW->SetBinContent(4,dVn8th);
7249 fIntFlowResultsPOIQCW->SetBinError(4,dSd8th);
7251 else if (type == "RP")
7254 fIntFlowResultsRPQCW->SetBinContent(1,dVn2nd);
7255 fIntFlowResultsRPQCW->SetBinError(1,dSd2nd);
7257 fIntFlowResultsRPQCW->SetBinContent(2,dVn4th);
7258 fIntFlowResultsRPQCW->SetBinError(2,dSd4th);
7260 fIntFlowResultsRPQCW->SetBinContent(3,dVn6th);
7261 fIntFlowResultsRPQCW->SetBinError(3,dSd6th);
7263 fIntFlowResultsRPQCW->SetBinContent(4,dVn8th);
7264 fIntFlowResultsRPQCW->SetBinError(4,dSd8th);
7269 // storing the results for integrated flow in common histos:
7270 // to be improved - now they are being filled twice ...
7273 fCommonHistsResults2nd->FillIntegratedFlowPOI(dVn2nd,0.); // to be improved (errors)
7274 fCommonHistsResults4th->FillIntegratedFlowPOI(dVn4th,0.); // to be improved (errors)
7275 fCommonHistsResults6th->FillIntegratedFlowPOI(dVn6th,0.); // to be improved (errors)
7276 fCommonHistsResults8th->FillIntegratedFlowPOI(dVn8th,0.); // to be improved (errors)
7278 else if (type == "RP")
7280 fCommonHistsResults2nd->FillIntegratedFlowRP(dVn2nd,0.); // to be improved (errors)
7281 fCommonHistsResults4th->FillIntegratedFlowRP(dVn4th,0.); // to be improved (errors)
7282 fCommonHistsResults6th->FillIntegratedFlowRP(dVn6th,0.); // to be improved (errors)
7283 fCommonHistsResults8th->FillIntegratedFlowRP(dVn8th,0.); // to be improved (errors)
7296 } // end of AliFlowAnalysisWithQCumulants::CalculateFinalResultsForRPandPOIIntegratedFlow(TString type, Bool_t useParticleWeights, TString eventWeights)
7299 //================================================================================================================================
7302 void AliFlowAnalysisWithQCumulants::InitializeArraysForDistributions()
7304 // initialize arrays used for distributions:
7306 for(Int_t pW=0;pW<1+(Int_t)(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);pW++) // non-weighted or weighted
7308 for(Int_t eW=0;eW<2;eW++)
7310 for(Int_t di=0;di<4;di++) // distribution index
7312 fDistributions[pW][eW][di] = NULL;
7317 } // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForDistributions()
7320 //================================================================================================================================
7323 void AliFlowAnalysisWithQCumulants::BookEverythingForDistributions()
7325 // book all histograms for distributions
7328 //weighted <2>_{n|n} distribution
7329 f2pDistribution = new TH1D("f2pDistribution","<2>_{n|n} distribution",100000,-0.02,0.1);
7330 f2pDistribution->SetXTitle("<2>_{n|n}");
7331 f2pDistribution->SetYTitle("Counts");
7332 fHistList->Add(f2pDistribution);
7334 //weighted <4>_{n,n|n,n} distribution
7335 f4pDistribution = new TH1D("f4pDistribution","<4>_{n,n|n,n} distribution",100000,-0.00025,0.002);
7336 f4pDistribution->SetXTitle("<4>_{n,n|n,n}");
7337 f4pDistribution->SetYTitle("Counts");
7338 fHistList->Add(f4pDistribution);
7340 //weighted <6>_{n,n,n|n,n,n} distribution
7341 f6pDistribution = new TH1D("f6pDistribution","<6>_{n,n,n|n,n,n} distribution",100000,-0.000005,0.000025);
7342 f6pDistribution->SetXTitle("<6>_{n,n,n|n,n,n}");
7343 f6pDistribution->SetYTitle("Counts");
7344 fHistList->Add(f6pDistribution);
7346 //weighted <8>_{n,n,n,n|n,n,n,n} distribution
7347 f8pDistribution = new TH1D("f8pDistribution","<8>_{n,n,n,n|n,n,n,n} distribution",100000,-0.000000001,0.00000001);
7348 f8pDistribution->SetXTitle("<8>_{n,n,n,n|n,n,n,n}");
7349 f8pDistribution->SetYTitle("Counts");
7350 fHistList->Add(f8pDistribution);
7353 } // end of void AliFlowAnalysisWithQCumulants::BookEverythingForDistributions()
7356 //================================================================================================================================
7359 void AliFlowAnalysisWithQCumulants::BookAndNestAllLists()
7361 // book and nest all lists in fHistList
7363 // booking and nesting:
7364 fHistList->Add(fWeightsList);
7366 fIntFlowList = new TList();
7367 fIntFlowList->SetName("Integrated Flow");
7368 fIntFlowList->SetOwner(kTRUE);
7369 fHistList->Add(fIntFlowList);
7371 fIntFlowResults = new TList();
7372 fIntFlowResults->SetName("Results");
7373 fIntFlowResults->SetOwner(kTRUE);
7374 fIntFlowList->Add(fIntFlowResults);
7376 fIntFlowProfiles = new TList();
7377 fIntFlowProfiles->SetName("Profiles");
7378 fIntFlowProfiles->SetOwner(kTRUE);
7379 fIntFlowList->Add(fIntFlowProfiles);
7381 fDiffFlowList = new TList();
7382 fDiffFlowList->SetName("Differential Flow");
7383 fDiffFlowList->SetOwner(kTRUE);
7384 fHistList->Add(fDiffFlowList);
7386 fDiffFlowProfiles = new TList();
7387 fDiffFlowProfiles->SetName("Profiles");
7388 fDiffFlowProfiles->SetOwner(kTRUE);
7389 fDiffFlowList->Add(fDiffFlowProfiles);
7391 fDiffFlowResults = new TList();
7392 fDiffFlowResults->SetName("Results");
7393 fDiffFlowResults->SetOwner(kTRUE);
7394 fDiffFlowList->Add(fDiffFlowResults);
7396 fDistributionsList = new TList();
7397 fDistributionsList->SetName("Distributions");
7398 fDistributionsList->SetOwner(kTRUE);
7399 fHistList->Add(fDistributionsList);
7401 fNestedLoopsList = new TList();
7402 fNestedLoopsList->SetName("Nested Loops");
7403 fNestedLoopsList->SetOwner(kTRUE);
7404 fHistList->Add(fNestedLoopsList);
7406 // flags for naming nested lists:
7408 list.SetOwner(kTRUE);
7409 TString typeFlag[2] = {"RP","POI"};
7410 TString pWeightsFlag[2] = {"not used","used"};
7411 TString eWeightsFlag[2] = {"exact","non-exact"};
7412 TString nuaFlag[2] = {"not corrected","corrected"}; // nua = non-uniform acceptance
7413 TString sinCosFlag[2] = {"sin","cos"};
7415 // nested lists in fDiffFlowProfiles (Differential Flow/Profiles):
7416 for(Int_t t=0;t<2;t++) // type: RP or POI
7418 fDFPType[t] = (TList*)list.Clone();
7419 fDFPType[t]->SetName(Form("%s",typeFlag[t].Data()));
7420 fDiffFlowProfiles->Add(fDFPType[t]);
7421 for(Int_t pW=0;pW<1+(Int_t)(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);pW++) // weights: not used or used
7423 fDFPParticleWeights[t][pW] = (TList*)list.Clone();
7424 fDFPParticleWeights[t][pW]->SetName(Form("%s, pWeights %s",typeFlag[t].Data(),pWeightsFlag[pW].Data()));
7425 fDFPType[t]->Add(fDFPParticleWeights[t][pW]);
7426 for(Int_t eW=0;eW<2;eW++)
7428 fDFPEventWeights[t][pW][eW] = (TList*)list.Clone();
7429 fDFPEventWeights[t][pW][eW]->SetName(Form("%s, pWeights %s, eWeights %s",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
7430 fDFPParticleWeights[t][pW]->Add(fDFPEventWeights[t][pW][eW]);
7432 fDiffFlowCorrelations[t][pW][eW] = (TList*)list.Clone();
7433 fDiffFlowCorrelations[t][pW][eW]->SetName(Form("Correlations (%s, pWeights %s, eWeights %s)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
7434 fDFPEventWeights[t][pW][eW]->Add(fDiffFlowCorrelations[t][pW][eW]);
7435 // products of correlations:
7436 fDiffFlowProductsOfCorrelations[t][pW][eW] = (TList*)list.Clone();
7437 fDiffFlowProductsOfCorrelations[t][pW][eW]->SetName(Form("Products of correlations (%s, pWeights %s, eWeights %s)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
7438 fDFPEventWeights[t][pW][eW]->Add(fDiffFlowProductsOfCorrelations[t][pW][eW]);
7439 // correction terms:
7440 for(Int_t sc=0;sc<2;sc++) // corrections for NUA: sin or cos terms
7442 fDiffFlowCorrectionTerms[t][pW][eW][sc] = (TList*)list.Clone();
7443 fDiffFlowCorrectionTerms[t][pW][eW][sc]->SetName(Form("Corrections for NUA (%s, pWeights %s, eWeights %s, %s terms)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),sinCosFlag[sc].Data()));
7444 fDFPEventWeights[t][pW][eW]->Add(fDiffFlowCorrectionTerms[t][pW][eW][sc]);
7450 // nested lists in fDiffFlowResults (Differential Flow/Results):
7451 for(Int_t t=0;t<2;t++) // RP or POI
7453 fDFRType[t] = (TList*)list.Clone();
7454 fDFRType[t]->SetName(Form("%s",typeFlag[t].Data()));
7455 fDiffFlowResults->Add(fDFRType[t]);
7456 for(Int_t pW=0;pW<1+(Int_t)(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);pW++) // particle weights not used or used
7458 fDFRParticleWeights[t][pW] = (TList*)list.Clone();
7459 fDFRParticleWeights[t][pW]->SetName(Form("%s, pWeights %s",typeFlag[t].Data(),pWeightsFlag[pW].Data()));
7460 fDFRType[t]->Add(fDFRParticleWeights[t][pW]);
7461 for(Int_t eW=0;eW<2;eW++) // event weights: exact ot non-exact // to be improved (terminology)
7463 fDFREventWeights[t][pW][eW] = (TList*)list.Clone();
7464 fDFREventWeights[t][pW][eW]->SetName(Form("%s, pWeights %s, eWeights %s",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
7465 fDFRParticleWeights[t][pW]->Add(fDFREventWeights[t][pW][eW]);
7466 // final correlations:
7467 fDiffFlowFinalCorrelations[t][pW][eW] = (TList*)list.Clone();
7468 fDiffFlowFinalCorrelations[t][pW][eW]->SetName(Form("Correlations (%s, pWeights %s, eWeights %s)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
7469 fDFREventWeights[t][pW][eW]->Add(fDiffFlowFinalCorrelations[t][pW][eW]);
7470 // final covariances:
7471 fDiffFlowFinalCovariances[t][pW][eW] = (TList*)list.Clone();
7472 fDiffFlowFinalCovariances[t][pW][eW]->SetName(Form("Covariances (%s, pWeights %s, eWeights %s)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
7473 fDFREventWeights[t][pW][eW]->Add(fDiffFlowFinalCovariances[t][pW][eW]);
7474 // final corrections:
7475 fDiffFlowFinalCorrections[t][pW][eW] = (TList*)list.Clone();
7476 fDiffFlowFinalCorrections[t][pW][eW]->SetName(Form("Corrections (%s, pWeights %s, eWeights %s)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data()));
7477 fDFREventWeights[t][pW][eW]->Add(fDiffFlowFinalCorrections[t][pW][eW]);
7478 for(Int_t nua=0;nua<2;nua++)
7480 fDFRCorrections[t][pW][eW][nua] = (TList*)list.Clone();
7481 fDFRCorrections[t][pW][eW][nua]->SetName(Form("%s, pWeights %s, eWeights %s, %s for NUA",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data()));
7482 fDFREventWeights[t][pW][eW]->Add(fDFRCorrections[t][pW][eW][nua]);
7484 fDiffFlowFinalCumulants[t][pW][eW][nua] = (TList*)list.Clone();
7485 fDiffFlowFinalCumulants[t][pW][eW][nua]->SetName(Form("Cumulants (%s, pWeights %s, eWeights %s, %s for NUA)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data()));
7486 fDFRCorrections[t][pW][eW][nua]->Add(fDiffFlowFinalCumulants[t][pW][eW][nua]);
7487 // final differential flow:
7488 fDiffFlowFinalFlow[t][pW][eW][nua] = (TList*)list.Clone();
7489 fDiffFlowFinalFlow[t][pW][eW][nua]->SetName(Form("Differential Flow (%s, pWeights %s, eWeights %s, %s for NUA)",typeFlag[t].Data(),pWeightsFlag[pW].Data(),eWeightsFlag[eW].Data(),nuaFlag[nua].Data()));
7490 fDFRCorrections[t][pW][eW][nua]->Add(fDiffFlowFinalFlow[t][pW][eW][nua]);
7496 } // end of void AliFlowAnalysisWithQCumulants::BookAndNestAllLists()
7499 //================================================================================================================================
7502 void AliFlowAnalysisWithQCumulants::FillCommonHistResultsDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights, Bool_t correctedForNUA)
7504 // fill common result histograms for differential flow
7506 // shortcuts for the flags:
7507 Int_t t = 0; // 0=RP, 1=POI
7508 Int_t pW = (Int_t)(useParticleWeights); // 0=weights not useed, 1=weights used
7510 Int_t nua = (Int_t)(correctedForNUA); // 0=not corrected for NUA, 1=corrected for NUA
7517 if(eventWeights == "exact")
7522 for(Int_t o=0;o<4;o++) // order
7524 if(!fFinalFlowPt[t][pW][eW][nua][o])
7526 cout<<"WARNING: fFinalFlowPt[t][pW][eW][nua][o] is NULL in AFAWQC::FCHRIF() !!!!"<<endl;
7527 cout<<"t = "<<t<<endl;
7528 cout<<"pW = "<<pW<<endl;
7529 cout<<"eW = "<<eW<<endl;
7530 cout<<"nua = "<<nua<<endl;
7531 cout<<"o = "<<o<<endl;
7534 if(!fFinalFlowEta[t][pW][eW][nua][o])
7536 cout<<"WARNING: fFinalFlowEta[t][pW][eW][nua][o] is NULL in AFAWQC::FCHRIF() !!!!"<<endl;
7537 cout<<"t = "<<t<<endl;
7538 cout<<"pW = "<<pW<<endl;
7539 cout<<"eW = "<<eW<<endl;
7540 cout<<"nua = "<<nua<<endl;
7541 cout<<"o = "<<o<<endl;
7546 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
7548 cout<<"WARNING: fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th"<<endl;
7549 cout<<" is NULL in AFAWQC::FCHRIF() !!!!"<<endl;
7554 for(Int_t p=1;p<=fnBinsPt;p++)
7556 Double_t v2 = fFinalFlowPt[t][pW][eW][nua][0]->GetBinContent(p);
7557 Double_t v4 = fFinalFlowPt[t][pW][eW][nua][1]->GetBinContent(p);
7558 Double_t v6 = fFinalFlowPt[t][pW][eW][nua][2]->GetBinContent(p);
7559 Double_t v8 = fFinalFlowPt[t][pW][eW][nua][3]->GetBinContent(p);
7561 //Double_t v2Error = fFinalFlow1D[t][pW][nua][0][0]->GetBinError(p);
7562 //Double_t v4Error = fFinalFlow1D[t][pW][nua][0][1]->GetBinError(p);
7563 //Double_t v6Error = fFinalFlow1D[t][pW][nua][0][2]->GetBinError(p);
7564 //Double_t v8Error = fFinalFlow1D[t][pW][nua][0][3]->GetBinError(p);
7568 fCommonHistsResults2nd->FillDifferentialFlowPtRP(p,v2,0.);
7569 fCommonHistsResults4th->FillDifferentialFlowPtRP(p,v4,0.);
7570 fCommonHistsResults6th->FillDifferentialFlowPtRP(p,v6,0.);
7571 fCommonHistsResults8th->FillDifferentialFlowPtRP(p,v8,0.);
7572 } else if(type == "POI")
7574 fCommonHistsResults2nd->FillDifferentialFlowPtPOI(p,v2,0.);
7575 fCommonHistsResults4th->FillDifferentialFlowPtPOI(p,v4,0.);
7576 fCommonHistsResults6th->FillDifferentialFlowPtPOI(p,v6,0.);
7577 fCommonHistsResults8th->FillDifferentialFlowPtPOI(p,v8,0.);
7579 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
7582 for(Int_t e=1;e<=fnBinsEta;e++)
7584 Double_t v2 = fFinalFlowEta[t][pW][eW][nua][0]->GetBinContent(e);
7585 Double_t v4 = fFinalFlowEta[t][pW][eW][nua][1]->GetBinContent(e);
7586 Double_t v6 = fFinalFlowEta[t][pW][eW][nua][2]->GetBinContent(e);
7587 Double_t v8 = fFinalFlowEta[t][pW][eW][nua][3]->GetBinContent(e);
7589 //Double_t v2Error = fFinalFlow1D[t][pW][nua][1][0]->GetBinError(e);
7590 //Double_t v4Error = fFinalFlow1D[t][pW][nua][1][1]->GetBinError(e);
7591 //Double_t v6Error = fFinalFlow1D[t][pW][nua][1][2]->GetBinError(e);
7592 //Double_t v8Error = fFinalFlow1D[t][pW][nua][1][3]->GetBinError(e);
7596 fCommonHistsResults2nd->FillDifferentialFlowEtaRP(e,v2,0.);
7597 fCommonHistsResults4th->FillDifferentialFlowEtaRP(e,v4,0.);
7598 fCommonHistsResults6th->FillDifferentialFlowEtaRP(e,v6,0.);
7599 fCommonHistsResults8th->FillDifferentialFlowEtaRP(e,v8,0.);
7600 } else if(type == "POI")
7602 fCommonHistsResults2nd->FillDifferentialFlowEtaPOI(e,v2,0.);
7603 fCommonHistsResults4th->FillDifferentialFlowEtaPOI(e,v4,0.);
7604 fCommonHistsResults6th->FillDifferentialFlowEtaPOI(e,v6,0.);
7605 fCommonHistsResults8th->FillDifferentialFlowEtaPOI(e,v8,0.);
7607 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
7609 } // end of void AliFlowAnalysisWithQCumulants::FillCommonHistResultsDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights, Bool_t correctedForNUA)
7612 //================================================================================================================================
7615 void AliFlowAnalysisWithQCumulants::AccessConstants()
7617 // access needed common constants from AliFlowCommonConstants
7619 fnBinsPhi = AliFlowCommonConstants::GetNbinsPhi();
7620 fPhiMin = AliFlowCommonConstants::GetPhiMin();
7621 fPhiMax = AliFlowCommonConstants::GetPhiMax();
7622 if(fnBinsPhi) fPhiBinWidth = (fPhiMax-fPhiMin)/fnBinsPhi;
7623 fnBinsPt = AliFlowCommonConstants::GetNbinsPt();
7624 fPtMin = AliFlowCommonConstants::GetPtMin();
7625 fPtMax = AliFlowCommonConstants::GetPtMax();
7626 if(fnBinsPt) fPtBinWidth = (fPtMax-fPtMin)/fnBinsPt;
7627 fnBinsEta = AliFlowCommonConstants::GetNbinsEta();
7628 fEtaMin = AliFlowCommonConstants::GetEtaMin();
7629 fEtaMax = AliFlowCommonConstants::GetEtaMax();
7630 if(fnBinsEta) fEtaBinWidth = (fEtaMax-fEtaMin)/fnBinsEta;
7632 } // end of void AliFlowAnalysisWithQCumulants::AccessConstants()
7635 //================================================================================================================================
7638 void AliFlowAnalysisWithQCumulants::CalculateSumAndProductOfEventWeights()
7640 // 1.) calculate sum of linear and quadratic event weights;
7641 // 2.) calculate products of event weights
7643 Double_t dMult = (*fSMpk)(0,0); // multiplicity (number of particles used to determine the reaction plane)
7645 Double_t eventWeight[4] = {0};
7646 eventWeight[0] = dMult*(dMult-1); // event weight for <2>
7647 eventWeight[1] = dMult*(dMult-1)*(dMult-2)*(dMult-3); // event weight for <4>
7648 eventWeight[2] = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5); // event weight for <6>
7649 eventWeight[3] = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7); // event weight for <8>
7651 for(Int_t p=0;p<2;p++)
7653 for(Int_t c=0;c<4;c++)
7655 fSumOfEventWeights[0][0][p]->Fill(c+0.5,pow(eventWeight[c],p+1));
7659 // to be improved (hardwired pW and eW):
7660 fProductOfEventWeights[0][0]->Fill(0.5,eventWeight[0]*eventWeight[1]);
7661 fProductOfEventWeights[0][0]->Fill(1.5,eventWeight[0]*eventWeight[2]);
7662 fProductOfEventWeights[0][0]->Fill(2.5,eventWeight[0]*eventWeight[3]);
7663 fProductOfEventWeights[0][0]->Fill(3.5,eventWeight[1]*eventWeight[2]);
7664 fProductOfEventWeights[0][0]->Fill(4.5,eventWeight[1]*eventWeight[3]);
7665 fProductOfEventWeights[0][0]->Fill(5.5,eventWeight[2]*eventWeight[3]);
7667 } // end of void AliFlowAnalysisWithQCumulants::CalculateSumAndProductOfEventWeights()
7670 //================================================================================================================================