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(kFALSE),
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 // Re[Q_{2n}Q_{n}Q_{n}^*Q_{n}^*Q_{n}^*]
2870 Double_t reQ2nQ1nQ1nstarQ1nstarQ1nstar = (dReQ2n*dReQ1n-dImQ2n*dImQ1n)*(pow(dReQ1n,3)-3.*dReQ1n*pow(dImQ1n,2))
2871 + (dReQ2n*dImQ1n+dReQ1n*dImQ2n)*(3.*dImQ1n*pow(dReQ1n,2)-pow(dImQ1n,3));
2872 // Re[Q_{2n}Q_{2n}Q_{2n}^*Q_{n}^*Q_{n}^*]
2873 Double_t reQ2nQ2nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))
2874 * (dReQ2n*(pow(dReQ1n,2.)-pow(dImQ1n,2.)) + 2.*dImQ2n*dReQ1n*dImQ1n);
2875 // Re[Q_{4n}Q_{n}^*Q_{n}^*Q_{n}^*Q_{n}^*]
2876 Double_t reQ4nQ1nstarQ1nstarQ1nstarQ1nstar = pow(dReQ1n,4.)*dReQ4n-6.*pow(dReQ1n,2.)*dReQ4n*pow(dImQ1n,2.)
2877 + pow(dImQ1n,4.)*dReQ4n+4.*pow(dReQ1n,3.)*dImQ1n*dImQ4n
2878 - 4.*pow(dImQ1n,3.)*dReQ1n*dImQ4n;
2879 // Re[Q_{3n}Q_{n}Q_{2n}^*Q_{n}^*Q_{n}^*]
2880 Double_t reQ3nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
2881 * (dReQ1n*dReQ2n*dReQ3n-dReQ3n*dImQ1n*dImQ2n
2882 + dReQ2n*dImQ1n*dImQ3n+dReQ1n*dImQ2n*dImQ3n);
2883 // Re[Q_{6n}Q_{n}Q_{3n}^*Q_{2n}^*Q_{n}^*]
2884 Double_t reQ6nQ3nstarQ2nstarQ1nstar = dReQ1n*dReQ2n*dReQ3n*dReQ6n-dReQ3n*dReQ6n*dImQ1n*dImQ2n
2885 - dReQ2n*dReQ6n*dImQ1n*dImQ3n-dReQ1n*dReQ6n*dImQ2n*dImQ3n
2886 + dReQ2n*dReQ3n*dImQ1n*dImQ6n+dReQ1n*dReQ3n*dImQ2n*dImQ6n
2887 + dReQ1n*dReQ2n*dImQ3n*dImQ6n-dImQ1n*dImQ2n*dImQ3n*dImQ6n;
2888 // Re[Q_{3n}Q_{3n}Q_{3n}^*Q_{2n}^*Q_{n}^*]
2889 Double_t reQ3nQ3nQ3nstarQ2nstarQ1nstar = (pow(dImQ3n,2.)+pow(dReQ3n,2.))
2890 * (dImQ2n*dImQ3n*dReQ1n+dImQ1n*dImQ3n*dReQ2n
2891 - dImQ1n*dImQ2n*dReQ3n+dReQ1n*dReQ2n*dReQ3n);
2892 // Re[Q_{3n}Q_{3n}Q_{2n}^*Q_{2n}^*Q_{2n}^*]
2893 Double_t reQ3nQ3nQ2nstarQ2nstarQ2nstar = pow(dReQ2n,3.)*pow(dReQ3n,2.)
2894 - 3.*dReQ2n*pow(dReQ3n,2.)*pow(dImQ2n,2.)
2895 + 6.*pow(dReQ2n,2.)*dReQ3n*dImQ2n*dImQ3n
2896 - 2.*dReQ3n*pow(dImQ2n,3.)*dImQ3n-pow(dReQ2n,3.)*pow(dImQ3n,2.)
2897 + 3.*dReQ2n*pow(dImQ2n,2.)*pow(dImQ3n,2.);
2898 // Re[Q_{4n}Q_{2n}Q_{3n}^*Q_{2n}^*Q_{n}^*]
2899 Double_t reQ4nQ2nQ3nstarQ2nstarQ1nstar = (pow(dImQ2n,2.)+pow(dReQ2n,2.))
2900 * (dImQ3n*dImQ4n*dReQ1n+dImQ1n*dImQ4n*dReQ3n
2901 - dImQ1n*dImQ3n*dReQ4n+dReQ1n*dReQ3n*dReQ4n);
2902 // Re[Q_{3n}Q_{2n}Q_{3n}^*Q_{n}^*Q_{n}^*]
2903 Double_t reQ3nQ2nQ3nstarQ1nstarQ1nstar = -(pow(dImQ3n,2.)+pow(dReQ3n,2.))
2904 * (-2.*dImQ1n*dImQ2n*dReQ1n+pow(dImQ1n,2.)*dReQ2n-pow(dReQ1n,2.)*dReQ2n);
2905 // Re[Q_{3n}Q_{2n}Q_{2n}^*Q_{2n}^*Q_{n}^*]
2906 Double_t reQ3nQ2nQ2nstarQ2nstarQ1nstar = (pow(dImQ2n,2.)+pow(dReQ2n,2.))
2907 * (dImQ2n*dImQ3n*dReQ1n+dImQ1n*dImQ3n*dReQ2n
2908 - dImQ1n*dImQ2n*dReQ3n+dReQ1n*dReQ2n*dReQ3n);
2909 // Re[Q_{5n}Q_{n}Q_{3n}^*Q_{2n}^*Q_{n}^*]
2910 Double_t reQ5nQ1nQ3nstarQ2nstarQ1nstar = (pow(dImQ1n,2.)+pow(dReQ1n,2.))
2911 * (dImQ3n*dImQ5n*dReQ2n+dImQ2n*dImQ5n*dReQ3n
2912 - dImQ2n*dImQ3n*dReQ5n+dReQ2n*dReQ3n*dReQ5n);
2913 // Re[Q_{2n}Q_{2n}Q_{n}^*Q_{n}^*Q_{n}^*Q_{n}^*]
2914 Double_t reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)*dReQ2n-2.*dReQ1n*dReQ2n*dImQ1n-dReQ2n*pow(dImQ1n,2.)
2915 + dImQ2n*pow(dReQ1n,2.)+2.*dReQ1n*dImQ1n*dImQ2n-pow(dImQ1n,2.)*dImQ2n)
2916 * (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 // Re[Q_{3n}Q_{n}Q_{n}^*Q_{n}^*Q_{n}^*Q_{n}^*]
2919 Double_t reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))
2920 * (pow(dReQ1n,3.)*dReQ3n-3.*dReQ1n*dReQ3n*pow(dImQ1n,2.)
2921 + 3.*pow(dReQ1n,2.)*dImQ1n*dImQ3n-pow(dImQ1n,3.)*dImQ3n);
2922 // |Q_{2n}|^2 |Q_{n}|^4
2923 Double_t dQ2nQ1nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))*pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.);
2924 // |Q_{3n}|^2 |Q_{2n}|^2 |Q_{n}|^2
2925 Double_t dQ3nQ2nQ1nQ3nstarQ2nstarQ1nstar = (pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
2926 * (pow(dReQ1n,2.)+pow(dImQ1n,2.));
2927 // Re[Q_{2n}Q_{n}Q_{n}Q_{n}^*Q_{n}^*Q_{n}^*Q_{n}^*]
2928 Double_t reQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
2929 * (pow(dReQ1n,2.)*dReQ2n-dReQ2n*pow(dImQ1n,2.)
2930 + 2.*dReQ1n*dImQ1n*dImQ2n);
2932 // Results for multiparticle azimuthal correlations:
2934 Double_t two1n1n = 0.; // <cos(n(phi1-phi2))>
2935 Double_t two2n2n = 0.; // <cos(2n(phi1-phi2))>
2936 Double_t two3n3n = 0.; // <cos(3n(phi1-phi2))>
2937 Double_t two4n4n = 0.; // <cos(4n(phi1-phi2))>
2940 two1n1n = (pow(dReQ1n,2.)+pow(dImQ1n,2.)-dMult)/(dMult*(dMult-1.));
2941 two2n2n = (pow(dReQ2n,2.)+pow(dImQ2n,2.)-dMult)/(dMult*(dMult-1.));
2942 two3n3n = (pow(dReQ3n,2.)+pow(dImQ3n,2.)-dMult)/(dMult*(dMult-1.));
2943 two4n4n = (pow(dReQ4n,2.)+pow(dImQ4n,2.)-dMult)/(dMult*(dMult-1.));
2944 // Average 2-particle correlations for single event:
2945 fIntFlowCorrelationsAllEBE->SetBinContent(1,two1n1n);
2946 fIntFlowCorrelationsAllEBE->SetBinContent(2,two2n2n);
2947 fIntFlowCorrelationsAllEBE->SetBinContent(3,two3n3n);
2948 fIntFlowCorrelationsAllEBE->SetBinContent(4,two4n4n);
2949 // Average 2-particle correlations for all events:
2950 fIntFlowCorrelationsAllPro->Fill(0.5,two1n1n,dMult*(dMult-1.));
2951 fIntFlowCorrelationsAllPro->Fill(1.5,two2n2n,dMult*(dMult-1.));
2952 fIntFlowCorrelationsAllPro->Fill(2.5,two3n3n,dMult*(dMult-1.));
2953 fIntFlowCorrelationsAllPro->Fill(3.5,two4n4n,dMult*(dMult-1.));
2954 // Store separetately <2>:
2955 fIntFlowCorrelationsEBE->SetBinContent(1,two1n1n); // <2>
2956 // Testing other multiplicity weights:
2957 Double_t mWeight2p = 0.;
2958 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
2960 mWeight2p = dMult*(dMult-1.);
2961 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
2964 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2968 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(1,mWeight2p); // eW_<2>
2969 fIntFlowCorrelationsPro->Fill(0.5,two1n1n,mWeight2p);
2970 fIntFlowSquaredCorrelationsPro->Fill(0.5,two1n1n*two1n1n,mWeight2p);
2971 if(fCalculateCumulantsVsM)
2973 fIntFlowCorrelationsVsMPro[0]->Fill(dMult+0.5,two1n1n,mWeight2p);
2974 fIntFlowSquaredCorrelationsVsMPro[0]->Fill(dMult+0.5,two1n1n*two1n1n,mWeight2p);
2976 if(fCalculateAllCorrelationsVsM)
2978 fIntFlowCorrelationsAllVsMPro[0]->Fill(dMult+0.5,two1n1n,mWeight2p);
2979 fIntFlowCorrelationsAllVsMPro[1]->Fill(dMult+0.5,two2n2n,mWeight2p);
2980 fIntFlowCorrelationsAllVsMPro[2]->Fill(dMult+0.5,two3n3n,mWeight2p);
2981 fIntFlowCorrelationsAllVsMPro[3]->Fill(dMult+0.5,two4n4n,mWeight2p);
2983 } // end of if(dMult>1)
2986 Double_t three2n1n1n = 0.; // <cos(n(2*phi1-phi2-phi3))>
2987 Double_t three3n2n1n = 0.; // <cos(n(3*phi1-2*phi2-phi3))>
2988 Double_t three4n2n2n = 0.; // <cos(n(4*phi1-2*phi2-2*phi3))>
2989 Double_t three4n3n1n = 0.; // <cos(n(4*phi1-3*phi2-phi3))>
2992 three2n1n1n = (reQ2nQ1nstarQ1nstar-2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
2993 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))+2.*dMult)
2994 / (dMult*(dMult-1.)*(dMult-2.));
2995 three3n2n1n = (reQ3nQ2nstarQ1nstar-(pow(dReQ3n,2.)+pow(dImQ3n,2.))
2996 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))
2997 - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)
2998 / (dMult*(dMult-1.)*(dMult-2.));
2999 three4n2n2n = (reQ4nQ2nstarQ2nstar-2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3000 - (pow(dReQ4n,2.)+pow(dImQ4n,2.))+2.*dMult)
3001 / (dMult*(dMult-1.)*(dMult-2.));
3002 three4n3n1n = (reQ4nQ3nstarQ1nstar-(pow(dReQ4n,2.)+pow(dImQ4n,2.))
3003 - (pow(dReQ3n,2.)+pow(dImQ3n,2.))
3004 - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)
3005 / (dMult*(dMult-1.)*(dMult-2.));
3006 // Average 3-particle correlations for single event:
3007 fIntFlowCorrelationsAllEBE->SetBinContent(6,three2n1n1n);
3008 fIntFlowCorrelationsAllEBE->SetBinContent(7,three3n2n1n);
3009 fIntFlowCorrelationsAllEBE->SetBinContent(8,three4n2n2n);
3010 fIntFlowCorrelationsAllEBE->SetBinContent(9,three4n3n1n);
3011 // Average 3-particle correlations for all events:
3012 fIntFlowCorrelationsAllPro->Fill(5.5,three2n1n1n,dMult*(dMult-1.)*(dMult-2.));
3013 fIntFlowCorrelationsAllPro->Fill(6.5,three3n2n1n,dMult*(dMult-1.)*(dMult-2.));
3014 fIntFlowCorrelationsAllPro->Fill(7.5,three4n2n2n,dMult*(dMult-1.)*(dMult-2.));
3015 fIntFlowCorrelationsAllPro->Fill(8.5,three4n3n1n,dMult*(dMult-1.)*(dMult-2.));
3016 // Average 3-particle correlations vs M for all events:
3017 if(fCalculateAllCorrelationsVsM)
3019 fIntFlowCorrelationsAllVsMPro[5]->Fill(dMult+0.5,three2n1n1n,dMult*(dMult-1.)*(dMult-2.));
3020 fIntFlowCorrelationsAllVsMPro[6]->Fill(dMult+0.5,three3n2n1n,dMult*(dMult-1.)*(dMult-2.));
3021 fIntFlowCorrelationsAllVsMPro[7]->Fill(dMult+0.5,three4n2n2n,dMult*(dMult-1.)*(dMult-2.));
3022 fIntFlowCorrelationsAllVsMPro[8]->Fill(dMult+0.5,three4n3n1n,dMult*(dMult-1.)*(dMult-2.));
3024 } // end of if(dMult>2)
3027 Double_t four1n1n1n1n = 0.; // <cos(n(phi1+phi2-phi3-phi4))>
3028 Double_t four2n2n2n2n = 0.; // <cos(2n(phi1+phi2-phi3-phi4))>
3029 Double_t four2n1n2n1n = 0.; // <cos(n(2*phi1+phi2-2*phi3-phi4))>
3030 Double_t four3n1n1n1n = 0.; // <cos(n(3*phi1-phi2-phi3-phi4))>
3031 Double_t four4n2n1n1n = 0.; // <cos(n(4*phi1-2*phi2-phi3-phi4))>
3032 Double_t four3n1n2n2n = 0.; // <cos(n(3*phi1+phi2-2*phi3-2*phi4))>
3033 Double_t four3n1n3n1n = 0.; // <cos(n(3*phi1+phi2-3*phi3-phi4))>
3036 four1n1n1n1n = (2.*dMult*(dMult-3.)+pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)-4.*(dMult-2.)*(pow(dReQ1n,2.)
3037 + pow(dImQ1n,2.))-2.*reQ2nQ1nstarQ1nstar+(pow(dReQ2n,2.)+pow(dImQ2n,2.)))
3038 / (dMult*(dMult-1)*(dMult-2.)*(dMult-3.));
3039 four2n2n2n2n = (2.*dMult*(dMult-3.)+pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)-4.*(dMult-2.)*(pow(dReQ2n,2.)
3040 + pow(dImQ2n,2.))-2.*reQ4nQ2nstarQ2nstar+(pow(dReQ4n,2.)+pow(dImQ4n,2.)))
3041 / (dMult*(dMult-1)*(dMult-2.)*(dMult-3.));
3042 four2n1n2n1n = (dQ2nQ1nQ2nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar-2.*reQ2nQ1nstarQ1nstar)
3043 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
3044 - ((dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3045 + (dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-(pow(dReQ3n,2.)+pow(dImQ3n,2.)))
3046 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
3047 + (dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.));
3048 four3n1n1n1n = (reQ3nQ1nstarQ1nstarQ1nstar-3.*reQ3nQ2nstarQ1nstar-3.*reQ2nQ1nstarQ1nstar
3049 + 2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+3.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3050 + 6.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-6.*dMult)
3051 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3052 four4n2n1n1n = (reQ4nQ2nstarQ1nstarQ1nstar-2.*reQ4nQ3nstarQ1nstar-reQ4nQ2nstarQ2nstar-2.*reQ3nQ2nstarQ1nstar)
3053 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
3054 - (reQ2nQ1nstarQ1nstar-2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3055 - 3.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
3056 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
3057 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
3058 four3n1n2n2n = (reQ3nQ1nQ2nstarQ2nstar-reQ4nQ2nstarQ2nstar-reQ4nQ3nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar)
3059 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
3060 - (2.*reQ2nQ1nstarQ1nstar-(pow(dReQ4n,2.)+pow(dImQ4n,2.))-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3061 - 4.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))
3062 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
3063 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));
3064 four3n1n3n1n = ((pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3065 - 2.*reQ4nQ3nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar
3066 + pow(dReQ4n,2.)+pow(dImQ4n,2.)-(dMult-4.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3067 + pow(dReQ2n,2.)+pow(dImQ2n,2.)-(dMult-4.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3069 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3070 // Average 4-particle correlations for single event:
3071 fIntFlowCorrelationsAllEBE->SetBinContent(11,four1n1n1n1n);
3072 fIntFlowCorrelationsAllEBE->SetBinContent(12,four2n1n2n1n);
3073 fIntFlowCorrelationsAllEBE->SetBinContent(13,four2n2n2n2n);
3074 fIntFlowCorrelationsAllEBE->SetBinContent(14,four3n1n1n1n);
3075 fIntFlowCorrelationsAllEBE->SetBinContent(15,four3n1n3n1n);
3076 fIntFlowCorrelationsAllEBE->SetBinContent(16,four3n1n2n2n);
3077 fIntFlowCorrelationsAllEBE->SetBinContent(17,four4n2n1n1n);
3078 // Average 4-particle correlations for all events:
3079 fIntFlowCorrelationsAllPro->Fill(10.5,four1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3080 fIntFlowCorrelationsAllPro->Fill(11.5,four2n1n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3081 fIntFlowCorrelationsAllPro->Fill(12.5,four2n2n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3082 fIntFlowCorrelationsAllPro->Fill(13.5,four3n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3083 fIntFlowCorrelationsAllPro->Fill(14.5,four3n1n3n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3084 fIntFlowCorrelationsAllPro->Fill(15.5,four3n1n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3085 fIntFlowCorrelationsAllPro->Fill(16.5,four4n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3086 // Average 4-particle correlations vs M for all events:
3087 if(fCalculateAllCorrelationsVsM)
3089 fIntFlowCorrelationsAllVsMPro[10]->Fill(dMult+0.5,four1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3090 fIntFlowCorrelationsAllVsMPro[11]->Fill(dMult+0.5,four2n1n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3091 fIntFlowCorrelationsAllVsMPro[12]->Fill(dMult+0.5,four2n2n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3092 fIntFlowCorrelationsAllVsMPro[13]->Fill(dMult+0.5,four3n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3093 fIntFlowCorrelationsAllVsMPro[14]->Fill(dMult+0.5,four3n1n3n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3094 fIntFlowCorrelationsAllVsMPro[15]->Fill(dMult+0.5,four3n1n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3095 fIntFlowCorrelationsAllVsMPro[16]->Fill(dMult+0.5,four4n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3097 // Store separetately <4>:
3098 fIntFlowCorrelationsEBE->SetBinContent(2,four1n1n1n1n); // <4>
3099 // Testing other multiplicity weights:
3100 Double_t mWeight4p = 0.;
3101 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
3103 mWeight4p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.);
3104 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
3107 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
3111 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(2,mWeight4p); // eW_<4>
3112 fIntFlowCorrelationsPro->Fill(1.5,four1n1n1n1n,mWeight4p);
3113 fIntFlowSquaredCorrelationsPro->Fill(1.5,four1n1n1n1n*four1n1n1n1n,mWeight4p);
3114 if(fCalculateCumulantsVsM)
3116 fIntFlowCorrelationsVsMPro[1]->Fill(dMult+0.5,four1n1n1n1n,mWeight4p);
3117 fIntFlowSquaredCorrelationsVsMPro[1]->Fill(dMult+0.5,four1n1n1n1n*four1n1n1n1n,mWeight4p);
3119 } // end of if(dMult>3)
3122 Double_t five2n1n1n1n1n = 0.; // <cos(n(2*phi1+phi2-phi3-phi4-phi5))>
3123 Double_t five2n2n2n1n1n = 0.; // <cos(n(2*phi1+2*phi2-2*phi3-phi4-phi5))>
3124 Double_t five3n1n2n1n1n = 0.; // <cos(n(3*phi1+phi2-2*phi3-phi4-phi5))>
3125 Double_t five4n1n1n1n1n = 0.; // <cos(n(4*phi1-phi2-phi3-phi4-phi5))>
3128 five2n1n1n1n1n = (reQ2nQ1nQ1nstarQ1nstarQ1nstar-reQ3nQ1nstarQ1nstarQ1nstar+5.*reQ3nQ2nstarQ1nstar
3129 - 3.*(dMult-5.)*reQ2nQ1nstarQ1nstar-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3130 - 3.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3131 + 3.*(dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3132 - 3.*pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
3133 + 6.*(2.*dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-6.*dMult*(dMult-4.))
3134 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3135 five2n2n2n1n1n = (reQ2nQ2nQ2nstarQ1nstarQ1nstar-reQ4nQ2nstarQ1nstarQ1nstar-2.*reQ3nQ1nQ2nstarQ2nstar
3136 + 3.*reQ4nQ2nstarQ2nstar+8.*reQ3nQ2nstarQ1nstar+2.*reQ4nQ3nstarQ1nstar
3137 - 2.*(dMult-6.)*reQ2nQ1nstarQ1nstar
3138 - 2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))-4.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3139 - pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)
3140 + 2.*(3.*dMult-10.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3141 - 4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3142 + 4.*(dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-4.*dMult*(dMult-6.))
3143 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3144 five4n1n1n1n1n = (reQ4nQ1nstarQ1nstarQ1nstarQ1nstar-6.*reQ4nQ2nstarQ1nstarQ1nstar-4.*reQ3nQ1nstarQ1nstarQ1nstar
3145 + 8.*reQ4nQ3nstarQ1nstar+3.*reQ4nQ2nstarQ2nstar+12.*reQ3nQ2nstarQ1nstar+12.*reQ2nQ1nstarQ1nstar
3146 - 6.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))-8.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3147 - 12.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-24.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))+24.*dMult)
3148 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3149 five3n1n2n1n1n = (reQ3nQ1nQ2nstarQ1nstarQ1nstar-reQ4nQ2nstarQ1nstarQ1nstar-reQ3nQ1nstarQ1nstarQ1nstar
3150 - reQ3nQ1nQ2nstarQ2nstar+4.*reQ4nQ3nstarQ1nstar+reQ4nQ2nstarQ2nstar
3151 - (2.*dMult-13.)*reQ3nQ2nstarQ1nstar+7.*reQ2nQ1nstarQ1nstar
3152 - 2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
3153 + 2.*(dMult-5.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3154 - 2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3155 + 2.*(dMult-6.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3156 - 2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3157 - pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
3158 + 2.*(3.*dMult-11.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-4.*dMult*(dMult-6.))
3159 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3160 // Average 5-particle correlations for single event:
3161 fIntFlowCorrelationsAllEBE->SetBinContent(19,five2n1n1n1n1n);
3162 fIntFlowCorrelationsAllEBE->SetBinContent(20,five2n2n2n1n1n);
3163 fIntFlowCorrelationsAllEBE->SetBinContent(21,five3n1n2n1n1n);
3164 fIntFlowCorrelationsAllEBE->SetBinContent(22,five4n1n1n1n1n);
3165 // Average 5-particle correlations for all events:
3166 fIntFlowCorrelationsAllPro->Fill(18.5,five2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3167 fIntFlowCorrelationsAllPro->Fill(19.5,five2n2n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3168 fIntFlowCorrelationsAllPro->Fill(20.5,five3n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3169 fIntFlowCorrelationsAllPro->Fill(21.5,five4n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3170 // Average 5-particle correlations vs M for all events:
3171 if(fCalculateAllCorrelationsVsM)
3173 fIntFlowCorrelationsAllVsMPro[18]->Fill(dMult+0.5,five2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3174 fIntFlowCorrelationsAllVsMPro[19]->Fill(dMult+0.5,five2n2n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3175 fIntFlowCorrelationsAllVsMPro[20]->Fill(dMult+0.5,five3n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3176 fIntFlowCorrelationsAllVsMPro[21]->Fill(dMult+0.5,five4n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3178 } // end of if(dMult>4)
3181 Double_t six1n1n1n1n1n1n = 0.; // <cos(n(phi1+phi2+phi3-phi4-phi5-phi6))>
3182 Double_t six2n2n1n1n1n1n = 0.; // <cos(n(2*phi1+2*phi2-phi3-phi4-phi5-phi6))>
3183 Double_t six3n1n1n1n1n1n = 0.; // <cos(n(3*phi1+phi2-phi3-phi4-phi5-phi6))>
3184 Double_t six2n1n1n2n1n1n = 0.; // <cos(n(2*phi1+phi2+phi3-2*phi4-phi5-phi6))>
3187 six1n1n1n1n1n1n = (pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),3.)-6.*reQ2nQ1nQ1nstarQ1nstarQ1nstar
3188 + 4.*reQ3nQ1nstarQ1nstarQ1nstar-12.*reQ3nQ2nstarQ1nstar+18.*(dMult-4.)*reQ2nQ1nstarQ1nstar
3189 + 9.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3190 + 4.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))-9.*(dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3191 - 9.*(dMult-4.)*pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
3192 + 18.*(dMult*dMult-7.*dMult+10.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3193 - 6.*dMult*(dMult*dMult-9.*dMult+20.))
3194 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3195 six2n1n1n2n1n1n = (dQ2nQ1nQ1nQ2nstarQ1nstarQ1nstar-4.*reQ3nQ1nQ2nstarQ1nstarQ1nstar
3196 - 4.*reQ2nQ1nQ1nstarQ1nstarQ1nstar-2.*reQ2nQ2nQ2nstarQ1nstarQ1nstar
3197 + 4.*reQ4nQ2nstarQ1nstarQ1nstar+4.*reQ3nQ1nQ2nstarQ2nstar+4.*reQ3nQ1nstarQ1nstarQ1nstar
3198 - 8.*reQ4nQ3nstarQ1nstar-4.*reQ4nQ2nstarQ2nstar+4.*(2.*dMult-13.)*reQ3nQ2nstarQ1nstar
3199 + 2.*(7.*dMult-34.)*reQ2nQ1nstarQ1nstar+4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3200 - 4.*(dMult-7.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3201 + 4.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))-4.*(dMult-6.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3202 + pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)+(2.*dMult*dMult-27.*dMult+76.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3203 - (dMult-12.)*pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
3204 + 4.*(dMult*dMult-15.*dMult+34.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3205 - 2.*dMult*(dMult*dMult-17.*dMult+60.))
3206 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3207 six2n2n1n1n1n1n = (reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar-6.*reQ2nQ2nQ2nstarQ1nstarQ1nstar-reQ4nQ1nstarQ1nstarQ1nstarQ1nstar
3208 - 8.*reQ2nQ1nQ1nstarQ1nstarQ1nstar+8.*reQ3nQ1nstarQ1nstarQ1nstar+6.*reQ4nQ2nstarQ1nstarQ1nstar
3209 + 8.*reQ3nQ1nQ2nstarQ2nstar-40.*reQ3nQ2nstarQ1nstar-8.*reQ4nQ3nstarQ1nstar-9.*reQ4nQ2nstarQ2nstar
3210 + 24.*(dMult-4.)*reQ2nQ1nstarQ1nstar+24.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3211 + 6.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+16.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3212 + 3.*pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)-12.*(2.*dMult-7.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3213 + 12.*pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)-48.*(dMult-3.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3214 + 24.*dMult*(dMult-5.))
3215 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3216 six3n1n1n1n1n1n = (reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar-6.*reQ3nQ1nQ2nstarQ1nstarQ1nstar+6.*reQ4nQ2nstarQ1nstarQ1nstar
3217 - reQ4nQ1nstarQ1nstarQ1nstarQ1nstar-4.*reQ2nQ1nQ1nstarQ1nstarQ1nstar+3.*reQ3nQ1nQ2nstarQ2nstar
3218 - 4.*(dMult-5.)*reQ3nQ1nstarQ1nstarQ1nstar-14.*reQ4nQ3nstarQ1nstar
3219 - 3.*reQ4nQ2nstarQ2nstar+4.*(3.*dMult-17.)*reQ3nQ2nstarQ1nstar+12.*(dMult-6.)*reQ2nQ1nstarQ1nstar
3220 + 12.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3221 + 8.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3222 + 6.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))-8.*(dMult-5.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3223 - 12.*(dMult-5.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-48.*(dMult-3.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3224 + 12.*pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)+24.*dMult*(dMult-5.))
3225 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3226 // Average 6-particle correlations for single event:
3227 fIntFlowCorrelationsAllEBE->SetBinContent(24,six1n1n1n1n1n1n);
3228 fIntFlowCorrelationsAllEBE->SetBinContent(25,six2n1n1n2n1n1n);
3229 fIntFlowCorrelationsAllEBE->SetBinContent(26,six2n2n1n1n1n1n);
3230 fIntFlowCorrelationsAllEBE->SetBinContent(27,six3n1n1n1n1n1n);
3231 // Average 6-particle correlations for all events:
3232 fIntFlowCorrelationsAllPro->Fill(23.5,six1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3233 fIntFlowCorrelationsAllPro->Fill(24.5,six2n1n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3234 fIntFlowCorrelationsAllPro->Fill(25.5,six2n2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3235 fIntFlowCorrelationsAllPro->Fill(26.5,six3n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3236 // Average 6-particle correlations vs M for all events:
3237 if(fCalculateAllCorrelationsVsM)
3239 fIntFlowCorrelationsAllVsMPro[23]->Fill(dMult+0.5,six1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3240 fIntFlowCorrelationsAllVsMPro[24]->Fill(dMult+0.5,six2n1n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3241 fIntFlowCorrelationsAllVsMPro[25]->Fill(dMult+0.5,six2n2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3242 fIntFlowCorrelationsAllVsMPro[26]->Fill(dMult+0.5,six3n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3244 // Store separetately <6>:
3245 fIntFlowCorrelationsEBE->SetBinContent(3,six1n1n1n1n1n1n); // <6>
3246 // Testing other multiplicity weights:
3247 Double_t mWeight6p = 0.;
3248 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
3250 mWeight6p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.);
3251 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
3254 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
3258 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(3,mWeight6p); // eW_<6>
3259 fIntFlowCorrelationsPro->Fill(2.5,six1n1n1n1n1n1n,mWeight6p);
3260 fIntFlowSquaredCorrelationsPro->Fill(2.5,six1n1n1n1n1n1n*six1n1n1n1n1n1n,mWeight6p);
3261 if(fCalculateCumulantsVsM)
3263 fIntFlowCorrelationsVsMPro[2]->Fill(dMult+0.5,six1n1n1n1n1n1n,mWeight6p);
3264 fIntFlowSquaredCorrelationsVsMPro[2]->Fill(dMult+0.5,six1n1n1n1n1n1n*six1n1n1n1n1n1n,mWeight6p);
3266 } // end of if(dMult>5)
3269 Double_t seven2n1n1n1n1n1n1n = 0.; // <cos(n(2*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
3272 seven2n1n1n1n1n1n1n = (reQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar-4.*pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),3.)
3273 - reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar-2.*reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar
3274 + 9.*reQ2nQ2nQ2nstarQ1nstarQ1nstar+20.*reQ3nQ1nQ2nstarQ1nstarQ1nstar
3275 + 2.*reQ4nQ1nstarQ1nstarQ1nstarQ1nstar-8.*(dMult-8.)*reQ2nQ1nQ1nstarQ1nstarQ1nstar
3276 - 18.*reQ4nQ2nstarQ1nstarQ1nstar-14.*reQ3nQ1nQ2nstarQ2nstar
3277 + 8.*(dMult-7.)*reQ3nQ1nstarQ1nstarQ1nstar+28.*reQ4nQ3nstarQ1nstar
3278 + 12.*reQ4nQ2nstarQ2nstar-8.*(5.*dMult-31.)*reQ3nQ2nstarQ1nstar
3279 + 12.*(dMult*dMult-15.*dMult+46.)*reQ2nQ1nstarQ1nstar
3280 - 16.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3281 - 6.*pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),2.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3282 - 3.*pow(pow(dReQ2n,2.)+pow(dImQ2n,2.),2.)
3283 + 12.*(2.*dMult-13.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3284 - 12.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+16.*(dMult-6.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3285 - 12.*(dMult-8.)*(dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3286 + 12.*(3.*dMult-14.)*pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),2.)
3287 - 24.*(3.*dMult-7.)*(dMult-6.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3288 + 24.*dMult*(dMult-5.)*(dMult-6.))
3289 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.));
3290 // Average 7-particle correlations for single event:
3291 fIntFlowCorrelationsAllEBE->SetBinContent(29,seven2n1n1n1n1n1n1n);
3292 // Average 7-particle correlations for all events:
3293 fIntFlowCorrelationsAllPro->Fill(28.5,seven2n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)
3294 *(dMult-4.)*(dMult-5.)*(dMult-6.));
3295 // Average 7-particle correlations vs M for all events:
3296 if(fCalculateAllCorrelationsVsM)
3298 fIntFlowCorrelationsAllVsMPro[28]->Fill(dMult+0.5,seven2n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)
3299 *(dMult-4.)*(dMult-5.)*(dMult-6.));
3301 } // end of if(dMult>6)
3304 Double_t eight1n1n1n1n1n1n1n1n = 0.; // <cos(n(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
3307 eight1n1n1n1n1n1n1n1n = (pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),4.)-12.*reQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar
3308 + 16.*reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar+6.*reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar
3309 - 12.*reQ4nQ1nstarQ1nstarQ1nstarQ1nstar-36.*reQ2nQ2nQ2nstarQ1nstarQ1nstar
3310 - 96.*reQ3nQ1nQ2nstarQ1nstarQ1nstar
3311 + 72.*reQ4nQ2nstarQ1nstarQ1nstar+48.*reQ3nQ1nQ2nstarQ2nstar
3312 - 64.*(dMult-6.)*reQ3nQ1nstarQ1nstarQ1nstar
3313 + 96.*(dMult-6.)*reQ2nQ1nQ1nstarQ1nstarQ1nstar
3314 - 96.*reQ4nQ3nstarQ1nstar-36.*reQ4nQ2nstarQ2nstar
3315 + 192.*(dMult-6.)*reQ3nQ2nstarQ1nstar
3316 - 144.*(dMult-7.)*(dMult-4.)*reQ2nQ1nstarQ1nstar
3317 + 64.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3318 - 144.*(dMult-6.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3319 + 72.*(dMult-7.)*(dMult-4.)*(pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),2.)+pow(dReQ2n,2.)+pow(dImQ2n,2.))
3320 - 96.*(dMult-7.)*(dMult-6.)*(dMult-2.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3321 + 36.*pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),2.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3322 + 9.*pow(pow(dReQ2n,2.)+pow(dImQ2n,2.),2.)
3323 - 64.*(dMult-6.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3324 + 36.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
3325 - 16.*(dMult-6.)*pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),3.)
3326 + 24.*dMult*(dMult-7.)*(dMult-6.)*(dMult-5.))
3327 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.));
3328 // Average 8-particle correlations for single event:
3329 fIntFlowCorrelationsAllEBE->SetBinContent(31,eight1n1n1n1n1n1n1n1n);
3330 // Average 8-particle correlations for all events:
3331 fIntFlowCorrelationsAllPro->Fill(30.5,eight1n1n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)
3332 *(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.));
3333 // Average 8-particle correlations vs M for all events:
3334 if(fCalculateAllCorrelationsVsM)
3336 fIntFlowCorrelationsAllVsMPro[30]->Fill(dMult+0.5,eight1n1n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)
3337 *(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.));
3339 // Store separetately <8>:
3340 fIntFlowCorrelationsEBE->SetBinContent(4,eight1n1n1n1n1n1n1n1n); // <8>
3341 // Testing other multiplicity weights:
3342 Double_t mWeight8p = 0.;
3343 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
3345 mWeight8p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.);
3346 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
3349 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
3353 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(4,mWeight8p); // eW_<8>
3354 fIntFlowCorrelationsPro->Fill(3.5,eight1n1n1n1n1n1n1n1n,mWeight8p);
3355 fIntFlowSquaredCorrelationsPro->Fill(3.5,eight1n1n1n1n1n1n1n1n*eight1n1n1n1n1n1n1n1n,mWeight8p);
3356 if(fCalculateCumulantsVsM)
3358 fIntFlowCorrelationsVsMPro[3]->Fill(dMult+0.5,eight1n1n1n1n1n1n1n1n,mWeight8p);
3359 fIntFlowSquaredCorrelationsVsMPro[3]->Fill(dMult+0.5,eight1n1n1n1n1n1n1n1n*eight1n1n1n1n1n1n1n1n,mWeight8p);
3361 } // end of if(dMult>7)
3363 // EXTRA correlations for v3{5} study:
3365 Double_t four4n2n3n3n = 0.; // <cos(n(4*phi1+2*phi2-3*phi3-3*phi4))>
3368 four4n2n3n3n = (reQ4nQ2nQ3nstarQ3nstar-reQ6nQ4nstarQ2nstar-reQ6nQ3nstarQ3nstar
3369 - 2.*reQ4nQ3nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar
3370 + (pow(dReQ6n,2.)+pow(dImQ6n,2.))+2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
3371 + 2.*(2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3372 + (pow(dReQ1n,2.)+pow(dImQ1n,2.))-3.*dMult))
3373 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3374 fIntFlowCorrelationsAllPro->Fill(32.5,four4n2n3n3n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3375 // Average 4-particle correlations vs M for all events:
3376 if(fCalculateAllCorrelationsVsM)
3378 fIntFlowCorrelationsAllVsMPro[32]->Fill(dMult+0.5,four4n2n3n3n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3380 } // end of if(dMult>3.)
3383 Double_t five3n3n2n2n2n = 0.; // <cos(n(3*phi1+3*phi2-2*phi3-2*phi4-2*phi5))>
3386 five3n3n2n2n2n = (reQ3nQ3nQ2nstarQ2nstarQ2nstar-reQ6nQ2nstarQ2nstarQ2nstar-3.*reQ4nQ2nQ3nstarQ3nstar
3387 - 6.*reQ3nQ1nQ2nstarQ2nstar+2.*reQ6nQ3nstarQ3nstar+3.*reQ6nQ4nstarQ2nstar
3388 + 6.*reQ4nQ3nstarQ1nstar+6.*reQ4nQ2nstarQ2nstar
3389 + 12.*reQ3nQ2nstarQ1nstar+6.*reQ2nQ1nstarQ1nstar
3390 - 2.*((pow(dReQ6n,2.)+pow(dImQ6n,2.))
3391 + 3.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
3392 + 6.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3393 + 9.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3394 + 6.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-12.*dMult))
3395 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3396 fIntFlowCorrelationsAllPro->Fill(33.5,five3n3n2n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3397 if(fCalculateAllCorrelationsVsM)
3399 fIntFlowCorrelationsAllVsMPro[33]->Fill(dMult+0.5,five3n3n2n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3401 } // end of if(dMult>4.)
3403 // EXTRA correlations for Teaney-Yan study:
3405 Double_t two5n5n = 0.; // <cos(5n(phi1-phi2))>
3406 Double_t two6n6n = 0.; // <cos(6n(phi1-phi2))>
3409 two5n5n = (pow(dReQ5n,2.)+pow(dImQ5n,2.)-dMult)/(dMult*(dMult-1.));
3410 two6n6n = (pow(dReQ6n,2.)+pow(dImQ6n,2.)-dMult)/(dMult*(dMult-1.));
3411 // Average 2-particle correlations for all events:
3412 fIntFlowCorrelationsAllPro->Fill(34.5,two5n5n,dMult*(dMult-1.));
3413 fIntFlowCorrelationsAllPro->Fill(35.5,two6n6n,dMult*(dMult-1.));
3414 if(fCalculateAllCorrelationsVsM)
3416 fIntFlowCorrelationsAllVsMPro[34]->Fill(dMult+0.5,two5n5n,dMult*(dMult-1.));
3417 fIntFlowCorrelationsAllVsMPro[35]->Fill(dMult+0.5,two6n6n,dMult*(dMult-1.));
3419 } // end of if(dMult>1)
3422 Double_t three5n3n2n = 0.; // <cos(n(5*phi1-3*phi2-2*phi3)>
3423 Double_t three5n4n1n = 0.; // <cos(n(5*phi1-4*phi2-1*phi3)>
3424 Double_t three6n3n3n = 0.; // <cos(n(6*phi1-3*phi2-3*phi3)>
3425 Double_t three6n4n2n = 0.; // <cos(n(6*phi1-4*phi2-2*phi3)>
3426 Double_t three6n5n1n = 0.; // <cos(n(6*phi1-5*phi2-1*phi3)>
3429 three5n3n2n = (reQ5nQ3nstarQ2nstar-(pow(dReQ5n,2.)+pow(dImQ5n,2.))
3430 - (pow(dReQ3n,2.)+pow(dImQ3n,2.))
3431 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))+2.*dMult)
3432 / (dMult*(dMult-1.)*(dMult-2.));
3433 three5n4n1n = (reQ5nQ4nstarQ1nstar-(pow(dReQ5n,2.)+pow(dImQ5n,2.))
3434 - (pow(dReQ4n,2.)+pow(dImQ4n,2.))
3435 - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)
3436 / (dMult*(dMult-1.)*(dMult-2.));
3437 three6n3n3n = (reQ6nQ3nstarQ3nstar-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3438 - (pow(dReQ6n,2.)+pow(dImQ6n,2.))+2.*dMult)
3439 / (dMult*(dMult-1.)*(dMult-2.));
3440 three6n4n2n = (reQ6nQ4nstarQ2nstar-(pow(dReQ6n,2.)+pow(dImQ6n,2.))
3441 - (pow(dReQ4n,2.)+pow(dImQ4n,2.))
3442 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))+2.*dMult)
3443 / (dMult*(dMult-1.)*(dMult-2.));
3444 three6n5n1n = (reQ6nQ5nstarQ1nstar-(pow(dReQ6n,2.)+pow(dImQ6n,2.))
3445 - (pow(dReQ5n,2.)+pow(dImQ5n,2.))
3446 - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)
3447 / (dMult*(dMult-1.)*(dMult-2.));
3448 // Average 3-particle correlations for all events:
3449 fIntFlowCorrelationsAllPro->Fill(36.5,three5n3n2n,dMult*(dMult-1.)*(dMult-2.)); // <<cos(n(5*phi1-3*phi2-2*phi3)>>
3450 fIntFlowCorrelationsAllPro->Fill(37.5,three5n4n1n,dMult*(dMult-1.)*(dMult-2.)); // <<cos(n(5*phi1-4*phi2-1*phi3)>>
3451 fIntFlowCorrelationsAllPro->Fill(38.5,three6n3n3n,dMult*(dMult-1.)*(dMult-2.)); // <<cos(n(6*phi1-3*phi2-3*phi3)>>
3452 fIntFlowCorrelationsAllPro->Fill(39.5,three6n4n2n,dMult*(dMult-1.)*(dMult-2.)); // <<cos(n(6*phi1-4*phi2-2*phi3)>>
3453 fIntFlowCorrelationsAllPro->Fill(40.5,three6n5n1n,dMult*(dMult-1.)*(dMult-2.)); // <<cos(n(6*phi1-5*phi2-1*phi3)>>
3454 if(fCalculateAllCorrelationsVsM)
3456 fIntFlowCorrelationsAllVsMPro[36]->Fill(dMult+0.5,three5n3n2n,dMult*(dMult-1.)*(dMult-2.));
3457 fIntFlowCorrelationsAllVsMPro[37]->Fill(dMult+0.5,three5n4n1n,dMult*(dMult-1.)*(dMult-2.));
3458 fIntFlowCorrelationsAllVsMPro[38]->Fill(dMult+0.5,three6n3n3n,dMult*(dMult-1.)*(dMult-2.));
3459 fIntFlowCorrelationsAllVsMPro[39]->Fill(dMult+0.5,three6n4n2n,dMult*(dMult-1.)*(dMult-2.));
3460 fIntFlowCorrelationsAllVsMPro[40]->Fill(dMult+0.5,three6n5n1n,dMult*(dMult-1.)*(dMult-2.));
3462 } // end of if(dMult>2)
3465 Double_t four6n3n2n1n = 0.; // <cos(n(6*phi1-3*phi2-2*phi3-1*phi4)>
3466 Double_t four3n2n3n2n = 0.; // <cos(n(3*phi1+2*phi2-3*phi3-2*phi4)>
3467 Double_t four4n1n3n2n = 0.; // <cos(n(4*phi1+1*phi2-3*phi3-2*phi4)>
3468 Double_t four3n3n3n3n = 0.; // <cos(3n(phi1+phi2-phi3-phi4))>
3469 //Double_t four4n2n3n3n = 0.; // <cos(n(4*phi1+2*phi2-3*phi3-3*phi4)> // I already have this one above
3470 Double_t four5n1n3n3n = 0.; // <cos(n(5*phi1+1*phi2-3*phi3-3*phi4)>
3471 Double_t four4n2n4n2n = 0.; // <cos(n(4*phi1+2*phi2-4*phi3-2*phi4)>
3472 Double_t four5n1n4n2n = 0.; // <cos(n(5*phi1+1*phi2-4*phi3-2*phi4)>
3473 Double_t four5n3n1n1n = 0.; // <cos(n(5*phi1-3*phi2-1*phi3-1*phi4)>
3474 Double_t four5n2n2n1n = 0.; // <cos(n(5*phi1-2*phi2-2*phi3-1*phi4)>
3475 Double_t four5n1n5n1n = 0.; // <cos(n(5*phi1+1*phi2-5*phi3-1*phi4)>
3476 Double_t four6n4n1n1n = 0.; // <cos(n(6*phi1-4*phi2-1*phi3-1*phi4)>
3477 Double_t four6n2n2n2n = 0.; // <cos(n(6*phi1-2*phi2-2*phi3-2*phi4)>
3480 four6n3n2n1n = (reQ6nQ3nstarQ2nstarQ1nstar-reQ6nQ4nstarQ2nstar-reQ6nQ3nstarQ3nstar-reQ6nQ5nstarQ1nstar
3481 - reQ5nQ3nstarQ2nstar-reQ4nQ3nstarQ1nstar-reQ3nQ2nstarQ1nstar
3482 + 2.*(pow(dReQ6n,2.)+pow(dImQ6n,2.))+pow(dReQ5n,2.)+pow(dImQ5n,2.)
3483 + pow(dReQ4n,2.)+pow(dImQ4n,2.)+3.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3484 + 2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))+2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-6.*dMult)
3485 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3486 four3n2n3n2n = (dQ3nQ2nQ3nstarQ2nstar-2.*reQ5nQ3nstarQ2nstar-2.*reQ3nQ2nstarQ1nstar
3487 + pow(dReQ5n,2.)+pow(dImQ5n,2.)+pow(dReQ1n,2.)+pow(dImQ1n,2.)
3488 -(dMult-4.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.)+pow(dReQ2n,2.)+pow(dImQ2n,2.))
3490 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3491 four4n1n3n2n = (reQ4nQ1nQ3nstarQ2nstar-reQ5nQ3nstarQ2nstar-reQ5nQ4nstarQ1nstar-reQ4nQ3nstarQ1nstar
3492 - reQ4nQ2nstarQ2nstar-reQ3nQ2nstarQ1nstar-reQ2nQ1nstarQ1nstar
3493 + pow(dReQ5n,2.)+pow(dImQ5n,2.)+2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
3494 + 2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+3.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3495 + 3.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-6.*dMult)
3496 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3497 four3n3n3n3n = (2.*dMult*(dMult-3.)+pow((pow(dReQ3n,2.)+pow(dImQ3n,2.)),2.)-4.*(dMult-2.)*(pow(dReQ3n,2.)
3498 + pow(dImQ3n,2.))-2.*reQ6nQ3nstarQ3nstar+(pow(dReQ6n,2.)+pow(dImQ6n,2.)))
3499 / (dMult*(dMult-1)*(dMult-2.)*(dMult-3.));
3500 //four4n2n3n3n = ; // I already have this one above
3501 four5n1n3n3n = (reQ5nQ1nQ3nstarQ3nstar-reQ6nQ5nstarQ1nstar-reQ6nQ3nstarQ3nstar-2.*reQ5nQ3nstarQ2nstar
3502 - 2.*reQ3nQ2nstarQ1nstar+pow(dReQ6n,2.)+pow(dImQ6n,2.)+2.*(pow(dReQ5n,2.)+pow(dImQ5n,2.))
3503 + 4.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3504 + 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-6.*dMult)
3505 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3506 four4n2n4n2n = (dQ4nQ2nQ4nstarQ2nstar-2.*reQ6nQ4nstarQ2nstar-2.*reQ4nQ2nstarQ2nstar)
3507 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
3508 - ((dMult-5.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3509 + (dMult-4.)*(pow(dReQ4n,2.)+pow(dImQ4n,2.))-(pow(dReQ6n,2.)+pow(dImQ6n,2.)))
3510 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))
3511 + (dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.));
3512 four5n1n4n2n = (reQ5nQ1nQ4nstarQ2nstar-reQ6nQ5nstarQ1nstar-reQ6nQ4nstarQ2nstar-reQ5nQ4nstarQ1nstar
3513 - reQ5nQ3nstarQ2nstar-reQ4nQ3nstarQ1nstar-reQ2nQ1nstarQ1nstar+pow(dReQ6n,2.)+pow(dImQ6n,2.)
3514 + 2.*(pow(dReQ5n,2.)+pow(dImQ5n,2.))+2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
3515 + pow(dReQ3n,2.)+pow(dImQ3n,2.)+2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3516 + 3.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-6.*dMult)
3517 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3518 four5n3n1n1n = (reQ5nQ3nstarQ1nstarQ1nstar-2.*reQ5nQ4nstarQ1nstar-reQ5nQ3nstarQ2nstar-2.*reQ4nQ3nstarQ1nstar
3519 - reQ2nQ1nstarQ1nstar+2.*(pow(dReQ5n,2.)+pow(dImQ5n,2.))+2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
3520 + 2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+pow(dReQ2n,2.)+pow(dImQ2n,2.)
3521 + 4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-6.*dMult)
3522 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3523 four5n2n2n1n = (reQ5nQ2nstarQ2nstarQ1nstar-reQ5nQ4nstarQ1nstar-2.*reQ5nQ3nstarQ2nstar-reQ4nQ2nstarQ2nstar
3524 - 2.*reQ3nQ2nstarQ1nstar+2.*(pow(dReQ5n,2.)+pow(dImQ5n,2.))+pow(dReQ4n,2.)+pow(dImQ4n,2.)
3525 + 2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+4.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3526 + 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-6.*dMult)
3527 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3528 four5n1n5n1n = (dQ5nQ1nQ5nstarQ1nstar-2.*reQ6nQ5nstarQ1nstar-2.*reQ5nQ4nstarQ1nstar
3529 + pow(dReQ6n,2.)+pow(dImQ6n,2.)-(dMult-4.)*(pow(dReQ5n,2.)+pow(dImQ5n,2.))
3530 + pow(dReQ4n,2.)+pow(dImQ4n,2.)-(dMult-4.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))+dMult*(dMult-6.))
3531 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3533 four6n4n1n1n = (reQ6nQ4nstarQ1nstarQ1nstar
3534 - dMult*(dMult-1.)*(dMult-2.)*(three2n1n1n+2.*three5n4n1n+2.*three6n5n1n+three6n4n2n)
3535 - dMult*(dMult-1.)*(2.*two1n1n+1.*two4n4n+1.*two6n6n+1.*two2n2n+2.*two5n5n)
3537 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3539 four6n2n2n2n = (reQ6nQ2nstarQ2nstarQ2nstar-3.*reQ6nQ4nstarQ2nstar-3.*reQ4nQ2nstarQ2nstar
3540 + 2.*(pow(dReQ6n,2.)+pow(dImQ6n,2.))+3.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
3541 + 6.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-6.*dMult)
3542 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3543 // Average 4-particle correlations for all events:
3544 fIntFlowCorrelationsAllPro->Fill(41.5,four6n3n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3545 fIntFlowCorrelationsAllPro->Fill(42.5,four3n2n3n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3546 fIntFlowCorrelationsAllPro->Fill(43.5,four4n1n3n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3547 fIntFlowCorrelationsAllPro->Fill(44.5,four3n3n3n3n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3548 //fIntFlowCorrelationsAllPro->Fill(45.5,four4n2n3n3n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)); // I already have this one above
3549 fIntFlowCorrelationsAllPro->Fill(46.5,four5n1n3n3n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3550 fIntFlowCorrelationsAllPro->Fill(47.5,four4n2n4n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3551 fIntFlowCorrelationsAllPro->Fill(48.5,four5n1n4n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3552 fIntFlowCorrelationsAllPro->Fill(49.5,four5n3n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3553 fIntFlowCorrelationsAllPro->Fill(50.5,four5n2n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3554 fIntFlowCorrelationsAllPro->Fill(51.5,four5n1n5n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3555 fIntFlowCorrelationsAllPro->Fill(58.5,four6n4n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3556 fIntFlowCorrelationsAllPro->Fill(59.5,four6n2n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3557 if(fCalculateAllCorrelationsVsM)
3559 fIntFlowCorrelationsAllVsMPro[41]->Fill(dMult+0.5,four6n3n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3560 fIntFlowCorrelationsAllVsMPro[42]->Fill(dMult+0.5,four3n2n3n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3561 fIntFlowCorrelationsAllVsMPro[43]->Fill(dMult+0.5,four4n1n3n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3562 fIntFlowCorrelationsAllVsMPro[44]->Fill(dMult+0.5,four3n3n3n3n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3563 //fIntFlowCorrelationsAllVsMPro[45]->Fill(dMult+0.5,four4n2n3n3n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3564 fIntFlowCorrelationsAllVsMPro[46]->Fill(dMult+0.5,four5n1n3n3n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3565 fIntFlowCorrelationsAllVsMPro[47]->Fill(dMult+0.5,four4n2n4n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3566 fIntFlowCorrelationsAllVsMPro[48]->Fill(dMult+0.5,four5n1n4n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3567 fIntFlowCorrelationsAllVsMPro[49]->Fill(dMult+0.5,four5n3n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3568 fIntFlowCorrelationsAllVsMPro[50]->Fill(dMult+0.5,four5n2n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3569 fIntFlowCorrelationsAllVsMPro[51]->Fill(dMult+0.5,four5n1n5n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3570 fIntFlowCorrelationsAllVsMPro[58]->Fill(dMult+0.5,four6n4n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3571 fIntFlowCorrelationsAllVsMPro[59]->Fill(dMult+0.5,four6n2n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
3573 } // end of if(dMult>3)
3576 Double_t five3n3n3n2n1n = 0.; // <cos(n(3*phi1+3*phi2-3*phi3-2*phi4-1*phi5)>
3577 Double_t five4n2n3n2n1n = 0.; // <cos(n(4*phi1+2*phi2-3*phi3-2*phi4-1*phi5)>
3578 Double_t five3n2n3n1n1n = 0.; // <cos(n(3*phi1+2*phi2-3*phi3-1*phi4-1*phi5)>
3579 Double_t five3n2n2n2n1n = 0.; // <cos(n(3*phi1+2*phi2-2*phi3-2*phi4-1*phi5)>
3580 Double_t five5n1n3n2n1n = 0.; // <cos(n(5*phi1+1*phi2-3*phi3-2*phi4-1*phi5)>
3581 Double_t five6n2n2n1n1n = 0.; // <cos(n(6*phi1-2*phi2-2*phi3-1*phi4-1*phi5)>
3582 Double_t five4n1n1n3n3n = 0.; // <cos(n(4*phi1+1*phi2+1*phi3-3*phi4-3*phi5)>
3585 five3n3n3n2n1n = (reQ3nQ3nQ3nstarQ2nstarQ1nstar-reQ6nQ3nstarQ2nstarQ1nstar-reQ5nQ1nQ3nstarQ3nstar-reQ4nQ2nQ3nstarQ3nstar
3586 + reQ6nQ5nstarQ1nstar+reQ6nQ4nstarQ2nstar+3.*reQ6nQ3nstarQ3nstar+4.*reQ5nQ3nstarQ2nstar+4.*reQ4nQ3nstarQ1nstar
3587 - 2.*(dMult-6.)*reQ3nQ2nstarQ1nstar-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3588 - 2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3589 - 2.*(pow(dReQ6n,2.)+pow(dImQ6n,2.))-2.*(pow(dReQ5n,2.)+pow(dImQ5n,2.))
3590 - 2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+2.*(3.*dMult-10.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3591 - pow((pow(dReQ3n,2.)+pow(dImQ3n,2.)),2.)+2.*(dMult-5.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3592 + 2.*(dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-4.*dMult*(dMult-6.))
3593 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3594 five4n2n3n2n1n = (reQ4nQ2nQ3nstarQ2nstarQ1nstar-reQ6nQ3nstarQ2nstarQ1nstar-reQ5nQ1nQ4nstarQ2nstar
3595 - reQ4nQ2nQ3nstarQ3nstar-reQ4nQ1nQ3nstarQ2nstar-reQ4nQ2nstarQ1nstarQ1nstar
3596 - reQ3nQ1nQ2nstarQ2nstar-(pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3597 + 3.*reQ6nQ4nstarQ2nstar+reQ6nQ5nstarQ1nstar+reQ6nQ3nstarQ3nstar+reQ5nQ4nstarQ1nstar
3598 + 3.*reQ5nQ3nstarQ2nstar-(dMult-7.)*reQ4nQ3nstarQ1nstar+3.*reQ4nQ2nstarQ2nstar+7.*reQ3nQ2nstarQ1nstar
3599 + 4.*reQ2nQ1nstarQ1nstar-(pow(dReQ4n,2.)+pow(dImQ4n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3600 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3601 - 2.*(pow(dReQ6n,2.)+pow(dImQ6n,2.))-2.*(pow(dReQ5n,2.)+pow(dImQ5n,2.))
3602 + (dMult-8.)*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+(dMult-10.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3603 + 2.*(dMult-7.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))+(dMult-12.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3604 - 2.*dMult*(dMult-12.))
3605 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3606 five3n2n3n1n1n = (reQ3nQ2nQ3nstarQ1nstarQ1nstar-reQ5nQ3nstarQ1nstarQ1nstar-2.*reQ4nQ1nQ3nstarQ2nstar-reQ3nQ1nstarQ1nstarQ1nstar
3607 - 2.*reQ3nQ1nQ2nstarQ2nstar+2.*reQ5nQ4nstarQ1nstar+3.*reQ5nQ3nstarQ2nstar+6.*reQ4nQ3nstarQ1nstar
3608 + 2.*reQ4nQ2nstarQ2nstar+9.*reQ3nQ2nstarQ1nstar-(dMult-8.)*reQ2nQ1nstarQ1nstar
3609 - (pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3610 - 2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3611 - 2.*(pow(dReQ5n,2.)+pow(dImQ5n,2.))-4.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
3612 + 2.*(dMult-6.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+(dMult-12.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3613 + 2.*(dMult-9.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-2.*dMult*(dMult-12.))
3614 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3615 five3n2n2n2n1n = (reQ3nQ2nQ2nstarQ2nstarQ1nstar-reQ5nQ2nstarQ2nstarQ1nstar-reQ4nQ1nQ3nstarQ2nstar-reQ3nQ1nQ2nstarQ2nstar
3616 - 2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))+reQ5nQ4nstarQ1nstar
3617 + 4.*reQ5nQ3nstarQ2nstar+reQ4nQ3nstarQ1nstar+3.*reQ4nQ2nstarQ2nstar-2.*(dMult-6.)*reQ3nQ2nstarQ1nstar
3618 + 4.*reQ2nQ1nstarQ1nstar-2.*(pow(dReQ5n,2.)+pow(dImQ5n,2.))
3619 - 2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+2.*(dMult-5.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3620 - 2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3621 - pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)+2.*(3.*dMult-10.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3622 + 2.*(dMult-6.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-4.*dMult*(dMult-6.))
3623 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3624 five5n1n3n2n1n = (reQ5nQ1nQ3nstarQ2nstarQ1nstar-reQ6nQ3nstarQ2nstarQ1nstar-reQ5nQ1nQ4nstarQ2nstar-reQ5nQ1nQ3nstarQ3nstar
3625 - reQ4nQ1nQ3nstarQ2nstar-reQ5nQ3nstarQ1nstarQ1nstar-reQ5nQ2nstarQ2nstarQ1nstar
3626 + 3.*reQ6nQ5nstarQ1nstar+reQ6nQ4nstarQ2nstar+reQ6nQ3nstarQ3nstar+4.*reQ5nQ4nstarQ1nstar
3627 - (dMult-7.)*reQ5nQ3nstarQ2nstar+4.*reQ4nQ3nstarQ1nstar+reQ4nQ2nstarQ2nstar+6.*reQ3nQ2nstarQ1nstar
3628 + 3.*reQ2nQ1nstarQ1nstar-(pow(dReQ5n,2.)+pow(dImQ5n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3629 - (pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3630 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3631 - 2.*(pow(dReQ6n,2.)+pow(dImQ6n,2.))+(dMult-8.)*(pow(dReQ5n,2.)+pow(dImQ5n,2.))
3632 - 4.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+(dMult-10.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3633 + (dMult-10.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))+2.*(dMult-7.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3634 - 2.*dMult*(dMult-12.))
3635 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3637 // five6n2n2n1n1n = ;
3638 // five4n1n1n3n3n = ;
3640 // Average 5-particle correlations for all events:
3641 fIntFlowCorrelationsAllPro->Fill(52.5,five3n3n3n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3642 fIntFlowCorrelationsAllPro->Fill(53.5,five4n2n3n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3643 fIntFlowCorrelationsAllPro->Fill(54.5,five3n2n3n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3644 fIntFlowCorrelationsAllPro->Fill(55.5,five3n2n2n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3645 fIntFlowCorrelationsAllPro->Fill(56.5,five5n1n3n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3646 fIntFlowCorrelationsAllPro->Fill(60.5,five6n2n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3647 fIntFlowCorrelationsAllPro->Fill(61.5,five4n1n1n3n3n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3648 if(fCalculateAllCorrelationsVsM)
3650 fIntFlowCorrelationsAllVsMPro[52]->Fill(dMult+0.5,five3n3n3n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3651 fIntFlowCorrelationsAllVsMPro[53]->Fill(dMult+0.5,five4n2n3n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3652 fIntFlowCorrelationsAllVsMPro[54]->Fill(dMult+0.5,five3n2n3n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3653 fIntFlowCorrelationsAllVsMPro[55]->Fill(dMult+0.5,five3n2n2n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3654 fIntFlowCorrelationsAllVsMPro[56]->Fill(dMult+0.5,five5n1n3n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3655 fIntFlowCorrelationsAllVsMPro[60]->Fill(dMult+0.5,five6n2n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3656 fIntFlowCorrelationsAllVsMPro[61]->Fill(dMult+0.5,five4n1n1n3n3n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
3658 } // end of if(dMult>4)
3661 Double_t six3n2n1n3n2n1n = 0.; // <cos(n(3*phi1+2*phi2+1*phi3-3*phi4-2*phi5-1*phi6)>
3662 Double_t six3n3n2n2n1n1n = 0.; // <cos(n(3*phi1+3*phi2-2*phi3-2*phi4-1*phi5-1*phi6)>
3665 six3n2n1n3n2n1n = (dQ3nQ2nQ1nQ3nstarQ2nstarQ1nstar-2.*reQ3nQ3nQ3nstarQ2nstarQ1nstar
3666 - 2.*reQ3nQ2nQ2nstarQ2nstarQ1nstar-2.*reQ3nQ1nQ2nstarQ1nstarQ1nstar
3667 - 2.*reQ3nQ2nQ3nstarQ1nstarQ1nstar-2.*reQ4nQ2nQ3nstarQ2nstarQ1nstar
3668 - 2.*reQ5nQ1nQ3nstarQ2nstarQ1nstar+4.*reQ6nQ3nstarQ2nstarQ1nstar
3669 + 2.*reQ5nQ1nQ4nstarQ2nstar+2.*reQ5nQ1nQ3nstarQ3nstar
3670 + 2.*reQ4nQ2nQ3nstarQ3nstar+6.*reQ4nQ1nQ3nstarQ2nstar
3671 + 2.*reQ5nQ3nstarQ1nstarQ1nstar+2.*reQ5nQ2nstarQ2nstarQ1nstar
3672 + 6.*reQ3nQ1nQ2nstarQ2nstar+2.*reQ4nQ2nstarQ1nstarQ1nstar
3673 - 4.*reQ6nQ5nstarQ1nstar-4.*reQ6nQ4nstarQ2nstar-6.*reQ5nQ4nstarQ1nstar
3674 - 4.*reQ6nQ3nstarQ3nstar+2.*(dMult-11.)*reQ5nQ3nstarQ2nstar
3675 + 2.*(dMult-13.)*reQ4nQ3nstarQ1nstar-8.*reQ4nQ2nstarQ2nstar
3676 + 2.*(5.*dMult-32.)*reQ3nQ2nstarQ1nstar+2.*reQ3nQ1nstarQ1nstarQ1nstar
3677 + 2.*(dMult-13.)*reQ2nQ1nstarQ1nstar
3678 - (dMult-10.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3679 + (pow(dReQ5n,2.)+pow(dImQ5n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3680 + (pow(dReQ4n,2.)+pow(dImQ4n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3681 - (dMult-11.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3682 - (dMult-10.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3683 + 4.*(pow(dReQ6n,2.)+pow(dImQ6n,2.))-(dMult-12.)*(pow(dReQ5n,2.)+pow(dImQ5n,2.))
3684 - (dMult-16.)*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+pow((pow(dReQ3n,2.)+pow(dImQ3n,2.)),2.)
3685 + (dMult*dMult-19.*dMult+68.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))
3686 + (dMult*dMult-19.*dMult+72.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
3687 + pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)+pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
3688 + (dMult*dMult-20.*dMult+80.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
3689 - dMult*(dMult-12.)*(dMult-10.))
3690 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3692 // six3n3n2n2n1n1n = ;
3694 // Average 6-particle correlations for all events:
3695 fIntFlowCorrelationsAllPro->Fill(57.5,six3n2n1n3n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3696 fIntFlowCorrelationsAllPro->Fill(62.5,six3n3n2n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3697 if(fCalculateAllCorrelationsVsM)
3699 fIntFlowCorrelationsAllVsMPro[57]->Fill(dMult+0.5,six3n2n1n3n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3700 fIntFlowCorrelationsAllVsMPro[62]->Fill(dMult+0.5,six3n3n2n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
3702 } // end of if(dMult>5.)
3704 } // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelations()
3706 //================================================================================================================================
3708 void AliFlowAnalysisWithQCumulants::StorePhiDistributionForOneEvent(AliFlowEventSimple *anEvent)
3710 // Store phi distribution for one event to illustrate flow.
3712 if(fPhiDistributionForOneEvent->GetEntries()>0){return;} // store only phi distribution for one event
3714 Double_t vMin = fPhiDistributionForOneEventSettings[0];
3715 Double_t vMax = fPhiDistributionForOneEventSettings[1];
3716 Double_t refMultMin = fPhiDistributionForOneEventSettings[2];
3717 Double_t refMultMax = fPhiDistributionForOneEventSettings[3];
3720 Double_t cumulant4thEBE = fIntFlowCorrelationsEBE->GetBinContent(2)-2.*pow(fIntFlowCorrelationsEBE->GetBinContent(1),2.);
3721 if(cumulant4thEBE<0.)
3723 vEBE = pow(-1.*cumulant4thEBE,0.25);
3724 if((vEBE>vMin && vEBE<vMax) && (fReferenceMultiplicityEBE>refMultMin && fReferenceMultiplicityEBE<refMultMax))
3726 fPhiDistributionForOneEvent->SetTitle(Form("v_{%i} = %f",fHarmonic,vEBE));
3727 for(Int_t p=0;p<anEvent->NumberOfTracks();p++)
3729 if(anEvent->GetTrack(p)->InRPSelection())
3731 fPhiDistributionForOneEvent->Fill(anEvent->GetTrack(p)->Phi());
3733 } // end of for(Int_t p=0;p<anEvent->NumberOfTracks();p++)
3736 fPhiDistributionForOneEvent->SetTitle(Form("v_{%i} = %f, out of specified boundaries",fHarmonic,vEBE));
3739 } // end of if(cumulant4thEBE<0.)
3741 } // end of void AliFlowAnalysisWithQCumulants::StorePhiDistributionForOneEvent(AliFlowEventSimple *anEvent)
3743 //================================================================================================================================
3745 void AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrelations()
3747 // Calculate averages of products of correlations for integrated flow.
3750 Double_t dMult = (*fSpk)(0,0);
3754 for(Int_t ci1=1;ci1<4;ci1++)
3756 for(Int_t ci2=ci1+1;ci2<=4;ci2++)
3758 fIntFlowProductOfCorrelationsPro->Fill(0.5+counter,
3759 fIntFlowCorrelationsEBE->GetBinContent(ci1)*
3760 fIntFlowCorrelationsEBE->GetBinContent(ci2),
3761 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
3762 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
3763 // products versus multiplicity: // [0=<<2><4>>,1=<<2><6>>,2=<<2><8>>,3=<<4><6>>,4=<<4><8>>,5=<<6><8>>]
3764 if(fCalculateCumulantsVsM)
3766 fIntFlowProductOfCorrelationsVsMPro[counter]->Fill(dMult+0.5, // to be improved: dMult => sum of weights ?
3767 fIntFlowCorrelationsEBE->GetBinContent(ci1)*
3768 fIntFlowCorrelationsEBE->GetBinContent(ci2),
3769 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
3770 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
3771 } // end of if(fCalculateCumulantsVsM)
3776 } // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrelations()
3779 //================================================================================================================================
3782 void AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrectionTermsForNUA()
3784 // Calculate averages of products of correction terms for NUA.
3786 // a) Binning of fIntFlowProductOfCorrectionTermsForNUAPro is organized as follows:
3787 // 1st bin: <<2><cos(phi)>>
3788 // 2nd bin: <<2><sin(phi)>>
3789 // 3rd bin: <<cos(phi)><sin(phi)>>
3790 // 4th bin: <<2><cos(phi1+phi2)>>
3791 // 5th bin: <<2><sin(phi1+phi2)>>
3792 // 6th bin: <<2><cos(phi1-phi2-phi3)>>
3793 // 7th bin: <<2><sin(phi1-phi2-phi3)>>
3794 // 8th bin: <<4><cos(phi1)>>
3795 // 9th bin: <<4><sin(phi1)>>
3796 // 10th bin: <<4><cos(phi1+phi2)>>
3797 // 11th bin: <<4><sin(phi1+phi2)>>
3798 // 12th bin: <<4><cos(phi1-phi2-phi3)>>
3799 // 13th bin: <<4><sin(phi1-phi2-phi3)>>
3800 // 14th bin: <<cos(phi1)><cos(phi1+phi2)>>
3801 // 15th bin: <<cos(phi1)><sin(phi1+phi2)>>
3802 // 16th bin: <<cos(phi1)><cos(phi1-phi2-phi3)>>
3803 // 17th bin: <<cos(phi1)><sin(phi1-phi2-phi3)>>
3804 // 18th bin: <<sin(phi1)><cos(phi1+phi2)>>
3805 // 19th bin: <<sin(phi1)><sin(phi1+phi2)>>
3806 // 20th bin: <<sin(phi1)><cos(phi1-phi2-phi3)>>
3807 // 21st bin: <<sin(phi1)><sin(phi1-phi2-phi3)>>
3808 // 22nd bin: <<cos(phi1+phi2)><sin(phi1+phi2)>>
3809 // 23rd bin: <<cos(phi1+phi2)><cos(phi1-phi2-phi3)>>
3810 // 24th bin: <<cos(phi1+phi2)><sin(phi1-phi2-phi3)>>
3811 // 25th bin: <<sin(phi1+phi2)><cos(phi1-phi2-phi3)>>
3812 // 26th bin: <<sin(phi1+phi2)><sin(phi1-phi2-phi3)>>
3813 // 27th bin: <<cos(phi1-phi2-phi3)><sin(phi1-phi2-phi3)>>
3816 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(0.5,
3817 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1),
3818 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3819 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
3821 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(1.5,
3822 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1),
3823 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3824 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
3825 // <<cos(phi)><sin(phi)>>:
3826 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(2.5,
3827 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1),
3828 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
3829 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
3830 // <<2><cos(phi1+phi2)>>:
3831 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(3.5,
3832 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
3833 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3834 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
3835 // <<2><sin(phi1+phi2)>>:
3836 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(4.5,
3837 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
3838 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3839 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
3840 // <<2><cos(phi1-phi2-phi3)>>:
3841 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(5.5,
3842 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3843 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3844 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3845 // <<2><sin(phi1-phi2-phi3)>>:
3846 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(6.5,
3847 fIntFlowCorrelationsEBE->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3848 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)
3849 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3850 // <<4><cos(phi1)>>:
3851 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(7.5,
3852 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1),
3853 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3854 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
3855 // <<4><sin(phi1)>>:
3856 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(8.5,
3857 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1),
3858 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3859 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
3860 // <<4><cos(phi1+phi2)>>:
3861 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(9.5,
3862 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
3863 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3864 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
3865 // <<4><sin(phi1+phi2)>>:
3866 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(10.5,
3867 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
3868 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3869 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
3870 // <<4><cos(phi1-phi2-phi3)>>:
3871 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(11.5,
3872 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3873 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3874 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3875 // <<4><sin(phi1-phi2-phi3)>>:
3876 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(12.5,
3877 fIntFlowCorrelationsEBE->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3878 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)
3879 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3880 // <<cos(phi1)><cos(phi1+phi2)>>:
3881 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(13.5,
3882 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
3883 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
3884 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
3885 // <<cos(phi1)><sin(phi1+phi2)>>:
3886 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(14.5,
3887 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
3888 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
3889 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
3890 // <<cos(phi1)><cos(phi1-phi2-phi3)>>:
3891 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(15.5,
3892 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3893 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
3894 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3895 // <<cos(phi1)><sin(phi1-phi2-phi3)>>:
3896 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(16.5,
3897 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3898 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)
3899 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3900 // <<sin(phi1)><cos(phi1+phi2)>>:
3901 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(17.5,
3902 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2),
3903 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
3904 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
3905 // <<sin(phi1)><sin(phi1+phi2)>>:
3906 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(18.5,
3907 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
3908 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
3909 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
3910 // <<sin(phi1)><cos(phi1-phi2-phi3)>>:
3911 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(19.5,
3912 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3913 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
3914 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3915 // <<sin(phi1)><sin(phi1-phi2-phi3)>>:
3916 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(20.5,
3917 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(1)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3918 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)
3919 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3920 // <<cos(phi1+phi2)><sin(phi1+phi2)>>:
3921 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(21.5,
3922 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2),
3923 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)
3924 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
3925 // <<cos(phi1+phi2)><cos(phi1-phi2-phi3)>>:
3926 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(22.5,
3927 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3928 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)
3929 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3930 // <<cos(phi1+phi2)><sin(phi1-phi2-phi3)>>:
3931 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(23.5,
3932 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3933 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)
3934 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3935 // <<sin(phi1+phi2)><cos(phi1-phi2-phi3)>>:
3936 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(24.5,
3937 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3),
3938 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)
3939 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
3940 // <<sin(phi1+phi2)><sin(phi1-phi2-phi3)>>:
3941 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(25.5,
3942 fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(2)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3943 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)
3944 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3945 // <<cos(phi1-phi2-phi3)><sin(phi1-phi2-phi3)>>:
3946 fIntFlowProductOfCorrectionTermsForNUAPro->Fill(26.5,
3947 fIntFlowCorrectionTermsForNUAEBE[1]->GetBinContent(3)*fIntFlowCorrectionTermsForNUAEBE[0]->GetBinContent(3),
3948 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3)
3949 *fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
3951 } // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrectionTermsForNUA()
3953 //================================================================================================================================
3955 void AliFlowAnalysisWithQCumulants::CalculateCovariancesIntFlow()
3957 // a) Calculate unbiased estimators Cov(<2>,<4>), Cov(<2>,<6>), Cov(<2>,<8>), Cov(<4>,<6>), Cov(<4>,<8>) and Cov(<6>,<8>)
3958 // for covariances V_(<2>,<4>), V_(<2>,<6>), V_(<2>,<8>), V_(<4>,<6>), V_(<4>,<8>) and V_(<6>,<8>).
3959 // b) Store in histogram fIntFlowCovariances for instance the following:
3961 // 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)]
3963 // where N is the number of events, w_{<2>} is event weight for <2> and w_{<4>} is event weight for <4>.
3964 // c) Binning of fIntFlowCovariances is organized as follows:
3966 // 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)]
3967 // 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)]
3968 // 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)]
3969 // 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)]
3970 // 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)]
3971 // 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)]
3974 // Average 2-, 4-, 6- and 8-particle correlations for all events:
3975 Double_t correlation[4] = {0.};
3976 for(Int_t ci=0;ci<4;ci++)
3978 correlation[ci] = fIntFlowCorrelationsPro->GetBinContent(ci+1);
3980 // Average products of 2-, 4-, 6- and 8-particle correlations:
3981 Double_t productOfCorrelations[4][4] = {{0.}};
3982 Int_t productOfCorrelationsLabel = 1;
3983 // Denominators in the expressions for the unbiased estimator for covariance:
3984 Double_t denominator[4][4] = {{0.}};
3985 Int_t sumOfProductOfEventWeightsLabel1 = 1;
3986 // Weight dependent prefactor which multiply unbiased estimators for covariances:
3987 Double_t wPrefactor[4][4] = {{0.}};
3988 Int_t sumOfProductOfEventWeightsLabel2 = 1;
3989 for(Int_t c1=0;c1<4;c1++)
3991 for(Int_t c2=c1+1;c2<4;c2++)
3993 productOfCorrelations[c1][c2] = fIntFlowProductOfCorrelationsPro->GetBinContent(productOfCorrelationsLabel);
3994 if(TMath::Abs(fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1)) > 1.e-44 && TMath::Abs(fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1)) > 1.e-44)
3996 denominator[c1][c2] = 1.-(fIntFlowSumOfProductOfEventWeights->GetBinContent(sumOfProductOfEventWeightsLabel1))
3997 / (fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1)
3998 * fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1));
3999 wPrefactor[c1][c2] = fIntFlowSumOfProductOfEventWeights->GetBinContent(sumOfProductOfEventWeightsLabel2)
4000 / (fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1)
4001 * fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1));
4003 productOfCorrelationsLabel++; // to be improved - do I need here all 3 counters?
4004 sumOfProductOfEventWeightsLabel1++;
4005 sumOfProductOfEventWeightsLabel2++;
4006 } // end of for(Int_t c2=c1+1;c2<4;c2++)
4007 } // end of for(Int_t c1=0;c1<4;c1++)
4009 Int_t covarianceLabel = 1;
4010 for(Int_t c1=0;c1<4;c1++)
4012 for(Int_t c2=c1+1;c2<4;c2++)
4014 if(TMath::Abs(denominator[c1][c2]) > 1.e-44)
4017 Double_t cov = (productOfCorrelations[c1][c2]-correlation[c1]*correlation[c2])/denominator[c1][c2];
4018 // Covariances multiplied with weight dependent prefactor:
4019 Double_t wCov = cov * wPrefactor[c1][c2];
4020 fIntFlowCovariances->SetBinContent(covarianceLabel,wCov);
4023 } // end of for(Int_t c2=c1+1;c2<4;c2++)
4024 } // end of for(Int_t c1=0;c1<4;c1++)
4026 // Versus multiplicity:
4027 if(!fCalculateCumulantsVsM){return;}
4028 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
4029 for(Int_t b=1;b<=nBins;b++)
4031 // Average 2-, 4-, 6- and 8-particle correlations for all events:
4032 Double_t correlationVsM[4] = {0.};
4033 for(Int_t ci=0;ci<4;ci++)
4035 correlationVsM[ci] = fIntFlowCorrelationsVsMPro[ci]->GetBinContent(b);
4036 } // end of for(Int_t ci=0;ci<4;ci++)
4037 // Average products of 2-, 4-, 6- and 8-particle correlations:
4038 Double_t productOfCorrelationsVsM[4][4] = {{0.}};
4039 Int_t productOfCorrelationsLabelVsM = 1;
4040 // Denominators in the expressions for the unbiased estimator for covariance:
4041 Double_t denominatorVsM[4][4] = {{0.}};
4042 Int_t sumOfProductOfEventWeightsLabel1VsM = 1;
4043 // Weight dependent prefactor which multiply unbiased estimators for covariances:
4044 Double_t wPrefactorVsM[4][4] = {{0.}};
4045 Int_t sumOfProductOfEventWeightsLabel2VsM = 1;
4046 for(Int_t c1=0;c1<4;c1++)
4048 for(Int_t c2=c1+1;c2<4;c2++)
4050 productOfCorrelationsVsM[c1][c2] = fIntFlowProductOfCorrelationsVsMPro[productOfCorrelationsLabelVsM-1]->GetBinContent(b);
4051 if(TMath::Abs(fIntFlowSumOfEventWeightsVsM[c1][0]->GetBinContent(b)) > 1.e-44 && TMath::Abs(fIntFlowSumOfEventWeightsVsM[c2][0]->GetBinContent(b)) > 1.e-44)
4053 denominatorVsM[c1][c2] = 1.-(fIntFlowSumOfProductOfEventWeightsVsM[sumOfProductOfEventWeightsLabel1VsM-1]->GetBinContent(b))
4054 / (fIntFlowSumOfEventWeightsVsM[c1][0]->GetBinContent(b)
4055 * fIntFlowSumOfEventWeightsVsM[c2][0]->GetBinContent(b));
4056 wPrefactorVsM[c1][c2] = fIntFlowSumOfProductOfEventWeightsVsM[sumOfProductOfEventWeightsLabel2VsM-1]->GetBinContent(b)
4057 / (fIntFlowSumOfEventWeightsVsM[c1][0]->GetBinContent(b)
4058 * fIntFlowSumOfEventWeightsVsM[c2][0]->GetBinContent(b));
4060 productOfCorrelationsLabelVsM++;
4061 sumOfProductOfEventWeightsLabel1VsM++;
4062 sumOfProductOfEventWeightsLabel2VsM++;
4063 } // end of for(Int_t c1=0;c1<4;c1++)
4064 } // end of for(Int_t c2=c1+1;c2<4;c2++)
4066 Int_t covarianceLabelVsM = 1;
4067 for(Int_t c1=0;c1<4;c1++)
4069 for(Int_t c2=c1+1;c2<4;c2++)
4071 if(TMath::Abs(denominatorVsM[c1][c2]) > 1.e-44)
4074 Double_t covVsM = (productOfCorrelationsVsM[c1][c2]-correlationVsM[c1]*correlationVsM[c2])/denominatorVsM[c1][c2];
4075 // Covariances multiplied with weight dependent prefactor:
4076 Double_t wCovVsM = covVsM * wPrefactorVsM[c1][c2];
4077 fIntFlowCovariancesVsM[covarianceLabelVsM-1]->SetBinContent(b,wCovVsM);
4079 covarianceLabelVsM++;
4080 } // end of for(Int_t c2=c1+1;c2<4;c2++)
4081 } // end of for(Int_t c1=0;c1<4;c1++)
4082 } // end of for(Int_t b=1;b<=nBins;b++)
4084 } // end of AliFlowAnalysisWithQCumulants::CalculateCovariancesIntFlow()
4086 //================================================================================================================================
4088 void AliFlowAnalysisWithQCumulants::CalculateCovariancesNUAIntFlow()
4090 // a) Calculate unbiased estimators Cov(*,*) for true covariances V_(*,*) for NUA terms.
4091 // b) Store in histogram fIntFlowCovariancesNUA for instance the following:
4093 // 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)]
4095 // where N is the number of events, w_{<2>} is event weight for <2> and w_{<cos(phi)>} is event weight for <cos(phi)>.
4096 // c) Binning of fIntFlowCovariancesNUA is organized as follows:
4098 // 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)]
4099 // 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)]
4100 // 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)]
4103 // Cov(<2>,<cos(phi)>):
4104 Double_t product1 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(1); // <<2><cos(phi)>>
4105 Double_t term1st1 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
4106 Double_t term2nd1 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi)>>
4107 Double_t sumOfW1st1 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
4108 Double_t sumOfW2nd1 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi)>}
4109 Double_t sumOfWW1 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(1); // W_{<2>} * W_{<cos(phi)>}
4110 // numerator in the expression for the the unbiased estimator for covariance:
4111 Double_t numerator1 = product1 - term1st1*term2nd1;
4112 // denominator in the expression for the the unbiased estimator for covariance:
4113 Double_t denominator1 = 0.;
4114 if(TMath::Abs(sumOfW1st1*sumOfW2nd1)>0.)
4116 denominator1 = 1.-sumOfWW1/(sumOfW1st1*sumOfW2nd1);
4117 if(TMath::Abs(denominator1)>0.)
4120 Double_t covariance1 = numerator1/denominator1;
4121 // weight dependent prefactor for covariance:
4122 Double_t wPrefactor1 = sumOfWW1/(sumOfW1st1*sumOfW2nd1);
4123 // finally, store "weighted" covariance:
4124 fIntFlowCovariancesNUA->SetBinContent(1,wPrefactor1*covariance1);
4125 } // end of if(TMath::Abs(denominator)>0.)
4126 } // end of if(TMath::Abs(sumOfW1st1*sumOfW2nd1)>0.)
4128 // Cov(<2>,<sin(phi)>):
4129 Double_t product2 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(2); // <<2><sin(phi)>>
4130 Double_t term1st2 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
4131 Double_t term2nd2 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi)>>
4132 Double_t sumOfW1st2 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
4133 Double_t sumOfW2nd2 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi)>}
4134 Double_t sumOfWW2 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(2); // W_{<2>} * W_{<sin(phi)>}
4135 // numerator in the expression for the the unbiased estimator for covariance:
4136 Double_t numerator2 = product2 - term1st2*term2nd2;
4137 // denominator in the expression for the the unbiased estimator for covariance:
4138 Double_t denominator2 = 0.;
4139 if(TMath::Abs(sumOfW1st2*sumOfW2nd2)>0.)
4141 denominator2 = 1.-sumOfWW2/(sumOfW1st2*sumOfW2nd2);
4142 if(TMath::Abs(denominator2)>0.)
4145 Double_t covariance2 = numerator2/denominator2;
4146 // weight dependent prefactor for covariance:
4147 Double_t wPrefactor2 = sumOfWW2/(sumOfW1st2*sumOfW2nd2);
4148 // finally, store "weighted" covariance:
4149 fIntFlowCovariancesNUA->SetBinContent(2,wPrefactor2*covariance2);
4150 } // end of if(TMath::Abs(denominator2)>0.)
4151 } // end of if(TMath::Abs(sumOfW1st2*sumOfW2nd2)>0.)
4153 // Cov(<cos(phi)>,<sin(phi)>):
4154 Double_t product3 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(3); // <<cos(phi)><sin(phi)>>
4155 Double_t term1st3 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi)>>
4156 Double_t term2nd3 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi)>>
4157 Double_t sumOfW1st3 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi)>}
4158 Double_t sumOfW2nd3 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi)>}
4159 Double_t sumOfWW3 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(3); // W_{<cos(phi)>} * W_{<sin(phi)>}
4160 // numerator in the expression for the the unbiased estimator for covariance:
4161 Double_t numerator3 = product3 - term1st3*term2nd3;
4162 // denominator in the expression for the the unbiased estimator for covariance:
4163 Double_t denominator3 = 0;
4164 if(TMath::Abs(sumOfW1st3*sumOfW2nd3)>0.)
4166 denominator3 = 1.-sumOfWW3/(sumOfW1st3*sumOfW2nd3);
4167 if(TMath::Abs(denominator3)>0.)
4170 Double_t covariance3 = numerator3/denominator3;
4171 // weight dependent prefactor for covariance:
4172 Double_t wPrefactor3 = sumOfWW3/(sumOfW1st3*sumOfW2nd3);
4173 // finally, store "weighted" covariance:
4174 fIntFlowCovariancesNUA->SetBinContent(3,wPrefactor3*covariance3);
4175 } // end of if(TMath::Abs(denominator3)>0.)
4176 } // end of if(TMath::Abs(sumOfW1st3*sumOfW2nd3)>0.)
4178 // Cov(<2>,<cos(phi1+phi2)>):
4179 Double_t product4 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(4); // <<2><cos(phi1+phi2)>>
4180 Double_t term1st4 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
4181 Double_t term2nd4 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
4182 Double_t sumOfW1st4 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
4183 Double_t sumOfW2nd4 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
4184 Double_t sumOfWW4 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(4); // W_{<2>} * W_{<cos(phi1+phi2)>}
4185 // numerator in the expression for the the unbiased estimator for covariance:
4186 Double_t numerator4 = product4 - term1st4*term2nd4;
4187 // denominator in the expression for the the unbiased estimator for covariance:
4188 Double_t denominator4 = 0.;
4189 if(TMath::Abs(sumOfW1st4*sumOfW2nd4)>0.)
4191 denominator4 = 1.-sumOfWW4/(sumOfW1st4*sumOfW2nd4);
4192 if(TMath::Abs(denominator4)>0.)
4195 Double_t covariance4 = numerator4/denominator4;
4196 // weight dependent prefactor for covariance:
4197 Double_t wPrefactor4 = sumOfWW4/(sumOfW1st4*sumOfW2nd4);
4198 // finally, store "weighted" covariance:
4199 fIntFlowCovariancesNUA->SetBinContent(4,wPrefactor4*covariance4);
4200 } // end of if(TMath::Abs(denominator4)>0.)
4201 } // end of if(TMath::Abs(sumOfW1st4*sumOfW2nd4)>0.)
4203 // Cov(<2>,<sin(phi1+phi2)>):
4204 Double_t product5 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(5); // <<2><sin(phi1+phi2)>>
4205 Double_t term1st5 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
4206 Double_t term2nd5 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
4207 Double_t sumOfW1st5 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
4208 Double_t sumOfW2nd5 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
4209 Double_t sumOfWW5 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(5); // W_{<2>} * W_{<sin(phi1+phi2)>}
4210 // numerator in the expression for the the unbiased estimator for covariance:
4211 Double_t numerator5 = product5 - term1st5*term2nd5;
4212 // denominator in the expression for the the unbiased estimator for covariance:
4213 Double_t denominator5 = 0.;
4214 if(TMath::Abs(sumOfW1st5*sumOfW2nd5)>0.)
4216 denominator5 = 1.-sumOfWW5/(sumOfW1st5*sumOfW2nd5);
4217 if(TMath::Abs(denominator5)>0.)
4220 Double_t covariance5 = numerator5/denominator5;
4221 // weight dependent prefactor for covariance:
4222 Double_t wPrefactor5 = sumOfWW5/(sumOfW1st5*sumOfW2nd5);
4223 // finally, store "weighted" covariance:
4224 fIntFlowCovariancesNUA->SetBinContent(5,wPrefactor5*covariance5);
4225 } // end of if(TMath::Abs(denominator5)>0.)
4226 } // end of if(TMath::Abs(sumOfW1st5*sumOfW2nd5)>0.)
4228 // Cov(<2>,<cos(phi1-phi2-phi3)>):
4229 Double_t product6 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(6); // <<2><cos(phi1-phi2-phi3)>>
4230 Double_t term1st6 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
4231 Double_t term2nd6 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
4232 Double_t sumOfW1st6 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
4233 Double_t sumOfW2nd6 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
4234 Double_t sumOfWW6 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(6); // W_{<2>} * W_{<cos(phi1-phi2-phi3)>}
4235 // numerator in the expression for the the unbiased estimator for covariance:
4236 Double_t numerator6 = product6 - term1st6*term2nd6;
4237 // denominator in the expression for the the unbiased estimator for covariance:
4238 Double_t denominator6 = 0.;
4239 if(TMath::Abs(sumOfW1st6*sumOfW2nd6)>0.)
4241 denominator6 = 1.-sumOfWW6/(sumOfW1st6*sumOfW2nd6);
4242 if(TMath::Abs(denominator6)>0.)
4245 Double_t covariance6 = numerator6/denominator6;
4246 // weight dependent prefactor for covariance:
4247 Double_t wPrefactor6 = sumOfWW6/(sumOfW1st6*sumOfW2nd6);
4248 // finally, store "weighted" covariance:
4249 fIntFlowCovariancesNUA->SetBinContent(6,wPrefactor6*covariance6);
4250 } // end of if(TMath::Abs(denominator6)>0.)
4251 } // end of if(TMath::Abs(sumOfW1st6*sumOfW2nd6)>0.)
4253 // Cov(<2>,<sin(phi1-phi2-phi3)>):
4254 Double_t product7 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(7); // <<2><sin(phi1-phi2-phi3)>>
4255 Double_t term1st7 = fIntFlowCorrelationsPro->GetBinContent(1); // <<2>>
4256 Double_t term2nd7 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
4257 Double_t sumOfW1st7 = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // W_{<2>}
4258 Double_t sumOfW2nd7 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
4259 Double_t sumOfWW7 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(7); // W_{<2>} * W_{<sin(phi1-phi2-phi3)>}
4260 // numerator in the expression for the the unbiased estimator for covariance:
4261 Double_t numerator7 = product7 - term1st7*term2nd7;
4262 // denominator in the expression for the the unbiased estimator for covariance:
4263 Double_t denominator7 = 0.;
4264 if(TMath::Abs(sumOfW1st7*sumOfW2nd7)>0.)
4266 denominator7 = 1.-sumOfWW7/(sumOfW1st7*sumOfW2nd7);
4267 if(TMath::Abs(denominator7)>0.)
4270 Double_t covariance7 = numerator7/denominator7;
4271 // weight dependent prefactor for covariance:
4272 Double_t wPrefactor7 = sumOfWW7/(sumOfW1st7*sumOfW2nd7);
4273 // finally, store "weighted" covariance:
4274 fIntFlowCovariancesNUA->SetBinContent(7,wPrefactor7*covariance7);
4275 } // end of if(TMath::Abs(denominator7)>0.)
4276 } // end of if(TMath::Abs(sumOfW1st7*sumOfW2nd7)>0.)
4278 // Cov(<4>,<cos(phi1>):
4279 Double_t product8 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(8); // <<4><cos(phi1)>>
4280 Double_t term1st8 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
4281 Double_t term2nd8 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
4282 Double_t sumOfW1st8 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
4283 Double_t sumOfW2nd8 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
4284 Double_t sumOfWW8 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(8); // W_{<4>} * W_{<cos(phi1)>}
4285 // numerator in the expression for the the unbiased estimator for covariance:
4286 Double_t numerator8 = product8 - term1st8*term2nd8;
4287 // denominator in the expression for the the unbiased estimator for covariance:
4288 Double_t denominator8 = 0.;
4289 if(TMath::Abs(sumOfW1st8*sumOfW2nd8)>0.)
4291 denominator8 = 1.-sumOfWW8/(sumOfW1st8*sumOfW2nd8);
4292 if(TMath::Abs(denominator8)>0.)
4295 Double_t covariance8 = numerator8/denominator8;
4296 // weight dependent prefactor for covariance:
4297 Double_t wPrefactor8 = sumOfWW8/(sumOfW1st8*sumOfW2nd8);
4298 // finally, store "weighted" covariance:
4299 fIntFlowCovariancesNUA->SetBinContent(8,wPrefactor8*covariance8);
4300 } // end of if(TMath::Abs(denominator8)>0.)
4301 } // end of if(TMath::Abs(sumOfW1st8*sumOfW2nd8)>0.)
4303 // Cov(<4>,<sin(phi1)>):
4304 Double_t product9 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(9); // <<4><sin(phi1)>>
4305 Double_t term1st9 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
4306 Double_t term2nd9 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
4307 Double_t sumOfW1st9 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
4308 Double_t sumOfW2nd9 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
4309 Double_t sumOfWW9 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(9); // W_{<4>} * W_{<sin(phi1)>}
4310 // numerator in the expression for the the unbiased estimator for covariance:
4311 Double_t numerator9 = product9 - term1st9*term2nd9;
4312 // denominator in the expression for the the unbiased estimator for covariance:
4313 Double_t denominator9 = 0.;
4314 if(TMath::Abs(sumOfW1st9*sumOfW2nd9)>0.)
4316 denominator9 = 1.-sumOfWW9/(sumOfW1st9*sumOfW2nd9);
4317 if(TMath::Abs(denominator9)>0.)
4320 Double_t covariance9 = numerator9/denominator9;
4321 // weight dependent prefactor for covariance:
4322 Double_t wPrefactor9 = sumOfWW9/(sumOfW1st9*sumOfW2nd9);
4323 // finally, store "weighted" covariance:
4324 fIntFlowCovariancesNUA->SetBinContent(9,wPrefactor9*covariance9);
4326 } // end of if(TMath::Abs(sumOfW1st9*sumOfW2nd9)>0.)
4328 // Cov(<4>,<cos(phi1+phi2)>):
4329 Double_t product10 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(10); // <<4><cos(phi1+phi2)>>
4330 Double_t term1st10 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
4331 Double_t term2nd10 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
4332 Double_t sumOfW1st10 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
4333 Double_t sumOfW2nd10 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
4334 Double_t sumOfWW10 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(10); // W_{<4>} * W_{<cos(phi1+phi2)>}
4335 // numerator in the expression for the the unbiased estimator for covariance:
4336 Double_t numerator10 = product10 - term1st10*term2nd10;
4337 // denominator in the expression for the the unbiased estimator for covariance:
4338 Double_t denominator10 = 0.;
4339 if(TMath::Abs(sumOfW1st10*sumOfW2nd10)>0.)
4341 denominator10 = 1.-sumOfWW10/(sumOfW1st10*sumOfW2nd10);
4342 if(TMath::Abs(denominator10)>0.)
4345 Double_t covariance10 = numerator10/denominator10;
4346 // weight dependent prefactor for covariance:
4347 Double_t wPrefactor10 = sumOfWW10/(sumOfW1st10*sumOfW2nd10);
4348 // finally, store "weighted" covariance:
4349 fIntFlowCovariancesNUA->SetBinContent(10,wPrefactor10*covariance10);
4350 } // end of if(TMath::Abs(denominator10)>0.)
4351 } // end of if(TMath::Abs(sumOfW1st10*sumOfW2nd10)>0.)
4353 // Cov(<4>,<sin(phi1+phi2)>):
4354 Double_t product11 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(11); // <<4><sin(phi1+phi2)>>
4355 Double_t term1st11 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
4356 Double_t term2nd11 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
4357 Double_t sumOfW1st11 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
4358 Double_t sumOfW2nd11 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
4359 Double_t sumOfWW11 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(11); // W_{<4>} * W_{<sin(phi1+phi2)>}
4360 // numerator in the expression for the the unbiased estimator for covariance:
4361 Double_t numerator11 = product11 - term1st11*term2nd11;
4362 // denominator in the expression for the the unbiased estimator for covariance:
4363 Double_t denominator11 = 0.;
4364 if(TMath::Abs(sumOfW1st11*sumOfW2nd11)>0.)
4366 denominator11 = 1.-sumOfWW11/(sumOfW1st11*sumOfW2nd11);
4367 if(TMath::Abs(denominator11)>0.)
4370 Double_t covariance11 = numerator11/denominator11;
4371 // weight dependent prefactor for covariance:
4372 Double_t wPrefactor11 = sumOfWW11/(sumOfW1st11*sumOfW2nd11);
4373 // finally, store "weighted" covariance:
4374 fIntFlowCovariancesNUA->SetBinContent(11,wPrefactor11*covariance11);
4375 } // end of if(TMath::Abs(denominator11)>0.)
4376 } // end of if(TMath::Abs(sumOfW1st11*sumOfW2nd11)>0.)
4378 // Cov(<4>,<cos(phi1-phi2-phi3)>):
4379 Double_t product12 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(12); // <<4><cos(phi1-phi2-phi3)>>
4380 Double_t term1st12 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
4381 Double_t term2nd12 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
4382 Double_t sumOfW1st12 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
4383 Double_t sumOfW2nd12 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
4384 Double_t sumOfWW12 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(12); // W_{<4>} * W_{<cos(phi1-phi2-phi3)>}
4385 // numerator in the expression for the the unbiased estimator for covariance:
4386 Double_t numerator12 = product12 - term1st12*term2nd12;
4387 // denominator in the expression for the the unbiased estimator for covariance:
4388 Double_t denominator12 = 0.;
4389 if(TMath::Abs(sumOfW1st12*sumOfW2nd12)>0.)
4391 denominator12 = 1.-sumOfWW12/(sumOfW1st12*sumOfW2nd12);
4392 if(TMath::Abs(denominator12)>0.)
4395 Double_t covariance12 = numerator12/denominator12;
4396 // weight dependent prefactor for covariance:
4397 Double_t wPrefactor12 = sumOfWW12/(sumOfW1st12*sumOfW2nd12);
4398 // finally, store "weighted" covariance:
4399 fIntFlowCovariancesNUA->SetBinContent(12,wPrefactor12*covariance12);
4400 } // end of if(TMath::Abs(denominator12)>0.)
4401 } // end of if(TMath::Abs(sumOfW1st12*sumOfW2nd12)>0.)
4403 // Cov(<4>,<sin(phi1-phi2-phi3)>):
4404 Double_t product13 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(13); // <<4><sin(phi1-phi2-phi3)>>
4405 Double_t term1st13 = fIntFlowCorrelationsPro->GetBinContent(2); // <<4>>
4406 Double_t term2nd13 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
4407 Double_t sumOfW1st13 = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // W_{<4>}
4408 Double_t sumOfW2nd13 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
4409 Double_t sumOfWW13 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(13); // W_{<4>} * W_{<sin(phi1-phi2-phi3)>}
4410 // numerator in the expression for the the unbiased estimator for covariance:
4411 Double_t numerator13 = product13 - term1st13*term2nd13;
4412 // denominator in the expression for the the unbiased estimator for covariance:
4413 Double_t denominator13 = 0.;
4414 if(TMath::Abs(sumOfW1st13*sumOfW2nd13)>0.)
4416 denominator13 = 1.-sumOfWW13/(sumOfW1st13*sumOfW2nd13);
4417 if(TMath::Abs(denominator13)>0.)
4420 Double_t covariance13 = numerator13/denominator13;
4421 // weight dependent prefactor for covariance:
4422 Double_t wPrefactor13 = sumOfWW13/(sumOfW1st13*sumOfW2nd13);
4423 // finally, store "weighted" covariance:
4424 fIntFlowCovariancesNUA->SetBinContent(13,wPrefactor13*covariance13);
4425 } // end of if(TMath::Abs(denominator13)>0.)
4426 } // end of if(TMath::Abs(sumOfW1st13*sumOfW2nd13)>0.)
4428 // Cov(<cos(phi1)>,<cos(phi1+phi2)>):
4429 Double_t product14 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(14); // <<cos(phi1)><cos(phi1+phi2)>>
4430 Double_t term1st14 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
4431 Double_t term2nd14 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
4432 Double_t sumOfW1st14 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
4433 Double_t sumOfW2nd14 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
4434 Double_t sumOfWW14 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(14); // W_{<cos(phi1)>} * W_{<cos(phi1+phi2)>}
4435 // numerator in the expression for the the unbiased estimator for covariance:
4436 Double_t numerator14 = product14 - term1st14*term2nd14;
4437 // denominator in the expression for the the unbiased estimator for covariance:
4438 Double_t denominator14 = 0.;
4439 if(TMath::Abs(sumOfW1st14*sumOfW2nd14)>0.)
4441 denominator14 = 1.-sumOfWW14/(sumOfW1st14*sumOfW2nd14);
4442 if(TMath::Abs(denominator14)>0.)
4445 Double_t covariance14 = numerator14/denominator14;
4446 // weight dependent prefactor for covariance:
4447 Double_t wPrefactor14 = sumOfWW14/(sumOfW1st14*sumOfW2nd14);
4448 // finally, store "weighted" covariance:
4449 fIntFlowCovariancesNUA->SetBinContent(14,wPrefactor14*covariance14);
4450 } // end of if(TMath::Abs(denominator14)>0.)
4451 } // end of if(TMath::Abs(sumOfW1st14*sumOfW2nd14)>0.)
4453 // Cov(<cos(phi1)>,<sin(phi1+phi2)>):
4454 Double_t product15 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(15); // <<cos(phi1)><sin(phi1+phi2)>>
4455 Double_t term1st15 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
4456 Double_t term2nd15 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
4457 Double_t sumOfW1st15 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
4458 Double_t sumOfW2nd15 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
4459 Double_t sumOfWW15 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(15); // W_{<cos(phi1)>} * W_{<sin(phi1+phi2)>}
4460 // numerator in the expression for the the unbiased estimator for covariance:
4461 Double_t numerator15 = product15 - term1st15*term2nd15;
4462 // denominator in the expression for the the unbiased estimator for covariance:
4463 Double_t denominator15 = 0.;
4464 if(TMath::Abs(sumOfW1st15*sumOfW2nd15)>0.)
4466 denominator15 = 1.-sumOfWW15/(sumOfW1st15*sumOfW2nd15);
4467 if(TMath::Abs(denominator15)>0.)
4470 Double_t covariance15 = numerator15/denominator15;
4471 // weight dependent prefactor for covariance:
4472 Double_t wPrefactor15 = sumOfWW15/(sumOfW1st15*sumOfW2nd15);
4473 // finally, store "weighted" covariance:
4474 fIntFlowCovariancesNUA->SetBinContent(15,wPrefactor15*covariance15);
4475 } // end of if(TMath::Abs(denominator15)>0.)
4476 } // end of if(TMath::Abs(sumOfW1st15*sumOfW2nd15)>0.)
4478 // Cov(<cos(phi1)>,<cos(phi1-phi2-phi3)>):
4479 Double_t product16 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(16); // <<cos(phi1)><cos(phi1-phi2-phi3)>>
4480 Double_t term1st16 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
4481 Double_t term2nd16 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
4482 Double_t sumOfW1st16 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
4483 Double_t sumOfW2nd16 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
4484 Double_t sumOfWW16 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(16); // W_{<cos(phi1)>} * W_{<cos(phi1-phi2-phi3)>}
4485 // numerator in the expression for the the unbiased estimator for covariance:
4486 Double_t numerator16 = product16 - term1st16*term2nd16;
4487 // denominator in the expression for the the unbiased estimator for covariance:
4488 Double_t denominator16 = 0.;
4489 if(TMath::Abs(sumOfW1st16*sumOfW2nd16)>0.)
4491 denominator16 = 1.-sumOfWW16/(sumOfW1st16*sumOfW2nd16);
4492 if(TMath::Abs(denominator16)>0.)
4495 Double_t covariance16 = numerator16/denominator16;
4496 // weight dependent prefactor for covariance:
4497 Double_t wPrefactor16 = sumOfWW16/(sumOfW1st16*sumOfW2nd16);
4498 // finally, store "weighted" covariance:
4499 fIntFlowCovariancesNUA->SetBinContent(16,wPrefactor16*covariance16);
4500 } // end of if(TMath::Abs(denominator16)>0.)
4501 } // end ofif(TMath::Abs(sumOfW1st16*sumOfW2nd16)>0.)
4503 // Cov(<cos(phi1)>,<sin(phi1-phi2-phi3)>):
4504 Double_t product17 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(17); // <<cos(phi1)><sin(phi1-phi2-phi3)>>
4505 Double_t term1st17 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(1); // <<cos(phi1)>>
4506 Double_t term2nd17 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
4507 Double_t sumOfW1st17 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(1); // W_{<cos(phi1)>}
4508 Double_t sumOfW2nd17 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
4509 Double_t sumOfWW17 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(17); // W_{<cos(phi1)>} * W_{<sin(phi1-phi2-phi3)>}
4510 // numerator in the expression for the the unbiased estimator for covariance:
4511 Double_t numerator17 = product17 - term1st17*term2nd17;
4512 // denominator in the expression for the the unbiased estimator for covariance:
4513 Double_t denominator17 = 0.;
4514 if(TMath::Abs(sumOfW1st17*sumOfW2nd17)>0.)
4516 denominator17 = 1.-sumOfWW17/(sumOfW1st17*sumOfW2nd17);
4517 if(TMath::Abs(denominator17)>0.)
4520 Double_t covariance17 = numerator17/denominator17;
4521 // weight dependent prefactor for covariance:
4522 Double_t wPrefactor17 = sumOfWW17/(sumOfW1st17*sumOfW2nd17);
4523 // finally, store "weighted" covariance:
4524 fIntFlowCovariancesNUA->SetBinContent(17,wPrefactor17*covariance17);
4525 } // end of if(TMath::Abs(denominator17)>0.)
4526 } // end of if(TMath::Abs(sumOfW1st17*sumOfW2nd17)>0.)
4528 // Cov(<sin(phi1)>,<cos(phi1+phi2)>):
4529 Double_t product18 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(18); // <<sin(phi1)><cos(phi1+phi2)>>
4530 Double_t term1st18 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
4531 Double_t term2nd18 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
4532 Double_t sumOfW1st18 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
4533 Double_t sumOfW2nd18 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
4534 Double_t sumOfWW18 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(18); // W_{<sin(phi1)>} * W_{<cos(phi1+phi2)>}
4535 // numerator in the expression for the the unbiased estimator for covariance:
4536 Double_t numerator18 = product18 - term1st18*term2nd18;
4537 // denominator in the expression for the the unbiased estimator for covariance:
4538 Double_t denominator18 = 0.;
4539 if(TMath::Abs(sumOfW1st18*sumOfW2nd18)>0.)
4541 denominator18 = 1.-sumOfWW18/(sumOfW1st18*sumOfW2nd18);
4542 if(TMath::Abs(denominator18)>0.)
4545 Double_t covariance18 = numerator18/denominator18;
4546 // weight dependent prefactor for covariance:
4547 Double_t wPrefactor18 = sumOfWW18/(sumOfW1st18*sumOfW2nd18);
4548 // finally, store "weighted" covariance:
4549 fIntFlowCovariancesNUA->SetBinContent(18,wPrefactor18*covariance18);
4550 } // end of if(TMath::Abs(denominator18)>0.)
4551 } // end of if(TMath::Abs(sumOfW1st18*sumOfW2nd18)>0.)
4553 // Cov(<sin(phi1)>,<sin(phi1+phi2)>):
4554 Double_t product19 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(19); // <<sin(phi1)><sin(phi1+phi2)>>
4555 Double_t term1st19 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
4556 Double_t term2nd19 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
4557 Double_t sumOfW1st19 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
4558 Double_t sumOfW2nd19 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
4559 Double_t sumOfWW19 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(19); // W_{<sin(phi1)>} * W_{<sin(phi1+phi2)>}
4560 // numerator in the expression for the the unbiased estimator for covariance:
4561 Double_t numerator19 = product19 - term1st19*term2nd19;
4562 // denominator in the expression for the the unbiased estimator for covariance:
4563 Double_t denominator19 = 0.;
4564 if(TMath::Abs(sumOfW1st19*sumOfW2nd19)>0.)
4566 denominator19 = 1.-sumOfWW19/(sumOfW1st19*sumOfW2nd19);
4567 if(TMath::Abs(denominator19)>0.)
4570 Double_t covariance19 = numerator19/denominator19;
4571 // weight dependent prefactor for covariance:
4572 Double_t wPrefactor19 = sumOfWW19/(sumOfW1st19*sumOfW2nd19);
4573 // finally, store "weighted" covariance:
4574 fIntFlowCovariancesNUA->SetBinContent(19,wPrefactor19*covariance19);
4575 } // end of if(TMath::Abs(denominator19)>0.)
4576 } // end of if(TMath::Abs(sumOfW1st19*sumOfW2nd19)>0.)
4578 // Cov(<sin(phi1)>,<cos(phi1-phi2-phi3)>):
4579 Double_t product20 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(20); // <<sin(phi1)><cos(phi1-phi2-phi3)>>
4580 Double_t term1st20 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
4581 Double_t term2nd20 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
4582 Double_t sumOfW1st20 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
4583 Double_t sumOfW2nd20 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
4584 Double_t sumOfWW20 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(20); // W_{<sin(phi1)>} * W_{<cos(phi1-phi2-phi3)>}
4585 // numerator in the expression for the the unbiased estimator for covariance:
4586 Double_t numerator20 = product20 - term1st20*term2nd20;
4587 // denominator in the expression for the the unbiased estimator for covariance:
4588 Double_t denominator20 = 0.;
4589 if(TMath::Abs(sumOfW1st20*sumOfW2nd20)>0.)
4591 denominator20 = 1.-sumOfWW20/(sumOfW1st20*sumOfW2nd20);
4592 if(TMath::Abs(denominator20)>0.)
4595 Double_t covariance20 = numerator20/denominator20;
4596 // weight dependent prefactor for covariance:
4597 Double_t wPrefactor20 = sumOfWW20/(sumOfW1st20*sumOfW2nd20);
4598 // finally, store "weighted" covariance:
4599 fIntFlowCovariancesNUA->SetBinContent(20,wPrefactor20*covariance20);
4600 } // end of if(TMath::Abs(denominator20)>0.)
4601 } // end of if(TMath::Abs(sumOfW1st20*sumOfW2nd20)>0.)
4603 // Cov(<sin(phi1)>,<sin(phi1-phi2-phi3)>):
4604 Double_t product21 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(21); // <<sin(phi1)><sin(phi1-phi2-phi3)>>
4605 Double_t term1st21 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(1); // <<sin(phi1)>>
4606 Double_t term2nd21 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
4607 Double_t sumOfW1st21 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(1); // W_{<sin(phi1)>}
4608 Double_t sumOfW2nd21 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
4609 Double_t sumOfWW21 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(21); // W_{<sin(phi1)>} * W_{<sin(phi1-phi2-phi3)>}
4610 // numerator in the expression for the the unbiased estimator for covariance:
4611 Double_t numerator21 = product21 - term1st21*term2nd21;
4612 // denominator in the expression for the the unbiased estimator for covariance:
4613 Double_t denominator21 = 0.;
4614 if(TMath::Abs(sumOfW1st21*sumOfW2nd21)>0.)
4616 denominator21 = 1.-sumOfWW21/(sumOfW1st21*sumOfW2nd21);
4617 if(TMath::Abs(denominator21)>0.)
4620 Double_t covariance21 = numerator21/denominator21;
4621 // weight dependent prefactor for covariance:
4622 Double_t wPrefactor21 = sumOfWW21/(sumOfW1st21*sumOfW2nd21);
4623 // finally, store "weighted" covariance:
4624 fIntFlowCovariancesNUA->SetBinContent(21,wPrefactor21*covariance21);
4625 } // end of if(TMath::Abs(denominator21)>0.)
4626 } // end of if(TMath::Abs(sumOfW1st21*sumOfW2nd21)>0.)
4628 // Cov(<cos(phi1+phi2)>,<sin(phi1+phi2)>):
4629 Double_t product22 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(22); // <<cos(phi1+phi2)><sin(phi1+phi2)>>
4630 Double_t term1st22 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
4631 Double_t term2nd22 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
4632 Double_t sumOfW1st22 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
4633 Double_t sumOfW2nd22 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
4634 Double_t sumOfWW22 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(22); // W_{<cos(phi1+phi2)>} * W_{<sin(phi1+phi2)>}
4635 // numerator in the expression for the the unbiased estimator for covariance:
4636 Double_t numerator22 = product22 - term1st22*term2nd22;
4637 // denominator in the expression for the the unbiased estimator for covariance:
4638 Double_t denominator22 = 0.;
4639 if(TMath::Abs(sumOfW1st22*sumOfW2nd22)>0.)
4641 denominator22 = 1.-sumOfWW22/(sumOfW1st22*sumOfW2nd22);
4642 if(TMath::Abs(denominator22)>0.)
4645 Double_t covariance22 = numerator22/denominator22;
4646 // weight dependent prefactor for covariance:
4647 Double_t wPrefactor22 = sumOfWW22/(sumOfW1st22*sumOfW2nd22);
4648 // finally, store "weighted" covariance:
4649 fIntFlowCovariancesNUA->SetBinContent(22,wPrefactor22*covariance22);
4650 } // end of if(TMath::Abs(denominator22)>0.)
4651 } // end of if(TMath::Abs(sumOfW1st22*sumOfW2nd22)>0.)
4653 // Cov(<cos(phi1+phi2)>,<cos(phi1-phi2-phi3)>):
4654 Double_t product23 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(23); // <<cos(phi1+phi2)><cos(phi1-phi2-phi3)>>
4655 Double_t term1st23 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
4656 Double_t term2nd23 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
4657 Double_t sumOfW1st23 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
4658 Double_t sumOfW2nd23 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
4659 Double_t sumOfWW23 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(23); // W_{<cos(phi1+phi2)>} * W_{<cos(phi1-phi2-phi3)>}
4660 // numerator in the expression for the the unbiased estimator for covariance:
4661 Double_t numerator23 = product23 - term1st23*term2nd23;
4662 // denominator in the expression for the the unbiased estimator for covariance:
4663 Double_t denominator23 = 0.;
4664 if(TMath::Abs(sumOfW1st23*sumOfW2nd23)>0.)
4666 denominator23 = 1.-sumOfWW23/(sumOfW1st23*sumOfW2nd23);
4667 if(TMath::Abs(denominator23)>0.)
4670 Double_t covariance23 = numerator23/denominator23;
4671 // weight dependent prefactor for covariance:
4672 Double_t wPrefactor23 = sumOfWW23/(sumOfW1st23*sumOfW2nd23);
4673 // finally, store "weighted" covariance:
4674 fIntFlowCovariancesNUA->SetBinContent(23,wPrefactor23*covariance23);
4675 } // end of if(TMath::Abs(denominator23)>0.)
4676 } // end of if(TMath::Abs(sumOfW1st23*sumOfW2nd23)>0.)
4678 // Cov(<cos(phi1+phi2)>,<sin(phi1-phi2-phi3)>):
4679 Double_t product24 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(24); // <<cos(phi1+phi2)><sin(phi1-phi2-phi3)>>
4680 Double_t term1st24 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(2); // <<cos(phi1+phi2)>>
4681 Double_t term2nd24 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
4682 Double_t sumOfW1st24 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(2); // W_{<cos(phi1+phi2)>}
4683 Double_t sumOfW2nd24 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
4684 Double_t sumOfWW24 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(24); // W_{<cos(phi1+phi2)>} * W_{<sin(phi1-phi2-phi3)>}
4685 // numerator in the expression for the the unbiased estimator for covariance:
4686 Double_t numerator24 = product24 - term1st24*term2nd24;
4687 // denominator in the expression for the the unbiased estimator for covariance:
4688 Double_t denominator24 = 0.;
4689 if(TMath::Abs(sumOfW1st24*sumOfW2nd24)>0.)
4691 denominator24 = 1.-sumOfWW24/(sumOfW1st24*sumOfW2nd24);
4692 if(TMath::Abs(denominator24)>0.)
4695 Double_t covariance24 = numerator24/denominator24;
4696 // weight dependent prefactor for covariance:
4697 Double_t wPrefactor24 = sumOfWW24/(sumOfW1st24*sumOfW2nd24);
4698 // finally, store "weighted" covariance:
4699 fIntFlowCovariancesNUA->SetBinContent(24,wPrefactor24*covariance24);
4700 } // end of if(TMath::Abs(denominator24)>0.)
4701 } // end of if(TMath::Abs(sumOfW1st24*sumOfW2nd24)>0.)
4703 // Cov(<sin(phi1+phi2)>,<cos(phi1-phi2-phi3)>):
4704 Double_t product25 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(25); // <<sin(phi1+phi2)><cos(phi1-phi2-phi3)>>
4705 Double_t term1st25 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
4706 Double_t term2nd25 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
4707 Double_t sumOfW1st25 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
4708 Double_t sumOfW2nd25 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
4709 Double_t sumOfWW25 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(25); // W_{<sin(phi1+phi2)>} * W_{<cos(phi1-phi2-phi3)>}
4710 // numerator in the expression for the the unbiased estimator for covariance:
4711 Double_t numerator25 = product25 - term1st25*term2nd25;
4712 // denominator in the expression for the the unbiased estimator for covariance:
4713 Double_t denominator25 = 0.;
4714 if(TMath::Abs(sumOfW1st25*sumOfW2nd25)>0.)
4716 denominator25 = 1.-sumOfWW25/(sumOfW1st25*sumOfW2nd25);
4717 if(TMath::Abs(denominator25)>0.)
4720 Double_t covariance25 = numerator25/denominator25;
4721 // weight dependent prefactor for covariance:
4722 Double_t wPrefactor25 = sumOfWW25/(sumOfW1st25*sumOfW2nd25);
4723 // finally, store "weighted" covariance:
4724 fIntFlowCovariancesNUA->SetBinContent(25,wPrefactor25*covariance25);
4725 } // end of if(TMath::Abs(denominator25)>0.)
4726 } // end of if(TMath::Abs(sumOfW1st25*sumOfW2nd25)>0.)
4728 // Cov(<sin(phi1+phi2)>,<sin(phi1-phi2-phi3)>):
4729 Double_t product26 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(26); // <<sin(phi1+phi2)><sin(phi1-phi2-phi3)>>
4730 Double_t term1st26 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(2); // <<sin(phi1+phi2)>>
4731 Double_t term2nd26 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
4732 Double_t sumOfW1st26 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(2); // W_{<sin(phi1+phi2)>}
4733 Double_t sumOfW2nd26 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
4734 Double_t sumOfWW26 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(26); // W_{<sin(phi1+phi2)>} * W_{<sin(phi1-phi2-phi3)>}
4735 // numerator in the expression for the the unbiased estimator for covariance:
4736 Double_t numerator26 = product26 - term1st26*term2nd26;
4737 // denominator in the expression for the the unbiased estimator for covariance:
4738 Double_t denominator26 = 0.;
4739 if(TMath::Abs(sumOfW1st26*sumOfW2nd26)>0.)
4741 denominator26 = 1.-sumOfWW26/(sumOfW1st26*sumOfW2nd26);
4742 if(TMath::Abs(denominator26)>0.)
4745 Double_t covariance26 = numerator26/denominator26;
4746 // weight dependent prefactor for covariance:
4747 Double_t wPrefactor26 = sumOfWW26/(sumOfW1st26*sumOfW2nd26);
4748 // finally, store "weighted" covariance:
4749 fIntFlowCovariancesNUA->SetBinContent(26,wPrefactor26*covariance26);
4750 } // end of if(TMath::Abs(denominator26)>0.)
4751 } // end of if(TMath::Abs(sumOfW1st26*sumOfW2nd26)>0.)
4753 // Cov(<cos(phi1-phi2-phi3)>,<sin(phi1-phi2-phi3)>):
4754 Double_t product27 = fIntFlowProductOfCorrectionTermsForNUAPro->GetBinContent(27); // <<cos(phi1-phi2-phi3)><sin(phi1-phi2-phi3)>>
4755 Double_t term1st27 = fIntFlowCorrectionTermsForNUAPro[1]->GetBinContent(3); // <<cos(phi1-phi2-phi3)>>
4756 Double_t term2nd27 = fIntFlowCorrectionTermsForNUAPro[0]->GetBinContent(3); // <<sin(phi1-phi2-phi3)>>
4757 Double_t sumOfW1st27 = fIntFlowSumOfEventWeightsNUA[1][0]->GetBinContent(3); // W_{<cos(phi1-phi2-phi3)>}
4758 Double_t sumOfW2nd27 = fIntFlowSumOfEventWeightsNUA[0][0]->GetBinContent(3); // W_{<sin(phi1-phi2-phi3)>}
4759 Double_t sumOfWW27 = fIntFlowSumOfProductOfEventWeightsNUA->GetBinContent(27); // W_{<cos(phi1-phi2-phi3)>} * W_{<sin(phi1-phi2-phi3)>}
4760 // numerator in the expression for the the unbiased estimator for covariance:
4761 Double_t numerator27 = product27 - term1st27*term2nd27;
4762 // denominator in the expression for the the unbiased estimator for covariance:
4763 Double_t denominator27 = 0.;
4764 if(TMath::Abs(sumOfW1st27*sumOfW2nd27)>0.)
4766 denominator27 = 1.-sumOfWW27/(sumOfW1st27*sumOfW2nd27);
4767 if(TMath::Abs(denominator27)>0.)
4770 Double_t covariance27 = numerator27/denominator27;
4771 // weight dependent prefactor for covariance:
4772 Double_t wPrefactor27 = sumOfWW27/(sumOfW1st27*sumOfW2nd27);
4773 // finally, store "weighted" covariance:
4774 fIntFlowCovariancesNUA->SetBinContent(27,wPrefactor27*covariance27);
4775 } // end of if(TMath::Abs(denominator27)>0.)
4776 } // end of if(TMath::Abs(sumOfW1st27*sumOfW2nd27)>0.)
4778 } // end of AliFlowAnalysisWithQCumulants::CalculateCovariancesNUAIntFlow()
4780 //================================================================================================================================
4782 void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsIntFlow()
4784 // From profile fIntFlowCorrelationsPro access measured correlations and spread,
4785 // correctly calculate the statistical errors and store the final results and
4786 // statistical errors for correlations in histogram fIntFlowCorrelationsHist.
4788 // Remark: Statistical error of correlation is calculated as:
4790 // statistical error = termA * spread * termB:
4791 // termA = sqrt{sum_{i=1}^{N} w^2}/(sum_{i=1}^{N} w)
4792 // termB = 1/sqrt(1-termA^2)
4795 for(Int_t ci=1;ci<=4;ci++) // correlation index
4797 if(fIntFlowCorrelationsPro->GetBinEffectiveEntries(ci) < 2 || fIntFlowSquaredCorrelationsPro->GetBinEffectiveEntries(ci) < 2)
4799 fIntFlowCorrelationsPro->SetBinError(ci,0.);
4800 fIntFlowSquaredCorrelationsPro->SetBinError(ci,0.);
4803 Double_t correlation = fIntFlowCorrelationsPro->GetBinContent(ci);
4804 Double_t squaredCorrelation = fIntFlowSquaredCorrelationsPro->GetBinContent(ci);
4805 Double_t spread = 0.;
4806 if(squaredCorrelation-correlation*correlation >= 0.)
4808 spread = pow(squaredCorrelation-correlation*correlation,0.5);
4812 cout<<Form(" WARNING: Imaginary 'spread' for %d-particle correlation!!!! ",2*ci)<<endl;
4815 Double_t sumOfLinearEventWeights = fIntFlowSumOfEventWeights[0]->GetBinContent(ci);
4816 Double_t sumOfQuadraticEventWeights = fIntFlowSumOfEventWeights[1]->GetBinContent(ci);
4817 Double_t termA = 0.;
4818 Double_t termB = 0.;
4819 if(TMath::Abs(sumOfLinearEventWeights) > 0.) // to be improved - shall I omitt here Abs() ?
4821 termA = pow(sumOfQuadraticEventWeights,0.5)/sumOfLinearEventWeights;
4825 cout<<" WARNING (QC): sumOfLinearEventWeights == 0 in method FinalizeCorrelationsIntFlow() !!!!"<<endl;
4826 cout<<" (for "<<2*ci<<"-particle correlation)"<<endl;
4829 if(1.-pow(termA,2.) > 0.)
4831 termB = 1./pow(1-pow(termA,2.),0.5);
4835 cout<<" WARNING (QC): 1.-pow(termA,2.) <= 0 in method FinalizeCorrelationsIntFlow() !!!!"<<endl;
4836 cout<<" (for "<<2*ci<<"-particle correlation)"<<endl;
4839 Double_t statisticalError = termA * spread * termB;
4840 fIntFlowCorrelationsHist->SetBinContent(ci,correlation);
4841 fIntFlowCorrelationsHist->SetBinError(ci,statisticalError);
4842 } // end of for(Int_t ci=1;ci<=4;ci++) // correlation index
4844 // Versus multiplicity:
4845 if(!fCalculateCumulantsVsM){return;}
4846 for(Int_t ci=0;ci<=3;ci++) // correlation index
4848 Int_t nBins = fIntFlowCorrelationsVsMPro[ci]->GetNbinsX();
4849 for(Int_t b=1;b<=nBins;b++) // looping over multiplicity bins
4851 if(fIntFlowCorrelationsVsMPro[ci]->GetBinEffectiveEntries(b) < 2 || fIntFlowSquaredCorrelationsVsMPro[ci]->GetBinEffectiveEntries(b) < 2)
4853 fIntFlowCorrelationsVsMPro[ci]->SetBinError(b,0.);
4854 fIntFlowSquaredCorrelationsVsMPro[ci]->SetBinError(b,0.);
4857 Double_t correlationVsM = fIntFlowCorrelationsVsMPro[ci]->GetBinContent(b);
4858 Double_t squaredCorrelationVsM = fIntFlowSquaredCorrelationsVsMPro[ci]->GetBinContent(b);
4859 Double_t spreadVsM = 0.;
4860 if(squaredCorrelationVsM-correlationVsM*correlationVsM >= 0.)
4862 spreadVsM = pow(squaredCorrelationVsM-correlationVsM*correlationVsM,0.5);
4866 cout<<Form(" WARNING (QC): Imaginary 'spreadVsM' for ci = %d, bin = %d, entries = %f !!!!",
4867 ci,b,fIntFlowCorrelationsVsMPro[ci]->GetBinEffectiveEntries(b))<<endl;
4870 Double_t sumOfLinearEventWeightsVsM = fIntFlowSumOfEventWeightsVsM[ci][0]->GetBinContent(b);
4871 Double_t sumOfQuadraticEventWeightsVsM = fIntFlowSumOfEventWeightsVsM[ci][1]->GetBinContent(b);
4872 Double_t termAVsM = 0.;
4873 Double_t termBVsM = 0.;
4874 if(sumOfLinearEventWeightsVsM > 0.)
4876 termAVsM = pow(sumOfQuadraticEventWeightsVsM,0.5)/sumOfLinearEventWeightsVsM;
4878 if(1.-pow(termAVsM,2.) > 0.)
4880 termBVsM = 1./pow(1-pow(termAVsM,2.),0.5);
4882 Double_t statisticalErrorVsM = termAVsM * spreadVsM * termBVsM;
4883 fIntFlowCorrelationsVsMHist[ci]->SetBinContent(b,correlationVsM);
4884 fIntFlowCorrelationsVsMHist[ci]->SetBinError(b,statisticalErrorVsM);
4885 } // end of for(Int_t b=1;b<=nBins;b++)
4886 } // end of for(Int_t ci=1;ci<=4;ci++) // correlation index
4888 } // end of AliFlowAnalysisWithQCumulants::FinalizeCorrelationsIntFlow()
4890 //================================================================================================================================
4892 void AliFlowAnalysisWithQCumulants::FillAverageMultiplicities(Int_t nRP)
4894 // Fill profile fAverageMultiplicity to hold average multiplicities and
4895 // number of events for events with nRP>=0, nRP>=1, ... , and nRP>=8
4897 // Binning of fAverageMultiplicity is organized as follows:
4898 // 1st bin: all events (including the empty ones)
4899 // 2nd bin: event with # of RPs greater or equal to 1
4900 // 3rd bin: event with # of RPs greater or equal to 2
4901 // 4th bin: event with # of RPs greater or equal to 3
4902 // 5th bin: event with # of RPs greater or equal to 4
4903 // 6th bin: event with # of RPs greater or equal to 5
4904 // 7th bin: event with # of RPs greater or equal to 6
4905 // 8th bin: event with # of RPs greater or equal to 7
4906 // 9th bin: event with # of RPs greater or equal to 8
4911 cout<<" WARNING (QC): nRP<0 in in AFAWQC::FAM() !!!!"<<endl;
4916 for(Int_t i=0;i<9;i++)
4918 if(nRP>=i){fAvMultiplicity->Fill(i+0.5,nRP,1);}
4921 } // end of AliFlowAnalysisWithQCumulants::FillAverageMultiplicities(nRP)
4923 //================================================================================================================================
4925 void AliFlowAnalysisWithQCumulants::CalculateCumulantsIntFlow()
4927 // a) Calculate Q-cumulants from the measured multiparticle correlations;
4928 // b) Propagate the statistical errors from measured multiparticle correlations to statistical errors of Q-cumulants;
4929 // c) Remark: Q-cumulants calculated in this method are biased by non-uniform acceptance of detector !!!!
4930 // Method CalculateQcumulantsCorrectedForNUAIntFlow() is called afterwards to correct for this bias;
4931 // d) Store the results and statistical error of Q-cumulants in histogram fIntFlowQcumulants.
4932 // Binning of fIntFlowQcumulants is organized as follows:
4941 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
4942 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
4943 Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
4944 Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
4945 // Statistical errors of average 2-, 4-, 6- and 8-particle azimuthal correlations:
4946 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <2>
4947 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <4>
4948 Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <6>
4949 Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <8>
4950 // Covariances (multiplied by prefactor depending on weights - see comments in CalculateCovariancesIntFlow()):
4951 Double_t wCov24 = 0.; // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
4952 Double_t wCov26 = 0.; // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)
4953 Double_t wCov28 = 0.; // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)
4954 Double_t wCov46 = 0.; // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)
4955 Double_t wCov48 = 0.; // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)
4956 Double_t wCov68 = 0.; // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)
4957 if(!fForgetAboutCovariances)
4959 wCov24 = fIntFlowCovariances->GetBinContent(1); // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
4960 wCov26 = fIntFlowCovariances->GetBinContent(2); // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)
4961 wCov28 = fIntFlowCovariances->GetBinContent(3); // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)
4962 wCov46 = fIntFlowCovariances->GetBinContent(4); // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)
4963 wCov48 = fIntFlowCovariances->GetBinContent(5); // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)
4964 wCov68 = fIntFlowCovariances->GetBinContent(6); // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)
4967 Double_t qc2 = 0.; // QC{2}
4968 Double_t qc4 = 0.; // QC{4}
4969 Double_t qc6 = 0.; // QC{6}
4970 Double_t qc8 = 0.; // QC{8}
4971 if(TMath::Abs(two) > 0.){qc2 = two;}
4972 if(TMath::Abs(four) > 0.){qc4 = four-2.*pow(two,2.);}
4973 if(TMath::Abs(six) > 0.){qc6 = six-9.*two*four+12.*pow(two,3.);}
4974 if(TMath::Abs(eight) > 0.){qc8 = eight-16.*two*six-18.*pow(four,2.)+144.*pow(two,2.)*four-144.*pow(two,4.);}
4975 // Statistical errors of Q-cumulants:
4976 Double_t qc2Error = 0.;
4977 Double_t qc4Error = 0.;
4978 Double_t qc6Error = 0.;
4979 Double_t qc8Error = 0.;
4980 // Squared statistical errors of Q-cumulants:
4981 //Double_t qc2ErrorSquared = 0.;
4982 Double_t qc4ErrorSquared = 0.;
4983 Double_t qc6ErrorSquared = 0.;
4984 Double_t qc8ErrorSquared = 0.;
4985 // Statistical error of QC{2}:
4986 qc2Error = twoError;
4987 // Statistical error of QC{4}:
4988 qc4ErrorSquared = 16.*pow(two,2.)*pow(twoError,2)+pow(fourError,2.)
4990 if(qc4ErrorSquared>0.)
4992 qc4Error = pow(qc4ErrorSquared,0.5);
4995 cout<<" WARNING (QC): Statistical error of QC{4} is imaginary !!!!"<<endl;
4997 // Statistical error of QC{6}:
4998 qc6ErrorSquared = 81.*pow(4.*pow(two,2.)-four,2.)*pow(twoError,2.)
4999 + 81.*pow(two,2.)*pow(fourError,2.)
5001 - 162.*two*(4.*pow(two,2.)-four)*wCov24
5002 + 18.*(4.*pow(two,2.)-four)*wCov26
5004 if(qc6ErrorSquared>0.)
5006 qc6Error = pow(qc6ErrorSquared,0.5);
5009 cout<<" WARNING (QC): Statistical error of QC{6} is imaginary !!!!"<<endl;
5011 // Statistical error of QC{8}:
5012 qc8ErrorSquared = 256.*pow(36.*pow(two,3.)-18.*four*two+six,2.)*pow(twoError,2.)
5013 + 1296.*pow(4.*pow(two,2.)-four,2.)*pow(fourError,2.)
5014 + 256.*pow(two,2.)*pow(sixError,2.)
5015 + pow(eightError,2.)
5016 - 1152.*(36.*pow(two,3.)-18.*four*two+six)*(4.*pow(two,2.)-four)*wCov24
5017 + 512.*two*(36.*pow(two,3.)-18.*four*two+six)*wCov26
5018 - 32.*(36.*pow(two,3.)-18.*four*two+six)*wCov28
5019 - 1152.*two*(4.*pow(two,2.)-four)*wCov46
5020 + 72.*(4.*pow(two,2.)-four)*wCov48
5022 if(qc8ErrorSquared>0.)
5024 qc8Error = pow(qc8ErrorSquared,0.5);
5027 cout<<"WARNING (QC): Statistical error of QC{8} is imaginary !!!!"<<endl;
5029 // Store the results and statistical errors for Q-cumulants:
5030 if(TMath::Abs(qc2)>0.)
5032 fIntFlowQcumulants->SetBinContent(1,qc2);
5033 fIntFlowQcumulants->SetBinError(1,qc2Error);
5035 if(TMath::Abs(qc4)>0.)
5037 fIntFlowQcumulants->SetBinContent(2,qc4);
5038 fIntFlowQcumulants->SetBinError(2,qc4Error);
5040 if(TMath::Abs(qc6)>0.)
5042 fIntFlowQcumulants->SetBinContent(3,qc6);
5043 fIntFlowQcumulants->SetBinError(3,qc6Error);
5045 if(TMath::Abs(qc8)>0.)
5047 fIntFlowQcumulants->SetBinContent(4,qc8);
5048 fIntFlowQcumulants->SetBinError(4,qc8Error);
5051 // Versus multiplicity:
5052 if(!fCalculateCumulantsVsM){return;}
5053 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
5054 Double_t value[4] = {0.}; // QCs vs M
5055 Double_t error[4] = {0.}; // error of QCs vs M
5056 Double_t dSum1[4] = {0.}; // sum value_i/(error_i)^2
5057 Double_t dSum2[4] = {0.}; // sum 1/(error_i)^2
5058 for(Int_t b=1;b<=nBins;b++)
5061 two = fIntFlowCorrelationsVsMHist[0]->GetBinContent(b); // <<2>>
5062 four = fIntFlowCorrelationsVsMHist[1]->GetBinContent(b); // <<4>>
5063 six = fIntFlowCorrelationsVsMHist[2]->GetBinContent(b); // <<6>>
5064 eight = fIntFlowCorrelationsVsMHist[3]->GetBinContent(b); // <<8>>
5065 // Statistical errors of average 2-, 4-, 6- and 8-particle azimuthal correlations:
5066 twoError = fIntFlowCorrelationsVsMHist[0]->GetBinError(b); // statistical error of <2>
5067 fourError = fIntFlowCorrelationsVsMHist[1]->GetBinError(b); // statistical error of <4>
5068 sixError = fIntFlowCorrelationsVsMHist[2]->GetBinError(b); // statistical error of <6>
5069 eightError = fIntFlowCorrelationsVsMHist[3]->GetBinError(b); // statistical error of <8>
5070 // Covariances (multiplied by prefactor depending on weights - see comments in CalculateCovariancesIntFlow()):
5071 if(!fForgetAboutCovariances)
5073 wCov24 = fIntFlowCovariancesVsM[0]->GetBinContent(b); // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)
5074 wCov26 = fIntFlowCovariancesVsM[1]->GetBinContent(b); // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)
5075 wCov28 = fIntFlowCovariancesVsM[2]->GetBinContent(b); // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)
5076 wCov46 = fIntFlowCovariancesVsM[3]->GetBinContent(b); // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)
5077 wCov48 = fIntFlowCovariancesVsM[4]->GetBinContent(b); // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)
5078 wCov68 = fIntFlowCovariancesVsM[5]->GetBinContent(b); // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)
5085 if(TMath::Abs(two) > 0.){qc2 = two;}
5086 if(TMath::Abs(four) > 0.){qc4 = four-2.*pow(two,2.);}
5087 if(TMath::Abs(six) > 0.){qc6 = six-9.*two*four+12.*pow(two,3.);}
5088 if(TMath::Abs(eight) > 0.){qc8 = eight-16.*two*six-18.*pow(four,2.)+144.*pow(two,2.)*four-144.*pow(two,4.);}
5089 // Statistical errors of Q-cumulants:
5094 // Squared statistical errors of Q-cumulants:
5095 //Double_t qc2ErrorSquared = 0.;
5096 qc4ErrorSquared = 0.;
5097 qc6ErrorSquared = 0.;
5098 qc8ErrorSquared = 0.;
5099 // Statistical error of QC{2}:
5100 qc2Error = twoError;
5101 // Statistical error of QC{4}:
5102 qc4ErrorSquared = 16.*pow(two,2.)*pow(twoError,2)+pow(fourError,2.)
5104 if(qc4ErrorSquared>0.)
5106 qc4Error = pow(qc4ErrorSquared,0.5);
5109 // cout<<"WARNING: Statistical error of QC{4} is imaginary in multiplicity bin "<<b<<" !!!!"<<endl;
5111 // Statistical error of QC{6}:
5112 qc6ErrorSquared = 81.*pow(4.*pow(two,2.)-four,2.)*pow(twoError,2.)
5113 + 81.*pow(two,2.)*pow(fourError,2.)
5115 - 162.*two*(4.*pow(two,2.)-four)*wCov24
5116 + 18.*(4.*pow(two,2.)-four)*wCov26
5118 if(qc6ErrorSquared>0.)
5120 qc6Error = pow(qc6ErrorSquared,0.5);
5123 // cout<<"WARNING: Statistical error of QC{6} is imaginary in multiplicity bin "<<b<<" !!!!"<<endl;
5125 // Statistical error of QC{8}:
5126 qc8ErrorSquared = 256.*pow(36.*pow(two,3.)-18.*four*two+six,2.)*pow(twoError,2.)
5127 + 1296.*pow(4.*pow(two,2.)-four,2.)*pow(fourError,2.)
5128 + 256.*pow(two,2.)*pow(sixError,2.)
5129 + pow(eightError,2.)
5130 - 1152.*(36.*pow(two,3.)-18.*four*two+six)*(4.*pow(two,2.)-four)*wCov24
5131 + 512.*two*(36.*pow(two,3.)-18.*four*two+six)*wCov26
5132 - 32.*(36.*pow(two,3.)-18.*four*two+six)*wCov28
5133 - 1152.*two*(4.*pow(two,2.)-four)*wCov46
5134 + 72.*(4.*pow(two,2.)-four)*wCov48
5136 if(qc8ErrorSquared>0.)
5138 qc8Error = pow(qc8ErrorSquared,0.5);
5141 // cout<<"WARNING: Statistical error of QC{8} is imaginary in multiplicity bin "<<b<<" !!!!"<<endl;
5143 // Store the results and statistical errors for Q-cumulants:
5144 if(TMath::Abs(qc2)>0.)
5146 fIntFlowQcumulantsVsM[0]->SetBinContent(b,qc2);
5147 fIntFlowQcumulantsVsM[0]->SetBinError(b,qc2Error);
5149 if(TMath::Abs(qc4)>0.)
5151 fIntFlowQcumulantsVsM[1]->SetBinContent(b,qc4);
5152 fIntFlowQcumulantsVsM[1]->SetBinError(b,qc4Error);
5154 if(TMath::Abs(qc6)>0.)
5156 fIntFlowQcumulantsVsM[2]->SetBinContent(b,qc6);
5157 fIntFlowQcumulantsVsM[2]->SetBinError(b,qc6Error);
5159 if(TMath::Abs(qc8)>0.)
5161 fIntFlowQcumulantsVsM[3]->SetBinContent(b,qc8);
5162 fIntFlowQcumulantsVsM[3]->SetBinError(b,qc8Error);
5165 for(Int_t co=0;co<4;co++)
5167 if(fIntFlowCorrelationsVsMPro[co]->GetBinEffectiveEntries(b)<2){continue;}
5168 value[co] = fIntFlowQcumulantsVsM[co]->GetBinContent(b);
5169 error[co] = fIntFlowQcumulantsVsM[co]->GetBinError(b);
5172 dSum1[co]+=value[co]/(error[co]*error[co]);
5173 dSum2[co]+=1./(error[co]*error[co]);
5175 } // end of for(Int_t co=0;co<4;co++)
5176 } // end of for(Int_t b=1;b<=nBins;b++)
5177 // Store rebinned Q-cumulants:
5178 for(Int_t co=0;co<4;co++)
5182 fIntFlowQcumulantsRebinnedInM->SetBinContent(co+1,dSum1[co]/dSum2[co]);
5183 fIntFlowQcumulantsRebinnedInM->SetBinError(co+1,pow(1./dSum2[co],0.5));
5185 } // end of for(Int_t co=0;co<4;co++)
5187 } // end of AliFlowAnalysisWithQCumulants::CalculateCumulantsIntFlow()
5189 //================================================================================================================================
5191 void AliFlowAnalysisWithQCumulants::CalculateReferenceFlow()
5193 // a) Calculate the final results for reference flow estimates from Q-cumulants;
5194 // b) Propagate the statistical errors to reference flow estimates from statistical error of Q-cumulants;
5195 // c) Store the results and statistical errors of reference flow estimates in histogram fIntFlow.
5196 // Binning of fIntFlow is organized as follows:
5204 // Reference flow estimates:
5205 Double_t v2 = 0.; // v{2,QC}
5206 Double_t v4 = 0.; // v{4,QC}
5207 Double_t v6 = 0.; // v{6,QC}
5208 Double_t v8 = 0.; // v{8,QC}
5209 // Reference flow's statistical errors:
5210 Double_t v2Error = 0.; // v{2,QC} stat. error
5211 Double_t v4Error = 0.; // v{4,QC} stat. error
5212 Double_t v6Error = 0.; // v{6,QC} stat. error
5213 Double_t v8Error = 0.; // v{8,QC} stat. error
5216 Double_t qc2 = fIntFlowQcumulants->GetBinContent(1); // QC{2}
5217 Double_t qc4 = fIntFlowQcumulants->GetBinContent(2); // QC{4}
5218 Double_t qc6 = fIntFlowQcumulants->GetBinContent(3); // QC{6}
5219 Double_t qc8 = fIntFlowQcumulants->GetBinContent(4); // QC{8}
5220 // Q-cumulants's statistical errors:
5221 Double_t qc2Error = fIntFlowQcumulants->GetBinError(1); // QC{2} stat. error
5222 Double_t qc4Error = fIntFlowQcumulants->GetBinError(2); // QC{4} stat. error
5223 Double_t qc6Error = fIntFlowQcumulants->GetBinError(3); // QC{6} stat. error
5224 Double_t qc8Error = fIntFlowQcumulants->GetBinError(4); // QC{8} stat. error
5225 // Calculate reference flow estimates from Q-cumulants:
5226 if(qc2>=0.){v2 = pow(qc2,0.5);}
5227 if(qc4<=0.){v4 = pow(-1.*qc4,1./4.);}
5228 if(qc6>=0.){v6 = pow((1./4.)*qc6,1./6.);}
5229 if(qc8<=0.){v8 = pow((-1./33.)*qc8,1./8.);}
5230 // Calculate stat. error for reference flow estimates from stat. error of Q-cumulants:
5231 if(qc2>0.){v2Error = (1./2.)*pow(qc2,-0.5)*qc2Error;}
5232 if(qc4<0.){v4Error = (1./4.)*pow(-qc4,-3./4.)*qc4Error;}
5233 if(qc6>0.){v6Error = (1./6.)*pow(2.,-1./3.)*pow(qc6,-5./6.)*qc6Error;}
5234 if(qc8<0.){v8Error = (1./8.)*pow(33.,-1./8.)*pow(-qc8,-7./8.)*qc8Error;}
5235 // Print warnings for the 'wrong sign' cumulants:
5236 if(TMath::Abs(v2) < 1.e-44)
5238 cout<<" WARNING: Wrong sign QC{2}, couldn't calculate v{2,QC} !!!!"<<endl;
5240 if(TMath::Abs(v4) < 1.e-44)
5242 cout<<" WARNING: Wrong sign QC{4}, couldn't calculate v{4,QC} !!!!"<<endl;
5244 if(TMath::Abs(v6) < 1.e-44)
5246 cout<<" WARNING: Wrong sign QC{6}, couldn't calculate v{6,QC} !!!!"<<endl;
5248 if(TMath::Abs(v8) < 1.e-44)
5250 cout<<" WARNING: Wrong sign QC{8}, couldn't calculate v{8,QC} !!!!"<<endl;
5252 // Store the results and statistical errors of integrated flow estimates:
5253 fIntFlow->SetBinContent(1,v2);
5254 fIntFlow->SetBinError(1,v2Error);
5255 fIntFlow->SetBinContent(2,v4);
5256 fIntFlow->SetBinError(2,v4Error);
5257 fIntFlow->SetBinContent(3,v6);
5258 fIntFlow->SetBinError(3,v6Error);
5259 fIntFlow->SetBinContent(4,v8);
5260 fIntFlow->SetBinError(4,v8Error);
5262 // Versus multiplicity:
5263 if(!fCalculateCumulantsVsM){return;}
5264 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
5265 for(Int_t b=1;b<=nBins;b++)
5268 Double_t qc2VsM = fIntFlowQcumulantsVsM[0]->GetBinContent(b); // QC{2}
5269 Double_t qc4VsM = fIntFlowQcumulantsVsM[1]->GetBinContent(b); // QC{4}
5270 Double_t qc6VsM = fIntFlowQcumulantsVsM[2]->GetBinContent(b); // QC{6}
5271 Double_t qc8VsM = fIntFlowQcumulantsVsM[3]->GetBinContent(b); // QC{8}
5272 // Q-cumulants's statistical errors:
5273 Double_t qc2ErrorVsM = fIntFlowQcumulantsVsM[0]->GetBinError(b); // QC{2} stat. error
5274 Double_t qc4ErrorVsM = fIntFlowQcumulantsVsM[1]->GetBinError(b); // QC{4} stat. error
5275 Double_t qc6ErrorVsM = fIntFlowQcumulantsVsM[2]->GetBinError(b); // QC{6} stat. error
5276 Double_t qc8ErrorVsM = fIntFlowQcumulantsVsM[3]->GetBinError(b); // QC{8} stat. error
5277 // Reference flow estimates:
5278 Double_t v2VsM = 0.; // v{2,QC}
5279 Double_t v4VsM = 0.; // v{4,QC}
5280 Double_t v6VsM = 0.; // v{6,QC}
5281 Double_t v8VsM = 0.; // v{8,QC}
5282 // Reference flow estimates errors:
5283 Double_t v2ErrorVsM = 0.; // v{2,QC} stat. error
5284 Double_t v4ErrorVsM = 0.; // v{4,QC} stat. error
5285 Double_t v6ErrorVsM = 0.; // v{6,QC} stat. error
5286 Double_t v8ErrorVsM = 0.; // v{8,QC} stat. error
5287 // Calculate reference flow estimates from Q-cumulants:
5288 if(qc2VsM>=0.){v2VsM = pow(qc2VsM,0.5);}
5289 if(qc4VsM<=0.){v4VsM = pow(-1.*qc4VsM,1./4.);}
5290 if(qc6VsM>=0.){v6VsM = pow((1./4.)*qc6VsM,1./6.);}
5291 if(qc8VsM<=0.){v8VsM = pow((-1./33.)*qc8VsM,1./8.);}
5292 // Calculate stat. error for reference flow estimates from stat. error of Q-cumulants:
5293 if(qc2VsM>0.){v2ErrorVsM = (1./2.)*pow(qc2VsM,-0.5)*qc2ErrorVsM;}
5294 if(qc4VsM<0.){v4ErrorVsM = (1./4.)*pow(-qc4VsM,-3./4.)*qc4ErrorVsM;}
5295 if(qc6VsM>0.){v6ErrorVsM = (1./6.)*pow(2.,-1./3.)*pow(qc6VsM,-5./6.)*qc6ErrorVsM;}
5296 if(qc8VsM<0.){v8ErrorVsM = (1./8.)*pow(33.,-1./8.)*pow(-qc8VsM,-7./8.)*qc8ErrorVsM;}
5297 // Store the results and statistical errors of integrated flow estimates:
5298 fIntFlowVsM[0]->SetBinContent(b,v2VsM);
5299 fIntFlowVsM[0]->SetBinError(b,v2ErrorVsM);
5300 fIntFlowVsM[1]->SetBinContent(b,v4VsM);
5301 fIntFlowVsM[1]->SetBinError(b,v4ErrorVsM);
5302 fIntFlowVsM[2]->SetBinContent(b,v6VsM);
5303 fIntFlowVsM[2]->SetBinError(b,v6ErrorVsM);
5304 fIntFlowVsM[3]->SetBinContent(b,v8VsM);
5305 fIntFlowVsM[3]->SetBinError(b,v8ErrorVsM);
5306 } // end of for(Int_t b=1;b<=nBins;b++)
5308 // 'Rebinned in M' calculation: // to be improved - this can be implemented better:
5309 // Reference flow estimates:
5310 Double_t v2RebinnedInM = 0.; // v{2,QC}
5311 Double_t v4RebinnedInM = 0.; // v{4,QC}
5312 Double_t v6RebinnedInM = 0.; // v{6,QC}
5313 Double_t v8RebinnedInM = 0.; // v{8,QC}
5314 // Reference flow's statistical errors:
5315 Double_t v2ErrorRebinnedInM = 0.; // v{2,QC} stat. error
5316 Double_t v4ErrorRebinnedInM = 0.; // v{4,QC} stat. error
5317 Double_t v6ErrorRebinnedInM = 0.; // v{6,QC} stat. error
5318 Double_t v8ErrorRebinnedInM = 0.; // v{8,QC} stat. error
5320 Double_t qc2RebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinContent(1); // QC{2}
5321 Double_t qc4RebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinContent(2); // QC{4}
5322 Double_t qc6RebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinContent(3); // QC{6}
5323 Double_t qc8RebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinContent(4); // QC{8}
5324 // Q-cumulants's statistical errors:
5325 Double_t qc2ErrorRebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinError(1); // QC{2} stat. error
5326 Double_t qc4ErrorRebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinError(2); // QC{4} stat. error
5327 Double_t qc6ErrorRebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinError(3); // QC{6} stat. error
5328 Double_t qc8ErrorRebinnedInM = fIntFlowQcumulantsRebinnedInM->GetBinError(4); // QC{8} stat. error
5329 // Calculate reference flow estimates from Q-cumulants:
5330 if(qc2RebinnedInM>=0.){v2RebinnedInM = pow(qc2RebinnedInM,0.5);}
5331 if(qc4RebinnedInM<=0.){v4RebinnedInM = pow(-1.*qc4RebinnedInM,1./4.);}
5332 if(qc6RebinnedInM>=0.){v6RebinnedInM = pow((1./4.)*qc6RebinnedInM,1./6.);}
5333 if(qc8RebinnedInM<=0.){v8RebinnedInM = pow((-1./33.)*qc8RebinnedInM,1./8.);}
5334 // Calculate stat. error for reference flow estimates from stat. error of Q-cumulants:
5335 if(qc2RebinnedInM>0.){v2ErrorRebinnedInM = (1./2.)*pow(qc2RebinnedInM,-0.5)*qc2ErrorRebinnedInM;}
5336 if(qc4RebinnedInM<0.){v4ErrorRebinnedInM = (1./4.)*pow(-qc4RebinnedInM,-3./4.)*qc4ErrorRebinnedInM;}
5337 if(qc6RebinnedInM>0.){v6ErrorRebinnedInM = (1./6.)*pow(2.,-1./3.)*pow(qc6RebinnedInM,-5./6.)*qc6ErrorRebinnedInM;}
5338 if(qc8RebinnedInM<0.){v8ErrorRebinnedInM = (1./8.)*pow(33.,-1./8.)*pow(-qc8RebinnedInM,-7./8.)*qc8ErrorRebinnedInM;}
5339 // Print warnings for the 'wrong sign' cumulants:
5340 if(TMath::Abs(v2RebinnedInM) < 1.e-44)
5342 cout<<" WARNING: Wrong sign QC{2} rebinned in M, couldn't calculate v{2,QC} !!!!"<<endl;
5344 if(TMath::Abs(v4RebinnedInM) < 1.e-44)
5346 cout<<" WARNING: Wrong sign QC{4} rebinned in M, couldn't calculate v{4,QC} !!!!"<<endl;
5348 if(TMath::Abs(v6RebinnedInM) < 1.e-44)
5350 cout<<" WARNING: Wrong sign QC{6} rebinned in M, couldn't calculate v{6,QC} !!!!"<<endl;
5352 if(TMath::Abs(v8RebinnedInM) < 1.e-44)
5354 cout<<" WARNING: Wrong sign QC{8} rebinned in M, couldn't calculate v{8,QC} !!!!"<<endl;
5356 // Store the results and statistical errors of integrated flow estimates:
5357 fIntFlowRebinnedInM->SetBinContent(1,v2RebinnedInM);
5358 fIntFlowRebinnedInM->SetBinError(1,v2ErrorRebinnedInM);
5359 fIntFlowRebinnedInM->SetBinContent(2,v4RebinnedInM);
5360 fIntFlowRebinnedInM->SetBinError(2,v4ErrorRebinnedInM);
5361 fIntFlowRebinnedInM->SetBinContent(3,v6RebinnedInM);
5362 fIntFlowRebinnedInM->SetBinError(3,v6ErrorRebinnedInM);
5363 fIntFlowRebinnedInM->SetBinContent(4,v8RebinnedInM);
5364 fIntFlowRebinnedInM->SetBinError(4,v8ErrorRebinnedInM);
5366 } // end of AliFlowAnalysisWithQCumulants::CalculateReferenceFlow()
5368 //================================================================================================================================
5370 void AliFlowAnalysisWithQCumulants::FillCommonHistResultsIntFlow()
5372 // Fill in AliFlowCommonHistResults histograms relevant for reference flow.
5374 // There are two possibilities here:
5375 // a) Store minimum bias reference flow - use SetMinimumBiasReferenceFlow(kTRUE). This result is
5376 // biased by the interplay between nonflow correlations and multiplicity fluctuations and is
5377 // also stored in local histogram fIntFlow;
5378 // b) Store reference flow obtained from flow analysis performed at fixed multiplicity and
5379 // rebinned only at the end of the day - use SetMinimumBiasReferenceFlow(kFALSE). This result
5380 // is also stored in local histogram fIntFlowRebinnedInM.
5382 // Reference flow estimates:
5383 Double_t v[4] = {0.};
5384 // Statistical errors of reference flow estimates:
5385 Double_t vError[4] = {0.};
5387 for(Int_t b=0;b<4;b++)
5389 if(fMinimumBiasReferenceFlow)
5391 v[b] = fIntFlow->GetBinContent(b+1);
5392 vError[b] = fIntFlow->GetBinError(b+1);
5395 v[b] = fIntFlowRebinnedInM->GetBinContent(b+1);
5396 vError[b] = fIntFlowRebinnedInM->GetBinError(b+1);
5398 } // end of for(Int_t b=0;b<4;b++)
5400 // Fill AliFlowCommonHistResults histogram:
5401 fCommonHistsResults2nd->FillIntegratedFlow(v[0],vError[0]); // to be improved (hardwired 2nd in the name)
5402 fCommonHistsResults4th->FillIntegratedFlow(v[1],vError[1]); // to be improved (hardwired 4th in the name)
5403 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights)) // to be improved (calculate also 6th and 8th order)
5405 fCommonHistsResults6th->FillIntegratedFlow(v[2],vError[2]); // to be improved (hardwired 6th in the name)
5406 fCommonHistsResults8th->FillIntegratedFlow(v[3],vError[3]); // to be improved (hardwired 8th in the name)
5409 } // end of AliFlowAnalysisWithQCumulants::FillCommonHistResultsIntFlow()
5411 //================================================================================================================================
5413 void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelationsUsingParticleWeights()
5415 // Calculate all correlations needed for integrated flow using particle weights.
5417 // Remark 1: When particle weights are used the binning of fIntFlowCorrelationAllPro is organized as follows:
5419 // 1st bin: <2>_{1n|1n} = two1n1nW1W1 = <w1 w2 cos(n*(phi1-phi2))>
5420 // 2nd bin: <2>_{2n|2n} = two2n2nW2W2 = <w1^2 w2^2 cos(2n*(phi1-phi2))>
5421 // 3rd bin: <2>_{3n|3n} = two3n3nW3W3 = <w1^3 w2^3 cos(3n*(phi1-phi2))>
5422 // 4th bin: <2>_{4n|4n} = two4n4nW4W4 = <w1^4 w2^4 cos(4n*(phi1-phi2))>
5423 // 5th bin: ---- EMPTY ----
5424 // 6th bin: <3>_{2n|1n,1n} = three2n1n1nW2W1W1 = <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
5425 // 7th bin: <3>_{3n|2n,1n} = ...
5426 // 8th bin: <3>_{4n|2n,2n} = ...
5427 // 9th bin: <3>_{4n|3n,1n} = ...
5428 // 10th bin: ---- EMPTY ----
5429 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1nW1W1W1W1 = <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
5430 // 12th bin: <4>_{2n,1n|2n,1n} = ...
5431 // 13th bin: <4>_{2n,2n|2n,2n} = ...
5432 // 14th bin: <4>_{3n|1n,1n,1n} = ...
5433 // 15th bin: <4>_{3n,1n|3n,1n} = ...
5434 // 16th bin: <4>_{3n,1n|2n,2n} = ...
5435 // 17th bin: <4>_{4n|2n,1n,1n} = ...
5436 // 18th bin: ---- EMPTY ----
5437 // 19th bin: <5>_{2n|1n,1n,1n,1n} = ...
5438 // 20th bin: <5>_{2n,2n|2n,1n,1n} = ...
5439 // 21st bin: <5>_{3n,1n|2n,1n,1n} = ...
5440 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = ...
5441 // 23rd bin: ---- EMPTY ----
5442 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = ...
5443 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = ...
5444 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = ...
5445 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = ...
5446 // 28th bin: ---- EMPTY ----
5447 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = ...
5448 // 30th bin: ---- EMPTY ----
5449 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = ...
5451 // Remark 2: When particle weights are used there are some extra correlations. They are stored in
5452 // fIntFlowExtraCorrelationsPro binning of which is organized as follows:
5454 // 1st bin: two1n1nW3W1 = <w1^3 w2 cos(n*(phi1-phi2))>
5455 // 2nd bin: two1n1nW1W1W2 = <w1 w2 w3^2 cos(n*(phi1-phi2))>
5457 // multiplicity (number of particles used to determine the reaction plane)
5458 Double_t dMult = (*fSpk)(0,0);
5460 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
5461 Double_t dReQ1n1k = (*fReQ)(0,1);
5462 Double_t dReQ2n2k = (*fReQ)(1,2);
5463 Double_t dReQ3n3k = (*fReQ)(2,3);
5464 Double_t dReQ4n4k = (*fReQ)(3,4);
5465 Double_t dReQ1n3k = (*fReQ)(0,3);
5466 Double_t dImQ1n1k = (*fImQ)(0,1);
5467 Double_t dImQ2n2k = (*fImQ)(1,2);
5468 Double_t dImQ3n3k = (*fImQ)(2,3);
5469 Double_t dImQ4n4k = (*fImQ)(3,4);
5470 Double_t dImQ1n3k = (*fImQ)(0,3);
5472 // dMs are variables introduced in order to simplify some Eqs. bellow:
5473 //..............................................................................................
5474 Double_t dM11 = (*fSpk)(1,1)-(*fSpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
5475 Double_t dM22 = (*fSpk)(1,2)-(*fSpk)(0,4); // dM22 = sum_{i,j=1,i!=j}^M w_i^2 w_j^2
5476 Double_t dM33 = (*fSpk)(1,3)-(*fSpk)(0,6); // dM33 = sum_{i,j=1,i!=j}^M w_i^3 w_j^3
5477 Double_t dM44 = (*fSpk)(1,4)-(*fSpk)(0,8); // dM44 = sum_{i,j=1,i!=j}^M w_i^4 w_j^4
5478 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
5479 Double_t dM211 = (*fSpk)(0,2)*(*fSpk)(1,1)-2.*(*fSpk)(0,3)*(*fSpk)(0,1)
5480 - (*fSpk)(1,2)+2.*(*fSpk)(0,4); // dM211 = sum_{i,j,k=1,i!=j!=k}^M w_i^2 w_j w_k
5481 Double_t dM1111 = (*fSpk)(3,1)-6.*(*fSpk)(0,2)*(*fSpk)(1,1)
5482 + 8.*(*fSpk)(0,3)*(*fSpk)(0,1)
5483 + 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
5484 //..............................................................................................
5486 // 2-particle correlations:
5487 Double_t two1n1nW1W1 = 0.; // <w1 w2 cos(n*(phi1-phi2))>
5488 Double_t two2n2nW2W2 = 0.; // <w1^2 w2^2 cos(2n*(phi1-phi2))>
5489 Double_t two3n3nW3W3 = 0.; // <w1^3 w2^3 cos(3n*(phi1-phi2))>
5490 Double_t two4n4nW4W4 = 0.; // <w1^4 w2^4 cos(4n*(phi1-phi2))>
5495 two1n1nW1W1 = (pow(dReQ1n1k,2)+pow(dImQ1n1k,2)-(*fSpk)(0,2))/dM11;
5496 // average correlation <w1 w2 cos(n*(phi1-phi2))> for single event:
5497 fIntFlowCorrelationsEBE->SetBinContent(1,two1n1nW1W1);
5498 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(1,dM11);
5499 // average correlation <w1 w2 cos(n*(phi1-phi2))> for all events:
5500 fIntFlowCorrelationsPro->Fill(0.5,two1n1nW1W1,dM11);
5501 // average squared correlation <w1 w2 cos(n*(phi1-phi2))> for all events:
5502 fIntFlowSquaredCorrelationsPro->Fill(0.5,two1n1nW1W1*two1n1nW1W1,dM11);
5503 fIntFlowCorrelationsAllPro->Fill(0.5,two1n1nW1W1,dM11);
5507 two2n2nW2W2 = (pow(dReQ2n2k,2)+pow(dImQ2n2k,2)-(*fSpk)(0,4))/dM22;
5509 // average correlation <w1^2 w2^2 cos(2n*(phi1-phi2))> for all events:
5510 fIntFlowCorrelationsAllPro->Fill(1.5,two2n2nW2W2,dM22);
5514 two3n3nW3W3 = (pow(dReQ3n3k,2)+pow(dImQ3n3k,2)-(*fSpk)(0,6))/dM33;
5516 // average correlation <w1^3 w2^3 cos(3n*(phi1-phi2))> for all events:
5517 fIntFlowCorrelationsAllPro->Fill(2.5,two3n3nW3W3,dM33);
5521 two4n4nW4W4 = (pow(dReQ4n4k,2)+pow(dImQ4n4k,2)-(*fSpk)(0,8))/dM44;
5523 // average correlation <w1^4 w2^4 cos(4n*(phi1-phi2))> for all events:
5524 fIntFlowCorrelationsAllPro->Fill(3.5,two4n4nW4W4,dM44);
5526 } // end of if(dMult>1)
5528 // extra 2-particle correlations:
5529 Double_t two1n1nW3W1 = 0.; // <w1^3 w2 cos(n*(phi1-phi2))>
5530 Double_t two1n1nW1W1W2 = 0.; // <w1 w2 w3^2 cos(n*(phi1-phi2))>
5535 two1n1nW3W1 = (dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k-(*fSpk)(0,4))/dM31;
5536 fIntFlowExtraCorrelationsPro->Fill(0.5,two1n1nW3W1,dM31);
5540 two1n1nW1W1W2 = ((*fSpk)(0,2)*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2)-(*fSpk)(0,2))
5541 - 2.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k
5542 - (*fSpk)(0,4)))/dM211;
5543 fIntFlowExtraCorrelationsPro->Fill(1.5,two1n1nW1W1W2,dM211);
5545 } // end of if(dMult>1)
5546 //..............................................................................................
5548 //..............................................................................................
5549 // 3-particle correlations:
5550 Double_t three2n1n1nW2W1W1 = 0.; // <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
5556 three2n1n1nW2W1W1 = (pow(dReQ1n1k,2.)*dReQ2n2k+2.*dReQ1n1k*dImQ1n1k*dImQ2n2k-pow(dImQ1n1k,2.)*dReQ2n2k
5557 - 2.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k)
5558 - pow(dReQ2n2k,2)-pow(dImQ2n2k,2)
5559 + 2.*(*fSpk)(0,4))/dM211;
5560 fIntFlowCorrelationsAllPro->Fill(5.5,three2n1n1nW2W1W1,dM211);
5562 } // end of if(dMult>2)
5563 //..............................................................................................
5565 //..............................................................................................
5566 // 4-particle correlations:
5567 Double_t four1n1n1n1nW1W1W1W1 = 0.; // <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
5572 four1n1n1n1nW1W1W1W1 = (pow(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.),2)
5573 - 2.*(pow(dReQ1n1k,2.)*dReQ2n2k+2.*dReQ1n1k*dImQ1n1k*dImQ2n2k-pow(dImQ1n1k,2.)*dReQ2n2k)
5574 + 8.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k)
5575 + (pow(dReQ2n2k,2)+pow(dImQ2n2k,2))
5576 - 4.*(*fSpk)(0,2)*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
5577 - 6.*(*fSpk)(0,4)+2.*(*fSpk)(1,2))/dM1111;
5579 // average correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for single event:
5580 fIntFlowCorrelationsEBE->SetBinContent(2,four1n1n1n1nW1W1W1W1);
5581 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(2,dM1111);
5582 // average correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for all events:
5583 fIntFlowCorrelationsPro->Fill(1.5,four1n1n1n1nW1W1W1W1,dM1111);
5584 // average squared correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for all events:
5585 fIntFlowSquaredCorrelationsPro->Fill(1.5,four1n1n1n1nW1W1W1W1*four1n1n1n1nW1W1W1W1,dM1111);
5586 fIntFlowCorrelationsAllPro->Fill(10.5,four1n1n1n1nW1W1W1W1,dM1111);
5588 } // end of if(dMult>3)
5589 //..............................................................................................
5591 } // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelationsUsingParticleWeights()
5593 //================================================================================================================================
5595 void AliFlowAnalysisWithQCumulants::InitializeArraysForIntFlow()
5597 // Initialize all arrays used to calculate integrated flow.
5599 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
5601 fIntFlowCorrectionTermsForNUAEBE[sc] = NULL;
5602 fIntFlowEventWeightForCorrectionTermsForNUAEBE[sc] = NULL;
5603 fIntFlowCorrectionTermsForNUAPro[sc] = NULL;
5604 fIntFlowCorrectionTermsForNUAHist[sc] = NULL;
5605 for(Int_t ci=0;ci<4;ci++) // correction term index (to be improved - hardwired 4)
5607 fIntFlowCorrectionTermsForNUAVsMPro[sc][ci] = NULL;
5609 for(Int_t power=0;power<2;power++) // linear or quadratic
5611 fIntFlowSumOfEventWeightsNUA[sc][power] = NULL;
5614 for(Int_t power=0;power<2;power++) // linear or quadratic
5616 fIntFlowSumOfEventWeights[power] = NULL;
5618 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))
5620 fPrintFinalResults[i] = kTRUE;
5622 for(Int_t ci=0;ci<4;ci++) // correlation index or cumulant order
5624 fIntFlowCorrelationsVsMPro[ci] = NULL;
5625 fIntFlowSquaredCorrelationsVsMPro[ci] = NULL;
5626 fIntFlowCorrelationsVsMHist[ci] = NULL;
5627 fIntFlowQcumulantsVsM[ci] = NULL;
5628 fIntFlowVsM[ci] = NULL;
5629 fIntFlowDetectorBiasVsM[ci] = NULL;
5630 for(Int_t lc=0;lc<2;lc++)
5632 fIntFlowSumOfEventWeightsVsM[ci][lc] = NULL;
5635 for(Int_t pi=0;pi<6;pi++) // product or covariance index
5637 fIntFlowProductOfCorrelationsVsMPro[pi] = NULL;
5638 fIntFlowCovariancesVsM[pi] = NULL;
5639 fIntFlowSumOfProductOfEventWeightsVsM[pi] = NULL;
5641 for(Int_t ci=0;ci<64;ci++) // correlation index for all correlations vs M profiles (to be improved - hardwired 64)
5643 fIntFlowCorrelationsAllVsMPro[ci] = NULL;
5646 } // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForIntFlow()
5648 //================================================================================================================================
5650 void AliFlowAnalysisWithQCumulants::InitializeArraysForDiffFlow()
5652 // Initialize all arrays needed to calculate differential flow.
5653 // a) Initialize lists holding profiles;
5654 // b) Initialize lists holding histograms;
5655 // c) Initialize event-by-event quantities;
5656 // d) Initialize profiles;
5657 // e) Initialize histograms holding final results.
5659 // a) Initialize lists holding profiles;
5660 for(Int_t t=0;t<2;t++) // type (RP, POI)
5662 for(Int_t pe=0;pe<2;pe++) // pt or eta
5664 fDiffFlowCorrelationsProList[t][pe] = NULL;
5665 fDiffFlowProductOfCorrelationsProList[t][pe] = NULL;
5666 fDiffFlowCorrectionsProList[t][pe] = NULL;
5669 f2DDiffFlowCorrelationsProList[t] = NULL;
5672 // b) Initialize lists holding histograms;
5673 for(Int_t t=0;t<2;t++) // type (RP, POI)
5675 for(Int_t pe=0;pe<2;pe++) // pt or eta
5677 fDiffFlowCorrelationsHistList[t][pe] = NULL;
5678 for(Int_t power=0;power<2;power++)
5680 fDiffFlowSumOfEventWeightsHistList[t][pe][power] = NULL;
5681 } // end of for(Int_t power=0;power<2;power++)
5682 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe] = NULL;
5683 fDiffFlowCorrectionsHistList[t][pe] = NULL;
5684 fDiffFlowCovariancesHistList[t][pe] = NULL;
5685 fDiffFlowCumulantsHistList[t][pe] = NULL;
5686 fDiffFlowDetectorBiasHistList[t][pe] = NULL;
5687 fDiffFlowHistList[t][pe] = NULL;
5688 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
5689 } // enf of for(Int_t t=0;t<2;t++) // type (RP, POI)
5691 // c) Initialize event-by-event quantities:
5693 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
5695 for(Int_t pe=0;pe<2;pe++) // pt or eta
5697 for(Int_t m=0;m<4;m++) // multiple of harmonic
5699 for(Int_t k=0;k<9;k++) // power of weight
5701 fReRPQ1dEBE[t][pe][m][k] = NULL;
5702 fImRPQ1dEBE[t][pe][m][k] = NULL;
5703 fs1dEBE[t][pe][k] = NULL; // to be improved (this doesn't need to be within loop over m)
5709 for(Int_t t=0;t<2;t++) // type (RP or POI)
5711 for(Int_t pe=0;pe<2;pe++) // pt or eta
5713 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
5715 for(Int_t cti=0;cti<9;cti++) // correction term index
5717 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti] = NULL;
5723 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
5725 for(Int_t m=0;m<4;m++) // multiple of harmonic
5727 for(Int_t k=0;k<9;k++) // power of weight
5729 fReRPQ2dEBE[t][m][k] = NULL;
5730 fImRPQ2dEBE[t][m][k] = NULL;
5731 fs2dEBE[t][k] = NULL; // to be improved (this doesn't need to be within loop over m)
5736 // d) Initialize profiles:
5737 for(Int_t t=0;t<2;t++) // type: RP or POI
5739 for(Int_t pe=0;pe<2;pe++) // pt or eta
5741 for(Int_t ci=0;ci<4;ci++) // correlation index
5743 fDiffFlowCorrelationsPro[t][pe][ci] = NULL;
5744 fDiffFlowSquaredCorrelationsPro[t][pe][ci] = NULL;
5745 } // end of for(Int_t ci=0;ci<4;ci++)
5746 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
5748 for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index
5750 fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2] = NULL;
5751 } // end of for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index
5752 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
5753 // correction terms for nua:
5754 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
5756 for(Int_t cti=0;cti<9;cti++) // correction term index
5758 fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti] = NULL;
5761 // other differential correlators:
5762 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
5764 for(Int_t ci=0;ci<1;ci++) // correction term index
5766 fOtherDiffCorrelators[t][pe][sc][ci] = NULL;
5769 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
5770 for(Int_t ci=0;ci<4;ci++) // correlation index
5772 f2DDiffFlowCorrelationsPro[t][ci] = NULL;
5774 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
5776 // e) Initialize histograms holding final results.
5777 for(Int_t t=0;t<2;t++) // type: RP or POI
5779 for(Int_t pe=0;pe<2;pe++) // pt or eta
5781 for(Int_t ci=0;ci<4;ci++) // correlation index
5783 fDiffFlowCorrelationsHist[t][pe][ci] = NULL;
5784 fDiffFlowCumulants[t][pe][ci] = NULL;
5785 fDiffFlowDetectorBias[t][pe][ci] = NULL;
5786 fDiffFlow[t][pe][ci] = NULL;
5787 } // end of for(Int_t ci=0;ci<4;ci++)
5788 for(Int_t covarianceIndex=0;covarianceIndex<5;covarianceIndex++)
5790 fDiffFlowCovariances[t][pe][covarianceIndex] = NULL;
5791 } // end of for(Int_t covarianceIndex=0;covarianceIndex<5;covarianceIndex++)
5792 // correction terms for nua:
5793 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
5795 for(Int_t cti=0;cti<9;cti++) // correction term index
5797 fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti] = NULL;
5800 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
5801 for(Int_t ci=0;ci<4;ci++) // correlation index
5803 f2DDiffFlowCumulants[t][ci] = NULL;
5804 f2DDiffFlow[t][ci] = NULL;
5806 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
5808 // sum of event weights for reduced correlations:
5809 for(Int_t t=0;t<2;t++) // type = RP or POI
5811 for(Int_t pe=0;pe<2;pe++) // pt or eta
5813 for(Int_t p=0;p<2;p++) // power of weight is 1 or 2
5815 for(Int_t ew=0;ew<4;ew++) // event weight index for reduced correlations
5817 fDiffFlowSumOfEventWeights[t][pe][p][ew] = NULL;
5822 // product of event weights for both types of correlations:
5823 for(Int_t t=0;t<2;t++) // type = RP or POI
5825 for(Int_t pe=0;pe<2;pe++) // pt or eta
5827 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
5829 for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index
5831 fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2] = NULL;
5837 } // end of AliFlowAnalysisWithQCumulants::InitializeArraysForDiffFlow()
5839 //================================================================================================================================
5841 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulants(TString type, TString ptOrEta)
5843 // Calculate differential flow cumulants from measured multiparticle correlations.
5845 // REMARK: Cumulants calculated in this method are NOT corrected for non-uniform acceptance.
5846 // This correction, if enabled via setter SetApplyCorrectionForNUA(Bool_t), is applied
5847 // in the method CalculateDiffFlowCumulantsCorrectedForNUA(TString type, TString ptOrEta)
5855 } else if(type == "POI")
5863 } else if(ptOrEta == "Eta")
5869 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
5871 // Correlation <<2>>:
5872 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1);
5873 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1);
5875 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
5877 // Reduced correlations:
5878 Double_t twoPrime = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b); // <<2'>>
5879 Double_t twoPrimeError = fDiffFlowCorrelationsHist[t][pe][0]->GetBinError(b); // stat. error of <<2'>>
5880 Double_t fourPrime = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b); // <<4'>>
5881 Double_t fourPrimeError = fDiffFlowCorrelationsHist[t][pe][1]->GetBinError(b); // stat. error of <<4'>>
5883 Double_t wCovTwoTwoReduced = fDiffFlowCovariances[t][pe][0]->GetBinContent(b); // Cov(<2>,<2'>) * prefactor(<2>,<2'>)
5884 Double_t wCovTwoFourReduced = fDiffFlowCovariances[t][pe][1]->GetBinContent(b); // Cov(<2>,<4'>) * prefactor(<2>,<4'>)
5885 Double_t wCovTwoReducedFourReduced = fDiffFlowCovariances[t][pe][4]->GetBinContent(b); // Cov(<2'>,<4'>) * prefactor(<2'>,<4'>)
5887 Double_t qc2Prime = twoPrime; // QC{2'}
5888 Double_t qc2PrimeError = twoPrimeError; // stat. error of QC{2'}
5889 fDiffFlowCumulants[t][pe][0]->SetBinContent(b,qc2Prime);
5890 fDiffFlowCumulants[t][pe][0]->SetBinError(b,qc2PrimeError);
5892 Double_t qc4Prime = fourPrime - 2.*twoPrime*two; // QC{4'} = <<4'>> - 2*<<2'>><<2>>
5893 Double_t qc4PrimeError = 0.; // stat. error of QC{4'}
5894 Double_t qc4PrimeErrorSquared = 4.*pow(twoPrime,2.)*pow(twoError,2.)
5895 + 4.*pow(two,2.)*pow(twoPrimeError,2.)
5896 + pow(fourPrimeError,2.)
5897 + 8.*two*twoPrime*wCovTwoTwoReduced
5898 - 4.*twoPrime*wCovTwoFourReduced
5899 - 4.*two*wCovTwoReducedFourReduced;
5900 if(qc4PrimeErrorSquared>0.)
5902 qc4PrimeError = pow(qc4PrimeErrorSquared,0.5);
5904 fDiffFlowCumulants[t][pe][1]->SetBinContent(b,qc4Prime);
5905 fDiffFlowCumulants[t][pe][1]->SetBinError(b,qc4PrimeError);
5906 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5908 } // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulants(TString type, Bool_t useParticleWeights, TString eventWeights);
5910 //================================================================================================================================
5912 void AliFlowAnalysisWithQCumulants::Calculate2DDiffFlowCumulants(TString type)
5914 // Calculate 2D differential cumulants.
5916 // Remark: correction for detector effects and error propagation not implemented yet for 2D differential cumulants.
5923 } else if(type == "POI")
5928 // Reference correlation <<2>>:
5929 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1);
5931 // Looping over all (pt,eta) bins and calculating differential flow cumulants:
5932 for(Int_t p=1;p<=fnBinsPt;p++)
5934 for(Int_t e=1;e<=fnBinsEta;e++)
5936 // Reduced correlations:
5937 Double_t twoPrime = f2DDiffFlowCorrelationsPro[t][0]->GetBinContent(f2DDiffFlowCorrelationsPro[t][0]->GetBin(p,e)); // <<2'>>(pt,eta)
5938 Double_t fourPrime = f2DDiffFlowCorrelationsPro[t][1]->GetBinContent(f2DDiffFlowCorrelationsPro[t][1]->GetBin(p,e)); // <<4'>>(pt,eta)
5940 Double_t qc2Prime = twoPrime; // QC{2'} = <<2'>>
5941 f2DDiffFlowCumulants[t][0]->SetBinContent(f2DDiffFlowCumulants[t][0]->GetBin(p,e),qc2Prime);
5942 Double_t qc4Prime = fourPrime - 2.*twoPrime*two; // QC{4'} = <<4'>> - 2*<<2'>><<2>>
5943 f2DDiffFlowCumulants[t][1]->SetBinContent(f2DDiffFlowCumulants[t][1]->GetBin(p,e),qc4Prime);
5944 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
5945 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
5947 } // end of void AliFlowAnalysisWithQCumulants::Calculate2DDiffFlowCumulants(TString type)
5949 //================================================================================================================================
5951 void AliFlowAnalysisWithQCumulants::CalculateFinalResultsForRPandPOIIntegratedFlow(TString type)
5953 // Calculate final results for integrated flow of RPs and POIs.
5955 // to be improved - check if the integrated flow calculation here is actually correct
5957 Int_t t = 0; // RP = 0, POI = 1
5962 } else if(type == "POI")
5968 TH1F *yield2ndPt = NULL;
5969 TH1F *yield4thPt = NULL;
5970 TH1F *yield6thPt = NULL;
5971 TH1F *yield8thPt = NULL;
5975 if(fFillMultipleControlHistograms)
5977 yield2ndPt = (TH1F*)(fCommonHists2nd->GetHistPtPOI())->Clone();
5978 yield4thPt = (TH1F*)(fCommonHists4th->GetHistPtPOI())->Clone();
5979 yield6thPt = (TH1F*)(fCommonHists6th->GetHistPtPOI())->Clone();
5980 yield8thPt = (TH1F*)(fCommonHists8th->GetHistPtPOI())->Clone();
5983 yield2ndPt = (TH1F*)(fCommonHists->GetHistPtPOI())->Clone();
5984 yield4thPt = (TH1F*)(fCommonHists->GetHistPtPOI())->Clone();
5985 yield6thPt = (TH1F*)(fCommonHists->GetHistPtPOI())->Clone();
5986 yield8thPt = (TH1F*)(fCommonHists->GetHistPtPOI())->Clone();
5989 else if(type == "RP")
5991 if(fFillMultipleControlHistograms)
5993 yield2ndPt = (TH1F*)(fCommonHists2nd->GetHistPtRP())->Clone();
5994 yield4thPt = (TH1F*)(fCommonHists4th->GetHistPtRP())->Clone();
5995 yield6thPt = (TH1F*)(fCommonHists6th->GetHistPtRP())->Clone();
5996 yield8thPt = (TH1F*)(fCommonHists8th->GetHistPtRP())->Clone();
5999 yield2ndPt = (TH1F*)(fCommonHists->GetHistPtRP())->Clone();
6000 yield4thPt = (TH1F*)(fCommonHists->GetHistPtRP())->Clone();
6001 yield6thPt = (TH1F*)(fCommonHists->GetHistPtRP())->Clone();
6002 yield8thPt = (TH1F*)(fCommonHists->GetHistPtRP())->Clone();
6006 if(!yield2ndPt){return;}
6007 if(!yield4thPt){return;}
6008 if(!yield6thPt){return;}
6009 if(!yield8thPt){return;}
6011 Int_t nBinsPt = yield2ndPt->GetNbinsX();
6013 TH1D *flow2ndPt = NULL;
6014 TH1D *flow4thPt = NULL;
6015 TH1D *flow6thPt = NULL;
6016 TH1D *flow8thPt = NULL;
6018 // to be improved (hardwired pt index)
6019 flow2ndPt = (TH1D*)fDiffFlow[t][0][0]->Clone();
6020 flow4thPt = (TH1D*)fDiffFlow[t][0][1]->Clone();
6021 flow6thPt = (TH1D*)fDiffFlow[t][0][2]->Clone();
6022 flow8thPt = (TH1D*)fDiffFlow[t][0][3]->Clone();
6024 if(!flow2ndPt){return;}
6025 if(!flow4thPt){return;}
6026 if(!flow6thPt){return;}
6027 if(!flow8thPt){return;}
6029 Double_t dvn2nd = 0., dvn4th = 0., dvn6th = 0., dvn8th = 0.; // differential flow
6030 Double_t dErrvn2nd = 0., dErrvn4th = 0., dErrvn6th = 0., dErrvn8th = 0.; // error on differential flow
6032 Double_t dVn2nd = 0., dVn4th = 0., dVn6th = 0., dVn8th = 0.; // integrated flow
6033 Double_t dErrVn2nd = 0., dErrVn4th = 0., dErrVn6th = 0., dErrVn8th = 0.; // error on integrated flow
6035 Double_t dYield2nd = 0., dYield4th = 0., dYield6th = 0., dYield8th = 0.; // pt yield
6036 Double_t dSum2nd = 0., dSum4th = 0., dSum6th = 0., dSum8th = 0.; // needed for normalizing integrated flow
6038 // looping over pt bins:
6039 for(Int_t p=1;p<nBinsPt+1;p++)
6041 dvn2nd = flow2ndPt->GetBinContent(p);
6042 dvn4th = flow4thPt->GetBinContent(p);
6043 dvn6th = flow6thPt->GetBinContent(p);
6044 dvn8th = flow8thPt->GetBinContent(p);
6046 dErrvn2nd = flow2ndPt->GetBinError(p);
6047 dErrvn4th = flow4thPt->GetBinError(p);
6048 dErrvn6th = flow6thPt->GetBinError(p);
6049 dErrvn8th = flow8thPt->GetBinError(p);
6051 dYield2nd = yield2ndPt->GetBinContent(p);
6052 dYield4th = yield4thPt->GetBinContent(p);
6053 dYield6th = yield6thPt->GetBinContent(p);
6054 dYield8th = yield8thPt->GetBinContent(p);
6056 dVn2nd += dvn2nd*dYield2nd;
6057 dVn4th += dvn4th*dYield4th;
6058 dVn6th += dvn6th*dYield6th;
6059 dVn8th += dvn8th*dYield8th;
6061 dSum2nd += dYield2nd;
6062 dSum4th += dYield4th;
6063 dSum6th += dYield6th;
6064 dSum8th += dYield8th;
6066 dErrVn2nd += dYield2nd*dYield2nd*dErrvn2nd*dErrvn2nd; // ro be improved (check this relation)
6067 dErrVn4th += dYield4th*dYield4th*dErrvn4th*dErrvn4th;
6068 dErrVn6th += dYield6th*dYield6th*dErrvn6th*dErrvn6th;
6069 dErrVn8th += dYield8th*dYield8th*dErrvn8th*dErrvn8th;
6071 } // end of for(Int_t p=1;p<nBinsPt+1;p++)
6073 // normalizing the results for integrated flow:
6077 dErrVn2nd /= (dSum2nd*dSum2nd);
6078 dErrVn2nd = TMath::Sqrt(dErrVn2nd);
6083 dErrVn4th /= (dSum4th*dSum4th);
6084 dErrVn4th = TMath::Sqrt(dErrVn4th);
6086 //if(dSum6th) dVn6th/=dSum6th;
6087 //if(dSum8th) dVn8th/=dSum8th;
6089 // storing the results for integrated flow in common histos: (to be improved: new method for this?)
6092 fCommonHistsResults2nd->FillIntegratedFlowPOI(dVn2nd,dErrVn2nd);
6093 fCommonHistsResults4th->FillIntegratedFlowPOI(dVn4th,dErrVn4th);
6094 fCommonHistsResults6th->FillIntegratedFlowPOI(dVn6th,0.); // to be improved (errors)
6095 fCommonHistsResults8th->FillIntegratedFlowPOI(dVn8th,0.); // to be improved (errors)
6097 else if (type == "RP")
6099 fCommonHistsResults2nd->FillIntegratedFlowRP(dVn2nd,dErrVn2nd);
6100 fCommonHistsResults4th->FillIntegratedFlowRP(dVn4th,dErrVn4th);
6101 fCommonHistsResults6th->FillIntegratedFlowRP(dVn6th,0.); // to be improved (errors)
6102 fCommonHistsResults8th->FillIntegratedFlowRP(dVn8th,0.); // to be improved (errors)
6115 } // end of AliFlowAnalysisWithQCumulants::CalculateFinalResultsForRPandPOIIntegratedFlow(TString type)
6117 //================================================================================================================================
6119 void AliFlowAnalysisWithQCumulants::InitializeArraysForDistributions()
6121 // Initialize all arrays used for distributions.
6123 // a) Initialize arrays of histograms used to hold distributions of correlations;
6124 // b) Initialize array to hold min and max values of correlations.
6126 // a) Initialize arrays of histograms used to hold distributions of correlations:
6127 for(Int_t di=0;di<4;di++) // distribution index
6129 fDistributions[di] = NULL;
6132 // b) Initialize default min and max values of correlations:
6133 // (Remark: The default values bellow were chosen for v2=5% and M=500)
6134 fMinValueOfCorrelation[0] = -0.01; // <2>_min
6135 fMaxValueOfCorrelation[0] = 0.04; // <2>_max
6136 fMinValueOfCorrelation[1] = -0.00002; // <4>_min
6137 fMaxValueOfCorrelation[1] = 0.00015; // <4>_max
6138 fMinValueOfCorrelation[2] = -0.0000003; // <6>_min
6139 fMaxValueOfCorrelation[2] = 0.0000006; // <6>_max
6140 fMinValueOfCorrelation[3] = -0.000000006; // <8>_min
6141 fMaxValueOfCorrelation[3] = 0.000000003; // <8>_max
6143 } // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForDistributions()
6145 //================================================================================================================================
6147 void AliFlowAnalysisWithQCumulants::InitializeArraysForVarious()
6149 // Initialize all arrays used for various unclassified objects.
6151 for(Int_t p=0;p<4;p++) // [v_min,v_max,refMult_min,refMult_max]
6153 fPhiDistributionForOneEventSettings[p] = 0.;
6156 } // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForVarious()
6158 //================================================================================================================================
6160 void AliFlowAnalysisWithQCumulants::BookEverythingForDistributions()
6162 // a) Book profile to hold all flags for distributions of correlations;
6163 // b) Book all histograms to hold distributions of correlations.
6165 TString correlationIndex[4] = {"<2>","<4>","<6>","<8>"}; // to be improved (should I promote this to data members?)
6167 // a) Book profile to hold all flags for distributions of correlations:
6168 TString distributionsFlagsName = "fDistributionsFlags";
6169 distributionsFlagsName += fAnalysisLabel->Data();
6170 fDistributionsFlags = new TProfile(distributionsFlagsName.Data(),"Flags for Distributions of Correlations",9,0,9);
6171 fDistributionsFlags->SetTickLength(-0.01,"Y");
6172 fDistributionsFlags->SetMarkerStyle(25);
6173 fDistributionsFlags->SetLabelSize(0.05);
6174 fDistributionsFlags->SetLabelOffset(0.02,"Y");
6175 fDistributionsFlags->GetXaxis()->SetBinLabel(1,"Store or not?");
6176 fDistributionsFlags->GetXaxis()->SetBinLabel(2,"<2>_{min}");
6177 fDistributionsFlags->GetXaxis()->SetBinLabel(3,"<2>_{max}");
6178 fDistributionsFlags->GetXaxis()->SetBinLabel(4,"<4>_{min}");
6179 fDistributionsFlags->GetXaxis()->SetBinLabel(5,"<4>_{max}");
6180 fDistributionsFlags->GetXaxis()->SetBinLabel(6,"<6>_{min}");
6181 fDistributionsFlags->GetXaxis()->SetBinLabel(7,"<6>_{max}");
6182 fDistributionsFlags->GetXaxis()->SetBinLabel(8,"<8>_{min}");
6183 fDistributionsFlags->GetXaxis()->SetBinLabel(9,"<8>_{max}");
6184 fDistributionsList->Add(fDistributionsFlags);
6186 // b) Book all histograms to hold distributions of correlations.
6187 if(fStoreDistributions)
6189 TString distributionsName = "fDistributions";
6190 distributionsName += fAnalysisLabel->Data();
6191 for(Int_t di=0;di<4;di++) // distribution index
6193 fDistributions[di] = new TH1D(Form("Distribution of %s",correlationIndex[di].Data()),Form("Distribution of %s",correlationIndex[di].Data()),10000,fMinValueOfCorrelation[di],fMaxValueOfCorrelation[di]);
6194 fDistributions[di]->SetXTitle(correlationIndex[di].Data());
6195 fDistributionsList->Add(fDistributions[di]);
6196 } // end of for(Int_t di=0;di<4;di++) // distribution index
6197 } // end of if(fStoreDistributions)
6199 } // end of void AliFlowAnalysisWithQCumulants::BookEverythingForDistributions()
6201 //================================================================================================================================
6203 void AliFlowAnalysisWithQCumulants::BookEverythingForVarious()
6205 // Book all objects for various unclassified quantities.
6207 if(!fStorePhiDistributionForOneEvent){return;}
6209 // a) Book histogram holding phi distribution for single event to illustrate flow.
6211 // a) Book histogram holding phi distribution for single event to illustrate flow:
6212 fPhiDistributionForOneEvent = new TH1D("fPhiDistributionForOneEvent","",360,0.,TMath::TwoPi());
6213 fPhiDistributionForOneEvent->GetXaxis()->SetTitle("#phi");
6214 fVariousList->Add(fPhiDistributionForOneEvent);
6216 } // end of void AliFlowAnalysisWithQCumulants::BookEverythingForVarious()
6218 //================================================================================================================================
6220 void AliFlowAnalysisWithQCumulants::StoreFlagsForDistributions()
6222 // Store all flags for distributiuons of correlations in profile fDistributionsFlags.
6224 if(!fDistributionsFlags)
6226 cout<<"WARNING: fDistributionsFlags is NULL in AFAWQC::SDF() !!!!"<<endl;
6230 fDistributionsFlags->Fill(0.5,(Int_t)fStoreDistributions); // histos with distributions of correlations stored or not in the output file
6231 // store min and max values of correlations:
6232 for(Int_t di=0;di<4;di++) // distribution index
6234 fDistributionsFlags->Fill(1.5+2.*(Double_t)di,fMinValueOfCorrelation[di]);
6235 fDistributionsFlags->Fill(2.5+2.*(Double_t)di,fMaxValueOfCorrelation[di]);
6238 } // end of void AliFlowAnalysisWithQCumulants::StoreFlagsForDistributions()
6240 //================================================================================================================================
6242 void AliFlowAnalysisWithQCumulants::StoreDistributionsOfCorrelations()
6244 // Store distributions of correlations.
6246 if(!(fIntFlowCorrelationsEBE && fIntFlowEventWeightsForCorrelationsEBE))
6248 cout<<"WARNING: fIntFlowCorrelationsEBE && fIntFlowEventWeightsForCorrelationsEBE"<<endl;
6249 cout<<" is NULL in AFAWQC::SDOC() !!!!"<<endl;
6253 for(Int_t di=0;di<4;di++) // distribution index
6255 if(!fDistributions[di])
6257 cout<<"WARNING: fDistributions[di] is NULL in AFAWQC::SDOC() !!!!"<<endl;
6258 cout<<"di = "<<di<<endl;
6262 fDistributions[di]->Fill(fIntFlowCorrelationsEBE->GetBinContent(di+1),fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(di+1));
6264 } // end of for(Int_t di=0;di<4;di++) // distribution index
6266 } // end of void AliFlowAnalysisWithQCumulants::StoreDistributionsOfCorrelations()
6268 //================================================================================================================================
6270 void AliFlowAnalysisWithQCumulants::BookAndNestAllLists()
6272 // Book and nest all lists nested in the base list fHistList.
6273 // a) Book and nest lists for integrated flow;
6274 // b) Book and nest lists for differential flow;
6275 // c) Book and nest list for particle weights;
6276 // d) Book and nest list for distributions;
6277 // e) Book and nest list for various unclassified objects;
6278 // f) Book and nest list for nested loops.
6280 // a) Book and nest all lists for integrated flow:
6281 // Base list for integrated flow:
6282 fIntFlowList = new TList();
6283 fIntFlowList->SetName("Integrated Flow");
6284 fIntFlowList->SetOwner(kTRUE);
6285 fHistList->Add(fIntFlowList);
6286 // List holding profiles:
6287 fIntFlowProfiles = new TList();
6288 fIntFlowProfiles->SetName("Profiles");
6289 fIntFlowProfiles->SetOwner(kTRUE);
6290 fIntFlowList->Add(fIntFlowProfiles);
6291 // List holding all profiles with results for correlations vs M:
6292 if(fCalculateAllCorrelationsVsM)
6294 fIntFlowAllCorrelationsVsM = new TList();
6295 fIntFlowAllCorrelationsVsM->SetName("Correlations vs M");
6296 fIntFlowAllCorrelationsVsM->SetOwner(kTRUE);
6297 fIntFlowProfiles->Add(fIntFlowAllCorrelationsVsM);
6298 } // end of if(fCalculateAllCorrelationsVsM)
6299 // List holding histograms with results:
6300 fIntFlowResults = new TList();
6301 fIntFlowResults->SetName("Results");
6302 fIntFlowResults->SetOwner(kTRUE);
6303 fIntFlowList->Add(fIntFlowResults);
6305 // b) Book and nest lists for differential flow:
6306 this->BookAndNestListsForDifferentialFlow();
6308 // c) Book and nest list for particle weights:
6309 fWeightsList->SetName("Weights");
6310 fWeightsList->SetOwner(kTRUE);
6311 fHistList->Add(fWeightsList);
6313 // d) Book and nest list for distributions:
6314 fDistributionsList = new TList();
6315 fDistributionsList->SetName("Distributions");
6316 fDistributionsList->SetOwner(kTRUE);
6317 fHistList->Add(fDistributionsList);
6319 // e) Book and nest list for various unclassified objects:
6320 if(fStorePhiDistributionForOneEvent)
6322 fVariousList = new TList();
6323 fVariousList->SetName("Various");
6324 fVariousList->SetOwner(kTRUE);
6325 fHistList->Add(fVariousList);
6328 // f) Book and nest list for other differential correlators:
6329 fOtherDiffCorrelatorsList = new TList();
6330 fOtherDiffCorrelatorsList->SetName("Other differential correlators");
6331 fOtherDiffCorrelatorsList->SetOwner(kTRUE);
6332 if(fCalculateDiffFlow){fHistList->Add(fOtherDiffCorrelatorsList);} // TBI: Use another flag here instead of fCalculateDiffFlow
6334 // g) Book and nest list for nested loops:
6335 fNestedLoopsList = new TList();
6336 fNestedLoopsList->SetName("Nested Loops");
6337 fNestedLoopsList->SetOwner(kTRUE);
6338 fHistList->Add(fNestedLoopsList);
6340 } // end of void AliFlowAnalysisWithQCumulants::BookAndNestAllLists()
6342 //================================================================================================================================
6344 void AliFlowAnalysisWithQCumulants::BookAndNestListsForDifferentialFlow()
6346 // Book and nest lists for differential flow.
6348 // Base list for differential flow objects:
6349 fDiffFlowList = new TList();
6350 fDiffFlowList->SetName("Differential Flow");
6351 fDiffFlowList->SetOwner(kTRUE);
6352 fHistList->Add(fDiffFlowList);
6355 TString typeFlag[2] = {"RP","POI"};
6356 TString ptEtaFlag[2] = {"p_{T}","#eta"};
6357 TString powerFlag[2] = {"linear","quadratic"};
6360 if(fCalculate2DDiffFlow)
6362 fDiffFlow2D = new TList();
6363 fDiffFlow2D->SetName("2D");
6364 fDiffFlow2D->SetOwner(kTRUE);
6365 fDiffFlowList->Add(fDiffFlow2D);
6366 for(Int_t t=0;t<2;t++)
6368 f2DDiffFlowCorrelationsProList[t] = new TList();
6369 f2DDiffFlowCorrelationsProList[t]->SetOwner(kTRUE);
6370 f2DDiffFlowCorrelationsProList[t]->SetName(Form("Profiles with 2D correlations (%s)",typeFlag[t].Data()));
6371 fDiffFlow2D->Add(f2DDiffFlowCorrelationsProList[t]);
6372 } // end of for(Int_t t=0;t<2;t++)
6373 } // end of if(fCalculate2DDiffFlow)
6375 // What follows bellow in this method is relevant only for 1D differential flow:
6376 if(!fCalculateDiffFlow){return;}
6378 // List holding profiles:
6379 fDiffFlowProfiles = new TList();
6380 fDiffFlowProfiles->SetName("Profiles");
6381 fDiffFlowProfiles->SetOwner(kTRUE);
6382 fDiffFlowList->Add(fDiffFlowProfiles);
6383 // List holding histograms with results:
6384 fDiffFlowResults = new TList();
6385 fDiffFlowResults->SetName("Results");
6386 fDiffFlowResults->SetOwner(kTRUE);
6387 fDiffFlowList->Add(fDiffFlowResults);
6388 // Flags used for naming nested lists in list fDiffFlowProfiles and fDiffFlowResults:
6390 list.SetOwner(kTRUE);
6391 // Nested lists in fDiffFlowProfiles (~/Differential Flow/Profiles):
6392 for(Int_t t=0;t<2;t++) // type: RP or POI
6394 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
6396 // list holding profiles with correlations:
6397 fDiffFlowCorrelationsProList[t][pe] = (TList*)list.Clone();
6398 fDiffFlowCorrelationsProList[t][pe]->SetName(Form("Profiles with correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6399 fDiffFlowProfiles->Add(fDiffFlowCorrelationsProList[t][pe]);
6400 // list holding profiles with products of correlations:
6401 fDiffFlowProductOfCorrelationsProList[t][pe] = (TList*)list.Clone();
6402 fDiffFlowProductOfCorrelationsProList[t][pe]->SetName(Form("Profiles with products of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6403 fDiffFlowProfiles->Add(fDiffFlowProductOfCorrelationsProList[t][pe]);
6404 // list holding profiles with corrections:
6405 fDiffFlowCorrectionsProList[t][pe] = (TList*)list.Clone();
6406 fDiffFlowCorrectionsProList[t][pe]->SetName(Form("Profiles with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6407 fDiffFlowProfiles->Add(fDiffFlowCorrectionsProList[t][pe]);
6408 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
6409 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
6410 // nested lists in fDiffFlowResults (~/Differential Flow/Results):
6411 for(Int_t t=0;t<2;t++) // type: RP or POI
6413 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
6415 // list holding histograms with correlations:
6416 fDiffFlowCorrelationsHistList[t][pe] = (TList*)list.Clone();
6417 fDiffFlowCorrelationsHistList[t][pe]->SetName(Form("Correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6418 fDiffFlowResults->Add(fDiffFlowCorrelationsHistList[t][pe]);
6419 // list holding histograms with corrections:
6420 fDiffFlowCorrectionsHistList[t][pe] = (TList*)list.Clone();
6421 fDiffFlowCorrectionsHistList[t][pe]->SetName(Form("Histograms with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6422 fDiffFlowResults->Add(fDiffFlowCorrectionsHistList[t][pe]);
6423 for(Int_t power=0;power<2;power++)
6425 // list holding histograms with sums of event weights:
6426 fDiffFlowSumOfEventWeightsHistList[t][pe][power] = (TList*)list.Clone();
6427 fDiffFlowSumOfEventWeightsHistList[t][pe][power]->SetName(Form("Sum of %s event weights (%s, %s)",powerFlag[power].Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6428 fDiffFlowResults->Add(fDiffFlowSumOfEventWeightsHistList[t][pe][power]);
6429 } // end of for(Int_t power=0;power<2;power++)
6430 // list holding histograms with sums of products of event weights:
6431 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe] = (TList*)list.Clone();
6432 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]->SetName(Form("Sum of products of event weights (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6433 fDiffFlowResults->Add(fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]);
6434 // list holding histograms with covariances of correlations:
6435 fDiffFlowCovariancesHistList[t][pe] = (TList*)list.Clone();
6436 fDiffFlowCovariancesHistList[t][pe]->SetName(Form("Covariances of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6437 fDiffFlowResults->Add(fDiffFlowCovariancesHistList[t][pe]);
6438 // list holding histograms with differential Q-cumulants:
6439 fDiffFlowCumulantsHistList[t][pe] = (TList*)list.Clone();
6440 fDiffFlowCumulantsHistList[t][pe]->SetName(Form("Differential Q-cumulants (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6441 fDiffFlowResults->Add(fDiffFlowCumulantsHistList[t][pe]);
6442 // list holding histograms which quantify detector bias to differential Q-cumulants:
6443 fDiffFlowDetectorBiasHistList[t][pe] = (TList*)list.Clone();
6444 fDiffFlowDetectorBiasHistList[t][pe]->SetName(Form("Detector bias (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6445 fDiffFlowResults->Add(fDiffFlowDetectorBiasHistList[t][pe]);
6446 // list holding histograms with differential flow estimates from Q-cumulants:
6447 fDiffFlowHistList[t][pe] = (TList*)list.Clone();
6448 fDiffFlowHistList[t][pe]->SetName(Form("Differential flow (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));
6449 fDiffFlowResults->Add(fDiffFlowHistList[t][pe]);
6450 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
6451 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
6453 } // end of void AliFlowAnalysisWithQCumulants::BookAndNestListsForDifferentialFlow()
6455 //================================================================================================================================
6457 void AliFlowAnalysisWithQCumulants::FillCommonHistResultsDiffFlow(TString type)
6459 // Fill common result histograms for differential flow.
6466 } else if(type == "POI")
6471 // to be improved - check all pointers used in this method
6473 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
6475 cout<<"WARNING: fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th"<<endl;
6476 cout<<" is NULL in AFAWQC::FCHRIF() !!!!"<<endl;
6481 for(Int_t p=1;p<=fnBinsPt;p++)
6483 Double_t v2 = fDiffFlow[t][0][0]->GetBinContent(p);
6484 Double_t v4 = fDiffFlow[t][0][1]->GetBinContent(p);
6485 Double_t v6 = fDiffFlow[t][0][2]->GetBinContent(p);
6486 Double_t v8 = fDiffFlow[t][0][3]->GetBinContent(p);
6488 Double_t v2Error = fDiffFlow[t][0][0]->GetBinError(p);
6489 Double_t v4Error = fDiffFlow[t][0][1]->GetBinError(p);
6490 //Double_t v6Error = fFinalFlow1D[t][pW][nua][0][2]->GetBinError(p);
6491 //Double_t v8Error = fFinalFlow1D[t][pW][nua][0][3]->GetBinError(p);
6495 fCommonHistsResults2nd->FillDifferentialFlowPtRP(p,v2,v2Error);
6496 fCommonHistsResults4th->FillDifferentialFlowPtRP(p,v4,v4Error);
6497 fCommonHistsResults6th->FillDifferentialFlowPtRP(p,v6,0.);
6498 fCommonHistsResults8th->FillDifferentialFlowPtRP(p,v8,0.);
6499 } else if(type == "POI")
6501 fCommonHistsResults2nd->FillDifferentialFlowPtPOI(p,v2,v2Error);
6502 fCommonHistsResults4th->FillDifferentialFlowPtPOI(p,v4,v4Error);
6503 fCommonHistsResults6th->FillDifferentialFlowPtPOI(p,v6,0.);
6504 fCommonHistsResults8th->FillDifferentialFlowPtPOI(p,v8,0.);
6506 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
6509 if(!fCalculateDiffFlowVsEta){return;}
6510 for(Int_t e=1;e<=fnBinsEta;e++)
6512 Double_t v2 = fDiffFlow[t][1][0]->GetBinContent(e);
6513 Double_t v4 = fDiffFlow[t][1][1]->GetBinContent(e);
6514 Double_t v6 = fDiffFlow[t][1][2]->GetBinContent(e);
6515 Double_t v8 = fDiffFlow[t][1][3]->GetBinContent(e);
6517 Double_t v2Error = fDiffFlow[t][1][0]->GetBinError(e);
6518 Double_t v4Error = fDiffFlow[t][1][1]->GetBinError(e);
6519 //Double_t v6Error = fDiffFlow[t][1][2]->GetBinError(e);
6520 //Double_t v8Error = fDiffFlow[t][1][3]->GetBinError(e);
6524 fCommonHistsResults2nd->FillDifferentialFlowEtaRP(e,v2,v2Error);
6525 fCommonHistsResults4th->FillDifferentialFlowEtaRP(e,v4,v4Error);
6526 fCommonHistsResults6th->FillDifferentialFlowEtaRP(e,v6,0.);
6527 fCommonHistsResults8th->FillDifferentialFlowEtaRP(e,v8,0.);
6528 } else if(type == "POI")
6530 fCommonHistsResults2nd->FillDifferentialFlowEtaPOI(e,v2,v2Error);
6531 fCommonHistsResults4th->FillDifferentialFlowEtaPOI(e,v4,v4Error);
6532 fCommonHistsResults6th->FillDifferentialFlowEtaPOI(e,v6,0.);
6533 fCommonHistsResults8th->FillDifferentialFlowEtaPOI(e,v8,0.);
6535 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
6537 } // end of void AliFlowAnalysisWithQCumulants::FillCommonHistResultsDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights, Bool_t correctedForNUA)
6539 //================================================================================================================================
6541 void AliFlowAnalysisWithQCumulants::CommonConstants(TString method)
6543 // Access and store common constants.
6545 // a) If this method was called in Init() access common constants from AliFlowCommonConstants;
6546 // b) If this method was called in Init() book and fill TProfile to hold constants accessed in a);
6547 // c) If this method was called in Finish() access common constants from TProfile booked and filled in b).
6549 if(method == "Init")
6551 // a) If this method was called in Init() access common constants from AliFlowCommonConstants:
6552 fnBinsPhi = AliFlowCommonConstants::GetMaster()->GetNbinsPhi();
6553 fPhiMin = AliFlowCommonConstants::GetMaster()->GetPhiMin();
6554 fPhiMax = AliFlowCommonConstants::GetMaster()->GetPhiMax();
6555 if(fnBinsPhi){fPhiBinWidth = (fPhiMax-fPhiMin)/fnBinsPhi;}
6556 fnBinsPt = AliFlowCommonConstants::GetMaster()->GetNbinsPt();
6557 fPtMin = AliFlowCommonConstants::GetMaster()->GetPtMin();
6558 fPtMax = AliFlowCommonConstants::GetMaster()->GetPtMax();
6559 if(fnBinsPt){fPtBinWidth = (fPtMax-fPtMin)/fnBinsPt;}
6560 fnBinsEta = AliFlowCommonConstants::GetMaster()->GetNbinsEta();
6561 fEtaMin = AliFlowCommonConstants::GetMaster()->GetEtaMin();
6562 fEtaMax = AliFlowCommonConstants::GetMaster()->GetEtaMax();
6563 if(fnBinsEta){fEtaBinWidth = (fEtaMax-fEtaMin)/fnBinsEta;}
6565 // b) If this method was called in Init() book and fill TProfile to hold constants accessed in a):
6566 TString fCommonConstantsName = "fCommonConstants";
6567 fCommonConstantsName += fAnalysisLabel->Data();
6568 fCommonConstants = new TProfile(fCommonConstantsName.Data(),"Common constants",9,0.,9.);
6569 fCommonConstants->SetLabelSize(0.05);
6570 fCommonConstants->GetXaxis()->SetBinLabel(1,"nBins (#phi)");
6571 fCommonConstants->Fill(0.5,fnBinsPhi);
6572 fCommonConstants->GetXaxis()->SetBinLabel(2,"#phi_{min}");
6573 fCommonConstants->Fill(1.5,fPhiMin);
6574 fCommonConstants->GetXaxis()->SetBinLabel(3,"#phi_{max}");
6575 fCommonConstants->Fill(2.5,fPhiMax);
6576 fCommonConstants->GetXaxis()->SetBinLabel(4,"nBins (p_{t})");
6577 fCommonConstants->Fill(3.5,fnBinsPt);
6578 fCommonConstants->GetXaxis()->SetBinLabel(5,"(p_{t})_{min}");
6579 fCommonConstants->Fill(4.5,fPtMin);
6580 fCommonConstants->GetXaxis()->SetBinLabel(6,"(p_{t})_{max}");
6581 fCommonConstants->Fill(5.5,fPtMax);
6582 fCommonConstants->GetXaxis()->SetBinLabel(7,"nBins (#eta)");
6583 fCommonConstants->Fill(6.5,fnBinsEta);
6584 fCommonConstants->GetXaxis()->SetBinLabel(8,"#eta_{min}");
6585 fCommonConstants->Fill(7.5,fEtaMin);
6586 fCommonConstants->GetXaxis()->SetBinLabel(9,"#eta_{max}");
6587 fCommonConstants->Fill(8.5,fEtaMax);
6588 fHistList->Add(fCommonConstants);
6589 } // end of if(method == "Init")
6590 else if(method == "Finish")
6592 // c) If this method was called in Finish() access common constants from TProfile booked and filled in b):
6593 if(!fCommonConstants)
6595 printf("\n WARNING (QC): fCommonConstants is NULL in AFAWQC::AC(\"%s\") !!!!\n\n",method.Data());
6598 fnBinsPhi = (Int_t)fCommonConstants->GetBinContent(1);
6599 fPhiMin = fCommonConstants->GetBinContent(2);
6600 fPhiMax = fCommonConstants->GetBinContent(3);
6601 if(fnBinsPhi){fPhiBinWidth = (fPhiMax-fPhiMin)/fnBinsPhi;}
6602 fnBinsPt = (Int_t)fCommonConstants->GetBinContent(4);
6603 fPtMin = fCommonConstants->GetBinContent(5);
6604 fPtMax = fCommonConstants->GetBinContent(6);
6605 if(fnBinsPt){fPtBinWidth = (fPtMax-fPtMin)/fnBinsPt;}
6606 fnBinsEta = (Int_t)fCommonConstants->GetBinContent(7);
6607 fEtaMin = fCommonConstants->GetBinContent(8);
6608 fEtaMax = fCommonConstants->GetBinContent(9);
6609 if(fnBinsEta){fEtaBinWidth = (fEtaMax-fEtaMin)/fnBinsEta;}
6610 } // end of else if(method == "Finish")
6612 } // end of void AliFlowAnalysisWithQCumulants::CommonConstants(TString method)
6614 //================================================================================================================================
6616 void AliFlowAnalysisWithQCumulants::CrossCheckSettings()
6618 // a) Cross check if the choice for multiplicity weights make sense.
6620 // a) Cross check if the choice for multiplicity weights make sense:
6621 if(strcmp(fMultiplicityWeight->Data(),"combinations") &&
6622 strcmp(fMultiplicityWeight->Data(),"unit") &&
6623 strcmp(fMultiplicityWeight->Data(),"multiplicity"))
6625 cout<<"WARNING (QC): Multiplicity weight can be either \"combinations\", \"unit\""<<endl;
6626 cout<<" or \"multiplicity\". Certainly not \""<<fMultiplicityWeight->Data()<<"\"."<<endl;
6630 } // end of void AliFlowAnalysisWithQCumulants::CrossCheckSettings()
6632 //================================================================================================================================
6634 void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeights()
6636 // Calculate sum of linear and quadratic event weights for correlations.
6639 Double_t dMult = (*fSpk)(0,0);
6641 for(Int_t p=0;p<2;p++) // power-1
6643 for(Int_t ci=0;ci<4;ci++) // correlation index
6645 fIntFlowSumOfEventWeights[p]->Fill(ci+0.5,pow(fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci+1),p+1));
6646 if(fCalculateCumulantsVsM)
6648 fIntFlowSumOfEventWeightsVsM[ci][p]->Fill(dMult+0.5,pow(fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci+1),p+1)); // to be improved: dMult => sum of weights?
6653 } // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeights()
6655 //================================================================================================================================
6657 void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeightsNUA()
6659 // Calculate sum of linear and quadratic event weights for NUA terms.
6661 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
6663 for(Int_t p=0;p<2;p++) // power-1
6665 for(Int_t ci=0;ci<4;ci++) // nua term index
6667 fIntFlowSumOfEventWeightsNUA[sc][p]->Fill(ci+0.5,pow(fIntFlowEventWeightForCorrectionTermsForNUAEBE[sc]->GetBinContent(ci+1),p+1));
6672 } // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeightsNUA()
6674 //================================================================================================================================
6676 void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfProductOfEventWeights()
6678 // Calculate sum of product of event weights for correlations.
6681 Double_t dMult = (*fSpk)(0,0);
6685 for(Int_t ci1=1;ci1<4;ci1++)
6687 for(Int_t ci2=ci1+1;ci2<=4;ci2++)
6689 fIntFlowSumOfProductOfEventWeights->Fill(0.5+counter,
6690 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
6691 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
6692 if(fCalculateCumulantsVsM)
6694 fIntFlowSumOfProductOfEventWeightsVsM[counter]->Fill(dMult+0.5, // to be improved: dMult => sum of weights?
6695 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*
6696 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));
6697 } // end of if(fCalculateCumulantsVsM)
6702 } // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfProductOfEventWeights()
6704 //================================================================================================================================
6706 void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfProductOfEventWeightsNUA()
6708 // Calculate sum of product of event weights for NUA terms.
6710 // w_{<2>} * w_{<cos(#phi)>}:
6711 fIntFlowSumOfProductOfEventWeightsNUA->Fill(0.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6712 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
6713 // w_{<2>} * w_{<sin(#phi)>}:
6714 fIntFlowSumOfProductOfEventWeightsNUA->Fill(1.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6715 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
6716 // w_{<cos(#phi)> * w_{<sin(#phi)>}:
6717 fIntFlowSumOfProductOfEventWeightsNUA->Fill(2.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6718 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
6719 // w_{<2>} * w{<cos(phi1+phi2)>}
6720 fIntFlowSumOfProductOfEventWeightsNUA->Fill(3.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6721 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
6722 // w_{<2>} * w{<sin(phi1+phi2)>}
6723 fIntFlowSumOfProductOfEventWeightsNUA->Fill(4.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6724 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6725 // w_{<2>} * w{<cos(phi1-phi2-phi3)>}
6726 fIntFlowSumOfProductOfEventWeightsNUA->Fill(5.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6727 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6728 // w_{<2>} * w{<sin(phi1-phi2-phi3)>}
6729 fIntFlowSumOfProductOfEventWeightsNUA->Fill(6.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1)*
6730 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6731 // w_{<4>} * w{<cos(phi1)>}
6732 fIntFlowSumOfProductOfEventWeightsNUA->Fill(7.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6733 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1));
6734 // w_{<4>} * w{<sin(phi1)>}
6735 fIntFlowSumOfProductOfEventWeightsNUA->Fill(8.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6736 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1));
6737 // w_{<4>} * w{<cos(phi1+phi2)>}
6738 fIntFlowSumOfProductOfEventWeightsNUA->Fill(9.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6739 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
6740 // w_{<4>} * w{<sin(phi1+phi2)>}
6741 fIntFlowSumOfProductOfEventWeightsNUA->Fill(10.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6742 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6743 // w_{<4>} * w{<cos(phi1-phi2-phi3)>}
6744 fIntFlowSumOfProductOfEventWeightsNUA->Fill(11.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6745 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6746 // w_{<4>} * w{<sin(phi1-phi2-phi3)>}
6747 fIntFlowSumOfProductOfEventWeightsNUA->Fill(12.5,fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2)*
6748 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6749 // w_{<cos(phi1)>} * w{<cos(phi1+phi2)>}
6750 fIntFlowSumOfProductOfEventWeightsNUA->Fill(13.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6751 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
6752 // w_{<cos(phi1)>} * w{<sin(phi1+phi2)>}
6753 fIntFlowSumOfProductOfEventWeightsNUA->Fill(14.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6754 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6755 // w_{<cos(phi1)>} * w{<cos(phi1-phi2-phi3)>}
6756 fIntFlowSumOfProductOfEventWeightsNUA->Fill(15.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6757 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6758 // w_{<cos(phi1)>} * w{<sin(phi1-phi2-phi3)>}
6759 fIntFlowSumOfProductOfEventWeightsNUA->Fill(16.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(1)*
6760 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6761 // w_{<sin(phi1)>} * w{<cos(phi1+phi2)>}
6762 fIntFlowSumOfProductOfEventWeightsNUA->Fill(17.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
6763 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2));
6764 // w_{<sin(phi1)>} * w{<sin(phi1+phi2)>}
6765 fIntFlowSumOfProductOfEventWeightsNUA->Fill(18.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
6766 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6767 // w_{<sin(phi1)>} * w{<cos(phi1-phi2-phi3)>}
6768 fIntFlowSumOfProductOfEventWeightsNUA->Fill(19.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
6769 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6770 // w_{<sin(phi1)>} * w{<sin(phi1-phi2-phi3)>}
6771 fIntFlowSumOfProductOfEventWeightsNUA->Fill(20.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(1)*
6772 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6773 // w_{<cos(phi1+phi2)>} * w{<sin(phi1+phi2))>}
6774 fIntFlowSumOfProductOfEventWeightsNUA->Fill(21.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)*
6775 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2));
6776 // w_{<cos(phi1+phi2)>} * w{<cos(phi1-phi2-phi3)>}
6777 fIntFlowSumOfProductOfEventWeightsNUA->Fill(22.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)*
6778 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6779 // w_{<cos(phi1+phi2)>} * w{<sin(phi1-phi2-phi3)>}
6780 fIntFlowSumOfProductOfEventWeightsNUA->Fill(23.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(2)*
6781 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6782 // w_{<sin(phi1+phi2)>} * w{<cos(phi1-phi2-phi3)>}
6783 fIntFlowSumOfProductOfEventWeightsNUA->Fill(24.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)*
6784 fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3));
6785 // w_{<sin(phi1+phi2)>} * w{<sin(phi1-phi2-phi3)>}
6786 fIntFlowSumOfProductOfEventWeightsNUA->Fill(25.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(2)*
6787 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6788 // w_{<cos(phi1-phi2-phi3)>} * w{<sin(phi1-phi2-phi3)>}
6789 fIntFlowSumOfProductOfEventWeightsNUA->Fill(26.5,fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->GetBinContent(3)*
6790 fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->GetBinContent(3));
6792 } // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowIntFlowSumOfProductOfEventWeightsNUA()
6794 //================================================================================================================================
6796 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelations(TString type, TString ptOrEta)
6798 // Calculate reduced correlations for RPs or POIs for all pt and eta bins.
6801 Double_t dMult = (*fSpk)(0,0);
6803 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
6804 Double_t dReQ1n = (*fReQ)(0,0);
6805 Double_t dReQ2n = (*fReQ)(1,0);
6806 //Double_t dReQ3n = (*fReQ)(2,0);
6807 //Double_t dReQ4n = (*fReQ)(3,0);
6808 Double_t dImQ1n = (*fImQ)(0,0);
6809 Double_t dImQ2n = (*fImQ)(1,0);
6810 //Double_t dImQ3n = (*fImQ)(2,0);
6811 //Double_t dImQ4n = (*fImQ)(3,0);
6813 // reduced correlations are stored in fDiffFlowCorrelationsPro[0=RP,1=POI][0=pt,1=eta][correlation index]. Correlation index runs as follows:
6820 Int_t t = 0; // type flag
6821 Int_t pe = 0; // ptEta flag
6826 } else if(type == "POI")
6834 } else if(ptOrEta == "Eta")
6839 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
6840 Double_t minPtEta[2] = {fPtMin,fEtaMin};
6841 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
6842 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
6844 // looping over all bins and calculating reduced correlations:
6845 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
6847 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
6848 Double_t p1n0kRe = 0.;
6849 Double_t p1n0kIm = 0.;
6851 // number of POIs in particular pt or eta bin:
6854 // 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):
6855 Double_t q1n0kRe = 0.;
6856 Double_t q1n0kIm = 0.;
6857 Double_t q2n0kRe = 0.;
6858 Double_t q2n0kIm = 0.;
6860 // number of particles which are both RPs and POIs in particular pt or eta bin:
6866 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))
6867 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));
6868 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))
6869 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));
6870 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))
6871 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));
6872 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))
6873 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b));
6875 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
6877 else if(type == "RP")
6880 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
6881 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
6882 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
6883 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
6884 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))
6885 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));
6886 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))
6887 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b));
6889 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
6895 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
6896 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
6897 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
6898 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
6900 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
6902 t = 1; // typeFlag = RP or POI
6904 else if(type == "RP")
6906 // p_{m*n,0} = q_{m*n,0}:
6912 t = 0; // typeFlag = RP or POI
6915 // 2'-particle correlation for particular pt or eta bin:
6916 Double_t two1n1nPtEta = 0.;
6917 Double_t mWeight2pPrime = 0.; // multiplicity weight for <2'>
6920 two1n1nPtEta = (p1n0kRe*dReQ1n+p1n0kIm*dImQ1n-mq)
6922 // determine multiplicity weight:
6923 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
6925 mWeight2pPrime = mp*dMult-mq;
6926 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
6928 mWeight2pPrime = 1.;
6930 if(type == "POI") // to be improved (I do not this if)
6932 // fill profile to get <<2'>> for POIs
6933 fDiffFlowCorrelationsPro[1][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta,mWeight2pPrime);
6934 // fill profile to get <<2'>^2> for POIs
6935 fDiffFlowSquaredCorrelationsPro[1][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta*two1n1nPtEta,mWeight2pPrime);
6936 // histogram to store <2'> for POIs e-b-e (needed in some other methods):
6937 fDiffFlowCorrelationsEBE[1][pe][0]->SetBinContent(b,two1n1nPtEta);
6938 fDiffFlowEventWeightsForCorrelationsEBE[1][pe][0]->SetBinContent(b,mWeight2pPrime);
6940 else if(type == "RP") // to be improved (I do not this if)
6942 // profile to get <<2'>> for RPs:
6943 fDiffFlowCorrelationsPro[0][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta,mWeight2pPrime);
6944 // profile to get <<2'>^2> for RPs:
6945 fDiffFlowSquaredCorrelationsPro[0][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta*two1n1nPtEta,mWeight2pPrime);
6946 // histogram to store <2'> for RPs e-b-e (needed in some other methods):
6947 fDiffFlowCorrelationsEBE[0][pe][0]->SetBinContent(b,two1n1nPtEta);
6948 fDiffFlowEventWeightsForCorrelationsEBE[0][pe][0]->SetBinContent(b,mWeight2pPrime);
6950 } // end of if(mp*dMult-mq)
6952 // 4'-particle correlation:
6953 Double_t four1n1n1n1nPtEta = 0.;
6954 Double_t mWeight4pPrime = 0.; // multiplicity weight for <4'>
6955 if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6956 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)
6958 four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6959 - q2n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))
6960 - 2.*q2n0kIm*dReQ1n*dImQ1n
6961 - p1n0kRe*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)
6962 + p1n0kIm*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)
6963 - 2.*dMult*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6964 - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*mq
6965 + 6.*(q1n0kRe*dReQ1n+q1n0kIm*dImQ1n)
6966 + 1.*(q2n0kRe*dReQ2n+q2n0kIm*dImQ2n)
6967 + 2.*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
6970 / ((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
6971 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
6972 // determine multiplicity weight:
6973 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
6975 mWeight4pPrime = (mp-mq)*dMult*(dMult-1.)*(dMult-2.) + mq*(dMult-1.)*(dMult-2.)*(dMult-3.);
6976 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
6978 mWeight4pPrime = 1.;
6982 // profile to get <<4'>> for POIs:
6983 fDiffFlowCorrelationsPro[1][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta,mWeight4pPrime);
6984 // profile to get <<4'>^2> for POIs:
6985 fDiffFlowSquaredCorrelationsPro[1][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta*four1n1n1n1nPtEta,mWeight4pPrime);
6986 // histogram to store <4'> for POIs e-b-e (needed in some other methods):
6987 fDiffFlowCorrelationsEBE[1][pe][1]->SetBinContent(b,four1n1n1n1nPtEta);
6988 fDiffFlowEventWeightsForCorrelationsEBE[1][pe][1]->SetBinContent(b,mWeight4pPrime);
6990 else if(type == "RP")
6992 // profile to get <<4'>> for RPs:
6993 fDiffFlowCorrelationsPro[0][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta,mWeight4pPrime);
6994 // profile to get <<4'>^2> for RPs:
6995 fDiffFlowSquaredCorrelationsPro[0][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta*four1n1n1n1nPtEta,mWeight4pPrime);
6996 // histogram to store <4'> for RPs e-b-e (needed in some other methods):
6997 fDiffFlowCorrelationsEBE[0][pe][1]->SetBinContent(b,four1n1n1n1nPtEta);
6998 fDiffFlowEventWeightsForCorrelationsEBE[0][pe][1]->SetBinContent(b,mWeight4pPrime);
7000 } // end of if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
7001 // +mq*(dMult-1.)*(dMult-2.)*(dMult-3.))
7003 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7006 } // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelations(TString type, TString ptOrEta);
7008 //================================================================================================================================
7010 void AliFlowAnalysisWithQCumulants::CalculateOtherDiffCorrelators(TString type, TString ptOrEta)
7012 // Calculate other differential correlators for RPs or POIs for all pt and eta bins.
7015 Double_t dMult = (*fSpk)(0,0);
7017 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
7018 Double_t dReQ1n = (*fReQ)(0,0);
7019 Double_t dReQ2n = (*fReQ)(1,0);
7020 Double_t dReQ3n = (*fReQ)(2,0);
7021 //Double_t dReQ4n = (*fReQ)(3,0);
7022 Double_t dImQ1n = (*fImQ)(0,0);
7023 Double_t dImQ2n = (*fImQ)(1,0);
7024 Double_t dImQ3n = (*fImQ)(2,0);
7025 //Double_t dImQ4n = (*fImQ)(3,0);
7027 // 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]
7028 // Correlation index runs as follows:
7030 // 0: <exp[in(psi1-3phi2+2phi3)]>
7032 Int_t t = 0; // type flag
7033 Int_t pe = 0; // ptEta flag
7038 } else if(type == "POI")
7046 } else if(ptOrEta == "Eta")
7051 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
7052 Double_t minPtEta[2] = {fPtMin,fEtaMin};
7053 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
7054 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
7056 // looping over all bins and calculating reduced correlations:
7057 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7059 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
7060 Double_t p1n0kRe = 0.;
7061 Double_t p1n0kIm = 0.;
7063 // number of POIs in particular pt or eta bin:
7066 // 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):
7067 Double_t q1n0kRe = 0.;
7068 Double_t q1n0kIm = 0.;
7069 Double_t q2n0kRe = 0.;
7070 Double_t q2n0kIm = 0.;
7071 Double_t q3n0kRe = 0.;
7072 Double_t q3n0kIm = 0.;
7074 // number of particles which are both RPs and POIs in particular pt or eta bin:
7080 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))
7081 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));
7082 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))
7083 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));
7084 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))
7085 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));
7086 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))
7087 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b));
7088 q3n0kRe = fReRPQ1dEBE[2][pe][2][0]->GetBinContent(fReRPQ1dEBE[2][pe][2][0]->GetBin(b))
7089 * fReRPQ1dEBE[2][pe][2][0]->GetBinEntries(fReRPQ1dEBE[2][pe][2][0]->GetBin(b));
7090 q3n0kIm = fImRPQ1dEBE[2][pe][2][0]->GetBinContent(fImRPQ1dEBE[2][pe][2][0]->GetBin(b))
7091 * fImRPQ1dEBE[2][pe][2][0]->GetBinEntries(fImRPQ1dEBE[2][pe][2][0]->GetBin(b));
7093 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
7095 else if(type == "RP")
7098 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
7099 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
7100 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
7101 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
7102 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))
7103 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));
7104 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))
7105 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b));
7106 q3n0kRe = fReRPQ1dEBE[0][pe][2][0]->GetBinContent(fReRPQ1dEBE[0][pe][2][0]->GetBin(b))
7107 * fReRPQ1dEBE[0][pe][2][0]->GetBinEntries(fReRPQ1dEBE[0][pe][2][0]->GetBin(b));
7108 q3n0kIm = fImRPQ1dEBE[0][pe][2][0]->GetBinContent(fImRPQ1dEBE[0][pe][2][0]->GetBin(b))
7109 * fImRPQ1dEBE[0][pe][2][0]->GetBinEntries(fImRPQ1dEBE[0][pe][2][0]->GetBin(b));
7111 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
7117 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
7118 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
7119 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
7120 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
7122 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
7124 t = 1; // typeFlag = RP or POI
7126 else if(type == "RP")
7128 // p_{m*n,0} = q_{m*n,0}:
7134 t = 0; // typeFlag = RP or POI
7137 // 3'-particle correlators:
7138 // Taeney-Yan correlator:
7139 Double_t dTaeneyYan = 0.;
7140 Double_t mWeightTaeneyYan = 0.; // multiplicity weight for Taeney-Yan correlator
7141 if((mp*dMult-2.*mq)*(dMult-1.) > 0.) // to be improved - is this condition fully justified?
7143 dTaeneyYan = (dReQ3n*(p1n0kRe*dReQ2n-p1n0kIm*dImQ2n)+dImQ3n*(p1n0kIm*dReQ2n+p1n0kRe*dImQ2n)
7144 - p1n0kRe*dReQ1n - p1n0kIm*dImQ1n
7145 - q2n0kRe*dReQ2n - q2n0kIm*dImQ2n
7146 - q3n0kRe*dReQ3n - q3n0kIm*dImQ3n
7148 / ((mp*dMult-2.*mq)*(dMult-1.));
7149 // determine multiplicity weight:
7150 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
7152 mWeightTaeneyYan = (mp*dMult-2.*mq)*(dMult-1.);
7153 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
7155 mWeightTaeneyYan = 1.;
7158 fOtherDiffCorrelators[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dTaeneyYan,mWeightTaeneyYan);
7159 } // end of if((mp*dMult-2.*mq)*(dMult-1.) > 0.)
7161 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7163 } // end of void AliFlowAnalysisWithQCumulants::CalculateOtherDiffCorrelators(TString type, TString ptOrEta)
7165 //================================================================================================================================
7167 void AliFlowAnalysisWithQCumulants::Calculate2DDiffFlowCorrelations(TString type)
7169 // Calculate all reduced correlations needed for 2D differential flow for each (pt,eta) bin.
7172 Double_t dMult = (*fSpk)(0,0);
7173 // Real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
7174 Double_t dReQ1n = (*fReQ)(0,0);
7175 Double_t dReQ2n = (*fReQ)(1,0);
7176 //Double_t dReQ3n = (*fReQ)(2,0);
7177 //Double_t dReQ4n = (*fReQ)(3,0);
7178 Double_t dImQ1n = (*fImQ)(0,0);
7179 Double_t dImQ2n = (*fImQ)(1,0);
7180 //Double_t dImQ3n = (*fImQ)(2,0);
7181 //Double_t dImQ4n = (*fImQ)(3,0);
7183 // 2D reduced correlations are stored in TProfile2D f2DDiffFlowCorrelationsPro[0=RP,1=POI][correlation index].
7184 // Correlation index runs as follows:
7190 Int_t t = 0; // type flag
7194 } else if(type == "POI")
7199 // Looping over all (pt,eta) bins and calculating correlations needed for differential flow:
7200 for(Int_t p=1;p<=fnBinsPt;p++)
7202 for(Int_t e=1;e<=fnBinsEta;e++)
7204 // Real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin):
7205 Double_t p1n0kRe = 0.;
7206 Double_t p1n0kIm = 0.;
7207 // Number of POIs in particular pt or eta bin:
7209 // Real and imaginary parts of q_{m*n,0} (non-weighted Q-vector evaluated for 'RP && POI particles' in particular pt or eta bin):
7210 Double_t q1n0kRe = 0.;
7211 Double_t q1n0kIm = 0.;
7212 Double_t q2n0kRe = 0.;
7213 Double_t q2n0kIm = 0.;
7214 // Number of 'RP && POI particles' in particular pt or eta bin:
7219 q1n0kRe = fReRPQ2dEBE[2][0][0]->GetBinContent(fReRPQ2dEBE[2][0][0]->GetBin(p,e))
7220 * fReRPQ2dEBE[2][0][0]->GetBinEntries(fReRPQ2dEBE[2][0][0]->GetBin(p,e));
7221 q1n0kIm = fImRPQ2dEBE[2][0][0]->GetBinContent(fImRPQ2dEBE[2][0][0]->GetBin(p,e))
7222 * fImRPQ2dEBE[2][0][0]->GetBinEntries(fImRPQ2dEBE[2][0][0]->GetBin(p,e));
7223 q2n0kRe = fReRPQ2dEBE[2][1][0]->GetBinContent(fReRPQ2dEBE[2][1][0]->GetBin(p,e))
7224 * fReRPQ2dEBE[2][1][0]->GetBinEntries(fReRPQ2dEBE[2][1][0]->GetBin(p,e));
7225 q2n0kIm = fImRPQ2dEBE[2][1][0]->GetBinContent(fImRPQ2dEBE[2][1][0]->GetBin(p,e))
7226 * fImRPQ2dEBE[2][1][0]->GetBinEntries(fImRPQ2dEBE[2][1][0]->GetBin(p,e));
7228 mq = fReRPQ2dEBE[2][0][0]->GetBinEntries(fReRPQ2dEBE[2][0][0]->GetBin(p,e)); // to be improved (cross-checked by accessing other profiles here)
7229 } // end of if(type == "POI")
7230 else if(type == "RP")
7233 q1n0kRe = fReRPQ2dEBE[0][0][0]->GetBinContent(fReRPQ2dEBE[0][0][0]->GetBin(p,e))
7234 * fReRPQ2dEBE[0][0][0]->GetBinEntries(fReRPQ2dEBE[0][0][0]->GetBin(p,e));
7235 q1n0kIm = fImRPQ2dEBE[0][0][0]->GetBinContent(fImRPQ2dEBE[0][0][0]->GetBin(p,e))
7236 * fImRPQ2dEBE[0][0][0]->GetBinEntries(fImRPQ2dEBE[0][0][0]->GetBin(p,e));
7237 q2n0kRe = fReRPQ2dEBE[0][1][0]->GetBinContent(fReRPQ2dEBE[0][1][0]->GetBin(p,e))
7238 * fReRPQ2dEBE[0][1][0]->GetBinEntries(fReRPQ2dEBE[0][1][0]->GetBin(p,e));
7239 q2n0kIm = fImRPQ2dEBE[0][1][0]->GetBinContent(fImRPQ2dEBE[0][1][0]->GetBin(p,e))
7240 * fImRPQ2dEBE[0][1][0]->GetBinEntries(fImRPQ2dEBE[0][1][0]->GetBin(p,e));
7242 mq = fReRPQ2dEBE[0][0][0]->GetBinEntries(fReRPQ2dEBE[0][0][0]->GetBin(p,e)); // to be improved (cross-checked by accessing other profiles here)
7243 } // end of else if(type == "RP")
7247 p1n0kRe = fReRPQ2dEBE[1][0][0]->GetBinContent(fReRPQ2dEBE[1][0][0]->GetBin(p,e))
7248 * fReRPQ2dEBE[1][0][0]->GetBinEntries(fReRPQ2dEBE[1][0][0]->GetBin(p,e));
7249 p1n0kIm = fImRPQ2dEBE[1][0][0]->GetBinContent(fImRPQ2dEBE[1][0][0]->GetBin(p,e))
7250 * fImRPQ2dEBE[1][0][0]->GetBinEntries(fImRPQ2dEBE[1][0][0]->GetBin(p,e));
7252 mp = fReRPQ2dEBE[1][0][0]->GetBinEntries(fReRPQ2dEBE[1][0][0]->GetBin(p,e)); // to be improved (cross-checked by accessing other profiles here)
7254 t = 1; // typeFlag = RP or POI
7255 } // end of if(type == "POI")
7256 else if(type == "RP")
7258 // p_{m*n,0} = q_{m*n,0}:
7264 t = 0; // typeFlag = RP or POI
7265 } // end of if(type == "RP")
7267 // 2'-particle correlation for particular (pt,eta) bin:
7268 Double_t two1n1nPtEta = 0.;
7269 Double_t mWeight2pPrime = 0.; // multiplicity weight for <2'>
7272 two1n1nPtEta = (p1n0kRe*dReQ1n+p1n0kIm*dImQ1n-mq)
7274 // Determine multiplicity weight:
7275 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
7277 mWeight2pPrime = mp*dMult-mq;
7278 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
7280 mWeight2pPrime = 1.;
7282 // Fill 2D profile holding <<2'>>:
7283 f2DDiffFlowCorrelationsPro[t][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mWeight2pPrime);
7284 } // end of if(mp*dMult-mq)
7286 // 4'-particle correlation:
7287 Double_t four1n1n1n1nPtEta = 0.;
7288 Double_t mWeight4pPrime = 0.; // multiplicity weight for <4'>
7289 if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
7290 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)
7292 four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
7293 - q2n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))
7294 - 2.*q2n0kIm*dReQ1n*dImQ1n
7295 - p1n0kRe*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)
7296 + p1n0kIm*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)
7297 - 2.*dMult*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
7298 - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*mq
7299 + 6.*(q1n0kRe*dReQ1n+q1n0kIm*dImQ1n)
7300 + 1.*(q2n0kRe*dReQ2n+q2n0kIm*dImQ2n)
7301 + 2.*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)
7304 / ((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
7305 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));
7306 // Determine multiplicity weight:
7307 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))
7309 mWeight4pPrime = (mp-mq)*dMult*(dMult-1.)*(dMult-2.) + mq*(dMult-1.)*(dMult-2.)*(dMult-3.);
7310 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))
7312 mWeight4pPrime = 1.;
7314 // Fill 2D profile holding <<4'>>:
7315 f2DDiffFlowCorrelationsPro[t][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,mWeight4pPrime);
7316 } // end of if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)
7317 // +mq*(dMult-1.)*(dMult-2.)*(dMult-3.))
7318 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
7319 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
7321 } // end of AliFlowAnalysisWithQCumulants::Calculate2DDiffFlowCorrelations(TString type)
7323 //================================================================================================================================
7325 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfEventWeights(TString type, TString ptOrEta)
7327 // Calculate sums of various event weights for reduced correlations.
7328 // (These quantitites are needed in expressions for unbiased estimators relevant for the statistical errors.)
7331 Int_t ptEtaFlag = 0;
7336 } else if(type == "POI")
7344 } else if(ptOrEta == "Eta")
7351 Int_t pe = ptEtaFlag;
7354 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
7355 Double_t minPtEta[2] = {fPtMin,fEtaMin};
7356 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
7357 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
7359 for(Int_t rpq=0;rpq<3;rpq++)
7361 for(Int_t m=0;m<4;m++)
7363 for(Int_t k=0;k<9;k++)
7365 if(!fReRPQ1dEBE[rpq][pe][m][k])
7367 cout<<"WARNING: fReRPQ1dEBE[rpq][pe][m][k] is NULL in AFAWQC::CSAPOEWFDF() !!!!"<<endl;
7368 cout<<"pe = "<<pe<<endl;
7369 cout<<"rpq = "<<rpq<<endl;
7370 cout<<"m = "<<m<<endl;
7371 cout<<"k = "<<k<<endl;
7379 Double_t dMult = (*fSpk)(0,0); // total event multiplicity
7380 //Double_t mr = 0.; // number of RPs in particular pt or eta bin
7381 Double_t mp = 0.; // number of POIs in particular pt or eta bin
7382 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin
7384 // event weights for reduced correlations:
7385 Double_t dw2 = 0.; // event weight for <2'>
7386 Double_t dw4 = 0.; // event weight for <4'>
7387 //Double_t dw6 = 0.; // event weight for <6'>
7388 //Double_t dw8 = 0.; // event weight for <8'>
7390 // looping over bins:
7391 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7395 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);
7396 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
7397 } else if(type == "POI")
7399 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);
7400 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b);
7403 // event weight for <2'>:
7405 fDiffFlowSumOfEventWeights[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2);
7406 fDiffFlowSumOfEventWeights[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw2,2.));
7408 // event weight for <4'>:
7409 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
7410 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.);
7411 fDiffFlowSumOfEventWeights[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4);
7412 fDiffFlowSumOfEventWeights[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw4,2.));
7414 // event weight for <6'>:
7416 //fDiffFlowSumOfEventWeights[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6);
7417 //fDiffFlowSumOfEventWeights[t][pe][t][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw6,2.));
7419 // event weight for <8'>:
7421 //fDiffFlowSumOfEventWeights[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw8);
7422 //fDiffFlowSumOfEventWeights[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw8,2.));
7423 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7425 } // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfEventWeights()
7428 //================================================================================================================================
7431 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfProductOfEventWeights(TString type, TString ptOrEta)
7433 // Calculate sum of products of various event weights for both types of correlations (the ones for int. and diff. flow).
7434 // (These quantitites are needed in expressions for unbiased estimators relevant for the statistical errors.)
7436 // Important: To fill fDiffFlowSumOfProductOfEventWeights[][][][] use bellow table (i,j) with following constraints:
7438 // 2.) do not store terms which DO NOT include reduced correlations;
7440 // [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'>]
7443 Int_t ptEtaFlag = 0;
7448 } else if(type == "POI")
7456 } else if(ptOrEta == "Eta")
7463 Int_t pe = ptEtaFlag;
7466 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
7467 Double_t minPtEta[2] = {fPtMin,fEtaMin};
7468 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
7469 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
7472 for(Int_t rpq=0;rpq<3;rpq++)
7474 for(Int_t m=0;m<4;m++)
7476 for(Int_t k=0;k<9;k++)
7478 if(!fReRPQ1dEBE[rpq][pe][m][k])
7480 cout<<"WARNING: fReRPQ1dEBE[rpq][pe][m][k] is NULL in AFAWQC::CSAPOEWFDF() !!!!"<<endl;
7481 cout<<"pe = "<<pe<<endl;
7482 cout<<"rpq = "<<rpq<<endl;
7483 cout<<"m = "<<m<<endl;
7484 cout<<"k = "<<k<<endl;
7492 Double_t dMult = (*fSpk)(0,0); // total event multiplicity
7493 //Double_t mr = 0.; // number of RPs in particular pt or eta bin
7494 Double_t mp = 0.; // number of POIs in particular pt or eta bin
7495 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin
7497 // event weights for correlations:
7498 Double_t dW2 = dMult*(dMult-1); // event weight for <2>
7499 Double_t dW4 = dMult*(dMult-1)*(dMult-2)*(dMult-3); // event weight for <4>
7500 Double_t dW6 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5); // event weight for <6>
7501 Double_t dW8 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7); // event weight for <8>
7503 // event weights for reduced correlations:
7504 Double_t dw2 = 0.; // event weight for <2'>
7505 Double_t dw4 = 0.; // event weight for <4'>
7506 //Double_t dw6 = 0.; // event weight for <6'>
7507 //Double_t dw8 = 0.; // event weight for <8'>
7509 // looping over bins:
7510 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7514 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);
7515 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
7516 } else if(type == "POI")
7518 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);
7519 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b);
7522 // event weight for <2'>:
7524 fDiffFlowSumOfProductOfEventWeights[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw2); // storing product of even weights for <2> and <2'>
7525 fDiffFlowSumOfProductOfEventWeights[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW4); // storing product of even weights for <4> and <2'>
7526 fDiffFlowSumOfProductOfEventWeights[t][pe][1][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW6); // storing product of even weights for <6> and <2'>
7527 fDiffFlowSumOfProductOfEventWeights[t][pe][1][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW8); // storing product of even weights for <8> and <2'>
7529 // event weight for <4'>:
7530 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
7531 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.);
7532 fDiffFlowSumOfProductOfEventWeights[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw4); // storing product of even weights for <2> and <4'>
7533 fDiffFlowSumOfProductOfEventWeights[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw4); // storing product of even weights for <2'> and <4'>
7534 fDiffFlowSumOfProductOfEventWeights[t][pe][2][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw4); // storing product of even weights for <4> and <4'>
7535 fDiffFlowSumOfProductOfEventWeights[t][pe][3][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dW6); // storing product of even weights for <6> and <4'>
7536 fDiffFlowSumOfProductOfEventWeights[t][pe][3][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dW8); // storing product of even weights for <8> and <4'>
7538 // event weight for <6'>:
7540 //fDiffFlowSumOfProductOfEventWeights[t][pe][0][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw6); // storing product of even weights for <2> and <6'>
7541 //fDiffFlowSumOfProductOfEventWeights[t][pe][1][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw6); // storing product of even weights for <2'> and <6'>
7542 //fDiffFlowSumOfProductOfEventWeights[t][pe][2][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw6); // storing product of even weights for <4> and <6'>
7543 //fDiffFlowSumOfProductOfEventWeights[t][pe][3][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dw6); // storing product of even weights for <4'> and <6'>
7544 //fDiffFlowSumOfProductOfEventWeights[t][pe][4][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW6*dw6); // storing product of even weights for <6> and <6'>
7545 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dW8); // storing product of even weights for <6'> and <8>
7546 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dw8); // storing product of even weights for <6'> and <8'>
7548 // event weight for <8'>:
7550 //fDiffFlowSumOfProductOfEventWeights[t][pe][0][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw8); // storing product of even weights for <2> and <8'>
7551 //fDiffFlowSumOfProductOfEventWeights[t][pe][1][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw8); // storing product of even weights for <2'> and <8'>
7552 //fDiffFlowSumOfProductOfEventWeights[t][pe][2][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw8); // storing product of even weights for <4> and <8'>
7553 //fDiffFlowSumOfProductOfEventWeights[t][pe][3][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dw8); // storing product of even weights for <4'> and <8'>
7554 //fDiffFlowSumOfProductOfEventWeights[t][pe][4][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW6*dw8); // storing product of even weights for <6> and <8'>
7555 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dw8); // storing product of even weights for <6'> and <8'>
7556 //fDiffFlowSumOfProductOfEventWeights[t][pe][6][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW8*dw8); // storing product of even weights for <8> and <8'>
7559 // [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'>]
7561 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7565 } // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfProductOfEventWeights(TString type, TString ptOrEta)
7567 //================================================================================================================================
7569 void AliFlowAnalysisWithQCumulants::FinalizeReducedCorrelations(TString type, TString ptOrEta)
7571 // Transfer profiles into histograms and calculate statistical errors correctly.
7573 Int_t t = 0; // RP or POI
7574 Int_t pe = 0; // pt or eta
7579 } else if(type == "POI")
7587 } else if(ptOrEta == "Eta")
7592 for(Int_t rci=0;rci<4;rci++) // to be improved - moved into the method CheckPointersUsedInFinish()
7594 if(!fDiffFlowCorrelationsPro[t][pe][rci])
7596 cout<<"WARNING: fDiffFlowCorrelationsPro[t][pe][rci] is NULL in AFAWQC::FRC() !!!!"<<endl;
7597 cout<<"t = "<<t<<endl;
7598 cout<<"pe = "<<pe<<endl;
7599 cout<<"rci = "<<rci<<endl;
7602 if(!fDiffFlowSquaredCorrelationsPro[t][pe][rci])
7604 cout<<"WARNING: fDiffFlowSquaredCorrelationsPro[t][pe][rci] is NULL in AFAWQC::FRC() !!!!"<<endl;
7605 cout<<"t = "<<t<<endl;
7606 cout<<"pe = "<<pe<<endl;
7607 cout<<"rci = "<<rci<<endl;
7610 for(Int_t power=0;power<2;power++)
7612 if(!fDiffFlowSumOfEventWeights[t][pe][power][rci])
7614 cout<<"WARNING: fDiffFlowSumOfEventWeights[t][pe][power][rci] is NULL in AFAWQC::FRC() !!!!"<<endl;
7615 cout<<"t = "<<t<<endl;
7616 cout<<"pe = "<<pe<<endl;
7617 cout<<"power = "<<power<<endl;
7618 cout<<"rci = "<<rci<<endl;
7621 } // end of for(Int_t power=0;power<2;power++)
7622 } // end of for(Int_t rci=0;rci<4;rci++)
7625 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
7626 // transfer 1D profile into 1D histogram:
7627 Double_t correlation = 0.;
7628 Double_t squaredCorrelation = 0.;
7629 Double_t spread = 0.;
7630 Double_t sumOfWeights = 0.; // sum of weights for particular reduced correlations for particular pt or eta bin
7631 Double_t sumOfSquaredWeights = 0.; // sum of squared weights for particular reduced correlations for particular pt or eta bin
7632 Double_t error = 0.; // error = termA * spread * termB
7633 // termA = (sqrt(sumOfSquaredWeights)/sumOfWeights)
7634 // termB = 1/pow(1-termA^2,0.5)
7635 Double_t termA = 0.;
7636 Double_t termB = 0.;
7637 for(Int_t rci=0;rci<4;rci++) // index of reduced correlation
7639 for(Int_t b=1;b<=nBinsPtEta[pe];b++) // number of pt or eta bins
7641 if(fDiffFlowCorrelationsPro[t][pe][rci]->GetBinEffectiveEntries(b) < 2 ||
7642 fDiffFlowSquaredCorrelationsPro[t][pe][rci]->GetBinEffectiveEntries(b) < 2)
7644 fDiffFlowCorrelationsPro[t][pe][rci]->SetBinError(b,0.);
7645 fDiffFlowSquaredCorrelationsPro[t][pe][rci]->SetBinError(b,0.);
7646 continue; // to be improved - should I ignore results in pt bins with one entry for reduced correlations or not?
7648 correlation = fDiffFlowCorrelationsPro[t][pe][rci]->GetBinContent(b);
7649 squaredCorrelation = fDiffFlowSquaredCorrelationsPro[t][pe][rci]->GetBinContent(b);
7650 if(squaredCorrelation-correlation*correlation >= 0.)
7652 spread = pow(squaredCorrelation-correlation*correlation,0.5);
7656 cout<<Form(" WARNING: Imaginary 'spread' for rci = %d, pe = %d, bin = %d !!!!",rci,pe,b)<<endl;
7659 sumOfWeights = fDiffFlowSumOfEventWeights[t][pe][0][rci]->GetBinContent(b);
7660 sumOfSquaredWeights = fDiffFlowSumOfEventWeights[t][pe][1][rci]->GetBinContent(b);
7661 if(TMath::Abs(sumOfWeights)>0.){termA = (pow(sumOfSquaredWeights,0.5)/sumOfWeights);}
7662 if(1.-pow(termA,2.)>0.){termB = 1./pow(1.-pow(termA,2.),0.5);}
7663 error = termA*spread*termB; // final error (unbiased estimator for standard deviation)
7664 fDiffFlowCorrelationsHist[t][pe][rci]->SetBinContent(b,correlation);
7665 fDiffFlowCorrelationsHist[t][pe][rci]->SetBinError(b,error);
7666 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7667 } // end of for(Int_t rci=0;rci<4;rci++)
7669 } // end of void AliFlowAnalysisWithQCumulants::FinalizeReducedCorrelations(TString type, TString ptOrEta)
7671 //================================================================================================================================
7673 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowProductOfCorrelations(TString type, TString ptOrEta)
7675 // store products: <2><2'>, <2><4'>, <2><6'>, <2><8'>, <2'><4>,
7676 // <2'><4'>, <2'><6>, <2'><6'>, <2'><8>, <2'><8'>,
7677 // <4><4'>, <4><6'>, <4><8'>, <4'><6>, <4'><6'>,
7678 // <4'><8>, <4'><8'>, <6><6'>, <6><8'>, <6'><8>,
7679 // <6'><8'>, <8><8'>.
7682 Int_t ptEtaFlag = 0;
7687 } else if(type == "POI")
7695 } else if(ptOrEta == "Eta")
7702 Int_t pe = ptEtaFlag;
7705 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
7706 Double_t minPtEta[2] = {fPtMin,fEtaMin};
7707 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
7709 // protections // to be improved (add protection for all pointers in this method)
7710 if(!fIntFlowCorrelationsEBE)
7712 cout<<"WARNING: fIntFlowCorrelationsEBE is NULL in AFAWQC::CDFPOC() !!!!"<<endl;
7717 Double_t dMult = (*fSpk)(0,0); // multiplicity (number of particles used to determine the reaction plane)
7718 //Double_t mr = 0.; // number of RPs in particular pt or eta bin
7719 Double_t mp = 0.; // number of POIs in particular pt or eta bin
7720 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin
7723 // e-b-e correlations:
7724 Double_t twoEBE = fIntFlowCorrelationsEBE->GetBinContent(1); // <2>
7725 Double_t fourEBE = fIntFlowCorrelationsEBE->GetBinContent(2); // <4>
7726 Double_t sixEBE = fIntFlowCorrelationsEBE->GetBinContent(3); // <6>
7727 Double_t eightEBE = fIntFlowCorrelationsEBE->GetBinContent(4); // <8>
7729 // event weights for correlations:
7730 Double_t dW2 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1); // event weight for <2>
7731 Double_t dW4 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2); // event weight for <4>
7732 Double_t dW6 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(3); // event weight for <6>
7733 Double_t dW8 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(4); // event weight for <8>
7735 // e-b-e reduced correlations:
7736 Double_t twoReducedEBE = 0.; // <2'>
7737 Double_t fourReducedEBE = 0.; // <4'>
7738 Double_t sixReducedEBE = 0.; // <6'>
7739 Double_t eightReducedEBE = 0.; // <8'>
7741 // event weights for reduced correlations:
7742 Double_t dw2 = 0.; // event weight for <2'>
7743 Double_t dw4 = 0.; // event weight for <4'>
7744 //Double_t dw6 = 0.; // event weight for <6'>
7745 //Double_t dw8 = 0.; // event weight for <8'>
7747 // looping over bins:
7748 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7750 // e-b-e reduced correlations:
7751 twoReducedEBE = fDiffFlowCorrelationsEBE[t][pe][0]->GetBinContent(b);
7752 fourReducedEBE = fDiffFlowCorrelationsEBE[t][pe][1]->GetBinContent(b);
7753 sixReducedEBE = fDiffFlowCorrelationsEBE[t][pe][2]->GetBinContent(b);
7754 eightReducedEBE = fDiffFlowCorrelationsEBE[t][pe][3]->GetBinContent(b);
7757 // to be improved (I should not do this here again)
7760 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);
7761 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow
7762 } else if(type == "POI")
7764 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);
7765 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b);
7768 // event weights for reduced correlations:
7769 dw2 = mp*dMult-mq; // weight for <2'>
7770 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)
7771 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.); // weight for <4'>
7777 dw2 = fDiffFlowEventWeightsForCorrelationsEBE[t][pe][0]->GetBinContent(b);
7778 dw4 = fDiffFlowEventWeightsForCorrelationsEBE[t][pe][1]->GetBinContent(b);
7780 // storing all products:
7781 fDiffFlowProductOfCorrelationsPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*twoReducedEBE,dW2*dw2); // storing <2><2'>
7782 fDiffFlowProductOfCorrelationsPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*twoReducedEBE,dW4*dw2); // storing <4><2'>
7783 fDiffFlowProductOfCorrelationsPro[t][pe][1][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*twoReducedEBE,dW6*dw2); // storing <6><2'>
7784 fDiffFlowProductOfCorrelationsPro[t][pe][1][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*twoReducedEBE,dW8*dw2); // storing <8><2'>
7786 // event weight for <4'>:
7787 fDiffFlowProductOfCorrelationsPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*fourReducedEBE,dW2*dw4); // storing <2><4'>
7788 fDiffFlowProductOfCorrelationsPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*fourReducedEBE,dw2*dw4); // storing <2'><4'>
7789 fDiffFlowProductOfCorrelationsPro[t][pe][2][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*fourReducedEBE,dW4*dw4); // storing <4><4'>
7790 fDiffFlowProductOfCorrelationsPro[t][pe][3][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*fourReducedEBE,dW6*dw4); // storing <6><4'>
7791 fDiffFlowProductOfCorrelationsPro[t][pe][3][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*fourReducedEBE,dW8*dw4); // storing <8><4'>
7793 // event weight for <6'>:
7795 //fDiffFlowProductOfCorrelationsPro[t][pe][0][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*sixReducedEBE,dW2*dw6); // storing <2><6'>
7796 //fDiffFlowProductOfCorrelationsPro[t][pe][1][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*sixReducedEBE,dw2*dw6); // storing <2'><6'>
7797 //fDiffFlowProductOfCorrelationsPro[t][pe][2][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*sixReducedEBE,dW4*dw6); // storing <4><6'>
7798 //fDiffFlowProductOfCorrelationsPro[t][pe][3][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourReducedEBE*sixReducedEBE,dw4*dw6); // storing <4'><6'>
7799 //fDiffFlowProductOfCorrelationsPro[t][pe][4][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*sixReducedEBE,dW6*dw6); // storing <6><6'>
7800 //fDiffFlowProductOfCorrelationsPro[t][pe][5][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightEBE,dw6*dW8); // storing <6'><8>
7801 //fDiffFlowProductOfCorrelationsPro[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightReducedEBE,dw6*dw8); // storing <6'><8'>
7803 // event weight for <8'>:
7805 //fDiffFlowProductOfCorrelationsPro[t][pe][0][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*eightReducedEBE,dW2*dw8); // storing <2><8'>
7806 //fDiffFlowProductOfCorrelationsPro[t][pe][1][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*eightReducedEBE,dw2*dw8); // storing <2'><8'>
7807 //fDiffFlowProductOfCorrelationsPro[t][pe][2][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*eightReducedEBE,dW4*dw8); // storing <4><8'>
7808 //fDiffFlowProductOfCorrelationsPro[t][pe][3][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourReducedEBE*eightReducedEBE,dw4*dw8); // storing <4'><8'>
7809 //fDiffFlowProductOfCorrelationsPro[t][pe][4][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*eightReducedEBE,dW6*dw8); // storing <6><8'>
7810 //fDiffFlowProductOfCorrelationsPro[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightReducedEBE,dw6*dw8); // storing <6'><8'>
7811 //fDiffFlowProductOfCorrelationsPro[t][pe][6][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*eightReducedEBE,dW8*dw8); // storing <8><8'>
7812 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++
7814 } // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowProductOfCorrelations(TString type, TString ptOrEta)
7816 //================================================================================================================================
7818 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCovariances(TString type, TString ptOrEta) // to be improved (reimplemented)
7820 // a) Calculate unbiased estimators Cov(<2>,<2'>), Cov(<2>,<4'>), Cov(<4>,<2'>), Cov(<4>,<4'>) and Cov(<2'>,<4'>)
7821 // for covariances V(<2>,<2'>), V(<2>,<4'>), V(<4>,<2'>), V(<4>,<4'>) and V(<2'>,<4'>).
7822 // b) Store in histogram fDiffFlowCovariances[t][pe][index] for instance the following:
7824 // 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)]
7826 // where N is the number of events, w_{<2>} is event weight for <2> and w_{<2'>} is event weight for <2'>.
7827 // c) Binning of fDiffFlowCovariances[t][pe][index] is organized as follows:
7829 // 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)]
7830 // 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)]
7831 // 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)]
7832 // 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)]
7833 // 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)]
7837 Int_t ptEtaFlag = 0;
7842 } else if(type == "POI")
7850 } else if(ptOrEta == "Eta")
7857 Int_t pe = ptEtaFlag;
7860 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
7861 //Double_t minPtEta[2] = {fPtMin,fEtaMin};
7862 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
7863 //Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
7865 // average correlations:
7866 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
7867 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
7868 //Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
7869 //Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
7871 // sum of weights for correlation:
7872 Double_t sumOfWeightsForTwo = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // sum_{i=1}^{N} w_{<2>}
7873 Double_t sumOfWeightsForFour = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // sum_{i=1}^{N} w_{<4>}
7874 //Double_t sumOfWeightsForSix = fIntFlowSumOfEventWeights[0]->GetBinContent(3); // sum_{i=1}^{N} w_{<6>}
7875 //Double_t sumOfWeightsForEight = fIntFlowSumOfEventWeights[0]->GetBinContent(4); // sum_{i=1}^{N} w_{<8>}
7877 // average reduced correlations:
7878 Double_t twoReduced = 0.; // <<2'>>
7879 Double_t fourReduced = 0.; // <<4'>>
7880 //Double_t sixReduced = 0.; // <<6'>>
7881 //Double_t eightReduced = 0.; // <<8'>>
7883 // sum of weights for reduced correlation:
7884 Double_t sumOfWeightsForTwoReduced = 0.; // sum_{i=1}^{N} w_{<2'>}
7885 Double_t sumOfWeightsForFourReduced = 0.; // sum_{i=1}^{N} w_{<4'>}
7886 //Double_t sumOfWeightsForSixReduced = 0.; // sum_{i=1}^{N} w_{<6'>}
7887 //Double_t sumOfWeightsForEightReduced = 0.; // sum_{i=1}^{N} w_{<8'>}
7889 // product of weights for reduced correlation:
7890 Double_t productOfWeightsForTwoTwoReduced = 0.; // sum_{i=1}^{N} w_{<2>}w_{<2'>}
7891 Double_t productOfWeightsForTwoFourReduced = 0.; // sum_{i=1}^{N} w_{<2>}w_{<4'>}
7892 Double_t productOfWeightsForFourTwoReduced = 0.; // sum_{i=1}^{N} w_{<4>}w_{<2'>}
7893 Double_t productOfWeightsForFourFourReduced = 0.; // sum_{i=1}^{N} w_{<4>}w_{<4'>}
7894 Double_t productOfWeightsForTwoReducedFourReduced = 0.; // sum_{i=1}^{N} w_{<2'>}w_{<4'>}
7897 // products for differential flow:
7898 Double_t twoTwoReduced = 0; // <<2><2'>>
7899 Double_t twoFourReduced = 0; // <<2><4'>>
7900 Double_t fourTwoReduced = 0; // <<4><2'>>
7901 Double_t fourFourReduced = 0; // <<4><4'>>
7902 Double_t twoReducedFourReduced = 0; // <<2'><4'>>
7904 // denominators in the expressions for the unbiased estimators for covariances:
7905 // denominator = 1 - term1/(term2*term3)
7906 // prefactor = term1/(term2*term3)
7907 Double_t denominator = 0.;
7908 Double_t prefactor = 0.;
7909 Double_t term1 = 0.;
7910 Double_t term2 = 0.;
7911 Double_t term3 = 0.;
7913 // unbiased estimators for covariances for differential flow:
7914 Double_t covTwoTwoReduced = 0.; // Cov(<2>,<2'>)
7915 Double_t wCovTwoTwoReduced = 0.; // Cov(<2>,<2'>) * prefactor(w_{<2>},w_{<2'>})
7916 Double_t covTwoFourReduced = 0.; // Cov(<2>,<4'>)
7917 Double_t wCovTwoFourReduced = 0.; // Cov(<2>,<4'>) * prefactor(w_{<2>},w_{<4'>})
7918 Double_t covFourTwoReduced = 0.; // Cov(<4>,<2'>)
7919 Double_t wCovFourTwoReduced = 0.; // Cov(<4>,<2'>) * prefactor(w_{<4>},w_{<2'>})
7920 Double_t covFourFourReduced = 0.; // Cov(<4>,<4'>)
7921 Double_t wCovFourFourReduced = 0.; // Cov(<4>,<4'>) * prefactor(w_{<4>},w_{<4'>})
7922 Double_t covTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>)
7923 Double_t wCovTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>) * prefactor(w_{<2'>},w_{<4'>})
7925 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
7927 // average reduced corelations:
7928 twoReduced = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b);
7929 fourReduced = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b);
7930 // average products:
7931 twoTwoReduced = fDiffFlowProductOfCorrelationsPro[t][pe][0][1]->GetBinContent(b);
7932 twoFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][0][3]->GetBinContent(b);
7933 fourTwoReduced = fDiffFlowProductOfCorrelationsPro[t][pe][1][2]->GetBinContent(b);
7934 fourFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][2][3]->GetBinContent(b);
7935 twoReducedFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][1][3]->GetBinContent(b);
7936 // sum of weights for reduced correlations:
7937 sumOfWeightsForTwoReduced = fDiffFlowSumOfEventWeights[t][pe][0][0]->GetBinContent(b);
7938 sumOfWeightsForFourReduced = fDiffFlowSumOfEventWeights[t][pe][0][1]->GetBinContent(b);
7939 // products of weights for correlations:
7940 productOfWeightsForTwoTwoReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][0][1]->GetBinContent(b);
7941 productOfWeightsForTwoFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][0][3]->GetBinContent(b);
7942 productOfWeightsForFourTwoReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][1][2]->GetBinContent(b);
7943 productOfWeightsForFourFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][2][3]->GetBinContent(b);
7944 productOfWeightsForTwoReducedFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][1][3]->GetBinContent(b);
7945 // denominator for the unbiased estimator for covariances: 1 - term1/(term2*term3)
7946 // prefactor (multiplies Cov's) = term1/(term2*term3)
7948 term1 = productOfWeightsForTwoTwoReduced;
7949 term2 = sumOfWeightsForTwo;
7950 term3 = sumOfWeightsForTwoReduced;
7953 denominator = 1.-term1/(term2*term3);
7954 prefactor = term1/(term2*term3);
7955 if(TMath::Abs(denominator)>1.e-6)
7957 covTwoTwoReduced = (twoTwoReduced-two*twoReduced)/denominator;
7958 wCovTwoTwoReduced = covTwoTwoReduced*prefactor;
7959 fDiffFlowCovariances[t][pe][0]->SetBinContent(b,wCovTwoTwoReduced);
7963 term1 = productOfWeightsForTwoFourReduced;
7964 term2 = sumOfWeightsForTwo;
7965 term3 = sumOfWeightsForFourReduced;
7968 denominator = 1.-term1/(term2*term3);
7969 prefactor = term1/(term2*term3);
7970 if(TMath::Abs(denominator)>1.e-6)
7972 covTwoFourReduced = (twoFourReduced-two*fourReduced)/denominator;
7973 wCovTwoFourReduced = covTwoFourReduced*prefactor;
7974 fDiffFlowCovariances[t][pe][1]->SetBinContent(b,wCovTwoFourReduced);
7978 term1 = productOfWeightsForFourTwoReduced;
7979 term2 = sumOfWeightsForFour;
7980 term3 = sumOfWeightsForTwoReduced;
7983 denominator = 1.-term1/(term2*term3);
7984 prefactor = term1/(term2*term3);
7985 if(TMath::Abs(denominator)>1.e-6)
7987 covFourTwoReduced = (fourTwoReduced-four*twoReduced)/denominator;
7988 wCovFourTwoReduced = covFourTwoReduced*prefactor;
7989 fDiffFlowCovariances[t][pe][2]->SetBinContent(b,wCovFourTwoReduced);
7993 term1 = productOfWeightsForFourFourReduced;
7994 term2 = sumOfWeightsForFour;
7995 term3 = sumOfWeightsForFourReduced;
7998 denominator = 1.-term1/(term2*term3);
7999 prefactor = term1/(term2*term3);
8000 if(TMath::Abs(denominator)>1.e-6)
8002 covFourFourReduced = (fourFourReduced-four*fourReduced)/denominator;
8003 wCovFourFourReduced = covFourFourReduced*prefactor;
8004 fDiffFlowCovariances[t][pe][3]->SetBinContent(b,wCovFourFourReduced);
8008 term1 = productOfWeightsForTwoReducedFourReduced;
8009 term2 = sumOfWeightsForTwoReduced;
8010 term3 = sumOfWeightsForFourReduced;
8013 denominator = 1.-term1/(term2*term3);
8014 prefactor = term1/(term2*term3);
8015 if(TMath::Abs(denominator)>1.e-6)
8017 covTwoReducedFourReduced = (twoReducedFourReduced-twoReduced*fourReduced)/denominator;
8018 wCovTwoReducedFourReduced = covTwoReducedFourReduced*prefactor;
8019 fDiffFlowCovariances[t][pe][4]->SetBinContent(b,wCovTwoReducedFourReduced);
8022 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
8024 } // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCovariances(TString type, TString ptOrEta)
8026 //================================================================================================================================
8028 void AliFlowAnalysisWithQCumulants::CalculateDiffFlow(TString type, TString ptOrEta)
8030 // Calculate final results for differential flow.
8032 // REMARK: Differential flow calculated in this method is NOT corrected for non-uniform acceptance.
8033 // This correction, if enabled via setter SetApplyCorrectionForNUA(Bool_t), is applied in the method
8034 // CalculateDiffFlowCorrectedForNUA(TString type, TString ptOrEta)
8036 Int_t t = 0; // RP or POI
8037 Int_t pe = 0; // pt or eta
8042 } else if(type == "POI")
8050 } else if(ptOrEta == "Eta")
8056 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
8058 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
8059 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
8060 // Statistical errors of correlations:
8061 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1);
8062 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2);
8063 // Reduced correlations:
8064 Double_t twoReduced = 0.; // <<2'>>
8065 Double_t fourReduced = 0.; // <<4'>>
8066 // Statistical errors of reduced correlations:
8067 Double_t twoReducedError = 0.;
8068 Double_t fourReducedError = 0.;
8070 Double_t wCovTwoFour = 0.; // Cov(<2>,<4>) * prefactor(<2>,<4>)
8071 if(!fForgetAboutCovariances)
8073 wCovTwoFour = fIntFlowCovariances->GetBinContent(1); // Cov(<2>,<4>) * prefactor(<2>,<4>)
8075 Double_t wCovTwoTwoReduced = 0.; // Cov(<2>,<2'>) * prefactor(<2>,<2'>)
8076 Double_t wCovTwoFourReduced = 0.; // Cov(<2>,<4'>) * prefactor(<2>,<4'>)
8077 Double_t wCovFourTwoReduced = 0.; // Cov(<4>,<2'>) * prefactor(<4>,<2'>)
8078 Double_t wCovFourFourReduced = 0.; // Cov(<4>,<4'>) * prefactor(<4>,<4'>)
8079 Double_t wCovTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>) * prefactor(<2'>,<4'>)
8080 // Differential flow:
8081 Double_t v2Prime = 0.; // v'{2}
8082 Double_t v4Prime = 0.; // v'{4}
8083 // Statistical error of differential flow:
8084 Double_t v2PrimeError = 0.;
8085 Double_t v4PrimeError = 0.;
8086 // Squared statistical error of differential flow:
8087 Double_t v2PrimeErrorSquared = 0.;
8088 Double_t v4PrimeErrorSquared = 0.;
8089 // Loop over pt or eta bins:
8090 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
8092 // Reduced correlations and statistical errors:
8093 twoReduced = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b);
8094 twoReducedError = fDiffFlowCorrelationsHist[t][pe][0]->GetBinError(b);
8095 fourReduced = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b);
8096 fourReducedError = fDiffFlowCorrelationsHist[t][pe][1]->GetBinError(b);
8098 if(!fForgetAboutCovariances)
8100 wCovTwoTwoReduced = fDiffFlowCovariances[t][pe][0]->GetBinContent(b);
8101 wCovTwoFourReduced = fDiffFlowCovariances[t][pe][1]->GetBinContent(b);
8102 wCovFourTwoReduced = fDiffFlowCovariances[t][pe][2]->GetBinContent(b);
8103 wCovFourFourReduced = fDiffFlowCovariances[t][pe][3]->GetBinContent(b);
8104 wCovTwoReducedFourReduced = fDiffFlowCovariances[t][pe][4]->GetBinContent(b);
8106 // Differential flow:
8110 v2Prime = twoReduced/pow(two,0.5);
8111 v2PrimeErrorSquared = (1./4.)*pow(two,-3.)*(pow(twoReduced,2.)*pow(twoError,2.)
8112 + 4.*pow(two,2.)*pow(twoReducedError,2.)
8113 - 4.*two*twoReduced*wCovTwoTwoReduced);
8114 if(v2PrimeErrorSquared>0.){v2PrimeError = pow(v2PrimeErrorSquared,0.5);}
8115 if(TMath::Abs(v2Prime)>0.)
8117 fDiffFlow[t][pe][0]->SetBinContent(b,v2Prime);
8118 fDiffFlow[t][pe][0]->SetBinError(b,v2PrimeError);
8120 } // end of if(two>0.)
8121 // differential flow:
8123 if(2.*pow(two,2.)-four > 0.)
8125 v4Prime = (2.*two*twoReduced-fourReduced)/pow(2.*pow(two,2.)-four,3./4.);
8126 v4PrimeErrorSquared = pow(2.*pow(two,2.)-four,-7./2.)
8127 * (pow(2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced,2.)*pow(twoError,2.)
8128 + (9./16.)*pow(2.*two*twoReduced-fourReduced,2.)*pow(fourError,2.)
8129 + 4.*pow(two,2.)*pow(2.*pow(two,2.)-four,2.)*pow(twoReducedError,2.)
8130 + pow(2.*pow(two,2.)-four,2.)*pow(fourReducedError,2.)
8131 - (3./2.)*(2.*two*twoReduced-fourReduced)
8132 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoFour
8133 - 4.*two*(2.*pow(two,2.)-four)
8134 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoTwoReduced
8135 + 2.*(2.*pow(two,2.)-four)
8136 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoFourReduced
8137 + 3.*two*(2.*pow(two,2.)-four)*(2.*two*twoReduced-fourReduced)*wCovFourTwoReduced
8138 - (3./2.)*(2.*pow(two,2.)-four)*(2.*two*twoReduced-fourReduced)*wCovFourFourReduced
8139 - 4.*two*pow(2.*pow(two,2.)-four,2.)*wCovTwoReducedFourReduced);
8140 if(v4PrimeErrorSquared>0.){v4PrimeError = pow(v4PrimeErrorSquared,0.5);}
8141 if(TMath::Abs(v4Prime)>0.)
8143 fDiffFlow[t][pe][1]->SetBinContent(b,v4Prime);
8144 fDiffFlow[t][pe][1]->SetBinError(b,v4PrimeError);
8146 } // end of if(2.*pow(two,2.)-four > 0.)
8147 } // end of for(Int_t b=1;b<=fnBinsPtEta[pe];b++)
8149 } // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlow(TString type, Bool_t useParticleWeights)
8151 //================================================================================================================================
8153 void AliFlowAnalysisWithQCumulants::Calculate2DDiffFlow(TString type)
8155 // Calculate final results for 2D diferential flow.
8157 // to be improved - check pointers used in this method
8159 Int_t t = 0; // RP or POI
8164 } else if(type == "POI")
8169 // Differential flow:
8170 Double_t v2Prime = 0.; // v'{2}
8171 Double_t v4Prime = 0.; // v'{4}
8172 // Differential cumulants:
8173 Double_t qc2Prime = 0.; // QC{2'}
8174 Double_t qc4Prime = 0.; // QC{4'}
8175 // Looping over all (pt,eta) bins and calculating differential flow:
8176 for(Int_t p=1;p<=fnBinsPt;p++)
8178 for(Int_t e=1;e<=fnBinsEta;e++)
8181 qc2Prime = f2DDiffFlowCumulants[t][0]->GetBinContent(f2DDiffFlowCumulants[t][0]->GetBin(p,e));
8184 v2Prime = pow(qc2Prime,0.5);
8185 f2DDiffFlow[t][0]->SetBinContent(f2DDiffFlow[t][0]->GetBin(p,e),v2Prime);
8188 qc4Prime = f2DDiffFlowCumulants[t][1]->GetBinContent(f2DDiffFlowCumulants[t][1]->GetBin(p,e));
8191 v4Prime = pow(-1.*qc4Prime,1./4.);
8192 f2DDiffFlow[t][1]->SetBinContent(f2DDiffFlow[t][1]->GetBin(p,e),v4Prime);
8194 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
8195 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
8197 } // end of void AliFlowAnalysisWithQCumulants::Calculate2DDiffFlow(TString type)
8199 //================================================================================================================================
8201 void AliFlowAnalysisWithQCumulants::StoreIntFlowFlags()
8203 // a) Store all flags for integrated flow in profile fIntFlowFlags.
8207 cout<<"WARNING: fIntFlowFlags is NULL in AFAWQC::SFFIF() !!!!"<<endl;
8211 // particle weights used or not:
8212 fIntFlowFlags->Fill(0.5,(Int_t)fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights);
8213 // which event weights were used:
8214 if(strcmp(fMultiplicityWeight->Data(),"combinations"))
8216 fIntFlowFlags->Fill(1.5,0); // 0 = "combinations" (default)
8217 } else if(strcmp(fMultiplicityWeight->Data(),"unit"))
8219 fIntFlowFlags->Fill(1.5,1); // 1 = "unit"
8220 } else if(strcmp(fMultiplicityWeight->Data(),"multiplicity"))
8222 fIntFlowFlags->Fill(1.5,2); // 2 = "multiplicity"
8224 fIntFlowFlags->Fill(2.5,(Int_t)fApplyCorrectionForNUA);
8225 fIntFlowFlags->Fill(3.5,(Int_t)fPrintFinalResults[0]);
8226 fIntFlowFlags->Fill(4.5,(Int_t)fPrintFinalResults[1]);
8227 fIntFlowFlags->Fill(5.5,(Int_t)fPrintFinalResults[2]);
8228 fIntFlowFlags->Fill(6.5,(Int_t)fPrintFinalResults[3]);
8229 fIntFlowFlags->Fill(7.5,(Int_t)fApplyCorrectionForNUAVsM);
8230 fIntFlowFlags->Fill(8.5,(Int_t)fPropagateErrorAlsoFromNIT);
8231 fIntFlowFlags->Fill(9.5,(Int_t)fCalculateCumulantsVsM);
8232 fIntFlowFlags->Fill(10.5,(Int_t)fMinimumBiasReferenceFlow);
8233 fIntFlowFlags->Fill(11.5,(Int_t)fForgetAboutCovariances);
8234 fIntFlowFlags->Fill(12.5,(Int_t)fStorePhiDistributionForOneEvent);
8235 fIntFlowFlags->Fill(13.5,(Int_t)fFillMultipleControlHistograms);
8236 fIntFlowFlags->Fill(14.5,(Int_t)fCalculateAllCorrelationsVsM);
8237 } // end of void AliFlowAnalysisWithQCumulants::StoreIntFlowFlags()
8239 //================================================================================================================================
8241 void AliFlowAnalysisWithQCumulants::StoreDiffFlowFlags()
8243 // Store all flags for differential flow in the profile fDiffFlowFlags.
8247 printf("\n WARNING (QC): fDiffFlowFlags is NULL in AFAWQC::SDFF() !!!!\n\n");
8251 fDiffFlowFlags->Fill(0.5,fCalculateDiffFlow); // calculate differential flow
8252 fDiffFlowFlags->Fill(1.5,fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights); // particle weights used or not?
8253 //fDiffFlowFlags->Fill(2.5,""); // which event weight was used? ("combinations", "unit" or "multiplicity") to be improved - finalized
8254 fDiffFlowFlags->Fill(3.5,fApplyCorrectionForNUA); // corrected for non-uniform acceptance or not
8255 fDiffFlowFlags->Fill(4.5,fCalculate2DDiffFlow); // calculate also 2D differential flow vs (pt,eta)
8256 fDiffFlowFlags->Fill(5.5,fCalculateDiffFlowVsEta); // if you set kFALSE only differential flow vs pt is calculated
8258 } // end of void AliFlowAnalysisWithQCumulants::StoreDiffFlowFlags()
8260 //================================================================================================================================
8262 void AliFlowAnalysisWithQCumulants::GetPointersForCommonHistograms()
8264 // Access all pointers to common control and common result histograms and profiles.
8266 TString sCommonConstantsName = "fCommonConstants";
8267 sCommonConstantsName += fAnalysisLabel->Data();
8268 fCommonConstants = dynamic_cast<TProfile*>(fHistList->FindObject(sCommonConstantsName.Data()));
8269 if(!fCommonConstants)
8271 printf("\n WARNING (QC): fCommonConstants is NULL in AFAWQC::GPFCH() !!!!\n\n");
8275 // to be improved - lines bellow can be implemented better.
8277 TString commonHistsName = "AliFlowCommonHistQC";
8278 commonHistsName += fAnalysisLabel->Data();
8279 AliFlowCommonHist *commonHist = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHistsName.Data()));
8282 this->SetCommonHists(commonHist);
8283 if(fCommonHists->GetHarmonic())
8285 fHarmonic = (Int_t)(fCommonHists->GetHarmonic())->GetBinContent(1);
8287 } // end of if(commonHist)
8288 TString commonHists2ndOrderName = "AliFlowCommonHist2ndOrderQC";
8289 commonHists2ndOrderName += fAnalysisLabel->Data();
8290 AliFlowCommonHist *commonHist2nd = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists2ndOrderName.Data()));
8291 if(commonHist2nd) this->SetCommonHists2nd(commonHist2nd);
8292 TString commonHists4thOrderName = "AliFlowCommonHist4thOrderQC";
8293 commonHists4thOrderName += fAnalysisLabel->Data();
8294 AliFlowCommonHist *commonHist4th = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists4thOrderName.Data()));
8295 if(commonHist4th) this->SetCommonHists4th(commonHist4th);
8296 TString commonHists6thOrderName = "AliFlowCommonHist6thOrderQC";
8297 commonHists6thOrderName += fAnalysisLabel->Data();
8298 AliFlowCommonHist *commonHist6th = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists6thOrderName.Data()));
8299 if(commonHist6th) this->SetCommonHists6th(commonHist6th);
8300 TString commonHists8thOrderName = "AliFlowCommonHist8thOrderQC";
8301 commonHists8thOrderName += fAnalysisLabel->Data();
8302 AliFlowCommonHist *commonHist8th = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists8thOrderName.Data()));
8303 if(commonHist8th) this->SetCommonHists8th(commonHist8th);
8305 TString commonHistResults2ndOrderName = "AliFlowCommonHistResults2ndOrderQC";
8306 commonHistResults2ndOrderName += fAnalysisLabel->Data();
8307 AliFlowCommonHistResults *commonHistRes2nd = dynamic_cast<AliFlowCommonHistResults*>
8308 (fHistList->FindObject(commonHistResults2ndOrderName.Data()));
8309 if(commonHistRes2nd) this->SetCommonHistsResults2nd(commonHistRes2nd);
8310 TString commonHistResults4thOrderName = "AliFlowCommonHistResults4thOrderQC";
8311 commonHistResults4thOrderName += fAnalysisLabel->Data();
8312 AliFlowCommonHistResults *commonHistRes4th = dynamic_cast<AliFlowCommonHistResults*>
8313 (fHistList->FindObject(commonHistResults4thOrderName.Data()));
8314 if(commonHistRes4th) this->SetCommonHistsResults4th(commonHistRes4th);
8315 TString commonHistResults6thOrderName = "AliFlowCommonHistResults6thOrderQC";
8316 commonHistResults6thOrderName += fAnalysisLabel->Data();
8317 AliFlowCommonHistResults *commonHistRes6th = dynamic_cast<AliFlowCommonHistResults*>
8318 (fHistList->FindObject(commonHistResults6thOrderName.Data()));
8319 if(commonHistRes6th) this->SetCommonHistsResults6th(commonHistRes6th);
8320 TString commonHistResults8thOrderName = "AliFlowCommonHistResults8thOrderQC";
8321 commonHistResults8thOrderName += fAnalysisLabel->Data();
8322 AliFlowCommonHistResults *commonHistRes8th = dynamic_cast<AliFlowCommonHistResults*>
8323 (fHistList->FindObject(commonHistResults8thOrderName.Data()));
8324 if(commonHistRes8th) this->SetCommonHistsResults8th(commonHistRes8th);
8326 } // end of void AliFlowAnalysisWithQCumulants::GetPointersForCommonHistograms()
8328 //================================================================================================================================
8330 void AliFlowAnalysisWithQCumulants::GetPointersForParticleWeightsHistograms()
8332 // Get pointers for histograms with particle weights.
8334 TList *weightsList = dynamic_cast<TList*>(fHistList->FindObject("Weights"));
8335 if(!weightsList){printf("\n WARNING (QC): weightsList is NULL in AFAWQC::GPFPWH() !!!!\n");exit(0);}
8336 this->SetWeightsList(weightsList);
8337 TString fUseParticleWeightsName = "fUseParticleWeightsQC"; // to be improved (hirdwired label QC)
8338 fUseParticleWeightsName += fAnalysisLabel->Data();
8339 TProfile *useParticleWeights = dynamic_cast<TProfile*>(weightsList->FindObject(fUseParticleWeightsName.Data()));
8340 if(useParticleWeights)
8342 this->SetUseParticleWeights(useParticleWeights);
8343 fUsePhiWeights = (Int_t)fUseParticleWeights->GetBinContent(1);
8344 fUsePtWeights = (Int_t)fUseParticleWeights->GetBinContent(2);
8345 fUseEtaWeights = (Int_t)fUseParticleWeights->GetBinContent(3);
8346 fUseTrackWeights = (Int_t)fUseParticleWeights->GetBinContent(4);
8348 } // end of void AliFlowAnalysisWithQCumulants::GetPointersForParticleWeightsHistograms();
8350 //================================================================================================================================
8352 void AliFlowAnalysisWithQCumulants::GetPointersForIntFlowHistograms()
8354 // Get pointers for histograms and profiles relevant for integrated flow:
8355 // a) Get pointer to base list for integrated flow holding profile fIntFlowFlags and lists fIntFlowProfiles and fIntFlowResults.
8356 // b) Get pointer to profile fIntFlowFlags holding all flags for integrated flow.
8357 // c) Get pointer to list fIntFlowProfiles and pointers to all objects that she holds.
8358 // d) Get pointer to list fIntFlowResults and pointers to all objects that she holds.
8360 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data member?)
8361 TString powerFlag[2] = {"linear","quadratic"}; // to be improved (should I promote this to data member?)
8362 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?)
8363 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?)
8365 // a) Get pointer to base list for integrated flow holding profile fIntFlowFlags and lists fIntFlowProfiles and fIntFlowResults:
8366 TList *intFlowList = NULL;
8367 intFlowList = dynamic_cast<TList*>(fHistList->FindObject("Integrated Flow"));
8370 cout<<"WARNING: intFlowList is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8374 // b) Get pointer to profile fIntFlowFlags holding all flags for integrated flow:
8375 TString intFlowFlagsName = "fIntFlowFlags";
8376 intFlowFlagsName += fAnalysisLabel->Data();
8377 TProfile *intFlowFlags = dynamic_cast<TProfile*>(intFlowList->FindObject(intFlowFlagsName.Data()));
8380 this->SetIntFlowFlags(intFlowFlags);
8381 fApplyCorrectionForNUA = (Bool_t)intFlowFlags->GetBinContent(3);
8382 fApplyCorrectionForNUAVsM = (Bool_t)intFlowFlags->GetBinContent(8);
8383 fCalculateCumulantsVsM = (Bool_t)intFlowFlags->GetBinContent(10);
8386 cout<<"WARNING: intFlowFlags is NULL in FAWQC::GPFIFH() !!!!"<<endl;
8389 // c) Get pointer to list fIntFlowProfiles and pointers to all objects that she holds:
8390 TList *intFlowProfiles = NULL;
8391 intFlowProfiles = dynamic_cast<TList*>(intFlowList->FindObject("Profiles"));
8394 // average multiplicities:
8395 TString avMultiplicityName = "fAvMultiplicity";
8396 avMultiplicityName += fAnalysisLabel->Data();
8397 TProfile *avMultiplicity = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(avMultiplicityName.Data()));
8400 this->SetAvMultiplicity(avMultiplicity);
8403 cout<<"WARNING: avMultiplicity is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8405 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with wrong errors!):
8406 TString intFlowCorrelationsProName = "fIntFlowCorrelationsPro";
8407 intFlowCorrelationsProName += fAnalysisLabel->Data();
8408 TProfile *intFlowCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowCorrelationsProName.Data()));
8409 if(intFlowCorrelationsPro)
8411 this->SetIntFlowCorrelationsPro(intFlowCorrelationsPro);
8414 cout<<"WARNING: intFlowCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8416 // average squared correlations <<2>^2>, <<4>^2>, <<6>^2> and <<8^2>>:
8417 TString intFlowSquaredCorrelationsProName = "fIntFlowSquaredCorrelationsPro";
8418 intFlowSquaredCorrelationsProName += fAnalysisLabel->Data();
8419 TProfile *intFlowSquaredCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowSquaredCorrelationsProName.Data()));
8420 if(intFlowSquaredCorrelationsPro)
8422 this->SetIntFlowSquaredCorrelationsPro(intFlowSquaredCorrelationsPro);
8425 cout<<"WARNING: intFlowSquaredCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8427 if(fCalculateCumulantsVsM)
8429 // Average correlations <<2>>, <<4>>, <<6>> and <<8>> versus multiplicity for all events (error is wrong here):
8430 TString intFlowCorrelationsVsMProName = "fIntFlowCorrelationsVsMPro";
8431 intFlowCorrelationsVsMProName += fAnalysisLabel->Data();
8432 for(Int_t ci=0;ci<4;ci++) // correlation index
8434 TProfile *intFlowCorrelationsVsMPro = dynamic_cast<TProfile*>
8435 (intFlowProfiles->FindObject(Form("%s, %s",intFlowCorrelationsVsMProName.Data(),correlationFlag[ci].Data())));
8436 if(intFlowCorrelationsVsMPro)
8438 this->SetIntFlowCorrelationsVsMPro(intFlowCorrelationsVsMPro,ci);
8441 cout<<"WARNING: "<<Form("intFlowCorrelationsVsMPro[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8443 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
8444 // Average squared correlations <<2>^2>, <<4>^2>, <<6>^2> and <<8>^2> versus multiplicity for all events:
8445 TString intFlowSquaredCorrelationsVsMProName = "fIntFlowSquaredCorrelationsVsMPro";
8446 intFlowSquaredCorrelationsVsMProName += fAnalysisLabel->Data();
8447 for(Int_t ci=0;ci<4;ci++) // correlation index
8449 TProfile *intFlowSquaredCorrelationsVsMPro = dynamic_cast<TProfile*>
8450 (intFlowProfiles->FindObject(Form("%s, %s",intFlowSquaredCorrelationsVsMProName.Data(),squaredCorrelationFlag[ci].Data())));
8451 if(intFlowSquaredCorrelationsVsMPro)
8453 this->SetIntFlowSquaredCorrelationsVsMPro(intFlowSquaredCorrelationsVsMPro,ci);
8456 cout<<"WARNING: "<<Form("intFlowSquaredCorrelationsVsMPro[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8458 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
8459 } // end of if(fCalculateCumulantsVsM)
8460 // average all correlations for integrated flow (with wrong errors!):
8461 TString intFlowCorrelationsAllProName = "fIntFlowCorrelationsAllPro";
8462 intFlowCorrelationsAllProName += fAnalysisLabel->Data();
8463 TProfile *intFlowCorrelationsAllPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowCorrelationsAllProName.Data()));
8464 if(intFlowCorrelationsAllPro)
8466 this->SetIntFlowCorrelationsAllPro(intFlowCorrelationsAllPro);
8469 cout<<"WARNING: intFlowCorrelationsAllPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8471 // average extra correlations for integrated flow (which appear only when particle weights are used):
8472 // (to be improved: Weak point in implementation, I am assuming here that method GetPointersForParticleWeightsHistograms() was called)
8473 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights)
8475 TString intFlowExtraCorrelationsProName = "fIntFlowExtraCorrelationsPro";
8476 intFlowExtraCorrelationsProName += fAnalysisLabel->Data();
8477 TProfile *intFlowExtraCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowExtraCorrelationsProName.Data()));
8478 if(intFlowExtraCorrelationsPro)
8480 this->SetIntFlowExtraCorrelationsPro(intFlowExtraCorrelationsPro);
8483 cout<<"WARNING: intFlowExtraCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8485 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights)
8486 // average products of correlations <2>, <4>, <6> and <8>:
8487 TString intFlowProductOfCorrelationsProName = "fIntFlowProductOfCorrelationsPro";
8488 intFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
8489 TProfile *intFlowProductOfCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowProductOfCorrelationsProName.Data()));
8490 if(intFlowProductOfCorrelationsPro)
8492 this->SetIntFlowProductOfCorrelationsPro(intFlowProductOfCorrelationsPro);
8495 cout<<"WARNING: intFlowProductOfCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8497 // average product of correlations <2>, <4>, <6> and <8> versus multiplicity
8498 // [0=<<2><4>>,1=<<2><6>>,2=<<2><8>>,3=<<4><6>>,4=<<4><8>>,5=<<6><8>>]
8499 if(fCalculateCumulantsVsM)
8501 TString intFlowProductOfCorrelationsVsMProName = "fIntFlowProductOfCorrelationsVsMPro";
8502 intFlowProductOfCorrelationsVsMProName += fAnalysisLabel->Data();
8503 TString productFlag[6] = {"#LT#LT2#GT#LT4#GT#GT","#LT#LT2#GT#LT6#GT#GT","#LT#LT2#GT#LT8#GT#GT",
8504 "#LT#LT4#GT#LT6#GT#GT","#LT#LT4#GT#LT8#GT#GT","#LT#LT6#GT#LT8#GT#GT"};
8505 for(Int_t pi=0;pi<6;pi++)
8507 TProfile *intFlowProductOfCorrelationsVsMPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(Form("%s, %s",intFlowProductOfCorrelationsVsMProName.Data(),productFlag[pi].Data())));
8508 if(intFlowProductOfCorrelationsVsMPro)
8510 this->SetIntFlowProductOfCorrelationsVsMPro(intFlowProductOfCorrelationsVsMPro,pi);
8513 cout<<"WARNING: "<<Form("intFlowProductOfCorrelationsVsMPro[%d]",pi)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8515 } // end of for(Int_t pi=0;pi<6;pi++)
8516 } // end of if(fCalculateCumulantsVsM)
8517 // average correction terms for non-uniform acceptance (with wrong errors!):
8518 for(Int_t sc=0;sc<2;sc++)
8520 TString intFlowCorrectionTermsForNUAProName = "fIntFlowCorrectionTermsForNUAPro";
8521 intFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
8522 TProfile *intFlowCorrectionTermsForNUAPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject((Form("%s: %s terms",intFlowCorrectionTermsForNUAProName.Data(),sinCosFlag[sc].Data()))));
8523 if(intFlowCorrectionTermsForNUAPro)
8525 this->SetIntFlowCorrectionTermsForNUAPro(intFlowCorrectionTermsForNUAPro,sc);
8528 cout<<"WARNING: intFlowCorrectionTermsForNUAPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8529 cout<<"sc = "<<sc<<endl;
8531 // versus multiplicity:
8532 if(fCalculateCumulantsVsM)
8534 TString correctionTermFlag[4] = {"(n(phi1))","(n(phi1+phi2))","(n(phi1-phi2-phi3))","(n(2phi1-phi2))"}; // to be improved - hardwired 4
8535 TString intFlowCorrectionTermsForNUAVsMProName = "fIntFlowCorrectionTermsForNUAVsMPro";
8536 intFlowCorrectionTermsForNUAVsMProName += fAnalysisLabel->Data();
8537 for(Int_t ci=0;ci<4;ci++) // correction term index (to be improved - hardwired 4)
8539 TProfile *intFlowCorrectionTermsForNUAVsMPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(Form("%s: #LT#LT%s%s#GT#GT",intFlowCorrectionTermsForNUAVsMProName.Data(),sinCosFlag[sc].Data(),correctionTermFlag[ci].Data())));
8540 if(intFlowCorrectionTermsForNUAVsMPro)
8542 this->SetIntFlowCorrectionTermsForNUAVsMPro(intFlowCorrectionTermsForNUAVsMPro,sc,ci);
8545 cout<<"WARNING: intFlowCorrectionTermsForNUAVsMPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8546 cout<<"sc = "<<sc<<endl;
8547 cout<<"ci = "<<ci<<endl;
8549 } // end of for(Int_t ci=0;ci<4;ci++) // correction term index (to be improved - hardwired 4)
8550 } // end of if(fCalculateCumulantsVsM)
8551 } // end of for(Int_t sc=0;sc<2;sc++)
8552 // average products of correction terms for NUA:
8553 TString intFlowProductOfCorrectionTermsForNUAProName = "fIntFlowProductOfCorrectionTermsForNUAPro";
8554 intFlowProductOfCorrectionTermsForNUAProName += fAnalysisLabel->Data();
8555 TProfile *intFlowProductOfCorrectionTermsForNUAPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowProductOfCorrectionTermsForNUAProName.Data()));
8556 if(intFlowProductOfCorrectionTermsForNUAPro)
8558 this->SetIntFlowProductOfCorrectionTermsForNUAPro(intFlowProductOfCorrectionTermsForNUAPro);
8561 cout<<"WARNING: intFlowProductOfCorrectionTermsForNUAPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8563 } else // to if(intFlowProfiles)
8565 cout<<"WARNING: intFlowProfiles is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8568 // d) Get pointer to list fIntFlowResults and pointers to all objects that she holds.
8569 TList *intFlowResults = NULL;
8570 intFlowResults = dynamic_cast<TList*>(intFlowList->FindObject("Results"));
8573 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with correct errors!):
8574 TString intFlowCorrelationsHistName = "fIntFlowCorrelationsHist";
8575 intFlowCorrelationsHistName += fAnalysisLabel->Data();
8576 TH1D *intFlowCorrelationsHist = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCorrelationsHistName.Data()));
8577 if(intFlowCorrelationsHist)
8579 this->SetIntFlowCorrelationsHist(intFlowCorrelationsHist);
8582 cout<<"WARNING: intFlowCorrelationsHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8584 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with correct errors!) vs M:
8585 if(fCalculateCumulantsVsM)
8587 TString intFlowCorrelationsVsMHistName = "fIntFlowCorrelationsVsMHist";
8588 intFlowCorrelationsVsMHistName += fAnalysisLabel->Data();
8589 for(Int_t ci=0;ci<4;ci++) // correlation index
8591 TH1D *intFlowCorrelationsVsMHist = dynamic_cast<TH1D*>
8592 (intFlowResults->FindObject(Form("%s, %s",intFlowCorrelationsVsMHistName.Data(),correlationFlag[ci].Data())));
8593 if(intFlowCorrelationsVsMHist)
8595 this->SetIntFlowCorrelationsVsMHist(intFlowCorrelationsVsMHist,ci);
8598 cout<<"WARNING: "<<Form("intFlowCorrelationsVsMHist[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8600 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
8601 } // end of if(fCalculateCumulantsVsM)
8602 // average all correlations for integrated flow (with correct errors!):
8603 TString intFlowCorrelationsAllHistName = "fIntFlowCorrelationsAllHist";
8604 intFlowCorrelationsAllHistName += fAnalysisLabel->Data();
8605 TH1D *intFlowCorrelationsAllHist = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCorrelationsAllHistName.Data()));
8606 if(intFlowCorrelationsAllHist)
8608 this->SetIntFlowCorrelationsAllHist(intFlowCorrelationsAllHist);
8611 cout<<"WARNING: intFlowCorrelationsAllHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8613 // average correction terms for non-uniform acceptance (with correct errors!):
8614 TString intFlowCorrectionTermsForNUAHistName = "fIntFlowCorrectionTermsForNUAHist";
8615 intFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
8616 for(Int_t sc=0;sc<2;sc++)
8618 TH1D *intFlowCorrectionTermsForNUAHist = dynamic_cast<TH1D*>(intFlowResults->FindObject((Form("%s: %s terms",intFlowCorrectionTermsForNUAHistName.Data(),sinCosFlag[sc].Data()))));
8619 if(intFlowCorrectionTermsForNUAHist)
8621 this->SetIntFlowCorrectionTermsForNUAHist(intFlowCorrectionTermsForNUAHist,sc);
8624 cout<<"WARNING: intFlowCorrectionTermsForNUAHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8625 cout<<"sc = "<<sc<<endl;
8627 } // end of for(Int_t sc=0;sc<2;sc++)
8628 // covariances (multiplied with weight dependent prefactor):
8629 TString intFlowCovariancesName = "fIntFlowCovariances";
8630 intFlowCovariancesName += fAnalysisLabel->Data();
8631 TH1D *intFlowCovariances = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCovariancesName.Data()));
8632 if(intFlowCovariances)
8634 this->SetIntFlowCovariances(intFlowCovariances);
8637 cout<<"WARNING: intFlowCovariances is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8639 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8>:
8640 TString intFlowSumOfEventWeightsName = "fIntFlowSumOfEventWeights";
8641 intFlowSumOfEventWeightsName += fAnalysisLabel->Data();
8642 for(Int_t power=0;power<2;power++)
8644 TH1D *intFlowSumOfEventWeights = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s: %s",intFlowSumOfEventWeightsName.Data(),powerFlag[power].Data())));
8645 if(intFlowSumOfEventWeights)
8647 this->SetIntFlowSumOfEventWeights(intFlowSumOfEventWeights,power);
8650 cout<<"WARNING: intFlowSumOfEventWeights is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8651 cout<<"power = "<<power<<endl;
8653 } // end of for(Int_t power=0;power<2;power++)
8654 // sum of products of event weights for correlations <2>, <4>, <6> and <8>:
8655 TString intFlowSumOfProductOfEventWeightsName = "fIntFlowSumOfProductOfEventWeights";
8656 intFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
8657 TH1D *intFlowSumOfProductOfEventWeights = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowSumOfProductOfEventWeightsName.Data()));
8658 if(intFlowSumOfProductOfEventWeights)
8660 this->SetIntFlowSumOfProductOfEventWeights(intFlowSumOfProductOfEventWeights);
8663 cout<<"WARNING: intFlowSumOfProductOfEventWeights is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8665 // final result for covariances of correlations (multiplied with weight dependent prefactor) versus M
8666 // [0=Cov(2,4),1=Cov(2,6),2=Cov(2,8),3=Cov(4,6),4=Cov(4,8),5=Cov(6,8)]:
8667 if(fCalculateCumulantsVsM)
8669 TString intFlowCovariancesVsMName = "fIntFlowCovariancesVsM";
8670 intFlowCovariancesVsMName += fAnalysisLabel->Data();
8671 TString covarianceFlag[6] = {"Cov(<2>,<4>)","Cov(<2>,<6>)","Cov(<2>,<8>)","Cov(<4>,<6>)","Cov(<4>,<8>)","Cov(<6>,<8>)"};
8672 for(Int_t ci=0;ci<6;ci++)
8674 TH1D *intFlowCovariancesVsM = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s, %s",intFlowCovariancesVsMName.Data(),covarianceFlag[ci].Data())));
8675 if(intFlowCovariancesVsM)
8677 this->SetIntFlowCovariancesVsM(intFlowCovariancesVsM,ci);
8680 cout<<"WARNING: "<<Form("intFlowCovariancesVsM[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8682 } // end of for(Int_t ci=0;ci<6;ci++)
8683 } // end of if(fCalculateCumulantsVsM)
8684 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8> versus multiplicity
8685 // [0=sum{w_{<2>}},1=sum{w_{<4>}},2=sum{w_{<6>}},3=sum{w_{<8>}}][0=linear 1,1=quadratic]:
8686 if(fCalculateCumulantsVsM)
8688 TString intFlowSumOfEventWeightsVsMName = "fIntFlowSumOfEventWeightsVsM";
8689 intFlowSumOfEventWeightsVsMName += fAnalysisLabel->Data();
8690 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>}"},
8691 {"#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}"}};
8692 for(Int_t si=0;si<4;si++)
8694 for(Int_t power=0;power<2;power++)
8696 TH1D *intFlowSumOfEventWeightsVsM = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s, %s",intFlowSumOfEventWeightsVsMName.Data(),sumFlag[power][si].Data())));
8697 if(intFlowSumOfEventWeightsVsM)
8699 this->SetIntFlowSumOfEventWeightsVsM(intFlowSumOfEventWeightsVsM,si,power);
8702 cout<<"WARNING: "<<Form("intFlowSumOfEventWeightsVsM[%d][%d]",si,power)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8704 } // end of for(Int_t power=0;power<2;power++)
8705 } // end of for(Int_t si=0;si<4;si++)
8706 } // end of if(fCalculateCumulantsVsM)
8707 // sum of products of event weights for correlations <2>, <4>, <6> and <8> vs M
8708 // [0=sum{w_{<2>}w_{<4>}},1=sum{w_{<2>}w_{<6>}},2=sum{w_{<2>}w_{<8>}},
8709 // 3=sum{w_{<4>}w_{<6>}},4=sum{w_{<4>}w_{<8>}},5=sum{w_{<6>}w_{<8>}}]:
8710 if(fCalculateCumulantsVsM)
8712 TString intFlowSumOfProductOfEventWeightsVsMName = "fIntFlowSumOfProductOfEventWeightsVsM";
8713 intFlowSumOfProductOfEventWeightsVsMName += fAnalysisLabel->Data();
8714 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>}",
8715 "#sum_{i=1}^{N} w_{<4>} w_{<6>}","#sum_{i=1}^{N} w_{<4>} w_{<8>}","#sum_{i=1}^{N} w_{<6>} w_{<8>}"};
8716 for(Int_t pi=0;pi<6;pi++)
8718 TH1D *intFlowSumOfProductOfEventWeightsVsM = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s, %s",intFlowSumOfProductOfEventWeightsVsMName.Data(),sopowFlag[pi].Data())));
8719 if(intFlowSumOfProductOfEventWeightsVsM)
8721 this->SetIntFlowSumOfProductOfEventWeightsVsM(intFlowSumOfProductOfEventWeightsVsM,pi);
8724 cout<<"WARNING: "<<Form("intFlowSumOfProductOfEventWeightsVsM[%d]",pi)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8726 } // end of for(Int_t pi=0;pi<6;pi++)
8727 } // end of if(fCalculateCumulantsVsM)
8728 // covariances for NUA (multiplied with weight dependent prefactor):
8729 TString intFlowCovariancesNUAName = "fIntFlowCovariancesNUA";
8730 intFlowCovariancesNUAName += fAnalysisLabel->Data();
8731 TH1D *intFlowCovariancesNUA = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCovariancesNUAName.Data()));
8732 if(intFlowCovariancesNUA)
8734 this->SetIntFlowCovariancesNUA(intFlowCovariancesNUA);
8737 cout<<"WARNING: intFlowCovariancesNUA is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8739 // sum of linear and quadratic event weights NUA terms:
8740 TString intFlowSumOfEventWeightsNUAName = "fIntFlowSumOfEventWeightsNUA";
8741 intFlowSumOfEventWeightsNUAName += fAnalysisLabel->Data();
8742 for(Int_t sc=0;sc<2;sc++)
8744 for(Int_t power=0;power<2;power++)
8746 TH1D *intFlowSumOfEventWeightsNUA = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s: %s, %s",intFlowSumOfEventWeightsNUAName.Data(),powerFlag[power].Data(),sinCosFlag[sc].Data())));
8747 if(intFlowSumOfEventWeightsNUA)
8749 this->SetIntFlowSumOfEventWeightsNUA(intFlowSumOfEventWeightsNUA,sc,power);
8752 cout<<"WARNING: intFlowSumOfEventWeightsNUA is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8753 cout<<"sc = "<<sc<<endl;
8754 cout<<"power = "<<power<<endl;
8756 } // end of for(Int_t power=0;power<2;power++)
8757 } // end of for(Int_t sc=0;sc<2;sc++)
8758 // sum of products of event weights for NUA terms:
8759 TString intFlowSumOfProductOfEventWeightsNUAName = "fIntFlowSumOfProductOfEventWeightsNUA";
8760 intFlowSumOfProductOfEventWeightsNUAName += fAnalysisLabel->Data();
8761 TH1D *intFlowSumOfProductOfEventWeightsNUA = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowSumOfProductOfEventWeightsNUAName.Data()));
8762 if(intFlowSumOfProductOfEventWeightsNUA)
8764 this->SetIntFlowSumOfProductOfEventWeightsNUA(intFlowSumOfProductOfEventWeightsNUA);
8767 cout<<"WARNING: intFlowSumOfProductOfEventWeightsNUA is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8769 // Final results for reference Q-cumulants:
8770 TString intFlowQcumulantsName = "fIntFlowQcumulants";
8771 intFlowQcumulantsName += fAnalysisLabel->Data();
8772 TH1D *intFlowQcumulants = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowQcumulantsName.Data()));
8773 if(intFlowQcumulants)
8775 this->SetIntFlowQcumulants(intFlowQcumulants);
8778 cout<<"WARNING: intFlowQcumulants is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8780 // Final results for reference Q-cumulants rebinned in M:
8781 if(fCalculateCumulantsVsM)
8783 TString intFlowQcumulantsRebinnedInMName = "fIntFlowQcumulantsRebinnedInM";
8784 intFlowQcumulantsRebinnedInMName += fAnalysisLabel->Data();
8785 TH1D *intFlowQcumulantsRebinnedInM = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowQcumulantsRebinnedInMName.Data()));
8786 if(intFlowQcumulantsRebinnedInM)
8788 this->SetIntFlowQcumulantsRebinnedInM(intFlowQcumulantsRebinnedInM);
8791 cout<<"WARNING: intFlowQcumulantsRebinnedInM is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8793 } // end of if(fCalculateCumulantsVsM)
8794 // Ratio between error squared: with/without non-isotropic terms:
8795 TString intFlowQcumulantsErrorSquaredRatioName = "fIntFlowQcumulantsErrorSquaredRatio";
8796 intFlowQcumulantsErrorSquaredRatioName += fAnalysisLabel->Data();
8797 TH1D *intFlowQcumulantsErrorSquaredRatio = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowQcumulantsErrorSquaredRatioName.Data()));
8798 if(intFlowQcumulantsErrorSquaredRatio)
8800 this->SetIntFlowQcumulantsErrorSquaredRatio(intFlowQcumulantsErrorSquaredRatio);
8803 cout<<" WARNING: intntFlowQcumulantsErrorSquaredRatio is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8805 // final results for integrated Q-cumulants versus multiplicity:
8806 TString cumulantFlag[4] = {"QC{2}","QC{4}","QC{6}","QC{8}"};
8807 if(fCalculateCumulantsVsM)
8809 TString intFlowQcumulantsVsMName = "fIntFlowQcumulantsVsM";
8810 intFlowQcumulantsVsMName += fAnalysisLabel->Data();
8811 for(Int_t co=0;co<4;co++) // cumulant order
8813 TH1D *intFlowQcumulantsVsM = dynamic_cast<TH1D*>
8814 (intFlowResults->FindObject(Form("%s, %s",intFlowQcumulantsVsMName.Data(),cumulantFlag[co].Data())));
8815 if(intFlowQcumulantsVsM)
8817 this->SetIntFlowQcumulantsVsM(intFlowQcumulantsVsM,co);
8820 cout<<"WARNING: "<<Form("intFlowQcumulantsVsM[%d]",co)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8822 } // end of for(Int_t co=0;co<4;co++) // cumulant order
8823 } // end of if(fCalculateCumulantsVsM)
8824 // Final reference flow estimates from Q-cumulants:
8825 TString intFlowName = "fIntFlow";
8826 intFlowName += fAnalysisLabel->Data();
8827 TH1D *intFlow = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowName.Data()));
8830 this->SetIntFlow(intFlow);
8833 cout<<"WARNING: intFlow is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8835 // Final reference flow estimates from Q-cumulants vs M rebinned in M:
8836 if(fCalculateCumulantsVsM)
8838 TString intFlowRebinnedInMName = "fIntFlowRebinnedInM";
8839 intFlowRebinnedInMName += fAnalysisLabel->Data();
8840 TH1D *intFlowRebinnedInM = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowRebinnedInMName.Data()));
8841 if(intFlowRebinnedInM)
8843 this->SetIntFlowRebinnedInM(intFlowRebinnedInM);
8846 cout<<"WARNING: intFlowRebinnedInM is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8848 } // end of if(fCalculateCumulantsVsM)
8849 // integrated flow from Q-cumulants versus multiplicity:
8850 if(fCalculateCumulantsVsM)
8852 TString intFlowVsMName = "fIntFlowVsM";
8853 intFlowVsMName += fAnalysisLabel->Data();
8854 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)};
8855 for(Int_t co=0;co<4;co++) // cumulant order
8857 TH1D *intFlowVsM = dynamic_cast<TH1D*>
8858 (intFlowResults->FindObject(Form("%s, %s",intFlowVsMName.Data(),flowFlag[co].Data())));
8861 this->SetIntFlowVsM(intFlowVsM,co);
8864 cout<<"WARNING: "<<Form("intFlowVsM[%d]",co)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8866 } // end of for(Int_t co=0;co<4;co++) // cumulant order
8867 } // end of if(fCalculateCumulantsVsM)
8868 // quantifying detector effects effects to correlations:
8869 TString intFlowDetectorBiasName = "fIntFlowDetectorBias";
8870 intFlowDetectorBiasName += fAnalysisLabel->Data();
8871 TH1D *intFlowDetectorBias = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowDetectorBiasName.Data()));
8872 if(intFlowDetectorBias)
8874 this->SetIntFlowDetectorBias(intFlowDetectorBias);
8877 cout<<"WARNING: intFlowDetectorBias is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8879 // quantifying detector effects effects to correlations vs multiplicity:
8880 if(fCalculateCumulantsVsM)
8882 TString intFlowDetectorBiasVsMName = "fIntFlowDetectorBiasVsM";
8883 intFlowDetectorBiasVsMName += fAnalysisLabel->Data();
8884 for(Int_t ci=0;ci<4;ci++) // correlation index
8886 TH1D *intFlowDetectorBiasVsM = dynamic_cast<TH1D*>
8887 (intFlowResults->FindObject(Form("%s for %s",intFlowDetectorBiasVsMName.Data(),cumulantFlag[ci].Data())));
8888 if(intFlowDetectorBiasVsM)
8890 this->SetIntFlowDetectorBiasVsM(intFlowDetectorBiasVsM,ci);
8893 cout<<"WARNING: "<<Form("intFlowDetectorBiasVsM[%d]",ci)<<" is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8895 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
8896 } // end of if(fCalculateCumulantsVsM)
8897 } else // to if(intFlowResults)
8899 cout<<"WARNING: intFlowResults is NULL in AFAWQC::GPFIFH() !!!!"<<endl;
8902 } // end of void AliFlowAnalysisWithQCumulants::GetPointersForIntFlowHistograms()
8904 //================================================================================================================================
8906 void AliFlowAnalysisWithQCumulants::GetPointersFor2DDiffFlowHistograms()
8908 // Get pointers for 2D differential flow histograms.
8909 // a) Check pointers used in this method;
8910 // b) Get pointers to 2D differential flow lists;
8911 // c) Get pointers to 2D differential flow profiles;
8912 // d) Get pointers to 2D differential flow histograms.
8914 // a) Check pointers used in this method:
8917 printf("\n WARNING (QC): fDiffFlowList is NULL in AFAWQC::GPF2DDFH() !!!!\n");
8918 printf(" Call method GetPointersForDiffFlowHistograms() first.\n\n");
8923 printf("\n WARNING (QC): fDiffFlowFlags is NULL in AFAWQC::GPF2DDFH() !!!!\n\n");
8924 printf(" Call method GetPointersForDiffFlowHistograms() first.\n\n");
8928 // b) Get pointers to 2D differential flow lists:
8929 this->SetCalculate2DDiffFlow((Bool_t)fDiffFlowFlags->GetBinContent(5)); // to be improved - hardwired 5
8930 if(!fCalculate2DDiffFlow){return;}
8931 TString typeFlag[2] = {"RP","POI"};
8932 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};
8933 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
8934 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
8936 TString diffFlow2DListName = "2D";
8937 diffFlow2DListName += fAnalysisLabel->Data();
8938 fDiffFlow2D = dynamic_cast<TList*>(fDiffFlowList->FindObject(diffFlow2DListName.Data()));
8941 printf("\n WARNING (QC): fDiffFlow2D is NULL in AFAWQC::GPFDFH() !!!!\n\n");
8944 // Lists holding profiles with 2D correlations:
8945 TString s2DDiffFlowCorrelationsProListName = "Profiles with 2D correlations";
8946 s2DDiffFlowCorrelationsProListName += fAnalysisLabel->Data(); // to be improved
8947 for(Int_t t=0;t<2;t++)
8949 f2DDiffFlowCorrelationsProList[t] = dynamic_cast<TList*>(fDiffFlow2D->FindObject(Form("Profiles with 2D correlations (%s)",typeFlag[t].Data())));
8950 if(!f2DDiffFlowCorrelationsProList[t])
8952 printf("\n WARNING (QC): f2DDiffFlowCorrelationsProList[%i] is NULL in AFAWQC::GPF2DFH() !!!!\n\n",t);
8955 } // end of for(Int_t t=0;t<2;t++)
8957 // c) Get pointers to 2D differential flow profiles:
8958 TString s2DDiffFlowCorrelationsProName = "f2DDiffFlowCorrelationsPro";
8959 s2DDiffFlowCorrelationsProName += fAnalysisLabel->Data();
8960 for(Int_t t=0;t<2;t++) // type: RP or POI
8962 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8964 f2DDiffFlowCorrelationsPro[t][rci] = dynamic_cast<TProfile2D*>(f2DDiffFlowCorrelationsProList[t]->FindObject(Form("%s, %s, %s",s2DDiffFlowCorrelationsProName.Data(),typeFlag[t].Data(),reducedCorrelationIndex[rci].Data())));
8965 if(!f2DDiffFlowCorrelationsPro[t][rci])
8967 printf("\n WARNING (QC): f2DDiffFlowCorrelationsPro[%i][%i] is NULL in AFAWQC::GPF2DFH() !!!!\n\n",t,rci);
8971 this->Set2DDiffFlowCorrelationsPro(f2DDiffFlowCorrelationsPro[t][rci],t,rci);
8973 } // end of for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8974 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
8976 // d) Get pointers to 2D differential flow histograms:
8977 TString s2DDiffFlowCumulantsName = "f2DDiffFlowCumulants";
8978 s2DDiffFlowCumulantsName += fAnalysisLabel->Data();
8979 TString s2DDiffFlowName = "f2DDiffFlow";
8980 s2DDiffFlowName += fAnalysisLabel->Data();
8981 for(Int_t t=0;t<2;t++) // type: RP or POI
8983 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
8985 // 2D differential cumulants:
8986 f2DDiffFlowCumulants[t][rci] = dynamic_cast<TH2D*>(f2DDiffFlowCorrelationsProList[t]->FindObject(Form("%s, %s, %s",s2DDiffFlowCumulantsName.Data(),typeFlag[t].Data(),differentialCumulantIndex[rci].Data())));
8987 if(!f2DDiffFlowCumulants[t][rci])
8989 printf("\n WARNING (QC): f2DDiffFlowCumulants[%i][%i] is NULL in AFAWQC::GPF2DFH() !!!!\n\n",t,rci);
8993 this->Set2DDiffFlowCumulants(f2DDiffFlowCumulants[t][rci],t,rci);
8995 // 2D differential flow:
8996 f2DDiffFlow[t][rci] = dynamic_cast<TH2D*>(f2DDiffFlowCorrelationsProList[t]->FindObject(Form("%s, %s, %s",s2DDiffFlowName.Data(),typeFlag[t].Data(),differentialFlowIndex[rci].Data())));
8997 if(!f2DDiffFlow[t][rci])
8999 printf("\n WARNING (QC): f2DDiffFlow[%i][%i] is NULL in AFAWQC::GPF2DFH() !!!!\n\n",t,rci);
9003 this->Set2DDiffFlow(f2DDiffFlow[t][rci],t,rci);
9005 } // end of for(Int_t rci=0;rci<4;rci++) // reduced correlation index
9006 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
9008 } // end of void AliFlowAnalysisWithQCumulants::GetPointersFor2DDiffFlowHistograms()
9010 //================================================================================================================================
9012 void AliFlowAnalysisWithQCumulants::GetPointersForOtherDiffCorrelators()
9014 // Get pointers for other differential correlators.
9015 // a) Get pointer to list with other differential correlators;
9016 // b) Declare local flags;
9017 // c) Get pointers to other differential profiles.
9019 if(!fCalculateDiffFlow){return;} // TBI: This must eventually be moved somewhere else
9021 // a) Get pointer to list with other differential correlators:
9022 fOtherDiffCorrelatorsList = dynamic_cast<TList*>(fHistList->FindObject("Other differential correlators"));
9023 if(!fOtherDiffCorrelatorsList)
9025 printf("\n WARNING (QC): fOtherDiffCorrelatorsList is NULL in AFAWQC::GPFDFH() !!!!\n\n");
9029 // b) Declare local flags: // (to be improved - promoted to data members)
9030 TString typeFlag[2] = {"RP","POI"};
9031 TString ptEtaFlag[2] = {"p_{T}","#eta"};
9032 TString sinCosFlag[2] = {"sin","cos"};
9034 // c) Get pointers to other differential profiles:
9035 TString otherDiffCorrelatorsName = "fOtherDiffCorrelators";
9036 otherDiffCorrelatorsName += fAnalysisLabel->Data();
9037 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
9039 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
9041 for(Int_t sc=0;sc<2;sc++) // sin or cos
9043 for(Int_t ci=0;ci<1;ci++) // correlator index
9045 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)));
9046 if(!fOtherDiffCorrelators[t][pe][sc][ci])
9048 printf("\n WARNING (QC): fOtherDiffCorrelators[%i][%i][%i][%i] is NULL in AFAWQC::GPFODC() !!!!\n\n",t,pe,sc,ci);
9052 this->SetOtherDiffCorrelators(fOtherDiffCorrelators[t][pe][sc][ci],t,pe,sc,ci);
9054 } // end of for(Int_t ci=0;ci<1;ci++) // correlator index
9055 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
9056 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
9057 } // end of for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
9059 } // end of void AliFlowAnalysisWithQCumulants::GetPointersForOtherDiffCorrelators()
9061 //================================================================================================================================
9063 void AliFlowAnalysisWithQCumulants::GetPointersForDiffFlowHistograms()
9065 // Get pointer to all objects relevant for differential flow.
9066 // a) Get pointer to base list for differential flow fDiffFlowList;
9067 // b) Get pointer to profile fDiffFlowFlags holding all flags for differential flow. Access and set some flags;
9068 // c) Get pointers to nested lists fDiffFlowListProfiles and fDiffFlowListResults;
9069 // d) Define flags locally (to be improved: should I promote these flags to data members?);
9070 // e) Get pointers to all nested lists in fDiffFlowListProfiles and to profiles which they hold;
9071 // f) Get pointers to all nested lists in fDiffFlowListResults and to histograms which they hold.
9073 // a) Get pointer to base list for differential flow fDiffFlowList:
9074 fDiffFlowList = dynamic_cast<TList*>(fHistList->FindObject("Differential Flow"));
9077 printf("\n WARNING (QC): fDiffFlowList is NULL in AFAWQC::GPFDFH() !!!!\n\n");
9081 // b) Get pointer to profile fDiffFlowFlags holding all flags for differential flow. Access and set some flags:
9082 TString diffFlowFlagsName = "fDiffFlowFlags";
9083 diffFlowFlagsName += fAnalysisLabel->Data();
9084 fDiffFlowFlags = dynamic_cast<TProfile*>(fDiffFlowList->FindObject(diffFlowFlagsName.Data()));
9087 this->SetCalculateDiffFlow((Bool_t)fDiffFlowFlags->GetBinContent(1)); // to be improved - hardwired 1
9088 this->SetCalculateDiffFlowVsEta((Bool_t)fDiffFlowFlags->GetBinContent(6)); // to be improved - hardwired 6
9091 printf("\n WARNING (QC): fDiffFlowFlags is NULL in AFAWQC::GPFDFH() !!!!\n\n");
9092 printf("\n Flags in method Finish() are wrong.\n\n");
9096 if(!fCalculateDiffFlow){return;} // IMPORTANT: do not move this anywhere above in this method (to be improved)
9098 // c) Get pointers to nested lists fDiffFlowListProfiles and fDiffFlowListResults:
9099 // List holding nested lists holding profiles:
9100 TList *diffFlowListProfiles = NULL;
9101 diffFlowListProfiles = dynamic_cast<TList*>(fDiffFlowList->FindObject("Profiles"));
9102 if(!diffFlowListProfiles)
9104 printf("\n WARNING (QC): diffFlowListProfiles is NULL in AFAWQC::GPFDFH() !!!!\n\n");
9107 // List holding nested lists holding histograms with final results:
9108 TList *diffFlowListResults = NULL;
9109 diffFlowListResults = dynamic_cast<TList*>(fDiffFlowList->FindObject("Results"));
9110 if(!diffFlowListResults)
9112 printf("\n WARNING (QC): diffFlowListResults is NULL in AFAWQC::GPFDFH() !!!!\n\n");
9116 // d) Define flags locally (to be improved: should I promote these flags to data members?):
9117 TString typeFlag[2] = {"RP","POI"};
9118 TString ptEtaFlag[2] = {"p_{T}","#eta"};
9119 TString powerFlag[2] = {"linear","quadratic"};
9120 TString sinCosFlag[2] = {"sin","cos"};
9121 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
9122 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
9123 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};
9124 TString reducedSquaredCorrelationIndex[4] = {"<2'>^{2}","<4'>^{2}","<6'>^{2}","<8'>^{2}"};
9125 TString mixedCorrelationIndex[8] = {"<2>","<2'>","<4>","<4'>","<6>","<6'>","<8>","<8'>"};
9126 TString covarianceName[5] = {"Cov(<2>,<2'>)","Cov(<2>,<4'>)","Cov(<4>,<2'>)","Cov(<4>,<4'>)","Cov(<2'>,<4'>)"};
9128 // e) Get pointers to all nested lists in fDiffFlowListProfiles and to profiles which they hold:
9130 TList *diffFlowCorrelationsProList[2][2] = {{NULL}};
9131 TString diffFlowCorrelationsProName = "fDiffFlowCorrelationsPro";
9132 diffFlowCorrelationsProName += fAnalysisLabel->Data();
9133 TProfile *diffFlowCorrelationsPro[2][2][4] = {{{NULL}}};
9134 // squared correlations:
9135 TString diffFlowSquaredCorrelationsProName = "fDiffFlowSquaredCorrelationsPro";
9136 diffFlowSquaredCorrelationsProName += fAnalysisLabel->Data();
9137 TProfile *diffFlowSquaredCorrelationsPro[2][2][4] = {{{NULL}}};
9138 // products of correlations:
9139 TList *diffFlowProductOfCorrelationsProList[2][2] = {{NULL}};
9140 TString diffFlowProductOfCorrelationsProName = "fDiffFlowProductOfCorrelationsPro";
9141 diffFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
9142 TProfile *diffFlowProductOfCorrelationsPro[2][2][8][8] = {{{{NULL}}}};
9144 TList *diffFlowCorrectionsProList[2][2] = {{NULL}};
9145 TString diffFlowCorrectionTermsForNUAProName = "fDiffFlowCorrectionTermsForNUAPro";
9146 diffFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
9147 TProfile *diffFlowCorrectionTermsForNUAPro[2][2][2][10] = {{{{NULL}}}};
9148 for(Int_t t=0;t<2;t++)
9150 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++)
9152 diffFlowCorrelationsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
9153 if(!diffFlowCorrelationsProList[t][pe])
9155 cout<<"WARNING: diffFlowCorrelationsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9156 cout<<"t = "<<t<<endl;
9157 cout<<"pe = "<<pe<<endl;
9160 for(Int_t ci=0;ci<4;ci++) // correlation index
9162 // reduced correlations:
9163 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())));
9164 if(diffFlowCorrelationsPro[t][pe][ci])
9166 this->SetDiffFlowCorrelationsPro(diffFlowCorrelationsPro[t][pe][ci],t,pe,ci);
9169 cout<<"WARNING: diffFlowCorrelationsPro[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9170 cout<<"t = "<<t<<endl;
9171 cout<<"pe = "<<pe<<endl;
9172 cout<<"ci = "<<ci<<endl;
9174 // reduced squared correlations:
9175 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())));
9176 if(diffFlowSquaredCorrelationsPro[t][pe][ci])
9178 this->SetDiffFlowSquaredCorrelationsPro(diffFlowSquaredCorrelationsPro[t][pe][ci],t,pe,ci);
9181 cout<<"WARNING: diffFlowSquaredCorrelationsPro[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9182 cout<<"t = "<<t<<endl;
9183 cout<<"pe = "<<pe<<endl;
9184 cout<<"ci = "<<ci<<endl;
9186 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
9187 // products of correlations:
9188 diffFlowProductOfCorrelationsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with products of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
9189 if(!diffFlowProductOfCorrelationsProList[t][pe])
9191 cout<<"WARNING: ddiffFlowProductOfCorrelationsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9192 cout<<"t = "<<t<<endl;
9193 cout<<"pe = "<<pe<<endl;
9196 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
9198 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
9200 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())));
9201 if(diffFlowProductOfCorrelationsPro[t][pe][mci1][mci2])
9203 this->SetDiffFlowProductOfCorrelationsPro(diffFlowProductOfCorrelationsPro[t][pe][mci1][mci2],t,pe,mci1,mci2);
9206 cout<<"WARNING: diffFlowProductOfCorrelationsPro[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9207 cout<<"t = "<<t<<endl;
9208 cout<<"pe = "<<pe<<endl;
9209 cout<<"mci1 = "<<mci1<<endl;
9210 cout<<"mci2 = "<<mci2<<endl;
9212 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
9213 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
9214 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
9216 diffFlowCorrectionsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
9217 if(!diffFlowCorrectionsProList[t][pe])
9219 cout<<"WARNING: diffFlowCorrectionsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9220 cout<<"t = "<<t<<endl;
9221 cout<<"pe = "<<pe<<endl;
9224 // correction terms for NUA:
9225 for(Int_t sc=0;sc<2;sc++) // sin or cos
9227 for(Int_t cti=0;cti<9;cti++) // correction term index
9229 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)));
9230 if(diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti])
9232 this->SetDiffFlowCorrectionTermsForNUAPro(diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti],t,pe,sc,cti);
9235 cout<<"WARNING: diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9236 cout<<"t = "<<t<<endl;
9237 cout<<"pe = "<<pe<<endl;
9238 cout<<"sc = "<<sc<<endl;
9239 cout<<"cti = "<<cti<<endl;
9241 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index
9242 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
9244 } // end of for(Int_t pe=0;pe<2;pe++)
9245 } // end of for(Int_t t=0;t<2;t++)
9247 // f) Get pointers to all nested lists in fDiffFlowListResults and to histograms which they hold:
9248 // reduced correlations:
9249 TList *diffFlowCorrelationsHistList[2][2] = {{NULL}};
9250 TString diffFlowCorrelationsHistName = "fDiffFlowCorrelationsHist";
9251 diffFlowCorrelationsHistName += fAnalysisLabel->Data();
9252 TH1D *diffFlowCorrelationsHist[2][2][4] = {{{NULL}}};
9253 // corrections for NUA:
9254 TList *diffFlowCorrectionsHistList[2][2] = {{NULL}};
9255 TString diffFlowCorrectionTermsForNUAHistName = "fDiffFlowCorrectionTermsForNUAHist";
9256 diffFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
9257 TH1D *diffFlowCorrectionTermsForNUAHist[2][2][2][10] = {{{{NULL}}}};
9258 // differential Q-cumulants:
9259 TList *diffFlowCumulantsHistList[2][2] = {{NULL}};
9260 TString diffFlowCumulantsName = "fDiffFlowCumulants";
9261 diffFlowCumulantsName += fAnalysisLabel->Data();
9262 TH1D *diffFlowCumulants[2][2][4] = {{{NULL}}};
9263 // detector bias to differential Q-cumulants:
9264 TList *diffFlowDetectorBiasHistList[2][2] = {{NULL}};
9265 TString diffFlowDetectorBiasName = "fDiffFlowDetectorBias";
9266 diffFlowDetectorBiasName += fAnalysisLabel->Data();
9267 TH1D *diffFlowDetectorBias[2][2][4] = {{{NULL}}};
9268 // differential flow estimates from Q-cumulants:
9269 TList *diffFlowHistList[2][2] = {{NULL}};
9270 TString diffFlowName = "fDiffFlow";
9271 diffFlowName += fAnalysisLabel->Data();
9272 TH1D *diffFlow[2][2][4] = {{{NULL}}};
9273 // differential covariances:
9274 TList *diffFlowCovariancesHistList[2][2] = {{NULL}};
9275 TString diffFlowCovariancesName = "fDiffFlowCovariances";
9276 diffFlowCovariancesName += fAnalysisLabel->Data();
9277 TH1D *diffFlowCovariances[2][2][5] = {{{NULL}}};
9278 for(Int_t t=0;t<2;t++) // type: RP or POI
9280 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
9282 // reduced correlations:
9283 diffFlowCorrelationsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
9284 if(!diffFlowCorrelationsHistList[t][pe])
9286 cout<<"WARNING: diffFlowCorrelationsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9287 cout<<"t = "<<t<<endl;
9288 cout<<"pe = "<<pe<<endl;
9291 for(Int_t index=0;index<4;index++)
9293 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())));
9294 if(diffFlowCorrelationsHist[t][pe][index])
9296 this->SetDiffFlowCorrelationsHist(diffFlowCorrelationsHist[t][pe][index],t,pe,index);
9299 cout<<"WARNING: diffFlowCorrelationsHist[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9300 cout<<"t = "<<t<<endl;
9301 cout<<"pe = "<<pe<<endl;
9302 cout<<"index = "<<index<<endl;
9305 } // end of for(Int_t index=0;index<4;index++)
9307 diffFlowCorrectionsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Histograms with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
9308 if(!diffFlowCorrectionsHistList[t][pe])
9310 cout<<"WARNING: diffFlowCorrectionsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9311 cout<<"t = "<<t<<endl;
9312 cout<<"pe = "<<pe<<endl;
9315 // correction terms for NUA:
9316 for(Int_t sc=0;sc<2;sc++) // sin or cos
9318 for(Int_t cti=0;cti<9;cti++) // correction term index
9320 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)));
9321 if(diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti])
9323 this->SetDiffFlowCorrectionTermsForNUAHist(diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti],t,pe,sc,cti);
9326 cout<<"WARNING: diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9327 cout<<"t = "<<t<<endl;
9328 cout<<"pe = "<<pe<<endl;
9329 cout<<"sc = "<<sc<<endl;
9330 cout<<"cti = "<<cti<<endl;
9332 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index
9333 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
9335 // differential Q-cumulants:
9336 diffFlowCumulantsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Differential Q-cumulants (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
9337 if(!diffFlowCumulantsHistList[t][pe])
9339 cout<<"WARNING: diffFlowCumulantsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9340 cout<<"t = "<<t<<endl;
9341 cout<<"pe = "<<pe<<endl;
9344 for(Int_t index=0;index<4;index++)
9346 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())));
9347 if(diffFlowCumulants[t][pe][index])
9349 this->SetDiffFlowCumulants(diffFlowCumulants[t][pe][index],t,pe,index);
9352 cout<<"WARNING: diffFlowCumulants[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9353 cout<<"t = "<<t<<endl;
9354 cout<<"pe = "<<pe<<endl;
9355 cout<<"index = "<<index<<endl;
9358 } // end of for(Int_t index=0;index<4;index++)
9359 // Detector bias to differential Q-cumulants:
9360 diffFlowDetectorBiasHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Detector bias (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
9361 if(!diffFlowDetectorBiasHistList[t][pe])
9363 cout<<"WARNING: diffFlowDetectorBiasHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9364 cout<<"t = "<<t<<endl;
9365 cout<<"pe = "<<pe<<endl;
9368 for(Int_t index=0;index<4;index++)
9370 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())));
9371 if(diffFlowDetectorBias[t][pe][index])
9373 this->SetDiffFlowDetectorBias(diffFlowDetectorBias[t][pe][index],t,pe,index);
9376 cout<<"WARNING: diffFlowDetectorBias[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9377 cout<<"t = "<<t<<endl;
9378 cout<<"pe = "<<pe<<endl;
9379 cout<<"index = "<<index<<endl;
9382 } // end of for(Int_t index=0;index<4;index++)
9383 // differential flow estimates from Q-cumulants:
9384 diffFlowHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Differential flow (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
9385 if(!diffFlowHistList[t][pe])
9387 cout<<"WARNING: diffFlowHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9388 cout<<"t = "<<t<<endl;
9389 cout<<"pe = "<<pe<<endl;
9392 for(Int_t index=0;index<4;index++)
9394 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())));
9395 if(diffFlow[t][pe][index])
9397 this->SetDiffFlow(diffFlow[t][pe][index],t,pe,index);
9400 cout<<"WARNING: diffFlow[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9401 cout<<"t = "<<t<<endl;
9402 cout<<"pe = "<<pe<<endl;
9403 cout<<"index = "<<index<<endl;
9406 } // end of for(Int_t index=0;index<4;index++)
9407 // differential covariances:
9408 diffFlowCovariancesHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Covariances of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
9409 if(!diffFlowCovariancesHistList[t][pe])
9411 cout<<"WARNING: diffFlowCovariancesHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9412 cout<<"t = "<<t<<endl;
9413 cout<<"pe = "<<pe<<endl;
9416 for(Int_t covIndex=0;covIndex<5;covIndex++)
9418 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())));
9419 if(diffFlowCovariances[t][pe][covIndex])
9421 this->SetDiffFlowCovariances(diffFlowCovariances[t][pe][covIndex],t,pe,covIndex);
9424 cout<<"WARNING: diffFlowCovariances[t][pe][covIndex] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9425 cout<<"t = "<<t<<endl;
9426 cout<<"pe = "<<pe<<endl;
9427 cout<<"covIndex = "<<covIndex<<endl;
9430 } // end of for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index
9431 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
9432 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
9433 // sum of event weights for reduced correlations:
9434 TList *diffFlowSumOfEventWeightsHistList[2][2][2] = {{{NULL}}};
9435 TString diffFlowSumOfEventWeightsName = "fDiffFlowSumOfEventWeights";
9436 diffFlowSumOfEventWeightsName += fAnalysisLabel->Data();
9437 TH1D *diffFlowSumOfEventWeights[2][2][2][4] = {{{{NULL}}}};
9438 for(Int_t t=0;t<2;t++) // type is RP or POI
9440 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
9442 for(Int_t p=0;p<2;p++) // power of event weights is either 1 or 2
9444 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())));
9445 if(!diffFlowSumOfEventWeightsHistList[t][pe][p])
9447 cout<<"WARNING: diffFlowSumOfEventWeightsHistList[t][pe][p] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9448 cout<<"t = "<<t<<endl;
9449 cout<<"pe = "<<pe<<endl;
9450 cout<<"power = "<<p<<endl;
9453 for(Int_t ew=0;ew<4;ew++) // index of reduced correlation
9455 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())));
9456 if(diffFlowSumOfEventWeights[t][pe][p][ew])
9458 this->SetDiffFlowSumOfEventWeights(diffFlowSumOfEventWeights[t][pe][p][ew],t,pe,p,ew);
9461 cout<<"WARNING: diffFlowSumOfEventWeights[t][pe][p][ew] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9462 cout<<"t = "<<t<<endl;
9463 cout<<"pe = "<<pe<<endl;
9464 cout<<"power = "<<p<<endl;
9465 cout<<"ew = "<<ew<<endl;
9469 } // end of for(Int_t p=0;p<2;p++) // power of event weights is either 1 or 2
9470 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
9471 } // end of for(Int_t t=0;t<2;t++) // type is RP or POI
9473 TList *diffFlowSumOfProductOfEventWeightsHistList[2][2] = {{NULL}};
9474 TString diffFlowSumOfProductOfEventWeightsName = "fDiffFlowSumOfProductOfEventWeights";
9475 diffFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
9476 TH1D *diffFlowSumOfProductOfEventWeights[2][2][8][8] = {{{{NULL}}}};
9477 for(Int_t t=0;t<2;t++) // type is RP or POI
9479 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
9481 diffFlowSumOfProductOfEventWeightsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Sum of products of event weights (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));
9482 if(!diffFlowSumOfProductOfEventWeightsHistList[t][pe])
9484 cout<<"WARNING: diffFlowSumOfProductOfEventWeightsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9485 cout<<"t = "<<t<<endl;
9486 cout<<"pe = "<<pe<<endl;
9489 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
9491 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
9493 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())));
9494 if(diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2])
9496 this->SetDiffFlowSumOfProductOfEventWeights(diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2],t,pe,mci1,mci2);
9499 cout<<"WARNING: diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
9500 cout<<"t = "<<t<<endl;
9501 cout<<"pe = "<<pe<<endl;
9502 cout<<"mci1 = "<<mci1<<endl;
9503 cout<<"mci2 = "<<mci2<<endl;
9506 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
9507 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
9508 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
9509 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
9510 } // end of for(Int_t t=0;t<2;t++) // type is RP or POI
9512 } // end void AliFlowAnalysisWithQCumulants::GetPointersForDiffFlowHistograms()
9514 //================================================================================================================================
9516 void AliFlowAnalysisWithQCumulants::BookEverythingFor2DDifferentialFlow()
9518 // Book all objects needed for 2D differential flow.
9519 // a) Define flags locally (to be improved: should I promote flags to data members?);
9520 // b) Book e-b-e quantities;
9521 // c) Book 2D profiles;
9522 // d) Book 2D histograms.
9524 if(!fCalculate2DDiffFlow){return;}
9526 // a) Define flags locally (to be improved: should I promote flags to data members?):
9527 TString typeFlag[2] = {"RP","POI"};
9528 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};
9529 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
9530 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
9532 // b) Book e-b-e quantities:
9533 TProfile2D styleRe("typeMultiplePowerRe","typeMultiplePowerRe",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
9534 TProfile2D styleIm("typeMultiplePowerIm","typeMultiplePowerIm",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
9535 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
9537 for(Int_t m=0;m<4;m++)
9539 for(Int_t k=0;k<9;k++)
9541 fReRPQ2dEBE[t][m][k] = (TProfile2D*)styleRe.Clone(Form("typeFlag%dmultiple%dpower%dRe",t,m,k));
9542 fImRPQ2dEBE[t][m][k] = (TProfile2D*)styleIm.Clone(Form("typeFlag%dmultiple%dpower%dIm",t,m,k));
9546 TProfile2D styleS("typePower","typePower",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);
9547 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
9549 for(Int_t k=0;k<9;k++)
9551 fs2dEBE[t][k] = (TProfile2D*)styleS.Clone(Form("typeFlag%dpower%d",t,k));
9555 // c) Book 2D profiles:
9556 TString s2DDiffFlowCorrelationsProName = "f2DDiffFlowCorrelationsPro";
9557 s2DDiffFlowCorrelationsProName += fAnalysisLabel->Data();
9558 for(Int_t t=0;t<2;t++) // type: RP or POI
9560 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
9562 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,"");
9563 f2DDiffFlowCorrelationsPro[t][rci]->Sumw2();
9564 f2DDiffFlowCorrelationsPro[t][rci]->SetXTitle("p_{t}");
9565 f2DDiffFlowCorrelationsPro[t][rci]->SetYTitle("#eta");
9566 f2DDiffFlowCorrelationsProList[t]->Add(f2DDiffFlowCorrelationsPro[t][rci]);
9567 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
9568 } // end of for(Int_t t=0;t<2;t++) // type: RP or POIs
9570 // d) Book 2D histograms:
9571 TString s2DDiffFlowCumulantsName = "f2DDiffFlowCumulants";
9572 s2DDiffFlowCumulantsName += fAnalysisLabel->Data();
9573 TString s2DDiffFlowName = "f2DDiffFlow";
9574 s2DDiffFlowName += fAnalysisLabel->Data();
9575 for(Int_t t=0;t<2;t++) // type: RP or POI
9577 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
9579 // 2D diferential cumulants:
9580 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);
9581 f2DDiffFlowCumulants[t][rci]->SetXTitle("p_{t}");
9582 f2DDiffFlowCumulants[t][rci]->SetYTitle("#eta");
9583 f2DDiffFlowCorrelationsProList[t]->Add(f2DDiffFlowCumulants[t][rci]); // to be improved - moved to another list
9584 // 2D differential flow:
9585 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);
9586 f2DDiffFlow[t][rci]->SetXTitle("p_{t}");
9587 f2DDiffFlow[t][rci]->SetYTitle("#eta");
9588 f2DDiffFlowCorrelationsProList[t]->Add(f2DDiffFlow[t][rci]); // to be improved - moved to another list
9589 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
9590 } // end of for(Int_t t=0;t<2;t++) // type: RP or POIs
9592 } // void AliFlowAnalysisWithQCumulants::BookEverythingFor2DDifferentialFlow()
9594 //================================================================================================================================
9596 void AliFlowAnalysisWithQCumulants::BookEverythingForDifferentialFlow()
9598 // Book all histograms and profiles needed for differential flow.
9599 // a) Book profile to hold all flags for differential flow;
9600 // b) Define flags locally (to be improved: should I promote flags to data members?);
9601 // c) Book e-b-e quantities;
9602 // d) Book profiles;
9603 // e) Book histograms holding final results.
9605 // a) Book profile to hold all flags for differential flow:
9606 TString diffFlowFlagsName = "fDiffFlowFlags";
9607 diffFlowFlagsName += fAnalysisLabel->Data();
9608 fDiffFlowFlags = new TProfile(diffFlowFlagsName.Data(),"Flags for differential flow",6,0,6);
9609 fDiffFlowFlags->SetTickLength(-0.01,"Y");
9610 fDiffFlowFlags->SetMarkerStyle(25);
9611 fDiffFlowFlags->SetLabelSize(0.04,"X");
9612 fDiffFlowFlags->SetLabelOffset(0.02,"Y");
9613 fDiffFlowFlags->GetXaxis()->SetBinLabel(1,"Calculate diff. flow");
9614 fDiffFlowFlags->GetXaxis()->SetBinLabel(2,"Particle weights");
9615 fDiffFlowFlags->GetXaxis()->SetBinLabel(3,"Event weights");
9616 fDiffFlowFlags->GetXaxis()->SetBinLabel(4,"Correct for NUA");
9617 fDiffFlowFlags->GetXaxis()->SetBinLabel(5,"Calculate 2D diff. flow");
9618 fDiffFlowFlags->GetXaxis()->SetBinLabel(6,"Calculate diff. flow vs eta");
9619 fDiffFlowList->Add(fDiffFlowFlags);
9621 if(!fCalculateDiffFlow){return;}
9623 // b) Define flags locally (to be improved: should I promote flags to data members?):
9624 TString typeFlag[2] = {"RP","POI"};
9625 TString ptEtaFlag[2] = {"p_{T}","#eta"};
9626 TString powerFlag[2] = {"linear","quadratic"};
9627 TString sinCosFlag[2] = {"sin","cos"};
9628 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"};
9629 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
9630 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};
9631 TString reducedSquaredCorrelationIndex[4] = {"<2'>^{2}","<4'>^{2}","<6'>^{2}","<8'>^{2}"};
9632 TString mixedCorrelationIndex[8] = {"<2>","<2'>","<4>","<4'>","<6>","<6'>","<8>","<8'>"};
9633 TString covarianceName[5] = {"Cov(<2>,<2'>)","Cov(<2>,<4'>)","Cov(<4>,<2'>)","Cov(<4>,<4'>)","Cov(<2'>,<4'>)"};
9634 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
9635 Double_t minPtEta[2] = {fPtMin,fEtaMin};
9636 Double_t maxPtEta[2] = {fPtMax,fEtaMax};
9638 // c) Book e-b-e quantities:
9639 // Event-by-event r_{m*n,k}(pt,eta), p_{m*n,k}(pt,eta) and q_{m*n,k}(pt,eta)
9640 // Explanantion of notation:
9641 // 1.) n is harmonic, m is multiple of harmonic;
9642 // 2.) k is power of particle weight;
9643 // 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);
9644 // 4.) p_{m*n,k}(pt,eta) = Q-vector evaluated in harmonic m*n for POIs in particular (pt,eta) bin
9645 // (if i-th POI is also RP, than it is weighted with w_i^k);
9646 // 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
9647 // (i-th RP&&POI is weighted with w_i^k)
9650 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP && POI )
9652 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
9654 for(Int_t m=0;m<4;m++) // multiple of harmonic
9656 for(Int_t k=0;k<9;k++) // power of particle weight
9658 fReRPQ1dEBE[t][pe][m][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%dpower%dRe",t,pe,m,k),
9659 Form("TypeFlag%dpteta%dmultiple%dpower%dRe",t,pe,m,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
9660 fImRPQ1dEBE[t][pe][m][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%dpower%dIm",t,pe,m,k),
9661 Form("TypeFlag%dpteta%dmultiple%dpower%dIm",t,pe,m,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
9666 // to be improved (add explanation of fs1dEBE[t][pe][k]):
9667 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )
9669 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
9671 for(Int_t k=0;k<9;k++) // power of particle weight
9673 fs1dEBE[t][pe][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%d",t,pe,k),
9674 Form("TypeFlag%dpteta%dmultiple%d",t,pe,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
9678 // correction terms for nua:
9679 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
9681 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
9683 for(Int_t sc=0;sc<2;sc++) // sin or cos
9685 for(Int_t cti=0;cti<9;cti++) // correction term index
9687 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti] = new TH1D(Form("typeFlag%d pteta%d sincos%d cti%d",t,pe,sc,cti),
9688 Form("typeFlag%d pteta%d sincos%d cti%d",t,pe,sc,cti),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
9693 // reduced correlations e-b-e:
9694 TString diffFlowCorrelationsEBEName = "fDiffFlowCorrelationsEBE";
9695 diffFlowCorrelationsEBEName += fAnalysisLabel->Data();
9696 for(Int_t t=0;t<2;t++) // type: RP or POI
9698 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
9700 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
9702 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]);
9703 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
9704 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
9705 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
9706 // event weights for reduced correlations e-b-e:
9707 TString diffFlowEventWeightsForCorrelationsEBEName = "fDiffFlowEventWeightsForCorrelationsEBE";
9708 diffFlowEventWeightsForCorrelationsEBEName += fAnalysisLabel->Data();
9709 for(Int_t t=0;t<2;t++) // type: RP or POI
9711 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
9713 for(Int_t rci=0;rci<4;rci++) // event weight for reduced correlation index
9715 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]);
9716 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
9717 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
9718 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
9720 // d) Book profiles;
9721 // reduced correlations:
9722 TString diffFlowCorrelationsProName = "fDiffFlowCorrelationsPro";
9723 diffFlowCorrelationsProName += fAnalysisLabel->Data();
9724 // reduced squared correlations:
9725 TString diffFlowSquaredCorrelationsProName = "fDiffFlowSquaredCorrelationsPro";
9726 diffFlowSquaredCorrelationsProName += fAnalysisLabel->Data();
9727 // corrections terms:
9728 TString diffFlowCorrectionTermsForNUAProName = "fDiffFlowCorrectionTermsForNUAPro";
9729 diffFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
9730 // reduced correlations:
9731 for(Int_t t=0;t<2;t++) // type: RP or POI
9733 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
9735 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
9737 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");
9738 fDiffFlowCorrelationsPro[t][pe][rci]->Sumw2();
9739 fDiffFlowCorrelationsPro[t][pe][rci]->SetXTitle(ptEtaFlag[pe].Data());
9740 fDiffFlowCorrelationsProList[t][pe]->Add(fDiffFlowCorrelationsPro[t][pe][rci]); // to be improved (add dedicated list to hold reduced correlations)
9741 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
9742 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
9743 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
9744 // reduced squared correlations:
9745 for(Int_t t=0;t<2;t++) // type: RP or POI
9747 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
9749 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
9751 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");
9752 fDiffFlowSquaredCorrelationsPro[t][pe][rci]->Sumw2();
9753 fDiffFlowSquaredCorrelationsPro[t][pe][rci]->SetXTitle(ptEtaFlag[pe].Data());
9754 fDiffFlowCorrelationsProList[t][pe]->Add(fDiffFlowSquaredCorrelationsPro[t][pe][rci]); // to be improved (add dedicated list to hold reduced correlations)
9755 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index
9756 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
9757 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
9758 // correction terms for nua:
9759 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
9761 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
9763 for(Int_t sc=0;sc<2;sc++) // sin or cos
9765 for(Int_t cti=0;cti<9;cti++) // correction term index
9767 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]);
9768 fDiffFlowCorrectionsProList[t][pe]->Add(fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]);
9773 // Other differential correlators:
9774 TString otherDiffCorrelatorsName = "fOtherDiffCorrelators";
9775 otherDiffCorrelatorsName += fAnalysisLabel->Data();
9776 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
9778 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
9780 for(Int_t sc=0;sc<2;sc++) // sin or cos
9782 for(Int_t ci=0;ci<1;ci++) // correlator index
9784 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]);
9785 fOtherDiffCorrelators[t][pe][sc][ci]->Sumw2();
9786 fOtherDiffCorrelatorsList->Add(fOtherDiffCorrelators[t][pe][sc][ci]);
9791 // e) Book histograms holding final results.
9792 // reduced correlations:
9793 TString diffFlowCorrelationsHistName = "fDiffFlowCorrelationsHist";
9794 diffFlowCorrelationsHistName += fAnalysisLabel->Data();
9795 // corrections terms:
9796 TString diffFlowCorrectionTermsForNUAHistName = "fDiffFlowCorrectionTermsForNUAHist";
9797 diffFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
9798 // differential covariances:
9799 TString diffFlowCovariancesName = "fDiffFlowCovariances";
9800 diffFlowCovariancesName += fAnalysisLabel->Data();
9801 // differential Q-cumulants:
9802 TString diffFlowCumulantsName = "fDiffFlowCumulants";
9803 diffFlowCumulantsName += fAnalysisLabel->Data();
9804 // Detector bias to differential Q-cumulants:
9805 TString diffFlowDetectorBiasName = "fDiffFlowDetectorBias";
9806 diffFlowDetectorBiasName += fAnalysisLabel->Data();
9807 // differential flow:
9808 TString diffFlowName = "fDiffFlow";
9809 diffFlowName += fAnalysisLabel->Data();
9810 for(Int_t t=0;t<2;t++) // type: RP or POI
9812 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
9814 for(Int_t index=0;index<4;index++)
9816 // reduced correlations:
9817 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]);
9818 fDiffFlowCorrelationsHist[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
9819 fDiffFlowCorrelationsHistList[t][pe]->Add(fDiffFlowCorrelationsHist[t][pe][index]);
9820 // differential Q-cumulants:
9821 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]);
9822 fDiffFlowCumulants[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
9823 fDiffFlowCumulantsHistList[t][pe]->Add(fDiffFlowCumulants[t][pe][index]);
9824 // Detector bias to differential Q-cumulants:
9825 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]);
9826 fDiffFlowDetectorBias[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
9827 fDiffFlowDetectorBias[t][pe][index]->SetTitle(Form("#frac{corrected}{measured} %s",differentialCumulantIndex[index].Data()));
9828 fDiffFlowDetectorBiasHistList[t][pe]->Add(fDiffFlowDetectorBias[t][pe][index]);
9829 // differential flow estimates from Q-cumulants:
9830 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]);
9831 fDiffFlow[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());
9832 fDiffFlowHistList[t][pe]->Add(fDiffFlow[t][pe][index]);
9833 } // end of for(Int_t index=0;index<4;index++)
9834 for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index
9836 // differential covariances:
9837 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]);
9838 fDiffFlowCovariances[t][pe][covIndex]->SetXTitle(ptEtaFlag[pe].Data());
9839 fDiffFlowCovariancesHistList[t][pe]->Add(fDiffFlowCovariances[t][pe][covIndex]);
9840 } // end of for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index
9841 // products of both types of correlations:
9842 TString diffFlowProductOfCorrelationsProName = "fDiffFlowProductOfCorrelationsPro";
9843 diffFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
9844 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
9846 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
9848 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]);
9849 fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2]->SetXTitle(ptEtaFlag[pe].Data());
9850 fDiffFlowProductOfCorrelationsProList[t][pe]->Add(fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2]);
9851 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
9852 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
9853 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
9854 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
9855 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI
9856 // sums of event weights for reduced correlations:
9857 TString diffFlowSumOfEventWeightsName = "fDiffFlowSumOfEventWeights";
9858 diffFlowSumOfEventWeightsName += fAnalysisLabel->Data();
9859 for(Int_t t=0;t<2;t++) // type is RP or POI
9861 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
9863 for(Int_t p=0;p<2;p++) // power of weights is either 1 or 2
9865 for(Int_t ew=0;ew<4;ew++) // index of reduced correlation
9867 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]);
9868 fDiffFlowSumOfEventWeights[t][pe][p][ew]->SetXTitle(ptEtaFlag[pe].Data());
9869 fDiffFlowSumOfEventWeightsHistList[t][pe][p]->Add(fDiffFlowSumOfEventWeights[t][pe][p][ew]); // to be improved (add dedicated list to hold all this)
9874 // sum of products of event weights for both types of correlations:
9875 TString diffFlowSumOfProductOfEventWeightsName = "fDiffFlowSumOfProductOfEventWeights";
9876 diffFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
9877 for(Int_t t=0;t<2;t++) // type is RP or POI
9879 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
9881 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index
9883 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index
9885 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]);
9886 fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2]->SetXTitle(ptEtaFlag[pe].Data());
9887 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]->Add(fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2]);
9888 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here
9893 // correction terms for nua:
9894 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)
9896 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
9898 for(Int_t sc=0;sc<2;sc++) // sin or cos
9900 for(Int_t cti=0;cti<9;cti++) // correction term index
9902 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]);
9903 fDiffFlowCorrectionsHistList[t][pe]->Add(fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti]);
9909 } // end of AliFlowAnalysisWithQCumulants::BookEverythingForDifferentialFlow()
9911 //================================================================================================================================
9913 void AliFlowAnalysisWithQCumulants::CalculateQcumulantsCorrectedForNUAIntFlow()
9915 // Calculate generalized Q-cumulants (cumulants corrected for non-unifom acceptance).
9917 // Isotropic cumulants:
9918 Double_t qc2 = fIntFlowQcumulants->GetBinContent(1);
9919 Double_t qc2Error = fIntFlowQcumulants->GetBinError(1);
9920 Double_t qc4 = fIntFlowQcumulants->GetBinContent(2);
9921 Double_t qc4Error = fIntFlowQcumulants->GetBinError(2);
9922 //Double_t qc6 = fIntFlowQcumulants->GetBinContent(3);
9923 //Double_t qc6Error = fIntFlowQcumulants->GetBinError(3);
9924 //Double_t qc8 = fIntFlowQcumulants->GetBinContent(4);
9925 //Double_t qc8Error = fIntFlowQcumulants->GetBinError(4);
9927 // Measured 2-, 4-, 6- and 8-particle correlations:
9928 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
9929 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <<2>>
9930 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>
9931 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <<4>>
9932 //Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>
9933 //Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <<6>>
9934 //Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>
9935 //Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <<8>>
9937 // Non-isotropic terms:
9938 Double_t c1 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1); // <<cos(n*phi1)>>
9939 Double_t c1Error = fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(1); // statistical error of <<cos(n*phi1)>>
9940 Double_t c2 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2); // <<cos(n*(phi1+phi2))>>
9941 Double_t c2Error = fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(2); // statistical error of <<cos(n*(phi1+phi2))>>
9942 Double_t c3 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(3); // <<cos(n*(phi1-phi2-phi3))>>
9943 Double_t c3Error = fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(3); // statistical error of <<cos(n*(phi1-phi2-phi3))>>
9944 Double_t s1 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1); // <<sin(n*phi1)>>
9945 Double_t s1Error = fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(1); // statistical error of <<sin(n*phi1)>>
9946 Double_t s2 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2); // <<sin(n*(phi1+phi2))>>
9947 Double_t s2Error = fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(2); // statistical error of <<sin(n*(phi1+phi2))>>
9948 Double_t s3 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(3); // <<sin(n*(phi1-phi2-phi3))>>
9949 Double_t s3Error = fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(3); // statistical error of <<sin(n*(phi1-phi2-phi3))>>
9952 Double_t a1 = 2.*pow(c1,2.)+2.*pow(s1,2.)-two;
9953 Double_t a2 = 6.*pow(c1,3.)-2.*c1*c2+c3+6.*c1*pow(s1,2.)-2.*s1*s2-4.*c1*two;
9954 Double_t a3 = 2.*pow(s1,2.)-2.*pow(c1,2.)+c2;
9955 Double_t a4 = 6.*pow(s1,3.)+6.*pow(c1,2.)*s1+2.*c2*s1-2.*c1*s2-s3-4.*s1*two;
9956 Double_t a5 = 4.*c1*s1-s2;
9958 // Covariances (including weight dependent prefactor):
9959 Double_t wCov1 = 0.; // w*Cov(<2>,<cos(phi))
9960 Double_t wCov2 = 0.; // w*Cov(<2>,<sin(phi))
9961 Double_t wCov3 = 0.; // w*Cov(<cos(phi),<sin(phi))
9962 Double_t wCov4 = 0.; // w*Cov(<2>,<4>)
9963 Double_t wCov5 = 0.; // w*Cov(<2>,<cos(#phi_{1}+#phi_{2})>)
9964 Double_t wCov6 = 0.; // w*Cov(<2>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9965 Double_t wCov7 = 0.; // w*Cov(<2>,<sin(#phi_{1}+#phi_{2})>)
9966 Double_t wCov8 = 0.; // w*Cov(<2>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9967 Double_t wCov9 = 0.; // w*Cov(<4>,<cos(#phi)>
9968 Double_t wCov10 = 0.; // w*Cov(<4>,<cos(#phi_{1}+#phi_{2})>)
9969 Double_t wCov11 = 0.; // w*Cov(<4>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9970 Double_t wCov12 = 0.; // w*Cov(<4>,<sin(#phi)>
9971 Double_t wCov13 = 0.; // w*Cov(<4>,<sin(#phi_{1}+#phi_{2})>)
9972 Double_t wCov14 = 0.; // w*Cov(<4>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9973 Double_t wCov15 = 0.; // w*Cov(<cos(#phi)>,<cos(#phi_{1}+#phi_{2})>)
9974 Double_t wCov16 = 0.; // w*Cov(<cos(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9975 Double_t wCov17 = 0.; // w*Cov(<cos(#phi)>,<sin(#phi_{1}+#phi_{2})>)
9976 Double_t wCov18 = 0.; // w*Cov(<cos(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9977 Double_t wCov19 = 0.; // w*Cov(<cos(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9978 Double_t wCov20 = 0.; // w*Cov(<sin(#phi)>,<cos(#phi_{1}+#phi_{2})>)
9979 Double_t wCov21 = 0.; // w*Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}+#phi_{2})>)
9980 Double_t wCov22 = 0.; // w*Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9981 Double_t wCov23 = 0.; // w*Cov(<sin(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9982 Double_t wCov24 = 0.; // w*Cov(<sin(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9983 Double_t wCov25 = 0.; // w*Cov(<cos(#phi_{1}-#phi_{2}-#phi_{3}>,<sin(#phi_{1}-#phi_{2}-#phi_{3}>)
9984 Double_t wCov26 = 0.; // w*Cov(<sin(#phi)>,<sin(#phi_{1}+#phi_{2})>)
9985 Double_t wCov27 = 0.; // w*Cov(<sin(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9986 Double_t wCov28 = 0.; // w*Cov(<sin(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9987 if(!fForgetAboutCovariances)
9989 wCov1 = fIntFlowCovariancesNUA->GetBinContent(1); // w*Cov(<2>,<cos(phi))
9990 wCov2 = fIntFlowCovariancesNUA->GetBinContent(2); // w*Cov(<2>,<sin(phi))
9991 wCov3 = fIntFlowCovariancesNUA->GetBinContent(3); // w*Cov(<cos(phi),<sin(phi))
9992 wCov4 = fIntFlowCovariances->GetBinContent(1); // w*Cov(<2>,<4>)
9993 wCov5 = fIntFlowCovariancesNUA->GetBinContent(4); // w*Cov(<2>,<cos(#phi_{1}+#phi_{2})>)
9994 wCov6 = fIntFlowCovariancesNUA->GetBinContent(6); // w*Cov(<2>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
9995 wCov7 = fIntFlowCovariancesNUA->GetBinContent(5); // w*Cov(<2>,<sin(#phi_{1}+#phi_{2})>)
9996 wCov8 = fIntFlowCovariancesNUA->GetBinContent(7); // w*Cov(<2>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
9997 wCov9 = fIntFlowCovariancesNUA->GetBinContent(8); // w*Cov(<4>,<cos(#phi)>
9998 wCov10 = fIntFlowCovariancesNUA->GetBinContent(10); // w*Cov(<4>,<cos(#phi_{1}+#phi_{2})>)
9999 wCov11 = fIntFlowCovariancesNUA->GetBinContent(12); // w*Cov(<4>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
10000 wCov12 = fIntFlowCovariancesNUA->GetBinContent(9); // w*Cov(<4>,<sin(#phi)>
10001 wCov13 = fIntFlowCovariancesNUA->GetBinContent(11); // w*Cov(<4>,<sin(#phi_{1}+#phi_{2})>)
10002 wCov14 = fIntFlowCovariancesNUA->GetBinContent(13); // w*Cov(<4>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
10003 wCov15 = fIntFlowCovariancesNUA->GetBinContent(14); // w*Cov(<cos(#phi)>,<cos(#phi_{1}+#phi_{2})>)
10004 wCov16 = fIntFlowCovariancesNUA->GetBinContent(16); // w*Cov(<cos(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
10005 wCov17 = fIntFlowCovariancesNUA->GetBinContent(15); // w*Cov(<cos(#phi)>,<sin(#phi_{1}+#phi_{2})>)
10006 wCov18 = fIntFlowCovariancesNUA->GetBinContent(17); // w*Cov(<cos(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
10007 wCov19 = fIntFlowCovariancesNUA->GetBinContent(23); // w*Cov(<cos(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
10008 wCov20 = fIntFlowCovariancesNUA->GetBinContent(18); // w*Cov(<sin(#phi)>,<cos(#phi_{1}+#phi_{2})>)
10009 wCov21 = fIntFlowCovariancesNUA->GetBinContent(22); // w*Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}+#phi_{2})>)
10010 wCov22 = fIntFlowCovariancesNUA->GetBinContent(24); // w*Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
10011 wCov23 = fIntFlowCovariancesNUA->GetBinContent(20); // w*Cov(<sin(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
10012 wCov24 = fIntFlowCovariancesNUA->GetBinContent(25); // w*Cov(<sin(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)
10013 wCov25 = fIntFlowCovariancesNUA->GetBinContent(27); // w*Cov(<cos(#phi_{1}-#phi_{2}-#phi_{3}>,<sin(#phi_{1}-#phi_{2}-#phi_{3}>)
10014 wCov26 = fIntFlowCovariancesNUA->GetBinContent(19); // w*Cov(<sin(#phi)>,<sin(#phi_{1}+#phi_{2})>)
10015 wCov27 = fIntFlowCovariancesNUA->GetBinContent(21); // w*Cov(<sin(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
10016 wCov28 = fIntFlowCovariancesNUA->GetBinContent(26); // w*Cov(<sin(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)
10017 } // end of if(!fForgetAboutCovariances)
10019 // Calculating generalized QC{2}:
10020 // Generalized QC{2}:
10021 Double_t gQC2 = two - pow(c1,2.) - pow(s1,2.);
10022 if(fApplyCorrectionForNUA){fIntFlowQcumulants->SetBinContent(1,gQC2);}
10023 // Statistical error of generalized QC{2}:
10024 Double_t gQC2ErrorSquared = pow(twoError,2.)+4.*pow(c1,2.)*pow(c1Error,2.)
10025 + 4.*pow(s1,2.)*pow(s1Error,2.)
10026 - 4*c1*wCov1-4*s1*wCov2
10028 // Store ratio of error squared - with/without NUA terms:
10029 Double_t ratioErrorSquaredQC2 = 0.;
10030 if(fIntFlowQcumulants->GetBinError(1)>0.)
10032 ratioErrorSquaredQC2 = (gQC2ErrorSquared/pow(fIntFlowQcumulants->GetBinError(1),2.));
10033 fIntFlowQcumulantsErrorSquaredRatio->SetBinContent(1,ratioErrorSquaredQC2);
10035 // If enabled, store error by including non-isotropic terms:
10036 if(fApplyCorrectionForNUA && fPropagateErrorAlsoFromNIT)
10038 if(gQC2ErrorSquared>=0.)
10040 fIntFlowQcumulants->SetBinError(1,pow(gQC2ErrorSquared,0.5));
10043 fIntFlowQcumulants->SetBinError(1,0.);
10045 cout<<" WARNING (QC): Statistical error of generalized QC{2} is imaginary !!!!"<<endl;
10048 } // end of if(fApplyCorrectionForNUA && fPropagateErrorAlsoFromNIT)
10049 // Quantify detector bias to QC{2}:
10050 if(TMath::Abs(qc2)>0.)
10052 fIntFlowDetectorBias->SetBinContent(1,gQC2/qc2);
10055 Double_t errorSquared = gQC2ErrorSquared/pow(qc2,2.)+pow(gQC2,2.)*pow(qc2Error,2.)/pow(qc2,4.);
10056 if(errorSquared>0.)
10058 fIntFlowDetectorBias->SetBinError(1,pow(errorSquared,0.5));
10061 } // end of if(TMath::Abs(qc2)>0.)
10063 // Calculating generalized QC{4}:
10064 // Generalized QC{4}:
10065 Double_t gQC4 = four-2.*pow(two,2.)
10066 - 4.*c1*c3+4.*s1*s3-pow(c2,2.)-pow(s2,2.)
10067 + 4.*c2*(pow(c1,2.)-pow(s1,2.))+8.*s2*s1*c1
10068 + 8.*two*(pow(c1,2.)+pow(s1,2.))-6.*pow((pow(c1,2.)+pow(s1,2.)),2.);
10069 if(fApplyCorrectionForNUA){fIntFlowQcumulants->SetBinContent(2,gQC4);}
10070 // Statistical error of generalized QC{4}:
10071 Double_t gQC4ErrorSquared = 16.*pow(a1,2.)*pow(twoError,2.)+pow(fourError,2.)+16.*pow(a2,2.)*pow(c1Error,2.)
10072 + 4.*pow(a3,2.)*pow(c2Error,2.)+16.*pow(c1,2.)*pow(c3Error,2.)
10073 + 16.*pow(a4,2.)*pow(s1Error,2.)+4.*pow(a5,2.)*pow(s2Error,2.)
10074 + 16.*pow(s1,2.)*pow(s3Error,2.)+8.*a1*wCov4-32.*a1*a2*wCov1
10075 - 16.*a3*a1*wCov5-32.*c1*a1*wCov6-32.*a1*a4*wCov2+16.*a5*a1*wCov7
10076 + 32.*s1*a1*wCov8-8.*a2*wCov9-4.*a3*wCov10-8.*c1*wCov11-8.*a4*wCov12
10077 + 4.*a5*wCov13+8.*s1*wCov14+16.*a3*a2*wCov15+32.*c1*a2*wCov16+32.*a2*a4*wCov3
10078 - 16.*a5*a2*wCov17-32.*s1*a2*wCov18+16.*c1*a3*wCov19+16.*a3*a4*wCov20
10079 - 8.*a3*a5*wCov21-16.*s1*a3*wCov22+32.*c1*a4*wCov23-16.*c1*a5*wCov24
10080 - 32.*c1*s1*wCov25-16.*a5*a4*wCov26-32.*s1*a4*wCov27+16.*s1*a5*wCov28;
10081 // Store ratio of error squared - with/without NUA terms:
10082 Double_t ratioErrorSquaredQC4 = 0.;
10083 if(fIntFlowQcumulants->GetBinError(2)>0.)
10085 ratioErrorSquaredQC4 = (gQC4ErrorSquared/pow(fIntFlowQcumulants->GetBinError(2),2.));
10086 fIntFlowQcumulantsErrorSquaredRatio->SetBinContent(2,ratioErrorSquaredQC4);
10088 if(fApplyCorrectionForNUA && fPropagateErrorAlsoFromNIT)
10090 if(gQC4ErrorSquared>=0.)
10092 fIntFlowQcumulants->SetBinError(2,pow(gQC4ErrorSquared,0.5));
10095 fIntFlowQcumulants->SetBinError(2,0.);
10097 cout<<" WARNING (QC): Statistical error of generalized QC{4} is imaginary !!!!"<<endl;
10100 } // end of if(fApplyCorrectionForNUA && fPropagateErrorAlsoFromNIT)
10101 // Quantify detector bias to QC{4}:
10102 if(TMath::Abs(qc4)>0.)
10104 fIntFlowDetectorBias->SetBinContent(2,gQC4/qc4);
10107 Double_t errorSquared = gQC4ErrorSquared/pow(qc4,2.)+pow(gQC4,2.)*pow(qc4Error,2.)/pow(qc4,4.);
10108 if(errorSquared>0.)
10110 fIntFlowDetectorBias->SetBinError(2,pow(errorSquared,0.5));
10113 } // end of if(TMath::Abs(qc4)>0.)
10116 // .... to be improved (continued for 6th and 8th order) ....
10119 // versus multiplicity:
10120 if(fCalculateCumulantsVsM) // to be improved - propagate error for nua terms vs M
10122 Int_t nBins = fIntFlowCorrelationsVsMPro[0]->GetNbinsX(); // to be improved (hardwired 0)
10123 Double_t value[4] = {0.}; // QCs vs M
10124 Double_t error[4] = {0.}; // error of QCs vs M
10125 Double_t dSum1[4] = {0.}; // sum value_i/(error_i)^2
10126 Double_t dSum2[4] = {0.}; // sum 1/(error_i)^2
10127 for(Int_t b=1;b<=nBins;b++)
10129 // Measured correlations:
10130 two = fIntFlowCorrelationsVsMHist[0]->GetBinContent(b); // <<2>> vs M
10131 four = fIntFlowCorrelationsVsMHist[1]->GetBinContent(b); // <<4>> vs M
10132 // Isotropic cumulants:
10134 qc4 = four-2.*pow(two,2.);
10135 // Non-isotropic terms:
10136 c1 = fIntFlowCorrectionTermsForNUAVsMPro[1][0]->GetBinContent(b); // <<cos(n*phi1)>>
10137 c2 = fIntFlowCorrectionTermsForNUAVsMPro[1][1]->GetBinContent(b); // <<cos(n*(phi1+phi2))>>
10138 c3 = fIntFlowCorrectionTermsForNUAVsMPro[1][2]->GetBinContent(b); // <<cos(n*(phi1-phi2-phi3))>>
10139 s1 = fIntFlowCorrectionTermsForNUAVsMPro[0][0]->GetBinContent(b); // <<sin(n*phi1)>>
10140 s2 = fIntFlowCorrectionTermsForNUAVsMPro[0][1]->GetBinContent(b); // <<sin(n*(phi1+phi2))>>
10141 s3 = fIntFlowCorrectionTermsForNUAVsMPro[0][2]->GetBinContent(b); // <<sin(n*(phi1-phi2-phi3))>>
10142 // Generalized QC{2} vs M:
10143 gQC2 = two - pow(c1,2.) - pow(s1,2.);
10144 if(fApplyCorrectionForNUAVsM){fIntFlowQcumulantsVsM[0]->SetBinContent(b,gQC2);}
10145 // Generalized QC{4} vs M:
10146 gQC4 = four-2.*pow(two,2.)
10147 - 4.*c1*c3+4.*s1*s3-pow(c2,2.)-pow(s2,2.)
10148 + 4.*c2*(pow(c1,2.)-pow(s1,2.))+8.*s2*s1*c1
10149 + 8.*two*(pow(c1,2.)+pow(s1,2.))-6.*pow((pow(c1,2.)+pow(s1,2.)),2.);
10150 if(fApplyCorrectionForNUAVsM){fIntFlowQcumulantsVsM[1]->SetBinContent(b,gQC4);}
10151 // Detector bias vs M:
10152 if(TMath::Abs(qc2)>0.)
10154 fIntFlowDetectorBiasVsM[0]->SetBinContent(b,gQC2/qc2);
10155 } // end of if(TMath::Abs(qc2)>0.)
10156 if(TMath::Abs(qc4)>0.)
10158 fIntFlowDetectorBiasVsM[1]->SetBinContent(b,gQC4/qc4);
10159 } // end of if(TMath::Abs(qc4)>0.)
10161 for(Int_t co=0;co<4;co++)
10163 value[co] = fIntFlowQcumulantsVsM[co]->GetBinContent(b);
10164 error[co] = fIntFlowQcumulantsVsM[co]->GetBinError(b);
10167 dSum1[co]+=value[co]/(error[co]*error[co]);
10168 dSum2[co]+=1./(error[co]*error[co]);
10170 } // end of for(Int_t co=0;co<4;co++)
10171 } // end of for(Int_t b=1;b<=nBins;b++)
10172 // Store rebinned Q-cumulants:
10173 if(fApplyCorrectionForNUAVsM)
10175 for(Int_t co=0;co<4;co++)
10179 fIntFlowQcumulantsRebinnedInM->SetBinContent(co+1,dSum1[co]/dSum2[co]);
10180 fIntFlowQcumulantsRebinnedInM->SetBinError(co+1,pow(1./dSum2[co],0.5));
10182 } // end of for(Int_t co=0;co<4;co++)
10183 } // end of if(fApplyCorrectionForNUAVsM)
10184 } // end of if(fCalculateCumulantsVsM)
10186 } // end of void AliFlowAnalysisWithQCumulants::CalculateQcumulantsCorrectedForNUAIntFlow()
10188 //================================================================================================================================
10190 void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUAIntFlow()
10192 // From profile fIntFlowCorrectionTermsForNUAPro[sc] access measured correction terms for NUA
10193 // and their spread, correctly calculate the statistical errors and store the final
10194 // results and statistical errors for correction terms for NUA in histogram fIntFlowCorrectionTermsForNUAHist[sc].
10196 // Remark: Statistical error of correction temrs is calculated as:
10198 // statistical error = termA * spread * termB:
10199 // termA = sqrt{sum_{i=1}^{N} w^2}/(sum_{i=1}^{N} w)
10200 // termB = 1/sqrt(1-termA^2)
10202 TString sinCosFlag[2] = {"sin","cos"}; // to be improved - promore this to data member?
10203 TString nonisotropicTermFlag[4] = {"(n(phi1))","(n(phi1+phi2))","(n(phi1-phi2-phi3))","(n(2phi1-phi2))"}; // to be improved - hardwired 4
10205 for(Int_t sc=0;sc<2;sc++) // sin or cos correction terms
10207 for(Int_t ci=1;ci<=4;ci++) // correction term index (to be improved - hardwired 4)
10209 Double_t correction = fIntFlowCorrectionTermsForNUAPro[sc]->GetBinContent(ci);
10210 Double_t spread = fIntFlowCorrectionTermsForNUAPro[sc]->GetBinError(ci);
10211 Double_t sumOfLinearEventWeights = fIntFlowSumOfEventWeightsNUA[sc][0]->GetBinContent(ci);
10212 Double_t sumOfQuadraticEventWeights = fIntFlowSumOfEventWeightsNUA[sc][1]->GetBinContent(ci);
10213 Double_t termA = 0.;
10214 Double_t termB = 0.;
10215 if(TMath::Abs(sumOfLinearEventWeights)>1.e-44)
10217 termA = pow(sumOfQuadraticEventWeights,0.5)/sumOfLinearEventWeights;
10220 cout<<" WARNING (QC): sumOfLinearEventWeights == 0 in AFAWQC::FCTFNIF() !!!!"<<endl;
10221 cout<<Form(" (for <<%s[%s]>> non-isotropic term)",sinCosFlag[sc].Data(),nonisotropicTermFlag[ci-1].Data())<<endl;
10223 if(1.-pow(termA,2.) > 0.)
10225 termB = 1./pow(1-pow(termA,2.),0.5);
10228 cout<<" WARNING (QC): 1.-pow(termA,2.) <= 0 in AFAWQC::FCTFNIF() !!!!"<<endl;
10229 cout<<Form(" (for <<%s[%s]>> non-isotropic term)",sinCosFlag[sc].Data(),nonisotropicTermFlag[ci-1].Data())<<endl;
10231 Double_t statisticalError = termA * spread * termB;
10232 fIntFlowCorrectionTermsForNUAHist[sc]->SetBinContent(ci,correction);
10233 fIntFlowCorrectionTermsForNUAHist[sc]->SetBinError(ci,statisticalError);
10234 } // end of for(Int_t ci=1;ci<=4;ci++) // correction term index
10235 } // end of for(Int sc=0;sc<2;sc++) // sin or cos correction terms
10237 } // end of void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUAIntFlow()
10239 //================================================================================================================================
10241 void AliFlowAnalysisWithQCumulants::GetPointersForNestedLoopsHistograms()
10243 // Get pointers to all objects relevant for calculations with nested loops.
10245 TList *nestedLoopsList = dynamic_cast<TList*>(fHistList->FindObject("Nested Loops"));
10246 if(nestedLoopsList)
10248 this->SetNestedLoopsList(nestedLoopsList);
10251 cout<<"WARNING: nestedLoopsList is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
10255 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)
10256 TString typeFlag[2] = {"RP","POI"}; // to be improved (should I promote this to data members?)
10257 TString ptEtaFlag[2] = {"p_{T}","#eta"}; // to be improved (should I promote this to data members?)
10258 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"}; // to be improved (should I promote this to data members?)
10260 TString evaluateNestedLoopsName = "fEvaluateNestedLoops";
10261 evaluateNestedLoopsName += fAnalysisLabel->Data();
10262 TProfile *evaluateNestedLoops = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(evaluateNestedLoopsName.Data()));
10263 Bool_t bEvaluateIntFlowNestedLoops = kFALSE;
10264 Bool_t bEvaluateDiffFlowNestedLoops = kFALSE;
10265 if(evaluateNestedLoops)
10267 this->SetEvaluateNestedLoops(evaluateNestedLoops);
10268 bEvaluateIntFlowNestedLoops = (Int_t)evaluateNestedLoops->GetBinContent(1);
10269 bEvaluateDiffFlowNestedLoops = (Int_t)evaluateNestedLoops->GetBinContent(2);
10271 // nested loops relevant for integrated flow:
10272 if(bEvaluateIntFlowNestedLoops)
10275 TString intFlowDirectCorrelationsName = "fIntFlowDirectCorrelations";
10276 intFlowDirectCorrelationsName += fAnalysisLabel->Data();
10277 TProfile *intFlowDirectCorrelations = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(intFlowDirectCorrelationsName.Data()));
10278 if(intFlowDirectCorrelations)
10280 this->SetIntFlowDirectCorrelations(intFlowDirectCorrelations);
10283 cout<<"WARNING: intFlowDirectCorrelations is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
10286 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights)
10288 TString intFlowExtraDirectCorrelationsName = "fIntFlowExtraDirectCorrelations";
10289 intFlowExtraDirectCorrelationsName += fAnalysisLabel->Data();
10290 TProfile *intFlowExtraDirectCorrelations = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(intFlowExtraDirectCorrelationsName.Data()));
10291 if(intFlowExtraDirectCorrelations)
10293 this->SetIntFlowExtraDirectCorrelations(intFlowExtraDirectCorrelations);
10296 cout<<"WARNING: intFlowExtraDirectCorrelations is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
10299 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights)
10300 // correction terms for non-uniform acceptance:
10301 TString intFlowDirectCorrectionTermsForNUAName = "fIntFlowDirectCorrectionTermsForNUA";
10302 intFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
10303 TProfile *intFlowDirectCorrectionTermsForNUA[2] = {NULL};
10304 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
10306 intFlowDirectCorrectionTermsForNUA[sc] = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(Form("%s: %s terms",intFlowDirectCorrectionTermsForNUAName.Data(),sinCosFlag[sc].Data())));
10307 if(intFlowDirectCorrectionTermsForNUA[sc])
10309 this->SetIntFlowDirectCorrectionTermsForNUA(intFlowDirectCorrectionTermsForNUA[sc],sc);
10312 cout<<"WARNING: intFlowDirectCorrectionTermsForNUA[sc] is NULL in AFAWQC::GPFNLH() !!!!"<<endl;
10313 cout<<"sc = "<<sc<<endl;
10316 } // end of for(Int_t sc=0;sc<2;sc++)
10317 } // end of if(bEvaluateIntFlowNestedLoops)
10319 // nested loops relevant for differential flow:
10320 if(bEvaluateDiffFlowNestedLoops)
10323 TString diffFlowDirectCorrelationsName = "fDiffFlowDirectCorrelations";
10324 diffFlowDirectCorrelationsName += fAnalysisLabel->Data();
10325 TProfile *diffFlowDirectCorrelations[2][2][4] = {{{NULL}}};
10326 for(Int_t t=0;t<2;t++)
10328 for(Int_t pe=0;pe<2;pe++)
10330 for(Int_t ci=0;ci<4;ci++) // correlation index
10332 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())));
10333 if(diffFlowDirectCorrelations[t][pe][ci])
10335 this->SetDiffFlowDirectCorrelations(diffFlowDirectCorrelations[t][pe][ci],t,pe,ci);
10338 cout<<"WARNING: diffFlowDirectCorrelations[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
10339 cout<<"t = "<<t<<endl;
10340 cout<<"pe = "<<pe<<endl;
10341 cout<<"ci = "<<ci<<endl;
10343 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
10344 } // end of for(Int_t pe=0;pe<2;pe++)
10345 } // end of for(Int_t t=0;t<2;t++)
10346 // correction terms for non-uniform acceptance:
10347 TString diffFlowDirectCorrectionTermsForNUAName = "fDiffFlowDirectCorrectionTermsForNUA";
10348 diffFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();
10349 TProfile *diffFlowDirectCorrectionTermsForNUA[2][2][2][10] = {{{{NULL}}}};
10350 for(Int_t t=0;t<2;t++)
10352 for(Int_t pe=0;pe<2;pe++)
10354 // correction terms for NUA:
10355 for(Int_t sc=0;sc<2;sc++) // sin or cos
10357 for(Int_t cti=0;cti<9;cti++) // correction term index
10359 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)));
10360 if(diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti])
10362 this->SetDiffFlowDirectCorrectionTermsForNUA(diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti],t,pe,sc,cti);
10365 cout<<"WARNING: diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
10366 cout<<"t = "<<t<<endl;
10367 cout<<"pe = "<<pe<<endl;
10368 cout<<"sc = "<<sc<<endl;
10369 cout<<"cti = "<<cti<<endl;
10371 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index
10372 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
10373 } // end of for(Int_t pe=0;pe<2;pe++)
10374 } // end of for(Int_t t=0;t<2;t++)
10375 // other differential correlators:
10376 TString otherDirectDiffCorrelatorsName = "fOtherDirectDiffCorrelators";
10377 otherDirectDiffCorrelatorsName += fAnalysisLabel->Data();
10378 TProfile *otherDirectDiffCorrelators[2][2][2][1] = {{{{NULL}}}};
10379 for(Int_t t=0;t<2;t++)
10381 for(Int_t pe=0;pe<2;pe++)
10383 // correction terms for NUA:
10384 for(Int_t sc=0;sc<2;sc++) // sin or cos
10386 for(Int_t ci=0;ci<1;ci++) // correlator index
10388 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)));
10389 if(otherDirectDiffCorrelators[t][pe][sc][ci])
10391 this->SetOtherDirectDiffCorrelators(otherDirectDiffCorrelators[t][pe][sc][ci],t,pe,sc,ci);
10394 cout<<"WARNING: otherDirectDiffCorrelators[t][pe][sc][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
10395 cout<<"t = "<<t<<endl;
10396 cout<<"pe = "<<pe<<endl;
10397 cout<<"sc = "<<sc<<endl;
10398 cout<<"ci = "<<ci<<endl;
10400 } // end of for(Int_t ci=0;ci<9;ci++) // correction term index
10401 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
10402 } // end of for(Int_t pe=0;pe<2;pe++)
10403 } // end of for(Int_t t=0;t<2;t++)
10404 // number of RPs and POIs in selected pt and eta bins for cross-checkings:
10405 TString noOfParticlesInBinName = "fNoOfParticlesInBin";
10406 TH1D *noOfParticlesInBin = NULL;
10407 noOfParticlesInBin = dynamic_cast<TH1D*>(nestedLoopsList->FindObject(noOfParticlesInBinName.Data()));
10408 if(noOfParticlesInBin)
10410 this->SetNoOfParticlesInBin(noOfParticlesInBin);
10414 cout<<" WARNING (QC): noOfParticlesInBin is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
10417 } // end of if(bEvaluateDiffFlowNestedLoops)
10419 } // end of void AliFlowAnalysisWithQCumulants::GetPointersForNestedLoopsHistograms()
10421 //================================================================================================================================
10423 void AliFlowAnalysisWithQCumulants::StoreHarmonic()
10425 // Store flow harmonic in common control histograms.
10427 (fCommonHists->GetHarmonic())->Fill(0.5,fHarmonic);
10428 if(fFillMultipleControlHistograms)
10430 (fCommonHists2nd->GetHarmonic())->Fill(0.5,fHarmonic);
10431 (fCommonHists4th->GetHarmonic())->Fill(0.5,fHarmonic);
10432 (fCommonHists6th->GetHarmonic())->Fill(0.5,fHarmonic);
10433 (fCommonHists8th->GetHarmonic())->Fill(0.5,fHarmonic);
10436 } // end of void AliFlowAnalysisWithQCumulants::StoreHarmonic()
10438 //================================================================================================================================
10440 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelationsUsingParticleWeights(TString type, TString ptOrEta) // type = RP or POI
10442 // Calculate all correlations needed for differential flow using particle weights.
10444 Int_t t = 0; // type flag
10445 Int_t pe = 0; // ptEta flag
10450 } else if(type == "POI")
10455 if(ptOrEta == "Pt")
10458 } else if(ptOrEta == "Eta")
10463 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
10464 Double_t minPtEta[2] = {fPtMin,fEtaMin};
10465 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
10466 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
10468 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
10469 Double_t dReQ1n1k = (*fReQ)(0,1);
10470 Double_t dReQ2n2k = (*fReQ)(1,2);
10471 Double_t dReQ1n3k = (*fReQ)(0,3);
10472 //Double_t dReQ4n4k = (*fReQ)(3,4);
10473 Double_t dImQ1n1k = (*fImQ)(0,1);
10474 Double_t dImQ2n2k = (*fImQ)(1,2);
10475 Double_t dImQ1n3k = (*fImQ)(0,3);
10476 //Double_t dImQ4n4k = (*fImQ)(3,4);
10478 // S^M_{p,k} (see .h file for the definition of fSpk):
10479 Double_t dSM1p1k = (*fSpk)(0,1);
10480 Double_t dSM1p2k = (*fSpk)(0,2);
10481 Double_t dSM1p3k = (*fSpk)(0,3);
10482 Double_t dSM2p1k = (*fSpk)(1,1);
10483 Double_t dSM3p1k = (*fSpk)(2,1);
10485 // looping over all bins and calculating reduced correlations:
10486 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10488 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin):
10489 Double_t p1n0kRe = 0.;
10490 Double_t p1n0kIm = 0.;
10492 // number of POIs in particular (pt,eta) bin):
10495 // real and imaginary parts of q_{m*n,k}:
10496 // (weighted Q-vector evaluated for particles which are both RPs and POIs in particular (pt,eta) bin)
10497 Double_t q1n2kRe = 0.;
10498 Double_t q1n2kIm = 0.;
10499 Double_t q2n1kRe = 0.;
10500 Double_t q2n1kIm = 0.;
10502 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
10503 Double_t s1p1k = 0.;
10504 Double_t s1p2k = 0.;
10505 Double_t s1p3k = 0.;
10507 // M0111 from Eq. (118) in QC2c (to be improved (notation))
10508 Double_t dM0111 = 0.;
10512 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
10513 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
10514 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
10515 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
10517 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
10519 t = 1; // typeFlag = RP or POI
10521 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
10522 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))
10523 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));
10524 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))
10525 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b));
10526 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))
10527 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));
10528 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))
10529 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b));
10531 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
10532 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.);
10533 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.);
10534 s1p3k = pow(fs1dEBE[2][pe][3]->GetBinContent(b)*fs1dEBE[2][pe][3]->GetBinEntries(b),1.);
10536 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
10537 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
10538 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
10539 + 2.*(s1p3k-s1p2k*dSM1p1k));
10541 else if(type == "RP")
10543 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
10544 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))
10545 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));
10546 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))
10547 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));
10548 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))
10549 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));
10550 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))
10551 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));
10553 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
10554 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.);
10555 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.);
10556 s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.);
10558 // to be improved (cross-checked):
10559 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
10560 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
10561 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
10562 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
10564 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
10566 t = 0; // typeFlag = RP or POI
10568 // M0111 from Eq. (118) in QC2c (to be improved (notation)):
10569 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)
10570 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)
10571 + 2.*(s1p3k-s1p2k*dSM1p1k));
10572 //...............................................................................................
10575 // 2'-particle correlation:
10576 Double_t two1n1nW0W1 = 0.;
10577 if(mp*dSM1p1k-s1p1k)
10579 two1n1nW0W1 = (p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k-s1p1k)
10580 / (mp*dSM1p1k-s1p1k);
10582 // fill profile to get <<2'>>
10583 fDiffFlowCorrelationsPro[t][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nW0W1,mp*dSM1p1k-s1p1k);
10584 // fill profile to get <<2'>^2>
10585 fDiffFlowSquaredCorrelationsPro[t][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nW0W1*two1n1nW0W1,mp*dSM1p1k-s1p1k);
10586 // histogram to store <2'> e-b-e (needed in some other methods):
10587 fDiffFlowCorrelationsEBE[t][pe][0]->SetBinContent(b,two1n1nW0W1);
10588 fDiffFlowEventWeightsForCorrelationsEBE[t][pe][0]->SetBinContent(b,mp*dSM1p1k-s1p1k);
10589 } // end of if(mp*dSM1p1k-s1p1k)
10591 // 4'-particle correlation:
10592 Double_t four1n1n1n1nW0W1W1W1 = 0.;
10595 four1n1n1n1nW0W1W1W1 = ((pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
10596 - q2n1kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))
10597 - 2.*q2n1kIm*dReQ1n1k*dImQ1n1k
10598 - p1n0kRe*(dReQ1n1k*dReQ2n2k+dImQ1n1k*dImQ2n2k)
10599 + p1n0kIm*(dImQ1n1k*dReQ2n2k-dReQ1n1k*dImQ2n2k)
10600 - 2.*dSM1p2k*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)
10601 - 2.*(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*s1p1k
10602 + 6.*(q1n2kRe*dReQ1n1k+q1n2kIm*dImQ1n1k)
10603 + 1.*(q2n1kRe*dReQ2n2k+q2n1kIm*dImQ2n2k)
10604 + 2.*(p1n0kRe*dReQ1n3k+p1n0kIm*dImQ1n3k)
10607 / dM0111; // to be improved (notation of dM0111)
10609 // fill profile to get <<4'>>
10610 fDiffFlowCorrelationsPro[t][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nW0W1W1W1,dM0111);
10611 // fill profile to get <<4'>^2>
10612 fDiffFlowSquaredCorrelationsPro[t][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nW0W1W1W1*four1n1n1n1nW0W1W1W1,dM0111);
10613 // histogram to store <4'> e-b-e (needed in some other methods):
10614 fDiffFlowCorrelationsEBE[t][pe][1]->SetBinContent(b,four1n1n1n1nW0W1W1W1);
10615 fDiffFlowEventWeightsForCorrelationsEBE[t][pe][1]->SetBinContent(b,dM0111);
10616 } // end of if(dM0111)
10617 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10619 } // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelationsUsingParticleWeights(TString type, TString ptOrEta); // type = RP or POI
10621 //================================================================================================================================
10623 void AliFlowAnalysisWithQCumulants::FillCommonControlHistograms(AliFlowEventSimple *anEvent)
10625 // Fill common control histograms.
10627 Int_t nRP = anEvent->GetEventNSelTracksRP(); // number of RPs (i.e. number of particles used to determine the reaction plane)
10628 fCommonHists->FillControlHistograms(anEvent);
10629 if(fFillMultipleControlHistograms)
10633 fCommonHists2nd->FillControlHistograms(anEvent);
10636 fCommonHists4th->FillControlHistograms(anEvent);
10639 fCommonHists6th->FillControlHistograms(anEvent);
10642 fCommonHists8th->FillControlHistograms(anEvent);
10643 } // end of if(nRP>7)
10644 } // end of if(nRP>5)
10645 } // end of if(nRP>3)
10646 } // end of if(nRP>1)
10647 } // end of if(fFillMultipleControlHistograms)
10649 } // end of void AliFlowAnalysisWithQCumulants::FillCommonControlHistograms(AliFlowEventSimple *anEvent)
10651 //================================================================================================================================
10653 void AliFlowAnalysisWithQCumulants::ResetEventByEventQuantities()
10655 // Reset all event by event quantities.
10661 fIntFlowCorrelationsEBE->Reset();
10662 fIntFlowEventWeightsForCorrelationsEBE->Reset();
10663 fIntFlowCorrelationsAllEBE->Reset();
10665 for(Int_t sc=0;sc<2;sc++)
10667 fIntFlowCorrectionTermsForNUAEBE[sc]->Reset();
10668 fIntFlowEventWeightForCorrectionTermsForNUAEBE[sc]->Reset();
10671 // Differential flow:
10672 if(fCalculateDiffFlow)
10674 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
10676 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // 1D in pt or eta
10678 for(Int_t m=0;m<4;m++) // multiple of harmonic
10680 for(Int_t k=0;k<9;k++) // power of weight
10682 if(fReRPQ1dEBE[t][pe][m][k]) fReRPQ1dEBE[t][pe][m][k]->Reset();
10683 if(fImRPQ1dEBE[t][pe][m][k]) fImRPQ1dEBE[t][pe][m][k]->Reset();
10688 for(Int_t t=0;t<3;t++) // type (0 = RP, 1 = POI, 2 = RP&&POI )
10690 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // 1D in pt or eta
10692 for(Int_t k=0;k<9;k++)
10694 if(fs1dEBE[t][pe][k]) fs1dEBE[t][pe][k]->Reset();
10698 // e-b-e reduced correlations:
10699 for(Int_t t=0;t<2;t++) // type (0 = RP, 1 = POI)
10701 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
10703 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
10705 if(fDiffFlowCorrelationsEBE[t][pe][rci]) fDiffFlowCorrelationsEBE[t][pe][rci]->Reset();
10706 if(fDiffFlowEventWeightsForCorrelationsEBE[t][pe][rci]) fDiffFlowEventWeightsForCorrelationsEBE[t][pe][rci]->Reset();
10710 // correction terms for NUA:
10711 for(Int_t t=0;t<2;t++) // type (0 = RP, 1 = POI)
10713 for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
10715 for(Int_t sc=0;sc<2;sc++) // sin or cos
10717 for(Int_t cti=0;cti<9;cti++) // correction term index
10719 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti]->Reset();
10724 } // end of if(fCalculateDiffFlow)
10727 if(fCalculate2DDiffFlow)
10729 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)
10731 for(Int_t m=0;m<4;m++) // multiple of harmonic
10733 for(Int_t k=0;k<9;k++) // power of weight
10735 if(fReRPQ2dEBE[t][m][k]){fReRPQ2dEBE[t][m][k]->Reset();}
10736 if(fImRPQ2dEBE[t][m][k]){fImRPQ2dEBE[t][m][k]->Reset();}
10740 for(Int_t t=0;t<3;t++) // type (0 = RP, 1 = POI, 2 = RP&&POI )
10742 for(Int_t k=0;k<9;k++)
10744 if(fs2dEBE[t][k]){fs2dEBE[t][k]->Reset();}
10747 } // end of if(fCalculate2DDiffFlow)
10749 } // end of void AliFlowAnalysisWithQCumulants::ResetEventByEventQuantities();
10751 //================================================================================================================================
10753 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTerms(TString type, TString ptOrEta)
10755 // Calculate correction terms for non-uniform acceptance for differential flow (sin terms).
10757 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][0][cti], where cti runs as follows:
10758 // 0: <<sin n(psi1)>>
10759 // 1: <<sin n(psi1+phi2)>>
10760 // 2: <<sin n(psi1+phi2-phi3)>>
10761 // 3: <<sin n(psi1-phi2-phi3)>>:
10767 Double_t dMult = (*fSpk)(0,0);
10769 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
10770 Double_t dReQ1n = (*fReQ)(0,0);
10771 Double_t dReQ2n = (*fReQ)(1,0);
10772 //Double_t dReQ3n = (*fReQ)(2,0);
10773 //Double_t dReQ4n = (*fReQ)(3,0);
10774 Double_t dImQ1n = (*fImQ)(0,0);
10775 Double_t dImQ2n = (*fImQ)(1,0);
10776 //Double_t dImQ3n = (*fImQ)(2,0);
10777 //Double_t dImQ4n = (*fImQ)(3,0);
10779 Int_t t = 0; // type flag
10780 Int_t pe = 0; // ptEta flag
10785 } else if(type == "POI")
10790 if(ptOrEta == "Pt")
10793 } else if(ptOrEta == "Eta")
10798 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
10799 Double_t minPtEta[2] = {fPtMin,fEtaMin};
10800 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
10801 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
10803 // looping over all bins and calculating correction terms:
10804 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10806 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
10807 Double_t p1n0kRe = 0.;
10808 Double_t p1n0kIm = 0.;
10810 // number of POIs in particular pt or eta bin:
10813 // 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):
10814 Double_t q1n0kRe = 0.;
10815 Double_t q1n0kIm = 0.;
10816 Double_t q2n0kRe = 0.;
10817 Double_t q2n0kIm = 0.;
10819 // number of particles which are both RPs and POIs in particular pt or eta bin:
10825 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))
10826 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));
10827 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))
10828 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));
10829 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))
10830 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));
10831 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))
10832 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b));
10834 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
10836 else if(type == "RP")
10839 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
10840 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
10841 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
10842 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
10843 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))
10844 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));
10845 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))
10846 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b));
10848 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
10853 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
10854 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
10855 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
10856 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
10858 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
10860 t = 1; // typeFlag = RP or POI
10862 else if(type == "RP")
10864 // p_{m*n,0} = q_{m*n,0}:
10870 t = 0; // typeFlag = RP or POI
10873 // <<sin n(psi1)>>:
10874 Double_t sinP1nPsi = 0.;
10877 sinP1nPsi = p1n0kIm/mp;
10878 // fill profile for <<sin n(psi1)>>:
10879 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi,mp);
10880 // histogram to store <sin n(psi1)> e-b-e (needed in some other methods):
10881 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][0]->SetBinContent(b,sinP1nPsi);
10884 // <<sin n(psi1+phi2)>>:
10885 Double_t sinP1nPsiP1nPhi = 0.;
10888 sinP1nPsiP1nPhi = (p1n0kRe*dImQ1n+p1n0kIm*dReQ1n-q2n0kIm)/(mp*dMult-mq);
10889 // fill profile for <<sin n(psi1+phi2)>>:
10890 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsiP1nPhi,mp*dMult-mq);
10891 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
10892 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][1]->SetBinContent(b,sinP1nPsiP1nPhi);
10893 } // end of if(mp*dMult-mq)
10895 // <<sin n(psi1+phi2-phi3)>>:
10896 Double_t sinP1nPsi1P1nPhi2MPhi3 = 0.;
10897 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
10899 sinP1nPsi1P1nPhi2MPhi3 = (p1n0kIm*(pow(dImQ1n,2.)+pow(dReQ1n,2.)-dMult)
10900 - 1.*(q2n0kIm*dReQ1n-q2n0kRe*dImQ1n)
10901 - mq*dImQ1n+2.*q1n0kIm)
10902 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
10903 // fill profile for <<sin n(psi1+phi2)>>:
10904 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1P1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
10905 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
10906 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][2]->SetBinContent(b,sinP1nPsi1P1nPhi2MPhi3);
10907 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
10909 // <<sin n(psi1-phi2-phi3)>>:
10910 Double_t sinP1nPsi1M1nPhi2MPhi3 = 0.;
10911 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
10913 sinP1nPsi1M1nPhi2MPhi3 = (p1n0kIm*(pow(dReQ1n,2.)-pow(dImQ1n,2.))-2.*p1n0kRe*dReQ1n*dImQ1n
10914 - 1.*(p1n0kIm*dReQ2n-p1n0kRe*dImQ2n)
10915 + 2.*mq*dImQ1n-2.*q1n0kIm)
10916 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
10917 // fill profile for <<sin n(psi1+phi2)>>:
10918 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1M1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
10919 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
10920 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][3]->SetBinContent(b,sinP1nPsi1M1nPhi2MPhi3);
10921 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
10922 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10924 } // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTerms(TString type, TString ptOrEta)
10927 //================================================================================================================================
10930 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTerms(TString type, TString ptOrEta)
10932 // Calculate correction terms for non-uniform acceptance for differential flow (cos terms).
10934 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][1][cti], where cti runs as follows:
10935 // 0: <<cos n(psi)>>
10936 // 1: <<cos n(psi1+phi2)>>
10937 // 2: <<cos n(psi1+phi2-phi3)>>
10938 // 3: <<cos n(psi1-phi2-phi3)>>
10944 Double_t dMult = (*fSpk)(0,0);
10946 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
10947 Double_t dReQ1n = (*fReQ)(0,0);
10948 Double_t dReQ2n = (*fReQ)(1,0);
10949 //Double_t dReQ3n = (*fReQ)(2,0);
10950 //Double_t dReQ4n = (*fReQ)(3,0);
10951 Double_t dImQ1n = (*fImQ)(0,0);
10952 Double_t dImQ2n = (*fImQ)(1,0);
10953 //Double_t dImQ3n = (*fImQ)(2,0);
10954 //Double_t dImQ4n = (*fImQ)(3,0);
10956 Int_t t = 0; // type flag
10957 Int_t pe = 0; // ptEta flag
10962 } else if(type == "POI")
10967 if(ptOrEta == "Pt")
10970 } else if(ptOrEta == "Eta")
10975 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
10976 Double_t minPtEta[2] = {fPtMin,fEtaMin};
10977 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
10978 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
10980 // looping over all bins and calculating correction terms:
10981 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
10983 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
10984 Double_t p1n0kRe = 0.;
10985 Double_t p1n0kIm = 0.;
10987 // number of POIs in particular pt or eta bin:
10990 // 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):
10991 Double_t q1n0kRe = 0.;
10992 Double_t q1n0kIm = 0.;
10993 Double_t q2n0kRe = 0.;
10994 Double_t q2n0kIm = 0.;
10996 // number of particles which are both RPs and POIs in particular pt or eta bin:
11002 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))
11003 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));
11004 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))
11005 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));
11006 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))
11007 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));
11008 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))
11009 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b));
11011 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
11013 else if(type == "RP")
11016 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
11017 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
11018 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
11019 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
11020 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))
11021 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));
11022 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))
11023 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b));
11025 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
11030 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
11031 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
11032 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
11033 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
11035 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
11037 t = 1; // typeFlag = RP or POI
11039 else if(type == "RP")
11041 // p_{m*n,0} = q_{m*n,0}:
11047 t = 0; // typeFlag = RP or POI
11050 // <<cos n(psi1)>>:
11051 Double_t cosP1nPsi = 0.;
11054 cosP1nPsi = p1n0kRe/mp;
11056 // fill profile for <<cos n(psi1)>>:
11057 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi,mp);
11058 // histogram to store <cos n(psi1)> e-b-e (needed in some other methods):
11059 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][0]->SetBinContent(b,cosP1nPsi);
11062 // <<cos n(psi1+phi2)>>:
11063 Double_t cosP1nPsiP1nPhi = 0.;
11066 cosP1nPsiP1nPhi = (p1n0kRe*dReQ1n-p1n0kIm*dImQ1n-q2n0kRe)/(mp*dMult-mq);
11067 // fill profile for <<sin n(psi1+phi2)>>:
11068 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsiP1nPhi,mp*dMult-mq);
11069 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
11070 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][1]->SetBinContent(b,cosP1nPsiP1nPhi);
11071 } // end of if(mp*dMult-mq)
11073 // <<cos n(psi1+phi2-phi3)>>:
11074 Double_t cosP1nPsi1P1nPhi2MPhi3 = 0.;
11075 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
11077 cosP1nPsi1P1nPhi2MPhi3 = (p1n0kRe*(pow(dImQ1n,2.)+pow(dReQ1n,2.)-dMult)
11078 - 1.*(q2n0kRe*dReQ1n+q2n0kIm*dImQ1n)
11079 - mq*dReQ1n+2.*q1n0kRe)
11080 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
11081 // fill profile for <<sin n(psi1+phi2)>>:
11082 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1P1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
11083 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
11084 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][2]->SetBinContent(b,cosP1nPsi1P1nPhi2MPhi3);
11085 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
11087 // <<cos n(psi1-phi2-phi3)>>:
11088 Double_t cosP1nPsi1M1nPhi2MPhi3 = 0.;
11089 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
11091 cosP1nPsi1M1nPhi2MPhi3 = (p1n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))+2.*p1n0kIm*dReQ1n*dImQ1n
11092 - 1.*(p1n0kRe*dReQ2n+p1n0kIm*dImQ2n)
11093 - 2.*mq*dReQ1n+2.*q1n0kRe)
11094 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
11095 // fill profile for <<sin n(psi1+phi2)>>:
11096 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1M1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));
11097 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):
11098 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][3]->SetBinContent(b,cosP1nPsi1M1nPhi2MPhi3);
11099 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))
11100 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
11102 } // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTerms(TString type, TString ptOrEta)
11104 //==================================================================================================================================
11106 void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUADiffFlow(TString type, TString ptOrEta)
11108 // Transfer profiles into histogams and correctly propagate the error.
11110 Int_t t = 0; // type flag
11111 Int_t pe = 0; // ptEta flag
11116 } else if(type == "POI")
11121 if(ptOrEta == "Pt")
11124 } else if(ptOrEta == "Eta")
11129 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
11130 //Double_t minPtEta[2] = {fPtMin,fEtaMin};
11131 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
11132 //Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
11134 for(Int_t sc=0;sc<2;sc++) // sin or cos
11136 for(Int_t cti=0;cti<9;cti++) // correction term index
11138 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
11140 Double_t correctionTerm = fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]->GetBinContent(b);
11141 fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti]->SetBinContent(b,correctionTerm);
11142 // to be improved (propagate error correctly)
11144 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
11145 } // correction term index
11146 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos
11148 }// end of void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUADiffFlow(TString type, TString ptOrEta)
11150 //==================================================================================================================================
11152 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulantsCorrectedForNUA(TString type, TString ptOrEta)
11154 // Calculate generalized differential flow cumulants (corrected for non-uniform acceptance).
11156 // to be improved - propagate error also from non-isotropic terms
11158 Int_t t = 0; // RP = 0, POI = 1
11159 Int_t pe = 0; // pt = 0, eta = 1
11164 } else if(type == "POI")
11169 if(ptOrEta == "Pt")
11172 } else if(ptOrEta == "Eta")
11178 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
11179 // 2-particle correlation:
11180 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
11181 // sinus terms coming from reference flow:
11182 Double_t sinP1nPhi = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1); // <<sin(n*phi1)>>
11183 Double_t sinP1nPhi1P1nPhi2 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2); // <<sin(n*(phi1+phi2))>>
11184 Double_t sinP1nPhi1M1nPhi2M1nPhi3 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(3); // <<sin(n*(phi1-phi2-phi3))>>
11185 // cosinus terms coming from reference flow:
11186 Double_t cosP1nPhi = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1); // <<cos(n*phi1)>>
11187 Double_t cosP1nPhi1P1nPhi2 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2); // <<cos(n*(phi1+phi2))>>
11188 Double_t cosP1nPhi1M1nPhi2M1nPhi3 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(3); // <<cos(n*(phi1-phi2-phi3))>>
11190 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
11192 Double_t twoPrime = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b); // <<2'>>
11193 Double_t fourPrime = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b); // <<4'>>
11194 Double_t sinP1nPsi = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][0]->GetBinContent(b); // <<sin n(Psi)>>
11195 Double_t cosP1nPsi = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][0]->GetBinContent(b); // <<cos n(Psi)>>
11196 Double_t sinP1nPsi1P1nPhi2 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][1]->GetBinContent(b); // <<sin n(psi1+phi2)>>
11197 Double_t cosP1nPsi1P1nPhi2 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][1]->GetBinContent(b); // <<cos n(psi1+phi2)>>
11198 Double_t sinP1nPsi1P1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][2]->GetBinContent(b); // <<sin n(psi1+phi2-phi3)>>
11199 Double_t cosP1nPsi1P1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][2]->GetBinContent(b); // <<cos n(psi1+phi2-phi3)>>
11200 Double_t sinP1nPsi1M1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][3]->GetBinContent(b); // <<sin n(psi1-phi2-phi3)>>
11201 Double_t cosP1nPsi1M1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][3]->GetBinContent(b); // <<cos n(psi1-phi2-phi3)>>
11202 // Generalized QC{2'}:
11203 Double_t qc2Prime = twoPrime - sinP1nPsi*sinP1nPhi - cosP1nPsi*cosP1nPhi;
11204 if(fApplyCorrectionForNUA)
11206 fDiffFlowCumulants[t][pe][0]->SetBinContent(b,qc2Prime);
11208 if(TMath::Abs(twoPrime)>0.)
11210 fDiffFlowDetectorBias[t][pe][0]->SetBinContent(b,qc2Prime/twoPrime); // detector bias = generalized/isotropic cumulant.
11212 // Generalized QC{4'}:
11213 Double_t qc4Prime = fourPrime-2.*twoPrime*two
11214 - cosP1nPsi*cosP1nPhi1M1nPhi2M1nPhi3
11215 + sinP1nPsi*sinP1nPhi1M1nPhi2M1nPhi3
11216 - cosP1nPhi*cosP1nPsi1M1nPhi2M1nPhi3
11217 + sinP1nPhi*sinP1nPsi1M1nPhi2M1nPhi3
11218 - 2.*cosP1nPhi*cosP1nPsi1P1nPhi2M1nPhi3
11219 - 2.*sinP1nPhi*sinP1nPsi1P1nPhi2M1nPhi3
11220 - cosP1nPsi1P1nPhi2*cosP1nPhi1P1nPhi2
11221 - sinP1nPsi1P1nPhi2*sinP1nPhi1P1nPhi2
11222 + 2.*cosP1nPhi1P1nPhi2*(cosP1nPsi*cosP1nPhi-sinP1nPsi*sinP1nPhi)
11223 + 2.*sinP1nPhi1P1nPhi2*(cosP1nPsi*sinP1nPhi+sinP1nPsi*cosP1nPhi)
11224 + 4.*two*(cosP1nPsi*cosP1nPhi+sinP1nPsi*sinP1nPhi)
11225 + 2.*cosP1nPsi1P1nPhi2*(pow(cosP1nPhi,2.)-pow(sinP1nPhi,2.))
11226 + 4.*sinP1nPsi1P1nPhi2*cosP1nPhi*sinP1nPhi
11227 + 4.*twoPrime*(pow(cosP1nPhi,2.)+pow(sinP1nPhi,2.))
11228 - 6.*(pow(cosP1nPhi,2.)-pow(sinP1nPhi,2.))
11229 * (cosP1nPsi*cosP1nPhi-sinP1nPsi*sinP1nPhi)
11230 - 12.*cosP1nPhi*sinP1nPhi
11231 * (sinP1nPsi*cosP1nPhi+cosP1nPsi*sinP1nPhi);
11232 if(fApplyCorrectionForNUA)
11234 fDiffFlowCumulants[t][pe][1]->SetBinContent(b,qc4Prime);
11236 if(TMath::Abs(fourPrime-2.*twoPrime*two)>0.)
11238 fDiffFlowDetectorBias[t][pe][1]->SetBinContent(b,qc4Prime/(fourPrime-2.*twoPrime*two)); // detector bias = generalized/isotropic cumulant.
11240 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
11242 } // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulantsCorrectedForNUA(TString type, TString ptOrEta)
11244 //==================================================================================================================================
11246 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectedForNUA(TString type, TString ptOrEta)
11248 // Calculate differential flow corrected for non-uniform acceptance.
11250 // to be improved: eventually I will have to access here masured correlations and NUA terms
11251 // instead of cumulants in order to propagate statistical error correctly also
11252 // to NUA terms (propagating errors directly from cumulants is WRONG for
11253 // differential flow becuase that doesn't account at all cross-covariance terms)
11255 // REMARK: When NUA correction is apllied error for differential flow DOES NOT get corrected,
11256 // i.e. only value is being corrected, error is still the one relevant for isotropic
11257 // case. This eventually will be resolved.
11260 Int_t t = 0; // RP or POI
11261 Int_t pe = 0; // pt or eta
11266 } else if(type == "POI")
11270 if(ptOrEta == "Pt")
11273 } else if(ptOrEta == "Eta")
11279 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
11280 // Reference Q-cumulants
11281 Double_t qc2 = fIntFlowQcumulants->GetBinContent(1); // QC{2}
11282 Double_t qc4 = fIntFlowQcumulants->GetBinContent(2); // QC{4}
11283 // Loop over pt or eta bins:
11284 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
11286 // Differential Q-cumulants:
11287 Double_t qc2Prime = fDiffFlowCumulants[t][pe][0]->GetBinContent(b); // QC{2'}
11288 Double_t qc4Prime = fDiffFlowCumulants[t][pe][1]->GetBinContent(b); // QC{4'}
11292 Double_t v2Prime = qc2Prime/pow(qc2,0.5);
11293 if(TMath::Abs(v2Prime)>0.){fDiffFlow[t][pe][0]->SetBinContent(b,v2Prime);}
11298 Double_t v4Prime = -qc4Prime/pow(-qc4,3./4.);
11299 if(TMath::Abs(v4Prime)>0.){fDiffFlow[t][pe][1]->SetBinContent(b,v4Prime);}
11301 } // end of for(Int_t b=1;b<=fnBinsPtEta[pe];b++)
11303 } // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectedForNUA(TString type, TString ptOrEta);
11305 //==================================================================================================================================
11307 void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoops(AliFlowEventSimple * const anEvent)
11309 // Evaluate with nested loops multiparticle correlations for integrated flow (without using the particle weights).
11311 // Remark: Results are stored in profile fIntFlowDirectCorrelations whose binning is organized as follows:
11313 // 1st bin: <2>_{1n|1n} = two1n1n = cos(n*(phi1-phi2))>
11314 // 2nd bin: <2>_{2n|2n} = two2n2n = cos(2n*(phi1-phi2))>
11315 // 3rd bin: <2>_{3n|3n} = two3n3n = cos(3n*(phi1-phi2))>
11316 // 4th bin: <2>_{4n|4n} = two4n4n = cos(4n*(phi1-phi2))>
11317 // 5th bin: ---- EMPTY ----
11318 // 6th bin: <3>_{2n|1n,1n} = three2n1n1n = <cos(n*(2.*phi1-phi2-phi3))>
11319 // 7th bin: <3>_{3n|2n,1n} = three3n2n1n = <cos(n*(3.*phi1-2.*phi2-phi3))>
11320 // 8th bin: <3>_{4n|2n,2n} = three4n2n2n = <cos(n*(4.*phi1-2.*phi2-2.*phi3))>
11321 // 9th bin: <3>_{4n|3n,1n} = three4n3n1n = <cos(n*(4.*phi1-3.*phi2-phi3))>
11322 // 10th bin: ---- EMPTY ----
11323 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1n = <cos(n*(phi1+phi2-phi3-phi4))>
11324 // 12th bin: <4>_{2n,1n|2n,1n} = four2n1n2n1n = <cos(2.*n*(phi1+phi2-phi3-phi4))>
11325 // 13th bin: <4>_{2n,2n|2n,2n} = four2n2n2n2n = <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>
11326 // 14th bin: <4>_{3n|1n,1n,1n} = four3n1n1n1n = <cos(n*(3.*phi1-phi2-phi3-phi4))>
11327 // 15th bin: <4>_{3n,1n|3n,1n} = four3n1n3n1n = <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>
11328 // 16th bin: <4>_{3n,1n|2n,2n} = four3n1n2n2n = <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>
11329 // 17th bin: <4>_{4n|2n,1n,1n} = four4n2n1n1n = <cos(n*(3.*phi1+phi2-3.*phi3-phi4))>
11330 // 18th bin: ---- EMPTY ----
11331 // 19th bin: <5>_{2n|1n,1n,1n,1n} = five2n1n1n1n1n = <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>
11332 // 20th bin: <5>_{2n,2n|2n,1n,1n} = five2n2n2n1n1n = <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>
11333 // 21st bin: <5>_{3n,1n|2n,1n,1n} = five3n1n2n1n1n = <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>
11334 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = five4n1n1n1n1n = <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>
11335 // 23rd bin: ---- EMPTY ----
11336 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = six1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>
11337 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = six2n1n1n2n1n1n = <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>
11338 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = six2n2n1n1n1n1n = <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>
11339 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = six3n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>
11340 // 28th bin: ---- EMPTY ----
11341 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = seven2n1n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>
11342 // 30th bin: ---- EMPTY ----
11343 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = eight1n1n1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>
11344 // 32nd bin: ---- EMPTY ----
11345 // Extra correlations for 3p TY study:
11346 // 33rd bin: <4>_{4n,2n|3n,3n}= four4n2n3n3n = <cos(n*(4.*phi1+2.*phi2-3.*phi3-3.*phi4))>
11347 // 34th bin: <5>_{3n,3n|2n,2n,2n} = five3n3n2n2n2n = <cos(n(3*phi1+3*phi2-2*phi3-2*phi4-2*phi5))>
11348 // Extra correlations for 6p TY study:
11349 // 35th bin: <2>_{5n|5n} = two5n5n = <cos(5n*(phi1-phi2)> T
11350 // 36th bin: <2>_{6n|6n} = two6n6n = <cos(6n*(phi1-phi2)> T
11351 // 37th bin: <3>_{5n|3n,2n} = three5n3n2n = <cos(n*(5*phi1-3*phi2-2*phi3)>
11352 // 38th bin: <3>_{5n|4n,1n} = three5n4n1n = <cos(n*(5*phi1-4*phi2-1*phi3)>
11353 // 39th bin: <3>_{6n|3n,3n} = three6n3n3n = <cos(n*(6*phi1-3*phi2-3*phi3)> T
11354 // 40th bin: <3>_{6n|4n,2n} = three6n4n2n = <cos(n*(6*phi1-4*phi2-2*phi3)> T
11355 // 41st bin: <3>_{6n|5n,1n} = three6n5n1n = <cos(n*(6*phi1-5*phi2-1*phi3)>
11356 // 42nd bin: <4>_{6n|3n,2n,1n} = four6n3n2n1n = <cos(n*(6*phi1-3*phi2-2*phi3-1*phi4)>
11357 // 43rd bin: <4>_{3n,2n|3n,2n} = four3n2n3n2n = <cos(n*(3*phi1+2*phi2-3*phi3-2*phi4)>
11358 // 44th bin: <4>_{4n,1n|3n,2n} = four4n1n3n2n = <cos(n*(4*phi1+1*phi2-3*phi3-2*phi4)>
11359 // 45th bin: <4>_{3n,3n|3n,3n} = four3n3n3n3n = <cos(3.*n*(phi1+phi2-phi3-phi4))> T
11360 // 46th bin: <4>_{4n,2n|3n,3n} = four4n2n3n3n = <cos(n*(4*phi1+2*phi2-3*phi3-3*phi4)>
11361 // 47th bin: <4>_{5n,1n|3n,3n} = four5n1n3n3n = <cos(n*(5*phi1+1*phi2-3*phi3-3*phi4)>
11362 // 48th bin: <4>_{4n,2n|4n,2n} = four4n2n4n2n = <cos(n*(4*phi1+2*phi2-4*phi3-2*phi4)> T
11363 // 49th bin: <4>_{5n,1n|4n,2n} = four5n1n4n2n = <cos(n*(5*phi1+1*phi2-4*phi3-2*phi4)>
11364 // 50th bin: <4>_{5n|3n,1n,1n} = four5n3n1n1n = <cos(n*(5*phi1-3*phi2-1*phi3-1*phi4)>
11365 // 51st bin: <4>_{5n|2n,2n,1n} = four5n2n2n1n = <cos(n*(5*phi1-2*phi2-2*phi3-1*phi4)>
11366 // 52nd bin: <4>_{5n,1n|5n,1n} = four5n1n5n1n = <cos(n*(5*phi1+1*phi2-5*phi3-1*phi4)>
11367 // 53rd bin: <5>_{3n,3n|3n,2n,1n} = four3n3n3n2n1n = <cos(n*(3*phi1+3*phi2-3*phi3-2*phi4-1*phi5)>
11368 // 54th bin: <5>_{4n,2n|3n,2n,1n} = four4n2n3n2n1n = <cos(n*(4*phi1+2*phi2-3*phi3-2*phi4-1*phi5)>
11369 // 55th bin: <5>_{3n,2n|3n,1n,1n} = four3n2n3n1n1n = <cos(n*(3*phi1+2*phi2-3*phi3-1*phi4-1*phi5)>
11370 // 56th bin: <5>_{3n,2n|2n,2n,1n} = four3n2n2n2n1n = <cos(n*(3*phi1+2*phi2-2*phi3-2*phi4-1*phi5)>
11371 // 57th bin: <5>_{5n,1n|3n,2n,1n} = four5n1n3n2n1n = <cos(n*(5*phi1+1*phi2-3*phi3-2*phi4-1*phi5)>
11372 // 58th bin: <6>_{3n,2n,1n|3n,2n,1n} = six3n2n1n3n2n1n = <cos(n*(3*phi1+2*phi2+1*phi3-3*phi4-2*phi5-1*phi6)>
11374 Int_t nPrim = anEvent->NumberOfTracks();
11375 AliFlowTrackSimple *aftsTrack = NULL;
11376 Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
11377 Int_t n = fHarmonic;
11378 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
11379 Double_t dMult = (*fSpk)(0,0);
11381 cout<<"Multiparticle correlations: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
11384 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
11385 } else if (dMult>fMaxAllowedMultiplicity)
11387 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
11390 cout<<"... evaluating nested loops (without using particle weights)..."<<endl;
11393 // 2-particle correlations:
11394 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
11396 for(Int_t i1=0;i1<nPrim;i1++)
11398 aftsTrack=anEvent->GetTrack(i1);
11399 if(!(aftsTrack->InRPSelection())) continue;
11400 phi1=aftsTrack->Phi();
11401 for(Int_t i2=0;i2<nPrim;i2++)
11403 if(i2==i1)continue;
11404 aftsTrack=anEvent->GetTrack(i2);
11405 if(!(aftsTrack->InRPSelection())) continue;
11406 phi2=aftsTrack->Phi();
11407 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
11408 // fill the profile with 2-p correlations:
11409 fIntFlowDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),1.); // <cos(n*(phi1-phi2))>
11410 fIntFlowDirectCorrelations->Fill(1.5,cos(2.*n*(phi1-phi2)),1.); // <cos(2n*(phi1-phi2))>
11411 fIntFlowDirectCorrelations->Fill(2.5,cos(3.*n*(phi1-phi2)),1.); // <cos(3n*(phi1-phi2))>
11412 fIntFlowDirectCorrelations->Fill(3.5,cos(4.*n*(phi1-phi2)),1.); // <cos(4n*(phi1-phi2))>
11413 fIntFlowDirectCorrelations->Fill(34.5,cos(5.*n*(phi1-phi2)),1.); // <cos(5n*(phi1-phi2))>
11414 fIntFlowDirectCorrelations->Fill(35.5,cos(6.*n*(phi1-phi2)),1.); // <cos(6n*(phi1-phi2))>
11415 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11416 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11417 } // end of if(nPrim>=2)
11419 // 3-particle correlations:
11420 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
11422 for(Int_t i1=0;i1<nPrim;i1++)
11424 aftsTrack=anEvent->GetTrack(i1);
11425 if(!(aftsTrack->InRPSelection())) continue;
11426 phi1=aftsTrack->Phi();
11427 for(Int_t i2=0;i2<nPrim;i2++)
11429 if(i2==i1)continue;
11430 aftsTrack=anEvent->GetTrack(i2);
11431 if(!(aftsTrack->InRPSelection())) continue;
11432 phi2=aftsTrack->Phi();
11433 for(Int_t i3=0;i3<nPrim;i3++)
11435 if(i3==i1||i3==i2)continue;
11436 aftsTrack=anEvent->GetTrack(i3);
11437 if(!(aftsTrack->InRPSelection())) continue;
11438 phi3=aftsTrack->Phi();
11439 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;
11440 // fill the profile with 3-p correlations:
11441 fIntFlowDirectCorrelations->Fill(5.,cos(2.*n*phi1-n*(phi2+phi3)),1.); //<3>_{2n|nn,n}
11442 fIntFlowDirectCorrelations->Fill(6.,cos(3.*n*phi1-2.*n*phi2-n*phi3),1.); //<3>_{3n|2n,n}
11443 fIntFlowDirectCorrelations->Fill(7.,cos(4.*n*phi1-2.*n*phi2-2.*n*phi3),1.); //<3>_{4n|2n,2n}
11444 fIntFlowDirectCorrelations->Fill(8.,cos(4.*n*phi1-3.*n*phi2-n*phi3),1.); //<3>_{4n|3n,n}
11445 fIntFlowDirectCorrelations->Fill(36.5,cos(5.*n*phi1-3.*n*phi2-2.*n*phi3),1.); //<3>_{5n|3n,2n}
11446 fIntFlowDirectCorrelations->Fill(37.5,cos(5.*n*phi1-4.*n*phi2-1.*n*phi3),1.); //<3>_{5n|4n,1n}
11447 fIntFlowDirectCorrelations->Fill(38.5,cos(6.*n*phi1-3.*n*phi2-3.*n*phi3),1.); //<3>_{6n|3n,3n}
11448 fIntFlowDirectCorrelations->Fill(39.5,cos(6.*n*phi1-4.*n*phi2-2.*n*phi3),1.); //<3>_{6n|4n,2n}
11449 fIntFlowDirectCorrelations->Fill(40.5,cos(6.*n*phi1-5.*n*phi2-1.*n*phi3),1.); //<3>_{6n|5n,1n}
11450 } // end of for(Int_t i3=0;i3<nPrim;i3++)
11451 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11452 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11453 } // end of if(nPrim>=3)
11455 // 4-particle correlations:
11456 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)
11458 for(Int_t i1=0;i1<nPrim;i1++)
11460 aftsTrack=anEvent->GetTrack(i1);
11461 if(!(aftsTrack->InRPSelection())) continue;
11462 phi1=aftsTrack->Phi();
11463 for(Int_t i2=0;i2<nPrim;i2++)
11465 if(i2==i1)continue;
11466 aftsTrack=anEvent->GetTrack(i2);
11467 if(!(aftsTrack->InRPSelection())) continue;
11468 phi2=aftsTrack->Phi();
11469 for(Int_t i3=0;i3<nPrim;i3++)
11471 if(i3==i1||i3==i2)continue;
11472 aftsTrack=anEvent->GetTrack(i3);
11473 if(!(aftsTrack->InRPSelection())) continue;
11474 phi3=aftsTrack->Phi();
11475 for(Int_t i4=0;i4<nPrim;i4++)
11477 if(i4==i1||i4==i2||i4==i3)continue;
11478 aftsTrack=anEvent->GetTrack(i4);
11479 if(!(aftsTrack->InRPSelection())) continue;
11480 phi4=aftsTrack->Phi();
11481 if(nPrim==4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush;
11482 // fill the profile with 4-p correlations:
11483 fIntFlowDirectCorrelations->Fill(10.,cos(n*phi1+n*phi2-n*phi3-n*phi4),1.); // <4>_{n,n|n,n}
11484 fIntFlowDirectCorrelations->Fill(11.,cos(2.*n*phi1+n*phi2-2.*n*phi3-n*phi4),1.); // <4>_{2n,n|2n,n}
11485 fIntFlowDirectCorrelations->Fill(12.,cos(2.*n*phi1+2*n*phi2-2.*n*phi3-2.*n*phi4),1.); // <4>_{2n,2n|2n,2n}
11486 fIntFlowDirectCorrelations->Fill(13.,cos(3.*n*phi1-n*phi2-n*phi3-n*phi4),1.); // <4>_{3n|n,n,n}
11487 fIntFlowDirectCorrelations->Fill(14.,cos(3.*n*phi1+n*phi2-3.*n*phi3-n*phi4),1.); // <4>_{3n,n|3n,n}
11488 fIntFlowDirectCorrelations->Fill(15.,cos(3.*n*phi1+n*phi2-2.*n*phi3-2.*n*phi4),1.); // <4>_{3n,n|2n,2n}
11489 fIntFlowDirectCorrelations->Fill(16.,cos(4.*n*phi1-2.*n*phi2-n*phi3-n*phi4),1.); // <4>_{4n|2n,n,n}
11490 fIntFlowDirectCorrelations->Fill(32.,cos(n*(4.*phi1+2.*phi2-3.*phi3-3.*phi4)),1.); // <4>_{4n,2n|3n,3n}
11491 fIntFlowDirectCorrelations->Fill(41.5,cos(n*(6.*phi1-3.*phi2-2.*phi3-1.*phi4)),1.); // <4>_{6n|3n,2n,1n}
11492 fIntFlowDirectCorrelations->Fill(42.5,cos(n*(3.*phi1+2.*phi2-3.*phi3-2.*phi4)),1.); // <4>_{3n,2n|3n,2n}
11493 fIntFlowDirectCorrelations->Fill(43.5,cos(n*(4.*phi1+1.*phi2-3.*phi3-2.*phi4)),1.); // <4>_{4n,1n|3n,2n}
11494 fIntFlowDirectCorrelations->Fill(44.5,cos(n*(3.*phi1+3.*phi2-3.*phi3-3.*phi4)),1.); // <4>_{3n,3n|3n,3n}
11495 fIntFlowDirectCorrelations->Fill(45.5,cos(n*(4.*phi1+2.*phi2-3.*phi3-3.*phi4)),1.); // <4>_{4n,2n|3n,3n}
11496 fIntFlowDirectCorrelations->Fill(46.5,cos(n*(5.*phi1+1.*phi2-3.*phi3-3.*phi4)),1.); // <4>_{5n,1n|3n,3n}
11497 fIntFlowDirectCorrelations->Fill(47.5,cos(n*(4.*phi1+2.*phi2-4.*phi3-2.*phi4)),1.); // <4>_{4n,2n|4n,2n}
11498 fIntFlowDirectCorrelations->Fill(48.5,cos(n*(5.*phi1+1.*phi2-4.*phi3-2.*phi4)),1.); // <4>_{5n,1n|4n,2n}
11499 fIntFlowDirectCorrelations->Fill(49.5,cos(n*(5.*phi1-3.*phi2-1.*phi3-1.*phi4)),1.); // <4>_{5n|3n,1n,1n}
11500 fIntFlowDirectCorrelations->Fill(50.5,cos(n*(5.*phi1-2.*phi2-2.*phi3-1.*phi4)),1.); // <4>_{5n|2n,2n,1n}
11501 fIntFlowDirectCorrelations->Fill(51.5,cos(n*(5.*phi1+1.*phi2-5.*phi3-1.*phi4)),1.); // <4>_{5n,1n|5n,1n}
11502 fIntFlowDirectCorrelations->Fill(58.5,cos(n*(6.*phi1-4.*phi2-1.*phi3-1.*phi4)),1.); // <4>_{6n|4n,1n,1n}
11503 fIntFlowDirectCorrelations->Fill(59.5,cos(n*(6.*phi1-2.*phi2-2.*phi3-2.*phi4)),1.); // <4>_{6n|2n,2n,2n}
11504 } // end of for(Int_t i4=0;i4<nPrim;i4++)
11505 } // end of for(Int_t i3=0;i3<nPrim;i3++)
11506 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11507 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11508 } // end of if(nPrim>=)
11510 // 5-particle correlations:
11511 if(nPrim>=5 && nPrim<=fMaxAllowedMultiplicity)
11513 for(Int_t i1=0;i1<nPrim;i1++)
11515 aftsTrack=anEvent->GetTrack(i1);
11516 if(!(aftsTrack->InRPSelection())) continue;
11517 phi1=aftsTrack->Phi();
11518 for(Int_t i2=0;i2<nPrim;i2++)
11520 if(i2==i1)continue;
11521 aftsTrack=anEvent->GetTrack(i2);
11522 if(!(aftsTrack->InRPSelection())) continue;
11523 phi2=aftsTrack->Phi();
11524 for(Int_t i3=0;i3<nPrim;i3++)
11526 if(i3==i1||i3==i2)continue;
11527 aftsTrack=anEvent->GetTrack(i3);
11528 if(!(aftsTrack->InRPSelection())) continue;
11529 phi3=aftsTrack->Phi();
11530 for(Int_t i4=0;i4<nPrim;i4++)
11532 if(i4==i1||i4==i2||i4==i3)continue;
11533 aftsTrack=anEvent->GetTrack(i4);
11534 if(!(aftsTrack->InRPSelection())) continue;
11535 phi4=aftsTrack->Phi();
11536 for(Int_t i5=0;i5<nPrim;i5++)
11538 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
11539 aftsTrack=anEvent->GetTrack(i5);
11540 if(!(aftsTrack->InRPSelection())) continue;
11541 phi5=aftsTrack->Phi();
11542 if(nPrim==5) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<"\r"<<flush;
11543 // fill the profile with 5-p correlations:
11544 fIntFlowDirectCorrelations->Fill(18.,cos(2.*n*phi1+n*phi2-n*phi3-n*phi4-n*phi5),1.); // <5>_{2n,n|n,n,n}
11545 fIntFlowDirectCorrelations->Fill(19.,cos(2.*n*phi1+2.*n*phi2-2.*n*phi3-n*phi4-n*phi5),1.); // <5>_{2n,2n|2n,n,n}
11546 fIntFlowDirectCorrelations->Fill(20.,cos(3.*n*phi1+n*phi2-2.*n*phi3-n*phi4-n*phi5),1.); // <5>_{3n,n|2n,n,n}
11547 fIntFlowDirectCorrelations->Fill(21.,cos(4.*n*phi1-n*phi2-n*phi3-n*phi4-n*phi5),1.); // <5>_{4n|n,n,n,n}
11548 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}
11549 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}
11550 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}
11551 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}
11552 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}
11553 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}
11554 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}
11555 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}
11556 } // end of for(Int_t i5=0;i5<nPrim;i5++)
11557 } // end of for(Int_t i4=0;i4<nPrim;i4++)
11558 } // end of for(Int_t i3=0;i3<nPrim;i3++)
11559 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11560 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11561 } // end of if(nPrim>=5)
11563 // 6-particle correlations:
11564 if(nPrim>=6 && nPrim<=fMaxAllowedMultiplicity)
11566 for(Int_t i1=0;i1<nPrim;i1++)
11568 aftsTrack=anEvent->GetTrack(i1);
11569 if(!(aftsTrack->InRPSelection())) continue;
11570 phi1=aftsTrack->Phi();
11571 for(Int_t i2=0;i2<nPrim;i2++)
11573 if(i2==i1)continue;
11574 aftsTrack=anEvent->GetTrack(i2);
11575 if(!(aftsTrack->InRPSelection())) continue;
11576 phi2=aftsTrack->Phi();
11577 for(Int_t i3=0;i3<nPrim;i3++)
11579 if(i3==i1||i3==i2)continue;
11580 aftsTrack=anEvent->GetTrack(i3);
11581 if(!(aftsTrack->InRPSelection())) continue;
11582 phi3=aftsTrack->Phi();
11583 for(Int_t i4=0;i4<nPrim;i4++)
11585 if(i4==i1||i4==i2||i4==i3)continue;
11586 aftsTrack=anEvent->GetTrack(i4);
11587 if(!(aftsTrack->InRPSelection())) continue;
11588 phi4=aftsTrack->Phi();
11589 for(Int_t i5=0;i5<nPrim;i5++)
11591 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
11592 aftsTrack=anEvent->GetTrack(i5);
11593 if(!(aftsTrack->InRPSelection())) continue;
11594 phi5=aftsTrack->Phi();
11595 for(Int_t i6=0;i6<nPrim;i6++)
11597 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
11598 aftsTrack=anEvent->GetTrack(i6);
11599 if(!(aftsTrack->InRPSelection())) continue;
11600 phi6=aftsTrack->Phi();
11601 if(nPrim==6) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<"\r"<<flush;
11602 // fill the profile with 6-p correlations:
11603 fIntFlowDirectCorrelations->Fill(23.,cos(n*phi1+n*phi2+n*phi3-n*phi4-n*phi5-n*phi6),1.); // <6>_{1n,1n,1n|1n,1n,1n}
11604 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}
11605 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}
11606 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}
11607 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}
11608 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}
11609 } // end of for(Int_t i6=0;i6<nPrim;i6++)
11610 } // end of for(Int_t i5=0;i5<nPrim;i5++)
11611 } // end of for(Int_t i4=0;i4<nPrim;i4++)
11612 } // end of for(Int_t i3=0;i3<nPrim;i3++)
11613 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11614 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11615 } // end of if(nPrim>=6)
11617 // 7-particle correlations:
11618 if(nPrim>=7 && nPrim<=fMaxAllowedMultiplicity)
11620 for(Int_t i1=0;i1<nPrim;i1++)
11622 aftsTrack=anEvent->GetTrack(i1);
11623 if(!(aftsTrack->InRPSelection())) continue;
11624 phi1=aftsTrack->Phi();
11625 for(Int_t i2=0;i2<nPrim;i2++)
11627 if(i2==i1)continue;
11628 aftsTrack=anEvent->GetTrack(i2);
11629 if(!(aftsTrack->InRPSelection())) continue;
11630 phi2=aftsTrack->Phi();
11631 for(Int_t i3=0;i3<nPrim;i3++)
11633 if(i3==i1||i3==i2)continue;
11634 aftsTrack=anEvent->GetTrack(i3);
11635 if(!(aftsTrack->InRPSelection())) continue;
11636 phi3=aftsTrack->Phi();
11637 for(Int_t i4=0;i4<nPrim;i4++)
11639 if(i4==i1||i4==i2||i4==i3)continue;
11640 aftsTrack=anEvent->GetTrack(i4);
11641 if(!(aftsTrack->InRPSelection())) continue;
11642 phi4=aftsTrack->Phi();
11643 for(Int_t i5=0;i5<nPrim;i5++)
11645 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
11646 aftsTrack=anEvent->GetTrack(i5);
11647 if(!(aftsTrack->InRPSelection())) continue;
11648 phi5=aftsTrack->Phi();
11649 for(Int_t i6=0;i6<nPrim;i6++)
11651 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
11652 aftsTrack=anEvent->GetTrack(i6);
11653 if(!(aftsTrack->InRPSelection())) continue;
11654 phi6=aftsTrack->Phi();
11655 for(Int_t i7=0;i7<nPrim;i7++)
11657 if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;
11658 aftsTrack=anEvent->GetTrack(i7);
11659 if(!(aftsTrack->InRPSelection())) continue;
11660 phi7=aftsTrack->Phi();
11661 if(nPrim==7) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<" "<<i7<<"\r"<<flush;
11662 // fill the profile with 7-p correlation:
11663 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}
11664 } // end of for(Int_t i7=0;i7<nPrim;i7++)
11665 } // end of for(Int_t i6=0;i6<nPrim;i6++)
11666 } // end of for(Int_t i5=0;i5<nPrim;i5++)
11667 } // end of for(Int_t i4=0;i4<nPrim;i4++)
11668 } // end of for(Int_t i3=0;i3<nPrim;i3++)
11669 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11670 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11671 } // end of if(nPrim>=7)
11673 // 8-particle correlations:
11674 if(nPrim>=8 && nPrim<=fMaxAllowedMultiplicity)
11676 for(Int_t i1=0;i1<nPrim;i1++)
11678 aftsTrack=anEvent->GetTrack(i1);
11679 if(!(aftsTrack->InRPSelection())) continue;
11680 phi1=aftsTrack->Phi();
11681 for(Int_t i2=0;i2<nPrim;i2++)
11683 if(i2==i1)continue;
11684 aftsTrack=anEvent->GetTrack(i2);
11685 if(!(aftsTrack->InRPSelection())) continue;
11686 phi2=aftsTrack->Phi();
11687 for(Int_t i3=0;i3<nPrim;i3++)
11689 if(i3==i1||i3==i2)continue;
11690 aftsTrack=anEvent->GetTrack(i3);
11691 if(!(aftsTrack->InRPSelection())) continue;
11692 phi3=aftsTrack->Phi();
11693 for(Int_t i4=0;i4<nPrim;i4++)
11695 if(i4==i1||i4==i2||i4==i3)continue;
11696 aftsTrack=anEvent->GetTrack(i4);
11697 if(!(aftsTrack->InRPSelection())) continue;
11698 phi4=aftsTrack->Phi();
11699 for(Int_t i5=0;i5<nPrim;i5++)
11701 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
11702 aftsTrack=anEvent->GetTrack(i5);
11703 if(!(aftsTrack->InRPSelection())) continue;
11704 phi5=aftsTrack->Phi();
11705 for(Int_t i6=0;i6<nPrim;i6++)
11707 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;
11708 aftsTrack=anEvent->GetTrack(i6);
11709 if(!(aftsTrack->InRPSelection())) continue;
11710 phi6=aftsTrack->Phi();
11711 for(Int_t i7=0;i7<nPrim;i7++)
11713 if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;
11714 aftsTrack=anEvent->GetTrack(i7);
11715 if(!(aftsTrack->InRPSelection())) continue;
11716 phi7=aftsTrack->Phi();
11717 for(Int_t i8=0;i8<nPrim;i8++)
11719 if(i8==i1||i8==i2||i8==i3||i8==i4||i8==i5||i8==i6||i8==i7)continue;
11720 aftsTrack=anEvent->GetTrack(i8);
11721 if(!(aftsTrack->InRPSelection())) continue;
11722 phi8=aftsTrack->Phi();
11723 cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<" "<<i7<<" "<<i8<<"\r"<<flush;
11724 // fill the profile with 8-p correlation:
11725 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}
11726 } // end of for(Int_t i8=0;i8<nPrim;i8++)
11727 } // end of for(Int_t i7=0;i7<nPrim;i7++)
11728 } // end of for(Int_t i6=0;i6<nPrim;i6++)
11729 } // end of for(Int_t i5=0;i5<nPrim;i5++)
11730 } // end of for(Int_t i4=0;i4<nPrim;i4++)
11731 } // end of for(Int_t i3=0;i3<nPrim;i3++)
11732 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11733 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11734 } // end of if(nPrim>=8)
11738 } // end of AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoops(AliFlowEventSimple* anEvent)
11741 //==================================================================================================================================
11744 void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrelations()
11746 // Cross-check results for multiparticle correlations needed for int. flow: results from Q-vectors vs results from nested loops.
11750 cout<<" *****************************************"<<endl;
11751 cout<<" **** cross-checking the correlations ****"<<endl;
11752 cout<<" **** for integrated flow ****"<<endl;
11753 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
11755 cout<<" **** (particle weights not used) ****"<<endl;
11758 cout<<" **** (particle weights used) ****"<<endl;
11760 cout<<" *****************************************"<<endl;
11764 Int_t ciMax = 64; // to be improved (removed eventually when I calculate 6th and 8th order with particle weights)
11766 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights)
11771 for(Int_t ci=1;ci<=ciMax;ci++)
11773 if(strcmp((fIntFlowCorrelationsAllPro->GetXaxis())->GetBinLabel(ci), "") == 0) continue; // to be improved (access finalized histogram here)
11774 cout<<(fIntFlowCorrelationsAllPro->GetXaxis())->GetBinLabel(ci)<<":"<<endl; // to be improved (access finalized histogram here)
11775 cout<<"from Q-vectors = "<<fIntFlowCorrelationsAllPro->GetBinContent(ci)<<endl; // to be improved (access finalized histogram here)
11776 cout<<"from nested loops = "<<fIntFlowDirectCorrelations->GetBinContent(ci)<<endl;
11780 } // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrelations()
11782 //================================================================================================================================
11784 void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrectionTermsForNUA()
11786 // Cross-check results for corrections terms for non-uniform acceptance needed for int. flow: results from Q-vectors vs results from nested loops.
11790 cout<<" *********************************************"<<endl;
11791 cout<<" **** cross-checking the correction terms ****"<<endl;
11792 cout<<" **** for non-uniform acceptance relevant ****"<<endl;
11793 cout<<" **** for integrated flow ****"<<endl;
11794 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
11796 cout<<" **** (particle weights not used) ****"<<endl;
11799 cout<<" **** (particle weights used) ****"<<endl;
11801 cout<<" *********************************************"<<endl;
11805 for(Int_t ci=1;ci<=4;ci++) // correction term index (to be improved - hardwired 4)
11807 for(Int_t sc=0;sc<2;sc++) // sin or cos term
11809 if(strcmp((fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->GetBinLabel(ci), "") == 0) continue; // to be improved (access finalized histogram here)
11810 cout<<(fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->GetBinLabel(ci)<<":"<<endl; // to be improved (access finalized histogram here)
11811 cout<<"from Q-vectors = "<<fIntFlowCorrectionTermsForNUAPro[sc]->GetBinContent(ci)<<endl; // to be improved (access finalized histogram here)
11812 cout<<"from nested loops = "<<fIntFlowDirectCorrectionTermsForNUA[sc]->GetBinContent(ci)<<endl;
11814 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos term
11815 } // end of for(Int_t ci=1;ci<=10;ci++) // correction term index
11817 } // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrectionTermsForNUA()
11819 //================================================================================================================================
11821 void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent)
11823 // Evaluate with nested loops multiparticle correlations for integrated flow (using the particle weights).
11825 // Results are stored in profile fIntFlowDirectCorrelations.
11826 // Remark 1: When particle weights are used the binning of fIntFlowDirectCorrelations is organized as follows:
11828 // 1st bin: <2>_{1n|1n} = two1n1nW1W1 = <w1 w2 cos(n*(phi1-phi2))>
11829 // 2nd bin: <2>_{2n|2n} = two2n2nW2W2 = <w1^2 w2^2 cos(2n*(phi1-phi2))>
11830 // 3rd bin: <2>_{3n|3n} = two3n3nW3W3 = <w1^3 w2^3 cos(3n*(phi1-phi2))>
11831 // 4th bin: <2>_{4n|4n} = two4n4nW4W4 = <w1^4 w2^4 cos(4n*(phi1-phi2))>
11832 // 5th bin: ---- EMPTY ----
11833 // 6th bin: <3>_{2n|1n,1n} = three2n1n1nW2W1W1 = <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>
11834 // 7th bin: <3>_{3n|2n,1n} = ...
11835 // 8th bin: <3>_{4n|2n,2n} = ...
11836 // 9th bin: <3>_{4n|3n,1n} = ...
11837 // 10th bin: ---- EMPTY ----
11838 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1nW1W1W1W1 = <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>
11839 // 12th bin: <4>_{2n,1n|2n,1n} = ...
11840 // 13th bin: <4>_{2n,2n|2n,2n} = ...
11841 // 14th bin: <4>_{3n|1n,1n,1n} = ...
11842 // 15th bin: <4>_{3n,1n|3n,1n} = ...
11843 // 16th bin: <4>_{3n,1n|2n,2n} = ...
11844 // 17th bin: <4>_{4n|2n,1n,1n} = ...
11845 // 18th bin: ---- EMPTY ----
11846 // 19th bin: <5>_{2n|1n,1n,1n,1n} = ...
11847 // 20th bin: <5>_{2n,2n|2n,1n,1n} = ...
11848 // 21st bin: <5>_{3n,1n|2n,1n,1n} = ...
11849 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = ...
11850 // 23rd bin: ---- EMPTY ----
11851 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = ...
11852 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = ...
11853 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = ...
11854 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = ...
11855 // 28th bin: ---- EMPTY ----
11856 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = ...
11857 // 30th bin: ---- EMPTY ----
11858 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = ...
11860 // Remark 2: When particle weights are used there are some extra correlations. They are stored in
11861 // fIntFlowExtraDirectCorrelations binning of which is organized as follows:
11863 // 1st bin: two1n1nW3W1 = <w1^3 w2 cos(n*(phi1-phi2))>
11864 // 2nd bin: two1n1nW1W1W2 = <w1 w2 w3^2 cos(n*(phi1-phi2))>
11867 Int_t nPrim = anEvent->NumberOfTracks();
11868 AliFlowTrackSimple *aftsTrack = NULL;
11869 //Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
11870 //Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1., wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
11871 Double_t phi1=0., phi2=0., phi3=0., phi4=0.;
11872 Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1.;
11873 Int_t n = fHarmonic;
11874 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
11875 Double_t dMult = (*fSpk)(0,0);
11877 cout<<"Multiparticle correlations: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
11880 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
11881 } else if (dMult>fMaxAllowedMultiplicity)
11883 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
11886 cout<<"... evaluating nested loops (using particle weights) ..."<<endl;
11889 // 2-particle correlations:
11890 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
11892 // 2 nested loops multiparticle correlations using particle weights:
11893 for(Int_t i1=0;i1<nPrim;i1++)
11895 aftsTrack=anEvent->GetTrack(i1);
11896 if(!(aftsTrack->InRPSelection())) continue;
11897 phi1=aftsTrack->Phi();
11898 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
11899 for(Int_t i2=0;i2<nPrim;i2++)
11901 if(i2==i1)continue;
11902 aftsTrack=anEvent->GetTrack(i2);
11903 if(!(aftsTrack->InRPSelection())) continue;
11904 phi2=aftsTrack->Phi();
11905 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
11906 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
11907 // 2-p correlations using particle weights:
11908 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),wPhi1*wPhi2); // <w1 w2 cos( n*(phi1-phi2))>
11909 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))>
11910 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))>
11911 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))>
11912 // extra correlations:
11913 // 2-p extra correlations (do not appear if particle weights are not used):
11914 if(fUsePhiWeights) fIntFlowExtraDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),pow(wPhi1,3)*wPhi2); // <w1^3 w2 cos(n*(phi1-phi2))>
11916 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11917 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11918 } // end of if(nPrim>=2)
11920 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
11922 // 3 nested loops multiparticle correlations using particle weights:
11923 for(Int_t i1=0;i1<nPrim;i1++)
11925 aftsTrack=anEvent->GetTrack(i1);
11926 if(!(aftsTrack->InRPSelection())) continue;
11927 phi1=aftsTrack->Phi();
11928 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
11929 for(Int_t i2=0;i2<nPrim;i2++)
11931 if(i2==i1)continue;
11932 aftsTrack=anEvent->GetTrack(i2);
11933 if(!(aftsTrack->InRPSelection())) continue;
11934 phi2=aftsTrack->Phi();
11935 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
11936 for(Int_t i3=0;i3<nPrim;i3++)
11938 if(i3==i1||i3==i2)continue;
11939 aftsTrack=anEvent->GetTrack(i3);
11940 if(!(aftsTrack->InRPSelection())) continue;
11941 phi3=aftsTrack->Phi();
11942 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
11943 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;
11944 // 3-p correlations using particle weights:
11945 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))>
11947 // extra correlations:
11948 // 2-p extra correlations (do not appear if particle weights are not used):
11949 if(fUsePhiWeights) fIntFlowExtraDirectCorrelations->Fill(1.5,cos(n*(phi1-phi2)),wPhi1*wPhi2*pow(wPhi3,2)); // <w1 w2 w3^2 cos(n*(phi1-phi2))>
11951 // 3-p extra correlations (do not appear if particle weights are not used):
11953 } // end of for(Int_t i3=0;i3<nPrim;i3++)
11954 } // end of for(Int_t i2=0;i2<nPrim;i2++)
11955 } // end of for(Int_t i1=0;i1<nPrim;i1++)
11956 } // end of if(nPrim>=3)
11958 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)
11960 // 4 nested loops multiparticle correlations using particle weights:
11961 for(Int_t i1=0;i1<nPrim;i1++)
11963 aftsTrack=anEvent->GetTrack(i1);
11964 if(!(aftsTrack->InRPSelection())) continue;
11965 phi1=aftsTrack->Phi();
11966 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
11967 for(Int_t i2=0;i2<nPrim;i2++)
11969 if(i2==i1)continue;
11970 aftsTrack=anEvent->GetTrack(i2);
11971 if(!(aftsTrack->InRPSelection())) continue;
11972 phi2=aftsTrack->Phi();
11973 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
11974 for(Int_t i3=0;i3<nPrim;i3++)
11976 if(i3==i1||i3==i2)continue;
11977 aftsTrack=anEvent->GetTrack(i3);
11978 if(!(aftsTrack->InRPSelection())) continue;
11979 phi3=aftsTrack->Phi();
11980 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
11981 for(Int_t i4=0;i4<nPrim;i4++)
11983 if(i4==i1||i4==i2||i4==i3)continue;
11984 aftsTrack=anEvent->GetTrack(i4);
11985 if(!(aftsTrack->InRPSelection())) continue;
11986 phi4=aftsTrack->Phi();
11987 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
11988 if(nPrim>=4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush; // to be improved (replace eventually this if statement with if(nPrim==4))
11989 // 4-p correlations using particle weights:
11990 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(10.5,cos(n*phi1+n*phi2-n*phi3-n*phi4),wPhi1*wPhi2*wPhi3*wPhi4);
11991 // extra correlations:
11992 // 2-p extra correlations (do not appear if particle weights are not used):
11994 // 3-p extra correlations (do not appear if particle weights are not used):
11996 // 4-p extra correlations (do not appear if particle weights are not used):
11998 } // end of for(Int_t i4=0;i4<nPrim;i4++)
11999 } // end of for(Int_t i3=0;i3<nPrim;i3++)
12000 } // end of for(Int_t i2=0;i2<nPrim;i2++)
12001 } // end of for(Int_t i1=0;i1<nPrim;i1++)
12002 } // end of if(nPrim>=4)
12006 } // end of void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent)
12008 //================================================================================================================================
12010 void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowExtraCorrelations()
12012 // Cross-check results for extra multiparticle correlations needed for int. flow
12013 // which appear only when particle weights are used: results from Q-vectors vs results from nested loops.
12017 cout<<" ***********************************************"<<endl;
12018 cout<<" **** cross-checking the extra correlations ****"<<endl;
12019 cout<<" **** for integrated flow ****"<<endl;
12020 cout<<" ***********************************************"<<endl;
12024 for(Int_t eci=1;eci<=2;eci++) // to be improved (increased eciMax eventually when I calculate 6th and 8th)
12026 if(strcmp((fIntFlowExtraCorrelationsPro->GetXaxis())->GetBinLabel(eci), "") == 0) continue;
12027 cout<<(fIntFlowExtraCorrelationsPro->GetXaxis())->GetBinLabel(eci)<<":"<<endl;
12028 cout<<"from Q-vectors = "<<fIntFlowExtraCorrelationsPro->GetBinContent(eci)<<endl;
12029 cout<<"from nested loops = "<<fIntFlowExtraDirectCorrelations->GetBinContent(eci)<<endl;
12033 } // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowExtraCorrelations()
12035 //================================================================================================================================
12037 void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoops(AliFlowEventSimple * const anEvent)
12039 // Evaluate with nested loops correction terms for non-uniform acceptance relevant for NONAME integrated flow (to be improved (name)).
12041 // Remark: Both sin and cos correction terms are calculated in this method. Sin terms are stored in fIntFlowDirectCorrectionTermsForNUA[0],
12042 // and cos terms in fIntFlowDirectCorrectionTermsForNUA[1]. Binning of fIntFlowDirectCorrectionTermsForNUA[sc] is organized as follows
12043 // (sc stands for either sin or cos):
12045 // 1st bin: <<sc(n*(phi1))>>
12046 // 2nd bin: <<sc(n*(phi1+phi2))>>
12047 // 3rd bin: <<sc(n*(phi1-phi2-phi3))>>
12048 // 4th bin: <<sc(n*(2phi1-phi2))>>
12050 Int_t nPrim = anEvent->NumberOfTracks();
12051 AliFlowTrackSimple *aftsTrack = NULL;
12052 Double_t phi1=0., phi2=0., phi3=0.;
12053 Int_t n = fHarmonic;
12054 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
12055 Double_t dMult = (*fSpk)(0,0);
12057 cout<<"Correction terms for non-uniform acceptance: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
12060 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
12061 } else if (dMult>fMaxAllowedMultiplicity)
12063 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
12066 cout<<"... evaluating nested loops (without using particle weights)..."<<endl;
12069 if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)
12071 // 1-particle correction terms for non-uniform acceptance:
12072 for(Int_t i1=0;i1<nPrim;i1++)
12074 aftsTrack=anEvent->GetTrack(i1);
12075 if(!(aftsTrack->InRPSelection())) continue;
12076 phi1=aftsTrack->Phi();
12077 if(nPrim==1) cout<<i1<<"\r"<<flush;
12079 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(0.5,sin(n*phi1),1.); // <sin(n*phi1)>
12081 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(0.5,cos(n*phi1),1.); // <cos(n*phi1)>
12082 } // end of for(Int_t i1=0;i1<nPrim;i1++)
12083 } // end of if(nPrim>=1)
12085 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
12087 // 2-particle correction terms for non-uniform acceptance:
12088 for(Int_t i1=0;i1<nPrim;i1++)
12090 aftsTrack=anEvent->GetTrack(i1);
12091 if(!(aftsTrack->InRPSelection())) continue;
12092 phi1=aftsTrack->Phi();
12093 for(Int_t i2=0;i2<nPrim;i2++)
12095 if(i2==i1)continue;
12096 aftsTrack=anEvent->GetTrack(i2);
12097 if(!(aftsTrack->InRPSelection())) continue;
12098 phi2=aftsTrack->Phi();
12099 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
12101 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(1.5,sin(n*(phi1+phi2)),1.); // <<sin(n*(phi1+phi2))>>
12102 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(3.5,sin(n*(2*phi1-phi2)),1.); // <<sin(n*(2*phi1-phi2))>>
12104 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(1.5,cos(n*(phi1+phi2)),1.); // <<cos(n*(phi1+phi2))>>
12105 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(3.5,cos(n*(2*phi1-phi2)),1.); // <<cos(n*(2*phi1-phi2))>>
12106 } // end of for(Int_t i2=0;i2<nPrim;i2++)
12107 } // end of for(Int_t i1=0;i1<nPrim;i1++)
12108 } // end of if(nPrim>=2)
12110 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
12112 // 3-particle correction terms for non-uniform acceptance:
12113 for(Int_t i1=0;i1<nPrim;i1++)
12115 aftsTrack=anEvent->GetTrack(i1);
12116 if(!(aftsTrack->InRPSelection())) continue;
12117 phi1=aftsTrack->Phi();
12118 for(Int_t i2=0;i2<nPrim;i2++)
12120 if(i2==i1)continue;
12121 aftsTrack=anEvent->GetTrack(i2);
12122 if(!(aftsTrack->InRPSelection())) continue;
12123 phi2=aftsTrack->Phi();
12124 for(Int_t i3=0;i3<nPrim;i3++)
12126 if(i3==i1||i3==i2)continue;
12127 aftsTrack=anEvent->GetTrack(i3);
12128 if(!(aftsTrack->InRPSelection())) continue;
12129 phi3=aftsTrack->Phi();
12130 if(nPrim>=3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush; // to be improved (eventually I will change this if statement)
12132 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(2.5,sin(n*(phi1-phi2-phi3)),1.); // <<sin(n*(phi1-phi2-phi3))>>
12134 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(2.5,cos(n*(phi1-phi2-phi3)),1.); // <<cos(n*(phi1-phi2-phi3))>>
12135 } // end of for(Int_t i3=0;i3<nPrim;i3++)
12136 } // end of for(Int_t i2=0;i2<nPrim;i2++)
12137 } // end of for(Int_t i1=0;i1<nPrim;i1++)
12138 } // end of if(nPrim>=3)
12143 //================================================================================================================================
12145 void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoops(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
12147 // Evaluate reduced correlations with nested loops without using the particle weights.
12149 // Remark 1: Reduced correlations are evaluated in pt bin number fCrossCheckInPtBinNo and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
12150 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrelations[t][pe][ci], where indices runs as follows:
12151 // [0=RP,1=POI][0=Pt,1=Eta][0=<2'>,1=<4'>,2=<6'>,3=<8'>]
12152 // Remark 3: <2'> = <cos(n*(psi1-phi2))>
12153 // <4'> = <cos(n*(psi1+phi2-phi3-phi4))>
12156 Int_t typeFlag = 0;
12157 Int_t ptEtaFlag = 0;
12161 } else if(type == "POI")
12165 if(ptOrEta == "Pt")
12168 } else if(ptOrEta == "Eta")
12173 Int_t t = typeFlag;
12174 Int_t pe = ptEtaFlag;
12176 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
12177 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
12178 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
12180 Int_t nPrim = anEvent->NumberOfTracks();
12181 AliFlowTrackSimple *aftsTrack = NULL;
12183 Double_t psi1=0., phi2=0., phi3=0., phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
12185 Int_t n = fHarmonic;
12187 // 2'-particle correlations:
12188 for(Int_t i1=0;i1<nPrim;i1++)
12190 aftsTrack=anEvent->GetTrack(i1);
12191 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12192 if(typeFlag==1) // this is diff flow of POIs
12194 if(ptOrEta == "Pt")
12196 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12197 } else if (ptOrEta == "Eta")
12199 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12201 } else // this is diff flow of RPs
12203 if(ptOrEta == "Pt")
12205 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12206 } else if (ptOrEta == "Eta")
12208 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12212 psi1=aftsTrack->Phi();
12213 for(Int_t i2=0;i2<nPrim;i2++)
12215 if(i2==i1)continue;
12216 aftsTrack=anEvent->GetTrack(i2);
12217 // RP condition (!(first) particle in the correlator must be RP):
12218 if(!(aftsTrack->InRPSelection()))continue;
12219 phi2=aftsTrack->Phi();
12220 // 2'-particle correlations:
12221 fDiffFlowDirectCorrelations[t][pe][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(1.*n*(psi1-phi2)),1.); // <cos(n*(psi1-phi2))
12222 }//end of for(Int_t i2=0;i2<nPrim;i2++)
12223 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12227 // 3'-particle correlations:
12228 for(Int_t i1=0;i1<nPrim;i1++)
12230 aftsTrack=anEvent->GetTrack(i1);
12231 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12232 if(ptOrEta == "Pt")
12234 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12235 } else if (ptOrEta == "Eta")
12237 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12239 psi1=aftsTrack->Phi();
12240 for(Int_t i2=0;i2<nPrim;i2++)
12242 if(i2==i1)continue;
12243 aftsTrack=anEvent->GetTrack(i2);
12244 // RP condition (!(first) particle in the correlator must be RP):
12245 if(!(aftsTrack->InRPSelection())) continue;
12246 phi2=aftsTrack->Phi();
12247 for(Int_t i3=0;i3<nPrim;i3++)
12249 if(i3==i1||i3==i2)continue;
12250 aftsTrack=anEvent->GetTrack(i3);
12251 // RP condition (!(first) particle in the correlator must be RP):
12252 if(!(aftsTrack->InRPSelection())) continue;
12253 phi3=aftsTrack->Phi();
12254 // 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))>
12255 }//end of for(Int_t i3=0;i3<nPrim;i3++)
12256 }//end of for(Int_t i2=0;i2<nPrim;i2++)
12257 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12261 // 4'-particle correlations:
12262 for(Int_t i1=0;i1<nPrim;i1++)
12264 aftsTrack=anEvent->GetTrack(i1);
12265 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12266 if(typeFlag==1) // this is diff flow of POIs
12268 if(ptOrEta == "Pt")
12270 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12271 } else if (ptOrEta == "Eta")
12273 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12275 } else // this is diff flow of RPs
12277 if(ptOrEta == "Pt")
12279 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12280 } else if (ptOrEta == "Eta")
12282 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12286 psi1=aftsTrack->Phi();
12287 for(Int_t i2=0;i2<nPrim;i2++)
12289 if(i2==i1) continue;
12290 aftsTrack=anEvent->GetTrack(i2);
12291 // RP condition (!(first) particle in the correlator must be RP):
12292 if(!(aftsTrack->InRPSelection())) continue;
12293 phi2=aftsTrack->Phi();
12294 for(Int_t i3=0;i3<nPrim;i3++)
12296 if(i3==i1||i3==i2) continue;
12297 aftsTrack=anEvent->GetTrack(i3);
12298 // RP condition (!(first) particle in the correlator must be RP):
12299 if(!(aftsTrack->InRPSelection())) continue;
12300 phi3=aftsTrack->Phi();
12301 for(Int_t i4=0;i4<nPrim;i4++)
12303 if(i4==i1||i4==i2||i4==i3) continue;
12304 aftsTrack=anEvent->GetTrack(i4);
12305 // RP condition (!(first) particle in the correlator must be RP):
12306 if(!(aftsTrack->InRPSelection())) continue;
12307 phi4=aftsTrack->Phi();
12308 // 4'-particle correlations:
12309 fDiffFlowDirectCorrelations[t][pe][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3-phi4)),1.); // <cos(n(psi1+phi2-phi3-phi4))>
12310 }//end of for(Int_t i4=0;i4<nPrim;i4++)
12311 }//end of for(Int_t i3=0;i3<nPrim;i3++)
12312 }//end of for(Int_t i2=0;i2<nPrim;i2++)
12313 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12315 // count # of RPs and POIs in selected pt and eta bins for cross-checkings:
12316 for(Int_t i=0;i<nPrim;i++)
12318 aftsTrack=anEvent->GetTrack(i);
12319 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12320 if(typeFlag==1) // this is diff flow of POIs
12322 if(ptOrEta == "Pt")
12324 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12325 } else if (ptOrEta == "Eta")
12327 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12329 } else // this is diff flow of RPs
12331 if(ptOrEta == "Pt")
12333 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12334 } else if (ptOrEta == "Eta")
12336 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12340 fNoOfParticlesInBin->Fill(t+pe+0.5);
12343 } // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoops(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
12345 //================================================================================================================================
12347 void AliFlowAnalysisWithQCumulants::EvaluateOtherDiffCorrelatorsWithNestedLoops(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
12349 // Evaluate other differential correlators with nested loops without using the particle weights.
12351 // Remark 1: Other differential correlators are evaluated in pt bin number fCrossCheckInPtBinNo
12352 // and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
12353 // Remark 2: Results are stored in 1 bin profiles fOtherDirectDiffCorrelators[t][pe][sc][ci], where indices runs as follows:
12354 // [0=RP,1=POI][0=Pt,1=Eta][0=sin terms,1=cos terms][ci = correlator index]
12355 // Remark 3: Correlator index 'ci' runs as follows:
12356 // 0: <exp(n*(psi1-3phi2+2phi3))> (Teaney-Yan correlator)
12358 Int_t typeFlag = 0;
12359 Int_t ptEtaFlag = 0;
12363 } else if(type == "POI")
12367 if(ptOrEta == "Pt")
12370 } else if(ptOrEta == "Eta")
12375 Int_t t = typeFlag;
12376 Int_t pe = ptEtaFlag;
12378 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
12379 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
12380 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
12382 Int_t nPrim = anEvent->NumberOfTracks();
12383 AliFlowTrackSimple *aftsTrack = NULL;
12385 Double_t psi1=0., phi2=0., phi3=0.;
12387 Int_t n = fHarmonic;
12389 // 3-p correlators:
12390 for(Int_t i1=0;i1<nPrim;i1++)
12392 aftsTrack=anEvent->GetTrack(i1);
12393 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12394 if(typeFlag==1) // this is diff flow of POIs
12396 if(ptOrEta == "Pt")
12398 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12399 } else if (ptOrEta == "Eta")
12401 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12403 } else // this is diff flow of RPs
12405 if(ptOrEta == "Pt")
12407 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12408 } else if (ptOrEta == "Eta")
12410 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12413 psi1=aftsTrack->Phi();
12414 for(Int_t i2=0;i2<nPrim;i2++)
12416 if(i2==i1) continue;
12417 aftsTrack=anEvent->GetTrack(i2);
12418 // RP condition (!(first) particle in the correlator must be RP):
12419 if(!(aftsTrack->InRPSelection())) continue;
12420 phi2=aftsTrack->Phi();
12421 for(Int_t i3=0;i3<nPrim;i3++)
12423 if(i3==i1||i3==i2) continue;
12424 aftsTrack=anEvent->GetTrack(i3);
12425 // RP condition (!(first) particle in the correlator must be RP):
12426 if(!(aftsTrack->InRPSelection())) continue;
12427 phi3=aftsTrack->Phi();
12428 // Fill 3-p correlators:
12429 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))>
12430 }//end of for(Int_t i3=0;i3<nPrim;i3++)
12431 }//end of for(Int_t i2=0;i2<nPrim;i2++)
12432 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12433 } // end of void AliFlowAnalysisWithQCumulants::EvaluateOtherDiffCorrelatorsWithNestedLoops(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
12435 //================================================================================================================================
12437 void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrelations(TString type, TString ptOrEta)
12439 // Compare correlations needed for diff. flow calculated with nested loops and those calculated from Q-vectors
12441 Int_t typeFlag = 0;
12442 Int_t ptEtaFlag = 0;
12446 } else if(type == "POI")
12450 if(ptOrEta == "Pt")
12453 } else if(ptOrEta == "Eta")
12458 Int_t t = typeFlag;
12459 Int_t pe = ptEtaFlag;
12461 TString rpORpoiString[2] = {"RP ","POI"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
12462 TString ptORetaString[2] = {"pt","eta"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
12463 TString reducedCorrelations[4] = {"<<cos(n(psi1-phi2))>>","<<cos(n(psi1+phi2-phi3-phi4))>>","",""}; // to be improved (access this from pro or hist)
12464 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
12465 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
12467 Int_t crossCheckInPtEtaBinNo[2] = {fCrossCheckInPtBinNo,fCrossCheckInEtaBinNo};
12471 cout<<" *****************************************"<<endl;
12472 cout<<" **** cross-checking the correlations ****"<<endl;
12473 cout<<" **** for differential flow ("<<rpORpoiString[t]<<") ****"<<endl;
12474 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
12476 cout<<" **** (particle weights not used) ****"<<endl;
12479 cout<<" **** (particle weights used) ****"<<endl;
12481 cout<<" *****************************************"<<endl;
12483 cout<<" "<<ptORetaString[pe]<<" bin: "<<lowerPtEtaEdge[pe]<<" <= "<<ptORetaString[pe]<<" < "<<upperPtEtaEdge[pe]<<endl;
12486 for(Int_t rci=0;rci<2;rci++) // to be improved (calculate 6th and 8th order)
12488 cout<<" "<<reducedCorrelations[rci].Data()<<":"<<endl;
12489 cout<<" from Q-vectors = "<<fDiffFlowCorrelationsPro[t][pe][rci]->GetBinContent(crossCheckInPtEtaBinNo[pe])<<endl;
12490 cout<<" from nested loops = "<<fDiffFlowDirectCorrelations[t][pe][rci]->GetBinContent(1)<<endl;
12492 } // end of for(Int_t rci=0;rci<4;rci++)
12494 } // end of void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrelations(TString type, TString ptOrEta)
12496 //================================================================================================================================
12498 void AliFlowAnalysisWithQCumulants::CrossCheckOtherDiffCorrelators(TString type, TString ptOrEta)
12500 // Compare correlations needed for diff. flow calculated with nested loops and those calculated from Q-vectors
12502 Int_t typeFlag = 0;
12503 Int_t ptEtaFlag = 0;
12507 } else if(type == "POI")
12511 if(ptOrEta == "Pt")
12514 } else if(ptOrEta == "Eta")
12519 Int_t t = typeFlag;
12520 Int_t pe = ptEtaFlag;
12522 TString rpORpoiString[2] = {"RP ","POI"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
12523 TString ptORetaString[2] = {"pt","eta"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
12524 TString otherCorrelators[1] = {"<<cos(n(psi1-3phi2+2phi3))>>"}; // to be improved (access this from pro or hist)
12525 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
12526 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
12528 Int_t crossCheckInPtEtaBinNo[2] = {fCrossCheckInPtBinNo,fCrossCheckInEtaBinNo};
12531 cout<<" *****************************************"<<endl;
12532 cout<<" **** cross-checking the other ****"<<endl;
12533 cout<<" **** diff. correlators ("<<rpORpoiString[t]<<") ****"<<endl;
12534 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
12536 cout<<" **** (particle weights not used) ****"<<endl;
12539 cout<<" **** (particle weights used) ****"<<endl;
12541 cout<<" *****************************************"<<endl;
12543 cout<<" "<<ptORetaString[pe]<<" bin: "<<lowerPtEtaEdge[pe]<<" <= "<<ptORetaString[pe]<<" < "<<upperPtEtaEdge[pe]<<endl;
12546 for(Int_t ci=0;ci<1;ci++)
12548 cout<<" "<<otherCorrelators[ci].Data()<<":"<<endl;
12549 cout<<" from Q-vectors = "<<fOtherDiffCorrelators[t][pe][1][ci]->GetBinContent(crossCheckInPtEtaBinNo[pe])<<endl;
12550 cout<<" from nested loops = "<<fOtherDirectDiffCorrelators[t][pe][1][ci]->GetBinContent(1)<<endl;
12552 } // end of for(Int_t ci=0;ci<1;ci++)
12554 } // end of void AliFlowAnalysisWithQCumulants::CrossCheckOtherDiffCorrelators(TString type, TString ptOrEta)
12556 //================================================================================================================================
12558 void AliFlowAnalysisWithQCumulants::PrintNumberOfParticlesInSelectedBin()
12560 // Print on the screen number of RPs and POIs in selected pt and eta bin for cross checkings.
12563 cout<<"Number of RPs in selected pt bin = "<<fNoOfParticlesInBin->GetBinContent(1)<<endl;
12564 cout<<"Number of RPs in selected eta bin = "<<fNoOfParticlesInBin->GetBinContent(2)<<endl;
12565 cout<<"Number of POIs in selected pt bin = "<<fNoOfParticlesInBin->GetBinContent(3)<<endl;
12566 cout<<"Number of POIs in selected eta bin = "<<fNoOfParticlesInBin->GetBinContent(4)<<endl;
12568 } // end of void AliFlowAnalysisWithQCumulants::PrintNumberOfParticlesInSelectedBin()
12570 //================================================================================================================================
12572 void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
12574 // Evaluate reduced correlations with nested loops without using the particle weights.
12576 // Remark 1: Reduced correlations are evaluated in pt bin number fCrossCheckInPtBinNo and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
12577 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrelations[t][pe][ci], where indices runs as follows:
12578 // [0=RP,1=POI][0=Pt,1=Eta][0=<2'>,1=<4'>,2=<6'>,3=<8'>]
12579 // Remark 3: <2'> = <w2 cos(n*(psi1-phi2))>
12580 // <4'> = <w2 w3 w4 cos(n*(psi1+phi2-phi3-phi4))>
12583 Int_t typeFlag = 0;
12584 Int_t ptEtaFlag = 0;
12588 } else if(type == "POI")
12592 if(ptOrEta == "Pt")
12595 } else if(ptOrEta == "Eta")
12600 Int_t t = typeFlag;
12601 Int_t pe = ptEtaFlag;
12603 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
12604 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
12605 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
12607 Int_t nPrim = anEvent->NumberOfTracks();
12608 AliFlowTrackSimple *aftsTrack = NULL;
12610 Double_t psi1=0., phi2=0., phi3=0., phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
12611 Double_t wPhi2=1., wPhi3=1., wPhi4=1.;// wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
12613 Int_t n = fHarmonic;
12615 // 2'-particle correlations:
12616 for(Int_t i1=0;i1<nPrim;i1++)
12618 aftsTrack=anEvent->GetTrack(i1);
12619 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12620 if(typeFlag==1) // this is diff flow of POIs
12622 if(ptOrEta == "Pt")
12624 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12625 } else if (ptOrEta == "Eta")
12627 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12629 } else // this is diff flow of RPs
12631 if(ptOrEta == "Pt")
12633 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12634 } else if (ptOrEta == "Eta")
12636 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12639 psi1=aftsTrack->Phi();
12640 for(Int_t i2=0;i2<nPrim;i2++)
12642 if(i2==i1) continue;
12643 aftsTrack=anEvent->GetTrack(i2);
12644 // RP condition (!(first) particle in the correlator must be RP):
12645 if(!(aftsTrack->InRPSelection())) continue;
12646 phi2=aftsTrack->Phi();
12647 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
12648 // 2'-particle correlations:
12649 fDiffFlowDirectCorrelations[t][pe][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(1.*n*(psi1-phi2)),wPhi2); // <w2 cos(n*(psi1-phi2))
12650 }//end of for(Int_t i2=0;i2<nPrim;i2++)
12651 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12653 // 4'-particle correlations:
12654 for(Int_t i1=0;i1<nPrim;i1++)
12656 aftsTrack=anEvent->GetTrack(i1);
12657 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12658 if(typeFlag==1) // this is diff flow of POIs
12660 if(ptOrEta == "Pt")
12662 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12663 } else if (ptOrEta == "Eta")
12665 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12667 } else // this is diff flow of RPs
12669 if(ptOrEta == "Pt")
12671 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12672 } else if (ptOrEta == "Eta")
12674 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12677 psi1=aftsTrack->Phi();
12678 for(Int_t i2=0;i2<nPrim;i2++)
12680 if(i2==i1) continue;
12681 aftsTrack=anEvent->GetTrack(i2);
12682 // RP condition (!(first) particle in the correlator must be RP):
12683 if(!(aftsTrack->InRPSelection())) continue;
12684 phi2=aftsTrack->Phi();
12685 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
12686 for(Int_t i3=0;i3<nPrim;i3++)
12688 if(i3==i1||i3==i2) continue;
12689 aftsTrack=anEvent->GetTrack(i3);
12690 // RP condition (!(first) particle in the correlator must be RP):
12691 if(!(aftsTrack->InRPSelection())) continue;
12692 phi3=aftsTrack->Phi();
12693 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
12694 for(Int_t i4=0;i4<nPrim;i4++)
12696 if(i4==i1||i4==i2||i4==i3) continue;
12697 aftsTrack=anEvent->GetTrack(i4);
12698 // RP condition (!(first) particle in the correlator must be RP):
12699 if(!(aftsTrack->InRPSelection())) continue;
12700 phi4=aftsTrack->Phi();
12701 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
12702 // 4'-particle correlations <w2 w3 w4 cos(n(psi1+phi2-phi3-phi4))>:
12703 fDiffFlowDirectCorrelations[t][pe][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3-phi4)),wPhi2*wPhi3*wPhi4);
12704 }//end of for(Int_t i4=0;i4<nPrim;i4++)
12705 }//end of for(Int_t i3=0;i3<nPrim;i3++)
12706 }//end of for(Int_t i2=0;i2<nPrim;i2++)
12707 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12709 // count # of RPs and POIs in selected pt and eta bins for cross-checkings: (to be improved - moved to dedicated method)
12710 for(Int_t i=0;i<nPrim;i++)
12712 aftsTrack=anEvent->GetTrack(i);
12713 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12714 if(typeFlag==1) // this is diff flow of POIs
12716 if(ptOrEta == "Pt")
12718 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12719 } else if (ptOrEta == "Eta")
12721 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12723 } else // this is diff flow of RPs
12725 if(ptOrEta == "Pt")
12727 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12728 } else if (ptOrEta == "Eta")
12730 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12734 fNoOfParticlesInBin->Fill(t+pe+0.5);
12737 } // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
12739 //================================================================================================================================
12741 void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
12743 // Evaluate with nested loops correction terms for non-uniform acceptance (both sin and cos terms) relevant for differential flow.
12745 // Remark 1: Reduced correction terms for non-uniform acceptance are evaluated in pt bin number fCrossCheckInPtBinNo
12746 // and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
12747 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrections[t][pe][sc][cti], where first three indices runs as:
12748 // [0=RP,1=POI][0=Pt,1=Eta][0=sin terms,1=cos terms], whilst the cti (correction term index) runs as follows:
12750 // 0: <<sc n(psi1)>>
12751 // 1: <<sc n(psi1+phi2)>>
12752 // 2: <<sc n(psi1+phi2-phi3)>>
12753 // 3: <<sc n(psi1-phi2-phi3)>>
12758 Int_t typeFlag = 0;
12759 Int_t ptEtaFlag = 0;
12763 } else if(type == "POI")
12767 if(ptOrEta == "Pt")
12770 } else if(ptOrEta == "Eta")
12775 Int_t t = typeFlag;
12776 Int_t pe = ptEtaFlag;
12778 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
12779 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
12780 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
12782 Int_t nPrim = anEvent->NumberOfTracks();
12783 AliFlowTrackSimple *aftsTrack = NULL;
12785 Double_t psi1=0., phi2=0., phi3=0.;// phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
12787 Int_t n = fHarmonic;
12789 // 1-particle correction terms:
12790 for(Int_t i1=0;i1<nPrim;i1++)
12792 aftsTrack=anEvent->GetTrack(i1);
12793 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12794 if(typeFlag==1) // this is diff flow of POIs
12796 if(ptOrEta == "Pt")
12798 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12799 } else if (ptOrEta == "Eta")
12801 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12803 } else // this is diff flow of RPs
12805 if(ptOrEta == "Pt")
12807 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12808 } else if (ptOrEta == "Eta")
12810 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12813 psi1=aftsTrack->Phi();
12815 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*psi1),1.); // <<sin(n*(psi1))>>
12817 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*psi1),1.); // <<cos(n*(psi1))>>
12818 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12820 // 2-particle correction terms:
12821 for(Int_t i1=0;i1<nPrim;i1++)
12823 aftsTrack=anEvent->GetTrack(i1);
12824 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12825 if(typeFlag==1) // this is diff flow of POIs
12827 if(ptOrEta == "Pt")
12829 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12830 } else if (ptOrEta == "Eta")
12832 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12834 } else // this is diff flow of RPs
12836 if(ptOrEta == "Pt")
12838 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12839 } else if (ptOrEta == "Eta")
12841 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12844 psi1=aftsTrack->Phi();
12845 for(Int_t i2=0;i2<nPrim;i2++)
12847 if(i2==i1) continue;
12848 aftsTrack=anEvent->GetTrack(i2);
12849 // RP condition (!(first) particle in the correlator must be RP):
12850 if(!(aftsTrack->InRPSelection())) continue;
12851 phi2=aftsTrack->Phi();
12853 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2)),1.); // <<sin(n*(psi1+phi2))>>
12855 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2)),1.); // <<cos(n*(psi1+phi2))>>
12856 }//end of for(Int_t i2=0;i2<nPrim;i2++)
12857 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12859 // 3-particle correction terms:
12860 for(Int_t i1=0;i1<nPrim;i1++)
12862 aftsTrack=anEvent->GetTrack(i1);
12863 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
12864 if(typeFlag==1) // this is diff flow of POIs
12866 if(ptOrEta == "Pt")
12868 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12869 } else if (ptOrEta == "Eta")
12871 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
12873 } else // this is diff flow of RPs
12875 if(ptOrEta == "Pt")
12877 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12878 } else if (ptOrEta == "Eta")
12880 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
12883 psi1=aftsTrack->Phi();
12884 for(Int_t i2=0;i2<nPrim;i2++)
12886 if(i2==i1) continue;
12887 aftsTrack=anEvent->GetTrack(i2);
12888 // RP condition (!(first) particle in the correlator must be RP):
12889 if(!(aftsTrack->InRPSelection())) continue;
12890 phi2=aftsTrack->Phi();
12891 for(Int_t i3=0;i3<nPrim;i3++)
12893 if(i3==i1||i3==i2) continue;
12894 aftsTrack=anEvent->GetTrack(i3);
12895 // RP condition (!(first) particle in the correlator must be RP):
12896 if(!(aftsTrack->InRPSelection())) continue;
12897 phi3=aftsTrack->Phi();
12899 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][2]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2-phi3)),1.); // <<sin(n*(psi1+phi2-phi3))>>
12900 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][3]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1-phi2-phi3)),1.); // <<sin(n*(psi1-phi2-phi3))>>
12902 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][2]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3)),1.); // <<cos(n*(psi1+phi2-phi3))>>
12903 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][3]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1-phi2-phi3)),1.); // <<cos(n*(psi1-phi2-phi3))>>
12904 }//end of for(Int_t i3=0;i3<nPrim;i3++)
12905 }//end of for(Int_t i2=0;i2<nPrim;i2++)
12906 }//end of for(Int_t i1=0;i1<nPrim;i1++)
12908 } // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
12911 //================================================================================================================================
12914 void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrectionTermsForNUA(TString type, TString ptOrEta)
12916 // Compare corrections temrs for non-uniform acceptance needed for diff. flow calculated with nested loops and those calculated from Q-vectors
12918 Int_t typeFlag = 0;
12919 Int_t ptEtaFlag = 0;
12923 } else if(type == "POI")
12927 if(ptOrEta == "Pt")
12930 } else if(ptOrEta == "Eta")
12935 Int_t t = typeFlag;
12936 Int_t pe = ptEtaFlag;
12938 TString rpORpoiString[2] = {"RP ","POI"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
12939 TString ptORetaString[2] = {"pt","eta"}; // to be improved (name in the same way as in the other methods, eventually promote to data member)
12940 //TString sinCosFlag[2] = {"sin","cos"}; // to be improved (eventually promote to data member)
12941 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)
12942 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)
12943 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
12944 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
12946 Int_t crossCheckInPtEtaBinNo[2] = {fCrossCheckInPtBinNo,fCrossCheckInEtaBinNo};
12949 cout<<" ******************************************"<<endl;
12950 cout<<" **** cross-checking the correction ****"<<endl;
12951 cout<<" **** terms for non-uniform acceptance ****"<<endl;
12952 cout<<" **** for differential flow ("<<rpORpoiString[t]<<") ****"<<endl;
12953 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
12955 cout<<" **** (particle weights not used) ****"<<endl;
12958 cout<<" **** (particle weights used) ****"<<endl;
12960 cout<<" ******************************************"<<endl;
12962 cout<<" "<<ptORetaString[pe]<<" bin: "<<lowerPtEtaEdge[pe]<<" <= "<<ptORetaString[pe]<<" < "<<upperPtEtaEdge[pe]<<endl;
12965 for(Int_t cti=0;cti<4;cti++) // correction term index
12967 for(Int_t sc=0;sc<2;sc++) // sin or cos terms
12969 if(sc==0) // to be improved (this can be implemented better)
12971 cout<<" "<<reducedCorrectionSinTerms[cti].Data()<<":"<<endl;
12974 cout<<" "<<reducedCorrectionCosTerms[cti].Data()<<":"<<endl;
12976 cout<<" from Q-vectors = "<<fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]->GetBinContent(crossCheckInPtEtaBinNo[pe])<<endl;
12977 cout<<" from nested loops = "<<fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti]->GetBinContent(1)<<endl;
12980 } // end of for(Int_t rci=0;rci<4;rci++)
12982 } // end of void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrectionTermsForNUA(TString type, TString ptOrEta)
12984 //================================================================================================================================
12986 void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights()
12988 // Calculate corrections using particle weights for non-uniform acceptance of the detector for no-name integrated flow (cos terms).
12990 // **********************************************************************
12991 // **** weighted corrections for non-uniform acceptance (cos terms): ****
12992 // **********************************************************************
12994 // Remark 1: When particle weights are used the binning of fIntFlowCorrectionTermsForNUAPro[1] is organized as follows:
12996 // 1st bin: <<w1 cos(n*(phi1))>> = cosP1nW1
12997 // 2nd bin: <<w1 w2 cos(n*(phi1+phi2))>> = cosP1nP1nW1W1
12998 // 3rd bin: <<w1 w2 w3 cos(n*(phi1-phi2-phi3))>> = cosP1nM1nM1nW1W1W1
13001 // multiplicity (number of particles used to determine the reaction plane)
13002 Double_t dMult = (*fSpk)(0,0);
13004 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
13005 Double_t dReQ1n1k = (*fReQ)(0,1);
13006 Double_t dReQ2n2k = (*fReQ)(1,2);
13007 //Double_t dReQ3n3k = (*fReQ)(2,3);
13008 //Double_t dReQ4n4k = (*fReQ)(3,4);
13009 Double_t dReQ1n3k = (*fReQ)(0,3);
13010 Double_t dImQ1n1k = (*fImQ)(0,1);
13011 Double_t dImQ2n2k = (*fImQ)(1,2);
13012 //Double_t dImQ3n3k = (*fImQ)(2,3);
13013 //Double_t dImQ4n4k = (*fImQ)(3,4);
13014 //Double_t dImQ1n3k = (*fImQ)(0,3);
13016 // dMs are variables introduced in order to simplify some Eqs. bellow:
13017 //..............................................................................................
13018 Double_t dM11 = (*fSpk)(1,1)-(*fSpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
13019 Double_t dM111 = (*fSpk)(2,1)-3.*(*fSpk)(0,2)*(*fSpk)(0,1)
13020 + 2.*(*fSpk)(0,3); // dM111 = sum_{i,j,k=1,i!=j!=k}^M w_i w_j w_k
13021 //..............................................................................................
13023 Double_t cosP1nW1 = 0.; // <<w1 cos(n*(phi1))>>
13025 if(dMult>0 && TMath::Abs((*fSpk)(0,1))>1.e-6)
13027 cosP1nW1 = dReQ1n1k/(*fSpk)(0,1);
13029 // average weighted 1-particle correction (cos terms) for non-uniform acceptance for single event:
13030 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(1,cosP1nW1);
13032 // final average weighted 1-particle correction (cos terms) for non-uniform acceptance for all events:
13033 fIntFlowCorrectionTermsForNUAPro[1]->Fill(0.5,cosP1nW1,(*fSpk)(0,1));
13037 Double_t cosP1nP1nW1W1 = 0.; // <<w1 w2 cos(n*(phi1+phi2))>>
13039 if(dMult>1 && TMath::Abs(dM11)>1.e-6)
13041 cosP1nP1nW1W1 = (pow(dReQ1n1k,2)-pow(dImQ1n1k,2)-dReQ2n2k)/dM11;
13043 // average weighted 2-particle correction (cos terms) for non-uniform acceptance for single event:
13044 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(2,cosP1nP1nW1W1);
13046 // final average weighted 2-particle correction (cos terms) for non-uniform acceptance for all events:
13047 fIntFlowCorrectionTermsForNUAPro[1]->Fill(1.5,cosP1nP1nW1W1,dM11);
13051 Double_t cosP1nM1nM1nW1W1W1 = 0.; // <<w1 w2 w3 cos(n*(phi1-phi2-phi3))>>
13053 if(dMult>2 && TMath::Abs(dM111)>1.e-6)
13055 cosP1nM1nM1nW1W1W1 = (dReQ1n1k*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
13056 - dReQ1n1k*dReQ2n2k-dImQ1n1k*dImQ2n2k
13057 - 2.*((*fSpk)(0,2))*dReQ1n1k
13061 // average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for single event:
13062 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(3,cosP1nM1nM1nW1W1W1);
13064 // final average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for all events:
13065 fIntFlowCorrectionTermsForNUAPro[1]->Fill(2.5,cosP1nM1nM1nW1W1W1,dM111);
13068 } // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights()
13071 //================================================================================================================================
13074 void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights()
13076 // calculate corrections using particle weights for non-uniform acceptance of the detector for no-name integrated flow (sin terms)
13078 // **********************************************************************
13079 // **** weighted corrections for non-uniform acceptance (sin terms): ****
13080 // **********************************************************************
13082 // Remark 1: When particle weights are used the binning of fIntFlowCorrectionTermsForNUAPro[0] is organized as follows:
13084 // 1st bin: <<w1 sin(n*(phi1))>> = sinP1nW1
13085 // 2nd bin: <<w1 w2 sin(n*(phi1+phi2))>> = sinP1nP1nW1W1
13086 // 3rd bin: <<w1 w2 w3 sin(n*(phi1-phi2-phi3))>> = sinP1nM1nM1nW1W1W1
13089 // multiplicity (number of particles used to determine the reaction plane)
13090 Double_t dMult = (*fSpk)(0,0);
13092 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
13093 Double_t dReQ1n1k = (*fReQ)(0,1);
13094 Double_t dReQ2n2k = (*fReQ)(1,2);
13095 //Double_t dReQ3n3k = (*fReQ)(2,3);
13096 //Double_t dReQ4n4k = (*fReQ)(3,4);
13097 //Double_t dReQ1n3k = (*fReQ)(0,3);
13098 Double_t dImQ1n1k = (*fImQ)(0,1);
13099 Double_t dImQ2n2k = (*fImQ)(1,2);
13100 //Double_t dImQ3n3k = (*fImQ)(2,3);
13101 //Double_t dImQ4n4k = (*fImQ)(3,4);
13102 Double_t dImQ1n3k = (*fImQ)(0,3);
13104 // dMs are variables introduced in order to simplify some Eqs. bellow:
13105 //..............................................................................................
13106 Double_t dM11 = (*fSpk)(1,1)-(*fSpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j
13107 Double_t dM111 = (*fSpk)(2,1)-3.*(*fSpk)(0,2)*(*fSpk)(0,1)
13108 + 2.*(*fSpk)(0,3); // dM111 = sum_{i,j,k=1,i!=j!=k}^M w_i w_j w_k
13109 //..............................................................................................
13112 Double_t sinP1nW1 = 0.; // <<w1 sin(n*(phi1))>>
13114 if(dMult>0 && TMath::Abs((*fSpk)(0,1))>1.e-6)
13116 sinP1nW1 = dImQ1n1k/((*fSpk)(0,1));
13118 // average weighted 1-particle correction (sin terms) for non-uniform acceptance for single event:
13119 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(1,sinP1nW1);
13121 // final average weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
13122 fIntFlowCorrectionTermsForNUAPro[0]->Fill(0.5,sinP1nW1,(*fSpk)(0,1));
13126 Double_t sinP1nP1nW1W1 = 0.; // <<w1 w2 sin(n*(phi1+phi2))>>
13128 if(dMult>1 && TMath::Abs(dM11)>1.e-6)
13130 sinP1nP1nW1W1 = (2.*dReQ1n1k*dImQ1n1k-dImQ2n2k)/dM11;
13132 // average weighted 2-particle correction (sin terms) for non-uniform acceptance for single event:
13133 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(2,sinP1nP1nW1W1);
13135 // final average weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
13136 fIntFlowCorrectionTermsForNUAPro[0]->Fill(1.5,sinP1nP1nW1W1,dM11);
13140 Double_t sinP1nM1nM1nW1W1W1 = 0.; // <<w1 w2 w3 sin(n*(phi1-phi2-phi3))>>
13142 if(dMult>2 && TMath::Abs(dM111)>1.e-6)
13144 sinP1nM1nM1nW1W1W1 = (-dImQ1n1k*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
13145 + dReQ1n1k*dImQ2n2k-dImQ1n1k*dReQ2n2k
13146 + 2.*((*fSpk)(0,2))*dImQ1n1k
13150 // average weighted 3-particle correction (sin terms) for non-uniform acceptance for single event:
13151 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(3,sinP1nM1nM1nW1W1W1);
13153 // final average weighted 3-particle correction (sin terms) for non-uniform acceptance for all events:
13154 fIntFlowCorrectionTermsForNUAPro[0]->Fill(2.5,sinP1nM1nM1nW1W1W1,dM111);
13157 } // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights()
13159 //================================================================================================================================
13161 void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent)
13163 // Evaluate with nested loops correction terms for non-uniform acceptance for integrated flow (using the particle weights).
13165 // Results are stored in profiles fIntFlowDirectCorrectionTermsForNUA[0] (sin terms) and
13166 // fIntFlowDirectCorrectionTermsForNUA[1] (cos terms).
13168 // Remark 1: When particle weights are used the binning of fIntFlowDirectCorrectionTermsForNUA[sc] is
13169 // organized as follows (sc stands for either sin or cos):
13171 // 1st bin: <<w1 sc(n*(phi1))>> = scP1nW1
13172 // 2nd bin: <<w1 w2 sc(n*(phi1+phi2))>> = scP1nP1nW1W1
13173 // 3rd bin: <<w1 w2 w3 sc(n*(phi1-phi2-phi3))>> = scP1nM1nM1nW1W1W1
13176 Int_t nPrim = anEvent->NumberOfTracks();
13177 AliFlowTrackSimple *aftsTrack = NULL;
13178 //Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;
13179 //Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1., wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;
13180 Double_t phi1=0., phi2=0., phi3=0.;
13181 Double_t wPhi1=1., wPhi2=1., wPhi3=1.;
13182 Int_t n = fHarmonic;
13183 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)
13184 Double_t dMult = (*fSpk)(0,0);
13186 cout<<"Correction terms for non-uniform acceptance: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;
13189 cout<<"... skipping this event (multiplicity too low) ..."<<endl;
13190 } else if (dMult>fMaxAllowedMultiplicity)
13192 cout<<"... skipping this event (multiplicity too high) ..."<<endl;
13195 cout<<"... evaluating nested loops (using particle weights) ..."<<endl;
13198 // 1-particle correction terms using particle weights:
13199 if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)
13201 for(Int_t i1=0;i1<nPrim;i1++)
13203 aftsTrack=anEvent->GetTrack(i1);
13204 if(!(aftsTrack->InRPSelection())) continue;
13205 phi1=aftsTrack->Phi();
13206 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
13207 // 1-particle correction terms using particle weights:
13208 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(0.5,sin(n*phi1),wPhi1); // <w1 sin(n*phi1)>
13209 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(0.5,cos(n*phi1),wPhi1); // <w1 cos(n*phi1)>
13210 } // end of for(Int_t i1=0;i1<nPrim;i1++)
13211 } // end of if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)
13213 // 2-particle correction terms using particle weights:
13214 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)
13216 for(Int_t i1=0;i1<nPrim;i1++)
13218 aftsTrack=anEvent->GetTrack(i1);
13219 if(!(aftsTrack->InRPSelection())) continue;
13220 phi1=aftsTrack->Phi();
13221 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
13222 for(Int_t i2=0;i2<nPrim;i2++)
13224 if(i2==i1)continue;
13225 aftsTrack=anEvent->GetTrack(i2);
13226 if(!(aftsTrack->InRPSelection())) continue;
13227 phi2=aftsTrack->Phi();
13228 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
13229 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;
13230 // 2-p correction terms using particle weights:
13231 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(1.5,sin(n*(phi1+phi2)),wPhi1*wPhi2); // <w1 w2 sin(n*(phi1+phi2))>
13232 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(1.5,cos(n*(phi1+phi2)),wPhi1*wPhi2); // <w1 w2 cos(n*(phi1+phi2))>
13233 } // end of for(Int_t i2=0;i2<nPrim;i2++)
13234 } // end of for(Int_t i1=0;i1<nPrim;i1++)
13235 } // end of if(nPrim>=2)
13237 // 3-particle correction terms using particle weights:
13238 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)
13240 for(Int_t i1=0;i1<nPrim;i1++)
13242 aftsTrack=anEvent->GetTrack(i1);
13243 if(!(aftsTrack->InRPSelection())) continue;
13244 phi1=aftsTrack->Phi();
13245 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
13246 for(Int_t i2=0;i2<nPrim;i2++)
13248 if(i2==i1)continue;
13249 aftsTrack=anEvent->GetTrack(i2);
13250 if(!(aftsTrack->InRPSelection())) continue;
13251 phi2=aftsTrack->Phi();
13252 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
13253 for(Int_t i3=0;i3<nPrim;i3++)
13255 if(i3==i1||i3==i2)continue;
13256 aftsTrack=anEvent->GetTrack(i3);
13257 if(!(aftsTrack->InRPSelection())) continue;
13258 phi3=aftsTrack->Phi();
13259 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
13260 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;
13261 // 3-p correction terms using particle weights:
13262 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(2.5,sin(n*(phi1-phi2-phi3)),wPhi1*wPhi2*wPhi3); // <w1 w2 w3 sin(n*(phi1-phi2-phi3))>
13263 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(2.5,cos(n*(phi1-phi2-phi3)),wPhi1*wPhi2*wPhi3); // <w1 w2 w3 cos(n*(phi1-phi2-phi3))>
13264 } // end of for(Int_t i3=0;i3<nPrim;i3++)
13265 } // end of for(Int_t i2=0;i2<nPrim;i2++)
13266 } // end of for(Int_t i1=0;i1<nPrim;i1++)
13267 } // end of if(nPrim>=3)
13271 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)
13273 // 4 nested loops multiparticle correlations using particle weights:
13274 for(Int_t i1=0;i1<nPrim;i1++)
13276 aftsTrack=anEvent->GetTrack(i1);
13277 if(!(aftsTrack->InRPSelection())) continue;
13278 phi1=aftsTrack->Phi();
13279 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));
13280 for(Int_t i2=0;i2<nPrim;i2++)
13282 if(i2==i1)continue;
13283 aftsTrack=anEvent->GetTrack(i2);
13284 if(!(aftsTrack->InRPSelection())) continue;
13285 phi2=aftsTrack->Phi();
13286 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
13287 for(Int_t i3=0;i3<nPrim;i3++)
13289 if(i3==i1||i3==i2)continue;
13290 aftsTrack=anEvent->GetTrack(i3);
13291 if(!(aftsTrack->InRPSelection())) continue;
13292 phi3=aftsTrack->Phi();
13293 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
13294 for(Int_t i4=0;i4<nPrim;i4++)
13296 if(i4==i1||i4==i2||i4==i3)continue;
13297 aftsTrack=anEvent->GetTrack(i4);
13298 if(!(aftsTrack->InRPSelection())) continue;
13299 phi4=aftsTrack->Phi();
13300 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));
13301 if(nPrim>=4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush; // to be improved (replace eventually this if statement with if(nPrim==4))
13302 // 4-p correlations using particle weights:
13303 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(10.5,cos(n*phi1+n*phi2-n*phi3-n*phi4),wPhi1*wPhi2*wPhi3*wPhi4);
13304 // extra correlations:
13305 // 2-p extra correlations (do not appear if particle weights are not used):
13307 // 3-p extra correlations (do not appear if particle weights are not used):
13309 // 4-p extra correlations (do not appear if particle weights are not used):
13311 } // end of for(Int_t i4=0;i4<nPrim;i4++)
13312 } // end of for(Int_t i3=0;i3<nPrim;i3++)
13313 } // end of for(Int_t i2=0;i2<nPrim;i2++)
13314 } // end of for(Int_t i1=0;i1<nPrim;i1++)
13315 } // end of if(nPrim>=4)
13321 } // end of void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent)
13323 //================================================================================================================================
13325 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights(TString type, TString ptOrEta)
13327 // Calculate correction terms for non-uniform acceptance for differential flow (cos terms) using particle weights.
13329 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][1][cti], where cti runs as follows:
13331 // 0: <<cos n(psi)>>
13332 // 1: <<w2 cos n(psi1+phi2)>>
13333 // 2: <<w2 w3 cos n(psi1+phi2-phi3)>>
13334 // 3: <<w2 w3 cos n(psi1-phi2-phi3)>>
13339 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
13340 Double_t dReQ1n1k = (*fReQ)(0,1);
13341 Double_t dReQ2n2k = (*fReQ)(1,2);
13342 //Double_t dReQ1n3k = (*fReQ)(0,3);
13343 //Double_t dReQ4n4k = (*fReQ)(3,4);
13344 Double_t dImQ1n1k = (*fImQ)(0,1);
13345 Double_t dImQ2n2k = (*fImQ)(1,2);
13346 //Double_t dImQ1n3k = (*fImQ)(0,3);
13347 //Double_t dImQ4n4k = (*fImQ)(3,4);
13349 // S^M_{p,k} (see .h file for the definition of fSpk):
13350 Double_t dSM1p1k = (*fSpk)(0,1);
13351 Double_t dSM1p2k = (*fSpk)(0,2);
13352 Double_t dSM2p1k = (*fSpk)(1,1);
13354 Int_t t = 0; // type flag
13355 Int_t pe = 0; // ptEta flag
13360 } else if(type == "POI")
13365 if(ptOrEta == "Pt")
13368 } else if(ptOrEta == "Eta")
13373 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
13374 Double_t minPtEta[2] = {fPtMin,fEtaMin};
13375 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
13376 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
13378 // looping over all bins and calculating correction terms:
13379 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
13381 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
13382 Double_t p1n0kRe = 0.;
13383 Double_t p1n0kIm = 0.;
13385 // number of POIs in particular pt or eta bin:
13388 // 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):
13389 Double_t q1n2kRe = 0.;
13390 Double_t q1n2kIm = 0.;
13391 Double_t q2n1kRe = 0.;
13392 Double_t q2n1kIm = 0.;
13394 // s_{1,1}, s_{1,2} // to be improved (add explanation)
13395 Double_t s1p1k = 0.;
13396 Double_t s1p2k = 0.;
13398 // number of particles which are both RPs and POIs in particular pt or eta bin:
13401 // M0111 from Eq. (118) in QC2c (to be improved (notation))
13402 Double_t dM01 = 0.;
13403 Double_t dM011 = 0.;
13408 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))
13409 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));
13410 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))
13411 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b));
13412 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))
13413 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));
13414 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))
13415 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b));
13416 mq = fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
13418 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.);
13419 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.);
13420 }else if(type == "RP")
13422 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
13423 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))
13424 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));
13425 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))
13426 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));
13427 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))
13428 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));
13429 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))
13430 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));
13431 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
13432 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.);
13433 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.);
13434 //s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.);
13436 mq = fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
13442 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
13443 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
13444 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
13445 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
13446 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
13447 // M01 from Eq. (118) in QC2c (to be improved (notation)):
13448 dM01 = mp*dSM1p1k-s1p1k;
13449 dM011 = mp*(dSM2p1k-dSM1p2k)
13450 - 2.*(s1p1k*dSM1p1k-s1p2k);
13452 // typeFlag = RP (0) or POI (1):
13454 } else if(type == "RP")
13456 // to be improved (cross-checked):
13457 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
13458 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
13459 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
13460 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
13461 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
13462 // M01 from Eq. (118) in QC2c (to be improved (notation)):
13463 dM01 = mp*dSM1p1k-s1p1k;
13464 dM011 = mp*(dSM2p1k-dSM1p2k)
13465 - 2.*(s1p1k*dSM1p1k-s1p2k);
13466 // typeFlag = RP (0) or POI (1):
13470 // <<cos n(psi1)>>:
13471 Double_t cosP1nPsi = 0.;
13474 cosP1nPsi = p1n0kRe/mp;
13476 // fill profile for <<cos n(psi1)>>:
13477 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi,mp);
13478 // histogram to store <cos n(psi1)> e-b-e (needed in some other methods):
13479 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][0]->SetBinContent(b,cosP1nPsi);
13482 // <<w2 cos n(psi1+phi2)>>:
13483 Double_t cosP1nPsiP1nPhiW2 = 0.;
13486 cosP1nPsiP1nPhiW2 = (p1n0kRe*dReQ1n1k-p1n0kIm*dImQ1n1k-q2n1kRe)/(dM01);
13487 // fill profile for <<w2 cos n(psi1+phi2)>>:
13488 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsiP1nPhiW2,dM01);
13489 // histogram to store <w2 cos n(psi1+phi2)> e-b-e (needed in some other methods):
13490 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][1]->SetBinContent(b,cosP1nPsiP1nPhiW2);
13491 } // end of if(dM01)
13493 // <<w2 w3 cos n(psi1+phi2-phi3)>>:
13494 Double_t cosP1nPsi1P1nPhi2MPhi3W2W3 = 0.;
13497 cosP1nPsi1P1nPhi2MPhi3W2W3 = (p1n0kRe*(pow(dImQ1n1k,2.)+pow(dReQ1n1k,2.))
13499 - q2n1kRe*dReQ1n1k-q2n1kIm*dImQ1n1k
13503 // fill profile for <<w1 w2 w3 cos n(psi1+phi2)>>:
13504 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1P1nPhi2MPhi3W2W3,dM011);
13505 // histogram to store <w1 w2 w3 cos n(psi1+phi2)> e-b-e (needed in some other methods):
13506 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][2]->SetBinContent(b,cosP1nPsi1P1nPhi2MPhi3W2W3);
13507 } // end of if(dM011)
13509 // <<w2 w3 cos n(psi1-phi2-phi3)>>:
13510 Double_t cosP1nPsi1M1nPhi2MPhi3W2W3 = 0.;
13513 cosP1nPsi1M1nPhi2MPhi3W2W3 = (p1n0kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))+2.*p1n0kIm*dReQ1n1k*dImQ1n1k
13514 - 1.*(p1n0kRe*dReQ2n2k+p1n0kIm*dImQ2n2k)
13515 - 2.*s1p1k*dReQ1n1k
13518 // fill profile for <<w1 w2 w3 cos n(psi1+phi2)>>:
13519 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1M1nPhi2MPhi3W2W3,dM011);
13520 // histogram to store <w1 w2 w3 cos n(psi1+phi2)> e-b-e (needed in some other methods):
13521 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][3]->SetBinContent(b,cosP1nPsi1M1nPhi2MPhi3W2W3);
13522 } // end of if(dM011)
13524 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
13526 } // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights(TString type, TString ptOrEta)
13529 //================================================================================================================================
13532 void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights(TString type, TString ptOrEta)
13534 // Calculate correction terms for non-uniform acceptance for differential flow (sin terms).
13536 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][0][cti], where cti runs as follows:
13537 // 0: <<sin n(psi1)>>
13538 // 1: <<w2 sin n(psi1+phi2)>>
13539 // 2: <<w2 w3 sin n(psi1+phi2-phi3)>>
13540 // 3: <<w2 w3 sin n(psi1-phi2-phi3)>>:
13545 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
13546 Double_t dReQ1n1k = (*fReQ)(0,1);
13547 Double_t dReQ2n2k = (*fReQ)(1,2);
13548 //Double_t dReQ1n3k = (*fReQ)(0,3);
13549 //Double_t dReQ4n4k = (*fReQ)(3,4);
13550 Double_t dImQ1n1k = (*fImQ)(0,1);
13551 Double_t dImQ2n2k = (*fImQ)(1,2);
13552 //Double_t dImQ1n3k = (*fImQ)(0,3);
13553 //Double_t dImQ4n4k = (*fImQ)(3,4);
13555 // S^M_{p,k} (see .h file for the definition of fSpk):
13556 Double_t dSM1p1k = (*fSpk)(0,1);
13557 Double_t dSM1p2k = (*fSpk)(0,2);
13558 Double_t dSM2p1k = (*fSpk)(1,1);
13560 Int_t t = 0; // type flag
13561 Int_t pe = 0; // ptEta flag
13566 } else if(type == "POI")
13571 if(ptOrEta == "Pt")
13574 } else if(ptOrEta == "Eta")
13579 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
13580 Double_t minPtEta[2] = {fPtMin,fEtaMin};
13581 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};
13582 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
13584 // looping over all bins and calculating correction terms:
13585 for(Int_t b=1;b<=nBinsPtEta[pe];b++)
13587 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin):
13588 Double_t p1n0kRe = 0.;
13589 Double_t p1n0kIm = 0.;
13591 // number of POIs in particular pt or eta bin:
13594 // 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):
13595 Double_t q1n2kRe = 0.;
13596 Double_t q1n2kIm = 0.;
13597 Double_t q2n1kRe = 0.;
13598 Double_t q2n1kIm = 0.;
13600 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
13601 Double_t s1p1k = 0.;
13602 Double_t s1p2k = 0.;
13604 // number of particles which are both RPs and POIs in particular pt or eta bin:
13607 // M0111 from Eq. (118) in QC2c (to be improved (notation))
13608 Double_t dM01 = 0.;
13609 Double_t dM011 = 0.;
13614 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))
13615 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));
13616 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))
13617 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b));
13618 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))
13619 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));
13620 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))
13621 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b));
13622 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
13624 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.);
13625 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.);
13626 }else if(type == "RP")
13628 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!))
13629 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))
13630 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));
13631 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))
13632 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));
13633 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))
13634 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));
13635 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))
13636 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));
13637 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation)
13638 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.);
13639 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.);
13640 //s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.);
13646 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))
13647 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));
13648 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b))
13649 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
13650 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
13651 // M01 from Eq. (118) in QC2c (to be improved (notation)):
13652 dM01 = mp*dSM1p1k-s1p1k;
13653 dM011 = mp*(dSM2p1k-dSM1p2k)
13654 - 2.*(s1p1k*dSM1p1k-s1p2k);
13655 // typeFlag = RP (0) or POI (1):
13657 } else if(type == "RP")
13659 // to be improved (cross-checked):
13660 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))
13661 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));
13662 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))
13663 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));
13664 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
13665 // M01 from Eq. (118) in QC2c (to be improved (notation)):
13666 dM01 = mp*dSM1p1k-s1p1k;
13667 dM011 = mp*(dSM2p1k-dSM1p2k)
13668 - 2.*(s1p1k*dSM1p1k-s1p2k);
13669 // typeFlag = RP (0) or POI (1):
13673 // <<sin n(psi1)>>:
13674 Double_t sinP1nPsi = 0.;
13677 sinP1nPsi = p1n0kIm/mp;
13679 // fill profile for <<sin n(psi1)>>:
13680 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi,mp);
13681 // histogram to store <sin n(psi1)> e-b-e (needed in some other methods):
13682 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][0]->SetBinContent(b,sinP1nPsi);
13685 // <<w2 sin n(psi1+phi2)>>:
13686 Double_t sinP1nPsiP1nPhiW2 = 0.;
13689 sinP1nPsiP1nPhiW2 = (p1n0kRe*dImQ1n1k+p1n0kIm*dReQ1n1k-q2n1kIm)/(dM01);
13690 // fill profile for <<w2 sin n(psi1+phi2)>>:
13691 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsiP1nPhiW2,dM01);
13692 // histogram to store <w2 sin n(psi1+phi2)> e-b-e (needed in some other methods):
13693 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][1]->SetBinContent(b,sinP1nPsiP1nPhiW2);
13694 } // end of if(mp*dMult-mq)
13696 // <<w2 w3 sin n(psi1+phi2-phi3)>>:
13697 Double_t sinP1nPsi1P1nPhi2MPhi3W2W3 = 0.;
13700 sinP1nPsi1P1nPhi2MPhi3W2W3 = (p1n0kIm*(pow(dImQ1n1k,2.)+pow(dReQ1n1k,2.))
13702 + q2n1kRe*dImQ1n1k-q2n1kIm*dReQ1n1k
13706 // fill profile for <<w2 w3 sin n(psi1+phi2-phi3)>>:
13707 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1P1nPhi2MPhi3W2W3,dM011);
13708 // histogram to store <w2 w3 sin n(psi1+phi2-phi3)> e-b-e (needed in some other methods):
13709 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][2]->SetBinContent(b,sinP1nPsi1P1nPhi2MPhi3W2W3);
13710 } // end of if(dM011)
13712 // <<w2 w3 sin n(psi1-phi2-phi3)>>:
13713 Double_t sinP1nPsi1M1nPhi2MPhi3W2W3 = 0.;
13716 sinP1nPsi1M1nPhi2MPhi3W2W3 = (p1n0kIm*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))-2.*p1n0kRe*dReQ1n1k*dImQ1n1k
13717 + 1.*(p1n0kRe*dImQ2n2k-p1n0kIm*dReQ2n2k)
13718 + 2.*s1p1k*dImQ1n1k
13721 // fill profile for <<w2 w3 sin n(psi1-phi2-phi3)>>:
13722 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1M1nPhi2MPhi3W2W3,dM011);
13723 // histogram to store <w2 w3 sin n(psi1-phi2-phi3)> e-b-e (needed in some other methods):
13724 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][3]->SetBinContent(b,sinP1nPsi1M1nPhi2MPhi3W2W3);
13725 } // end of if(dM011)
13727 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)
13729 } // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights(TString type, TString ptOrEta)
13731 //================================================================================================================================
13733 void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple * const anEvent, TString type, TString ptOrEta)
13735 // Evaluate with nested loops correction terms for non-uniform acceptance
13736 // with using particle weights (both sin and cos terms) relevant for differential flow.
13738 // Remark 1: "w1" in expressions bellow is a particle weight used only for particles which were
13739 // flagged both as POI and RP.
13740 // Remark 2: Reduced correction terms for non-uniform acceptance are evaluated in pt bin number fCrossCheckInPtBinNo
13741 // and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.
13742 // Remark 3: Results are stored in 1 bin profiles fDiffFlowDirectCorrections[t][pe][sc][cti], where first three indices runs as:
13743 // [0=RP,1=POI][0=Pt,1=Eta][0=sin terms,1=cos terms], whilst the cti (correction term index) runs as follows:
13745 // 0: <<sc n(psi1)>>
13746 // 1: <<w2 sc n(psi1+phi2)>>
13747 // 2: <<w2 w3 sc n(psi1+phi2-phi3)>>
13748 // 3: <<w2 w3 sc n(psi1-phi2-phi3)>>
13753 Int_t typeFlag = 0;
13754 Int_t ptEtaFlag = 0;
13758 } else if(type == "POI")
13762 if(ptOrEta == "Pt")
13765 } else if(ptOrEta == "Eta")
13770 Int_t t = typeFlag;
13771 Int_t pe = ptEtaFlag;
13773 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};
13774 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};
13775 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};
13777 Int_t nPrim = anEvent->NumberOfTracks();
13778 AliFlowTrackSimple *aftsTrack = NULL;
13780 Double_t psi1=0., phi2=0., phi3=0.;// phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;
13781 Double_t wPhi2=1., wPhi3=1.;
13783 Int_t n = fHarmonic;
13785 // 1'-particle correction terms:
13786 for(Int_t i1=0;i1<nPrim;i1++)
13788 aftsTrack=anEvent->GetTrack(i1);
13789 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
13790 if(typeFlag==1) // this is diff flow of POIs
13792 if(ptOrEta == "Pt")
13794 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
13795 } else if (ptOrEta == "Eta")
13797 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
13799 } else // this is diff flow of RPs
13801 if(ptOrEta == "Pt")
13803 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
13804 } else if (ptOrEta == "Eta")
13806 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
13809 psi1=aftsTrack->Phi();
13811 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*psi1),1.); // <<sin(n*(psi1))>>
13813 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*psi1),1.); // <<cos(n*(psi1))>>
13814 }//end of for(Int_t i1=0;i1<nPrim;i1++)
13816 // 2'-particle correction terms:
13817 for(Int_t i1=0;i1<nPrim;i1++)
13819 aftsTrack=anEvent->GetTrack(i1);
13820 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
13821 if(typeFlag==1) // this is diff flow of POIs
13823 if(ptOrEta == "Pt")
13825 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
13826 } else if (ptOrEta == "Eta")
13828 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
13830 } else // this is diff flow of RPs
13832 if(ptOrEta == "Pt")
13834 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
13835 } else if (ptOrEta == "Eta")
13837 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
13840 psi1=aftsTrack->Phi();
13841 for(Int_t i2=0;i2<nPrim;i2++)
13843 if(i2==i1) continue;
13844 aftsTrack=anEvent->GetTrack(i2);
13845 // RP condition (!(first) particle in the correlator must be RP):
13846 if(!(aftsTrack->InRPSelection())) continue;
13847 phi2=aftsTrack->Phi();
13848 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
13850 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2)),wPhi2); // <<w2 sin(n*(psi1+phi2))>>
13852 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2)),wPhi2); // <<w2 cos(n*(psi1+phi2))>>
13853 }//end of for(Int_t i2=0;i2<nPrim;i2++)
13854 }//end of for(Int_t i1=0;i1<nPrim;i1++)
13856 // 3'-particle correction terms:
13857 for(Int_t i1=0;i1<nPrim;i1++)
13859 aftsTrack=anEvent->GetTrack(i1);
13860 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
13861 if(typeFlag==1) // this is diff flow of POIs
13863 if(ptOrEta == "Pt")
13865 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
13866 } else if (ptOrEta == "Eta")
13868 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;
13870 } else // this is diff flow of RPs
13872 if(ptOrEta == "Pt")
13874 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
13875 } else if (ptOrEta == "Eta")
13877 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;
13880 psi1=aftsTrack->Phi();
13881 for(Int_t i2=0;i2<nPrim;i2++)
13883 if(i2==i1) continue;
13884 aftsTrack=anEvent->GetTrack(i2);
13885 // RP condition (!(first) particle in the correlator must be RP):
13886 if(!(aftsTrack->InRPSelection())) continue;
13887 phi2=aftsTrack->Phi();
13888 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));
13889 for(Int_t i3=0;i3<nPrim;i3++)
13891 if(i3==i1||i3==i2) continue;
13892 aftsTrack=anEvent->GetTrack(i3);
13893 // RP condition (!(first) particle in the correlator must be RP):
13894 if(!(aftsTrack->InRPSelection())) continue;
13895 phi3=aftsTrack->Phi();
13896 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));
13898 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))>>
13899 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))>>
13901 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))>>
13902 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))>>
13903 }//end of for(Int_t i3=0;i3<nPrim;i3++)
13904 }//end of for(Int_t i2=0;i2<nPrim;i2++)
13905 }//end of for(Int_t i1=0;i1<nPrim;i1++)
13907 } // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)
13909 //================================================================================================================================
13911 void AliFlowAnalysisWithQCumulants::CheckPointersUsedInFinish()
13913 // Check all pointers used in method Finish().
13915 if(!fAvMultiplicity)
13918 cout<<" WARNING (QC): fAvMultiplicity is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
13922 if(!fIntFlowCorrelationsPro)
13925 cout<<" WARNING (QC): fIntFlowCorrelationsPro is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
13929 if(!fIntFlowSquaredCorrelationsPro)
13932 cout<<" WARNING (QC): fIntFlowSquaredCorrelationsPro is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
13936 if(!fIntFlowCorrelationsHist)
13939 cout<<" WARNING (QC): fIntFlowCorrelationsHist is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
13943 if((fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights) && !fIntFlowExtraCorrelationsPro)
13946 cout<<" WARNING (QC): fIntFlowExtraCorrelationsPro is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
13950 for(Int_t power=0;power<2;power++)
13952 if(!fIntFlowSumOfEventWeights[power])
13955 cout<<Form(" WARNING (QC): fIntFlowSumOfEventWeights[%d] is NULL in CheckPointersUsedInFinish() !!!!",power)<<endl;
13959 } // end of for(Int_t power=0;power<2;power++)
13960 if(!fIntFlowProductOfCorrelationsPro)
13963 cout<<" WARNING (QC): fIntFlowProductOfCorrelationsPro is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
13967 if(!fIntFlowSumOfProductOfEventWeights)
13970 cout<<" WARNING (QC): fIntFlowSumOfProductOfEventWeights is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
13974 if(!fIntFlowCovariances)
13977 cout<<" WARNING (QC): fIntFlowCovariances is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
13981 if(!fIntFlowQcumulants)
13984 cout<<" WARNING (QC): fIntFlowQcumulants is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
13991 cout<<" WARNING (QC): fIntFlow is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
13998 cout<<" WARNING (QC): fCommonHists is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
14002 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
14005 cout<<" WARNING (QC): fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th"<<endl;
14006 cout<<" && fCommonHistsResults8th is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
14012 for(Int_t sc=0;sc<2;sc++) // sin/cos
14014 if(!fIntFlowCorrectionTermsForNUAPro[sc])
14017 cout<<Form(" WARNING (QC): fIntFlowCorrectionTermsForNUAPro[%d] is NULL in CheckPointersUsedInFinish() !!!!",sc)<<endl;
14021 if(!fIntFlowCorrectionTermsForNUAHist[sc])
14024 cout<<Form(" WARNING (QC): fIntFlowCorrectionTermsForNUAHist[%d] is NULL in CheckPointersUsedInFinish() !!!!",sc)<<endl;
14028 for(Int_t lq=0;lq<2;lq++) // linear/quadratic
14030 if(!fIntFlowSumOfEventWeightsNUA[sc][lq])
14033 cout<<Form(" WARNING (QC): fIntFlowSumOfEventWeightsNUA[%d][%d] is NULL in CheckPointersUsedInFinish() !!!!",sc,lq)<<endl;
14037 } // end of for(Int_t lq=0;lq<2;lq++) // linear/quadratic
14038 } // end of for(Int_t power=0;power<2;power++)
14039 if(!fIntFlowProductOfCorrectionTermsForNUAPro)
14042 cout<<" WARNING (QC): fIntFlowProductOfCorrectionTermsForNUAPro is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
14046 if(!fIntFlowSumOfProductOfEventWeightsNUA)
14049 cout<<" WARNING (QC): fIntFlowSumOfProductOfEventWeightsNUA is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
14053 if(!fIntFlowCovariancesNUA)
14056 cout<<" WARNING (QC): fIntFlowCovariancesNUA is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
14060 if(!fIntFlowQcumulantsErrorSquaredRatio)
14063 cout<<" WARNING (QC): fIntFlowQcumulantsErrorSquaredRatio is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
14067 if(!fIntFlowDetectorBias)
14070 cout<<" WARNING (QC): fIntFlowDetectorBias is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
14075 // Versus multiplicity:
14076 if(!fCalculateCumulantsVsM){return;}
14077 for(Int_t co=0;co<=3;co++) // cumulant order
14079 if(!fIntFlowQcumulantsVsM[co])
14082 cout<<Form(" WARNING (QC): fIntFlowQcumulantsVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",co)<<endl;
14086 if(!fIntFlowVsM[co])
14089 cout<<Form(" WARNING (QC): fIntFlowVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",co)<<endl;
14093 if(!fIntFlowDetectorBiasVsM[co])
14096 cout<<Form(" WARNING (QC): fIntFlowDetectorBiasVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",co)<<endl;
14100 } // end of for(Int_t c0=0;c0<=3;c0++) // cumulant order
14101 for(Int_t ci=0;ci<=3;ci++) // correlation index
14103 if(!fIntFlowCorrelationsVsMPro[ci])
14106 cout<<Form(" WARNING (QC): fIntFlowCorrelationsVsMPro[%d] is NULL in CheckPointersUsedInFinish() !!!!",ci)<<endl;
14110 if(!fIntFlowSquaredCorrelationsVsMPro[ci])
14113 cout<<Form(" WARNING (QC): fIntFlowSquaredCorrelationsVsMPro[%d] is NULL in CheckPointersUsedInFinish() !!!!",ci)<<endl;
14117 if(!fIntFlowCorrelationsVsMHist[ci])
14120 cout<<Form(" WARNING (QC): fIntFlowCorrelationsVsMHist[%d] is NULL in CheckPointersUsedInFinish() !!!!",ci)<<endl;
14124 for(Int_t power=0;power<2;power++)
14126 if(!fIntFlowSumOfEventWeightsVsM[ci][power])
14129 cout<<Form(" WARNING (QC): fIntFlowSumOfEventWeightsVsM[%d][%d] is NULL in CheckPointersUsedInFinish() !!!!",ci,power)<<endl;
14133 } // end of for(Int_t power=0;power<2;power++)
14134 } // end of for(Int_t ci=0;ci<=3;ci++) // correlation index
14135 for(Int_t i=0;i<6;i++)
14137 if(!fIntFlowProductOfCorrelationsVsMPro[i])
14140 cout<<Form(" WARNING (QC): fIntFlowProductOfCorrelationsVsMPro[%d] is NULL in CheckPointersUsedInFinish() !!!!",i)<<endl;
14144 if(!fIntFlowSumOfProductOfEventWeightsVsM[i])
14147 cout<<Form(" WARNING (QC): fIntFlowSumOfProductOfEventWeightsVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",i)<<endl;
14151 if(!fIntFlowCovariancesVsM[i])
14154 cout<<Form(" WARNING (QC): fIntFlowCovariancesVsM[%d] is NULL in CheckPointersUsedInFinish() !!!!",i)<<endl;
14158 } // end of for(Int_t i=0;i<6;i++)
14159 if(!fIntFlowRebinnedInM)
14162 cout<<" WARNING (QC): fIntFlowRebinnedInM is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
14166 if(!fIntFlowQcumulantsRebinnedInM)
14169 cout<<" WARNING (QC): fIntFlowQcumulantsRebinnedInM is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
14174 } // end of void AliFlowAnalysisWithQCumulants::CheckPointersUsedInFinish()
14176 //================================================================================================================================
14178 void AliFlowAnalysisWithQCumulants::CheckPointersUsedInMake()
14180 // Check all pointers used in method Make(). // to be improved - check other pointers as well
14182 if(!fAvMultiplicity)
14184 printf("\n WARNING (QC): fAvMultiplicity is NULL in CheckPointersUsedInMake() !!!!\n\n");
14187 if((fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights) && !fIntFlowExtraCorrelationsPro)
14189 printf("\n WARNING (QC): fIntFlowExtraCorrelationsPro is NULL in CheckPointersUsedInMake() !!!!\n\n");
14193 if(fCalculate2DDiffFlow)
14195 for(Int_t t=0;t<2;t++) // type = RP or POI
14197 for(Int_t rci=0;rci<4;rci++) // reduced correlation index
14199 if(!f2DDiffFlowCorrelationsPro[t][rci])
14201 printf("\n WARNING (QC): f2DDiffFlowCorrelationsPro[%i][%i] is NULL in CheckPointersUsedInMake() !!!!\n\n",t,rci);
14203 } // end of if(!f2DDiffFlowCorrelationsPro[t][rci])
14204 } // end of for(Int_t rci=0;rci<4;rci++) // reduced correlation index
14205 } // end of for(Int_t t=0;t<2;t++)
14206 } // end of if(fCalculate2DDiffFlow)
14208 } // end of void AliFlowAnalysisWithQCumulants::CheckPointersUsedInMake()