1 /*************************************************************************
2 * Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 /**********************************
17 * flow analysis with Q-cumulants *
19 * author: Ante Bilandzic *
20 * (abilandzic@gmail.com) *
21 *********************************/
23 #define AliFlowAnalysisWithQCumulants_cxx
25 #include "Riostream.h"
26 #include "AliFlowCommonConstants.h"
27 #include "AliFlowCommonHist.h"
28 #include "AliFlowCommonHistResults.h"
34 #include "TParticle.h"
38 #include "TProfile2D.h"
41 #include "TPaveLabel.h"
43 #include "AliFlowEventSimple.h"
44 #include "AliFlowTrackSimple.h"
45 #include "AliFlowAnalysisWithQCumulants.h"
65 //================================================================================================================
67 ClassImp(AliFlowAnalysisWithQCumulants)
69 AliFlowAnalysisWithQCumulants::AliFlowAnalysisWithQCumulants():
73 fBookOnlyBasicCCH(kTRUE),
75 fCommonHists2nd(NULL),
76 fCommonHists4th(NULL),
77 fCommonHists6th(NULL),
78 fCommonHists8th(NULL),
79 fCommonHistsResults2nd(NULL),
80 fCommonHistsResults4th(NULL),
81 fCommonHistsResults6th(NULL),
82 fCommonHistsResults8th(NULL),
95 fCommonConstants(NULL),
96 fFillMultipleControlHistograms(kFALSE),
99 // 2a.) particle weights:
101 fUsePhiWeights(kFALSE),
102 fUsePtWeights(kFALSE),
103 fUseEtaWeights(kFALSE),
104 fUseTrackWeights(kFALSE),
105 fUseParticleWeights(NULL),
109 // 2b.) event weights:
110 fMultiplicityWeight(NULL),
111 // 3.) integrated flow:
113 fIntFlowProfiles(NULL),
114 fIntFlowResults(NULL),
115 fIntFlowAllCorrelationsVsM(NULL),
117 fApplyCorrectionForNUA(kFALSE),
118 fApplyCorrectionForNUAVsM(kFALSE),
122 fPropagateErrorAlsoFromNIT(kFALSE),
123 fCalculateCumulantsVsM(kFALSE),
124 fCalculateAllCorrelationsVsM(kFALSE),
125 fMinimumBiasReferenceFlow(kTRUE),
126 fForgetAboutCovariances(kFALSE),
127 fStorePhiDistributionForOneEvent(kFALSE),
131 fIntFlowCorrelationsEBE(NULL),
132 fIntFlowEventWeightsForCorrelationsEBE(NULL),
133 fIntFlowCorrelationsAllEBE(NULL),
134 fReferenceMultiplicityEBE(0.),
135 fAvMultiplicity(NULL),
136 fIntFlowCorrelationsPro(NULL),
137 fIntFlowSquaredCorrelationsPro(NULL),
138 fIntFlowCorrelationsAllPro(NULL),
139 fIntFlowExtraCorrelationsPro(NULL),
140 fIntFlowProductOfCorrelationsPro(NULL),
141 fIntFlowProductOfCorrectionTermsForNUAPro(NULL),
142 fIntFlowCorrelationsHist(NULL),
143 fIntFlowCorrelationsAllHist(NULL),
144 fIntFlowCovariances(NULL),
145 fIntFlowSumOfProductOfEventWeights(NULL),
146 fIntFlowCovariancesNUA(NULL),
147 fIntFlowSumOfProductOfEventWeightsNUA(NULL),
148 fIntFlowQcumulants(NULL),
149 fIntFlowQcumulantsRebinnedInM(NULL),
150 fIntFlowQcumulantsErrorSquaredRatio(NULL),
152 fIntFlowRebinnedInM(NULL),
153 fIntFlowDetectorBias(NULL),
154 // 4.) differential flow:
156 fDiffFlowProfiles(NULL),
157 fDiffFlowResults(NULL),
159 fDiffFlowFlags(NULL),
160 fCalculateDiffFlow(kTRUE),
161 fCalculate2DDiffFlow(kFALSE),
162 fCalculateDiffFlowVsEta(kTRUE),
163 // 5.) other differential correlators:
164 fOtherDiffCorrelatorsList(NULL),
165 // 6.) distributions:
166 fDistributionsList(NULL),
167 fDistributionsFlags(NULL),
168 fStoreDistributions(kFALSE),
171 fPhiDistributionForOneEvent(NULL),
172 // x.) debugging and cross-checking:
173 fNestedLoopsList(NULL),
174 fEvaluateIntFlowNestedLoops(kFALSE),
175 fEvaluateDiffFlowNestedLoops(kFALSE),
176 fMaxAllowedMultiplicity(10),
177 fEvaluateNestedLoops(NULL),
178 fIntFlowDirectCorrelations(NULL),
179 fIntFlowExtraDirectCorrelations(NULL),
180 fCrossCheckInPtBinNo(10),
181 fCrossCheckInEtaBinNo(20),
182 fNoOfParticlesInBin(NULL)
186 // base list to hold all output objects:
187 fHistList = new TList();
188 fHistList->SetName("cobjQC");
189 fHistList->SetOwner(kTRUE);
191 // list to hold histograms with phi, pt and eta weights:
192 fWeightsList = new TList();
194 // multiplicity weight:
195 fMultiplicityWeight = new TString("combinations");
198 fAnalysisLabel = new TString();
200 // initialize all arrays:
201 this->InitializeArraysForIntFlow();
202 this->InitializeArraysForDiffFlow();
203 this->InitializeArraysForDistributions();
204 this->InitializeArraysForVarious();
205 this->InitializeArraysForNestedLoops();
207 } // end of constructor
209 //================================================================================================================
211 AliFlowAnalysisWithQCumulants::~AliFlowAnalysisWithQCumulants()
217 } // end of AliFlowAnalysisWithQCumulants::~AliFlowAnalysisWithQCumulants()
219 //================================================================================================================
221 void AliFlowAnalysisWithQCumulants::Init()
223 // a) Cross check if the settings make sense before starting the QC adventure;
224 // b) Access all common constants;
225 // c) Book all objects;
226 // d) Store flags for integrated and differential flow;
227 // e) Store flags for distributions of corelations;
228 // f) Store harmonic which will be estimated.
230 //save old value and prevent histograms from being added to directory
231 //to avoid name clashes in case multiple analaysis objects are used
233 Bool_t oldHistAddStatus = TH1::AddDirectoryStatus();
234 TH1::AddDirectory(kFALSE);
236 // a) Cross check if the settings make sense before starting the QC adventure;
237 this->CrossCheckSettings();
238 // b) Access all common constants and book a profile to hold them:
239 this->CommonConstants("Init");
240 // c) Book all objects:
241 this->BookAndFillWeightsHistograms();
242 this->BookAndNestAllLists();
243 this->BookCommonHistograms();
244 this->BookEverythingForIntegratedFlow();
245 this->BookEverythingForDifferentialFlow();
246 this->BookEverythingFor2DDifferentialFlow();
247 this->BookEverythingForDistributions();
248 this->BookEverythingForVarious();
249 this->BookEverythingForNestedLoops();
250 // d) Store flags for integrated and differential flow:
251 this->StoreIntFlowFlags();
252 this->StoreDiffFlowFlags();
253 // e) Store flags for distributions of corelations:
254 this->StoreFlagsForDistributions();
255 // f) Store harmonic which will be estimated:
256 this->StoreHarmonic();
258 TH1::AddDirectory(oldHistAddStatus);
259 } // end of void AliFlowAnalysisWithQCumulants::Init()
261 //================================================================================================================
263 void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
265 // Running over data only in this method.
267 // a) Check all pointers used in this method;
268 // b) Define local variables;
269 // c) Fill the common control histograms and call the method to fill fAvMultiplicity;
270 // d) Loop over data and calculate e-b-e quantities Q_{n,k}, S_{p,k} and s_{p,k};
271 // e) Calculate the final expressions for S_{p,k} and s_{p,k} (important !!!!);
272 // f) Call the methods which calculate correlations for reference flow;
273 // g) Call the methods which calculate correlations for differential flow;
274 // h) Call the methods which calculate correlations for 2D differential flow;
275 // i) Call the methods which calculate other differential correlators;
276 // j) Distributions of correlations;
277 // k) Store phi distribution for one event to illustrate flow;
278 // l) Cross-check with nested loops correlators for reference flow;
279 // m) Cross-check with nested loops correlators for differential flow;
280 // n) Reset all event-by-event quantities (very important !!!!).
282 // a) Check all pointers used in this method:
283 this->CheckPointersUsedInMake();
285 // b) Define local variables:
286 Double_t dPhi = 0.; // azimuthal angle in the laboratory frame
287 Double_t dPt = 0.; // transverse momentum
288 Double_t dEta = 0.; // pseudorapidity
289 Double_t wPhi = 1.; // phi weight
290 Double_t wPt = 1.; // pt weight
291 Double_t wEta = 1.; // eta weight
292 Double_t wTrack = 1.; // track weight
293 Int_t nRP = anEvent->GetEventNSelTracksRP(); // number of RPs (i.e. number of reference particles)
294 fReferenceMultiplicityEBE = anEvent->GetReferenceMultiplicity(); // reference multiplicity for current event
295 Double_t ptEta[2] = {0.,0.}; // 0 = dPt, 1 = dEta
297 // c) Fill the common control histograms and call the method to fill fAvMultiplicity:
298 this->FillCommonControlHistograms(anEvent);
299 this->FillAverageMultiplicities(nRP);
301 // d) Loop over data and calculate e-b-e quantities Q_{n,k}, S_{p,k} and s_{p,k}:
302 Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = total number of primary tracks, i.e. nPrim = nRP + nPOI where:
303 // nRP = # of reference particles;
304 // nPOI = # of particles of interest.
305 AliFlowTrackSimple *aftsTrack = NULL;
306 Int_t n = fHarmonic; // shortcut for the harmonic
307 for(Int_t i=0;i<nPrim;i++)
309 aftsTrack=anEvent->GetTrack(i);
312 if(!(aftsTrack->InRPSelection() || aftsTrack->InPOISelection())){continue;} // safety measure: consider only tracks which are RPs or POIs
313 if(aftsTrack->InRPSelection()) // RP condition:
315 dPhi = aftsTrack->Phi();
316 dPt = aftsTrack->Pt();
317 dEta = aftsTrack->Eta();
318 if(fUsePhiWeights && fPhiWeights && fnBinsPhi) // determine phi weight for this particle:
320 wPhi = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*fnBinsPhi/TMath::TwoPi())));
322 if(fUsePtWeights && fPtWeights && fnBinsPt) // determine pt weight for this particle:
324 wPt = fPtWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/fPtBinWidth)));
326 if(fUseEtaWeights && fEtaWeights && fEtaBinWidth) // determine eta weight for this particle:
328 wEta = fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/fEtaBinWidth)));
330 // Access track weight:
333 wTrack = aftsTrack->Weight();
335 // Calculate Re[Q_{m*n,k}] and Im[Q_{m*n,k}] for this event (m = 1,2,...,6, k = 0,1,...,8):
336 for(Int_t m=0;m<6;m++) // to be improved - hardwired 6
338 for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
340 (*fReQ)(m,k)+=pow(wPhi*wPt*wEta*wTrack,k)*TMath::Cos((m+1)*n*dPhi);
341 (*fImQ)(m,k)+=pow(wPhi*wPt*wEta*wTrack,k)*TMath::Sin((m+1)*n*dPhi);
344 // Calculate S_{p,k} for this event (Remark: final calculation of S_{p,k} follows after the loop over data bellow):
345 for(Int_t p=0;p<8;p++)
347 for(Int_t k=0;k<9;k++)
349 (*fSpk)(p,k)+=pow(wPhi*wPt*wEta*wTrack,k);
352 // Differential flow:
353 if(fCalculateDiffFlow || fCalculate2DDiffFlow)
357 // Calculate r_{m*n,k} and s_{p,k} (r_{m,k} is 'p-vector' for RPs):
358 for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
360 for(Int_t m=0;m<4;m++) // to be improved - hardwired 4
362 if(fCalculateDiffFlow)
364 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
366 fReRPQ1dEBE[0][pe][m][k]->Fill(ptEta[pe],pow(wPhi*wPt*wEta*wTrack,k)*TMath::Cos((m+1.)*n*dPhi),1.);
367 fImRPQ1dEBE[0][pe][m][k]->Fill(ptEta[pe],pow(wPhi*wPt*wEta*wTrack,k)*TMath::Sin((m+1.)*n*dPhi),1.);
368 if(m==0) // s_{p,k} does not depend on index m
370 fs1dEBE[0][pe][k]->Fill(ptEta[pe],pow(wPhi*wPt*wEta*wTrack,k),1.);
371 } // end of if(m==0) // s_{p,k} does not depend on index m
372 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
373 } // end of if(fCalculateDiffFlow)
374 if(fCalculate2DDiffFlow)
376 fReRPQ2dEBE[0][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta*wTrack,k)*TMath::Cos((m+1.)*n*dPhi),1.);
377 fImRPQ2dEBE[0][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta*wTrack,k)*TMath::Sin((m+1.)*n*dPhi),1.);
378 if(m==0) // s_{p,k} does not depend on index m
380 fs2dEBE[0][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta*wTrack,k),1.);
381 } // end of if(m==0) // s_{p,k} does not depend on index m
382 } // end of if(fCalculate2DDiffFlow)
383 } // end of for(Int_t m=0;m<4;m++) // to be improved - hardwired 4
384 } // end of for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
385 // Checking if RP particle is also POI particle:
386 if(aftsTrack->InPOISelection())
388 // Calculate q_{m*n,k} and s_{p,k} ('q-vector' and 's' for RPs && POIs):
389 for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
391 for(Int_t m=0;m<4;m++) // to be improved - hardwired 4
393 if(fCalculateDiffFlow)
395 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
397 fReRPQ1dEBE[2][pe][m][k]->Fill(ptEta[pe],pow(wPhi*wPt*wEta*wTrack,k)*TMath::Cos((m+1.)*n*dPhi),1.);
398 fImRPQ1dEBE[2][pe][m][k]->Fill(ptEta[pe],pow(wPhi*wPt*wEta*wTrack,k)*TMath::Sin((m+1.)*n*dPhi),1.);
399 if(m==0) // s_{p,k} does not depend on index m
401 fs1dEBE[2][pe][k]->Fill(ptEta[pe],pow(wPhi*wPt*wEta*wTrack,k),1.);
402 } // end of if(m==0) // s_{p,k} does not depend on index m
403 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
404 } // end of if(fCalculateDiffFlow)
405 if(fCalculate2DDiffFlow)
407 fReRPQ2dEBE[2][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta*wTrack,k)*TMath::Cos((m+1.)*n*dPhi),1.);
408 fImRPQ2dEBE[2][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta*wTrack,k)*TMath::Sin((m+1.)*n*dPhi),1.);
409 if(m==0) // s_{p,k} does not depend on index m
411 fs2dEBE[2][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta*wTrack,k),1.);
412 } // end of if(m==0) // s_{p,k} does not depend on index m
413 } // end of if(fCalculate2DDiffFlow)
414 } // end of for(Int_t m=0;m<4;m++) // to be improved - hardwired 4
415 } // end of for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
416 } // end of if(aftsTrack->InPOISelection())
417 } // end of if(fCalculateDiffFlow || fCalculate2DDiffFlow)
418 } // end of if(pTrack->InRPSelection())
419 if(aftsTrack->InPOISelection())
421 dPhi = aftsTrack->Phi();
422 dPt = aftsTrack->Pt();
423 dEta = aftsTrack->Eta();
428 if(fUsePhiWeights && fPhiWeights && fnBinsPhi && aftsTrack->InRPSelection()) // determine phi weight for POI && RP particle:
430 wPhi = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*fnBinsPhi/TMath::TwoPi())));
432 if(fUsePtWeights && fPtWeights && fnBinsPt && aftsTrack->InRPSelection()) // determine pt weight for POI && RP particle:
434 wPt = fPtWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/fPtBinWidth)));
436 if(fUseEtaWeights && fEtaWeights && fEtaBinWidth && aftsTrack->InRPSelection()) // determine eta weight for POI && RP particle:
438 wEta = fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/fEtaBinWidth)));
440 // Access track weight for POI && RP particle:
441 if(aftsTrack->InRPSelection() && fUseTrackWeights)
443 wTrack = aftsTrack->Weight();
447 // Calculate p_{m*n,k} ('p-vector' for POIs):
448 for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
450 for(Int_t m=0;m<4;m++) // to be improved - hardwired 4
452 if(fCalculateDiffFlow)
454 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
456 fReRPQ1dEBE[1][pe][m][k]->Fill(ptEta[pe],pow(wPhi*wPt*wEta*wTrack,k)*TMath::Cos((m+1.)*n*dPhi),1.);
457 fImRPQ1dEBE[1][pe][m][k]->Fill(ptEta[pe],pow(wPhi*wPt*wEta*wTrack,k)*TMath::Sin((m+1.)*n*dPhi),1.);
458 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
459 } // end of if(fCalculateDiffFlow)
460 if(fCalculate2DDiffFlow)
462 fReRPQ2dEBE[1][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta*wTrack,k)*TMath::Cos((m+1.)*n*dPhi),1.);
463 fImRPQ2dEBE[1][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta*wTrack,k)*TMath::Sin((m+1.)*n*dPhi),1.);
464 } // end of if(fCalculate2DDiffFlow)
465 } // end of for(Int_t m=0;m<4;m++) // to be improved - hardwired 4
466 } // end of for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
467 } // end of if(pTrack->InPOISelection())
468 } else // to if(aftsTrack)
470 printf("\n WARNING (QC): No particle (i.e. aftsTrack is a NULL pointer in AFAWQC::Make())!!!!\n\n");
472 } // end of for(Int_t i=0;i<nPrim;i++)
474 // e) Calculate the final expressions for S_{p,k} and s_{p,k} (important !!!!):
475 for(Int_t p=0;p<8;p++)
477 for(Int_t k=0;k<9;k++)
479 (*fSpk)(p,k)=pow((*fSpk)(p,k),p+1);
480 // ... for the time being s_{p,k} dosn't need higher powers, so no need to finalize it here ...
481 } // end of for(Int_t k=0;k<9;k++)
482 } // end of for(Int_t p=0;p<8;p++)
484 // f) Call the methods which calculate correlations for reference flow:
485 if(!fEvaluateIntFlowNestedLoops)
487 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
489 if(nRP>1){this->CalculateIntFlowCorrelations();} // without using particle weights
490 } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
492 if(nRP>1){this->CalculateIntFlowCorrelationsUsingParticleWeights();} // with using particle weights
494 // Whether or not using particle weights the following is calculated in the same way:
495 if(nRP>3){this->CalculateIntFlowProductOfCorrelations();}
496 if(nRP>1){this->CalculateIntFlowSumOfEventWeights();}
497 if(nRP>1){this->CalculateIntFlowSumOfProductOfEventWeights();}
498 // Non-isotropic terms:
499 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
501 if(nRP>0){this->CalculateIntFlowCorrectionsForNUASinTerms();}
502 if(nRP>0){this->CalculateIntFlowCorrectionsForNUACosTerms();}
503 } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
505 if(nRP>0){this->CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights();}
506 if(nRP>0){this->CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights();}
508 // Whether or not using particle weights the following is calculated in the same way:
509 if(nRP>0){this->CalculateIntFlowProductOfCorrectionTermsForNUA();}
510 if(nRP>0){this->CalculateIntFlowSumOfEventWeightsNUA();}
511 if(nRP>0){this->CalculateIntFlowSumOfProductOfEventWeightsNUA();}
512 } // end of if(!fEvaluateIntFlowNestedLoops)
514 // g) Call the methods which calculate correlations for differential flow:
515 if(!fEvaluateDiffFlowNestedLoops && fCalculateDiffFlow)
517 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
519 // Without using particle weights:
520 this->CalculateDiffFlowCorrelations("RP","Pt");
521 if(fCalculateDiffFlowVsEta){this->CalculateDiffFlowCorrelations("RP","Eta");}
522 this->CalculateDiffFlowCorrelations("POI","Pt");
523 if(fCalculateDiffFlowVsEta){this->CalculateDiffFlowCorrelations("POI","Eta");}
524 // Non-isotropic terms:
525 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Pt");
526 if(fCalculateDiffFlowVsEta){this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Eta");}
527 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Pt");
528 if(fCalculateDiffFlowVsEta){this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Eta");}
529 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Pt");
530 if(fCalculateDiffFlowVsEta){this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Eta");}
531 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Pt");
532 if(fCalculateDiffFlowVsEta){this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Eta");}
533 } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
535 // With using particle weights:
536 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Pt");
537 if(fCalculateDiffFlowVsEta){this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Eta");}
538 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Pt");
539 if(fCalculateDiffFlowVsEta){this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Eta");}
540 // Non-isotropic terms:
541 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Pt");
542 if(fCalculateDiffFlowVsEta){this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Eta");}
543 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Pt");
544 if(fCalculateDiffFlowVsEta){this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Eta");}
545 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Pt");
546 if(fCalculateDiffFlowVsEta){this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Eta");}
547 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Pt");
548 if(fCalculateDiffFlowVsEta){this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Eta");}
550 // Whether or not using particle weights the following is calculated in the same way:
551 this->CalculateDiffFlowProductOfCorrelations("RP","Pt");
552 if(fCalculateDiffFlowVsEta){this->CalculateDiffFlowProductOfCorrelations("RP","Eta");}
553 this->CalculateDiffFlowProductOfCorrelations("POI","Pt");
554 if(fCalculateDiffFlowVsEta){this->CalculateDiffFlowProductOfCorrelations("POI","Eta");}
555 this->CalculateDiffFlowSumOfEventWeights("RP","Pt");
556 if(fCalculateDiffFlowVsEta){this->CalculateDiffFlowSumOfEventWeights("RP","Eta");}
557 this->CalculateDiffFlowSumOfEventWeights("POI","Pt");
558 if(fCalculateDiffFlowVsEta){this->CalculateDiffFlowSumOfEventWeights("POI","Eta");}
559 this->CalculateDiffFlowSumOfProductOfEventWeights("RP","Pt");
560 if(fCalculateDiffFlowVsEta){this->CalculateDiffFlowSumOfProductOfEventWeights("RP","Eta");}
561 this->CalculateDiffFlowSumOfProductOfEventWeights("POI","Pt");
562 if(fCalculateDiffFlowVsEta){this->CalculateDiffFlowSumOfProductOfEventWeights("POI","Eta");}
563 } // end of if(!fEvaluateDiffFlowNestedLoops && fCalculateDiffFlow)
565 // h) Call the methods which calculate correlations for 2D differential flow:
566 if(!fEvaluateDiffFlowNestedLoops && fCalculate2DDiffFlow)
568 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
570 // Without using particle weights:
571 this->Calculate2DDiffFlowCorrelations("RP");
572 this->Calculate2DDiffFlowCorrelations("POI");
573 // Non-isotropic terms:
575 } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
577 // With using particle weights:
579 // Non-isotropic terms:
582 // Whether or not using particle weights the following is calculated in the same way:
584 } // end of if(!fEvaluateDiffFlowNestedLoops && fCalculate2DDiffFlow)
586 // i) Call the methods which calculate other differential correlators:
587 if(!fEvaluateDiffFlowNestedLoops && fCalculateDiffFlow)
589 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
591 // Without using particle weights:
592 this->CalculateOtherDiffCorrelators("RP","Pt");
593 if(fCalculateDiffFlowVsEta){this->CalculateOtherDiffCorrelators("RP","Eta");}
594 this->CalculateOtherDiffCorrelators("POI","Pt");
595 if(fCalculateDiffFlowVsEta){this->CalculateOtherDiffCorrelators("POI","Eta");}
596 } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
598 // With using particle weights:
601 // Whether or not using particle weights the following is calculated in the same way:
603 } // end of if(!fEvaluateDiffFlowNestedLoops)
605 // j) Distributions of correlations:
606 if(fStoreDistributions){this->StoreDistributionsOfCorrelations();}
608 // k) Store phi distribution for one event to illustrate flow:
609 if(fStorePhiDistributionForOneEvent){this->StorePhiDistributionForOneEvent(anEvent);}
611 // l) Cross-check with nested loops correlators for reference flow:
612 if(fEvaluateIntFlowNestedLoops){this->EvaluateIntFlowNestedLoops(anEvent);}
614 // m) Cross-check with nested loops correlators for differential flow:
615 if(fEvaluateDiffFlowNestedLoops){this->EvaluateDiffFlowNestedLoops(anEvent);}
617 // n) Reset all event-by-event quantities (very important !!!!):
618 this->ResetEventByEventQuantities();
620 } // end of AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
622 //================================================================================================================================
624 void AliFlowAnalysisWithQCumulants::Finish()
626 // Calculate the final results.
628 // a) Check all pointers used in this method;
629 // b) Acces the constants;
630 // c) Access the flags;
631 // d) Calculate reference cumulants (not corrected for detector effects);
632 // e) Correct reference cumulants for detector effects;
633 // f) Calculate reference flow;
634 // g) Store results for reference flow in AliFlowCommonHistResults and print them on the screen;
635 // h) Calculate the final results for differential flow (without/with weights);
636 // i) Correct the results for differential flow (without/with weights) for effects of non-uniform acceptance (NUA);
637 // j) Calculate the final results for integrated flow (RP/POI) and store in AliFlowCommonHistResults;
638 // k) Store results for differential flow in AliFlowCommonHistResults;
639 // l) Print the final results for integrated flow (RP/POI) on the screen;
640 // m) Cross-checking: Results from Q-vectors vs results from nested loops.
642 // a) Check all pointers used in this method:
643 this->CheckPointersUsedInFinish();
645 // b) Acces the constants:
646 this->CommonConstants("Finish");
648 if(fCommonHists && fCommonHists->GetHarmonic()) // to be improved (moved somewhere else)
650 fHarmonic = (Int_t)(fCommonHists->GetHarmonic())->GetBinContent(1);
653 // c) Access the flags: // to be improved (implement a method for this? should I store again the flags becose they can get modified with redoFinish?)
654 fUsePhiWeights = (Bool_t)fUseParticleWeights->GetBinContent(1);
655 fUsePtWeights = (Bool_t)fUseParticleWeights->GetBinContent(2);
656 fUseEtaWeights = (Bool_t)fUseParticleWeights->GetBinContent(3);
657 fUseTrackWeights = (Bool_t)fUseParticleWeights->GetBinContent(4);
658 fApplyCorrectionForNUA = (Bool_t)fIntFlowFlags->GetBinContent(3);
659 fPrintFinalResults[0] = (Bool_t)fIntFlowFlags->GetBinContent(4);
660 fPrintFinalResults[1] = (Bool_t)fIntFlowFlags->GetBinContent(5);
661 fPrintFinalResults[2] = (Bool_t)fIntFlowFlags->GetBinContent(6);
662 fPrintFinalResults[3] = (Bool_t)fIntFlowFlags->GetBinContent(7);
663 fApplyCorrectionForNUAVsM = (Bool_t)fIntFlowFlags->GetBinContent(8);
664 fPropagateErrorAlsoFromNIT = (Bool_t)fIntFlowFlags->GetBinContent(9);
665 fCalculateCumulantsVsM = (Bool_t)fIntFlowFlags->GetBinContent(10);
666 fMinimumBiasReferenceFlow = (Bool_t)fIntFlowFlags->GetBinContent(11);
667 fForgetAboutCovariances = (Bool_t)fIntFlowFlags->GetBinContent(12);
668 fStorePhiDistributionForOneEvent = (Bool_t)fIntFlowFlags->GetBinContent(13);
669 fFillMultipleControlHistograms = (Bool_t)fIntFlowFlags->GetBinContent(14);
670 fCalculateAllCorrelationsVsM = (Bool_t)fIntFlowFlags->GetBinContent(15);
671 fEvaluateIntFlowNestedLoops = (Bool_t)fEvaluateNestedLoops->GetBinContent(1);
672 fEvaluateDiffFlowNestedLoops = (Bool_t)fEvaluateNestedLoops->GetBinContent(2);
673 fCrossCheckInPtBinNo = (Int_t)fEvaluateNestedLoops->GetBinContent(3);
674 fCrossCheckInEtaBinNo = (Int_t)fEvaluateNestedLoops->GetBinContent(4);
676 // d) Calculate reference cumulants (not corrected for detector effects):
677 this->FinalizeCorrelationsIntFlow();
678 this->CalculateCovariancesIntFlow();
679 this->CalculateCumulantsIntFlow();
681 // e) Correct reference cumulants for detector effects:
682 this->FinalizeCorrectionTermsForNUAIntFlow();
683 this->CalculateCovariancesNUAIntFlow();
684 this->CalculateQcumulantsCorrectedForNUAIntFlow();
686 // f) Calculate reference flow:
687 this->CalculateReferenceFlow();
689 // g) Store results for reference flow in AliFlowCommonHistResults and print them on the screen:
690 this->FillCommonHistResultsIntFlow();
691 if(fPrintFinalResults[0]){this->PrintFinalResultsForIntegratedFlow("RF");}
692 if(fPrintFinalResults[3] && fCalculateCumulantsVsM){this->PrintFinalResultsForIntegratedFlow("RF, rebinned in M");}
694 // h) Calculate the final results for differential flow (without/with weights):
695 if(fCalculateDiffFlow)
697 this->FinalizeReducedCorrelations("RP","Pt");
698 if(fCalculateDiffFlowVsEta){this->FinalizeReducedCorrelations("RP","Eta");}
699 this->FinalizeReducedCorrelations("POI","Pt");
700 if(fCalculateDiffFlowVsEta){this->FinalizeReducedCorrelations("POI","Eta");}
701 this->CalculateDiffFlowCovariances("RP","Pt");
702 if(fCalculateDiffFlowVsEta){this->CalculateDiffFlowCovariances("RP","Eta");}
703 this->CalculateDiffFlowCovariances("POI","Pt");
704 if(fCalculateDiffFlowVsEta){this->CalculateDiffFlowCovariances("POI","Eta");}
705 this->CalculateDiffFlowCumulants("RP","Pt");
706 if(fCalculateDiffFlowVsEta){this->CalculateDiffFlowCumulants("RP","Eta");}
707 this->CalculateDiffFlowCumulants("POI","Pt");
708 if(fCalculateDiffFlowVsEta){this->CalculateDiffFlowCumulants("POI","Eta");}
709 this->CalculateDiffFlow("RP","Pt");
710 if(fCalculateDiffFlowVsEta){this->CalculateDiffFlow("RP","Eta");}
711 this->CalculateDiffFlow("POI","Pt");
712 if(fCalculateDiffFlowVsEta){this->CalculateDiffFlow("POI","Eta");}
713 } // if(fCalculateDiffFlow)
715 // i) Correct the results for differential flow (without/with weights) for effects of non-uniform acceptance (NUA):
716 if(fCalculateDiffFlow)
718 this->FinalizeCorrectionTermsForNUADiffFlow("RP","Pt");
719 if(fCalculateDiffFlowVsEta){this->FinalizeCorrectionTermsForNUADiffFlow("RP","Eta");}
720 this->FinalizeCorrectionTermsForNUADiffFlow("POI","Pt");
721 if(fCalculateDiffFlowVsEta){this->FinalizeCorrectionTermsForNUADiffFlow("POI","Eta");}
722 this->CalculateDiffFlowCumulantsCorrectedForNUA("RP","Pt");
723 if(fCalculateDiffFlowVsEta){this->CalculateDiffFlowCumulantsCorrectedForNUA("RP","Eta");}
724 this->CalculateDiffFlowCumulantsCorrectedForNUA("POI","Pt");
725 if(fCalculateDiffFlowVsEta){this->CalculateDiffFlowCumulantsCorrectedForNUA("POI","Eta");}
726 if(fApplyCorrectionForNUA)
728 this->CalculateDiffFlowCorrectedForNUA("RP","Pt");
729 if(fCalculateDiffFlowVsEta){this->CalculateDiffFlowCorrectedForNUA("RP","Eta");}
730 this->CalculateDiffFlowCorrectedForNUA("POI","Pt");
731 if(fCalculateDiffFlowVsEta){this->CalculateDiffFlowCorrectedForNUA("POI","Eta");}
733 } // end of if(fCalculateDiffFlow && fApplyCorrectionForNUA)
735 // i) Calcualate final results for 2D differential flow:
736 if(fCalculate2DDiffFlow)
738 this->Calculate2DDiffFlowCumulants("RP");
739 this->Calculate2DDiffFlowCumulants("POI");
740 this->Calculate2DDiffFlow("RP");
741 this->Calculate2DDiffFlow("POI");
742 } // end of if(fCalculate2DDiffFlow)
744 // j) Calculate the final results for integrated flow (RP/POI) and store in AliFlowCommonHistResults:
745 if(fCalculateDiffFlow)
747 this->CalculateFinalResultsForRPandPOIIntegratedFlow("RP");
748 this->CalculateFinalResultsForRPandPOIIntegratedFlow("POI");
751 // k) Store results for differential flow in AliFlowCommonHistResults:
752 if(fCalculateDiffFlow)
754 this->FillCommonHistResultsDiffFlow("RP");
755 this->FillCommonHistResultsDiffFlow("POI");
758 // l) Print the final results for integrated flow (RP/POI) on the screen:
759 if(fPrintFinalResults[1] && fCalculateDiffFlow){this->PrintFinalResultsForIntegratedFlow("RP");}
760 if(fPrintFinalResults[2] && fCalculateDiffFlow){this->PrintFinalResultsForIntegratedFlow("POI");}
762 // m) Cross-checking: Results from Q-vectors vs results from nested loops:
763 // m1) Reference flow:
764 if(fEvaluateIntFlowNestedLoops)
766 this->CrossCheckIntFlowCorrelations();
767 this->CrossCheckIntFlowCorrectionTermsForNUA();
768 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights){this->CrossCheckIntFlowExtraCorrelations();}
769 } // end of if(fEvaluateIntFlowNestedLoops)
770 // m2) Differential flow:
771 if(fEvaluateDiffFlowNestedLoops && fCalculateDiffFlow)
774 this->PrintNumberOfParticlesInSelectedBin();
775 this->CrossCheckDiffFlowCorrelations("RP","Pt");
776 if(fCalculateDiffFlowVsEta){this->CrossCheckDiffFlowCorrelations("RP","Eta");}
777 this->CrossCheckDiffFlowCorrelations("POI","Pt");
778 if(fCalculateDiffFlowVsEta){this->CrossCheckDiffFlowCorrelations("POI","Eta");}
779 // Correction terms for non-uniform acceptance:
780 this->CrossCheckDiffFlowCorrectionTermsForNUA("RP","Pt");
781 if(fCalculateDiffFlowVsEta){this->CrossCheckDiffFlowCorrectionTermsForNUA("RP","Eta");}
782 this->CrossCheckDiffFlowCorrectionTermsForNUA("POI","Pt");
783 if(fCalculateDiffFlowVsEta){this->CrossCheckDiffFlowCorrectionTermsForNUA("POI","Eta");}
784 // Other differential correlators:
785 this->CrossCheckOtherDiffCorrelators("RP","Pt");
786 if(fCalculateDiffFlowVsEta){this->CrossCheckOtherDiffCorrelators("RP","Eta");}
787 this->CrossCheckOtherDiffCorrelators("POI","Pt");
788 if(fCalculateDiffFlowVsEta){this->CrossCheckOtherDiffCorrelators("POI","Eta");}
789 } // end of if(fEvaluateDiffFlowNestedLoops)
791 } // end of AliFlowAnalysisWithQCumulants::Finish()
793 //================================================================================================================================
795 void AliFlowAnalysisWithQCumulants::EvaluateIntFlowNestedLoops(AliFlowEventSimple* anEvent)
797 // Evalauted all correlators for reference flow with nested loops.
799 Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = nRP + nPOI
800 if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10
802 // Without using particle weights:
803 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
806 this->CalculateIntFlowCorrelations(); // from Q-vectors
807 this->EvaluateIntFlowCorrelationsWithNestedLoops(anEvent); // from nested loops (to be improved: do I have to pass here anEvent or not?)
808 // Correction for non-uniform acceptance:
809 this->CalculateIntFlowCorrectionsForNUASinTerms(); // from Q-vectors (sin terms)
810 this->CalculateIntFlowCorrectionsForNUACosTerms(); // from Q-vectors (cos terms)
811 this->EvaluateIntFlowCorrectionsForNUAWithNestedLoops(anEvent); // from nested loops (both sin and cos terms)
813 // Using particle weights:
814 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights)
817 this->CalculateIntFlowCorrelationsUsingParticleWeights(); // from Q-vectors
818 this->EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent); // from nested loops (to be improved: do I have to pass here anEvent or not?)
819 // Correction for non-uniform acceptance:
820 this->CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights(); // from Q-vectors (sin terms)
821 this->CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights(); // from Q-vectors (cos terms)
822 this->EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(anEvent); // from nested loops (both sin and cos terms)
824 } else if(nPrim>fMaxAllowedMultiplicity) // to if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity)
827 cout<<"Skipping the event because multiplicity is "<<nPrim<<". Too high to evaluate nested loops!"<<endl;
831 cout<<"Skipping the event because multiplicity is "<<nPrim<<"."<<endl;
834 } // end of void AliFlowAnalysisWithQCumulants::EvaluateIntFlowNestedLoops(AliFlowEventSimple* anEvent)
836 //================================================================================================================================
838 void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowNestedLoops(AliFlowEventSimple* anEvent)
840 // Evalauted all correlators for differential flow with nested loops.
842 if(!fCalculateDiffFlow){return;}
844 Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = nRP + nPOI
845 if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10
847 // Without using particle weights:
848 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
850 // 1.) Reduced correlations:
852 this->CalculateDiffFlowCorrelations("RP","Pt");
853 this->CalculateDiffFlowCorrelations("RP","Eta");
854 this->CalculateDiffFlowCorrelations("POI","Pt");
855 this->CalculateDiffFlowCorrelations("POI","Eta");
857 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"RP","Pt");
858 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"RP","Eta");
859 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"POI","Pt");
860 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"POI","Eta");
861 // 2.) Reduced corrections for non-uniform acceptance:
863 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Pt");
864 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Eta");
865 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Pt");
866 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Eta");
867 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Pt");
868 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Eta");
869 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Pt");
870 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Eta");
872 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"RP","Pt");
873 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"RP","Eta");
874 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"POI","Pt");
875 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"POI","Eta");
876 // 3.) Other differential correlators:
878 this->CalculateOtherDiffCorrelators("RP","Pt");
879 this->CalculateOtherDiffCorrelators("RP","Eta");
880 this->CalculateOtherDiffCorrelators("POI","Pt");
881 this->CalculateOtherDiffCorrelators("POI","Eta");
883 this->EvaluateOtherDiffCorrelatorsWithNestedLoops(anEvent,"RP","Pt");
884 this->EvaluateOtherDiffCorrelatorsWithNestedLoops(anEvent,"RP","Eta");
885 this->EvaluateOtherDiffCorrelatorsWithNestedLoops(anEvent,"POI","Pt");
886 this->EvaluateOtherDiffCorrelatorsWithNestedLoops(anEvent,"POI","Eta");
887 } // end of if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
888 // Using particle weights:
889 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights)
891 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Pt");
892 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Eta");
893 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Pt");
894 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Eta");
895 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Pt");
896 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Eta");
897 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Pt");
898 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Eta");
899 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Pt");
900 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Eta");
901 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Pt");
902 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Eta");
903 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"RP","Pt");
904 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"RP","Eta");
905 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"POI","Pt");
906 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"POI","Eta");
907 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"RP","Pt");
908 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"RP","Eta");
909 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"POI","Pt");
910 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"POI","Eta");
911 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights)
912 } // end of if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10
914 } // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowNestedLoops(AliFlowEventSimple* anEvent)
916 //================================================================================================================================
918 void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTerms()
920 // Calculate correction terms for non-uniform acceptance of the detector for reference flow (cos terms).
923 Double_t dMult = (*fSpk)(0,0);
925 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
926 Double_t dReQ1n = (*fReQ)(0,0);
927 Double_t dReQ2n = (*fReQ)(1,0);
928 //Double_t dReQ3n = (*fReQ)(2,0);
929 //Double_t dReQ4n = (*fReQ)(3,0);
930 Double_t dImQ1n = (*fImQ)(0,0);
931 Double_t dImQ2n = (*fImQ)(1,0);
932 //Double_t dImQ3n = (*fImQ)(2,0);
933 //Double_t dImQ4n = (*fImQ)(3,0);
935 // *************************************************************
936 // **** corrections for non-uniform acceptance (cos terms): ****
937 // *************************************************************
939 // Remark 1: corrections for non-uniform acceptance (cos terms) calculated with non-weighted Q-vectors
940 // are stored in 1D profile fQCorrectionsCos.
941 // Remark 2: binning of fIntFlowCorrectionTermsForNUAPro[1] is organized as follows:
942 // --------------------------------------------------------------------------------------------------------------------
943 // 1st bin: <<cos(n*(phi1))>> = cosP1n
944 // 2nd bin: <<cos(n*(phi1+phi2))>> = cosP1nP1n
945 // 3rd bin: <<cos(n*(phi1-phi2-phi3))>> = cosP1nM1nM1n
946 // 4th bin: <<cos(n*(2phi1-phi2))>> = cosP2nM1n
947 // --------------------------------------------------------------------------------------------------------------------
950 Double_t cosP1n = 0.; // <<cos(n*(phi1))>>
954 cosP1n = dReQ1n/dMult;
956 // average non-weighted 1-particle correction (cos terms) for non-uniform acceptance for single event:
957 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(1,cosP1n);
958 // event weights for NUA terms:
959 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(1,dMult);
961 // final average non-weighted 1-particle correction (cos terms) for non-uniform acceptance for all events:
962 fIntFlowCorrectionTermsForNUAPro[1]->Fill(0.5,cosP1n,dMult);
963 if(fCalculateCumulantsVsM){fIntFlowCorrectionTermsForNUAVsMPro[1][0]->Fill(dMult+0.5,cosP1n,dMult);}
967 Double_t cosP1nP1n = 0.; // <<cos(n*(phi1+phi2))>>
968 Double_t cosP2nM1n = 0.; // <<cos(n*(2phi1-phi2))>>
972 cosP1nP1n = (pow(dReQ1n,2)-pow(dImQ1n,2)-dReQ2n)/(dMult*(dMult-1));
973 cosP2nM1n = (dReQ2n*dReQ1n+dImQ2n*dImQ1n-dReQ1n)/(dMult*(dMult-1));
975 // average non-weighted 2-particle correction (cos terms) for non-uniform acceptance for single event:
976 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(2,cosP1nP1n);
977 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(4,cosP2nM1n);
978 // event weights for NUA terms:
979 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(2,dMult*(dMult-1));
980 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(4,dMult*(dMult-1));
982 // final average non-weighted 2-particle correction (cos terms) for non-uniform acceptance for all events:
983 fIntFlowCorrectionTermsForNUAPro[1]->Fill(1.5,cosP1nP1n,dMult*(dMult-1));
984 fIntFlowCorrectionTermsForNUAPro[1]->Fill(3.5,cosP2nM1n,dMult*(dMult-1));
985 if(fCalculateCumulantsVsM)
987 fIntFlowCorrectionTermsForNUAVsMPro[1][1]->Fill(dMult+0.5,cosP1nP1n,dMult*(dMult-1));
988 fIntFlowCorrectionTermsForNUAVsMPro[1][3]->Fill(dMult+0.5,cosP2nM1n,dMult*(dMult-1));
993 Double_t cosP1nM1nM1n = 0.; // <<cos(n*(phi1-phi2-phi3))>>
997 cosP1nM1nM1n = (dReQ1n*(pow(dReQ1n,2)+pow(dImQ1n,2))-dReQ1n*dReQ2n-dImQ1n*dImQ2n-2.*(dMult-1)*dReQ1n)
998 / (dMult*(dMult-1)*(dMult-2));
1000 // average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for single event:
1001 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(3,cosP1nM1nM1n);
1002 // event weights for NUA terms:
1003 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(3,dMult*(dMult-1)*(dMult-2));
1005 // final average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for all events:
1006 fIntFlowCorrectionTermsForNUAPro[1]->Fill(2.5,cosP1nM1nM1n,dMult*(dMult-1)*(dMult-2));
1007 if(fCalculateCumulantsVsM){fIntFlowCorrectionTermsForNUAVsMPro[1][2]->Fill(dMult+0.5,cosP1nM1nM1n,dMult*(dMult-1)*(dMult-2));}
1010 } // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTerms()
1013 //================================================================================================================================
1016 void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTerms()
1018 // calculate corrections for non-uniform acceptance of the detector for no-name integrated flow (sin terms)
1021 Double_t dMult = (*fSpk)(0,0);
1023 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
1024 Double_t dReQ1n = (*fReQ)(0,0);
1025 Double_t dReQ2n = (*fReQ)(1,0);
1026 //Double_t dReQ3n = (*fReQ)(2,0);
1027 //Double_t dReQ4n = (*fReQ)(3,0);
1028 Double_t dImQ1n = (*fImQ)(0,0);
1029 Double_t dImQ2n = (*fImQ)(1,0);
1030 //Double_t dImQ3n = (*fImQ)(2,0);
1031 //Double_t dImQ4n = (*fImQ)(3,0);
1033 // *************************************************************
1034 // **** corrections for non-uniform acceptance (sin terms): ****
1035 // *************************************************************
1037 // Remark 1: corrections for non-uniform acceptance (sin terms) calculated with non-weighted Q-vectors
1038 // are stored in 1D profile fQCorrectionsSin.
1039 // Remark 2: binning of fIntFlowCorrectionTermsForNUAPro[0] is organized as follows:
1040 // --------------------------------------------------------------------------------------------------------------------
1041 // 1st bin: <<sin(n*(phi1))>> = sinP1n
1042 // 2nd bin: <<sin(n*(phi1+phi2))>> = sinP1nP1n
1043 // 3rd bin: <<sin(n*(phi1-phi2-phi3))>> = sinP1nM1nM1n
1044 // 4th bin: <<sin(n*(2phi1-phi2))>> = sinP2nM1n
1045 // --------------------------------------------------------------------------------------------------------------------
1048 Double_t sinP1n = 0.; // <sin(n*(phi1))>
1052 sinP1n = dImQ1n/dMult;
1054 // average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for single event:
1055 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(1,sinP1n);
1056 // event weights for NUA terms:
1057 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(1,dMult);
1059 // final average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
1060 fIntFlowCorrectionTermsForNUAPro[0]->Fill(0.5,sinP1n,dMult);
1061 if(fCalculateCumulantsVsM){fIntFlowCorrectionTermsForNUAVsMPro[0][0]->Fill(dMult+0.5,sinP1n,dMult);}
1065 Double_t sinP1nP1n = 0.; // <<sin(n*(phi1+phi2))>>
1066 Double_t sinP2nM1n = 0.; // <<sin(n*(2phi1-phi2))>>
1069 sinP1nP1n = (2.*dReQ1n*dImQ1n-dImQ2n)/(dMult*(dMult-1));
1070 sinP2nM1n = (dImQ2n*dReQ1n-dReQ2n*dImQ1n-dImQ1n)/(dMult*(dMult-1));
1072 // average non-weighted 2-particle correction (sin terms) for non-uniform acceptance for single event:
1073 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(2,sinP1nP1n);
1074 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(4,sinP2nM1n);
1075 // event weights for NUA terms:
1076 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(2,dMult*(dMult-1));
1077 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(4,dMult*(dMult-1));
1079 // final average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
1080 fIntFlowCorrectionTermsForNUAPro[0]->Fill(1.5,sinP1nP1n,dMult*(dMult-1));
1081 fIntFlowCorrectionTermsForNUAPro[0]->Fill(3.5,sinP2nM1n,dMult*(dMult-1));
1082 if(fCalculateCumulantsVsM)
1084 fIntFlowCorrectionTermsForNUAVsMPro[0][1]->Fill(dMult+0.5,sinP1nP1n,dMult*(dMult-1));
1085 fIntFlowCorrectionTermsForNUAVsMPro[0][3]->Fill(dMult+0.5,sinP2nM1n,dMult*(dMult-1));
1090 Double_t sinP1nM1nM1n = 0.; // <<sin(n*(phi1-phi2-phi3))>>
1094 sinP1nM1nM1n = (-dImQ1n*(pow(dReQ1n,2)+pow(dImQ1n,2))+dReQ1n*dImQ2n-dImQ1n*dReQ2n+2.*(dMult-1)*dImQ1n)
1095 / (dMult*(dMult-1)*(dMult-2));
1097 // average non-weighted 3-particle correction (sin terms) for non-uniform acceptance for single event:
1098 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(3,sinP1nM1nM1n);
1099 // event weights for NUA terms:
1100 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(3,dMult*(dMult-1)*(dMult-2));
1102 // final average non-weighted 3-particle correction (sin terms) for non-uniform acceptance for all events:
1103 fIntFlowCorrectionTermsForNUAPro[0]->Fill(2.5,sinP1nM1nM1n,dMult*(dMult-1)*(dMult-2));
1104 if(fCalculateCumulantsVsM){fIntFlowCorrectionTermsForNUAVsMPro[0][2]->Fill(dMult+0.5,sinP1nM1nM1n,dMult*(dMult-1)*(dMult-2));}
1107 } // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTerms()
1109 //================================================================================================================================
1111 void AliFlowAnalysisWithQCumulants::GetOutputHistograms(TList *outputListHistos)
1113 // a) Get pointers for common control and common result histograms;
1114 // b) Get pointers for histograms holding particle weights;
1115 // c) Get pointers for reference flow histograms;
1116 // d) Get pointers for differential flow histograms;
1117 // e) Get pointers for 2D differential flow histograms;
1118 // f) Get pointers for other differential correlators;
1119 // g) Get pointers for nested loops' histograms.
1121 if(outputListHistos)
1123 this->SetHistList(outputListHistos);
1126 printf("\n WARNING (QC): fHistList is NULL in AFAWQC::GOH() !!!!\n\n");
1129 this->GetPointersForCommonHistograms();
1130 this->GetPointersForParticleWeightsHistograms();
1131 this->GetPointersForIntFlowHistograms();
1132 this->GetPointersForDiffFlowHistograms();
1133 this->GetPointersFor2DDiffFlowHistograms();
1134 this->GetPointersForOtherDiffCorrelators();
1135 this->GetPointersForNestedLoopsHistograms();
1138 printf("\n WARNING (QC): outputListHistos is NULL in AFAWQC::GOH() !!!!\n\n");
1142 } // end of void AliFlowAnalysisWithQCumulants::GetOutputHistograms(TList *outputListHistos)
1144 //================================================================================================================================
1146 TProfile* AliFlowAnalysisWithQCumulants::MakePtProjection(TProfile2D *profilePtEta) const
1148 // project 2D profile onto pt axis to get 1D profile
1150 Int_t nBinsPt = profilePtEta->GetNbinsX();
1151 Double_t dPtMin = (profilePtEta->GetXaxis())->GetXmin();
1152 Double_t dPtMax = (profilePtEta->GetXaxis())->GetXmax();
1154 Int_t nBinsEta = profilePtEta->GetNbinsY();
1156 TProfile *profilePt = new TProfile("","",nBinsPt,dPtMin,dPtMax);
1158 for(Int_t p=1;p<=nBinsPt;p++)
1160 Double_t contentPt = 0.;
1161 Double_t entryPt = 0.;
1162 Double_t spreadPt = 0.;
1166 for(Int_t e=1;e<=nBinsEta;e++)
1168 contentPt += (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)))
1169 * (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1170 entryPt += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1172 sum1 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)))
1173 * (pow(profilePtEta->GetBinError(profilePtEta->GetBin(p,e)),2.)
1174 + pow(profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)),2.));
1175 sum2 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1176 sum3 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)))
1177 * (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)));
1179 if(sum2>0. && sum1/sum2-pow(sum3/sum2,2.) > 0.)
1181 spreadPt = pow(sum1/sum2-pow(sum3/sum2,2.),0.5);
1183 profilePt->SetBinContent(p,contentPt);
1184 profilePt->SetBinEntries(p,entryPt);
1186 profilePt->SetBinError(p,spreadPt);
1193 } // end of TProfile* AliFlowAnalysisWithQCumulants::MakePtProjection(TProfile2D *profilePtEta)
1196 //================================================================================================================================
1199 TProfile* AliFlowAnalysisWithQCumulants::MakeEtaProjection(TProfile2D *profilePtEta) const
1201 // project 2D profile onto eta axis to get 1D profile
1203 Int_t nBinsEta = profilePtEta->GetNbinsY();
1204 Double_t dEtaMin = (profilePtEta->GetYaxis())->GetXmin();
1205 Double_t dEtaMax = (profilePtEta->GetYaxis())->GetXmax();
1207 Int_t nBinsPt = profilePtEta->GetNbinsX();
1209 TProfile *profileEta = new TProfile("","",nBinsEta,dEtaMin,dEtaMax);
1211 for(Int_t e=1;e<=nBinsEta;e++)
1213 Double_t contentEta = 0.;
1214 Double_t entryEta = 0.;
1215 for(Int_t p=1;p<=nBinsPt;p++)
1217 contentEta += (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)))
1218 * (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1219 entryEta += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
1221 profileEta->SetBinContent(e,contentEta);
1222 profileEta->SetBinEntries(e,entryEta);
1227 } // end of TProfile* AliFlowAnalysisWithQCumulants::MakeEtaProjection(TProfile2D *profilePtEta)
1229 //================================================================================================================================
1231 void AliFlowAnalysisWithQCumulants::PrintFinalResultsForIntegratedFlow(TString type)
1233 // Printing on the screen the final results for integrated flow (RF, POI and RP).
1235 Int_t n = fHarmonic;
1237 Double_t dVn[4] = {0.}; // array to hold Vn{2}, Vn{4}, Vn{6} and Vn{8}
1238 Double_t dVnErr[4] = {0.}; // array to hold errors of Vn{2}, Vn{4}, Vn{6} and Vn{8}
1242 for(Int_t b=0;b<4;b++)
1244 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinContent(1);
1245 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinError(1);
1246 dVn[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinContent(1);
1247 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinError(1);
1248 dVn[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinContent(1);
1249 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinError(1);
1250 dVn[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinContent(1);
1251 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinError(1);
1253 } else if(type == "RP")
1255 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinContent(1);
1256 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinError(1);
1257 dVn[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinContent(1);
1258 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinError(1);
1259 dVn[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinContent(1);
1260 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinError(1);
1261 dVn[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinContent(1);
1262 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinError(1);
1263 } else if(type == "POI")
1265 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinContent(1);
1266 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinError(1);
1267 dVn[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinContent(1);
1268 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinError(1);
1269 dVn[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinContent(1);
1270 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinError(1);
1271 dVn[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinContent(1);
1272 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinError(1);
1273 } else if(type == "RF, rebinned in M" && fCalculateCumulantsVsM)
1275 for(Int_t b=0;b<4;b++)
1277 dVn[b] = fIntFlowRebinnedInM->GetBinContent(b+1);
1278 dVnErr[b] = fIntFlowRebinnedInM->GetBinError(b+1);
1282 TString title = " flow estimates from Q-cumulants";
1283 TString subtitle = " (";
1284 TString subtitle2 = " (rebinned in M)";
1286 if(type != "RF, rebinned in M")
1288 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
1290 subtitle.Append(type);
1291 subtitle.Append(", without weights)");
1294 subtitle.Append(type);
1295 subtitle.Append(", with weights)");
1299 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
1301 subtitle.Append("RF");
1302 subtitle.Append(", without weights)");
1305 subtitle.Append("RF");
1306 subtitle.Append(", with weights)");
1311 cout<<"*************************************"<<endl;
1312 cout<<"*************************************"<<endl;
1313 cout<<title.Data()<<endl;
1314 cout<<subtitle.Data()<<endl;
1315 if(type == "RF, rebinned in M"){cout<<subtitle2.Data()<<endl;}
1318 for(Int_t i=0;i<4;i++)
1320 cout<<" v_"<<n<<"{"<<2*(i+1)<<"} = "<<dVn[i]<<" +/- "<<dVnErr[i]<<endl;
1326 if(fApplyCorrectionForNUA)
1328 cout<<" detector bias (corrected for): "<<endl;
1331 cout<<" detector bias (not corrected for):"<<endl;
1333 cout<<" to QC{2}: "<<fIntFlowDetectorBias->GetBinContent(1)<<" +/- "<<fIntFlowDetectorBias->GetBinError(1)<<endl;
1334 cout<<" to QC{4}: "<<fIntFlowDetectorBias->GetBinContent(2)<<" +/- "<<fIntFlowDetectorBias->GetBinError(2)<<endl;
1337 if(type == "RF" || type == "RF, rebinned in M")
1339 cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultRP()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultRP()->GetMean()<<endl;
1341 else if (type == "RP")
1343 cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultRP()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultRP()->GetMean()<<endl;
1345 else if (type == "POI")
1347 cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultPOI()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultPOI()->GetMean()<<endl;
1350 cout<<"*************************************"<<endl;
1351 cout<<"*************************************"<<endl;
1354 }// end of AliFlowAnalysisWithQCumulants::PrintFinalResultsForIntegratedFlow(TString type="RF");
1356 //================================================================================================================================
1358 void AliFlowAnalysisWithQCumulants::WriteHistograms(TString outputFileName)
1360 //store the final results in output .root file
1361 TFile *output = new TFile(outputFileName.Data(),"RECREATE");
1362 //output->WriteObject(fHistList, "cobjQC","SingleKey");
1363 fHistList->Write(fHistList->GetName(), TObject::kSingleKey);
1368 //================================================================================================================================
1371 void AliFlowAnalysisWithQCumulants::WriteHistograms(TDirectoryFile *outputFileName)
1373 //store the final results in output .root file
1374 fHistList->SetName("cobjQC");
1375 fHistList->SetOwner(kTRUE);
1376 outputFileName->Add(fHistList);
1377 outputFileName->Write(outputFileName->GetName(), TObject::kSingleKey);
1380 //================================================================================================================================
1382 void AliFlowAnalysisWithQCumulants::BookCommonHistograms()
1384 // Book common control histograms and common histograms for final results.
1385 // a) Book common control histograms;
1386 // b) Book common result histograms.
1388 // a) Book common control histograms:
1389 // Common control histograms (all events):
1390 TString commonHistsName = "AliFlowCommonHistQC";
1391 commonHistsName += fAnalysisLabel->Data();
1392 fCommonHists = new AliFlowCommonHist(commonHistsName.Data(),commonHistsName.Data(),fBookOnlyBasicCCH);
1393 fHistList->Add(fCommonHists);
1394 // Common control histograms (selected events):
1395 if(fFillMultipleControlHistograms)
1397 // Common control histogram filled for events with 2 and more reference particles:
1398 TString commonHists2ndOrderName = "AliFlowCommonHist2ndOrderQC";
1399 commonHists2ndOrderName += fAnalysisLabel->Data();
1400 fCommonHists2nd = new AliFlowCommonHist(commonHists2ndOrderName.Data(),commonHists2ndOrderName.Data(),fBookOnlyBasicCCH);
1401 fHistList->Add(fCommonHists2nd);
1402 // Common control histogram filled for events with 2 and more reference particles:
1403 TString commonHists4thOrderName = "AliFlowCommonHist4thOrderQC";
1404 commonHists4thOrderName += fAnalysisLabel->Data();
1405 fCommonHists4th = new AliFlowCommonHist(commonHists4thOrderName.Data(),commonHists4thOrderName.Data(),fBookOnlyBasicCCH);
1406 fHistList->Add(fCommonHists4th);
1407 // Common control histogram filled for events with 6 and more reference particles:
1408 TString commonHists6thOrderName = "AliFlowCommonHist6thOrderQC";
1409 commonHists6thOrderName += fAnalysisLabel->Data();
1410 fCommonHists6th = new AliFlowCommonHist(commonHists6thOrderName.Data(),commonHists6thOrderName.Data(),fBookOnlyBasicCCH);
1411 fHistList->Add(fCommonHists6th);
1412 // Common control histogram filled for events with 8 and more reference particles:
1413 TString commonHists8thOrderName = "AliFlowCommonHist8thOrderQC";
1414 commonHists8thOrderName += fAnalysisLabel->Data();
1415 fCommonHists8th = new AliFlowCommonHist(commonHists8thOrderName.Data(),commonHists8thOrderName.Data(),fBookOnlyBasicCCH);
1416 fHistList->Add(fCommonHists8th);
1417 } // end of if(fFillMultipleControlHistograms)
1419 // b) Book common result histograms:
1420 // Common result histograms for QC{2}:
1421 TString commonHistResults2ndOrderName = "AliFlowCommonHistResults2ndOrderQC";
1422 commonHistResults2ndOrderName += fAnalysisLabel->Data();
1423 fCommonHistsResults2nd = new AliFlowCommonHistResults(commonHistResults2ndOrderName.Data(),"",fHarmonic);
1424 fHistList->Add(fCommonHistsResults2nd);
1425 // Common result histograms for QC{4}:
1426 TString commonHistResults4thOrderName = "AliFlowCommonHistResults4thOrderQC";
1427 commonHistResults4thOrderName += fAnalysisLabel->Data();
1428 fCommonHistsResults4th = new AliFlowCommonHistResults(commonHistResults4thOrderName.Data(),"",fHarmonic);
1429 fHistList->Add(fCommonHistsResults4th);
1430 // Common result histograms for QC{6}:
1431 TString commonHistResults6thOrderName = "AliFlowCommonHistResults6thOrderQC";
1432 commonHistResults6thOrderName += fAnalysisLabel->Data();
1433 fCommonHistsResults6th = new AliFlowCommonHistResults(commonHistResults6thOrderName.Data(),"",fHarmonic);
1434 fHistList->Add(fCommonHistsResults6th);
1435 // Common result histograms for QC{8}:
1436 TString commonHistResults8thOrderName = "AliFlowCommonHistResults8thOrderQC";
1437 commonHistResults8thOrderName += fAnalysisLabel->Data();
1438 fCommonHistsResults8th = new AliFlowCommonHistResults(commonHistResults8thOrderName.Data(),"",fHarmonic);
1439 fHistList->Add(fCommonHistsResults8th);
1441 } // end of void AliFlowAnalysisWithQCumulants::BookCommonHistograms()
1443 //================================================================================================================================
1445 void AliFlowAnalysisWithQCumulants::BookAndFillWeightsHistograms()
1447 // Book and fill histograms which hold phi, pt and eta weights.
1451 printf("\n WARNING (QC): fWeightsList is NULL in AFAWQC::BAFWH() !!!! \n\n");
1455 TString fUseParticleWeightsName = "fUseParticleWeightsQC";
1456 fUseParticleWeightsName += fAnalysisLabel->Data();
1457 fUseParticleWeights = new TProfile(fUseParticleWeightsName.Data(),"0 = particle weight not used, 1 = particle weight used ",4,0,4);
1458 fUseParticleWeights->SetLabelSize(0.06);
1459 (fUseParticleWeights->GetXaxis())->SetBinLabel(1,"w_{#phi}");
1460 (fUseParticleWeights->GetXaxis())->SetBinLabel(2,"w_{p_{T}}");
1461 (fUseParticleWeights->GetXaxis())->SetBinLabel(3,"w_{#eta}");
1462 (fUseParticleWeights->GetXaxis())->SetBinLabel(4,"w_{track}");
1463 fUseParticleWeights->Fill(0.5,(Int_t)fUsePhiWeights);
1464 fUseParticleWeights->Fill(1.5,(Int_t)fUsePtWeights);
1465 fUseParticleWeights->Fill(2.5,(Int_t)fUseEtaWeights);
1466 fUseParticleWeights->Fill(3.5,(Int_t)fUseTrackWeights);
1467 fWeightsList->Add(fUseParticleWeights);
1471 if(fWeightsList->FindObject("phi_weights"))
1473 fPhiWeights = dynamic_cast<TH1F*>(fWeightsList->FindObject("phi_weights"));
1476 printf("\n WARNING (QC): fPhiWeights is NULL in AFAWQC::BAFWH() !!!!\n\n");
1479 if(TMath::Abs(fPhiWeights->GetBinWidth(1)-fPhiBinWidth)>pow(10.,-6.))
1482 cout<<"WARNING (QC): Inconsistent binning in histograms for phi-weights throughout the code."<<endl;
1488 cout<<"WARNING: fWeightsList->FindObject(\"phi_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
1491 } // end of if(fUsePhiWeights)
1495 if(fWeightsList->FindObject("pt_weights"))
1497 fPtWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("pt_weights"));
1500 printf("\n WARNING (QC): fPtWeights is NULL in AFAWQC::BAFWH() !!!!\n\n");
1503 if(TMath::Abs(fPtWeights->GetBinWidth(1)-fPtBinWidth)>pow(10.,-6.))
1506 cout<<"WARNING (QC): Inconsistent binning in histograms for pt-weights throughout the code."<<endl;
1512 cout<<"WARNING: fWeightsList->FindObject(\"pt_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
1515 } // end of if(fUsePtWeights)
1519 if(fWeightsList->FindObject("eta_weights"))
1521 fEtaWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("eta_weights"));
1524 printf("\n WARNING (QC): fEtaWeights is NULL in AFAWQC::BAFWH() !!!!\n\n");
1527 if(TMath::Abs(fEtaWeights->GetBinWidth(1)-fEtaBinWidth)>pow(10.,-6.))
1530 cout<<"WARNING (QC): Inconsistent binning in histograms for eta-weights throughout the code."<<endl;
1536 cout<<"WARNING: fUseEtaWeights && fWeightsList->FindObject(\"eta_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
1539 } // end of if(fUseEtaWeights)
1541 } // end of AliFlowAnalysisWithQCumulants::BookAndFillWeightsHistograms()
1543 //================================================================================================================================
1545 void AliFlowAnalysisWithQCumulants::BookEverythingForIntegratedFlow()
1547 // Book all objects for integrated flow:
1548 // a) Book profile to hold all flags for integrated flow;
1549 // b) Book event-by-event quantities;
1550 // c) Book profiles; // to be improved (comment)
1551 // d) Book histograms holding the final results.
1553 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)
1554 TString powerFlag[2] = {"linear","quadratic"}; // to be improved (should I promote this to data members?)
1556 // a) Book profile to hold all flags for integrated flow:
1557 TString intFlowFlagsName = "fIntFlowFlags";
1558 intFlowFlagsName += fAnalysisLabel->Data();
1559 fIntFlowFlags = new TProfile(intFlowFlagsName.Data(),"Flags for Integrated Flow",15,0,15);
1560 fIntFlowFlags->SetTickLength(-0.01,"Y");
1561 fIntFlowFlags->SetMarkerStyle(25);
1562 fIntFlowFlags->SetLabelSize(0.04);
1563 fIntFlowFlags->SetLabelOffset(0.02,"Y");
1564 fIntFlowFlags->GetXaxis()->SetBinLabel(1,"Particle Weights");
1565 fIntFlowFlags->GetXaxis()->SetBinLabel(2,"Event Weights");
1566 fIntFlowFlags->GetXaxis()->SetBinLabel(3,"Corrected for NUA?");
1567 fIntFlowFlags->GetXaxis()->SetBinLabel(4,"Print RF results");
1568 fIntFlowFlags->GetXaxis()->SetBinLabel(5,"Print RP results");
1569 fIntFlowFlags->GetXaxis()->SetBinLabel(6,"Print POI results");
1570 fIntFlowFlags->GetXaxis()->SetBinLabel(7,"Print RF (rebinned in M) results");
1571 fIntFlowFlags->GetXaxis()->SetBinLabel(8,"Corrected for NUA vs M?");
1572 fIntFlowFlags->GetXaxis()->SetBinLabel(9,"Propagate errors to v_{n} from correlations?");
1573 fIntFlowFlags->GetXaxis()->SetBinLabel(10,"Calculate cumulants vs M");
1574 fIntFlowFlags->GetXaxis()->SetBinLabel(11,"fMinimumBiasReferenceFlow");
1575 fIntFlowFlags->GetXaxis()->SetBinLabel(12,"fForgetAboutCovariances");
1576 fIntFlowFlags->GetXaxis()->SetBinLabel(13,"fStorePhiDistributionForOneEvent");
1577 fIntFlowFlags->GetXaxis()->SetBinLabel(14,"fFillMultipleControlHistograms");
1578 fIntFlowFlags->GetXaxis()->SetBinLabel(15,"Calculate all correlations vs M");
1579 fIntFlowList->Add(fIntFlowFlags);
1581 // b) Book event-by-event quantities:
1582 // Re[Q_{m*n,k}], Im[Q_{m*n,k}] and S_{p,k}^M:
1583 fReQ = new TMatrixD(6,9);
1584 fImQ = new TMatrixD(6,9);
1585 fSpk = new TMatrixD(8,9);
1586 // average correlations <2>, <4>, <6> and <8> for single event (bining is the same as in fIntFlowCorrelationsPro and fIntFlowCorrelationsHist):
1587 TString intFlowCorrelationsEBEName = "fIntFlowCorrelationsEBE";
1588 intFlowCorrelationsEBEName += fAnalysisLabel->Data();
1589 fIntFlowCorrelationsEBE = new TH1D(intFlowCorrelationsEBEName.Data(),intFlowCorrelationsEBEName.Data(),4,0,4);
1590 // weights for average correlations <2>, <4>, <6> and <8> for single event:
1591 TString intFlowEventWeightsForCorrelationsEBEName = "fIntFlowEventWeightsForCorrelationsEBE";
1592 intFlowEventWeightsForCorrelationsEBEName += fAnalysisLabel->Data();
1593 fIntFlowEventWeightsForCorrelationsEBE = new TH1D(intFlowEventWeightsForCorrelationsEBEName.Data(),intFlowEventWeightsForCorrelationsEBEName.Data(),4,0,4);
1594 // average all correlations for single event (bining is the same as in fIntFlowCorrelationsAllPro and fIntFlowCorrelationsAllHist):
1595 TString intFlowCorrelationsAllEBEName = "fIntFlowCorrelationsAllEBE";
1596 intFlowCorrelationsAllEBEName += fAnalysisLabel->Data();
1597 fIntFlowCorrelationsAllEBE = new TH1D(intFlowCorrelationsAllEBEName.Data(),intFlowCorrelationsAllEBEName.Data(),64,0,64);
1598 // average correction terms for non-uniform acceptance for single event
1599 // (binning is the same as in fIntFlowCorrectionTermsForNUAPro[2] and fIntFlowCorrectionTermsForNUAHist[2]):
1600 TString fIntFlowCorrectionTermsForNUAEBEName = "fIntFlowCorrectionTermsForNUAEBE";
1601 fIntFlowCorrectionTermsForNUAEBEName += fAnalysisLabel->Data();
1602 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1604 fIntFlowCorrectionTermsForNUAEBE[sc] = new TH1D(Form("%s: %s terms",fIntFlowCorrectionTermsForNUAEBEName.Data(),sinCosFlag[sc].Data()),Form("Correction terms for non-uniform acceptance (%s terms)",sinCosFlag[sc].Data()),4,0,4);
1606 // event weights for terms for non-uniform acceptance:
1607 TString fIntFlowEventWeightForCorrectionTermsForNUAEBEName = "fIntFlowEventWeightForCorrectionTermsForNUAEBE";
1608 fIntFlowEventWeightForCorrectionTermsForNUAEBEName += fAnalysisLabel->Data();
1609 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
1611 fIntFlowEventWeightForCorrectionTermsForNUAEBE[sc] = new TH1D(Form("%s: %s terms",fIntFlowEventWeightForCorrectionTermsForNUAEBEName.Data(),sinCosFlag[sc].Data()),Form("Event weights for terms for non-uniform acceptance (%s terms)",sinCosFlag[sc].Data()),4,0,4); // to be improved - 4
1613 // c) Book profiles: // to be improved (comment)
1614 // profile to hold average multiplicities and number of events for events with nRP>=0, nRP>=1, ... , and nRP>=8:
1615 TString avMultiplicityName = "fAvMultiplicity";
1616 avMultiplicityName += fAnalysisLabel->Data();
1617 fAvMultiplicity = new TProfile(avMultiplicityName.Data(),"Average multiplicities of reference particles (RPs)",9,0,9);
1618 fAvMultiplicity->SetTickLength(-0.01,"Y");
1619 fAvMultiplicity->SetMarkerStyle(25);
1620 fAvMultiplicity->SetLabelSize(0.05);
1621 fAvMultiplicity->SetLabelOffset(0.02,"Y");
1622 fAvMultiplicity->SetYTitle("Average multiplicity");
1623 (fAvMultiplicity->GetXaxis())->SetBinLabel(1,"all evts");
1624 (fAvMultiplicity->GetXaxis())->SetBinLabel(2,"n_{RP} #geq 1");
1625 (fAvMultiplicity->GetXaxis())->SetBinLabel(3,"n_{RP} #geq 2");
1626 (fAvMultiplicity->GetXaxis())->SetBinLabel(4,"n_{RP} #geq 3");
1627 (fAvMultiplicity->GetXaxis())->SetBinLabel(5,"n_{RP} #geq 4");
1628 (fAvMultiplicity->GetXaxis())->SetBinLabel(6,"n_{RP} #geq 5");
1629 (fAvMultiplicity->GetXaxis())->SetBinLabel(7,"n_{RP} #geq 6");
1630 (fAvMultiplicity->GetXaxis())->SetBinLabel(8,"n_{RP} #geq 7");
1631 (fAvMultiplicity->GetXaxis())->SetBinLabel(9,"n_{RP} #geq 8");
1632 fIntFlowProfiles->Add(fAvMultiplicity);
1633 // Average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with wrong errors!):
1634 TString correlationFlag[4] = {"#LT#LT2#GT#GT","#LT#LT4#GT#GT","#LT#LT6#GT#GT","#LT#LT8#GT#GT"};
1635 TString intFlowCorrelationsProName = "fIntFlowCorrelationsPro";
1636 intFlowCorrelationsProName += fAnalysisLabel->Data();
1637 fIntFlowCorrelationsPro = new TProfile(intFlowCorrelationsProName.Data(),"Average correlations for all events",4,0,4,"s");
1638 fIntFlowCorrelationsPro->Sumw2();
1639 fIntFlowCorrelationsPro->SetTickLength(-0.01,"Y");
1640 fIntFlowCorrelationsPro->SetMarkerStyle(25);
1641 fIntFlowCorrelationsPro->SetLabelSize(0.06);
1642 fIntFlowCorrelationsPro->SetLabelOffset(0.01,"Y");
1643 for(Int_t b=0;b<4;b++)
1645 (fIntFlowCorrelationsPro->GetXaxis())->SetBinLabel(b+1,correlationFlag[b].Data());
1647 fIntFlowProfiles->Add(fIntFlowCorrelationsPro);
1648 // Average correlations squared <<2>^2>, <<4>^2>, <<6>^2> and <<8>^2> for all events:
1649 TString squaredCorrelationFlag[4] = {"#LT#LT2#GT^{2}#GT","#LT#LT4#GT^{2}#GT","#LT#LT6#GT^{2}#GT","#LT#LT8#GT^{2}#GT"};
1650 TString intFlowSquaredCorrelationsProName = "fIntFlowSquaredCorrelationsPro";
1651 intFlowSquaredCorrelationsProName += fAnalysisLabel->Data();
1652 fIntFlowSquaredCorrelationsPro = new TProfile(intFlowSquaredCorrelationsProName.Data(),"Average squared correlations for all events",4,0,4,"s");
1653 fIntFlowSquaredCorrelationsPro->Sumw2();
1654 fIntFlowSquaredCorrelationsPro->SetTickLength(-0.01,"Y");
1655 fIntFlowSquaredCorrelationsPro->SetMarkerStyle(25);
1656 fIntFlowSquaredCorrelationsPro->SetLabelSize(0.06);
1657 fIntFlowSquaredCorrelationsPro->SetLabelOffset(0.01,"Y");
1658 for(Int_t b=0;b<4;b++)
1660 (fIntFlowSquaredCorrelationsPro->GetXaxis())->SetBinLabel(b+1,squaredCorrelationFlag[b].Data());
1662 fIntFlowProfiles->Add(fIntFlowSquaredCorrelationsPro);
1663 if(fCalculateCumulantsVsM)
1665 for(Int_t ci=0;ci<4;ci++) // correlation index
1667 // average correlations <<2>>, <<4>>, <<6>> and <<8>> versus multiplicity for all events (with wrong errors):
1668 TString intFlowCorrelationsVsMProName = "fIntFlowCorrelationsVsMPro";
1669 intFlowCorrelationsVsMProName += fAnalysisLabel->Data();
1670 fIntFlowCorrelationsVsMPro[ci] = new TProfile(Form("%s, %s",intFlowCorrelationsVsMProName.Data(),correlationFlag[ci].Data()),
1671 Form("%s vs multiplicity",correlationFlag[ci].Data()),
1672 fnBinsMult,fMinMult,fMaxMult,"s");
1673 fIntFlowCorrelationsVsMPro[ci]->Sumw2();
1674 fIntFlowCorrelationsVsMPro[ci]->GetYaxis()->SetTitle(correlationFlag[ci].Data());
1675 fIntFlowCorrelationsVsMPro[ci]->GetXaxis()->SetTitle("M");
1676 fIntFlowProfiles->Add(fIntFlowCorrelationsVsMPro[ci]);
1677 // average squared correlations <<2>^2>, <<4>^2>, <<6>^2> and <<8>^2> versus multiplicity for all events:
1678 TString intFlowSquaredCorrelationsVsMProName = "fIntFlowSquaredCorrelationsVsMPro";
1679 intFlowSquaredCorrelationsVsMProName += fAnalysisLabel->Data();
1680 fIntFlowSquaredCorrelationsVsMPro[ci] = new TProfile(Form("%s, %s",intFlowSquaredCorrelationsVsMProName.Data(),squaredCorrelationFlag[ci].Data()),
1681 Form("%s vs multiplicity",squaredCorrelationFlag[ci].Data()),
1682 fnBinsMult,fMinMult,fMaxMult,"s");
1683 fIntFlowSquaredCorrelationsVsMPro[ci]->Sumw2();
1684 fIntFlowSquaredCorrelationsVsMPro[ci]->GetYaxis()->SetTitle(squaredCorrelationFlag[ci].Data());
1685 fIntFlowSquaredCorrelationsVsMPro[ci]->GetXaxis()->SetTitle("M");
1686 fIntFlowProfiles->Add(fIntFlowSquaredCorrelationsVsMPro[ci]);
1687 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
1688 } // end of if(fCalculateCumulantsVsM)
1689 // averaged all correlations for all events (with wrong errors!):
1690 TString intFlowCorrelationsAllProName = "fIntFlowCorrelationsAllPro";
1691 intFlowCorrelationsAllProName += fAnalysisLabel->Data();
1692 fIntFlowCorrelationsAllPro = new TProfile(intFlowCorrelationsAllProName.Data(),"Average all correlations for all events",64,0,64);
1693 fIntFlowCorrelationsAllPro->Sumw2();
1694 fIntFlowCorrelationsAllPro->SetTickLength(-0.01,"Y");
1695 fIntFlowCorrelationsAllPro->SetMarkerStyle(25);
1696 fIntFlowCorrelationsAllPro->SetLabelSize(0.03);
1697 fIntFlowCorrelationsAllPro->SetLabelOffset(0.01,"Y");
1698 // 2-p correlations:
1699 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(1,"#LT#LT2#GT#GT_{n|n}");
1700 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(2,"#LT#LT2#GT#GT_{2n|2n}");
1701 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(3,"#LT#LT2#GT#GT_{3n|3n}");
1702 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(4,"#LT#LT2#GT#GT_{4n|4n}");
1703 // 3-p correlations:
1704 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(6,"#LT#LT3#GT#GT_{2n|n,n}");
1705 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(7,"#LT#LT3#GT#GT_{3n|2n,n}");
1706 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(8,"#LT#LT3#GT#GT_{4n|2n,2n}");
1707 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(9,"#LT#LT3#GT#GT_{4n|3n,n}");
1708 // 4-p correlations:
1709 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(11,"#LT#LT4#GT#GT_{n,n|n,n}");
1710 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(12,"#LT#LT4#GT#GT_{2n,n|2n,n}");
1711 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(13,"#LT#LT4#GT#GT_{2n,2n|2n,2n}");
1712 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(14,"#LT#LT4#GT#GT_{3n|n,n,n}");
1713 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(15,"#LT#LT4#GT#GT_{3n,n|3n,n}");
1714 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(16,"#LT#LT4#GT#GT_{3n,n|2n,2n}");
1715 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(17,"#LT#LT4#GT#GT_{4n|2n,n,n}");
1716 // 5-p correlations:
1717 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(19,"#LT#LT5#GT#GT_{2n,n|n,n,n}");
1718 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(20,"#LT#LT5#GT#GT_{2n,2n|2n,n,n}");
1719 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(21,"#LT#LT5#GT#GT_{3n,n|2n,n,n}");
1720 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(22,"#LT#LT5#GT#GT_{4n|n,n,n,n}");
1721 // 6-p correlations:
1722 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(24,"#LT#LT6#GT#GT_{n,n,n|n,n,n}");
1723 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(25,"#LT#LT6#GT#GT_{2n,n,n|2n,n,n}");
1724 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(26,"#LT#LT6#GT#GT_{2n,2n|n,n,n,n}");
1725 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(27,"#LT#LT6#GT#GT_{3n,n|n,n,n,n}");
1726 // 7-p correlations:
1727 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(29,"#LT#LT7#GT#GT_{2n,n,n|n,n,n,n}");
1728 // 8-p correlations:
1729 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(31,"#LT#LT8#GT#GT_{n,n,n,n|n,n,n,n}");
1730 // EXTRA correlations for v3{5} study:
1731 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(33,"#LT#LT4#GT#GT_{4n,2n|3n,3n}");
1732 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(34,"#LT#LT5#GT#GT_{3n,3n|2n,2n,2n}");
1733 // EXTRA correlations for Teaney-Yan study:
1734 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(35,"#LT#LT2#GT#GT_{5n|5n}");
1735 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(36,"#LT#LT2#GT#GT_{6n|6n}");
1736 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(37,"#LT#LT3#GT#GT_{5n|3n,2n}");
1737 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(38,"#LT#LT3#GT#GT_{5n|4n,1n}");
1738 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(39,"#LT#LT3#GT#GT_{6n|3n,3n}");
1739 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(40,"#LT#LT3#GT#GT_{6n|4n,2n}");
1740 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(41,"#LT#LT3#GT#GT_{6n|5n,1n}");
1741 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(42,"#LT#LT4#GT#GT_{6n|3n,2n,1n}");
1742 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(43,"#LT#LT4#GT#GT_{3n,2n|3n,2n}");
1743 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(44,"#LT#LT4#GT#GT_{4n,1n|3n,2n}");
1744 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(45,"#LT#LT4#GT#GT_{3n,3n|3n,3n}");
1745 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(46,"#LT#LT4#GT#GT_{4n,2n|3n,3n}");
1746 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(47,"#LT#LT4#GT#GT_{5n,1n|3n,3n}");
1747 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(48,"#LT#LT4#GT#GT_{4n,2n|4n,2n}");
1748 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(49,"#LT#LT4#GT#GT_{5n,1n|4n,2n}");
1749 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(50,"#LT#LT4#GT#GT_{5n|3n,1n,1n}");
1750 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(51,"#LT#LT4#GT#GT_{5n|2n,2n,1n}");
1751 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(52,"#LT#LT4#GT#GT_{5n,1n|5n,1n}");
1752 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(53,"#LT#LT5#GT#GT_{3n,3n|3n,2n,1n}");
1753 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(54,"#LT#LT5#GT#GT_{4n,2n|3n,2n,1n}");
1754 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(55,"#LT#LT5#GT#GT_{3n,2n|3n,1n,1n}");
1755 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(56,"#LT#LT5#GT#GT_{3n,2n|2n,2n,1n}");
1756 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(57,"#LT#LT5#GT#GT_{5n,1n|3n,2n,1n}");
1757 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(58,"#LT#LT6#GT#GT_{3n,2n,1n|3n,2n,1n}");
1758 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(59,"#LT#LT4#GT#GT_{6n|4n,1n,1n}");
1759 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(60,"#LT#LT4#GT#GT_{6n|2n,2n,2n}");
1760 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(61,"#LT#LT5#GT#GT_{6n|2n,2n,1n,1n}");
1761 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(62,"#LT#LT5#GT#GT_{4n,1n,1n|3n,3n}");
1762 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(63,"#LT#LT6#GT#GT_{3n,3n|2n,2n,1n,1n}");
1763 fIntFlowProfiles->Add(fIntFlowCorrelationsAllPro);
1764 // average all correlations versus multiplicity (errors via Sumw2 - to be improved):
1765 if(fCalculateAllCorrelationsVsM)
1767 // 2-p correlations vs M:
1768 fIntFlowCorrelationsAllVsMPro[0] = new TProfile("two1n1n","#LT#LT2#GT#GT_{n|n}",fnBinsMult,fMinMult,fMaxMult);
1769 fIntFlowCorrelationsAllVsMPro[0]->Sumw2();
1770 fIntFlowCorrelationsAllVsMPro[0]->GetXaxis()->SetTitle("M");
1771 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[0]);
1772 fIntFlowCorrelationsAllVsMPro[1] = new TProfile("two2n2n","#LT#LT2#GT#GT_{2n|2n}",fnBinsMult,fMinMult,fMaxMult);
1773 fIntFlowCorrelationsAllVsMPro[1]->Sumw2();
1774 fIntFlowCorrelationsAllVsMPro[1]->GetXaxis()->SetTitle("M");
1775 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[1]);
1776 fIntFlowCorrelationsAllVsMPro[2] = new TProfile("two3n3n","#LT#LT2#GT#GT_{3n|3n}",fnBinsMult,fMinMult,fMaxMult);
1777 fIntFlowCorrelationsAllVsMPro[2]->Sumw2();
1778 fIntFlowCorrelationsAllVsMPro[2]->GetXaxis()->SetTitle("M");
1779 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[2]);
1780 fIntFlowCorrelationsAllVsMPro[3] = new TProfile("two4n4n","#LT#LT2#GT#GT_{4n|4n}",fnBinsMult,fMinMult,fMaxMult);
1781 fIntFlowCorrelationsAllVsMPro[3]->Sumw2();
1782 fIntFlowCorrelationsAllVsMPro[3]->GetXaxis()->SetTitle("M");
1783 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[3]);
1784 // 3-p correlations vs M:
1785 fIntFlowCorrelationsAllVsMPro[5] = new TProfile("three2n1n1n","#LT#LT3#GT#GT_{2n|n,n}",fnBinsMult,fMinMult,fMaxMult);
1786 fIntFlowCorrelationsAllVsMPro[5]->Sumw2();
1787 fIntFlowCorrelationsAllVsMPro[5]->GetXaxis()->SetTitle("M");
1788 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[5]);
1789 fIntFlowCorrelationsAllVsMPro[6] = new TProfile("three3n2n1n","#LT#LT3#GT#GT_{3n|2n,n}",fnBinsMult,fMinMult,fMaxMult);
1790 fIntFlowCorrelationsAllVsMPro[6]->Sumw2();
1791 fIntFlowCorrelationsAllVsMPro[6]->GetXaxis()->SetTitle("M");
1792 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[6]);
1793 fIntFlowCorrelationsAllVsMPro[7] = new TProfile("three4n2n2n","#LT#LT3#GT#GT_{4n|2n,2n}",fnBinsMult,fMinMult,fMaxMult);
1794 fIntFlowCorrelationsAllVsMPro[7]->Sumw2();
1795 fIntFlowCorrelationsAllVsMPro[7]->GetXaxis()->SetTitle("M");
1796 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[7]);
1797 fIntFlowCorrelationsAllVsMPro[8] = new TProfile("three4n3n1n","#LT#LT3#GT#GT_{4n|3n,n}",fnBinsMult,fMinMult,fMaxMult);
1798 fIntFlowCorrelationsAllVsMPro[8]->Sumw2();
1799 fIntFlowCorrelationsAllVsMPro[8]->GetXaxis()->SetTitle("M");
1800 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[8]);
1801 // 4-p correlations vs M:
1802 fIntFlowCorrelationsAllVsMPro[10] = new TProfile("four1n1n1n1n","#LT#LT4#GT#GT_{n,n|n,n}",fnBinsMult,fMinMult,fMaxMult);
1803 fIntFlowCorrelationsAllVsMPro[10]->Sumw2();
1804 fIntFlowCorrelationsAllVsMPro[10]->GetXaxis()->SetTitle("M");
1805 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[10]);
1806 fIntFlowCorrelationsAllVsMPro[11] = new TProfile("four2n1n2n1n","#LT#LT4#GT#GT_{2n,n|2n,n}",fnBinsMult,fMinMult,fMaxMult);
1807 fIntFlowCorrelationsAllVsMPro[11]->Sumw2();
1808 fIntFlowCorrelationsAllVsMPro[11]->GetXaxis()->SetTitle("M");
1809 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[11]);
1810 fIntFlowCorrelationsAllVsMPro[12] = new TProfile("four2n2n2n2n","#LT#LT4#GT#GT_{2n,2n|2n,2n}",fnBinsMult,fMinMult,fMaxMult);
1811 fIntFlowCorrelationsAllVsMPro[12]->Sumw2();
1812 fIntFlowCorrelationsAllVsMPro[12]->GetXaxis()->SetTitle("M");
1813 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[12]);
1814 fIntFlowCorrelationsAllVsMPro[13] = new TProfile("four3n1n1n1n","#LT#LT4#GT#GT_{3n|n,n,n}",fnBinsMult,fMinMult,fMaxMult);
1815 fIntFlowCorrelationsAllVsMPro[13]->Sumw2();
1816 fIntFlowCorrelationsAllVsMPro[13]->GetXaxis()->SetTitle("M");
1817 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[13]);
1818 fIntFlowCorrelationsAllVsMPro[14] = new TProfile("four3n1n3n1n","#LT#LT4#GT#GT_{3n,n|3n,n}",fnBinsMult,fMinMult,fMaxMult);
1819 fIntFlowCorrelationsAllVsMPro[14]->Sumw2();
1820 fIntFlowCorrelationsAllVsMPro[14]->GetXaxis()->SetTitle("M");
1821 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[14]);
1822 fIntFlowCorrelationsAllVsMPro[15] = new TProfile("four3n1n2n2n","#LT#LT4#GT#GT_{3n,n|2n,2n}",fnBinsMult,fMinMult,fMaxMult);
1823 fIntFlowCorrelationsAllVsMPro[15]->Sumw2();
1824 fIntFlowCorrelationsAllVsMPro[15]->GetXaxis()->SetTitle("M");
1825 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[15]);
1826 fIntFlowCorrelationsAllVsMPro[16] = new TProfile("four4n2n1n1n","#LT#LT4#GT#GT_{4n|2n,n,n}",fnBinsMult,fMinMult,fMaxMult);
1827 fIntFlowCorrelationsAllVsMPro[16]->Sumw2();
1828 fIntFlowCorrelationsAllVsMPro[16]->GetXaxis()->SetTitle("M");
1829 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[16]);
1830 // 5-p correlations vs M:
1831 fIntFlowCorrelationsAllVsMPro[18] = new TProfile("five2n1n1n1n1n","#LT#LT5#GT#GT_{2n,n|n,n,n}",fnBinsMult,fMinMult,fMaxMult);
1832 fIntFlowCorrelationsAllVsMPro[18]->Sumw2();
1833 fIntFlowCorrelationsAllVsMPro[18]->GetXaxis()->SetTitle("M");
1834 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[18]);
1835 fIntFlowCorrelationsAllVsMPro[19] = new TProfile("five2n2n2n1n1n","#LT#LT5#GT#GT_{2n,2n|2n,n,n}",fnBinsMult,fMinMult,fMaxMult);
1836 fIntFlowCorrelationsAllVsMPro[19]->Sumw2();
1837 fIntFlowCorrelationsAllVsMPro[19]->GetXaxis()->SetTitle("M");
1838 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[19]);
1839 fIntFlowCorrelationsAllVsMPro[20] = new TProfile("five3n1n2n1n1n","#LT#LT5#GT#GT_{3n,n|2n,n,n}",fnBinsMult,fMinMult,fMaxMult);
1840 fIntFlowCorrelationsAllVsMPro[20]->Sumw2();
1841 fIntFlowCorrelationsAllVsMPro[20]->GetXaxis()->SetTitle("M");
1842 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[20]);
1843 fIntFlowCorrelationsAllVsMPro[21] = new TProfile("five4n1n1n1n1n","#LT#LT5#GT#GT_{4n|n,n,n,n}",fnBinsMult,fMinMult,fMaxMult);
1844 fIntFlowCorrelationsAllVsMPro[21]->Sumw2();
1845 fIntFlowCorrelationsAllVsMPro[21]->GetXaxis()->SetTitle("M");
1846 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[21]);
1847 // 6-p correlations vs M:
1848 fIntFlowCorrelationsAllVsMPro[23] = new TProfile("six1n1n1n1n1n1n","#LT#LT6#GT#GT_{n,n,n|n,n,n}",fnBinsMult,fMinMult,fMaxMult);
1849 fIntFlowCorrelationsAllVsMPro[23]->Sumw2();
1850 fIntFlowCorrelationsAllVsMPro[23]->GetXaxis()->SetTitle("M");
1851 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[23]);
1852 fIntFlowCorrelationsAllVsMPro[24] = new TProfile("six2n1n1n2n1n1n","#LT#LT6#GT#GT_{2n,n,n|2n,n,n}",fnBinsMult,fMinMult,fMaxMult);
1853 fIntFlowCorrelationsAllVsMPro[24]->Sumw2();
1854 fIntFlowCorrelationsAllVsMPro[24]->GetXaxis()->SetTitle("M");
1855 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[24]);
1856 fIntFlowCorrelationsAllVsMPro[25] = new TProfile("six2n2n1n1n1n1n","#LT#LT6#GT#GT_{2n,2n|n,n,n,n}",fnBinsMult,fMinMult,fMaxMult);
1857 fIntFlowCorrelationsAllVsMPro[25]->Sumw2();
1858 fIntFlowCorrelationsAllVsMPro[25]->GetXaxis()->SetTitle("M");
1859 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[25]);
1860 fIntFlowCorrelationsAllVsMPro[26] = new TProfile("six3n1n1n1n1n1n","#LT#LT6#GT#GT_{3n,n|n,n,n,n}",fnBinsMult,fMinMult,fMaxMult);
1861 fIntFlowCorrelationsAllVsMPro[26]->Sumw2();
1862 fIntFlowCorrelationsAllVsMPro[26]->GetXaxis()->SetTitle("M");
1863 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[26]);
1864 // 7-p correlations vs M:
1865 fIntFlowCorrelationsAllVsMPro[28] = new TProfile("seven2n1n1n1n1n1n1n","#LT#LT7#GT#GT_{2n,n,n|n,n,n,n}",fnBinsMult,fMinMult,fMaxMult);
1866 fIntFlowCorrelationsAllVsMPro[28]->Sumw2();
1867 fIntFlowCorrelationsAllVsMPro[28]->GetXaxis()->SetTitle("M");
1868 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[28]);
1869 // 8-p correlations vs M:
1870 fIntFlowCorrelationsAllVsMPro[30] = new TProfile("eight1n1n1n1n1n1n1n1n","#LT#LT8#GT#GT_{n,n,n,n|n,n,n,n}",fnBinsMult,fMinMult,fMaxMult);
1871 fIntFlowCorrelationsAllVsMPro[30]->Sumw2();
1872 fIntFlowCorrelationsAllVsMPro[30]->GetXaxis()->SetTitle("M");
1873 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[30]);
1874 // EXTRA correlations vs M for v3{5} study (to be improved - put them in a right order somewhere):
1875 fIntFlowCorrelationsAllVsMPro[32] = new TProfile("four4n2n3n3n","#LT#LT4#GT#GT_{4n,2n|3n,3n}",fnBinsMult,fMinMult,fMaxMult);
1876 fIntFlowCorrelationsAllVsMPro[32]->Sumw2();
1877 fIntFlowCorrelationsAllVsMPro[32]->GetXaxis()->SetTitle("M");
1878 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[32]);
1879 fIntFlowCorrelationsAllVsMPro[33] = new TProfile("five3n3n2n2n2n","#LT#LT5#GT#GT_{3n,3n|2n,2n,2n}",fnBinsMult,fMinMult,fMaxMult);
1880 fIntFlowCorrelationsAllVsMPro[33]->Sumw2();
1881 fIntFlowCorrelationsAllVsMPro[33]->GetXaxis()->SetTitle("M");
1882 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[33]);
1883 // EXTRA correlations vs M for Teaney-Yan study (to be improved - put them in a right order somewhere):
1884 fIntFlowCorrelationsAllVsMPro[34] = new TProfile("two5n5n","#LT#LT2#GT#GT_{5n|5n}",fnBinsMult,fMinMult,fMaxMult);
1885 fIntFlowCorrelationsAllVsMPro[34]->Sumw2();
1886 fIntFlowCorrelationsAllVsMPro[34]->GetXaxis()->SetTitle("M");
1887 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[34]);
1888 fIntFlowCorrelationsAllVsMPro[35] = new TProfile("two6n6n","#LT#LT2#GT#GT_{6n|6n}",fnBinsMult,fMinMult,fMaxMult);
1889 fIntFlowCorrelationsAllVsMPro[35]->Sumw2();
1890 fIntFlowCorrelationsAllVsMPro[35]->GetXaxis()->SetTitle("M");
1891 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[35]);
1892 fIntFlowCorrelationsAllVsMPro[36] = new TProfile("three5n3n2n","#LT#LT3#GT#GT_{5n|3n,2n}",fnBinsMult,fMinMult,fMaxMult);
1893 fIntFlowCorrelationsAllVsMPro[36]->Sumw2();
1894 fIntFlowCorrelationsAllVsMPro[36]->GetXaxis()->SetTitle("M");
1895 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[36]);
1896 fIntFlowCorrelationsAllVsMPro[37] = new TProfile("three5n4n1n","#LT#LT3#GT#GT_{5n|4n,1n}",fnBinsMult,fMinMult,fMaxMult);
1897 fIntFlowCorrelationsAllVsMPro[37]->Sumw2();
1898 fIntFlowCorrelationsAllVsMPro[37]->GetXaxis()->SetTitle("M");
1899 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[37]);
1900 fIntFlowCorrelationsAllVsMPro[38] = new TProfile("three6n3n3n","#LT#LT3#GT#GT_{6n|3n,3n}",fnBinsMult,fMinMult,fMaxMult);
1901 fIntFlowCorrelationsAllVsMPro[38]->Sumw2();
1902 fIntFlowCorrelationsAllVsMPro[38]->GetXaxis()->SetTitle("M");
1903 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[38]);
1904 fIntFlowCorrelationsAllVsMPro[39] = new TProfile("three6n4n2n","#LT#LT3#GT#GT_{6n|4n,2n}",fnBinsMult,fMinMult,fMaxMult);
1905 fIntFlowCorrelationsAllVsMPro[39]->Sumw2();
1906 fIntFlowCorrelationsAllVsMPro[39]->GetXaxis()->SetTitle("M");
1907 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[39]);
1908 fIntFlowCorrelationsAllVsMPro[40] = new TProfile("three6n5n1n","#LT#LT3#GT#GT_{6n|5n,1n}",fnBinsMult,fMinMult,fMaxMult);
1909 fIntFlowCorrelationsAllVsMPro[40]->Sumw2();
1910 fIntFlowCorrelationsAllVsMPro[40]->GetXaxis()->SetTitle("M");
1911 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[40]);
1912 fIntFlowCorrelationsAllVsMPro[41] = new TProfile("four6n3n2n1n","#LT#LT4#GT#GT_{6n|3n,2n,1n}",fnBinsMult,fMinMult,fMaxMult);
1913 fIntFlowCorrelationsAllVsMPro[41]->Sumw2();
1914 fIntFlowCorrelationsAllVsMPro[41]->GetXaxis()->SetTitle("M");
1915 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[41]);
1916 fIntFlowCorrelationsAllVsMPro[42] = new TProfile("four3n2n3n2n","#LT#LT4#GT#GT_{3n,2n|3n,2n}",fnBinsMult,fMinMult,fMaxMult);
1917 fIntFlowCorrelationsAllVsMPro[42]->Sumw2();
1918 fIntFlowCorrelationsAllVsMPro[42]->GetXaxis()->SetTitle("M");
1919 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[42]);
1920 fIntFlowCorrelationsAllVsMPro[43] = new TProfile("four4n1n3n2n","#LT#LT4#GT#GT_{4n,1n|3n,2n}",fnBinsMult,fMinMult,fMaxMult);
1921 fIntFlowCorrelationsAllVsMPro[43]->Sumw2();
1922 fIntFlowCorrelationsAllVsMPro[43]->GetXaxis()->SetTitle("M");
1923 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[43]);
1924 fIntFlowCorrelationsAllVsMPro[44] = new TProfile("four3n3n3n3n","#LT#LT4#GT#GT_{3n,3n|3n,3n}",fnBinsMult,fMinMult,fMaxMult);
1925 fIntFlowCorrelationsAllVsMPro[44]->Sumw2();
1926 fIntFlowCorrelationsAllVsMPro[44]->GetXaxis()->SetTitle("M");
1927 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[44]);
1928 fIntFlowCorrelationsAllVsMPro[45] = new TProfile("four4n2n3n3n","#LT#LT4#GT#GT_{4n,2n|3n,3n}",fnBinsMult,fMinMult,fMaxMult);
1929 fIntFlowCorrelationsAllVsMPro[45]->Sumw2();
1930 fIntFlowCorrelationsAllVsMPro[45]->GetXaxis()->SetTitle("M");
1931 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[45]);
1932 fIntFlowCorrelationsAllVsMPro[46] = new TProfile("four5n1n3n3n","#LT#LT4#GT#GT_{5n,1n|3n,3n}",fnBinsMult,fMinMult,fMaxMult);
1933 fIntFlowCorrelationsAllVsMPro[46]->Sumw2();
1934 fIntFlowCorrelationsAllVsMPro[46]->GetXaxis()->SetTitle("M");
1935 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[46]);
1936 fIntFlowCorrelationsAllVsMPro[47] = new TProfile("four4n2n4n2n","#LT#LT4#GT#GT_{4n,2n|4n,2n}",fnBinsMult,fMinMult,fMaxMult);
1937 fIntFlowCorrelationsAllVsMPro[47]->Sumw2();
1938 fIntFlowCorrelationsAllVsMPro[47]->GetXaxis()->SetTitle("M");
1939 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[47]);
1940 fIntFlowCorrelationsAllVsMPro[48] = new TProfile("four5n1n4n2n","#LT#LT4#GT#GT_{5n,1n|4n,2n}",fnBinsMult,fMinMult,fMaxMult);
1941 fIntFlowCorrelationsAllVsMPro[48]->Sumw2();
1942 fIntFlowCorrelationsAllVsMPro[48]->GetXaxis()->SetTitle("M");
1943 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[48]);
1944 fIntFlowCorrelationsAllVsMPro[49] = new TProfile("four5n3n1n1n","#LT#LT4#GT#GT_{5n|3n,1n,1n}",fnBinsMult,fMinMult,fMaxMult);
1945 fIntFlowCorrelationsAllVsMPro[49]->Sumw2();
1946 fIntFlowCorrelationsAllVsMPro[49]->GetXaxis()->SetTitle("M");
1947 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[49]);
1948 fIntFlowCorrelationsAllVsMPro[50] = new TProfile("four5n2n2n1n","#LT#LT4#GT#GT_{5n|2n,2n,1n}",fnBinsMult,fMinMult,fMaxMult);
1949 fIntFlowCorrelationsAllVsMPro[50]->Sumw2();
1950 fIntFlowCorrelationsAllVsMPro[50]->GetXaxis()->SetTitle("M");
1951 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[50]);
1952 fIntFlowCorrelationsAllVsMPro[51] = new TProfile("four5n1n5n1n","#LT#LT4#GT#GT_{5n,1n|5n,1n}",fnBinsMult,fMinMult,fMaxMult);
1953 fIntFlowCorrelationsAllVsMPro[51]->Sumw2();
1954 fIntFlowCorrelationsAllVsMPro[51]->GetXaxis()->SetTitle("M");
1955 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[51]);
1956 fIntFlowCorrelationsAllVsMPro[52] = new TProfile("five3n3n3n2n1n","#LT#LT5#GT#GT_{3n,3n|3n,2n,1n}",fnBinsMult,fMinMult,fMaxMult);
1957 fIntFlowCorrelationsAllVsMPro[52]->Sumw2();
1958 fIntFlowCorrelationsAllVsMPro[52]->GetXaxis()->SetTitle("M");
1959 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[52]);
1960 fIntFlowCorrelationsAllVsMPro[53] = new TProfile("five4n2n3n2n1n","#LT#LT5#GT#GT_{4n,2n|3n,2n,1n}",fnBinsMult,fMinMult,fMaxMult);
1961 fIntFlowCorrelationsAllVsMPro[53]->Sumw2();
1962 fIntFlowCorrelationsAllVsMPro[53]->GetXaxis()->SetTitle("M");
1963 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[53]);
1964 fIntFlowCorrelationsAllVsMPro[54] = new TProfile("five3n2n3n1n1n","#LT#LT5#GT#GT_{3n,2n|3n,1n,1n}",fnBinsMult,fMinMult,fMaxMult);
1965 fIntFlowCorrelationsAllVsMPro[54]->Sumw2();
1966 fIntFlowCorrelationsAllVsMPro[54]->GetXaxis()->SetTitle("M");
1967 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[54]);
1968 fIntFlowCorrelationsAllVsMPro[55] = new TProfile("five3n2n2n2n1n","#LT#LT5#GT#GT_{3n,2n|2n,2n,1n}",fnBinsMult,fMinMult,fMaxMult);
1969 fIntFlowCorrelationsAllVsMPro[55]->Sumw2();
1970 fIntFlowCorrelationsAllVsMPro[55]->GetXaxis()->SetTitle("M");
1971 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[55]);
1972 fIntFlowCorrelationsAllVsMPro[56] = new TProfile("five5n1n3n2n1n","#LT#LT5#GT#GT_{5n,1n|3n,2n,1n}",fnBinsMult,fMinMult,fMaxMult);
1973 fIntFlowCorrelationsAllVsMPro[56]->Sumw2();
1974 fIntFlowCorrelationsAllVsMPro[56]->GetXaxis()->SetTitle("M");
1975 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[56]);
1976 fIntFlowCorrelationsAllVsMPro[57] = new TProfile("six3n2n1n3n2n1n","#LT#LT6#GT#GT_{3n,2n,1n|3n,2n,1n}",fnBinsMult,fMinMult,fMaxMult);
1977 fIntFlowCorrelationsAllVsMPro[57]->Sumw2();
1978 fIntFlowCorrelationsAllVsMPro[57]->GetXaxis()->SetTitle("M");
1979 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[57]);
1980 fIntFlowCorrelationsAllVsMPro[58] = new TProfile("four6n4n1n1n","#LT#LT4#GT#GT_{6n|4n,1n,1n}",fnBinsMult,fMinMult,fMaxMult);
1981 fIntFlowCorrelationsAllVsMPro[58]->Sumw2();
1982 fIntFlowCorrelationsAllVsMPro[58]->GetXaxis()->SetTitle("M");
1983 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[58]);
1984 fIntFlowCorrelationsAllVsMPro[59] = new TProfile("four6n2n2n2n","#LT#LT4#GT#GT_{6n|2n,2n,2n}",fnBinsMult,fMinMult,fMaxMult);
1985 fIntFlowCorrelationsAllVsMPro[59]->Sumw2();
1986 fIntFlowCorrelationsAllVsMPro[59]->GetXaxis()->SetTitle("M");
1987 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[59]);
1988 fIntFlowCorrelationsAllVsMPro[60] = new TProfile("five6n2n2n1n1n","#LT#LT5#GT#GT_{6n|2n,2n,1n,1n}",fnBinsMult,fMinMult,fMaxMult);
1989 fIntFlowCorrelationsAllVsMPro[60]->Sumw2();
1990 fIntFlowCorrelationsAllVsMPro[60]->GetXaxis()->SetTitle("M");
1991 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[60]);
1992 fIntFlowCorrelationsAllVsMPro[61] = new TProfile("five4n1n1n3n3n","#LT#LT5#GT#GT_{4n,1n,1n|3n,3n}",fnBinsMult,fMinMult,fMaxMult);
1993 fIntFlowCorrelationsAllVsMPro[61]->Sumw2();
1994 fIntFlowCorrelationsAllVsMPro[61]->GetXaxis()->SetTitle("M");
1995 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[61]);
1996 fIntFlowCorrelationsAllVsMPro[62] = new TProfile("six3n3n2n2n1n1n","#LT#LT6#GT#GT_{3n,3n|2n,2n,1n,1n}",fnBinsMult,fMinMult,fMaxMult);
1997 fIntFlowCorrelationsAllVsMPro[62]->Sumw2();
1998 fIntFlowCorrelationsAllVsMPro[62]->GetXaxis()->SetTitle("M");
1999 fIntFlowAllCorrelationsVsM->Add(fIntFlowCorrelationsAllVsMPro[62]);
2000 } // end of if(fCalculateAllCorrelationsVsM)
2001 // when particle weights are used some extra correlations appear:
2002 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights)
2004 TString intFlowExtraCorrelationsProName = "fIntFlowExtraCorrelationsPro";
2005 intFlowExtraCorrelationsProName += fAnalysisLabel->Data();
2006 fIntFlowExtraCorrelationsPro = new TProfile(intFlowExtraCorrelationsProName.Data(),"Average extra correlations for all events",100,0,100,"s");
2007 fIntFlowExtraCorrelationsPro->SetTickLength(-0.01,"Y");
2008 fIntFlowExtraCorrelationsPro->SetMarkerStyle(25);
2009 fIntFlowExtraCorrelationsPro->SetLabelSize(0.03);
2010 fIntFlowExtraCorrelationsPro->SetLabelOffset(0.01,"Y");
2011 // extra 2-p correlations:
2012 (fIntFlowExtraCorrelationsPro->GetXaxis())->SetBinLabel(1,"<<w1^3 w2 cos(n*(phi1-phi2))>>");
2013 (fIntFlowExtraCorrelationsPro->GetXaxis())->SetBinLabel(2,"<<w1 w2 w3^2 cos(n*(phi1-phi2))>>");
2014 fIntFlowProfiles->Add(fIntFlowExtraCorrelationsPro);
2015 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights)
2016 // average product of correlations <2>, <4>, <6> and <8>:
2017 TString productFlag[6] = {"#LT#LT2#GT#LT4#GT#GT","#LT#LT2#GT#LT6#GT#GT","#LT#LT2#GT#LT8#GT#GT",
2018 "#LT#LT4#GT#LT6#GT#GT","#LT#LT4#GT#LT8#GT#GT","#LT#LT6#GT#LT8#GT#GT"};
2019 TString intFlowProductOfCorrelationsProName = "fIntFlowProductOfCorrelationsPro";
2020 intFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
2021 fIntFlowProductOfCorrelationsPro = new TProfile(intFlowProductOfCorrelationsProName.Data(),"Average products of correlations",6,0,6);
2022 fIntFlowProductOfCorrelationsPro->SetTickLength(-0.01,"Y");
2023 fIntFlowProductOfCorrelationsPro->SetMarkerStyle(25);
2024 fIntFlowProductOfCorrelationsPro->SetLabelSize(0.05);
2025 fIntFlowProductOfCorrelationsPro->SetLabelOffset(0.01,"Y");
2026 for(Int_t b=0;b<6;b++)
2028 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(b+1,productFlag[b].Data());
2030 fIntFlowProfiles->Add(fIntFlowProductOfCorrelationsPro);
2031 // average product of correlations <2>, <4>, <6> and <8> versus multiplicity
2032 // [0=<<2><4>>,1=<<2><6>>,2=<<2><8>>,3=<<4><6>>,4=<<4><8>>,5=<<6><8>>]
2033 if(fCalculateCumulantsVsM)
2035 TString intFlowProductOfCorrelationsVsMProName = "fIntFlowProductOfCorrelationsVsMPro";
2036 intFlowProductOfCorrelationsVsMProName += fAnalysisLabel->Data();
2037 for(Int_t pi=0;pi<6;pi++)
2039 fIntFlowProductOfCorrelationsVsMPro[pi] = new TProfile(Form("%s, %s",intFlowProductOfCorrelationsVsMProName.Data(),productFlag[pi].Data()),
2040 Form("%s versus multiplicity",productFlag[pi].Data()),
2041 fnBinsMult,fMinMult,fMaxMult);
2042 fIntFlowProductOfCorrelationsVsMPro[pi]->GetXaxis()->SetTitle("M");
2043 fIntFlowProfiles->Add(fIntFlowProductOfCorrelationsVsMPro[pi]);
2044 } // end of for(Int_t pi=0;pi<6;pi++)
2045 } // end of if(fCalculateCumulantsVsM)
2046 // average product of correction terms for NUA:
2047 TString intFlowProductOfCorrectionTermsForNUAProName = "fIntFlowProductOfCorrectionTermsForNUAPro";
2048 intFlowProductOfCorrectionTermsForNUAProName += fAnalysisLabel->Data();
2049 fIntFlowProductOfCorrectionTermsForNUAPro = new TProfile(intFlowProductOfCorrectionTermsForNUAProName.Data(),"Average products of correction terms for NUA",27,0,27);
2050 fIntFlowProductOfCorrectionTermsForNUAPro->SetTickLength(-0.01,"Y");
2051 fIntFlowProductOfCorrectionTermsForNUAPro->SetMarkerStyle(25);
2052 fIntFlowProductOfCorrectionTermsForNUAPro->SetLabelSize(0.03);
2053 fIntFlowProductOfCorrectionTermsForNUAPro->SetLabelOffset(0.01,"Y");
2054 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(1,"<<2><cos(#phi)>>");
2055 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(2,"<<2><sin(#phi)>>");
2056 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(3,"<<cos(#phi)><sin(#phi)>>");
2057 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(4,"Cov(<2>,<cos(#phi_{1}+#phi_{2})>)");
2058 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(5,"Cov(<2>,<sin(#phi_{1}+#phi_{2})>)");
2059 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(6,"Cov(<2>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
2060 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(7,"Cov(<2>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
2061 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(8,"Cov(<4>,<cos(#phi)>)");
2062 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(9,"Cov(<4>,<sin(#phi)>)");
2063 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(10,"Cov(<4>,<cos(#phi_{1}+#phi_{2})>)");
2064 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(11,"Cov(<4>,<sin(#phi_{1}+#phi_{2})>)");
2065 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(12,"Cov(<4>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>>)");
2066 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(13,"Cov(<4>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>>)");
2067 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(14,"Cov(<cos(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
2068 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(15,"Cov(<cos(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
2069 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(16,"Cov(<cos(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
2070 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(17,"Cov(<cos(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
2071 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(18,"Cov(<sin(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
2072 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(19,"Cov(<sin(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
2073 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(20,"Cov(<sin(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
2074 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(21,"Cov(<sin(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
2075 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(22,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}+#phi_{2})>)");
2076 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(23,"Cov(<cos(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
2077 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(24,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
2078 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(25,"Cov(<sin(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
2079 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(26,"Cov(<sin(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
2080 (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(27,"Cov(<cos(#phi_{1}-#phi_{2}-#phi_{3}>,<sin(#phi_{1}-#phi_{2}-#phi_{3}>)");
2081 fIntFlowProfiles->Add(fIntFlowProductOfCorrectionTermsForNUAPro);
2082 // average correction terms for non-uniform acceptance (with wrong errors!):
2083 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2085 TString intFlowCorrectionTermsForNUAProName = "fIntFlowCorrectionTermsForNUAPro";
2086 intFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
2087 fIntFlowCorrectionTermsForNUAPro[sc] = new TProfile(Form("%s: %s terms",intFlowCorrectionTermsForNUAProName.Data(),sinCosFlag[sc].Data()),Form("Correction terms for non-uniform acceptance (%s terms)",sinCosFlag[sc].Data()),4,0,4,"s");
2088 fIntFlowCorrectionTermsForNUAPro[sc]->SetTickLength(-0.01,"Y");
2089 fIntFlowCorrectionTermsForNUAPro[sc]->SetMarkerStyle(25);
2090 fIntFlowCorrectionTermsForNUAPro[sc]->SetLabelSize(0.05);
2091 fIntFlowCorrectionTermsForNUAPro[sc]->SetLabelOffset(0.01,"Y");
2092 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(1,Form("#LT#LT%s(n(#phi_{1}))#GT#GT",sinCosFlag[sc].Data()));
2093 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(2,Form("#LT#LT%s(n(#phi_{1}+#phi_{2}))#GT#GT",sinCosFlag[sc].Data()));
2094 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(3,Form("#LT#LT%s(n(#phi_{1}-#phi_{2}-#phi_{3}))#GT#GT",sinCosFlag[sc].Data()));
2095 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(4,Form("#LT#LT%s(n(2#phi_{1}-#phi_{2}))#GT#GT",sinCosFlag[sc].Data()));
2096 fIntFlowProfiles->Add(fIntFlowCorrectionTermsForNUAPro[sc]);
2097 // versus multiplicity:
2098 if(fCalculateCumulantsVsM)
2100 TString correctionTermFlag[4] = {"(n(phi1))","(n(phi1+phi2))","(n(phi1-phi2-phi3))","(n(2phi1-phi2))"}; // to be improved - hardwired 4
2101 for(Int_t ci=0;ci<4;ci++) // correction term index (to be improved - hardwired 4)
2103 TString intFlowCorrectionTermsForNUAVsMProName = "fIntFlowCorrectionTermsForNUAVsMPro";
2104 intFlowCorrectionTermsForNUAVsMProName += fAnalysisLabel->Data();
2105 fIntFlowCorrectionTermsForNUAVsMPro[sc][ci] = new TProfile(Form("%s: #LT#LT%s%s#GT#GT",intFlowCorrectionTermsForNUAVsMProName.Data(),sinCosFlag[sc].Data(),correctionTermFlag[ci].Data()),Form("#LT#LT%s%s#GT#GT vs M",sinCosFlag[sc].Data(),correctionTermFlag[ci].Data()),fnBinsMult,fMinMult,fMaxMult,"s");
2106 fIntFlowProfiles->Add(fIntFlowCorrectionTermsForNUAVsMPro[sc][ci]);
2108 } // end of if(fCalculateCumulantsVsM)
2109 } // end of for(Int_t sc=0;sc<2;sc++)
2111 // d) Book histograms holding the final results:
2112 // average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with correct errors!):
2113 TString intFlowCorrelationsHistName = "fIntFlowCorrelationsHist";
2114 intFlowCorrelationsHistName += fAnalysisLabel->Data();
2115 fIntFlowCorrelationsHist = new TH1D(intFlowCorrelationsHistName.Data(),"Average correlations for all events",4,0,4);
2116 fIntFlowCorrelationsHist->SetTickLength(-0.01,"Y");
2117 fIntFlowCorrelationsHist->SetMarkerStyle(25);
2118 fIntFlowCorrelationsHist->SetLabelSize(0.06);
2119 fIntFlowCorrelationsHist->SetLabelOffset(0.01,"Y");
2120 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(1,"#LT#LT2#GT#GT");
2121 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(2,"#LT#LT4#GT#GT");
2122 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(3,"#LT#LT6#GT#GT");
2123 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(4,"#LT#LT8#GT#GT");
2124 fIntFlowResults->Add(fIntFlowCorrelationsHist);
2125 // average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with correct errors!) vs M:
2126 if(fCalculateCumulantsVsM)
2128 for(Int_t ci=0;ci<4;ci++) // correlation index
2130 TString intFlowCorrelationsVsMHistName = "fIntFlowCorrelationsVsMHist";
2131 intFlowCorrelationsVsMHistName += fAnalysisLabel->Data();
2132 fIntFlowCorrelationsVsMHist[ci] = new TH1D(Form("%s, %s",intFlowCorrelationsVsMHistName.Data(),correlationFlag[ci].Data()),
2133 Form("%s vs multiplicity",correlationFlag[ci].Data()),
2134 fnBinsMult,fMinMult,fMaxMult);
2135 fIntFlowCorrelationsVsMHist[ci]->GetYaxis()->SetTitle(correlationFlag[ci].Data());
2136 fIntFlowCorrelationsVsMHist[ci]->GetXaxis()->SetTitle("M");
2137 fIntFlowResults->Add(fIntFlowCorrelationsVsMHist[ci]);
2138 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
2139 } // end of if(fCalculateCumulantsVsM)
2140 // average all correlations for all events (with correct errors!):
2141 TString intFlowCorrelationsAllHistName = "fIntFlowCorrelationsAllHist";
2142 intFlowCorrelationsAllHistName += fAnalysisLabel->Data();
2143 fIntFlowCorrelationsAllHist = new TH1D(intFlowCorrelationsAllHistName.Data(),"Average correlations for all events",34,0,34);
2144 fIntFlowCorrelationsAllHist->SetTickLength(-0.01,"Y");
2145 fIntFlowCorrelationsAllHist->SetMarkerStyle(25);
2146 fIntFlowCorrelationsAllHist->SetLabelSize(0.03);
2147 fIntFlowCorrelationsAllHist->SetLabelOffset(0.01,"Y");
2148 // 2-p correlations:
2149 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(1,"<<2>>_{n|n}");
2150 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(2,"<<2>>_{2n|2n}");
2151 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(3,"<<2>>_{3n|3n}");
2152 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(4,"<<2>>_{4n|4n}");
2153 // 3-p correlations:
2154 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(6,"<<3>>_{2n|n,n}");
2155 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(7,"<<3>>_{3n|2n,n}");
2156 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(8,"<<3>>_{4n|2n,2n}");
2157 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(9,"<<3>>_{4n|3n,n}");
2158 // 4-p correlations:
2159 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(11,"<<4>>_{n,n|n,n}");
2160 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(12,"<<4>>_{2n,n|2n,n}");
2161 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(13,"<<4>>_{2n,2n|2n,2n}");
2162 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(14,"<<4>>_{3n|n,n,n}");
2163 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(15,"<<4>>_{3n,n|3n,n}");
2164 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(16,"<<4>>_{3n,n|2n,2n}");
2165 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(17,"<<4>>_{4n|2n,n,n}");
2166 // 5-p correlations:
2167 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(19,"<<5>>_{2n|n,n,n,n}");
2168 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(20,"<<5>>_{2n,2n|2n,n,n}");
2169 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(21,"<<5>>_{3n,n|2n,n,n}");
2170 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(22,"<<5>>_{4n|n,n,n,n}");
2171 // 6-p correlations:
2172 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(24,"<<6>>_{n,n,n|n,n,n}");
2173 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(25,"<<6>>_{2n,n,n|2n,n,n}");
2174 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(26,"<<6>>_{2n,2n|n,n,n,n}");
2175 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(27,"<<6>>_{3n,n|n,n,n,n}");
2176 // 7-p correlations:
2177 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(29,"<<7>>_{2n,n,n|n,n,n,n}");
2178 // 8-p correlations:
2179 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(31,"<<8>>_{n,n,n,n|n,n,n,n}");
2180 fIntFlowResults->Add(fIntFlowCorrelationsAllHist);
2181 // average correction terms for non-uniform acceptance (with correct errors!):
2182 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2184 TString intFlowCorrectionTermsForNUAHistName = "fIntFlowCorrectionTermsForNUAHist";
2185 intFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
2186 fIntFlowCorrectionTermsForNUAHist[sc] = new TH1D(Form("%s: %s terms",intFlowCorrectionTermsForNUAHistName.Data(),sinCosFlag[sc].Data()),Form("Correction terms for non-uniform acceptance (%s terms)",sinCosFlag[sc].Data()),4,0,4);
2187 fIntFlowCorrectionTermsForNUAHist[sc]->SetTickLength(-0.01,"Y");
2188 fIntFlowCorrectionTermsForNUAHist[sc]->SetMarkerStyle(25);
2189 fIntFlowCorrectionTermsForNUAHist[sc]->SetLabelSize(0.05);
2190 fIntFlowCorrectionTermsForNUAHist[sc]->SetLabelOffset(0.01,"Y");
2191 (fIntFlowCorrectionTermsForNUAHist[sc]->GetXaxis())->SetBinLabel(1,Form("#LT#LT%s(n(#phi_{1}))#GT#GT",sinCosFlag[sc].Data()));
2192 (fIntFlowCorrectionTermsForNUAHist[sc]->GetXaxis())->SetBinLabel(2,Form("#LT#LT%s(n(#phi_{1}+#phi_{2}))#GT#GT",sinCosFlag[sc].Data()));
2193 (fIntFlowCorrectionTermsForNUAHist[sc]->GetXaxis())->SetBinLabel(3,Form("#LT#LT%s(n(#phi_{1}-#phi_{2}-#phi_{3}))#GT#GT",sinCosFlag[sc].Data()));
2194 (fIntFlowCorrectionTermsForNUAHist[sc]->GetXaxis())->SetBinLabel(4,Form("#LT#LT%s(n(2#phi_{1}-#phi_{2}))#GT#GT",sinCosFlag[sc].Data()));
2195 fIntFlowResults->Add(fIntFlowCorrectionTermsForNUAHist[sc]);
2196 } // end of for(Int_t sc=0;sc<2;sc++)
2197 // covariances (multiplied with weight dependent prefactor):
2198 TString intFlowCovariancesName = "fIntFlowCovariances";
2199 intFlowCovariancesName += fAnalysisLabel->Data();
2200 fIntFlowCovariances = new TH1D(intFlowCovariancesName.Data(),"Covariances (multiplied with weight dependent prefactor)",6,0,6);
2201 fIntFlowCovariances->SetLabelSize(0.04);
2202 fIntFlowCovariances->SetMarkerStyle(25);
2203 (fIntFlowCovariances->GetXaxis())->SetBinLabel(1,"Cov(#LT2#GT,#LT4#GT)");
2204 (fIntFlowCovariances->GetXaxis())->SetBinLabel(2,"Cov(#LT2#GT,#LT6#GT)");
2205 (fIntFlowCovariances->GetXaxis())->SetBinLabel(3,"Cov(#LT2#GT,#LT8#GT)");
2206 (fIntFlowCovariances->GetXaxis())->SetBinLabel(4,"Cov(#LT4#GT,#LT6#GT)");
2207 (fIntFlowCovariances->GetXaxis())->SetBinLabel(5,"Cov(#LT4#GT,#LT8#GT)");
2208 (fIntFlowCovariances->GetXaxis())->SetBinLabel(6,"Cov(#LT6#GT,#LT8#GT)");
2209 fIntFlowResults->Add(fIntFlowCovariances);
2210 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8>:
2211 TString intFlowSumOfEventWeightsName = "fIntFlowSumOfEventWeights";
2212 intFlowSumOfEventWeightsName += fAnalysisLabel->Data();
2213 for(Int_t power=0;power<2;power++)
2215 fIntFlowSumOfEventWeights[power] = new TH1D(Form("%s: %s",intFlowSumOfEventWeightsName.Data(),powerFlag[power].Data()),Form("Sum of %s event weights for correlations",powerFlag[power].Data()),4,0,4);
2216 fIntFlowSumOfEventWeights[power]->SetLabelSize(0.04);
2217 fIntFlowSumOfEventWeights[power]->SetMarkerStyle(25);
2220 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{#LT2#GT}");
2221 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{#LT4#GT}");
2222 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{#LT6#GT}");
2223 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{#LT8#GT}");
2224 } else if (power == 1)
2226 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{#LT2#GT}^{2}");
2227 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{#LT4#GT}^{2}");
2228 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{#LT6#GT}^{2}");
2229 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{#LT8#GT}^{2}");
2231 fIntFlowResults->Add(fIntFlowSumOfEventWeights[power]);
2233 // sum of products of event weights for correlations <2>, <4>, <6> and <8>:
2234 TString intFlowSumOfProductOfEventWeightsName = "fIntFlowSumOfProductOfEventWeights";
2235 intFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
2236 fIntFlowSumOfProductOfEventWeights = new TH1D(intFlowSumOfProductOfEventWeightsName.Data(),"Sum of product of event weights for correlations",6,0,6);
2237 fIntFlowSumOfProductOfEventWeights->SetLabelSize(0.04);
2238 fIntFlowSumOfProductOfEventWeights->SetMarkerStyle(25);
2239 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{#LT2#GT} w_{#LT4#GT}");
2240 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{#LT2#GT} w_{#LT6#GT}");
2241 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{#LT2#GT} w_{#LT8#GT}");
2242 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{#LT4#GT} w_{#LT6#GT}");
2243 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(5,"#sum_{i=1}^{N} w_{#LT4#GT} w_{#LT8#GT}");
2244 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(6,"#sum_{i=1}^{N} w_{#LT6#GT} w_{#LT8#GT}");
2245 fIntFlowResults->Add(fIntFlowSumOfProductOfEventWeights);
2246 // final result for covariances of correlations (multiplied with weight dependent prefactor) versus M
2247 // [0=Cov(2,4),1=Cov(2,6),2=Cov(2,8),3=Cov(4,6),4=Cov(4,8),5=Cov(6,8)]:
2248 if(fCalculateCumulantsVsM)
2250 TString intFlowCovariancesVsMName = "fIntFlowCovariancesVsM";
2251 intFlowCovariancesVsMName += fAnalysisLabel->Data();
2252 TString covarianceFlag[6] = {"Cov(<2>,<4>)","Cov(<2>,<6>)","Cov(<2>,<8>)","Cov(<4>,<6>)","Cov(<4>,<8>)","Cov(<6>,<8>)"};
2253 for(Int_t ci=0;ci<6;ci++)
2255 fIntFlowCovariancesVsM[ci] = new TH1D(Form("%s, %s",intFlowCovariancesVsMName.Data(),covarianceFlag[ci].Data()),
2256 Form("%s vs multiplicity",covarianceFlag[ci].Data()),
2257 fnBinsMult,fMinMult,fMaxMult);
2258 fIntFlowCovariancesVsM[ci]->GetYaxis()->SetTitle(covarianceFlag[ci].Data());
2259 fIntFlowCovariancesVsM[ci]->GetXaxis()->SetTitle("M");
2260 fIntFlowResults->Add(fIntFlowCovariancesVsM[ci]);
2262 } // end of if(fCalculateCumulantsVsM)
2263 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8> versus multiplicity
2264 // [0=sum{w_{<2>}},1=sum{w_{<4>}},2=sum{w_{<6>}},3=sum{w_{<8>}}][0=linear 1,1=quadratic]:
2265 if(fCalculateCumulantsVsM)
2267 TString intFlowSumOfEventWeightsVsMName = "fIntFlowSumOfEventWeightsVsM";
2268 intFlowSumOfEventWeightsVsMName += fAnalysisLabel->Data();
2269 TString sumFlag[2][4] = {{"#sum_{i=1}^{N} w_{<2>}","#sum_{i=1}^{N} w_{<4>}","#sum_{i=1}^{N} w_{<6>}","#sum_{i=1}^{N} w_{<8>}"},
2270 {"#sum_{i=1}^{N} w_{<2>}^{2}","#sum_{i=1}^{N} w_{<4>}^{2}","#sum_{i=1}^{N} w_{<6>}^{2}","#sum_{i=1}^{N} w_{<8>}^{2}"}};
2271 for(Int_t si=0;si<4;si++)
2273 for(Int_t power=0;power<2;power++)
2275 fIntFlowSumOfEventWeightsVsM[si][power] = new TH1D(Form("%s, %s",intFlowSumOfEventWeightsVsMName.Data(),sumFlag[power][si].Data()),
2276 Form("%s vs multiplicity",sumFlag[power][si].Data()),
2277 fnBinsMult,fMinMult,fMaxMult);
2278 fIntFlowSumOfEventWeightsVsM[si][power]->GetYaxis()->SetTitle(sumFlag[power][si].Data());
2279 fIntFlowSumOfEventWeightsVsM[si][power]->GetXaxis()->SetTitle("M");
2280 fIntFlowResults->Add(fIntFlowSumOfEventWeightsVsM[si][power]);
2281 } // end of for(Int_t power=0;power<2;power++)
2282 } // end of for(Int_t si=0;si<4;si++)
2283 } // end of if(fCalculateCumulantsVsM)
2284 // sum of products of event weights for correlations <2>, <4>, <6> and <8> vs M
2285 // [0=sum{w_{<2>}w_{<4>}},1=sum{w_{<2>}w_{<6>}},2=sum{w_{<2>}w_{<8>}},
2286 // 3=sum{w_{<4>}w_{<6>}},4=sum{w_{<4>}w_{<8>}},5=sum{w_{<6>}w_{<8>}}]:
2287 if(fCalculateCumulantsVsM)
2289 TString intFlowSumOfProductOfEventWeightsVsMName = "fIntFlowSumOfProductOfEventWeightsVsM";
2290 intFlowSumOfProductOfEventWeightsVsMName += fAnalysisLabel->Data();
2291 TString sopowFlag[6] = {"#sum_{i=1}^{N} w_{<2>} w_{<4>}","#sum_{i=1}^{N} w_{<2>} w_{<6>}","#sum_{i=1}^{N} w_{<2>} w_{<8>}",
2292 "#sum_{i=1}^{N} w_{<4>} w_{<6>}","#sum_{i=1}^{N} w_{<4>} w_{<8>}","#sum_{i=1}^{N} w_{<6>} w_{<8>}"};
2293 for(Int_t pi=0;pi<6;pi++)
2295 fIntFlowSumOfProductOfEventWeightsVsM[pi] = new TH1D(Form("%s, %s",intFlowSumOfProductOfEventWeightsVsMName.Data(),sopowFlag[pi].Data()),
2296 Form("%s versus multiplicity",sopowFlag[pi].Data()),
2297 fnBinsMult,fMinMult,fMaxMult);
2298 fIntFlowSumOfProductOfEventWeightsVsM[pi]->GetXaxis()->SetTitle("M");
2299 fIntFlowSumOfProductOfEventWeightsVsM[pi]->GetYaxis()->SetTitle(sopowFlag[pi].Data());
2300 fIntFlowResults->Add(fIntFlowSumOfProductOfEventWeightsVsM[pi]);
2301 } // end of for(Int_t pi=0;pi<6;pi++)
2302 } // end of if(fCalculateCumulantsVsM)
2303 // covariances of NUA terms (multiplied with weight dependent prefactor):
2304 TString intFlowCovariancesNUAName = "fIntFlowCovariancesNUA";
2305 intFlowCovariancesNUAName += fAnalysisLabel->Data();
2306 fIntFlowCovariancesNUA = new TH1D(intFlowCovariancesNUAName.Data(),"Covariances for NUA (multiplied with weight dependent prefactor)",27,0,27);
2307 fIntFlowCovariancesNUA->SetLabelSize(0.04);
2308 fIntFlowCovariancesNUA->SetMarkerStyle(25);
2309 fIntFlowCovariancesNUA->GetXaxis()->SetLabelSize(0.02);
2310 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(1,"Cov(<2>,<cos(#phi)>");
2311 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(2,"Cov(<2>,<sin(#phi)>)");
2312 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(3,"Cov(<cos(#phi)>,<sin(#phi)>)");
2313 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(4,"Cov(<2>,<cos(#phi_{1}+#phi_{2})>)");
2314 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(5,"Cov(<2>,<sin(#phi_{1}+#phi_{2})>)");
2315 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(6,"Cov(<2>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
2316 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(7,"Cov(<2>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
2317 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(8,"Cov(<4>,<cos(#phi)>)");
2318 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(9,"Cov(<4>,<sin(#phi)>)");
2319 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(10,"Cov(<4>,<cos(#phi_{1}+#phi_{2})>)");
2320 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(11,"Cov(<4>,<sin(#phi_{1}+#phi_{2})>)");
2321 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(12,"Cov(<4>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>>)");
2322 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(13,"Cov(<4>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>>)");
2323 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(14,"Cov(<cos(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
2324 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(15,"Cov(<cos(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
2325 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(16,"Cov(<cos(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
2326 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(17,"Cov(<cos(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
2327 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(18,"Cov(<sin(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
2328 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(19,"Cov(<sin(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
2329 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(20,"Cov(<sin(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
2330 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(21,"Cov(<sin(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
2331 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(22,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}+#phi_{2})>)");
2332 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(23,"Cov(<cos(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
2333 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(24,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
2334 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(25,"Cov(<sin(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
2335 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(26,"Cov(<sin(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
2336 (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(27,"Cov(<cos(#phi_{1}-#phi_{2}-#phi_{3}>,<sin(#phi_{1}-#phi_{2}-#phi_{3}>)");
2337 fIntFlowResults->Add(fIntFlowCovariancesNUA);
2338 // sum of linear and quadratic event weights for NUA terms:
2339 TString intFlowSumOfEventWeightsNUAName = "fIntFlowSumOfEventWeightsNUA";
2340 intFlowSumOfEventWeightsNUAName += fAnalysisLabel->Data();
2341 for(Int_t sc=0;sc<2;sc++)
2343 for(Int_t power=0;power<2;power++)
2345 fIntFlowSumOfEventWeightsNUA[sc][power] = new TH1D(Form("%s: %s, %s",intFlowSumOfEventWeightsNUAName.Data(),powerFlag[power].Data(),sinCosFlag[sc].Data()),Form("Sum of %s event weights for NUA %s terms",powerFlag[power].Data(),sinCosFlag[sc].Data()),4,0,4); // to be improved - 4
2346 fIntFlowSumOfEventWeightsNUA[sc][power]->SetLabelSize(0.05);
2347 fIntFlowSumOfEventWeightsNUA[sc][power]->SetMarkerStyle(25);
2350 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(1,Form("#sum_{i=1}^{N} w_{<%s(#phi)>}",sinCosFlag[sc].Data()));
2351 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(2,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}+#phi_{2})>}",sinCosFlag[sc].Data()));
2352 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(3,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}-#phi_{2}-#phi_{3})>}",sinCosFlag[sc].Data()));
2353 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(4,Form("#sum_{i=1}^{N} w_{<%s(2#phi_{1}-#phi_{2})>}",sinCosFlag[sc].Data()));
2354 } else if(power == 1)
2356 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(1,Form("#sum_{i=1}^{N} w_{<%s(#phi)>}^{2}",sinCosFlag[sc].Data()));
2357 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(2,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}+#phi_{2})>}^{2}",sinCosFlag[sc].Data()));
2358 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(3,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}-#phi_{2}-#phi_{3})>}^{2}",sinCosFlag[sc].Data()));
2359 (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(4,Form("#sum_{i=1}^{N} w_{<%s(2#phi_{1}-#phi_{2})>}^{2}",sinCosFlag[sc].Data()));
2361 fIntFlowResults->Add(fIntFlowSumOfEventWeightsNUA[sc][power]);
2364 // sum of products of event weights for NUA terms:
2365 TString intFlowSumOfProductOfEventWeightsNUAName = "fIntFlowSumOfProductOfEventWeightsNUA";
2366 intFlowSumOfProductOfEventWeightsNUAName += fAnalysisLabel->Data();
2367 fIntFlowSumOfProductOfEventWeightsNUA = new TH1D(intFlowSumOfProductOfEventWeightsNUAName.Data(),"Sum of product of event weights for NUA terms",27,0,27);
2368 fIntFlowSumOfProductOfEventWeightsNUA->SetLabelSize(0.02);
2369 fIntFlowSumOfProductOfEventWeightsNUA->SetMarkerStyle(25);
2370 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{#LT2#GT} w_{#LTcos(#phi)#GT}");
2371 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{#LT2#GT} w_{#LTsin(#phi)#GT}");
2372 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{#LTcos(#phi)#GT} w_{#LTsin(#phi)#GT}");
2373 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{#LT2#GT} w_{#LTcos(#phi_{1}+#phi_{2})#GT}");
2374 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(5,"#sum_{i=1}^{N} w_{#LT2#GT} w_{#LTsin(#phi_{1}+#phi_{2})#GT}");
2375 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(6,"#sum_{i=1}^{N} w_{#LT2#GT} w_{#LTcos(#phi_{1}-#phi_{2}-#phi_{3})#GT}");
2376 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(7,"#sum_{i=1}^{N} w_{#LT2#GT} w_{#LTsin(#phi_{1}-#phi_{2}-#phi_{3})#GT}");
2377 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(8,"#sum_{i=1}^{N} w_{#LT4#GT} w_{#LTcos(#phi)#GT}");
2378 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(9,"#sum_{i=1}^{N} w_{#LT4#GT} w_{#LTsin(#phi)#GT}");
2379 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(10,"#sum_{i=1}^{N} w_{#LT4#GT} w_{#LTcos(#phi_{1}+#phi_{2})#GT}");
2380 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(11,"#sum_{i=1}^{N} w_{#LT4#GT} w_{#LTsin(#phi_{1}+#phi_{2})#GT}");
2381 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(12,"#sum_{i=1}^{N} w_{#LT4#GT} w_{#LTcos(#phi_{1}-#phi_{2}-#phi_{3})#GT}");
2382 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(13,"#sum_{i=1}^{N} w_{#LT4#GT} w_{#LTsin(#phi_{1}-#phi_{2}-#phi_{3})#GT}");
2383 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(14,"#sum_{i=1}^{N} w_{#LTcos(#phi)#GT} w_{#LTcos(#phi_{1}+#phi_{2})#GT}");
2384 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(15,"#sum_{i=1}^{N} w_{#LTcos(#phi)#GT} w_{#LTsin(#phi_{1}+#phi_{2})#GT}");
2385 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(16,"#sum_{i=1}^{N} w_{#LTcos(#phi)#GT} w_{#LTcos(#phi_{1}-#phi_{2}-#phi_{3})#GT}");
2386 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(17,"#sum_{i=1}^{N} w_{#LTcos(#phi)#GT} w_{#LTsin(#phi_{1}-#phi_{2}-#phi_{3})#GT}");
2387 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(18,"#sum_{i=1}^{N} w_{#LTsin(#phi)#GT} w_{#LTcos(#phi_{1}+#phi_{2})#GT}");
2388 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(19,"#sum_{i=1}^{N} w_{#LTsin(#phi)#GT} w_{#LTsin(#phi_{1}+#phi_{2})#GT}");
2389 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(20,"#sum_{i=1}^{N} w_{#LTsin(#phi)#GT} w_{#LTcos(#phi_{1}-#phi_{2}-#phi_{3})#GT}");
2390 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(21,"#sum_{i=1}^{N} w_{#LTsin(#phi)#GT} w_{#LTsin(#phi_{1}-#phi_{2}-#phi_{3})#GT}");
2391 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(22,"#sum_{i=1}^{N} w_{#LTcos(#phi_{1}+#phi_{2})#GT} w_{#LTsin(#phi_{1}+#phi_{2})#GT}");
2392 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(23,"#sum_{i=1}^{N} w_{#LTcos(#phi_{1}+#phi_{2})#GT} w_{#LTcos(#phi_{1}-#phi_{2}-#phi_{3})#GT}");
2393 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(24,"#sum_{i=1}^{N} w_{#LTcos(#phi_{1}+#phi_{2})#GT} w_{#LTsin(#phi_{1}-#phi_{2}-#phi_{3})#GT}");
2394 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(25,"#sum_{i=1}^{N} w_{#LTsin(#phi_{1}+#phi_{2})#GT} w_{#LTcos(#phi_{1}-#phi_{2}-#phi_{3})#GT}");
2395 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(26,"#sum_{i=1}^{N} w_{#LTsin(#phi_{1}+#phi_{2})#GT} w_{#LTsin(#phi_{1}-#phi_{2}-#phi_{3})#GT}");
2396 (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(27,"#sum_{i=1}^{N} w_{#LTcos(#phi_{1}-#phi_{2}-#phi_{3})#GT} w_{#LTsin(#phi_{1}-#phi_{2}-#phi_{3})#GT}");
2397 fIntFlowResults->Add(fIntFlowSumOfProductOfEventWeightsNUA);
2398 // Final results for reference Q-cumulants:
2399 TString cumulantFlag[4] = {"QC{2}","QC{4}","QC{6}","QC{8}"};
2400 TString intFlowQcumulantsName = "fIntFlowQcumulants";
2401 intFlowQcumulantsName += fAnalysisLabel->Data();
2402 fIntFlowQcumulants = new TH1D(intFlowQcumulantsName.Data(),"Reference Q-cumulants",4,0,4);
2403 if(fPropagateErrorAlsoFromNIT)
2405 fIntFlowQcumulants->SetTitle("Reference Q-cumulants (error from non-isotropic terms also propagated)");
2407 fIntFlowQcumulants->SetLabelSize(0.05);
2408 fIntFlowQcumulants->SetMarkerStyle(25);
2409 for(Int_t b=0;b<4;b++)
2411 (fIntFlowQcumulants->GetXaxis())->SetBinLabel(b+1,cumulantFlag[b].Data());
2413 fIntFlowResults->Add(fIntFlowQcumulants);
2414 // Final results for reference Q-cumulants rebinned in M:
2415 if(fCalculateCumulantsVsM)
2417 TString intFlowQcumulantsRebinnedInMName = "fIntFlowQcumulantsRebinnedInM";
2418 intFlowQcumulantsRebinnedInMName += fAnalysisLabel->Data();
2419 fIntFlowQcumulantsRebinnedInM = new TH1D(intFlowQcumulantsRebinnedInMName.Data(),"Reference Q-cumulants rebinned in M",4,0,4);
2420 fIntFlowQcumulantsRebinnedInM->SetLabelSize(0.05);
2421 fIntFlowQcumulantsRebinnedInM->SetMarkerStyle(25);
2422 for(Int_t b=0;b<4;b++)
2424 (fIntFlowQcumulantsRebinnedInM->GetXaxis())->SetBinLabel(b+1,cumulantFlag[b].Data());
2426 fIntFlowResults->Add(fIntFlowQcumulantsRebinnedInM);
2427 } // end of if(fCalculateCumulantsVsM)
2428 // Ratio between error squared: with/without non-isotropic terms:
2429 TString intFlowQcumulantsErrorSquaredRatioName = "fIntFlowQcumulantsErrorSquaredRatio";
2430 intFlowQcumulantsErrorSquaredRatioName += fAnalysisLabel->Data();
2431 fIntFlowQcumulantsErrorSquaredRatio = new TH1D(intFlowQcumulantsErrorSquaredRatioName.Data(),"Error squared of reference Q-cumulants: #frac{with NUA terms}{without NUA terms}",4,0,4);
2432 fIntFlowQcumulantsErrorSquaredRatio->SetLabelSize(0.05);
2433 fIntFlowQcumulantsErrorSquaredRatio->SetMarkerStyle(25);
2434 for(Int_t b=0;b<4;b++)
2436 (fIntFlowQcumulantsErrorSquaredRatio->GetXaxis())->SetBinLabel(b+1,cumulantFlag[b].Data());
2438 fIntFlowResults->Add(fIntFlowQcumulantsErrorSquaredRatio);
2439 // final results for integrated Q-cumulants versus multiplicity:
2440 if(fCalculateCumulantsVsM)
2442 TString intFlowQcumulantsVsMName = "fIntFlowQcumulantsVsM";
2443 intFlowQcumulantsVsMName += fAnalysisLabel->Data();
2444 for(Int_t co=0;co<4;co++) // cumulant order
2446 fIntFlowQcumulantsVsM[co] = new TH1D(Form("%s, %s",intFlowQcumulantsVsMName.Data(),cumulantFlag[co].Data()),
2447 Form("%s vs multipicity",cumulantFlag[co].Data()),
2448 fnBinsMult,fMinMult,fMaxMult);
2449 fIntFlowQcumulantsVsM[co]->GetXaxis()->SetTitle("M");
2450 fIntFlowQcumulantsVsM[co]->GetYaxis()->SetTitle(cumulantFlag[co].Data());
2451 fIntFlowResults->Add(fIntFlowQcumulantsVsM[co]);
2452 } // end of for(Int_t co=0;co<4;co++) // cumulant order
2453 } // end of if(fCalculateCumulantsVsM)
2454 // final integrated flow estimates from Q-cumulants:
2455 TString flowFlag[4] = {Form("v_{%d}{2,QC}",fHarmonic),Form("v_{%d}{4,QC}",fHarmonic),Form("v_{%d}{6,QC}",fHarmonic),Form("v_{%d}{8,QC}",fHarmonic)};
2456 TString intFlowName = "fIntFlow";
2457 intFlowName += fAnalysisLabel->Data();
2458 // integrated flow from Q-cumulants:
2459 fIntFlow = new TH1D(intFlowName.Data(),"Reference flow estimates from Q-cumulants",4,0,4);
2460 fIntFlow->SetLabelSize(0.05);
2461 fIntFlow->SetMarkerStyle(25);
2462 for(Int_t b=0;b<4;b++)
2464 (fIntFlow->GetXaxis())->SetBinLabel(b+1,flowFlag[b].Data());
2466 fIntFlowResults->Add(fIntFlow);
2467 // Reference flow vs M rebinned in one huge bin:
2468 if(fCalculateCumulantsVsM)
2470 TString intFlowRebinnedInMName = "fIntFlowRebinnedInM";
2471 intFlowRebinnedInMName += fAnalysisLabel->Data();
2472 fIntFlowRebinnedInM = new TH1D(intFlowRebinnedInMName.Data(),"Reference flow estimates from Q-cumulants (rebinned in M)",4,0,4);
2473 fIntFlowRebinnedInM->SetLabelSize(0.05);
2474 fIntFlowRebinnedInM->SetMarkerStyle(25);
2475 for(Int_t b=0;b<4;b++)
2477 (fIntFlowRebinnedInM->GetXaxis())->SetBinLabel(b+1,flowFlag[b].Data());
2479 fIntFlowResults->Add(fIntFlowRebinnedInM);
2481 // integrated flow from Q-cumulants: versus multiplicity:
2482 if(fCalculateCumulantsVsM)
2484 TString intFlowVsMName = "fIntFlowVsM";
2485 intFlowVsMName += fAnalysisLabel->Data();
2486 for(Int_t co=0;co<4;co++) // cumulant order
2488 fIntFlowVsM[co] = new TH1D(Form("%s, %s",intFlowVsMName.Data(),flowFlag[co].Data()),
2489 Form("%s vs multipicity",flowFlag[co].Data()),
2490 fnBinsMult,fMinMult,fMaxMult);
2491 fIntFlowVsM[co]->GetXaxis()->SetTitle("M");
2492 fIntFlowVsM[co]->GetYaxis()->SetTitle(flowFlag[co].Data());
2493 fIntFlowResults->Add(fIntFlowVsM[co]);
2494 } // end of for(Int_t co=0;co<4;co++) // cumulant order
2495 } // end of if(fCalculateCumulantsVsM)
2496 // quantifying detector effects effects to correlations:
2497 TString intFlowDetectorBiasName = "fIntFlowDetectorBias";
2498 intFlowDetectorBiasName += fAnalysisLabel->Data();
2499 fIntFlowDetectorBias = new TH1D(intFlowDetectorBiasName.Data(),"Quantifying detector bias",4,0,4);
2500 fIntFlowDetectorBias->SetLabelSize(0.05);
2501 fIntFlowDetectorBias->SetMarkerStyle(25);
2502 for(Int_t ci=0;ci<4;ci++)
2504 (fIntFlowDetectorBias->GetXaxis())->SetBinLabel(ci+1,Form("#frac{corrected}{measured} %s",cumulantFlag[ci].Data()));
2506 fIntFlowResults->Add(fIntFlowDetectorBias);
2507 // quantifying detector effects to correlations versus multiplicity:
2508 if(fCalculateCumulantsVsM)
2510 TString intFlowDetectorBiasVsMName = "fIntFlowDetectorBiasVsM";
2511 intFlowDetectorBiasVsMName += fAnalysisLabel->Data();
2512 for(Int_t ci=0;ci<4;ci++) // correlation index
2514 fIntFlowDetectorBiasVsM[ci] = new TH1D(Form("%s for %s",intFlowDetectorBiasVsMName.Data(),cumulantFlag[ci].Data()),
2515 Form("Quantifying detector bias for %s vs multipicity",cumulantFlag[ci].Data()),
2516 fnBinsMult,fMinMult,fMaxMult);
2517 fIntFlowDetectorBiasVsM[ci]->GetXaxis()->SetTitle("M");
2518 fIntFlowDetectorBiasVsM[ci]->GetYaxis()->SetTitle("#frac{corrected}{measured}");
2519 fIntFlowResults->Add(fIntFlowDetectorBiasVsM[ci]);
2520 } // end of for(Int_t co=0;co<4;co++) // cumulant order
2521 } // end of if(fCalculateCumulantsVsM)
2523 } // end of AliFlowAnalysisWithQCumulants::BookEverythingForIntegratedFlow()
2525 //================================================================================================================================
2527 void AliFlowAnalysisWithQCumulants::InitializeArraysForNestedLoops()
2529 // Initialize arrays of all objects relevant for calculations with nested loops.
2532 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2534 fIntFlowDirectCorrectionTermsForNUA[sc] = NULL;
2537 // differential flow:
2539 for(Int_t t=0;t<2;t++) // type: RP or POI
2541 for(Int_t pe=0;pe<2;pe++) // pt or eta
2543 for(Int_t ci=0;ci<4;ci++) // correlation index
2545 fDiffFlowDirectCorrelations[t][pe][ci] = NULL;
2546 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
2547 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
2548 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
2549 // correction terms for non-uniform acceptance:
2550 for(Int_t t=0;t<2;t++) // type: RP or POI
2552 for(Int_t pe=0;pe<2;pe++) // pt or eta
2554 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2556 for(Int_t cti=0;cti<9;cti++) // correction term index
2558 fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti] = NULL;
2561 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
2562 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
2564 // other differential correlators:
2565 for(Int_t t=0;t<2;t++) // type: RP or POI
2567 for(Int_t pe=0;pe<2;pe++) // pt or eta
2569 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2571 for(Int_t ci=0;ci<1;ci++) // correlator index
2573 fOtherDirectDiffCorrelators[t][pe][sc][ci] = NULL;
2576 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
2577 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
2579 } // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForNestedLoops()
2581 //================================================================================================================================
2583 void AliFlowAnalysisWithQCumulants::BookEverythingForNestedLoops()
2585 // Book all objects relevant for calculations with nested loops.
2587 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)
2588 TString typeFlag[2] = {"RP","POI"}; // to be improved (should I promote this to data members?)
2589 TString ptEtaFlag[2] = {"p_{T}","#eta"}; // to be improved (should I promote this to data members?)
2590 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"}; // to be improved (should I promote this to data members?)
2591 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
2592 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
2594 TString evaluateNestedLoopsName = "fEvaluateNestedLoops";
2595 evaluateNestedLoopsName += fAnalysisLabel->Data();
2596 fEvaluateNestedLoops = new TProfile(evaluateNestedLoopsName.Data(),"Flags for nested loops",4,0,4);
2597 fEvaluateNestedLoops->SetLabelSize(0.03);
2598 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(1,"fEvaluateIntFlowNestedLoops");
2599 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(2,"fEvaluateDiffFlowNestedLoops");
2600 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(3,"fCrossCheckInPtBinNo");
2601 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(4,"fCrossCheckInEtaBinNo");
2602 fEvaluateNestedLoops->Fill(0.5,(Int_t)fEvaluateIntFlowNestedLoops);
2603 fEvaluateNestedLoops->Fill(1.5,(Int_t)fEvaluateDiffFlowNestedLoops);
2604 fEvaluateNestedLoops->Fill(2.5,fCrossCheckInPtBinNo);
2605 fEvaluateNestedLoops->Fill(3.5,fCrossCheckInEtaBinNo);
2606 fNestedLoopsList->Add(fEvaluateNestedLoops);
2607 // nested loops for integrated flow:
2608 if(fEvaluateIntFlowNestedLoops)
2611 TString intFlowDirectCorrelationsName = "fIntFlowDirectCorrelations";
2612 intFlowDirectCorrelationsName += fAnalysisLabel->Data();
2613 fIntFlowDirectCorrelations = new TProfile(intFlowDirectCorrelationsName.Data(),"Multiparticle correlations calculated with nested loops (for int. flow)",64,0,64,"s");
2614 fNestedLoopsList->Add(fIntFlowDirectCorrelations);
2615 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights)
2617 TString intFlowExtraDirectCorrelationsName = "fIntFlowExtraDirectCorrelations";
2618 intFlowExtraDirectCorrelationsName += fAnalysisLabel->Data();
2619 fIntFlowExtraDirectCorrelations = new TProfile(intFlowExtraDirectCorrelationsName.Data(),"Extra multiparticle correlations calculated with nested loops (for int. flow)",100,0,100,"s");
2620 fNestedLoopsList->Add(fIntFlowExtraDirectCorrelations);
2621 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights)
2622 // correction terms for non-uniform acceptance:
2623 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2625 TString intFlowDirectCorrectionTermsForNUAName = "fIntFlowDirectCorrectionTermsForNUA";
2626 intFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
2627 fIntFlowDirectCorrectionTermsForNUA[sc] = new TProfile(Form("%s: %s terms",intFlowDirectCorrectionTermsForNUAName.Data(),sinCosFlag[sc].Data()),Form("Correction terms for non-uniform acceptance (%s terms)",sinCosFlag[sc].Data()),10,0,10,"s");
2628 fNestedLoopsList->Add(fIntFlowDirectCorrectionTermsForNUA[sc]);
2629 } // end of for(Int_t sc=0;sc<2;sc++)
2630 } // end of if(fEvaluateIntFlowNestedLoops)
2632 // nested loops for differential flow:
2633 if(fEvaluateDiffFlowNestedLoops)
2635 // reduced correlations:
2636 TString diffFlowDirectCorrelationsName = "fDiffFlowDirectCorrelations";
2637 diffFlowDirectCorrelationsName += fAnalysisLabel->Data();
2638 for(Int_t t=0;t<2;t++) // type: RP or POI
2640 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
2642 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
2644 // reduced correlations:
2645 fDiffFlowDirectCorrelations[t][pe][rci] = new TProfile(Form("%s, %s, %s, %s",diffFlowDirectCorrelationsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[rci].Data()),Form("%s, %s, %s, %s",diffFlowDirectCorrelationsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[rci].Data()),1,lowerPtEtaEdge[pe],upperPtEtaEdge[pe],"s");
2646 fDiffFlowDirectCorrelations[t][pe][rci]->SetXTitle(ptEtaFlag[pe].Data());
2647 fNestedLoopsList->Add(fDiffFlowDirectCorrelations[t][pe][rci]); // to be improved (add dedicated list to hold reduced correlations)
2648 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
2649 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
2650 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
2653 // correction terms for non-uniform acceptance:
2654 TString diffFlowDirectCorrectionTermsForNUAName = "fDiffFlowDirectCorrectionTermsForNUA";
2655 diffFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
2656 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
2658 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
2660 for(Int_t sc=0;sc<2;sc++) // sin or cos
2662 for(Int_t cti=0;cti<9;cti++) // correction term index
2664 fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti] = new TProfile(Form("%s, %s, %s, %s, cti = %d",diffFlowDirectCorrectionTermsForNUAName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),cti+1),Form("%s, %s, %s, %s, cti = %d",diffFlowDirectCorrectionTermsForNUAName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),cti+1),1,lowerPtEtaEdge[pe],upperPtEtaEdge[pe],"s");
2665 fNestedLoopsList->Add(fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti]);
2670 // other differential correlators:
2671 TString otherDirectDiffCorrelatorsName = "fOtherDirectDiffCorrelators";
2672 otherDirectDiffCorrelatorsName += fAnalysisLabel->Data();
2673 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
2675 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
2677 for(Int_t sc=0;sc<2;sc++) // sin or cos
2679 for(Int_t ci=0;ci<1;ci++) // correlator index
2681 fOtherDirectDiffCorrelators[t][pe][sc][ci] = new TProfile(Form("%s, %s, %s, %s, ci = %d",otherDirectDiffCorrelatorsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),ci+1),Form("%s, %s, %s, %s, ci = %d",otherDirectDiffCorrelatorsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),ci+1),1,lowerPtEtaEdge[pe],upperPtEtaEdge[pe]);
2682 fNestedLoopsList->Add(fOtherDirectDiffCorrelators[t][pe][sc][ci]);
2687 // number of RPs and POIs in selected pt and eta bins for cross-checkings:
2688 TString noOfParticlesInBinName = "fNoOfParticlesInBin";
2689 fNoOfParticlesInBin = new TH1D(noOfParticlesInBinName.Data(),"Number of RPs and POIs in selected p_{T} and #eta bin",4,0,4);
2690 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(1,"# of RPs in p_{T} bin");
2691 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(2,"# of RPs in #eta bin");
2692 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(3,"# of POIs in p_{T} bin");
2693 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(4,"# of POIs in #eta bin");
2694 fNestedLoopsList->Add(fNoOfParticlesInBin);
2695 } // end of if(fEvaluateDiffFlowNestedLoops)
2697 } // end of AliFlowAnalysisWithQCumulants::BookEverythingForNestedLoops()
2699 //================================================================================================================================
2701 void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelations()
2703 // Calculate in this method all multiparticle azimuthal correlations.
2705 // Remark 1: All multiparticle correlations are stored in TProfile fIntFlowCorrelationsAllPro;
2706 // Remark 2: There is a special TProfile fIntFlowCorrelationsPro holding results
2707 // only for same harmonic's correlations <<2>>, <<4>>, <<6>> and <<8>>;
2708 // Remark 3: Binning of fIntFlowCorrelationsAllPro is organized as follows:
2709 // --------------------------------------------------------------------------------------------------------------------
2710 // 1st bin: <2>_{1n|1n} = two1n1n = cos(1n(phi1-phi2))>
2711 // 2nd bin: <2>_{2n|2n} = two2n2n = cos(2n(phi1-phi2))>
2712 // 3rd bin: <2>_{3n|3n} = two3n3n = cos(3n(phi1-phi2))>
2713 // 4th bin: <2>_{4n|4n} = two4n4n = cos(4n(phi1-phi2))>
2714 // 5th bin: ---- EMPTY ----
2715 // 6th bin: <3>_{2n|1n,1n} = three2n1n1n = <cos(n(2*phi1-phi2-phi3))>
2716 // 7th bin: <3>_{3n|2n,1n} = three3n2n1n = <cos(n(3*phi1-2*phi2-phi3))>
2717 // 8th bin: <3>_{4n|2n,2n} = three4n2n2n = <cos(n(4*phi1-2*phi2-2*phi3))>
2718 // 9th bin: <3>_{4n|3n,1n} = three4n3n1n = <cos(n(4*phi1-3*phi2-phi3))>
2719 // 10th bin: ---- EMPTY ----
2720 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1n = <cos(n(phi1+phi2-phi3-phi4))>
2721 // 12th bin: <4>_{2n,1n|2n,1n} = four2n1n2n1n = <cos(n(2*phi1+phi2-2*phi3-phi4))>
2722 // 13th bin: <4>_{2n,2n|2n,2n} = four2n2n2n2n = <cos(2n(phi1+phi2-phi3-phi4))>
2723 // 14th bin: <4>_{3n|1n,1n,1n} = four3n1n1n1n = <cos(n(3*phi1-phi2-phi3-phi4))>
2724 // 15th bin: <4>_{3n,1n|3n,1n} = four3n1n3n1n = <cos(n(3*phi1+phi2-3*phi3-phi4))>
2725 // 16th bin: <4>_{3n,1n|2n,2n} = four3n1n2n2n = <cos(n(3*phi1+phi2-2*phi3-2*phi4))>
2726 // 17th bin: <4>_{4n|2n,1n,1n} = four4n2n1n1n = <cos(n(4*phi1-2*phi2-phi3-phi4))>
2727 // 18th bin: ---- EMPTY ----
2728 // 19th bin: <5>_{2n,1n|1n,1n,1n} = five2n1n1n1n1n = <cos(n(2*phi1+phi2-phi3-phi4-phi5))>
2729 // 20th bin: <5>_{2n,2n|2n,1n,1n} = five2n2n2n1n1n = <cos(n(2*phi1+2*phi2-2*phi3-phi4-phi5))>
2730 // 21st bin: <5>_{3n,1n|2n,1n,1n} = five3n1n2n1n1n = <cos(n(3*phi1+phi2-2*phi3-phi4-phi5))>
2731 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = five4n1n1n1n1n = <cos(n(4*phi1-phi2-phi3-phi4-phi5))>
2732 // 23rd bin: ---- EMPTY ----
2733 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = six1n1n1n1n1n1n = <cos(n(phi1+phi2+phi3-phi4-phi5-phi6))>
2734 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = six2n1n1n2n1n1n = <cos(n(2*phi1+phi2+phi3-2*phi4-phi5-phi6))>
2735 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = six2n2n1n1n1n1n = <cos(n(2*phi1+2*phi2-phi3-phi4-phi5-phi6))>
2736 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = six3n1n1n1n1n1n = <cos(n(3*phi1+phi2-phi3-phi4-phi5-phi6))>
2737 // 28th bin: ---- EMPTY ----
2738 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = seven2n1n1n1n1n1n1n = <cos(n(2*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
2739 // 30th bin: ---- EMPTY ----
2740 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = eight1n1n1n1n1n1n1n1n = <cos(n(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
2741 // 32nd bin: ---- EMPTY ----
2742 // Extra correlations for v3{5} study:
2743 // 33rd bin: <4>_{4n,2n|3n,3n} = four4n2n3n3n = <cos(n(4*phi1+2*phi2-3*phi3-3*phi4))>
2744 // 34th bin: <5>_{3n,3n|2n,2n,2n} = five3n3n2n2n2n = <cos(n(3*phi1+3*phi2-2*phi3-2*phi4-2*phi5))>
2745 // Extra correlations for Teaney-Yan study:
2746 // 35th bin: <2>_{5n|5n} = two5n5n = <cos(5n(phi1-phi2)>
2747 // 36th bin: <2>_{6n|6n} = two6n6n = <cos(6n(phi1-phi2)>
2748 // 37th bin: <3>_{5n|3n,2n} = three5n3n2n = <cos(n(5*phi1-3*phi2-2*phi3)>
2749 // 38th bin: <3>_{5n|4n,1n} = three5n4n1n = <cos(n(5*phi1-4*phi2-1*phi3)>
2750 // 39th bin: <3>_{6n|3n,3n} = three6n3n3n = <cos(n(6*phi1-3*phi2-3*phi3)>
2751 // 40th bin: <3>_{6n|4n,2n} = three6n4n2n = <cos(n(6*phi1-4*phi2-2*phi3)>
2752 // 41st bin: <3>_{6n|5n,1n} = three6n5n1n = <cos(n(6*phi1-5*phi2-1*phi3)>
2753 // 42nd bin: <4>_{6n|3n,2n,1n} = four6n3n2n1n = <cos(n(6*phi1-3*phi2-2*phi3-1*phi4)>
2754 // 43rd bin: <4>_{3n,2n|3n,2n} = four3n2n3n2n = <cos(n(3*phi1+2*phi2-3*phi3-2*phi4)>
2755 // 44th bin: <4>_{4n,1n|3n,2n} = four4n1n3n2n = <cos(n(4*phi1+1*phi2-3*phi3-2*phi4)>
2756 // 45th bin: <4>_{3n,3n|3n,3n} = four3n3n3n3n = <cos(3n*(phi1+phi2-phi3-phi4))>
2757 // 46th bin: <4>_{4n,2n|3n,3n} = four4n2n3n3n = <cos(n(4*phi1+2*phi2-3*phi3-3*phi4)>
2758 // 47th bin: <4>_{5n,1n|3n,3n} = four5n1n3n3n = <cos(n(5*phi1+1*phi2-3*phi3-3*phi4)>
2759 // 48th bin: <4>_{4n,2n|4n,2n} = four4n2n4n2n = <cos(n(4*phi1+2*phi2-4*phi3-2*phi4)>
2760 // 49th bin: <4>_{5n,1n|4n,2n} = four5n1n4n2n = <cos(n(5*phi1+1*phi2-4*phi3-2*phi4)>
2761 // 50th bin: <4>_{5n|3n,1n,1n} = four5n3n1n1n = <cos(n(5*phi1-3*phi2-1*phi3-1*phi4)>
2762 // 51st bin: <4>_{5n|2n,2n,1n} = four5n2n2n1n = <cos(n(5*phi1-2*phi2-2*phi3-1*phi4)>
2763 // 52nd bin: <4>_{5n,1n|5n,1n} = four5n1n5n1n = <cos(n(5*phi1+1*phi2-5*phi3-1*phi4)>
2764 // 53rd bin: <5>_{3n,3n|3n,2n,1n} = five3n3n3n2n1n = <cos(n(3*phi1+3*phi2-3*phi3-2*phi4-1*phi5)>
2765 // 54th bin: <5>_{4n,2n|3n,2n,1n} = five4n2n3n2n1n = <cos(n(4*phi1+2*phi2-3*phi3-2*phi4-1*phi5)>
2766 // 55th bin: <5>_{3n,2n|3n,1n,1n} = five3n2n3n1n1n = <cos(n(3*phi1+2*phi2-3*phi3-1*phi4-1*phi5)>
2767 // 56th bin: <5>_{3n,2n|2n,2n,1n} = five3n2n2n2n1n = <cos(n(3*phi1+2*phi2-2*phi3-2*phi4-1*phi5)>
2768 // 57th bin: <5>_{5n,1n|3n,2n,1n} = five5n1n3n2n1n = <cos(n(5*phi1+1*phi2-3*phi3-2*phi4-1*phi5)>
2769 // 58th bin: <6>_{3n,2n,1n|3n,2n,1n} = six3n2n1n3n2n1n = <cos(n(3*phi1+2*phi2+1*phi3-3*phi4-2*phi5-1*phi6)>
2770 // Extra correlations for Teaney-Yan study (B):
2771 // 59th bin: <4>_{6n|4n,1n,1n} = four6n4n1n1n = <cos(n(6*phi1-4*phi2-1*phi3-1*phi4)>
2772 // 60th bin: <4>_{6n|2n,2n,2n} = four6n2n2n2n = <cos(n(6*phi1-2*phi2-2*phi3-2*phi4)>
2773 // 61st bin: <5>_{6n|2n,2n,1n,1n} = five6n2n2n1n1n = <cos(n(6*phi1-2*phi2-2*phi3-1*phi4-1*phi5)>
2774 // 62nd bin: <5>_{4n,1n,1n|3n,3n} = five4n1n1n3n3n = <cos(n(4*phi1+1*phi2+1*phi3-3*phi4-3*phi5)>
2775 // 63rd bin: <6>_{3n,3n|2n,2n,1n,1n} = six3n3n2n2n1n1n = <cos(n(3*phi1+3*phi2-2*phi3-2*phi4-1*phi5-1*phi6)>
2776 // --------------------------------------------------------------------------------------------------------------------
2778 // Multiplicity of an event:
2779 Double_t dMult = (*fSpk)(0,0);
2780 // Real parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n, 4n, 5n and 6n:
2781 Double_t dReQ1n = (*fReQ)(0,0);
2782 Double_t dReQ2n = (*fReQ)(1,0);
2783 Double_t dReQ3n = (*fReQ)(2,0);
2784 Double_t dReQ4n = (*fReQ)(3,0);
2785 Double_t dReQ5n = (*fReQ)(4,0);
2786 Double_t dReQ6n = (*fReQ)(5,0);
2787 // Imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n, 4n, 5n and 6n:
2788 Double_t dImQ1n = (*fImQ)(0,0);
2789 Double_t dImQ2n = (*fImQ)(1,0);
2790 Double_t dImQ3n = (*fImQ)(2,0);
2791 Double_t dImQ4n = (*fImQ)(3,0);
2792 Double_t dImQ5n = (*fImQ)(4,0);
2793 Double_t dImQ6n = (*fImQ)(5,0);
2795 // Real parts of expressions involving various combinations of Q-vectors which appears
2796 // simultaneously in several equations for multiparticle correlations bellow:
2797 // Re[Q_{2n}Q_{n}^*Q_{n}^*]
2798 Double_t reQ2nQ1nstarQ1nstar = pow(dReQ1n,2.)*dReQ2n+2.*dReQ1n*dImQ1n*dImQ2n-pow(dImQ1n,2.)*dReQ2n;
2799 // Re[Q_{6n}Q_{3n}^*Q_{3n}^*]
2800 Double_t reQ6nQ3nstarQ3nstar = pow(dReQ3n,2.)*dReQ6n+2.*dReQ3n*dImQ3n*dImQ6n-pow(dImQ3n,2.)*dReQ6n;
2801 // Re[Q_{4n}Q_{2n}^*Q_{2n}^*]
2802 Double_t reQ4nQ2nstarQ2nstar = pow(dReQ2n,2.)*dReQ4n+2.*dReQ2n*dImQ2n*dImQ4n-pow(dImQ2n,2.)*dReQ4n;
2803 // Re[Q_{4n}Q_{3n}^*Q_{n}^*]
2804 Double_t reQ4nQ3nstarQ1nstar = dReQ4n*(dReQ3n*dReQ1n-dImQ3n*dImQ1n)+dImQ4n*(dReQ3n*dImQ1n+dImQ3n*dReQ1n);
2805 // Re[Q_{3n}Q_{2n}^*Q_{n}^*]
2806 Double_t reQ3nQ2nstarQ1nstar = dReQ3n*dReQ2n*dReQ1n-dReQ3n*dImQ2n*dImQ1n+dImQ3n*dReQ2n*dImQ1n
2807 + dImQ3n*dImQ2n*dReQ1n;
2808 // Re[Q_{5n}Q_{3n}^*Q_{2n}^*]
2809 Double_t reQ5nQ3nstarQ2nstar = dReQ5n*dReQ2n*dReQ3n-dReQ5n*dImQ2n*dImQ3n+dImQ5n*dReQ2n*dImQ3n
2810 + dImQ5n*dImQ2n*dReQ3n;
2811 // Re[Q_{5n}Q_{4n}^*Q_{1n}^*]
2812 Double_t reQ5nQ4nstarQ1nstar = dReQ5n*dReQ4n*dReQ1n-dReQ5n*dImQ4n*dImQ1n+dImQ5n*dReQ4n*dImQ1n
2813 + dImQ5n*dImQ4n*dReQ1n;
2814 // Re[Q_{6n}Q_{5n}^*Q_{1n}^*]
2815 Double_t reQ6nQ5nstarQ1nstar = dReQ6n*dReQ5n*dReQ1n-dReQ6n*dImQ5n*dImQ1n+dImQ6n*dReQ5n*dImQ1n
2816 + dImQ6n*dImQ5n*dReQ1n;
2817 // Re[Q_{6n}Q_{4n}^*Q_{2n}^*]
2818 Double_t reQ6nQ4nstarQ2nstar = dReQ6n*dReQ4n*dReQ2n-dReQ6n*dImQ4n*dImQ2n+dImQ6n*dReQ4n*dImQ2n
2819 + dImQ6n*dImQ4n*dReQ2n;
2820 // Re[Q_{3n}Q_{n}Q_{2n}^*Q_{2n}^*]
2821 Double_t reQ3nQ1nQ2nstarQ2nstar = (pow(dReQ2n,2.)-pow(dImQ2n,2.))*(dReQ3n*dReQ1n-dImQ3n*dImQ1n)
2822 + 2.*dReQ2n*dImQ2n*(dReQ3n*dImQ1n+dImQ3n*dReQ1n);
2823 // Re[Q_{3n}Q_{n}^*Q_{n}^*Q_{n}^*]
2824 Double_t reQ3nQ1nstarQ1nstarQ1nstar = dReQ3n*pow(dReQ1n,3)-3.*dReQ1n*dReQ3n*pow(dImQ1n,2)
2825 + 3.*dImQ1n*dImQ3n*pow(dReQ1n,2)-dImQ3n*pow(dImQ1n,3);
2826 // Re[Q_{6n}Q_{2n}^*Q_{2n}^*Q_{2n}^*]
2827 Double_t reQ6nQ2nstarQ2nstarQ2nstar = dReQ6n*pow(dReQ2n,3)-3.*dReQ2n*dReQ6n*pow(dImQ2n,2)
2828 + 3.*dImQ2n*dImQ6n*pow(dReQ2n,2)-dImQ6n*pow(dImQ2n,3);
2829 // Re[Q_{4n}Q_{2n}^*Q_{n}^*Q_{n}^*]
2830 Double_t reQ4nQ2nstarQ1nstarQ1nstar = (dReQ4n*dReQ2n+dImQ4n*dImQ2n)*(pow(dReQ1n,2)-pow(dImQ1n,2))
2831 + 2.*dReQ1n*dImQ1n*(dImQ4n*dReQ2n-dReQ4n*dImQ2n);
2832 // Re[Q_{4n}Q_{2n}^*Q_{3n}^*Q_{3n}^*]
2833 Double_t reQ4nQ2nQ3nstarQ3nstar = (dReQ4n*dReQ2n-dImQ4n*dImQ2n)*(dReQ3n*dReQ3n-dImQ3n*dImQ3n)
2834 + 2.*(dReQ4n*dImQ2n+dImQ4n*dReQ2n)*dReQ3n*dImQ3n;
2835 // Re[Q_{4n}Q_{n}Q_{3n}^*Q_{2n}^*]
2836 Double_t reQ4nQ1nQ3nstarQ2nstar = dImQ1n*dImQ2n*dImQ3n*dImQ4n+dImQ3n*dImQ4n*dReQ1n*dReQ2n
2837 + dImQ2n*dImQ4n*dReQ1n*dReQ3n-dImQ1n*dImQ4n*dReQ2n*dReQ3n
2838 - dImQ2n*dImQ3n*dReQ1n*dReQ4n+dImQ1n*dImQ3n*dReQ2n*dReQ4n
2839 + dImQ1n*dImQ2n*dReQ3n*dReQ4n+dReQ1n*dReQ2n*dReQ3n*dReQ4n;
2840 // Re[Q_{5n}Q_{n}Q_{4n}^*Q_{2n}^*]
2841 Double_t reQ5nQ1nQ4nstarQ2nstar = dImQ1n*dImQ2n*dImQ4n*dImQ5n+dImQ4n*dImQ5n*dReQ1n*dReQ2n
2842 + dImQ2n*dImQ5n*dReQ1n*dReQ4n-dImQ1n*dImQ5n*dReQ2n*dReQ4n
2843 - dImQ2n*dImQ4n*dReQ1n*dReQ5n+dImQ1n*dImQ4n*dReQ2n*dReQ5n
2844 + dImQ1n*dImQ2n*dReQ4n*dReQ5n+dReQ1n*dReQ2n*dReQ4n*dReQ5n;
2845 // Re[Q_{5n}Q_{n}Q_{3n}^*Q_{3n}^*]
2846 Double_t reQ5nQ1nQ3nstarQ3nstar = dImQ1n*pow(dImQ3n,2.)*dImQ5n+2.*dImQ3n*dImQ5n*dReQ1n*dReQ3n
2847 - dImQ1n*dImQ5n*pow(dReQ3n,2.)-pow(dImQ3n,2.)*dReQ1n*dReQ5n
2848 + 2.*dImQ1n*dImQ3n*dReQ3n*dReQ5n+dReQ1n*pow(dReQ3n,2.)*dReQ5n;
2849 // Re[Q_{5n}Q_{3n}^*Q_{n}^*Q_{n}^*]
2850 Double_t reQ5nQ3nstarQ1nstarQ1nstar = -pow(dImQ1n,2.)*dImQ3n*dImQ5n+dImQ3n*dImQ5n*pow(dReQ1n,2.)
2851 + 2.*dImQ1n*dImQ5n*dReQ1n*dReQ3n-2.*dImQ1n*dImQ3n*dReQ1n*dReQ5n
2852 - pow(dImQ1n,2.)*dReQ3n*dReQ5n+pow(dReQ1n,2.)*dReQ3n*dReQ5n;
2853 // Re[Q_{5n}Q_{2n}^*Q_{2n}^*Q_{n}^*]
2854 Double_t reQ5nQ2nstarQ2nstarQ1nstar = -pow(dImQ2n,2.)*dImQ1n*dImQ5n+dImQ1n*dImQ5n*pow(dReQ2n,2.)
2855 + 2.*dImQ2n*dImQ5n*dReQ2n*dReQ1n-2.*dImQ2n*dImQ1n*dReQ2n*dReQ5n
2856 - pow(dImQ2n,2.)*dReQ1n*dReQ5n+pow(dReQ2n,2.)*dReQ1n*dReQ5n;
2857 // Re[Q_{6n}Q_{4n}^*Q_{n}^*Q_{n}^*]
2858 Double_t reQ6nQ4nstarQ1nstarQ1nstar = -pow(dImQ1n,2.)*dImQ4n*dImQ6n+dImQ4n*dImQ6n*pow(dReQ1n,2.)
2859 + 2.*dImQ1n*dImQ6n*dReQ1n*dReQ4n-2.*dImQ1n*dImQ4n*dReQ1n*dReQ6n
2860 - pow(dImQ1n,2.)*dReQ4n*dReQ6n+pow(dReQ1n,2.)*dReQ4n*dReQ6n;
2861 // |Q_{2n}|^2 |Q_{n}|^2
2862 Double_t dQ2nQ1nQ2nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.));
2863 // |Q_{4n}|^2 |Q_{2n}|^2
2864 Double_t dQ4nQ2nQ4nstarQ2nstar = (pow(dReQ4n,2.)+pow(dImQ4n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.));
2865 // |Q_{3n}|^2 |Q_{2n}|^2
2866 Double_t dQ3nQ2nQ3nstarQ2nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ3n,2.)+pow(dImQ3n,2.));
2867 // |Q_{5n}|^2 |Q_{n}|^2
2868 Double_t dQ5nQ1nQ5nstarQ1nstar = (pow(dReQ5n,2.)+pow(dImQ5n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.));
2869 // |Q_{3n}|^2 |Q_{n}|^2
2870 Double_t dQ3nQ1nQ3nstarQ1nstar = (pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.));
2871 // Re[Q_{2n}Q_{n}Q_{n}^*Q_{n}^*Q_{n}^*]
2872 Double_t reQ2nQ1nQ1nstarQ1nstarQ1nstar = (dReQ2n*dReQ1n-dImQ2n*dImQ1n)*(pow(dReQ1n,3)-3.*dReQ1n*pow(dImQ1n,2))
2873 + (dReQ2n*dImQ1n+dReQ1n*dImQ2n)*(3.*dImQ1n*pow(dReQ1n,2)-pow(dImQ1n,3));
2874 // Re[Q_{2n}Q_{2n}Q_{2n}^*Q_{n}^*Q_{n}^*]
2875 Double_t reQ2nQ2nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))
2876 * (dReQ2n*(pow(dReQ1n,2.)-pow(dImQ1n,2.)) + 2.*dImQ2n*dReQ1n*dImQ1n);
2877 // Re[Q_{4n}Q_{n}^*Q_{n}^*Q_{n}^*Q_{n}^*]
2878 Double_t reQ4nQ1nstarQ1nstarQ1nstarQ1nstar = pow(dReQ1n,4.)*dReQ4n-6.*pow(dReQ1n,2.)*dReQ4n*pow(dImQ1n,2.)
2879 + pow(dImQ1n,4.)*dReQ4n+4.*pow(dReQ1n,3.)*dImQ1n*dImQ4n
2880 - 4.*pow(dImQ1n,3.)*dReQ1n*dImQ4n;
2881 // Re[Q_{3n}Q_{n}Q_{2n}^*Q_{n}^*Q_{n}^*]
2882 Double_t reQ3nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
2883 * (dReQ1n*dReQ2n*dReQ3n-dReQ3n*dImQ1n*dImQ2n
2884 + dReQ2n*dImQ1n*dImQ3n+dReQ1n*dImQ2n*dImQ3n);
2885 // Re[Q_{6n}Q_{n}Q_{3n}^*Q_{2n}^*Q_{n}^*]
2886 Double_t reQ6nQ3nstarQ2nstarQ1nstar = dReQ1n*dReQ2n*dReQ3n*dReQ6n-dReQ3n*dReQ6n*dImQ1n*dImQ2n
2887 - dReQ2n*dReQ6n*dImQ1n*dImQ3n-dReQ1n*dReQ6n*dImQ2n*dImQ3n
2888 + dReQ2n*dReQ3n*dImQ1n*dImQ6n+dReQ1n*dReQ3n*dImQ2n*dImQ6n
2889 + dReQ1n*dReQ2n*dImQ3n*dImQ6n-dImQ1n*dImQ2n*dImQ3n*dImQ6n;
2890 // Re[Q_{3n}Q_{3n}Q_{3n}^*Q_{2n}^*Q_{n}^*]
2891 Double_t reQ3nQ3nQ3nstarQ2nstarQ1nstar = (pow(dImQ3n,2.)+pow(dReQ3n,2.))
2892 * (dImQ2n*dImQ3n*dReQ1n+dImQ1n*dImQ3n*dReQ2n
2893 - dImQ1n*dImQ2n*dReQ3n+dReQ1n*dReQ2n*dReQ3n);
2894 // Re[Q_{3n}Q_{3n}Q_{2n}^*Q_{2n}^*Q_{2n}^*]
2895 Double_t reQ3nQ3nQ2nstarQ2nstarQ2nstar = pow(dReQ2n,3.)*pow(dReQ3n,2.)
2896 - 3.*dReQ2n*pow(dReQ3n,2.)*pow(dImQ2n,2.)
2897 + 6.*pow(dReQ2n,2.)*dReQ3n*dImQ2n*dImQ3n
2898 - 2.*dReQ3n*pow(dImQ2n,3.)*dImQ3n-pow(dReQ2n,3.)*pow(dImQ3n,2.)
2899 + 3.*dReQ2n*pow(dImQ2n,2.)*pow(dImQ3n,2.);
2900 // Re[Q_{4n}Q_{2n}Q_{3n}^*Q_{2n}^*Q_{n}^*]
2901 Double_t reQ4nQ2nQ3nstarQ2nstarQ1nstar = (pow(dImQ2n,2.)+pow(dReQ2n,2.))
2902 * (dImQ3n*dImQ4n*dReQ1n+dImQ1n*dImQ4n*dReQ3n
2903 - dImQ1n*dImQ3n*dReQ4n+dReQ1n*dReQ3n*dReQ4n);
2904 // Re[Q_{3n}Q_{2n}Q_{3n}^*Q_{n}^*Q_{n}^*]
2905 Double_t reQ3nQ2nQ3nstarQ1nstarQ1nstar = -(pow(dImQ3n,2.)+pow(dReQ3n,2.))
2906 * (-2.*dImQ1n*dImQ2n*dReQ1n+pow(dImQ1n,2.)*dReQ2n-pow(dReQ1n,2.)*dReQ2n);
2907 // Re[Q_{3n}Q_{2n}Q_{2n}^*Q_{2n}^*Q_{n}^*]
2908 Double_t reQ3nQ2nQ2nstarQ2nstarQ1nstar = (pow(dImQ2n,2.)+pow(dReQ2n,2.))
2909 * (dImQ2n*dImQ3n*dReQ1n+dImQ1n*dImQ3n*dReQ2n
2910 - dImQ1n*dImQ2n*dReQ3n+dReQ1n*dReQ2n*dReQ3n);
2911 // Re[Q_{5n}Q_{n}Q_{3n}^*Q_{2n}^*Q_{n}^*]
2912 Double_t reQ5nQ1nQ3nstarQ2nstarQ1nstar = (pow(dImQ1n,2.)+pow(dReQ1n,2.))
2913 * (dImQ3n*dImQ5n*dReQ2n+dImQ2n*dImQ5n*dReQ3n
2914 - dImQ2n*dImQ3n*dReQ5n+dReQ2n*dReQ3n*dReQ5n);
2915 // Re[Q_{2n}Q_{2n}Q_{n}^*Q_{n}^*Q_{n}^*Q_{n}^*]
2916 Double_t reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)*dReQ2n-2.*dReQ1n*dReQ2n*dImQ1n-dReQ2n*pow(dImQ1n,2.)
2917 + dImQ2n*pow(dReQ1n,2.)+2.*dReQ1n*dImQ1n*dImQ2n-pow(dImQ1n,2.)*dImQ2n)
2918 * (pow(dReQ1n,2.)*dReQ2n+2.*dReQ1n*dReQ2n*dImQ1n-dReQ2n*pow(dImQ1n,2.)
2919 - dImQ2n*pow(dReQ1n,2.)+2.*dReQ1n*dImQ1n*dImQ2n+pow(dImQ1n,2.)*dImQ2n);
2920 // Re[Q_{3n}Q_{n}Q_{n}^*Q_{n}^*Q_{n}^*Q_{n}^*]
2921 Double_t reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
2922 * (pow(dReQ1n,3.)*dReQ3n-3.*dReQ1n*dReQ3n*pow(dImQ1n,2.)
2923 + 3.*pow(dReQ1n,2.)*dImQ1n*dImQ3n-pow(dImQ1n,3.)*dImQ3n);
2924 // |Q_{2n}|^2 |Q_{n}|^4
2925 Double_t dQ2nQ1nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))*pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.);
2926 // |Q_{3n}|^2 |Q_{2n}|^2 |Q_{n}|^2
2927 Double_t dQ3nQ2nQ1nQ3nstarQ2nstarQ1nstar = (pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2928 * (pow(dReQ1n,2.)+pow(dImQ1n,2.));
2929 // Re[Q_{2n}Q_{n}Q_{n}Q_{n}^*Q_{n}^*Q_{n}^*Q_{n}^*]
2930 Double_t reQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
2931 * (pow(dReQ1n,2.)*dReQ2n-dReQ2n*pow(dImQ1n,2.)
2932 + 2.*dReQ1n*dImQ1n*dImQ2n);
2933 // Re[Q_{6n}Q_{2n}^*Q_{2n}^*Q_{n}^*Q_{n}^*]
2934 Double_t reQ6nQ2nstarQ2nstarQ1nstarQ1nstar = pow(dReQ1n*dReQ2n,2.)*dReQ6n-pow(dReQ2n*dImQ1n,2.)*dReQ6n
2935 - 4.*dReQ1n*dReQ2n*dReQ6n*dImQ1n*dImQ2n
2936 - pow(dReQ1n*dImQ2n,2.)*dReQ6n+pow(dImQ1n*dImQ2n,2.)*dReQ6n
2937 + 2.*dReQ1n*pow(dReQ2n,2.)*dImQ1n*dImQ6n
2938 + 2.*pow(dReQ1n,2.)*dReQ2n*dImQ2n*dImQ6n
2939 - 2.*dReQ2n*pow(dImQ1n,2.)*dImQ2n*dImQ6n
2940 - 2.*dReQ1n*dImQ1n*pow(dImQ2n,2.)*dImQ6n;
2941 // Re[Q_{4n}Q_{1n}Q_{1n}Q_{3n}^*Q_{3n}^*]
2942 Double_t reQ4nQ1nQ1nQ3nstarQ3nstar = pow(dReQ1n*dReQ3n,2.)*dReQ4n-pow(dReQ3n*dImQ1n,2.)*dReQ4n
2943 + 4.*dReQ1n*dReQ3n*dReQ4n*dImQ1n*dImQ3n
2944 - pow(dReQ1n*dImQ3n,2.)*dReQ4n+pow(dImQ1n*dImQ3n,2.)*dReQ4n
2945 - 2.*dReQ1n*pow(dReQ3n,2.)*dImQ1n*dImQ4n
2946 + 2.*pow(dReQ1n,2.)*dReQ3n*dImQ3n*dImQ4n
2947 - 2.*dReQ3n*pow(dImQ1n,2.)*dImQ3n*dImQ4n
2948 + 2.*dReQ1n*dImQ1n*pow(dImQ3n,2.)*dImQ4n;
2949 // Re[Q_{3n}Q_{3n}Q_{2n}^*Q_{2n}^*Q_{1n}^*Q_{1n}^*]
2950 Double_t reQ3nQ3nQ2nstarQ2nstarQ1nstarQ1nstar = (dReQ1n*dReQ2n*dReQ3n-dReQ2n*dReQ3n*dImQ1n-dReQ1n*dReQ3n*dImQ2n
2951 - dReQ3n*dImQ1n*dImQ2n+dReQ1n*dReQ2n*dImQ3n+dReQ2n*dImQ1n*dImQ3n
2952 + dReQ1n*dImQ2n*dImQ3n-dImQ1n*dImQ2n*dImQ3n)*(dReQ1n*dReQ2n*dReQ3n
2953 + dReQ2n*dReQ3n*dImQ1n+dReQ1n*dReQ3n*dImQ2n-dReQ3n*dImQ1n*dImQ2n
2954 - dReQ1n*dReQ2n*dImQ3n+dReQ2n*dImQ1n*dImQ3n+dReQ1n*dImQ2n*dImQ3n
2955 + dImQ1n*dImQ2n*dImQ3n);
2957 // Results for multiparticle azimuthal correlations:
2959 Double_t two1n1n = 0.; // <cos(n(phi1-phi2))>
2960 Double_t two2n2n = 0.; // <cos(2n(phi1-phi2))>
2961 Double_t two3n3n = 0.; // <cos(3n(phi1-phi2))>
2962 Double_t two4n4n = 0.; // <cos(4n(phi1-phi2))>
2965 two1n1n = (pow(dReQ1n,2.)+pow(dImQ1n,2.)-dMult)/(dMult*(dMult-1.));
2966 two2n2n = (pow(dReQ2n,2.)+pow(dImQ2n,2.)-dMult)/(dMult*(dMult-1.));
2967 two3n3n = (pow(dReQ3n,2.)+pow(dImQ3n,2.)-dMult)/(dMult*(dMult-1.));
2968 two4n4n = (pow(dReQ4n,2.)+pow(dImQ4n,2.)-dMult)/(dMult*(dMult-1.));
2969 // Average 2-particle correlations for single event:
2970 fIntFlowCorrelationsAllEBE->SetBinContent(1,two1n1n);
2971 fIntFlowCorrelationsAllEBE->SetBinContent(2,two2n2n);
2972 fIntFlowCorrelationsAllEBE->SetBinContent(3,two3n3n);
2973 fIntFlowCorrelationsAllEBE->SetBinContent(4,two4n4n);
2974 // Average 2-particle correlations for all events:
2975 fIntFlowCorrelationsAllPro->Fill(0.5,two1n1n,dMult*(dMult-1.));
2976 fIntFlowCorrelationsAllPro->Fill(1.5,two2n2n,dMult*(dMult-1.));
2977 fIntFlowCorrelationsAllPro->Fill(2.5,two3n3n,dMult*(dMult-1.));
2978 fIntFlowCorrelationsAllPro->Fill(3.5,two4n4n,dMult*(dMult-1.));
2979 // Store separetately <2>:
2980 fIntFlowCorrelationsEBE->SetBinContent(1,two1n1n); // <2>
2981 // Testing other multiplicity weights:
2982 Double_t mWeight2p = 0.;
2983 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
2985 mWeight2p = dMult*(dMult-1.);
2986 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
2989 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2993 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(1,mWeight2p); // eW_<2>
2994 fIntFlowCorrelationsPro->Fill(0.5,two1n1n,mWeight2p);
2995 fIntFlowSquaredCorrelationsPro->Fill(0.5,two1n1n*two1n1n,mWeight2p);
2996 if(fCalculateCumulantsVsM)
2998 fIntFlowCorrelationsVsMPro[0]->Fill(dMult+0.5,two1n1n,mWeight2p);
2999 fIntFlowSquaredCorrelationsVsMPro[0]->Fill(dMult+0.5,two1n1n*two1n1n,mWeight2p);
3001 if(fCalculateAllCorrelationsVsM)
3003 fIntFlowCorrelationsAllVsMPro[0]->Fill(dMult+0.5,two1n1n,mWeight2p);
3004 fIntFlowCorrelationsAllVsMPro[1]->Fill(dMult+0.5,two2n2n,mWeight2p);
3005 fIntFlowCorrelationsAllVsMPro[2]->Fill(dMult+0.5,two3n3n,mWeight2p);
3006 fIntFlowCorrelationsAllVsMPro[3]->Fill(dMult+0.5,two4n4n,mWeight2p);
3008 } // end of if(dMult>1)
3011 Double_t three2n1n1n = 0.; // <cos(n(2*phi1-phi2-phi3))>
3012 Double_t three3n2n1n = 0.; // <cos(n(3*phi1-2*phi2-phi3))>
3013 Double_t three4n2n2n = 0.; // <cos(n(4*phi1-2*phi2-2*phi3))>
3014 Double_t three4n3n1n = 0.; // <cos(n(4*phi1-3*phi2-phi3))>
3017 three2n1n1n = (reQ2nQ1nstarQ1nstar-2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3018 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))+2.*dMult)
3019 / (dMult*(dMult-1.)*(dMult-2.));
3020 three3n2n1n = (reQ3nQ2nstarQ1nstar-(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3021 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))
3022 - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)
3023 / (dMult*(dMult-1.)*(dMult-2.));
3024 three4n2n2n = (reQ4nQ2nstarQ2nstar-2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3025 - (pow(dReQ4n,2.)+pow(dImQ4n,2.))+2.*dMult)
3026 / (dMult*(dMult-1.)*(dMult-2.));
3027 three4n3n1n = (reQ4nQ3nstarQ1nstar-(pow(dReQ4n,2.)+pow(dImQ4n,2.))
3028 - (pow(dReQ3n,2.)+pow(dImQ3n,2.))
3029 - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)
3030 / (dMult*(dMult-1.)*(dMult-2.));
3031 // Average 3-particle correlations for single event:
3032 fIntFlowCorrelationsAllEBE->SetBinContent(6,three2n1n1n);
3033 fIntFlowCorrelationsAllEBE->SetBinContent(7,three3n2n1n);
3034 fIntFlowCorrelationsAllEBE->SetBinContent(8,three4n2n2n);
3035 fIntFlowCorrelationsAllEBE->SetBinContent(9,three4n3n1n);
3036 // Average 3-particle correlations for all events:
3037 fIntFlowCorrelationsAllPro->Fill(5.5,three2n1n1n,dMult*(dMult-1.)*(dMult-2.));
3038 fIntFlowCorrelationsAllPro->Fill(6.5,three3n2n1n,dMult*(dMult-1.)*(dMult-2.));
3039 fIntFlowCorrelationsAllPro->Fill(7.5,three4n2n2n,dMult*(dMult-1.)*(dMult-2.));
3040 fIntFlowCorrelationsAllPro->Fill(8.5,three4n3n1n,dMult*(dMult-1.)*(dMult-2.));
3041 // Average 3-particle correlations vs M for all events:
3042 if(fCalculateAllCorrelationsVsM)
3044 fIntFlowCorrelationsAllVsMPro[5]->Fill(dMult+0.5,three2n1n1n,dMult*(dMult-1.)*(dMult-2.));
3045 fIntFlowCorrelationsAllVsMPro[6]->Fill(dMult+0.5,three3n2n1n,dMult*(dMult-1.)*(dMult-2.));
3046 fIntFlowCorrelationsAllVsMPro[7]->Fill(dMult+0.5,three4n2n2n,dMult*(dMult-1.)*(dMult-2.));
3047 fIntFlowCorrelationsAllVsMPro[8]->Fill(dMult+0.5,three4n3n1n,dMult*(dMult-1.)*(dMult-2.));
3049 } // end of if(dMult>2)
3052 Double_t four1n1n1n1n = 0.; // <cos(n(phi1+phi2-phi3-phi4))>
3053 Double_t four2n2n2n2n = 0.; // <cos(2n(phi1+phi2-phi3-phi4))>
3054 Double_t four2n1n2n1n = 0.; // <cos(n(2*phi1+phi2-2*phi3-phi4))>
3055 Double_t four3n1n1n1n = 0.; // <cos(n(3*phi1-phi2-phi3-phi4))>
3056 Double_t four4n2n1n1n = 0.; // <cos(n(4*phi1-2*phi2-phi3-phi4))>
3057 Double_t four3n1n2n2n = 0.; // <cos(n(3*phi1+phi2-2*phi3-2*phi4))>
3058 Double_t four3n1n3n1n = 0.; // <cos(n(3*phi1+phi2-3*phi3-phi4))>
3061 four1n1n1n1n = (2.*dMult*(dMult-3.)+pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)-4.*(dMult-2.)*(pow(dReQ1n,2.)
3062 + pow(dImQ1n,2.))-2.*reQ2nQ1nstarQ1nstar+(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
3063 / (dMult*(dMult-1)*(dMult-2.)*(dMult-3.));
3064 four2n2n2n2n = (2.*dMult*(dMult-3.)+pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)-4.*(dMult-2.)*(pow(dReQ2n,2.)
3065 + pow(dImQ2n,2.))-2.*reQ4nQ2nstarQ2nstar+(pow(dReQ4n,2.)+pow(dImQ4n,2.)))
3066 / (dMult*(dMult-1)*(dMult-2.)*(dMult-3.));
3067 four2n1n2n1n = (dQ2nQ1nQ2nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar-2.*reQ2nQ1nstarQ1nstar)
3068 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
3069 - ((dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3070 + (dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-(pow(dReQ3n,2.)+pow(dImQ3n,2.)))
3071 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
3072 + (dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.));
3073 four3n1n1n1n = (reQ3nQ1nstarQ1nstarQ1nstar-3.*reQ3nQ2nstarQ1nstar-3.*reQ2nQ1nstarQ1nstar
3074 + 2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+3.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3075 + 6.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-6.*dMult)
3076 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3077 four4n2n1n1n = (reQ4nQ2nstarQ1nstarQ1nstar-2.*reQ4nQ3nstarQ1nstar-reQ4nQ2nstarQ2nstar-2.*reQ3nQ2nstarQ1nstar)
3078 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
3079 - (reQ2nQ1nstarQ1nstar-2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3080 - 3.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
3081 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
3082 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
3083 four3n1n2n2n = (reQ3nQ1nQ2nstarQ2nstar-reQ4nQ2nstarQ2nstar-reQ4nQ3nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar)
3084 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
3085 - (2.*reQ2nQ1nstarQ1nstar-(pow(dReQ4n,2.)+pow(dImQ4n,2.))-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3086 - 4.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
3087 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
3088 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
3089 four3n1n3n1n = ((pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3090 - 2.*reQ4nQ3nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar
3091 + pow(dReQ4n,2.)+pow(dImQ4n,2.)-(dMult-4.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3092 + pow(dReQ2n,2.)+pow(dImQ2n,2.)-(dMult-4.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3094 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3095 // Average 4-particle correlations for single event:
3096 fIntFlowCorrelationsAllEBE->SetBinContent(11,four1n1n1n1n);
3097 fIntFlowCorrelationsAllEBE->SetBinContent(12,four2n1n2n1n);
3098 fIntFlowCorrelationsAllEBE->SetBinContent(13,four2n2n2n2n);
3099 fIntFlowCorrelationsAllEBE->SetBinContent(14,four3n1n1n1n);
3100 fIntFlowCorrelationsAllEBE->SetBinContent(15,four3n1n3n1n);
3101 fIntFlowCorrelationsAllEBE->SetBinContent(16,four3n1n2n2n);
3102 fIntFlowCorrelationsAllEBE->SetBinContent(17,four4n2n1n1n);
3103 // Average 4-particle correlations for all events:
3104 fIntFlowCorrelationsAllPro->Fill(10.5,four1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3105 fIntFlowCorrelationsAllPro->Fill(11.5,four2n1n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3106 fIntFlowCorrelationsAllPro->Fill(12.5,four2n2n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3107 fIntFlowCorrelationsAllPro->Fill(13.5,four3n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3108 fIntFlowCorrelationsAllPro->Fill(14.5,four3n1n3n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3109 fIntFlowCorrelationsAllPro->Fill(15.5,four3n1n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3110 fIntFlowCorrelationsAllPro->Fill(16.5,four4n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3111 // Average 4-particle correlations vs M for all events:
3112 if(fCalculateAllCorrelationsVsM)
3114 fIntFlowCorrelationsAllVsMPro[10]->Fill(dMult+0.5,four1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3115 fIntFlowCorrelationsAllVsMPro[11]->Fill(dMult+0.5,four2n1n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3116 fIntFlowCorrelationsAllVsMPro[12]->Fill(dMult+0.5,four2n2n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3117 fIntFlowCorrelationsAllVsMPro[13]->Fill(dMult+0.5,four3n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3118 fIntFlowCorrelationsAllVsMPro[14]->Fill(dMult+0.5,four3n1n3n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3119 fIntFlowCorrelationsAllVsMPro[15]->Fill(dMult+0.5,four3n1n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3120 fIntFlowCorrelationsAllVsMPro[16]->Fill(dMult+0.5,four4n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3122 // Store separetately <4>:
3123 fIntFlowCorrelationsEBE->SetBinContent(2,four1n1n1n1n); // <4>
3124 // Testing other multiplicity weights:
3125 Double_t mWeight4p = 0.;
3126 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
3128 mWeight4p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.);
3129 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
3132 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
3136 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(2,mWeight4p); // eW_<4>
3137 fIntFlowCorrelationsPro->Fill(1.5,four1n1n1n1n,mWeight4p);
3138 fIntFlowSquaredCorrelationsPro->Fill(1.5,four1n1n1n1n*four1n1n1n1n,mWeight4p);
3139 if(fCalculateCumulantsVsM)
3141 fIntFlowCorrelationsVsMPro[1]->Fill(dMult+0.5,four1n1n1n1n,mWeight4p);
3142 fIntFlowSquaredCorrelationsVsMPro[1]->Fill(dMult+0.5,four1n1n1n1n*four1n1n1n1n,mWeight4p);
3144 } // end of if(dMult>3)
3147 Double_t five2n1n1n1n1n = 0.; // <cos(n(2*phi1+phi2-phi3-phi4-phi5))>
3148 Double_t five2n2n2n1n1n = 0.; // <cos(n(2*phi1+2*phi2-2*phi3-phi4-phi5))>
3149 Double_t five3n1n2n1n1n = 0.; // <cos(n(3*phi1+phi2-2*phi3-phi4-phi5))>
3150 Double_t five4n1n1n1n1n = 0.; // <cos(n(4*phi1-phi2-phi3-phi4-phi5))>
3153 five2n1n1n1n1n = (reQ2nQ1nQ1nstarQ1nstarQ1nstar-reQ3nQ1nstarQ1nstarQ1nstar+5.*reQ3nQ2nstarQ1nstar
3154 - 3.*(dMult-5.)*reQ2nQ1nstarQ1nstar-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3155 - 3.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3156 + 3.*(dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3157 - 3.*pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
3158 + 6.*(2.*dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-6.*dMult*(dMult-4.))
3159 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3160 five2n2n2n1n1n = (reQ2nQ2nQ2nstarQ1nstarQ1nstar-reQ4nQ2nstarQ1nstarQ1nstar-2.*reQ3nQ1nQ2nstarQ2nstar
3161 + 3.*reQ4nQ2nstarQ2nstar+8.*reQ3nQ2nstarQ1nstar+2.*reQ4nQ3nstarQ1nstar
3162 - 2.*(dMult-6.)*reQ2nQ1nstarQ1nstar
3163 - 2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))-4.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3164 - pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)
3165 + 2.*(3.*dMult-10.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3166 - 4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3167 + 4.*(dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-4.*dMult*(dMult-6.))
3168 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3169 five4n1n1n1n1n = (reQ4nQ1nstarQ1nstarQ1nstarQ1nstar-6.*reQ4nQ2nstarQ1nstarQ1nstar-4.*reQ3nQ1nstarQ1nstarQ1nstar
3170 + 8.*reQ4nQ3nstarQ1nstar+3.*reQ4nQ2nstarQ2nstar+12.*reQ3nQ2nstarQ1nstar+12.*reQ2nQ1nstarQ1nstar
3171 - 6.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))-8.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3172 - 12.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-24.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))+24.*dMult)
3173 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3174 five3n1n2n1n1n = (reQ3nQ1nQ2nstarQ1nstarQ1nstar-reQ4nQ2nstarQ1nstarQ1nstar-reQ3nQ1nstarQ1nstarQ1nstar
3175 - reQ3nQ1nQ2nstarQ2nstar+4.*reQ4nQ3nstarQ1nstar+reQ4nQ2nstarQ2nstar
3176 - (2.*dMult-13.)*reQ3nQ2nstarQ1nstar+7.*reQ2nQ1nstarQ1nstar
3177 - 2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
3178 + 2.*(dMult-5.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3179 - 2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3180 + 2.*(dMult-6.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3181 - 2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3182 - pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
3183 + 2.*(3.*dMult-11.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-4.*dMult*(dMult-6.))
3184 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3185 // Average 5-particle correlations for single event:
3186 fIntFlowCorrelationsAllEBE->SetBinContent(19,five2n1n1n1n1n);
3187 fIntFlowCorrelationsAllEBE->SetBinContent(20,five2n2n2n1n1n);
3188 fIntFlowCorrelationsAllEBE->SetBinContent(21,five3n1n2n1n1n);
3189 fIntFlowCorrelationsAllEBE->SetBinContent(22,five4n1n1n1n1n);
3190 // Average 5-particle correlations for all events:
3191 fIntFlowCorrelationsAllPro->Fill(18.5,five2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3192 fIntFlowCorrelationsAllPro->Fill(19.5,five2n2n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3193 fIntFlowCorrelationsAllPro->Fill(20.5,five3n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3194 fIntFlowCorrelationsAllPro->Fill(21.5,five4n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3195 // Average 5-particle correlations vs M for all events:
3196 if(fCalculateAllCorrelationsVsM)
3198 fIntFlowCorrelationsAllVsMPro[18]->Fill(dMult+0.5,five2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3199 fIntFlowCorrelationsAllVsMPro[19]->Fill(dMult+0.5,five2n2n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3200 fIntFlowCorrelationsAllVsMPro[20]->Fill(dMult+0.5,five3n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3201 fIntFlowCorrelationsAllVsMPro[21]->Fill(dMult+0.5,five4n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3203 } // end of if(dMult>4)
3206 Double_t six1n1n1n1n1n1n = 0.; // <cos(n(phi1+phi2+phi3-phi4-phi5-phi6))>
3207 Double_t six2n2n1n1n1n1n = 0.; // <cos(n(2*phi1+2*phi2-phi3-phi4-phi5-phi6))>
3208 Double_t six3n1n1n1n1n1n = 0.; // <cos(n(3*phi1+phi2-phi3-phi4-phi5-phi6))>
3209 Double_t six2n1n1n2n1n1n = 0.; // <cos(n(2*phi1+phi2+phi3-2*phi4-phi5-phi6))>
3212 six1n1n1n1n1n1n = (pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),3.)-6.*reQ2nQ1nQ1nstarQ1nstarQ1nstar
3213 + 4.*reQ3nQ1nstarQ1nstarQ1nstar-12.*reQ3nQ2nstarQ1nstar+18.*(dMult-4.)*reQ2nQ1nstarQ1nstar
3214 + 9.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3215 + 4.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))-9.*(dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3216 - 9.*(dMult-4.)*pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
3217 + 18.*(dMult*dMult-7.*dMult+10.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3218 - 6.*dMult*(dMult*dMult-9.*dMult+20.))
3219 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3220 six2n1n1n2n1n1n = (dQ2nQ1nQ1nQ2nstarQ1nstarQ1nstar-4.*reQ3nQ1nQ2nstarQ1nstarQ1nstar
3221 - 4.*reQ2nQ1nQ1nstarQ1nstarQ1nstar-2.*reQ2nQ2nQ2nstarQ1nstarQ1nstar
3222 + 4.*reQ4nQ2nstarQ1nstarQ1nstar+4.*reQ3nQ1nQ2nstarQ2nstar+4.*reQ3nQ1nstarQ1nstarQ1nstar
3223 - 8.*reQ4nQ3nstarQ1nstar-4.*reQ4nQ2nstarQ2nstar+4.*(2.*dMult-13.)*reQ3nQ2nstarQ1nstar
3224 + 2.*(7.*dMult-34.)*reQ2nQ1nstarQ1nstar+4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3225 - 4.*(dMult-7.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3226 + 4.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))-4.*(dMult-6.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3227 + pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)+(2.*dMult*dMult-27.*dMult+76.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3228 - (dMult-12.)*pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
3229 + 4.*(dMult*dMult-15.*dMult+34.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3230 - 2.*dMult*(dMult*dMult-17.*dMult+60.))
3231 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3232 six2n2n1n1n1n1n = (reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar-6.*reQ2nQ2nQ2nstarQ1nstarQ1nstar-reQ4nQ1nstarQ1nstarQ1nstarQ1nstar
3233 - 8.*reQ2nQ1nQ1nstarQ1nstarQ1nstar+8.*reQ3nQ1nstarQ1nstarQ1nstar+6.*reQ4nQ2nstarQ1nstarQ1nstar
3234 + 8.*reQ3nQ1nQ2nstarQ2nstar-40.*reQ3nQ2nstarQ1nstar-8.*reQ4nQ3nstarQ1nstar-9.*reQ4nQ2nstarQ2nstar
3235 + 24.*(dMult-4.)*reQ2nQ1nstarQ1nstar+24.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3236 + 6.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+16.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3237 + 3.*pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)-12.*(2.*dMult-7.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3238 + 12.*pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)-48.*(dMult-3.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3239 + 24.*dMult*(dMult-5.))
3240 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3241 six3n1n1n1n1n1n = (reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar-6.*reQ3nQ1nQ2nstarQ1nstarQ1nstar+6.*reQ4nQ2nstarQ1nstarQ1nstar
3242 - reQ4nQ1nstarQ1nstarQ1nstarQ1nstar-4.*reQ2nQ1nQ1nstarQ1nstarQ1nstar+3.*reQ3nQ1nQ2nstarQ2nstar
3243 - 4.*(dMult-5.)*reQ3nQ1nstarQ1nstarQ1nstar-14.*reQ4nQ3nstarQ1nstar
3244 - 3.*reQ4nQ2nstarQ2nstar+4.*(3.*dMult-17.)*reQ3nQ2nstarQ1nstar+12.*(dMult-6.)*reQ2nQ1nstarQ1nstar
3245 + 12.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3246 + 8.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3247 + 6.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))-8.*(dMult-5.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3248 - 12.*(dMult-5.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-48.*(dMult-3.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3249 + 12.*pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)+24.*dMult*(dMult-5.))
3250 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3251 // Average 6-particle correlations for single event:
3252 fIntFlowCorrelationsAllEBE->SetBinContent(24,six1n1n1n1n1n1n);
3253 fIntFlowCorrelationsAllEBE->SetBinContent(25,six2n1n1n2n1n1n);
3254 fIntFlowCorrelationsAllEBE->SetBinContent(26,six2n2n1n1n1n1n);
3255 fIntFlowCorrelationsAllEBE->SetBinContent(27,six3n1n1n1n1n1n);
3256 // Average 6-particle correlations for all events:
3257 fIntFlowCorrelationsAllPro->Fill(23.5,six1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3258 fIntFlowCorrelationsAllPro->Fill(24.5,six2n1n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3259 fIntFlowCorrelationsAllPro->Fill(25.5,six2n2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3260 fIntFlowCorrelationsAllPro->Fill(26.5,six3n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3261 // Average 6-particle correlations vs M for all events:
3262 if(fCalculateAllCorrelationsVsM)
3264 fIntFlowCorrelationsAllVsMPro[23]->Fill(dMult+0.5,six1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3265 fIntFlowCorrelationsAllVsMPro[24]->Fill(dMult+0.5,six2n1n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3266 fIntFlowCorrelationsAllVsMPro[25]->Fill(dMult+0.5,six2n2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3267 fIntFlowCorrelationsAllVsMPro[26]->Fill(dMult+0.5,six3n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3269 // Store separetately <6>:
3270 fIntFlowCorrelationsEBE->SetBinContent(3,six1n1n1n1n1n1n); // <6>
3271 // Testing other multiplicity weights:
3272 Double_t mWeight6p = 0.;
3273 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
3275 mWeight6p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.);
3276 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
3279 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
3283 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(3,mWeight6p); // eW_<6>
3284 fIntFlowCorrelationsPro->Fill(2.5,six1n1n1n1n1n1n,mWeight6p);
3285 fIntFlowSquaredCorrelationsPro->Fill(2.5,six1n1n1n1n1n1n*six1n1n1n1n1n1n,mWeight6p);
3286 if(fCalculateCumulantsVsM)
3288 fIntFlowCorrelationsVsMPro[2]->Fill(dMult+0.5,six1n1n1n1n1n1n,mWeight6p);
3289 fIntFlowSquaredCorrelationsVsMPro[2]->Fill(dMult+0.5,six1n1n1n1n1n1n*six1n1n1n1n1n1n,mWeight6p);
3291 } // end of if(dMult>5)
3294 Double_t seven2n1n1n1n1n1n1n = 0.; // <cos(n(2*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
3297 seven2n1n1n1n1n1n1n = (reQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar-4.*pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),3.)
3298 - reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar-2.*reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar
3299 + 9.*reQ2nQ2nQ2nstarQ1nstarQ1nstar+20.*reQ3nQ1nQ2nstarQ1nstarQ1nstar
3300 + 2.*reQ4nQ1nstarQ1nstarQ1nstarQ1nstar-8.*(dMult-8.)*reQ2nQ1nQ1nstarQ1nstarQ1nstar
3301 - 18.*reQ4nQ2nstarQ1nstarQ1nstar-14.*reQ3nQ1nQ2nstarQ2nstar
3302 + 8.*(dMult-7.)*reQ3nQ1nstarQ1nstarQ1nstar+28.*reQ4nQ3nstarQ1nstar
3303 + 12.*reQ4nQ2nstarQ2nstar-8.*(5.*dMult-31.)*reQ3nQ2nstarQ1nstar
3304 + 12.*(dMult*dMult-15.*dMult+46.)*reQ2nQ1nstarQ1nstar
3305 - 16.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3306 - 6.*pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),2.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3307 - 3.*pow(pow(dReQ2n,2.)+pow(dImQ2n,2.),2.)
3308 + 12.*(2.*dMult-13.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3309 - 12.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+16.*(dMult-6.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3310 - 12.*(dMult-8.)*(dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3311 + 12.*(3.*dMult-14.)*pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),2.)
3312 - 24.*(3.*dMult-7.)*(dMult-6.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3313 + 24.*dMult*(dMult-5.)*(dMult-6.))
3314 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.));
3315 // Average 7-particle correlations for single event:
3316 fIntFlowCorrelationsAllEBE->SetBinContent(29,seven2n1n1n1n1n1n1n);
3317 // Average 7-particle correlations for all events:
3318 fIntFlowCorrelationsAllPro->Fill(28.5,seven2n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)
3319 *(dMult-4.)*(dMult-5.)*(dMult-6.));
3320 // Average 7-particle correlations vs M for all events:
3321 if(fCalculateAllCorrelationsVsM)
3323 fIntFlowCorrelationsAllVsMPro[28]->Fill(dMult+0.5,seven2n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)
3324 *(dMult-4.)*(dMult-5.)*(dMult-6.));
3326 } // end of if(dMult>6)
3329 Double_t eight1n1n1n1n1n1n1n1n = 0.; // <cos(n(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
3332 eight1n1n1n1n1n1n1n1n = (pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),4.)-12.*reQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar
3333 + 16.*reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar+6.*reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar
3334 - 12.*reQ4nQ1nstarQ1nstarQ1nstarQ1nstar-36.*reQ2nQ2nQ2nstarQ1nstarQ1nstar
3335 - 96.*reQ3nQ1nQ2nstarQ1nstarQ1nstar
3336 + 72.*reQ4nQ2nstarQ1nstarQ1nstar+48.*reQ3nQ1nQ2nstarQ2nstar
3337 - 64.*(dMult-6.)*reQ3nQ1nstarQ1nstarQ1nstar
3338 + 96.*(dMult-6.)*reQ2nQ1nQ1nstarQ1nstarQ1nstar
3339 - 96.*reQ4nQ3nstarQ1nstar-36.*reQ4nQ2nstarQ2nstar
3340 + 192.*(dMult-6.)*reQ3nQ2nstarQ1nstar
3341 - 144.*(dMult-7.)*(dMult-4.)*reQ2nQ1nstarQ1nstar
3342 + 64.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3343 - 144.*(dMult-6.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3344 + 72.*(dMult-7.)*(dMult-4.)*(pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),2.)+pow(dReQ2n,2.)+pow(dImQ2n,2.))
3345 - 96.*(dMult-7.)*(dMult-6.)*(dMult-2.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3346 + 36.*pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),2.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3347 + 9.*pow(pow(dReQ2n,2.)+pow(dImQ2n,2.),2.)
3348 - 64.*(dMult-6.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3349 + 36.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
3350 - 16.*(dMult-6.)*pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),3.)
3351 + 24.*dMult*(dMult-7.)*(dMult-6.)*(dMult-5.))
3352 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.));
3353 // Average 8-particle correlations for single event:
3354 fIntFlowCorrelationsAllEBE->SetBinContent(31,eight1n1n1n1n1n1n1n1n);
3355 // Average 8-particle correlations for all events:
3356 fIntFlowCorrelationsAllPro->Fill(30.5,eight1n1n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)
3357 *(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.));
3358 // Average 8-particle correlations vs M for all events:
3359 if(fCalculateAllCorrelationsVsM)
3361 fIntFlowCorrelationsAllVsMPro[30]->Fill(dMult+0.5,eight1n1n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)
3362 *(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.));
3364 // Store separetately <8>:
3365 fIntFlowCorrelationsEBE->SetBinContent(4,eight1n1n1n1n1n1n1n1n); // <8>
3366 // Testing other multiplicity weights:
3367 Double_t mWeight8p = 0.;
3368 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
3370 mWeight8p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.);
3371 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
3374 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
3378 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(4,mWeight8p); // eW_<8>
3379 fIntFlowCorrelationsPro->Fill(3.5,eight1n1n1n1n1n1n1n1n,mWeight8p);
3380 fIntFlowSquaredCorrelationsPro->Fill(3.5,eight1n1n1n1n1n1n1n1n*eight1n1n1n1n1n1n1n1n,mWeight8p);
3381 if(fCalculateCumulantsVsM)
3383 fIntFlowCorrelationsVsMPro[3]->Fill(dMult+0.5,eight1n1n1n1n1n1n1n1n,mWeight8p);
3384 fIntFlowSquaredCorrelationsVsMPro[3]->Fill(dMult+0.5,eight1n1n1n1n1n1n1n1n*eight1n1n1n1n1n1n1n1n,mWeight8p);
3386 } // end of if(dMult>7)
3388 // EXTRA correlations for v3{5} study:
3390 Double_t four4n2n3n3n = 0.; // <cos(n(4*phi1+2*phi2-3*phi3-3*phi4))>
3393 four4n2n3n3n = (reQ4nQ2nQ3nstarQ3nstar-reQ6nQ4nstarQ2nstar-reQ6nQ3nstarQ3nstar
3394 - 2.*reQ4nQ3nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar
3395 + (pow(dReQ6n,2.)+pow(dImQ6n,2.))+2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
3396 + 2.*(2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3397 + (pow(dReQ1n,2.)+pow(dImQ1n,2.))-3.*dMult))
3398 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3399 fIntFlowCorrelationsAllPro->Fill(32.5,four4n2n3n3n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3400 // Average 4-particle correlations vs M for all events:
3401 if(fCalculateAllCorrelationsVsM)
3403 fIntFlowCorrelationsAllVsMPro[32]->Fill(dMult+0.5,four4n2n3n3n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3405 } // end of if(dMult>3.)
3408 Double_t five3n3n2n2n2n = 0.; // <cos(n(3*phi1+3*phi2-2*phi3-2*phi4-2*phi5))>
3411 five3n3n2n2n2n = (reQ3nQ3nQ2nstarQ2nstarQ2nstar-reQ6nQ2nstarQ2nstarQ2nstar-3.*reQ4nQ2nQ3nstarQ3nstar
3412 - 6.*reQ3nQ1nQ2nstarQ2nstar+2.*reQ6nQ3nstarQ3nstar+3.*reQ6nQ4nstarQ2nstar
3413 + 6.*reQ4nQ3nstarQ1nstar+6.*reQ4nQ2nstarQ2nstar
3414 + 12.*reQ3nQ2nstarQ1nstar+6.*reQ2nQ1nstarQ1nstar
3415 - 2.*((pow(dReQ6n,2.)+pow(dImQ6n,2.))
3416 + 3.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
3417 + 6.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3418 + 9.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3419 + 6.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-12.*dMult))
3420 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3421 fIntFlowCorrelationsAllPro->Fill(33.5,five3n3n2n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3422 if(fCalculateAllCorrelationsVsM)
3424 fIntFlowCorrelationsAllVsMPro[33]->Fill(dMult+0.5,five3n3n2n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3426 } // end of if(dMult>4.)
3428 // EXTRA correlations for Teaney-Yan study:
3430 Double_t two5n5n = 0.; // <cos(5n(phi1-phi2))>
3431 Double_t two6n6n = 0.; // <cos(6n(phi1-phi2))>
3434 two5n5n = (pow(dReQ5n,2.)+pow(dImQ5n,2.)-dMult)/(dMult*(dMult-1.));
3435 two6n6n = (pow(dReQ6n,2.)+pow(dImQ6n,2.)-dMult)/(dMult*(dMult-1.));
3436 // Average 2-particle correlations for all events:
3437 fIntFlowCorrelationsAllPro->Fill(34.5,two5n5n,dMult*(dMult-1.));
3438 fIntFlowCorrelationsAllPro->Fill(35.5,two6n6n,dMult*(dMult-1.));
3439 if(fCalculateAllCorrelationsVsM)
3441 fIntFlowCorrelationsAllVsMPro[34]->Fill(dMult+0.5,two5n5n,dMult*(dMult-1.));
3442 fIntFlowCorrelationsAllVsMPro[35]->Fill(dMult+0.5,two6n6n,dMult*(dMult-1.));
3444 } // end of if(dMult>1)
3447 Double_t three5n3n2n = 0.; // <cos(n(5*phi1-3*phi2-2*phi3)>
3448 Double_t three5n4n1n = 0.; // <cos(n(5*phi1-4*phi2-1*phi3)>
3449 Double_t three6n3n3n = 0.; // <cos(n(6*phi1-3*phi2-3*phi3)>
3450 Double_t three6n4n2n = 0.; // <cos(n(6*phi1-4*phi2-2*phi3)>
3451 Double_t three6n5n1n = 0.; // <cos(n(6*phi1-5*phi2-1*phi3)>
3454 three5n3n2n = (reQ5nQ3nstarQ2nstar-(pow(dReQ5n,2.)+pow(dImQ5n,2.))
3455 - (pow(dReQ3n,2.)+pow(dImQ3n,2.))
3456 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))+2.*dMult)
3457 / (dMult*(dMult-1.)*(dMult-2.));
3458 three5n4n1n = (reQ5nQ4nstarQ1nstar-(pow(dReQ5n,2.)+pow(dImQ5n,2.))
3459 - (pow(dReQ4n,2.)+pow(dImQ4n,2.))
3460 - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)
3461 / (dMult*(dMult-1.)*(dMult-2.));
3462 three6n3n3n = (reQ6nQ3nstarQ3nstar-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3463 - (pow(dReQ6n,2.)+pow(dImQ6n,2.))+2.*dMult)
3464 / (dMult*(dMult-1.)*(dMult-2.));
3465 three6n4n2n = (reQ6nQ4nstarQ2nstar-(pow(dReQ6n,2.)+pow(dImQ6n,2.))
3466 - (pow(dReQ4n,2.)+pow(dImQ4n,2.))
3467 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))+2.*dMult)
3468 / (dMult*(dMult-1.)*(dMult-2.));
3469 three6n5n1n = (reQ6nQ5nstarQ1nstar-(pow(dReQ6n,2.)+pow(dImQ6n,2.))
3470 - (pow(dReQ5n,2.)+pow(dImQ5n,2.))
3471 - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)
3472 / (dMult*(dMult-1.)*(dMult-2.));
3473 // Average 3-particle correlations for all events:
3474 fIntFlowCorrelationsAllPro->Fill(36.5,three5n3n2n,dMult*(dMult-1.)*(dMult-2.)); // <<cos(n(5*phi1-3*phi2-2*phi3)>>
3475 fIntFlowCorrelationsAllPro->Fill(37.5,three5n4n1n,dMult*(dMult-1.)*(dMult-2.)); // <<cos(n(5*phi1-4*phi2-1*phi3)>>
3476 fIntFlowCorrelationsAllPro->Fill(38.5,three6n3n3n,dMult*(dMult-1.)*(dMult-2.)); // <<cos(n(6*phi1-3*phi2-3*phi3)>>
3477 fIntFlowCorrelationsAllPro->Fill(39.5,three6n4n2n,dMult*(dMult-1.)*(dMult-2.)); // <<cos(n(6*phi1-4*phi2-2*phi3)>>
3478 fIntFlowCorrelationsAllPro->Fill(40.5,three6n5n1n,dMult*(dMult-1.)*(dMult-2.)); // <<cos(n(6*phi1-5*phi2-1*phi3)>>
3479 if(fCalculateAllCorrelationsVsM)
3481 fIntFlowCorrelationsAllVsMPro[36]->Fill(dMult+0.5,three5n3n2n,dMult*(dMult-1.)*(dMult-2.));
3482 fIntFlowCorrelationsAllVsMPro[37]->Fill(dMult+0.5,three5n4n1n,dMult*(dMult-1.)*(dMult-2.));
3483 fIntFlowCorrelationsAllVsMPro[38]->Fill(dMult+0.5,three6n3n3n,dMult*(dMult-1.)*(dMult-2.));
3484 fIntFlowCorrelationsAllVsMPro[39]->Fill(dMult+0.5,three6n4n2n,dMult*(dMult-1.)*(dMult-2.));
3485 fIntFlowCorrelationsAllVsMPro[40]->Fill(dMult+0.5,three6n5n1n,dMult*(dMult-1.)*(dMult-2.));
3487 } // end of if(dMult>2)
3490 Double_t four6n3n2n1n = 0.; // <cos(n(6*phi1-3*phi2-2*phi3-1*phi4)>
3491 Double_t four3n2n3n2n = 0.; // <cos(n(3*phi1+2*phi2-3*phi3-2*phi4)>
3492 Double_t four4n1n3n2n = 0.; // <cos(n(4*phi1+1*phi2-3*phi3-2*phi4)>
3493 Double_t four3n3n3n3n = 0.; // <cos(3n(phi1+phi2-phi3-phi4))>
3494 //Double_t four4n2n3n3n = 0.; // <cos(n(4*phi1+2*phi2-3*phi3-3*phi4)> // I already have this one above
3495 Double_t four5n1n3n3n = 0.; // <cos(n(5*phi1+1*phi2-3*phi3-3*phi4)>
3496 Double_t four4n2n4n2n = 0.; // <cos(n(4*phi1+2*phi2-4*phi3-2*phi4)>
3497 Double_t four5n1n4n2n = 0.; // <cos(n(5*phi1+1*phi2-4*phi3-2*phi4)>
3498 Double_t four5n3n1n1n = 0.; // <cos(n(5*phi1-3*phi2-1*phi3-1*phi4)>
3499 Double_t four5n2n2n1n = 0.; // <cos(n(5*phi1-2*phi2-2*phi3-1*phi4)>
3500 Double_t four5n1n5n1n = 0.; // <cos(n(5*phi1+1*phi2-5*phi3-1*phi4)>
3501 Double_t four6n4n1n1n = 0.; // <cos(n(6*phi1-4*phi2-1*phi3-1*phi4)>
3502 Double_t four6n2n2n2n = 0.; // <cos(n(6*phi1-2*phi2-2*phi3-2*phi4)>
3505 four6n3n2n1n = (reQ6nQ3nstarQ2nstarQ1nstar-reQ6nQ4nstarQ2nstar-reQ6nQ3nstarQ3nstar-reQ6nQ5nstarQ1nstar
3506 - reQ5nQ3nstarQ2nstar-reQ4nQ3nstarQ1nstar-reQ3nQ2nstarQ1nstar
3507 + 2.*(pow(dReQ6n,2.)+pow(dImQ6n,2.))+pow(dReQ5n,2.)+pow(dImQ5n,2.)
3508 + pow(dReQ4n,2.)+pow(dImQ4n,2.)+3.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3509 + 2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))+2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-6.*dMult)
3510 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3511 four3n2n3n2n = (dQ3nQ2nQ3nstarQ2nstar-2.*reQ5nQ3nstarQ2nstar-2.*reQ3nQ2nstarQ1nstar
3512 + pow(dReQ5n,2.)+pow(dImQ5n,2.)+pow(dReQ1n,2.)+pow(dImQ1n,2.)
3513 -(dMult-4.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.)+pow(dReQ2n,2.)+pow(dImQ2n,2.))
3515 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3516 four4n1n3n2n = (reQ4nQ1nQ3nstarQ2nstar-reQ5nQ3nstarQ2nstar-reQ5nQ4nstarQ1nstar-reQ4nQ3nstarQ1nstar
3517 - reQ4nQ2nstarQ2nstar-reQ3nQ2nstarQ1nstar-reQ2nQ1nstarQ1nstar
3518 + pow(dReQ5n,2.)+pow(dImQ5n,2.)+2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
3519 + 2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+3.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3520 + 3.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-6.*dMult)
3521 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3522 four3n3n3n3n = (2.*dMult*(dMult-3.)+pow((pow(dReQ3n,2.)+pow(dImQ3n,2.)),2.)-4.*(dMult-2.)*(pow(dReQ3n,2.)
3523 + pow(dImQ3n,2.))-2.*reQ6nQ3nstarQ3nstar+(pow(dReQ6n,2.)+pow(dImQ6n,2.)))
3524 / (dMult*(dMult-1)*(dMult-2.)*(dMult-3.));
3525 //four4n2n3n3n = ; // I already have this one above
3526 four5n1n3n3n = (reQ5nQ1nQ3nstarQ3nstar-reQ6nQ5nstarQ1nstar-reQ6nQ3nstarQ3nstar-2.*reQ5nQ3nstarQ2nstar
3527 - 2.*reQ3nQ2nstarQ1nstar+pow(dReQ6n,2.)+pow(dImQ6n,2.)+2.*(pow(dReQ5n,2.)+pow(dImQ5n,2.))
3528 + 4.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3529 + 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-6.*dMult)
3530 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3531 four4n2n4n2n = (dQ4nQ2nQ4nstarQ2nstar-2.*reQ6nQ4nstarQ2nstar-2.*reQ4nQ2nstarQ2nstar)
3532 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
3533 - ((dMult-5.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3534 + (dMult-4.)*(pow(dReQ4n,2.)+pow(dImQ4n,2.))-(pow(dReQ6n,2.)+pow(dImQ6n,2.)))
3535 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
3536 + (dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.));
3537 four5n1n4n2n = (reQ5nQ1nQ4nstarQ2nstar-reQ6nQ5nstarQ1nstar-reQ6nQ4nstarQ2nstar-reQ5nQ4nstarQ1nstar
3538 - reQ5nQ3nstarQ2nstar-reQ4nQ3nstarQ1nstar-reQ2nQ1nstarQ1nstar+pow(dReQ6n,2.)+pow(dImQ6n,2.)
3539 + 2.*(pow(dReQ5n,2.)+pow(dImQ5n,2.))+2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
3540 + pow(dReQ3n,2.)+pow(dImQ3n,2.)+2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3541 + 3.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-6.*dMult)
3542 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3543 four5n3n1n1n = (reQ5nQ3nstarQ1nstarQ1nstar-2.*reQ5nQ4nstarQ1nstar-reQ5nQ3nstarQ2nstar-2.*reQ4nQ3nstarQ1nstar
3544 - reQ2nQ1nstarQ1nstar+2.*(pow(dReQ5n,2.)+pow(dImQ5n,2.))+2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
3545 + 2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+pow(dReQ2n,2.)+pow(dImQ2n,2.)
3546 + 4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-6.*dMult)
3547 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3548 four5n2n2n1n = (reQ5nQ2nstarQ2nstarQ1nstar-reQ5nQ4nstarQ1nstar-2.*reQ5nQ3nstarQ2nstar-reQ4nQ2nstarQ2nstar
3549 - 2.*reQ3nQ2nstarQ1nstar+2.*(pow(dReQ5n,2.)+pow(dImQ5n,2.))+pow(dReQ4n,2.)+pow(dImQ4n,2.)
3550 + 2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+4.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3551 + 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-6.*dMult)
3552 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3553 four5n1n5n1n = (dQ5nQ1nQ5nstarQ1nstar-2.*reQ6nQ5nstarQ1nstar-2.*reQ5nQ4nstarQ1nstar
3554 + pow(dReQ6n,2.)+pow(dImQ6n,2.)-(dMult-4.)*(pow(dReQ5n,2.)+pow(dImQ5n,2.))
3555 + pow(dReQ4n,2.)+pow(dImQ4n,2.)-(dMult-4.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))+dMult*(dMult-6.))
3556 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3558 // TBI: Recursive formula needed:
3559 four6n4n1n1n = (reQ6nQ4nstarQ1nstarQ1nstar
3560 - dMult*(dMult-1.)*(dMult-2.)*(three2n1n1n+2.*three5n4n1n+2.*three6n5n1n+three6n4n2n)
3561 - dMult*(dMult-1.)*(2.*two1n1n+1.*two4n4n+1.*two6n6n+1.*two2n2n+2.*two5n5n)
3563 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3565 four6n2n2n2n = (reQ6nQ2nstarQ2nstarQ2nstar-3.*reQ6nQ4nstarQ2nstar-3.*reQ4nQ2nstarQ2nstar
3566 + 2.*(pow(dReQ6n,2.)+pow(dImQ6n,2.))+3.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
3567 + 6.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-6.*dMult)
3568 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3569 // Average 4-particle correlations for all events:
3570 fIntFlowCorrelationsAllPro->Fill(41.5,four6n3n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3571 fIntFlowCorrelationsAllPro->Fill(42.5,four3n2n3n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3572 fIntFlowCorrelationsAllPro->Fill(43.5,four4n1n3n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3573 fIntFlowCorrelationsAllPro->Fill(44.5,four3n3n3n3n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3574 //fIntFlowCorrelationsAllPro->Fill(45.5,four4n2n3n3n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)); // I already have this one above
3575 fIntFlowCorrelationsAllPro->Fill(46.5,four5n1n3n3n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3576 fIntFlowCorrelationsAllPro->Fill(47.5,four4n2n4n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3577 fIntFlowCorrelationsAllPro->Fill(48.5,four5n1n4n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3578 fIntFlowCorrelationsAllPro->Fill(49.5,four5n3n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3579 fIntFlowCorrelationsAllPro->Fill(50.5,four5n2n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3580 fIntFlowCorrelationsAllPro->Fill(51.5,four5n1n5n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3581 fIntFlowCorrelationsAllPro->Fill(58.5,four6n4n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3582 fIntFlowCorrelationsAllPro->Fill(59.5,four6n2n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3583 if(fCalculateAllCorrelationsVsM)
3585 fIntFlowCorrelationsAllVsMPro[41]->Fill(dMult+0.5,four6n3n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3586 fIntFlowCorrelationsAllVsMPro[42]->Fill(dMult+0.5,four3n2n3n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3587 fIntFlowCorrelationsAllVsMPro[43]->Fill(dMult+0.5,four4n1n3n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3588 fIntFlowCorrelationsAllVsMPro[44]->Fill(dMult+0.5,four3n3n3n3n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3589 //fIntFlowCorrelationsAllVsMPro[45]->Fill(dMult+0.5,four4n2n3n3n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3590 fIntFlowCorrelationsAllVsMPro[46]->Fill(dMult+0.5,four5n1n3n3n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3591 fIntFlowCorrelationsAllVsMPro[47]->Fill(dMult+0.5,four4n2n4n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3592 fIntFlowCorrelationsAllVsMPro[48]->Fill(dMult+0.5,four5n1n4n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3593 fIntFlowCorrelationsAllVsMPro[49]->Fill(dMult+0.5,four5n3n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3594 fIntFlowCorrelationsAllVsMPro[50]->Fill(dMult+0.5,four5n2n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3595 fIntFlowCorrelationsAllVsMPro[51]->Fill(dMult+0.5,four5n1n5n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3596 fIntFlowCorrelationsAllVsMPro[58]->Fill(dMult+0.5,four6n4n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3597 fIntFlowCorrelationsAllVsMPro[59]->Fill(dMult+0.5,four6n2n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3599 } // end of if(dMult>3)
3602 Double_t five3n3n3n2n1n = 0.; // <cos(n(3*phi1+3*phi2-3*phi3-2*phi4-1*phi5)>
3603 Double_t five4n2n3n2n1n = 0.; // <cos(n(4*phi1+2*phi2-3*phi3-2*phi4-1*phi5)>
3604 Double_t five3n2n3n1n1n = 0.; // <cos(n(3*phi1+2*phi2-3*phi3-1*phi4-1*phi5)>
3605 Double_t five3n2n2n2n1n = 0.; // <cos(n(3*phi1+2*phi2-2*phi3-2*phi4-1*phi5)>
3606 Double_t five5n1n3n2n1n = 0.; // <cos(n(5*phi1+1*phi2-3*phi3-2*phi4-1*phi5)>
3607 Double_t five6n2n2n1n1n = 0.; // <cos(n(6*phi1-2*phi2-2*phi3-1*phi4-1*phi5)>
3608 Double_t five4n1n1n3n3n = 0.; // <cos(n(4*phi1+1*phi2+1*phi3-3*phi4-3*phi5)>
3611 five3n3n3n2n1n = (reQ3nQ3nQ3nstarQ2nstarQ1nstar-reQ6nQ3nstarQ2nstarQ1nstar-reQ5nQ1nQ3nstarQ3nstar-reQ4nQ2nQ3nstarQ3nstar
3612 + reQ6nQ5nstarQ1nstar+reQ6nQ4nstarQ2nstar+3.*reQ6nQ3nstarQ3nstar+4.*reQ5nQ3nstarQ2nstar+4.*reQ4nQ3nstarQ1nstar
3613 - 2.*(dMult-6.)*reQ3nQ2nstarQ1nstar-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3614 - 2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3615 - 2.*(pow(dReQ6n,2.)+pow(dImQ6n,2.))-2.*(pow(dReQ5n,2.)+pow(dImQ5n,2.))
3616 - 2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+2.*(3.*dMult-10.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3617 - pow((pow(dReQ3n,2.)+pow(dImQ3n,2.)),2.)+2.*(dMult-5.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3618 + 2.*(dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-4.*dMult*(dMult-6.))
3619 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3620 five4n2n3n2n1n = (reQ4nQ2nQ3nstarQ2nstarQ1nstar-reQ6nQ3nstarQ2nstarQ1nstar-reQ5nQ1nQ4nstarQ2nstar
3621 - reQ4nQ2nQ3nstarQ3nstar-reQ4nQ1nQ3nstarQ2nstar-reQ4nQ2nstarQ1nstarQ1nstar
3622 - reQ3nQ1nQ2nstarQ2nstar-(pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3623 + 3.*reQ6nQ4nstarQ2nstar+reQ6nQ5nstarQ1nstar+reQ6nQ3nstarQ3nstar+reQ5nQ4nstarQ1nstar
3624 + 3.*reQ5nQ3nstarQ2nstar-(dMult-7.)*reQ4nQ3nstarQ1nstar+3.*reQ4nQ2nstarQ2nstar+7.*reQ3nQ2nstarQ1nstar
3625 + 4.*reQ2nQ1nstarQ1nstar-(pow(dReQ4n,2.)+pow(dImQ4n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3626 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3627 - 2.*(pow(dReQ6n,2.)+pow(dImQ6n,2.))-2.*(pow(dReQ5n,2.)+pow(dImQ5n,2.))
3628 + (dMult-8.)*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+(dMult-10.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3629 + 2.*(dMult-7.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))+(dMult-12.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3630 - 2.*dMult*(dMult-12.))
3631 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3632 five3n2n3n1n1n = (reQ3nQ2nQ3nstarQ1nstarQ1nstar-reQ5nQ3nstarQ1nstarQ1nstar-2.*reQ4nQ1nQ3nstarQ2nstar-reQ3nQ1nstarQ1nstarQ1nstar
3633 - 2.*reQ3nQ1nQ2nstarQ2nstar+2.*reQ5nQ4nstarQ1nstar+3.*reQ5nQ3nstarQ2nstar+6.*reQ4nQ3nstarQ1nstar
3634 + 2.*reQ4nQ2nstarQ2nstar+9.*reQ3nQ2nstarQ1nstar-(dMult-8.)*reQ2nQ1nstarQ1nstar
3635 - (pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3636 - 2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3637 - 2.*(pow(dReQ5n,2.)+pow(dImQ5n,2.))-4.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
3638 + 2.*(dMult-6.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+(dMult-12.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3639 + 2.*(dMult-9.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-2.*dMult*(dMult-12.))
3640 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3641 five3n2n2n2n1n = (reQ3nQ2nQ2nstarQ2nstarQ1nstar-reQ5nQ2nstarQ2nstarQ1nstar-reQ4nQ1nQ3nstarQ2nstar-reQ3nQ1nQ2nstarQ2nstar
3642 - 2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))+reQ5nQ4nstarQ1nstar
3643 + 4.*reQ5nQ3nstarQ2nstar+reQ4nQ3nstarQ1nstar+3.*reQ4nQ2nstarQ2nstar-2.*(dMult-6.)*reQ3nQ2nstarQ1nstar
3644 + 4.*reQ2nQ1nstarQ1nstar-2.*(pow(dReQ5n,2.)+pow(dImQ5n,2.))
3645 - 2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+2.*(dMult-5.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3646 - 2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3647 - pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)+2.*(3.*dMult-10.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3648 + 2.*(dMult-6.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-4.*dMult*(dMult-6.))
3649 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3650 five5n1n3n2n1n = (reQ5nQ1nQ3nstarQ2nstarQ1nstar-reQ6nQ3nstarQ2nstarQ1nstar-reQ5nQ1nQ4nstarQ2nstar-reQ5nQ1nQ3nstarQ3nstar
3651 - reQ4nQ1nQ3nstarQ2nstar-reQ5nQ3nstarQ1nstarQ1nstar-reQ5nQ2nstarQ2nstarQ1nstar
3652 + 3.*reQ6nQ5nstarQ1nstar+reQ6nQ4nstarQ2nstar+reQ6nQ3nstarQ3nstar+4.*reQ5nQ4nstarQ1nstar
3653 - (dMult-7.)*reQ5nQ3nstarQ2nstar+4.*reQ4nQ3nstarQ1nstar+reQ4nQ2nstarQ2nstar+6.*reQ3nQ2nstarQ1nstar
3654 + 3.*reQ2nQ1nstarQ1nstar-(pow(dReQ5n,2.)+pow(dImQ5n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3655 - (pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3656 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3657 - 2.*(pow(dReQ6n,2.)+pow(dImQ6n,2.))+(dMult-8.)*(pow(dReQ5n,2.)+pow(dImQ5n,2.))
3658 - 4.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+(dMult-10.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3659 + (dMult-10.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))+2.*(dMult-7.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3660 - 2.*dMult*(dMult-12.))
3661 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3663 // Peter Jochumzsen:
3664 five6n2n2n1n1n = (reQ6nQ2nstarQ2nstarQ1nstarQ1nstar
3665 - 12.*pow(dReQ1n,2.)-12.*pow(dImQ1n,2.)
3666 - 14.*pow(dReQ2n,2.)-14.*pow(dImQ2n,2.)
3667 - 8.*pow(dReQ3n,2.)-8.*pow(dImQ3n,2.)
3668 - 6.*pow(dReQ4n,2.)-6.*pow(dImQ4n,2.)
3669 - 4.*pow(dReQ5n,2.)-4.*pow(dImQ5n,2.)
3670 - 6.*pow(dReQ6n,2.)-6.*pow(dImQ6n,2.)
3671 + 2.*reQ2nQ1nstarQ1nstar + 8.*reQ3nQ2nstarQ1nstar
3672 + 5.*reQ6nQ4nstarQ2nstar - reQ6nQ4nstarQ1nstarQ1nstar
3673 + 2.*reQ6nQ3nstarQ3nstar - reQ6nQ2nstarQ2nstarQ2nstar
3674 + 4.*reQ4nQ2nstarQ2nstar - 2.*reQ4nQ2nstarQ1nstarQ1nstar
3675 + 2.*reQ5nQ4nstarQ1nstar - 2.*reQ5nQ2nstarQ2nstarQ1nstar
3676 + 4.*reQ4nQ3nstarQ1nstar + 4.*reQ5nQ3nstarQ2nstar
3677 + 4.*reQ6nQ5nstarQ1nstar - 4.*reQ6nQ3nstarQ2nstarQ1nstar + 24.*dMult)
3678 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3680 // Peter Jochumzsen:
3682 five4n1n1n3n3n = (reQ6nQ2nstarQ2nstarQ1nstarQ1nstar
3683 - 12.*pow(dReQ1n,2.)-12.*pow(dImQ1n,2.)
3684 - 14.*pow(dReQ2n,2.)-14.*pow(dImQ2n,2.)
3685 - 8.*pow(dReQ3n,2.)-8.*pow(dImQ3n,2.)
3686 - 6.*pow(dReQ4n,2.)-6.*pow(dImQ4n,2.)
3687 - 4.*pow(dReQ5n,2.)-4.*pow(dImQ5n,2.)
3688 - 6.*pow(dReQ6n,2.)-6.*pow(dImQ6n,2.)
3689 + 2.*reQ2nQ1nstarQ1nstar + 8.*reQ3nQ2nstarQ1nstar
3690 + 5.*reQ6nQ4nstarQ2nstar - reQ6nQ4nstarQ1nstarQ1nstar
3691 + 2.*reQ6nQ3nstarQ3nstar - reQ6nQ2nstarQ2nstarQ2nstar
3692 + 4.*reQ4nQ2nstarQ2nstar - 2.*reQ4nQ2nstarQ1nstarQ1nstar
3693 + 2.*reQ5nQ4nstarQ1nstar - 2.*reQ5nQ2nstarQ2nstarQ1nstar
3694 + 4.*reQ4nQ3nstarQ1nstar + 4.*reQ5nQ3nstarQ2nstar
3695 + 4.*reQ6nQ5nstarQ1nstar - 4.*reQ6nQ3nstarQ2nstarQ1nstar + 24.*dMult)
3696 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3699 // Average 5-particle correlations for all events:
3700 fIntFlowCorrelationsAllPro->Fill(52.5,five3n3n3n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3701 fIntFlowCorrelationsAllPro->Fill(53.5,five4n2n3n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3702 fIntFlowCorrelationsAllPro->Fill(54.5,five3n2n3n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3703 fIntFlowCorrelationsAllPro->Fill(55.5,five3n2n2n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3704 fIntFlowCorrelationsAllPro->Fill(56.5,five5n1n3n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3705 fIntFlowCorrelationsAllPro->Fill(60.5,five6n2n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3706 fIntFlowCorrelationsAllPro->Fill(61.5,five4n1n1n3n3n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3707 if(fCalculateAllCorrelationsVsM)
3709 fIntFlowCorrelationsAllVsMPro[52]->Fill(dMult+0.5,five3n3n3n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3710 fIntFlowCorrelationsAllVsMPro[53]->Fill(dMult+0.5,five4n2n3n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3711 fIntFlowCorrelationsAllVsMPro[54]->Fill(dMult+0.5,five3n2n3n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3712 fIntFlowCorrelationsAllVsMPro[55]->Fill(dMult+0.5,five3n2n2n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3713 fIntFlowCorrelationsAllVsMPro[56]->Fill(dMult+0.5,five5n1n3n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3714 fIntFlowCorrelationsAllVsMPro[60]->Fill(dMult+0.5,five6n2n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3715 fIntFlowCorrelationsAllVsMPro[61]->Fill(dMult+0.5,five4n1n1n3n3n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3717 } // end of if(dMult>4)
3720 Double_t six3n2n1n3n2n1n = 0.; // <cos(n(3*phi1+2*phi2+1*phi3-3*phi4-2*phi5-1*phi6)>
3721 Double_t six3n3n2n2n1n1n = 0.; // <cos(n(3*phi1+3*phi2-2*phi3-2*phi4-1*phi5-1*phi6)>
3724 six3n2n1n3n2n1n = (dQ3nQ2nQ1nQ3nstarQ2nstarQ1nstar-2.*reQ3nQ3nQ3nstarQ2nstarQ1nstar
3725 - 2.*reQ3nQ2nQ2nstarQ2nstarQ1nstar-2.*reQ3nQ1nQ2nstarQ1nstarQ1nstar
3726 - 2.*reQ3nQ2nQ3nstarQ1nstarQ1nstar-2.*reQ4nQ2nQ3nstarQ2nstarQ1nstar
3727 - 2.*reQ5nQ1nQ3nstarQ2nstarQ1nstar+4.*reQ6nQ3nstarQ2nstarQ1nstar
3728 + 2.*reQ5nQ1nQ4nstarQ2nstar+2.*reQ5nQ1nQ3nstarQ3nstar
3729 + 2.*reQ4nQ2nQ3nstarQ3nstar+6.*reQ4nQ1nQ3nstarQ2nstar
3730 + 2.*reQ5nQ3nstarQ1nstarQ1nstar+2.*reQ5nQ2nstarQ2nstarQ1nstar
3731 + 6.*reQ3nQ1nQ2nstarQ2nstar+2.*reQ4nQ2nstarQ1nstarQ1nstar
3732 - 4.*reQ6nQ5nstarQ1nstar-4.*reQ6nQ4nstarQ2nstar-6.*reQ5nQ4nstarQ1nstar
3733 - 4.*reQ6nQ3nstarQ3nstar+2.*(dMult-11.)*reQ5nQ3nstarQ2nstar
3734 + 2.*(dMult-13.)*reQ4nQ3nstarQ1nstar-8.*reQ4nQ2nstarQ2nstar
3735 + 2.*(5.*dMult-32.)*reQ3nQ2nstarQ1nstar+2.*reQ3nQ1nstarQ1nstarQ1nstar
3736 + 2.*(dMult-13.)*reQ2nQ1nstarQ1nstar
3737 - (dMult-10.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3738 + (pow(dReQ5n,2.)+pow(dImQ5n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3739 + (pow(dReQ4n,2.)+pow(dImQ4n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3740 - (dMult-11.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3741 - (dMult-10.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3742 + 4.*(pow(dReQ6n,2.)+pow(dImQ6n,2.))-(dMult-12.)*(pow(dReQ5n,2.)+pow(dImQ5n,2.))
3743 - (dMult-16.)*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+pow((pow(dReQ3n,2.)+pow(dImQ3n,2.)),2.)
3744 + (dMult*dMult-19.*dMult+68.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3745 + (dMult*dMult-19.*dMult+72.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3746 + pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)+pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
3747 + (dMult*dMult-20.*dMult+80.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3748 - dMult*(dMult-12.)*(dMult-10.))
3749 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3751 // Peter Jochumzsen:
3752 six3n3n2n2n1n1n = (reQ3nQ3nQ2nstarQ2nstarQ1nstarQ1nstar
3753 + (80.-16.*dMult)*pow(dReQ1n,2.)+(80.-16.*dMult)*pow(dImQ1n,2.)
3754 + (78.-16.*dMult)*pow(dReQ2n,2.)+(78.-16.*dMult)*pow(dImQ2n,2.)
3755 + (72.-16.*dMult)*pow(dReQ3n,2.)+(72.-16.*dMult)*pow(dImQ3n,2.)
3756 + 14.*pow(dReQ4n,2.)+14.*pow(dImQ4n,2.)
3757 + 8.*pow(dReQ5n,2.)+8.*pow(dImQ5n,2.)
3758 + 6.*pow(dReQ6n,2.)+6.*pow(dImQ6n,2.)
3759 + 1.*reQ6nQ2nstarQ2nstarQ2nstar - 1.*reQ6nQ2nstarQ2nstarQ1nstarQ1nstar
3760 - 76.*reQ3nQ2nstarQ1nstar + 4.*reQ3nQ1nstarQ1nstarQ1nstar
3761 - 8.*reQ3nQ2nstarQ1nstar + 8.*dQ2nQ1nQ2nstarQ1nstar
3762 + 4.*reQ5nQ2nstarQ2nstarQ1nstar - 2.*reQ6nQ3nstarQ3nstar
3763 + 4.*reQ6nQ3nstarQ2nstarQ1nstar - 4.*reQ5nQ4nstarQ1nstar
3764 + 16.*dMult*reQ3nQ2nstarQ1nstar - 2.*reQ4nQ2nstarQ2nstar
3765 - 4.*reQ3nQ3nQ3nstarQ2nstarQ1nstar -8.*reQ4nQ3nstarQ1nstar
3766 - 10.*reQ4nQ2nstarQ2nstar + 4.*reQ4nQ2nstarQ1nstarQ1nstar
3767 - 12.*reQ4nQ3nstarQ1nstar + 8.*dQ3nQ1nQ3nstarQ1nstar
3768 + 8.*reQ3nQ1nQ2nstarQ2nstar - 4.*reQ3nQ1nQ2nstarQ1nstarQ1nstar
3769 + 5.*reQ4nQ2nQ3nstarQ3nstar+2.*pow(pow(dReQ2n,2.)+pow(dImQ2n,2.),2.)
3770 + 4.*reQ5nQ1nQ3nstarQ3nstar+2.*pow(pow(dReQ3n,2.)+pow(dImQ3n,2.),2.)
3771 - 6.*reQ6nQ3nstarQ3nstar - 14.*reQ2nQ1nstarQ1nstar
3772 - 1.*reQ3nQ3nQ2nstarQ2nstarQ2nstar-4.*reQ3nQ2nQ2nstarQ2nstarQ1nstar
3773 - 1.*reQ4nQ1nQ1nQ3nstarQ3nstar-8.*reQ5nQ3nstarQ2nstar
3774 + 2.*pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),2.) - 10.*reQ2nQ1nstarQ1nstar
3775 - 4.*reQ6nQ5nstarQ1nstar-5.*reQ6nQ4nstarQ2nstar
3776 + 1.*reQ6nQ4nstarQ1nstarQ1nstar-8.*reQ5nQ3nstarQ2nstar
3777 + 4.*reQ4nQ1nQ3nstarQ2nstar+8.*dQ3nQ2nQ3nstarQ2nstar
3778 - 120.*dMult + 16.*dMult*dMult)
3779 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3781 // Average 6-particle correlations for all events:
3782 fIntFlowCorrelationsAllPro->Fill(57.5,six3n2n1n3n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3783 fIntFlowCorrelationsAllPro->Fill(62.5,six3n3n2n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3784 if(fCalculateAllCorrelationsVsM)
3786 fIntFlowCorrelationsAllVsMPro[57]->Fill(dMult+0.5,six3n2n1n3n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3787 fIntFlowCorrelationsAllVsMPro[62]->Fill(dMult+0.5,six3n3n2n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3789 } // end of if(dMult>5.)
3791 } // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelations()
3793 //================================================================================================================================
3795 void AliFlowAnalysisWithQCumulants::StorePhiDistributionForOneEvent(AliFlowEventSimple *anEvent)
3797 // Store phi distribution for one event to illustrate flow.
3799 if(fPhiDistributionForOneEvent->GetEntries()>0){return;} // store only phi distribution for one event
3801 Double_t vMin = fPhiDistributionForOneEventSettings[0];
3802 Double_t vMax = fPhiDistributionForOneEventSettings[1];
3803 Double_t refMultMin = fPhiDistributionForOneEventSettings[2];
3804 Double_t refMultMax = fPhiDistributionForOneEventSettings[3];
3807 Double_t cumulant4thEBE = fIntFlowCorrelationsEBE->GetBinContent(2)-2.*pow(fIntFlowCorrelationsEBE->GetBinContent(1),2.);
3808 if(cumulant4thEBE<0.)
3810 vEBE = pow(-1.*cumulant4thEBE,0.25);
3811 if((vEBE>vMin && vEBE<vMax) && (fReferenceMultiplicityEBE>refMultMin && fReferenceMultiplicityEBE<refMultMax))
3813 fPhiDistributionForOneEvent->SetTitle(Form("v_{%i} = %f",fHarmonic,vEBE));
3814 for(Int_t p=0;p<anEvent->NumberOfTracks();p++)
3816 if(anEvent->GetTrack(p)->InRPSelection())
3818 fPhiDistributionForOneEvent->Fill(anEvent->GetTrack(p)->Phi());
3820 } // end of for(Int_t p=0;p<anEvent->NumberOfTracks();p++)
3823 fPhiDistributionForOneEvent->SetTitle(Form("v_{%i} = %f, out of specified boundaries",fHarmonic,vEBE));
3826 } // end of if(cumulant4thEBE<0.)
3828 } // end of void AliFlowAnalysisWithQCumulants::StorePhiDistributionForOneEvent(AliFlowEventSimple *anEvent)
3830 //================================================================================================================================
3832 void AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrelations()
3834 // Calculate averages of products of correlations for integrated flow.
3837 Double_t dMult = (*fSpk)(0,0);
3841 for(Int_t ci1=1;ci1<4;ci1++)
3843 for(Int_t ci2=ci1+1;ci2<=4;ci2++)
3845 fIntFlowProductOfCorrelationsPro->Fill(0.5+counter,
3846 fIntFlowCorrelationsEBE->GetBinContent(ci1)*
3847 fIntFlowCorrelationsEBE->GetBinContent(ci2),
3848 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
3849 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
3850 // products versus multiplicity: // [0=<<2><4>>,1=<<2><6>>,2=<<2><8>>,3=<<4><6>>,4=<<4><8>>,5=<<6><8>>]
3851 if(fCalculateCumulantsVsM)
3853 fIntFlowProductOfCorrelationsVsMPro[counter]->Fill(dMult+0.5, // to be improved: dMult => sum of weights ?
3854 fIntFlowCorrelationsEBE->GetBinContent(ci1)*
3855 fIntFlowCorrelationsEBE->GetBinContent(ci2),
3856 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
3857 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
3858 } // end of if(fCalculateCumulantsVsM)
3863 } // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrelations()
3866 //================================================================================================================================
3869 void AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrectionTermsForNUA()
3871 // Calculate averages of products of correction terms for NUA.
3873 // a) Binning of fIntFlowProductOfCorrectionTermsForNUAPro is organized as follows:
3874 // 1st bin: <<2><cos(phi)>>
3875 // 2nd bin: <<2><sin(phi)>>
3876 // 3rd bin: <<cos(phi)><sin(phi)>>
3877 // 4th bin: <<2><cos(phi1+phi2)>>
3878 // 5th bin: <<2><sin(phi1+phi2)>>
3879 // 6th bin: <<2><cos(phi1-phi2-phi3)>>
3880 // 7th bin: <<2><sin(phi1-phi2-phi3)>>
3881 // 8th bin: <<4><cos(phi1)>>
3882 // 9th bin: <<4><sin(phi1)>>
3883 // 10th bin: <<4><cos(phi1+phi2)>>
3884 // 11th bin: <<4><sin(phi1+phi2)>>
3885 // 12th bin: <<4><cos(phi1-phi2-phi3)>>
3886 // 13th bin: <<4><sin(phi1-phi2-phi3)>>
3887 // 14th bin: <<cos(phi1)><cos(phi1+phi2)>>
3888 // 15th bin: <<cos(phi1)><sin(phi1+phi2)>>
3889 // 16th bin: <<cos(phi1)><cos(phi1-phi2-phi3)>>
3890 // 17th bin: <<cos(phi1)><sin(phi1-phi2-phi3)>>
3891 // 18th bin: <<sin(phi1)><cos(phi1+phi2)>>
3892 // 19th bin: <<sin(phi1)><sin(phi1+phi2)>>
3893 // 20th bin: <<sin(phi1)><cos(phi1-phi2-phi3)>>
3894 // 21st bin: <<sin(phi1)><sin(phi1-phi2-phi3)>>
3895 // 22nd bin: <<cos(phi1+phi2)><sin(phi1+phi2)>>
3896 // 23rd bin: <<cos(phi1+phi2)><cos(phi1-phi2-phi3)>>
3897 // 24th bin: <<cos(phi1+phi2)><sin(phi1-phi2-phi3)>>
3898 // 25th bin: <<sin(phi1+phi2)><cos(phi1-phi2-phi3)>>
3899 // 26th bin: <<sin(phi1+phi2)><sin(phi1-phi2-phi3)>>
3900 // 27th bin: <<cos(phi1-phi2-phi3)><sin(phi1-phi2-phi3)>>
3903 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(0.5,
3904 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1),
3905 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3906 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
3908 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(1.5,
3909 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1),
3910 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3911 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
3912 // <<cos(phi)><sin(phi)>>:
3913 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(2.5,
3914 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1),
3915 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
3916 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
3917 // <<2><cos(phi1+phi2)>>:
3918 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(3.5,
3919 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
3920 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3921 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
3922 // <<2><sin(phi1+phi2)>>:
3923 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(4.5,
3924 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
3925 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3926 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
3927 // <<2><cos(phi1-phi2-phi3)>>:
3928 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(5.5,
3929 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3930 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3931 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3932 // <<2><sin(phi1-phi2-phi3)>>:
3933 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(6.5,
3934 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3935 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3936 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3937 // <<4><cos(phi1)>>:
3938 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(7.5,
3939 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1),
3940 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3941 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
3942 // <<4><sin(phi1)>>:
3943 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(8.5,
3944 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1),
3945 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3946 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
3947 // <<4><cos(phi1+phi2)>>:
3948 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(9.5,
3949 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
3950 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3951 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
3952 // <<4><sin(phi1+phi2)>>:
3953 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(10.5,
3954 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
3955 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3956 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
3957 // <<4><cos(phi1-phi2-phi3)>>:
3958 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(11.5,
3959 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3960 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3961 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3962 // <<4><sin(phi1-phi2-phi3)>>:
3963 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(12.5,
3964 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3965 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3966 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3967 // <<cos(phi1)><cos(phi1+phi2)>>:
3968 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(13.5,
3969 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
3970 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
3971 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
3972 // <<cos(phi1)><sin(phi1+phi2)>>:
3973 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(14.5,
3974 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
3975 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
3976 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
3977 // <<cos(phi1)><cos(phi1-phi2-phi3)>>:
3978 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(15.5,
3979 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3980 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
3981 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3982 // <<cos(phi1)><sin(phi1-phi2-phi3)>>:
3983 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(16.5,
3984 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3985 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
3986 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3987 // <<sin(phi1)><cos(phi1+phi2)>>:
3988 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(17.5,
3989 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
3990 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
3991 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
3992 // <<sin(phi1)><sin(phi1+phi2)>>:
3993 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(18.5,
3994 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
3995 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
3996 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
3997 // <<sin(phi1)><cos(phi1-phi2-phi3)>>:
3998 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(19.5,
3999 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
4000 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
4001 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
4002 // <<sin(phi1)><sin(phi1-phi2-phi3)>>:
4003 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(20.5,
4004 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
4005 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
4006 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
4007 // <<cos(phi1+phi2)><sin(phi1+phi2)>>:
4008 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(21.5,
4009 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
4010 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)
4011 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
4012 // <<cos(phi1+phi2)><cos(phi1-phi2-phi3)>>:
4013 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(22.5,
4014 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
4015 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)
4016 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
4017 // <<cos(phi1+phi2)><sin(phi1-phi2-phi3)>>:
4018 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(23.5,
4019 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
4020 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)
4021 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
4022 // <<sin(phi1+phi2)><cos(phi1-phi2-phi3)>>:
4023 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(24.5,
4024 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
4025 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)
4026 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
4027 // <<sin(phi1+phi2)><sin(phi1-phi2-phi3)>>:
4028 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(25.5,
4029 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
4030 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)
4031 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
4032 // <<cos(phi1-phi2-phi3)><sin(phi1-phi2-phi3)>>:
4033 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(26.5,
4034 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
4035 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3)
4036 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
4038 } // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrectionTermsForNUA()
4040 //================================================================================================================================
4042 void AliFlowAnalysisWithQCumulants::CalculateCovariancesIntFlow()
4044 // a) Calculate unbiased estimators Cov(<2>,<4>), Cov(<2>,<6>), Cov(<2>,<8>), Cov(<4>,<6>), Cov(<4>,<8>) and Cov(<6>,<8>)
4045 // for covariances V_(<2>,<4>), V_(<2>,<6>), V_(<2>,<8>), V_(<4>,<6>), V_(<4>,<8>) and V_(<6>,<8>).
4046 // b) Store in histogram fIntFlowCovariances for instance the following:
4048 // Cov(<2>,<4>) * (sum_{i=1}^{N} w_{<2>}_i w_{<4>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<4>}_j)]
4050 // where N is the number of events, w_{<2>} is event weight for <2> and w_{<4>} is event weight for <4>.
4051 // c) Binning of fIntFlowCovariances is organized as follows:
4053 // 1st bin: Cov(<2>,<4>) * (sum_{i=1}^{N} w_{<2>}_i w_{<4>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<4>}_j)]
4054 // 2nd bin: Cov(<2>,<6>) * (sum_{i=1}^{N} w_{<2>}_i w_{<6>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<6>}_j)]
4055 // 3rd bin: Cov(<2>,<8>) * (sum_{i=1}^{N} w_{<2>}_i w_{<8>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<8>}_j)]
4056 // 4th bin: Cov(<4>,<6>) * (sum_{i=1}^{N} w_{<4>}_i w_{<6>}_i )/[(sum_{i=1}^{N} w_{<4>}_i) * (sum_{j=1}^{N} w_{<6>}_j)]
4057 // 5th bin: Cov(<4>,<8>) * (sum_{i=1}^{N} w_{<4>}_i w_{<8>}_i )/[(sum_{i=1}^{N} w_{<4>}_i) * (sum_{j=1}^{N} w_{<8>}_j)]
4058 // 6th bin: Cov(<6>,<8>) * (sum_{i=1}^{N} w_{<6>}_i w_{<8>}_i )/[(sum_{i=1}^{N} w_{<6>}_i) * (sum_{j=1}^{N} w_{<8>}_j)]
4061 // Average 2-, 4-, 6- and 8-particle correlations for all events:
4062 Double_t correlation[4] = {0.};
4063 for(Int_t ci=0;ci<4;ci++)
4065 correlation[ci] = fIntFlowCorrelationsPro->GetBinContent(ci+1);
4067 // Average products of 2-, 4-, 6- and 8-particle correlations:
4068 Double_t productOfCorrelations[4][4] = {{0.}};
4069 Int_t productOfCorrelationsLabel = 1;
4070 // Denominators in the expressions for the unbiased estimator for covariance:
4071 Double_t denominator[4][4] = {{0.}};
4072 Int_t sumOfProductOfEventWeightsLabel1 = 1;
4073 // Weight dependent prefactor which multiply unbiased estimators for covariances:
4074 Double_t wPrefactor[4][4] = {{0.}};
4075 Int_t sumOfProductOfEventWeightsLabel2 = 1;
4076 for(Int_t c1=0;c1<4;c1++)
4078 for(Int_t c2=c1+1;c2<4;c2++)
4080 productOfCorrelations[c1][c2] = fIntFlowProductOfCorrelationsPro->GetBinContent(productOfCorrelationsLabel);
4081 if(TMath::Abs(fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1)) > 1.e-44 && TMath::Abs(fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1)) > 1.e-44)
4083 denominator[c1][c2] = 1.-(fIntFlowSumOfProductOfEventWeights->GetBinContent(sumOfProductOfEventWeightsLabel1))
4084 / (fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1)
4085 * fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1));
4086 wPrefactor[c1][c2] = fIntFlowSumOfProductOfEventWeights->GetBinContent(sumOfProductOfEventWeightsLabel2)
4087 / (fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1)
4088 * fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1));
4090 productOfCorrelationsLabel++; // to be improved - do I need here all 3 counters?
4091 sumOfProductOfEventWeightsLabel1++;
4092 sumOfProductOfEventWeightsLabel2++;
4093 } // end of for(Int_t c2=c1+1;c2<4;c2++)
4094 } // end of for(Int_t c1=0;c1<4;c1++)
4096 Int_t covarianceLabel = 1;
4097 for(Int_t c1=0;c1<4;c1++)
4099 for(Int_t c2=c1+1;c2<4;c2++)
4101 if(TMath::Abs(denominator[c1][c2]) > 1.e-44)
4104 Double_t cov = (productOfCorrelations[c1][c2]-correlation[c1]*correlation[c2])/denominator[c1][c2];
4105 // Covariances multiplied with weight dependent prefactor:
4106 Double_t wCov = cov * wPrefactor[c1][c2];
4107 fIntFlowCovariances->SetBinContent(covarianceLabel,wCov);
4110 } // end of for(Int_t c2=c1+1;c2<4;c2++)
4111 } // end of for(Int_t c1=0;c1<4;c1++)
4113 // Versus multiplicity:
4114 if(!fCalculateCumulantsVsM){return;}
4115 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
4116 for(Int_t b=1;b<=nBins;b++)
4118 // Average 2-, 4-, 6- and 8-particle correlations for all events:
4119 Double_t correlationVsM[4] = {0.};
4120 for(Int_t ci=0;ci<4;ci++)
4122 correlationVsM[ci] = fIntFlowCorrelationsVsMPro[ci]->GetBinContent(b);
4123 } // end of for(Int_t ci=0;ci<4;ci++)
4124 // Average products of 2-, 4-, 6- and 8-particle correlations:
4125 Double_t productOfCorrelationsVsM[4][4] = {{0.}};
4126 Int_t productOfCorrelationsLabelVsM = 1;
4127 // Denominators in the expressions for the unbiased estimator for covariance:
4128 Double_t denominatorVsM[4][4] = {{0.}};
4129 Int_t sumOfProductOfEventWeightsLabel1VsM = 1;
4130 // Weight dependent prefactor which multiply unbiased estimators for covariances:
4131 Double_t wPrefactorVsM[4][4] = {{0.}};
4132 Int_t sumOfProductOfEventWeightsLabel2VsM = 1;
4133 for(Int_t c1=0;c1<4;c1++)
4135 for(Int_t c2=c1+1;c2<4;c2++)
4137 productOfCorrelationsVsM[c1][c2] = fIntFlowProductOfCorrelationsVsMPro[productOfCorrelationsLabelVsM-1]->GetBinContent(b);
4138 if(TMath::Abs(fIntFlowSumOfEventWeightsVsM[c1][0]->GetBinContent(b)) > 1.e-44 && TMath::Abs(fIntFlowSumOfEventWeightsVsM[c2][0]->GetBinContent(b)) > 1.e-44)
4140 denominatorVsM[c1][c2] = 1.-(fIntFlowSumOfProductOfEventWeightsVsM[sumOfProductOfEventWeightsLabel1VsM-1]->GetBinContent(b))
4141 / (fIntFlowSumOfEventWeightsVsM[c1][0]->GetBinContent(b)
4142 * fIntFlowSumOfEventWeightsVsM[c2][0]->GetBinContent(b));
4143 wPrefactorVsM[c1][c2] = fIntFlowSumOfProductOfEventWeightsVsM[sumOfProductOfEventWeightsLabel2VsM-1]->GetBinContent(b)
4144 / (fIntFlowSumOfEventWeightsVsM[c1][0]->GetBinContent(b)
4145 * fIntFlowSumOfEventWeightsVsM[c2][0]->GetBinContent(b));
4147 productOfCorrelationsLabelVsM++;
4148 sumOfProductOfEventWeightsLabel1VsM++;
4149 sumOfProductOfEventWeightsLabel2VsM++;
4150 } // end of for(Int_t c1=0;c1<4;c1++)
4151 } // end of for(Int_t c2=c1+1;c2<4;c2++)
4153 Int_t covarianceLabelVsM = 1;
4154 for(Int_t c1=0;c1<4;c1++)
4156 for(Int_t c2=c1+1;c2<4;c2++)
4158 if(TMath::Abs(denominatorVsM[c1][c2]) > 1.e-44)
4161 Double_t covVsM = (productOfCorrelationsVsM[c1][c2]-correlationVsM[c1]*correlationVsM[c2])/denominatorVsM[c1][c2];
4162 // Covariances multiplied with weight dependent prefactor:
4163 Double_t wCovVsM = covVsM * wPrefactorVsM[c1][c2];
4164 fIntFlowCovariancesVsM[covarianceLabelVsM-1]->SetBinContent(b,wCovVsM);
4166 covarianceLabelVsM++;
4167 } // end of for(Int_t c2=c1+1;c2<4;c2++)
4168 } // end of for(Int_t c1=0;c1<4;c1++)
4169 } // end of for(Int_t b=1;b<=nBins;b++)
4171 } // end of AliFlowAnalysisWithQCumulants::CalculateCovariancesIntFlow()
4173 //================================================================================================================================
4175 void AliFlowAnalysisWithQCumulants::CalculateCovariancesNUAIntFlow()
4177 // a) Calculate unbiased estimators Cov(*,*) for true covariances V_(*,*) for NUA terms.
4178 // b) Store in histogram fIntFlowCovariancesNUA for instance the following:
4180 // Cov(<2>,<cos(phi)>) * (sum_{i=1}^{N} w_{<2>}_i w_{<cos(phi)>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<cos(phi)>}_j)]
4182 // where N is the number of events, w_{<2>} is event weight for <2> and w_{<cos(phi)>} is event weight for <cos(phi)>.
4183 // c) Binning of fIntFlowCovariancesNUA is organized as follows:
4185 // 1st bin: Cov(<2>,<cos(phi)>) * (sum_{i=1}^{N} w_{<2>}_i w_{<cos(phi)>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<cos(phi)>}_j)]
4186 // 2nd bin: Cov(<2>,<sin(phi)>) * (sum_{i=1}^{N} w_{<2>}_i w_{<sin(phi)>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<sin(phi)>}_j)]
4187 // 3rd bin: Cov(<cos(phi)>,<sin(phi)>) * (sum_{i=1}^{N} w_{<cos(phi)>}_i w_{<sin(phi)>}_i )/[(sum_{i=1}^{N} w_{<cos(phi)>}_i) * (sum_{j=1}^{N} w_{<sin(phi)>}_j)]
4190 // Cov(<2>,<cos(phi)>):
4191 Double_t product1 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(1); // <<2><cos(phi)>>
4192 Double_t term1st1 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
4193 Double_t term2nd1 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi)>>
4194 Double_t sumOfW1st1 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
4195 Double_t sumOfW2nd1 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi)>}
4196 Double_t sumOfWW1 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(1); // W_{<2>} * W_{<cos(phi)>}
4197 // numerator in the expression for the the unbiased estimator for covariance:
4198 Double_t numerator1 = product1 - term1st1*term2nd1;
4199 // denominator in the expression for the the unbiased estimator for covariance:
4200 Double_t denominator1 = 0.;
4201 if(TMath::Abs(sumOfW1st1*sumOfW2nd1)>0.)
4203 denominator1 = 1.-sumOfWW1/(sumOfW1st1*sumOfW2nd1);
4204 if(TMath::Abs(denominator1)>0.)
4207 Double_t covariance1 = numerator1/denominator1;
4208 // weight dependent prefactor for covariance:
4209 Double_t wPrefactor1 = sumOfWW1/(sumOfW1st1*sumOfW2nd1);
4210 // finally, store "weighted" covariance:
4211 fIntFlowCovariancesNUA->SetBinContent(1,wPrefactor1*covariance1);
4212 } // end of if(TMath::Abs(denominator)>0.)
4213 } // end of if(TMath::Abs(sumOfW1st1*sumOfW2nd1)>0.)
4215 // Cov(<2>,<sin(phi)>):
4216 Double_t product2 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(2); // <<2><sin(phi)>>
4217 Double_t term1st2 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
4218 Double_t term2nd2 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi)>>
4219 Double_t sumOfW1st2 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
4220 Double_t sumOfW2nd2 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi)>}
4221 Double_t sumOfWW2 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(2); // W_{<2>} * W_{<sin(phi)>}
4222 // numerator in the expression for the the unbiased estimator for covariance:
4223 Double_t numerator2 = product2 - term1st2*term2nd2;
4224 // denominator in the expression for the the unbiased estimator for covariance:
4225 Double_t denominator2 = 0.;
4226 if(TMath::Abs(sumOfW1st2*sumOfW2nd2)>0.)
4228 denominator2 = 1.-sumOfWW2/(sumOfW1st2*sumOfW2nd2);
4229 if(TMath::Abs(denominator2)>0.)
4232 Double_t covariance2 = numerator2/denominator2;
4233 // weight dependent prefactor for covariance:
4234 Double_t wPrefactor2 = sumOfWW2/(sumOfW1st2*sumOfW2nd2);
4235 // finally, store "weighted" covariance:
4236 fIntFlowCovariancesNUA->SetBinContent(2,wPrefactor2*covariance2);
4237 } // end of if(TMath::Abs(denominator2)>0.)
4238 } // end of if(TMath::Abs(sumOfW1st2*sumOfW2nd2)>0.)
4240 // Cov(<cos(phi)>,<sin(phi)>):
4241 Double_t product3 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(3); // <<cos(phi)><sin(phi)>>
4242 Double_t term1st3 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi)>>
4243 Double_t term2nd3 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi)>>
4244 Double_t sumOfW1st3 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi)>}
4245 Double_t sumOfW2nd3 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi)>}
4246 Double_t sumOfWW3 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(3); // W_{<cos(phi)>} * W_{<sin(phi)>}
4247 // numerator in the expression for the the unbiased estimator for covariance:
4248 Double_t numerator3 = product3 - term1st3*term2nd3;
4249 // denominator in the expression for the the unbiased estimator for covariance:
4250 Double_t denominator3 = 0;
4251 if(TMath::Abs(sumOfW1st3*sumOfW2nd3)>0.)
4253 denominator3 = 1.-sumOfWW3/(sumOfW1st3*sumOfW2nd3);
4254 if(TMath::Abs(denominator3)>0.)
4257 Double_t covariance3 = numerator3/denominator3;
4258 // weight dependent prefactor for covariance:
4259 Double_t wPrefactor3 = sumOfWW3/(sumOfW1st3*sumOfW2nd3);
4260 // finally, store "weighted" covariance:
4261 fIntFlowCovariancesNUA->SetBinContent(3,wPrefactor3*covariance3);
4262 } // end of if(TMath::Abs(denominator3)>0.)
4263 } // end of if(TMath::Abs(sumOfW1st3*sumOfW2nd3)>0.)
4265 // Cov(<2>,<cos(phi1+phi2)>):
4266 Double_t product4 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(4); // <<2><cos(phi1+phi2)>>
4267 Double_t term1st4 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
4268 Double_t term2nd4 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
4269 Double_t sumOfW1st4 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
4270 Double_t sumOfW2nd4 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
4271 Double_t sumOfWW4 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(4); // W_{<2>} * W_{<cos(phi1+phi2)>}
4272 // numerator in the expression for the the unbiased estimator for covariance:
4273 Double_t numerator4 = product4 - term1st4*term2nd4;
4274 // denominator in the expression for the the unbiased estimator for covariance:
4275 Double_t denominator4 = 0.;
4276 if(TMath::Abs(sumOfW1st4*sumOfW2nd4)>0.)
4278 denominator4 = 1.-sumOfWW4/(sumOfW1st4*sumOfW2nd4);
4279 if(TMath::Abs(denominator4)>0.)
4282 Double_t covariance4 = numerator4/denominator4;
4283 // weight dependent prefactor for covariance:
4284 Double_t wPrefactor4 = sumOfWW4/(sumOfW1st4*sumOfW2nd4);
4285 // finally, store "weighted" covariance:
4286 fIntFlowCovariancesNUA->SetBinContent(4,wPrefactor4*covariance4);
4287 } // end of if(TMath::Abs(denominator4)>0.)
4288 } // end of if(TMath::Abs(sumOfW1st4*sumOfW2nd4)>0.)
4290 // Cov(<2>,<sin(phi1+phi2)>):
4291 Double_t product5 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(5); // <<2><sin(phi1+phi2)>>
4292 Double_t term1st5 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
4293 Double_t term2nd5 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
4294 Double_t sumOfW1st5 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
4295 Double_t sumOfW2nd5 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
4296 Double_t sumOfWW5 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(5); // W_{<2>} * W_{<sin(phi1+phi2)>}
4297 // numerator in the expression for the the unbiased estimator for covariance:
4298 Double_t numerator5 = product5 - term1st5*term2nd5;
4299 // denominator in the expression for the the unbiased estimator for covariance:
4300 Double_t denominator5 = 0.;
4301 if(TMath::Abs(sumOfW1st5*sumOfW2nd5)>0.)
4303 denominator5 = 1.-sumOfWW5/(sumOfW1st5*sumOfW2nd5);
4304 if(TMath::Abs(denominator5)>0.)
4307 Double_t covariance5 = numerator5/denominator5;
4308 // weight dependent prefactor for covariance:
4309 Double_t wPrefactor5 = sumOfWW5/(sumOfW1st5*sumOfW2nd5);
4310 // finally, store "weighted" covariance:
4311 fIntFlowCovariancesNUA->SetBinContent(5,wPrefactor5*covariance5);
4312 } // end of if(TMath::Abs(denominator5)>0.)
4313 } // end of if(TMath::Abs(sumOfW1st5*sumOfW2nd5)>0.)
4315 // Cov(<2>,<cos(phi1-phi2-phi3)>):
4316 Double_t product6 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(6); // <<2><cos(phi1-phi2-phi3)>>
4317 Double_t term1st6 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
4318 Double_t term2nd6 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
4319 Double_t sumOfW1st6 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
4320 Double_t sumOfW2nd6 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
4321 Double_t sumOfWW6 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(6); // W_{<2>} * W_{<cos(phi1-phi2-phi3)>}
4322 // numerator in the expression for the the unbiased estimator for covariance:
4323 Double_t numerator6 = product6 - term1st6*term2nd6;
4324 // denominator in the expression for the the unbiased estimator for covariance:
4325 Double_t denominator6 = 0.;
4326 if(TMath::Abs(sumOfW1st6*sumOfW2nd6)>0.)
4328 denominator6 = 1.-sumOfWW6/(sumOfW1st6*sumOfW2nd6);
4329 if(TMath::Abs(denominator6)>0.)
4332 Double_t covariance6 = numerator6/denominator6;
4333 // weight dependent prefactor for covariance:
4334 Double_t wPrefactor6 = sumOfWW6/(sumOfW1st6*sumOfW2nd6);
4335 // finally, store "weighted" covariance:
4336 fIntFlowCovariancesNUA->SetBinContent(6,wPrefactor6*covariance6);
4337 } // end of if(TMath::Abs(denominator6)>0.)
4338 } // end of if(TMath::Abs(sumOfW1st6*sumOfW2nd6)>0.)
4340 // Cov(<2>,<sin(phi1-phi2-phi3)>):
4341 Double_t product7 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(7); // <<2><sin(phi1-phi2-phi3)>>
4342 Double_t term1st7 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
4343 Double_t term2nd7 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
4344 Double_t sumOfW1st7 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
4345 Double_t sumOfW2nd7 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
4346 Double_t sumOfWW7 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(7); // W_{<2>} * W_{<sin(phi1-phi2-phi3)>}
4347 // numerator in the expression for the the unbiased estimator for covariance:
4348 Double_t numerator7 = product7 - term1st7*term2nd7;
4349 // denominator in the expression for the the unbiased estimator for covariance:
4350 Double_t denominator7 = 0.;
4351 if(TMath::Abs(sumOfW1st7*sumOfW2nd7)>0.)
4353 denominator7 = 1.-sumOfWW7/(sumOfW1st7*sumOfW2nd7);
4354 if(TMath::Abs(denominator7)>0.)
4357 Double_t covariance7 = numerator7/denominator7;
4358 // weight dependent prefactor for covariance:
4359 Double_t wPrefactor7 = sumOfWW7/(sumOfW1st7*sumOfW2nd7);
4360 // finally, store "weighted" covariance:
4361 fIntFlowCovariancesNUA->SetBinContent(7,wPrefactor7*covariance7);
4362 } // end of if(TMath::Abs(denominator7)>0.)
4363 } // end of if(TMath::Abs(sumOfW1st7*sumOfW2nd7)>0.)
4365 // Cov(<4>,<cos(phi1>):
4366 Double_t product8 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(8); // <<4><cos(phi1)>>
4367 Double_t term1st8 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
4368 Double_t term2nd8 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
4369 Double_t sumOfW1st8 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
4370 Double_t sumOfW2nd8 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
4371 Double_t sumOfWW8 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(8); // W_{<4>} * W_{<cos(phi1)>}
4372 // numerator in the expression for the the unbiased estimator for covariance:
4373 Double_t numerator8 = product8 - term1st8*term2nd8;
4374 // denominator in the expression for the the unbiased estimator for covariance:
4375 Double_t denominator8 = 0.;
4376 if(TMath::Abs(sumOfW1st8*sumOfW2nd8)>0.)
4378 denominator8 = 1.-sumOfWW8/(sumOfW1st8*sumOfW2nd8);
4379 if(TMath::Abs(denominator8)>0.)
4382 Double_t covariance8 = numerator8/denominator8;
4383 // weight dependent prefactor for covariance:
4384 Double_t wPrefactor8 = sumOfWW8/(sumOfW1st8*sumOfW2nd8);
4385 // finally, store "weighted" covariance:
4386 fIntFlowCovariancesNUA->SetBinContent(8,wPrefactor8*covariance8);
4387 } // end of if(TMath::Abs(denominator8)>0.)
4388 } // end of if(TMath::Abs(sumOfW1st8*sumOfW2nd8)>0.)
4390 // Cov(<4>,<sin(phi1)>):
4391 Double_t product9 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(9); // <<4><sin(phi1)>>
4392 Double_t term1st9 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
4393 Double_t term2nd9 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
4394 Double_t sumOfW1st9 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
4395 Double_t sumOfW2nd9 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
4396 Double_t sumOfWW9 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(9); // W_{<4>} * W_{<sin(phi1)>}
4397 // numerator in the expression for the the unbiased estimator for covariance:
4398 Double_t numerator9 = product9 - term1st9*term2nd9;
4399 // denominator in the expression for the the unbiased estimator for covariance:
4400 Double_t denominator9 = 0.;
4401 if(TMath::Abs(sumOfW1st9*sumOfW2nd9)>0.)
4403 denominator9 = 1.-sumOfWW9/(sumOfW1st9*sumOfW2nd9);
4404 if(TMath::Abs(denominator9)>0.)
4407 Double_t covariance9 = numerator9/denominator9;
4408 // weight dependent prefactor for covariance:
4409 Double_t wPrefactor9 = sumOfWW9/(sumOfW1st9*sumOfW2nd9);
4410 // finally, store "weighted" covariance:
4411 fIntFlowCovariancesNUA->SetBinContent(9,wPrefactor9*covariance9);
4413 } // end of if(TMath::Abs(sumOfW1st9*sumOfW2nd9)>0.)
4415 // Cov(<4>,<cos(phi1+phi2)>):
4416 Double_t product10 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(10); // <<4><cos(phi1+phi2)>>
4417 Double_t term1st10 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
4418 Double_t term2nd10 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
4419 Double_t sumOfW1st10 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
4420 Double_t sumOfW2nd10 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
4421 Double_t sumOfWW10 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(10); // W_{<4>} * W_{<cos(phi1+phi2)>}
4422 // numerator in the expression for the the unbiased estimator for covariance:
4423 Double_t numerator10 = product10 - term1st10*term2nd10;
4424 // denominator in the expression for the the unbiased estimator for covariance:
4425 Double_t denominator10 = 0.;
4426 if(TMath::Abs(sumOfW1st10*sumOfW2nd10)>0.)
4428 denominator10 = 1.-sumOfWW10/(sumOfW1st10*sumOfW2nd10);
4429 if(TMath::Abs(denominator10)>0.)
4432 Double_t covariance10 = numerator10/denominator10;
4433 // weight dependent prefactor for covariance:
4434 Double_t wPrefactor10 = sumOfWW10/(sumOfW1st10*sumOfW2nd10);
4435 // finally, store "weighted" covariance:
4436 fIntFlowCovariancesNUA->SetBinContent(10,wPrefactor10*covariance10);
4437 } // end of if(TMath::Abs(denominator10)>0.)
4438 } // end of if(TMath::Abs(sumOfW1st10*sumOfW2nd10)>0.)
4440 // Cov(<4>,<sin(phi1+phi2)>):
4441 Double_t product11 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(11); // <<4><sin(phi1+phi2)>>
4442 Double_t term1st11 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
4443 Double_t term2nd11 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
4444 Double_t sumOfW1st11 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
4445 Double_t sumOfW2nd11 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
4446 Double_t sumOfWW11 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(11); // W_{<4>} * W_{<sin(phi1+phi2)>}
4447 // numerator in the expression for the the unbiased estimator for covariance:
4448 Double_t numerator11 = product11 - term1st11*term2nd11;
4449 // denominator in the expression for the the unbiased estimator for covariance:
4450 Double_t denominator11 = 0.;
4451 if(TMath::Abs(sumOfW1st11*sumOfW2nd11)>0.)
4453 denominator11 = 1.-sumOfWW11/(sumOfW1st11*sumOfW2nd11);
4454 if(TMath::Abs(denominator11)>0.)
4457 Double_t covariance11 = numerator11/denominator11;
4458 // weight dependent prefactor for covariance:
4459 Double_t wPrefactor11 = sumOfWW11/(sumOfW1st11*sumOfW2nd11);
4460 // finally, store "weighted" covariance:
4461 fIntFlowCovariancesNUA->SetBinContent(11,wPrefactor11*covariance11);
4462 } // end of if(TMath::Abs(denominator11)>0.)
4463 } // end of if(TMath::Abs(sumOfW1st11*sumOfW2nd11)>0.)
4465 // Cov(<4>,<cos(phi1-phi2-phi3)>):
4466 Double_t product12 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(12); // <<4><cos(phi1-phi2-phi3)>>
4467 Double_t term1st12 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
4468 Double_t term2nd12 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
4469 Double_t sumOfW1st12 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
4470 Double_t sumOfW2nd12 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
4471 Double_t sumOfWW12 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(12); // W_{<4>} * W_{<cos(phi1-phi2-phi3)>}
4472 // numerator in the expression for the the unbiased estimator for covariance:
4473 Double_t numerator12 = product12 - term1st12*term2nd12;
4474 // denominator in the expression for the the unbiased estimator for covariance:
4475 Double_t denominator12 = 0.;
4476 if(TMath::Abs(sumOfW1st12*sumOfW2nd12)>0.)
4478 denominator12 = 1.-sumOfWW12/(sumOfW1st12*sumOfW2nd12);
4479 if(TMath::Abs(denominator12)>0.)
4482 Double_t covariance12 = numerator12/denominator12;
4483 // weight dependent prefactor for covariance:
4484 Double_t wPrefactor12 = sumOfWW12/(sumOfW1st12*sumOfW2nd12);
4485 // finally, store "weighted" covariance:
4486 fIntFlowCovariancesNUA->SetBinContent(12,wPrefactor12*covariance12);
4487 } // end of if(TMath::Abs(denominator12)>0.)
4488 } // end of if(TMath::Abs(sumOfW1st12*sumOfW2nd12)>0.)
4490 // Cov(<4>,<sin(phi1-phi2-phi3)>):
4491 Double_t product13 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(13); // <<4><sin(phi1-phi2-phi3)>>
4492 Double_t term1st13 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
4493 Double_t term2nd13 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
4494 Double_t sumOfW1st13 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
4495 Double_t sumOfW2nd13 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
4496 Double_t sumOfWW13 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(13); // W_{<4>} * W_{<sin(phi1-phi2-phi3)>}
4497 // numerator in the expression for the the unbiased estimator for covariance:
4498 Double_t numerator13 = product13 - term1st13*term2nd13;
4499 // denominator in the expression for the the unbiased estimator for covariance:
4500 Double_t denominator13 = 0.;
4501 if(TMath::Abs(sumOfW1st13*sumOfW2nd13)>0.)
4503 denominator13 = 1.-sumOfWW13/(sumOfW1st13*sumOfW2nd13);
4504 if(TMath::Abs(denominator13)>0.)
4507 Double_t covariance13 = numerator13/denominator13;
4508 // weight dependent prefactor for covariance:
4509 Double_t wPrefactor13 = sumOfWW13/(sumOfW1st13*sumOfW2nd13);
4510 // finally, store "weighted" covariance:
4511 fIntFlowCovariancesNUA->SetBinContent(13,wPrefactor13*covariance13);
4512 } // end of if(TMath::Abs(denominator13)>0.)
4513 } // end of if(TMath::Abs(sumOfW1st13*sumOfW2nd13)>0.)
4515 // Cov(<cos(phi1)>,<cos(phi1+phi2)>):
4516 Double_t product14 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(14); // <<cos(phi1)><cos(phi1+phi2)>>
4517 Double_t term1st14 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
4518 Double_t term2nd14 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
4519 Double_t sumOfW1st14 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
4520 Double_t sumOfW2nd14 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
4521 Double_t sumOfWW14 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(14); // W_{<cos(phi1)>} * W_{<cos(phi1+phi2)>}
4522 // numerator in the expression for the the unbiased estimator for covariance:
4523 Double_t numerator14 = product14 - term1st14*term2nd14;
4524 // denominator in the expression for the the unbiased estimator for covariance:
4525 Double_t denominator14 = 0.;
4526 if(TMath::Abs(sumOfW1st14*sumOfW2nd14)>0.)
4528 denominator14 = 1.-sumOfWW14/(sumOfW1st14*sumOfW2nd14);
4529 if(TMath::Abs(denominator14)>0.)
4532 Double_t covariance14 = numerator14/denominator14;
4533 // weight dependent prefactor for covariance:
4534 Double_t wPrefactor14 = sumOfWW14/(sumOfW1st14*sumOfW2nd14);
4535 // finally, store "weighted" covariance:
4536 fIntFlowCovariancesNUA->SetBinContent(14,wPrefactor14*covariance14);
4537 } // end of if(TMath::Abs(denominator14)>0.)
4538 } // end of if(TMath::Abs(sumOfW1st14*sumOfW2nd14)>0.)
4540 // Cov(<cos(phi1)>,<sin(phi1+phi2)>):
4541 Double_t product15 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(15); // <<cos(phi1)><sin(phi1+phi2)>>
4542 Double_t term1st15 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
4543 Double_t term2nd15 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
4544 Double_t sumOfW1st15 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
4545 Double_t sumOfW2nd15 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
4546 Double_t sumOfWW15 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(15); // W_{<cos(phi1)>} * W_{<sin(phi1+phi2)>}
4547 // numerator in the expression for the the unbiased estimator for covariance:
4548 Double_t numerator15 = product15 - term1st15*term2nd15;
4549 // denominator in the expression for the the unbiased estimator for covariance:
4550 Double_t denominator15 = 0.;
4551 if(TMath::Abs(sumOfW1st15*sumOfW2nd15)>0.)
4553 denominator15 = 1.-sumOfWW15/(sumOfW1st15*sumOfW2nd15);
4554 if(TMath::Abs(denominator15)>0.)
4557 Double_t covariance15 = numerator15/denominator15;
4558 // weight dependent prefactor for covariance:
4559 Double_t wPrefactor15 = sumOfWW15/(sumOfW1st15*sumOfW2nd15);
4560 // finally, store "weighted" covariance:
4561 fIntFlowCovariancesNUA->SetBinContent(15,wPrefactor15*covariance15);
4562 } // end of if(TMath::Abs(denominator15)>0.)
4563 } // end of if(TMath::Abs(sumOfW1st15*sumOfW2nd15)>0.)
4565 // Cov(<cos(phi1)>,<cos(phi1-phi2-phi3)>):
4566 Double_t product16 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(16); // <<cos(phi1)><cos(phi1-phi2-phi3)>>
4567 Double_t term1st16 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
4568 Double_t term2nd16 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
4569 Double_t sumOfW1st16 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
4570 Double_t sumOfW2nd16 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
4571 Double_t sumOfWW16 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(16); // W_{<cos(phi1)>} * W_{<cos(phi1-phi2-phi3)>}
4572 // numerator in the expression for the the unbiased estimator for covariance:
4573 Double_t numerator16 = product16 - term1st16*term2nd16;
4574 // denominator in the expression for the the unbiased estimator for covariance:
4575 Double_t denominator16 = 0.;
4576 if(TMath::Abs(sumOfW1st16*sumOfW2nd16)>0.)
4578 denominator16 = 1.-sumOfWW16/(sumOfW1st16*sumOfW2nd16);
4579 if(TMath::Abs(denominator16)>0.)
4582 Double_t covariance16 = numerator16/denominator16;
4583 // weight dependent prefactor for covariance:
4584 Double_t wPrefactor16 = sumOfWW16/(sumOfW1st16*sumOfW2nd16);
4585 // finally, store "weighted" covariance:
4586 fIntFlowCovariancesNUA->SetBinContent(16,wPrefactor16*covariance16);
4587 } // end of if(TMath::Abs(denominator16)>0.)
4588 } // end ofif(TMath::Abs(sumOfW1st16*sumOfW2nd16)>0.)
4590 // Cov(<cos(phi1)>,<sin(phi1-phi2-phi3)>):
4591 Double_t product17 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(17); // <<cos(phi1)><sin(phi1-phi2-phi3)>>
4592 Double_t term1st17 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
4593 Double_t term2nd17 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
4594 Double_t sumOfW1st17 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
4595 Double_t sumOfW2nd17 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
4596 Double_t sumOfWW17 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(17); // W_{<cos(phi1)>} * W_{<sin(phi1-phi2-phi3)>}
4597 // numerator in the expression for the the unbiased estimator for covariance:
4598 Double_t numerator17 = product17 - term1st17*term2nd17;
4599 // denominator in the expression for the the unbiased estimator for covariance:
4600 Double_t denominator17 = 0.;
4601 if(TMath::Abs(sumOfW1st17*sumOfW2nd17)>0.)
4603 denominator17 = 1.-sumOfWW17/(sumOfW1st17*sumOfW2nd17);
4604 if(TMath::Abs(denominator17)>0.)
4607 Double_t covariance17 = numerator17/denominator17;
4608 // weight dependent prefactor for covariance:
4609 Double_t wPrefactor17 = sumOfWW17/(sumOfW1st17*sumOfW2nd17);
4610 // finally, store "weighted" covariance:
4611 fIntFlowCovariancesNUA->SetBinContent(17,wPrefactor17*covariance17);
4612 } // end of if(TMath::Abs(denominator17)>0.)
4613 } // end of if(TMath::Abs(sumOfW1st17*sumOfW2nd17)>0.)
4615 // Cov(<sin(phi1)>,<cos(phi1+phi2)>):
4616 Double_t product18 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(18); // <<sin(phi1)><cos(phi1+phi2)>>
4617 Double_t term1st18 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
4618 Double_t term2nd18 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
4619 Double_t sumOfW1st18 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
4620 Double_t sumOfW2nd18 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
4621 Double_t sumOfWW18 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(18); // W_{<sin(phi1)>} * W_{<cos(phi1+phi2)>}
4622 // numerator in the expression for the the unbiased estimator for covariance:
4623 Double_t numerator18 = product18 - term1st18*term2nd18;
4624 // denominator in the expression for the the unbiased estimator for covariance:
4625 Double_t denominator18 = 0.;
4626 if(TMath::Abs(sumOfW1st18*sumOfW2nd18)>0.)
4628 denominator18 = 1.-sumOfWW18/(sumOfW1st18*sumOfW2nd18);
4629 if(TMath::Abs(denominator18)>0.)
4632 Double_t covariance18 = numerator18/denominator18;
4633 // weight dependent prefactor for covariance:
4634 Double_t wPrefactor18 = sumOfWW18/(sumOfW1st18*sumOfW2nd18);
4635 // finally, store "weighted" covariance:
4636 fIntFlowCovariancesNUA->SetBinContent(18,wPrefactor18*covariance18);
4637 } // end of if(TMath::Abs(denominator18)>0.)
4638 } // end of if(TMath::Abs(sumOfW1st18*sumOfW2nd18)>0.)
4640 // Cov(<sin(phi1)>,<sin(phi1+phi2)>):
4641 Double_t product19 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(19); // <<sin(phi1)><sin(phi1+phi2)>>
4642 Double_t term1st19 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
4643 Double_t term2nd19 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
4644 Double_t sumOfW1st19 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
4645 Double_t sumOfW2nd19 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
4646 Double_t sumOfWW19 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(19); // W_{<sin(phi1)>} * W_{<sin(phi1+phi2)>}
4647 // numerator in the expression for the the unbiased estimator for covariance:
4648 Double_t numerator19 = product19 - term1st19*term2nd19;
4649 // denominator in the expression for the the unbiased estimator for covariance:
4650 Double_t denominator19 = 0.;
4651 if(TMath::Abs(sumOfW1st19*sumOfW2nd19)>0.)
4653 denominator19 = 1.-sumOfWW19/(sumOfW1st19*sumOfW2nd19);
4654 if(TMath::Abs(denominator19)>0.)
4657 Double_t covariance19 = numerator19/denominator19;
4658 // weight dependent prefactor for covariance:
4659 Double_t wPrefactor19 = sumOfWW19/(sumOfW1st19*sumOfW2nd19);
4660 // finally, store "weighted" covariance:
4661 fIntFlowCovariancesNUA->SetBinContent(19,wPrefactor19*covariance19);
4662 } // end of if(TMath::Abs(denominator19)>0.)
4663 } // end of if(TMath::Abs(sumOfW1st19*sumOfW2nd19)>0.)
4665 // Cov(<sin(phi1)>,<cos(phi1-phi2-phi3)>):
4666 Double_t product20 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(20); // <<sin(phi1)><cos(phi1-phi2-phi3)>>
4667 Double_t term1st20 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
4668 Double_t term2nd20 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
4669 Double_t sumOfW1st20 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
4670 Double_t sumOfW2nd20 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
4671 Double_t sumOfWW20 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(20); // W_{<sin(phi1)>} * W_{<cos(phi1-phi2-phi3)>}
4672 // numerator in the expression for the the unbiased estimator for covariance:
4673 Double_t numerator20 = product20 - term1st20*term2nd20;
4674 // denominator in the expression for the the unbiased estimator for covariance:
4675 Double_t denominator20 = 0.;
4676 if(TMath::Abs(sumOfW1st20*sumOfW2nd20)>0.)
4678 denominator20 = 1.-sumOfWW20/(sumOfW1st20*sumOfW2nd20);
4679 if(TMath::Abs(denominator20)>0.)
4682 Double_t covariance20 = numerator20/denominator20;
4683 // weight dependent prefactor for covariance:
4684 Double_t wPrefactor20 = sumOfWW20/(sumOfW1st20*sumOfW2nd20);
4685 // finally, store "weighted" covariance:
4686 fIntFlowCovariancesNUA->SetBinContent(20,wPrefactor20*covariance20);
4687 } // end of if(TMath::Abs(denominator20)>0.)
4688 } // end of if(TMath::Abs(sumOfW1st20*sumOfW2nd20)>0.)
4690 // Cov(<sin(phi1)>,<sin(phi1-phi2-phi3)>):
4691 Double_t product21 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(21); // <<sin(phi1)><sin(phi1-phi2-phi3)>>
4692 Double_t term1st21 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
4693 Double_t term2nd21 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
4694 Double_t sumOfW1st21 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
4695 Double_t sumOfW2nd21 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
4696 Double_t sumOfWW21 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(21); // W_{<sin(phi1)>} * W_{<sin(phi1-phi2-phi3)>}
4697 // numerator in the expression for the the unbiased estimator for covariance:
4698 Double_t numerator21 = product21 - term1st21*term2nd21;
4699 // denominator in the expression for the the unbiased estimator for covariance:
4700 Double_t denominator21 = 0.;
4701 if(TMath::Abs(sumOfW1st21*sumOfW2nd21)>0.)
4703 denominator21 = 1.-sumOfWW21/(sumOfW1st21*sumOfW2nd21);
4704 if(TMath::Abs(denominator21)>0.)
4707 Double_t covariance21 = numerator21/denominator21;
4708 // weight dependent prefactor for covariance:
4709 Double_t wPrefactor21 = sumOfWW21/(sumOfW1st21*sumOfW2nd21);
4710 // finally, store "weighted" covariance:
4711 fIntFlowCovariancesNUA->SetBinContent(21,wPrefactor21*covariance21);
4712 } // end of if(TMath::Abs(denominator21)>0.)
4713 } // end of if(TMath::Abs(sumOfW1st21*sumOfW2nd21)>0.)
4715 // Cov(<cos(phi1+phi2)>,<sin(phi1+phi2)>):
4716 Double_t product22 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(22); // <<cos(phi1+phi2)><sin(phi1+phi2)>>
4717 Double_t term1st22 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
4718 Double_t term2nd22 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
4719 Double_t sumOfW1st22 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
4720 Double_t sumOfW2nd22 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
4721 Double_t sumOfWW22 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(22); // W_{<cos(phi1+phi2)>} * W_{<sin(phi1+phi2)>}
4722 // numerator in the expression for the the unbiased estimator for covariance:
4723 Double_t numerator22 = product22 - term1st22*term2nd22;
4724 // denominator in the expression for the the unbiased estimator for covariance:
4725 Double_t denominator22 = 0.;
4726 if(TMath::Abs(sumOfW1st22*sumOfW2nd22)>0.)
4728 denominator22 = 1.-sumOfWW22/(sumOfW1st22*sumOfW2nd22);
4729 if(TMath::Abs(denominator22)>0.)
4732 Double_t covariance22 = numerator22/denominator22;
4733 // weight dependent prefactor for covariance:
4734 Double_t wPrefactor22 = sumOfWW22/(sumOfW1st22*sumOfW2nd22);
4735 // finally, store "weighted" covariance:
4736 fIntFlowCovariancesNUA->SetBinContent(22,wPrefactor22*covariance22);
4737 } // end of if(TMath::Abs(denominator22)>0.)
4738 } // end of if(TMath::Abs(sumOfW1st22*sumOfW2nd22)>0.)
4740 // Cov(<cos(phi1+phi2)>,<cos(phi1-phi2-phi3)>):
4741 Double_t product23 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(23); // <<cos(phi1+phi2)><cos(phi1-phi2-phi3)>>
4742 Double_t term1st23 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
4743 Double_t term2nd23 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
4744 Double_t sumOfW1st23 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
4745 Double_t sumOfW2nd23 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
4746 Double_t sumOfWW23 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(23); // W_{<cos(phi1+phi2)>} * W_{<cos(phi1-phi2-phi3)>}
4747 // numerator in the expression for the the unbiased estimator for covariance:
4748 Double_t numerator23 = product23 - term1st23*term2nd23;
4749 // denominator in the expression for the the unbiased estimator for covariance:
4750 Double_t denominator23 = 0.;
4751 if(TMath::Abs(sumOfW1st23*sumOfW2nd23)>0.)
4753 denominator23 = 1.-sumOfWW23/(sumOfW1st23*sumOfW2nd23);
4754 if(TMath::Abs(denominator23)>0.)
4757 Double_t covariance23 = numerator23/denominator23;
4758 // weight dependent prefactor for covariance:
4759 Double_t wPrefactor23 = sumOfWW23/(sumOfW1st23*sumOfW2nd23);
4760 // finally, store "weighted" covariance:
4761 fIntFlowCovariancesNUA->SetBinContent(23,wPrefactor23*covariance23);
4762 } // end of if(TMath::Abs(denominator23)>0.)
4763 } // end of if(TMath::Abs(sumOfW1st23*sumOfW2nd23)>0.)
4765 // Cov(<cos(phi1+phi2)>,<sin(phi1-phi2-phi3)>):
4766 Double_t product24 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(24); // <<cos(phi1+phi2)><sin(phi1-phi2-phi3)>>
4767 Double_t term1st24 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
4768 Double_t term2nd24 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
4769 Double_t sumOfW1st24 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
4770 Double_t sumOfW2nd24 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
4771 Double_t sumOfWW24 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(24); // W_{<cos(phi1+phi2)>} * W_{<sin(phi1-phi2-phi3)>}
4772 // numerator in the expression for the the unbiased estimator for covariance:
4773 Double_t numerator24 = product24 - term1st24*term2nd24;
4774 // denominator in the expression for the the unbiased estimator for covariance:
4775 Double_t denominator24 = 0.;
4776 if(TMath::Abs(sumOfW1st24*sumOfW2nd24)>0.)
4778 denominator24 = 1.-sumOfWW24/(sumOfW1st24*sumOfW2nd24);
4779 if(TMath::Abs(denominator24)>0.)
4782 Double_t covariance24 = numerator24/denominator24;
4783 // weight dependent prefactor for covariance:
4784 Double_t wPrefactor24 = sumOfWW24/(sumOfW1st24*sumOfW2nd24);
4785 // finally, store "weighted" covariance:
4786 fIntFlowCovariancesNUA->SetBinContent(24,wPrefactor24*covariance24);
4787 } // end of if(TMath::Abs(denominator24)>0.)
4788 } // end of if(TMath::Abs(sumOfW1st24*sumOfW2nd24)>0.)
4790 // Cov(<sin(phi1+phi2)>,<cos(phi1-phi2-phi3)>):
4791 Double_t product25 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(25); // <<sin(phi1+phi2)><cos(phi1-phi2-phi3)>>
4792 Double_t term1st25 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
4793 Double_t term2nd25 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
4794 Double_t sumOfW1st25 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
4795 Double_t sumOfW2nd25 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
4796 Double_t sumOfWW25 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(25); // W_{<sin(phi1+phi2)>} * W_{<cos(phi1-phi2-phi3)>}
4797 // numerator in the expression for the the unbiased estimator for covariance:
4798 Double_t numerator25 = product25 - term1st25*term2nd25;
4799 // denominator in the expression for the the unbiased estimator for covariance:
4800 Double_t denominator25 = 0.;
4801 if(TMath::Abs(sumOfW1st25*sumOfW2nd25)>0.)
4803 denominator25 = 1.-sumOfWW25/(sumOfW1st25*sumOfW2nd25);
4804 if(TMath::Abs(denominator25)>0.)
4807 Double_t covariance25 = numerator25/denominator25;
4808 // weight dependent prefactor for covariance:
4809 Double_t wPrefactor25 = sumOfWW25/(sumOfW1st25*sumOfW2nd25);
4810 // finally, store "weighted" covariance:
4811 fIntFlowCovariancesNUA->SetBinContent(25,wPrefactor25*covariance25);
4812 } // end of if(TMath::Abs(denominator25)>0.)
4813 } // end of if(TMath::Abs(sumOfW1st25*sumOfW2nd25)>0.)
4815 // Cov(<sin(phi1+phi2)>,<sin(phi1-phi2-phi3)>):
4816 Double_t product26 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(26); // <<sin(phi1+phi2)><sin(phi1-phi2-phi3)>>
4817 Double_t term1st26 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
4818 Double_t term2nd26 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
4819 Double_t sumOfW1st26 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
4820 Double_t sumOfW2nd26 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
4821 Double_t sumOfWW26 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(26); // W_{<sin(phi1+phi2)>} * W_{<sin(phi1-phi2-phi3)>}
4822 // numerator in the expression for the the unbiased estimator for covariance:
4823 Double_t numerator26 = product26 - term1st26*term2nd26;
4824 // denominator in the expression for the the unbiased estimator for covariance:
4825 Double_t denominator26 = 0.;
4826 if(TMath::Abs(sumOfW1st26*sumOfW2nd26)>0.)
4828 denominator26 = 1.-sumOfWW26/(sumOfW1st26*sumOfW2nd26);
4829 if(TMath::Abs(denominator26)>0.)
4832 Double_t covariance26 = numerator26/denominator26;
4833 // weight dependent prefactor for covariance:
4834 Double_t wPrefactor26 = sumOfWW26/(sumOfW1st26*sumOfW2nd26);
4835 // finally, store "weighted" covariance:
4836 fIntFlowCovariancesNUA->SetBinContent(26,wPrefactor26*covariance26);
4837 } // end of if(TMath::Abs(denominator26)>0.)
4838 } // end of if(TMath::Abs(sumOfW1st26*sumOfW2nd26)>0.)
4840 // Cov(<cos(phi1-phi2-phi3)>,<sin(phi1-phi2-phi3)>):
4841 Double_t product27 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(27); // <<cos(phi1-phi2-phi3)><sin(phi1-phi2-phi3)>>
4842 Double_t term1st27 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
4843 Double_t term2nd27 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
4844 Double_t sumOfW1st27 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
4845 Double_t sumOfW2nd27 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
4846 Double_t sumOfWW27 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(27); // W_{<cos(phi1-phi2-phi3)>} * W_{<sin(phi1-phi2-phi3)>}
4847 // numerator in the expression for the the unbiased estimator for covariance:
4848 Double_t numerator27 = product27 - term1st27*term2nd27;
4849 // denominator in the expression for the the unbiased estimator for covariance:
4850 Double_t denominator27 = 0.;
4851 if(TMath::Abs(sumOfW1st27*sumOfW2nd27)>0.)
4853 denominator27 = 1.-sumOfWW27/(sumOfW1st27*sumOfW2nd27);
4854 if(TMath::Abs(denominator27)>0.)
4857 Double_t covariance27 = numerator27/denominator27;
4858 // weight dependent prefactor for covariance:
4859 Double_t wPrefactor27 = sumOfWW27/(sumOfW1st27*sumOfW2nd27);
4860 // finally, store "weighted" covariance:
4861 fIntFlowCovariancesNUA->SetBinContent(27,wPrefactor27*covariance27);
4862 } // end of if(TMath::Abs(denominator27)>0.)
4863 } // end of if(TMath::Abs(sumOfW1st27*sumOfW2nd27)>0.)
4865 } // end of AliFlowAnalysisWithQCumulants::CalculateCovariancesNUAIntFlow()
4867 //================================================================================================================================
4869 void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsIntFlow()
4871 // From profile fIntFlowCorrelationsPro access measured correlations and spread,
4872 // correctly calculate the statistical errors and store the final results and
4873 // statistical errors for correlations in histogram fIntFlowCorrelationsHist.
4875 // Remark: Statistical error of correlation is calculated as:
4877 // statistical error = termA * spread * termB:
4878 // termA = sqrt{sum_{i=1}^{N} w^2}/(sum_{i=1}^{N} w)
4879 // termB = 1/sqrt(1-termA^2)
4882 for(Int_t ci=1;ci<=4;ci++) // correlation index
4884 if(fIntFlowCorrelationsPro->GetBinEffectiveEntries(ci) < 2 || fIntFlowSquaredCorrelationsPro->GetBinEffectiveEntries(ci) < 2)
4886 fIntFlowCorrelationsPro->SetBinError(ci,0.);
4887 fIntFlowSquaredCorrelationsPro->SetBinError(ci,0.);
4890 Double_t correlation = fIntFlowCorrelationsPro->GetBinContent(ci);
4891 Double_t squaredCorrelation = fIntFlowSquaredCorrelationsPro->GetBinContent(ci);
4892 Double_t spread = 0.;
4893 if(squaredCorrelation-correlation*correlation >= 0.)
4895 spread = pow(squaredCorrelation-correlation*correlation,0.5);
4899 cout<<Form(" WARNING: Imaginary 'spread' for %d-particle correlation!!!! ",2*ci)<<endl;
4902 Double_t sumOfLinearEventWeights = fIntFlowSumOfEventWeights[0]->GetBinContent(ci);
4903 Double_t sumOfQuadraticEventWeights = fIntFlowSumOfEventWeights[1]->GetBinContent(ci);
4904 Double_t termA = 0.;
4905 Double_t termB = 0.;
4906 if(TMath::Abs(sumOfLinearEventWeights) > 0.) // to be improved - shall I omitt here Abs() ?
4908 termA = pow(sumOfQuadraticEventWeights,0.5)/sumOfLinearEventWeights;
4912 cout<<" WARNING (QC): sumOfLinearEventWeights == 0 in method FinalizeCorrelationsIntFlow() !!!!"<<endl;
4913 cout<<" (for "<<2*ci<<"-particle correlation)"<<endl;
4916 if(1.-pow(termA,2.) > 0.)
4918 termB = 1./pow(1-pow(termA,2.),0.5);
4922 cout<<" WARNING (QC): 1.-pow(termA,2.) <= 0 in method FinalizeCorrelationsIntFlow() !!!!"<<endl;
4923 cout<<" (for "<<2*ci<<"-particle correlation)"<<endl;
4926 Double_t statisticalError = termA * spread * termB;
4927 fIntFlowCorrelationsHist->SetBinContent(ci,correlation);
4928 fIntFlowCorrelationsHist->SetBinError(ci,statisticalError);
4929 } // end of for(Int_t ci=1;ci<=4;ci++) // correlation index
4931 // Versus multiplicity:
4932 if(!fCalculateCumulantsVsM){return;}
4933 for(Int_t ci=0;ci<=3;ci++) // correlation index
4935 Int_t nBins = fIntFlowCorrelationsVsMPro[ci]->GetNbinsX();
4936 for(Int_t b=1;b<=nBins;b++) // looping over multiplicity bins
4938 if(fIntFlowCorrelationsVsMPro[ci]->GetBinEffectiveEntries(b) < 2 || fIntFlowSquaredCorrelationsVsMPro[ci]->GetBinEffectiveEntries(b) < 2)
4940 fIntFlowCorrelationsVsMPro[ci]->SetBinError(b,0.);
4941 fIntFlowSquaredCorrelationsVsMPro[ci]->SetBinError(b,0.);
4944 Double_t correlationVsM = fIntFlowCorrelationsVsMPro[ci]->GetBinContent(b);
4945 Double_t squaredCorrelationVsM = fIntFlowSquaredCorrelationsVsMPro[ci]->GetBinContent(b);
4946 Double_t spreadVsM = 0.;
4947 if(squaredCorrelationVsM-correlationVsM*correlationVsM >= 0.)
4949 spreadVsM = pow(squaredCorrelationVsM-correlationVsM*correlationVsM,0.5);
4953 cout<<Form(" WARNING (QC): Imaginary 'spreadVsM' for ci = %d, bin = %d, entries = %f !!!!",
4954 ci,b,fIntFlowCorrelationsVsMPro[ci]->GetBinEffectiveEntries(b))<<endl;
4957 Double_t sumOfLinearEventWeightsVsM = fIntFlowSumOfEventWeightsVsM[ci][0]->GetBinContent(b);
4958 Double_t sumOfQuadraticEventWeightsVsM = fIntFlowSumOfEventWeightsVsM[ci][1]->GetBinContent(b);
4959 Double_t termAVsM = 0.;
4960 Double_t termBVsM = 0.;
4961 if(sumOfLinearEventWeightsVsM > 0.)
4963 termAVsM = pow(sumOfQuadraticEventWeightsVsM,0.5)/sumOfLinearEventWeightsVsM;
4965 if(1.-pow(termAVsM,2.) > 0.)
4967 termBVsM = 1./pow(1-pow(termAVsM,2.),0.5);
4969 Double_t statisticalErrorVsM = termAVsM * spreadVsM * termBVsM;
4970 fIntFlowCorrelationsVsMHist[ci]->SetBinContent(b,correlationVsM);
4971 fIntFlowCorrelationsVsMHist[ci]->SetBinError(b,statisticalErrorVsM);
4972 } // end of for(Int_t b=1;b<=nBins;b++)
4973 } // end of for(Int_t ci=1;ci<=4;ci++) // correlation index
4975 } // end of AliFlowAnalysisWithQCumulants::FinalizeCorrelationsIntFlow()
4977 //================================================================================================================================
4979 void AliFlowAnalysisWithQCumulants::FillAverageMultiplicities(Int_t nRP)
4981 // Fill profile fAverageMultiplicity to hold average multiplicities and
4982 // number of events for events with nRP>=0, nRP>=1, ... , and nRP>=8
4984 // Binning of fAverageMultiplicity is organized as follows:
4985 // 1st bin: all events (including the empty ones)
4986 // 2nd bin: event with # of RPs greater or equal to 1
4987 // 3rd bin: event with # of RPs greater or equal to 2
4988 // 4th bin: event with # of RPs greater or equal to 3
4989 // 5th bin: event with # of RPs greater or equal to 4
4990 // 6th bin: event with # of RPs greater or equal to 5
4991 // 7th bin: event with # of RPs greater or equal to 6
4992 // 8th bin: event with # of RPs greater or equal to 7
4993 // 9th bin: event with # of RPs greater or equal to 8
4998 cout<<" WARNING (QC): nRP<0 in in AFAWQC::FAM() !!!!"<<endl;
5003 for(Int_t i=0;i<9;i++)
5005 if(nRP>=i){fAvMultiplicity->Fill(i+0.5,nRP,1);}
5008 } // end of AliFlowAnalysisWithQCumulants::FillAverageMultiplicities(nRP)
5010 //================================================================================================================================
5012 void AliFlowAnalysisWithQCumulants::CalculateCumulantsIntFlow()
5014 // a) Calculate Q-cumulants from the measured multiparticle correlations;
5015 // b) Propagate the statistical errors from measured multiparticle correlations to statistical errors of Q-cumulants;
5016 // c) Remark: Q-cumulants calculated in this method are biased by non-uniform acceptance of detector !!!!
5017 // Method CalculateQcumulantsCorrectedForNUAIntFlow() is called afterwards to correct for this bias;
5018 // d) Store the results and statistical error of Q-cumulants in histogram fIntFlowQcumulants.
5019 // Binning of fIntFlowQcumulants is organized as follows:
5028 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
5029 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
5030 Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
5031 Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
5032 // Statistical errors of average 2-, 4-, 6- and 8-particle azimuthal correlations:
5033 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <2>
5034 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <4>
5035 Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <6>
5036 Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <8>
5037 // Covariances (multiplied by prefactor depending on weights - see comments in CalculateCovariancesIntFlow()):
5038 Double_t wCov24 = 0.; // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
5039 Double_t wCov26 = 0.; // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)
5040 Double_t wCov28 = 0.; // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)
5041 Double_t wCov46 = 0.; // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)
5042 Double_t wCov48 = 0.; // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)
5043 Double_t wCov68 = 0.; // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)
5044 if(!fForgetAboutCovariances)
5046 wCov24 = fIntFlowCovariances->GetBinContent(1); // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
5047 wCov26 = fIntFlowCovariances->GetBinContent(2); // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)
5048 wCov28 = fIntFlowCovariances->GetBinContent(3); // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)
5049 wCov46 = fIntFlowCovariances->GetBinContent(4); // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)
5050 wCov48 = fIntFlowCovariances->GetBinContent(5); // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)
5051 wCov68 = fIntFlowCovariances->GetBinContent(6); // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)
5054 Double_t qc2 = 0.; // QC{2}
5055 Double_t qc4 = 0.; // QC{4}
5056 Double_t qc6 = 0.; // QC{6}
5057 Double_t qc8 = 0.; // QC{8}
5058 if(TMath::Abs(two) > 0.){qc2 = two;}
5059 if(TMath::Abs(four) > 0.){qc4 = four-2.*pow(two,2.);}
5060 if(TMath::Abs(six) > 0.){qc6 = six-9.*two*four+12.*pow(two,3.);}
5061 if(TMath::Abs(eight) > 0.){qc8 = eight-16.*two*six-18.*pow(four,2.)+144.*pow(two,2.)*four-144.*pow(two,4.);}
5062 // Statistical errors of Q-cumulants:
5063 Double_t qc2Error = 0.;
5064 Double_t qc4Error = 0.;
5065 Double_t qc6Error = 0.;
5066 Double_t qc8Error = 0.;
5067 // Squared statistical errors of Q-cumulants:
5068 //Double_t qc2ErrorSquared = 0.;
5069 Double_t qc4ErrorSquared = 0.;
5070 Double_t qc6ErrorSquared = 0.;
5071 Double_t qc8ErrorSquared = 0.;
5072 // Statistical error of QC{2}:
5073 qc2Error = twoError;
5074 // Statistical error of QC{4}:
5075 qc4ErrorSquared = 16.*pow(two,2.)*pow(twoError,2)+pow(fourError,2.)
5077 if(qc4ErrorSquared>0.)
5079 qc4Error = pow(qc4ErrorSquared,0.5);
5082 cout<<" WARNING (QC): Statistical error of QC{4} is imaginary !!!!"<<endl;
5084 // Statistical error of QC{6}:
5085 qc6ErrorSquared = 81.*pow(4.*pow(two,2.)-four,2.)*pow(twoError,2.)
5086 + 81.*pow(two,2.)*pow(fourError,2.)
5088 - 162.*two*(4.*pow(two,2.)-four)*wCov24
5089 + 18.*(4.*pow(two,2.)-four)*wCov26
5091 if(qc6ErrorSquared>0.)
5093 qc6Error = pow(qc6ErrorSquared,0.5);
5096 cout<<" WARNING (QC): Statistical error of QC{6} is imaginary !!!!"<<endl;
5098 // Statistical error of QC{8}:
5099 qc8ErrorSquared = 256.*pow(36.*pow(two,3.)-18.*four*two+six,2.)*pow(twoError,2.)
5100 + 1296.*pow(4.*pow(two,2.)-four,2.)*pow(fourError,2.)
5101 + 256.*pow(two,2.)*pow(sixError,2.)
5102 + pow(eightError,2.)
5103 - 1152.*(36.*pow(two,3.)-18.*four*two+six)*(4.*pow(two,2.)-four)*wCov24
5104 + 512.*two*(36.*pow(two,3.)-18.*four*two+six)*wCov26
5105 - 32.*(36.*pow(two,3.)-18.*four*two+six)*wCov28
5106 - 1152.*two*(4.*pow(two,2.)-four)*wCov46
5107 + 72.*(4.*pow(two,2.)-four)*wCov48
5109 if(qc8ErrorSquared>0.)
5111 qc8Error = pow(qc8ErrorSquared,0.5);
5114 cout<<"WARNING (QC): Statistical error of QC{8} is imaginary !!!!"<<endl;
5116 // Store the results and statistical errors for Q-cumulants:
5117 if(TMath::Abs(qc2)>0.)
5119 fIntFlowQcumulants->SetBinContent(1,qc2);
5120 fIntFlowQcumulants->SetBinError(1,qc2Error);
5122 if(TMath::Abs(qc4)>0.)
5124 fIntFlowQcumulants->SetBinContent(2,qc4);
5125 fIntFlowQcumulants->SetBinError(2,qc4Error);
5127 if(TMath::Abs(qc6)>0.)
5129 fIntFlowQcumulants->SetBinContent(3,qc6);
5130 fIntFlowQcumulants->SetBinError(3,qc6Error);
5132 if(TMath::Abs(qc8)>0.)
5134 fIntFlowQcumulants->SetBinContent(4,qc8);
5135 fIntFlowQcumulants->SetBinError(4,qc8Error);
5138 // Versus multiplicity:
5139 if(!fCalculateCumulantsVsM){return;}
5140 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
5141 Double_t value[4] = {0.}; // QCs vs M
5142 Double_t error[4] = {0.}; // error of QCs vs M
5143 Double_t dSum1[4] = {0.}; // sum value_i/(error_i)^2
5144 Double_t dSum2[4] = {0.}; // sum 1/(error_i)^2
5145 for(Int_t b=1;b<=nBins;b++)
5148 two = fIntFlowCorrelationsVsMHist[0]->GetBinContent(b); // <<2>>
5149 four = fIntFlowCorrelationsVsMHist[1]->GetBinContent(b); // <<4>>
5150 six = fIntFlowCorrelationsVsMHist[2]->GetBinContent(b); // <<6>>
5151 eight = fIntFlowCorrelationsVsMHist[3]->GetBinContent(b); // <<8>>
5152 // Statistical errors of average 2-, 4-, 6- and 8-particle azimuthal correlations:
5153 twoError = fIntFlowCorrelationsVsMHist[0]->GetBinError(b); // statistical error of <2>
5154 fourError = fIntFlowCorrelationsVsMHist[1]->GetBinError(b); // statistical error of <4>
5155 sixError = fIntFlowCorrelationsVsMHist[2]->GetBinError(b); // statistical error of <6>
5156 eightError = fIntFlowCorrelationsVsMHist[3]->GetBinError(b); // statistical error of <8>
5157 // Covariances (multiplied by prefactor depending on weights - see comments in CalculateCovariancesIntFlow()):
5158 if(!fForgetAboutCovariances)
5160 wCov24 = fIntFlowCovariancesVsM[0]->GetBinContent(b); // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
5161 wCov26 = fIntFlowCovariancesVsM[1]->GetBinContent(b); // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)
5162 wCov28 = fIntFlowCovariancesVsM[2]->GetBinContent(b); // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)
5163 wCov46 = fIntFlowCovariancesVsM[3]->GetBinContent(b); // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)
5164 wCov48 = fIntFlowCovariancesVsM[4]->GetBinContent(b); // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)
5165 wCov68 = fIntFlowCovariancesVsM[5]->GetBinContent(b); // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)
5172 if(TMath::Abs(two) > 0.){qc2 = two;}
5173 if(TMath::Abs(four) > 0.){qc4 = four-2.*pow(two,2.);}
5174 if(TMath::Abs(six) > 0.){qc6 = six-9.*two*four+12.*pow(two,3.);}
5175 if(TMath::Abs(eight) > 0.){qc8 = eight-16.*two*six-18.*pow(four,2.)+144.*pow(two,2.)*four-144.*pow(two,4.);}
5176 // Statistical errors of Q-cumulants:
5181 // Squared statistical errors of Q-cumulants:
5182 //Double_t qc2ErrorSquared = 0.;
5183 qc4ErrorSquared = 0.;
5184 qc6ErrorSquared = 0.;
5185 qc8ErrorSquared = 0.;
5186 // Statistical error of QC{2}:
5187 qc2Error = twoError;
5188 // Statistical error of QC{4}:
5189 qc4ErrorSquared = 16.*pow(two,2.)*pow(twoError,2)+pow(fourError,2.)
5191 if(qc4ErrorSquared>0.)
5193 qc4Error = pow(qc4ErrorSquared,0.5);
5196 // cout<<"WARNING: Statistical error of QC{4} is imaginary in multiplicity bin "<<b<<" !!!!"<<endl;
5198 // Statistical error of QC{6}:
5199 qc6ErrorSquared = 81.*pow(4.*pow(two,2.)-four,2.)*pow(twoError,2.)
5200 + 81.*pow(two,2.)*pow(fourError,2.)
5202 - 162.*two*(4.*pow(two,2.)-four)*wCov24
5203 + 18.*(4.*pow(two,2.)-four)*wCov26
5205 if(qc6ErrorSquared>0.)
5207 qc6Error = pow(qc6ErrorSquared,0.5);
5210 // cout<<"WARNING: Statistical error of QC{6} is imaginary in multiplicity bin "<<b<<" !!!!"<<endl;
5212 // Statistical error of QC{8}:
5213 qc8ErrorSquared = 256.*pow(36.*pow(two,3.)-18.*four*two+six,2.)*pow(twoError,2.)
5214 + 1296.*pow(4.*pow(two,2.)-four,2.)*pow(fourError,2.)
5215 + 256.*pow(two,2.)*pow(sixError,2.)
5216 + pow(eightError,2.)
5217 - 1152.*(36.*pow(two,3.)-18.*four*two+six)*(4.*pow(two,2.)-four)*wCov24
5218 + 512.*two*(36.*pow(two,3.)-18.*four*two+six)*wCov26
5219 - 32.*(36.*pow(two,3.)-18.*four*two+six)*wCov28
5220 - 1152.*two*(4.*pow(two,2.)-four)*wCov46
5221 + 72.*(4.*pow(two,2.)-four)*wCov48
5223 if(qc8ErrorSquared>0.)
5225 qc8Error = pow(qc8ErrorSquared,0.5);
5228 // cout<<"WARNING: Statistical error of QC{8} is imaginary in multiplicity bin "<<b<<" !!!!"<<endl;
5230 // Store the results and statistical errors for Q-cumulants:
5231 if(TMath::Abs(qc2)>0.)
5233 fIntFlowQcumulantsVsM[0]->SetBinContent(b,qc2);
5234 fIntFlowQcumulantsVsM[0]->SetBinError(b,qc2Error);
5236 if(TMath::Abs(qc4)>0.)
5238 fIntFlowQcumulantsVsM[1]->SetBinContent(b,qc4);
5239 fIntFlowQcumulantsVsM[1]->SetBinError(b,qc4Error);
5241 if(TMath::Abs(qc6)>0.)
5243 fIntFlowQcumulantsVsM[2]->SetBinContent(b,qc6);
5244 fIntFlowQcumulantsVsM[2]->SetBinError(b,qc6Error);
5246 if(TMath::Abs(qc8)>0.)
5248 fIntFlowQcumulantsVsM[3]->SetBinContent(b,qc8);
5249 fIntFlowQcumulantsVsM[3]->SetBinError(b,qc8Error);
5252 for(Int_t co=0;co<4;co++)
5254 if(fIntFlowCorrelationsVsMPro[co]->GetBinEffectiveEntries(b)<2){continue;}
5255 value[co] = fIntFlowQcumulantsVsM[co]->GetBinContent(b);
5256 error[co] = fIntFlowQcumulantsVsM[co]->GetBinError(b);
5259 dSum1[co]+=value[co]/(error[co]*error[co]);
5260 dSum2[co]+=1./(error[co]*error[co]);
5262 } // end of for(Int_t co=0;co<4;co++)
5263 } // end of for(Int_t b=1;b<=nBins;b++)
5264 // Store rebinned Q-cumulants:
5265 for(Int_t co=0;co<4;co++)
5269 fIntFlowQcumulantsRebinnedInM->SetBinContent(co+1,dSum1[co]/dSum2[co]);
5270 fIntFlowQcumulantsRebinnedInM->SetBinError(co+1,pow(1./dSum2[co],0.5));
5272 } // end of for(Int_t co=0;co<4;co++)
5274 } // end of AliFlowAnalysisWithQCumulants::CalculateCumulantsIntFlow()
5276 //================================================================================================================================
5278 void AliFlowAnalysisWithQCumulants::CalculateReferenceFlow()
5280 // a) Calculate the final results for reference flow estimates from Q-cumulants;
5281 // b) Propagate the statistical errors to reference flow estimates from statistical error of Q-cumulants;
5282 // c) Store the results and statistical errors of reference flow estimates in histogram fIntFlow.
5283 // Binning of fIntFlow is organized as follows:
5291 // Reference flow estimates:
5292 Double_t v2 = 0.; // v{2,QC}
5293 Double_t v4 = 0.; // v{4,QC}
5294 Double_t v6 = 0.; // v{6,QC}
5295 Double_t v8 = 0.; // v{8,QC}
5296 // Reference flow's statistical errors:
5297 Double_t v2Error = 0.; // v{2,QC} stat. error
5298 Double_t v4Error = 0.; // v{4,QC} stat. error
5299 Double_t v6Error = 0.; // v{6,QC} stat. error
5300 Double_t v8Error = 0.; // v{8,QC} stat. error
5303 Double_t qc2 = fIntFlowQcumulants->GetBinContent(1); // QC{2}
5304 Double_t qc4 = fIntFlowQcumulants->GetBinContent(2); // QC{4}
5305 Double_t qc6 = fIntFlowQcumulants->GetBinContent(3); // QC{6}
5306 Double_t qc8 = fIntFlowQcumulants->GetBinContent(4); // QC{8}
5307 // Q-cumulants's statistical errors:
5308 Double_t qc2Error = fIntFlowQcumulants->GetBinError(1); // QC{2} stat. error
5309 Double_t qc4Error = fIntFlowQcumulants->GetBinError(2); // QC{4} stat. error
5310 Double_t qc6Error = fIntFlowQcumulants->GetBinError(3); // QC{6} stat. error
5311 Double_t qc8Error = fIntFlowQcumulants->GetBinError(4); // QC{8} stat. error
5312 // Calculate reference flow estimates from Q-cumulants:
5313 if(qc2>=0.){v2 = pow(qc2,0.5);}
5314 if(qc4<=0.){v4 = pow(-1.*qc4,1./4.);}
5315 if(qc6>=0.){v6 = pow((1./4.)*qc6,1./6.);}
5316 if(qc8<=0.){v8 = pow((-1./33.)*qc8,1./8.);}
5317 // Calculate stat. error for reference flow estimates from stat. error of Q-cumulants:
5318 if(qc2>0.){v2Error = (1./2.)*pow(qc2,-0.5)*qc2Error;}
5319 if(qc4<0.){v4Error = (1./4.)*pow(-qc4,-3./4.)*qc4Error;}
5320 if(qc6>0.){v6Error = (1./6.)*pow(2.,-1./3.)*pow(qc6,-5./6.)*qc6Error;}
5321 if(qc8<0.){v8Error = (1./8.)*pow(33.,-1./8.)*pow(-qc8,-7./8.)*qc8Error;}
5322 // Print warnings for the 'wrong sign' cumulants:
5323 if(TMath::Abs(v2) < 1.e-44)
5325 cout<<" WARNING: Wrong sign QC{2}, couldn't calculate v{2,QC} !!!!"<<endl;
5327 if(TMath::Abs(v4) < 1.e-44)
5329 cout<<" WARNING: Wrong sign QC{4}, couldn't calculate v{4,QC} !!!!"<<endl;
5331 if(TMath::Abs(v6) < 1.e-44)
5333 cout<<" WARNING: Wrong sign QC{6}, couldn't calculate v{6,QC} !!!!"<<endl;
5335 if(TMath::Abs(v8) < 1.e-44)
5337 cout<<" WARNING: Wrong sign QC{8}, couldn't calculate v{8,QC} !!!!"<<endl;
5339 // Store the results and statistical errors of integrated flow estimates:
5340 fIntFlow->SetBinContent(1,v2);
5341 fIntFlow->SetBinError(1,v2Error);
5342 fIntFlow->SetBinContent(2,v4);
5343 fIntFlow->SetBinError(2,v4Error);
5344 fIntFlow->SetBinContent(3,v6);
5345 fIntFlow->SetBinError(3,v6Error);
5346 fIntFlow->SetBinContent(4,v8);
5347 fIntFlow->SetBinError(4,v8Error);
5349 // Versus multiplicity:
5350 if(!fCalculateCumulantsVsM){return;}
5351 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
5352 for(Int_t b=1;b<=nBins;b++)
5355 Double_t qc2VsM = fIntFlowQcumulantsVsM[0]->GetBinContent(b); // QC{2}
5356 Double_t qc4VsM = fIntFlowQcumulantsVsM[1]->GetBinContent(b); // QC{4}
5357 Double_t qc6VsM = fIntFlowQcumulantsVsM[2]->GetBinContent(b); // QC{6}
5358 Double_t qc8VsM = fIntFlowQcumulantsVsM[3]->GetBinContent(b); // QC{8}
5359 // Q-cumulants's statistical errors:
5360 Double_t qc2ErrorVsM = fIntFlowQcumulantsVsM[0]->GetBinError(b); // QC{2} stat. error
5361 Double_t qc4ErrorVsM = fIntFlowQcumulantsVsM[1]->GetBinError(b); // QC{4} stat. error
5362 Double_t qc6ErrorVsM = fIntFlowQcumulantsVsM[2]->GetBinError(b); // QC{6} stat. error
5363 Double_t qc8ErrorVsM = fIntFlowQcumulantsVsM[3]->GetBinError(b); // QC{8} stat. error
5364 // Reference flow estimates:
5365 Double_t v2VsM = 0.; // v{2,QC}
5366 Double_t v4VsM = 0.; // v{4,QC}
5367 Double_t v6VsM = 0.; // v{6,QC}
5368 Double_t v8VsM = 0.; // v{8,QC}
5369 // Reference flow estimates errors:
5370 Double_t v2ErrorVsM = 0.; // v{2,QC} stat. error
5371 Double_t v4ErrorVsM = 0.; // v{4,QC} stat. error
5372 Double_t v6ErrorVsM = 0.; // v{6,QC} stat. error
5373 Double_t v8ErrorVsM = 0.; // v{8,QC} stat. error
5374 // Calculate reference flow estimates from Q-cumulants:
5375 if(qc2VsM>=0.){v2VsM = pow(qc2VsM,0.5);}
5376 if(qc4VsM<=0.){v4VsM = pow(-1.*qc4VsM,1./4.);}
5377 if(qc6VsM>=0.){v6VsM = pow((1./4.)*qc6VsM,1./6.);}
5378 if(qc8VsM<=0.){v8VsM = pow((-1./33.)*qc8VsM,1./8.);}
5379 // Calculate stat. error for reference flow estimates from stat. error of Q-cumulants:
5380 if(qc2VsM>0.){v2ErrorVsM = (1./2.)*pow(qc2VsM,-0.5)*qc2ErrorVsM;}
5381 if(qc4VsM<0.){v4ErrorVsM = (1./4.)*pow(-qc4VsM,-3./4.)*qc4ErrorVsM;}
5382 if(qc6VsM>0.){v6ErrorVsM = (1./6.)*pow(2.,-1./3.)*pow(qc6VsM,-5./6.)*qc6ErrorVsM;}
5383 if(qc8VsM<0.){v8ErrorVsM = (1./8.)*pow(33.,-1./8.)*pow(-qc8VsM,-7./8.)*qc8ErrorVsM;}
5384 // Store the results and statistical errors of integrated flow estimates:
5385 fIntFlowVsM[0]->SetBinContent(b,v2VsM);
5386 fIntFlowVsM[0]->SetBinError(b,v2ErrorVsM);
5387 fIntFlowVsM[1]->SetBinContent(b,v4VsM);
5388 fIntFlowVsM[1]->SetBinError(b,v4ErrorVsM);
5389 fIntFlowVsM[2]->SetBinContent(b,v6VsM);
5390 fIntFlowVsM[2]->SetBinError(b,v6ErrorVsM);
5391 fIntFlowVsM[3]->SetBinContent(b,v8VsM);
5392 fIntFlowVsM[3]->SetBinError(b,v8ErrorVsM);
5393 } // end of for(Int_t b=1;b<=nBins;b++)
5395 // 'Rebinned in M' calculation: // to be improved - this can be implemented better:
5396 // Reference flow estimates:
5397 Double_t v2RebinnedInM = 0.; // v{2,QC}
5398 Double_t v4RebinnedInM = 0.; // v{4,QC}
5399 Double_t v6RebinnedInM = 0.; // v{6,QC}
5400 Double_t v8RebinnedInM = 0.; // v{8,QC}
5401 // Reference flow's statistical errors:
5402 Double_t v2ErrorRebinnedInM = 0.; // v{2,QC} stat. error
5403 Double_t v4ErrorRebinnedInM = 0.; // v{4,QC} stat. error
5404 Double_t v6ErrorRebinnedInM = 0.; // v{6,QC} stat. error
5405 Double_t v8ErrorRebinnedInM = 0.; // v{8,QC} stat. error
5407 Double_t qc2RebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinContent(1); // QC{2}
5408 Double_t qc4RebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinContent(2); // QC{4}
5409 Double_t qc6RebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinContent(3); // QC{6}
5410 Double_t qc8RebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinContent(4); // QC{8}
5411 // Q-cumulants's statistical errors:
5412 Double_t qc2ErrorRebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinError(1); // QC{2} stat. error
5413 Double_t qc4ErrorRebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinError(2); // QC{4} stat. error
5414 Double_t qc6ErrorRebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinError(3); // QC{6} stat. error
5415 Double_t qc8ErrorRebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinError(4); // QC{8} stat. error
5416 // Calculate reference flow estimates from Q-cumulants:
5417 if(qc2RebinnedInM>=0.){v2RebinnedInM = pow(qc2RebinnedInM,0.5);}
5418 if(qc4RebinnedInM<=0.){v4RebinnedInM = pow(-1.*qc4RebinnedInM,1./4.);}
5419 if(qc6RebinnedInM>=0.){v6RebinnedInM = pow((1./4.)*qc6RebinnedInM,1./6.);}
5420 if(qc8RebinnedInM<=0.){v8RebinnedInM = pow((-1./33.)*qc8RebinnedInM,1./8.);}
5421 // Calculate stat. error for reference flow estimates from stat. error of Q-cumulants:
5422 if(qc2RebinnedInM>0.){v2ErrorRebinnedInM = (1./2.)*pow(qc2RebinnedInM,-0.5)*qc2ErrorRebinnedInM;}
5423 if(qc4RebinnedInM<0.){v4ErrorRebinnedInM = (1./4.)*pow(-qc4RebinnedInM,-3./4.)*qc4ErrorRebinnedInM;}
5424 if(qc6RebinnedInM>0.){v6ErrorRebinnedInM = (1./6.)*pow(2.,-1./3.)*pow(qc6RebinnedInM,-5./6.)*qc6ErrorRebinnedInM;}
5425 if(qc8RebinnedInM<0.){v8ErrorRebinnedInM = (1./8.)*pow(33.,-1./8.)*pow(-qc8RebinnedInM,-7./8.)*qc8ErrorRebinnedInM;}
5426 // Print warnings for the 'wrong sign' cumulants:
5427 if(TMath::Abs(v2RebinnedInM) < 1.e-44)
5429 cout<<" WARNING: Wrong sign QC{2} rebinned in M, couldn't calculate v{2,QC} !!!!"<<endl;
5431 if(TMath::Abs(v4RebinnedInM) < 1.e-44)
5433 cout<<" WARNING: Wrong sign QC{4} rebinned in M, couldn't calculate v{4,QC} !!!!"<<endl;
5435 if(TMath::Abs(v6RebinnedInM) < 1.e-44)
5437 cout<<" WARNING: Wrong sign QC{6} rebinned in M, couldn't calculate v{6,QC} !!!!"<<endl;
5439 if(TMath::Abs(v8RebinnedInM) < 1.e-44)
5441 cout<<" WARNING: Wrong sign QC{8} rebinned in M, couldn't calculate v{8,QC} !!!!"<<endl;
5443 // Store the results and statistical errors of integrated flow estimates:
5444 fIntFlowRebinnedInM->SetBinContent(1,v2RebinnedInM);
5445 fIntFlowRebinnedInM->SetBinError(1,v2ErrorRebinnedInM);
5446 fIntFlowRebinnedInM->SetBinContent(2,v4RebinnedInM);
5447 fIntFlowRebinnedInM->SetBinError(2,v4ErrorRebinnedInM);
5448 fIntFlowRebinnedInM->SetBinContent(3,v6RebinnedInM);
5449 fIntFlowRebinnedInM->SetBinError(3,v6ErrorRebinnedInM);
5450 fIntFlowRebinnedInM->SetBinContent(4,v8RebinnedInM);
5451 fIntFlowRebinnedInM->SetBinError(4,v8ErrorRebinnedInM);
5453 } // end of AliFlowAnalysisWithQCumulants::CalculateReferenceFlow()
5455 //================================================================================================================================
5457 void AliFlowAnalysisWithQCumulants::FillCommonHistResultsIntFlow()
5459 // Fill in AliFlowCommonHistResults histograms relevant for reference flow.
5461 // There are two possibilities here:
5462 // a) Store minimum bias reference flow - use SetMinimumBiasReferenceFlow(kTRUE). This result is
5463 // biased by the interplay between nonflow correlations and multiplicity fluctuations and is
5464 // also stored in local histogram fIntFlow;
5465 // b) Store reference flow obtained from flow analysis performed at fixed multiplicity and
5466 // rebinned only at the end of the day - use SetMinimumBiasReferenceFlow(kFALSE). This result
5467 // is also stored in local histogram fIntFlowRebinnedInM.
5469 // Reference flow estimates:
5470 Double_t v[4] = {0.};
5471 // Statistical errors of reference flow estimates:
5472 Double_t vError[4] = {0.};
5474 for(Int_t b=0;b<4;b++)
5476 if(fMinimumBiasReferenceFlow)
5478 v[b] = fIntFlow->GetBinContent(b+1);
5479 vError[b] = fIntFlow->GetBinError(b+1);
5482 v[b] = fIntFlowRebinnedInM->GetBinContent(b+1);
5483 vError[b] = fIntFlowRebinnedInM->GetBinError(b+1);
5485 } // end of for(Int_t b=0;b<4;b++)
5487 // Fill AliFlowCommonHistResults histogram:
5488 fCommonHistsResults2nd->FillIntegratedFlow(v[0],vError[0]); // to be improved (hardwired 2nd in the name)
5489 fCommonHistsResults4th->FillIntegratedFlow(v[1],vError[1]); // to be improved (hardwired 4th in the name)
5490 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights)) // to be improved (calculate also 6th and 8th order)
5492 fCommonHistsResults6th->FillIntegratedFlow(v[2],vError[2]); // to be improved (hardwired 6th in the name)
5493 fCommonHistsResults8th->FillIntegratedFlow(v[3],vError[3]); // to be improved (hardwired 8th in the name)
5496 } // end of AliFlowAnalysisWithQCumulants::FillCommonHistResultsIntFlow()
5498 //================================================================================================================================
5500 void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelationsUsingParticleWeights()
5502 // Calculate all correlations needed for integrated flow using particle weights.
5504 // Remark 1: When particle weights are used the binning of fIntFlowCorrelationAllPro is organized as follows:
5506 // 1st bin: <2>_{1n|1n} = two1n1nW1W1 = <w1 w2 cos(n*(phi1-phi2))>
5507 // 2nd bin: <2>_{2n|2n} = two2n2nW2W2 = <w1^2 w2^2 cos(2n*(phi1-phi2))>
5508 // 3rd bin: <2>_{3n|3n} = two3n3nW3W3 = <w1^3 w2^3 cos(3n*(phi1-phi2))>
5509 // 4th bin: <2>_{4n|4n} = two4n4nW4W4 = <w1^4 w2^4 cos(4n*(phi1-phi2))>
5510 // 5th bin: ---- EMPTY ----
5511 // 6th bin: <3>_{2n|1n,1n} = three2n1n1nW2W1W1 = <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
5512 // 7th bin: <3>_{3n|2n,1n} = ...
5513 // 8th bin: <3>_{4n|2n,2n} = ...
5514 // 9th bin: <3>_{4n|3n,1n} = ...
5515 // 10th bin: ---- EMPTY ----
5516 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1nW1W1W1W1 = <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
5517 // 12th bin: <4>_{2n,1n|2n,1n} = ...
5518 // 13th bin: <4>_{2n,2n|2n,2n} = ...
5519 // 14th bin: <4>_{3n|1n,1n,1n} = ...
5520 // 15th bin: <4>_{3n,1n|3n,1n} = ...
5521 // 16th bin: <4>_{3n,1n|2n,2n} = ...
5522 // 17th bin: <4>_{4n|2n,1n,1n} = ...
5523 // 18th bin: ---- EMPTY ----
5524 // 19th bin: <5>_{2n|1n,1n,1n,1n} = ...
5525 // 20th bin: <5>_{2n,2n|2n,1n,1n} = ...
5526 // 21st bin: <5>_{3n,1n|2n,1n,1n} = ...
5527 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = ...
5528 // 23rd bin: ---- EMPTY ----
5529 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = ...
5530 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = ...
5531 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = ...
5532 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = ...
5533 // 28th bin: ---- EMPTY ----
5534 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = ...
5535 // 30th bin: ---- EMPTY ----
5536 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = ...
5538 // Remark 2: When particle weights are used there are some extra correlations. They are stored in
5539 // fIntFlowExtraCorrelationsPro binning of which is organized as follows:
5541 // 1st bin: two1n1nW3W1 = <w1^3 w2 cos(n*(phi1-phi2))>
5542 // 2nd bin: two1n1nW1W1W2 = <w1 w2 w3^2 cos(n*(phi1-phi2))>
5544 // multiplicity (number of particles used to determine the reaction plane)
5545 Double_t dMult = (*fSpk)(0,0);
5547 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
5548 Double_t dReQ1n1k = (*fReQ)(0,1);
5549 Double_t dReQ2n2k = (*fReQ)(1,2);
5550 Double_t dReQ3n3k = (*fReQ)(2,3);
5551 Double_t dReQ4n4k = (*fReQ)(3,4);
5552 Double_t dReQ1n3k = (*fReQ)(0,3);
5553 Double_t dImQ1n1k = (*fImQ)(0,1);
5554 Double_t dImQ2n2k = (*fImQ)(1,2);
5555 Double_t dImQ3n3k = (*fImQ)(2,3);
5556 Double_t dImQ4n4k = (*fImQ)(3,4);
5557 Double_t dImQ1n3k = (*fImQ)(0,3);
5559 // dMs are variables introduced in order to simplify some Eqs. bellow:
5560 //..............................................................................................
5561 Double_t dM11 = (*fSpk)(1,1)-(*fSpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
5562 Double_t dM22 = (*fSpk)(1,2)-(*fSpk)(0,4); // dM22 = sum_{i,j=1,i!=j}^M w_i^2 w_j^2
5563 Double_t dM33 = (*fSpk)(1,3)-(*fSpk)(0,6); // dM33 = sum_{i,j=1,i!=j}^M w_i^3 w_j^3
5564 Double_t dM44 = (*fSpk)(1,4)-(*fSpk)(0,8); // dM44 = sum_{i,j=1,i!=j}^M w_i^4 w_j^4
5565 Double_t dM31 = (*fSpk)(0,3)*(*fSpk)(0,1)-(*fSpk)(0,4); // dM31 = sum_{i,j=1,i!=j}^M w_i^3 w_j
5566 Double_t dM211 = (*fSpk)(0,2)*(*fSpk)(1,1)-2.*(*fSpk)(0,3)*(*fSpk)(0,1)
5567 - (*fSpk)(1,2)+2.*(*fSpk)(0,4); // dM211 = sum_{i,j,k=1,i!=j!=k}^M w_i^2 w_j w_k
5568 Double_t dM1111 = (*fSpk)(3,1)-6.*(*fSpk)(0,2)*(*fSpk)(1,1)
5569 + 8.*(*fSpk)(0,3)*(*fSpk)(0,1)
5570 + 3.*(*fSpk)(1,2)-6.*(*fSpk)(0,4); // dM1111 = sum_{i,j,k,l=1,i!=j!=k!=l}^M w_i w_j w_k w_l
5571 //..............................................................................................
5573 // 2-particle correlations:
5574 Double_t two1n1nW1W1 = 0.; // <w1 w2 cos(n*(phi1-phi2))>
5575 Double_t two2n2nW2W2 = 0.; // <w1^2 w2^2 cos(2n*(phi1-phi2))>
5576 Double_t two3n3nW3W3 = 0.; // <w1^3 w2^3 cos(3n*(phi1-phi2))>
5577 Double_t two4n4nW4W4 = 0.; // <w1^4 w2^4 cos(4n*(phi1-phi2))>
5582 two1n1nW1W1 = (pow(dReQ1n1k,2)+pow(dImQ1n1k,2)-(*fSpk)(0,2))/dM11;
5583 // average correlation <w1 w2 cos(n*(phi1-phi2))> for single event:
5584 fIntFlowCorrelationsEBE->SetBinContent(1,two1n1nW1W1);
5585 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(1,dM11);
5586 // average correlation <w1 w2 cos(n*(phi1-phi2))> for all events:
5587 fIntFlowCorrelationsPro->Fill(0.5,two1n1nW1W1,dM11);
5588 // average squared correlation <w1 w2 cos(n*(phi1-phi2))> for all events:
5589 fIntFlowSquaredCorrelationsPro->Fill(0.5,two1n1nW1W1*two1n1nW1W1,dM11);
5590 fIntFlowCorrelationsAllPro->Fill(0.5,two1n1nW1W1,dM11);
5594 two2n2nW2W2 = (pow(dReQ2n2k,2)+pow(dImQ2n2k,2)-(*fSpk)(0,4))/dM22;
5596 // average correlation <w1^2 w2^2 cos(2n*(phi1-phi2))> for all events:
5597 fIntFlowCorrelationsAllPro->Fill(1.5,two2n2nW2W2,dM22);
5601 two3n3nW3W3 = (pow(dReQ3n3k,2)+pow(dImQ3n3k,2)-(*fSpk)(0,6))/dM33;
5603 // average correlation <w1^3 w2^3 cos(3n*(phi1-phi2))> for all events:
5604 fIntFlowCorrelationsAllPro->Fill(2.5,two3n3nW3W3,dM33);
5608 two4n4nW4W4 = (pow(dReQ4n4k,2)+pow(dImQ4n4k,2)-(*fSpk)(0,8))/dM44;
5610 // average correlation <w1^4 w2^4 cos(4n*(phi1-phi2))> for all events:
5611 fIntFlowCorrelationsAllPro->Fill(3.5,two4n4nW4W4,dM44);
5613 } // end of if(dMult>1)
5615 // extra 2-particle correlations:
5616 Double_t two1n1nW3W1 = 0.; // <w1^3 w2 cos(n*(phi1-phi2))>
5617 Double_t two1n1nW1W1W2 = 0.; // <w1 w2 w3^2 cos(n*(phi1-phi2))>
5622 two1n1nW3W1 = (dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k-(*fSpk)(0,4))/dM31;
5623 fIntFlowExtraCorrelationsPro->Fill(0.5,two1n1nW3W1,dM31);
5627 two1n1nW1W1W2 = ((*fSpk)(0,2)*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2)-(*fSpk)(0,2))
5628 - 2.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k
5629 - (*fSpk)(0,4)))/dM211;
5630 fIntFlowExtraCorrelationsPro->Fill(1.5,two1n1nW1W1W2,dM211);
5632 } // end of if(dMult>1)
5633 //..............................................................................................
5635 //..............................................................................................
5636 // 3-particle correlations:
5637 Double_t three2n1n1nW2W1W1 = 0.; // <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
5643 three2n1n1nW2W1W1 = (pow(dReQ1n1k,2.)*dReQ2n2k+2.*dReQ1n1k*dImQ1n1k*dImQ2n2k-pow(dImQ1n1k,2.)*dReQ2n2k
5644 - 2.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k)
5645 - pow(dReQ2n2k,2)-pow(dImQ2n2k,2)
5646 + 2.*(*fSpk)(0,4))/dM211;
5647 fIntFlowCorrelationsAllPro->Fill(5.5,three2n1n1nW2W1W1,dM211);
5649 } // end of if(dMult>2)
5650 //..............................................................................................
5652 //..............................................................................................
5653 // 4-particle correlations:
5654 Double_t four1n1n1n1nW1W1W1W1 = 0.; // <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
5659 four1n1n1n1nW1W1W1W1 = (pow(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.),2)
5660 - 2.*(pow(dReQ1n1k,2.)*dReQ2n2k+2.*dReQ1n1k*dImQ1n1k*dImQ2n2k-pow(dImQ1n1k,2.)*dReQ2n2k)
5661 + 8.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k)
5662 + (pow(dReQ2n2k,2)+pow(dImQ2n2k,2))
5663 - 4.*(*fSpk)(0,2)*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
5664 - 6.*(*fSpk)(0,4)+2.*(*fSpk)(1,2))/dM1111;
5666 // average correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for single event:
5667 fIntFlowCorrelationsEBE->SetBinContent(2,four1n1n1n1nW1W1W1W1);
5668 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(2,dM1111);
5669 // average correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for all events:
5670 fIntFlowCorrelationsPro->Fill(1.5,four1n1n1n1nW1W1W1W1,dM1111);
5671 // average squared correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for all events:
5672 fIntFlowSquaredCorrelationsPro->Fill(1.5,four1n1n1n1nW1W1W1W1*four1n1n1n1nW1W1W1W1,dM1111);
5673 fIntFlowCorrelationsAllPro->Fill(10.5,four1n1n1n1nW1W1W1W1,dM1111);
5675 } // end of if(dMult>3)
5676 //..............................................................................................
5678 } // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelationsUsingParticleWeights()
5680 //================================================================================================================================
5682 void AliFlowAnalysisWithQCumulants::InitializeArraysForIntFlow()
5684 // Initialize all arrays used to calculate integrated flow.
5686 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
5688 fIntFlowCorrectionTermsForNUAEBE[sc] = NULL;
5689 fIntFlowEventWeightForCorrectionTermsForNUAEBE[sc] = NULL;
5690 fIntFlowCorrectionTermsForNUAPro[sc] = NULL;
5691 fIntFlowCorrectionTermsForNUAHist[sc] = NULL;
5692 for(Int_t ci=0;ci<4;ci++) // correction term index (to be improved - hardwired 4)
5694 fIntFlowCorrectionTermsForNUAVsMPro[sc][ci] = NULL;
5696 for(Int_t power=0;power<2;power++) // linear or quadratic
5698 fIntFlowSumOfEventWeightsNUA[sc][power] = NULL;
5701 for(Int_t power=0;power<2;power++) // linear or quadratic
5703 fIntFlowSumOfEventWeights[power] = NULL;
5705 for(Int_t i=0;i<4;i++) // print on the screen the final results (0=RF, 1=RP, 2=POI, 3=RF (rebbined in M))
5707 fPrintFinalResults[i] = kTRUE;
5709 for(Int_t ci=0;ci<4;ci++) // correlation index or cumulant order
5711 fIntFlowCorrelationsVsMPro[ci] = NULL;
5712 fIntFlowSquaredCorrelationsVsMPro[ci] = NULL;
5713 fIntFlowCorrelationsVsMHist[ci] = NULL;
5714 fIntFlowQcumulantsVsM[ci] = NULL;
5715 fIntFlowVsM[ci] = NULL;
5716 fIntFlowDetectorBiasVsM[ci] = NULL;
5717 for(Int_t lc=0;lc<2;lc++)
5719 fIntFlowSumOfEventWeightsVsM[ci][lc] = NULL;
5722 for(Int_t pi=0;pi<6;pi++) // product or covariance index
5724 fIntFlowProductOfCorrelationsVsMPro[pi] = NULL;
5725 fIntFlowCovariancesVsM[pi] = NULL;
5726 fIntFlowSumOfProductOfEventWeightsVsM[pi] = NULL;
5728 for(Int_t ci=0;ci<64;ci++) // correlation index for all correlations vs M profiles (to be improved - hardwired 64)
5730 fIntFlowCorrelationsAllVsMPro[ci] = NULL;
5733 } // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForIntFlow()
5735 //================================================================================================================================
5737 void AliFlowAnalysisWithQCumulants::InitializeArraysForDiffFlow()
5739 // Initialize all arrays needed to calculate differential flow.
5740 // a) Initialize lists holding profiles;
5741 // b) Initialize lists holding histograms;
5742 // c) Initialize event-by-event quantities;
5743 // d) Initialize profiles;
5744 // e) Initialize histograms holding final results.
5746 // a) Initialize lists holding profiles;
5747 for(Int_t t=0;t<2;t++) // type (RP, POI)
5749 for(Int_t pe=0;pe<2;pe++) // pt or eta
5751 fDiffFlowCorrelationsProList[t][pe] = NULL;
5752 fDiffFlowProductOfCorrelationsProList[t][pe] = NULL;
5753 fDiffFlowCorrectionsProList[t][pe] = NULL;
5756 f2DDiffFlowCorrelationsProList[t] = NULL;
5759 // b) Initialize lists holding histograms;
5760 for(Int_t t=0;t<2;t++) // type (RP, POI)
5762 for(Int_t pe=0;pe<2;pe++) // pt or eta
5764 fDiffFlowCorrelationsHistList[t][pe] = NULL;
5765 for(Int_t power=0;power<2;power++)
5767 fDiffFlowSumOfEventWeightsHistList[t][pe][power] = NULL;
5768 } // end of for(Int_t power=0;power<2;power++)
5769 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe] = NULL;
5770 fDiffFlowCorrectionsHistList[t][pe] = NULL;
5771 fDiffFlowCovariancesHistList[t][pe] = NULL;
5772 fDiffFlowCumulantsHistList[t][pe] = NULL;
5773 fDiffFlowDetectorBiasHistList[t][pe] = NULL;
5774 fDiffFlowHistList[t][pe] = NULL;
5775 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
5776 } // enf of for(Int_t t=0;t<2;t++) // type (RP, POI)
5778 // c) Initialize event-by-event quantities:
5780 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
5782 for(Int_t pe=0;pe<2;pe++) // pt or eta
5784 for(Int_t m=0;m<4;m++) // multiple of harmonic
5786 for(Int_t k=0;k<9;k++) // power of weight
5788 fReRPQ1dEBE[t][pe][m][k] = NULL;
5789 fImRPQ1dEBE[t][pe][m][k] = NULL;
5790 fs1dEBE[t][pe][k] = NULL; // to be improved (this doesn't need to be within loop over m)
5796 for(Int_t t=0;t<2;t++) // type (RP or POI)
5798 for(Int_t pe=0;pe<2;pe++) // pt or eta
5800 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
5802 for(Int_t cti=0;cti<9;cti++) // correction term index
5804 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti] = NULL;
5810 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
5812 for(Int_t m=0;m<4;m++) // multiple of harmonic
5814 for(Int_t k=0;k<9;k++) // power of weight
5816 fReRPQ2dEBE[t][m][k] = NULL;
5817 fImRPQ2dEBE[t][m][k] = NULL;
5818 fs2dEBE[t][k] = NULL; // to be improved (this doesn't need to be within loop over m)
5823 // d) Initialize profiles:
5824 for(Int_t t=0;t<2;t++) // type: RP or POI
5826 for(Int_t pe=0;pe<2;pe++) // pt or eta
5828 for(Int_t ci=0;ci<4;ci++) // correlation index
5830 fDiffFlowCorrelationsPro[t][pe][ci] = NULL;
5831 fDiffFlowSquaredCorrelationsPro[t][pe][ci] = NULL;
5832 } // end of for(Int_t ci=0;ci<4;ci++)
5833 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
5835 for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index
5837 fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2] = NULL;
5838 } // end of for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index
5839 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
5840 // correction terms for nua:
5841 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
5843 for(Int_t cti=0;cti<9;cti++) // correction term index
5845 fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti] = NULL;
5848 // other differential correlators:
5849 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
5851 for(Int_t ci=0;ci<1;ci++) // correction term index
5853 fOtherDiffCorrelators[t][pe][sc][ci] = NULL;
5856 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
5857 for(Int_t ci=0;ci<4;ci++) // correlation index
5859 f2DDiffFlowCorrelationsPro[t][ci] = NULL;
5861 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
5863 // e) Initialize histograms holding final results.
5864 for(Int_t t=0;t<2;t++) // type: RP or POI
5866 for(Int_t pe=0;pe<2;pe++) // pt or eta
5868 for(Int_t ci=0;ci<4;ci++) // correlation index
5870 fDiffFlowCorrelationsHist[t][pe][ci] = NULL;
5871 fDiffFlowCumulants[t][pe][ci] = NULL;
5872 fDiffFlowDetectorBias[t][pe][ci] = NULL;
5873 fDiffFlow[t][pe][ci] = NULL;
5874 } // end of for(Int_t ci=0;ci<4;ci++)
5875 for(Int_t covarianceIndex=0;covarianceIndex<5;covarianceIndex++)
5877 fDiffFlowCovariances[t][pe][covarianceIndex] = NULL;
5878 } // end of for(Int_t covarianceIndex=0;covarianceIndex<5;covarianceIndex++)
5879 // correction terms for nua:
5880 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
5882 for(Int_t cti=0;cti<9;cti++) // correction term index
5884 fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti] = NULL;
5887 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
5888 for(Int_t ci=0;ci<4;ci++) // correlation index
5890 f2DDiffFlowCumulants[t][ci] = NULL;
5891 f2DDiffFlow[t][ci] = NULL;
5893 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
5895 // sum of event weights for reduced correlations:
5896 for(Int_t t=0;t<2;t++) // type = RP or POI
5898 for(Int_t pe=0;pe<2;pe++) // pt or eta
5900 for(Int_t p=0;p<2;p++) // power of weight is 1 or 2
5902 for(Int_t ew=0;ew<4;ew++) // event weight index for reduced correlations
5904 fDiffFlowSumOfEventWeights[t][pe][p][ew] = NULL;
5909 // product of event weights for both types of correlations:
5910 for(Int_t t=0;t<2;t++) // type = RP or POI
5912 for(Int_t pe=0;pe<2;pe++) // pt or eta
5914 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
5916 for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index
5918 fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2] = NULL;
5924 } // end of AliFlowAnalysisWithQCumulants::InitializeArraysForDiffFlow()
5926 //================================================================================================================================
5928 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulants(TString type, TString ptOrEta)
5930 // Calculate differential flow cumulants from measured multiparticle correlations.
5932 // REMARK: Cumulants calculated in this method are NOT corrected for non-uniform acceptance.
5933 // This correction, if enabled via setter SetApplyCorrectionForNUA(Bool_t), is applied
5934 // in the method CalculateDiffFlowCumulantsCorrectedForNUA(TString type, TString ptOrEta)
5942 } else if(type == "POI")
5950 } else if(ptOrEta == "Eta")
5956 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
5958 // Correlation <<2>>:
5959 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1);
5960 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1);
5962 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
5964 // Reduced correlations:
5965 Double_t twoPrime = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b); // <<2'>>
5966 Double_t twoPrimeError = fDiffFlowCorrelationsHist[t][pe][0]->GetBinError(b); // stat. error of <<2'>>
5967 Double_t fourPrime = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b); // <<4'>>
5968 Double_t fourPrimeError = fDiffFlowCorrelationsHist[t][pe][1]->GetBinError(b); // stat. error of <<4'>>
5970 Double_t wCovTwoTwoReduced = fDiffFlowCovariances[t][pe][0]->GetBinContent(b); // Cov(<2>,<2'>) * prefactor(<2>,<2'>)
5971 Double_t wCovTwoFourReduced = fDiffFlowCovariances[t][pe][1]->GetBinContent(b); // Cov(<2>,<4'>) * prefactor(<2>,<4'>)
5972 Double_t wCovTwoReducedFourReduced = fDiffFlowCovariances[t][pe][4]->GetBinContent(b); // Cov(<2'>,<4'>) * prefactor(<2'>,<4'>)
5974 Double_t qc2Prime = twoPrime; // QC{2'}
5975 Double_t qc2PrimeError = twoPrimeError; // stat. error of QC{2'}
5976 fDiffFlowCumulants[t][pe][0]->SetBinContent(b,qc2Prime);
5977 fDiffFlowCumulants[t][pe][0]->SetBinError(b,qc2PrimeError);
5979 Double_t qc4Prime = fourPrime - 2.*twoPrime*two; // QC{4'} = <<4'>> - 2*<<2'>><<2>>
5980 Double_t qc4PrimeError = 0.; // stat. error of QC{4'}
5981 Double_t qc4PrimeErrorSquared = 4.*pow(twoPrime,2.)*pow(twoError,2.)
5982 + 4.*pow(two,2.)*pow(twoPrimeError,2.)
5983 + pow(fourPrimeError,2.)
5984 + 8.*two*twoPrime*wCovTwoTwoReduced
5985 - 4.*twoPrime*wCovTwoFourReduced
5986 - 4.*two*wCovTwoReducedFourReduced;
5987 if(qc4PrimeErrorSquared>0.)
5989 qc4PrimeError = pow(qc4PrimeErrorSquared,0.5);
5991 fDiffFlowCumulants[t][pe][1]->SetBinContent(b,qc4Prime);
5992 fDiffFlowCumulants[t][pe][1]->SetBinError(b,qc4PrimeError);
5993 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5995 } // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulants(TString type, Bool_t useParticleWeights, TString eventWeights);
5997 //================================================================================================================================
5999 void AliFlowAnalysisWithQCumulants::Calculate2DDiffFlowCumulants(TString type)
6001 // Calculate 2D differential cumulants.
6003 // Remark: correction for detector effects and error propagation not implemented yet for 2D differential cumulants.
6010 } else if(type == "POI")
6015 // Reference correlation <<2>>:
6016 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1);
6018 // Looping over all (pt,eta) bins and calculating differential flow cumulants:
6019 for(Int_t p=1;p<=fnBinsPt;p++)
6021 for(Int_t e=1;e<=fnBinsEta;e++)
6023 // Reduced correlations:
6024 Double_t twoPrime = f2DDiffFlowCorrelationsPro[t][0]->GetBinContent(f2DDiffFlowCorrelationsPro[t][0]->GetBin(p,e)); // <<2'>>(pt,eta)
6025 Double_t fourPrime = f2DDiffFlowCorrelationsPro[t][1]->GetBinContent(f2DDiffFlowCorrelationsPro[t][1]->GetBin(p,e)); // <<4'>>(pt,eta)
6027 Double_t qc2Prime = twoPrime; // QC{2'} = <<2'>>
6028 f2DDiffFlowCumulants[t][0]->SetBinContent(f2DDiffFlowCumulants[t][0]->GetBin(p,e),qc2Prime);
6029 Double_t qc4Prime = fourPrime - 2.*twoPrime*two; // QC{4'} = <<4'>> - 2*<<2'>><<2>>
6030 f2DDiffFlowCumulants[t][1]->SetBinContent(f2DDiffFlowCumulants[t][1]->GetBin(p,e),qc4Prime);
6031 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
6032 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
6034 } // end of void AliFlowAnalysisWithQCumulants::Calculate2DDiffFlowCumulants(TString type)
6036 //================================================================================================================================
6038 void AliFlowAnalysisWithQCumulants::CalculateFinalResultsForRPandPOIIntegratedFlow(TString type)
6040 // Calculate final results for integrated flow of RPs and POIs.
6042 // to be improved - check if the integrated flow calculation here is actually correct
6044 Int_t t = 0; // RP = 0, POI = 1
6049 } else if(type == "POI")
6055 TH1F *yield2ndPt = NULL;
6056 TH1F *yield4thPt = NULL;
6057 TH1F *yield6thPt = NULL;
6058 TH1F *yield8thPt = NULL;
6062 if(fFillMultipleControlHistograms)
6064 yield2ndPt = (TH1F*)(fCommonHists2nd->GetHistPtPOI())->Clone();
6065 yield4thPt = (TH1F*)(fCommonHists4th->GetHistPtPOI())->Clone();
6066 yield6thPt = (TH1F*)(fCommonHists6th->GetHistPtPOI())->Clone();
6067 yield8thPt = (TH1F*)(fCommonHists8th->GetHistPtPOI())->Clone();
6070 yield2ndPt = (TH1F*)(fCommonHists->GetHistPtPOI())->Clone();
6071 yield4thPt = (TH1F*)(fCommonHists->GetHistPtPOI())->Clone();
6072 yield6thPt = (TH1F*)(fCommonHists->GetHistPtPOI())->Clone();
6073 yield8thPt = (TH1F*)(fCommonHists->GetHistPtPOI())->Clone();
6076 else if(type == "RP")
6078 if(fFillMultipleControlHistograms)
6080 yield2ndPt = (TH1F*)(fCommonHists2nd->GetHistPtRP())->Clone();
6081 yield4thPt = (TH1F*)(fCommonHists4th->GetHistPtRP())->Clone();
6082 yield6thPt = (TH1F*)(fCommonHists6th->GetHistPtRP())->Clone();
6083 yield8thPt = (TH1F*)(fCommonHists8th->GetHistPtRP())->Clone();
6086 yield2ndPt = (TH1F*)(fCommonHists->GetHistPtRP())->Clone();
6087 yield4thPt = (TH1F*)(fCommonHists->GetHistPtRP())->Clone();
6088 yield6thPt = (TH1F*)(fCommonHists->GetHistPtRP())->Clone();
6089 yield8thPt = (TH1F*)(fCommonHists->GetHistPtRP())->Clone();
6093 if(!yield2ndPt){return;}
6094 if(!yield4thPt){return;}
6095 if(!yield6thPt){return;}
6096 if(!yield8thPt){return;}
6098 Int_t nBinsPt = yield2ndPt->GetNbinsX();
6100 TH1D *flow2ndPt = NULL;
6101 TH1D *flow4thPt = NULL;
6102 TH1D *flow6thPt = NULL;
6103 TH1D *flow8thPt = NULL;
6105 // to be improved (hardwired pt index)
6106 flow2ndPt = (TH1D*)fDiffFlow[t][0][0]->Clone();
6107 flow4thPt = (TH1D*)fDiffFlow[t][0][1]->Clone();
6108 flow6thPt = (TH1D*)fDiffFlow[t][0][2]->Clone();
6109 flow8thPt = (TH1D*)fDiffFlow[t][0][3]->Clone();
6111 if(!flow2ndPt){return;}
6112 if(!flow4thPt){return;}
6113 if(!flow6thPt){return;}
6114 if(!flow8thPt){return;}
6116 Double_t dvn2nd = 0., dvn4th = 0., dvn6th = 0., dvn8th = 0.; // differential flow
6117 Double_t dErrvn2nd = 0., dErrvn4th = 0., dErrvn6th = 0., dErrvn8th = 0.; // error on differential flow
6119 Double_t dVn2nd = 0., dVn4th = 0., dVn6th = 0., dVn8th = 0.; // integrated flow
6120 Double_t dErrVn2nd = 0., dErrVn4th = 0., dErrVn6th = 0., dErrVn8th = 0.; // error on integrated flow
6122 Double_t dYield2nd = 0., dYield4th = 0., dYield6th = 0., dYield8th = 0.; // pt yield
6123 Double_t dSum2nd = 0., dSum4th = 0., dSum6th = 0., dSum8th = 0.; // needed for normalizing integrated flow
6125 // looping over pt bins:
6126 for(Int_t p=1;p<nBinsPt+1;p++)
6128 dvn2nd = flow2ndPt->GetBinContent(p);
6129 dvn4th = flow4thPt->GetBinContent(p);
6130 dvn6th = flow6thPt->GetBinContent(p);
6131 dvn8th = flow8thPt->GetBinContent(p);
6133 dErrvn2nd = flow2ndPt->GetBinError(p);
6134 dErrvn4th = flow4thPt->GetBinError(p);
6135 dErrvn6th = flow6thPt->GetBinError(p);
6136 dErrvn8th = flow8thPt->GetBinError(p);
6138 dYield2nd = yield2ndPt->GetBinContent(p);
6139 dYield4th = yield4thPt->GetBinContent(p);
6140 dYield6th = yield6thPt->GetBinContent(p);
6141 dYield8th = yield8thPt->GetBinContent(p);
6143 dVn2nd += dvn2nd*dYield2nd;
6144 dVn4th += dvn4th*dYield4th;
6145 dVn6th += dvn6th*dYield6th;
6146 dVn8th += dvn8th*dYield8th;
6148 dSum2nd += dYield2nd;
6149 dSum4th += dYield4th;
6150 dSum6th += dYield6th;
6151 dSum8th += dYield8th;
6153 dErrVn2nd += dYield2nd*dYield2nd*dErrvn2nd*dErrvn2nd; // ro be improved (check this relation)
6154 dErrVn4th += dYield4th*dYield4th*dErrvn4th*dErrvn4th;
6155 dErrVn6th += dYield6th*dYield6th*dErrvn6th*dErrvn6th;
6156 dErrVn8th += dYield8th*dYield8th*dErrvn8th*dErrvn8th;
6158 } // end of for(Int_t p=1;p<nBinsPt+1;p++)
6160 // normalizing the results for integrated flow:
6164 dErrVn2nd /= (dSum2nd*dSum2nd);
6165 dErrVn2nd = TMath::Sqrt(dErrVn2nd);
6170 dErrVn4th /= (dSum4th*dSum4th);
6171 dErrVn4th = TMath::Sqrt(dErrVn4th);
6173 //if(dSum6th) dVn6th/=dSum6th;
6174 //if(dSum8th) dVn8th/=dSum8th;
6176 // storing the results for integrated flow in common histos: (to be improved: new method for this?)
6179 fCommonHistsResults2nd->FillIntegratedFlowPOI(dVn2nd,dErrVn2nd);
6180 fCommonHistsResults4th->FillIntegratedFlowPOI(dVn4th,dErrVn4th);
6181 fCommonHistsResults6th->FillIntegratedFlowPOI(dVn6th,0.); // to be improved (errors)
6182 fCommonHistsResults8th->FillIntegratedFlowPOI(dVn8th,0.); // to be improved (errors)
6184 else if (type == "RP")
6186 fCommonHistsResults2nd->FillIntegratedFlowRP(dVn2nd,dErrVn2nd);
6187 fCommonHistsResults4th->FillIntegratedFlowRP(dVn4th,dErrVn4th);
6188 fCommonHistsResults6th->FillIntegratedFlowRP(dVn6th,0.); // to be improved (errors)
6189 fCommonHistsResults8th->FillIntegratedFlowRP(dVn8th,0.); // to be improved (errors)
6202 } // end of AliFlowAnalysisWithQCumulants::CalculateFinalResultsForRPandPOIIntegratedFlow(TString type)
6204 //================================================================================================================================
6206 void AliFlowAnalysisWithQCumulants::InitializeArraysForDistributions()
6208 // Initialize all arrays used for distributions.
6210 // a) Initialize arrays of histograms used to hold distributions of correlations;
6211 // b) Initialize array to hold min and max values of correlations.
6213 // a) Initialize arrays of histograms used to hold distributions of correlations:
6214 for(Int_t di=0;di<4;di++) // distribution index
6216 fDistributions[di] = NULL;
6219 // b) Initialize default min and max values of correlations:
6220 // (Remark: The default values bellow were chosen for v2=5% and M=500)
6221 fMinValueOfCorrelation[0] = -0.01; // <2>_min
6222 fMaxValueOfCorrelation[0] = 0.04; // <2>_max
6223 fMinValueOfCorrelation[1] = -0.00002; // <4>_min
6224 fMaxValueOfCorrelation[1] = 0.00015; // <4>_max
6225 fMinValueOfCorrelation[2] = -0.0000003; // <6>_min
6226 fMaxValueOfCorrelation[2] = 0.0000006; // <6>_max
6227 fMinValueOfCorrelation[3] = -0.000000006; // <8>_min
6228 fMaxValueOfCorrelation[3] = 0.000000003; // <8>_max
6230 } // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForDistributions()
6232 //================================================================================================================================
6234 void AliFlowAnalysisWithQCumulants::InitializeArraysForVarious()
6236 // Initialize all arrays used for various unclassified objects.
6238 for(Int_t p=0;p<4;p++) // [v_min,v_max,refMult_min,refMult_max]
6240 fPhiDistributionForOneEventSettings[p] = 0.;
6243 } // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForVarious()
6245 //================================================================================================================================
6247 void AliFlowAnalysisWithQCumulants::BookEverythingForDistributions()
6249 // a) Book profile to hold all flags for distributions of correlations;
6250 // b) Book all histograms to hold distributions of correlations.
6252 TString correlationIndex[4] = {"<2>","<4>","<6>","<8>"}; // to be improved (should I promote this to data members?)
6254 // a) Book profile to hold all flags for distributions of correlations:
6255 TString distributionsFlagsName = "fDistributionsFlags";
6256 distributionsFlagsName += fAnalysisLabel->Data();
6257 fDistributionsFlags = new TProfile(distributionsFlagsName.Data(),"Flags for Distributions of Correlations",9,0,9);
6258 fDistributionsFlags->SetTickLength(-0.01,"Y");
6259 fDistributionsFlags->SetMarkerStyle(25);
6260 fDistributionsFlags->SetLabelSize(0.05);
6261 fDistributionsFlags->SetLabelOffset(0.02,"Y");
6262 fDistributionsFlags->GetXaxis()->SetBinLabel(1,"Store or not?");
6263 fDistributionsFlags->GetXaxis()->SetBinLabel(2,"<2>_{min}");
6264 fDistributionsFlags->GetXaxis()->SetBinLabel(3,"<2>_{max}");
6265 fDistributionsFlags->GetXaxis()->SetBinLabel(4,"<4>_{min}");
6266 fDistributionsFlags->GetXaxis()->SetBinLabel(5,"<4>_{max}");
6267 fDistributionsFlags->GetXaxis()->SetBinLabel(6,"<6>_{min}");
6268 fDistributionsFlags->GetXaxis()->SetBinLabel(7,"<6>_{max}");
6269 fDistributionsFlags->GetXaxis()->SetBinLabel(8,"<8>_{min}");
6270 fDistributionsFlags->GetXaxis()->SetBinLabel(9,"<8>_{max}");
6271 fDistributionsList->Add(fDistributionsFlags);
6273 // b) Book all histograms to hold distributions of correlations.
6274 if(fStoreDistributions)
6276 TString distributionsName = "fDistributions";
6277 distributionsName += fAnalysisLabel->Data();
6278 for(Int_t di=0;di<4;di++) // distribution index
6280 fDistributions[di] = new TH1D(Form("Distribution of %s",correlationIndex[di].Data()),Form("Distribution of %s",correlationIndex[di].Data()),10000,fMinValueOfCorrelation[di],fMaxValueOfCorrelation[di]);
6281 fDistributions[di]->SetXTitle(correlationIndex[di].Data());
6282 fDistributionsList->Add(fDistributions[di]);
6283 } // end of for(Int_t di=0;di<4;di++) // distribution index
6284 } // end of if(fStoreDistributions)
6286 } // end of void AliFlowAnalysisWithQCumulants::BookEverythingForDistributions()
6288 //================================================================================================================================
6290 void AliFlowAnalysisWithQCumulants::BookEverythingForVarious()
6292 // Book all objects for various unclassified quantities.
6294 if(!fStorePhiDistributionForOneEvent){return;}
6296 // a) Book histogram holding phi distribution for single event to illustrate flow.
6298 // a) Book histogram holding phi distribution for single event to illustrate flow:
6299 fPhiDistributionForOneEvent = new TH1D("fPhiDistributionForOneEvent","",360,0.,TMath::TwoPi());
6300 fPhiDistributionForOneEvent->GetXaxis()->SetTitle("#phi");
6301 fVariousList->Add(fPhiDistributionForOneEvent);
6303 } // end of void AliFlowAnalysisWithQCumulants::BookEverythingForVarious()
6305 //================================================================================================================================
6307 void AliFlowAnalysisWithQCumulants::StoreFlagsForDistributions()
6309 // Store all flags for distributiuons of correlations in profile fDistributionsFlags.
6311 if(!fDistributionsFlags)
6313 cout<<"WARNING: fDistributionsFlags is NULL in AFAWQC::SDF() !!!!"<<endl;
6317 fDistributionsFlags->Fill(0.5,(Int_t)fStoreDistributions); // histos with distributions of correlations stored or not in the output file
6318 // store min and max values of correlations:
6319 for(Int_t di=0;di<4;di++) // distribution index
6321 fDistributionsFlags->Fill(1.5+2.*(Double_t)di,fMinValueOfCorrelation[di]);
6322 fDistributionsFlags->Fill(2.5+2.*(Double_t)di,fMaxValueOfCorrelation[di]);
6325 } // end of void AliFlowAnalysisWithQCumulants::StoreFlagsForDistributions()
6327 //================================================================================================================================
6329 void AliFlowAnalysisWithQCumulants::StoreDistributionsOfCorrelations()
6331 // Store distributions of correlations.
6333 if(!(fIntFlowCorrelationsEBE && fIntFlowEventWeightsForCorrelationsEBE))
6335 cout<<"WARNING: fIntFlowCorrelationsEBE && fIntFlowEventWeightsForCorrelationsEBE"<<endl;
6336 cout<<" is NULL in AFAWQC::SDOC() !!!!"<<endl;
6340 for(Int_t di=0;di<4;di++) // distribution index
6342 if(!fDistributions[di])
6344 cout<<"WARNING: fDistributions[di] is NULL in AFAWQC::SDOC() !!!!"<<endl;
6345 cout<<"di = "<<di<<endl;
6349 fDistributions[di]->Fill(fIntFlowCorrelationsEBE->GetBinContent(di+1),fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(di+1));
6351 } // end of for(Int_t di=0;di<4;di++) // distribution index
6353 } // end of void AliFlowAnalysisWithQCumulants::StoreDistributionsOfCorrelations()
6355 //================================================================================================================================
6357 void AliFlowAnalysisWithQCumulants::BookAndNestAllLists()
6359 // Book and nest all lists nested in the base list fHistList.
6360 // a) Book and nest lists for integrated flow;
6361 // b) Book and nest lists for differential flow;
6362 // c) Book and nest list for particle weights;
6363 // d) Book and nest list for distributions;
6364 // e) Book and nest list for various unclassified objects;
6365 // f) Book and nest list for nested loops.
6367 // a) Book and nest all lists for integrated flow:
6368 // Base list for integrated flow:
6369 fIntFlowList = new TList();
6370 fIntFlowList->SetName("Integrated Flow");
6371 fIntFlowList->SetOwner(kTRUE);
6372 fHistList->Add(fIntFlowList);
6373 // List holding profiles:
6374 fIntFlowProfiles = new TList();
6375 fIntFlowProfiles->SetName("Profiles");
6376 fIntFlowProfiles->SetOwner(kTRUE);
6377 fIntFlowList->Add(fIntFlowProfiles);
6378 // List holding all profiles with results for correlations vs M:
6379 if(fCalculateAllCorrelationsVsM)
6381 fIntFlowAllCorrelationsVsM = new TList();
6382 fIntFlowAllCorrelationsVsM->SetName("Correlations vs M");
6383 fIntFlowAllCorrelationsVsM->SetOwner(kTRUE);
6384 fIntFlowProfiles->Add(fIntFlowAllCorrelationsVsM);
6385 } // end of if(fCalculateAllCorrelationsVsM)
6386 // List holding histograms with results:
6387 fIntFlowResults = new TList();
6388 fIntFlowResults->SetName("Results");
6389 fIntFlowResults->SetOwner(kTRUE);
6390 fIntFlowList->Add(fIntFlowResults);
6392 // b) Book and nest lists for differential flow:
6393 this->BookAndNestListsForDifferentialFlow();
6395 // c) Book and nest list for particle weights:
6396 fWeightsList->SetName("Weights");
6397 fWeightsList->SetOwner(kTRUE);
6398 fHistList->Add(fWeightsList);
6400 // d) Book and nest list for distributions:
6401 fDistributionsList = new TList();
6402 fDistributionsList->SetName("Distributions");
6403 fDistributionsList->SetOwner(kTRUE);
6404 fHistList->Add(fDistributionsList);
6406 // e) Book and nest list for various unclassified objects:
6407 if(fStorePhiDistributionForOneEvent)
6409 fVariousList = new TList();
6410 fVariousList->SetName("Various");
6411 fVariousList->SetOwner(kTRUE);
6412 fHistList->Add(fVariousList);
6415 // f) Book and nest list for other differential correlators:
6416 fOtherDiffCorrelatorsList = new TList();
6417 fOtherDiffCorrelatorsList->SetName("Other differential correlators");
6418 fOtherDiffCorrelatorsList->SetOwner(kTRUE);
6419 if(fCalculateDiffFlow){fHistList->Add(fOtherDiffCorrelatorsList);} // TBI: Use another flag here instead of fCalculateDiffFlow
6421 // g) Book and nest list for nested loops:
6422 fNestedLoopsList = new TList();
6423 fNestedLoopsList->SetName("Nested Loops");
6424 fNestedLoopsList->SetOwner(kTRUE);
6425 fHistList->Add(fNestedLoopsList);
6427 } // end of void AliFlowAnalysisWithQCumulants::BookAndNestAllLists()
6429 //================================================================================================================================
6431 void AliFlowAnalysisWithQCumulants::BookAndNestListsForDifferentialFlow()
6433 // Book and nest lists for differential flow.
6435 // Base list for differential flow objects:
6436 fDiffFlowList = new TList();
6437 fDiffFlowList->SetName("Differential Flow");
6438 fDiffFlowList->SetOwner(kTRUE);
6439 fHistList->Add(fDiffFlowList);
6442 TString typeFlag[2] = {"RP","POI"};
6443 TString ptEtaFlag[2] = {"p_{T}","#eta"};
6444 TString powerFlag[2] = {"linear","quadratic"};
6447 if(fCalculate2DDiffFlow)
6449 fDiffFlow2D = new TList();
6450 fDiffFlow2D->SetName("2D");
6451 fDiffFlow2D->SetOwner(kTRUE);
6452 fDiffFlowList->Add(fDiffFlow2D);
6453 for(Int_t t=0;t<2;t++)
6455 f2DDiffFlowCorrelationsProList[t] = new TList();
6456 f2DDiffFlowCorrelationsProList[t]->SetOwner(kTRUE);
6457 f2DDiffFlowCorrelationsProList[t]->SetName(Form("Profiles with 2D correlations (%s)",typeFlag[t].Data()));
6458 fDiffFlow2D->Add(f2DDiffFlowCorrelationsProList[t]);
6459 } // end of for(Int_t t=0;t<2;t++)
6460 } // end of if(fCalculate2DDiffFlow)
6462 // What follows bellow in this method is relevant only for 1D differential flow:
6463 if(!fCalculateDiffFlow){return;}
6465 // List holding profiles:
6466 fDiffFlowProfiles = new TList();
6467 fDiffFlowProfiles->SetName("Profiles");
6468 fDiffFlowProfiles->SetOwner(kTRUE);
6469 fDiffFlowList->Add(fDiffFlowProfiles);
6470 // List holding histograms with results:
6471 fDiffFlowResults = new TList();
6472 fDiffFlowResults->SetName("Results");
6473 fDiffFlowResults->SetOwner(kTRUE);
6474 fDiffFlowList->Add(fDiffFlowResults);
6475 // Flags used for naming nested lists in list fDiffFlowProfiles and fDiffFlowResults:
6477 list.SetOwner(kTRUE);
6478 // Nested lists in fDiffFlowProfiles (~/Differential Flow/Profiles):
6479 for(Int_t t=0;t<2;t++) // type: RP or POI
6481 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
6483 // list holding profiles with correlations:
6484 fDiffFlowCorrelationsProList[t][pe] = (TList*)list.Clone();
6485 fDiffFlowCorrelationsProList[t][pe]->SetName(Form("Profiles with correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6486 fDiffFlowProfiles->Add(fDiffFlowCorrelationsProList[t][pe]);
6487 // list holding profiles with products of correlations:
6488 fDiffFlowProductOfCorrelationsProList[t][pe] = (TList*)list.Clone();
6489 fDiffFlowProductOfCorrelationsProList[t][pe]->SetName(Form("Profiles with products of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6490 fDiffFlowProfiles->Add(fDiffFlowProductOfCorrelationsProList[t][pe]);
6491 // list holding profiles with corrections:
6492 fDiffFlowCorrectionsProList[t][pe] = (TList*)list.Clone();
6493 fDiffFlowCorrectionsProList[t][pe]->SetName(Form("Profiles with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6494 fDiffFlowProfiles->Add(fDiffFlowCorrectionsProList[t][pe]);
6495 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
6496 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
6497 // nested lists in fDiffFlowResults (~/Differential Flow/Results):
6498 for(Int_t t=0;t<2;t++) // type: RP or POI
6500 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
6502 // list holding histograms with correlations:
6503 fDiffFlowCorrelationsHistList[t][pe] = (TList*)list.Clone();
6504 fDiffFlowCorrelationsHistList[t][pe]->SetName(Form("Correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6505 fDiffFlowResults->Add(fDiffFlowCorrelationsHistList[t][pe]);
6506 // list holding histograms with corrections:
6507 fDiffFlowCorrectionsHistList[t][pe] = (TList*)list.Clone();
6508 fDiffFlowCorrectionsHistList[t][pe]->SetName(Form("Histograms with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6509 fDiffFlowResults->Add(fDiffFlowCorrectionsHistList[t][pe]);
6510 for(Int_t power=0;power<2;power++)
6512 // list holding histograms with sums of event weights:
6513 fDiffFlowSumOfEventWeightsHistList[t][pe][power] = (TList*)list.Clone();
6514 fDiffFlowSumOfEventWeightsHistList[t][pe][power]->SetName(Form("Sum of %s event weights (%s, %s)",powerFlag[power].Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6515 fDiffFlowResults->Add(fDiffFlowSumOfEventWeightsHistList[t][pe][power]);
6516 } // end of for(Int_t power=0;power<2;power++)
6517 // list holding histograms with sums of products of event weights:
6518 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe] = (TList*)list.Clone();
6519 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]->SetName(Form("Sum of products of event weights (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6520 fDiffFlowResults->Add(fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]);
6521 // list holding histograms with covariances of correlations:
6522 fDiffFlowCovariancesHistList[t][pe] = (TList*)list.Clone();
6523 fDiffFlowCovariancesHistList[t][pe]->SetName(Form("Covariances of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6524 fDiffFlowResults->Add(fDiffFlowCovariancesHistList[t][pe]);
6525 // list holding histograms with differential Q-cumulants:
6526 fDiffFlowCumulantsHistList[t][pe] = (TList*)list.Clone();
6527 fDiffFlowCumulantsHistList[t][pe]->SetName(Form("Differential Q-cumulants (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6528 fDiffFlowResults->Add(fDiffFlowCumulantsHistList[t][pe]);
6529 // list holding histograms which quantify detector bias to differential Q-cumulants:
6530 fDiffFlowDetectorBiasHistList[t][pe] = (TList*)list.Clone();
6531 fDiffFlowDetectorBiasHistList[t][pe]->SetName(Form("Detector bias (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6532 fDiffFlowResults->Add(fDiffFlowDetectorBiasHistList[t][pe]);
6533 // list holding histograms with differential flow estimates from Q-cumulants:
6534 fDiffFlowHistList[t][pe] = (TList*)list.Clone();
6535 fDiffFlowHistList[t][pe]->SetName(Form("Differential flow (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6536 fDiffFlowResults->Add(fDiffFlowHistList[t][pe]);
6537 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
6538 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
6540 } // end of void AliFlowAnalysisWithQCumulants::BookAndNestListsForDifferentialFlow()
6542 //================================================================================================================================
6544 void AliFlowAnalysisWithQCumulants::FillCommonHistResultsDiffFlow(TString type)
6546 // Fill common result histograms for differential flow.
6553 } else if(type == "POI")
6558 // to be improved - check all pointers used in this method
6560 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
6562 cout<<"WARNING: fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th"<<endl;
6563 cout<<" is NULL in AFAWQC::FCHRIF() !!!!"<<endl;
6568 for(Int_t p=1;p<=fnBinsPt;p++)
6570 Double_t v2 = fDiffFlow[t][0][0]->GetBinContent(p);
6571 Double_t v4 = fDiffFlow[t][0][1]->GetBinContent(p);
6572 Double_t v6 = fDiffFlow[t][0][2]->GetBinContent(p);
6573 Double_t v8 = fDiffFlow[t][0][3]->GetBinContent(p);
6575 Double_t v2Error = fDiffFlow[t][0][0]->GetBinError(p);
6576 Double_t v4Error = fDiffFlow[t][0][1]->GetBinError(p);
6577 //Double_t v6Error = fFinalFlow1D[t][pW][nua][0][2]->GetBinError(p);
6578 //Double_t v8Error = fFinalFlow1D[t][pW][nua][0][3]->GetBinError(p);
6582 fCommonHistsResults2nd->FillDifferentialFlowPtRP(p,v2,v2Error);
6583 fCommonHistsResults4th->FillDifferentialFlowPtRP(p,v4,v4Error);
6584 fCommonHistsResults6th->FillDifferentialFlowPtRP(p,v6,0.);
6585 fCommonHistsResults8th->FillDifferentialFlowPtRP(p,v8,0.);
6586 } else if(type == "POI")
6588 fCommonHistsResults2nd->FillDifferentialFlowPtPOI(p,v2,v2Error);
6589 fCommonHistsResults4th->FillDifferentialFlowPtPOI(p,v4,v4Error);
6590 fCommonHistsResults6th->FillDifferentialFlowPtPOI(p,v6,0.);
6591 fCommonHistsResults8th->FillDifferentialFlowPtPOI(p,v8,0.);
6593 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
6596 if(!fCalculateDiffFlowVsEta){return;}
6597 for(Int_t e=1;e<=fnBinsEta;e++)
6599 Double_t v2 = fDiffFlow[t][1][0]->GetBinContent(e);
6600 Double_t v4 = fDiffFlow[t][1][1]->GetBinContent(e);
6601 Double_t v6 = fDiffFlow[t][1][2]->GetBinContent(e);
6602 Double_t v8 = fDiffFlow[t][1][3]->GetBinContent(e);
6604 Double_t v2Error = fDiffFlow[t][1][0]->GetBinError(e);
6605 Double_t v4Error = fDiffFlow[t][1][1]->GetBinError(e);
6606 //Double_t v6Error = fDiffFlow[t][1][2]->GetBinError(e);
6607 //Double_t v8Error = fDiffFlow[t][1][3]->GetBinError(e);
6611 fCommonHistsResults2nd->FillDifferentialFlowEtaRP(e,v2,v2Error);
6612 fCommonHistsResults4th->FillDifferentialFlowEtaRP(e,v4,v4Error);
6613 fCommonHistsResults6th->FillDifferentialFlowEtaRP(e,v6,0.);
6614 fCommonHistsResults8th->FillDifferentialFlowEtaRP(e,v8,0.);
6615 } else if(type == "POI")
6617 fCommonHistsResults2nd->FillDifferentialFlowEtaPOI(e,v2,v2Error);
6618 fCommonHistsResults4th->FillDifferentialFlowEtaPOI(e,v4,v4Error);
6619 fCommonHistsResults6th->FillDifferentialFlowEtaPOI(e,v6,0.);
6620 fCommonHistsResults8th->FillDifferentialFlowEtaPOI(e,v8,0.);
6622 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
6624 } // end of void AliFlowAnalysisWithQCumulants::FillCommonHistResultsDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights, Bool_t correctedForNUA)
6626 //================================================================================================================================
6628 void AliFlowAnalysisWithQCumulants::CommonConstants(TString method)
6630 // Access and store common constants.
6632 // a) If this method was called in Init() access common constants from AliFlowCommonConstants;
6633 // b) If this method was called in Init() book and fill TProfile to hold constants accessed in a);
6634 // c) If this method was called in Finish() access common constants from TProfile booked and filled in b).
6636 if(method == "Init")
6638 // a) If this method was called in Init() access common constants from AliFlowCommonConstants:
6639 fnBinsPhi = AliFlowCommonConstants::GetMaster()->GetNbinsPhi();
6640 fPhiMin = AliFlowCommonConstants::GetMaster()->GetPhiMin();
6641 fPhiMax = AliFlowCommonConstants::GetMaster()->GetPhiMax();
6642 if(fnBinsPhi){fPhiBinWidth = (fPhiMax-fPhiMin)/fnBinsPhi;}
6643 fnBinsPt = AliFlowCommonConstants::GetMaster()->GetNbinsPt();
6644 fPtMin = AliFlowCommonConstants::GetMaster()->GetPtMin();
6645 fPtMax = AliFlowCommonConstants::GetMaster()->GetPtMax();
6646 if(fnBinsPt){fPtBinWidth = (fPtMax-fPtMin)/fnBinsPt;}
6647 fnBinsEta = AliFlowCommonConstants::GetMaster()->GetNbinsEta();
6648 fEtaMin = AliFlowCommonConstants::GetMaster()->GetEtaMin();
6649 fEtaMax = AliFlowCommonConstants::GetMaster()->GetEtaMax();
6650 if(fnBinsEta){fEtaBinWidth = (fEtaMax-fEtaMin)/fnBinsEta;}
6652 // b) If this method was called in Init() book and fill TProfile to hold constants accessed in a):
6653 TString fCommonConstantsName = "fCommonConstants";
6654 fCommonConstantsName += fAnalysisLabel->Data();
6655 fCommonConstants = new TProfile(fCommonConstantsName.Data(),"Common constants",9,0.,9.);
6656 fCommonConstants->SetLabelSize(0.05);
6657 fCommonConstants->GetXaxis()->SetBinLabel(1,"nBins (#phi)");
6658 fCommonConstants->Fill(0.5,fnBinsPhi);
6659 fCommonConstants->GetXaxis()->SetBinLabel(2,"#phi_{min}");
6660 fCommonConstants->Fill(1.5,fPhiMin);
6661 fCommonConstants->GetXaxis()->SetBinLabel(3,"#phi_{max}");
6662 fCommonConstants->Fill(2.5,fPhiMax);
6663 fCommonConstants->GetXaxis()->SetBinLabel(4,"nBins (p_{t})");
6664 fCommonConstants->Fill(3.5,fnBinsPt);
6665 fCommonConstants->GetXaxis()->SetBinLabel(5,"(p_{t})_{min}");
6666 fCommonConstants->Fill(4.5,fPtMin);
6667 fCommonConstants->GetXaxis()->SetBinLabel(6,"(p_{t})_{max}");
6668 fCommonConstants->Fill(5.5,fPtMax);
6669 fCommonConstants->GetXaxis()->SetBinLabel(7,"nBins (#eta)");
6670 fCommonConstants->Fill(6.5,fnBinsEta);
6671 fCommonConstants->GetXaxis()->SetBinLabel(8,"#eta_{min}");
6672 fCommonConstants->Fill(7.5,fEtaMin);
6673 fCommonConstants->GetXaxis()->SetBinLabel(9,"#eta_{max}");
6674 fCommonConstants->Fill(8.5,fEtaMax);
6675 fHistList->Add(fCommonConstants);
6676 } // end of if(method == "Init")
6677 else if(method == "Finish")
6679 // c) If this method was called in Finish() access common constants from TProfile booked and filled in b):
6680 if(!fCommonConstants)
6682 printf("\n WARNING (QC): fCommonConstants is NULL in AFAWQC::AC(\"%s\") !!!!\n\n",method.Data());
6685 fnBinsPhi = (Int_t)fCommonConstants->GetBinContent(1);
6686 fPhiMin = fCommonConstants->GetBinContent(2);
6687 fPhiMax = fCommonConstants->GetBinContent(3);
6688 if(fnBinsPhi){fPhiBinWidth = (fPhiMax-fPhiMin)/fnBinsPhi;}
6689 fnBinsPt = (Int_t)fCommonConstants->GetBinContent(4);
6690 fPtMin = fCommonConstants->GetBinContent(5);
6691 fPtMax = fCommonConstants->GetBinContent(6);
6692 if(fnBinsPt){fPtBinWidth = (fPtMax-fPtMin)/fnBinsPt;}
6693 fnBinsEta = (Int_t)fCommonConstants->GetBinContent(7);
6694 fEtaMin = fCommonConstants->GetBinContent(8);
6695 fEtaMax = fCommonConstants->GetBinContent(9);
6696 if(fnBinsEta){fEtaBinWidth = (fEtaMax-fEtaMin)/fnBinsEta;}
6697 } // end of else if(method == "Finish")
6699 } // end of void AliFlowAnalysisWithQCumulants::CommonConstants(TString method)
6701 //================================================================================================================================
6703 void AliFlowAnalysisWithQCumulants::CrossCheckSettings()
6705 // a) Cross check if the choice for multiplicity weights make sense.
6707 // a) Cross check if the choice for multiplicity weights make sense:
6708 if(strcmp(fMultiplicityWeight->Data(),"combinations") &&
6709 strcmp(fMultiplicityWeight->Data(),"unit") &&
6710 strcmp(fMultiplicityWeight->Data(),"multiplicity"))
6712 cout<<"WARNING (QC): Multiplicity weight can be either \"combinations\", \"unit\""<<endl;
6713 cout<<" or \"multiplicity\". Certainly not \""<<fMultiplicityWeight->Data()<<"\"."<<endl;
6717 } // end of void AliFlowAnalysisWithQCumulants::CrossCheckSettings()
6719 //================================================================================================================================
6721 void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeights()
6723 // Calculate sum of linear and quadratic event weights for correlations.
6726 Double_t dMult = (*fSpk)(0,0);
6728 for(Int_t p=0;p<2;p++) // power-1
6730 for(Int_t ci=0;ci<4;ci++) // correlation index
6732 fIntFlowSumOfEventWeights[p]->Fill(ci+0.5,pow(fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci+1),p+1));
6733 if(fCalculateCumulantsVsM)
6735 fIntFlowSumOfEventWeightsVsM[ci][p]->Fill(dMult+0.5,pow(fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci+1),p+1)); // to be improved: dMult => sum of weights?
6740 } // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeights()
6742 //================================================================================================================================
6744 void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeightsNUA()
6746 // Calculate sum of linear and quadratic event weights for NUA terms.
6748 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
6750 for(Int_t p=0;p<2;p++) // power-1
6752 for(Int_t ci=0;ci<4;ci++) // nua term index
6754 fIntFlowSumOfEventWeightsNUA[sc][p]->Fill(ci+0.5,pow(fIntFlowEventWeightForCorrectionTermsForNUAEBE[sc]->GetBinContent(ci+1),p+1));
6759 } // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeightsNUA()
6761 //================================================================================================================================
6763 void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfProductOfEventWeights()
6765 // Calculate sum of product of event weights for correlations.
6768 Double_t dMult = (*fSpk)(0,0);
6772 for(Int_t ci1=1;ci1<4;ci1++)
6774 for(Int_t ci2=ci1+1;ci2<=4;ci2++)
6776 fIntFlowSumOfProductOfEventWeights->Fill(0.5+counter,
6777 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
6778 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
6779 if(fCalculateCumulantsVsM)
6781 fIntFlowSumOfProductOfEventWeightsVsM[counter]->Fill(dMult+0.5, // to be improved: dMult => sum of weights?
6782 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
6783 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
6784 } // end of if(fCalculateCumulantsVsM)
6789 } // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfProductOfEventWeights()
6791 //================================================================================================================================
6793 void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfProductOfEventWeightsNUA()
6795 // Calculate sum of product of event weights for NUA terms.
6797 // w_{<2>} * w_{<cos(#phi)>}:
6798 fIntFlowSumOfProductOfEventWeightsNUA->Fill(0.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6799 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
6800 // w_{<2>} * w_{<sin(#phi)>}:
6801 fIntFlowSumOfProductOfEventWeightsNUA->Fill(1.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6802 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
6803 // w_{<cos(#phi)> * w_{<sin(#phi)>}:
6804 fIntFlowSumOfProductOfEventWeightsNUA->Fill(2.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6805 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
6806 // w_{<2>} * w{<cos(phi1+phi2)>}
6807 fIntFlowSumOfProductOfEventWeightsNUA->Fill(3.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6808 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
6809 // w_{<2>} * w{<sin(phi1+phi2)>}
6810 fIntFlowSumOfProductOfEventWeightsNUA->Fill(4.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6811 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6812 // w_{<2>} * w{<cos(phi1-phi2-phi3)>}
6813 fIntFlowSumOfProductOfEventWeightsNUA->Fill(5.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6814 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6815 // w_{<2>} * w{<sin(phi1-phi2-phi3)>}
6816 fIntFlowSumOfProductOfEventWeightsNUA->Fill(6.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6817 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6818 // w_{<4>} * w{<cos(phi1)>}
6819 fIntFlowSumOfProductOfEventWeightsNUA->Fill(7.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6820 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
6821 // w_{<4>} * w{<sin(phi1)>}
6822 fIntFlowSumOfProductOfEventWeightsNUA->Fill(8.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6823 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
6824 // w_{<4>} * w{<cos(phi1+phi2)>}
6825 fIntFlowSumOfProductOfEventWeightsNUA->Fill(9.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6826 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
6827 // w_{<4>} * w{<sin(phi1+phi2)>}
6828 fIntFlowSumOfProductOfEventWeightsNUA->Fill(10.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6829 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6830 // w_{<4>} * w{<cos(phi1-phi2-phi3)>}
6831 fIntFlowSumOfProductOfEventWeightsNUA->Fill(11.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6832 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6833 // w_{<4>} * w{<sin(phi1-phi2-phi3)>}
6834 fIntFlowSumOfProductOfEventWeightsNUA->Fill(12.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6835 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6836 // w_{<cos(phi1)>} * w{<cos(phi1+phi2)>}
6837 fIntFlowSumOfProductOfEventWeightsNUA->Fill(13.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6838 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
6839 // w_{<cos(phi1)>} * w{<sin(phi1+phi2)>}
6840 fIntFlowSumOfProductOfEventWeightsNUA->Fill(14.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6841 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6842 // w_{<cos(phi1)>} * w{<cos(phi1-phi2-phi3)>}
6843 fIntFlowSumOfProductOfEventWeightsNUA->Fill(15.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6844 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6845 // w_{<cos(phi1)>} * w{<sin(phi1-phi2-phi3)>}
6846 fIntFlowSumOfProductOfEventWeightsNUA->Fill(16.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6847 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6848 // w_{<sin(phi1)>} * w{<cos(phi1+phi2)>}
6849 fIntFlowSumOfProductOfEventWeightsNUA->Fill(17.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
6850 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
6851 // w_{<sin(phi1)>} * w{<sin(phi1+phi2)>}
6852 fIntFlowSumOfProductOfEventWeightsNUA->Fill(18.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
6853 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6854 // w_{<sin(phi1)>} * w{<cos(phi1-phi2-phi3)>}
6855 fIntFlowSumOfProductOfEventWeightsNUA->Fill(19.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
6856 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6857 // w_{<sin(phi1)>} * w{<sin(phi1-phi2-phi3)>}
6858 fIntFlowSumOfProductOfEventWeightsNUA->Fill(20.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
6859 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6860 // w_{<cos(phi1+phi2)>} * w{<sin(phi1+phi2))>}
6861 fIntFlowSumOfProductOfEventWeightsNUA->Fill(21.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)*
6862 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6863 // w_{<cos(phi1+phi2)>} * w{<cos(phi1-phi2-phi3)>}
6864 fIntFlowSumOfProductOfEventWeightsNUA->Fill(22.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)*
6865 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6866 // w_{<cos(phi1+phi2)>} * w{<sin(phi1-phi2-phi3)>}
6867 fIntFlowSumOfProductOfEventWeightsNUA->Fill(23.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)*
6868 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6869 // w_{<sin(phi1+phi2)>} * w{<cos(phi1-phi2-phi3)>}
6870 fIntFlowSumOfProductOfEventWeightsNUA->Fill(24.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)*
6871 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6872 // w_{<sin(phi1+phi2)>} * w{<sin(phi1-phi2-phi3)>}
6873 fIntFlowSumOfProductOfEventWeightsNUA->Fill(25.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)*
6874 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6875 // w_{<cos(phi1-phi2-phi3)>} * w{<sin(phi1-phi2-phi3)>}
6876 fIntFlowSumOfProductOfEventWeightsNUA->Fill(26.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3)*
6877 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6879 } // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowIntFlowSumOfProductOfEventWeightsNUA()
6881 //================================================================================================================================
6883 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelations(TString type, TString ptOrEta)
6885 // Calculate reduced correlations for RPs or POIs for all pt and eta bins.
6888 Double_t dMult = (*fSpk)(0,0);
6890 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
6891 Double_t dReQ1n = (*fReQ)(0,0);
6892 Double_t dReQ2n = (*fReQ)(1,0);
6893 //Double_t dReQ3n = (*fReQ)(2,0);
6894 //Double_t dReQ4n = (*fReQ)(3,0);
6895 Double_t dImQ1n = (*fImQ)(0,0);
6896 Double_t dImQ2n = (*fImQ)(1,0);
6897 //Double_t dImQ3n = (*fImQ)(2,0);
6898 //Double_t dImQ4n = (*fImQ)(3,0);
6900 // reduced correlations are stored in fDiffFlowCorrelationsPro[0=RP,1=POI][0=pt,1=eta][correlation index]. Correlation index runs as follows:
6907 Int_t t = 0; // type flag
6908 Int_t pe = 0; // ptEta flag
6913 } else if(type == "POI")
6921 } else if(ptOrEta == "Eta")
6926 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6927 Double_t minPtEta[2] = {fPtMin,fEtaMin};
6928 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
6929 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
6931 // looping over all bins and calculating reduced correlations:
6932 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6934 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
6935 Double_t p1n0kRe = 0.;
6936 Double_t p1n0kIm = 0.;
6938 // number of POIs in particular pt or eta bin:
6941 // real and imaginary parts of q_{m*n,0} (non-weighted Q-vector evaluated for particles which are both RPs and POIs in particular pt or eta bin):
6942 Double_t q1n0kRe = 0.;
6943 Double_t q1n0kIm = 0.;
6944 Double_t q2n0kRe = 0.;
6945 Double_t q2n0kIm = 0.;
6947 // number of particles which are both RPs and POIs in particular pt or eta bin:
6953 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))
6954 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));
6955 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))
6956 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));
6957 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))
6958 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));
6959 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))
6960 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b));
6962 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
6964 else if(type == "RP")
6967 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
6968 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
6969 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
6970 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
6971 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))
6972 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));
6973 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))
6974 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b));
6976 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
6982 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
6983 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
6984 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
6985 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
6987 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
6989 t = 1; // typeFlag = RP or POI
6991 else if(type == "RP")
6993 // p_{m*n,0} = q_{m*n,0}:
6999 t = 0; // typeFlag = RP or POI
7002 // 2'-particle correlation for particular pt or eta bin:
7003 Double_t two1n1nPtEta = 0.;
7004 Double_t mWeight2pPrime = 0.; // multiplicity weight for <2'>
7007 two1n1nPtEta = (p1n0kRe*dReQ1n+p1n0kIm*dImQ1n-mq)
7009 // determine multiplicity weight:
7010 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
7012 mWeight2pPrime = mp*dMult-mq;
7013 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
7015 mWeight2pPrime = 1.;
7017 if(type == "POI") // to be improved (I do not this if)
7019 // fill profile to get <<2'>> for POIs
7020 fDiffFlowCorrelationsPro[1][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta,mWeight2pPrime);
7021 // fill profile to get <<2'>^2> for POIs
7022 fDiffFlowSquaredCorrelationsPro[1][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta*two1n1nPtEta,mWeight2pPrime);
7023 // histogram to store <2'> for POIs e-b-e (needed in some other methods):
7024 fDiffFlowCorrelationsEBE[1][pe][0]->SetBinContent(b,two1n1nPtEta);
7025 fDiffFlowEventWeightsForCorrelationsEBE[1][pe][0]->SetBinContent(b,mWeight2pPrime);
7027 else if(type == "RP") // to be improved (I do not this if)
7029 // profile to get <<2'>> for RPs:
7030 fDiffFlowCorrelationsPro[0][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta,mWeight2pPrime);
7031 // profile to get <<2'>^2> for RPs:
7032 fDiffFlowSquaredCorrelationsPro[0][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta*two1n1nPtEta,mWeight2pPrime);
7033 // histogram to store <2'> for RPs e-b-e (needed in some other methods):
7034 fDiffFlowCorrelationsEBE[0][pe][0]->SetBinContent(b,two1n1nPtEta);
7035 fDiffFlowEventWeightsForCorrelationsEBE[0][pe][0]->SetBinContent(b,mWeight2pPrime);
7037 } // end of if(mp*dMult-mq)
7039 // 4'-particle correlation:
7040 Double_t four1n1n1n1nPtEta = 0.;
7041 Double_t mWeight4pPrime = 0.; // multiplicity weight for <4'>
7042 if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
7043 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)
7045 four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
7046 - q2n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))
7047 - 2.*q2n0kIm*dReQ1n*dImQ1n
7048 - p1n0kRe*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)
7049 + p1n0kIm*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)
7050 - 2.*dMult*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
7051 - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*mq
7052 + 6.*(q1n0kRe*dReQ1n+q1n0kIm*dImQ1n)
7053 + 1.*(q2n0kRe*dReQ2n+q2n0kIm*dImQ2n)
7054 + 2.*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
7057 / ((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
7058 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
7059 // determine multiplicity weight:
7060 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
7062 mWeight4pPrime = (mp-mq)*dMult*(dMult-1.)*(dMult-2.) + mq*(dMult-1.)*(dMult-2.)*(dMult-3.);
7063 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
7065 mWeight4pPrime = 1.;
7069 // profile to get <<4'>> for POIs:
7070 fDiffFlowCorrelationsPro[1][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta,mWeight4pPrime);
7071 // profile to get <<4'>^2> for POIs:
7072 fDiffFlowSquaredCorrelationsPro[1][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta*four1n1n1n1nPtEta,mWeight4pPrime);
7073 // histogram to store <4'> for POIs e-b-e (needed in some other methods):
7074 fDiffFlowCorrelationsEBE[1][pe][1]->SetBinContent(b,four1n1n1n1nPtEta);
7075 fDiffFlowEventWeightsForCorrelationsEBE[1][pe][1]->SetBinContent(b,mWeight4pPrime);
7077 else if(type == "RP")
7079 // profile to get <<4'>> for RPs:
7080 fDiffFlowCorrelationsPro[0][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta,mWeight4pPrime);
7081 // profile to get <<4'>^2> for RPs:
7082 fDiffFlowSquaredCorrelationsPro[0][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta*four1n1n1n1nPtEta,mWeight4pPrime);
7083 // histogram to store <4'> for RPs e-b-e (needed in some other methods):
7084 fDiffFlowCorrelationsEBE[0][pe][1]->SetBinContent(b,four1n1n1n1nPtEta);
7085 fDiffFlowEventWeightsForCorrelationsEBE[0][pe][1]->SetBinContent(b,mWeight4pPrime);
7087 } // end of if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
7088 // +mq*(dMult-1.)*(dMult-2.)*(dMult-3.))
7090 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7093 } // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelations(TString type, TString ptOrEta);
7095 //================================================================================================================================
7097 void AliFlowAnalysisWithQCumulants::CalculateOtherDiffCorrelators(TString type, TString ptOrEta)
7099 // Calculate other differential correlators for RPs or POIs for all pt and eta bins.
7102 Double_t dMult = (*fSpk)(0,0);
7104 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
7105 Double_t dReQ1n = (*fReQ)(0,0);
7106 Double_t dReQ2n = (*fReQ)(1,0);
7107 Double_t dReQ3n = (*fReQ)(2,0);
7108 //Double_t dReQ4n = (*fReQ)(3,0);
7109 Double_t dImQ1n = (*fImQ)(0,0);
7110 Double_t dImQ2n = (*fImQ)(1,0);
7111 Double_t dImQ3n = (*fImQ)(2,0);
7112 //Double_t dImQ4n = (*fImQ)(3,0);
7114 // Other correlations are stored in fOtherDiffCorrelators[2][2][2][1], [0=RP,1=POI][0=pt,1=eta][0=sin terms,1=cos terms][correlator index]
7115 // Correlation index runs as follows:
7117 // 0: <exp[in(psi1-3phi2+2phi3)]>
7119 Int_t t = 0; // type flag
7120 Int_t pe = 0; // ptEta flag
7125 } else if(type == "POI")
7133 } else if(ptOrEta == "Eta")
7138 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
7139 Double_t minPtEta[2] = {fPtMin,fEtaMin};
7140 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
7141 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
7143 // looping over all bins and calculating reduced correlations:
7144 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7146 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
7147 Double_t p1n0kRe = 0.;
7148 Double_t p1n0kIm = 0.;
7150 // number of POIs in particular pt or eta bin:
7153 // real and imaginary parts of q_{m*n,0} (non-weighted Q-vector evaluated for particles which are both RPs and POIs in particular pt or eta bin):
7154 Double_t q1n0kRe = 0.;
7155 Double_t q1n0kIm = 0.;
7156 Double_t q2n0kRe = 0.;
7157 Double_t q2n0kIm = 0.;
7158 Double_t q3n0kRe = 0.;
7159 Double_t q3n0kIm = 0.;
7161 // number of particles which are both RPs and POIs in particular pt or eta bin:
7167 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))
7168 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));
7169 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))
7170 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));
7171 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))
7172 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));
7173 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))
7174 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b));
7175 q3n0kRe = fReRPQ1dEBE[2][pe][2][0]->GetBinContent(fReRPQ1dEBE[2][pe][2][0]->GetBin(b))
7176 * fReRPQ1dEBE[2][pe][2][0]->GetBinEntries(fReRPQ1dEBE[2][pe][2][0]->GetBin(b));
7177 q3n0kIm = fImRPQ1dEBE[2][pe][2][0]->GetBinContent(fImRPQ1dEBE[2][pe][2][0]->GetBin(b))
7178 * fImRPQ1dEBE[2][pe][2][0]->GetBinEntries(fImRPQ1dEBE[2][pe][2][0]->GetBin(b));
7180 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
7182 else if(type == "RP")
7185 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
7186 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
7187 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
7188 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
7189 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))
7190 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));
7191 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))
7192 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b));
7193 q3n0kRe = fReRPQ1dEBE[0][pe][2][0]->GetBinContent(fReRPQ1dEBE[0][pe][2][0]->GetBin(b))
7194 * fReRPQ1dEBE[0][pe][2][0]->GetBinEntries(fReRPQ1dEBE[0][pe][2][0]->GetBin(b));
7195 q3n0kIm = fImRPQ1dEBE[0][pe][2][0]->GetBinContent(fImRPQ1dEBE[0][pe][2][0]->GetBin(b))
7196 * fImRPQ1dEBE[0][pe][2][0]->GetBinEntries(fImRPQ1dEBE[0][pe][2][0]->GetBin(b));
7198 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
7204 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
7205 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
7206 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
7207 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
7209 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
7211 t = 1; // typeFlag = RP or POI
7213 else if(type == "RP")
7215 // p_{m*n,0} = q_{m*n,0}:
7221 t = 0; // typeFlag = RP or POI
7224 // 3'-particle correlators:
7225 // Taeney-Yan correlator:
7226 Double_t dTaeneyYan = 0.;
7227 Double_t mWeightTaeneyYan = 0.; // multiplicity weight for Taeney-Yan correlator
7228 if((mp*dMult-2.*mq)*(dMult-1.) > 0.) // to be improved - is this condition fully justified?
7230 dTaeneyYan = (dReQ3n*(p1n0kRe*dReQ2n-p1n0kIm*dImQ2n)+dImQ3n*(p1n0kIm*dReQ2n+p1n0kRe*dImQ2n)
7231 - p1n0kRe*dReQ1n - p1n0kIm*dImQ1n
7232 - q2n0kRe*dReQ2n - q2n0kIm*dImQ2n
7233 - q3n0kRe*dReQ3n - q3n0kIm*dImQ3n
7235 / ((mp*dMult-2.*mq)*(dMult-1.));
7236 // determine multiplicity weight:
7237 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
7239 mWeightTaeneyYan = (mp*dMult-2.*mq)*(dMult-1.);
7240 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
7242 mWeightTaeneyYan = 1.;
7245 fOtherDiffCorrelators[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dTaeneyYan,mWeightTaeneyYan);
7246 } // end of if((mp*dMult-2.*mq)*(dMult-1.) > 0.)
7248 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7250 } // end of void AliFlowAnalysisWithQCumulants::CalculateOtherDiffCorrelators(TString type, TString ptOrEta)
7252 //================================================================================================================================
7254 void AliFlowAnalysisWithQCumulants::Calculate2DDiffFlowCorrelations(TString type)
7256 // Calculate all reduced correlations needed for 2D differential flow for each (pt,eta) bin.
7259 Double_t dMult = (*fSpk)(0,0);
7260 // Real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
7261 Double_t dReQ1n = (*fReQ)(0,0);
7262 Double_t dReQ2n = (*fReQ)(1,0);
7263 //Double_t dReQ3n = (*fReQ)(2,0);
7264 //Double_t dReQ4n = (*fReQ)(3,0);
7265 Double_t dImQ1n = (*fImQ)(0,0);
7266 Double_t dImQ2n = (*fImQ)(1,0);
7267 //Double_t dImQ3n = (*fImQ)(2,0);
7268 //Double_t dImQ4n = (*fImQ)(3,0);
7270 // 2D reduced correlations are stored in TProfile2D f2DDiffFlowCorrelationsPro[0=RP,1=POI][correlation index].
7271 // Correlation index runs as follows:
7277 Int_t t = 0; // type flag
7281 } else if(type == "POI")
7286 // Looping over all (pt,eta) bins and calculating correlations needed for differential flow:
7287 for(Int_t p=1;p<=fnBinsPt;p++)
7289 for(Int_t e=1;e<=fnBinsEta;e++)
7291 // Real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin):
7292 Double_t p1n0kRe = 0.;
7293 Double_t p1n0kIm = 0.;
7294 // Number of POIs in particular pt or eta bin:
7296 // Real and imaginary parts of q_{m*n,0} (non-weighted Q-vector evaluated for 'RP && POI particles' in particular pt or eta bin):
7297 Double_t q1n0kRe = 0.;
7298 Double_t q1n0kIm = 0.;
7299 Double_t q2n0kRe = 0.;
7300 Double_t q2n0kIm = 0.;
7301 // Number of 'RP && POI particles' in particular pt or eta bin:
7306 q1n0kRe = fReRPQ2dEBE[2][0][0]->GetBinContent(fReRPQ2dEBE[2][0][0]->GetBin(p,e))
7307 * fReRPQ2dEBE[2][0][0]->GetBinEntries(fReRPQ2dEBE[2][0][0]->GetBin(p,e));
7308 q1n0kIm = fImRPQ2dEBE[2][0][0]->GetBinContent(fImRPQ2dEBE[2][0][0]->GetBin(p,e))
7309 * fImRPQ2dEBE[2][0][0]->GetBinEntries(fImRPQ2dEBE[2][0][0]->GetBin(p,e));
7310 q2n0kRe = fReRPQ2dEBE[2][1][0]->GetBinContent(fReRPQ2dEBE[2][1][0]->GetBin(p,e))
7311 * fReRPQ2dEBE[2][1][0]->GetBinEntries(fReRPQ2dEBE[2][1][0]->GetBin(p,e));
7312 q2n0kIm = fImRPQ2dEBE[2][1][0]->GetBinContent(fImRPQ2dEBE[2][1][0]->GetBin(p,e))
7313 * fImRPQ2dEBE[2][1][0]->GetBinEntries(fImRPQ2dEBE[2][1][0]->GetBin(p,e));
7315 mq = fReRPQ2dEBE[2][0][0]->GetBinEntries(fReRPQ2dEBE[2][0][0]->GetBin(p,e)); // to be improved (cross-checked by accessing other profiles here)
7316 } // end of if(type == "POI")
7317 else if(type == "RP")
7320 q1n0kRe = fReRPQ2dEBE[0][0][0]->GetBinContent(fReRPQ2dEBE[0][0][0]->GetBin(p,e))
7321 * fReRPQ2dEBE[0][0][0]->GetBinEntries(fReRPQ2dEBE[0][0][0]->GetBin(p,e));
7322 q1n0kIm = fImRPQ2dEBE[0][0][0]->GetBinContent(fImRPQ2dEBE[0][0][0]->GetBin(p,e))
7323 * fImRPQ2dEBE[0][0][0]->GetBinEntries(fImRPQ2dEBE[0][0][0]->GetBin(p,e));
7324 q2n0kRe = fReRPQ2dEBE[0][1][0]->GetBinContent(fReRPQ2dEBE[0][1][0]->GetBin(p,e))
7325 * fReRPQ2dEBE[0][1][0]->GetBinEntries(fReRPQ2dEBE[0][1][0]->GetBin(p,e));
7326 q2n0kIm = fImRPQ2dEBE[0][1][0]->GetBinContent(fImRPQ2dEBE[0][1][0]->GetBin(p,e))
7327 * fImRPQ2dEBE[0][1][0]->GetBinEntries(fImRPQ2dEBE[0][1][0]->GetBin(p,e));
7329 mq = fReRPQ2dEBE[0][0][0]->GetBinEntries(fReRPQ2dEBE[0][0][0]->GetBin(p,e)); // to be improved (cross-checked by accessing other profiles here)
7330 } // end of else if(type == "RP")
7334 p1n0kRe = fReRPQ2dEBE[1][0][0]->GetBinContent(fReRPQ2dEBE[1][0][0]->GetBin(p,e))
7335 * fReRPQ2dEBE[1][0][0]->GetBinEntries(fReRPQ2dEBE[1][0][0]->GetBin(p,e));
7336 p1n0kIm = fImRPQ2dEBE[1][0][0]->GetBinContent(fImRPQ2dEBE[1][0][0]->GetBin(p,e))
7337 * fImRPQ2dEBE[1][0][0]->GetBinEntries(fImRPQ2dEBE[1][0][0]->GetBin(p,e));
7339 mp = fReRPQ2dEBE[1][0][0]->GetBinEntries(fReRPQ2dEBE[1][0][0]->GetBin(p,e)); // to be improved (cross-checked by accessing other profiles here)
7341 t = 1; // typeFlag = RP or POI
7342 } // end of if(type == "POI")
7343 else if(type == "RP")
7345 // p_{m*n,0} = q_{m*n,0}:
7351 t = 0; // typeFlag = RP or POI
7352 } // end of if(type == "RP")
7354 // 2'-particle correlation for particular (pt,eta) bin:
7355 Double_t two1n1nPtEta = 0.;
7356 Double_t mWeight2pPrime = 0.; // multiplicity weight for <2'>
7359 two1n1nPtEta = (p1n0kRe*dReQ1n+p1n0kIm*dImQ1n-mq)
7361 // Determine multiplicity weight:
7362 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
7364 mWeight2pPrime = mp*dMult-mq;
7365 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
7367 mWeight2pPrime = 1.;
7369 // Fill 2D profile holding <<2'>>:
7370 f2DDiffFlowCorrelationsPro[t][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mWeight2pPrime);
7371 } // end of if(mp*dMult-mq)
7373 // 4'-particle correlation:
7374 Double_t four1n1n1n1nPtEta = 0.;
7375 Double_t mWeight4pPrime = 0.; // multiplicity weight for <4'>
7376 if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
7377 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)
7379 four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
7380 - q2n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))
7381 - 2.*q2n0kIm*dReQ1n*dImQ1n
7382 - p1n0kRe*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)
7383 + p1n0kIm*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)
7384 - 2.*dMult*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
7385 - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*mq
7386 + 6.*(q1n0kRe*dReQ1n+q1n0kIm*dImQ1n)
7387 + 1.*(q2n0kRe*dReQ2n+q2n0kIm*dImQ2n)
7388 + 2.*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
7391 / ((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
7392 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
7393 // Determine multiplicity weight:
7394 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
7396 mWeight4pPrime = (mp-mq)*dMult*(dMult-1.)*(dMult-2.) + mq*(dMult-1.)*(dMult-2.)*(dMult-3.);
7397 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
7399 mWeight4pPrime = 1.;
7401 // Fill 2D profile holding <<4'>>:
7402 f2DDiffFlowCorrelationsPro[t][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,mWeight4pPrime);
7403 } // end of if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
7404 // +mq*(dMult-1.)*(dMult-2.)*(dMult-3.))
7405 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
7406 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
7408 } // end of AliFlowAnalysisWithQCumulants::Calculate2DDiffFlowCorrelations(TString type)
7410 //================================================================================================================================
7412 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfEventWeights(TString type, TString ptOrEta)
7414 // Calculate sums of various event weights for reduced correlations.
7415 // (These quantitites are needed in expressions for unbiased estimators relevant for the statistical errors.)
7418 Int_t ptEtaFlag = 0;
7423 } else if(type == "POI")
7431 } else if(ptOrEta == "Eta")
7438 Int_t pe = ptEtaFlag;
7441 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
7442 Double_t minPtEta[2] = {fPtMin,fEtaMin};
7443 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
7444 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
7446 for(Int_t rpq=0;rpq<3;rpq++)
7448 for(Int_t m=0;m<4;m++)
7450 for(Int_t k=0;k<9;k++)
7452 if(!fReRPQ1dEBE[rpq][pe][m][k])
7454 cout<<"WARNING: fReRPQ1dEBE[rpq][pe][m][k] is NULL in AFAWQC::CSAPOEWFDF() !!!!"<<endl;
7455 cout<<"pe = "<<pe<<endl;
7456 cout<<"rpq = "<<rpq<<endl;
7457 cout<<"m = "<<m<<endl;
7458 cout<<"k = "<<k<<endl;
7466 Double_t dMult = (*fSpk)(0,0); // total event multiplicity
7467 //Double_t mr = 0.; // number of RPs in particular pt or eta bin
7468 Double_t mp = 0.; // number of POIs in particular pt or eta bin
7469 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin
7471 // event weights for reduced correlations:
7472 Double_t dw2 = 0.; // event weight for <2'>
7473 Double_t dw4 = 0.; // event weight for <4'>
7474 //Double_t dw6 = 0.; // event weight for <6'>
7475 //Double_t dw8 = 0.; // event weight for <8'>
7477 // looping over bins:
7478 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7482 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);
7483 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
7484 } else if(type == "POI")
7486 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);
7487 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b);
7490 // event weight for <2'>:
7492 fDiffFlowSumOfEventWeights[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2);
7493 fDiffFlowSumOfEventWeights[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw2,2.));
7495 // event weight for <4'>:
7496 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
7497 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.);
7498 fDiffFlowSumOfEventWeights[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4);
7499 fDiffFlowSumOfEventWeights[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw4,2.));
7501 // event weight for <6'>:
7503 //fDiffFlowSumOfEventWeights[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6);
7504 //fDiffFlowSumOfEventWeights[t][pe][t][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw6,2.));
7506 // event weight for <8'>:
7508 //fDiffFlowSumOfEventWeights[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw8);
7509 //fDiffFlowSumOfEventWeights[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw8,2.));
7510 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7512 } // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfEventWeights()
7515 //================================================================================================================================
7518 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfProductOfEventWeights(TString type, TString ptOrEta)
7520 // Calculate sum of products of various event weights for both types of correlations (the ones for int. and diff. flow).
7521 // (These quantitites are needed in expressions for unbiased estimators relevant for the statistical errors.)
7523 // Important: To fill fDiffFlowSumOfProductOfEventWeights[][][][] use bellow table (i,j) with following constraints:
7525 // 2.) do not store terms which DO NOT include reduced correlations;
7527 // [0=<2>,1=<2'>,2=<4>,3=<4'>,4=<6>,5=<6'>,6=<8>,7=<8'>] x [0=<2>,1=<2'>,2=<4>,3=<4'>,4=<6>,5=<6'>,6=<8>,7=<8'>]
7530 Int_t ptEtaFlag = 0;
7535 } else if(type == "POI")
7543 } else if(ptOrEta == "Eta")
7550 Int_t pe = ptEtaFlag;
7553 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
7554 Double_t minPtEta[2] = {fPtMin,fEtaMin};
7555 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
7556 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
7559 for(Int_t rpq=0;rpq<3;rpq++)
7561 for(Int_t m=0;m<4;m++)
7563 for(Int_t k=0;k<9;k++)
7565 if(!fReRPQ1dEBE[rpq][pe][m][k])
7567 cout<<"WARNING: fReRPQ1dEBE[rpq][pe][m][k] is NULL in AFAWQC::CSAPOEWFDF() !!!!"<<endl;
7568 cout<<"pe = "<<pe<<endl;
7569 cout<<"rpq = "<<rpq<<endl;
7570 cout<<"m = "<<m<<endl;
7571 cout<<"k = "<<k<<endl;
7579 Double_t dMult = (*fSpk)(0,0); // total event multiplicity
7580 //Double_t mr = 0.; // number of RPs in particular pt or eta bin
7581 Double_t mp = 0.; // number of POIs in particular pt or eta bin
7582 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin
7584 // event weights for correlations:
7585 Double_t dW2 = dMult*(dMult-1); // event weight for <2>
7586 Double_t dW4 = dMult*(dMult-1)*(dMult-2)*(dMult-3); // event weight for <4>
7587 Double_t dW6 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5); // event weight for <6>
7588 Double_t dW8 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7); // event weight for <8>
7590 // event weights for reduced correlations:
7591 Double_t dw2 = 0.; // event weight for <2'>
7592 Double_t dw4 = 0.; // event weight for <4'>
7593 //Double_t dw6 = 0.; // event weight for <6'>
7594 //Double_t dw8 = 0.; // event weight for <8'>
7596 // looping over bins:
7597 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7601 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);
7602 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
7603 } else if(type == "POI")
7605 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);
7606 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b);
7609 // event weight for <2'>:
7611 fDiffFlowSumOfProductOfEventWeights[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw2); // storing product of even weights for <2> and <2'>
7612 fDiffFlowSumOfProductOfEventWeights[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW4); // storing product of even weights for <4> and <2'>
7613 fDiffFlowSumOfProductOfEventWeights[t][pe][1][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW6); // storing product of even weights for <6> and <2'>
7614 fDiffFlowSumOfProductOfEventWeights[t][pe][1][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW8); // storing product of even weights for <8> and <2'>
7616 // event weight for <4'>:
7617 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
7618 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.);
7619 fDiffFlowSumOfProductOfEventWeights[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw4); // storing product of even weights for <2> and <4'>
7620 fDiffFlowSumOfProductOfEventWeights[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw4); // storing product of even weights for <2'> and <4'>
7621 fDiffFlowSumOfProductOfEventWeights[t][pe][2][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw4); // storing product of even weights for <4> and <4'>
7622 fDiffFlowSumOfProductOfEventWeights[t][pe][3][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dW6); // storing product of even weights for <6> and <4'>
7623 fDiffFlowSumOfProductOfEventWeights[t][pe][3][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dW8); // storing product of even weights for <8> and <4'>
7625 // event weight for <6'>:
7627 //fDiffFlowSumOfProductOfEventWeights[t][pe][0][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw6); // storing product of even weights for <2> and <6'>
7628 //fDiffFlowSumOfProductOfEventWeights[t][pe][1][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw6); // storing product of even weights for <2'> and <6'>
7629 //fDiffFlowSumOfProductOfEventWeights[t][pe][2][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw6); // storing product of even weights for <4> and <6'>
7630 //fDiffFlowSumOfProductOfEventWeights[t][pe][3][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dw6); // storing product of even weights for <4'> and <6'>
7631 //fDiffFlowSumOfProductOfEventWeights[t][pe][4][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW6*dw6); // storing product of even weights for <6> and <6'>
7632 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dW8); // storing product of even weights for <6'> and <8>
7633 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dw8); // storing product of even weights for <6'> and <8'>
7635 // event weight for <8'>:
7637 //fDiffFlowSumOfProductOfEventWeights[t][pe][0][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw8); // storing product of even weights for <2> and <8'>
7638 //fDiffFlowSumOfProductOfEventWeights[t][pe][1][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw8); // storing product of even weights for <2'> and <8'>
7639 //fDiffFlowSumOfProductOfEventWeights[t][pe][2][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw8); // storing product of even weights for <4> and <8'>
7640 //fDiffFlowSumOfProductOfEventWeights[t][pe][3][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dw8); // storing product of even weights for <4'> and <8'>
7641 //fDiffFlowSumOfProductOfEventWeights[t][pe][4][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW6*dw8); // storing product of even weights for <6> and <8'>
7642 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dw8); // storing product of even weights for <6'> and <8'>
7643 //fDiffFlowSumOfProductOfEventWeights[t][pe][6][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW8*dw8); // storing product of even weights for <8> and <8'>
7646 // [0=<2>,1=<2'>,2=<4>,3=<4'>,4=<6>,5=<6'>,6=<8>,7=<8'>] x [0=<2>,1=<2'>,2=<4>,3=<4'>,4=<6>,5=<6'>,6=<8>,7=<8'>]
7648 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7652 } // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfProductOfEventWeights(TString type, TString ptOrEta)
7654 //================================================================================================================================
7656 void AliFlowAnalysisWithQCumulants::FinalizeReducedCorrelations(TString type, TString ptOrEta)
7658 // Transfer profiles into histograms and calculate statistical errors correctly.
7660 Int_t t = 0; // RP or POI
7661 Int_t pe = 0; // pt or eta
7666 } else if(type == "POI")
7674 } else if(ptOrEta == "Eta")
7679 for(Int_t rci=0;rci<4;rci++) // to be improved - moved into the method CheckPointersUsedInFinish()
7681 if(!fDiffFlowCorrelationsPro[t][pe][rci])
7683 cout<<"WARNING: fDiffFlowCorrelationsPro[t][pe][rci] is NULL in AFAWQC::FRC() !!!!"<<endl;
7684 cout<<"t = "<<t<<endl;
7685 cout<<"pe = "<<pe<<endl;
7686 cout<<"rci = "<<rci<<endl;
7689 if(!fDiffFlowSquaredCorrelationsPro[t][pe][rci])
7691 cout<<"WARNING: fDiffFlowSquaredCorrelationsPro[t][pe][rci] is NULL in AFAWQC::FRC() !!!!"<<endl;
7692 cout<<"t = "<<t<<endl;
7693 cout<<"pe = "<<pe<<endl;
7694 cout<<"rci = "<<rci<<endl;
7697 for(Int_t power=0;power<2;power++)
7699 if(!fDiffFlowSumOfEventWeights[t][pe][power][rci])
7701 cout<<"WARNING: fDiffFlowSumOfEventWeights[t][pe][power][rci] is NULL in AFAWQC::FRC() !!!!"<<endl;
7702 cout<<"t = "<<t<<endl;
7703 cout<<"pe = "<<pe<<endl;
7704 cout<<"power = "<<power<<endl;
7705 cout<<"rci = "<<rci<<endl;
7708 } // end of for(Int_t power=0;power<2;power++)
7709 } // end of for(Int_t rci=0;rci<4;rci++)
7712 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
7713 // transfer 1D profile into 1D histogram:
7714 Double_t correlation = 0.;
7715 Double_t squaredCorrelation = 0.;
7716 Double_t spread = 0.;
7717 Double_t sumOfWeights = 0.; // sum of weights for particular reduced correlations for particular pt or eta bin
7718 Double_t sumOfSquaredWeights = 0.; // sum of squared weights for particular reduced correlations for particular pt or eta bin
7719 Double_t error = 0.; // error = termA * spread * termB
7720 // termA = (sqrt(sumOfSquaredWeights)/sumOfWeights)
7721 // termB = 1/pow(1-termA^2,0.5)
7722 Double_t termA = 0.;
7723 Double_t termB = 0.;
7724 for(Int_t rci=0;rci<4;rci++) // index of reduced correlation
7726 for(Int_t b=1;b<=nBinsPtEta[pe];b++) // number of pt or eta bins
7728 if(fDiffFlowCorrelationsPro[t][pe][rci]->GetBinEffectiveEntries(b) < 2 ||
7729 fDiffFlowSquaredCorrelationsPro[t][pe][rci]->GetBinEffectiveEntries(b) < 2)
7731 fDiffFlowCorrelationsPro[t][pe][rci]->SetBinError(b,0.);
7732 fDiffFlowSquaredCorrelationsPro[t][pe][rci]->SetBinError(b,0.);
7733 continue; // to be improved - should I ignore results in pt bins with one entry for reduced correlations or not?
7735 correlation = fDiffFlowCorrelationsPro[t][pe][rci]->GetBinContent(b);
7736 squaredCorrelation = fDiffFlowSquaredCorrelationsPro[t][pe][rci]->GetBinContent(b);
7737 if(squaredCorrelation-correlation*correlation >= 0.)
7739 spread = pow(squaredCorrelation-correlation*correlation,0.5);
7743 cout<<Form(" WARNING: Imaginary 'spread' for rci = %d, pe = %d, bin = %d !!!!",rci,pe,b)<<endl;
7746 sumOfWeights = fDiffFlowSumOfEventWeights[t][pe][0][rci]->GetBinContent(b);
7747 sumOfSquaredWeights = fDiffFlowSumOfEventWeights[t][pe][1][rci]->GetBinContent(b);
7748 if(TMath::Abs(sumOfWeights)>0.){termA = (pow(sumOfSquaredWeights,0.5)/sumOfWeights);}
7749 if(1.-pow(termA,2.)>0.){termB = 1./pow(1.-pow(termA,2.),0.5);}
7750 error = termA*spread*termB; // final error (unbiased estimator for standard deviation)
7751 fDiffFlowCorrelationsHist[t][pe][rci]->SetBinContent(b,correlation);
7752 fDiffFlowCorrelationsHist[t][pe][rci]->SetBinError(b,error);
7753 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7754 } // end of for(Int_t rci=0;rci<4;rci++)
7756 } // end of void AliFlowAnalysisWithQCumulants::FinalizeReducedCorrelations(TString type, TString ptOrEta)
7758 //================================================================================================================================
7760 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowProductOfCorrelations(TString type, TString ptOrEta)
7762 // store products: <2><2'>, <2><4'>, <2><6'>, <2><8'>, <2'><4>,
7763 // <2'><4'>, <2'><6>, <2'><6'>, <2'><8>, <2'><8'>,
7764 // <4><4'>, <4><6'>, <4><8'>, <4'><6>, <4'><6'>,
7765 // <4'><8>, <4'><8'>, <6><6'>, <6><8'>, <6'><8>,
7766 // <6'><8'>, <8><8'>.
7769 Int_t ptEtaFlag = 0;
7774 } else if(type == "POI")
7782 } else if(ptOrEta == "Eta")
7789 Int_t pe = ptEtaFlag;
7792 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
7793 Double_t minPtEta[2] = {fPtMin,fEtaMin};
7794 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
7796 // protections // to be improved (add protection for all pointers in this method)
7797 if(!fIntFlowCorrelationsEBE)
7799 cout<<"WARNING: fIntFlowCorrelationsEBE is NULL in AFAWQC::CDFPOC() !!!!"<<endl;
7804 Double_t dMult = (*fSpk)(0,0); // multiplicity (number of particles used to determine the reaction plane)
7805 //Double_t mr = 0.; // number of RPs in particular pt or eta bin
7806 Double_t mp = 0.; // number of POIs in particular pt or eta bin
7807 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin
7810 // e-b-e correlations:
7811 Double_t twoEBE = fIntFlowCorrelationsEBE->GetBinContent(1); // <2>
7812 Double_t fourEBE = fIntFlowCorrelationsEBE->GetBinContent(2); // <4>
7813 Double_t sixEBE = fIntFlowCorrelationsEBE->GetBinContent(3); // <6>
7814 Double_t eightEBE = fIntFlowCorrelationsEBE->GetBinContent(4); // <8>
7816 // event weights for correlations:
7817 Double_t dW2 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1); // event weight for <2>
7818 Double_t dW4 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2); // event weight for <4>
7819 Double_t dW6 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(3); // event weight for <6>
7820 Double_t dW8 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(4); // event weight for <8>
7822 // e-b-e reduced correlations:
7823 Double_t twoReducedEBE = 0.; // <2'>
7824 Double_t fourReducedEBE = 0.; // <4'>
7825 Double_t sixReducedEBE = 0.; // <6'>
7826 Double_t eightReducedEBE = 0.; // <8'>
7828 // event weights for reduced correlations:
7829 Double_t dw2 = 0.; // event weight for <2'>
7830 Double_t dw4 = 0.; // event weight for <4'>
7831 //Double_t dw6 = 0.; // event weight for <6'>
7832 //Double_t dw8 = 0.; // event weight for <8'>
7834 // looping over bins:
7835 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7837 // e-b-e reduced correlations:
7838 twoReducedEBE = fDiffFlowCorrelationsEBE[t][pe][0]->GetBinContent(b);
7839 fourReducedEBE = fDiffFlowCorrelationsEBE[t][pe][1]->GetBinContent(b);
7840 sixReducedEBE = fDiffFlowCorrelationsEBE[t][pe][2]->GetBinContent(b);
7841 eightReducedEBE = fDiffFlowCorrelationsEBE[t][pe][3]->GetBinContent(b);
7844 // to be improved (I should not do this here again)
7847 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);
7848 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
7849 } else if(type == "POI")
7851 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);
7852 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b);
7855 // event weights for reduced correlations:
7856 dw2 = mp*dMult-mq; // weight for <2'>
7857 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
7858 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.); // weight for <4'>
7864 dw2 = fDiffFlowEventWeightsForCorrelationsEBE[t][pe][0]->GetBinContent(b);
7865 dw4 = fDiffFlowEventWeightsForCorrelationsEBE[t][pe][1]->GetBinContent(b);
7867 // storing all products:
7868 fDiffFlowProductOfCorrelationsPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*twoReducedEBE,dW2*dw2); // storing <2><2'>
7869 fDiffFlowProductOfCorrelationsPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*twoReducedEBE,dW4*dw2); // storing <4><2'>
7870 fDiffFlowProductOfCorrelationsPro[t][pe][1][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*twoReducedEBE,dW6*dw2); // storing <6><2'>
7871 fDiffFlowProductOfCorrelationsPro[t][pe][1][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*twoReducedEBE,dW8*dw2); // storing <8><2'>
7873 // event weight for <4'>:
7874 fDiffFlowProductOfCorrelationsPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*fourReducedEBE,dW2*dw4); // storing <2><4'>
7875 fDiffFlowProductOfCorrelationsPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*fourReducedEBE,dw2*dw4); // storing <2'><4'>
7876 fDiffFlowProductOfCorrelationsPro[t][pe][2][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*fourReducedEBE,dW4*dw4); // storing <4><4'>
7877 fDiffFlowProductOfCorrelationsPro[t][pe][3][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*fourReducedEBE,dW6*dw4); // storing <6><4'>
7878 fDiffFlowProductOfCorrelationsPro[t][pe][3][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*fourReducedEBE,dW8*dw4); // storing <8><4'>
7880 // event weight for <6'>:
7882 //fDiffFlowProductOfCorrelationsPro[t][pe][0][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*sixReducedEBE,dW2*dw6); // storing <2><6'>
7883 //fDiffFlowProductOfCorrelationsPro[t][pe][1][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*sixReducedEBE,dw2*dw6); // storing <2'><6'>
7884 //fDiffFlowProductOfCorrelationsPro[t][pe][2][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*sixReducedEBE,dW4*dw6); // storing <4><6'>
7885 //fDiffFlowProductOfCorrelationsPro[t][pe][3][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourReducedEBE*sixReducedEBE,dw4*dw6); // storing <4'><6'>
7886 //fDiffFlowProductOfCorrelationsPro[t][pe][4][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*sixReducedEBE,dW6*dw6); // storing <6><6'>
7887 //fDiffFlowProductOfCorrelationsPro[t][pe][5][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightEBE,dw6*dW8); // storing <6'><8>
7888 //fDiffFlowProductOfCorrelationsPro[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightReducedEBE,dw6*dw8); // storing <6'><8'>
7890 // event weight for <8'>:
7892 //fDiffFlowProductOfCorrelationsPro[t][pe][0][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*eightReducedEBE,dW2*dw8); // storing <2><8'>
7893 //fDiffFlowProductOfCorrelationsPro[t][pe][1][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*eightReducedEBE,dw2*dw8); // storing <2'><8'>
7894 //fDiffFlowProductOfCorrelationsPro[t][pe][2][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*eightReducedEBE,dW4*dw8); // storing <4><8'>
7895 //fDiffFlowProductOfCorrelationsPro[t][pe][3][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourReducedEBE*eightReducedEBE,dw4*dw8); // storing <4'><8'>
7896 //fDiffFlowProductOfCorrelationsPro[t][pe][4][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*eightReducedEBE,dW6*dw8); // storing <6><8'>
7897 //fDiffFlowProductOfCorrelationsPro[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightReducedEBE,dw6*dw8); // storing <6'><8'>
7898 //fDiffFlowProductOfCorrelationsPro[t][pe][6][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*eightReducedEBE,dW8*dw8); // storing <8><8'>
7899 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++
7901 } // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowProductOfCorrelations(TString type, TString ptOrEta)
7903 //================================================================================================================================
7905 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCovariances(TString type, TString ptOrEta) // to be improved (reimplemented)
7907 // a) Calculate unbiased estimators Cov(<2>,<2'>), Cov(<2>,<4'>), Cov(<4>,<2'>), Cov(<4>,<4'>) and Cov(<2'>,<4'>)
7908 // for covariances V(<2>,<2'>), V(<2>,<4'>), V(<4>,<2'>), V(<4>,<4'>) and V(<2'>,<4'>).
7909 // b) Store in histogram fDiffFlowCovariances[t][pe][index] for instance the following:
7911 // Cov(<2>,<2'>) * (sum_{i=1}^{N} w_{<2>}_i w_{<2'>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<2'>}_j)]
7913 // where N is the number of events, w_{<2>} is event weight for <2> and w_{<2'>} is event weight for <2'>.
7914 // c) Binning of fDiffFlowCovariances[t][pe][index] is organized as follows:
7916 // 1st bin: Cov(<2>,<2'>) * (sum_{i=1}^{N} w_{<2>}_i w_{<2'>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<2'>}_j)]
7917 // 2nd bin: Cov(<2>,<4'>) * (sum_{i=1}^{N} w_{<2>}_i w_{<4'>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<4'>}_j)]
7918 // 3rd bin: Cov(<4>,<2'>) * (sum_{i=1}^{N} w_{<4>}_i w_{<2'>}_i )/[(sum_{i=1}^{N} w_{<4>}_i) * (sum_{j=1}^{N} w_{<2'>}_j)]
7919 // 4th bin: Cov(<4>,<4'>) * (sum_{i=1}^{N} w_{<4>}_i w_{<4'>}_i )/[(sum_{i=1}^{N} w_{<4>}_i) * (sum_{j=1}^{N} w_{<4'>}_j)]
7920 // 5th bin: Cov(<2'>,<4'>) * (sum_{i=1}^{N} w_{<2'>}_i w_{<4'>}_i )/[(sum_{i=1}^{N} w_{<2'>}_i) * (sum_{j=1}^{N} w_{<4'>}_j)]
7924 Int_t ptEtaFlag = 0;
7929 } else if(type == "POI")
7937 } else if(ptOrEta == "Eta")
7944 Int_t pe = ptEtaFlag;
7947 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
7948 //Double_t minPtEta[2] = {fPtMin,fEtaMin};
7949 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
7950 //Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
7952 // average correlations:
7953 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
7954 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
7955 //Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
7956 //Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
7958 // sum of weights for correlation:
7959 Double_t sumOfWeightsForTwo = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // sum_{i=1}^{N} w_{<2>}
7960 Double_t sumOfWeightsForFour = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // sum_{i=1}^{N} w_{<4>}
7961 //Double_t sumOfWeightsForSix = fIntFlowSumOfEventWeights[0]->GetBinContent(3); // sum_{i=1}^{N} w_{<6>}
7962 //Double_t sumOfWeightsForEight = fIntFlowSumOfEventWeights[0]->GetBinContent(4); // sum_{i=1}^{N} w_{<8>}
7964 // average reduced correlations:
7965 Double_t twoReduced = 0.; // <<2'>>
7966 Double_t fourReduced = 0.; // <<4'>>
7967 //Double_t sixReduced = 0.; // <<6'>>
7968 //Double_t eightReduced = 0.; // <<8'>>
7970 // sum of weights for reduced correlation:
7971 Double_t sumOfWeightsForTwoReduced = 0.; // sum_{i=1}^{N} w_{<2'>}
7972 Double_t sumOfWeightsForFourReduced = 0.; // sum_{i=1}^{N} w_{<4'>}
7973 //Double_t sumOfWeightsForSixReduced = 0.; // sum_{i=1}^{N} w_{<6'>}
7974 //Double_t sumOfWeightsForEightReduced = 0.; // sum_{i=1}^{N} w_{<8'>}
7976 // product of weights for reduced correlation:
7977 Double_t productOfWeightsForTwoTwoReduced = 0.; // sum_{i=1}^{N} w_{<2>}w_{<2'>}
7978 Double_t productOfWeightsForTwoFourReduced = 0.; // sum_{i=1}^{N} w_{<2>}w_{<4'>}
7979 Double_t productOfWeightsForFourTwoReduced = 0.; // sum_{i=1}^{N} w_{<4>}w_{<2'>}
7980 Double_t productOfWeightsForFourFourReduced = 0.; // sum_{i=1}^{N} w_{<4>}w_{<4'>}
7981 Double_t productOfWeightsForTwoReducedFourReduced = 0.; // sum_{i=1}^{N} w_{<2'>}w_{<4'>}
7984 // products for differential flow:
7985 Double_t twoTwoReduced = 0; // <<2><2'>>
7986 Double_t twoFourReduced = 0; // <<2><4'>>
7987 Double_t fourTwoReduced = 0; // <<4><2'>>
7988 Double_t fourFourReduced = 0; // <<4><4'>>
7989 Double_t twoReducedFourReduced = 0; // <<2'><4'>>
7991 // denominators in the expressions for the unbiased estimators for covariances:
7992 // denominator = 1 - term1/(term2*term3)
7993 // prefactor = term1/(term2*term3)
7994 Double_t denominator = 0.;
7995 Double_t prefactor = 0.;
7996 Double_t term1 = 0.;
7997 Double_t term2 = 0.;
7998 Double_t term3 = 0.;
8000 // unbiased estimators for covariances for differential flow:
8001 Double_t covTwoTwoReduced = 0.; // Cov(<2>,<2'>)
8002 Double_t wCovTwoTwoReduced = 0.; // Cov(<2>,<2'>) * prefactor(w_{<2>},w_{<2'>})
8003 Double_t covTwoFourReduced = 0.; // Cov(<2>,<4'>)
8004 Double_t wCovTwoFourReduced = 0.; // Cov(<2>,<4'>) * prefactor(w_{<2>},w_{<4'>})
8005 Double_t covFourTwoReduced = 0.; // Cov(<4>,<2'>)
8006 Double_t wCovFourTwoReduced = 0.; // Cov(<4>,<2'>) * prefactor(w_{<4>},w_{<2'>})
8007 Double_t covFourFourReduced = 0.; // Cov(<4>,<4'>)
8008 Double_t wCovFourFourReduced = 0.; // Cov(<4>,<4'>) * prefactor(w_{<4>},w_{<4'>})
8009 Double_t covTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>)
8010 Double_t wCovTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>) * prefactor(w_{<2'>},w_{<4'>})
8012 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
8014 // average reduced corelations:
8015 twoReduced = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b);
8016 fourReduced = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b);
8017 // average products:
8018 twoTwoReduced = fDiffFlowProductOfCorrelationsPro[t][pe][0][1]->GetBinContent(b);
8019 twoFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][0][3]->GetBinContent(b);
8020 fourTwoReduced = fDiffFlowProductOfCorrelationsPro[t][pe][1][2]->GetBinContent(b);
8021 fourFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][2][3]->GetBinContent(b);
8022 twoReducedFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][1][3]->GetBinContent(b);
8023 // sum of weights for reduced correlations:
8024 sumOfWeightsForTwoReduced = fDiffFlowSumOfEventWeights[t][pe][0][0]->GetBinContent(b);
8025 sumOfWeightsForFourReduced = fDiffFlowSumOfEventWeights[t][pe][0][1]->GetBinContent(b);
8026 // products of weights for correlations:
8027 productOfWeightsForTwoTwoReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][0][1]->GetBinContent(b);
8028 productOfWeightsForTwoFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][0][3]->GetBinContent(b);
8029 productOfWeightsForFourTwoReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][1][2]->GetBinContent(b);
8030 productOfWeightsForFourFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][2][3]->GetBinContent(b);
8031 productOfWeightsForTwoReducedFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][1][3]->GetBinContent(b);
8032 // denominator for the unbiased estimator for covariances: 1 - term1/(term2*term3)
8033 // prefactor (multiplies Cov's) = term1/(term2*term3)
8035 term1 = productOfWeightsForTwoTwoReduced;
8036 term2 = sumOfWeightsForTwo;
8037 term3 = sumOfWeightsForTwoReduced;
8040 denominator = 1.-term1/(term2*term3);
8041 prefactor = term1/(term2*term3);
8042 if(TMath::Abs(denominator)>1.e-6)
8044 covTwoTwoReduced = (twoTwoReduced-two*twoReduced)/denominator;
8045 wCovTwoTwoReduced = covTwoTwoReduced*prefactor;
8046 fDiffFlowCovariances[t][pe][0]->SetBinContent(b,wCovTwoTwoReduced);
8050 term1 = productOfWeightsForTwoFourReduced;
8051 term2 = sumOfWeightsForTwo;
8052 term3 = sumOfWeightsForFourReduced;
8055 denominator = 1.-term1/(term2*term3);
8056 prefactor = term1/(term2*term3);
8057 if(TMath::Abs(denominator)>1.e-6)
8059 covTwoFourReduced = (twoFourReduced-two*fourReduced)/denominator;
8060 wCovTwoFourReduced = covTwoFourReduced*prefactor;
8061 fDiffFlowCovariances[t][pe][1]->SetBinContent(b,wCovTwoFourReduced);
8065 term1 = productOfWeightsForFourTwoReduced;
8066 term2 = sumOfWeightsForFour;
8067 term3 = sumOfWeightsForTwoReduced;
8070 denominator = 1.-term1/(term2*term3);
8071 prefactor = term1/(term2*term3);
8072 if(TMath::Abs(denominator)>1.e-6)
8074 covFourTwoReduced = (fourTwoReduced-four*twoReduced)/denominator;
8075 wCovFourTwoReduced = covFourTwoReduced*prefactor;
8076 fDiffFlowCovariances[t][pe][2]->SetBinContent(b,wCovFourTwoReduced);
8080 term1 = productOfWeightsForFourFourReduced;
8081 term2 = sumOfWeightsForFour;
8082 term3 = sumOfWeightsForFourReduced;
8085 denominator = 1.-term1/(term2*term3);
8086 prefactor = term1/(term2*term3);
8087 if(TMath::Abs(denominator)>1.e-6)
8089 covFourFourReduced = (fourFourReduced-four*fourReduced)/denominator;
8090 wCovFourFourReduced = covFourFourReduced*prefactor;
8091 fDiffFlowCovariances[t][pe][3]->SetBinContent(b,wCovFourFourReduced);
8095 term1 = productOfWeightsForTwoReducedFourReduced;
8096 term2 = sumOfWeightsForTwoReduced;
8097 term3 = sumOfWeightsForFourReduced;
8100 denominator = 1.-term1/(term2*term3);
8101 prefactor = term1/(term2*term3);
8102 if(TMath::Abs(denominator)>1.e-6)
8104 covTwoReducedFourReduced = (twoReducedFourReduced-twoReduced*fourReduced)/denominator;
8105 wCovTwoReducedFourReduced = covTwoReducedFourReduced*prefactor;
8106 fDiffFlowCovariances[t][pe][4]->SetBinContent(b,wCovTwoReducedFourReduced);
8109 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
8111 } // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCovariances(TString type, TString ptOrEta)
8113 //================================================================================================================================
8115 void AliFlowAnalysisWithQCumulants::CalculateDiffFlow(TString type, TString ptOrEta)
8117 // Calculate final results for differential flow.
8119 // REMARK: Differential flow calculated in this method is NOT corrected for non-uniform acceptance.
8120 // This correction, if enabled via setter SetApplyCorrectionForNUA(Bool_t), is applied in the method
8121 // CalculateDiffFlowCorrectedForNUA(TString type, TString ptOrEta)
8123 Int_t t = 0; // RP or POI
8124 Int_t pe = 0; // pt or eta
8129 } else if(type == "POI")
8137 } else if(ptOrEta == "Eta")
8143 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
8145 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
8146 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
8147 // Statistical errors of correlations:
8148 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1);
8149 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2);
8150 // Reduced correlations:
8151 Double_t twoReduced = 0.; // <<2'>>
8152 Double_t fourReduced = 0.; // <<4'>>
8153 // Statistical errors of reduced correlations:
8154 Double_t twoReducedError = 0.;
8155 Double_t fourReducedError = 0.;
8157 Double_t wCovTwoFour = 0.; // Cov(<2>,<4>) * prefactor(<2>,<4>)
8158 if(!fForgetAboutCovariances)
8160 wCovTwoFour = fIntFlowCovariances->GetBinContent(1); // Cov(<2>,<4>) * prefactor(<2>,<4>)
8162 Double_t wCovTwoTwoReduced = 0.; // Cov(<2>,<2'>) * prefactor(<2>,<2'>)
8163 Double_t wCovTwoFourReduced = 0.; // Cov(<2>,<4'>) * prefactor(<2>,<4'>)
8164 Double_t wCovFourTwoReduced = 0.; // Cov(<4>,<2'>) * prefactor(<4>,<2'>)
8165 Double_t wCovFourFourReduced = 0.; // Cov(<4>,<4'>) * prefactor(<4>,<4'>)
8166 Double_t wCovTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>) * prefactor(<2'>,<4'>)
8167 // Differential flow:
8168 Double_t v2Prime = 0.; // v'{2}
8169 Double_t v4Prime = 0.; // v'{4}
8170 // Statistical error of differential flow:
8171 Double_t v2PrimeError = 0.;
8172 Double_t v4PrimeError = 0.;
8173 // Squared statistical error of differential flow:
8174 Double_t v2PrimeErrorSquared = 0.;
8175 Double_t v4PrimeErrorSquared = 0.;
8176 // Loop over pt or eta bins:
8177 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
8179 // Reduced correlations and statistical errors:
8180 twoReduced = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b);
8181 twoReducedError = fDiffFlowCorrelationsHist[t][pe][0]->GetBinError(b);
8182 fourReduced = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b);
8183 fourReducedError = fDiffFlowCorrelationsHist[t][pe][1]->GetBinError(b);
8185 if(!fForgetAboutCovariances)
8187 wCovTwoTwoReduced = fDiffFlowCovariances[t][pe][0]->GetBinContent(b);
8188 wCovTwoFourReduced = fDiffFlowCovariances[t][pe][1]->GetBinContent(b);
8189 wCovFourTwoReduced = fDiffFlowCovariances[t][pe][2]->GetBinContent(b);
8190 wCovFourFourReduced = fDiffFlowCovariances[t][pe][3]->GetBinContent(b);
8191 wCovTwoReducedFourReduced = fDiffFlowCovariances[t][pe][4]->GetBinContent(b);
8193 // Differential flow:
8197 v2Prime = twoReduced/pow(two,0.5);
8198 v2PrimeErrorSquared = (1./4.)*pow(two,-3.)*(pow(twoReduced,2.)*pow(twoError,2.)
8199 + 4.*pow(two,2.)*pow(twoReducedError,2.)
8200 - 4.*two*twoReduced*wCovTwoTwoReduced);
8201 if(v2PrimeErrorSquared>0.){v2PrimeError = pow(v2PrimeErrorSquared,0.5);}
8202 if(TMath::Abs(v2Prime)>0.)
8204 fDiffFlow[t][pe][0]->SetBinContent(b,v2Prime);
8205 fDiffFlow[t][pe][0]->SetBinError(b,v2PrimeError);
8207 } // end of if(two>0.)
8208 // differential flow:
8210 if(2.*pow(two,2.)-four > 0.)
8212 v4Prime = (2.*two*twoReduced-fourReduced)/pow(2.*pow(two,2.)-four,3./4.);
8213 v4PrimeErrorSquared = pow(2.*pow(two,2.)-four,-7./2.)
8214 * (pow(2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced,2.)*pow(twoError,2.)
8215 + (9./16.)*pow(2.*two*twoReduced-fourReduced,2.)*pow(fourError,2.)
8216 + 4.*pow(two,2.)*pow(2.*pow(two,2.)-four,2.)*pow(twoReducedError,2.)
8217 + pow(2.*pow(two,2.)-four,2.)*pow(fourReducedError,2.)
8218 - (3./2.)*(2.*two*twoReduced-fourReduced)
8219 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoFour
8220 - 4.*two*(2.*pow(two,2.)-four)
8221 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoTwoReduced
8222 + 2.*(2.*pow(two,2.)-four)
8223 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoFourReduced
8224 + 3.*two*(2.*pow(two,2.)-four)*(2.*two*twoReduced-fourReduced)*wCovFourTwoReduced
8225 - (3./2.)*(2.*pow(two,2.)-four)*(2.*two*twoReduced-fourReduced)*wCovFourFourReduced
8226 - 4.*two*pow(2.*pow(two,2.)-four,2.)*wCovTwoReducedFourReduced);
8227 if(v4PrimeErrorSquared>0.){v4PrimeError = pow(v4PrimeErrorSquared,0.5);}
8228 if(TMath::Abs(v4Prime)>0.)
8230 fDiffFlow[t][pe][1]->SetBinContent(b,v4Prime);
8231 fDiffFlow[t][pe][1]->SetBinError(b,v4PrimeError);
8233 } // end of if(2.*pow(two,2.)-four > 0.)
8234 } // end of for(Int_t b=1;b<=fnBinsPtEta[pe];b++)
8236 } // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlow(TString type, Bool_t useParticleWeights)
8238 //================================================================================================================================
8240 void AliFlowAnalysisWithQCumulants::Calculate2DDiffFlow(TString type)
8242 // Calculate final results for 2D diferential flow.
8244 // to be improved - check pointers used in this method
8246 Int_t t = 0; // RP or POI
8251 } else if(type == "POI")
8256 // Differential flow:
8257 Double_t v2Prime = 0.; // v'{2}
8258 Double_t v4Prime = 0.; // v'{4}
8259 // Differential cumulants:
8260 Double_t qc2Prime = 0.; // QC{2'}
8261 Double_t qc4Prime = 0.; // QC{4'}
8262 // Looping over all (pt,eta) bins and calculating differential flow:
8263 for(Int_t p=1;p<=fnBinsPt;p++)
8265 for(Int_t e=1;e<=fnBinsEta;e++)
8268 qc2Prime = f2DDiffFlowCumulants[t][0]->GetBinContent(f2DDiffFlowCumulants[t][0]->GetBin(p,e));
8271 v2Prime = pow(qc2Prime,0.5);
8272 f2DDiffFlow[t][0]->SetBinContent(f2DDiffFlow[t][0]->GetBin(p,e),v2Prime);
8275 qc4Prime = f2DDiffFlowCumulants[t][1]->GetBinContent(f2DDiffFlowCumulants[t][1]->GetBin(p,e));
8278 v4Prime = pow(-1.*qc4Prime,1./4.);
8279 f2DDiffFlow[t][1]->SetBinContent(f2DDiffFlow[t][1]->GetBin(p,e),v4Prime);
8281 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
8282 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
8284 } // end of void AliFlowAnalysisWithQCumulants::Calculate2DDiffFlow(TString type)
8286 //================================================================================================================================
8288 void AliFlowAnalysisWithQCumulants::StoreIntFlowFlags()
8290 // a) Store all flags for integrated flow in profile fIntFlowFlags.
8294 cout<<"WARNING: fIntFlowFlags is NULL in AFAWQC::SFFIF() !!!!"<<endl;
8298 // particle weights used or not:
8299 fIntFlowFlags->Fill(0.5,(Int_t)fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights);
8300 // which event weights were used:
8301 if(strcmp(fMultiplicityWeight->Data(),"combinations"))
8303 fIntFlowFlags->Fill(1.5,0); // 0 = "combinations" (default)
8304 } else if(strcmp(fMultiplicityWeight->Data(),"unit"))
8306 fIntFlowFlags->Fill(1.5,1); // 1 = "unit"
8307 } else if(strcmp(fMultiplicityWeight->Data(),"multiplicity"))
8309 fIntFlowFlags->Fill(1.5,2); // 2 = "multiplicity"
8311 fIntFlowFlags->Fill(2.5,(Int_t)fApplyCorrectionForNUA);
8312 fIntFlowFlags->Fill(3.5,(Int_t)fPrintFinalResults[0]);
8313 fIntFlowFlags->Fill(4.5,(Int_t)fPrintFinalResults[1]);
8314 fIntFlowFlags->Fill(5.5,(Int_t)fPrintFinalResults[2]);
8315 fIntFlowFlags->Fill(6.5,(Int_t)fPrintFinalResults[3]);
8316 fIntFlowFlags->Fill(7.5,(Int_t)fApplyCorrectionForNUAVsM);
8317 fIntFlowFlags->Fill(8.5,(Int_t)fPropagateErrorAlsoFromNIT);
8318 fIntFlowFlags->Fill(9.5,(Int_t)fCalculateCumulantsVsM);
8319 fIntFlowFlags->Fill(10.5,(Int_t)fMinimumBiasReferenceFlow);
8320 fIntFlowFlags->Fill(11.5,(Int_t)fForgetAboutCovariances);
8321 fIntFlowFlags->Fill(12.5,(Int_t)fStorePhiDistributionForOneEvent);
8322 fIntFlowFlags->Fill(13.5,(Int_t)fFillMultipleControlHistograms);
8323 fIntFlowFlags->Fill(14.5,(Int_t)fCalculateAllCorrelationsVsM);
8324 } // end of void AliFlowAnalysisWithQCumulants::StoreIntFlowFlags()
8326 //================================================================================================================================
8328 void AliFlowAnalysisWithQCumulants::StoreDiffFlowFlags()
8330 // Store all flags for differential flow in the profile fDiffFlowFlags.
8334 printf("\n WARNING (QC): fDiffFlowFlags is NULL in AFAWQC::SDFF() !!!!\n\n");
8338 fDiffFlowFlags->Fill(0.5,fCalculateDiffFlow); // calculate differential flow
8339 fDiffFlowFlags->Fill(1.5,fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights); // particle weights used or not?
8340 //fDiffFlowFlags->Fill(2.5,""); // which event weight was used? ("combinations", "unit" or "multiplicity") to be improved - finalized
8341 fDiffFlowFlags->Fill(3.5,fApplyCorrectionForNUA); // corrected for non-uniform acceptance or not
8342 fDiffFlowFlags->Fill(4.5,fCalculate2DDiffFlow); // calculate also 2D differential flow vs (pt,eta)
8343 fDiffFlowFlags->Fill(5.5,fCalculateDiffFlowVsEta); // if you set kFALSE only differential flow vs pt is calculated
8345 } // end of void AliFlowAnalysisWithQCumulants::StoreDiffFlowFlags()
8347 //================================================================================================================================
8349 void AliFlowAnalysisWithQCumulants::GetPointersForCommonHistograms()
8351 // Access all pointers to common control and common result histograms and profiles.
8353 TString sCommonConstantsName = "fCommonConstants";
8354 sCommonConstantsName += fAnalysisLabel->Data();
8355 fCommonConstants = dynamic_cast<TProfile*>(fHistList->FindObject(sCommonConstantsName.Data()));
8356 if(!fCommonConstants)
8358 printf("\n WARNING (QC): fCommonConstants is NULL in AFAWQC::GPFCH() !!!!\n\n");
8362 // to be improved - lines bellow can be implemented better.
8364 TString commonHistsName = "AliFlowCommonHistQC";
8365 commonHistsName += fAnalysisLabel->Data();
8366 AliFlowCommonHist *commonHist = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHistsName.Data()));
8369 this->SetCommonHists(commonHist);
8370 if(fCommonHists->GetHarmonic())
8372 fHarmonic = (Int_t)(fCommonHists->GetHarmonic())->GetBinContent(1);
8374 } // end of if(commonHist)
8375 TString commonHists2ndOrderName = "AliFlowCommonHist2ndOrderQC";
8376 commonHists2ndOrderName += fAnalysisLabel->Data();
8377 AliFlowCommonHist *commonHist2nd = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists2ndOrderName.Data()));
8378 if(commonHist2nd) this->SetCommonHists2nd(commonHist2nd);
8379 TString commonHists4thOrderName = "AliFlowCommonHist4thOrderQC";
8380 commonHists4thOrderName += fAnalysisLabel->Data();
8381 AliFlowCommonHist *commonHist4th = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists4thOrderName.Data()));
8382 if(commonHist4th) this->SetCommonHists4th(commonHist4th);
8383 TString commonHists6thOrderName = "AliFlowCommonHist6thOrderQC";
8384 commonHists6thOrderName += fAnalysisLabel->Data();
8385 AliFlowCommonHist *commonHist6th = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists6thOrderName.Data()));
8386 if(commonHist6th) this->SetCommonHists6th(commonHist6th);
8387 TString commonHists8thOrderName = "AliFlowCommonHist8thOrderQC";
8388 commonHists8thOrderName += fAnalysisLabel->Data();
8389 AliFlowCommonHist *commonHist8th = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists8thOrderName.Data()));
8390 if(commonHist8th) this->SetCommonHists8th(commonHist8th);
8392 TString commonHistResults2ndOrderName = "AliFlowCommonHistResults2ndOrderQC";
8393 commonHistResults2ndOrderName += fAnalysisLabel->Data();
8394 AliFlowCommonHistResults *commonHistRes2nd = dynamic_cast<AliFlowCommonHistResults*>
8395 (fHistList->FindObject(commonHistResults2ndOrderName.Data()));
8396 if(commonHistRes2nd) this->SetCommonHistsResults2nd(commonHistRes2nd);
8397 TString commonHistResults4thOrderName = "AliFlowCommonHistResults4thOrderQC";
8398 commonHistResults4thOrderName += fAnalysisLabel->Data();
8399 AliFlowCommonHistResults *commonHistRes4th = dynamic_cast<AliFlowCommonHistResults*>
8400 (fHistList->FindObject(commonHistResults4thOrderName.Data()));
8401 if(commonHistRes4th) this->SetCommonHistsResults4th(commonHistRes4th);
8402 TString commonHistResults6thOrderName = "AliFlowCommonHistResults6thOrderQC";
8403 commonHistResults6thOrderName += fAnalysisLabel->Data();
8404 AliFlowCommonHistResults *commonHistRes6th = dynamic_cast<AliFlowCommonHistResults*>
8405 (fHistList->FindObject(commonHistResults6thOrderName.Data()));
8406 if(commonHistRes6th) this->SetCommonHistsResults6th(commonHistRes6th);
8407 TString commonHistResults8thOrderName = "AliFlowCommonHistResults8thOrderQC";
8408 commonHistResults8thOrderName += fAnalysisLabel->Data();
8409 AliFlowCommonHistResults *commonHistRes8th = dynamic_cast<AliFlowCommonHistResults*>
8410 (fHistList->FindObject(commonHistResults8thOrderName.Data()));
8411 if(commonHistRes8th) this->SetCommonHistsResults8th(commonHistRes8th);
8413 } // end of void AliFlowAnalysisWithQCumulants::GetPointersForCommonHistograms()
8415 //================================================================================================================================
8417 void AliFlowAnalysisWithQCumulants::GetPointersForParticleWeightsHistograms()
8419 // Get pointers for histograms with particle weights.
8421 TList *weightsList = dynamic_cast<TList*>(fHistList->FindObject("Weights"));
8422 if(!weightsList){printf("\n WARNING (QC): weightsList is NULL in AFAWQC::GPFPWH() !!!!\n");exit(0);}
8423 this->SetWeightsList(weightsList);
8424 TString fUseParticleWeightsName = "fUseParticleWeightsQC"; // to be improved (hirdwired label QC)
8425 fUseParticleWeightsName += fAnalysisLabel->Data();
8426 TProfile *useParticleWeights = dynamic_cast<TProfile*>(weightsList->FindObject(fUseParticleWeightsName.Data()));
8427 if(useParticleWeights)
8429 this->SetUseParticleWeights(useParticleWeights);
8430 fUsePhiWeights = (Int_t)fUseParticleWeights->GetBinContent(1);
8431 fUsePtWeights = (Int_t)fUseParticleWeights->GetBinContent(2);
8432 fUseEtaWeights = (Int_t)fUseParticleWeights->GetBinContent(3);
8433 fUseTrackWeights = (Int_t)fUseParticleWeights->GetBinContent(4);
8435 } // end of void AliFlowAnalysisWithQCumulants::GetPointersForParticleWeightsHistograms();
8437 //================================================================================================================================
8439 void AliFlowAnalysisWithQCumulants::GetPointersForIntFlowHistograms()
8441 // Get pointers for histograms and profiles relevant for integrated flow:
8442 // a) Get pointer to base list for integrated flow holding profile fIntFlowFlags and lists fIntFlowProfiles and fIntFlowResults.
8443 // b) Get pointer to profile fIntFlowFlags holding all flags for integrated flow.
8444 // c) Get pointer to list fIntFlowProfiles and pointers to all objects that she holds.
8445 // d) Get pointer to list fIntFlowResults and pointers to all objects that she holds.
8447 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data member?)
8448 TString powerFlag[2] = {"linear","quadratic"}; // to be improved (should I promote this to data member?)
8449 TString correlationFlag[4] = {"#LT#LT2#GT#GT","#LT#LT4#GT#GT","#LT#LT6#GT#GT","#LT#LT8#GT#GT"}; // to be improved (should I promote this to data member?)
8450 TString squaredCorrelationFlag[4] = {"#LT#LT2#GT^{2}#GT","#LT#LT4#GT^{2}#GT","#LT#LT6#GT^{2}#GT","#LT#LT8#GT^{2}#GT"}; // to be improved (should I promote this to data member?)
8452 // a) Get pointer to base list for integrated flow holding profile fIntFlowFlags and lists fIntFlowProfiles and fIntFlowResults:
8453 TList *intFlowList = NULL;
8454 intFlowList = dynamic_cast<TList*>(fHistList->FindObject("Integrated Flow"));
8457 cout<<"WARNING: intFlowList is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8461 // b) Get pointer to profile fIntFlowFlags holding all flags for integrated flow:
8462 TString intFlowFlagsName = "fIntFlowFlags";
8463 intFlowFlagsName += fAnalysisLabel->Data();
8464 TProfile *intFlowFlags = dynamic_cast<TProfile*>(intFlowList->FindObject(intFlowFlagsName.Data()));
8467 this->SetIntFlowFlags(intFlowFlags);
8468 fApplyCorrectionForNUA = (Bool_t)intFlowFlags->GetBinContent(3);
8469 fApplyCorrectionForNUAVsM = (Bool_t)intFlowFlags->GetBinContent(8);
8470 fCalculateCumulantsVsM = (Bool_t)intFlowFlags->GetBinContent(10);
8473 cout<<"WARNING: intFlowFlags is NULL in FAWQC::GPFIFH() !!!!"<<endl;
8476 // c) Get pointer to list fIntFlowProfiles and pointers to all objects that she holds:
8477 TList *intFlowProfiles = NULL;
8478 intFlowProfiles = dynamic_cast<TList*>(intFlowList->FindObject("Profiles"));
8481 // average multiplicities:
8482 TString avMultiplicityName = "fAvMultiplicity";
8483 avMultiplicityName += fAnalysisLabel->Data();
8484 TProfile *avMultiplicity = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(avMultiplicityName.Data()));
8487 this->SetAvMultiplicity(avMultiplicity);
8490 cout<<"WARNING: avMultiplicity is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8492 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with wrong errors!):
8493 TString intFlowCorrelationsProName = "fIntFlowCorrelationsPro";
8494 intFlowCorrelationsProName += fAnalysisLabel->Data();
8495 TProfile *intFlowCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowCorrelationsProName.Data()));
8496 if(intFlowCorrelationsPro)
8498 this->SetIntFlowCorrelationsPro(intFlowCorrelationsPro);
8501 cout<<"WARNING: intFlowCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8503 // average squared correlations <<2>^2>, <<4>^2>, <<6>^2> and <<8^2>>:
8504 TString intFlowSquaredCorrelationsProName = "fIntFlowSquaredCorrelationsPro";
8505 intFlowSquaredCorrelationsProName += fAnalysisLabel->Data();
8506 TProfile *intFlowSquaredCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowSquaredCorrelationsProName.Data()));
8507 if(intFlowSquaredCorrelationsPro)
8509 this->SetIntFlowSquaredCorrelationsPro(intFlowSquaredCorrelationsPro);
8512 cout<<"WARNING: intFlowSquaredCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8514 if(fCalculateCumulantsVsM)
8516 // Average correlations <<2>>, <<4>>, <<6>> and <<8>> versus multiplicity for all events (error is wrong here):
8517 TString intFlowCorrelationsVsMProName = "fIntFlowCorrelationsVsMPro";
8518 intFlowCorrelationsVsMProName += fAnalysisLabel->Data();
8519 for(Int_t ci=0;ci<4;ci++) // correlation index
8521 TProfile *intFlowCorrelationsVsMPro = dynamic_cast<TProfile*>
8522 (intFlowProfiles->FindObject(Form("%s, %s",intFlowCorrelationsVsMProName.Data(),correlationFlag[ci].Data())));
8523 if(intFlowCorrelationsVsMPro)
8525 this->SetIntFlowCorrelationsVsMPro(intFlowCorrelationsVsMPro,ci);
8528 cout<<"WARNING: "<<Form("intFlowCorrelationsVsMPro[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8530 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
8531 // Average squared correlations <<2>^2>, <<4>^2>, <<6>^2> and <<8>^2> versus multiplicity for all events:
8532 TString intFlowSquaredCorrelationsVsMProName = "fIntFlowSquaredCorrelationsVsMPro";
8533 intFlowSquaredCorrelationsVsMProName += fAnalysisLabel->Data();
8534 for(Int_t ci=0;ci<4;ci++) // correlation index
8536 TProfile *intFlowSquaredCorrelationsVsMPro = dynamic_cast<TProfile*>
8537 (intFlowProfiles->FindObject(Form("%s, %s",intFlowSquaredCorrelationsVsMProName.Data(),squaredCorrelationFlag[ci].Data())));
8538 if(intFlowSquaredCorrelationsVsMPro)
8540 this->SetIntFlowSquaredCorrelationsVsMPro(intFlowSquaredCorrelationsVsMPro,ci);
8543 cout<<"WARNING: "<<Form("intFlowSquaredCorrelationsVsMPro[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8545 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
8546 } // end of if(fCalculateCumulantsVsM)
8547 // average all correlations for integrated flow (with wrong errors!):
8548 TString intFlowCorrelationsAllProName = "fIntFlowCorrelationsAllPro";
8549 intFlowCorrelationsAllProName += fAnalysisLabel->Data();
8550 TProfile *intFlowCorrelationsAllPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowCorrelationsAllProName.Data()));
8551 if(intFlowCorrelationsAllPro)
8553 this->SetIntFlowCorrelationsAllPro(intFlowCorrelationsAllPro);
8556 cout<<"WARNING: intFlowCorrelationsAllPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8558 // average extra correlations for integrated flow (which appear only when particle weights are used):
8559 // (to be improved: Weak point in implementation, I am assuming here that method GetPointersForParticleWeightsHistograms() was called)
8560 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights)
8562 TString intFlowExtraCorrelationsProName = "fIntFlowExtraCorrelationsPro";
8563 intFlowExtraCorrelationsProName += fAnalysisLabel->Data();
8564 TProfile *intFlowExtraCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowExtraCorrelationsProName.Data()));
8565 if(intFlowExtraCorrelationsPro)
8567 this->SetIntFlowExtraCorrelationsPro(intFlowExtraCorrelationsPro);
8570 cout<<"WARNING: intFlowExtraCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8572 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights)
8573 // average products of correlations <2>, <4>, <6> and <8>:
8574 TString intFlowProductOfCorrelationsProName = "fIntFlowProductOfCorrelationsPro";
8575 intFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
8576 TProfile *intFlowProductOfCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowProductOfCorrelationsProName.Data()));
8577 if(intFlowProductOfCorrelationsPro)
8579 this->SetIntFlowProductOfCorrelationsPro(intFlowProductOfCorrelationsPro);
8582 cout<<"WARNING: intFlowProductOfCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8584 // average product of correlations <2>, <4>, <6> and <8> versus multiplicity
8585 // [0=<<2><4>>,1=<<2><6>>,2=<<2><8>>,3=<<4><6>>,4=<<4><8>>,5=<<6><8>>]
8586 if(fCalculateCumulantsVsM)
8588 TString intFlowProductOfCorrelationsVsMProName = "fIntFlowProductOfCorrelationsVsMPro";
8589 intFlowProductOfCorrelationsVsMProName += fAnalysisLabel->Data();
8590 TString productFlag[6] = {"#LT#LT2#GT#LT4#GT#GT","#LT#LT2#GT#LT6#GT#GT","#LT#LT2#GT#LT8#GT#GT",
8591 "#LT#LT4#GT#LT6#GT#GT","#LT#LT4#GT#LT8#GT#GT","#LT#LT6#GT#LT8#GT#GT"};
8592 for(Int_t pi=0;pi<6;pi++)
8594 TProfile *intFlowProductOfCorrelationsVsMPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(Form("%s, %s",intFlowProductOfCorrelationsVsMProName.Data(),productFlag[pi].Data())));
8595 if(intFlowProductOfCorrelationsVsMPro)
8597 this->SetIntFlowProductOfCorrelationsVsMPro(intFlowProductOfCorrelationsVsMPro,pi);
8600 cout<<"WARNING: "<<Form("intFlowProductOfCorrelationsVsMPro[%d]",pi)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8602 } // end of for(Int_t pi=0;pi<6;pi++)
8603 } // end of if(fCalculateCumulantsVsM)
8604 // average correction terms for non-uniform acceptance (with wrong errors!):
8605 for(Int_t sc=0;sc<2;sc++)
8607 TString intFlowCorrectionTermsForNUAProName = "fIntFlowCorrectionTermsForNUAPro";
8608 intFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
8609 TProfile *intFlowCorrectionTermsForNUAPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject((Form("%s: %s terms",intFlowCorrectionTermsForNUAProName.Data(),sinCosFlag[sc].Data()))));
8610 if(intFlowCorrectionTermsForNUAPro)
8612 this->SetIntFlowCorrectionTermsForNUAPro(intFlowCorrectionTermsForNUAPro,sc);
8615 cout<<"WARNING: intFlowCorrectionTermsForNUAPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8616 cout<<"sc = "<<sc<<endl;
8618 // versus multiplicity:
8619 if(fCalculateCumulantsVsM)
8621 TString correctionTermFlag[4] = {"(n(phi1))","(n(phi1+phi2))","(n(phi1-phi2-phi3))","(n(2phi1-phi2))"}; // to be improved - hardwired 4
8622 TString intFlowCorrectionTermsForNUAVsMProName = "fIntFlowCorrectionTermsForNUAVsMPro";
8623 intFlowCorrectionTermsForNUAVsMProName += fAnalysisLabel->Data();
8624 for(Int_t ci=0;ci<4;ci++) // correction term index (to be improved - hardwired 4)
8626 TProfile *intFlowCorrectionTermsForNUAVsMPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(Form("%s: #LT#LT%s%s#GT#GT",intFlowCorrectionTermsForNUAVsMProName.Data(),sinCosFlag[sc].Data(),correctionTermFlag[ci].Data())));
8627 if(intFlowCorrectionTermsForNUAVsMPro)
8629 this->SetIntFlowCorrectionTermsForNUAVsMPro(intFlowCorrectionTermsForNUAVsMPro,sc,ci);
8632 cout<<"WARNING: intFlowCorrectionTermsForNUAVsMPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8633 cout<<"sc = "<<sc<<endl;
8634 cout<<"ci = "<<ci<<endl;
8636 } // end of for(Int_t ci=0;ci<4;ci++) // correction term index (to be improved - hardwired 4)
8637 } // end of if(fCalculateCumulantsVsM)
8638 } // end of for(Int_t sc=0;sc<2;sc++)
8639 // average products of correction terms for NUA:
8640 TString intFlowProductOfCorrectionTermsForNUAProName = "fIntFlowProductOfCorrectionTermsForNUAPro";
8641 intFlowProductOfCorrectionTermsForNUAProName += fAnalysisLabel->Data();
8642 TProfile *intFlowProductOfCorrectionTermsForNUAPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowProductOfCorrectionTermsForNUAProName.Data()));
8643 if(intFlowProductOfCorrectionTermsForNUAPro)
8645 this->SetIntFlowProductOfCorrectionTermsForNUAPro(intFlowProductOfCorrectionTermsForNUAPro);
8648 cout<<"WARNING: intFlowProductOfCorrectionTermsForNUAPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8650 } else // to if(intFlowProfiles)
8652 cout<<"WARNING: intFlowProfiles is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8655 // d) Get pointer to list fIntFlowResults and pointers to all objects that she holds.
8656 TList *intFlowResults = NULL;
8657 intFlowResults = dynamic_cast<TList*>(intFlowList->FindObject("Results"));
8660 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with correct errors!):
8661 TString intFlowCorrelationsHistName = "fIntFlowCorrelationsHist";
8662 intFlowCorrelationsHistName += fAnalysisLabel->Data();
8663 TH1D *intFlowCorrelationsHist = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCorrelationsHistName.Data()));
8664 if(intFlowCorrelationsHist)
8666 this->SetIntFlowCorrelationsHist(intFlowCorrelationsHist);
8669 cout<<"WARNING: intFlowCorrelationsHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8671 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with correct errors!) vs M:
8672 if(fCalculateCumulantsVsM)
8674 TString intFlowCorrelationsVsMHistName = "fIntFlowCorrelationsVsMHist";
8675 intFlowCorrelationsVsMHistName += fAnalysisLabel->Data();
8676 for(Int_t ci=0;ci<4;ci++) // correlation index
8678 TH1D *intFlowCorrelationsVsMHist = dynamic_cast<TH1D*>
8679 (intFlowResults->FindObject(Form("%s, %s",intFlowCorrelationsVsMHistName.Data(),correlationFlag[ci].Data())));
8680 if(intFlowCorrelationsVsMHist)
8682 this->SetIntFlowCorrelationsVsMHist(intFlowCorrelationsVsMHist,ci);
8685 cout<<"WARNING: "<<Form("intFlowCorrelationsVsMHist[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8687 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
8688 } // end of if(fCalculateCumulantsVsM)
8689 // average all correlations for integrated flow (with correct errors!):
8690 TString intFlowCorrelationsAllHistName = "fIntFlowCorrelationsAllHist";
8691 intFlowCorrelationsAllHistName += fAnalysisLabel->Data();
8692 TH1D *intFlowCorrelationsAllHist = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCorrelationsAllHistName.Data()));
8693 if(intFlowCorrelationsAllHist)
8695 this->SetIntFlowCorrelationsAllHist(intFlowCorrelationsAllHist);
8698 cout<<"WARNING: intFlowCorrelationsAllHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8700 // average correction terms for non-uniform acceptance (with correct errors!):
8701 TString intFlowCorrectionTermsForNUAHistName = "fIntFlowCorrectionTermsForNUAHist";
8702 intFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
8703 for(Int_t sc=0;sc<2;sc++)
8705 TH1D *intFlowCorrectionTermsForNUAHist = dynamic_cast<TH1D*>(intFlowResults->FindObject((Form("%s: %s terms",intFlowCorrectionTermsForNUAHistName.Data(),sinCosFlag[sc].Data()))));
8706 if(intFlowCorrectionTermsForNUAHist)
8708 this->SetIntFlowCorrectionTermsForNUAHist(intFlowCorrectionTermsForNUAHist,sc);
8711 cout<<"WARNING: intFlowCorrectionTermsForNUAHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8712 cout<<"sc = "<<sc<<endl;
8714 } // end of for(Int_t sc=0;sc<2;sc++)
8715 // covariances (multiplied with weight dependent prefactor):
8716 TString intFlowCovariancesName = "fIntFlowCovariances";
8717 intFlowCovariancesName += fAnalysisLabel->Data();
8718 TH1D *intFlowCovariances = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCovariancesName.Data()));
8719 if(intFlowCovariances)
8721 this->SetIntFlowCovariances(intFlowCovariances);
8724 cout<<"WARNING: intFlowCovariances is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8726 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8>:
8727 TString intFlowSumOfEventWeightsName = "fIntFlowSumOfEventWeights";
8728 intFlowSumOfEventWeightsName += fAnalysisLabel->Data();
8729 for(Int_t power=0;power<2;power++)
8731 TH1D *intFlowSumOfEventWeights = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s: %s",intFlowSumOfEventWeightsName.Data(),powerFlag[power].Data())));
8732 if(intFlowSumOfEventWeights)
8734 this->SetIntFlowSumOfEventWeights(intFlowSumOfEventWeights,power);
8737 cout<<"WARNING: intFlowSumOfEventWeights is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8738 cout<<"power = "<<power<<endl;
8740 } // end of for(Int_t power=0;power<2;power++)
8741 // sum of products of event weights for correlations <2>, <4>, <6> and <8>:
8742 TString intFlowSumOfProductOfEventWeightsName = "fIntFlowSumOfProductOfEventWeights";
8743 intFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
8744 TH1D *intFlowSumOfProductOfEventWeights = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowSumOfProductOfEventWeightsName.Data()));
8745 if(intFlowSumOfProductOfEventWeights)
8747 this->SetIntFlowSumOfProductOfEventWeights(intFlowSumOfProductOfEventWeights);
8750 cout<<"WARNING: intFlowSumOfProductOfEventWeights is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8752 // final result for covariances of correlations (multiplied with weight dependent prefactor) versus M
8753 // [0=Cov(2,4),1=Cov(2,6),2=Cov(2,8),3=Cov(4,6),4=Cov(4,8),5=Cov(6,8)]:
8754 if(fCalculateCumulantsVsM)
8756 TString intFlowCovariancesVsMName = "fIntFlowCovariancesVsM";
8757 intFlowCovariancesVsMName += fAnalysisLabel->Data();
8758 TString covarianceFlag[6] = {"Cov(<2>,<4>)","Cov(<2>,<6>)","Cov(<2>,<8>)","Cov(<4>,<6>)","Cov(<4>,<8>)","Cov(<6>,<8>)"};
8759 for(Int_t ci=0;ci<6;ci++)
8761 TH1D *intFlowCovariancesVsM = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s, %s",intFlowCovariancesVsMName.Data(),covarianceFlag[ci].Data())));
8762 if(intFlowCovariancesVsM)
8764 this->SetIntFlowCovariancesVsM(intFlowCovariancesVsM,ci);
8767 cout<<"WARNING: "<<Form("intFlowCovariancesVsM[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8769 } // end of for(Int_t ci=0;ci<6;ci++)
8770 } // end of if(fCalculateCumulantsVsM)
8771 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8> versus multiplicity
8772 // [0=sum{w_{<2>}},1=sum{w_{<4>}},2=sum{w_{<6>}},3=sum{w_{<8>}}][0=linear 1,1=quadratic]:
8773 if(fCalculateCumulantsVsM)
8775 TString intFlowSumOfEventWeightsVsMName = "fIntFlowSumOfEventWeightsVsM";
8776 intFlowSumOfEventWeightsVsMName += fAnalysisLabel->Data();
8777 TString sumFlag[2][4] = {{"#sum_{i=1}^{N} w_{<2>}","#sum_{i=1}^{N} w_{<4>}","#sum_{i=1}^{N} w_{<6>}","#sum_{i=1}^{N} w_{<8>}"},
8778 {"#sum_{i=1}^{N} w_{<2>}^{2}","#sum_{i=1}^{N} w_{<4>}^{2}","#sum_{i=1}^{N} w_{<6>}^{2}","#sum_{i=1}^{N} w_{<8>}^{2}"}};
8779 for(Int_t si=0;si<4;si++)
8781 for(Int_t power=0;power<2;power++)
8783 TH1D *intFlowSumOfEventWeightsVsM = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s, %s",intFlowSumOfEventWeightsVsMName.Data(),sumFlag[power][si].Data())));
8784 if(intFlowSumOfEventWeightsVsM)
8786 this->SetIntFlowSumOfEventWeightsVsM(intFlowSumOfEventWeightsVsM,si,power);
8789 cout<<"WARNING: "<<Form("intFlowSumOfEventWeightsVsM[%d][%d]",si,power)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8791 } // end of for(Int_t power=0;power<2;power++)
8792 } // end of for(Int_t si=0;si<4;si++)
8793 } // end of if(fCalculateCumulantsVsM)
8794 // sum of products of event weights for correlations <2>, <4>, <6> and <8> vs M
8795 // [0=sum{w_{<2>}w_{<4>}},1=sum{w_{<2>}w_{<6>}},2=sum{w_{<2>}w_{<8>}},
8796 // 3=sum{w_{<4>}w_{<6>}},4=sum{w_{<4>}w_{<8>}},5=sum{w_{<6>}w_{<8>}}]:
8797 if(fCalculateCumulantsVsM)
8799 TString intFlowSumOfProductOfEventWeightsVsMName = "fIntFlowSumOfProductOfEventWeightsVsM";
8800 intFlowSumOfProductOfEventWeightsVsMName += fAnalysisLabel->Data();
8801 TString sopowFlag[6] = {"#sum_{i=1}^{N} w_{<2>} w_{<4>}","#sum_{i=1}^{N} w_{<2>} w_{<6>}","#sum_{i=1}^{N} w_{<2>} w_{<8>}",
8802 "#sum_{i=1}^{N} w_{<4>} w_{<6>}","#sum_{i=1}^{N} w_{<4>} w_{<8>}","#sum_{i=1}^{N} w_{<6>} w_{<8>}"};
8803 for(Int_t pi=0;pi<6;pi++)
8805 TH1D *intFlowSumOfProductOfEventWeightsVsM = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s, %s",intFlowSumOfProductOfEventWeightsVsMName.Data(),sopowFlag[pi].Data())));
8806 if(intFlowSumOfProductOfEventWeightsVsM)
8808 this->SetIntFlowSumOfProductOfEventWeightsVsM(intFlowSumOfProductOfEventWeightsVsM,pi);
8811 cout<<"WARNING: "<<Form("intFlowSumOfProductOfEventWeightsVsM[%d]",pi)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8813 } // end of for(Int_t pi=0;pi<6;pi++)
8814 } // end of if(fCalculateCumulantsVsM)
8815 // covariances for NUA (multiplied with weight dependent prefactor):
8816 TString intFlowCovariancesNUAName = "fIntFlowCovariancesNUA";
8817 intFlowCovariancesNUAName += fAnalysisLabel->Data();
8818 TH1D *intFlowCovariancesNUA = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCovariancesNUAName.Data()));
8819 if(intFlowCovariancesNUA)
8821 this->SetIntFlowCovariancesNUA(intFlowCovariancesNUA);
8824 cout<<"WARNING: intFlowCovariancesNUA is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8826 // sum of linear and quadratic event weights NUA terms:
8827 TString intFlowSumOfEventWeightsNUAName = "fIntFlowSumOfEventWeightsNUA";
8828 intFlowSumOfEventWeightsNUAName += fAnalysisLabel->Data();
8829 for(Int_t sc=0;sc<2;sc++)
8831 for(Int_t power=0;power<2;power++)
8833 TH1D *intFlowSumOfEventWeightsNUA = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s: %s, %s",intFlowSumOfEventWeightsNUAName.Data(),powerFlag[power].Data(),sinCosFlag[sc].Data())));
8834 if(intFlowSumOfEventWeightsNUA)
8836 this->SetIntFlowSumOfEventWeightsNUA(intFlowSumOfEventWeightsNUA,sc,power);
8839 cout<<"WARNING: intFlowSumOfEventWeightsNUA is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8840 cout<<"sc = "<<sc<<endl;
8841 cout<<"power = "<<power<<endl;
8843 } // end of for(Int_t power=0;power<2;power++)
8844 } // end of for(Int_t sc=0;sc<2;sc++)
8845 // sum of products of event weights for NUA terms:
8846 TString intFlowSumOfProductOfEventWeightsNUAName = "fIntFlowSumOfProductOfEventWeightsNUA";
8847 intFlowSumOfProductOfEventWeightsNUAName += fAnalysisLabel->Data();
8848 TH1D *intFlowSumOfProductOfEventWeightsNUA = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowSumOfProductOfEventWeightsNUAName.Data()));
8849 if(intFlowSumOfProductOfEventWeightsNUA)
8851 this->SetIntFlowSumOfProductOfEventWeightsNUA(intFlowSumOfProductOfEventWeightsNUA);
8854 cout<<"WARNING: intFlowSumOfProductOfEventWeightsNUA is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8856 // Final results for reference Q-cumulants:
8857 TString intFlowQcumulantsName = "fIntFlowQcumulants";
8858 intFlowQcumulantsName += fAnalysisLabel->Data();
8859 TH1D *intFlowQcumulants = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowQcumulantsName.Data()));
8860 if(intFlowQcumulants)
8862 this->SetIntFlowQcumulants(intFlowQcumulants);
8865 cout<<"WARNING: intFlowQcumulants is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8867 // Final results for reference Q-cumulants rebinned in M:
8868 if(fCalculateCumulantsVsM)
8870 TString intFlowQcumulantsRebinnedInMName = "fIntFlowQcumulantsRebinnedInM";
8871 intFlowQcumulantsRebinnedInMName += fAnalysisLabel->Data();
8872 TH1D *intFlowQcumulantsRebinnedInM = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowQcumulantsRebinnedInMName.Data()));
8873 if(intFlowQcumulantsRebinnedInM)
8875 this->SetIntFlowQcumulantsRebinnedInM(intFlowQcumulantsRebinnedInM);
8878 cout<<"WARNING: intFlowQcumulantsRebinnedInM is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8880 } // end of if(fCalculateCumulantsVsM)
8881 // Ratio between error squared: with/without non-isotropic terms:
8882 TString intFlowQcumulantsErrorSquaredRatioName = "fIntFlowQcumulantsErrorSquaredRatio";
8883 intFlowQcumulantsErrorSquaredRatioName += fAnalysisLabel->Data();
8884 TH1D *intFlowQcumulantsErrorSquaredRatio = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowQcumulantsErrorSquaredRatioName.Data()));
8885 if(intFlowQcumulantsErrorSquaredRatio)
8887 this->SetIntFlowQcumulantsErrorSquaredRatio(intFlowQcumulantsErrorSquaredRatio);
8890 cout<<" WARNING: intntFlowQcumulantsErrorSquaredRatio is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8892 // final results for integrated Q-cumulants versus multiplicity:
8893 TString cumulantFlag[4] = {"QC{2}","QC{4}","QC{6}","QC{8}"};
8894 if(fCalculateCumulantsVsM)
8896 TString intFlowQcumulantsVsMName = "fIntFlowQcumulantsVsM";
8897 intFlowQcumulantsVsMName += fAnalysisLabel->Data();
8898 for(Int_t co=0;co<4;co++) // cumulant order
8900 TH1D *intFlowQcumulantsVsM = dynamic_cast<TH1D*>
8901 (intFlowResults->FindObject(Form("%s, %s",intFlowQcumulantsVsMName.Data(),cumulantFlag[co].Data())));
8902 if(intFlowQcumulantsVsM)
8904 this->SetIntFlowQcumulantsVsM(intFlowQcumulantsVsM,co);
8907 cout<<"WARNING: "<<Form("intFlowQcumulantsVsM[%d]",co)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8909 } // end of for(Int_t co=0;co<4;co++) // cumulant order
8910 } // end of if(fCalculateCumulantsVsM)
8911 // Final reference flow estimates from Q-cumulants:
8912 TString intFlowName = "fIntFlow";
8913 intFlowName += fAnalysisLabel->Data();
8914 TH1D *intFlow = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowName.Data()));
8917 this->SetIntFlow(intFlow);
8920 cout<<"WARNING: intFlow is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8922 // Final reference flow estimates from Q-cumulants vs M rebinned in M:
8923 if(fCalculateCumulantsVsM)
8925 TString intFlowRebinnedInMName = "fIntFlowRebinnedInM";
8926 intFlowRebinnedInMName += fAnalysisLabel->Data();
8927 TH1D *intFlowRebinnedInM = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowRebinnedInMName.Data()));
8928 if(intFlowRebinnedInM)
8930 this->SetIntFlowRebinnedInM(intFlowRebinnedInM);
8933 cout<<"WARNING: intFlowRebinnedInM is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8935 } // end of if(fCalculateCumulantsVsM)
8936 // integrated flow from Q-cumulants versus multiplicity:
8937 if(fCalculateCumulantsVsM)
8939 TString intFlowVsMName = "fIntFlowVsM";
8940 intFlowVsMName += fAnalysisLabel->Data();
8941 TString flowFlag[4] = {Form("v_{%d}{2,QC}",fHarmonic),Form("v_{%d}{4,QC}",fHarmonic),Form("v_{%d}{6,QC}",fHarmonic),Form("v_{%d}{8,QC}",fHarmonic)};
8942 for(Int_t co=0;co<4;co++) // cumulant order
8944 TH1D *intFlowVsM = dynamic_cast<TH1D*>
8945 (intFlowResults->FindObject(Form("%s, %s",intFlowVsMName.Data(),flowFlag[co].Data())));
8948 this->SetIntFlowVsM(intFlowVsM,co);
8951 cout<<"WARNING: "<<Form("intFlowVsM[%d]",co)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8953 } // end of for(Int_t co=0;co<4;co++) // cumulant order
8954 } // end of if(fCalculateCumulantsVsM)
8955 // quantifying detector effects effects to correlations:
8956 TString intFlowDetectorBiasName = "fIntFlowDetectorBias";
8957 intFlowDetectorBiasName += fAnalysisLabel->Data();
8958 TH1D *intFlowDetectorBias = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowDetectorBiasName.Data()));
8959 if(intFlowDetectorBias)
8961 this->SetIntFlowDetectorBias(intFlowDetectorBias);
8964 cout<<"WARNING: intFlowDetectorBias is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8966 // quantifying detector effects effects to correlations vs multiplicity:
8967 if(fCalculateCumulantsVsM)
8969 TString intFlowDetectorBiasVsMName = "fIntFlowDetectorBiasVsM";
8970 intFlowDetectorBiasVsMName += fAnalysisLabel->Data();
8971 for(Int_t ci=0;ci<4;ci++) // correlation index
8973 TH1D *intFlowDetectorBiasVsM = dynamic_cast<TH1D*>
8974 (intFlowResults->FindObject(Form("%s for %s",intFlowDetectorBiasVsMName.Data(),cumulantFlag[ci].Data())));
8975 if(intFlowDetectorBiasVsM)
8977 this->SetIntFlowDetectorBiasVsM(intFlowDetectorBiasVsM,ci);
8980 cout<<"WARNING: "<<Form("intFlowDetectorBiasVsM[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8982 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
8983 } // end of if(fCalculateCumulantsVsM)
8984 } else // to if(intFlowResults)
8986 cout<<"WARNING: intFlowResults is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8989 } // end of void AliFlowAnalysisWithQCumulants::GetPointersForIntFlowHistograms()
8991 //================================================================================================================================
8993 void AliFlowAnalysisWithQCumulants::GetPointersFor2DDiffFlowHistograms()
8995 // Get pointers for 2D differential flow histograms.
8996 // a) Check pointers used in this method;
8997 // b) Get pointers to 2D differential flow lists;
8998 // c) Get pointers to 2D differential flow profiles;
8999 // d) Get pointers to 2D differential flow histograms.
9001 // a) Check pointers used in this method:
9004 printf("\n WARNING (QC): fDiffFlowList is NULL in AFAWQC::GPF2DDFH() !!!!\n");
9005 printf(" Call method GetPointersForDiffFlowHistograms() first.\n\n");
9010 printf("\n WARNING (QC): fDiffFlowFlags is NULL in AFAWQC::GPF2DDFH() !!!!\n\n");
9011 printf(" Call method GetPointersForDiffFlowHistograms() first.\n\n");
9015 // b) Get pointers to 2D differential flow lists:
9016 this->SetCalculate2DDiffFlow((Bool_t)fDiffFlowFlags->GetBinContent(5)); // to be improved - hardwired 5
9017 if(!fCalculate2DDiffFlow){return;}
9018 TString typeFlag[2] = {"RP","POI"};
9019 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};
9020 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
9021 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
9023 TString diffFlow2DListName = "2D";
9024 diffFlow2DListName += fAnalysisLabel->Data();
9025 fDiffFlow2D = dynamic_cast<TList*>(fDiffFlowList->FindObject(diffFlow2DListName.Data()));
9028 printf("\n WARNING (QC): fDiffFlow2D is NULL in AFAWQC::GPFDFH() !!!!\n\n");
9031 // Lists holding profiles with 2D correlations:
9032 TString s2DDiffFlowCorrelationsProListName = "Profiles with 2D correlations";
9033 s2DDiffFlowCorrelationsProListName += fAnalysisLabel->Data(); // to be improved
9034 for(Int_t t=0;t<2;t++)
9036 f2DDiffFlowCorrelationsProList[t] = dynamic_cast<TList*>(fDiffFlow2D->FindObject(Form("Profiles with 2D correlations (%s)",typeFlag[t].Data())));
9037 if(!f2DDiffFlowCorrelationsProList[t])
9039 printf("\n WARNING (QC): f2DDiffFlowCorrelationsProList[%i] is NULL in AFAWQC::GPF2DFH() !!!!\n\n",t);
9042 } // end of for(Int_t t=0;t<2;t++)
9044 // c) Get pointers to 2D differential flow profiles:
9045 TString s2DDiffFlowCorrelationsProName = "f2DDiffFlowCorrelationsPro";
9046 s2DDiffFlowCorrelationsProName += fAnalysisLabel->Data();
9047 for(Int_t t=0;t<2;t++) // type: RP or POI
9049 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
9051 f2DDiffFlowCorrelationsPro[t][rci] = dynamic_cast<TProfile2D*>(f2DDiffFlowCorrelationsProList[t]->FindObject(Form("%s, %s, %s",s2DDiffFlowCorrelationsProName.Data(),typeFlag[t].Data(),reducedCorrelationIndex[rci].Data())));
9052 if(!f2DDiffFlowCorrelationsPro[t][rci])
9054 printf("\n WARNING (QC): f2DDiffFlowCorrelationsPro[%i][%i] is NULL in AFAWQC::GPF2DFH() !!!!\n\n",t,rci);
9058 this->Set2DDiffFlowCorrelationsPro(f2DDiffFlowCorrelationsPro[t][rci],t,rci);
9060 } // end of for(Int_t rci=0;rci<4;rci++) // reduced correlation index
9061 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
9063 // d) Get pointers to 2D differential flow histograms:
9064 TString s2DDiffFlowCumulantsName = "f2DDiffFlowCumulants";
9065 s2DDiffFlowCumulantsName += fAnalysisLabel->Data();
9066 TString s2DDiffFlowName = "f2DDiffFlow";
9067 s2DDiffFlowName += fAnalysisLabel->Data();
9068 for(Int_t t=0;t<2;t++) // type: RP or POI
9070 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
9072 // 2D differential cumulants:
9073 f2DDiffFlowCumulants[t][rci] = dynamic_cast<TH2D*>(f2DDiffFlowCorrelationsProList[t]->FindObject(Form("%s, %s, %s",s2DDiffFlowCumulantsName.Data(),typeFlag[t].Data(),differentialCumulantIndex[rci].Data())));
9074 if(!f2DDiffFlowCumulants[t][rci])
9076 printf("\n WARNING (QC): f2DDiffFlowCumulants[%i][%i] is NULL in AFAWQC::GPF2DFH() !!!!\n\n",t,rci);
9080 this->Set2DDiffFlowCumulants(f2DDiffFlowCumulants[t][rci],t,rci);
9082 // 2D differential flow:
9083 f2DDiffFlow[t][rci] = dynamic_cast<TH2D*>(f2DDiffFlowCorrelationsProList[t]->FindObject(Form("%s, %s, %s",s2DDiffFlowName.Data(),typeFlag[t].Data(),differentialFlowIndex[rci].Data())));
9084 if(!f2DDiffFlow[t][rci])
9086 printf("\n WARNING (QC): f2DDiffFlow[%i][%i] is NULL in AFAWQC::GPF2DFH() !!!!\n\n",t,rci);
9090 this->Set2DDiffFlow(f2DDiffFlow[t][rci],t,rci);
9092 } // end of for(Int_t rci=0;rci<4;rci++) // reduced correlation index
9093 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
9095 } // end of void AliFlowAnalysisWithQCumulants::GetPointersFor2DDiffFlowHistograms()
9097 //================================================================================================================================
9099 void AliFlowAnalysisWithQCumulants::GetPointersForOtherDiffCorrelators()
9101 // Get pointers for other differential correlators.
9102 // a) Get pointer to list with other differential correlators;
9103 // b) Declare local flags;
9104 // c) Get pointers to other differential profiles.
9106 if(!fCalculateDiffFlow){return;} // TBI: This must eventually be moved somewhere else
9108 // a) Get pointer to list with other differential correlators:
9109 fOtherDiffCorrelatorsList = dynamic_cast<TList*>(fHistList->FindObject("Other differential correlators"));
9110 if(!fOtherDiffCorrelatorsList)
9112 printf("\n WARNING (QC): fOtherDiffCorrelatorsList is NULL in AFAWQC::GPFDFH() !!!!\n\n");
9116 // b) Declare local flags: // (to be improved - promoted to data members)
9117 TString typeFlag[2] = {"RP","POI"};
9118 TString ptEtaFlag[2] = {"p_{T}","#eta"};
9119 TString sinCosFlag[2] = {"sin","cos"};
9121 // c) Get pointers to other differential profiles:
9122 TString otherDiffCorrelatorsName = "fOtherDiffCorrelators";
9123 otherDiffCorrelatorsName += fAnalysisLabel->Data();
9124 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
9126 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
9128 for(Int_t sc=0;sc<2;sc++) // sin or cos
9130 for(Int_t ci=0;ci<1;ci++) // correlator index
9132 fOtherDiffCorrelators[t][pe][sc][ci] = dynamic_cast<TProfile*>(fOtherDiffCorrelatorsList->FindObject(Form("%s, %s, %s, %s, ci = %d",otherDiffCorrelatorsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),ci+1)));
9133 if(!fOtherDiffCorrelators[t][pe][sc][ci])
9135 printf("\n WARNING (QC): fOtherDiffCorrelators[%i][%i][%i][%i] is NULL in AFAWQC::GPFODC() !!!!\n\n",t,pe,sc,ci);
9139 this->SetOtherDiffCorrelators(fOtherDiffCorrelators[t][pe][sc][ci],t,pe,sc,ci);
9141 } // end of for(Int_t ci=0;ci<1;ci++) // correlator index
9142 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
9143 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
9144 } // end of for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
9146 } // end of void AliFlowAnalysisWithQCumulants::GetPointersForOtherDiffCorrelators()
9148 //================================================================================================================================
9150 void AliFlowAnalysisWithQCumulants::GetPointersForDiffFlowHistograms()
9152 // Get pointer to all objects relevant for differential flow.
9153 // a) Get pointer to base list for differential flow fDiffFlowList;
9154 // b) Get pointer to profile fDiffFlowFlags holding all flags for differential flow. Access and set some flags;
9155 // c) Get pointers to nested lists fDiffFlowListProfiles and fDiffFlowListResults;
9156 // d) Define flags locally (to be improved: should I promote these flags to data members?);
9157 // e) Get pointers to all nested lists in fDiffFlowListProfiles and to profiles which they hold;
9158 // f) Get pointers to all nested lists in fDiffFlowListResults and to histograms which they hold.
9160 // a) Get pointer to base list for differential flow fDiffFlowList:
9161 fDiffFlowList = dynamic_cast<TList*>(fHistList->FindObject("Differential Flow"));
9164 printf("\n WARNING (QC): fDiffFlowList is NULL in AFAWQC::GPFDFH() !!!!\n\n");
9168 // b) Get pointer to profile fDiffFlowFlags holding all flags for differential flow. Access and set some flags:
9169 TString diffFlowFlagsName = "fDiffFlowFlags";
9170 diffFlowFlagsName += fAnalysisLabel->Data();
9171 fDiffFlowFlags = dynamic_cast<TProfile*>(fDiffFlowList->FindObject(diffFlowFlagsName.Data()));
9174 this->SetCalculateDiffFlow((Bool_t)fDiffFlowFlags->GetBinContent(1)); // to be improved - hardwired 1
9175 this->SetCalculateDiffFlowVsEta((Bool_t)fDiffFlowFlags->GetBinContent(6)); // to be improved - hardwired 6
9178 printf("\n WARNING (QC): fDiffFlowFlags is NULL in AFAWQC::GPFDFH() !!!!\n\n");
9179 printf("\n Flags in method Finish() are wrong.\n\n");
9183 if(!fCalculateDiffFlow){return;} // IMPORTANT: do not move this anywhere above in this method (to be improved)
9185 // c) Get pointers to nested lists fDiffFlowListProfiles and fDiffFlowListResults:
9186 // List holding nested lists holding profiles:
9187 TList *diffFlowListProfiles = NULL;
9188 diffFlowListProfiles = dynamic_cast<TList*>(fDiffFlowList->FindObject("Profiles"));
9189 if(!diffFlowListProfiles)
9191 printf("\n WARNING (QC): diffFlowListProfiles is NULL in AFAWQC::GPFDFH() !!!!\n\n");
9194 // List holding nested lists holding histograms with final results:
9195 TList *diffFlowListResults = NULL;
9196 diffFlowListResults = dynamic_cast<TList*>(fDiffFlowList->FindObject("Results"));
9197 if(!diffFlowListResults)
9199 printf("\n WARNING (QC): diffFlowListResults is NULL in AFAWQC::GPFDFH() !!!!\n\n");
9203 // d) Define flags locally (to be improved: should I promote these flags to data members?):
9204 TString typeFlag[2] = {"RP","POI"};
9205 TString ptEtaFlag[2] = {"p_{T}","#eta"};
9206 TString powerFlag[2] = {"linear","quadratic"};
9207 TString sinCosFlag[2] = {"sin","cos"};
9208 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
9209 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
9210 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};
9211 TString reducedSquaredCorrelationIndex[4] = {"<2'>^{2}","<4'>^{2}","<6'>^{2}","<8'>^{2}"};
9212 TString mixedCorrelationIndex[8] = {"<2>","<2'>","<4>","<4'>","<6>","<6'>","<8>","<8'>"};
9213 TString covarianceName[5] = {"Cov(<2>,<2'>)","Cov(<2>,<4'>)","Cov(<4>,<2'>)","Cov(<4>,<4'>)","Cov(<2'>,<4'>)"};
9215 // e) Get pointers to all nested lists in fDiffFlowListProfiles and to profiles which they hold:
9217 TList *diffFlowCorrelationsProList[2][2] = {{NULL}};
9218 TString diffFlowCorrelationsProName = "fDiffFlowCorrelationsPro";
9219 diffFlowCorrelationsProName += fAnalysisLabel->Data();
9220 TProfile *diffFlowCorrelationsPro[2][2][4] = {{{NULL}}};
9221 // squared correlations:
9222 TString diffFlowSquaredCorrelationsProName = "fDiffFlowSquaredCorrelationsPro";
9223 diffFlowSquaredCorrelationsProName += fAnalysisLabel->Data();
9224 TProfile *diffFlowSquaredCorrelationsPro[2][2][4] = {{{NULL}}};
9225 // products of correlations:
9226 TList *diffFlowProductOfCorrelationsProList[2][2] = {{NULL}};
9227 TString diffFlowProductOfCorrelationsProName = "fDiffFlowProductOfCorrelationsPro";
9228 diffFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
9229 TProfile *diffFlowProductOfCorrelationsPro[2][2][8][8] = {{{{NULL}}}};
9231 TList *diffFlowCorrectionsProList[2][2] = {{NULL}};
9232 TString diffFlowCorrectionTermsForNUAProName = "fDiffFlowCorrectionTermsForNUAPro";
9233 diffFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
9234 TProfile *diffFlowCorrectionTermsForNUAPro[2][2][2][10] = {{{{NULL}}}};
9235 for(Int_t t=0;t<2;t++)
9237 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++)
9239 diffFlowCorrelationsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
9240 if(!diffFlowCorrelationsProList[t][pe])
9242 cout<<"WARNING: diffFlowCorrelationsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9243 cout<<"t = "<<t<<endl;
9244 cout<<"pe = "<<pe<<endl;
9247 for(Int_t ci=0;ci<4;ci++) // correlation index
9249 // reduced correlations:
9250 diffFlowCorrelationsPro[t][pe][ci] = dynamic_cast<TProfile*>(diffFlowCorrelationsProList[t][pe]->FindObject(Form("%s, %s, %s, %s",diffFlowCorrelationsProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[ci].Data())));
9251 if(diffFlowCorrelationsPro[t][pe][ci])
9253 this->SetDiffFlowCorrelationsPro(diffFlowCorrelationsPro[t][pe][ci],t,pe,ci);
9256 cout<<"WARNING: diffFlowCorrelationsPro[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9257 cout<<"t = "<<t<<endl;
9258 cout<<"pe = "<<pe<<endl;
9259 cout<<"ci = "<<ci<<endl;
9261 // reduced squared correlations:
9262 diffFlowSquaredCorrelationsPro[t][pe][ci] = dynamic_cast<TProfile*>(diffFlowCorrelationsProList[t][pe]->FindObject(Form("%s, %s, %s, %s",diffFlowSquaredCorrelationsProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedSquaredCorrelationIndex[ci].Data())));
9263 if(diffFlowSquaredCorrelationsPro[t][pe][ci])
9265 this->SetDiffFlowSquaredCorrelationsPro(diffFlowSquaredCorrelationsPro[t][pe][ci],t,pe,ci);
9268 cout<<"WARNING: diffFlowSquaredCorrelationsPro[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9269 cout<<"t = "<<t<<endl;
9270 cout<<"pe = "<<pe<<endl;
9271 cout<<"ci = "<<ci<<endl;
9273 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
9274 // products of correlations:
9275 diffFlowProductOfCorrelationsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with products of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
9276 if(!diffFlowProductOfCorrelationsProList[t][pe])
9278 cout<<"WARNING: ddiffFlowProductOfCorrelationsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9279 cout<<"t = "<<t<<endl;
9280 cout<<"pe = "<<pe<<endl;
9283 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
9285 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
9287 diffFlowProductOfCorrelationsPro[t][pe][mci1][mci2] = dynamic_cast<TProfile*>(diffFlowProductOfCorrelationsProList[t][pe]->FindObject(Form("%s, %s, %s, %s, %s",diffFlowProductOfCorrelationsProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),mixedCorrelationIndex[mci1].Data(),mixedCorrelationIndex[mci2].Data())));
9288 if(diffFlowProductOfCorrelationsPro[t][pe][mci1][mci2])
9290 this->SetDiffFlowProductOfCorrelationsPro(diffFlowProductOfCorrelationsPro[t][pe][mci1][mci2],t,pe,mci1,mci2);
9293 cout<<"WARNING: diffFlowProductOfCorrelationsPro[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9294 cout<<"t = "<<t<<endl;
9295 cout<<"pe = "<<pe<<endl;
9296 cout<<"mci1 = "<<mci1<<endl;
9297 cout<<"mci2 = "<<mci2<<endl;
9299 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
9300 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
9301 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
9303 diffFlowCorrectionsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
9304 if(!diffFlowCorrectionsProList[t][pe])
9306 cout<<"WARNING: diffFlowCorrectionsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9307 cout<<"t = "<<t<<endl;
9308 cout<<"pe = "<<pe<<endl;
9311 // correction terms for NUA:
9312 for(Int_t sc=0;sc<2;sc++) // sin or cos
9314 for(Int_t cti=0;cti<9;cti++) // correction term index
9316 diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti] = dynamic_cast<TProfile*>(diffFlowCorrectionsProList[t][pe]->FindObject(Form("%s, %s, %s, %s, cti = %d",diffFlowCorrectionTermsForNUAProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),cti+1)));
9317 if(diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti])
9319 this->SetDiffFlowCorrectionTermsForNUAPro(diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti],t,pe,sc,cti);
9322 cout<<"WARNING: diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9323 cout<<"t = "<<t<<endl;
9324 cout<<"pe = "<<pe<<endl;
9325 cout<<"sc = "<<sc<<endl;
9326 cout<<"cti = "<<cti<<endl;
9328 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index
9329 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
9331 } // end of for(Int_t pe=0;pe<2;pe++)
9332 } // end of for(Int_t t=0;t<2;t++)
9334 // f) Get pointers to all nested lists in fDiffFlowListResults and to histograms which they hold:
9335 // reduced correlations:
9336 TList *diffFlowCorrelationsHistList[2][2] = {{NULL}};
9337 TString diffFlowCorrelationsHistName = "fDiffFlowCorrelationsHist";
9338 diffFlowCorrelationsHistName += fAnalysisLabel->Data();
9339 TH1D *diffFlowCorrelationsHist[2][2][4] = {{{NULL}}};
9340 // corrections for NUA:
9341 TList *diffFlowCorrectionsHistList[2][2] = {{NULL}};
9342 TString diffFlowCorrectionTermsForNUAHistName = "fDiffFlowCorrectionTermsForNUAHist";
9343 diffFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
9344 TH1D *diffFlowCorrectionTermsForNUAHist[2][2][2][10] = {{{{NULL}}}};
9345 // differential Q-cumulants:
9346 TList *diffFlowCumulantsHistList[2][2] = {{NULL}};
9347 TString diffFlowCumulantsName = "fDiffFlowCumulants";
9348 diffFlowCumulantsName += fAnalysisLabel->Data();
9349 TH1D *diffFlowCumulants[2][2][4] = {{{NULL}}};
9350 // detector bias to differential Q-cumulants:
9351 TList *diffFlowDetectorBiasHistList[2][2] = {{NULL}};
9352 TString diffFlowDetectorBiasName = "fDiffFlowDetectorBias";
9353 diffFlowDetectorBiasName += fAnalysisLabel->Data();
9354 TH1D *diffFlowDetectorBias[2][2][4] = {{{NULL}}};
9355 // differential flow estimates from Q-cumulants:
9356 TList *diffFlowHistList[2][2] = {{NULL}};
9357 TString diffFlowName = "fDiffFlow";
9358 diffFlowName += fAnalysisLabel->Data();
9359 TH1D *diffFlow[2][2][4] = {{{NULL}}};
9360 // differential covariances:
9361 TList *diffFlowCovariancesHistList[2][2] = {{NULL}};
9362 TString diffFlowCovariancesName = "fDiffFlowCovariances";
9363 diffFlowCovariancesName += fAnalysisLabel->Data();
9364 TH1D *diffFlowCovariances[2][2][5] = {{{NULL}}};
9365 for(Int_t t=0;t<2;t++) // type: RP or POI
9367 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
9369 // reduced correlations:
9370 diffFlowCorrelationsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
9371 if(!diffFlowCorrelationsHistList[t][pe])
9373 cout<<"WARNING: diffFlowCorrelationsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9374 cout<<"t = "<<t<<endl;
9375 cout<<"pe = "<<pe<<endl;
9378 for(Int_t index=0;index<4;index++)
9380 diffFlowCorrelationsHist[t][pe][index] = dynamic_cast<TH1D*>(diffFlowCorrelationsHistList[t][pe]->FindObject(Form("%s, %s, %s, %s",diffFlowCorrelationsHistName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[index].Data())));
9381 if(diffFlowCorrelationsHist[t][pe][index])
9383 this->SetDiffFlowCorrelationsHist(diffFlowCorrelationsHist[t][pe][index],t,pe,index);
9386 cout<<"WARNING: diffFlowCorrelationsHist[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9387 cout<<"t = "<<t<<endl;
9388 cout<<"pe = "<<pe<<endl;
9389 cout<<"index = "<<index<<endl;
9392 } // end of for(Int_t index=0;index<4;index++)
9394 diffFlowCorrectionsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Histograms with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
9395 if(!diffFlowCorrectionsHistList[t][pe])
9397 cout<<"WARNING: diffFlowCorrectionsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9398 cout<<"t = "<<t<<endl;
9399 cout<<"pe = "<<pe<<endl;
9402 // correction terms for NUA:
9403 for(Int_t sc=0;sc<2;sc++) // sin or cos
9405 for(Int_t cti=0;cti<9;cti++) // correction term index
9407 diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti] = dynamic_cast<TH1D*>(diffFlowCorrectionsHistList[t][pe]->FindObject(Form("%s, %s, %s, %s, cti = %d",diffFlowCorrectionTermsForNUAHistName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),cti+1)));
9408 if(diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti])
9410 this->SetDiffFlowCorrectionTermsForNUAHist(diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti],t,pe,sc,cti);
9413 cout<<"WARNING: diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9414 cout<<"t = "<<t<<endl;
9415 cout<<"pe = "<<pe<<endl;
9416 cout<<"sc = "<<sc<<endl;
9417 cout<<"cti = "<<cti<<endl;
9419 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index
9420 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
9422 // differential Q-cumulants:
9423 diffFlowCumulantsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Differential Q-cumulants (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
9424 if(!diffFlowCumulantsHistList[t][pe])
9426 cout<<"WARNING: diffFlowCumulantsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9427 cout<<"t = "<<t<<endl;
9428 cout<<"pe = "<<pe<<endl;
9431 for(Int_t index=0;index<4;index++)
9433 diffFlowCumulants[t][pe][index] = dynamic_cast<TH1D*>(diffFlowCumulantsHistList[t][pe]->FindObject(Form("%s, %s, %s, %s",diffFlowCumulantsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),differentialCumulantIndex[index].Data())));
9434 if(diffFlowCumulants[t][pe][index])
9436 this->SetDiffFlowCumulants(diffFlowCumulants[t][pe][index],t,pe,index);
9439 cout<<"WARNING: diffFlowCumulants[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9440 cout<<"t = "<<t<<endl;
9441 cout<<"pe = "<<pe<<endl;
9442 cout<<"index = "<<index<<endl;
9445 } // end of for(Int_t index=0;index<4;index++)
9446 // Detector bias to differential Q-cumulants:
9447 diffFlowDetectorBiasHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Detector bias (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
9448 if(!diffFlowDetectorBiasHistList[t][pe])
9450 cout<<"WARNING: diffFlowDetectorBiasHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9451 cout<<"t = "<<t<<endl;
9452 cout<<"pe = "<<pe<<endl;
9455 for(Int_t index=0;index<4;index++)
9457 diffFlowDetectorBias[t][pe][index] = dynamic_cast<TH1D*>(diffFlowDetectorBiasHistList[t][pe]->FindObject(Form("%s, %s, %s, %s",diffFlowDetectorBiasName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),differentialCumulantIndex[index].Data())));
9458 if(diffFlowDetectorBias[t][pe][index])
9460 this->SetDiffFlowDetectorBias(diffFlowDetectorBias[t][pe][index],t,pe,index);
9463 cout<<"WARNING: diffFlowDetectorBias[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9464 cout<<"t = "<<t<<endl;
9465 cout<<"pe = "<<pe<<endl;
9466 cout<<"index = "<<index<<endl;
9469 } // end of for(Int_t index=0;index<4;index++)
9470 // differential flow estimates from Q-cumulants:
9471 diffFlowHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Differential flow (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
9472 if(!diffFlowHistList[t][pe])
9474 cout<<"WARNING: diffFlowHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9475 cout<<"t = "<<t<<endl;
9476 cout<<"pe = "<<pe<<endl;
9479 for(Int_t index=0;index<4;index++)
9481 diffFlow[t][pe][index] = dynamic_cast<TH1D*>(diffFlowHistList[t][pe]->FindObject(Form("%s, %s, %s, %s",diffFlowName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),differentialFlowIndex[index].Data())));
9482 if(diffFlow[t][pe][index])
9484 this->SetDiffFlow(diffFlow[t][pe][index],t,pe,index);
9487 cout<<"WARNING: diffFlow[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9488 cout<<"t = "<<t<<endl;
9489 cout<<"pe = "<<pe<<endl;
9490 cout<<"index = "<<index<<endl;
9493 } // end of for(Int_t index=0;index<4;index++)
9494 // differential covariances:
9495 diffFlowCovariancesHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Covariances of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
9496 if(!diffFlowCovariancesHistList[t][pe])
9498 cout<<"WARNING: diffFlowCovariancesHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9499 cout<<"t = "<<t<<endl;
9500 cout<<"pe = "<<pe<<endl;
9503 for(Int_t covIndex=0;covIndex<5;covIndex++)
9505 diffFlowCovariances[t][pe][covIndex] = dynamic_cast<TH1D*>(diffFlowCovariancesHistList[t][pe]->FindObject(Form("%s, %s, %s, %s",diffFlowCovariancesName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),covarianceName[covIndex].Data())));
9506 if(diffFlowCovariances[t][pe][covIndex])
9508 this->SetDiffFlowCovariances(diffFlowCovariances[t][pe][covIndex],t,pe,covIndex);
9511 cout<<"WARNING: diffFlowCovariances[t][pe][covIndex] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9512 cout<<"t = "<<t<<endl;
9513 cout<<"pe = "<<pe<<endl;
9514 cout<<"covIndex = "<<covIndex<<endl;
9517 } // end of for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index
9518 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
9519 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
9520 // sum of event weights for reduced correlations:
9521 TList *diffFlowSumOfEventWeightsHistList[2][2][2] = {{{NULL}}};
9522 TString diffFlowSumOfEventWeightsName = "fDiffFlowSumOfEventWeights";
9523 diffFlowSumOfEventWeightsName += fAnalysisLabel->Data();
9524 TH1D *diffFlowSumOfEventWeights[2][2][2][4] = {{{{NULL}}}};
9525 for(Int_t t=0;t<2;t++) // type is RP or POI
9527 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
9529 for(Int_t p=0;p<2;p++) // power of event weights is either 1 or 2
9531 diffFlowSumOfEventWeightsHistList[t][pe][p] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Sum of %s event weights (%s, %s)",powerFlag[p].Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data())));
9532 if(!diffFlowSumOfEventWeightsHistList[t][pe][p])
9534 cout<<"WARNING: diffFlowSumOfEventWeightsHistList[t][pe][p] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9535 cout<<"t = "<<t<<endl;
9536 cout<<"pe = "<<pe<<endl;
9537 cout<<"power = "<<p<<endl;
9540 for(Int_t ew=0;ew<4;ew++) // index of reduced correlation
9542 diffFlowSumOfEventWeights[t][pe][p][ew] = dynamic_cast<TH1D*>(diffFlowSumOfEventWeightsHistList[t][pe][p]->FindObject(Form("%s, %s, %s, %s, %s",diffFlowSumOfEventWeightsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),powerFlag[p].Data(),reducedCorrelationIndex[ew].Data())));
9543 if(diffFlowSumOfEventWeights[t][pe][p][ew])
9545 this->SetDiffFlowSumOfEventWeights(diffFlowSumOfEventWeights[t][pe][p][ew],t,pe,p,ew);
9548 cout<<"WARNING: diffFlowSumOfEventWeights[t][pe][p][ew] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9549 cout<<"t = "<<t<<endl;
9550 cout<<"pe = "<<pe<<endl;
9551 cout<<"power = "<<p<<endl;
9552 cout<<"ew = "<<ew<<endl;
9556 } // end of for(Int_t p=0;p<2;p++) // power of event weights is either 1 or 2
9557 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
9558 } // end of for(Int_t t=0;t<2;t++) // type is RP or POI
9560 TList *diffFlowSumOfProductOfEventWeightsHistList[2][2] = {{NULL}};
9561 TString diffFlowSumOfProductOfEventWeightsName = "fDiffFlowSumOfProductOfEventWeights";
9562 diffFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
9563 TH1D *diffFlowSumOfProductOfEventWeights[2][2][8][8] = {{{{NULL}}}};
9564 for(Int_t t=0;t<2;t++) // type is RP or POI
9566 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
9568 diffFlowSumOfProductOfEventWeightsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Sum of products of event weights (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
9569 if(!diffFlowSumOfProductOfEventWeightsHistList[t][pe])
9571 cout<<"WARNING: diffFlowSumOfProductOfEventWeightsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9572 cout<<"t = "<<t<<endl;
9573 cout<<"pe = "<<pe<<endl;
9576 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
9578 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
9580 diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2] = dynamic_cast<TH1D*>(diffFlowSumOfProductOfEventWeightsHistList[t][pe]->FindObject(Form("%s, %s, %s, %s, %s",diffFlowSumOfProductOfEventWeightsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),mixedCorrelationIndex[mci1].Data(),mixedCorrelationIndex[mci2].Data())));
9581 if(diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2])
9583 this->SetDiffFlowSumOfProductOfEventWeights(diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2],t,pe,mci1,mci2);
9586 cout<<"WARNING: diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9587 cout<<"t = "<<t<<endl;
9588 cout<<"pe = "<<pe<<endl;
9589 cout<<"mci1 = "<<mci1<<endl;
9590 cout<<"mci2 = "<<mci2<<endl;
9593 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
9594 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
9595 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
9596 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
9597 } // end of for(Int_t t=0;t<2;t++) // type is RP or POI
9599 } // end void AliFlowAnalysisWithQCumulants::GetPointersForDiffFlowHistograms()
9601 //================================================================================================================================
9603 void AliFlowAnalysisWithQCumulants::BookEverythingFor2DDifferentialFlow()
9605 // Book all objects needed for 2D differential flow.
9606 // a) Define flags locally (to be improved: should I promote flags to data members?);
9607 // b) Book e-b-e quantities;
9608 // c) Book 2D profiles;
9609 // d) Book 2D histograms.
9611 if(!fCalculate2DDiffFlow){return;}
9613 // a) Define flags locally (to be improved: should I promote flags to data members?):
9614 TString typeFlag[2] = {"RP","POI"};
9615 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};
9616 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
9617 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
9619 // b) Book e-b-e quantities:
9620 TProfile2D styleRe("typeMultiplePowerRe","typeMultiplePowerRe",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
9621 TProfile2D styleIm("typeMultiplePowerIm","typeMultiplePowerIm",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
9622 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
9624 for(Int_t m=0;m<4;m++)
9626 for(Int_t k=0;k<9;k++)
9628 fReRPQ2dEBE[t][m][k] = (TProfile2D*)styleRe.Clone(Form("typeFlag%dmultiple%dpower%dRe",t,m,k));
9629 fImRPQ2dEBE[t][m][k] = (TProfile2D*)styleIm.Clone(Form("typeFlag%dmultiple%dpower%dIm",t,m,k));
9633 TProfile2D styleS("typePower","typePower",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
9634 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
9636 for(Int_t k=0;k<9;k++)
9638 fs2dEBE[t][k] = (TProfile2D*)styleS.Clone(Form("typeFlag%dpower%d",t,k));
9642 // c) Book 2D profiles:
9643 TString s2DDiffFlowCorrelationsProName = "f2DDiffFlowCorrelationsPro";
9644 s2DDiffFlowCorrelationsProName += fAnalysisLabel->Data();
9645 for(Int_t t=0;t<2;t++) // type: RP or POI
9647 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
9649 f2DDiffFlowCorrelationsPro[t][rci] = new TProfile2D(Form("%s, %s, %s",s2DDiffFlowCorrelationsProName.Data(),typeFlag[t].Data(),reducedCorrelationIndex[rci].Data()),Form("%s, %s, %s",s2DDiffFlowCorrelationsProName.Data(),typeFlag[t].Data(),reducedCorrelationIndex[rci].Data()),fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax,"");
9650 f2DDiffFlowCorrelationsPro[t][rci]->Sumw2();
9651 f2DDiffFlowCorrelationsPro[t][rci]->SetXTitle("p_{t}");
9652 f2DDiffFlowCorrelationsPro[t][rci]->SetYTitle("#eta");
9653 f2DDiffFlowCorrelationsProList[t]->Add(f2DDiffFlowCorrelationsPro[t][rci]);
9654 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
9655 } // end of for(Int_t t=0;t<2;t++) // type: RP or POIs
9657 // d) Book 2D histograms:
9658 TString s2DDiffFlowCumulantsName = "f2DDiffFlowCumulants";
9659 s2DDiffFlowCumulantsName += fAnalysisLabel->Data();
9660 TString s2DDiffFlowName = "f2DDiffFlow";
9661 s2DDiffFlowName += fAnalysisLabel->Data();
9662 for(Int_t t=0;t<2;t++) // type: RP or POI
9664 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
9666 // 2D diferential cumulants:
9667 f2DDiffFlowCumulants[t][rci] = new TH2D(Form("%s, %s, %s",s2DDiffFlowCumulantsName.Data(),typeFlag[t].Data(),differentialCumulantIndex[rci].Data()),Form("%s, %s, %s",s2DDiffFlowCumulantsName.Data(),typeFlag[t].Data(),differentialCumulantIndex[rci].Data()),fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
9668 f2DDiffFlowCumulants[t][rci]->SetXTitle("p_{t}");
9669 f2DDiffFlowCumulants[t][rci]->SetYTitle("#eta");
9670 f2DDiffFlowCorrelationsProList[t]->Add(f2DDiffFlowCumulants[t][rci]); // to be improved - moved to another list
9671 // 2D differential flow:
9672 f2DDiffFlow[t][rci] = new TH2D(Form("%s, %s, %s",s2DDiffFlowName.Data(),typeFlag[t].Data(),differentialFlowIndex[rci].Data()),Form("%s, %s, %s",s2DDiffFlowName.Data(),typeFlag[t].Data(),differentialFlowIndex[rci].Data()),fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
9673 f2DDiffFlow[t][rci]->SetXTitle("p_{t}");
9674 f2DDiffFlow[t][rci]->SetYTitle("#eta");
9675 f2DDiffFlowCorrelationsProList[t]->Add(f2DDiffFlow[t][rci]); // to be improved - moved to another list
9676 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
9677 } // end of for(Int_t t=0;t<2;t++) // type: RP or POIs
9679 } // void AliFlowAnalysisWithQCumulants::BookEverythingFor2DDifferentialFlow()
9681 //================================================================================================================================
9683 void AliFlowAnalysisWithQCumulants::BookEverythingForDifferentialFlow()
9685 // Book all histograms and profiles needed for differential flow.
9686 // a) Book profile to hold all flags for differential flow;
9687 // b) Define flags locally (to be improved: should I promote flags to data members?);
9688 // c) Book e-b-e quantities;
9689 // d) Book profiles;
9690 // e) Book histograms holding final results.
9692 // a) Book profile to hold all flags for differential flow:
9693 TString diffFlowFlagsName = "fDiffFlowFlags";
9694 diffFlowFlagsName += fAnalysisLabel->Data();
9695 fDiffFlowFlags = new TProfile(diffFlowFlagsName.Data(),"Flags for differential flow",6,0,6);
9696 fDiffFlowFlags->SetTickLength(-0.01,"Y");
9697 fDiffFlowFlags->SetMarkerStyle(25);
9698 fDiffFlowFlags->SetLabelSize(0.04,"X");
9699 fDiffFlowFlags->SetLabelOffset(0.02,"Y");
9700 fDiffFlowFlags->GetXaxis()->SetBinLabel(1,"Calculate diff. flow");
9701 fDiffFlowFlags->GetXaxis()->SetBinLabel(2,"Particle weights");
9702 fDiffFlowFlags->GetXaxis()->SetBinLabel(3,"Event weights");
9703 fDiffFlowFlags->GetXaxis()->SetBinLabel(4,"Correct for NUA");
9704 fDiffFlowFlags->GetXaxis()->SetBinLabel(5,"Calculate 2D diff. flow");
9705 fDiffFlowFlags->GetXaxis()->SetBinLabel(6,"Calculate diff. flow vs eta");
9706 fDiffFlowList->Add(fDiffFlowFlags);
9708 if(!fCalculateDiffFlow){return;}
9710 // b) Define flags locally (to be improved: should I promote flags to data members?):
9711 TString typeFlag[2] = {"RP","POI"};
9712 TString ptEtaFlag[2] = {"p_{T}","#eta"};
9713 TString powerFlag[2] = {"linear","quadratic"};
9714 TString sinCosFlag[2] = {"sin","cos"};
9715 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
9716 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
9717 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};
9718 TString reducedSquaredCorrelationIndex[4] = {"<2'>^{2}","<4'>^{2}","<6'>^{2}","<8'>^{2}"};
9719 TString mixedCorrelationIndex[8] = {"<2>","<2'>","<4>","<4'>","<6>","<6'>","<8>","<8'>"};
9720 TString covarianceName[5] = {"Cov(<2>,<2'>)","Cov(<2>,<4'>)","Cov(<4>,<2'>)","Cov(<4>,<4'>)","Cov(<2'>,<4'>)"};
9721 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
9722 Double_t minPtEta[2] = {fPtMin,fEtaMin};
9723 Double_t maxPtEta[2] = {fPtMax,fEtaMax};
9725 // c) Book e-b-e quantities:
9726 // Event-by-event r_{m*n,k}(pt,eta), p_{m*n,k}(pt,eta) and q_{m*n,k}(pt,eta)
9727 // Explanantion of notation:
9728 // 1.) n is harmonic, m is multiple of harmonic;
9729 // 2.) k is power of particle weight;
9730 // 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);
9731 // 4.) p_{m*n,k}(pt,eta) = Q-vector evaluated in harmonic m*n for POIs in particular (pt,eta) bin
9732 // (if i-th POI is also RP, than it is weighted with w_i^k);
9733 // 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
9734 // (i-th RP&&POI is weighted with w_i^k)
9737 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP && POI )
9739 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
9741 for(Int_t m=0;m<4;m++) // multiple of harmonic
9743 for(Int_t k=0;k<9;k++) // power of particle weight
9745 fReRPQ1dEBE[t][pe][m][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%dpower%dRe",t,pe,m,k),
9746 Form("TypeFlag%dpteta%dmultiple%dpower%dRe",t,pe,m,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
9747 fImRPQ1dEBE[t][pe][m][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%dpower%dIm",t,pe,m,k),
9748 Form("TypeFlag%dpteta%dmultiple%dpower%dIm",t,pe,m,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
9753 // to be improved (add explanation of fs1dEBE[t][pe][k]):
9754 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
9756 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
9758 for(Int_t k=0;k<9;k++) // power of particle weight
9760 fs1dEBE[t][pe][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%d",t,pe,k),
9761 Form("TypeFlag%dpteta%dmultiple%d",t,pe,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
9765 // correction terms for nua:
9766 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
9768 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
9770 for(Int_t sc=0;sc<2;sc++) // sin or cos
9772 for(Int_t cti=0;cti<9;cti++) // correction term index
9774 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti] = new TH1D(Form("typeFlag%d pteta%d sincos%d cti%d",t,pe,sc,cti),
9775 Form("typeFlag%d pteta%d sincos%d cti%d",t,pe,sc,cti),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
9780 // reduced correlations e-b-e:
9781 TString diffFlowCorrelationsEBEName = "fDiffFlowCorrelationsEBE";
9782 diffFlowCorrelationsEBEName += fAnalysisLabel->Data();
9783 for(Int_t t=0;t<2;t++) // type: RP or POI
9785 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
9787 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
9789 fDiffFlowCorrelationsEBE[t][pe][rci] = new TH1D(Form("%s, %s, %s, %s",diffFlowCorrelationsEBEName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[rci].Data()),Form("%s, %s, %s, %s",diffFlowCorrelationsEBEName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[rci].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
9790 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
9791 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
9792 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
9793 // event weights for reduced correlations e-b-e:
9794 TString diffFlowEventWeightsForCorrelationsEBEName = "fDiffFlowEventWeightsForCorrelationsEBE";
9795 diffFlowEventWeightsForCorrelationsEBEName += fAnalysisLabel->Data();
9796 for(Int_t t=0;t<2;t++) // type: RP or POI
9798 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
9800 for(Int_t rci=0;rci<4;rci++) // event weight for reduced correlation index
9802 fDiffFlowEventWeightsForCorrelationsEBE[t][pe][rci] = new TH1D(Form("%s, %s, %s, eW for %s",diffFlowEventWeightsForCorrelationsEBEName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[rci].Data()),Form("%s, %s, %s, eW for %s",diffFlowEventWeightsForCorrelationsEBEName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[rci].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
9803 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
9804 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
9805 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
9807 // d) Book profiles;
9808 // reduced correlations:
9809 TString diffFlowCorrelationsProName = "fDiffFlowCorrelationsPro";
9810 diffFlowCorrelationsProName += fAnalysisLabel->Data();
9811 // reduced squared correlations:
9812 TString diffFlowSquaredCorrelationsProName = "fDiffFlowSquaredCorrelationsPro";
9813 diffFlowSquaredCorrelationsProName += fAnalysisLabel->Data();
9814 // corrections terms:
9815 TString diffFlowCorrectionTermsForNUAProName = "fDiffFlowCorrectionTermsForNUAPro";
9816 diffFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
9817 // reduced correlations:
9818 for(Int_t t=0;t<2;t++) // type: RP or POI
9820 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
9822 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
9824 fDiffFlowCorrelationsPro[t][pe][rci] = new TProfile(Form("%s, %s, %s, %s",diffFlowCorrelationsProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[rci].Data()),Form("%s, %s, %s, %s",diffFlowCorrelationsProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[rci].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe],"s");
9825 fDiffFlowCorrelationsPro[t][pe][rci]->Sumw2();
9826 fDiffFlowCorrelationsPro[t][pe][rci]->SetXTitle(ptEtaFlag[pe].Data());
9827 fDiffFlowCorrelationsProList[t][pe]->Add(fDiffFlowCorrelationsPro[t][pe][rci]); // to be improved (add dedicated list to hold reduced correlations)
9828 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
9829 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
9830 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
9831 // reduced squared correlations:
9832 for(Int_t t=0;t<2;t++) // type: RP or POI
9834 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
9836 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
9838 fDiffFlowSquaredCorrelationsPro[t][pe][rci] = new TProfile(Form("%s, %s, %s, %s",diffFlowSquaredCorrelationsProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedSquaredCorrelationIndex[rci].Data()),Form("%s, %s, %s, %s",diffFlowSquaredCorrelationsProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedSquaredCorrelationIndex[rci].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe],"s");
9839 fDiffFlowSquaredCorrelationsPro[t][pe][rci]->Sumw2();
9840 fDiffFlowSquaredCorrelationsPro[t][pe][rci]->SetXTitle(ptEtaFlag[pe].Data());
9841 fDiffFlowCorrelationsProList[t][pe]->Add(fDiffFlowSquaredCorrelationsPro[t][pe][rci]); // to be improved (add dedicated list to hold reduced correlations)
9842 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
9843 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
9844 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
9845 // correction terms for nua:
9846 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
9848 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
9850 for(Int_t sc=0;sc<2;sc++) // sin or cos
9852 for(Int_t cti=0;cti<9;cti++) // correction term index
9854 fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti] = new TProfile(Form("%s, %s, %s, %s, cti = %d",diffFlowCorrectionTermsForNUAProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),cti+1),Form("%s, %s, %s, %s, cti = %d",diffFlowCorrectionTermsForNUAProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),cti+1),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
9855 fDiffFlowCorrectionsProList[t][pe]->Add(fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]);
9860 // Other differential correlators:
9861 TString otherDiffCorrelatorsName = "fOtherDiffCorrelators";
9862 otherDiffCorrelatorsName += fAnalysisLabel->Data();
9863 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
9865 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
9867 for(Int_t sc=0;sc<2;sc++) // sin or cos
9869 for(Int_t ci=0;ci<1;ci++) // correlator index
9871 fOtherDiffCorrelators[t][pe][sc][ci] = new TProfile(Form("%s, %s, %s, %s, ci = %d",otherDiffCorrelatorsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),ci+1),Form("%s, %s, %s, %s, ci = %d",otherDiffCorrelatorsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),ci+1),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
9872 fOtherDiffCorrelators[t][pe][sc][ci]->Sumw2();
9873 fOtherDiffCorrelatorsList->Add(fOtherDiffCorrelators[t][pe][sc][ci]);
9878 // e) Book histograms holding final results.
9879 // reduced correlations:
9880 TString diffFlowCorrelationsHistName = "fDiffFlowCorrelationsHist";
9881 diffFlowCorrelationsHistName += fAnalysisLabel->Data();
9882 // corrections terms:
9883 TString diffFlowCorrectionTermsForNUAHistName = "fDiffFlowCorrectionTermsForNUAHist";
9884 diffFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
9885 // differential covariances:
9886 TString diffFlowCovariancesName = "fDiffFlowCovariances";
9887 diffFlowCovariancesName += fAnalysisLabel->Data();
9888 // differential Q-cumulants:
9889 TString diffFlowCumulantsName = "fDiffFlowCumulants";
9890 diffFlowCumulantsName += fAnalysisLabel->Data();
9891 // Detector bias to differential Q-cumulants:
9892 TString diffFlowDetectorBiasName = "fDiffFlowDetectorBias";
9893 diffFlowDetectorBiasName += fAnalysisLabel->Data();
9894 // differential flow:
9895 TString diffFlowName = "fDiffFlow";
9896 diffFlowName += fAnalysisLabel->Data();
9897 for(Int_t t=0;t<2;t++) // type: RP or POI
9899 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
9901 for(Int_t index=0;index<4;index++)
9903 // reduced correlations:
9904 fDiffFlowCorrelationsHist[t][pe][index] = new TH1D(Form("%s, %s, %s, %s",diffFlowCorrelationsHistName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[index].Data()),Form("%s, %s, %s, %s",diffFlowCorrelationsHistName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[index].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
9905 fDiffFlowCorrelationsHist[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
9906 fDiffFlowCorrelationsHistList[t][pe]->Add(fDiffFlowCorrelationsHist[t][pe][index]);
9907 // differential Q-cumulants:
9908 fDiffFlowCumulants[t][pe][index] = new TH1D(Form("%s, %s, %s, %s",diffFlowCumulantsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),differentialCumulantIndex[index].Data()),Form("%s, %s, %s, %s",diffFlowCumulantsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),differentialCumulantIndex[index].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
9909 fDiffFlowCumulants[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
9910 fDiffFlowCumulantsHistList[t][pe]->Add(fDiffFlowCumulants[t][pe][index]);
9911 // Detector bias to differential Q-cumulants:
9912 fDiffFlowDetectorBias[t][pe][index] = new TH1D(Form("%s, %s, %s, %s",diffFlowDetectorBiasName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),differentialCumulantIndex[index].Data()),Form("%s, %s, %s, %s",diffFlowDetectorBiasName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),differentialCumulantIndex[index].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
9913 fDiffFlowDetectorBias[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
9914 fDiffFlowDetectorBias[t][pe][index]->SetTitle(Form("#frac{corrected}{measured} %s",differentialCumulantIndex[index].Data()));
9915 fDiffFlowDetectorBiasHistList[t][pe]->Add(fDiffFlowDetectorBias[t][pe][index]);
9916 // differential flow estimates from Q-cumulants:
9917 fDiffFlow[t][pe][index] = new TH1D(Form("%s, %s, %s, %s",diffFlowName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),differentialFlowIndex[index].Data()),Form("%s, %s, %s, %s",diffFlowName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),differentialFlowIndex[index].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
9918 fDiffFlow[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
9919 fDiffFlowHistList[t][pe]->Add(fDiffFlow[t][pe][index]);
9920 } // end of for(Int_t index=0;index<4;index++)
9921 for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index
9923 // differential covariances:
9924 fDiffFlowCovariances[t][pe][covIndex] = new TH1D(Form("%s, %s, %s, %s",diffFlowCovariancesName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),covarianceName[covIndex].Data()),Form("%s, %s, %s, %s",diffFlowCovariancesName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),covarianceName[covIndex].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
9925 fDiffFlowCovariances[t][pe][covIndex]->SetXTitle(ptEtaFlag[pe].Data());
9926 fDiffFlowCovariancesHistList[t][pe]->Add(fDiffFlowCovariances[t][pe][covIndex]);
9927 } // end of for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index
9928 // products of both types of correlations:
9929 TString diffFlowProductOfCorrelationsProName = "fDiffFlowProductOfCorrelationsPro";
9930 diffFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
9931 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
9933 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
9935 fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2] = new TProfile(Form("%s, %s, %s, %s, %s",diffFlowProductOfCorrelationsProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),mixedCorrelationIndex[mci1].Data(),mixedCorrelationIndex[mci2].Data()),Form("%s, %s, %s, %s #times %s",diffFlowProductOfCorrelationsProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),mixedCorrelationIndex[mci1].Data(),mixedCorrelationIndex[mci2].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
9936 fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2]->SetXTitle(ptEtaFlag[pe].Data());
9937 fDiffFlowProductOfCorrelationsProList[t][pe]->Add(fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2]);
9938 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
9939 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
9940 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
9941 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
9942 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
9943 // sums of event weights for reduced correlations:
9944 TString diffFlowSumOfEventWeightsName = "fDiffFlowSumOfEventWeights";
9945 diffFlowSumOfEventWeightsName += fAnalysisLabel->Data();
9946 for(Int_t t=0;t<2;t++) // type is RP or POI
9948 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
9950 for(Int_t p=0;p<2;p++) // power of weights is either 1 or 2
9952 for(Int_t ew=0;ew<4;ew++) // index of reduced correlation
9954 fDiffFlowSumOfEventWeights[t][pe][p][ew] = new TH1D(Form("%s, %s, %s, %s, %s",diffFlowSumOfEventWeightsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),powerFlag[p].Data(),reducedCorrelationIndex[ew].Data()),Form("%s, %s, %s, power = %s, %s",diffFlowSumOfEventWeightsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),powerFlag[p].Data(),reducedCorrelationIndex[ew].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
9955 fDiffFlowSumOfEventWeights[t][pe][p][ew]->SetXTitle(ptEtaFlag[pe].Data());
9956 fDiffFlowSumOfEventWeightsHistList[t][pe][p]->Add(fDiffFlowSumOfEventWeights[t][pe][p][ew]); // to be improved (add dedicated list to hold all this)
9961 // sum of products of event weights for both types of correlations:
9962 TString diffFlowSumOfProductOfEventWeightsName = "fDiffFlowSumOfProductOfEventWeights";
9963 diffFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
9964 for(Int_t t=0;t<2;t++) // type is RP or POI
9966 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
9968 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
9970 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
9972 fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2] = new TH1D(Form("%s, %s, %s, %s, %s",diffFlowSumOfProductOfEventWeightsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),mixedCorrelationIndex[mci1].Data(),mixedCorrelationIndex[mci2].Data()),Form("%s, %s, %s, %s #times %s",diffFlowSumOfProductOfEventWeightsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),mixedCorrelationIndex[mci1].Data(),mixedCorrelationIndex[mci2].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
9973 fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2]->SetXTitle(ptEtaFlag[pe].Data());
9974 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]->Add(fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2]);
9975 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
9980 // correction terms for nua:
9981 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
9983 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
9985 for(Int_t sc=0;sc<2;sc++) // sin or cos
9987 for(Int_t cti=0;cti<9;cti++) // correction term index
9989 fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti] = new TH1D(Form("%s, %s, %s, %s, cti = %d",diffFlowCorrectionTermsForNUAHistName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),cti+1),Form("%s, %s, %s, %s, cti = %d",diffFlowCorrectionTermsForNUAHistName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),cti+1),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
9990 fDiffFlowCorrectionsHistList[t][pe]->Add(fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti]);
9996 } // end of AliFlowAnalysisWithQCumulants::BookEverythingForDifferentialFlow()
9998 //================================================================================================================================
10000 void AliFlowAnalysisWithQCumulants::CalculateQcumulantsCorrectedForNUAIntFlow()
10002 // Calculate generalized Q-cumulants (cumulants corrected for non-unifom acceptance).
10004 // Isotropic cumulants:
10005 Double_t QC2 = fIntFlowQcumulants->GetBinContent(1);
10006 Double_t QC2Error = fIntFlowQcumulants->GetBinError(1);
10007 Double_t QC4 = fIntFlowQcumulants->GetBinContent(2);
10008 Double_t QC4Error = fIntFlowQcumulants->GetBinError(2);
10009 //Double_t QC6 = fIntFlowQcumulants->GetBinContent(3);
10010 //Double_t QC6Error = fIntFlowQcumulants->GetBinError(3);
10011 //Double_t QC8 = fIntFlowQcumulants->GetBinContent(4);
10012 //Double_t QC8Error = fIntFlowQcumulants->GetBinError(4);
10014 // Measured 2-, 4-, 6- and 8-particle correlations:
10015 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
10016 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <<2>>
10017 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
10018 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <<4>>
10019 //Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
10020 //Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <<6>>
10021 //Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
10022 //Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <<8>>
10024 // Non-isotropic terms:
10025 Double_t c1 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1); // <<cos(n*phi1)>>
10026 Double_t c1Error = fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(1); // statistical error of <<cos(n*phi1)>>
10027 Double_t c2 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2); // <<cos(n*(phi1+phi2))>>
10028 Double_t c2Error = fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(2); // statistical error of <<cos(n*(phi1+phi2))>>
10029 Double_t c3 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(3); // <<cos(n*(phi1-phi2-phi3))>>
10030 Double_t c3Error = fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(3); // statistical error of <<cos(n*(phi1-phi2-phi3))>>
10031 Double_t s1 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1); // <<sin(n*phi1)>>
10032 Double_t s1Error = fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(1); // statistical error of <<sin(n*phi1)>>
10033 Double_t s2 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2); // <<sin(n*(phi1+phi2))>>
10034 Double_t s2Error = fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(2); // statistical error of <<sin(n*(phi1+phi2))>>
10035 Double_t s3 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(3); // <<sin(n*(phi1-phi2-phi3))>>
10036 Double_t s3Error = fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(3); // statistical error of <<sin(n*(phi1-phi2-phi3))>>
10039 Double_t a1 = 2.*pow(c1,2.)+2.*pow(s1,2.)-two;
10040 Double_t a2 = 6.*pow(c1,3.)-2.*c1*c2+c3+6.*c1*pow(s1,2.)-2.*s1*s2-4.*c1*two;
10041 Double_t a3 = 2.*pow(s1,2.)-2.*pow(c1,2.)+c2;
10042 Double_t a4 = 6.*pow(s1,3.)+6.*pow(c1,2.)*s1+2.*c2*s1-2.*c1*s2-s3-4.*s1*two;
10043 Double_t a5 = 4.*c1*s1-s2;
10045 // Covariances (including weight dependent prefactor):
10046 Double_t wCov1 = 0.; // w*Cov(<2>,<cos(phi))
10047 Double_t wCov2 = 0.; // w*Cov(<2>,<sin(phi))
10048 Double_t wCov3 = 0.; // w*Cov(<cos(phi),<sin(phi))
10049 Double_t wCov4 = 0.; // w*Cov(<2>,<4>)
10050 Double_t wCov5 = 0.; // w*Cov(<2>,<cos(#phi_{1}+#phi_{2})>)
10051 Double_t wCov6 = 0.; // w*Cov(<2>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
10052 Double_t wCov7 = 0.; // w*Cov(<2>,<sin(#phi_{1}+#phi_{2})>)
10053 Double_t wCov8 = 0.; // w*Cov(<2>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
10054 Double_t wCov9 = 0.; // w*Cov(<4>,<cos(#phi)>
10055 Double_t wCov10 = 0.; // w*Cov(<4>,<cos(#phi_{1}+#phi_{2})>)
10056 Double_t wCov11 = 0.; // w*Cov(<4>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
10057 Double_t wCov12 = 0.; // w*Cov(<4>,<sin(#phi)>
10058 Double_t wCov13 = 0.; // w*Cov(<4>,<sin(#phi_{1}+#phi_{2})>)
10059 Double_t wCov14 = 0.; // w*Cov(<4>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
10060 Double_t wCov15 = 0.; // w*Cov(<cos(#phi)>,<cos(#phi_{1}+#phi_{2})>)
10061 Double_t wCov16 = 0.; // w*Cov(<cos(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
10062 Double_t wCov17 = 0.; // w*Cov(<cos(#phi)>,<sin(#phi_{1}+#phi_{2})>)
10063 Double_t wCov18 = 0.; // w*Cov(<cos(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
10064 Double_t wCov19 = 0.; // w*Cov(<cos(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
10065 Double_t wCov20 = 0.; // w*Cov(<sin(#phi)>,<cos(#phi_{1}+#phi_{2})>)
10066 Double_t wCov21 = 0.; // w*Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}+#phi_{2})>)
10067 Double_t wCov22 = 0.; // w*Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
10068 Double_t wCov23 = 0.; // w*Cov(<sin(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
10069 Double_t wCov24 = 0.; // w*Cov(<sin(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
10070 Double_t wCov25 = 0.; // w*Cov(<cos(#phi_{1}-#phi_{2}-#phi_{3}>,<sin(#phi_{1}-#phi_{2}-#phi_{3}>)
10071 Double_t wCov26 = 0.; // w*Cov(<sin(#phi)>,<sin(#phi_{1}+#phi_{2})>)
10072 Double_t wCov27 = 0.; // w*Cov(<sin(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
10073 Double_t wCov28 = 0.; // w*Cov(<sin(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
10074 if(!fForgetAboutCovariances)
10076 wCov1 = fIntFlowCovariancesNUA->GetBinContent(1); // w*Cov(<2>,<cos(phi))
10077 wCov2 = fIntFlowCovariancesNUA->GetBinContent(2); // w*Cov(<2>,<sin(phi))
10078 wCov3 = fIntFlowCovariancesNUA->GetBinContent(3); // w*Cov(<cos(phi),<sin(phi))
10079 wCov4 = fIntFlowCovariances->GetBinContent(1); // w*Cov(<2>,<4>)
10080 wCov5 = fIntFlowCovariancesNUA->GetBinContent(4); // w*Cov(<2>,<cos(#phi_{1}+#phi_{2})>)
10081 wCov6 = fIntFlowCovariancesNUA->GetBinContent(6); // w*Cov(<2>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
10082 wCov7 = fIntFlowCovariancesNUA->GetBinContent(5); // w*Cov(<2>,<sin(#phi_{1}+#phi_{2})>)
10083 wCov8 = fIntFlowCovariancesNUA->GetBinContent(7); // w*Cov(<2>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
10084 wCov9 = fIntFlowCovariancesNUA->GetBinContent(8); // w*Cov(<4>,<cos(#phi)>
10085 wCov10 = fIntFlowCovariancesNUA->GetBinContent(10); // w*Cov(<4>,<cos(#phi_{1}+#phi_{2})>)
10086 wCov11 = fIntFlowCovariancesNUA->GetBinContent(12); // w*Cov(<4>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
10087 wCov12 = fIntFlowCovariancesNUA->GetBinContent(9); // w*Cov(<4>,<sin(#phi)>
10088 wCov13 = fIntFlowCovariancesNUA->GetBinContent(11); // w*Cov(<4>,<sin(#phi_{1}+#phi_{2})>)
10089 wCov14 = fIntFlowCovariancesNUA->GetBinContent(13); // w*Cov(<4>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
10090 wCov15 = fIntFlowCovariancesNUA->GetBinContent(14); // w*Cov(<cos(#phi)>,<cos(#phi_{1}+#phi_{2})>)
10091 wCov16 = fIntFlowCovariancesNUA->GetBinContent(16); // w*Cov(<cos(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
10092 wCov17 = fIntFlowCovariancesNUA->GetBinContent(15); // w*Cov(<cos(#phi)>,<sin(#phi_{1}+#phi_{2})>)
10093 wCov18 = fIntFlowCovariancesNUA->GetBinContent(17); // w*Cov(<cos(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
10094 wCov19 = fIntFlowCovariancesNUA->GetBinContent(23); // w*Cov(<cos(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
10095 wCov20 = fIntFlowCovariancesNUA->GetBinContent(18); // w*Cov(<sin(#phi)>,<cos(#phi_{1}+#phi_{2})>)
10096 wCov21 = fIntFlowCovariancesNUA->GetBinContent(22); // w*Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}+#phi_{2})>)
10097 wCov22 = fIntFlowCovariancesNUA->GetBinContent(24); // w*Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
10098 wCov23 = fIntFlowCovariancesNUA->GetBinContent(20); // w*Cov(<sin(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
10099 wCov24 = fIntFlowCovariancesNUA->GetBinContent(25); // w*Cov(<sin(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
10100 wCov25 = fIntFlowCovariancesNUA->GetBinContent(27); // w*Cov(<cos(#phi_{1}-#phi_{2}-#phi_{3}>,<sin(#phi_{1}-#phi_{2}-#phi_{3}>)
10101 wCov26 = fIntFlowCovariancesNUA->GetBinContent(19); // w*Cov(<sin(#phi)>,<sin(#phi_{1}+#phi_{2})>)
10102 wCov27 = fIntFlowCovariancesNUA->GetBinContent(21); // w*Cov(<sin(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
10103 wCov28 = fIntFlowCovariancesNUA->GetBinContent(26); // w*Cov(<sin(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
10104 } // end of if(!fForgetAboutCovariances)
10106 // Calculating generalized QC{2}:
10107 // Generalized QC{2}:
10108 Double_t gQC2 = two - pow(c1,2.) - pow(s1,2.);
10109 if(fApplyCorrectionForNUA){fIntFlowQcumulants->SetBinContent(1,gQC2);}
10110 // Statistical error of generalized QC{2}:
10111 Double_t gQC2ErrorSquared = pow(twoError,2.)+4.*pow(c1,2.)*pow(c1Error,2.)
10112 + 4.*pow(s1,2.)*pow(s1Error,2.)
10113 - 4*c1*wCov1-4*s1*wCov2
10115 // Store ratio of error squared - with/without NUA terms:
10116 Double_t ratioErrorSquaredQC2 = 0.;
10117 if(fIntFlowQcumulants->GetBinError(1)>0.)
10119 ratioErrorSquaredQC2 = (gQC2ErrorSquared/pow(fIntFlowQcumulants->GetBinError(1),2.));
10120 fIntFlowQcumulantsErrorSquaredRatio->SetBinContent(1,ratioErrorSquaredQC2);
10122 // If enabled, store error by including non-isotropic terms:
10123 if(fApplyCorrectionForNUA && fPropagateErrorAlsoFromNIT)
10125 if(gQC2ErrorSquared>=0.)
10127 fIntFlowQcumulants->SetBinError(1,pow(gQC2ErrorSquared,0.5));
10130 fIntFlowQcumulants->SetBinError(1,0.);
10132 cout<<" WARNING (QC): Statistical error of generalized QC{2} is imaginary !!!!"<<endl;
10135 } // end of if(fApplyCorrectionForNUA && fPropagateErrorAlsoFromNIT)
10136 // Quantify detector bias to QC{2}:
10137 if(TMath::Abs(QC2)>0.)
10139 fIntFlowDetectorBias->SetBinContent(1,gQC2/QC2);
10142 Double_t errorSquared = gQC2ErrorSquared/pow(QC2,2.)+pow(gQC2,2.)*pow(QC2Error,2.)/pow(QC2,4.);
10143 if(errorSquared>0.)
10145 fIntFlowDetectorBias->SetBinError(1,pow(errorSquared,0.5));
10148 } // end of if(TMath::Abs(QC2)>0.)
10150 // Calculating generalized QC{4}:
10151 // Generalized QC{4}:
10152 Double_t gQC4 = four-2.*pow(two,2.)
10153 - 4.*c1*c3+4.*s1*s3-pow(c2,2.)-pow(s2,2.)
10154 + 4.*c2*(pow(c1,2.)-pow(s1,2.))+8.*s2*s1*c1
10155 + 8.*two*(pow(c1,2.)+pow(s1,2.))-6.*pow((pow(c1,2.)+pow(s1,2.)),2.);
10156 if(fApplyCorrectionForNUA){fIntFlowQcumulants->SetBinContent(2,gQC4);}
10157 // Statistical error of generalized QC{4}:
10158 Double_t gQC4ErrorSquared = 16.*pow(a1,2.)*pow(twoError,2.)+pow(fourError,2.)+16.*pow(a2,2.)*pow(c1Error,2.)
10159 + 4.*pow(a3,2.)*pow(c2Error,2.)+16.*pow(c1,2.)*pow(c3Error,2.)
10160 + 16.*pow(a4,2.)*pow(s1Error,2.)+4.*pow(a5,2.)*pow(s2Error,2.)
10161 + 16.*pow(s1,2.)*pow(s3Error,2.)+8.*a1*wCov4-32.*a1*a2*wCov1
10162 - 16.*a3*a1*wCov5-32.*c1*a1*wCov6-32.*a1*a4*wCov2+16.*a5*a1*wCov7
10163 + 32.*s1*a1*wCov8-8.*a2*wCov9-4.*a3*wCov10-8.*c1*wCov11-8.*a4*wCov12
10164 + 4.*a5*wCov13+8.*s1*wCov14+16.*a3*a2*wCov15+32.*c1*a2*wCov16+32.*a2*a4*wCov3
10165 - 16.*a5*a2*wCov17-32.*s1*a2*wCov18+16.*c1*a3*wCov19+16.*a3*a4*wCov20
10166 - 8.*a3*a5*wCov21-16.*s1*a3*wCov22+32.*c1*a4*wCov23-16.*c1*a5*wCov24
10167 - 32.*c1*s1*wCov25-16.*a5*a4*wCov26-32.*s1*a4*wCov27+16.*s1*a5*wCov28;
10168 // Store ratio of error squared - with/without NUA terms:
10169 Double_t ratioErrorSquaredQC4 = 0.;
10170 if(fIntFlowQcumulants->GetBinError(2)>0.)
10172 ratioErrorSquaredQC4 = (gQC4ErrorSquared/pow(fIntFlowQcumulants->GetBinError(2),2.));
10173 fIntFlowQcumulantsErrorSquaredRatio->SetBinContent(2,ratioErrorSquaredQC4);
10175 if(fApplyCorrectionForNUA && fPropagateErrorAlsoFromNIT)
10177 if(gQC4ErrorSquared>=0.)
10179 fIntFlowQcumulants->SetBinError(2,pow(gQC4ErrorSquared,0.5));
10182 fIntFlowQcumulants->SetBinError(2,0.);
10184 cout<<" WARNING (QC): Statistical error of generalized QC{4} is imaginary !!!!"<<endl;
10187 } // end of if(fApplyCorrectionForNUA && fPropagateErrorAlsoFromNIT)
10188 // Quantify detector bias to QC{4}:
10189 if(TMath::Abs(QC4)>0.)
10191 fIntFlowDetectorBias->SetBinContent(2,gQC4/QC4);
10194 Double_t errorSquared = gQC4ErrorSquared/pow(QC4,2.)+pow(gQC4,2.)*pow(QC4Error,2.)/pow(QC4,4.);
10195 if(errorSquared>0.)
10197 fIntFlowDetectorBias->SetBinError(2,pow(errorSquared,0.5));
10200 } // end of if(TMath::Abs(QC4)>0.)
10203 // .... to be improved (continued for 6th and 8th order) ....
10206 // versus multiplicity:
10207 if(fCalculateCumulantsVsM) // to be improved - propagate error for nua terms vs M
10209 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
10210 Double_t value[4] = {0.}; // QCs vs M
10211 Double_t error[4] = {0.}; // error of QCs vs M
10212 Double_t dSum1[4] = {0.}; // sum value_i/(error_i)^2
10213 Double_t dSum2[4] = {0.}; // sum 1/(error_i)^2
10214 for(Int_t b=1;b<=nBins;b++)
10216 // Measured correlations:
10217 two = fIntFlowCorrelationsVsMHist[0]->GetBinContent(b); // <<2>> vs M
10218 four = fIntFlowCorrelationsVsMHist[1]->GetBinContent(b); // <<4>> vs M
10219 // Isotropic cumulants:
10221 QC4 = four-2.*pow(two,2.);
10222 // Non-isotropic terms:
10223 c1 = fIntFlowCorrectionTermsForNUAVsMPro[1][0]->GetBinContent(b); // <<cos(n*phi1)>>
10224 c2 = fIntFlowCorrectionTermsForNUAVsMPro[1][1]->GetBinContent(b); // <<cos(n*(phi1+phi2))>>
10225 c3 = fIntFlowCorrectionTermsForNUAVsMPro[1][2]->GetBinContent(b); // <<cos(n*(phi1-phi2-phi3))>>
10226 s1 = fIntFlowCorrectionTermsForNUAVsMPro[0][0]->GetBinContent(b); // <<sin(n*phi1)>>
10227 s2 = fIntFlowCorrectionTermsForNUAVsMPro[0][1]->GetBinContent(b); // <<sin(n*(phi1+phi2))>>
10228 s3 = fIntFlowCorrectionTermsForNUAVsMPro[0][2]->GetBinContent(b); // <<sin(n*(phi1-phi2-phi3))>>
10229 // Generalized QC{2} vs M:
10230 gQC2 = two - pow(c1,2.) - pow(s1,2.);
10231 if(fApplyCorrectionForNUAVsM){fIntFlowQcumulantsVsM[0]->SetBinContent(b,gQC2);}
10232 // Generalized QC{4} vs M:
10233 gQC4 = four-2.*pow(two,2.)
10234 - 4.*c1*c3+4.*s1*s3-pow(c2,2.)-pow(s2,2.)
10235 + 4.*c2*(pow(c1,2.)-pow(s1,2.))+8.*s2*s1*c1
10236 + 8.*two*(pow(c1,2.)+pow(s1,2.))-6.*pow((pow(c1,2.)+pow(s1,2.)),2.);
10237 if(fApplyCorrectionForNUAVsM){fIntFlowQcumulantsVsM[1]->SetBinContent(b,gQC4);}
10238 // Detector bias vs M:
10239 if(TMath::Abs(QC2)>0.)
10241 fIntFlowDetectorBiasVsM[0]->SetBinContent(b,gQC2/QC2);
10242 } // end of if(TMath::Abs(QC2)>0.)
10243 if(TMath::Abs(QC4)>0.)
10245 fIntFlowDetectorBiasVsM[1]->SetBinContent(b,gQC4/QC4);
10246 } // end of if(TMath::Abs(QC4)>0.)
10248 for(Int_t co=0;co<4;co++)
10250 value[co] = fIntFlowQcumulantsVsM[co]->GetBinContent(b);
10251 error[co] = fIntFlowQcumulantsVsM[co]->GetBinError(b);
10254 dSum1[co]+=value[co]/(error[co]*error[co]);
10255 dSum2[co]+=1./(error[co]*error[co]);
10257 } // end of for(Int_t co=0;co<4;co++)
10258 } // end of for(Int_t b=1;b<=nBins;b++)
10259 // Store rebinned Q-cumulants:
10260 if(fApplyCorrectionForNUAVsM)
10262 for(Int_t co=0;co<4;co++)
10266 fIntFlowQcumulantsRebinnedInM->SetBinContent(co+1,dSum1[co]/dSum2[co]);
10267 fIntFlowQcumulantsRebinnedInM->SetBinError(co+1,pow(1./dSum2[co],0.5));
10269 } // end of for(Int_t co=0;co<4;co++)
10270 } // end of if(fApplyCorrectionForNUAVsM)
10271 } // end of if(fCalculateCumulantsVsM)
10273 } // end of void AliFlowAnalysisWithQCumulants::CalculateQcumulantsCorrectedForNUAIntFlow()
10275 //================================================================================================================================
10277 void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUAIntFlow()
10279 // From profile fIntFlowCorrectionTermsForNUAPro[sc] access measured correction terms for NUA
10280 // and their spread, correctly calculate the statistical errors and store the final
10281 // results and statistical errors for correction terms for NUA in histogram fIntFlowCorrectionTermsForNUAHist[sc].
10283 // Remark: Statistical error of correction temrs is calculated as:
10285 // statistical error = termA * spread * termB:
10286 // termA = sqrt{sum_{i=1}^{N} w^2}/(sum_{i=1}^{N} w)
10287 // termB = 1/sqrt(1-termA^2)
10289 TString sinCosFlag[2] = {"sin","cos"}; // to be improved - promore this to data member?
10290 TString nonisotropicTermFlag[4] = {"(n(phi1))","(n(phi1+phi2))","(n(phi1-phi2-phi3))","(n(2phi1-phi2))"}; // to be improved - hardwired 4
10292 for(Int_t sc=0;sc<2;sc++) // sin or cos correction terms
10294 for(Int_t ci=1;ci<=4;ci++) // correction term index (to be improved - hardwired 4)
10296 Double_t correction = fIntFlowCorrectionTermsForNUAPro[sc]->GetBinContent(ci);
10297 Double_t spread = fIntFlowCorrectionTermsForNUAPro[sc]->GetBinError(ci);
10298 Double_t sumOfLinearEventWeights = fIntFlowSumOfEventWeightsNUA[sc][0]->GetBinContent(ci);
10299 Double_t sumOfQuadraticEventWeights = fIntFlowSumOfEventWeightsNUA[sc][1]->GetBinContent(ci);
10300 Double_t termA = 0.;
10301 Double_t termB = 0.;
10302 if(TMath::Abs(sumOfLinearEventWeights)>1.e-44)
10304 termA = pow(sumOfQuadraticEventWeights,0.5)/sumOfLinearEventWeights;
10307 cout<<" WARNING (QC): sumOfLinearEventWeights == 0 in AFAWQC::FCTFNIF() !!!!"<<endl;
10308 cout<<Form(" (for <<%s[%s]>> non-isotropic term)",sinCosFlag[sc].Data(),nonisotropicTermFlag[ci-1].Data())<<endl;
10310 if(1.-pow(termA,2.) > 0.)
10312 termB = 1./pow(1-pow(termA,2.),0.5);
10315 cout<<" WARNING (QC): 1.-pow(termA,2.) <= 0 in AFAWQC::FCTFNIF() !!!!"<<endl;
10316 cout<<Form(" (for <<%s[%s]>> non-isotropic term)",sinCosFlag[sc].Data(),nonisotropicTermFlag[ci-1].Data())<<endl;
10318 Double_t statisticalError = termA * spread * termB;
10319 fIntFlowCorrectionTermsForNUAHist[sc]->SetBinContent(ci,correction);
10320 fIntFlowCorrectionTermsForNUAHist[sc]->SetBinError(ci,statisticalError);
10321 } // end of for(Int_t ci=1;ci<=4;ci++) // correction term index
10322 } // end of for(Int sc=0;sc<2;sc++) // sin or cos correction terms
10324 } // end of void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUAIntFlow()
10326 //================================================================================================================================
10328 void AliFlowAnalysisWithQCumulants::GetPointersForNestedLoopsHistograms()
10330 // Get pointers to all objects relevant for calculations with nested loops.
10332 TList *nestedLoopsList = dynamic_cast<TList*>(fHistList->FindObject("Nested Loops"));
10333 if(nestedLoopsList)
10335 this->SetNestedLoopsList(nestedLoopsList);
10338 cout<<"WARNING: nestedLoopsList is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
10342 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)
10343 TString typeFlag[2] = {"RP","POI"}; // to be improved (should I promote this to data members?)
10344 TString ptEtaFlag[2] = {"p_{T}","#eta"}; // to be improved (should I promote this to data members?)
10345 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"}; // to be improved (should I promote this to data members?)
10347 TString evaluateNestedLoopsName = "fEvaluateNestedLoops";
10348 evaluateNestedLoopsName += fAnalysisLabel->Data();
10349 TProfile *evaluateNestedLoops = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(evaluateNestedLoopsName.Data()));
10350 Bool_t bEvaluateIntFlowNestedLoops = kFALSE;
10351 Bool_t bEvaluateDiffFlowNestedLoops = kFALSE;
10352 if(evaluateNestedLoops)
10354 this->SetEvaluateNestedLoops(evaluateNestedLoops);
10355 bEvaluateIntFlowNestedLoops = (Int_t)evaluateNestedLoops->GetBinContent(1);
10356 bEvaluateDiffFlowNestedLoops = (Int_t)evaluateNestedLoops->GetBinContent(2);
10358 // nested loops relevant for integrated flow:
10359 if(bEvaluateIntFlowNestedLoops)
10362 TString intFlowDirectCorrelationsName = "fIntFlowDirectCorrelations";
10363 intFlowDirectCorrelationsName += fAnalysisLabel->Data();
10364 TProfile *intFlowDirectCorrelations = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(intFlowDirectCorrelationsName.Data()));
10365 if(intFlowDirectCorrelations)
10367 this->SetIntFlowDirectCorrelations(intFlowDirectCorrelations);
10370 cout<<"WARNING: intFlowDirectCorrelations is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
10373 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights)
10375 TString intFlowExtraDirectCorrelationsName = "fIntFlowExtraDirectCorrelations";
10376 intFlowExtraDirectCorrelationsName += fAnalysisLabel->Data();
10377 TProfile *intFlowExtraDirectCorrelations = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(intFlowExtraDirectCorrelationsName.Data()));
10378 if(intFlowExtraDirectCorrelations)
10380 this->SetIntFlowExtraDirectCorrelations(intFlowExtraDirectCorrelations);
10383 cout<<"WARNING: intFlowExtraDirectCorrelations is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
10386 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights)
10387 // correction terms for non-uniform acceptance:
10388 TString intFlowDirectCorrectionTermsForNUAName = "fIntFlowDirectCorrectionTermsForNUA";
10389 intFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
10390 TProfile *intFlowDirectCorrectionTermsForNUA[2] = {NULL};
10391 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
10393 intFlowDirectCorrectionTermsForNUA[sc] = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(Form("%s: %s terms",intFlowDirectCorrectionTermsForNUAName.Data(),sinCosFlag[sc].Data())));
10394 if(intFlowDirectCorrectionTermsForNUA[sc])
10396 this->SetIntFlowDirectCorrectionTermsForNUA(intFlowDirectCorrectionTermsForNUA[sc],sc);
10399 cout<<"WARNING: intFlowDirectCorrectionTermsForNUA[sc] is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
10400 cout<<"sc = "<<sc<<endl;
10403 } // end of for(Int_t sc=0;sc<2;sc++)
10404 } // end of if(bEvaluateIntFlowNestedLoops)
10406 // nested loops relevant for differential flow:
10407 if(bEvaluateDiffFlowNestedLoops)
10410 TString diffFlowDirectCorrelationsName = "fDiffFlowDirectCorrelations";
10411 diffFlowDirectCorrelationsName += fAnalysisLabel->Data();
10412 TProfile *diffFlowDirectCorrelations[2][2][4] = {{{NULL}}};
10413 for(Int_t t=0;t<2;t++)
10415 for(Int_t pe=0;pe<2;pe++)
10417 for(Int_t ci=0;ci<4;ci++) // correlation index
10419 diffFlowDirectCorrelations[t][pe][ci] = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(Form("%s, %s, %s, %s",diffFlowDirectCorrelationsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[ci].Data())));
10420 if(diffFlowDirectCorrelations[t][pe][ci])
10422 this->SetDiffFlowDirectCorrelations(diffFlowDirectCorrelations[t][pe][ci],t,pe,ci);
10425 cout<<"WARNING: diffFlowDirectCorrelations[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
10426 cout<<"t = "<<t<<endl;
10427 cout<<"pe = "<<pe<<endl;
10428 cout<<"ci = "<<ci<<endl;
10430 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
10431 } // end of for(Int_t pe=0;pe<2;pe++)
10432 } // end of for(Int_t t=0;t<2;t++)
10433 // correction terms for non-uniform acceptance:
10434 TString diffFlowDirectCorrectionTermsForNUAName = "fDiffFlowDirectCorrectionTermsForNUA";
10435 diffFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
10436 TProfile *diffFlowDirectCorrectionTermsForNUA[2][2][2][10] = {{{{NULL}}}};
10437 for(Int_t t=0;t<2;t++)
10439 for(Int_t pe=0;pe<2;pe++)
10441 // correction terms for NUA:
10442 for(Int_t sc=0;sc<2;sc++) // sin or cos
10444 for(Int_t cti=0;cti<9;cti++) // correction term index
10446 diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti] = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(Form("%s, %s, %s, %s, cti = %d",diffFlowDirectCorrectionTermsForNUAName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),cti+1)));
10447 if(diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti])
10449 this->SetDiffFlowDirectCorrectionTermsForNUA(diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti],t,pe,sc,cti);
10452 cout<<"WARNING: diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
10453 cout<<"t = "<<t<<endl;
10454 cout<<"pe = "<<pe<<endl;
10455 cout<<"sc = "<<sc<<endl;
10456 cout<<"cti = "<<cti<<endl;
10458 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index
10459 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
10460 } // end of for(Int_t pe=0;pe<2;pe++)
10461 } // end of for(Int_t t=0;t<2;t++)
10462 // other differential correlators:
10463 TString otherDirectDiffCorrelatorsName = "fOtherDirectDiffCorrelators";
10464 otherDirectDiffCorrelatorsName += fAnalysisLabel->Data();
10465 TProfile *otherDirectDiffCorrelators[2][2][2][1] = {{{{NULL}}}};
10466 for(Int_t t=0;t<2;t++)
10468 for(Int_t pe=0;pe<2;pe++)
10470 // correction terms for NUA:
10471 for(Int_t sc=0;sc<2;sc++) // sin or cos
10473 for(Int_t ci=0;ci<1;ci++) // correlator index
10475 otherDirectDiffCorrelators[t][pe][sc][ci] = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(Form("%s, %s, %s, %s, ci = %d",otherDirectDiffCorrelatorsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),ci+1)));
10476 if(otherDirectDiffCorrelators[t][pe][sc][ci])
10478 this->SetOtherDirectDiffCorrelators(otherDirectDiffCorrelators[t][pe][sc][ci],t,pe,sc,ci);
10481 cout<<"WARNING: otherDirectDiffCorrelators[t][pe][sc][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
10482 cout<<"t = "<<t<<endl;
10483 cout<<"pe = "<<pe<<endl;
10484 cout<<"sc = "<<sc<<endl;
10485 cout<<"ci = "<<ci<<endl;
10487 } // end of for(Int_t ci=0;ci<9;ci++) // correction term index
10488 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
10489 } // end of for(Int_t pe=0;pe<2;pe++)
10490 } // end of for(Int_t t=0;t<2;t++)
10491 // number of RPs and POIs in selected pt and eta bins for cross-checkings:
10492 TString noOfParticlesInBinName = "fNoOfParticlesInBin";
10493 TH1D *noOfParticlesInBin = NULL;
10494 noOfParticlesInBin = dynamic_cast<TH1D*>(nestedLoopsList->FindObject(noOfParticlesInBinName.Data()));
10495 if(noOfParticlesInBin)
10497 this->SetNoOfParticlesInBin(noOfParticlesInBin);
10501 cout<<" WARNING (QC): noOfParticlesInBin is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
10504 } // end of if(bEvaluateDiffFlowNestedLoops)
10506 } // end of void AliFlowAnalysisWithQCumulants::GetPointersForNestedLoopsHistograms()
10508 //================================================================================================================================
10510 void AliFlowAnalysisWithQCumulants::StoreHarmonic()
10512 // Store flow harmonic in common control histograms.
10514 (fCommonHists->GetHarmonic())->Fill(0.5,fHarmonic);
10515 if(fFillMultipleControlHistograms)
10517 (fCommonHists2nd->GetHarmonic())->Fill(0.5,fHarmonic);
10518 (fCommonHists4th->GetHarmonic())->Fill(0.5,fHarmonic);
10519 (fCommonHists6th->GetHarmonic())->Fill(0.5,fHarmonic);
10520 (fCommonHists8th->GetHarmonic())->Fill(0.5,fHarmonic);
10523 } // end of void AliFlowAnalysisWithQCumulants::StoreHarmonic()
10525 //================================================================================================================================
10527 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelationsUsingParticleWeights(TString type, TString ptOrEta) // type = RP or POI
10529 // Calculate all correlations needed for differential flow using particle weights.
10531 Int_t t = 0; // type flag
10532 Int_t pe = 0; // ptEta flag
10537 } else if(type == "POI")
10542 if(ptOrEta == "Pt")
10545 } else if(ptOrEta == "Eta")
10550 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
10551 Double_t minPtEta[2] = {fPtMin,fEtaMin};
10552 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
10553 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
10555 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
10556 Double_t dReQ1n1k = (*fReQ)(0,1);
10557 Double_t dReQ2n2k = (*fReQ)(1,2);
10558 Double_t dReQ1n3k = (*fReQ)(0,3);
10559 //Double_t dReQ4n4k = (*fReQ)(3,4);
10560 Double_t dImQ1n1k = (*fImQ)(0,1);
10561 Double_t dImQ2n2k = (*fImQ)(1,2);
10562 Double_t dImQ1n3k = (*fImQ)(0,3);
10563 //Double_t dImQ4n4k = (*fImQ)(3,4);
10565 // S^M_{p,k} (see .h file for the definition of fSpk):
10566 Double_t dSM1p1k = (*fSpk)(0,1);
10567 Double_t dSM1p2k = (*fSpk)(0,2);
10568 Double_t dSM1p3k = (*fSpk)(0,3);
10569 Double_t dSM2p1k = (*fSpk)(1,1);
10570 Double_t dSM3p1k = (*fSpk)(2,1);
10572 // looping over all bins and calculating reduced correlations:
10573 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10575 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin):
10576 Double_t p1n0kRe = 0.;
10577 Double_t p1n0kIm = 0.;
10579 // number of POIs in particular (pt,eta) bin):
10582 // real and imaginary parts of q_{m*n,k}:
10583 // (weighted Q-vector evaluated for particles which are both RPs and POIs in particular (pt,eta) bin)
10584 Double_t q1n2kRe = 0.;
10585 Double_t q1n2kIm = 0.;
10586 Double_t q2n1kRe = 0.;
10587 Double_t q2n1kIm = 0.;
10589 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
10590 Double_t s1p1k = 0.;
10591 Double_t s1p2k = 0.;
10592 Double_t s1p3k = 0.;
10594 // M0111 from Eq. (118) in QC2c (to be improved (notation))
10595 Double_t dM0111 = 0.;
10599 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
10600 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
10601 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
10602 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
10604 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
10606 t = 1; // typeFlag = RP or POI
10608 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
10609 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))
10610 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));
10611 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))
10612 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b));
10613 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))
10614 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));
10615 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))
10616 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b));
10618 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
10619 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.);
10620 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.);
10621 s1p3k = pow(fs1dEBE[2][pe][3]->GetBinContent(b)*fs1dEBE[2][pe][3]->GetBinEntries(b),1.);
10623 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
10624 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
10625 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
10626 + 2.*(s1p3k-s1p2k*dSM1p1k));
10628 else if(type == "RP")
10630 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
10631 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))
10632 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));
10633 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))
10634 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));
10635 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))
10636 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));
10637 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))
10638 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));
10640 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
10641 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.);
10642 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.);
10643 s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.);
10645 // to be improved (cross-checked):
10646 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
10647 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
10648 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
10649 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
10651 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
10653 t = 0; // typeFlag = RP or POI
10655 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
10656 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
10657 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
10658 + 2.*(s1p3k-s1p2k*dSM1p1k));
10659 //...............................................................................................
10662 // 2'-particle correlation:
10663 Double_t two1n1nW0W1 = 0.;
10664 if(mp*dSM1p1k-s1p1k)
10666 two1n1nW0W1 = (p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k-s1p1k)
10667 / (mp*dSM1p1k-s1p1k);
10669 // fill profile to get <<2'>>
10670 fDiffFlowCorrelationsPro[t][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nW0W1,mp*dSM1p1k-s1p1k);
10671 // fill profile to get <<2'>^2>
10672 fDiffFlowSquaredCorrelationsPro[t][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nW0W1*two1n1nW0W1,mp*dSM1p1k-s1p1k);
10673 // histogram to store <2'> e-b-e (needed in some other methods):
10674 fDiffFlowCorrelationsEBE[t][pe][0]->SetBinContent(b,two1n1nW0W1);
10675 fDiffFlowEventWeightsForCorrelationsEBE[t][pe][0]->SetBinContent(b,mp*dSM1p1k-s1p1k);
10676 } // end of if(mp*dSM1p1k-s1p1k)
10678 // 4'-particle correlation:
10679 Double_t four1n1n1n1nW0W1W1W1 = 0.;
10682 four1n1n1n1nW0W1W1W1 = ((pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
10683 - q2n1kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))
10684 - 2.*q2n1kIm*dReQ1n1k*dImQ1n1k
10685 - p1n0kRe*(dReQ1n1k*dReQ2n2k+dImQ1n1k*dImQ2n2k)
10686 + p1n0kIm*(dImQ1n1k*dReQ2n2k-dReQ1n1k*dImQ2n2k)
10687 - 2.*dSM1p2k*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
10688 - 2.*(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*s1p1k
10689 + 6.*(q1n2kRe*dReQ1n1k+q1n2kIm*dImQ1n1k)
10690 + 1.*(q2n1kRe*dReQ2n2k+q2n1kIm*dImQ2n2k)
10691 + 2.*(p1n0kRe*dReQ1n3k+p1n0kIm*dImQ1n3k)
10694 / dM0111; // to be improved (notation of dM0111)
10696 // fill profile to get <<4'>>
10697 fDiffFlowCorrelationsPro[t][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nW0W1W1W1,dM0111);
10698 // fill profile to get <<4'>^2>
10699 fDiffFlowSquaredCorrelationsPro[t][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nW0W1W1W1*four1n1n1n1nW0W1W1W1,dM0111);
10700 // histogram to store <4'> e-b-e (needed in some other methods):
10701 fDiffFlowCorrelationsEBE[t][pe][1]->SetBinContent(b,four1n1n1n1nW0W1W1W1);
10702 fDiffFlowEventWeightsForCorrelationsEBE[t][pe][1]->SetBinContent(b,dM0111);
10703 } // end of if(dM0111)
10704 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10706 } // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelationsUsingParticleWeights(TString type, TString ptOrEta); // type = RP or POI
10708 //================================================================================================================================
10710 void AliFlowAnalysisWithQCumulants::FillCommonControlHistograms(AliFlowEventSimple *anEvent)
10712 // Fill common control histograms.
10714 Int_t nRP = anEvent->GetEventNSelTracksRP(); // number of RPs (i.e. number of particles used to determine the reaction plane)
10715 fCommonHists->FillControlHistograms(anEvent);
10716 if(fFillMultipleControlHistograms)
10720 fCommonHists2nd->FillControlHistograms(anEvent);
10723 fCommonHists4th->FillControlHistograms(anEvent);
10726 fCommonHists6th->FillControlHistograms(anEvent);
10729 fCommonHists8th->FillControlHistograms(anEvent);
10730 } // end of if(nRP>7)
10731 } // end of if(nRP>5)
10732 } // end of if(nRP>3)
10733 } // end of if(nRP>1)
10734 } // end of if(fFillMultipleControlHistograms)
10736 } // end of void AliFlowAnalysisWithQCumulants::FillCommonControlHistograms(AliFlowEventSimple *anEvent)
10738 //================================================================================================================================
10740 void AliFlowAnalysisWithQCumulants::ResetEventByEventQuantities()
10742 // Reset all event by event quantities.
10748 fIntFlowCorrelationsEBE->Reset();
10749 fIntFlowEventWeightsForCorrelationsEBE->Reset();
10750 fIntFlowCorrelationsAllEBE->Reset();
10752 for(Int_t sc=0;sc<2;sc++)
10754 fIntFlowCorrectionTermsForNUAEBE[sc]->Reset();
10755 fIntFlowEventWeightForCorrectionTermsForNUAEBE[sc]->Reset();
10758 // Differential flow:
10759 if(fCalculateDiffFlow)
10761 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
10763 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // 1D in pt or eta
10765 for(Int_t m=0;m<4;m++) // multiple of harmonic
10767 for(Int_t k=0;k<9;k++) // power of weight
10769 if(fReRPQ1dEBE[t][pe][m][k]) fReRPQ1dEBE[t][pe][m][k]->Reset();
10770 if(fImRPQ1dEBE[t][pe][m][k]) fImRPQ1dEBE[t][pe][m][k]->Reset();
10775 for(Int_t t=0;t<3;t++) // type (0 = RP, 1 = POI, 2 = RP&&POI )
10777 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // 1D in pt or eta
10779 for(Int_t k=0;k<9;k++)
10781 if(fs1dEBE[t][pe][k]) fs1dEBE[t][pe][k]->Reset();
10785 // e-b-e reduced correlations:
10786 for(Int_t t=0;t<2;t++) // type (0 = RP, 1 = POI)
10788 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
10790 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
10792 if(fDiffFlowCorrelationsEBE[t][pe][rci]) fDiffFlowCorrelationsEBE[t][pe][rci]->Reset();
10793 if(fDiffFlowEventWeightsForCorrelationsEBE[t][pe][rci]) fDiffFlowEventWeightsForCorrelationsEBE[t][pe][rci]->Reset();
10797 // correction terms for NUA:
10798 for(Int_t t=0;t<2;t++) // type (0 = RP, 1 = POI)
10800 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
10802 for(Int_t sc=0;sc<2;sc++) // sin or cos
10804 for(Int_t cti=0;cti<9;cti++) // correction term index
10806 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti]->Reset();
10811 } // end of if(fCalculateDiffFlow)
10814 if(fCalculate2DDiffFlow)
10816 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
10818 for(Int_t m=0;m<4;m++) // multiple of harmonic
10820 for(Int_t k=0;k<9;k++) // power of weight
10822 if(fReRPQ2dEBE[t][m][k]){fReRPQ2dEBE[t][m][k]->Reset();}
10823 if(fImRPQ2dEBE[t][m][k]){fImRPQ2dEBE[t][m][k]->Reset();}
10827 for(Int_t t=0;t<3;t++) // type (0 = RP, 1 = POI, 2 = RP&&POI )
10829 for(Int_t k=0;k<9;k++)
10831 if(fs2dEBE[t][k]){fs2dEBE[t][k]->Reset();}
10834 } // end of if(fCalculate2DDiffFlow)
10836 } // end of void AliFlowAnalysisWithQCumulants::ResetEventByEventQuantities();
10838 //================================================================================================================================
10840 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTerms(TString type, TString ptOrEta)
10842 // Calculate correction terms for non-uniform acceptance for differential flow (sin terms).
10844 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][0][cti], where cti runs as follows:
10845 // 0: <<sin n(psi1)>>
10846 // 1: <<sin n(psi1+phi2)>>
10847 // 2: <<sin n(psi1+phi2-phi3)>>
10848 // 3: <<sin n(psi1-phi2-phi3)>>:
10854 Double_t dMult = (*fSpk)(0,0);
10856 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
10857 Double_t dReQ1n = (*fReQ)(0,0);
10858 Double_t dReQ2n = (*fReQ)(1,0);
10859 //Double_t dReQ3n = (*fReQ)(2,0);
10860 //Double_t dReQ4n = (*fReQ)(3,0);
10861 Double_t dImQ1n = (*fImQ)(0,0);
10862 Double_t dImQ2n = (*fImQ)(1,0);
10863 //Double_t dImQ3n = (*fImQ)(2,0);
10864 //Double_t dImQ4n = (*fImQ)(3,0);
10866 Int_t t = 0; // type flag
10867 Int_t pe = 0; // ptEta flag
10872 } else if(type == "POI")
10877 if(ptOrEta == "Pt")
10880 } else if(ptOrEta == "Eta")
10885 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
10886 Double_t minPtEta[2] = {fPtMin,fEtaMin};
10887 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
10888 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
10890 // looping over all bins and calculating correction terms:
10891 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10893 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
10894 Double_t p1n0kRe = 0.;
10895 Double_t p1n0kIm = 0.;
10897 // number of POIs in particular pt or eta bin:
10900 // real and imaginary parts of q_{m*n,0} (non-weighted Q-vector evaluated for particles which are both RPs and POIs in particular pt or eta bin):
10901 Double_t q1n0kRe = 0.;
10902 Double_t q1n0kIm = 0.;
10903 Double_t q2n0kRe = 0.;
10904 Double_t q2n0kIm = 0.;
10906 // number of particles which are both RPs and POIs in particular pt or eta bin:
10912 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))
10913 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));
10914 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))
10915 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));
10916 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))
10917 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));
10918 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))
10919 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b));
10921 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
10923 else if(type == "RP")
10926 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
10927 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
10928 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
10929 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
10930 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))
10931 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));
10932 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))
10933 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b));
10935 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
10940 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
10941 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
10942 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
10943 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
10945 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
10947 t = 1; // typeFlag = RP or POI
10949 else if(type == "RP")
10951 // p_{m*n,0} = q_{m*n,0}:
10957 t = 0; // typeFlag = RP or POI
10960 // <<sin n(psi1)>>:
10961 Double_t sinP1nPsi = 0.;
10964 sinP1nPsi = p1n0kIm/mp;
10965 // fill profile for <<sin n(psi1)>>:
10966 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi,mp);
10967 // histogram to store <sin n(psi1)> e-b-e (needed in some other methods):
10968 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][0]->SetBinContent(b,sinP1nPsi);
10971 // <<sin n(psi1+phi2)>>:
10972 Double_t sinP1nPsiP1nPhi = 0.;
10975 sinP1nPsiP1nPhi = (p1n0kRe*dImQ1n+p1n0kIm*dReQ1n-q2n0kIm)/(mp*dMult-mq);
10976 // fill profile for <<sin n(psi1+phi2)>>:
10977 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsiP1nPhi,mp*dMult-mq);
10978 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
10979 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][1]->SetBinContent(b,sinP1nPsiP1nPhi);
10980 } // end of if(mp*dMult-mq)
10982 // <<sin n(psi1+phi2-phi3)>>:
10983 Double_t sinP1nPsi1P1nPhi2MPhi3 = 0.;
10984 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
10986 sinP1nPsi1P1nPhi2MPhi3 = (p1n0kIm*(pow(dImQ1n,2.)+pow(dReQ1n,2.)-dMult)
10987 - 1.*(q2n0kIm*dReQ1n-q2n0kRe*dImQ1n)
10988 - mq*dImQ1n+2.*q1n0kIm)
10989 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
10990 // fill profile for <<sin n(psi1+phi2)>>:
10991 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1P1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
10992 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
10993 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][2]->SetBinContent(b,sinP1nPsi1P1nPhi2MPhi3);
10994 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
10996 // <<sin n(psi1-phi2-phi3)>>:
10997 Double_t sinP1nPsi1M1nPhi2MPhi3 = 0.;
10998 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
11000 sinP1nPsi1M1nPhi2MPhi3 = (p1n0kIm*(pow(dReQ1n,2.)-pow(dImQ1n,2.))-2.*p1n0kRe*dReQ1n*dImQ1n
11001 - 1.*(p1n0kIm*dReQ2n-p1n0kRe*dImQ2n)
11002 + 2.*mq*dImQ1n-2.*q1n0kIm)
11003 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
11004 // fill profile for <<sin n(psi1+phi2)>>:
11005 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1M1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
11006 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
11007 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][3]->SetBinContent(b,sinP1nPsi1M1nPhi2MPhi3);
11008 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
11009 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
11011 } // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTerms(TString type, TString ptOrEta)
11014 //================================================================================================================================
11017 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTerms(TString type, TString ptOrEta)
11019 // Calculate correction terms for non-uniform acceptance for differential flow (cos terms).
11021 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][1][cti], where cti runs as follows:
11022 // 0: <<cos n(psi)>>
11023 // 1: <<cos n(psi1+phi2)>>
11024 // 2: <<cos n(psi1+phi2-phi3)>>
11025 // 3: <<cos n(psi1-phi2-phi3)>>
11031 Double_t dMult = (*fSpk)(0,0);
11033 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
11034 Double_t dReQ1n = (*fReQ)(0,0);
11035 Double_t dReQ2n = (*fReQ)(1,0);
11036 //Double_t dReQ3n = (*fReQ)(2,0);
11037 //Double_t dReQ4n = (*fReQ)(3,0);
11038 Double_t dImQ1n = (*fImQ)(0,0);
11039 Double_t dImQ2n = (*fImQ)(1,0);
11040 //Double_t dImQ3n = (*fImQ)(2,0);
11041 //Double_t dImQ4n = (*fImQ)(3,0);
11043 Int_t t = 0; // type flag
11044 Int_t pe = 0; // ptEta flag
11049 } else if(type == "POI")
11054 if(ptOrEta == "Pt")
11057 } else if(ptOrEta == "Eta")
11062 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
11063 Double_t minPtEta[2] = {fPtMin,fEtaMin};
11064 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
11065 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
11067 // looping over all bins and calculating correction terms:
11068 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
11070 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
11071 Double_t p1n0kRe = 0.;
11072 Double_t p1n0kIm = 0.;
11074 // number of POIs in particular pt or eta bin:
11077 // real and imaginary parts of q_{m*n,0} (non-weighted Q-vector evaluated for particles which are both RPs and POIs in particular pt or eta bin):
11078 Double_t q1n0kRe = 0.;
11079 Double_t q1n0kIm = 0.;
11080 Double_t q2n0kRe = 0.;
11081 Double_t q2n0kIm = 0.;
11083 // number of particles which are both RPs and POIs in particular pt or eta bin:
11089 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))
11090 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));
11091 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))
11092 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));
11093 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))
11094 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));
11095 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))
11096 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b));
11098 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
11100 else if(type == "RP")
11103 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
11104 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
11105 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
11106 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
11107 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))
11108 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));
11109 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))
11110 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b));
11112 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
11117 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
11118 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
11119 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
11120 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
11122 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
11124 t = 1; // typeFlag = RP or POI
11126 else if(type == "RP")
11128 // p_{m*n,0} = q_{m*n,0}:
11134 t = 0; // typeFlag = RP or POI
11137 // <<cos n(psi1)>>:
11138 Double_t cosP1nPsi = 0.;
11141 cosP1nPsi = p1n0kRe/mp;
11143 // fill profile for <<cos n(psi1)>>:
11144 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi,mp);
11145 // histogram to store <cos n(psi1)> e-b-e (needed in some other methods):
11146 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][0]->SetBinContent(b,cosP1nPsi);
11149 // <<cos n(psi1+phi2)>>:
11150 Double_t cosP1nPsiP1nPhi = 0.;
11153 cosP1nPsiP1nPhi = (p1n0kRe*dReQ1n-p1n0kIm*dImQ1n-q2n0kRe)/(mp*dMult-mq);
11154 // fill profile for <<sin n(psi1+phi2)>>:
11155 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsiP1nPhi,mp*dMult-mq);
11156 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
11157 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][1]->SetBinContent(b,cosP1nPsiP1nPhi);
11158 } // end of if(mp*dMult-mq)
11160 // <<cos n(psi1+phi2-phi3)>>:
11161 Double_t cosP1nPsi1P1nPhi2MPhi3 = 0.;
11162 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
11164 cosP1nPsi1P1nPhi2MPhi3 = (p1n0kRe*(pow(dImQ1n,2.)+pow(dReQ1n,2.)-dMult)
11165 - 1.*(q2n0kRe*dReQ1n+q2n0kIm*dImQ1n)
11166 - mq*dReQ1n+2.*q1n0kRe)
11167 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
11168 // fill profile for <<sin n(psi1+phi2)>>:
11169 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1P1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
11170 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
11171 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][2]->SetBinContent(b,cosP1nPsi1P1nPhi2MPhi3);
11172 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
11174 // <<cos n(psi1-phi2-phi3)>>:
11175 Double_t cosP1nPsi1M1nPhi2MPhi3 = 0.;
11176 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
11178 cosP1nPsi1M1nPhi2MPhi3 = (p1n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))+2.*p1n0kIm*dReQ1n*dImQ1n
11179 - 1.*(p1n0kRe*dReQ2n+p1n0kIm*dImQ2n)
11180 - 2.*mq*dReQ1n+2.*q1n0kRe)
11181 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
11182 // fill profile for <<sin n(psi1+phi2)>>:
11183 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1M1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
11184 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
11185 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][3]->SetBinContent(b,cosP1nPsi1M1nPhi2MPhi3);
11186 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
11187 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
11189 } // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTerms(TString type, TString ptOrEta)
11191 //==================================================================================================================================
11193 void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUADiffFlow(TString type, TString ptOrEta)
11195 // Transfer profiles into histogams and correctly propagate the error.
11197 Int_t t = 0; // type flag
11198 Int_t pe = 0; // ptEta flag
11203 } else if(type == "POI")
11208 if(ptOrEta == "Pt")
11211 } else if(ptOrEta == "Eta")
11216 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
11217 //Double_t minPtEta[2] = {fPtMin,fEtaMin};
11218 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
11219 //Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
11221 for(Int_t sc=0;sc<2;sc++) // sin or cos
11223 for(Int_t cti=0;cti<9;cti++) // correction term index
11225 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
11227 Double_t correctionTerm = fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]->GetBinContent(b);
11228 fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti]->SetBinContent(b,correctionTerm);
11229 // to be improved (propagate error correctly)
11231 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
11232 } // correction term index
11233 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
11235 }// end of void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUADiffFlow(TString type, TString ptOrEta)
11237 //==================================================================================================================================
11239 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulantsCorrectedForNUA(TString type, TString ptOrEta)
11241 // Calculate generalized differential flow cumulants (corrected for non-uniform acceptance).
11243 // to be improved - propagate error also from non-isotropic terms
11245 Int_t t = 0; // RP = 0, POI = 1
11246 Int_t pe = 0; // pt = 0, eta = 1
11251 } else if(type == "POI")
11256 if(ptOrEta == "Pt")
11259 } else if(ptOrEta == "Eta")
11265 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
11266 // 2-particle correlation:
11267 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
11268 // sinus terms coming from reference flow:
11269 Double_t sinP1nPhi = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1); // <<sin(n*phi1)>>
11270 Double_t sinP1nPhi1P1nPhi2 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2); // <<sin(n*(phi1+phi2))>>
11271 Double_t sinP1nPhi1M1nPhi2M1nPhi3 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(3); // <<sin(n*(phi1-phi2-phi3))>>
11272 // cosinus terms coming from reference flow:
11273 Double_t cosP1nPhi = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1); // <<cos(n*phi1)>>
11274 Double_t cosP1nPhi1P1nPhi2 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2); // <<cos(n*(phi1+phi2))>>
11275 Double_t cosP1nPhi1M1nPhi2M1nPhi3 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(3); // <<cos(n*(phi1-phi2-phi3))>>
11277 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
11279 Double_t twoPrime = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b); // <<2'>>
11280 Double_t fourPrime = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b); // <<4'>>
11281 Double_t sinP1nPsi = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][0]->GetBinContent(b); // <<sin n(Psi)>>
11282 Double_t cosP1nPsi = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][0]->GetBinContent(b); // <<cos n(Psi)>>
11283 Double_t sinP1nPsi1P1nPhi2 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][1]->GetBinContent(b); // <<sin n(psi1+phi2)>>
11284 Double_t cosP1nPsi1P1nPhi2 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][1]->GetBinContent(b); // <<cos n(psi1+phi2)>>
11285 Double_t sinP1nPsi1P1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][2]->GetBinContent(b); // <<sin n(psi1+phi2-phi3)>>
11286 Double_t cosP1nPsi1P1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][2]->GetBinContent(b); // <<cos n(psi1+phi2-phi3)>>
11287 Double_t sinP1nPsi1M1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][3]->GetBinContent(b); // <<sin n(psi1-phi2-phi3)>>
11288 Double_t cosP1nPsi1M1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][3]->GetBinContent(b); // <<cos n(psi1-phi2-phi3)>>
11289 // Generalized QC{2'}:
11290 Double_t qc2Prime = twoPrime - sinP1nPsi*sinP1nPhi - cosP1nPsi*cosP1nPhi;
11291 if(fApplyCorrectionForNUA)
11293 fDiffFlowCumulants[t][pe][0]->SetBinContent(b,qc2Prime);
11295 if(TMath::Abs(twoPrime)>0.)
11297 fDiffFlowDetectorBias[t][pe][0]->SetBinContent(b,qc2Prime/twoPrime); // detector bias = generalized/isotropic cumulant.
11299 // Generalized QC{4'}:
11300 Double_t qc4Prime = fourPrime-2.*twoPrime*two
11301 - cosP1nPsi*cosP1nPhi1M1nPhi2M1nPhi3
11302 + sinP1nPsi*sinP1nPhi1M1nPhi2M1nPhi3
11303 - cosP1nPhi*cosP1nPsi1M1nPhi2M1nPhi3
11304 + sinP1nPhi*sinP1nPsi1M1nPhi2M1nPhi3
11305 - 2.*cosP1nPhi*cosP1nPsi1P1nPhi2M1nPhi3
11306 - 2.*sinP1nPhi*sinP1nPsi1P1nPhi2M1nPhi3
11307 - cosP1nPsi1P1nPhi2*cosP1nPhi1P1nPhi2
11308 - sinP1nPsi1P1nPhi2*sinP1nPhi1P1nPhi2
11309 + 2.*cosP1nPhi1P1nPhi2*(cosP1nPsi*cosP1nPhi-sinP1nPsi*sinP1nPhi)
11310 + 2.*sinP1nPhi1P1nPhi2*(cosP1nPsi*sinP1nPhi+sinP1nPsi*cosP1nPhi)
11311 + 4.*two*(cosP1nPsi*cosP1nPhi+sinP1nPsi*sinP1nPhi)
11312 + 2.*cosP1nPsi1P1nPhi2*(pow(cosP1nPhi,2.)-pow(sinP1nPhi,2.))
11313 + 4.*sinP1nPsi1P1nPhi2*cosP1nPhi*sinP1nPhi
11314 + 4.*twoPrime*(pow(cosP1nPhi,2.)+pow(sinP1nPhi,2.))
11315 - 6.*(pow(cosP1nPhi,2.)-pow(sinP1nPhi,2.))
11316 * (cosP1nPsi*cosP1nPhi-sinP1nPsi*sinP1nPhi)
11317 - 12.*cosP1nPhi*sinP1nPhi
11318 * (sinP1nPsi*cosP1nPhi+cosP1nPsi*sinP1nPhi);
11319 if(fApplyCorrectionForNUA)
11321 fDiffFlowCumulants[t][pe][1]->SetBinContent(b,qc4Prime);
11323 if(TMath::Abs(fourPrime-2.*twoPrime*two)>0.)
11325 fDiffFlowDetectorBias[t][pe][1]->SetBinContent(b,qc4Prime/(fourPrime-2.*twoPrime*two)); // detector bias = generalized/isotropic cumulant.
11327 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
11329 } // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulantsCorrectedForNUA(TString type, TString ptOrEta)
11331 //==================================================================================================================================
11333 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectedForNUA(TString type, TString ptOrEta)
11335 // Calculate differential flow corrected for non-uniform acceptance.
11337 // to be improved: eventually I will have to access here masured correlations and NUA terms
11338 // instead of cumulants in order to propagate statistical error correctly also
11339 // to NUA terms (propagating errors directly from cumulants is WRONG for
11340 // differential flow becuase that doesn't account at all cross-covariance terms)
11342 // REMARK: When NUA correction is apllied error for differential flow DOES NOT get corrected,
11343 // i.e. only value is being corrected, error is still the one relevant for isotropic
11344 // case. This eventually will be resolved.
11347 Int_t t = 0; // RP or POI
11348 Int_t pe = 0; // pt or eta
11353 } else if(type == "POI")
11357 if(ptOrEta == "Pt")
11360 } else if(ptOrEta == "Eta")
11366 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
11367 // Reference Q-cumulants
11368 Double_t qc2 = fIntFlowQcumulants->GetBinContent(1); // QC{2}
11369 Double_t qc4 = fIntFlowQcumulants->GetBinContent(2); // QC{4}
11370 // Loop over pt or eta bins:
11371 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
11373 // Differential Q-cumulants:
11374 Double_t qc2Prime = fDiffFlowCumulants[t][pe][0]->GetBinContent(b); // QC{2'}
11375 Double_t qc4Prime = fDiffFlowCumulants[t][pe][1]->GetBinContent(b); // QC{4'}
11379 Double_t v2Prime = qc2Prime/pow(qc2,0.5);
11380 if(TMath::Abs(v2Prime)>0.){fDiffFlow[t][pe][0]->SetBinContent(b,v2Prime);}
11385 Double_t v4Prime = -qc4Prime/pow(-qc4,3./4.);
11386 if(TMath::Abs(v4Prime)>0.){fDiffFlow[t][pe][1]->SetBinContent(b,v4Prime);}
11388 } // end of for(Int_t b=1;b<=fnBinsPtEta[pe];b++)
11390 } // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectedForNUA(TString type, TString ptOrEta);
11392 //==================================================================================================================================
11394 void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoops(AliFlowEventSimple * const anEvent)
11396 // Evaluate with nested loops multiparticle correlations for integrated flow (without using the particle weights).
11398 // Remark: Results are stored in profile fIntFlowDirectCorrelations whose binning is organized as follows:
11400 // 1st bin: <2>_{1n|1n} = two1n1n = cos(n*(phi1-phi2))>
11401 // 2nd bin: <2>_{2n|2n} = two2n2n = cos(2n*(phi1-phi2))>
11402 // 3rd bin: <2>_{3n|3n} = two3n3n = cos(3n*(phi1-phi2))>
11403 // 4th bin: <2>_{4n|4n} = two4n4n = cos(4n*(phi1-phi2))>
11404 // 5th bin: ---- EMPTY ----
11405 // 6th bin: <3>_{2n|1n,1n} = three2n1n1n = <cos(n*(2.*phi1-phi2-phi3))>
11406 // 7th bin: <3>_{3n|2n,1n} = three3n2n1n = <cos(n*(3.*phi1-2.*phi2-phi3))>
11407 // 8th bin: <3>_{4n|2n,2n} = three4n2n2n = <cos(n*(4.*phi1-2.*phi2-2.*phi3))>
11408 // 9th bin: <3>_{4n|3n,1n} = three4n3n1n = <cos(n*(4.*phi1-3.*phi2-phi3))>
11409 // 10th bin: ---- EMPTY ----
11410 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1n = <cos(n*(phi1+phi2-phi3-phi4))>
11411 // 12th bin: <4>_{2n,1n|2n,1n} = four2n1n2n1n = <cos(2.*n*(phi1+phi2-phi3-phi4))>
11412 // 13th bin: <4>_{2n,2n|2n,2n} = four2n2n2n2n = <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>
11413 // 14th bin: <4>_{3n|1n,1n,1n} = four3n1n1n1n = <cos(n*(3.*phi1-phi2-phi3-phi4))>
11414 // 15th bin: <4>_{3n,1n|3n,1n} = four3n1n3n1n = <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>
11415 // 16th bin: <4>_{3n,1n|2n,2n} = four3n1n2n2n = <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>
11416 // 17th bin: <4>_{4n|2n,1n,1n} = four4n2n1n1n = <cos(n*(3.*phi1+phi2-3.*phi3-phi4))>
11417 // 18th bin: ---- EMPTY ----
11418 // 19th bin: <5>_{2n|1n,1n,1n,1n} = five2n1n1n1n1n = <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>
11419 // 20th bin: <5>_{2n,2n|2n,1n,1n} = five2n2n2n1n1n = <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>
11420 // 21st bin: <5>_{3n,1n|2n,1n,1n} = five3n1n2n1n1n = <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>
11421 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = five4n1n1n1n1n = <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>
11422 // 23rd bin: ---- EMPTY ----
11423 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = six1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
11424 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = six2n1n1n2n1n1n = <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>
11425 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = six2n2n1n1n1n1n = <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>
11426 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = six3n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>
11427 // 28th bin: ---- EMPTY ----
11428 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = seven2n1n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
11429 // 30th bin: ---- EMPTY ----
11430 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = eight1n1n1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
11431 // 32nd bin: ---- EMPTY ----
11432 // Extra correlations for 3p TY study:
11433 // 33rd bin: <4>_{4n,2n|3n,3n}= four4n2n3n3n = <cos(n*(4.*phi1+2.*phi2-3.*phi3-3.*phi4))>
11434 // 34th bin: <5>_{3n,3n|2n,2n,2n} = five3n3n2n2n2n = <cos(n(3*phi1+3*phi2-2*phi3-2*phi4-2*phi5))>
11435 // Extra correlations for 6p TY study:
11436 // 35th bin: <2>_{5n|5n} = two5n5n = <cos(5n*(phi1-phi2)> T
11437 // 36th bin: <2>_{6n|6n} = two6n6n = <cos(6n*(phi1-phi2)> T
11438 // 37th bin: <3>_{5n|3n,2n} = three5n3n2n = <cos(n*(5*phi1-3*phi2-2*phi3)>
11439 // 38th bin: <3>_{5n|4n,1n} = three5n4n1n = <cos(n*(5*phi1-4*phi2-1*phi3)>
11440 // 39th bin: <3>_{6n|3n,3n} = three6n3n3n = <cos(n*(6*phi1-3*phi2-3*phi3)> T
11441 // 40th bin: <3>_{6n|4n,2n} = three6n4n2n = <cos(n*(6*phi1-4*phi2-2*phi3)> T
11442 // 41st bin: <3>_{6n|5n,1n} = three6n5n1n = <cos(n*(6*phi1-5*phi2-1*phi3)>
11443 // 42nd bin: <4>_{6n|3n,2n,1n} = four6n3n2n1n = <cos(n*(6*phi1-3*phi2-2*phi3-1*phi4)>
11444 // 43rd bin: <4>_{3n,2n|3n,2n} = four3n2n3n2n = <cos(n*(3*phi1+2*phi2-3*phi3-2*phi4)>
11445 // 44th bin: <4>_{4n,1n|3n,2n} = four4n1n3n2n = <cos(n*(4*phi1+1*phi2-3*phi3-2*phi4)>
11446 // 45th bin: <4>_{3n,3n|3n,3n} = four3n3n3n3n = <cos(3.*n*(phi1+phi2-phi3-phi4))> T
11447 // 46th bin: <4>_{4n,2n|3n,3n} = four4n2n3n3n = <cos(n*(4*phi1+2*phi2-3*phi3-3*phi4)>
11448 // 47th bin: <4>_{5n,1n|3n,3n} = four5n1n3n3n = <cos(n*(5*phi1+1*phi2-3*phi3-3*phi4)>
11449 // 48th bin: <4>_{4n,2n|4n,2n} = four4n2n4n2n = <cos(n*(4*phi1+2*phi2-4*phi3-2*phi4)> T
11450 // 49th bin: <4>_{5n,1n|4n,2n} = four5n1n4n2n = <cos(n*(5*phi1+1*phi2-4*phi3-2*phi4)>
11451 // 50th bin: <4>_{5n|3n,1n,1n} = four5n3n1n1n = <cos(n*(5*phi1-3*phi2-1*phi3-1*phi4)>
11452 // 51st bin: <4>_{5n|2n,2n,1n} = four5n2n2n1n = <cos(n*(5*phi1-2*phi2-2*phi3-1*phi4)>
11453 // 52nd bin: <4>_{5n,1n|5n,1n} = four5n1n5n1n = <cos(n*(5*phi1+1*phi2-5*phi3-1*phi4)>
11454 // 53rd bin: <5>_{3n,3n|3n,2n,1n} = four3n3n3n2n1n = <cos(n*(3*phi1+3*phi2-3*phi3-2*phi4-1*phi5)>
11455 // 54th bin: <5>_{4n,2n|3n,2n,1n} = four4n2n3n2n1n = <cos(n*(4*phi1+2*phi2-3*phi3-2*phi4-1*phi5)>
11456 // 55th bin: <5>_{3n,2n|3n,1n,1n} = four3n2n3n1n1n = <cos(n*(3*phi1+2*phi2-3*phi3-1*phi4-1*phi5)>
11457 // 56th bin: <5>_{3n,2n|2n,2n,1n} = four3n2n2n2n1n = <cos(n*(3*phi1+2*phi2-2*phi3-2*phi4-1*phi5)>
11458 // 57th bin: <5>_{5n,1n|3n,2n,1n} = four5n1n3n2n1n = <cos(n*(5*phi1+1*phi2-3*phi3-2*phi4-1*phi5)>
11459 // 58th bin: <6>_{3n,2n,1n|3n,2n,1n} = six3n2n1n3n2n1n = <cos(n*(3*phi1+2*phi2+1*phi3-3*phi4-2*phi5-1*phi6)>
11461 Int_t nPrim = anEvent->NumberOfTracks();
11462 AliFlowTrackSimple *aftsTrack = NULL;
11463 Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
11464 Int_t n = fHarmonic;
11465 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
11466 Double_t dMult = (*fSpk)(0,0);
11468 cout<<"Multiparticle correlations: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
11471 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
11472 } else if (dMult>fMaxAllowedMultiplicity)
11474 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
11477 cout<<"... evaluating nested loops (without using particle weights)..."<<endl;
11480 // 2-particle correlations:
11481 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
11483 for(Int_t i1=0;i1<nPrim;i1++)
11485 aftsTrack=anEvent->GetTrack(i1);
11486 if(!(aftsTrack->InRPSelection())) continue;
11487 phi1=aftsTrack->Phi();
11488 for(Int_t i2=0;i2<nPrim;i2++)
11490 if(i2==i1)continue;
11491 aftsTrack=anEvent->GetTrack(i2);
11492 if(!(aftsTrack->InRPSelection())) continue;
11493 phi2=aftsTrack->Phi();
11494 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
11495 // fill the profile with 2-p correlations:
11496 fIntFlowDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),1.); // <cos(n*(phi1-phi2))>
11497 fIntFlowDirectCorrelations->Fill(1.5,cos(2.*n*(phi1-phi2)),1.); // <cos(2n*(phi1-phi2))>
11498 fIntFlowDirectCorrelations->Fill(2.5,cos(3.*n*(phi1-phi2)),1.); // <cos(3n*(phi1-phi2))>
11499 fIntFlowDirectCorrelations->Fill(3.5,cos(4.*n*(phi1-phi2)),1.); // <cos(4n*(phi1-phi2))>
11500 fIntFlowDirectCorrelations->Fill(34.5,cos(5.*n*(phi1-phi2)),1.); // <cos(5n*(phi1-phi2))>
11501 fIntFlowDirectCorrelations->Fill(35.5,cos(6.*n*(phi1-phi2)),1.); // <cos(6n*(phi1-phi2))>
11502 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11503 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11504 } // end of if(nPrim>=2)
11506 // 3-particle correlations:
11507 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
11509 for(Int_t i1=0;i1<nPrim;i1++)
11511 aftsTrack=anEvent->GetTrack(i1);
11512 if(!(aftsTrack->InRPSelection())) continue;
11513 phi1=aftsTrack->Phi();
11514 for(Int_t i2=0;i2<nPrim;i2++)
11516 if(i2==i1)continue;
11517 aftsTrack=anEvent->GetTrack(i2);
11518 if(!(aftsTrack->InRPSelection())) continue;
11519 phi2=aftsTrack->Phi();
11520 for(Int_t i3=0;i3<nPrim;i3++)
11522 if(i3==i1||i3==i2)continue;
11523 aftsTrack=anEvent->GetTrack(i3);
11524 if(!(aftsTrack->InRPSelection())) continue;
11525 phi3=aftsTrack->Phi();
11526 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;
11527 // fill the profile with 3-p correlations:
11528 fIntFlowDirectCorrelations->Fill(5.,cos(2.*n*phi1-n*(phi2+phi3)),1.); //<3>_{2n|nn,n}
11529 fIntFlowDirectCorrelations->Fill(6.,cos(3.*n*phi1-2.*n*phi2-n*phi3),1.); //<3>_{3n|2n,n}
11530 fIntFlowDirectCorrelations->Fill(7.,cos(4.*n*phi1-2.*n*phi2-2.*n*phi3),1.); //<3>_{4n|2n,2n}
11531 fIntFlowDirectCorrelations->Fill(8.,cos(4.*n*phi1-3.*n*phi2-n*phi3),1.); //<3>_{4n|3n,n}
11532 fIntFlowDirectCorrelations->Fill(36.5,cos(5.*n*phi1-3.*n*phi2-2.*n*phi3),1.); //<3>_{5n|3n,2n}
11533 fIntFlowDirectCorrelations->Fill(37.5,cos(5.*n*phi1-4.*n*phi2-1.*n*phi3),1.); //<3>_{5n|4n,1n}
11534 fIntFlowDirectCorrelations->Fill(38.5,cos(6.*n*phi1-3.*n*phi2-3.*n*phi3),1.); //<3>_{6n|3n,3n}
11535 fIntFlowDirectCorrelations->Fill(39.5,cos(6.*n*phi1-4.*n*phi2-2.*n*phi3),1.); //<3>_{6n|4n,2n}
11536 fIntFlowDirectCorrelations->Fill(40.5,cos(6.*n*phi1-5.*n*phi2-1.*n*phi3),1.); //<3>_{6n|5n,1n}
11537 } // end of for(Int_t i3=0;i3<nPrim;i3++)
11538 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11539 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11540 } // end of if(nPrim>=3)
11542 // 4-particle correlations:
11543 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)
11545 for(Int_t i1=0;i1<nPrim;i1++)
11547 aftsTrack=anEvent->GetTrack(i1);
11548 if(!(aftsTrack->InRPSelection())) continue;
11549 phi1=aftsTrack->Phi();
11550 for(Int_t i2=0;i2<nPrim;i2++)
11552 if(i2==i1)continue;
11553 aftsTrack=anEvent->GetTrack(i2);
11554 if(!(aftsTrack->InRPSelection())) continue;
11555 phi2=aftsTrack->Phi();
11556 for(Int_t i3=0;i3<nPrim;i3++)
11558 if(i3==i1||i3==i2)continue;
11559 aftsTrack=anEvent->GetTrack(i3);
11560 if(!(aftsTrack->InRPSelection())) continue;
11561 phi3=aftsTrack->Phi();
11562 for(Int_t i4=0;i4<nPrim;i4++)
11564 if(i4==i1||i4==i2||i4==i3)continue;
11565 aftsTrack=anEvent->GetTrack(i4);
11566 if(!(aftsTrack->InRPSelection())) continue;
11567 phi4=aftsTrack->Phi();
11568 if(nPrim==4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush;
11569 // fill the profile with 4-p correlations:
11570 fIntFlowDirectCorrelations->Fill(10.,cos(n*phi1+n*phi2-n*phi3-n*phi4),1.); // <4>_{n,n|n,n}
11571 fIntFlowDirectCorrelations->Fill(11.,cos(2.*n*phi1+n*phi2-2.*n*phi3-n*phi4),1.); // <4>_{2n,n|2n,n}
11572 fIntFlowDirectCorrelations->Fill(12.,cos(2.*n*phi1+2*n*phi2-2.*n*phi3-2.*n*phi4),1.); // <4>_{2n,2n|2n,2n}
11573 fIntFlowDirectCorrelations->Fill(13.,cos(3.*n*phi1-n*phi2-n*phi3-n*phi4),1.); // <4>_{3n|n,n,n}
11574 fIntFlowDirectCorrelations->Fill(14.,cos(3.*n*phi1+n*phi2-3.*n*phi3-n*phi4),1.); // <4>_{3n,n|3n,n}
11575 fIntFlowDirectCorrelations->Fill(15.,cos(3.*n*phi1+n*phi2-2.*n*phi3-2.*n*phi4),1.); // <4>_{3n,n|2n,2n}
11576 fIntFlowDirectCorrelations->Fill(16.,cos(4.*n*phi1-2.*n*phi2-n*phi3-n*phi4),1.); // <4>_{4n|2n,n,n}
11577 fIntFlowDirectCorrelations->Fill(32.,cos(n*(4.*phi1+2.*phi2-3.*phi3-3.*phi4)),1.); // <4>_{4n,2n|3n,3n}
11578 fIntFlowDirectCorrelations->Fill(41.5,cos(n*(6.*phi1-3.*phi2-2.*phi3-1.*phi4)),1.); // <4>_{6n|3n,2n,1n}
11579 fIntFlowDirectCorrelations->Fill(42.5,cos(n*(3.*phi1+2.*phi2-3.*phi3-2.*phi4)),1.); // <4>_{3n,2n|3n,2n}
11580 fIntFlowDirectCorrelations->Fill(43.5,cos(n*(4.*phi1+1.*phi2-3.*phi3-2.*phi4)),1.); // <4>_{4n,1n|3n,2n}
11581 fIntFlowDirectCorrelations->Fill(44.5,cos(n*(3.*phi1+3.*phi2-3.*phi3-3.*phi4)),1.); // <4>_{3n,3n|3n,3n}
11582 fIntFlowDirectCorrelations->Fill(45.5,cos(n*(4.*phi1+2.*phi2-3.*phi3-3.*phi4)),1.); // <4>_{4n,2n|3n,3n}
11583 fIntFlowDirectCorrelations->Fill(46.5,cos(n*(5.*phi1+1.*phi2-3.*phi3-3.*phi4)),1.); // <4>_{5n,1n|3n,3n}
11584 fIntFlowDirectCorrelations->Fill(47.5,cos(n*(4.*phi1+2.*phi2-4.*phi3-2.*phi4)),1.); // <4>_{4n,2n|4n,2n}
11585 fIntFlowDirectCorrelations->Fill(48.5,cos(n*(5.*phi1+1.*phi2-4.*phi3-2.*phi4)),1.); // <4>_{5n,1n|4n,2n}
11586 fIntFlowDirectCorrelations->Fill(49.5,cos(n*(5.*phi1-3.*phi2-1.*phi3-1.*phi4)),1.); // <4>_{5n|3n,1n,1n}
11587 fIntFlowDirectCorrelations->Fill(50.5,cos(n*(5.*phi1-2.*phi2-2.*phi3-1.*phi4)),1.); // <4>_{5n|2n,2n,1n}
11588 fIntFlowDirectCorrelations->Fill(51.5,cos(n*(5.*phi1+1.*phi2-5.*phi3-1.*phi4)),1.); // <4>_{5n,1n|5n,1n}
11589 fIntFlowDirectCorrelations->Fill(58.5,cos(n*(6.*phi1-4.*phi2-1.*phi3-1.*phi4)),1.); // <4>_{6n|4n,1n,1n}
11590 fIntFlowDirectCorrelations->Fill(59.5,cos(n*(6.*phi1-2.*phi2-2.*phi3-2.*phi4)),1.); // <4>_{6n|2n,2n,2n}
11591 } // end of for(Int_t i4=0;i4<nPrim;i4++)
11592 } // end of for(Int_t i3=0;i3<nPrim;i3++)
11593 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11594 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11595 } // end of if(nPrim>=)
11597 // 5-particle correlations:
11598 if(nPrim>=5 && nPrim<=fMaxAllowedMultiplicity)
11600 for(Int_t i1=0;i1<nPrim;i1++)
11602 aftsTrack=anEvent->GetTrack(i1);
11603 if(!(aftsTrack->InRPSelection())) continue;
11604 phi1=aftsTrack->Phi();
11605 for(Int_t i2=0;i2<nPrim;i2++)
11607 if(i2==i1)continue;
11608 aftsTrack=anEvent->GetTrack(i2);
11609 if(!(aftsTrack->InRPSelection())) continue;
11610 phi2=aftsTrack->Phi();
11611 for(Int_t i3=0;i3<nPrim;i3++)
11613 if(i3==i1||i3==i2)continue;
11614 aftsTrack=anEvent->GetTrack(i3);
11615 if(!(aftsTrack->InRPSelection())) continue;
11616 phi3=aftsTrack->Phi();
11617 for(Int_t i4=0;i4<nPrim;i4++)
11619 if(i4==i1||i4==i2||i4==i3)continue;
11620 aftsTrack=anEvent->GetTrack(i4);
11621 if(!(aftsTrack->InRPSelection())) continue;
11622 phi4=aftsTrack->Phi();
11623 for(Int_t i5=0;i5<nPrim;i5++)
11625 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
11626 aftsTrack=anEvent->GetTrack(i5);
11627 if(!(aftsTrack->InRPSelection())) continue;
11628 phi5=aftsTrack->Phi();
11629 if(nPrim==5) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<"\r"<<flush;
11630 // fill the profile with 5-p correlations:
11631 fIntFlowDirectCorrelations->Fill(18.,cos(2.*n*phi1+n*phi2-n*phi3-n*phi4-n*phi5),1.); // <5>_{2n,n|n,n,n}
11632 fIntFlowDirectCorrelations->Fill(19.,cos(2.*n*phi1+2.*n*phi2-2.*n*phi3-n*phi4-n*phi5),1.); // <5>_{2n,2n|2n,n,n}
11633 fIntFlowDirectCorrelations->Fill(20.,cos(3.*n*phi1+n*phi2-2.*n*phi3-n*phi4-n*phi5),1.); // <5>_{3n,n|2n,n,n}
11634 fIntFlowDirectCorrelations->Fill(21.,cos(4.*n*phi1-n*phi2-n*phi3-n*phi4-n*phi5),1.); // <5>_{4n|n,n,n,n}
11635 fIntFlowDirectCorrelations->Fill(33.,cos(3.*n*phi1+3.*n*phi2-2.*n*phi3-2.*n*phi4-2.*n*phi5),1.); // <5>_{3n,3n|2n,2n,2n}
11636 fIntFlowDirectCorrelations->Fill(52.5,cos(3.*n*phi1+3.*n*phi2-3.*n*phi3-2.*n*phi4-1.*n*phi5),1.); // <5>_{3n,3n|3n,2n,1n}
11637 fIntFlowDirectCorrelations->Fill(53.5,cos(4.*n*phi1+2.*n*phi2-3.*n*phi3-2.*n*phi4-1.*n*phi5),1.); // <5>_{4n,2n|3n,2n,1n}
11638 fIntFlowDirectCorrelations->Fill(54.5,cos(3.*n*phi1+2.*n*phi2-3.*n*phi3-1.*n*phi4-1.*n*phi5),1.); // <5>_{3n,2n|3n,1n,1n}
11639 fIntFlowDirectCorrelations->Fill(55.5,cos(3.*n*phi1+2.*n*phi2-2.*n*phi3-2.*n*phi4-1.*n*phi5),1.); // <5>_{3n,2n|2n,2n,1n}
11640 fIntFlowDirectCorrelations->Fill(56.5,cos(5.*n*phi1+1.*n*phi2-3.*n*phi3-2.*n*phi4-1.*n*phi5),1.); // <5>_{5n,1n|3n,2n,1n}
11641 fIntFlowDirectCorrelations->Fill(60.5,cos(6.*n*phi1-2.*n*phi2-2.*n*phi3-1.*n*phi4-1.*n*phi5),1.); // <5>_{6n|2n,2n,1n,1n}
11642 fIntFlowDirectCorrelations->Fill(61.5,cos(4.*n*phi1+1.*n*phi2+1.*n*phi3-3.*n*phi4-3.*n*phi5),1.); // <5>_{4n,1n,1n|3n,3n}
11643 } // end of for(Int_t i5=0;i5<nPrim;i5++)
11644 } // end of for(Int_t i4=0;i4<nPrim;i4++)
11645 } // end of for(Int_t i3=0;i3<nPrim;i3++)
11646 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11647 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11648 } // end of if(nPrim>=5)
11650 // 6-particle correlations:
11651 if(nPrim>=6 && nPrim<=fMaxAllowedMultiplicity)
11653 for(Int_t i1=0;i1<nPrim;i1++)
11655 aftsTrack=anEvent->GetTrack(i1);
11656 if(!(aftsTrack->InRPSelection())) continue;
11657 phi1=aftsTrack->Phi();
11658 for(Int_t i2=0;i2<nPrim;i2++)
11660 if(i2==i1)continue;
11661 aftsTrack=anEvent->GetTrack(i2);
11662 if(!(aftsTrack->InRPSelection())) continue;
11663 phi2=aftsTrack->Phi();
11664 for(Int_t i3=0;i3<nPrim;i3++)
11666 if(i3==i1||i3==i2)continue;
11667 aftsTrack=anEvent->GetTrack(i3);
11668 if(!(aftsTrack->InRPSelection())) continue;
11669 phi3=aftsTrack->Phi();
11670 for(Int_t i4=0;i4<nPrim;i4++)
11672 if(i4==i1||i4==i2||i4==i3)continue;
11673 aftsTrack=anEvent->GetTrack(i4);
11674 if(!(aftsTrack->InRPSelection())) continue;
11675 phi4=aftsTrack->Phi();
11676 for(Int_t i5=0;i5<nPrim;i5++)
11678 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
11679 aftsTrack=anEvent->GetTrack(i5);
11680 if(!(aftsTrack->InRPSelection())) continue;
11681 phi5=aftsTrack->Phi();
11682 for(Int_t i6=0;i6<nPrim;i6++)
11684 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
11685 aftsTrack=anEvent->GetTrack(i6);
11686 if(!(aftsTrack->InRPSelection())) continue;
11687 phi6=aftsTrack->Phi();
11688 if(nPrim==6) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<"\r"<<flush;
11689 // fill the profile with 6-p correlations:
11690 fIntFlowDirectCorrelations->Fill(23.,cos(n*phi1+n*phi2+n*phi3-n*phi4-n*phi5-n*phi6),1.); // <6>_{1n,1n,1n|1n,1n,1n}
11691 fIntFlowDirectCorrelations->Fill(24.,cos(2.*n*phi1+n*phi2+n*phi3-2.*n*phi4-n*phi5-n*phi6),1.); // <6>_{2n,1n,1n|2n,1n,1n}
11692 fIntFlowDirectCorrelations->Fill(25.,cos(2.*n*phi1+2.*n*phi2-n*phi3-n*phi4-n*phi5-n*phi6),1.); // <6>_{2n,2n|1n,1n,1n,1n}
11693 fIntFlowDirectCorrelations->Fill(26.,cos(3.*n*phi1+n*phi2-n*phi3-n*phi4-n*phi5-n*phi6),1.); // <6>_{3n,1n|1n,1n,1n,1n}
11694 fIntFlowDirectCorrelations->Fill(57.5,cos(3.*n*phi1+2.*n*phi2+1.*n*phi3-3.*n*phi4-2.*n*phi5-1.*n*phi6),1.); // <6>_{3n,2n,1n|3n,2n,1n}
11695 fIntFlowDirectCorrelations->Fill(62.5,cos(3.*n*phi1+3.*n*phi2-2.*n*phi3-2.*n*phi4-1.*n*phi5-1.*n*phi6),1.); // <6>_{3n,3n|2n,2n,1n,1n}
11696 } // end of for(Int_t i6=0;i6<nPrim;i6++)
11697 } // end of for(Int_t i5=0;i5<nPrim;i5++)
11698 } // end of for(Int_t i4=0;i4<nPrim;i4++)
11699 } // end of for(Int_t i3=0;i3<nPrim;i3++)
11700 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11701 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11702 } // end of if(nPrim>=6)
11704 // 7-particle correlations:
11705 if(nPrim>=7 && nPrim<=fMaxAllowedMultiplicity)
11707 for(Int_t i1=0;i1<nPrim;i1++)
11709 aftsTrack=anEvent->GetTrack(i1);
11710 if(!(aftsTrack->InRPSelection())) continue;
11711 phi1=aftsTrack->Phi();
11712 for(Int_t i2=0;i2<nPrim;i2++)
11714 if(i2==i1)continue;
11715 aftsTrack=anEvent->GetTrack(i2);
11716 if(!(aftsTrack->InRPSelection())) continue;
11717 phi2=aftsTrack->Phi();
11718 for(Int_t i3=0;i3<nPrim;i3++)
11720 if(i3==i1||i3==i2)continue;
11721 aftsTrack=anEvent->GetTrack(i3);
11722 if(!(aftsTrack->InRPSelection())) continue;
11723 phi3=aftsTrack->Phi();
11724 for(Int_t i4=0;i4<nPrim;i4++)
11726 if(i4==i1||i4==i2||i4==i3)continue;
11727 aftsTrack=anEvent->GetTrack(i4);
11728 if(!(aftsTrack->InRPSelection())) continue;
11729 phi4=aftsTrack->Phi();
11730 for(Int_t i5=0;i5<nPrim;i5++)
11732 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
11733 aftsTrack=anEvent->GetTrack(i5);
11734 if(!(aftsTrack->InRPSelection())) continue;
11735 phi5=aftsTrack->Phi();
11736 for(Int_t i6=0;i6<nPrim;i6++)
11738 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
11739 aftsTrack=anEvent->GetTrack(i6);
11740 if(!(aftsTrack->InRPSelection())) continue;
11741 phi6=aftsTrack->Phi();
11742 for(Int_t i7=0;i7<nPrim;i7++)
11744 if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;
11745 aftsTrack=anEvent->GetTrack(i7);
11746 if(!(aftsTrack->InRPSelection())) continue;
11747 phi7=aftsTrack->Phi();
11748 if(nPrim==7) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<" "<<i7<<"\r"<<flush;
11749 // fill the profile with 7-p correlation:
11750 fIntFlowDirectCorrelations->Fill(28.,cos(2.*n*phi1+n*phi2+n*phi3-n*phi4-n*phi5-n*phi6-n*phi7),1.); // <7>_{2n,n,n|n,n,n,n}
11751 } // end of for(Int_t i7=0;i7<nPrim;i7++)
11752 } // end of for(Int_t i6=0;i6<nPrim;i6++)
11753 } // end of for(Int_t i5=0;i5<nPrim;i5++)
11754 } // end of for(Int_t i4=0;i4<nPrim;i4++)
11755 } // end of for(Int_t i3=0;i3<nPrim;i3++)
11756 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11757 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11758 } // end of if(nPrim>=7)
11760 // 8-particle correlations:
11761 if(nPrim>=8 && nPrim<=fMaxAllowedMultiplicity)
11763 for(Int_t i1=0;i1<nPrim;i1++)
11765 aftsTrack=anEvent->GetTrack(i1);
11766 if(!(aftsTrack->InRPSelection())) continue;
11767 phi1=aftsTrack->Phi();
11768 for(Int_t i2=0;i2<nPrim;i2++)
11770 if(i2==i1)continue;
11771 aftsTrack=anEvent->GetTrack(i2);
11772 if(!(aftsTrack->InRPSelection())) continue;
11773 phi2=aftsTrack->Phi();
11774 for(Int_t i3=0;i3<nPrim;i3++)
11776 if(i3==i1||i3==i2)continue;
11777 aftsTrack=anEvent->GetTrack(i3);
11778 if(!(aftsTrack->InRPSelection())) continue;
11779 phi3=aftsTrack->Phi();
11780 for(Int_t i4=0;i4<nPrim;i4++)
11782 if(i4==i1||i4==i2||i4==i3)continue;
11783 aftsTrack=anEvent->GetTrack(i4);
11784 if(!(aftsTrack->InRPSelection())) continue;
11785 phi4=aftsTrack->Phi();
11786 for(Int_t i5=0;i5<nPrim;i5++)
11788 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
11789 aftsTrack=anEvent->GetTrack(i5);
11790 if(!(aftsTrack->InRPSelection())) continue;
11791 phi5=aftsTrack->Phi();
11792 for(Int_t i6=0;i6<nPrim;i6++)
11794 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
11795 aftsTrack=anEvent->GetTrack(i6);
11796 if(!(aftsTrack->InRPSelection())) continue;
11797 phi6=aftsTrack->Phi();
11798 for(Int_t i7=0;i7<nPrim;i7++)
11800 if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;
11801 aftsTrack=anEvent->GetTrack(i7);
11802 if(!(aftsTrack->InRPSelection())) continue;
11803 phi7=aftsTrack->Phi();
11804 for(Int_t i8=0;i8<nPrim;i8++)
11806 if(i8==i1||i8==i2||i8==i3||i8==i4||i8==i5||i8==i6||i8==i7)continue;
11807 aftsTrack=anEvent->GetTrack(i8);
11808 if(!(aftsTrack->InRPSelection())) continue;
11809 phi8=aftsTrack->Phi();
11810 cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<" "<<i7<<" "<<i8<<"\r"<<flush;
11811 // fill the profile with 8-p correlation:
11812 fIntFlowDirectCorrelations->Fill(30.,cos(n*phi1+n*phi2+n*phi3+n*phi4-n*phi5-n*phi6-n*phi7-n*phi8),1.); // <8>_{n,n,n,n|n,n,n,n}
11813 } // end of for(Int_t i8=0;i8<nPrim;i8++)
11814 } // end of for(Int_t i7=0;i7<nPrim;i7++)
11815 } // end of for(Int_t i6=0;i6<nPrim;i6++)
11816 } // end of for(Int_t i5=0;i5<nPrim;i5++)
11817 } // end of for(Int_t i4=0;i4<nPrim;i4++)
11818 } // end of for(Int_t i3=0;i3<nPrim;i3++)
11819 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11820 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11821 } // end of if(nPrim>=8)
11825 } // end of AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoops(AliFlowEventSimple* anEvent)
11828 //==================================================================================================================================
11831 void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrelations()
11833 // Cross-check results for multiparticle correlations needed for int. flow: results from Q-vectors vs results from nested loops.
11837 cout<<" *****************************************"<<endl;
11838 cout<<" **** cross-checking the correlations ****"<<endl;
11839 cout<<" **** for integrated flow ****"<<endl;
11840 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
11842 cout<<" **** (particle weights not used) ****"<<endl;
11845 cout<<" **** (particle weights used) ****"<<endl;
11847 cout<<" *****************************************"<<endl;
11851 Int_t ciMax = 64; // to be improved (removed eventually when I calculate 6th and 8th order with particle weights)
11853 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights)
11858 for(Int_t ci=1;ci<=ciMax;ci++)
11860 if(strcmp((fIntFlowCorrelationsAllPro->GetXaxis())->GetBinLabel(ci), "") == 0) continue; // to be improved (access finalized histogram here)
11861 cout<<(fIntFlowCorrelationsAllPro->GetXaxis())->GetBinLabel(ci)<<":"<<endl; // to be improved (access finalized histogram here)
11862 cout<<"from Q-vectors = "<<fIntFlowCorrelationsAllPro->GetBinContent(ci)<<endl; // to be improved (access finalized histogram here)
11863 cout<<"from nested loops = "<<fIntFlowDirectCorrelations->GetBinContent(ci)<<endl;
11867 } // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrelations()
11869 //================================================================================================================================
11871 void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrectionTermsForNUA()
11873 // Cross-check results for corrections terms for non-uniform acceptance needed for int. flow: results from Q-vectors vs results from nested loops.
11877 cout<<" *********************************************"<<endl;
11878 cout<<" **** cross-checking the correction terms ****"<<endl;
11879 cout<<" **** for non-uniform acceptance relevant ****"<<endl;
11880 cout<<" **** for integrated flow ****"<<endl;
11881 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
11883 cout<<" **** (particle weights not used) ****"<<endl;
11886 cout<<" **** (particle weights used) ****"<<endl;
11888 cout<<" *********************************************"<<endl;
11892 for(Int_t ci=1;ci<=4;ci++) // correction term index (to be improved - hardwired 4)
11894 for(Int_t sc=0;sc<2;sc++) // sin or cos term
11896 if(strcmp((fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->GetBinLabel(ci), "") == 0) continue; // to be improved (access finalized histogram here)
11897 cout<<(fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->GetBinLabel(ci)<<":"<<endl; // to be improved (access finalized histogram here)
11898 cout<<"from Q-vectors = "<<fIntFlowCorrectionTermsForNUAPro[sc]->GetBinContent(ci)<<endl; // to be improved (access finalized histogram here)
11899 cout<<"from nested loops = "<<fIntFlowDirectCorrectionTermsForNUA[sc]->GetBinContent(ci)<<endl;
11901 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos term
11902 } // end of for(Int_t ci=1;ci<=10;ci++) // correction term index
11904 } // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrectionTermsForNUA()
11906 //================================================================================================================================
11908 void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent)
11910 // Evaluate with nested loops multiparticle correlations for integrated flow (using the particle weights).
11912 // Results are stored in profile fIntFlowDirectCorrelations.
11913 // Remark 1: When particle weights are used the binning of fIntFlowDirectCorrelations is organized as follows:
11915 // 1st bin: <2>_{1n|1n} = two1n1nW1W1 = <w1 w2 cos(n*(phi1-phi2))>
11916 // 2nd bin: <2>_{2n|2n} = two2n2nW2W2 = <w1^2 w2^2 cos(2n*(phi1-phi2))>
11917 // 3rd bin: <2>_{3n|3n} = two3n3nW3W3 = <w1^3 w2^3 cos(3n*(phi1-phi2))>
11918 // 4th bin: <2>_{4n|4n} = two4n4nW4W4 = <w1^4 w2^4 cos(4n*(phi1-phi2))>
11919 // 5th bin: ---- EMPTY ----
11920 // 6th bin: <3>_{2n|1n,1n} = three2n1n1nW2W1W1 = <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
11921 // 7th bin: <3>_{3n|2n,1n} = ...
11922 // 8th bin: <3>_{4n|2n,2n} = ...
11923 // 9th bin: <3>_{4n|3n,1n} = ...
11924 // 10th bin: ---- EMPTY ----
11925 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1nW1W1W1W1 = <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
11926 // 12th bin: <4>_{2n,1n|2n,1n} = ...
11927 // 13th bin: <4>_{2n,2n|2n,2n} = ...
11928 // 14th bin: <4>_{3n|1n,1n,1n} = ...
11929 // 15th bin: <4>_{3n,1n|3n,1n} = ...
11930 // 16th bin: <4>_{3n,1n|2n,2n} = ...
11931 // 17th bin: <4>_{4n|2n,1n,1n} = ...
11932 // 18th bin: ---- EMPTY ----
11933 // 19th bin: <5>_{2n|1n,1n,1n,1n} = ...
11934 // 20th bin: <5>_{2n,2n|2n,1n,1n} = ...
11935 // 21st bin: <5>_{3n,1n|2n,1n,1n} = ...
11936 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = ...
11937 // 23rd bin: ---- EMPTY ----
11938 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = ...
11939 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = ...
11940 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = ...
11941 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = ...
11942 // 28th bin: ---- EMPTY ----
11943 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = ...
11944 // 30th bin: ---- EMPTY ----
11945 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = ...
11947 // Remark 2: When particle weights are used there are some extra correlations. They are stored in
11948 // fIntFlowExtraDirectCorrelations binning of which is organized as follows:
11950 // 1st bin: two1n1nW3W1 = <w1^3 w2 cos(n*(phi1-phi2))>
11951 // 2nd bin: two1n1nW1W1W2 = <w1 w2 w3^2 cos(n*(phi1-phi2))>
11954 Int_t nPrim = anEvent->NumberOfTracks();
11955 AliFlowTrackSimple *aftsTrack = NULL;
11956 //Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
11957 //Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1., wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
11958 Double_t phi1=0., phi2=0., phi3=0., phi4=0.;
11959 Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1.;
11960 Int_t n = fHarmonic;
11961 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
11962 Double_t dMult = (*fSpk)(0,0);
11964 cout<<"Multiparticle correlations: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
11967 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
11968 } else if (dMult>fMaxAllowedMultiplicity)
11970 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
11973 cout<<"... evaluating nested loops (using particle weights) ..."<<endl;
11976 // 2-particle correlations:
11977 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
11979 // 2 nested loops multiparticle correlations using particle weights:
11980 for(Int_t i1=0;i1<nPrim;i1++)
11982 aftsTrack=anEvent->GetTrack(i1);
11983 if(!(aftsTrack->InRPSelection())) continue;
11984 phi1=aftsTrack->Phi();
11985 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
11986 for(Int_t i2=0;i2<nPrim;i2++)
11988 if(i2==i1)continue;
11989 aftsTrack=anEvent->GetTrack(i2);
11990 if(!(aftsTrack->InRPSelection())) continue;
11991 phi2=aftsTrack->Phi();
11992 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
11993 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
11994 // 2-p correlations using particle weights:
11995 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),wPhi1*wPhi2); // <w1 w2 cos( n*(phi1-phi2))>
11996 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(1.5,cos(2.*n*(phi1-phi2)),pow(wPhi1,2)*pow(wPhi2,2)); // <w1^2 w2^2 cos(2n*(phi1-phi2))>
11997 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(2.5,cos(3.*n*(phi1-phi2)),pow(wPhi1,3)*pow(wPhi2,3)); // <w1^3 w2^3 cos(3n*(phi1-phi2))>
11998 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(3.5,cos(4.*n*(phi1-phi2)),pow(wPhi1,4)*pow(wPhi2,4)); // <w1^4 w2^4 cos(4n*(phi1-phi2))>
11999 // extra correlations:
12000 // 2-p extra correlations (do not appear if particle weights are not used):
12001 if(fUsePhiWeights) fIntFlowExtraDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),pow(wPhi1,3)*wPhi2); // <w1^3 w2 cos(n*(phi1-phi2))>
12003 } // end of for(Int_t i2=0;i2<nPrim;i2++)
12004 } // end of for(Int_t i1=0;i1<nPrim;i1++)
12005 } // end of if(nPrim>=2)
12007 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
12009 // 3 nested loops multiparticle correlations using particle weights:
12010 for(Int_t i1=0;i1<nPrim;i1++)
12012 aftsTrack=anEvent->GetTrack(i1);
12013 if(!(aftsTrack->InRPSelection())) continue;
12014 phi1=aftsTrack->Phi();
12015 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
12016 for(Int_t i2=0;i2<nPrim;i2++)
12018 if(i2==i1)continue;
12019 aftsTrack=anEvent->GetTrack(i2);
12020 if(!(aftsTrack->InRPSelection())) continue;
12021 phi2=aftsTrack->Phi();
12022 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
12023 for(Int_t i3=0;i3<nPrim;i3++)
12025 if(i3==i1||i3==i2)continue;
12026 aftsTrack=anEvent->GetTrack(i3);
12027 if(!(aftsTrack->InRPSelection())) continue;
12028 phi3=aftsTrack->Phi();
12029 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
12030 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;
12031 // 3-p correlations using particle weights:
12032 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(5.5,cos(2.*n*phi1-n*(phi2+phi3)),pow(wPhi1,2)*wPhi2*wPhi3); // <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
12034 // extra correlations:
12035 // 2-p extra correlations (do not appear if particle weights are not used):
12036 if(fUsePhiWeights) fIntFlowExtraDirectCorrelations->Fill(1.5,cos(n*(phi1-phi2)),wPhi1*wPhi2*pow(wPhi3,2)); // <w1 w2 w3^2 cos(n*(phi1-phi2))>
12038 // 3-p extra correlations (do not appear if particle weights are not used):
12040 } // end of for(Int_t i3=0;i3<nPrim;i3++)
12041 } // end of for(Int_t i2=0;i2<nPrim;i2++)
12042 } // end of for(Int_t i1=0;i1<nPrim;i1++)
12043 } // end of if(nPrim>=3)
12045 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)
12047 // 4 nested loops multiparticle correlations using particle weights:
12048 for(Int_t i1=0;i1<nPrim;i1++)
12050 aftsTrack=anEvent->GetTrack(i1);
12051 if(!(aftsTrack->InRPSelection())) continue;
12052 phi1=aftsTrack->Phi();
12053 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
12054 for(Int_t i2=0;i2<nPrim;i2++)
12056 if(i2==i1)continue;
12057 aftsTrack=anEvent->GetTrack(i2);
12058 if(!(aftsTrack->InRPSelection())) continue;
12059 phi2=aftsTrack->Phi();
12060 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
12061 for(Int_t i3=0;i3<nPrim;i3++)
12063 if(i3==i1||i3==i2)continue;
12064 aftsTrack=anEvent->GetTrack(i3);
12065 if(!(aftsTrack->InRPSelection())) continue;
12066 phi3=aftsTrack->Phi();
12067 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
12068 for(Int_t i4=0;i4<nPrim;i4++)
12070 if(i4==i1||i4==i2||i4==i3)continue;
12071 aftsTrack=anEvent->GetTrack(i4);
12072 if(!(aftsTrack->InRPSelection())) continue;
12073 phi4=aftsTrack->Phi();
12074 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
12075 if(nPrim>=4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush; // to be improved (replace eventually this if statement with if(nPrim==4))
12076 // 4-p correlations using particle weights:
12077 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(10.5,cos(n*phi1+n*phi2-n*phi3-n*phi4),wPhi1*wPhi2*wPhi3*wPhi4);
12078 // extra correlations:
12079 // 2-p extra correlations (do not appear if particle weights are not used):
12081 // 3-p extra correlations (do not appear if particle weights are not used):
12083 // 4-p extra correlations (do not appear if particle weights are not used):
12085 } // end of for(Int_t i4=0;i4<nPrim;i4++)
12086 } // end of for(Int_t i3=0;i3<nPrim;i3++)
12087 } // end of for(Int_t i2=0;i2<nPrim;i2++)
12088 } // end of for(Int_t i1=0;i1<nPrim;i1++)
12089 } // end of if(nPrim>=4)
12093 } // end of void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent)
12095 //================================================================================================================================
12097 void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowExtraCorrelations()
12099 // Cross-check results for extra multiparticle correlations needed for int. flow
12100 // which appear only when particle weights are used: results from Q-vectors vs results from nested loops.
12104 cout<<" ***********************************************"<<endl;
12105 cout<<" **** cross-checking the extra correlations ****"<<endl;
12106 cout<<" **** for integrated flow ****"<<endl;
12107 cout<<" ***********************************************"<<endl;
12111 for(Int_t eci=1;eci<=2;eci++) // to be improved (increased eciMax eventually when I calculate 6th and 8th)
12113 if(strcmp((fIntFlowExtraCorrelationsPro->GetXaxis())->GetBinLabel(eci), "") == 0) continue;
12114 cout<<(fIntFlowExtraCorrelationsPro->GetXaxis())->GetBinLabel(eci)<<":"<<endl;
12115 cout<<"from Q-vectors = "<<fIntFlowExtraCorrelationsPro->GetBinContent(eci)<<endl;
12116 cout<<"from nested loops = "<<fIntFlowExtraDirectCorrelations->GetBinContent(eci)<<endl;
12120 } // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowExtraCorrelations()
12122 //================================================================================================================================
12124 void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoops(AliFlowEventSimple * const anEvent)
12126 // Evaluate with nested loops correction terms for non-uniform acceptance relevant for NONAME integrated flow (to be improved (name)).
12128 // Remark: Both sin and cos correction terms are calculated in this method. Sin terms are stored in fIntFlowDirectCorrectionTermsForNUA[0],
12129 // and cos terms in fIntFlowDirectCorrectionTermsForNUA[1]. Binning of fIntFlowDirectCorrectionTermsForNUA[sc] is organized as follows
12130 // (sc stands for either sin or cos):
12132 // 1st bin: <<sc(n*(phi1))>>
12133 // 2nd bin: <<sc(n*(phi1+phi2))>>
12134 // 3rd bin: <<sc(n*(phi1-phi2-phi3))>>
12135 // 4th bin: <<sc(n*(2phi1-phi2))>>
12137 Int_t nPrim = anEvent->NumberOfTracks();
12138 AliFlowTrackSimple *aftsTrack = NULL;
12139 Double_t phi1=0., phi2=0., phi3=0.;
12140 Int_t n = fHarmonic;
12141 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
12142 Double_t dMult = (*fSpk)(0,0);
12144 cout<<"Correction terms for non-uniform acceptance: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
12147 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
12148 } else if (dMult>fMaxAllowedMultiplicity)
12150 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
12153 cout<<"... evaluating nested loops (without using particle weights)..."<<endl;
12156 if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)
12158 // 1-particle correction terms for non-uniform acceptance:
12159 for(Int_t i1=0;i1<nPrim;i1++)
12161 aftsTrack=anEvent->GetTrack(i1);
12162 if(!(aftsTrack->InRPSelection())) continue;
12163 phi1=aftsTrack->Phi();
12164 if(nPrim==1) cout<<i1<<"\r"<<flush;
12166 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(0.5,sin(n*phi1),1.); // <sin(n*phi1)>
12168 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(0.5,cos(n*phi1),1.); // <cos(n*phi1)>
12169 } // end of for(Int_t i1=0;i1<nPrim;i1++)
12170 } // end of if(nPrim>=1)
12172 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
12174 // 2-particle correction terms for non-uniform acceptance:
12175 for(Int_t i1=0;i1<nPrim;i1++)
12177 aftsTrack=anEvent->GetTrack(i1);
12178 if(!(aftsTrack->InRPSelection())) continue;
12179 phi1=aftsTrack->Phi();
12180 for(Int_t i2=0;i2<nPrim;i2++)
12182 if(i2==i1)continue;
12183 aftsTrack=anEvent->GetTrack(i2);
12184 if(!(aftsTrack->InRPSelection())) continue;
12185 phi2=aftsTrack->Phi();
12186 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
12188 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(1.5,sin(n*(phi1+phi2)),1.); // <<sin(n*(phi1+phi2))>>
12189 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(3.5,sin(n*(2*phi1-phi2)),1.); // <<sin(n*(2*phi1-phi2))>>
12191 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(1.5,cos(n*(phi1+phi2)),1.); // <<cos(n*(phi1+phi2))>>
12192 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(3.5,cos(n*(2*phi1-phi2)),1.); // <<cos(n*(2*phi1-phi2))>>
12193 } // end of for(Int_t i2=0;i2<nPrim;i2++)
12194 } // end of for(Int_t i1=0;i1<nPrim;i1++)
12195 } // end of if(nPrim>=2)
12197 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
12199 // 3-particle correction terms for non-uniform acceptance:
12200 for(Int_t i1=0;i1<nPrim;i1++)
12202 aftsTrack=anEvent->GetTrack(i1);
12203 if(!(aftsTrack->InRPSelection())) continue;
12204 phi1=aftsTrack->Phi();
12205 for(Int_t i2=0;i2<nPrim;i2++)
12207 if(i2==i1)continue;
12208 aftsTrack=anEvent->GetTrack(i2);
12209 if(!(aftsTrack->InRPSelection())) continue;
12210 phi2=aftsTrack->Phi();
12211 for(Int_t i3=0;i3<nPrim;i3++)
12213 if(i3==i1||i3==i2)continue;
12214 aftsTrack=anEvent->GetTrack(i3);
12215 if(!(aftsTrack->InRPSelection())) continue;
12216 phi3=aftsTrack->Phi();
12217 if(nPrim>=3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush; // to be improved (eventually I will change this if statement)
12219 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(2.5,sin(n*(phi1-phi2-phi3)),1.); // <<sin(n*(phi1-phi2-phi3))>>
12221 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(2.5,cos(n*(phi1-phi2-phi3)),1.); // <<cos(n*(phi1-phi2-phi3))>>
12222 } // end of for(Int_t i3=0;i3<nPrim;i3++)
12223 } // end of for(Int_t i2=0;i2<nPrim;i2++)
12224 } // end of for(Int_t i1=0;i1<nPrim;i1++)
12225 } // end of if(nPrim>=3)
12230 //================================================================================================================================
12232 void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoops(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
12234 // Evaluate reduced correlations with nested loops without using the particle weights.
12236 // Remark 1: Reduced correlations are evaluated in pt bin number fCrossCheckInPtBinNo and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
12237 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrelations[t][pe][ci], where indices runs as follows:
12238 // [0=RP,1=POI][0=Pt,1=Eta][0=<2'>,1=<4'>,2=<6'>,3=<8'>]
12239 // Remark 3: <2'> = <cos(n*(psi1-phi2))>
12240 // <4'> = <cos(n*(psi1+phi2-phi3-phi4))>
12243 Int_t typeFlag = 0;
12244 Int_t ptEtaFlag = 0;
12248 } else if(type == "POI")
12252 if(ptOrEta == "Pt")
12255 } else if(ptOrEta == "Eta")
12260 Int_t t = typeFlag;
12261 Int_t pe = ptEtaFlag;
12263 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
12264 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
12265 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
12267 Int_t nPrim = anEvent->NumberOfTracks();
12268 AliFlowTrackSimple *aftsTrack = NULL;
12270 Double_t psi1=0., phi2=0., phi3=0., phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
12272 Int_t n = fHarmonic;
12274 // 2'-particle correlations:
12275 for(Int_t i1=0;i1<nPrim;i1++)
12277 aftsTrack=anEvent->GetTrack(i1);
12278 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12279 if(typeFlag==1) // this is diff flow of POIs
12281 if(ptOrEta == "Pt")
12283 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12284 } else if (ptOrEta == "Eta")
12286 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12288 } else // this is diff flow of RPs
12290 if(ptOrEta == "Pt")
12292 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12293 } else if (ptOrEta == "Eta")
12295 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12299 psi1=aftsTrack->Phi();
12300 for(Int_t i2=0;i2<nPrim;i2++)
12302 if(i2==i1)continue;
12303 aftsTrack=anEvent->GetTrack(i2);
12304 // RP condition (!(first) particle in the correlator must be RP):
12305 if(!(aftsTrack->InRPSelection()))continue;
12306 phi2=aftsTrack->Phi();
12307 // 2'-particle correlations:
12308 fDiffFlowDirectCorrelations[t][pe][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(1.*n*(psi1-phi2)),1.); // <cos(n*(psi1-phi2))
12309 }//end of for(Int_t i2=0;i2<nPrim;i2++)
12310 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12314 // 3'-particle correlations:
12315 for(Int_t i1=0;i1<nPrim;i1++)
12317 aftsTrack=anEvent->GetTrack(i1);
12318 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12319 if(ptOrEta == "Pt")
12321 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12322 } else if (ptOrEta == "Eta")
12324 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12326 psi1=aftsTrack->Phi();
12327 for(Int_t i2=0;i2<nPrim;i2++)
12329 if(i2==i1)continue;
12330 aftsTrack=anEvent->GetTrack(i2);
12331 // RP condition (!(first) particle in the correlator must be RP):
12332 if(!(aftsTrack->InRPSelection())) continue;
12333 phi2=aftsTrack->Phi();
12334 for(Int_t i3=0;i3<nPrim;i3++)
12336 if(i3==i1||i3==i2)continue;
12337 aftsTrack=anEvent->GetTrack(i3);
12338 // RP condition (!(first) particle in the correlator must be RP):
12339 if(!(aftsTrack->InRPSelection())) continue;
12340 phi3=aftsTrack->Phi();
12341 // to be improved : where to store it? ->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(2.*phi1-phi2-phi3)),1.); // <w1 w2 w3 cos(n(2psi1-phi2-phi3))>
12342 }//end of for(Int_t i3=0;i3<nPrim;i3++)
12343 }//end of for(Int_t i2=0;i2<nPrim;i2++)
12344 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12348 // 4'-particle correlations:
12349 for(Int_t i1=0;i1<nPrim;i1++)
12351 aftsTrack=anEvent->GetTrack(i1);
12352 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12353 if(typeFlag==1) // this is diff flow of POIs
12355 if(ptOrEta == "Pt")
12357 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12358 } else if (ptOrEta == "Eta")
12360 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12362 } else // this is diff flow of RPs
12364 if(ptOrEta == "Pt")
12366 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12367 } else if (ptOrEta == "Eta")
12369 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12373 psi1=aftsTrack->Phi();
12374 for(Int_t i2=0;i2<nPrim;i2++)
12376 if(i2==i1) continue;
12377 aftsTrack=anEvent->GetTrack(i2);
12378 // RP condition (!(first) particle in the correlator must be RP):
12379 if(!(aftsTrack->InRPSelection())) continue;
12380 phi2=aftsTrack->Phi();
12381 for(Int_t i3=0;i3<nPrim;i3++)
12383 if(i3==i1||i3==i2) continue;
12384 aftsTrack=anEvent->GetTrack(i3);
12385 // RP condition (!(first) particle in the correlator must be RP):
12386 if(!(aftsTrack->InRPSelection())) continue;
12387 phi3=aftsTrack->Phi();
12388 for(Int_t i4=0;i4<nPrim;i4++)
12390 if(i4==i1||i4==i2||i4==i3) continue;
12391 aftsTrack=anEvent->GetTrack(i4);
12392 // RP condition (!(first) particle in the correlator must be RP):
12393 if(!(aftsTrack->InRPSelection())) continue;
12394 phi4=aftsTrack->Phi();
12395 // 4'-particle correlations:
12396 fDiffFlowDirectCorrelations[t][pe][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3-phi4)),1.); // <cos(n(psi1+phi2-phi3-phi4))>
12397 }//end of for(Int_t i4=0;i4<nPrim;i4++)
12398 }//end of for(Int_t i3=0;i3<nPrim;i3++)
12399 }//end of for(Int_t i2=0;i2<nPrim;i2++)
12400 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12402 // count # of RPs and POIs in selected pt and eta bins for cross-checkings:
12403 for(Int_t i=0;i<nPrim;i++)
12405 aftsTrack=anEvent->GetTrack(i);
12406 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12407 if(typeFlag==1) // this is diff flow of POIs
12409 if(ptOrEta == "Pt")
12411 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12412 } else if (ptOrEta == "Eta")
12414 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12416 } else // this is diff flow of RPs
12418 if(ptOrEta == "Pt")
12420 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12421 } else if (ptOrEta == "Eta")
12423 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12427 fNoOfParticlesInBin->Fill(t+pe+0.5);
12430 } // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoops(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
12432 //================================================================================================================================
12434 void AliFlowAnalysisWithQCumulants::EvaluateOtherDiffCorrelatorsWithNestedLoops(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
12436 // Evaluate other differential correlators with nested loops without using the particle weights.
12438 // Remark 1: Other differential correlators are evaluated in pt bin number fCrossCheckInPtBinNo
12439 // and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
12440 // Remark 2: Results are stored in 1 bin profiles fOtherDirectDiffCorrelators[t][pe][sc][ci], where indices runs as follows:
12441 // [0=RP,1=POI][0=Pt,1=Eta][0=sin terms,1=cos terms][ci = correlator index]
12442 // Remark 3: Correlator index 'ci' runs as follows:
12443 // 0: <exp(n*(psi1-3phi2+2phi3))> (Teaney-Yan correlator)
12445 Int_t typeFlag = 0;
12446 Int_t ptEtaFlag = 0;
12450 } else if(type == "POI")
12454 if(ptOrEta == "Pt")
12457 } else if(ptOrEta == "Eta")
12462 Int_t t = typeFlag;
12463 Int_t pe = ptEtaFlag;
12465 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
12466 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
12467 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
12469 Int_t nPrim = anEvent->NumberOfTracks();
12470 AliFlowTrackSimple *aftsTrack = NULL;
12472 Double_t psi1=0., phi2=0., phi3=0.;
12474 Int_t n = fHarmonic;
12476 // 3-p correlators:
12477 for(Int_t i1=0;i1<nPrim;i1++)
12479 aftsTrack=anEvent->GetTrack(i1);
12480 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12481 if(typeFlag==1) // this is diff flow of POIs
12483 if(ptOrEta == "Pt")
12485 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12486 } else if (ptOrEta == "Eta")
12488 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12490 } else // this is diff flow of RPs
12492 if(ptOrEta == "Pt")
12494 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12495 } else if (ptOrEta == "Eta")
12497 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12500 psi1=aftsTrack->Phi();
12501 for(Int_t i2=0;i2<nPrim;i2++)
12503 if(i2==i1) continue;
12504 aftsTrack=anEvent->GetTrack(i2);
12505 // RP condition (!(first) particle in the correlator must be RP):
12506 if(!(aftsTrack->InRPSelection())) continue;
12507 phi2=aftsTrack->Phi();
12508 for(Int_t i3=0;i3<nPrim;i3++)
12510 if(i3==i1||i3==i2) continue;
12511 aftsTrack=anEvent->GetTrack(i3);
12512 // RP condition (!(first) particle in the correlator must be RP):
12513 if(!(aftsTrack->InRPSelection())) continue;
12514 phi3=aftsTrack->Phi();
12515 // Fill 3-p correlators:
12516 fOtherDirectDiffCorrelators[t][pe][1][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1-3.*phi2+2.*phi3)),1.); // <cos(n(psi1-3.*phi2+2.*phi3))>
12517 }//end of for(Int_t i3=0;i3<nPrim;i3++)
12518 }//end of for(Int_t i2=0;i2<nPrim;i2++)
12519 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12520 } // end of void AliFlowAnalysisWithQCumulants::EvaluateOtherDiffCorrelatorsWithNestedLoops(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
12522 //================================================================================================================================
12524 void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrelations(TString type, TString ptOrEta)
12526 // Compare correlations needed for diff. flow calculated with nested loops and those calculated from Q-vectors
12528 Int_t typeFlag = 0;
12529 Int_t ptEtaFlag = 0;
12533 } else if(type == "POI")
12537 if(ptOrEta == "Pt")
12540 } else if(ptOrEta == "Eta")
12545 Int_t t = typeFlag;
12546 Int_t pe = ptEtaFlag;
12548 TString rpORpoiString[2] = {"RP ","POI"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
12549 TString ptORetaString[2] = {"pt","eta"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
12550 TString reducedCorrelations[4] = {"<<cos(n(psi1-phi2))>>","<<cos(n(psi1+phi2-phi3-phi4))>>","",""}; // to be improved (access this from pro or hist)
12551 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
12552 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
12554 Int_t crossCheckInPtEtaBinNo[2] = {fCrossCheckInPtBinNo,fCrossCheckInEtaBinNo};
12558 cout<<" *****************************************"<<endl;
12559 cout<<" **** cross-checking the correlations ****"<<endl;
12560 cout<<" **** for differential flow ("<<rpORpoiString[t]<<") ****"<<endl;
12561 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
12563 cout<<" **** (particle weights not used) ****"<<endl;
12566 cout<<" **** (particle weights used) ****"<<endl;
12568 cout<<" *****************************************"<<endl;
12570 cout<<" "<<ptORetaString[pe]<<" bin: "<<lowerPtEtaEdge[pe]<<" <= "<<ptORetaString[pe]<<" < "<<upperPtEtaEdge[pe]<<endl;
12573 for(Int_t rci=0;rci<2;rci++) // to be improved (calculate 6th and 8th order)
12575 cout<<" "<<reducedCorrelations[rci].Data()<<":"<<endl;
12576 cout<<" from Q-vectors = "<<fDiffFlowCorrelationsPro[t][pe][rci]->GetBinContent(crossCheckInPtEtaBinNo[pe])<<endl;
12577 cout<<" from nested loops = "<<fDiffFlowDirectCorrelations[t][pe][rci]->GetBinContent(1)<<endl;
12579 } // end of for(Int_t rci=0;rci<4;rci++)
12581 } // end of void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrelations(TString type, TString ptOrEta)
12583 //================================================================================================================================
12585 void AliFlowAnalysisWithQCumulants::CrossCheckOtherDiffCorrelators(TString type, TString ptOrEta)
12587 // Compare correlations needed for diff. flow calculated with nested loops and those calculated from Q-vectors
12589 Int_t typeFlag = 0;
12590 Int_t ptEtaFlag = 0;
12594 } else if(type == "POI")
12598 if(ptOrEta == "Pt")
12601 } else if(ptOrEta == "Eta")
12606 Int_t t = typeFlag;
12607 Int_t pe = ptEtaFlag;
12609 TString rpORpoiString[2] = {"RP ","POI"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
12610 TString ptORetaString[2] = {"pt","eta"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
12611 TString otherCorrelators[1] = {"<<cos(n(psi1-3phi2+2phi3))>>"}; // to be improved (access this from pro or hist)
12612 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
12613 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
12615 Int_t crossCheckInPtEtaBinNo[2] = {fCrossCheckInPtBinNo,fCrossCheckInEtaBinNo};
12618 cout<<" *****************************************"<<endl;
12619 cout<<" **** cross-checking the other ****"<<endl;
12620 cout<<" **** diff. correlators ("<<rpORpoiString[t]<<") ****"<<endl;
12621 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
12623 cout<<" **** (particle weights not used) ****"<<endl;
12626 cout<<" **** (particle weights used) ****"<<endl;
12628 cout<<" *****************************************"<<endl;
12630 cout<<" "<<ptORetaString[pe]<<" bin: "<<lowerPtEtaEdge[pe]<<" <= "<<ptORetaString[pe]<<" < "<<upperPtEtaEdge[pe]<<endl;
12633 for(Int_t ci=0;ci<1;ci++)
12635 cout<<" "<<otherCorrelators[ci].Data()<<":"<<endl;
12636 cout<<" from Q-vectors = "<<fOtherDiffCorrelators[t][pe][1][ci]->GetBinContent(crossCheckInPtEtaBinNo[pe])<<endl;
12637 cout<<" from nested loops = "<<fOtherDirectDiffCorrelators[t][pe][1][ci]->GetBinContent(1)<<endl;
12639 } // end of for(Int_t ci=0;ci<1;ci++)
12641 } // end of void AliFlowAnalysisWithQCumulants::CrossCheckOtherDiffCorrelators(TString type, TString ptOrEta)
12643 //================================================================================================================================
12645 void AliFlowAnalysisWithQCumulants::PrintNumberOfParticlesInSelectedBin()
12647 // Print on the screen number of RPs and POIs in selected pt and eta bin for cross checkings.
12650 cout<<"Number of RPs in selected pt bin = "<<fNoOfParticlesInBin->GetBinContent(1)<<endl;
12651 cout<<"Number of RPs in selected eta bin = "<<fNoOfParticlesInBin->GetBinContent(2)<<endl;
12652 cout<<"Number of POIs in selected pt bin = "<<fNoOfParticlesInBin->GetBinContent(3)<<endl;
12653 cout<<"Number of POIs in selected eta bin = "<<fNoOfParticlesInBin->GetBinContent(4)<<endl;
12655 } // end of void AliFlowAnalysisWithQCumulants::PrintNumberOfParticlesInSelectedBin()
12657 //================================================================================================================================
12659 void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
12661 // Evaluate reduced correlations with nested loops without using the particle weights.
12663 // Remark 1: Reduced correlations are evaluated in pt bin number fCrossCheckInPtBinNo and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
12664 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrelations[t][pe][ci], where indices runs as follows:
12665 // [0=RP,1=POI][0=Pt,1=Eta][0=<2'>,1=<4'>,2=<6'>,3=<8'>]
12666 // Remark 3: <2'> = <w2 cos(n*(psi1-phi2))>
12667 // <4'> = <w2 w3 w4 cos(n*(psi1+phi2-phi3-phi4))>
12670 Int_t typeFlag = 0;
12671 Int_t ptEtaFlag = 0;
12675 } else if(type == "POI")
12679 if(ptOrEta == "Pt")
12682 } else if(ptOrEta == "Eta")
12687 Int_t t = typeFlag;
12688 Int_t pe = ptEtaFlag;
12690 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
12691 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
12692 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
12694 Int_t nPrim = anEvent->NumberOfTracks();
12695 AliFlowTrackSimple *aftsTrack = NULL;
12697 Double_t psi1=0., phi2=0., phi3=0., phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
12698 Double_t wPhi2=1., wPhi3=1., wPhi4=1.;// wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
12700 Int_t n = fHarmonic;
12702 // 2'-particle correlations:
12703 for(Int_t i1=0;i1<nPrim;i1++)
12705 aftsTrack=anEvent->GetTrack(i1);
12706 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12707 if(typeFlag==1) // this is diff flow of POIs
12709 if(ptOrEta == "Pt")
12711 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12712 } else if (ptOrEta == "Eta")
12714 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12716 } else // this is diff flow of RPs
12718 if(ptOrEta == "Pt")
12720 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12721 } else if (ptOrEta == "Eta")
12723 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12726 psi1=aftsTrack->Phi();
12727 for(Int_t i2=0;i2<nPrim;i2++)
12729 if(i2==i1) continue;
12730 aftsTrack=anEvent->GetTrack(i2);
12731 // RP condition (!(first) particle in the correlator must be RP):
12732 if(!(aftsTrack->InRPSelection())) continue;
12733 phi2=aftsTrack->Phi();
12734 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
12735 // 2'-particle correlations:
12736 fDiffFlowDirectCorrelations[t][pe][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(1.*n*(psi1-phi2)),wPhi2); // <w2 cos(n*(psi1-phi2))
12737 }//end of for(Int_t i2=0;i2<nPrim;i2++)
12738 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12740 // 4'-particle correlations:
12741 for(Int_t i1=0;i1<nPrim;i1++)
12743 aftsTrack=anEvent->GetTrack(i1);
12744 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12745 if(typeFlag==1) // this is diff flow of POIs
12747 if(ptOrEta == "Pt")
12749 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12750 } else if (ptOrEta == "Eta")
12752 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12754 } else // this is diff flow of RPs
12756 if(ptOrEta == "Pt")
12758 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12759 } else if (ptOrEta == "Eta")
12761 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12764 psi1=aftsTrack->Phi();
12765 for(Int_t i2=0;i2<nPrim;i2++)
12767 if(i2==i1) continue;
12768 aftsTrack=anEvent->GetTrack(i2);
12769 // RP condition (!(first) particle in the correlator must be RP):
12770 if(!(aftsTrack->InRPSelection())) continue;
12771 phi2=aftsTrack->Phi();
12772 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
12773 for(Int_t i3=0;i3<nPrim;i3++)
12775 if(i3==i1||i3==i2) continue;
12776 aftsTrack=anEvent->GetTrack(i3);
12777 // RP condition (!(first) particle in the correlator must be RP):
12778 if(!(aftsTrack->InRPSelection())) continue;
12779 phi3=aftsTrack->Phi();
12780 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
12781 for(Int_t i4=0;i4<nPrim;i4++)
12783 if(i4==i1||i4==i2||i4==i3) continue;
12784 aftsTrack=anEvent->GetTrack(i4);
12785 // RP condition (!(first) particle in the correlator must be RP):
12786 if(!(aftsTrack->InRPSelection())) continue;
12787 phi4=aftsTrack->Phi();
12788 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
12789 // 4'-particle correlations <w2 w3 w4 cos(n(psi1+phi2-phi3-phi4))>:
12790 fDiffFlowDirectCorrelations[t][pe][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3-phi4)),wPhi2*wPhi3*wPhi4);
12791 }//end of for(Int_t i4=0;i4<nPrim;i4++)
12792 }//end of for(Int_t i3=0;i3<nPrim;i3++)
12793 }//end of for(Int_t i2=0;i2<nPrim;i2++)
12794 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12796 // count # of RPs and POIs in selected pt and eta bins for cross-checkings: (to be improved - moved to dedicated method)
12797 for(Int_t i=0;i<nPrim;i++)
12799 aftsTrack=anEvent->GetTrack(i);
12800 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12801 if(typeFlag==1) // this is diff flow of POIs
12803 if(ptOrEta == "Pt")
12805 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12806 } else if (ptOrEta == "Eta")
12808 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12810 } else // this is diff flow of RPs
12812 if(ptOrEta == "Pt")
12814 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12815 } else if (ptOrEta == "Eta")
12817 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12821 fNoOfParticlesInBin->Fill(t+pe+0.5);
12824 } // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
12826 //================================================================================================================================
12828 void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
12830 // Evaluate with nested loops correction terms for non-uniform acceptance (both sin and cos terms) relevant for differential flow.
12832 // Remark 1: Reduced correction terms for non-uniform acceptance are evaluated in pt bin number fCrossCheckInPtBinNo
12833 // and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
12834 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrections[t][pe][sc][cti], where first three indices runs as:
12835 // [0=RP,1=POI][0=Pt,1=Eta][0=sin terms,1=cos terms], whilst the cti (correction term index) runs as follows:
12837 // 0: <<sc n(psi1)>>
12838 // 1: <<sc n(psi1+phi2)>>
12839 // 2: <<sc n(psi1+phi2-phi3)>>
12840 // 3: <<sc n(psi1-phi2-phi3)>>
12845 Int_t typeFlag = 0;
12846 Int_t ptEtaFlag = 0;
12850 } else if(type == "POI")
12854 if(ptOrEta == "Pt")
12857 } else if(ptOrEta == "Eta")
12862 Int_t t = typeFlag;
12863 Int_t pe = ptEtaFlag;
12865 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
12866 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
12867 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
12869 Int_t nPrim = anEvent->NumberOfTracks();
12870 AliFlowTrackSimple *aftsTrack = NULL;
12872 Double_t psi1=0., phi2=0., phi3=0.;// phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
12874 Int_t n = fHarmonic;
12876 // 1-particle correction terms:
12877 for(Int_t i1=0;i1<nPrim;i1++)
12879 aftsTrack=anEvent->GetTrack(i1);
12880 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12881 if(typeFlag==1) // this is diff flow of POIs
12883 if(ptOrEta == "Pt")
12885 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12886 } else if (ptOrEta == "Eta")
12888 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12890 } else // this is diff flow of RPs
12892 if(ptOrEta == "Pt")
12894 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12895 } else if (ptOrEta == "Eta")
12897 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12900 psi1=aftsTrack->Phi();
12902 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*psi1),1.); // <<sin(n*(psi1))>>
12904 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*psi1),1.); // <<cos(n*(psi1))>>
12905 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12907 // 2-particle correction terms:
12908 for(Int_t i1=0;i1<nPrim;i1++)
12910 aftsTrack=anEvent->GetTrack(i1);
12911 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12912 if(typeFlag==1) // this is diff flow of POIs
12914 if(ptOrEta == "Pt")
12916 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12917 } else if (ptOrEta == "Eta")
12919 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12921 } else // this is diff flow of RPs
12923 if(ptOrEta == "Pt")
12925 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12926 } else if (ptOrEta == "Eta")
12928 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12931 psi1=aftsTrack->Phi();
12932 for(Int_t i2=0;i2<nPrim;i2++)
12934 if(i2==i1) continue;
12935 aftsTrack=anEvent->GetTrack(i2);
12936 // RP condition (!(first) particle in the correlator must be RP):
12937 if(!(aftsTrack->InRPSelection())) continue;
12938 phi2=aftsTrack->Phi();
12940 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2)),1.); // <<sin(n*(psi1+phi2))>>
12942 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2)),1.); // <<cos(n*(psi1+phi2))>>
12943 }//end of for(Int_t i2=0;i2<nPrim;i2++)
12944 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12946 // 3-particle correction terms:
12947 for(Int_t i1=0;i1<nPrim;i1++)
12949 aftsTrack=anEvent->GetTrack(i1);
12950 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12951 if(typeFlag==1) // this is diff flow of POIs
12953 if(ptOrEta == "Pt")
12955 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12956 } else if (ptOrEta == "Eta")
12958 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12960 } else // this is diff flow of RPs
12962 if(ptOrEta == "Pt")
12964 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12965 } else if (ptOrEta == "Eta")
12967 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12970 psi1=aftsTrack->Phi();
12971 for(Int_t i2=0;i2<nPrim;i2++)
12973 if(i2==i1) continue;
12974 aftsTrack=anEvent->GetTrack(i2);
12975 // RP condition (!(first) particle in the correlator must be RP):
12976 if(!(aftsTrack->InRPSelection())) continue;
12977 phi2=aftsTrack->Phi();
12978 for(Int_t i3=0;i3<nPrim;i3++)
12980 if(i3==i1||i3==i2) continue;
12981 aftsTrack=anEvent->GetTrack(i3);
12982 // RP condition (!(first) particle in the correlator must be RP):
12983 if(!(aftsTrack->InRPSelection())) continue;
12984 phi3=aftsTrack->Phi();
12986 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][2]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2-phi3)),1.); // <<sin(n*(psi1+phi2-phi3))>>
12987 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][3]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1-phi2-phi3)),1.); // <<sin(n*(psi1-phi2-phi3))>>
12989 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][2]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3)),1.); // <<cos(n*(psi1+phi2-phi3))>>
12990 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][3]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1-phi2-phi3)),1.); // <<cos(n*(psi1-phi2-phi3))>>
12991 }//end of for(Int_t i3=0;i3<nPrim;i3++)
12992 }//end of for(Int_t i2=0;i2<nPrim;i2++)
12993 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12995 } // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
12998 //================================================================================================================================
13001 void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrectionTermsForNUA(TString type, TString ptOrEta)
13003 // Compare corrections temrs for non-uniform acceptance needed for diff. flow calculated with nested loops and those calculated from Q-vectors
13005 Int_t typeFlag = 0;
13006 Int_t ptEtaFlag = 0;
13010 } else if(type == "POI")
13014 if(ptOrEta == "Pt")
13017 } else if(ptOrEta == "Eta")
13022 Int_t t = typeFlag;
13023 Int_t pe = ptEtaFlag;
13025 TString rpORpoiString[2] = {"RP ","POI"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
13026 TString ptORetaString[2] = {"pt","eta"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
13027 //TString sinCosFlag[2] = {"sin","cos"}; // to be improved (eventually promote to data member)
13028 TString reducedCorrectionSinTerms[4] = {"<<sin(n(psi1))>>","<<sin(n(psi1+phi2))>>","<<sin(n*(psi1+phi2-phi3))>>","<<sin(n*(psi1-phi2-phi3))>>"}; // to be improved (access this from pro or hist)
13029 TString reducedCorrectionCosTerms[4] = {"<<cos(n(psi1))>>","<<cos(n(psi1+phi2))>>","<<cos(n*(psi1+phi2-phi3))>>","<<cos(n*(psi1-phi2-phi3))>>"}; // to be improved (access this from pro or hist)
13030 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
13031 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
13033 Int_t crossCheckInPtEtaBinNo[2] = {fCrossCheckInPtBinNo,fCrossCheckInEtaBinNo};
13036 cout<<" ******************************************"<<endl;
13037 cout<<" **** cross-checking the correction ****"<<endl;
13038 cout<<" **** terms for non-uniform acceptance ****"<<endl;
13039 cout<<" **** for differential flow ("<<rpORpoiString[t]<<") ****"<<endl;
13040 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
13042 cout<<" **** (particle weights not used) ****"<<endl;
13045 cout<<" **** (particle weights used) ****"<<endl;
13047 cout<<" ******************************************"<<endl;
13049 cout<<" "<<ptORetaString[pe]<<" bin: "<<lowerPtEtaEdge[pe]<<" <= "<<ptORetaString[pe]<<" < "<<upperPtEtaEdge[pe]<<endl;
13052 for(Int_t cti=0;cti<4;cti++) // correction term index
13054 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
13056 if(sc==0) // to be improved (this can be implemented better)
13058 cout<<" "<<reducedCorrectionSinTerms[cti].Data()<<":"<<endl;
13061 cout<<" "<<reducedCorrectionCosTerms[cti].Data()<<":"<<endl;
13063 cout<<" from Q-vectors = "<<fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]->GetBinContent(crossCheckInPtEtaBinNo[pe])<<endl;
13064 cout<<" from nested loops = "<<fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti]->GetBinContent(1)<<endl;
13067 } // end of for(Int_t rci=0;rci<4;rci++)
13069 } // end of void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrectionTermsForNUA(TString type, TString ptOrEta)
13071 //================================================================================================================================
13073 void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights()
13075 // Calculate corrections using particle weights for non-uniform acceptance of the detector for no-name integrated flow (cos terms).
13077 // **********************************************************************
13078 // **** weighted corrections for non-uniform acceptance (cos terms): ****
13079 // **********************************************************************
13081 // Remark 1: When particle weights are used the binning of fIntFlowCorrectionTermsForNUAPro[1] is organized as follows:
13083 // 1st bin: <<w1 cos(n*(phi1))>> = cosP1nW1
13084 // 2nd bin: <<w1 w2 cos(n*(phi1+phi2))>> = cosP1nP1nW1W1
13085 // 3rd bin: <<w1 w2 w3 cos(n*(phi1-phi2-phi3))>> = cosP1nM1nM1nW1W1W1
13088 // multiplicity (number of particles used to determine the reaction plane)
13089 Double_t dMult = (*fSpk)(0,0);
13091 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
13092 Double_t dReQ1n1k = (*fReQ)(0,1);
13093 Double_t dReQ2n2k = (*fReQ)(1,2);
13094 //Double_t dReQ3n3k = (*fReQ)(2,3);
13095 //Double_t dReQ4n4k = (*fReQ)(3,4);
13096 Double_t dReQ1n3k = (*fReQ)(0,3);
13097 Double_t dImQ1n1k = (*fImQ)(0,1);
13098 Double_t dImQ2n2k = (*fImQ)(1,2);
13099 //Double_t dImQ3n3k = (*fImQ)(2,3);
13100 //Double_t dImQ4n4k = (*fImQ)(3,4);
13101 //Double_t dImQ1n3k = (*fImQ)(0,3);
13103 // dMs are variables introduced in order to simplify some Eqs. bellow:
13104 //..............................................................................................
13105 Double_t dM11 = (*fSpk)(1,1)-(*fSpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
13106 Double_t dM111 = (*fSpk)(2,1)-3.*(*fSpk)(0,2)*(*fSpk)(0,1)
13107 + 2.*(*fSpk)(0,3); // dM111 = sum_{i,j,k=1,i!=j!=k}^M w_i w_j w_k
13108 //..............................................................................................
13110 Double_t cosP1nW1 = 0.; // <<w1 cos(n*(phi1))>>
13112 if(dMult>0 && TMath::Abs((*fSpk)(0,1))>1.e-6)
13114 cosP1nW1 = dReQ1n1k/(*fSpk)(0,1);
13116 // average weighted 1-particle correction (cos terms) for non-uniform acceptance for single event:
13117 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(1,cosP1nW1);
13119 // final average weighted 1-particle correction (cos terms) for non-uniform acceptance for all events:
13120 fIntFlowCorrectionTermsForNUAPro[1]->Fill(0.5,cosP1nW1,(*fSpk)(0,1));
13124 Double_t cosP1nP1nW1W1 = 0.; // <<w1 w2 cos(n*(phi1+phi2))>>
13126 if(dMult>1 && TMath::Abs(dM11)>1.e-6)
13128 cosP1nP1nW1W1 = (pow(dReQ1n1k,2)-pow(dImQ1n1k,2)-dReQ2n2k)/dM11;
13130 // average weighted 2-particle correction (cos terms) for non-uniform acceptance for single event:
13131 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(2,cosP1nP1nW1W1);
13133 // final average weighted 2-particle correction (cos terms) for non-uniform acceptance for all events:
13134 fIntFlowCorrectionTermsForNUAPro[1]->Fill(1.5,cosP1nP1nW1W1,dM11);
13138 Double_t cosP1nM1nM1nW1W1W1 = 0.; // <<w1 w2 w3 cos(n*(phi1-phi2-phi3))>>
13140 if(dMult>2 && TMath::Abs(dM111)>1.e-6)
13142 cosP1nM1nM1nW1W1W1 = (dReQ1n1k*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
13143 - dReQ1n1k*dReQ2n2k-dImQ1n1k*dImQ2n2k
13144 - 2.*((*fSpk)(0,2))*dReQ1n1k
13148 // average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for single event:
13149 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(3,cosP1nM1nM1nW1W1W1);
13151 // final average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for all events:
13152 fIntFlowCorrectionTermsForNUAPro[1]->Fill(2.5,cosP1nM1nM1nW1W1W1,dM111);
13155 } // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights()
13158 //================================================================================================================================
13161 void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights()
13163 // calculate corrections using particle weights for non-uniform acceptance of the detector for no-name integrated flow (sin terms)
13165 // **********************************************************************
13166 // **** weighted corrections for non-uniform acceptance (sin terms): ****
13167 // **********************************************************************
13169 // Remark 1: When particle weights are used the binning of fIntFlowCorrectionTermsForNUAPro[0] is organized as follows:
13171 // 1st bin: <<w1 sin(n*(phi1))>> = sinP1nW1
13172 // 2nd bin: <<w1 w2 sin(n*(phi1+phi2))>> = sinP1nP1nW1W1
13173 // 3rd bin: <<w1 w2 w3 sin(n*(phi1-phi2-phi3))>> = sinP1nM1nM1nW1W1W1
13176 // multiplicity (number of particles used to determine the reaction plane)
13177 Double_t dMult = (*fSpk)(0,0);
13179 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
13180 Double_t dReQ1n1k = (*fReQ)(0,1);
13181 Double_t dReQ2n2k = (*fReQ)(1,2);
13182 //Double_t dReQ3n3k = (*fReQ)(2,3);
13183 //Double_t dReQ4n4k = (*fReQ)(3,4);
13184 //Double_t dReQ1n3k = (*fReQ)(0,3);
13185 Double_t dImQ1n1k = (*fImQ)(0,1);
13186 Double_t dImQ2n2k = (*fImQ)(1,2);
13187 //Double_t dImQ3n3k = (*fImQ)(2,3);
13188 //Double_t dImQ4n4k = (*fImQ)(3,4);
13189 Double_t dImQ1n3k = (*fImQ)(0,3);
13191 // dMs are variables introduced in order to simplify some Eqs. bellow:
13192 //..............................................................................................
13193 Double_t dM11 = (*fSpk)(1,1)-(*fSpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
13194 Double_t dM111 = (*fSpk)(2,1)-3.*(*fSpk)(0,2)*(*fSpk)(0,1)
13195 + 2.*(*fSpk)(0,3); // dM111 = sum_{i,j,k=1,i!=j!=k}^M w_i w_j w_k
13196 //..............................................................................................
13199 Double_t sinP1nW1 = 0.; // <<w1 sin(n*(phi1))>>
13201 if(dMult>0 && TMath::Abs((*fSpk)(0,1))>1.e-6)
13203 sinP1nW1 = dImQ1n1k/((*fSpk)(0,1));
13205 // average weighted 1-particle correction (sin terms) for non-uniform acceptance for single event:
13206 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(1,sinP1nW1);
13208 // final average weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
13209 fIntFlowCorrectionTermsForNUAPro[0]->Fill(0.5,sinP1nW1,(*fSpk)(0,1));
13213 Double_t sinP1nP1nW1W1 = 0.; // <<w1 w2 sin(n*(phi1+phi2))>>
13215 if(dMult>1 && TMath::Abs(dM11)>1.e-6)
13217 sinP1nP1nW1W1 = (2.*dReQ1n1k*dImQ1n1k-dImQ2n2k)/dM11;
13219 // average weighted 2-particle correction (sin terms) for non-uniform acceptance for single event:
13220 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(2,sinP1nP1nW1W1);
13222 // final average weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
13223 fIntFlowCorrectionTermsForNUAPro[0]->Fill(1.5,sinP1nP1nW1W1,dM11);
13227 Double_t sinP1nM1nM1nW1W1W1 = 0.; // <<w1 w2 w3 sin(n*(phi1-phi2-phi3))>>
13229 if(dMult>2 && TMath::Abs(dM111)>1.e-6)
13231 sinP1nM1nM1nW1W1W1 = (-dImQ1n1k*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
13232 + dReQ1n1k*dImQ2n2k-dImQ1n1k*dReQ2n2k
13233 + 2.*((*fSpk)(0,2))*dImQ1n1k
13237 // average weighted 3-particle correction (sin terms) for non-uniform acceptance for single event:
13238 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(3,sinP1nM1nM1nW1W1W1);
13240 // final average weighted 3-particle correction (sin terms) for non-uniform acceptance for all events:
13241 fIntFlowCorrectionTermsForNUAPro[0]->Fill(2.5,sinP1nM1nM1nW1W1W1,dM111);
13244 } // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights()
13246 //================================================================================================================================
13248 void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent)
13250 // Evaluate with nested loops correction terms for non-uniform acceptance for integrated flow (using the particle weights).
13252 // Results are stored in profiles fIntFlowDirectCorrectionTermsForNUA[0] (sin terms) and
13253 // fIntFlowDirectCorrectionTermsForNUA[1] (cos terms).
13255 // Remark 1: When particle weights are used the binning of fIntFlowDirectCorrectionTermsForNUA[sc] is
13256 // organized as follows (sc stands for either sin or cos):
13258 // 1st bin: <<w1 sc(n*(phi1))>> = scP1nW1
13259 // 2nd bin: <<w1 w2 sc(n*(phi1+phi2))>> = scP1nP1nW1W1
13260 // 3rd bin: <<w1 w2 w3 sc(n*(phi1-phi2-phi3))>> = scP1nM1nM1nW1W1W1
13263 Int_t nPrim = anEvent->NumberOfTracks();
13264 AliFlowTrackSimple *aftsTrack = NULL;
13265 //Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
13266 //Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1., wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
13267 Double_t phi1=0., phi2=0., phi3=0.;
13268 Double_t wPhi1=1., wPhi2=1., wPhi3=1.;
13269 Int_t n = fHarmonic;
13270 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
13271 Double_t dMult = (*fSpk)(0,0);
13273 cout<<"Correction terms for non-uniform acceptance: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
13276 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
13277 } else if (dMult>fMaxAllowedMultiplicity)
13279 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
13282 cout<<"... evaluating nested loops (using particle weights) ..."<<endl;
13285 // 1-particle correction terms using particle weights:
13286 if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)
13288 for(Int_t i1=0;i1<nPrim;i1++)
13290 aftsTrack=anEvent->GetTrack(i1);
13291 if(!(aftsTrack->InRPSelection())) continue;
13292 phi1=aftsTrack->Phi();
13293 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
13294 // 1-particle correction terms using particle weights:
13295 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(0.5,sin(n*phi1),wPhi1); // <w1 sin(n*phi1)>
13296 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(0.5,cos(n*phi1),wPhi1); // <w1 cos(n*phi1)>
13297 } // end of for(Int_t i1=0;i1<nPrim;i1++)
13298 } // end of if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)
13300 // 2-particle correction terms using particle weights:
13301 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
13303 for(Int_t i1=0;i1<nPrim;i1++)
13305 aftsTrack=anEvent->GetTrack(i1);
13306 if(!(aftsTrack->InRPSelection())) continue;
13307 phi1=aftsTrack->Phi();
13308 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
13309 for(Int_t i2=0;i2<nPrim;i2++)
13311 if(i2==i1)continue;
13312 aftsTrack=anEvent->GetTrack(i2);
13313 if(!(aftsTrack->InRPSelection())) continue;
13314 phi2=aftsTrack->Phi();
13315 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
13316 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
13317 // 2-p correction terms using particle weights:
13318 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(1.5,sin(n*(phi1+phi2)),wPhi1*wPhi2); // <w1 w2 sin(n*(phi1+phi2))>
13319 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(1.5,cos(n*(phi1+phi2)),wPhi1*wPhi2); // <w1 w2 cos(n*(phi1+phi2))>
13320 } // end of for(Int_t i2=0;i2<nPrim;i2++)
13321 } // end of for(Int_t i1=0;i1<nPrim;i1++)
13322 } // end of if(nPrim>=2)
13324 // 3-particle correction terms using particle weights:
13325 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
13327 for(Int_t i1=0;i1<nPrim;i1++)
13329 aftsTrack=anEvent->GetTrack(i1);
13330 if(!(aftsTrack->InRPSelection())) continue;
13331 phi1=aftsTrack->Phi();
13332 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
13333 for(Int_t i2=0;i2<nPrim;i2++)
13335 if(i2==i1)continue;
13336 aftsTrack=anEvent->GetTrack(i2);
13337 if(!(aftsTrack->InRPSelection())) continue;
13338 phi2=aftsTrack->Phi();
13339 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
13340 for(Int_t i3=0;i3<nPrim;i3++)
13342 if(i3==i1||i3==i2)continue;
13343 aftsTrack=anEvent->GetTrack(i3);
13344 if(!(aftsTrack->InRPSelection())) continue;
13345 phi3=aftsTrack->Phi();
13346 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
13347 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;
13348 // 3-p correction terms using particle weights:
13349 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(2.5,sin(n*(phi1-phi2-phi3)),wPhi1*wPhi2*wPhi3); // <w1 w2 w3 sin(n*(phi1-phi2-phi3))>
13350 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(2.5,cos(n*(phi1-phi2-phi3)),wPhi1*wPhi2*wPhi3); // <w1 w2 w3 cos(n*(phi1-phi2-phi3))>
13351 } // end of for(Int_t i3=0;i3<nPrim;i3++)
13352 } // end of for(Int_t i2=0;i2<nPrim;i2++)
13353 } // end of for(Int_t i1=0;i1<nPrim;i1++)
13354 } // end of if(nPrim>=3)
13358 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)
13360 // 4 nested loops multiparticle correlations using particle weights:
13361 for(Int_t i1=0;i1<nPrim;i1++)
13363 aftsTrack=anEvent->GetTrack(i1);
13364 if(!(aftsTrack->InRPSelection())) continue;
13365 phi1=aftsTrack->Phi();
13366 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
13367 for(Int_t i2=0;i2<nPrim;i2++)
13369 if(i2==i1)continue;
13370 aftsTrack=anEvent->GetTrack(i2);
13371 if(!(aftsTrack->InRPSelection())) continue;
13372 phi2=aftsTrack->Phi();
13373 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
13374 for(Int_t i3=0;i3<nPrim;i3++)
13376 if(i3==i1||i3==i2)continue;
13377 aftsTrack=anEvent->GetTrack(i3);
13378 if(!(aftsTrack->InRPSelection())) continue;
13379 phi3=aftsTrack->Phi();
13380 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
13381 for(Int_t i4=0;i4<nPrim;i4++)
13383 if(i4==i1||i4==i2||i4==i3)continue;
13384 aftsTrack=anEvent->GetTrack(i4);
13385 if(!(aftsTrack->InRPSelection())) continue;
13386 phi4=aftsTrack->Phi();
13387 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
13388 if(nPrim>=4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush; // to be improved (replace eventually this if statement with if(nPrim==4))
13389 // 4-p correlations using particle weights:
13390 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(10.5,cos(n*phi1+n*phi2-n*phi3-n*phi4),wPhi1*wPhi2*wPhi3*wPhi4);
13391 // extra correlations:
13392 // 2-p extra correlations (do not appear if particle weights are not used):
13394 // 3-p extra correlations (do not appear if particle weights are not used):
13396 // 4-p extra correlations (do not appear if particle weights are not used):
13398 } // end of for(Int_t i4=0;i4<nPrim;i4++)
13399 } // end of for(Int_t i3=0;i3<nPrim;i3++)
13400 } // end of for(Int_t i2=0;i2<nPrim;i2++)
13401 } // end of for(Int_t i1=0;i1<nPrim;i1++)
13402 } // end of if(nPrim>=4)
13408 } // end of void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent)
13410 //================================================================================================================================
13412 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights(TString type, TString ptOrEta)
13414 // Calculate correction terms for non-uniform acceptance for differential flow (cos terms) using particle weights.
13416 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][1][cti], where cti runs as follows:
13418 // 0: <<cos n(psi)>>
13419 // 1: <<w2 cos n(psi1+phi2)>>
13420 // 2: <<w2 w3 cos n(psi1+phi2-phi3)>>
13421 // 3: <<w2 w3 cos n(psi1-phi2-phi3)>>
13426 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
13427 Double_t dReQ1n1k = (*fReQ)(0,1);
13428 Double_t dReQ2n2k = (*fReQ)(1,2);
13429 //Double_t dReQ1n3k = (*fReQ)(0,3);
13430 //Double_t dReQ4n4k = (*fReQ)(3,4);
13431 Double_t dImQ1n1k = (*fImQ)(0,1);
13432 Double_t dImQ2n2k = (*fImQ)(1,2);
13433 //Double_t dImQ1n3k = (*fImQ)(0,3);
13434 //Double_t dImQ4n4k = (*fImQ)(3,4);
13436 // S^M_{p,k} (see .h file for the definition of fSpk):
13437 Double_t dSM1p1k = (*fSpk)(0,1);
13438 Double_t dSM1p2k = (*fSpk)(0,2);
13439 Double_t dSM2p1k = (*fSpk)(1,1);
13441 Int_t t = 0; // type flag
13442 Int_t pe = 0; // ptEta flag
13447 } else if(type == "POI")
13452 if(ptOrEta == "Pt")
13455 } else if(ptOrEta == "Eta")
13460 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
13461 Double_t minPtEta[2] = {fPtMin,fEtaMin};
13462 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
13463 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
13465 // looping over all bins and calculating correction terms:
13466 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
13468 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
13469 Double_t p1n0kRe = 0.;
13470 Double_t p1n0kIm = 0.;
13472 // number of POIs in particular pt or eta bin:
13475 // real and imaginary parts of q_{m*n,0} (weighted Q-vector evaluated for particles which are both RPs and POIs in particular pt or eta bin):
13476 Double_t q1n2kRe = 0.;
13477 Double_t q1n2kIm = 0.;
13478 Double_t q2n1kRe = 0.;
13479 Double_t q2n1kIm = 0.;
13481 // s_{1,1}, s_{1,2} // to be improved (add explanation)
13482 Double_t s1p1k = 0.;
13483 Double_t s1p2k = 0.;
13485 // number of particles which are both RPs and POIs in particular pt or eta bin:
13488 // M0111 from Eq. (118) in QC2c (to be improved (notation))
13489 Double_t dM01 = 0.;
13490 Double_t dM011 = 0.;
13495 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))
13496 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));
13497 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))
13498 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b));
13499 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))
13500 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));
13501 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))
13502 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b));
13503 mq = fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
13505 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.);
13506 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.);
13507 }else if(type == "RP")
13509 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
13510 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))
13511 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));
13512 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))
13513 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));
13514 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))
13515 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));
13516 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))
13517 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));
13518 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
13519 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.);
13520 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.);
13521 //s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.);
13523 mq = fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
13529 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
13530 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
13531 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
13532 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
13533 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
13534 // M01 from Eq. (118) in QC2c (to be improved (notation)):
13535 dM01 = mp*dSM1p1k-s1p1k;
13536 dM011 = mp*(dSM2p1k-dSM1p2k)
13537 - 2.*(s1p1k*dSM1p1k-s1p2k);
13539 // typeFlag = RP (0) or POI (1):
13541 } else if(type == "RP")
13543 // to be improved (cross-checked):
13544 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
13545 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
13546 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
13547 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
13548 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
13549 // M01 from Eq. (118) in QC2c (to be improved (notation)):
13550 dM01 = mp*dSM1p1k-s1p1k;
13551 dM011 = mp*(dSM2p1k-dSM1p2k)
13552 - 2.*(s1p1k*dSM1p1k-s1p2k);
13553 // typeFlag = RP (0) or POI (1):
13557 // <<cos n(psi1)>>:
13558 Double_t cosP1nPsi = 0.;
13561 cosP1nPsi = p1n0kRe/mp;
13563 // fill profile for <<cos n(psi1)>>:
13564 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi,mp);
13565 // histogram to store <cos n(psi1)> e-b-e (needed in some other methods):
13566 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][0]->SetBinContent(b,cosP1nPsi);
13569 // <<w2 cos n(psi1+phi2)>>:
13570 Double_t cosP1nPsiP1nPhiW2 = 0.;
13573 cosP1nPsiP1nPhiW2 = (p1n0kRe*dReQ1n1k-p1n0kIm*dImQ1n1k-q2n1kRe)/(dM01);
13574 // fill profile for <<w2 cos n(psi1+phi2)>>:
13575 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsiP1nPhiW2,dM01);
13576 // histogram to store <w2 cos n(psi1+phi2)> e-b-e (needed in some other methods):
13577 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][1]->SetBinContent(b,cosP1nPsiP1nPhiW2);
13578 } // end of if(dM01)
13580 // <<w2 w3 cos n(psi1+phi2-phi3)>>:
13581 Double_t cosP1nPsi1P1nPhi2MPhi3W2W3 = 0.;
13584 cosP1nPsi1P1nPhi2MPhi3W2W3 = (p1n0kRe*(pow(dImQ1n1k,2.)+pow(dReQ1n1k,2.))
13586 - q2n1kRe*dReQ1n1k-q2n1kIm*dImQ1n1k
13590 // fill profile for <<w1 w2 w3 cos n(psi1+phi2)>>:
13591 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1P1nPhi2MPhi3W2W3,dM011);
13592 // histogram to store <w1 w2 w3 cos n(psi1+phi2)> e-b-e (needed in some other methods):
13593 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][2]->SetBinContent(b,cosP1nPsi1P1nPhi2MPhi3W2W3);
13594 } // end of if(dM011)
13596 // <<w2 w3 cos n(psi1-phi2-phi3)>>:
13597 Double_t cosP1nPsi1M1nPhi2MPhi3W2W3 = 0.;
13600 cosP1nPsi1M1nPhi2MPhi3W2W3 = (p1n0kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))+2.*p1n0kIm*dReQ1n1k*dImQ1n1k
13601 - 1.*(p1n0kRe*dReQ2n2k+p1n0kIm*dImQ2n2k)
13602 - 2.*s1p1k*dReQ1n1k
13605 // fill profile for <<w1 w2 w3 cos n(psi1+phi2)>>:
13606 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1M1nPhi2MPhi3W2W3,dM011);
13607 // histogram to store <w1 w2 w3 cos n(psi1+phi2)> e-b-e (needed in some other methods):
13608 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][3]->SetBinContent(b,cosP1nPsi1M1nPhi2MPhi3W2W3);
13609 } // end of if(dM011)
13611 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
13613 } // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights(TString type, TString ptOrEta)
13616 //================================================================================================================================
13619 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights(TString type, TString ptOrEta)
13621 // Calculate correction terms for non-uniform acceptance for differential flow (sin terms).
13623 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][0][cti], where cti runs as follows:
13624 // 0: <<sin n(psi1)>>
13625 // 1: <<w2 sin n(psi1+phi2)>>
13626 // 2: <<w2 w3 sin n(psi1+phi2-phi3)>>
13627 // 3: <<w2 w3 sin n(psi1-phi2-phi3)>>:
13632 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
13633 Double_t dReQ1n1k = (*fReQ)(0,1);
13634 Double_t dReQ2n2k = (*fReQ)(1,2);
13635 //Double_t dReQ1n3k = (*fReQ)(0,3);
13636 //Double_t dReQ4n4k = (*fReQ)(3,4);
13637 Double_t dImQ1n1k = (*fImQ)(0,1);
13638 Double_t dImQ2n2k = (*fImQ)(1,2);
13639 //Double_t dImQ1n3k = (*fImQ)(0,3);
13640 //Double_t dImQ4n4k = (*fImQ)(3,4);
13642 // S^M_{p,k} (see .h file for the definition of fSpk):
13643 Double_t dSM1p1k = (*fSpk)(0,1);
13644 Double_t dSM1p2k = (*fSpk)(0,2);
13645 Double_t dSM2p1k = (*fSpk)(1,1);
13647 Int_t t = 0; // type flag
13648 Int_t pe = 0; // ptEta flag
13653 } else if(type == "POI")
13658 if(ptOrEta == "Pt")
13661 } else if(ptOrEta == "Eta")
13666 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
13667 Double_t minPtEta[2] = {fPtMin,fEtaMin};
13668 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
13669 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
13671 // looping over all bins and calculating correction terms:
13672 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
13674 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
13675 Double_t p1n0kRe = 0.;
13676 Double_t p1n0kIm = 0.;
13678 // number of POIs in particular pt or eta bin:
13681 // real and imaginary parts of q_{m*n,0} (weighted Q-vector evaluated for particles which are both RPs and POIs in particular pt or eta bin):
13682 Double_t q1n2kRe = 0.;
13683 Double_t q1n2kIm = 0.;
13684 Double_t q2n1kRe = 0.;
13685 Double_t q2n1kIm = 0.;
13687 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
13688 Double_t s1p1k = 0.;
13689 Double_t s1p2k = 0.;
13691 // number of particles which are both RPs and POIs in particular pt or eta bin:
13694 // M0111 from Eq. (118) in QC2c (to be improved (notation))
13695 Double_t dM01 = 0.;
13696 Double_t dM011 = 0.;
13701 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))
13702 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));
13703 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))
13704 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b));
13705 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))
13706 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));
13707 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))
13708 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b));
13709 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
13711 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.);
13712 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.);
13713 }else if(type == "RP")
13715 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
13716 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))
13717 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));
13718 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))
13719 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));
13720 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))
13721 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));
13722 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))
13723 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));
13724 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
13725 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.);
13726 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.);
13727 //s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.);
13733 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
13734 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
13735 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
13736 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
13737 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
13738 // M01 from Eq. (118) in QC2c (to be improved (notation)):
13739 dM01 = mp*dSM1p1k-s1p1k;
13740 dM011 = mp*(dSM2p1k-dSM1p2k)
13741 - 2.*(s1p1k*dSM1p1k-s1p2k);
13742 // typeFlag = RP (0) or POI (1):
13744 } else if(type == "RP")
13746 // to be improved (cross-checked):
13747 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
13748 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
13749 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
13750 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
13751 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
13752 // M01 from Eq. (118) in QC2c (to be improved (notation)):
13753 dM01 = mp*dSM1p1k-s1p1k;
13754 dM011 = mp*(dSM2p1k-dSM1p2k)
13755 - 2.*(s1p1k*dSM1p1k-s1p2k);
13756 // typeFlag = RP (0) or POI (1):
13760 // <<sin n(psi1)>>:
13761 Double_t sinP1nPsi = 0.;
13764 sinP1nPsi = p1n0kIm/mp;
13766 // fill profile for <<sin n(psi1)>>:
13767 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi,mp);
13768 // histogram to store <sin n(psi1)> e-b-e (needed in some other methods):
13769 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][0]->SetBinContent(b,sinP1nPsi);
13772 // <<w2 sin n(psi1+phi2)>>:
13773 Double_t sinP1nPsiP1nPhiW2 = 0.;
13776 sinP1nPsiP1nPhiW2 = (p1n0kRe*dImQ1n1k+p1n0kIm*dReQ1n1k-q2n1kIm)/(dM01);
13777 // fill profile for <<w2 sin n(psi1+phi2)>>:
13778 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsiP1nPhiW2,dM01);
13779 // histogram to store <w2 sin n(psi1+phi2)> e-b-e (needed in some other methods):
13780 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][1]->SetBinContent(b,sinP1nPsiP1nPhiW2);
13781 } // end of if(mp*dMult-mq)
13783 // <<w2 w3 sin n(psi1+phi2-phi3)>>:
13784 Double_t sinP1nPsi1P1nPhi2MPhi3W2W3 = 0.;
13787 sinP1nPsi1P1nPhi2MPhi3W2W3 = (p1n0kIm*(pow(dImQ1n1k,2.)+pow(dReQ1n1k,2.))
13789 + q2n1kRe*dImQ1n1k-q2n1kIm*dReQ1n1k
13793 // fill profile for <<w2 w3 sin n(psi1+phi2-phi3)>>:
13794 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1P1nPhi2MPhi3W2W3,dM011);
13795 // histogram to store <w2 w3 sin n(psi1+phi2-phi3)> e-b-e (needed in some other methods):
13796 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][2]->SetBinContent(b,sinP1nPsi1P1nPhi2MPhi3W2W3);
13797 } // end of if(dM011)
13799 // <<w2 w3 sin n(psi1-phi2-phi3)>>:
13800 Double_t sinP1nPsi1M1nPhi2MPhi3W2W3 = 0.;
13803 sinP1nPsi1M1nPhi2MPhi3W2W3 = (p1n0kIm*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))-2.*p1n0kRe*dReQ1n1k*dImQ1n1k
13804 + 1.*(p1n0kRe*dImQ2n2k-p1n0kIm*dReQ2n2k)
13805 + 2.*s1p1k*dImQ1n1k
13808 // fill profile for <<w2 w3 sin n(psi1-phi2-phi3)>>:
13809 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1M1nPhi2MPhi3W2W3,dM011);
13810 // histogram to store <w2 w3 sin n(psi1-phi2-phi3)> e-b-e (needed in some other methods):
13811 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][3]->SetBinContent(b,sinP1nPsi1M1nPhi2MPhi3W2W3);
13812 } // end of if(dM011)
13814 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
13816 } // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights(TString type, TString ptOrEta)
13818 //================================================================================================================================
13820 void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
13822 // Evaluate with nested loops correction terms for non-uniform acceptance
13823 // with using particle weights (both sin and cos terms) relevant for differential flow.
13825 // Remark 1: "w1" in expressions bellow is a particle weight used only for particles which were
13826 // flagged both as POI and RP.
13827 // Remark 2: Reduced correction terms for non-uniform acceptance are evaluated in pt bin number fCrossCheckInPtBinNo
13828 // and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
13829 // Remark 3: Results are stored in 1 bin profiles fDiffFlowDirectCorrections[t][pe][sc][cti], where first three indices runs as:
13830 // [0=RP,1=POI][0=Pt,1=Eta][0=sin terms,1=cos terms], whilst the cti (correction term index) runs as follows:
13832 // 0: <<sc n(psi1)>>
13833 // 1: <<w2 sc n(psi1+phi2)>>
13834 // 2: <<w2 w3 sc n(psi1+phi2-phi3)>>
13835 // 3: <<w2 w3 sc n(psi1-phi2-phi3)>>
13840 Int_t typeFlag = 0;
13841 Int_t ptEtaFlag = 0;
13845 } else if(type == "POI")
13849 if(ptOrEta == "Pt")
13852 } else if(ptOrEta == "Eta")
13857 Int_t t = typeFlag;
13858 Int_t pe = ptEtaFlag;
13860 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
13861 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
13862 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
13864 Int_t nPrim = anEvent->NumberOfTracks();
13865 AliFlowTrackSimple *aftsTrack = NULL;
13867 Double_t psi1=0., phi2=0., phi3=0.;// phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
13868 Double_t wPhi2=1., wPhi3=1.;
13870 Int_t n = fHarmonic;
13872 // 1'-particle correction terms:
13873 for(Int_t i1=0;i1<nPrim;i1++)
13875 aftsTrack=anEvent->GetTrack(i1);
13876 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
13877 if(typeFlag==1) // this is diff flow of POIs
13879 if(ptOrEta == "Pt")
13881 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
13882 } else if (ptOrEta == "Eta")
13884 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
13886 } else // this is diff flow of RPs
13888 if(ptOrEta == "Pt")
13890 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
13891 } else if (ptOrEta == "Eta")
13893 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
13896 psi1=aftsTrack->Phi();
13898 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*psi1),1.); // <<sin(n*(psi1))>>
13900 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*psi1),1.); // <<cos(n*(psi1))>>
13901 }//end of for(Int_t i1=0;i1<nPrim;i1++)
13903 // 2'-particle correction terms:
13904 for(Int_t i1=0;i1<nPrim;i1++)
13906 aftsTrack=anEvent->GetTrack(i1);
13907 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
13908 if(typeFlag==1) // this is diff flow of POIs
13910 if(ptOrEta == "Pt")
13912 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
13913 } else if (ptOrEta == "Eta")
13915 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
13917 } else // this is diff flow of RPs
13919 if(ptOrEta == "Pt")
13921 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
13922 } else if (ptOrEta == "Eta")
13924 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
13927 psi1=aftsTrack->Phi();
13928 for(Int_t i2=0;i2<nPrim;i2++)
13930 if(i2==i1) continue;
13931 aftsTrack=anEvent->GetTrack(i2);
13932 // RP condition (!(first) particle in the correlator must be RP):
13933 if(!(aftsTrack->InRPSelection())) continue;
13934 phi2=aftsTrack->Phi();
13935 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
13937 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2)),wPhi2); // <<w2 sin(n*(psi1+phi2))>>
13939 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2)),wPhi2); // <<w2 cos(n*(psi1+phi2))>>
13940 }//end of for(Int_t i2=0;i2<nPrim;i2++)
13941 }//end of for(Int_t i1=0;i1<nPrim;i1++)
13943 // 3'-particle correction terms:
13944 for(Int_t i1=0;i1<nPrim;i1++)
13946 aftsTrack=anEvent->GetTrack(i1);
13947 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
13948 if(typeFlag==1) // this is diff flow of POIs
13950 if(ptOrEta == "Pt")
13952 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
13953 } else if (ptOrEta == "Eta")
13955 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
13957 } else // this is diff flow of RPs
13959 if(ptOrEta == "Pt")
13961 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
13962 } else if (ptOrEta == "Eta")
13964 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
13967 psi1=aftsTrack->Phi();
13968 for(Int_t i2=0;i2<nPrim;i2++)
13970 if(i2==i1) continue;
13971 aftsTrack=anEvent->GetTrack(i2);
13972 // RP condition (!(first) particle in the correlator must be RP):
13973 if(!(aftsTrack->InRPSelection())) continue;
13974 phi2=aftsTrack->Phi();
13975 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
13976 for(Int_t i3=0;i3<nPrim;i3++)
13978 if(i3==i1||i3==i2) continue;
13979 aftsTrack=anEvent->GetTrack(i3);
13980 // RP condition (!(first) particle in the correlator must be RP):
13981 if(!(aftsTrack->InRPSelection())) continue;
13982 phi3=aftsTrack->Phi();
13983 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
13985 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][2]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2-phi3)),wPhi2*wPhi3); // <<wPhi2*wPhi3 sin(n*(psi1+phi2-phi3))>>
13986 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][3]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1-phi2-phi3)),wPhi2*wPhi3); // <<wPhi2*wPhi3 sin(n*(psi1-phi2-phi3))>>
13988 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][2]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3)),wPhi2*wPhi3); // <<wPhi2*wPhi3 cos(n*(psi1+phi2-phi3))>>
13989 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][3]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1-phi2-phi3)),wPhi2*wPhi3); // <<wPhi2*wPhi3 cos(n*(psi1-phi2-phi3))>>
13990 }//end of for(Int_t i3=0;i3<nPrim;i3++)
13991 }//end of for(Int_t i2=0;i2<nPrim;i2++)
13992 }//end of for(Int_t i1=0;i1<nPrim;i1++)
13994 } // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
13996 //================================================================================================================================
13998 void AliFlowAnalysisWithQCumulants::CheckPointersUsedInFinish()
14000 // Check all pointers used in method Finish().
14002 if(!fAvMultiplicity)
14005 cout<<" WARNING (QC): fAvMultiplicity is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
14009 if(!fIntFlowCorrelationsPro)
14012 cout<<" WARNING (QC): fIntFlowCorrelationsPro is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
14016 if(!fIntFlowSquaredCorrelationsPro)
14019 cout<<" WARNING (QC): fIntFlowSquaredCorrelationsPro is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
14023 if(!fIntFlowCorrelationsHist)
14026 cout<<" WARNING (QC): fIntFlowCorrelationsHist is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
14030 if((fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights) && !fIntFlowExtraCorrelationsPro)
14033 cout<<" WARNING (QC): fIntFlowExtraCorrelationsPro is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
14037 for(Int_t power=0;power<2;power++)
14039 if(!fIntFlowSumOfEventWeights[power])
14042 cout<<Form(" WARNING (QC): fIntFlowSumOfEventWeights[%d] is NULL in CheckPointersUsedInFinish() !!!!",power)<<endl;
14046 } // end of for(Int_t power=0;power<2;power++)
14047 if(!fIntFlowProductOfCorrelationsPro)
14050 cout<<" WARNING (QC): fIntFlowProductOfCorrelationsPro is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
14054 if(!fIntFlowSumOfProductOfEventWeights)
14057 cout<<" WARNING (QC): fIntFlowSumOfProductOfEventWeights is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
14061 if(!fIntFlowCovariances)
14064 cout<<" WARNING (QC): fIntFlowCovariances is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
14068 if(!fIntFlowQcumulants)
14071 cout<<" WARNING (QC): fIntFlowQcumulants is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
14078 cout<<" WARNING (QC): fIntFlow is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
14085 cout<<" WARNING (QC): fCommonHists is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
14089 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
14092 cout<<" WARNING (QC): fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th"<<endl;
14093 cout<<" && fCommonHistsResults8th is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
14099 for(Int_t sc=0;sc<2;sc++) // sin/cos
14101 if(!fIntFlowCorrectionTermsForNUAPro[sc])
14104 cout<<Form(" WARNING (QC): fIntFlowCorrectionTermsForNUAPro[%d] is NULL in CheckPointersUsedInFinish() !!!!",sc)<<endl;
14108 if(!fIntFlowCorrectionTermsForNUAHist[sc])
14111 cout<<Form(" WARNING (QC): fIntFlowCorrectionTermsForNUAHist[%d] is NULL in CheckPointersUsedInFinish() !!!!",sc)<<endl;
14115 for(Int_t lq=0;lq<2;lq++) // linear/quadratic
14117 if(!fIntFlowSumOfEventWeightsNUA[sc][lq])
14120 cout<<Form(" WARNING (QC): fIntFlowSumOfEventWeightsNUA[%d][%d] is NULL in CheckPointersUsedInFinish() !!!!",sc,lq)<<endl;
14124 } // end of for(Int_t lq=0;lq<2;lq++) // linear/quadratic
14125 } // end of for(Int_t power=0;power<2;power++)
14126 if(!fIntFlowProductOfCorrectionTermsForNUAPro)
14129 cout<<" WARNING (QC): fIntFlowProductOfCorrectionTermsForNUAPro is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
14133 if(!fIntFlowSumOfProductOfEventWeightsNUA)
14136 cout<<" WARNING (QC): fIntFlowSumOfProductOfEventWeightsNUA is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
14140 if(!fIntFlowCovariancesNUA)
14143 cout<<" WARNING (QC): fIntFlowCovariancesNUA is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
14147 if(!fIntFlowQcumulantsErrorSquaredRatio)
14150 cout<<" WARNING (QC): fIntFlowQcumulantsErrorSquaredRatio is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
14154 if(!fIntFlowDetectorBias)
14157 cout<<" WARNING (QC): fIntFlowDetectorBias is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
14162 // Versus multiplicity:
14163 if(!fCalculateCumulantsVsM){return;}
14164 for(Int_t co=0;co<=3;co++) // cumulant order
14166 if(!fIntFlowQcumulantsVsM[co])
14169 cout<<Form(" WARNING (QC): fIntFlowQcumulantsVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",co)<<endl;
14173 if(!fIntFlowVsM[co])
14176 cout<<Form(" WARNING (QC): fIntFlowVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",co)<<endl;
14180 if(!fIntFlowDetectorBiasVsM[co])
14183 cout<<Form(" WARNING (QC): fIntFlowDetectorBiasVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",co)<<endl;
14187 } // end of for(Int_t c0=0;c0<=3;c0++) // cumulant order
14188 for(Int_t ci=0;ci<=3;ci++) // correlation index
14190 if(!fIntFlowCorrelationsVsMPro[ci])
14193 cout<<Form(" WARNING (QC): fIntFlowCorrelationsVsMPro[%d] is NULL in CheckPointersUsedInFinish() !!!!",ci)<<endl;
14197 if(!fIntFlowSquaredCorrelationsVsMPro[ci])
14200 cout<<Form(" WARNING (QC): fIntFlowSquaredCorrelationsVsMPro[%d] is NULL in CheckPointersUsedInFinish() !!!!",ci)<<endl;
14204 if(!fIntFlowCorrelationsVsMHist[ci])
14207 cout<<Form(" WARNING (QC): fIntFlowCorrelationsVsMHist[%d] is NULL in CheckPointersUsedInFinish() !!!!",ci)<<endl;
14211 for(Int_t power=0;power<2;power++)
14213 if(!fIntFlowSumOfEventWeightsVsM[ci][power])
14216 cout<<Form(" WARNING (QC): fIntFlowSumOfEventWeightsVsM[%d][%d] is NULL in CheckPointersUsedInFinish() !!!!",ci,power)<<endl;
14220 } // end of for(Int_t power=0;power<2;power++)
14221 } // end of for(Int_t ci=0;ci<=3;ci++) // correlation index
14222 for(Int_t i=0;i<6;i++)
14224 if(!fIntFlowProductOfCorrelationsVsMPro[i])
14227 cout<<Form(" WARNING (QC): fIntFlowProductOfCorrelationsVsMPro[%d] is NULL in CheckPointersUsedInFinish() !!!!",i)<<endl;
14231 if(!fIntFlowSumOfProductOfEventWeightsVsM[i])
14234 cout<<Form(" WARNING (QC): fIntFlowSumOfProductOfEventWeightsVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",i)<<endl;
14238 if(!fIntFlowCovariancesVsM[i])
14241 cout<<Form(" WARNING (QC): fIntFlowCovariancesVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",i)<<endl;
14245 } // end of for(Int_t i=0;i<6;i++)
14246 if(!fIntFlowRebinnedInM)
14249 cout<<" WARNING (QC): fIntFlowRebinnedInM is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
14253 if(!fIntFlowQcumulantsRebinnedInM)
14256 cout<<" WARNING (QC): fIntFlowQcumulantsRebinnedInM is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
14261 } // end of void AliFlowAnalysisWithQCumulants::CheckPointersUsedInFinish()
14263 //================================================================================================================================
14265 void AliFlowAnalysisWithQCumulants::CheckPointersUsedInMake()
14267 // Check all pointers used in method Make(). // to be improved - check other pointers as well
14269 if(!fAvMultiplicity)
14271 printf("\n WARNING (QC): fAvMultiplicity is NULL in CheckPointersUsedInMake() !!!!\n\n");
14274 if((fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights) && !fIntFlowExtraCorrelationsPro)
14276 printf("\n WARNING (QC): fIntFlowExtraCorrelationsPro is NULL in CheckPointersUsedInMake() !!!!\n\n");
14280 if(fCalculate2DDiffFlow)
14282 for(Int_t t=0;t<2;t++) // type = RP or POI
14284 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
14286 if(!f2DDiffFlowCorrelationsPro[t][rci])
14288 printf("\n WARNING (QC): f2DDiffFlowCorrelationsPro[%i][%i] is NULL in CheckPointersUsedInMake() !!!!\n\n",t,rci);
14290 } // end of if(!f2DDiffFlowCorrelationsPro[t][rci])
14291 } // end of for(Int_t rci=0;rci<4;rci++) // reduced correlation index
14292 } // end of for(Int_t t=0;t<2;t++)
14293 } // end of if(fCalculate2DDiffFlow)
14295 } // end of void AliFlowAnalysisWithQCumulants::CheckPointersUsedInMake()