AliPhysics  ff1d528 (ff1d528)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliFlowAnalysisCRC.cxx
Go to the documentation of this file.
1 /*************************************************************************
2  * Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
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  **************************************************************************/
15 
16 /*************************************************
17  * Charge-rapidity correlations with Q-cumulants *
18  * *
19  * author: Jacopo Margutti *
20  * (margutti@nikhef.nl) *
21  *************************************************/
22 
23 #define AliFlowAnalysisCRC_cxx
24 
25 #include "Riostream.h"
26 #include "AliFlowCommonConstants.h"
27 #include "AliFlowCommonHist.h"
29 #include "TChain.h"
30 
31 #include "TFile.h"
32 #include "TList.h"
33 #include "TGraph.h"
34 #include "TParticle.h"
35 #include "TRandom3.h"
36 #include "TStyle.h"
37 #include "TProfile.h"
38 #include "TProfile2D.h"
39 #include "TProfile3D.h"
40 #include "TMath.h"
41 #include "TArrow.h"
42 #include "TPaveLabel.h"
43 #include "TCanvas.h"
44 #include "AliFlowEventSimple.h"
45 #include "AliFlowVector.h"
46 #include "AliFlowTrackSimple.h"
47 #include "AliFlowAnalysisCRC.h"
48 #include "AliLog.h"
49 #include "TRandom.h"
50 #include "TF1.h"
51 #include "TNtuple.h"
52 #include "THnSparse.h"
53 #include <cmath>
54 
55 class TH1;
56 class TH2;
57 class TGraph;
58 class TPave;
59 class TLatex;
60 class TMarker;
61 class TRandom3;
62 class TObjArray;
63 class TList;
64 class TCanvas;
65 class TSystem;
66 class TROOT;
67 class AliFlowVector;
68 class TVector;
69 
70 //==============================================================================================================
71 
72 using std::endl;
73 using std::cout;
74 using std::flush;
76 
77 AliFlowAnalysisCRC::AliFlowAnalysisCRC(const char* name,
78  Int_t nCen,
79  Double_t CenWidth):
80 TNamed(name,name),
81 // 0.) base:
82 fHistList(NULL),
83 // 1.) common:
84 fBookOnlyBasicCCH(kTRUE),
85 fCommonHists(NULL),
86 fCommonHists2nd(NULL),
87 fCommonHists4th(NULL),
88 fCommonHists6th(NULL),
89 fCommonHists8th(NULL),
90 fCommonHistsResults2nd(NULL),
91 fCommonHistsResults4th(NULL),
92 fCommonHistsResults6th(NULL),
93 fCommonHistsResults8th(NULL),
94 fnBinsPhi(0),
95 fPhiMin(0),
96 fPhiMax(0),
97 fPhiBinWidth(0),
98 fnBinsPt(0),
99 fPtMin(0),
100 fPtMax(0),
101 fPtBinWidth(0),
102 fnBinsEta(0),
103 fEtaMin(0),
104 fEtaMax(0),
105 fEtaBinWidth(0),
106 fCommonConstants(NULL),
107 fFillMultipleControlHistograms(kFALSE),
108 fHarmonic(1),
109 fAnalysisLabel(NULL),
110 // 2a.) particle weights:
111 fUsePhiWeights(kFALSE),
112 fUsePtWeights(kFALSE),
113 fUseEtaWeights(kFALSE),
114 fUseTrackWeights(kFALSE),
115 fUsePhiEtaWeights(kFALSE),
116 fUsePhiEtaWeightsChDep(kFALSE),
117 fUsePhiEtaWeightsVtxDep(kFALSE),
118 fUsePhiEtaWeightsChPtDep(kFALSE),
119 fUseZDCESEMulWeights(kFALSE),
120 fUseZDCESESpecWeights(kFALSE),
121 fUseParticleWeights(NULL),
122 // 2b.) event weights:
123 fMultiplicityWeight(NULL),
124 fMultiplicityIs(AliFlowCommonConstants::kRP),
125 // 3.) integrated flow:
126 fIntFlowList(NULL),
127 fIntFlowProfiles(NULL),
128 fIntFlowResults(NULL),
129 fIntFlowAllCorrelationsVsM(NULL),
130 fIntFlowFlags(NULL),
131 fApplyCorrectionForNUA(kFALSE),
132 fApplyCorrectionForNUAVsM(kFALSE),
133 fnBinsMult(10000),
134 fMinMult(0.),
135 fMaxMult(10000.),
136 fPropagateErrorAlsoFromNIT(kFALSE),
137 fCalculateCumulantsVsM(kFALSE),
138 fCalculateAllCorrelationsVsM(kFALSE),
139 fMinimumBiasReferenceFlow(kTRUE),
140 fForgetAboutCovariances(kFALSE),
141 fStoreVarious(kFALSE),
142 fExactNoRPs(0),
143 fUse2DHistograms(kFALSE),
144 fFillProfilesVsMUsingWeights(kTRUE),
145 fUseQvectorTerms(kFALSE),
146 fReQ(NULL),
147 fImQ(NULL),
148 fSpk(NULL),
149 fIntFlowCorrelationsEBE(NULL),
150 fIntFlowEventWeightsForCorrelationsEBE(NULL),
151 fIntFlowCorrelationsAllEBE(NULL),
152 fNumberOfRPsEBE(0.),
153 fNumberOfPOIsEBE(0.),
154 fReferenceMultiplicityEBE(0.),
155 fCentralityEBE(0.),
156 fNewCentralityEBE(0.),
157 fZDCESEclEbE(0),
158 fNewMetricLEBE(0.),
159 fNewMetricDEBE(0.),
160 fNewMetricL2EBE(0.),
161 fNewMetricD2EBE(0.),
162 fCentralityCL1EBE(0.),
163 fNITSCL1EBE(0.),
164 fCentralityTRKEBE(0.),
165 fZNCen(0.),
166 fZNAen(0.),
167 fEnNucl(1.),
168 fAvMultiplicity(NULL),
169 fIntFlowCorrelationsPro(NULL),
170 fIntFlowSquaredCorrelationsPro(NULL),
171 fIntFlowCorrelationsAllPro(NULL),
172 fIntFlowExtraCorrelationsPro(NULL),
173 fIntFlowProductOfCorrelationsPro(NULL),
174 fIntFlowProductOfCorrectionTermsForNUAPro(NULL),
175 fIntFlowCorrelationsHist(NULL),
176 fIntFlowCorrelationsAllHist(NULL),
177 fIntFlowCovariances(NULL),
178 fIntFlowSumOfProductOfEventWeights(NULL),
179 fIntFlowCovariancesNUA(NULL),
180 fIntFlowSumOfProductOfEventWeightsNUA(NULL),
181 fIntFlowQcumulants(NULL),
182 fIntFlowQcumulantsRebinnedInM(NULL),
183 fIntFlowQcumulantsErrorSquaredRatio(NULL),
184 fIntFlow(NULL),
185 fIntFlowRebinnedInM(NULL),
186 fIntFlowDetectorBias(NULL),
187 // 4.) differential flow:
188 fDiffFlowList(NULL),
189 fDiffFlowProfiles(NULL),
190 fDiffFlowResults(NULL),
191 fDiffFlow2D(NULL),
192 fDiffFlowFlags(NULL),
193 fCalculateDiffFlow(kTRUE),
194 fCalculate2DDiffFlow(kFALSE),
195 fCalculateDiffFlowVsEta(kTRUE),
196 // 5.) other differential correlators:
197 fOtherDiffCorrelatorsList(NULL),
198 // 6.) distributions:
199 fDistributionsList(NULL),
200 fDistributionsFlags(NULL),
201 fStoreDistributions(kFALSE),
202 fnBinsForCorrelations(10000),
203 // 8.) debugging and cross-checking:
204 fNestedLoopsList(NULL),
205 fEvaluateIntFlowNestedLoops(kFALSE),
206 fEvaluateDiffFlowNestedLoops(kFALSE),
207 fMaxAllowedMultiplicity(10),
208 fEvaluateNestedLoops(NULL),
209 fIntFlowDirectCorrelations(NULL),
210 fIntFlowExtraDirectCorrelations(NULL),
211 fCrossCheckInPtBinNo(10),
212 fCrossCheckInEtaBinNo(20),
213 fNoOfParticlesInBin(NULL),
214 fMixedHarmonicsNestedLoops(NULL),
215 // 9.) mixed harmonics:
216 fMixedHarmonicsList(NULL),
217 fMixedHarmonicsProfiles(NULL),
218 fMixedHarmonicsResults(NULL),
219 fMixedHarmonicsErrorPropagation(NULL),
220 fMixedHarmonicsFlags(NULL),
221 fCalculateMixedHarmonics(kFALSE),
222 fCalculateMixedHarmonicsVsM(kFALSE),
223 f2pCorrelations(NULL),
224 f3pCorrelations(NULL),
225 f4pCorrelations(NULL),
226 f5pCorrelations(NULL),
227 f6pCorrelations(NULL),
228 f7pCorrelations(NULL),
229 f8pCorrelations(NULL),
230 f2pCumulants(NULL),
231 f3pCumulants(NULL),
232 f4pCumulants(NULL),
233 f5pCumulants(NULL),
234 f6pCumulants(NULL),
235 f7pCumulants(NULL),
236 f8pCumulants(NULL),
237 fMixedHarmonicProductOfEventWeights(NULL),
238 fMixedHarmonicProductOfCorrelations(NULL),
239 // 10.) Control histograms:
240 fControlHistogramsList(NULL),
241 fControlHistogramsFlags(NULL),
242 fStoreControlHistograms(kFALSE),
243 fCorrelationNoRPsVsRefMult(NULL),
244 fCorrelationNoPOIsVsRefMult(NULL),
245 fCorrelationNoRPsVsNoPOIs(NULL),
246 // 11.) Bootstrap:
247 fBootstrapList(NULL),
248 fBootstrapProfilesList(NULL),
249 fBootstrapResultsList(NULL),
250 fBootstrapFlags(NULL),
251 fUseBootstrap(kFALSE),
252 fUseBootstrapVsM(kFALSE),
253 fnSubsamples(10),
254 fRandom(NULL),
255 fBootstrapCorrelations(NULL),
256 fBootstrapCumulants(NULL),
257 // 12.) Charge-Eta Asymmetry:
258 fCRCList(NULL),
259 fTempList(NULL),
260 fCRCFlags(NULL),
261 fCalculateCRC(kTRUE),
262 fCalculateCRCPt(kFALSE),
263 fCalculateCME(kFALSE),
264 fCalculateCRCInt(kFALSE),
265 fCalculateCRC2(kFALSE),
266 fCalculateCRCVZ(kFALSE),
267 fCalculateCRCZDC(kFALSE),
268 fCalculateFlowQC(kFALSE),
269 fCalculateFlowZDC(kFALSE),
270 fCalculateFlowVZ(kFALSE),
271 fCalculateEbEFlow(kFALSE),
272 fStoreZDCQVecVtxPos(kFALSE),
273 fUsePhiEtaCuts(kFALSE),
274 fUseVZERO(kFALSE),
275 fUseZDC(kFALSE),
276 fRecenterZDC(kFALSE),
277 fNUAforCRC(kFALSE),
278 fUseCRCRecenter(kFALSE),
279 fDivSigma(kTRUE),
280 fInvertZDC(kFALSE),
281 fCRCTestSin(kFALSE),
282 fVtxRbR(kFALSE),
283 fCRCEtaMin(0.),
284 fCRCEtaMax(0.),
285 fRunNum(0),
286 fCachedRunNum(0),
287 fRbREventCounter(0),
288 fRunBin(0),
289 fCenBin(0),
290 fCorrWeightTPC(kUnit),
291 fCorrWeightVZ(kUnit),
292 fCorrWeightZDC(kUnit),
293 fCRCIntList(NULL),
294 fCRCnCen(nCen),
295 fCRCCenBinWidth(CenWidth),
296 fCRCIntRbRList(NULL),
297 fCRCnRun(211),
298 fDataSet(kAny),
299 fInteractionRate(kAll),
300 fSelectCharge(kAllCh),
301 fPOIExtraWeights(kNone),
302 fCRCQVecList(NULL),
303 fCRCQVecListTPC(NULL),
304 fCRCQVecWeightsList(NULL),
305 fCRCZDCCalibList(NULL),
306 fCRCVZEROCalibList(NULL),
307 fCRCZDCResList(NULL),
308 fZDCESEList(NULL),
309 fCRCVZList(NULL),
310 fCRCZDCList(NULL),
311 fCRCZDCRbRList(NULL),
312 fCRCPtList(NULL),
313 fCMEList(NULL),
314 fCMETPCList(NULL),
315 fCMEZDCList(NULL),
316 fCRC2List(NULL),
317 fCRC2nEtaBins(6),
318 fFlowSPZDCList(NULL),
319 fFlowQCList(NULL),
320 //fFlowQCOrdMagList(NULL),
321 fFlowQCHOList(NULL),
322 fFlowQCCenBin(100),
323 fFlowQCDeltaEta(0.4),
324 fFlowSPVZList(NULL),
325 fVariousList(NULL),
326 fEbEFlowList(NULL),
327 fCenWeightEbE(0.),
328 fQAZDCCuts(kFALSE),
329 fQAZDCCutsFlag(kTRUE),
330 fMinMulZN(0),
331 fMaxDevZN(5.),
332 fZDCGainAlpha(0.395),
333 fbFlagIsPosMagField(kFALSE)
334 {
335  // constructor
336 
337  // base list to hold all output objects:
338  fHistList = new TList();
339  fHistList->SetName("cobjQC");
340  fHistList->SetOwner(kTRUE);
341 
342  // base list to hold all temp objects:
343  fTempList = new TList();
344  fTempList->SetName("temp");
345  fTempList->SetOwner(kTRUE);
346 
347  // multiplicity weight:
348  fMultiplicityWeight = new TString("combinations");
349 
350  // analysis label;
351  fAnalysisLabel = new TString();
352 
353  // initialize all arrays:
354  this->InitializeArraysForIntFlow();
355  this->InitializeArraysForDiffFlow();
356  this->InitializeArraysForDistributions();
357  this->InitializeArraysForVarious();
358  this->InitializeArraysForNestedLoops();
359  this->InitializeArraysForMixedHarmonics();
360  this->InitializeArraysForControlHistograms();
361  this->InitializeArraysForBootstrap();
362 
363  fRunList = TArrayI();
364  fAvVtxPosX = TArrayD();
365  fAvVtxPosY = TArrayD();
366  fAvVtxPosZ = TArrayD();
367  fnEvRbR = TArrayI();
368 
369  // CRC
370  this->InitializeCostantsForCRC();
371  this->InitializeArraysForParticleWeights();
372  this->InitializeArraysForCRC();
373  this->InitializeArraysForCRCVZ();
374  this->InitializeArraysForCRCZDC();
375  this->InitializeArraysForCRC2();
376  this->InitializeArraysForQVec();
377  this->InitializeArraysForCRCPt();
378  this->InitializeArraysForCME();
379  this->InitializeArraysForFlowEbE();
380  this->InitializeArraysForFlowQC();
381  this->InitializeArraysForFlowQCHighOrders();
382  this->InitializeArraysForFlowSPZDC();
383  this->InitializeArraysForFlowSPVZ();
384  this->InitializeArraysForEbEFlow();
385 
386  // printf("Arrays initialized \n");
387 
388 } // end of constructor
389 
390 //================================================================================================================
391 
393 {
394  // destructor
395  delete fHistList;
396  delete fTempList;
400  if(fCRCZDCResList) delete fCRCZDCResList;
401  if(fZDCESEList) delete fZDCESEList;
402  delete[] fCRCPtvarPtBins;
403  delete[] fCRCPtBins;
404  delete[] fZDCEPweightEbE;
405  delete[] fCorrMap;
406  delete[] fchisqVA;
407  delete[] fchisqVC;
409 } // end of AliFlowAnalysisCRC::~AliFlowAnalysisCRC()
410 
411 //================================================================================================================
412 
414 {
415  // a) Cross check if the settings make sense before starting the QC adventure;
416  // b) Access all common constants;
417  // c) Book all objects;
418  // d) Store flags for integrated and differential flow;
419  // e) Store flags for distributions of corelations;
420  // f) Store harmonic which will be estimated;
421  // g) Store flags for mixed harmonics;
422  // h) Store flags for control histograms;
423  // i) Store bootstrap flags.
424 
425  //save old value and prevent histograms from being added to directory
426  //to avoid name clashes in case multiple analaysis objects are used
427  //in an analysis
428  Bool_t oldHistAddStatus = TH1::AddDirectoryStatus();
429  TH1::AddDirectory(kFALSE);
430  fRandom = new TRandom3(0); // if uiSeed is 0, the seed is determined uniquely in space and time via TUUID
431 
432  // a) Cross check if the settings make sense before starting the QC adventure;
433  this->CrossCheckSettings();
434  // b) Access all common constants and book a profile to hold them:
435  this->CommonConstants("Init");
436  // c) Book all objects:
438  this->BookAndNestAllLists();
439  this->BookCommonHistograms();
448  this->SetRunList();
449  if(fCalculateCRC) {
450  this->BookEverythingForCRC();
451  this->BookEverythingForCRCVZ();
452  this->BookEverythingForCRCZDC();
453  this->BookEverythingForCRCPt();
454  this->BookEverythingForCRC2();
455  this->BookEverythingForQVec();
456  this->BookEverythingForCME();
457  this->BookEverythingForFlowEbE();
458  this->BookEverythingForFlowQC();
462  this->BookEverythingForEbEFlow();
463  }
464  this->BookEverythingForVarious();
465 
466  this->SetCentralityWeights();
467 
468  // d) Store flags for integrated and differential flow:
469  this->StoreIntFlowFlags();
470  this->StoreDiffFlowFlags();
471  // e) Store flags for distributions of corelations:
473  // f) Store harmonic which will be estimated:
474  this->StoreHarmonic();
475  // g) Store flags for mixed harmonics:
476  this->StoreMixedHarmonicsFlags();
477  // h) Store flags for control histograms:
479  // i) Store bootstrap flags:
480  this->StoreBootstrapFlags();
481  if(fCalculateCRC) {
482  // j) Store CRC flags:
483  this->StoreCRCFlags();
484  }
485 
486  TH1::AddDirectory(oldHistAddStatus);
487 
488  // printf("Stuff booked \n");
489 
490 } // end of void AliFlowAnalysisCRC::Init()
491 
492 //================================================================================================================
493 
495 {
496  // Running over data only in this method.
497  // a) Check all pointers used in this method;
498  // b) Define local variables;
499  // c) Fill the common control histograms and call the method to fill fAvMultiplicity;
500  // d) Loop over data and calculate e-b-e quantities Q_{n,k}, S_{p,k} and s_{p,k};
501  // d.1) initialize particle weights
502  // e) Calculate the final expressions for S_{p,k} and s_{p,k} (important !!!!);
503  // f) Call the methods which calculate correlations for reference flow;
504  // g) Call the methods which calculate correlations for differential flow;
505  // h) Call the methods which calculate correlations for 2D differential flow;
506  // i) Call the methods which calculate other differential correlators;
507  // j) Distributions of correlations;
508  // k) Store various;
509  // l) Cross-check with nested loops correlators for reference flow;
510  // m) Cross-check with nested loops correlators for differential flow;
511  // n) Reset all event-by-event quantities (very important !!!!).
512 
513  // a) Check all pointers used in this method:
514  this->CheckPointersUsedInMake();
515 
516  // b) Define local variables:
517  Double_t dPhi = 0.; // azimuthal angle in the laboratory frame
518  Double_t dPt = 0.; // transverse momentum
519  Double_t dEta = 0.; // pseudorapidity
520  Double_t wPhi = 1.; // phi weight
521  Double_t wPt = 1.; // pt weight
522  Double_t wEta = 1.; // eta weight
523  Double_t wTrack = 1.; // track weight
524  Double_t wPhiEta = 1.;
525  Double_t wt = 1.;
526  Double_t wProbCut = 1.;
527  Int_t nCounterNoRPs = 0; // needed only for shuffling
528  fNumberOfRPsEBE = anEvent->GetNumberOfRPs(); // number of RPs (i.e. number of reference particles)
529  fNumberOfPOIsEBE = anEvent->GetNumberOfPOIs(); // number of POIs (i.e. number of particles of interest)
530  fReferenceMultiplicityEBE = anEvent->GetReferenceMultiplicity(); // reference multiplicity for current event
531  fCentralityEBE = anEvent->GetCentrality(); // centrality percentile for current event
532  fCentralityCL1EBE = anEvent->GetCentralityCL1(); // centrality percentile for current event (alternative estimation)
533  fCentralityTRKEBE = anEvent->GetCentralityTRK(); // centrality percentile for current event (alternative estimation)
534  fNITSCL1EBE = anEvent->GetNITSCL1();
535 
536  // printf("debug: NoRPs %e, NoPOIs %e, RunNum %d, Cen %e \n",fNumberOfRPsEBE,fNumberOfPOIsEBE,fRunNum,fCentralityEBE);
537 
538  if(fExactNoRPs > 0 && fNumberOfRPsEBE<fExactNoRPs){return;}
539  if(!fCentralityEBE){return;}
540  if(!fNumberOfRPsEBE || !fNumberOfPOIsEBE){return;}
542  if((fDataSet==k2015 || fDataSet==k2015v6) && !MultCut2015o()){return;}
543 
544  // centrality flattening with weights
545  fCenWeightEbE = 1.;
547 
548  // primary vertex position (x,y,z)
549  anEvent->GetVertexPosition(fVtxPos);
550 
551  Double_t ptEta[2] = {0.,0.}; // 0 = dPt, 1 = dEta
552  Int_t dCharge = 0; // charge
553 
554  // d) Loop over data and calculate e-b-e quantities Q_{n,k}, S_{p,k} and s_{p,k}:
555  Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = total number of primary tracks
556  AliFlowTrackSimple *aftsTrack = NULL;
557  Int_t n = fHarmonic; // shortcut for the harmonic
558 
559  // d.1) Initialize particle weights
560  Int_t cw = 0;
561 
562  if (fDataSet==kAny) {fRunBin = 0;}
563  else {fRunBin = GetCRCRunBin(fRunNum);}
564  if(fRunBin<0 || fRunBin>=fCRCnRun) {return;}
566  if(fCenBin<0 || fCenBin>=fCRCnCen) {return;}
567 
571 
572  if(fRunNum!=fCachedRunNum) {
573  fbFlagIsPosMagField = kFALSE;
574  Int_t dRun15hPos[] = {246390, 246391, 246392, 246994, 246991, 246989, 246984, 246982, 246980, 246948, 246945, 246928, 246851, 246847, 246846, 246845, 246844, 246810, 246809, 246808, 246807, 246805, 246804, 246766, 246765, 246763, 246760, 246759, 246758, 246757, 246751, 246750, 246495, 246493, 246488, 246487, 246434, 246431, 246428, 246424};
575  for (Int_t i=0; i<40; i++) {
576  if(fRunNum==dRun15hPos[i]) fbFlagIsPosMagField = kTRUE;
577  }
579  }
580 
581  // VZERO *********************************************************************************************************
582 
583  if(fUseVZERO) {
584  for(Int_t h=0; h<fCRCnHar; h++) {
585  // Get Q vectors for the subevents
586  AliFlowVector vQarray[2];
587  anEvent->GetV02Qsub(vQarray,h+1);
588  fVZFlowVect[0][h] = vQarray[0];
589  fVZFlowVect[1][h] = vQarray[1];
590  // re-center VZERO Q-vectors
592 
593  // fill Q-vector RbR
594 // if(fCRCVZEROQVec[fRunBin][h]) {
595 // fCRCVZEROQVec[fRunBin][h]->Fill(0.5,fCentralityEBE,fVZFlowVect[0][h].X());
596 // fCRCVZEROQVec[fRunBin][h]->Fill(1.5,fCentralityEBE,fVZFlowVect[0][h].Y());
597 // fCRCVZEROQVec[fRunBin][h]->Fill(2.5,fCentralityEBE,fVZFlowVect[1][h].X());
598 // fCRCVZEROQVec[fRunBin][h]->Fill(3.5,fCentralityEBE,fVZFlowVect[1][h].Y());
599 // fCRCVZEROQVec[fRunBin][h]->Fill(4.5,fCentralityEBE,fVZFlowVect[0][h].X()*fVZFlowVect[1][h].X());
600 // fCRCVZEROQVec[fRunBin][h]->Fill(5.5,fCentralityEBE,fVZFlowVect[0][h].Y()*fVZFlowVect[1][h].Y());
601 // fCRCVZEROQVec[fRunBin][h]->Fill(6.5,fCentralityEBE,fVZFlowVect[0][h].X()*fVZFlowVect[1][h].Y());
602 // fCRCVZEROQVec[fRunBin][h]->Fill(7.5,fCentralityEBE,fVZFlowVect[0][h].Y()*fVZFlowVect[1][h].X());
603 // }
604  } // end of for(Int_t h=0; h<fCRCnHar; h++)
605  } // end of if(fUseVZERO)
606 
607  // ZDC *********************************************************************************************************
608 
609  if(fUseZDC) {
610  // Get Q vectors for the subevents
611  AliFlowVector vQarray[2];
612  anEvent->GetZDC2Qsub(vQarray);
613  fZDCFlowVect[0] = vQarray[0];
614  fZDCFlowVect[1] = vQarray[1];
615  fZNCen = anEvent->GetZNCEnergy()/fEnNucl;
616  fZNAen = anEvent->GetZNAEnergy()/fEnNucl;
617  } // end of if(fUseZDC)
618 
619  this->CalculateCRCQVec();
620 
621  if(fUseZDC) {
622  if(fRecenterZDC) {
623  this->RecenterCRCQVecZDC();
624  }
625  }
626  // ZDC-C (eta < -8.8)
627  Double_t ZCRe = fZDCFlowVect[0].X();
628  Double_t ZCIm = fZDCFlowVect[0].Y();
629  Double_t ZCM = fZDCFlowVect[0].GetMult();
630  // ZDC-A (eta > 8.8)
631  Double_t ZARe = fZDCFlowVect[1].X();
632  Double_t ZAIm = fZDCFlowVect[1].Y();
633  Double_t ZAM = fZDCFlowVect[1].GetMult();
634  if( fInvertZDC ) ZARe = -ZARe;
635 
636  if(fCalculateCRC) {
637  fQAZDCCutsFlag = this->PassQAZDCCuts();
638  }
639  // ZDC QA cuts
640  Bool_t bPassZDCcuts = kTRUE;
641  if( ZCM<=0. || ZAM<=0. || sqrt(ZCRe*ZCRe+ZCIm*ZCIm)<1.E-6 || sqrt(ZARe*ZARe+ZAIm*ZAIm)<1.E-6 ) bPassZDCcuts=kFALSE;
642  if( !std::isfinite(fZDCFlowVect[0].Mod()) || !std::isfinite(fZDCFlowVect[1].Mod())) bPassZDCcuts=kFALSE;
643  if(fQAZDCCuts && !fQAZDCCutsFlag) bPassZDCcuts=kFALSE;
645 
646  // EbE flow *********************************************************************************************************
647 
648  if(fCalculateEbEFlow) {
649  if(fNumberOfPOIsEBE>0 && fNumberOfPOIsEBE<=2500) {
651  } else {
652  fEBEFlowMulBin = -1;
653  }
654  }
655 
656  // run-by-run corrections ********************************************************************************************
657 
658  if(fRunNum!=fCachedRunNum) {
660  if(fWeightsList->FindObject(Form("fCRCQVecPhiHistRbR[%d]",fRunNum))) {
661  fPhiEtaRbRWeights = (TH3D*)(fWeightsList->FindObject(Form("fCRCQVecPhiRbRHist[%d]",fRunNum)));
662  } else {
663  AliWarning("WARNING: POIExtraWeights (kEtaPhiRbR) not found ! \n");
664  }
665  }
667  for (Int_t i=0; i<2; i++) {
668  if(fWeightsList->FindObject(Form("fCRCQVecPhiRbRHistCh[%d][%d]",fRunNum,i))) {
669  fPhiEtaRbRWeightsCh[i] = (TH3D*)(fWeightsList->FindObject(Form("fCRCQVecPhiRbRHistCh[%d][%d]",fRunNum,i)));
670  } else {
671  AliWarning("WARNING: POIExtraWeights (kEtaPhiChRbR) not found ! \n");
672  }
673  }
674  }
675  }
676 
677  // loop over particles **********************************************************************************************
678 
679  for(Int_t i=0;i<nPrim;i++) {
680  if(fExactNoRPs > 0 && nCounterNoRPs>fExactNoRPs){continue;}
681  aftsTrack=anEvent->GetTrack(i);
682  if(aftsTrack) {
683  if(!(aftsTrack->InRPSelection() || aftsTrack->InPOISelection())){continue;} // safety measure: consider only tracks which are RPs or POIs
684 
685  // RPs *********************************************************************************************************
686 
687  if(aftsTrack->InRPSelection()) {
688  nCounterNoRPs++;
689  dPhi = aftsTrack->Phi();
690  dPt = aftsTrack->Pt();
691  dEta = aftsTrack->Eta();
692  dCharge = aftsTrack->Charge();
693 
694  if(fSelectCharge==kPosCh && dCharge<0.) continue;
695  if(fSelectCharge==kNegCh && dCharge>0.) continue;
696 
697  cw = (dCharge > 0. ? 0 : 1);
698  wPhi = 1.;
699  wPt = 1.;
700  wEta = 1.;
701  wTrack = 1.;
702  wPhiEta = 1.;
703  wProbCut = 0.;
704 
705  // pT weights
707  if(dPt>fPtWeightsHist[fCenBin]->GetXaxis()->GetXmin() && dPt<fPtWeightsHist[fCenBin]->GetXaxis()->GetXmax()) wt = fPtWeightsHist[fCenBin]->Interpolate(dPt);
708  else if(dPt<fPtWeightsHist[fCenBin]->GetXaxis()->GetXmin()) wt = fPtWeightsHist[fCenBin]->Interpolate(fPtWeightsHist[fCenBin]->GetXaxis()->GetXmin());
709  else if(dPt>fPtWeightsHist[fCenBin]->GetXaxis()->GetXmax()) wt = fPtWeightsHist[fCenBin]->Interpolate(fPtWeightsHist[fCenBin]->GetXaxis()->GetXmax());
710  if(std::isfinite(1./wt)) wPhiEta *= 1./wt;
711  }
712 
713  // extra weights: eta, phi, ch, vtx
714  if(fPOIExtraWeights==kEtaPhi && fPhiEtaWeights) // determine phieta weight for POI:
715  {
716  wt = fPhiEtaWeights->GetBinContent(fPhiEtaWeights->FindBin(fCentralityEBE,dPhi,dEta));
717  if(std::isfinite(1./wt)) wPhiEta *= 1./wt;
718  }
719  if(fPOIExtraWeights==kEtaPhiCh && fPhiEtaWeightsCh[cw]) // determine phieta weight for POI, ch dep:
720  {
721  wt = fPhiEtaWeightsCh[cw]->GetBinContent(fPhiEtaWeightsCh[cw]->FindBin(fCentralityEBE,dPhi,dEta));
722  if(std::isfinite(1./wt)) wPhiEta *= 1./wt;
723  }
724  if(fPOIExtraWeights==kEtaPhiVtx) // determine phieta weight for POI:
725  {
726  // TBI
727  }
728  Int_t ptbebe = (dPt>1.? 2 : (dPt>0.5 ? 1 : 0)); // hardcoded
729  if(fPOIExtraWeights==kEtaPhiChPt && fPhiEtaWeightsChPt[cw][ptbebe]) // determine phieta weight for POI, ch dep:
730  {
731  wt = fPhiEtaWeightsChPt[cw][ptbebe]->GetBinContent(fPhiEtaWeightsChPt[cw][ptbebe]->FindBin(fCentralityEBE,dPhi,dEta));
732  if(std::isfinite(1./wt)) wPhiEta *= 1./wt;
733  }
734  // run-by-run
735  if(fPOIExtraWeights==kEtaPhiRbR && fPhiEtaRbRWeights) // determine phieta weight for POI:
736  {
737  wt = fPhiEtaRbRWeights->GetBinContent(fPhiEtaRbRWeights->FindBin(fCentralityEBE,dPhi,dEta));
738  if(std::isfinite(1./wt)) wPhiEta *= 1./wt;
739  }
740  if(fPOIExtraWeights==kEtaPhiChRbR && fPhiEtaRbRWeightsCh[cw]) // determine phieta weight for POI, ch dep:
741  {
742  wt = fPhiEtaRbRWeightsCh[cw]->GetBinContent(fPhiEtaRbRWeightsCh[cw]->FindBin(fCentralityEBE,dPhi,dEta));
743  if(std::isfinite(1./wt)) wPhiEta *= 1./wt;
744  }
745 
746  if(fPhiExclZoneHist) {
747  if(fPhiExclZoneHist->GetBinContent(fPhiExclZoneHist->FindBin(dEta,dPhi))<0.5) continue;
748  }
749 
750  // Calculate Re[Q_{m*n,k}] and Im[Q_{m*n,k}] for this event (m = 1,2,...,12, k = 0,1,...,8):
751  for(Int_t m=0;m<12;m++) // to be improved - hardwired 6
752  {
753  for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
754  {
755  (*fReQ)(m,k)+=pow(wPhiEta*wPhi*wPt*wEta*wTrack,k)*TMath::Cos((m+1)*n*dPhi);
756  (*fImQ)(m,k)+=pow(wPhiEta*wPhi*wPt*wEta*wTrack,k)*TMath::Sin((m+1)*n*dPhi);
757  }
758  }
759  // Calculate S_{p,k} for this event (Remark: final calculation of S_{p,k} follows after the loop over data bellow):
760  for(Int_t p=0;p<8;p++)
761  {
762  for(Int_t k=0;k<9;k++)
763  {
764  (*fSpk)(p,k)+=pow(wPhiEta*wPhi*wPt*wEta*wTrack,k);
765  }
766  }
767  // Differential flow:
769  {
770  ptEta[0] = dPt;
771  ptEta[1] = dEta;
772  // Calculate r_{m*n,k} and s_{p,k} (r_{m,k} is 'p-vector' for RPs):
773  for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
774  {
775  for(Int_t m=0;m<4;m++) // to be improved - hardwired 4
776  {
778  {
779  for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
780  {
781  fReRPQ1dEBE[0][pe][m][k]->Fill(ptEta[pe],pow(wPhiEta*wPhi*wPt*wEta*wTrack,k)*TMath::Cos((m+1.)*n*dPhi),1.);
782  fImRPQ1dEBE[0][pe][m][k]->Fill(ptEta[pe],pow(wPhiEta*wPhi*wPt*wEta*wTrack,k)*TMath::Sin((m+1.)*n*dPhi),1.);
783  if(m==0) // s_{p,k} does not depend on index m
784  {
785  fs1dEBE[0][pe][k]->Fill(ptEta[pe],pow(wPhiEta*wPhi*wPt*wEta*wTrack,k),1.);
786  } // end of if(m==0) // s_{p,k} does not depend on index m
787  } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
788  } // end of if(fCalculateDiffFlow)
790  {
791  fReRPQ2dEBE[0][m][k]->Fill(dPt,dEta,pow(wPhiEta*wPhi*wPt*wEta*wTrack,k)*TMath::Cos((m+1.)*n*dPhi),1.);
792  fImRPQ2dEBE[0][m][k]->Fill(dPt,dEta,pow(wPhiEta*wPhi*wPt*wEta*wTrack,k)*TMath::Sin((m+1.)*n*dPhi),1.);
793  if(m==0) // s_{p,k} does not depend on index m
794  {
795  fs2dEBE[0][k]->Fill(dPt,dEta,pow(wPhiEta*wPhi*wPt*wEta*wTrack,k),1.);
796  } // end of if(m==0) // s_{p,k} does not depend on index m
797  } // end of if(fCalculate2DDiffFlow)
798  } // end of for(Int_t m=0;m<4;m++) // to be improved - hardwired 4
799  } // end of for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
800  // Checking if RP particle is also POI particle:
801  if(aftsTrack->InPOISelection())
802  {
803  // Calculate q_{m*n,k} and s_{p,k} ('q-vector' and 's' for RPs && POIs):
804  for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
805  {
806  for(Int_t m=0;m<4;m++) // to be improved - hardwired 4
807  {
809  {
810  for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
811  {
812  fReRPQ1dEBE[2][pe][m][k]->Fill(ptEta[pe],pow(wPhiEta*wPhi*wPt*wEta*wTrack,k)*TMath::Cos((m+1.)*n*dPhi),1.);
813  fImRPQ1dEBE[2][pe][m][k]->Fill(ptEta[pe],pow(wPhiEta*wPhi*wPt*wEta*wTrack,k)*TMath::Sin((m+1.)*n*dPhi),1.);
814  if(m==0) // s_{p,k} does not depend on index m
815  {
816  fs1dEBE[2][pe][k]->Fill(ptEta[pe],pow(wPhiEta*wPhi*wPt*wEta*wTrack,k),1.);
817  } // end of if(m==0) // s_{p,k} does not depend on index m
818  } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
819  } // end of if(fCalculateDiffFlow)
821  {
822  fReRPQ2dEBE[2][m][k]->Fill(dPt,dEta,pow(wPhiEta*wPhi*wPt*wEta*wTrack,k)*TMath::Cos((m+1.)*n*dPhi),1.);
823  fImRPQ2dEBE[2][m][k]->Fill(dPt,dEta,pow(wPhiEta*wPhi*wPt*wEta*wTrack,k)*TMath::Sin((m+1.)*n*dPhi),1.);
824  if(m==0) // s_{p,k} does not depend on index m
825  {
826  fs2dEBE[2][k]->Fill(dPt,dEta,pow(wPhiEta*wPhi*wPt*wEta*wTrack,k),1.);
827  } // end of if(m==0) // s_{p,k} does not depend on index m
828  } // end of if(fCalculate2DDiffFlow)
829  } // end of for(Int_t m=0;m<4;m++) // to be improved - hardwired 4
830  } // end of for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
831  } // end of if(aftsTrack->InPOISelection())
832  } // end of if(fCalculateDiffFlow || fCalculate2DDiffFlow)
833 
834  } // end of if(pTrack->InRPSelection())
835 
836  // POIs ********************************************************************************************************
837 
838  if(aftsTrack->InPOISelection()) {
839  dPhi = aftsTrack->Phi();
840  dPt = aftsTrack->Pt();
841  dEta = aftsTrack->Eta();
842  dCharge = aftsTrack->Charge();
843  Int_t ITStype = aftsTrack->ITStype();
844 
845  if(fSelectCharge==kPosCh && dCharge<0.) continue;
846  if(fSelectCharge==kNegCh && dCharge>0.) continue;
847 
848  if(fCRCTestSin) {
849  if(dCharge > 0.) dPt += 1.E-2;
850  else dPt -= 1.E-2;
851  }
852 
853  cw = (dCharge > 0. ? 0 : 1);
854  wPhi = 1.;
855  wPt = 1.;
856  wEta = 1.;
857  wTrack = 1.;
858  wPhiEta = 1.;
859  wProbCut = 0.;
860 
861  // pT weights
863  if(dPt>fPtWeightsHist[fCenBin]->GetXaxis()->GetXmin() && dPt<fPtWeightsHist[fCenBin]->GetXaxis()->GetXmax()) wt = fPtWeightsHist[fCenBin]->Interpolate(dPt);
864  else if(dPt<fPtWeightsHist[fCenBin]->GetXaxis()->GetXmin()) wt = fPtWeightsHist[fCenBin]->Interpolate(fPtWeightsHist[fCenBin]->GetXaxis()->GetXmin());
865  else if(dPt>fPtWeightsHist[fCenBin]->GetXaxis()->GetXmax()) wt = fPtWeightsHist[fCenBin]->Interpolate(fPtWeightsHist[fCenBin]->GetXaxis()->GetXmax());
866  if(std::isfinite(1./wt)) wPhiEta *= 1./wt;
867  }
868 
869  // extra weights: eta, phi, ch, vtx
870  if(fPOIExtraWeights==kEtaPhi && fPhiEtaWeights) // determine phieta weight for POI:
871  {
872  wt = fPhiEtaWeights->GetBinContent(fPhiEtaWeights->FindBin(fCentralityEBE,dPhi,dEta));
873  if(std::isfinite(1./wt)) wPhiEta *= 1./wt;
874  }
875  if(fPOIExtraWeights==kEtaPhiCh && fPhiEtaWeightsCh[cw]) // determine phieta weight for POI, ch dep:
876  {
877  wt = fPhiEtaWeightsCh[cw]->GetBinContent(fPhiEtaWeightsCh[cw]->FindBin(fCentralityEBE,dPhi,dEta));
878  if(std::isfinite(1./wt)) wPhiEta *= 1./wt;
879  }
880  if(fPOIExtraWeights==kEtaPhiVtx) // determine phieta weight for POI:
881  {
882  // TBI
883  }
884  Int_t ptbebe = (dPt>1.? 2 : (dPt>0.5 ? 1 : 0)); // hardcoded
885  if(fPOIExtraWeights==kEtaPhiChPt && fPhiEtaWeightsChPt[cw][ptbebe]) // determine phieta weight for POI, ch dep:
886  {
887  wt = fPhiEtaWeightsChPt[cw][ptbebe]->GetBinContent(fPhiEtaWeightsChPt[cw][ptbebe]->FindBin(fCentralityEBE,dPhi,dEta));
888  if(std::isfinite(1./wt)) wPhiEta *= 1./wt;
889  }
890  // run-by-run
891  if(fPOIExtraWeights==kEtaPhiRbR && fPhiEtaRbRWeights) // determine phieta weight for POI:
892  {
893  wt = fPhiEtaRbRWeights->GetBinContent(fPhiEtaRbRWeights->FindBin(fCentralityEBE,dPhi,dEta));
894  if(std::isfinite(1./wt)) wPhiEta *= 1./wt;
895  }
896  if(fPOIExtraWeights==kEtaPhiChRbR && fPhiEtaRbRWeightsCh[cw]) // determine phieta weight for POI, ch dep:
897  {
898  wt = fPhiEtaRbRWeightsCh[cw]->GetBinContent(fPhiEtaRbRWeightsCh[cw]->FindBin(fCentralityEBE,dPhi,dEta));
899  if(std::isfinite(1./wt)) wPhiEta *= 1./wt;
900  }
901 
902  if(fUsePhiEtaCuts)
903  {
904  // test: remove region with low SPD efficiency
905  if(dPhi>2.136283 && dPhi<2.324779) continue;
906  }
907 
908  ptEta[0] = dPt;
909  ptEta[1] = dEta;
910  // Calculate p_{m*n,k} ('p-vector' for POIs):
911  for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
912  {
913  for(Int_t m=0;m<4;m++) // to be improved - hardwired 4
914  {
916  {
917  for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
918  {
919  fReRPQ1dEBE[1][pe][m][k]->Fill(ptEta[pe],pow(wPhiEta*wPhi*wPt*wEta*wTrack,k)*TMath::Cos((m+1.)*n*dPhi),1.);
920  fImRPQ1dEBE[1][pe][m][k]->Fill(ptEta[pe],pow(wPhiEta*wPhi*wPt*wEta*wTrack,k)*TMath::Sin((m+1.)*n*dPhi),1.);
921  } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
922  } // end of if(fCalculateDiffFlow)
924  {
925  fReRPQ2dEBE[1][m][k]->Fill(dPt,dEta,pow(wPhiEta*wPhi*wPt*wEta*wTrack,k)*TMath::Cos((m+1.)*n*dPhi),1.);
926  fImRPQ2dEBE[1][m][k]->Fill(dPt,dEta,pow(wPhiEta*wPhi*wPt*wEta*wTrack,k)*TMath::Sin((m+1.)*n*dPhi),1.);
927  } // end of if(fCalculate2DDiffFlow)
928  } // end of for(Int_t m=0;m<4;m++) // to be improved - hardwired 4
929  } // end of for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
930 
931  // Charge-Rapidity Correlations
932  for (Int_t h=0;h<fCRCnHar;h++) {
933 
934  fCRCQRe[cw][h]->Fill(dEta,wPhiEta*TMath::Cos((h+1.)*dPhi));
935  fCRCQIm[cw][h]->Fill(dEta,wPhiEta*TMath::Sin((h+1.)*dPhi));
936  fCRCMult[cw][h]->Fill(dEta,wPhiEta);
937 
938  fCRC2QRe[cw][h]->Fill(dEta,wPhiEta*TMath::Cos((h+1.)*dPhi));
939  fCRC2QIm[cw][h]->Fill(dEta,wPhiEta*TMath::Sin((h+1.)*dPhi));
940  fCRC2Mul[cw][h]->Fill(dEta,pow(wPhiEta,h));
941 
942  fCRCZDCQRe[cw][h]->Fill(dEta,wPhiEta*TMath::Cos((h+1.)*dPhi));
943  fCRCZDCQIm[cw][h]->Fill(dEta,wPhiEta*TMath::Sin((h+1.)*dPhi));
944  fCRCZDCMult[cw][h]->Fill(dEta,wPhiEta);
945 
946  if(fRandom->Integer(2)>0.5) {
947  fCRC2QRe[2][h]->Fill(dEta,wPhiEta*TMath::Cos((h+1.)*dPhi));
948  fCRC2QIm[2][h]->Fill(dEta,wPhiEta*TMath::Sin((h+1.)*dPhi));
949  fCRC2Mul[2][h]->Fill(dEta,pow(wPhiEta,h));
950  }
951 
952  if(fRandom->Integer(2)>0.5) {
953  fCRCZDCQRe[2][h]->Fill(dEta,wPhiEta*TMath::Cos((h+1.)*dPhi));
954  fCRCZDCQIm[2][h]->Fill(dEta,wPhiEta*TMath::Sin((h+1.)*dPhi));
955  fCRCZDCMult[2][h]->Fill(dEta,wPhiEta);
956  } else {
957  fCRCZDCQRe[3][h]->Fill(dEta,wPhiEta*TMath::Cos((h+1.)*dPhi));
958  fCRCZDCQIm[3][h]->Fill(dEta,wPhiEta*TMath::Sin((h+1.)*dPhi));
959  fCRCZDCMult[3][h]->Fill(dEta,wPhiEta);
960  }
961 
962  if(fCalculateCME) {
963  Double_t SpecWeig = 1.;
964  if(fUseZDCESESpecWeights && fZDCESESpecWeightsHist[fZDCESEclEbE] && dPt>0.2 && dPt<20.2) {
966  if(weraw > 0.) SpecWeig = 1./weraw;
967  }
968  fCMEQRe[cw][h]->Fill(dEta,SpecWeig*wPhiEta*TMath::Cos((h+1.)*dPhi));
969  fCMEQIm[cw][h]->Fill(dEta,SpecWeig*wPhiEta*TMath::Sin((h+1.)*dPhi));
970  fCMEMult[cw][h]->Fill(dEta,SpecWeig*wPhiEta);
971  fCMEQRe[2+cw][h]->Fill(dEta,pow(SpecWeig*wPhiEta,2.)*TMath::Cos((h+1.)*dPhi));
972  fCMEQIm[2+cw][h]->Fill(dEta,pow(SpecWeig*wPhiEta,2.)*TMath::Sin((h+1.)*dPhi));
973  fCMEMult[2+cw][h]->Fill(dEta,pow(SpecWeig*wPhiEta,2.));
974 
975  // spectra
976  fhCenvsSpec[fZDCESEclEbE]->Fill(fCentralityEBE,dPt,SpecWeig*wPhiEta);
977  fhCenvsSpec[fZDCESEnCl]->Fill(fCentralityEBE,dPt,SpecWeig*wPhiEta);
978  }
979 
980  } // end of for (Int_t h=0;h<fCRCnHar;h++)
981 
982  // Flow SP ZDC
983  Bool_t bFillDis=kTRUE;
984  for (Int_t k=0; k<fQVecPower; k++) {
985  for (Int_t h=0;h<fFlowNHarmMax;h++) {
986 
987  if(fFlowQCDeltaEta>0.) {
988 
989  fPOIPtDiffQRe[k][h]->Fill(dPt,pow(wPhiEta,k)*TMath::Cos((h+1.)*dPhi));
990  fPOIPtDiffQIm[k][h]->Fill(dPt,pow(wPhiEta,k)*TMath::Sin((h+1.)*dPhi));
991  fPOIPtDiffMul[k][h]->Fill(dPt,pow(wPhiEta,k));
992 
993  fPOIPtDiffQReCh[cw][k][h]->Fill(dPt,pow(wPhiEta,k)*TMath::Cos((h+1.)*dPhi));
994  fPOIPtDiffQImCh[cw][k][h]->Fill(dPt,pow(wPhiEta,k)*TMath::Sin((h+1.)*dPhi));
995  fPOIPtDiffMulCh[cw][k][h]->Fill(dPt,pow(wPhiEta,k));
996 
997  fPOIPhiDiffQRe[k][h]->Fill(dPhi,pow(wPhiEta,k)*TMath::Cos((h+1.)*dPhi));
998  fPOIPhiDiffQIm[k][h]->Fill(dPhi,pow(wPhiEta,k)*TMath::Sin((h+1.)*dPhi));
999  fPOIPhiDiffMul[k][h]->Fill(dPhi,pow(wPhiEta,k));
1000 
1001  if(fabs(dEta)>fFlowQCDeltaEta/2.) {
1002  Int_t keta = (dEta<0.?0:1);
1003  fPOIPtDiffQReEG[keta][k][h]->Fill(dPt,pow(wPhiEta,k)*TMath::Cos((h+1.)*dPhi));
1004  fPOIPtDiffQImEG[keta][k][h]->Fill(dPt,pow(wPhiEta,k)*TMath::Sin((h+1.)*dPhi));
1005  fPOIPtDiffMulEG[keta][k][h]->Fill(dPt,pow(wPhiEta,k));
1006  fPOIPhiDiffQReEG[keta][k][h]->Fill(dPhi,pow(wPhiEta,k)*TMath::Cos((h+1.)*dPhi));
1007  fPOIPhiDiffQImEG[keta][k][h]->Fill(dPhi,pow(wPhiEta,k)*TMath::Sin((h+1.)*dPhi));
1008  fPOIPhiDiffMulEG[keta][k][h]->Fill(dPhi,pow(wPhiEta,k));
1009  }
1010 
1011  } else if(fFlowQCDeltaEta<0. && fFlowQCDeltaEta>-1.) {
1012 
1013  if(dEta>0.) {
1014  fPOIPtDiffQRe[k][h]->Fill(dPt,pow(wPhiEta,k)*TMath::Cos((h+1.)*dPhi));
1015  fPOIPtDiffQIm[k][h]->Fill(dPt,pow(wPhiEta,k)*TMath::Sin((h+1.)*dPhi));
1016  fPOIPtDiffMul[k][h]->Fill(dPt,pow(wPhiEta,k));
1017 
1018  fPOIPhiDiffQRe[k][h]->Fill(dPhi,pow(wPhiEta,k)*TMath::Cos((h+1.)*dPhi));
1019  fPOIPhiDiffQIm[k][h]->Fill(dPhi,pow(wPhiEta,k)*TMath::Sin((h+1.)*dPhi));
1020  fPOIPhiDiffMul[k][h]->Fill(dPhi,pow(wPhiEta,k));
1021 
1022  Double_t boundetagap = fabs(fFlowQCDeltaEta);
1023 
1024  if((dEta>0. && dEta<0.4-boundetagap/2.) || (dEta>0.4+boundetagap/2. && dEta<0.8)) {
1025  Int_t keta;
1026  if(dEta>0. && dEta<0.4-boundetagap/2.) keta = 0;
1027  else keta = 1;
1028  fPOIPtDiffQReEG[keta][k][h]->Fill(dPt,pow(wPhiEta,k)*TMath::Cos((h+1.)*dPhi));
1029  fPOIPtDiffQImEG[keta][k][h]->Fill(dPt,pow(wPhiEta,k)*TMath::Sin((h+1.)*dPhi));
1030  fPOIPtDiffMulEG[keta][k][h]->Fill(dPt,pow(wPhiEta,k));
1031  }
1032  } else {
1033  bFillDis = kFALSE;
1034  continue;
1035  }
1036 
1037  } else if(fFlowQCDeltaEta<-1. && fFlowQCDeltaEta>-2.) {
1038 
1039  if(dEta<0.) {
1040  fPOIPtDiffQRe[k][h]->Fill(dPt,pow(wPhiEta,k)*TMath::Cos((h+1.)*dPhi));
1041  fPOIPtDiffQIm[k][h]->Fill(dPt,pow(wPhiEta,k)*TMath::Sin((h+1.)*dPhi));
1042  fPOIPtDiffMul[k][h]->Fill(dPt,pow(wPhiEta,k));
1043 
1044  fPOIPhiDiffQRe[k][h]->Fill(dPhi,pow(wPhiEta,k)*TMath::Cos((h+1.)*dPhi));
1045  fPOIPhiDiffQIm[k][h]->Fill(dPhi,pow(wPhiEta,k)*TMath::Sin((h+1.)*dPhi));
1046  fPOIPhiDiffMul[k][h]->Fill(dPhi,pow(wPhiEta,k));
1047 
1048  Double_t boundetagap = fabs(fFlowQCDeltaEta)-1.;
1049 
1050  if((dEta<0. && dEta>-0.4+boundetagap/2.) || (dEta<-0.4-boundetagap/2. && dEta>-0.8)) {
1051  Int_t keta;
1052  if(dEta<0. && dEta>-0.4+boundetagap/2.) keta = 0;
1053  else keta = 1;
1054  fPOIPtDiffQReEG[keta][k][h]->Fill(dPt,pow(wPhiEta,k)*TMath::Cos((h+1.)*dPhi));
1055  fPOIPtDiffQImEG[keta][k][h]->Fill(dPt,pow(wPhiEta,k)*TMath::Sin((h+1.)*dPhi));
1056  fPOIPtDiffMulEG[keta][k][h]->Fill(dPt,pow(wPhiEta,k));
1057  }
1058  } else {
1059  bFillDis = kFALSE;
1060  continue;
1061  }
1062 
1063  }
1064  }
1065  }
1066 
1067  for (Int_t h=0;h<fFlowNHarmMax;h++) {
1068  fEtaDiffQRe[cw][h]->Fill(dEta,wPhiEta*TMath::Cos((h+1.)*dPhi));
1069  fEtaDiffQIm[cw][h]->Fill(dEta,wPhiEta*TMath::Sin((h+1.)*dPhi));
1070  fEtaDiffMul[cw][h]->Fill(dEta,pow(wPhiEta,h+1));
1071  fPOIEtaPtQRe[cw][h]->Fill(dEta,dPt,wPhiEta*TMath::Cos((h+1.)*dPhi));
1072  fPOIEtaPtQIm[cw][h]->Fill(dEta,dPt,wPhiEta*TMath::Sin((h+1.)*dPhi));
1073  fPOIEtaPtMul[cw][h]->Fill(dEta,dPt,wPhiEta);
1074  }
1075 
1076  if(fCalculateEbEFlow) {
1077  if(fEBEFlowMulBin>=0) fEbEFlowAzimDis[fEBEFlowMulBin]->Fill(dPhi,wPhiEta);
1078  }
1079  if(bFillDis && bPassZDCcuts) {
1080 
1081  fFlowSPZDCv1etaPro[fCenBin][0][7]->Fill(dEta,TMath::Cos(dPhi)*ZARe+TMath::Sin(dPhi)*ZAIm,wPhiEta);
1082  fFlowSPZDCv1etaPro[fCenBin][0][8]->Fill(dEta,TMath::Cos(dPhi)*ZCRe+TMath::Sin(dPhi)*ZCIm,wPhiEta);
1083  if(cw==0) {
1084  fFlowSPZDCv1etaPro[fCenBin][0][9]->Fill(dEta,TMath::Cos(dPhi)*ZARe+TMath::Sin(dPhi)*ZAIm,wPhiEta);
1085  fFlowSPZDCv1etaPro[fCenBin][0][10]->Fill(dEta,TMath::Cos(dPhi)*ZCRe+TMath::Sin(dPhi)*ZCIm,wPhiEta);
1086  } else {
1087  fFlowSPZDCv1etaPro[fCenBin][0][11]->Fill(dEta,TMath::Cos(dPhi)*ZARe+TMath::Sin(dPhi)*ZAIm,wPhiEta);
1088  fFlowSPZDCv1etaPro[fCenBin][0][12]->Fill(dEta,TMath::Cos(dPhi)*ZCRe+TMath::Sin(dPhi)*ZCIm,wPhiEta);
1089  }
1090 
1091 // if(fCentralityEBE>5. && fCentralityEBE<40.) {
1092 // if(fbFlagIsPosMagField) {
1093 // fFlowSPZDCv1etaProPhi[0]->Fill(dEta,dPhi,TMath::Cos(dPhi)*ZARe+TMath::Sin(dPhi)*ZAIm,wPhiEta);
1094 // fFlowSPZDCv1etaProPhi[1]->Fill(dEta,dPhi,TMath::Cos(dPhi)*ZCRe+TMath::Sin(dPhi)*ZCIm,wPhiEta);
1095 // if(cw==0) {
1096 // fFlowSPZDCv1etaProPhi[2]->Fill(dEta,dPhi,TMath::Cos(dPhi)*ZARe+TMath::Sin(dPhi)*ZAIm,wPhiEta);
1097 // fFlowSPZDCv1etaProPhi[3]->Fill(dEta,dPhi,TMath::Cos(dPhi)*ZCRe+TMath::Sin(dPhi)*ZCIm,wPhiEta);
1098 // } else {
1099 // fFlowSPZDCv1etaProPhi[4]->Fill(dEta,dPhi,TMath::Cos(dPhi)*ZARe+TMath::Sin(dPhi)*ZAIm,wPhiEta);
1100 // fFlowSPZDCv1etaProPhi[5]->Fill(dEta,dPhi,TMath::Cos(dPhi)*ZCRe+TMath::Sin(dPhi)*ZCIm,wPhiEta);
1101 // }
1102 // } else {
1103 // fFlowSPZDCv1etaProPhi[6]->Fill(dEta,dPhi,TMath::Cos(dPhi)*ZARe+TMath::Sin(dPhi)*ZAIm,wPhiEta);
1104 // fFlowSPZDCv1etaProPhi[7]->Fill(dEta,dPhi,TMath::Cos(dPhi)*ZCRe+TMath::Sin(dPhi)*ZCIm,wPhiEta);
1105 // if(cw==0) {
1106 // fFlowSPZDCv1etaProPhi[8]->Fill(dEta,dPhi,TMath::Cos(dPhi)*ZARe+TMath::Sin(dPhi)*ZAIm,wPhiEta);
1107 // fFlowSPZDCv1etaProPhi[9]->Fill(dEta,dPhi,TMath::Cos(dPhi)*ZCRe+TMath::Sin(dPhi)*ZCIm,wPhiEta);
1108 // } else {
1109 // fFlowSPZDCv1etaProPhi[10]->Fill(dEta,dPhi,TMath::Cos(dPhi)*ZARe+TMath::Sin(dPhi)*ZAIm,wPhiEta);
1110 // fFlowSPZDCv1etaProPhi[11]->Fill(dEta,dPhi,TMath::Cos(dPhi)*ZCRe+TMath::Sin(dPhi)*ZCIm,wPhiEta);
1111 // }
1112 // }
1113 // }
1114 // if(fCentralityEBE>5. && fCentralityEBE<40.) {
1115 // Double_t dITStype = ITStype+0.5;
1116 // if(fbFlagIsPosMagField) {
1117 // fFlowSPZDCv1etaProITS[0]->Fill(dEta,dITStype,TMath::Cos(dPhi)*ZARe+TMath::Sin(dPhi)*ZAIm,wPhiEta);
1118 // fFlowSPZDCv1etaProITS[1]->Fill(dEta,dITStype,TMath::Cos(dPhi)*ZCRe+TMath::Sin(dPhi)*ZCIm,wPhiEta);
1119 // if(cw==0) {
1120 // fFlowSPZDCv1etaProITS[2]->Fill(dEta,dITStype,TMath::Cos(dPhi)*ZARe+TMath::Sin(dPhi)*ZAIm,wPhiEta);
1121 // fFlowSPZDCv1etaProITS[3]->Fill(dEta,dITStype,TMath::Cos(dPhi)*ZCRe+TMath::Sin(dPhi)*ZCIm,wPhiEta);
1122 // } else {
1123 // fFlowSPZDCv1etaProITS[4]->Fill(dEta,dITStype,TMath::Cos(dPhi)*ZARe+TMath::Sin(dPhi)*ZAIm,wPhiEta);
1124 // fFlowSPZDCv1etaProITS[5]->Fill(dEta,dITStype,TMath::Cos(dPhi)*ZCRe+TMath::Sin(dPhi)*ZCIm,wPhiEta);
1125 // }
1126 // } else {
1127 // fFlowSPZDCv1etaProITS[6]->Fill(dEta,dITStype,TMath::Cos(dPhi)*ZARe+TMath::Sin(dPhi)*ZAIm,wPhiEta);
1128 // fFlowSPZDCv1etaProITS[7]->Fill(dEta,dITStype,TMath::Cos(dPhi)*ZCRe+TMath::Sin(dPhi)*ZCIm,wPhiEta);
1129 // if(cw==0) {
1130 // fFlowSPZDCv1etaProITS[8]->Fill(dEta,dITStype,TMath::Cos(dPhi)*ZARe+TMath::Sin(dPhi)*ZAIm,wPhiEta);
1131 // fFlowSPZDCv1etaProITS[9]->Fill(dEta,dITStype,TMath::Cos(dPhi)*ZCRe+TMath::Sin(dPhi)*ZCIm,wPhiEta);
1132 // } else {
1133 // fFlowSPZDCv1etaProITS[10]->Fill(dEta,dITStype,TMath::Cos(dPhi)*ZARe+TMath::Sin(dPhi)*ZAIm,wPhiEta);
1134 // fFlowSPZDCv1etaProITS[11]->Fill(dEta,dITStype,TMath::Cos(dPhi)*ZCRe+TMath::Sin(dPhi)*ZCIm,wPhiEta);
1135 // }
1136 // }
1137 // if(fbFlagIsPosMagField) {
1138 // fFlowSPZDCv1etaProITSDis[0][ITStype]->Fill(dEta,dPhi,wPhiEta);
1139 // } else {
1140 // fFlowSPZDCv1etaProITSDis[1][ITStype]->Fill(dEta,dPhi,wPhiEta);
1141 // }
1142 // }
1143 
1144  // all runs
1145  fCRCQVecPhiHist->Fill(fCentralityEBE,dPhi,dEta,wPhiEta);
1146  fCRCQVecPhiHistCh[cw]->Fill(fCentralityEBE,dPhi,dEta,wPhiEta);
1147  Int_t ptbebe = (dPt>1.? 2 : (dPt>0.5 ? 1 : 0)); // hardcoded
1148  fCRCQVecPhiHistChPt[cw][ptbebe]->Fill(fCentralityEBE,dPhi,dEta,wPhiEta);
1149  for (Int_t h=0;h<6;h++) {
1150  fCRCQVecHarCosProCh[cw]->Fill(fCentralityEBE,(Double_t)h+0.5,dEta,TMath::Cos((h+1.)*dPhi),wPhiEta);
1151  fCRCQVecHarSinProCh[cw]->Fill(fCentralityEBE,(Double_t)h+0.5,dEta,TMath::Sin((h+1.)*dPhi),wPhiEta);
1152  }
1153  // run-by-run
1154 // fCRCQVecPhiRbRHist[fRunBin]->Fill(fCentralityEBE,dPhi,dEta,wPhiEta);
1155 // fCRCQVecPhiRbRHistCh[fRunBin][cw]->Fill(fCentralityEBE,dPhi,dEta,wPhiEta);
1156  if(fCentralityEBE>0. && fCentralityEBE<70.) {
1157 // fCRCQVecPhiVtxHist[etab]->Fill(fVtxPosCor[0],fVtxPosCor[1],fVtxPosCor[2],dPhi,wPhiEta);
1158 // fCRCQVecEtaHist[fRunBin][0]->Fill(dEta,fVtxPosCor[0],TMath::Cos(dPhi),wPhiEta*fCenWeightEbE);
1159 // fCRCQVecEtaHist[fRunBin][1]->Fill(dEta,fVtxPosCor[1],TMath::Cos(dPhi),wPhiEta*fCenWeightEbE);
1160 // fCRCQVecEtaHist[fRunBin][2]->Fill(dEta,fVtxPosCor[2],TMath::Cos(dPhi),wPhiEta*fCenWeightEbE);
1161 // fCRCQVecEtaHist[fRunBin][3]->Fill(dEta,fVtxPosCor[0],TMath::Sin(dPhi),wPhiEta*fCenWeightEbE);
1162 // fCRCQVecEtaHist[fRunBin][4]->Fill(dEta,fVtxPosCor[1],TMath::Sin(dPhi),wPhiEta*fCenWeightEbE);
1163 // fCRCQVecEtaHist[fRunBin][5]->Fill(dEta,fVtxPosCor[2],TMath::Sin(dPhi),wPhiEta*fCenWeightEbE);
1164  }
1165 
1166 // fCRCTPCQVecCenEComTot[fRunBin][0+cw*2]->Fill(fCentralityEBE,(ZCM+ZAM)/2.,TMath::Cos(dPhi),wPhiEta);
1167 // fCRCTPCQVecCenEComTot[fRunBin][1+cw*2]->Fill(fCentralityEBE,(ZCM+ZAM)/2.,TMath::Sin(dPhi),wPhiEta);
1168  fCRCTPCQVecCenRefMulTot[fRunBin][0+cw*2]->Fill(fCentralityEBE,fReferenceMultiplicityEBE,TMath::Cos(dPhi),wPhiEta);
1169  fCRCTPCQVecCenRefMulTot[fRunBin][1+cw*2]->Fill(fCentralityEBE,fReferenceMultiplicityEBE,TMath::Sin(dPhi),wPhiEta);
1171 
1172 // if(fnEvRbR[fRunBin]) {
1173 // Double_t FracRun = (Double_t)fRbREventCounter/fnEvRbR[fRunBin];
1174 // if(fCentralityEBE>5. && fCentralityEBE<40.) {
1175 // for(Int_t i=0; i<3; i++) {
1176 // fCRCTPCQVecCenVtxTime[fRunBin][i][0+cw*2]->Fill(FracRun,fVtxPosCor[i],TMath::Cos(dPhi),wPhiEta);
1177 // fCRCTPCQVecCenVtxTime[fRunBin][i][1+cw*2]->Fill(FracRun,fVtxPosCor[i],TMath::Sin(dPhi),wPhiEta);
1178 // }
1179 // }
1180 // }
1181 
1182  }
1183 // fCRCQVecPhiHistVtxDep[fRunBin][fCenBin]->Fill(fVtxPos[2],dPhi,dEta,wPhiEta);
1185  fFlowQCSpectraCharge[cw]->Fill(fCentralityEBE,dPt,wPhiEta*fCenWeightEbE);
1186 
1187  } // end of if(pTrack->InPOISelection())
1188  } else // to if(aftsTrack)
1189  {
1190  printf("\n WARNING (QC): No particle (i.e. aftsTrack is a NULL pointer in AFAWQC::Make())!!!!\n\n");
1191  }
1192  } // end of for(Int_t i=0;i<nPrim;i++)
1193 
1194  // ************************************************************************************************************
1195 
1196  // e) Calculate the final expressions for S_{p,k} and s_{p,k} (important !!!!):
1197  for(Int_t p=0;p<8;p++)
1198  {
1199  for(Int_t k=0;k<9;k++)
1200  {
1201  (*fSpk)(p,k)=pow((*fSpk)(p,k),p+1);
1202  }
1203  }
1204 
1205  // f) Call the methods which calculate correlations for reference flow:
1207  {
1209  {
1210  if(fNumberOfRPsEBE>1){this->CalculateIntFlowCorrelations();} // without using particle weights
1211  } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
1212  {
1213  if(fNumberOfRPsEBE>1){this->CalculateIntFlowCorrelationsUsingParticleWeights();} // with using particle weights
1214  }
1215  // Whether or not using particle weights the following is calculated in the same way:
1219  // Non-isotropic terms:
1221  {
1224  } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
1225  {
1228  }
1229  // Whether or not using particle weights the following is calculated in the same way:
1233  // Mixed harmonics:
1235  } // end of if(!fEvaluateIntFlowNestedLoops)
1236 
1237  // g) Call the methods which calculate correlations for differential flow:
1239  {
1241  {
1242  // Without using particle weights:
1243  this->CalculateDiffFlowCorrelations("RP","Pt");
1245  this->CalculateDiffFlowCorrelations("POI","Pt");
1247  // Non-isotropic terms:
1256  } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
1257  {
1258  // With using particle weights:
1263  // Non-isotropic terms:
1272  }
1273  // Whether or not using particle weights the following is calculated in the same way:
1274  this->CalculateDiffFlowProductOfCorrelations("RP","Pt");
1276  this->CalculateDiffFlowProductOfCorrelations("POI","Pt");
1278  this->CalculateDiffFlowSumOfEventWeights("RP","Pt");
1280  this->CalculateDiffFlowSumOfEventWeights("POI","Pt");
1286  } // end of if(!fEvaluateDiffFlowNestedLoops && fCalculateDiffFlow)
1287 
1288  // h) Call the methods which calculate correlations for 2D differential flow:
1290  {
1292  {
1293  // Without using particle weights:
1294  this->Calculate2DDiffFlowCorrelations("RP");
1295  this->Calculate2DDiffFlowCorrelations("POI");
1296  // Non-isotropic terms:
1297  // ... to be ctd ...
1298  } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
1299  {
1300  // With using particle weights:
1301  // ... to be ctd ...
1302  // Non-isotropic terms:
1303  // ... to be ctd ...
1304  }
1305  // Whether or not using particle weights the following is calculated in the same way:
1306  // ... to be ctd ...
1307  } // end of if(!fEvaluateDiffFlowNestedLoops && fCalculate2DDiffFlow)
1308 
1309  // i) Call the methods which calculate other differential correlators:
1311  {
1313  {
1314  // Without using particle weights:
1315  this->CalculateOtherDiffCorrelators("RP","Pt");
1317  this->CalculateOtherDiffCorrelators("POI","Pt");
1319  } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
1320  {
1321  // With using particle weights:
1322  // ... to be ctd ...
1323  }
1324  // Whether or not using particle weights the following is calculated in the same way:
1325  // ... to be ctd ...
1326  } // end of if(!fEvaluateDiffFlowNestedLoops)
1327 
1328  // i.2) Calculate CRC quantities:
1329  if(fCalculateCRC) {
1330  if(fCalculateCRCInt) this->CalculateCRCCorr();
1331  if(fCalculateCRC2) this->CalculateCRC2Cor();
1333  if(fCalculateCRCZDC && fUseZDC) this->CalculateCRCZDC();
1334  if(fCalculateCRCPt) this->CalculateCRCPtCorr();
1335  // if(fUseVZERO && fUseZDC) this->CalculateVZvsZDC();
1336  if(fCalculateCME && fUseZDC) {
1337  this->CalculateCMETPC();
1338  this->CalculateCMEZDC();
1339  }
1340  }
1341  // WARNING: do not invert order of SPZDC and QC, used in SC
1343  if(fCalculateFlowQC) {
1344  this->CalculateFlowQC();
1345  this->CalculateFlowQCHighOrders();
1346  }
1348  if(fCalculateEbEFlow) this->FitEbEFlow();
1349 
1350  // j) Distributions of correlations:
1352 
1353  // l) Cross-check with nested loops correlators for reference flow:
1355 
1356  // m) Cross-check with nested loops correlators for differential flow:
1358 
1359  // n) Store multiplicity in various:
1360  if(fStoreVarious) this->FillVarious();
1361 
1362  // o) Reset all event-by-event quantities (very important !!!!):
1364 
1365  // p) cache run number
1367  fRbREventCounter++;
1368 
1369  fQAZDCCutsFlag = kTRUE;
1370  // printf("Make done \n");
1371 
1372 } // end of AliFlowAnalysisCRC::Make(AliFlowEventSimple* anEvent)
1373 
1374 //=======================================================================================================================
1375 
1377 {
1378  // Calculate the final results.
1379 
1380  // a) Check all pointers used in this method;
1381  // b) Access the constants;
1382  // c) Access the flags;
1383  // d) Calculate reference cumulants (not corrected for detector effects);
1384  // e) Correct reference cumulants for detector effects;
1385  // f) Calculate reference flow;
1386  // g) Store results for reference flow in AliFlowCommonHistResults and print them on the screen;
1387  // h) Calculate the final results for differential flow (without/with weights);
1388  // i) Correct the results for differential flow (without/with weights) for effects of non-uniform acceptance (NUA);
1389  // j) Calculate the final results for integrated flow (RP/POI) and store in AliFlowCommonHistResults;
1390  // k) Store results for differential flow in AliFlowCommonHistResults;
1391  // l) Print the final results for integrated flow (RP/POI) on the screen;
1392  // m) Cross-checking: Results from Q-vectors vs results from nested loops;
1393  // n) Calculate cumulants for mixed harmonics;
1394  // o) Calculate charge-rapidity correlations;
1395  // p) Calculate cumulants for bootstrap;
1396  // q) Finalize various;
1397 
1398  // a) Check all pointers used in this method:
1399  this->CheckPointersUsedInFinish();
1400 
1401  // b) Access the constants:
1402  this->CommonConstants("Finish");
1403 
1405  fHarmonic = (Int_t)(fCommonHists->GetHarmonic())->GetBinContent(1);
1406  }
1407 
1408  // c) Access the flags: // tbi (implement a method for this? should I store again the flags because they can get modified with redoFinish?)
1409  fUsePhiWeights = (Bool_t)fUseParticleWeights->GetBinContent(1);
1410  fUsePtWeights = (Bool_t)fUseParticleWeights->GetBinContent(2);
1411  fUseEtaWeights = (Bool_t)fUseParticleWeights->GetBinContent(3);
1412  fUseTrackWeights = (Bool_t)fUseParticleWeights->GetBinContent(4);
1413  fUsePhiEtaWeights = (Bool_t)fUseParticleWeights->GetBinContent(5);
1414  fUsePhiEtaWeightsChDep = (Bool_t)fUseParticleWeights->GetBinContent(6);
1415  fUsePhiEtaWeightsVtxDep = (Bool_t)fUseParticleWeights->GetBinContent(7);
1417  fApplyCorrectionForNUA = (Bool_t)fIntFlowFlags->GetBinContent(3);
1418  fPrintFinalResults[0] = (Bool_t)fIntFlowFlags->GetBinContent(4);
1419  fPrintFinalResults[1] = (Bool_t)fIntFlowFlags->GetBinContent(5);
1420  fPrintFinalResults[2] = (Bool_t)fIntFlowFlags->GetBinContent(6);
1421  fPrintFinalResults[3] = (Bool_t)fIntFlowFlags->GetBinContent(7);
1422  fApplyCorrectionForNUAVsM = (Bool_t)fIntFlowFlags->GetBinContent(8);
1423  fPropagateErrorAlsoFromNIT = (Bool_t)fIntFlowFlags->GetBinContent(9);
1424  fCalculateCumulantsVsM = (Bool_t)fIntFlowFlags->GetBinContent(10);
1425  fMinimumBiasReferenceFlow = (Bool_t)fIntFlowFlags->GetBinContent(11);
1426  fForgetAboutCovariances = (Bool_t)fIntFlowFlags->GetBinContent(12);
1427  fStoreVarious = (Bool_t)fIntFlowFlags->GetBinContent(13);
1428  fFillMultipleControlHistograms = (Bool_t)fIntFlowFlags->GetBinContent(14);
1429  fCalculateAllCorrelationsVsM = (Bool_t)fIntFlowFlags->GetBinContent(15);
1430  fUse2DHistograms = (Bool_t)fIntFlowFlags->GetBinContent(18);
1431  fFillProfilesVsMUsingWeights = (Bool_t)fIntFlowFlags->GetBinContent(19);
1432  fUseQvectorTerms = (Bool_t)fIntFlowFlags->GetBinContent(20);
1435  fCrossCheckInPtBinNo = (Int_t)fEvaluateNestedLoops->GetBinContent(3);
1436  fCrossCheckInEtaBinNo = (Int_t)fEvaluateNestedLoops->GetBinContent(4);
1438  //fHarmonic = (Int_t)fMixedHarmonicsFlags->GetBinContent(2); // TBI should I add inpdependent generic harmonic here?
1440  fUseBootstrap = (Bool_t)fBootstrapFlags->GetBinContent(1);
1441  fUseBootstrapVsM = (Bool_t)fBootstrapFlags->GetBinContent(2);
1442  fnSubsamples = (Int_t)fBootstrapFlags->GetBinContent(3);
1443 
1444  // d) Calculate reference cumulants (not corrected for detector effects):
1447  this->CalculateCumulantsIntFlow();
1448 
1449  // e) Correct reference cumulants for detector effects:
1453 
1454  // f) Calculate reference flow:
1455  this->CalculateReferenceFlow();
1456 
1457  // g) Store results for reference flow in AliFlowCommonHistResults and print them on the screen:
1461 
1462  // h) Calculate the final results for differential flow (without/with weights):
1463  if(fCalculateDiffFlow)
1464  {
1465  this->FinalizeReducedCorrelations("RP","Pt");
1467  this->FinalizeReducedCorrelations("POI","Pt");
1468  if(fCalculateDiffFlowVsEta){this->FinalizeReducedCorrelations("POI","Eta");}
1469  this->CalculateDiffFlowCovariances("RP","Pt");
1471  this->CalculateDiffFlowCovariances("POI","Pt");
1472  if(fCalculateDiffFlowVsEta){this->CalculateDiffFlowCovariances("POI","Eta");}
1473  this->CalculateDiffFlowCumulants("RP","Pt");
1474  if(fCalculateDiffFlowVsEta){this->CalculateDiffFlowCumulants("RP","Eta");}
1475  this->CalculateDiffFlowCumulants("POI","Pt");
1476  if(fCalculateDiffFlowVsEta){this->CalculateDiffFlowCumulants("POI","Eta");}
1477  this->CalculateDiffFlow("RP","Pt");
1478  if(fCalculateDiffFlowVsEta){this->CalculateDiffFlow("RP","Eta");}
1479  this->CalculateDiffFlow("POI","Pt");
1480  if(fCalculateDiffFlowVsEta){this->CalculateDiffFlow("POI","Eta");}
1481  } // if(fCalculateDiffFlow)
1482 
1483  // i) Correct the results for differential flow (without/with weights) for effects of non-uniform acceptance (NUA):
1484  if(fCalculateDiffFlow)
1485  {
1486  this->FinalizeCorrectionTermsForNUADiffFlow("RP","Pt");
1488  this->FinalizeCorrectionTermsForNUADiffFlow("POI","Pt");
1495  {
1496  this->CalculateDiffFlowCorrectedForNUA("RP","Pt");
1498  this->CalculateDiffFlowCorrectedForNUA("POI","Pt");
1500  }
1501  } // end of if(fCalculateDiffFlow && fApplyCorrectionForNUA)
1502 
1503  // i) Calcualate final results for 2D differential flow:
1505  {
1506  this->Calculate2DDiffFlowCumulants("RP");
1507  this->Calculate2DDiffFlowCumulants("POI");
1508  this->Calculate2DDiffFlow("RP");
1509  this->Calculate2DDiffFlow("POI");
1510  } // end of if(fCalculate2DDiffFlow)
1511 
1512  // j) Calculate the final results for integrated flow (RP/POI) and store in AliFlowCommonHistResults:
1513  if(fCalculateDiffFlow)
1514  {
1517  }
1518 
1519  // k) Store results for differential flow in AliFlowCommonHistResults:
1520  if(fCalculateDiffFlow)
1521  {
1522  this->FillCommonHistResultsDiffFlow("RP");
1523  this->FillCommonHistResultsDiffFlow("POI");
1524  }
1525 
1526  // l) Print the final results for integrated flow (RP/POI) on the screen:
1529 
1530  // m) Cross-checking: Results from Q-vectors vs results from nested loops:
1531  // m1) Reference flow:
1533  {
1538  } // end of if(fEvaluateIntFlowNestedLoops)
1539  // m2) Differential flow:
1541  {
1542  // Correlations:
1544  this->CrossCheckDiffFlowCorrelations("RP","Pt");
1546  this->CrossCheckDiffFlowCorrelations("POI","Pt");
1548  // Correction terms for non-uniform acceptance:
1549  this->CrossCheckDiffFlowCorrectionTermsForNUA("RP","Pt");
1551  this->CrossCheckDiffFlowCorrectionTermsForNUA("POI","Pt");
1553  // Other differential correlators:
1554  this->CrossCheckOtherDiffCorrelators("RP","Pt");
1556  this->CrossCheckOtherDiffCorrelators("POI","Pt");
1558  } // end of if(fEvaluateDiffFlowNestedLoops)
1559 
1560  // n) Calculate cumulants for mixed harmonics:
1562 
1563  // o) Calculate charge-rapidity correlations:
1564  if(fCalculateCRC) {
1565  if(fCalculateCRCInt) this->FinalizeCRCCorr();
1566  if(fCalculateCRC2) this->FinalizeCRC2Cor();
1568  if(fCalculateCRCZDC && fUseZDC) this->FinalizeCRCZDC();
1569  if(fCalculateCRCPt) this->FinalizeCRCPtCorr();
1570  if(fCalculateCME && fUseZDC) {
1571  this->FinalizeCMETPC();
1572  this->FinalizeCMEZDC();
1573  }
1574  }
1575  // WARNING: do not invert order of SPZDC and QC, used in SC
1577  if(fCalculateFlowQC) {
1578  this->FinalizeFlowQC();
1579  this->FinalizeFlowQCHighOrders();
1580  }
1582 
1583  // p) Calculate cumulants for bootstrap:
1585 
1586  // q) Finalize various:
1587  if(fStoreVarious) this->FinalizeVarious();
1588 
1589 } // end of AliFlowAnalysisCRC::Finish()
1590 
1591 //=======================================================================================================================
1592 
1594 {
1595  // Evaluate all correlators for reference flow with nested loops.
1596 
1597  Int_t nPrim = anEvent->NumberOfTracks(); // number of primaries
1598  if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10
1599  {
1600  // Without using particle weights:
1602  {
1603  // Correlations:
1604  this->CalculateIntFlowCorrelations(); // from Q-vectors
1605  this->EvaluateIntFlowCorrelationsWithNestedLoops(anEvent); // from nested loops (TBI: do I have to pass here anEvent or not?)
1606  // Correction for non-uniform acceptance:
1607  this->CalculateIntFlowCorrectionsForNUASinTerms(); // from Q-vectors (sin terms)
1608  this->CalculateIntFlowCorrectionsForNUACosTerms(); // from Q-vectors (cos terms)
1609  this->EvaluateIntFlowCorrectionsForNUAWithNestedLoops(anEvent); // from nested loops (both sin and cos terms)
1610  // Mixed harmonics:
1612  {
1613  this->CalculateMixedHarmonics(); // from Q-vectors
1614  this->EvaluateMixedHarmonicsWithNestedLoops(anEvent); // from nested loops (TBI: do I have to pass here anEvent or not?)
1615  } // end of if(fCalculateMixedHarmonics)
1616  }
1617  // Using particle weights:
1619  {
1620  // Correlations
1621  this->CalculateIntFlowCorrelationsUsingParticleWeights(); // from Q-vectors
1622  this->EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent); // from nested loops (to be improved: do I have to pass here anEvent or not?)
1623  // Correction for non-uniform acceptance:
1624  this->CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights(); // from Q-vectors (sin terms)
1625  this->CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights(); // from Q-vectors (cos terms)
1626  this->EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(anEvent); // from nested loops (both sin and cos terms)
1627  }
1628  } else if(nPrim>fMaxAllowedMultiplicity) // to if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity)
1629  {
1630  cout<<endl;
1631  cout<<"Skipping the event because multiplicity is "<<nPrim<<". Too high to evaluate nested loops!"<<endl;
1632  } else
1633  {
1634  cout<<endl;
1635  cout<<"Skipping the event because multiplicity is "<<nPrim<<"."<<endl;
1636  }
1637 
1638 } // end of void AliFlowAnalysisCRC::EvaluateIntFlowNestedLoops(AliFlowEventSimple* anEvent)
1639 
1640 //=======================================================================================================================
1641 
1643 {
1644  // Evalauted all correlators for differential flow with nested loops.
1645 
1646  if(!fCalculateDiffFlow){return;}
1647 
1648  Int_t nPrim = anEvent->NumberOfTracks(); // number of primaries
1649  if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10
1650  {
1651  // Without using particle weights:
1653  {
1654  // 1.) Reduced correlations:
1655  // Q-vectors:
1656  this->CalculateDiffFlowCorrelations("RP","Pt");
1657  this->CalculateDiffFlowCorrelations("RP","Eta");
1658  this->CalculateDiffFlowCorrelations("POI","Pt");
1659  this->CalculateDiffFlowCorrelations("POI","Eta");
1660  // Nested loops:
1661  this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"RP","Pt");
1662  this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"RP","Eta");
1663  this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"POI","Pt");
1664  this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"POI","Eta");
1665  // 2.) Reduced corrections for non-uniform acceptance:
1666  // Q-vectors:
1670  this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Eta");
1674  this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Eta");
1675  // Nested loops:
1677  this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"RP","Eta");
1678  this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"POI","Pt");
1679  this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"POI","Eta");
1680  // 3.) Other differential correlators:
1681  // Q-vectors:
1682  this->CalculateOtherDiffCorrelators("RP","Pt");
1683  this->CalculateOtherDiffCorrelators("RP","Eta");
1684  this->CalculateOtherDiffCorrelators("POI","Pt");
1685  this->CalculateOtherDiffCorrelators("POI","Eta");
1686  // Nested loops:
1687  this->EvaluateOtherDiffCorrelatorsWithNestedLoops(anEvent,"RP","Pt");
1688  this->EvaluateOtherDiffCorrelatorsWithNestedLoops(anEvent,"RP","Eta");
1689  this->EvaluateOtherDiffCorrelatorsWithNestedLoops(anEvent,"POI","Pt");
1690  this->EvaluateOtherDiffCorrelatorsWithNestedLoops(anEvent,"POI","Eta");
1691  } // end of if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
1692  // Using particle weights:
1694  {
1715  } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights)
1716  } // end of if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10
1717 
1718 } // end of void AliFlowAnalysisCRC::EvaluateDiffFlowNestedLoops(AliFlowEventSimple* anEvent)
1719 
1720 //=======================================================================================================================
1721 
1723 {
1724  // Calculate correction terms for non-uniform acceptance of the detector for reference flow (cos terms).
1725 
1726  // multiplicity:
1727  Double_t dMult = (*fSpk)(0,0);
1728 
1729  // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
1730  Double_t dReQ1n = (*fReQ)(0,0);
1731  Double_t dReQ2n = (*fReQ)(1,0);
1732  //Double_t dReQ3n = (*fReQ)(2,0);
1733  //Double_t dReQ4n = (*fReQ)(3,0);
1734  Double_t dImQ1n = (*fImQ)(0,0);
1735  Double_t dImQ2n = (*fImQ)(1,0);
1736  //Double_t dImQ3n = (*fImQ)(2,0);
1737  //Double_t dImQ4n = (*fImQ)(3,0);
1738 
1739  // Multiplicity bin of an event (relevant for all histos vs M):
1740  Double_t dMultiplicityBin = 0.;
1742  {
1743  dMultiplicityBin = fNumberOfRPsEBE+0.5;
1745  {
1746  dMultiplicityBin = fReferenceMultiplicityEBE+0.5;
1748  {
1749  dMultiplicityBin = fNumberOfPOIsEBE+0.5;
1750  }
1751 
1752  // *************************************************************
1753  // **** corrections for non-uniform acceptance (cos terms): ****
1754  // *************************************************************
1755  //
1756  // Remark 1: corrections for non-uniform acceptance (cos terms) calculated with non-weighted Q-vectors
1757  // are stored in 1D profile fQCorrectionsCos.
1758  // Remark 2: binning of fIntFlowCorrectionTermsForNUAPro[1] is organized as follows:
1759  // --------------------------------------------------------------------------------------------------------------------
1760  // 1st bin: <<cos(n*(phi1))>> = cosP1n
1761  // 2nd bin: <<cos(n*(phi1+phi2))>> = cosP1nP1n
1762  // 3rd bin: <<cos(n*(phi1-phi2-phi3))>> = cosP1nM1nM1n
1763  // 4th bin: <<cos(n*(2phi1-phi2))>> = cosP2nM1n
1764  // --------------------------------------------------------------------------------------------------------------------
1765 
1766  // 1-particle:
1767  Double_t cosP1n = 0.; // <<cos(n*(phi1))>>
1768 
1769  if(dMult>0)
1770  {
1771  cosP1n = dReQ1n/dMult;
1772 
1773  // average non-weighted 1-particle correction (cos terms) for non-uniform acceptance for single event:
1774  fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(1,cosP1n);
1775  // event weights for NUA terms:
1776  fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(1,dMult);
1777 
1778  // final average non-weighted 1-particle correction (cos terms) for non-uniform acceptance for all events:
1779  fIntFlowCorrectionTermsForNUAPro[1]->Fill(0.5,cosP1n,dMult);
1780  if(fCalculateCumulantsVsM){fIntFlowCorrectionTermsForNUAVsMPro[1][0]->Fill(dMultiplicityBin,cosP1n,dMult);}
1781  }
1782 
1783  // 2-particle:
1784  Double_t cosP1nP1n = 0.; // <<cos(n*(phi1+phi2))>>
1785  Double_t cosP2nM1n = 0.; // <<cos(n*(2phi1-phi2))>>
1786 
1787  if(dMult>1)
1788  {
1789  cosP1nP1n = (pow(dReQ1n,2)-pow(dImQ1n,2)-dReQ2n)/(dMult*(dMult-1));
1790  cosP2nM1n = (dReQ2n*dReQ1n+dImQ2n*dImQ1n-dReQ1n)/(dMult*(dMult-1));
1791 
1792  // average non-weighted 2-particle correction (cos terms) for non-uniform acceptance for single event:
1793  fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(2,cosP1nP1n);
1794  fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(4,cosP2nM1n);
1795  // event weights for NUA terms:
1796  fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(2,dMult*(dMult-1));
1797  fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(4,dMult*(dMult-1));
1798 
1799  // final average non-weighted 2-particle correction (cos terms) for non-uniform acceptance for all events:
1800  fIntFlowCorrectionTermsForNUAPro[1]->Fill(1.5,cosP1nP1n,dMult*(dMult-1));
1801  fIntFlowCorrectionTermsForNUAPro[1]->Fill(3.5,cosP2nM1n,dMult*(dMult-1));
1803  {
1804  fIntFlowCorrectionTermsForNUAVsMPro[1][1]->Fill(dMultiplicityBin,cosP1nP1n,dMult*(dMult-1));
1805  fIntFlowCorrectionTermsForNUAVsMPro[1][3]->Fill(dMultiplicityBin,cosP2nM1n,dMult*(dMult-1));
1806  }
1807  }
1808 
1809  // 3-particle:
1810  Double_t cosP1nM1nM1n = 0.; // <<cos(n*(phi1-phi2-phi3))>>
1811 
1812  if(dMult>2)
1813  {
1814  cosP1nM1nM1n = (dReQ1n*(pow(dReQ1n,2)+pow(dImQ1n,2))-dReQ1n*dReQ2n-dImQ1n*dImQ2n-2.*(dMult-1)*dReQ1n)
1815  / (dMult*(dMult-1)*(dMult-2));
1816 
1817  // average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for single event:
1818  fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(3,cosP1nM1nM1n);
1819  // event weights for NUA terms:
1820  fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(3,dMult*(dMult-1)*(dMult-2));
1821 
1822  // final average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for all events:
1823  fIntFlowCorrectionTermsForNUAPro[1]->Fill(2.5,cosP1nM1nM1n,dMult*(dMult-1)*(dMult-2));
1824  if(fCalculateCumulantsVsM){fIntFlowCorrectionTermsForNUAVsMPro[1][2]->Fill(dMultiplicityBin,cosP1nM1nM1n,dMult*(dMult-1)*(dMult-2));}
1825  }
1826 
1827 } // end of AliFlowAnalysisCRC::CalculateIntFlowCorrectionsForNUACosTerms()
1828 
1829 //=======================================================================================================================
1830 
1832 {
1833  // calculate corrections for non-uniform acceptance of the detector for no-name integrated flow (sin terms)
1834 
1835  // multiplicity:
1836  Double_t dMult = (*fSpk)(0,0);
1837 
1838  // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
1839  Double_t dReQ1n = (*fReQ)(0,0);
1840  Double_t dReQ2n = (*fReQ)(1,0);
1841  //Double_t dReQ3n = (*fReQ)(2,0);
1842  //Double_t dReQ4n = (*fReQ)(3,0);
1843  Double_t dImQ1n = (*fImQ)(0,0);
1844  Double_t dImQ2n = (*fImQ)(1,0);
1845  //Double_t dImQ3n = (*fImQ)(2,0);
1846  //Double_t dImQ4n = (*fImQ)(3,0);
1847 
1848  // Multiplicity bin of an event (relevant for all histos vs M):
1849  Double_t dMultiplicityBin = 0.;
1851  {
1852  dMultiplicityBin = fNumberOfRPsEBE+0.5;
1854  {
1855  dMultiplicityBin = fReferenceMultiplicityEBE+0.5;
1857  {
1858  dMultiplicityBin = fNumberOfPOIsEBE+0.5;
1859  }
1860 
1861  // *************************************************************
1862  // **** corrections for non-uniform acceptance (sin terms): ****
1863  // *************************************************************
1864  //
1865  // Remark 1: corrections for non-uniform acceptance (sin terms) calculated with non-weighted Q-vectors
1866  // are stored in 1D profile fQCorrectionsSin.
1867  // Remark 2: binning of fIntFlowCorrectionTermsForNUAPro[0] is organized as follows:
1868  // --------------------------------------------------------------------------------------------------------------------
1869  // 1st bin: <<sin(n*(phi1))>> = sinP1n
1870  // 2nd bin: <<sin(n*(phi1+phi2))>> = sinP1nP1n
1871  // 3rd bin: <<sin(n*(phi1-phi2-phi3))>> = sinP1nM1nM1n
1872  // 4th bin: <<sin(n*(2phi1-phi2))>> = sinP2nM1n
1873  // --------------------------------------------------------------------------------------------------------------------
1874 
1875  // 1-particle:
1876  Double_t sinP1n = 0.; // <sin(n*(phi1))>
1877 
1878  if(dMult>0)
1879  {
1880  sinP1n = dImQ1n/dMult;
1881 
1882  // average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for single event:
1883  fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(1,sinP1n);
1884  // event weights for NUA terms:
1885  fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(1,dMult);
1886 
1887  // final average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
1888  fIntFlowCorrectionTermsForNUAPro[0]->Fill(0.5,sinP1n,dMult);
1889  if(fCalculateCumulantsVsM){fIntFlowCorrectionTermsForNUAVsMPro[0][0]->Fill(dMultiplicityBin,sinP1n,dMult);}
1890  }
1891 
1892  // 2-particle:
1893  Double_t sinP1nP1n = 0.; // <<sin(n*(phi1+phi2))>>
1894  Double_t sinP2nM1n = 0.; // <<sin(n*(2phi1-phi2))>>
1895  if(dMult>1)
1896  {
1897  sinP1nP1n = (2.*dReQ1n*dImQ1n-dImQ2n)/(dMult*(dMult-1));
1898  sinP2nM1n = (dImQ2n*dReQ1n-dReQ2n*dImQ1n-dImQ1n)/(dMult*(dMult-1));
1899 
1900  // average non-weighted 2-particle correction (sin terms) for non-uniform acceptance for single event:
1901  fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(2,sinP1nP1n);
1902  fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(4,sinP2nM1n);
1903  // event weights for NUA terms:
1904  fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(2,dMult*(dMult-1));
1905  fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(4,dMult*(dMult-1));
1906 
1907  // final average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
1908  fIntFlowCorrectionTermsForNUAPro[0]->Fill(1.5,sinP1nP1n,dMult*(dMult-1));
1909  fIntFlowCorrectionTermsForNUAPro[0]->Fill(3.5,sinP2nM1n,dMult*(dMult-1));
1911  {
1912  fIntFlowCorrectionTermsForNUAVsMPro[0][1]->Fill(dMultiplicityBin,sinP1nP1n,dMult*(dMult-1));
1913  fIntFlowCorrectionTermsForNUAVsMPro[0][3]->Fill(dMultiplicityBin,sinP2nM1n,dMult*(dMult-1));
1914  }
1915  }
1916 
1917  // 3-particle:
1918  Double_t sinP1nM1nM1n = 0.; // <<sin(n*(phi1-phi2-phi3))>>
1919 
1920  if(dMult>2)
1921  {
1922  sinP1nM1nM1n = (-dImQ1n*(pow(dReQ1n,2)+pow(dImQ1n,2))+dReQ1n*dImQ2n-dImQ1n*dReQ2n+2.*(dMult-1)*dImQ1n)
1923  / (dMult*(dMult-1)*(dMult-2));
1924 
1925  // average non-weighted 3-particle correction (sin terms) for non-uniform acceptance for single event:
1926  fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(3,sinP1nM1nM1n);
1927  // event weights for NUA terms:
1928  fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(3,dMult*(dMult-1)*(dMult-2));
1929 
1930  // final average non-weighted 3-particle correction (sin terms) for non-uniform acceptance for all events:
1931  fIntFlowCorrectionTermsForNUAPro[0]->Fill(2.5,sinP1nM1nM1n,dMult*(dMult-1)*(dMult-2));
1932  if(fCalculateCumulantsVsM){fIntFlowCorrectionTermsForNUAVsMPro[0][2]->Fill(dMultiplicityBin,sinP1nM1nM1n,dMult*(dMult-1)*(dMult-2));}
1933  }
1934 
1935 } // end of AliFlowAnalysisCRC::CalculateIntFlowCorrectionsForNUASinTerms()
1936 
1937 //=======================================================================================================================
1938 
1940 {
1941  // a) Get pointers for common control and common result histograms;
1942  // b) Get pointers for histograms holding particle weights;
1943  // c) Get pointers for reference flow histograms;
1944  // d) Get pointers for differential flow histograms;
1945  // e) Get pointers for 2D differential flow histograms;
1946  // f) Get pointers for other differential correlators;
1947  // g) Get pointers for mixed harmonics histograms;
1948  // h) Get pointers for nested loops' histograms;
1949  // i) Get pointers for control histograms;
1950  // j) Get pointers for bootstrap.
1951  // k) Get pointers for CRC histograms;
1952 
1953  if(outputListHistos)
1954  {
1955  this->SetHistList(outputListHistos);
1956  if(!fHistList)
1957  {
1958  printf("\n WARNING (QC): fHistList is NULL in AFAWQC::GOH() !!!!\n\n");
1959  exit(0);
1960  }
1970  this->GetPointersForBootstrap();
1971  this->GetPointersForCRC();
1972  this->GetPointersForCRCVZ();
1973  this->GetPointersForCRCZDC();
1974  this->GetPointersForCRCPt();
1975  this->GetPointersForCRC2();
1976  this->GetPointersForQVec();
1977  this->GetPointersForCME();
1978  this->GetPointersForFlowQC();
1980  this->GetPointersForFlowSPZDC();
1981  this->GetPointersForFlowSPVZ();
1982  this->GetPointersForEbEFlow();
1983  this->GetPointersForVarious();
1984  } else
1985  {
1986  printf("\n WARNING (QC): outputListHistos is NULL in AFAWQC::GOH() !!!!\n\n");
1987  exit(0);
1988  }
1989 
1990 } // end of void AliFlowAnalysisCRC::GetOutputHistograms(TList *outputListHistos)
1991 
1992 //=======================================================================================================================
1993 
1994 TProfile* AliFlowAnalysisCRC::MakePtProjection(TProfile2D *profilePtEta) const
1995 {
1996  // project 2D profile onto pt axis to get 1D profile
1997 
1998  Int_t nBinsPt = profilePtEta->GetNbinsX();
1999  Double_t dPtMin = (profilePtEta->GetXaxis())->GetXmin();
2000  Double_t dPtMax = (profilePtEta->GetXaxis())->GetXmax();
2001 
2002  Int_t nBinsEta = profilePtEta->GetNbinsY();
2003 
2004  TProfile *profilePt = new TProfile("","",nBinsPt,dPtMin,dPtMax);
2005 
2006  for(Int_t p=1;p<=nBinsPt;p++)
2007  {
2008  Double_t contentPt = 0.;
2009  Double_t entryPt = 0.;
2010  Double_t spreadPt = 0.;
2011  Double_t sum1 = 0.;
2012  Double_t sum2 = 0.;
2013  Double_t sum3 = 0.;
2014  for(Int_t e=1;e<=nBinsEta;e++)
2015  {
2016  contentPt += (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)))
2017  * (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
2018  entryPt += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
2019 
2020  sum1 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)))
2021  * (pow(profilePtEta->GetBinError(profilePtEta->GetBin(p,e)),2.)
2022  + pow(profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)),2.));
2023  sum2 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
2024  sum3 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)))
2025  * (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)));
2026  }
2027  if(sum2>0. && sum1/sum2-pow(sum3/sum2,2.) > 0.)
2028  {
2029  spreadPt = pow(sum1/sum2-pow(sum3/sum2,2.),0.5);
2030  }
2031  profilePt->SetBinContent(p,contentPt);
2032  profilePt->SetBinEntries(p,entryPt);
2033  {
2034  profilePt->SetBinError(p,spreadPt);
2035  }
2036 
2037  }
2038 
2039  return profilePt;
2040 
2041 } // end of TProfile* AliFlowAnalysisCRC::MakePtProjection(TProfile2D *profilePtEta)
2042 
2043 
2044 //=======================================================================================================================
2045 
2046 
2047 TProfile* AliFlowAnalysisCRC::MakeEtaProjection(TProfile2D *profilePtEta) const
2048 {
2049  // project 2D profile onto eta axis to get 1D profile
2050 
2051  Int_t nBinsEta = profilePtEta->GetNbinsY();
2052  Double_t dEtaMin = (profilePtEta->GetYaxis())->GetXmin();
2053  Double_t dEtaMax = (profilePtEta->GetYaxis())->GetXmax();
2054 
2055  Int_t nBinsPt = profilePtEta->GetNbinsX();
2056 
2057  TProfile *profileEta = new TProfile("","",nBinsEta,dEtaMin,dEtaMax);
2058 
2059  for(Int_t e=1;e<=nBinsEta;e++)
2060  {
2061  Double_t contentEta = 0.;
2062  Double_t entryEta = 0.;
2063  for(Int_t p=1;p<=nBinsPt;p++)
2064  {
2065  contentEta += (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)))
2066  * (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
2067  entryEta += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
2068  }
2069  profileEta->SetBinContent(e,contentEta);
2070  profileEta->SetBinEntries(e,entryEta);
2071  }
2072 
2073  return profileEta;
2074 
2075 } // end of TProfile* AliFlowAnalysisCRC::MakeEtaProjection(TProfile2D *profilePtEta)
2076 
2077 //=======================================================================================================================
2078 
2080 {
2081  // Printing on the screen the final results for integrated flow (RF, POI and RP).
2082 
2083  Int_t n = fHarmonic;
2084 
2085  Double_t dVn[4] = {0.}; // array to hold Vn{2}, Vn{4}, Vn{6} and Vn{8}
2086  Double_t dVnErr[4] = {0.}; // array to hold errors of Vn{2}, Vn{4}, Vn{6} and Vn{8}
2087 
2088  if(type == "RF")
2089  {
2090  for(Int_t b=0;b<4;b++)
2091  {
2092  dVn[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinContent(1);
2093  dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinError(1);
2094  dVn[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinContent(1);
2095  dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinError(1);
2096  dVn[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinContent(1);
2097  dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinError(1);
2098  dVn[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinContent(1);
2099  dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinError(1);
2100  }
2101  } else if(type == "RP")
2102  {
2103  dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinContent(1);
2104  dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinError(1);
2105  dVn[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinContent(1);
2106  dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinError(1);
2107  dVn[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinContent(1);
2108  dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinError(1);
2109  dVn[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinContent(1);
2110  dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinError(1);
2111  } else if(type == "POI")
2112  {
2113  dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinContent(1);
2114  dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinError(1);
2115  dVn[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinContent(1);
2116  dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinError(1);
2117  dVn[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinContent(1);
2118  dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinError(1);
2119  dVn[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinContent(1);
2120  dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinError(1);
2121  } else if(type == "RF, rebinned in M" && fCalculateCumulantsVsM)
2122  {
2123  for(Int_t b=0;b<4;b++)
2124  {
2125  dVn[b] = fIntFlowRebinnedInM->GetBinContent(b+1);
2126  dVnErr[b] = fIntFlowRebinnedInM->GetBinError(b+1);
2127  }
2128  }
2129 
2130  TString title = " flow estimates from Q-cumulants";
2131  TString subtitle = " (";
2132  TString subtitle2 = " (rebinned in M)";
2133 
2134  if(type != "RF, rebinned in M")
2135  {
2137  {
2138  subtitle.Append(type);
2139  subtitle.Append(", without weights)");
2140  } else
2141  {
2142  subtitle.Append(type);
2143  subtitle.Append(", with weights)");
2144  }
2145  } else
2146  {
2148  {
2149  subtitle.Append("RF");
2150  subtitle.Append(", without weights)");
2151  } else
2152  {
2153  subtitle.Append("RF");
2154  subtitle.Append(", with weights)");
2155  }
2156  }
2157 
2158  cout<<endl;
2159  cout<<"*************************************"<<endl;
2160  cout<<"*************************************"<<endl;
2161  cout<<title.Data()<<endl;
2162  cout<<subtitle.Data()<<endl;
2163  if(type == "RF, rebinned in M"){cout<<subtitle2.Data()<<endl;}
2164  cout<<endl;
2165 
2166  for(Int_t i=0;i<4;i++)
2167  {
2168  cout<<" v_"<<n<<"{"<<2*(i+1)<<"} = "<<dVn[i]<<" +/- "<<dVnErr[i]<<endl;
2169  }
2170 
2171  cout<<endl;
2172  if(type == "RF")
2173  {
2175  {
2176  cout<<" detector bias (corrected for): "<<endl;
2177  } else
2178  {
2179  cout<<" detector bias (not corrected for):"<<endl;
2180  }
2181  cout<<" to QC{2}: "<<fIntFlowDetectorBias->GetBinContent(1)<<" +/- "<<fIntFlowDetectorBias->GetBinError(1)<<endl;
2182  cout<<" to QC{4}: "<<fIntFlowDetectorBias->GetBinContent(2)<<" +/- "<<fIntFlowDetectorBias->GetBinError(2)<<endl;
2183  cout<<endl;
2184  }
2185  if(type == "RF" || type == "RF, rebinned in M")
2186  {
2187  cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultRP()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultRP()->GetMean()<<endl;
2188  }
2189  else if (type == "RP")
2190  {
2191  cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultRP()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultRP()->GetMean()<<endl;
2192  }
2193  else if (type == "POI")
2194  {
2195  cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultPOI()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultPOI()->GetMean()<<endl;
2196  }
2197 
2198  cout<<"*************************************"<<endl;
2199  cout<<"*************************************"<<endl;
2200  cout<<endl;
2201 
2202 }// end of AliFlowAnalysisCRC::PrintFinalResultsForIntegratedFlow(TString type="RF");
2203 
2204 //=======================================================================================================================
2205 
2207 {
2208  //store the final results in output .root file
2209  TFile *output = new TFile(outputFileName.Data(),"RECREATE");
2210  //output->WriteObject(fHistList, "cobjQC","SingleKey");
2211  fHistList->Write(fHistList->GetName(), TObject::kSingleKey);
2212  delete output;
2213 }
2214 
2215 
2216 //=======================================================================================================================
2217 
2218 
2219 void AliFlowAnalysisCRC::WriteHistograms(TDirectoryFile *outputFileName)
2220 {
2221  //store the final results in output .root file
2222  fHistList->SetName("cobjQC");
2223  fHistList->SetOwner(kTRUE);
2224  outputFileName->Add(fHistList);
2225  outputFileName->Write(outputFileName->GetName(), TObject::kSingleKey);
2226 }
2227 
2228 //=======================================================================================================================
2229 
2231 {
2232  // Book common control histograms and common histograms for final results.
2233  // a) Book common control histograms;
2234  // b) Book common result histograms.
2235 
2236  // a) Book common control histograms:
2237  // Common control histograms (all events):
2238  TString commonHistsName = "AliFlowCommonHistQC";
2239  commonHistsName += fAnalysisLabel->Data();
2240  fCommonHists = new AliFlowCommonHist(commonHistsName.Data(),commonHistsName.Data(),fBookOnlyBasicCCH);
2241  fHistList->Add(fCommonHists);
2242  // Common control histograms (selected events):
2244  {
2245  // Common control histogram filled for events with 2 and more reference particles:
2246  TString commonHists2ndOrderName = "AliFlowCommonHist2ndOrderQC";
2247  commonHists2ndOrderName += fAnalysisLabel->Data();
2248  fCommonHists2nd = new AliFlowCommonHist(commonHists2ndOrderName.Data(),commonHists2ndOrderName.Data(),fBookOnlyBasicCCH);
2249  fHistList->Add(fCommonHists2nd);
2250  // Common control histogram filled for events with 2 and more reference particles:
2251  TString commonHists4thOrderName = "AliFlowCommonHist4thOrderQC";
2252  commonHists4thOrderName += fAnalysisLabel->Data();
2253  fCommonHists4th = new AliFlowCommonHist(commonHists4thOrderName.Data(),commonHists4thOrderName.Data(),fBookOnlyBasicCCH);
2254  fHistList->Add(fCommonHists4th);
2255  // Common control histogram filled for events with 6 and more reference particles:
2256  TString commonHists6thOrderName = "AliFlowCommonHist6thOrderQC";
2257  commonHists6thOrderName += fAnalysisLabel->Data();
2258  fCommonHists6th = new AliFlowCommonHist(commonHists6thOrderName.Data(),commonHists6thOrderName.Data(),fBookOnlyBasicCCH);
2259  fHistList->Add(fCommonHists6th);
2260  // Common control histogram filled for events with 8 and more reference particles:
2261  TString commonHists8thOrderName = "AliFlowCommonHist8thOrderQC";
2262  commonHists8thOrderName += fAnalysisLabel->Data();
2263  fCommonHists8th = new AliFlowCommonHist(commonHists8thOrderName.Data(),commonHists8thOrderName.Data(),fBookOnlyBasicCCH);
2264  fHistList->Add(fCommonHists8th);
2265  } // end of if(fFillMultipleControlHistograms)
2266 
2267  // b) Book common result histograms:
2268  // Common result histograms for QC{2}:
2269  TString commonHistResults2ndOrderName = "AliFlowCommonHistResults2ndOrderQC";
2270  commonHistResults2ndOrderName += fAnalysisLabel->Data();
2271  fCommonHistsResults2nd = new AliFlowCommonHistResults(commonHistResults2ndOrderName.Data(),"",fHarmonic);
2273  // Common result histograms for QC{4}:
2274  TString commonHistResults4thOrderName = "AliFlowCommonHistResults4thOrderQC";
2275  commonHistResults4thOrderName += fAnalysisLabel->Data();
2276  fCommonHistsResults4th = new AliFlowCommonHistResults(commonHistResults4thOrderName.Data(),"",fHarmonic);
2278  // Common result histograms for QC{6}:
2279  TString commonHistResults6thOrderName = "AliFlowCommonHistResults6thOrderQC";
2280  commonHistResults6thOrderName += fAnalysisLabel->Data();
2281  fCommonHistsResults6th = new AliFlowCommonHistResults(commonHistResults6thOrderName.Data(),"",fHarmonic);
2283  // Common result histograms for QC{8}:
2284  TString commonHistResults8thOrderName = "AliFlowCommonHistResults8thOrderQC";
2285  commonHistResults8thOrderName += fAnalysisLabel->Data();
2286  fCommonHistsResults8th = new AliFlowCommonHistResults(commonHistResults8thOrderName.Data(),"",fHarmonic);
2288 
2289 } // end of void AliFlowAnalysisCRC::BookCommonHistograms()
2290 
2291 //=======================================================================================================================
2292 
2294 {
2295  // Book and fill histograms which hold phi, pt and eta weights.
2296 
2297  if(!fWeightsList)
2298  {
2299  printf("\n WARNING (QC): fWeightsList is NULL in AFAWQC::BAFWH() !!!! \n\n");
2300  exit(0);
2301  }
2302 
2303  TString fUseParticleWeightsName = "fUseParticleWeightsQC";
2304  fUseParticleWeightsName += fAnalysisLabel->Data();
2305  fUseParticleWeights = new TProfile(fUseParticleWeightsName.Data(),"0 = particle weight not used, 1 = particle weight used ",8,0,8);
2306  fUseParticleWeights->SetLabelSize(0.06);
2307  fUseParticleWeights->SetStats(kFALSE);
2308  (fUseParticleWeights->GetXaxis())->SetBinLabel(1,"w_{#phi}");
2309  (fUseParticleWeights->GetXaxis())->SetBinLabel(2,"w_{p_{T}}");
2310  (fUseParticleWeights->GetXaxis())->SetBinLabel(3,"w_{#eta}");
2311  (fUseParticleWeights->GetXaxis())->SetBinLabel(4,"w_{track}");
2312  (fUseParticleWeights->GetXaxis())->SetBinLabel(5,"w_{#phi,#eta}");
2313  (fUseParticleWeights->GetXaxis())->SetBinLabel(6,"w_{#phi,#eta} ch_dep");
2314  (fUseParticleWeights->GetXaxis())->SetBinLabel(7,"w_{#phi,#eta} vtx_dep");
2315  (fUseParticleWeights->GetXaxis())->SetBinLabel(8,"w_{#phi,#eta} ch_pT_dep");
2325 
2326  // // POIs
2327  // for(Int_t c=0; c<2; c++)
2328  // {
2329  // fPhiWeightsPOIs[c] = new TH1F(Form("fPhiWeightsPOIs[%d][%d]",c,h),Form("fPhiWeightsPOIs[%d][%d]",c,h),fnBinsPhi,fPhiMin,fPhiMax);
2330  // fPhiWeightsPOIs[c]->Sumw2();
2331  // fEtaWeightsPOIs[c] = new TH1D(Form("fEtaWeightsPOIs[%d][%d]",c,h),Form("fEtaWeightsPOIs[%d][%d]",c,h),fnBinsEta,fEtaMin,fEtaMax);
2332  // fEtaWeightsPOIs[c]->Sumw2();
2333  // fPhiEtaWeightsPOIs[c] = new TH2D(Form("fPhiEtaWeightsPOIs[%d][%d]",c,h),Form("fPhiEtaWeightsPOIs[%d][%d]",c,h),fnBinsPhi,fPhiMin,fPhiMax,fnBinsEta,fEtaMin,fEtaMax);
2334  // fPhiEtaWeightsPOIs[c]->Sumw2();
2335  //
2336  // if(fUsePhiWeights)
2337  // {
2338  // if(fWeightsList->FindObject(Form("fPhiHist[%d][%d]",c,h)))
2339  // {
2340  // fPhiDistrRefPOIs[c] = dynamic_cast<TH1F*>(fWeightsList->FindObject(Form("fPhiHist[%d][%d]",c,h)));
2341  // if(!fPhiDistrRefPOIs[c])
2342  // {
2343  // printf("\n WARNING (QC): fPhiDistrRefPOIs is NULL in AFAWQC::BAFWH() !!!!\n\n");
2344  // exit(0);
2345  // }
2346  // if(TMath::Abs(fPhiDistrRefPOIs[c]->GetBinWidth(1)-fPhiBinWidth)>pow(10.,-6.))
2347  // {
2348  // cout<<endl;
2349  // cout<<"WARNING (QC): Inconsistent binning in histograms for phi-weights throughout the code."<<endl;
2350  // cout<<endl;
2351  // //exit(0);
2352  // }
2353  // } else
2354  // {
2355  // cout<<"WARNING: fWeightsList->FindObject(\"fPhiHist\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
2356  // exit(0);
2357  // }
2358  // } // end of if(fUsePhiWeights)
2359  //
2360  // if(fUsePtWeights)
2361  // {
2362  // if(fWeightsList->FindObject(Form("fPtHist[%d][%d]",c,h)))
2363  // {
2364  // fPtDistrRefPOIs[c] = dynamic_cast<TH1D*>(fWeightsList->FindObject(Form("fPtHist[%d][%d]",c,h)));
2365  // if(!fPtDistrRefPOIs[c])
2366  // {
2367  // printf("\n WARNING (QC): fPtDistrRefPOIs is NULL in AFAWQC::BAFWH() !!!!\n\n");
2368  // exit(0);
2369  // }
2370  // if(TMath::Abs(fPtDistrRefPOIs[c]->GetBinWidth(1)-fPtBinWidth)>pow(10.,-6.))
2371  // {
2372  // cout<<endl;
2373  // cout<<"WARNING (QC): Inconsistent binning in histograms for pt-weights throughout the code."<<endl;
2374  // cout<<endl;
2375  // //exit(0);
2376  // }
2377  // } else
2378  // {
2379  // cout<<"WARNING: fWeightsList->FindObject(\"fPtHist\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
2380  // exit(0);
2381  // }
2382  // } // end of if(fUsePtWeights)
2383  //
2384  // if(fUseEtaWeights)
2385  // {
2386  // if(fWeightsList->FindObject(Form("fEtaHist[%d][%d]",c,h)))
2387  // {
2388  // fEtaDistrRefPOIs[c] = dynamic_cast<TH1D*>(fWeightsList->FindObject(Form("fEtaHist[%d][%d]",c,h)));
2389  // if(!fEtaDistrRefPOIs[c])
2390  // {
2391  // printf("\n WARNING (QC): fEtaDistrRefPOIs is NULL in AFAWQC::BAFWH() !!!!\n\n");
2392  // exit(0);
2393  // }
2394  // if(TMath::Abs(fEtaDistrRefPOIs[c]->GetBinWidth(1)-fEtaBinWidth)>pow(10.,-6.))
2395  // {
2396  // cout<<endl;
2397  // cout<<"WARNING (QC): Inconsistent binning in histograms for eta-weights throughout the code."<<endl;
2398  // cout<<endl;
2399  // //exit(0);
2400  // }
2401  // } else
2402  // {
2403  // cout<<"WARNING: fWeightsList->FindObject(\"fEtaHist\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
2404  // exit(0);
2405  // }
2406  // } // end of if(fUseEtaWeights)
2407  //
2408  //
2409  // } // end of for(Int_t c=0; c<2; c++)
2410 
2411  //**********************************************************************************************************
2412 
2413  // RPs
2414 
2415  // fPhiWeightsRPs = new TH1F("fPhiWeightsRPs","fPhiWeightsRPs",fnBinsPhi,fPhiMin,fPhiMax);
2416  // fEtaWeightsRPs = new TH1D("fEtaWeightsRPs","fEtaWeightsRPs",fnBinsEta,fEtaMin,fEtaMax);
2417  //
2418  // if(fUsePhiWeights)
2419  // {
2420  // if(fWeightsList->FindObject("fPhiDistrRPs"))
2421  // {
2422  // fPhiDistrRefRPs = dynamic_cast<TH1F*>(fWeightsList->FindObject("fPhiDistrRPs"));
2423  // if(!fPhiDistrRefRPs)
2424  // {
2425  // printf("\n WARNING (QC): fPhiDistrRefRPs is NULL in AFAWQC::BAFWH() !!!!\n\n");
2426  // exit(0);
2427  // }
2428  // if(TMath::Abs(fPhiDistrRefRPs->GetBinWidth(1)-fPhiBinWidth)>pow(10.,-6.))
2429  // {
2430  // cout<<endl;
2431  // cout<<"WARNING (QC): Inconsistent binning in histograms for phi-weights throughout the code."<<endl;
2432  // cout<<endl;
2433  // //exit(0);
2434  // }
2435  // } else
2436  // {
2437  // cout<<"WARNING: fWeightsList->FindObject(\"fPhiDistrRPs\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
2438  // exit(0);
2439  // }
2440  // } // end of if(fUsePhiWeights)
2441  //
2442  // if(fUsePtWeights)
2443  // {
2444  // if(fWeightsList->FindObject("fPtDistrRPs"))
2445  // {
2446  // fPtDistrRefRPs = dynamic_cast<TH1D*>(fWeightsList->FindObject("fPtDistrRPs"));
2447  // if(!fPtDistrRefRPs)
2448  // {
2449  // printf("\n WARNING (QC): fPtDistrRefRPs is NULL in AFAWQC::BAFWH() !!!!\n\n");
2450  // exit(0);
2451  // }
2452  // if(TMath::Abs(fPtDistrRefRPs->GetBinWidth(1)-fPtBinWidth)>pow(10.,-6.))
2453  // {
2454  // cout<<endl;
2455  // cout<<"WARNING (QC): Inconsistent binning in histograms for phi-weights throughout the code."<<endl;
2456  // cout<<endl;
2457  // //exit(0);
2458  // }
2459  // } else
2460  // {
2461  // cout<<"WARNING: fWeightsList->FindObject(\"fPtDistrRPs\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
2462  // exit(0);
2463  // }
2464  // } // end of if(fUsePtWeights)
2465  //
2466  // if(fUseEtaWeights)
2467  // {
2468  // if(fWeightsList->FindObject("fEtaDistrRPs"))
2469  // {
2470  // fEtaDistrRefRPs = dynamic_cast<TH1D*>(fWeightsList->FindObject("fEtaDistrRPs"));
2471  // if(!fEtaDistrRefRPs)
2472  // {
2473  // printf("\n WARNING (QC): fEtaDistrRefRPs is NULL in AFAWQC::BAFWH() !!!!\n\n");
2474  // exit(0);
2475  // }
2476  // if(TMath::Abs(fEtaDistrRefRPs->GetBinWidth(1)-fEtaBinWidth)>pow(10.,-6.))
2477  // {
2478  // cout<<endl;
2479  // cout<<"WARNING (QC): Inconsistent binning in histograms for eta-weights throughout the code."<<endl;
2480  // cout<<endl;
2481  // //exit(0);
2482  // }
2483  // } else
2484  // {
2485  // cout<<"WARNING: fWeightsList->FindObject(\"fEtaDistrRPs\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
2486  // exit(0);
2487  // }
2488  // } // end of if(fUseEtaWeights)
2489  //
2490 
2491 } // end of AliFlowAnalysisCRC::BookAndFillWeightsHistograms()
2492 
2493 //=======================================================================================================================
2494 
2496 {
2497  if(!fCenWeightsHist) return;
2498  fCenWeigCalHist = (TH1D*)(fCenWeightsHist->Clone("fCenWeigCalHist"));
2499  TF1 *CenFit = new TF1("CenFit","pol0", 0., 100.);
2501  fCenWeigCalHist->Fit("CenFit","QNR","",0.,50.);
2502  Double_t CenAv = CenFit->GetParameter(0);
2503  for(Int_t b=1; b<=fCenWeigCalHist->GetNbinsX(); b++) {
2504  Double_t newbin = fCenWeigCalHist->GetBinContent(b);
2505  if(newbin) {
2506  fCenWeigCalHist->SetBinContent(b,CenAv/newbin);
2507  } else {
2508  fCenWeigCalHist->SetBinContent(b,1.);
2509  }
2510  }
2511  }
2512  else {
2513  fCenWeigCalHist->Fit("CenFit","QNR","",0.,8.);
2514  Double_t CenAv = CenFit->GetParameter(0);
2515  fCenWeigCalHist->Fit("CenFit","QNR","",12.,50.);
2516  Double_t SemiCenAv = CenFit->GetParameter(0);
2517  for(Int_t b=1; b<=fCenWeigCalHist->GetNbinsX(); b++) {
2518  Double_t newbin = fCenWeigCalHist->GetBinContent(b);
2519  if(newbin) {
2520  if(b<=10) fCenWeigCalHist->SetBinContent(b,CenAv/newbin);
2521  if(b>10 && b<=50) fCenWeigCalHist->SetBinContent(b,SemiCenAv/newbin);
2522  if(b>50) fCenWeigCalHist->SetBinContent(b,1.);
2523  } else {
2524  fCenWeigCalHist->SetBinContent(b,1.);
2525  }
2526  }
2527  }
2528  fCenWeigCalHist->SetName("CenWeights");
2530 } // end of AliFlowAnalysisCRC::SetCentralityWeights()
2531 
2532 //=======================================================================================================================
2533 
2535 {
2536  // Book all objects for integrated flow:
2537  // a) Book profile to hold all flags for integrated flow;
2538  // b) Book event-by-event quantities;
2539  // c) Book profiles; // to be improved (comment)
2540  // d) Book histograms holding the final results.
2541 
2542  TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)
2543  TString powerFlag[2] = {"linear","quadratic"}; // to be improved (should I promote this to data members?)
2544 
2545  // a) Book profile to hold all flags for integrated flow:
2546  TString intFlowFlagsName = "fIntFlowFlags";
2547  intFlowFlagsName += fAnalysisLabel->Data();
2548  fIntFlowFlags = new TProfile(intFlowFlagsName.Data(),"Flags for Integrated Flow",20,0.,20.);
2549  fIntFlowFlags->SetTickLength(-0.01,"Y");
2550  fIntFlowFlags->SetMarkerStyle(25);
2551  fIntFlowFlags->SetLabelSize(0.04);
2552  fIntFlowFlags->SetLabelOffset(0.02,"Y");
2553  fIntFlowFlags->SetStats(kFALSE);
2554  fIntFlowFlags->GetXaxis()->SetBinLabel(1,"Particle Weights");
2555  fIntFlowFlags->GetXaxis()->SetBinLabel(2,"Event Weights");
2556  fIntFlowFlags->GetXaxis()->SetBinLabel(3,"Corrected for NUA?");
2557  fIntFlowFlags->GetXaxis()->SetBinLabel(4,"Print RF results");
2558  fIntFlowFlags->GetXaxis()->SetBinLabel(5,"Print RP results");
2559  fIntFlowFlags->GetXaxis()->SetBinLabel(6,"Print POI results");
2560  fIntFlowFlags->GetXaxis()->SetBinLabel(7,"Print RF (rebinned in M) results");
2561  fIntFlowFlags->GetXaxis()->SetBinLabel(8,"Corrected for NUA vs M?");
2562  fIntFlowFlags->GetXaxis()->SetBinLabel(9,"Propagate errors to v_{n} from correlations?");
2563  fIntFlowFlags->GetXaxis()->SetBinLabel(10,"Calculate cumulants vs M");
2564  fIntFlowFlags->GetXaxis()->SetBinLabel(11,"fMinimumBiasReferenceFlow");
2565  fIntFlowFlags->GetXaxis()->SetBinLabel(12,"fForgetAboutCovariances");
2566  fIntFlowFlags->GetXaxis()->SetBinLabel(13,"fStoreVarious");
2567  fIntFlowFlags->GetXaxis()->SetBinLabel(14,"fFillMultipleControlHistograms");
2568  fIntFlowFlags->GetXaxis()->SetBinLabel(15,"Calculate all correlations vs M");
2569  fIntFlowFlags->GetXaxis()->SetBinLabel(16,"fMultiplicityIs");
2570  fIntFlowFlags->GetXaxis()->SetBinLabel(17,"fExactNoRPs");
2571  fIntFlowFlags->GetXaxis()->SetBinLabel(18,"fUse2DHistograms");
2572  fIntFlowFlags->GetXaxis()->SetBinLabel(19,"fFillProfilesVsMUsingWeights");
2573  fIntFlowFlags->GetXaxis()->SetBinLabel(20,"fUseQvectorTerms");
2575 
2576  // b) Book event-by-event quantities:
2577  // Re[Q_{m*n,k}], Im[Q_{m*n,k}] and S_{p,k}^M:
2578  fReQ = new TMatrixD(12,9);
2579  fImQ = new TMatrixD(12,9);
2580  fSpk = new TMatrixD(8,9);
2581  // average correlations <2>, <4>, <6> and <8> for single event (bining is the same as in fIntFlowCorrelationsPro and fIntFlowCorrelationsHist):
2582  TString intFlowCorrelationsEBEName = "fIntFlowCorrelationsEBE";
2583  intFlowCorrelationsEBEName += fAnalysisLabel->Data();
2584  fIntFlowCorrelationsEBE = new TH1D(intFlowCorrelationsEBEName.Data(),intFlowCorrelationsEBEName.Data(),4,0,4);
2585  // weights for average correlations <2>, <4>, <6> and <8> for single event:
2586  TString intFlowEventWeightsForCorrelationsEBEName = "fIntFlowEventWeightsForCorrelationsEBE";
2587  intFlowEventWeightsForCorrelationsEBEName += fAnalysisLabel->Data();
2588  fIntFlowEventWeightsForCorrelationsEBE = new TH1D(intFlowEventWeightsForCorrelationsEBEName.Data(),intFlowEventWeightsForCorrelationsEBEName.Data(),4,0,4);
2589  // average all correlations for single event (bining is the same as in fIntFlowCorrelationsAllPro and fIntFlowCorrelationsAllHist):
2590  TString intFlowCorrelationsAllEBEName = "fIntFlowCorrelationsAllEBE";
2591  intFlowCorrelationsAllEBEName += fAnalysisLabel->Data();
2592  fIntFlowCorrelationsAllEBE = new TH1D(intFlowCorrelationsAllEBEName.Data(),intFlowCorrelationsAllEBEName.Data(),64,0,64);
2593  // average correction terms for non-uniform acceptance for single event
2594  // (binning is the same as in fIntFlowCorrectionTermsForNUAPro[2] and fIntFlowCorrectionTermsForNUAHist[2]):
2595  TString fIntFlowCorrectionTermsForNUAEBEName = "fIntFlowCorrectionTermsForNUAEBE";
2596  fIntFlowCorrectionTermsForNUAEBEName += fAnalysisLabel->Data();
2597  for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2598  {
2599  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);
2600  }
2601  // event weights for terms for non-uniform acceptance:
2602  TString fIntFlowEventWeightForCorrectionTermsForNUAEBEName = "fIntFlowEventWeightForCorrectionTermsForNUAEBE";
2603  fIntFlowEventWeightForCorrectionTermsForNUAEBEName += fAnalysisLabel->Data();
2604  for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2605  {
2606  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
2607  }
2608  // c) Book profiles: // to be improved (comment)
2609  // profile to hold average multiplicities and number of events for events with nRP>=0, nRP>=1, ... , and nRP>=8:
2610  TString avMultiplicityName = "fAvMultiplicity";
2611  avMultiplicityName += fAnalysisLabel->Data();
2612  fAvMultiplicity = new TProfile(avMultiplicityName.Data(),"Average multiplicities of reference particles (RPs)",9,0,9);
2613  fAvMultiplicity->SetTickLength(-0.01,"Y");
2614  fAvMultiplicity->SetMarkerStyle(25);
2615  fAvMultiplicity->SetLabelSize(0.05);
2616  fAvMultiplicity->SetLabelOffset(0.02,"Y");
2617  fAvMultiplicity->SetYTitle("Average multiplicity");
2618  (fAvMultiplicity->GetXaxis())->SetBinLabel(1,"all evts");
2619  (fAvMultiplicity->GetXaxis())->SetBinLabel(2,"n_{RP} #geq 1");
2620  (fAvMultiplicity->GetXaxis())->SetBinLabel(3,"n_{RP} #geq 2");
2621  (fAvMultiplicity->GetXaxis())->SetBinLabel(4,"n_{RP} #geq 3");
2622  (fAvMultiplicity->GetXaxis())->SetBinLabel(5,"n_{RP} #geq 4");
2623  (fAvMultiplicity->GetXaxis())->SetBinLabel(6,"n_{RP} #geq 5");
2624  (fAvMultiplicity->GetXaxis())->SetBinLabel(7,"n_{RP} #geq 6");
2625  (fAvMultiplicity->GetXaxis())->SetBinLabel(8,"n_{RP} #geq 7");
2626  (fAvMultiplicity->GetXaxis())->SetBinLabel(9,"n_{RP} #geq 8");
2628  // Average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with wrong errors!):
2629  TString correlationFlag[4] = {"#LT#LT2#GT#GT","#LT#LT4#GT#GT","#LT#LT6#GT#GT","#LT#LT8#GT#GT"};
2630  TString intFlowCorrelationsProName = "fIntFlowCorrelationsPro";
2631  intFlowCorrelationsProName += fAnalysisLabel->Data();
2632  fIntFlowCorrelationsPro = new TProfile(intFlowCorrelationsProName.Data(),"Average correlations for all events",4,0,4,"s");
2633  fIntFlowCorrelationsPro->Sumw2();
2634  fIntFlowCorrelationsPro->SetTickLength(-0.01,"Y");
2635  fIntFlowCorrelationsPro->SetMarkerStyle(25);
2636  fIntFlowCorrelationsPro->SetLabelSize(0.06);
2637  fIntFlowCorrelationsPro->SetLabelOffset(0.01,"Y");
2638  for(Int_t b=0;b<4;b++)
2639  {
2640  (fIntFlowCorrelationsPro->GetXaxis())->SetBinLabel(b+1,correlationFlag[b].Data());
2641  }
2643  // Average correlations squared <<2>^2>, <<4>^2>, <<6>^2> and <<8>^2> for all events:
2644  TString squaredCorrelationFlag[4] = {"#LT#LT2#GT^{2}#GT","#LT#LT4#GT^{2}#GT","#LT#LT6#GT^{2}#GT","#LT#LT8#GT^{2}#GT"};
2645  TString intFlowSquaredCorrelationsProName = "fIntFlowSquaredCorrelationsPro";
2646  intFlowSquaredCorrelationsProName += fAnalysisLabel->Data();
2647  fIntFlowSquaredCorrelationsPro = new TProfile(intFlowSquaredCorrelationsProName.Data(),"Average squared correlations for all events",4,0,4,"s");
2649  fIntFlowSquaredCorrelationsPro->SetTickLength(-0.01,"Y");
2650  fIntFlowSquaredCorrelationsPro->SetMarkerStyle(25);
2651  fIntFlowSquaredCorrelationsPro->SetLabelSize(0.06);
2652  fIntFlowSquaredCorrelationsPro->SetLabelOffset(0.01,"Y");
2653  for(Int_t b=0;b<4;b++)
2654  {
2655  (fIntFlowSquaredCorrelationsPro->GetXaxis())->SetBinLabel(b+1,squaredCorrelationFlag[b].Data());
2656  }
2659  {
2660  for(Int_t ci=0;ci<4;ci++) // correlation index
2661  {
2662  // average correlations <<2>>, <<4>>, <<6>> and <<8>> versus multiplicity for all events (with wrong errors):
2663  TString intFlowCorrelationsVsMProName = "fIntFlowCorrelationsVsMPro";
2664  intFlowCorrelationsVsMProName += fAnalysisLabel->Data();
2665  fIntFlowCorrelationsVsMPro[ci] = new TProfile(Form("%s, %s",intFlowCorrelationsVsMProName.Data(),correlationFlag[ci].Data()),
2666  Form("%s vs multiplicity",correlationFlag[ci].Data()),
2668  fIntFlowCorrelationsVsMPro[ci]->Sumw2();
2669  fIntFlowCorrelationsVsMPro[ci]->GetYaxis()->SetTitle(correlationFlag[ci].Data());
2671  {
2672  fIntFlowCorrelationsVsMPro[ci]->GetXaxis()->SetTitle("# RPs");
2674  {
2675  fIntFlowCorrelationsVsMPro[ci]->GetXaxis()->SetTitle("Reference multiplicity (from ESD)");
2677  {
2678  fIntFlowCorrelationsVsMPro[ci]->GetXaxis()->SetTitle("# POIs");
2679  }
2681  // average squared correlations <<2>^2>, <<4>^2>, <<6>^2> and <<8>^2> versus multiplicity for all events:
2682  TString intFlowSquaredCorrelationsVsMProName = "fIntFlowSquaredCorrelationsVsMPro";
2683  intFlowSquaredCorrelationsVsMProName += fAnalysisLabel->Data();
2684  fIntFlowSquaredCorrelationsVsMPro[ci] = new TProfile(Form("%s, %s",intFlowSquaredCorrelationsVsMProName.Data(),squaredCorrelationFlag[ci].Data()),
2685  Form("%s vs multiplicity",squaredCorrelationFlag[ci].Data()),
2687  fIntFlowSquaredCorrelationsVsMPro[ci]->Sumw2();
2688  fIntFlowSquaredCorrelationsVsMPro[ci]->GetYaxis()->SetTitle(squaredCorrelationFlag[ci].Data());
2690  {
2691  fIntFlowSquaredCorrelationsVsMPro[ci]->GetXaxis()->SetTitle("# RPs");
2693  {
2694  fIntFlowSquaredCorrelationsVsMPro[ci]->GetXaxis()->SetTitle("Reference multiplicity (from ESD)");
2696  {
2697  fIntFlowSquaredCorrelationsVsMPro[ci]->GetXaxis()->SetTitle("# POIs");
2698  }
2700  } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
2701  } // end of if(fCalculateCumulantsVsM)
2702  // averaged all correlations for all events (with wrong errors!):
2703  TString intFlowCorrelationsAllProName = "fIntFlowCorrelationsAllPro";
2704  intFlowCorrelationsAllProName += fAnalysisLabel->Data();
2705  fIntFlowCorrelationsAllPro = new TProfile(intFlowCorrelationsAllProName.Data(),"Average all correlations for all events",64,0,64);
2706  fIntFlowCorrelationsAllPro->Sumw2();
2707  fIntFlowCorrelationsAllPro->SetTickLength(-0.01,"Y");
2708  fIntFlowCorrelationsAllPro->SetMarkerStyle(25);
2709  fIntFlowCorrelationsAllPro->SetLabelSize(0.03);
2710  fIntFlowCorrelationsAllPro->SetLabelOffset(0.01,"Y");
2711  // 2-p correlations:
2712  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(1,"#LT#LT2#GT#GT_{n|n}");
2713  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(2,"#LT#LT2#GT#GT_{2n|2n}");
2714  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(3,"#LT#LT2#GT#GT_{3n|3n}");
2715  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(4,"#LT#LT2#GT#GT_{4n|4n}");
2716  // 3-p correlations:
2717  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(6,"#LT#LT3#GT#GT_{2n|n,n}");
2718  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(7,"#LT#LT3#GT#GT_{3n|2n,n}");
2719  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(8,"#LT#LT3#GT#GT_{4n|2n,2n}");
2720  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(9,"#LT#LT3#GT#GT_{4n|3n,n}");
2721  // 4-p correlations:
2722  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(11,"#LT#LT4#GT#GT_{n,n|n,n}");
2723  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(12,"#LT#LT4#GT#GT_{2n,n|2n,n}");
2724  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(13,"#LT#LT4#GT#GT_{2n,2n|2n,2n}");
2725  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(14,"#LT#LT4#GT#GT_{3n|n,n,n}");
2726  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(15,"#LT#LT4#GT#GT_{3n,n|3n,n}");
2727  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(16,"#LT#LT4#GT#GT_{3n,n|2n,2n}");
2728  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(17,"#LT#LT4#GT#GT_{4n|2n,n,n}");
2729  // 5-p correlations:
2730  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(19,"#LT#LT5#GT#GT_{2n,n|n,n,n}");
2731  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(20,"#LT#LT5#GT#GT_{2n,2n|2n,n,n}");
2732  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(21,"#LT#LT5#GT#GT_{3n,n|2n,n,n}");
2733  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(22,"#LT#LT5#GT#GT_{4n|n,n,n,n}");
2734  // 6-p correlations:
2735  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(24,"#LT#LT6#GT#GT_{n,n,n|n,n,n}");
2736  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(25,"#LT#LT6#GT#GT_{2n,n,n|2n,n,n}");
2737  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(26,"#LT#LT6#GT#GT_{2n,2n|n,n,n,n}");
2738  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(27,"#LT#LT6#GT#GT_{3n,n|n,n,n,n}");
2739  // 7-p correlations:
2740  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(29,"#LT#LT7#GT#GT_{2n,n,n|n,n,n,n}");
2741  // 8-p correlations:
2742  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(31,"#LT#LT8#GT#GT_{n,n,n,n|n,n,n,n}");
2743  // EXTRA correlations for v3{5} study:
2744  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(33,"#LT#LT4#GT#GT_{4n,2n|3n,3n}");
2745  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(34,"#LT#LT5#GT#GT_{3n,3n|2n,2n,2n}");
2746  // EXTRA correlations for Teaney-Yan study:
2747  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(35,"#LT#LT2#GT#GT_{5n|5n}");
2748  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(36,"#LT#LT2#GT#GT_{6n|6n}");
2749  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(37,"#LT#LT3#GT#GT_{5n|3n,2n}");
2750  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(38,"#LT#LT3#GT#GT_{5n|4n,1n}");
2751  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(39,"#LT#LT3#GT#GT_{6n|3n,3n}");
2752  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(40,"#LT#LT3#GT#GT_{6n|4n,2n}");
2753  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(41,"#LT#LT3#GT#GT_{6n|5n,1n}");
2754  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(42,"#LT#LT4#GT#GT_{6n|3n,2n,1n}");
2755  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(43,"#LT#LT4#GT#GT_{3n,2n|3n,2n}");
2756  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(44,"#LT#LT4#GT#GT_{4n,1n|3n,2n}");
2757  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(45,"#LT#LT4#GT#GT_{3n,3n|3n,3n}");
2758  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(46,"#LT#LT4#GT#GT_{4n,2n|3n,3n}");
2759  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(47,"#LT#LT4#GT#GT_{5n,1n|3n,3n}");
2760  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(48,"#LT#LT4#GT#GT_{4n,2n|4n,2n}");
2761  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(49,"#LT#LT4#GT#GT_{5n,1n|4n,2n}");
2762  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(50,"#LT#LT4#GT#GT_{5n|3n,1n,1n}");
2763  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(51,"#LT#LT4#GT#GT_{5n|2n,2n,1n}");
2764  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(52,"#LT#LT4#GT#GT_{5n,1n|5n,1n}");
2765  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(53,"#LT#LT5#GT#GT_{3n,3n|3n,2n,1n}");
2766  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(54,"#LT#LT5#GT#GT_{4n,2n|3n,2n,1n}");
2767  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(55,"#LT#LT5#GT#GT_{3n,2n|3n,1n,1n}");
2768  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(56,"#LT#LT5#GT#GT_{3n,2n|2n,2n,1n}");
2769  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(57,"#LT#LT5#GT#GT_{5n,1n|3n,2n,1n}");
2770  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(58,"#LT#LT6#GT#GT_{3n,2n,1n|3n,2n,1n}");
2771  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(59,"#LT#LT4#GT#GT_{6n|4n,1n,1n}");
2772  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(60,"#LT#LT4#GT#GT_{6n|2n,2n,2n}");
2773  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(61,"#LT#LT5#GT#GT_{6n|2n,2n,1n,1n}");
2774  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(62,"#LT#LT5#GT#GT_{4n,1n,1n|3n,3n}");
2775  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(63,"#LT#LT6#GT#GT_{3n,3n|2n,2n,1n,1n}");
2777  // average all correlations versus multiplicity (errors via Sumw2 - to be improved):
2779  {
2780  // 2-p correlations vs M:
2781  fIntFlowCorrelationsAllVsMPro[0] = new TProfile("two1n1n","#LT#LT2#GT#GT_{n|n}",fnBinsMult,fMinMult,fMaxMult);
2782  fIntFlowCorrelationsAllVsMPro[1] = new TProfile("two2n2n","#LT#LT2#GT#GT_{2n|2n}",fnBinsMult,fMinMult,fMaxMult);
2783  fIntFlowCorrelationsAllVsMPro[2] = new TProfile("two3n3n","#LT#LT2#GT#GT_{3n|3n}",fnBinsMult,fMinMult,fMaxMult);
2784  fIntFlowCorrelationsAllVsMPro[3] = new TProfile("two4n4n","#LT#LT2#GT#GT_{4n|4n}",fnBinsMult,fMinMult,fMaxMult);
2785  // 3-p correlations vs M:
2786  fIntFlowCorrelationsAllVsMPro[5] = new TProfile("three2n1n1n","#LT#LT3#GT#GT_{2n|n,n}",fnBinsMult,fMinMult,fMaxMult);
2787  fIntFlowCorrelationsAllVsMPro[6] = new TProfile("three3n2n1n","#LT#LT3#GT#GT_{3n|2n,n}",fnBinsMult,fMinMult,fMaxMult);
2788  fIntFlowCorrelationsAllVsMPro[7] = new TProfile("three4n2n2n","#LT#LT3#GT#GT_{4n|2n,2n}",fnBinsMult,fMinMult,fMaxMult);
2789  fIntFlowCorrelationsAllVsMPro[8] = new TProfile("three4n3n1n","#LT#LT3#GT#GT_{4n|3n,n}",fnBinsMult,fMinMult,fMaxMult);
2790  // 4-p correlations vs M:
2791  fIntFlowCorrelationsAllVsMPro[10] = new TProfile("four1n1n1n1n","#LT#LT4#GT#GT_{n,n|n,n}",fnBinsMult,fMinMult,fMaxMult);
2792  fIntFlowCorrelationsAllVsMPro[11] = new TProfile("four2n1n2n1n","#LT#LT4#GT#GT_{2n,n|2n,n}",fnBinsMult,fMinMult,fMaxMult);
2793  fIntFlowCorrelationsAllVsMPro[12] = new TProfile("four2n2n2n2n","#LT#LT4#GT#GT_{2n,2n|2n,2n}",fnBinsMult,fMinMult,fMaxMult);
2794  fIntFlowCorrelationsAllVsMPro[13] = new TProfile("four3n1n1n1n","#LT#LT4#GT#GT_{3n|n,n,n}",fnBinsMult,fMinMult,fMaxMult);
2795  fIntFlowCorrelationsAllVsMPro[14] = new TProfile("four3n1n3n1n","#LT#LT4#GT#GT_{3n,n|3n,n}",fnBinsMult,fMinMult,fMaxMult);
2796  fIntFlowCorrelationsAllVsMPro[15] = new TProfile("four3n1n2n2n","#LT#LT4#GT#GT_{3n,n|2n,2n}",fnBinsMult,fMinMult,fMaxMult);
2797  fIntFlowCorrelationsAllVsMPro[16] = new TProfile("four4n2n1n1n","#LT#LT4#GT#GT_{4n|2n,n,n}",fnBinsMult,fMinMult,fMaxMult);
2798  // 5-p correlations vs M:
2799  fIntFlowCorrelationsAllVsMPro[18] = new TProfile("five2n1n1n1n1n","#LT#LT5#GT#GT_{2n,n|n,n,n}",fnBinsMult,fMinMult,fMaxMult);
2800  fIntFlowCorrelationsAllVsMPro[19] = new TProfile("five2n2n2n1n1n","#LT#LT5#GT#GT_{2n,2n|2n,n,n}",fnBinsMult,fMinMult,fMaxMult);
2801  fIntFlowCorrelationsAllVsMPro[20] = new TProfile("five3n1n2n1n1n","#LT#LT5#GT#GT_{3n,n|2n,n,n}",fnBinsMult,fMinMult,fMaxMult);
2802  fIntFlowCorrelationsAllVsMPro[21] = new TProfile("five4n1n1n1n1n","#LT#LT5#GT#GT_{4n|n,n,n,n}",fnBinsMult,fMinMult,fMaxMult);
2803  // 6-p correlations vs M:
2804  fIntFlowCorrelationsAllVsMPro[23] = new TProfile("six1n1n1n1n1n1n","#LT#LT6#GT#GT_{n,n,n|n,n,n}",fnBinsMult,fMinMult,fMaxMult);
2805  fIntFlowCorrelationsAllVsMPro[24] = new TProfile("six2n1n1n2n1n1n","#LT#LT6#GT#GT_{2n,n,n|2n,n,n}",fnBinsMult,fMinMult,fMaxMult);
2806  fIntFlowCorrelationsAllVsMPro[25] = new TProfile("six2n2n1n1n1n1n","#LT#LT6#GT#GT_{2n,2n|n,n,n,n}",fnBinsMult,fMinMult,fMaxMult);
2807  fIntFlowCorrelationsAllVsMPro[26] = new TProfile("six3n1n1n1n1n1n","#LT#LT6#GT#GT_{3n,n|n,n,n,n}",fnBinsMult,fMinMult,fMaxMult);
2808  // 7-p correlations vs M:
2809  fIntFlowCorrelationsAllVsMPro[28] = new TProfile("seven2n1n1n1n1n1n1n","#LT#LT7#GT#GT_{2n,n,n|n,n,n,n}",fnBinsMult,fMinMult,fMaxMult);
2810  // 8-p correlations vs M:
2811  fIntFlowCorrelationsAllVsMPro[30] = new TProfile("eight1n1n1n1n1n1n1n1n","#LT#LT8#GT#GT_{n,n,n,n|n,n,n,n}",fnBinsMult,fMinMult,fMaxMult);
2812  // EXTRA correlations vs M for v3{5} study (to be improved - put them in a right order somewhere):
2813  fIntFlowCorrelationsAllVsMPro[32] = new TProfile("four4n2n3n3n","#LT#LT4#GT#GT_{4n,2n|3n,3n}",fnBinsMult,fMinMult,fMaxMult);
2814  fIntFlowCorrelationsAllVsMPro[33] = new TProfile("five3n3n2n2n2n","#LT#LT5#GT#GT_{3n,3n|2n,2n,2n}",fnBinsMult,fMinMult,fMaxMult);
2815  // EXTRA correlations vs M for Teaney-Yan study (to be improved - put them in a right order somewhere):
2816  fIntFlowCorrelationsAllVsMPro[34] = new TProfile("two5n5n","#LT#LT2#GT#GT_{5n|5n}",fnBinsMult,fMinMult,fMaxMult);
2817  fIntFlowCorrelationsAllVsMPro[35] = new TProfile("two6n6n","#LT#LT2#GT#GT_{6n|6n}",fnBinsMult,fMinMult,fMaxMult);
2818  fIntFlowCorrelationsAllVsMPro[36] = new TProfile("three5n3n2n","#LT#LT3#GT#GT_{5n|3n,2n}",fnBinsMult,fMinMult,fMaxMult);
2819  fIntFlowCorrelationsAllVsMPro[37] = new TProfile("three5n4n1n","#LT#LT3#GT#GT_{5n|4n,1n}",fnBinsMult,fMinMult,fMaxMult);
2820  fIntFlowCorrelationsAllVsMPro[38] = new TProfile("three6n3n3n","#LT#LT3#GT#GT_{6n|3n,3n}",fnBinsMult,fMinMult,fMaxMult);
2821  fIntFlowCorrelationsAllVsMPro[39] = new TProfile("three6n4n2n","#LT#LT3#GT#GT_{6n|4n,2n}",fnBinsMult,fMinMult,fMaxMult);
2822  fIntFlowCorrelationsAllVsMPro[40] = new TProfile("three6n5n1n","#LT#LT3#GT#GT_{6n|5n,1n}",fnBinsMult,fMinMult,fMaxMult);
2823  fIntFlowCorrelationsAllVsMPro[41] = new TProfile("four6n3n2n1n","#LT#LT4#GT#GT_{6n|3n,2n,1n}",fnBinsMult,fMinMult,fMaxMult);
2824  fIntFlowCorrelationsAllVsMPro[42] = new TProfile("four3n2n3n2n","#LT#LT4#GT#GT_{3n,2n|3n,2n}",fnBinsMult,fMinMult,fMaxMult);
2825  fIntFlowCorrelationsAllVsMPro[43] = new TProfile("four4n1n3n2n","#LT#LT4#GT#GT_{4n,1n|3n,2n}",fnBinsMult,fMinMult,fMaxMult);
2826  fIntFlowCorrelationsAllVsMPro[44] = new TProfile("four3n3n3n3n","#LT#LT4#GT#GT_{3n,3n|3n,3n}",fnBinsMult,fMinMult,fMaxMult);
2827  fIntFlowCorrelationsAllVsMPro[45] = new TProfile("four4n2n3n3n","#LT#LT4#GT#GT_{4n,2n|3n,3n}",fnBinsMult,fMinMult,fMaxMult);
2828  fIntFlowCorrelationsAllVsMPro[46] = new TProfile("four5n1n3n3n","#LT#LT4#GT#GT_{5n,1n|3n,3n}",fnBinsMult,fMinMult,fMaxMult);
2829  fIntFlowCorrelationsAllVsMPro[47] = new TProfile("four4n2n4n2n","#LT#LT4#GT#GT_{4n,2n|4n,2n}",fnBinsMult,fMinMult,fMaxMult);
2830  fIntFlowCorrelationsAllVsMPro[48] = new TProfile("four5n1n4n2n","#LT#LT4#GT#GT_{5n,1n|4n,2n}",fnBinsMult,fMinMult,fMaxMult);
2831  fIntFlowCorrelationsAllVsMPro[49] = new TProfile("four5n3n1n1n","#LT#LT4#GT#GT_{5n|3n,1n,1n}",fnBinsMult,fMinMult,fMaxMult);
2832  fIntFlowCorrelationsAllVsMPro[50] = new TProfile("four5n2n2n1n","#LT#LT4#GT#GT_{5n|2n,2n,1n}",fnBinsMult,fMinMult,fMaxMult);
2833  fIntFlowCorrelationsAllVsMPro[51] = new TProfile("four5n1n5n1n","#LT#LT4#GT#GT_{5n,1n|5n,1n}",fnBinsMult,fMinMult,fMaxMult);
2834  fIntFlowCorrelationsAllVsMPro[52] = new TProfile("five3n3n3n2n1n","#LT#LT5#GT#GT_{3n,3n|3n,2n,1n}",fnBinsMult,fMinMult,fMaxMult);
2835  fIntFlowCorrelationsAllVsMPro[53] = new TProfile("five4n2n3n2n1n","#LT#LT5#GT#GT_{4n,2n|3n,2n,1n}",fnBinsMult,fMinMult,fMaxMult);
2836  fIntFlowCorrelationsAllVsMPro[54] = new TProfile("five3n2n3n1n1n","#LT#LT5#GT#GT_{3n,2n|3n,1n,1n}",fnBinsMult,fMinMult,fMaxMult);
2837  fIntFlowCorrelationsAllVsMPro[55] = new TProfile("five3n2n2n2n1n","#LT#LT5#GT#GT_{3n,2n|2n,2n,1n}",fnBinsMult,fMinMult,fMaxMult);
2838  fIntFlowCorrelationsAllVsMPro[56] = new TProfile("five5n1n3n2n1n","#LT#LT5#GT#GT_{5n,1n|3n,2n,1n}",fnBinsMult,fMinMult,fMaxMult);
2839  fIntFlowCorrelationsAllVsMPro[57] = new TProfile("six3n2n1n3n2n1n","#LT#LT6#GT#GT_{3n,2n,1n|3n,2n,1n}",fnBinsMult,fMinMult,fMaxMult);
2840  fIntFlowCorrelationsAllVsMPro[58] = new TProfile("four6n4n1n1n","#LT#LT4#GT#GT_{6n|4n,1n,1n}",fnBinsMult,fMinMult,fMaxMult);
2841  fIntFlowCorrelationsAllVsMPro[59] = new TProfile("four6n2n2n2n","#LT#LT4#GT#GT_{6n|2n,2n,2n}",fnBinsMult,fMinMult,fMaxMult);
2842  fIntFlowCorrelationsAllVsMPro[60] = new TProfile("five6n2n2n1n1n","#LT#LT5#GT#GT_{6n|2n,2n,1n,1n}",fnBinsMult,fMinMult,fMaxMult);
2843  fIntFlowCorrelationsAllVsMPro[61] = new TProfile("five4n1n1n3n3n","#LT#LT5#GT#GT_{4n,1n,1n|3n,3n}",fnBinsMult,fMinMult,fMaxMult);
2844  fIntFlowCorrelationsAllVsMPro[62] = new TProfile("six3n3n2n2n1n1n","#LT#LT6#GT#GT_{3n,3n|2n,2n,1n,1n}",fnBinsMult,fMinMult,fMaxMult);
2845  for(Int_t n=0;n<63;n++)
2846  {
2848  {
2849  fIntFlowCorrelationsAllVsMPro[n]->Sumw2();
2851  {
2852  fIntFlowCorrelationsAllVsMPro[n]->GetXaxis()->SetTitle("# RPs");
2854  {
2855  fIntFlowCorrelationsAllVsMPro[n]->GetXaxis()->SetTitle("Reference multiplicity (from ESD)");
2857  {
2858  fIntFlowCorrelationsAllVsMPro[n]->GetXaxis()->SetTitle("# POIs");
2859  }
2861  } // end of if(fIntFlowCorrelationsAllVsMPro[n])
2862  } // end of for(Int_t n=0;n<63;n++)
2863  } // end of if(fCalculateAllCorrelationsVsM)
2864  // when particle weights are used some extra correlations appear:
2866  {
2867  TString intFlowExtraCorrelationsProName = "fIntFlowExtraCorrelationsPro";
2868  intFlowExtraCorrelationsProName += fAnalysisLabel->Data();
2869  fIntFlowExtraCorrelationsPro = new TProfile(intFlowExtraCorrelationsProName.Data(),"Average extra correlations for all events",100,0,100,"s");
2870  fIntFlowExtraCorrelationsPro->SetTickLength(-0.01,"Y");
2871  fIntFlowExtraCorrelationsPro->SetMarkerStyle(25);
2872  fIntFlowExtraCorrelationsPro->SetLabelSize(0.03);
2873  fIntFlowExtraCorrelationsPro->SetLabelOffset(0.01,"Y");
2874  // extra 2-p correlations:
2875  (fIntFlowExtraCorrelationsPro->GetXaxis())->SetBinLabel(1,"<<w1^3 w2 cos(n*(phi1-phi2))>>");
2876  (fIntFlowExtraCorrelationsPro->GetXaxis())->SetBinLabel(2,"<<w1 w2 w3^2 cos(n*(phi1-phi2))>>");
2878  } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights)
2879  // average product of correlations <2>, <4>, <6> and <8>:
2880  TString productFlag[6] = {"#LT#LT2#GT#LT4#GT#GT","#LT#LT2#GT#LT6#GT#GT","#LT#LT2#GT#LT8#GT#GT",
2881  "#LT#LT4#GT#LT6#GT#GT","#LT#LT4#GT#LT8#GT#GT","#LT#LT6#GT#LT8#GT#GT"};
2882  TString intFlowProductOfCorrelationsProName = "fIntFlowProductOfCorrelationsPro";
2883  intFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
2884  fIntFlowProductOfCorrelationsPro = new TProfile(intFlowProductOfCorrelationsProName.Data(),"Average products of correlations",6,0,6);
2885  fIntFlowProductOfCorrelationsPro->SetTickLength(-0.01,"Y");
2886  fIntFlowProductOfCorrelationsPro->SetMarkerStyle(25);
2887  fIntFlowProductOfCorrelationsPro->SetLabelSize(0.05);
2888  fIntFlowProductOfCorrelationsPro->SetLabelOffset(0.01,"Y");
2889  for(Int_t b=0;b<6;b++)
2890  {
2891  (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(b+1,productFlag[b].Data());
2892  }
2894  // average product of correlations <2>, <4>, <6> and <8> versus multiplicity
2895  // [0=<<2><4>>,1=<<2><6>>,2=<<2><8>>,3=<<4><6>>,4=<<4><8>>,5=<<6><8>>]
2897  {
2898  TString intFlowProductOfCorrelationsVsMProName = "fIntFlowProductOfCorrelationsVsMPro";
2899  intFlowProductOfCorrelationsVsMProName += fAnalysisLabel->Data();
2900  for(Int_t pi=0;pi<6;pi++)
2901  {
2902  fIntFlowProductOfCorrelationsVsMPro[pi] = new TProfile(Form("%s, %s",intFlowProductOfCorrelationsVsMProName.Data(),productFlag[pi].Data()),
2903  Form("%s versus multiplicity",productFlag[pi].Data()),
2906  {
2907  fIntFlowProductOfCorrelationsVsMPro[pi]->GetXaxis()->SetTitle("# RPs");
2909  {
2910  fIntFlowProductOfCorrelationsVsMPro[pi]->GetXaxis()->SetTitle("Reference multiplicity (from ESD)");
2912  {
2913  fIntFlowProductOfCorrelationsVsMPro[pi]->GetXaxis()->SetTitle("# POIs");
2914  }
2916  } // end of for(Int_t pi=0;pi<6;pi++)
2917  } // end of if(fCalculateCumulantsVsM)
2918  // average product of correction terms for NUA:
2919  TString intFlowProductOfCorrectionTermsForNUAProName = "fIntFlowProductOfCorrectionTermsForNUAPro";
2920  intFlowProductOfCorrectionTermsForNUAProName += fAnalysisLabel->Data();
2921  fIntFlowProductOfCorrectionTermsForNUAPro = new TProfile(intFlowProductOfCorrectionTermsForNUAProName.Data(),"Average products of correction terms for NUA",27,0,27);
2922  fIntFlowProductOfCorrectionTermsForNUAPro->SetTickLength(-0.01,"Y");
2923  fIntFlowProductOfCorrectionTermsForNUAPro->SetMarkerStyle(25);
2924  fIntFlowProductOfCorrectionTermsForNUAPro->SetLabelSize(0.03);
2925  fIntFlowProductOfCorrectionTermsForNUAPro->SetLabelOffset(0.01,"Y");
2926  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(1,"<<2><cos(#phi)>>");
2927  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(2,"<<2><sin(#phi)>>");
2928  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(3,"<<cos(#phi)><sin(#phi)>>");
2929  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(4,"Cov(<2>,<cos(#phi_{1}+#phi_{2})>)");
2930  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(5,"Cov(<2>,<sin(#phi_{1}+#phi_{2})>)");
2931  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(6,"Cov(<2>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
2932  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(7,"Cov(<2>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
2933  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(8,"Cov(<4>,<cos(#phi)>)");
2934  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(9,"Cov(<4>,<sin(#phi)>)");
2935  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(10,"Cov(<4>,<cos(#phi_{1}+#phi_{2})>)");
2936  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(11,"Cov(<4>,<sin(#phi_{1}+#phi_{2})>)");
2937  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(12,"Cov(<4>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>>)");
2938  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(13,"Cov(<4>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>>)");
2939  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(14,"Cov(<cos(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
2940  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(15,"Cov(<cos(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
2941  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(16,"Cov(<cos(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
2942  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(17,"Cov(<cos(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
2943  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(18,"Cov(<sin(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
2944  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(19,"Cov(<sin(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
2945  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(20,"Cov(<sin(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
2946  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(21,"Cov(<sin(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
2947  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(22,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}+#phi_{2})>)");
2948  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(23,"Cov(<cos(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
2949  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(24,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
2950  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(25,"Cov(<sin(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
2951  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(26,"Cov(<sin(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
2952  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(27,"Cov(<cos(#phi_{1}-#phi_{2}-#phi_{3}>,<sin(#phi_{1}-#phi_{2}-#phi_{3}>)");
2954  // average correction terms for non-uniform acceptance (with wrong errors!):
2955  for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2956  {
2957  TString intFlowCorrectionTermsForNUAProName = "fIntFlowCorrectionTermsForNUAPro";
2958  intFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
2959  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");
2960  fIntFlowCorrectionTermsForNUAPro[sc]->SetTickLength(-0.01,"Y");
2961  fIntFlowCorrectionTermsForNUAPro[sc]->SetMarkerStyle(25);
2962  fIntFlowCorrectionTermsForNUAPro[sc]->SetLabelSize(0.05);
2963  fIntFlowCorrectionTermsForNUAPro[sc]->SetLabelOffset(0.01,"Y");
2964  (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(1,Form("#LT#LT%s(n(#phi_{1}))#GT#GT",sinCosFlag[sc].Data()));
2965  (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(2,Form("#LT#LT%s(n(#phi_{1}+#phi_{2}))#GT#GT",sinCosFlag[sc].Data()));
2966  (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(3,Form("#LT#LT%s(n(#phi_{1}-#phi_{2}-#phi_{3}))#GT#GT",sinCosFlag[sc].Data()));
2967  (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(4,Form("#LT#LT%s(n(2#phi_{1}-#phi_{2}))#GT#GT",sinCosFlag[sc].Data()));
2969  // versus multiplicity:
2971  {
2972  TString correctionTermFlag[4] = {"(n(phi1))","(n(phi1+phi2))","(n(phi1-phi2-phi3))","(n(2phi1-phi2))"}; // to be improved - hardwired 4
2973  for(Int_t ci=0;ci<4;ci++) // correction term index (to be improved - hardwired 4)
2974  {
2975  TString intFlowCorrectionTermsForNUAVsMProName = "fIntFlowCorrectionTermsForNUAVsMPro";
2976  intFlowCorrectionTermsForNUAVsMProName += fAnalysisLabel->Data();
2977  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");
2979  }
2980  } // end of if(fCalculateCumulantsVsM)
2981  } // end of for(Int_t sc=0;sc<2;sc++)
2982 
2983  // d) Book histograms holding the final results:
2984  // average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with correct errors!):
2985  TString intFlowCorrelationsHistName = "fIntFlowCorrelationsHist";
2986  intFlowCorrelationsHistName += fAnalysisLabel->Data();
2987  fIntFlowCorrelationsHist = new TH1D(intFlowCorrelationsHistName.Data(),"Average correlations for all events",4,0,4);
2988  fIntFlowCorrelationsHist->SetTickLength(-0.01,"Y");
2989  fIntFlowCorrelationsHist->SetMarkerStyle(25);
2990  fIntFlowCorrelationsHist->SetLabelSize(0.06);
2991  fIntFlowCorrelationsHist->SetLabelOffset(0.01,"Y");
2992  (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(1,"#LT#LT2#GT#GT");
2993  (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(2,"#LT#LT4#GT#GT");
2994  (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(3,"#LT#LT6#GT#GT");
2995  (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(4,"#LT#LT8#GT#GT");
2997  // average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with correct errors!) vs M:
2999  {
3000  for(Int_t ci=0;ci<4;ci++) // correlation index
3001  {
3002  TString intFlowCorrelationsVsMHistName = "fIntFlowCorrelationsVsMHist";
3003  intFlowCorrelationsVsMHistName += fAnalysisLabel->Data();
3004  fIntFlowCorrelationsVsMHist[ci] = new TH1D(Form("%s, %s",intFlowCorrelationsVsMHistName.Data(),correlationFlag[ci].Data()),
3005  Form("%s vs multiplicity",correlationFlag[ci].Data()),
3007  fIntFlowCorrelationsVsMHist[ci]->GetYaxis()->SetTitle(correlationFlag[ci].Data());
3009  {
3010  fIntFlowCorrelationsVsMHist[ci]->GetXaxis()->SetTitle("# RPs");
3012  {
3013  fIntFlowCorrelationsVsMHist[ci]->GetXaxis()->SetTitle("Reference multiplicity (from ESD)");
3015  {
3016  fIntFlowCorrelationsVsMHist[ci]->GetXaxis()->SetTitle("# POIs");
3017  }
3019  } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
3020  } // end of if(fCalculateCumulantsVsM)
3021  // average all correlations for all events (with correct errors!):
3022  TString intFlowCorrelationsAllHistName = "fIntFlowCorrelationsAllHist";
3023  intFlowCorrelationsAllHistName += fAnalysisLabel->Data();
3024  fIntFlowCorrelationsAllHist = new TH1D(intFlowCorrelationsAllHistName.Data(),"Average correlations for all events",34,0,34);
3025  fIntFlowCorrelationsAllHist->SetTickLength(-0.01,"Y");
3026  fIntFlowCorrelationsAllHist->SetMarkerStyle(25);
3027  fIntFlowCorrelationsAllHist->SetLabelSize(0.03);
3028  fIntFlowCorrelationsAllHist->SetLabelOffset(0.01,"Y");
3029  // 2-p correlations:
3030  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(1,"<<2>>_{n|n}");
3031  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(2,"<<2>>_{2n|2n}");
3032  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(3,"<<2>>_{3n|3n}");
3033  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(4,"<<2>>_{4n|4n}");
3034  // 3-p correlations:
3035  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(6,"<<3>>_{2n|n,n}");
3036  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(7,"<<3>>_{3n|2n,n}");
3037  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(8,"<<3>>_{4n|2n,2n}");
3038  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(9,"<<3>>_{4n|3n,n}");
3039  // 4-p correlations:
3040  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(11,"<<4>>_{n,n|n,n}");
3041  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(12,"<<4>>_{2n,n|2n,n}");
3042  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(13,"<<4>>_{2n,2n|2n,2n}");
3043  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(14,"<<4>>_{3n|n,n,n}");
3044  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(15,"<<4>>_{3n,n|3n,n}");
3045  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(16,"<<4>>_{3n,n|2n,2n}");
3046  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(17,"<<4>>_{4n|2n,n,n}");
3047  // 5-p correlations:
3048  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(19,"<<5>>_{2n|n,n,n,n}");
3049  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(20,"<<5>>_{2n,2n|2n,n,n}");
3050  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(21,"<<5>>_{3n,n|2n,n,n}");
3051  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(22,"<<5>>_{4n|n,n,n,n}");
3052  // 6-p correlations:
3053  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(24,"<<6>>_{n,n,n|n,n,n}");
3054  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(25,"<<6>>_{2n,n,n|2n,n,n}");
3055  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(26,"<<6>>_{2n,2n|n,n,n,n}");
3056  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(27,"<<6>>_{3n,n|n,n,n,n}");
3057  // 7-p correlations:
3058  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(29,"<<7>>_{2n,n,n|n,n,n,n}");
3059  // 8-p correlations:
3060  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(31,"<<8>>_{n,n,n,n|n,n,n,n}");
3062  // average correction terms for non-uniform acceptance (with correct errors!):
3063  for(Int_t sc=0;sc<2;sc++) // sin or cos terms
3064  {
3065  TString intFlowCorrectionTermsForNUAHistName = "fIntFlowCorrectionTermsForNUAHist";
3066  intFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
3067  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);
3068  fIntFlowCorrectionTermsForNUAHist[sc]->SetTickLength(-0.01,"Y");
3069  fIntFlowCorrectionTermsForNUAHist[sc]->SetMarkerStyle(25);
3070  fIntFlowCorrectionTermsForNUAHist[sc]->SetLabelSize(0.05);
3071  fIntFlowCorrectionTermsForNUAHist[sc]->SetLabelOffset(0.01,"Y");
3072  (fIntFlowCorrectionTermsForNUAHist[sc]->GetXaxis())->SetBinLabel(1,Form("#LT#LT%s(n(#phi_{1}))#GT#GT",sinCosFlag[sc].Data()));
3073  (fIntFlowCorrectionTermsForNUAHist[sc]->GetXaxis())->SetBinLabel(2,Form("#LT#LT%s(n(#phi_{1}+#phi_{2}))#GT#GT",sinCosFlag[sc].Data()));
3074  (fIntFlowCorrectionTermsForNUAHist[sc]->GetXaxis())->SetBinLabel(3,Form("#LT#LT%s(n(#phi_{1}-#phi_{2}-#phi_{3}))#GT#GT",sinCosFlag[sc].Data()));
3075  (fIntFlowCorrectionTermsForNUAHist[sc]->GetXaxis())->SetBinLabel(4,Form("#LT#LT%s(n(2#phi_{1}-#phi_{2}))#GT#GT",sinCosFlag[sc].Data()));
3077  } // end of for(Int_t sc=0;sc<2;sc++)
3078  // covariances (multiplied with weight dependent prefactor):
3079  TString intFlowCovariancesName = "fIntFlowCovariances";
3080  intFlowCovariancesName += fAnalysisLabel->Data();
3081  fIntFlowCovariances = new TH1D(intFlowCovariancesName.Data(),"Covariances (multiplied with weight dependent prefactor)",6,0,6);
3082  fIntFlowCovariances->SetLabelSize(0.04);
3083  fIntFlowCovariances->SetMarkerStyle(25);
3084  (fIntFlowCovariances->GetXaxis())->SetBinLabel(1,"Cov(#LT2#GT,#LT4#GT)");
3085  (fIntFlowCovariances->GetXaxis())->SetBinLabel(2,"Cov(#LT2#GT,#LT6#GT)");
3086  (fIntFlowCovariances->GetXaxis())->SetBinLabel(3,"Cov(#LT2#GT,#LT8#GT)");
3087  (fIntFlowCovariances->GetXaxis())->SetBinLabel(4,"Cov(#LT4#GT,#LT6#GT)");
3088  (fIntFlowCovariances->GetXaxis())->SetBinLabel(5,"Cov(#LT4#GT,#LT8#GT)");
3089  (fIntFlowCovariances->GetXaxis())->SetBinLabel(6,"Cov(#LT6#GT,#LT8#GT)");
3091  // sum of linear and quadratic event weights for <2>, <4>, <6> and <8>:
3092  TString intFlowSumOfEventWeightsName = "fIntFlowSumOfEventWeights";
3093  intFlowSumOfEventWeightsName += fAnalysisLabel->Data();
3094  for(Int_t power=0;power<2;power++)
3095  {
3096  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);
3097  fIntFlowSumOfEventWeights[power]->SetLabelSize(0.04);
3098  fIntFlowSumOfEventWeights[power]->SetMarkerStyle(25);
3099  if(power == 0)
3100  {
3101  (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{#LT2#GT}");
3102  (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{#LT4#GT}");
3103  (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{#LT6#GT}");
3104  (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{#LT8#GT}");
3105  } else if (power == 1)
3106  {
3107  (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{#LT2#GT}^{2}");
3108  (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{#LT4#GT}^{2}");
3109  (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{#LT6#GT}^{2}");
3110  (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{#LT8#GT}^{2}");
3111  }
3113  }
3114  // sum of products of event weights for correlations <2>, <4>, <6> and <8>:
3115  TString intFlowSumOfProductOfEventWeightsName = "fIntFlowSumOfProductOfEventWeights";
3116  intFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
3117  fIntFlowSumOfProductOfEventWeights = new TH1D(intFlowSumOfProductOfEventWeightsName.Data(),"Sum of product of event weights for correlations",6,0,6);
3118  fIntFlowSumOfProductOfEventWeights->SetLabelSize(0.04);
3119  fIntFlowSumOfProductOfEventWeights->SetMarkerStyle(25);
3120  (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{#LT2#GT} w_{#LT4#GT}");
3121  (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{#LT2#GT} w_{#LT6#GT}");
3122  (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{#LT2#GT} w_{#LT8#GT}");
3123  (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{#LT4#GT} w_{#LT6#GT}");
3124  (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(5,"#sum_{i=1}^{N} w_{#LT4#GT} w_{#LT8#GT}");
3125  (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(6,"#sum_{i=1}^{N} w_{#LT6#GT} w_{#LT8#GT}");
3127  // final result for covariances of correlations (multiplied with weight dependent prefactor) versus M
3128  // [0=Cov(2,4),1=Cov(2,6),2=Cov(2,8),3=Cov(4,6),4=Cov(4,8),5=Cov(6,8)]:
3130  {
3131  TString intFlowCovariancesVsMName = "fIntFlowCovariancesVsM";
3132  intFlowCovariancesVsMName += fAnalysisLabel->Data();
3133  TString covarianceFlag[6] = {"Cov(<2>,<4>)","Cov(<2>,<6>)","Cov(<2>,<8>)","Cov(<4>,<6>)","Cov(<4>,<8>)","Cov(<6>,<8>)"};
3134  for(Int_t ci=0;ci<6;ci++)
3135  {
3136  fIntFlowCovariancesVsM[ci] = new TH1D(Form("%s, %s",intFlowCovariancesVsMName.Data(),covarianceFlag[ci].Data()),
3137  Form("%s vs multiplicity",covarianceFlag[ci].Data()),
3139  fIntFlowCovariancesVsM[ci]->GetYaxis()->SetTitle(covarianceFlag[ci].Data());
3141  {
3142  fIntFlowCovariancesVsM[ci]->GetXaxis()->SetTitle("# RPs");
3144  {
3145  fIntFlowCovariancesVsM[ci]->GetXaxis()->SetTitle("Reference multiplicity (from ESD)");
3147  {
3148  fIntFlowCovariancesVsM[ci]->GetXaxis()->SetTitle("# POIs");
3149  }
3151  }
3152  } // end of if(fCalculateCumulantsVsM)
3153  // sum of linear and quadratic event weights for <2>, <4>, <6> and <8> versus multiplicity
3154  // [0=sum{w_{<2>}},1=sum{w_{<4>}},2=sum{w_{<6>}},3=sum{w_{<8>}}][0=linear 1,1=quadratic]:
3156  {
3157  TString intFlowSumOfEventWeightsVsMName = "fIntFlowSumOfEventWeightsVsM";
3158  intFlowSumOfEventWeightsVsMName += fAnalysisLabel->Data();
3159  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>}"},
3160  {"#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}"}};
3161  for(Int_t si=0;si<4;si++)
3162  {
3163  for(Int_t power=0;power<2;power++)
3164  {
3165  fIntFlowSumOfEventWeightsVsM[si][power] = new TH1D(Form("%s, %s",intFlowSumOfEventWeightsVsMName.Data(),sumFlag[power][si].Data()),
3166  Form("%s vs multiplicity",sumFlag[power][si].Data()),
3168  fIntFlowSumOfEventWeightsVsM[si][power]->GetYaxis()->SetTitle(sumFlag[power][si].Data());
3170  {
3171  fIntFlowSumOfEventWeightsVsM[si][power]->GetXaxis()->SetTitle("# RPs");
3173  {
3174  fIntFlowSumOfEventWeightsVsM[si][power]->GetXaxis()->SetTitle("Reference multiplicity (from ESD)");
3176  {
3177  fIntFlowSumOfEventWeightsVsM[si][power]->GetXaxis()->SetTitle("# POIs");
3178  }
3180  } // end of for(Int_t power=0;power<2;power++)
3181  } // end of for(Int_t si=0;si<4;si++)
3182  } // end of if(fCalculateCumulantsVsM)
3183  // sum of products of event weights for correlations <2>, <4>, <6> and <8> vs M
3184  // [0=sum{w_{<2>}w_{<4>}},1=sum{w_{<2>}w_{<6>}},2=sum{w_{<2>}w_{<8>}},
3185  // 3=sum{w_{<4>}w_{<6>}},4=sum{w_{<4>}w_{<8>}},5=sum{w_{<6>}w_{<8>}}]:
3187  {
3188  TString intFlowSumOfProductOfEventWeightsVsMName = "fIntFlowSumOfProductOfEventWeightsVsM";
3189  intFlowSumOfProductOfEventWeightsVsMName += fAnalysisLabel->Data();
3190  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>}",
3191  "#sum_{i=1}^{N} w_{<4>} w_{<6>}","#sum_{i=1}^{N} w_{<4>} w_{<8>}","#sum_{i=1}^{N} w_{<6>} w_{<8>}"};
3192  for(Int_t pi=0;pi<6;pi++)
3193  {
3194  fIntFlowSumOfProductOfEventWeightsVsM[pi] = new TH1D(Form("%s, %s",intFlowSumOfProductOfEventWeightsVsMName.Data(),sopowFlag[pi].Data()),
3195  Form("%s versus multiplicity",sopowFlag[pi].Data()),
3198  {
3199  fIntFlowSumOfProductOfEventWeightsVsM[pi]->GetXaxis()->SetTitle("# RPs");
3201  {
3202  fIntFlowSumOfProductOfEventWeightsVsM[pi]->GetXaxis()->SetTitle("Reference multiplicity (from ESD)");
3204  {
3205  fIntFlowSumOfProductOfEventWeightsVsM[pi]->GetXaxis()->SetTitle("# POIs");
3206  }
3207  fIntFlowSumOfProductOfEventWeightsVsM[pi]->GetYaxis()->SetTitle(sopowFlag[pi].Data());
3209  } // end of for(Int_t pi=0;pi<6;pi++)
3210  } // end of if(fCalculateCumulantsVsM)
3211  // covariances of NUA terms (multiplied with weight dependent prefactor):
3212  TString intFlowCovariancesNUAName = "fIntFlowCovariancesNUA";
3213  intFlowCovariancesNUAName += fAnalysisLabel->Data();
3214  fIntFlowCovariancesNUA = new TH1D(intFlowCovariancesNUAName.Data(),"Covariances for NUA (multiplied with weight dependent prefactor)",27,0,27);
3215  fIntFlowCovariancesNUA->SetLabelSize(0.04);
3216  fIntFlowCovariancesNUA->SetMarkerStyle(25);
3217  fIntFlowCovariancesNUA->GetXaxis()->SetLabelSize(0.02);
3218  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(1,"Cov(<2>,<cos(#phi)>");
3219  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(2,"Cov(<2>,<sin(#phi)>)");
3220  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(3,"Cov(<cos(#phi)>,<sin(#phi)>)");
3221  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(4,"Cov(<2>,<cos(#phi_{1}+#phi_{2})>)");
3222  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(5,"Cov(<2>,<sin(#phi_{1}+#phi_{2})>)");
3223  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(6,"Cov(<2>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
3224  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(7,"Cov(<2>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
3225  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(8,"Cov(<4>,<cos(#phi)>)");
3226  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(9,"Cov(<4>,<sin(#phi)>)");
3227  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(10,"Cov(<4>,<cos(#phi_{1}+#phi_{2})>)");
3228  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(11,"Cov(<4>,<sin(#phi_{1}+#phi_{2})>)");
3229  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(12,"Cov(<4>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>>)");
3230  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(13,"Cov(<4>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>>)");
3231  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(14,"Cov(<cos(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
3232  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(15,"Cov(<cos(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
3233  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(16,"Cov(<cos(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
3234  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(17,"Cov(<cos(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
3235  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(18,"Cov(<sin(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
3236  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(19,"Cov(<sin(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
3237  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(20,"Cov(<sin(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
3238  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(21,"Cov(<sin(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
3239  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(22,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}+#phi_{2})>)");
3240  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(23,"Cov(<cos(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
3241  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(24,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
3242  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(25,"Cov(<sin(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
3243  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(26,"Cov(<sin(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
3244  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(27,"Cov(<cos(#phi_{1}-#phi_{2}-#phi_{3}>,<sin(#phi_{1}-#phi_{2}-#phi_{3}>)");
3246  // sum of linear and quadratic event weights for NUA terms:
3247  TString intFlowSumOfEventWeightsNUAName = "fIntFlowSumOfEventWeightsNUA";
3248  intFlowSumOfEventWeightsNUAName += fAnalysisLabel->Data();
3249  for(Int_t sc=0;sc<2;sc++)
3250  {
3251  for(Int_t power=0;power<2;power++)
3252  {
3253  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
3254  fIntFlowSumOfEventWeightsNUA[sc][power]->SetLabelSize(0.05);
3255  fIntFlowSumOfEventWeightsNUA[sc][power]->SetMarkerStyle(25);
3256  if(power == 0)
3257  {
3258  (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(1,Form("#sum_{i=1}^{N} w_{<%s(#phi)>}",sinCosFlag[sc].Data()));
3259  (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(2,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}+#phi_{2})>}",sinCosFlag[sc].Data()));
3260  (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(3,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}-#phi_{2}-#phi_{3})>}",sinCosFlag[sc].Data()));
3261  (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(4,Form("#sum_{i=1}^{N} w_{<%s(2#phi_{1}-#phi_{2})>}",sinCosFlag[sc].Data()));
3262  } else if(power == 1)
3263  {
3264  (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(1,Form("#sum_{i=1}^{N} w_{<%s(#phi)>}^{2}",sinCosFlag[sc].Data()));
3265  (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(2,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}+#phi_{2})>}^{2}",sinCosFlag[sc].Data()));
3266  (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(3,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}-#phi_{2}-#phi_{3})>}^{2}",sinCosFlag[sc].Data()));
3267  (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(4,Form("#sum_{i=1}^{N} w_{<%s(2#phi_{1}-#phi_{2})>}^{2}",sinCosFlag[sc].Data()));
3268  }
3270  }
3271  }
3272  // sum of products of event weights for NUA terms:
3273  TString intFlowSumOfProductOfEventWeightsNUAName = "fIntFlowSumOfProductOfEventWeightsNUA";
3274  intFlowSumOfProductOfEventWeightsNUAName += fAnalysisLabel->Data();
3275  fIntFlowSumOfProductOfEventWeightsNUA = new TH1D(intFlowSumOfProductOfEventWeightsNUAName.Data(),"Sum of product of event weights for NUA terms",27,0,27);
3276  fIntFlowSumOfProductOfEventWeightsNUA->SetLabelSize(0.02);
3277  fIntFlowSumOfProductOfEventWeightsNUA->SetMarkerStyle(25);
3278  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{#LT2#GT} w_{#LTcos(#phi)#GT}");
3279  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{#LT2#GT} w_{#LTsin(#phi)#GT}");
3280  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{#LTcos(#phi)#GT} w_{#LTsin(#phi)#GT}");
3281  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{#LT2#GT} w_{#LTcos(#phi_{1}+#phi_{2})#GT}");
3282  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(5,"#sum_{i=1}^{N} w_{#LT2#GT} w_{#LTsin(#phi_{1}+#phi_{2})#GT}");
3283  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(6,"#sum_{i=1}^{N} w_{#LT2#GT} w_{#LTcos(#phi_{1}-#phi_{2}-#phi_{3})#GT}");
3284  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(7,"#sum_{i=1}^{N} w_{#LT2#GT} w_{#LTsin(#phi_{1}-#phi_{2}-#phi_{3})#GT}");
3285  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(8,"#sum_{i=1}^{N} w_{#LT4#GT} w_{#LTcos(#phi)#GT}");
3286  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(9,"#sum_{i=1}^{N} w_{#LT4#GT} w_{#LTsin(#phi)#GT}");
3287  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(10,"#sum_{i=1}^{N} w_{#LT4#GT} w_{#LTcos(#phi_{1}+#phi_{2})#GT}");
3288  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(11,"#sum_{i=1}^{N} w_{#LT4#GT} w_{#LTsin(#phi_{1}+#phi_{2})#GT}");
3289  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(12,"#sum_{i=1}^{N} w_{#LT4#GT} w_{#LTcos(#phi_{1}-#phi_{2}-#phi_{3})#GT}");
3290  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(13,"#sum_{i=1}^{N} w_{#LT4#GT} w_{#LTsin(#phi_{1}-#phi_{2}-#phi_{3})#GT}");
3291  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(14,"#sum_{i=1}^{N} w_{#LTcos(#phi)#GT} w_{#LTcos(#phi_{1}+#phi_{2})#GT}");
3292  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(15,"#sum_{i=1}^{N} w_{#LTcos(#phi)#GT} w_{#LTsin(#phi_{1}+#phi_{2})#GT}");
3293  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(16,"#sum_{i=1}^{N} w_{#LTcos(#phi)#GT} w_{#LTcos(#phi_{1}-#phi_{2}-#phi_{3})#GT}");
3294  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(17,"#sum_{i=1}^{N} w_{#LTcos(#phi)#GT} w_{#LTsin(#phi_{1}-#phi_{2}-#phi_{3})#GT}");
3295  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(18,"#sum_{i=1}^{N} w_{#LTsin(#phi)#GT} w_{#LTcos(#phi_{1}+#phi_{2})#GT}");
3296  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(19,"#sum_{i=1}^{N} w_{#LTsin(#phi)#GT} w_{#LTsin(#phi_{1}+#phi_{2})#GT}");
3297  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(20,"#sum_{i=1}^{N} w_{#LTsin(#phi)#GT} w_{#LTcos(#phi_{1}-#phi_{2}-#phi_{3})#GT}");
3298  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(21,"#sum_{i=1}^{N} w_{#LTsin(#phi)#GT} w_{#LTsin(#phi_{1}-#phi_{2}-#phi_{3})#GT}");
3299  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(22,"#sum_{i=1}^{N} w_{#LTcos(#phi_{1}+#phi_{2})#GT} w_{#LTsin(#phi_{1}+#phi_{2})#GT}");
3300  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(23,"#sum_{i=1}^{N} w_{#LTcos(#phi_{1}+#phi_{2})#GT} w_{#LTcos(#phi_{1}-#phi_{2}-#phi_{3})#GT}");
3301  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(24,"#sum_{i=1}^{N} w_{#LTcos(#phi_{1}+#phi_{2})#GT} w_{#LTsin(#phi_{1}-#phi_{2}-#phi_{3})#GT}");
3302  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(25,"#sum_{i=1}^{N} w_{#LTsin(#phi_{1}+#phi_{2})#GT} w_{#LTcos(#phi_{1}-#phi_{2}-#phi_{3})#GT}");
3303  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(26,"#sum_{i=1}^{N} w_{#LTsin(#phi_{1}+#phi_{2})#GT} w_{#LTsin(#phi_{1}-#phi_{2}-#phi_{3})#GT}");
3304  (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}");
3306  // Final results for reference Q-cumulants:
3307  TString cumulantFlag[4] = {"QC{2}","QC{4}","QC{6}","QC{8}"};
3308  TString intFlowQcumulantsName = "fIntFlowQcumulants";
3309  intFlowQcumulantsName += fAnalysisLabel->Data();
3310  fIntFlowQcumulants = new TH1D(intFlowQcumulantsName.Data(),"Reference Q-cumulants",4,0,4);
3312  {
3313  fIntFlowQcumulants->SetTitle("Reference Q-cumulants (error from non-isotropic terms also propagated)");
3314  }
3315  fIntFlowQcumulants->SetLabelSize(0.05);
3316  fIntFlowQcumulants->SetMarkerStyle(25);
3317  for(Int_t b=0;b<4;b++)
3318  {
3319  (fIntFlowQcumulants->GetXaxis())->SetBinLabel(b+1,cumulantFlag[b].Data());
3320  }
3322  // Final results for reference Q-cumulants rebinned in M:
3324  {
3325  TString intFlowQcumulantsRebinnedInMName = "fIntFlowQcumulantsRebinnedInM";
3326  intFlowQcumulantsRebinnedInMName += fAnalysisLabel->Data();
3327  fIntFlowQcumulantsRebinnedInM = new TH1D(intFlowQcumulantsRebinnedInMName.Data(),"Reference Q-cumulants rebinned in M",4,0,4);
3328  fIntFlowQcumulantsRebinnedInM->SetLabelSize(0.05);
3329  fIntFlowQcumulantsRebinnedInM->SetMarkerStyle(25);
3330  for(Int_t b=0;b<4;b++)
3331  {
3332  (fIntFlowQcumulantsRebinnedInM->GetXaxis())->SetBinLabel(b+1,cumulantFlag[b].Data());
3333  }
3335  } // end of if(fCalculateCumulantsVsM)
3336  // Ratio between error squared: with/without non-isotropic terms:
3337  TString intFlowQcumulantsErrorSquaredRatioName = "fIntFlowQcumulantsErrorSquaredRatio";
3338  intFlowQcumulantsErrorSquaredRatioName += fAnalysisLabel->Data();
3339  fIntFlowQcumulantsErrorSquaredRatio = new TH1D(intFlowQcumulantsErrorSquaredRatioName.Data(),"Error squared of reference Q-cumulants: #frac{with NUA terms}{without NUA terms}",4,0,4);
3340  fIntFlowQcumulantsErrorSquaredRatio->SetLabelSize(0.05);
3341  fIntFlowQcumulantsErrorSquaredRatio->SetMarkerStyle(25);
3342  for(Int_t b=0;b<4;b++)
3343  {
3344  (fIntFlowQcumulantsErrorSquaredRatio->GetXaxis())->SetBinLabel(b+1,cumulantFlag[b].Data());
3345  }
3347  // final results for integrated Q-cumulants versus multiplicity:
3349  {
3350  TString intFlowQcumulantsVsMName = "fIntFlowQcumulantsVsM";
3351  intFlowQcumulantsVsMName += fAnalysisLabel->Data();
3352  for(Int_t co=0;co<4;co++) // cumulant order
3353  {
3354  fIntFlowQcumulantsVsM[co] = new TH1D(Form("%s, %s",intFlowQcumulantsVsMName.Data(),cumulantFlag[co].Data()),
3355  Form("%s vs multiplicity",cumulantFlag[co].Data()),
3358  {
3359  fIntFlowQcumulantsVsM[co]->GetXaxis()->SetTitle("# RPs");
3361  {
3362  fIntFlowQcumulantsVsM[co]->GetXaxis()->SetTitle("Reference multiplicity (from ESD)");
3364  {
3365  fIntFlowQcumulantsVsM[co]->GetXaxis()->SetTitle("# POIs");
3366  }
3367  fIntFlowQcumulantsVsM[co]->GetYaxis()->SetTitle(cumulantFlag[co].Data());
3369  } // end of for(Int_t co=0;co<4;co++) // cumulant order
3370  } // end of if(fCalculateCumulantsVsM)
3371  // final integrated flow estimates from Q-cumulants:
3372  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)};
3373  TString intFlowName = "fIntFlow";
3374  intFlowName += fAnalysisLabel->Data();
3375  // integrated flow from Q-cumulants:
3376  fIntFlow = new TH1D(intFlowName.Data(),"Reference flow estimates from Q-cumulants",4,0,4);
3377  fIntFlow->SetLabelSize(0.05);
3378  fIntFlow->SetMarkerStyle(25);
3379  for(Int_t b=0;b<4;b++)
3380  {
3381  (fIntFlow->GetXaxis())->SetBinLabel(b+1,flowFlag[b].Data());
3382  }
3383  fIntFlowResults->Add(fIntFlow);
3384  // Reference flow vs M rebinned in one huge bin:
3386  {
3387  TString intFlowRebinnedInMName = "fIntFlowRebinnedInM";
3388  intFlowRebinnedInMName += fAnalysisLabel->Data();
3389  fIntFlowRebinnedInM = new TH1D(intFlowRebinnedInMName.Data(),"Reference flow estimates from Q-cumulants (rebinned in M)",4,0,4);
3390  fIntFlowRebinnedInM->SetLabelSize(0.05);
3391  fIntFlowRebinnedInM->SetMarkerStyle(25);
3392  for(Int_t b=0;b<4;b++)
3393  {
3394  (fIntFlowRebinnedInM->GetXaxis())->SetBinLabel(b+1,flowFlag[b].Data());
3395  }
3397  }
3398  // integrated flow from Q-cumulants: versus multiplicity:
3400  {
3401  TString intFlowVsMName = "fIntFlowVsM";
3402  intFlowVsMName += fAnalysisLabel->Data();
3403  for(Int_t co=0;co<4;co++) // cumulant order
3404  {
3405  fIntFlowVsM[co] = new TH1D(Form("%s, %s",intFlowVsMName.Data(),flowFlag[co].Data()),
3406  Form("%s vs multiplicity",flowFlag[co].Data()),
3409  {
3410  fIntFlowVsM[co]->GetXaxis()->SetTitle("# RPs");
3412  {
3413  fIntFlowVsM[co]->GetXaxis()->SetTitle("Reference multiplicity (from ESD)");
3415  {
3416  fIntFlowVsM[co]->GetXaxis()->SetTitle("# POIs");
3417  }
3418  fIntFlowVsM[co]->GetYaxis()->SetTitle(flowFlag[co].Data());
3419  fIntFlowResults->Add(fIntFlowVsM[co]);
3420  } // end of for(Int_t co=0;co<4;co++) // cumulant order
3421  } // end of if(fCalculateCumulantsVsM)
3422  // quantifying detector effects effects to correlations:
3423  TString intFlowDetectorBiasName = "fIntFlowDetectorBias";
3424  intFlowDetectorBiasName += fAnalysisLabel->Data();
3425  fIntFlowDetectorBias = new TH1D(intFlowDetectorBiasName.Data(),"Quantifying detector bias",4,0,4);
3426  fIntFlowDetectorBias->SetLabelSize(0.05);
3427  fIntFlowDetectorBias->SetMarkerStyle(25);
3428  for(Int_t ci=0;ci<4;ci++)
3429  {
3430  (fIntFlowDetectorBias->GetXaxis())->SetBinLabel(ci+1,Form("#frac{corrected}{measured} %s",cumulantFlag[ci].Data()));
3431  }
3433  // quantifying detector effects to correlations versus multiplicity:
3435  {
3436  TString intFlowDetectorBiasVsMName = "fIntFlowDetectorBiasVsM";
3437  intFlowDetectorBiasVsMName += fAnalysisLabel->Data();
3438  for(Int_t ci=0;ci<4;ci++) // correlation index
3439  {
3440  fIntFlowDetectorBiasVsM[ci] = new TH1D(Form("%s for %s",intFlowDetectorBiasVsMName.Data(),cumulantFlag[ci].Data()),
3441  Form("Quantifying detector bias for %s vs multiplicity",cumulantFlag[ci].Data()),
3444  {
3445  fIntFlowDetectorBiasVsM[ci]->GetXaxis()->SetTitle("# RPs");
3447  {
3448  fIntFlowDetectorBiasVsM[ci]->GetXaxis()->SetTitle("Reference multiplicity (from ESD)");
3450  {
3451  fIntFlowDetectorBiasVsM[ci]->GetXaxis()->SetTitle("# POIs");
3452  }
3453  fIntFlowDetectorBiasVsM[ci]->GetYaxis()->SetTitle("#frac{corrected}{measured}");
3455  } // end of for(Int_t co=0;co<4;co++) // cumulant order
3456  } // end of if(fCalculateCumulantsVsM)
3457 
3458 } // end of AliFlowAnalysisCRC::BookEverythingForIntegratedFlow()
3459 
3460 //=======================================================================================================================
3461 
3463 {
3464  // Book all objects for control histograms.
3465 
3466  // a) Book profile to hold all flags for control histograms;
3467  // b) Book all control histograms.
3468 
3469  // a) Book profile to hold all flags for control histograms:
3470  TString controlHistogramsFlagsName = "fControlHistogramsFlags";
3471  controlHistogramsFlagsName += fAnalysisLabel->Data();
3472  fControlHistogramsFlags = new TProfile(controlHistogramsFlagsName.Data(),"Flags for Control Histograms",2,0,2);
3473  fControlHistogramsFlags->SetTickLength(-0.01,"Y");
3474  fControlHistogramsFlags->SetMarkerStyle(25);
3475  fControlHistogramsFlags->SetLabelSize(0.04);
3476  fControlHistogramsFlags->SetLabelOffset(0.02,"Y");
3477  fControlHistogramsFlags->SetStats(kFALSE);
3478  fControlHistogramsFlags->GetXaxis()->SetBinLabel(1,"fStoreControlHistograms");
3479  fControlHistogramsFlags->GetXaxis()->SetBinLabel(2,"fUseQvectorTerms");
3481 
3482  if(!fStoreControlHistograms){return;}
3483 
3484  // b) Book all control histograms:
3485  // b1) Correlation between # RPs and ref. mult. determined centrally:
3486  TString sCorrelationNoRPsVsRefMultName = "fCorrelationNoRPsVsRefMult";
3487  sCorrelationNoRPsVsRefMultName += fAnalysisLabel->Data();
3488  fCorrelationNoRPsVsRefMult = new TH2D(sCorrelationNoRPsVsRefMultName.Data(),"# RPs vs. Reference Multiplicity",fnBinsMult,fMinMult,fMaxMult,fnBinsMult,fMinMult,fMaxMult);
3489  fCorrelationNoRPsVsRefMult->SetTickLength(-0.01,"Y");
3490  fCorrelationNoRPsVsRefMult->SetLabelSize(0.04);
3491  fCorrelationNoRPsVsRefMult->SetLabelOffset(0.02,"Y");
3492  fCorrelationNoRPsVsRefMult->SetStats(kTRUE);
3493  fCorrelationNoRPsVsRefMult->GetXaxis()->SetTitle("# RPs");
3494  fCorrelationNoRPsVsRefMult->GetYaxis()->SetTitle("Reference Multiplicity");
3496  // b2) Correlation between # POIs and ref. mult. determined centrally:
3497  TString sCorrelationNoPOIsVsRefMultName = "fCorrelationNoPOIsVsRefMult";
3498  sCorrelationNoPOIsVsRefMultName += fAnalysisLabel->Data();
3499  fCorrelationNoPOIsVsRefMult = new TH2D(sCorrelationNoPOIsVsRefMultName.Data(),"# POIs vs. Reference Multiplicity",fnBinsMult,fMinMult,fMaxMult,fnBinsMult,fMinMult,fMaxMult);
3500  fCorrelationNoPOIsVsRefMult->SetTickLength(-0.01,"Y");
3501  fCorrelationNoPOIsVsRefMult->SetLabelSize(0.04);
3502  fCorrelationNoPOIsVsRefMult->SetLabelOffset(0.02,"Y");
3503  fCorrelationNoPOIsVsRefMult->SetStats(kTRUE);
3504  fCorrelationNoPOIsVsRefMult->GetXaxis()->SetTitle("# POIs");
3505  fCorrelationNoPOIsVsRefMult->GetYaxis()->SetTitle("Reference Multiplicity");
3507  // b3) Correlation between # RPs and # POIs:
3508  TString sCorrelationNoRPsVsNoPOIsName = "fCorrelationNoRPsVsNoPOIs";
3509  sCorrelationNoRPsVsNoPOIsName += fAnalysisLabel->Data();
3510  fCorrelationNoRPsVsNoPOIs = new TH2D(sCorrelationNoRPsVsNoPOIsName.Data(),"# RPs vs. # POIs",fnBinsMult,fMinMult,fMaxMult,fnBinsMult,fMinMult,fMaxMult);
3511  fCorrelationNoRPsVsNoPOIs->SetTickLength(-0.01,"Y");
3512  fCorrelationNoRPsVsNoPOIs->SetLabelSize(0.04);
3513  fCorrelationNoRPsVsNoPOIs->SetLabelOffset(0.02,"Y");
3514  fCorrelationNoRPsVsNoPOIs->SetStats(kTRUE);
3515  fCorrelationNoRPsVsNoPOIs->GetXaxis()->SetTitle("# RPs");
3516  fCorrelationNoRPsVsNoPOIs->GetYaxis()->SetTitle("# POIs");
3518  // b4) <2>, <4>, <6> and <8> vs multiplicity (#RPs, #POIs or external):
3519  TString sCorrelation[4] = {"#LT2#GT","#LT4#GT","#LT6#GT","#LT8#GT"};
3520  TString sMultiplicity = "";
3522  {
3523  sMultiplicity = "# RPs";
3525  {
3526  sMultiplicity = "Reference multiplicity (from ESD)";
3528  {
3529  sMultiplicity = "# POIs";
3530  }
3531  for(Int_t ci=0;ci<4;ci++)
3532  {
3533  fCorrelation2468VsMult[ci] = new TH2D(Form("%s vs M",sCorrelation[ci].Data()),Form("%s vs M",sCorrelation[ci].Data()),fnBinsMult,fMinMult,fMaxMult,fnBinsForCorrelations,fMinValueOfCorrelation[ci],fMaxValueOfCorrelation[ci]);
3534  fCorrelation2468VsMult[ci]->SetTickLength(-0.01,"Y");
3535  fCorrelation2468VsMult[ci]->SetLabelSize(0.04);
3536  fCorrelation2468VsMult[ci]->SetLabelOffset(0.02,"Y");
3537  fCorrelation2468VsMult[ci]->SetStats(kTRUE);
3538  fCorrelation2468VsMult[ci]->GetXaxis()->SetTitle(sMultiplicity.Data());
3539  fCorrelation2468VsMult[ci]->GetYaxis()->SetTitle(sCorrelation[ci].Data());
3541  } // end of for(Int_t ci=0;ci<4;ci++)
3542  // b5) <2><4>, <2><6>, <2><8>, <4><6> etc. vs multiplicity (#RPs, #POIs or external):
3543  TString sCorrelationProduct[1] = {"#LT2#GT#LT4#GT"}; // TBI: add the other ones when needed first time
3544  for(Int_t cpi=0;cpi<1;cpi++) // TBI: hardwired 1
3545  {
3546  fCorrelationProduct2468VsMult[cpi] = new TH2D(Form("%s vs M",sCorrelationProduct[cpi].Data()),Form("%s vs M",sCorrelationProduct[cpi].Data()),fnBinsMult,fMinMult,fMaxMult,fnBinsForCorrelations,fMinValueOfCorrelationProduct[cpi],fMaxValueOfCorrelationProduct[cpi]);
3547  fCorrelationProduct2468VsMult[cpi]->SetTickLength(-0.01,"Y");
3548  fCorrelationProduct2468VsMult[cpi]->SetLabelSize(0.04);
3549  fCorrelationProduct2468VsMult[cpi]->SetLabelOffset(0.02,"Y");
3550  fCorrelationProduct2468VsMult[cpi]->SetStats(kTRUE);
3551  fCorrelationProduct2468VsMult[cpi]->GetXaxis()->SetTitle(sMultiplicity.Data());
3552  fCorrelationProduct2468VsMult[cpi]->GetYaxis()->SetTitle(sCorrelationProduct[cpi].Data());
3554  } // end of for(Int_t cpi=0;cpi<4;cpi++)
3555  // b6) |Qn|^2/M, |Q2n|^2/M, |Qn|^4/(M(2M-1)), Re[Q2nQn^*Qn^*]/M, ... vs multiplicity (#RPs, #POIs or external)
3556  if(fUseQvectorTerms)
3557  {
3558  TString sQvectorTerms[4] = {"#frac{|Q_{n}|^{2}}{M}","#frac{|Q_{2n}|^{2}}{M}","#frac{|Q_{n}|^{4}}{M(2M-1)}","#frac{Re[Q_{2n}Q_{n}^{*}Q_{n}^{*}]}{M^{3/2}}"}; // TBI: add the other ones when needed first time
3559  for(Int_t qvti=0;qvti<4;qvti++) // TBI: hardwired 4
3560  {
3561  fQvectorTermsVsMult[qvti] = new TH2D(Form("%s vs M",sQvectorTerms[qvti].Data()),Form("%s vs M",sQvectorTerms[qvti].Data()),fnBinsMult,fMinMult,fMaxMult,fnBinsForCorrelations,fMinValueOfQvectorTerms[qvti],fMaxValueOfQvectorTerms[qvti]);
3562  fQvectorTermsVsMult[qvti]->SetTickLength(-0.01,"Y");
3563  fQvectorTermsVsMult[qvti]->SetLabelSize(0.04);
3564  fQvectorTermsVsMult[qvti]->SetLabelOffset(0.02,"Y");
3565  fQvectorTermsVsMult[qvti]->SetStats(kTRUE);
3566  fQvectorTermsVsMult[qvti]->GetXaxis()->SetTitle(sMultiplicity.Data());
3567  fQvectorTermsVsMult[qvti]->GetYaxis()->SetTitle(sQvectorTerms[qvti].Data());
3569  } // end of for(Int_t qvti=0;qvti<4;qvti++)
3570  } // end of if(fUseQvectorTerms)
3571 
3572 } // end of void AliFlowAnalysisCRC::BookEverythingForControlHistograms()
3573 
3574 //=======================================================================================================================
3575 
3577 {
3578  // Book all objects needed for bootstrap.
3579 
3580  // a) Book profile to hold all flags for bootstrap;
3581  // b) Book local random generator;
3582  // c) Book all bootstrap objects;
3583  // d) Book all bootstrap objects 'vs M'.
3584 
3585  // a) Book profile to hold all flags for bootstrap;
3586  TString bootstrapFlagsName = "fBootstrapFlags";
3587  bootstrapFlagsName += fAnalysisLabel->Data();
3588  fBootstrapFlags = new TProfile(bootstrapFlagsName.Data(),"Flags for bootstrap",3,0,3);
3589  fBootstrapFlags->SetTickLength(-0.01,"Y");
3590  fBootstrapFlags->SetMarkerStyle(25);
3591  fBootstrapFlags->SetLabelSize(0.04);
3592  fBootstrapFlags->SetLabelOffset(0.02,"Y");
3593  fBootstrapFlags->SetStats(kFALSE);
3594  fBootstrapFlags->GetXaxis()->SetBinLabel(1,"fUseBootstrap");
3595  fBootstrapFlags->GetXaxis()->SetBinLabel(2,"fUseBootstrapVsM");
3596  fBootstrapFlags->GetXaxis()->SetBinLabel(3,"fnSubsamples");
3598 
3599  // c) Book all bootstrap objects:
3600  TString correlationFlag[4] = {"#LT#LT2#GT#GT","#LT#LT4#GT#GT","#LT#LT6#GT#GT","#LT#LT8#GT#GT"};
3601  TString cumulantFlag[4] = {"QC{2}","QC{4}","QC{6}","QC{8}"};
3602  if(fUseBootstrap)
3603  {
3604  // ....
3605  TString bootstrapCorrelationsName = "fBootstrapCorrelations";
3606  bootstrapCorrelationsName += fAnalysisLabel->Data();
3607  fBootstrapCorrelations = new TProfile2D(bootstrapCorrelationsName.Data(),"Bootstrap Correlations",4,0.,4.,fnSubsamples,0,fnSubsamples); // x-axis => <2>, <4>, <6>, <8>; y-axis => subsample #
3608  fBootstrapCorrelations->SetStats(kFALSE);
3609  for(Int_t ci=0;ci<4;ci++) // correlation index
3610  {
3611  fBootstrapCorrelations->GetXaxis()->SetBinLabel(ci+1,correlationFlag[ci].Data());
3612  } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
3613  for(Int_t ss=0;ss<fnSubsamples;ss++)
3614  {
3615  fBootstrapCorrelations->GetYaxis()->SetBinLabel(ss+1,Form("#%d",ss));
3616  } // end of for(Int_t ss=0;ss<fnSubsamples;ss++)
3618  // ....
3619  TString bootstrapCumulantsName = "fBootstrapCumulants";
3620  bootstrapCumulantsName += fAnalysisLabel->Data();
3621  fBootstrapCumulants = new TH2D(bootstrapCumulantsName.Data(),"Bootstrap Cumulants",4,0.,4.,fnSubsamples,0,fnSubsamples); // x-axis => QC{2}, QC{4}, QC{6}, QC{8}; y-axis => subsample #
3622  fBootstrapCumulants->SetStats(kFALSE);
3623  for(Int_t co=0;co<4;co++) // cumulant order
3624  {
3625  fBootstrapCumulants->GetXaxis()->SetBinLabel(co+1,cumulantFlag[co].Data());
3626  } // end of for(Int_t co=0;co<4;co++) // cumulant order
3627  for(Int_t ss=0;ss<fnSubsamples;ss++)
3628  {
3629  fBootstrapCumulants->GetYaxis()->SetBinLabel(ss+1,Form("#%d",ss));
3630  } // end of for(Int_t ss=0;ss<fnSubsamples;ss++)
3632  } // end of if(fUseBootstrap)
3633 
3634  // d) Book all bootstrap objects 'vs M':
3635  TString sMultiplicity = "";
3637  {
3638  sMultiplicity = "# RPs";
3640  {
3641  sMultiplicity = "Reference multiplicity (from ESD)";
3643  {
3644  sMultiplicity = "# POIs";
3645  }
3646  if(fUseBootstrapVsM)
3647  {
3648  // ....
3649  TString bootstrapCorrelationsVsMName = "fBootstrapCorrelationsVsM";
3650  bootstrapCorrelationsVsMName += fAnalysisLabel->Data();
3651  for(Int_t ci=0;ci<4;ci++) // correlation index
3652  {
3653  fBootstrapCorrelationsVsM[ci] = new TProfile2D(Form("%s, %s",bootstrapCorrelationsVsMName.Data(),correlationFlag[ci].Data()),
3654  Form("Bootstrap Correlations Vs. M, %s",correlationFlag[ci].Data()),
3655  fnBinsMult,fMinMult,fMaxMult,fnSubsamples,0,fnSubsamples); // index => <2>, <4>, <6>, <8>; x-axis => multiplicity; y-axis => subsample #
3656  fBootstrapCorrelationsVsM[ci]->SetStats(kFALSE);
3657  fBootstrapCorrelationsVsM[ci]->GetXaxis()->SetTitle(sMultiplicity.Data());
3658  for(Int_t ss=0;ss<fnSubsamples;ss++)
3659  {
3660  fBootstrapCorrelationsVsM[ci]->GetYaxis()->SetBinLabel(ss+1,Form("#%d",ss));
3661  } // end of for(Int_t ss=0;ss<fnSubsamples;ss++)
3663  } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
3664  // ....
3665  TString bootstrapCumulantsVsMName = "fBootstrapCumulantsVsM";
3666  bootstrapCumulantsVsMName += fAnalysisLabel->Data();
3667  for(Int_t co=0;co<4;co++) // cumulant order
3668  {
3669  fBootstrapCumulantsVsM[co] = new TH2D(Form("%s, %s",bootstrapCumulantsVsMName.Data(),cumulantFlag[co].Data()),
3670  Form("Bootstrap Cumulants Vs. M, %s",cumulantFlag[co].Data()),
3671  fnBinsMult,fMinMult,fMaxMult,fnSubsamples,0,fnSubsamples); // index => <2>, <4>, <6>, <8>; x-axis => multiplicity; y-axis => subsample #
3672  fBootstrapCumulantsVsM[co]->SetStats(kFALSE);
3673  fBootstrapCumulantsVsM[co]->GetXaxis()->SetTitle(sMultiplicity.Data());
3674  for(Int_t ss=0;ss<fnSubsamples;ss++)
3675  {
3676  fBootstrapCumulantsVsM[co]->GetYaxis()->SetBinLabel(ss+1,Form("#%d",ss));
3677  } // end of for(Int_t ss=0;ss<fnSubsamples;ss++)
3679  } // end of for(Int_t co=0;co<4;co++) // correlation index
3680  } // end of if(fUseBootstrapVsM)
3681 
3682 } // end of void AliFlowAnalysisCRC::BookEverythingForBootstrap()
3683 
3684 //=======================================================================================================================
3685 
3687 {
3688  // Book all objects for mixed harmonics.
3689 
3690  // a) Book profile to hold all flags for mixed harmonics;
3691  // b) Book all objects in TList fMixedHarmonicsProfiles;
3692  // c) Book all objects in TList fMixedHarmonicsResults;
3693  // d) Book all objects in TList fMixedHarmonicsErrorPropagation.
3694 
3695  // a) Book profile to hold all flags for mixed harmonics:
3696  TString mixedHarmonicsFlagsName = "fMixedHarmonicsFlags";
3697  mixedHarmonicsFlagsName += fAnalysisLabel->Data();
3698  fMixedHarmonicsFlags = new TProfile(mixedHarmonicsFlagsName.Data(),"Flags for Mixed Harmonics",4,0,4);
3699  fMixedHarmonicsFlags->SetTickLength(-0.01,"Y");
3700  fMixedHarmonicsFlags->SetMarkerStyle(25);
3701  fMixedHarmonicsFlags->SetLabelSize(0.04);
3702  fMixedHarmonicsFlags->SetLabelOffset(0.02,"Y");
3703  fMixedHarmonicsFlags->SetStats(kFALSE);
3704  fMixedHarmonicsFlags->GetXaxis()->SetBinLabel(1,"Calculate Mixed Harmonics");
3705  fMixedHarmonicsFlags->GetXaxis()->SetBinLabel(2,"Generic Harmonic");
3706  fMixedHarmonicsFlags->GetXaxis()->SetBinLabel(3,"Calculate vs Multiplicity");
3707  fMixedHarmonicsFlags->GetXaxis()->SetBinLabel(4,"Multiplicity Weight");
3709 
3710  if(!fCalculateMixedHarmonics){return;}
3711 
3712  // b) Book all objects in TList fMixedHarmonicsProfiles:
3713  // b1) 2-p correlations:
3714  TString s2pCorrelationsName = "f2pCorrelations";
3715  s2pCorrelationsName += fAnalysisLabel->Data();
3716  f2pCorrelations = new TProfile(s2pCorrelationsName.Data(),Form("2-particle correlations (n = %d)",fHarmonic),6,0,6,"s");
3717  f2pCorrelations->SetTickLength(-0.01,"Y");
3718  f2pCorrelations->SetMarkerStyle(25);
3719  f2pCorrelations->SetLabelSize(0.04);
3720  f2pCorrelations->SetLabelOffset(0.02,"Y");
3721  f2pCorrelations->SetStats(kFALSE);
3722  f2pCorrelations->Sumw2();
3723  f2pCorrelations->GetXaxis()->SetBinLabel(1,Form("#LT#LT2#GT#GT_{%dn|%dn}",1*fHarmonic,1*fHarmonic));
3724  f2pCorrelations->GetXaxis()->SetBinLabel(2,Form("#LT#LT2#GT#GT_{%dn|%dn}",2*fHarmonic,2*fHarmonic));
3725  f2pCorrelations->GetXaxis()->SetBinLabel(3,Form("#LT#LT2#GT#GT_{%dn|%dn}",3*fHarmonic,3*fHarmonic));
3726  f2pCorrelations->GetXaxis()->SetBinLabel(4,Form("#LT#LT2#GT#GT_{%dn|%dn}",4*fHarmonic,4*fHarmonic));
3727  f2pCorrelations->GetXaxis()->SetBinLabel(5,Form("#LT#LT2#GT#GT_{%dn|%dn}",5*fHarmonic,5*fHarmonic));
3728  f2pCorrelations->GetXaxis()->SetBinLabel(6,Form("#LT#LT2#GT#GT_{%dn|%dn}",6*fHarmonic,6*fHarmonic));
3730  // b2) 3-p correlations (3+6):
3731  TString s3pCorrelationsName = "f3pCorrelations";
3732  s3pCorrelationsName += fAnalysisLabel->Data();
3733  f3pCorrelations = new TProfile(s3pCorrelationsName.Data(),Form("3-particle correlations (n = %d)",fHarmonic),10,0,10,"s");
3734  f3pCorrelations->SetTickLength(-0.01,"Y");
3735  f3pCorrelations->SetMarkerStyle(25);
3736  f3pCorrelations->SetLabelSize(0.04);
3737  f3pCorrelations->SetLabelOffset(0.02,"Y");
3738  f3pCorrelations->SetStats(kFALSE);
3739  f3pCorrelations->Sumw2();
3740  // 3-p correlations sensitive to two distinct harmonics (3):
3741  f3pCorrelations->GetXaxis()->SetBinLabel(1,Form("#LT#LT3#GT#GT_{%dn|%dn,%dn}",2*fHarmonic,1*fHarmonic,1*fHarmonic));
3742  f3pCorrelations->GetXaxis()->SetBinLabel(2,Form("#LT#LT3#GT#GT_{%dn|%dn,%dn}",4*fHarmonic,2*fHarmonic,2*fHarmonic));
3743  f3pCorrelations->GetXaxis()->SetBinLabel(3,Form("#LT#LT3#GT#GT_{%dn|%dn,%dn}",6*fHarmonic,3*fHarmonic,3*fHarmonic));
3744  f3pCorrelations->GetXaxis()->SetBinLabel(4,""); // empty
3745  // 3-p correlations sensitive to three distinct harmonics (6):
3746  f3pCorrelations->GetXaxis()->SetBinLabel(5,Form("#LT#LT3#GT#GT_{%dn|%dn,%dn}",3*fHarmonic,2*fHarmonic,1*fHarmonic));
3747  f3pCorrelations->GetXaxis()->SetBinLabel(6,Form("#LT#LT3#GT#GT_{%dn|%dn,%dn}",4*fHarmonic,3*fHarmonic,1*fHarmonic));
3748  f3pCorrelations->GetXaxis()->SetBinLabel(7,Form("#LT#LT3#GT#GT_{%dn|%dn,%dn}",5*fHarmonic,3*fHarmonic,2*fHarmonic));
3749  f3pCorrelations->GetXaxis()->SetBinLabel(8,Form("#LT#LT3#GT#GT_{%dn|%dn,%dn}",5*fHarmonic,4*fHarmonic,1*fHarmonic));
3750  f3pCorrelations->GetXaxis()->SetBinLabel(9,Form("#LT#LT3#GT#GT_{%dn|%dn,%dn}",6*fHarmonic,4*fHarmonic,2*fHarmonic));
3751  f3pCorrelations->GetXaxis()->SetBinLabel(10,Form("#LT#LT3#GT#GT_{%dn|%dn,%dn}",6*fHarmonic,5*fHarmonic,1*fHarmonic));
3753  // b3) 4-p correlations (6+15+2+10+8):
3754  TString s4pCorrelationsName = "f4pCorrelations";
3755  s4pCorrelationsName += fAnalysisLabel->Data();
3756  f4pCorrelations = new TProfile(s4pCorrelationsName.Data(),Form("4-particle correlations (n = %d)",fHarmonic),45,0,45,"s");
3757  f4pCorrelations->SetTickLength(-0.01,"Y");
3758  f4pCorrelations->SetMarkerStyle(25);
3759  f4pCorrelations->SetLabelSize(0.03);
3760  f4pCorrelations->SetLabelOffset(0.02,"Y");
3761  f4pCorrelations->SetStats(kFALSE);
3762  f4pCorrelations->Sumw2();
3763  // "same harmonic" (6):
3764  f4pCorrelations->GetXaxis()->SetBinLabel(1,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",1*fHarmonic,1*fHarmonic,1*fHarmonic,1*fHarmonic));
3765  f4pCorrelations->GetXaxis()->SetBinLabel(2,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",2*fHarmonic,2*fHarmonic,2*fHarmonic,2*fHarmonic));
3766  f4pCorrelations->GetXaxis()->SetBinLabel(3,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",3*fHarmonic,3*fHarmonic,3*fHarmonic,3*fHarmonic));
3767  f4pCorrelations->GetXaxis()->SetBinLabel(4,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",4*fHarmonic,4*fHarmonic,4*fHarmonic,4*fHarmonic));
3768  f4pCorrelations->GetXaxis()->SetBinLabel(5,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",5*fHarmonic,5*fHarmonic,5*fHarmonic,5*fHarmonic));
3769  f4pCorrelations->GetXaxis()->SetBinLabel(6,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",6*fHarmonic,6*fHarmonic,6*fHarmonic,6*fHarmonic));
3770  f4pCorrelations->GetXaxis()->SetBinLabel(7,""); // empty
3771  // "standard candles" (15):
3772  f4pCorrelations->GetXaxis()->SetBinLabel(8,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",2*fHarmonic,1*fHarmonic,2*fHarmonic,1*fHarmonic));
3773  f4pCorrelations->GetXaxis()->SetBinLabel(9,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",3*fHarmonic,1*fHarmonic,3*fHarmonic,1*fHarmonic));
3774  f4pCorrelations->GetXaxis()->SetBinLabel(10,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",3*fHarmonic,2*fHarmonic,3*fHarmonic,2*fHarmonic));
3775  f4pCorrelations->GetXaxis()->SetBinLabel(11,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",4*fHarmonic,1*fHarmonic,4*fHarmonic,1*fHarmonic));
3776  f4pCorrelations->GetXaxis()->SetBinLabel(12,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",4*fHarmonic,2*fHarmonic,4*fHarmonic,2*fHarmonic));
3777  f4pCorrelations->GetXaxis()->SetBinLabel(13,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",4*fHarmonic,3*fHarmonic,4*fHarmonic,3*fHarmonic));
3778  f4pCorrelations->GetXaxis()->SetBinLabel(14,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",5*fHarmonic,1*fHarmonic,5*fHarmonic,1*fHarmonic));
3779  f4pCorrelations->GetXaxis()->SetBinLabel(15,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",5*fHarmonic,2*fHarmonic,5*fHarmonic,2*fHarmonic));
3780  f4pCorrelations->GetXaxis()->SetBinLabel(16,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",5*fHarmonic,3*fHarmonic,5*fHarmonic,3*fHarmonic));
3781  f4pCorrelations->GetXaxis()->SetBinLabel(17,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",5*fHarmonic,4*fHarmonic,5*fHarmonic,4*fHarmonic));
3782  f4pCorrelations->GetXaxis()->SetBinLabel(18,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",6*fHarmonic,1*fHarmonic,6*fHarmonic,1*fHarmonic));
3783  f4pCorrelations->GetXaxis()->SetBinLabel(19,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",6*fHarmonic,2*fHarmonic,6*fHarmonic,2*fHarmonic));
3784  f4pCorrelations->GetXaxis()->SetBinLabel(20,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",6*fHarmonic,3*fHarmonic,6*fHarmonic,3*fHarmonic));
3785  f4pCorrelations->GetXaxis()->SetBinLabel(21,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",6*fHarmonic,4*fHarmonic,6*fHarmonic,4*fHarmonic));
3786  f4pCorrelations->GetXaxis()->SetBinLabel(22,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",6*fHarmonic,5*fHarmonic,6*fHarmonic,5*fHarmonic));
3787  f4pCorrelations->GetXaxis()->SetBinLabel(23,""); // empty
3788  // 4-p correlations sensitive to two distinct harmonics (2):
3789  f4pCorrelations->GetXaxis()->SetBinLabel(24,Form("#LT#LT4#GT#GT_{%dn|%dn,%dn,%dn}",3*fHarmonic,1*fHarmonic,1*fHarmonic,1*fHarmonic));
3790  f4pCorrelations->GetXaxis()->SetBinLabel(25,Form("#LT#LT4#GT#GT_{%dn|%dn,%dn,%dn}",6*fHarmonic,2*fHarmonic,2*fHarmonic,2*fHarmonic));
3791  f4pCorrelations->GetXaxis()->SetBinLabel(26,""); // empty
3792  // 4-p correlations sensitive to three distinct harmonics (10):
3793  f4pCorrelations->GetXaxis()->SetBinLabel(27,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",3*fHarmonic,1*fHarmonic,2*fHarmonic,2*fHarmonic));
3794  f4pCorrelations->GetXaxis()->SetBinLabel(28,Form("#LT#LT4#GT#GT_{%dn|%dn,%dn,%dn}",4*fHarmonic,2*fHarmonic,1*fHarmonic,1*fHarmonic));
3795  f4pCorrelations->GetXaxis()->SetBinLabel(29,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",4*fHarmonic,2*fHarmonic,3*fHarmonic,3*fHarmonic));
3796  f4pCorrelations->GetXaxis()->SetBinLabel(30,Form("#LT#LT4#GT#GT_{%dn|%dn,%dn,%dn}",5*fHarmonic,2*fHarmonic,2*fHarmonic,1*fHarmonic));
3797  f4pCorrelations->GetXaxis()->SetBinLabel(31,Form("#LT#LT4#GT#GT_{%dn|%dn,%dn,%dn}",5*fHarmonic,3*fHarmonic,1*fHarmonic,1*fHarmonic));
3798  f4pCorrelations->GetXaxis()->SetBinLabel(32,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",5*fHarmonic,1*fHarmonic,3*fHarmonic,3*fHarmonic));
3799  f4pCorrelations->GetXaxis()->SetBinLabel(33,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",5*fHarmonic,3*fHarmonic,4*fHarmonic,4*fHarmonic));
3800  f4pCorrelations->GetXaxis()->SetBinLabel(34,Form("#LT#LT4#GT#GT_{%dn|%dn,%dn,%dn}",6*fHarmonic,4*fHarmonic,1*fHarmonic,1*fHarmonic));
3801  f4pCorrelations->GetXaxis()->SetBinLabel(35,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",6*fHarmonic,2*fHarmonic,4*fHarmonic,4*fHarmonic));
3802  f4pCorrelations->GetXaxis()->SetBinLabel(36,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",6*fHarmonic,4*fHarmonic,5*fHarmonic,5*fHarmonic));
3803  f4pCorrelations->GetXaxis()->SetBinLabel(37,""); // empty
3804  // 4-p correlations sensitive to four distinct harmonics (8):
3805  f4pCorrelations->GetXaxis()->SetBinLabel(38,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",4*fHarmonic,1*fHarmonic,3*fHarmonic,2*fHarmonic));
3806  f4pCorrelations->GetXaxis()->SetBinLabel(39,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",5*fHarmonic,1*fHarmonic,4*fHarmonic,2*fHarmonic));
3807  f4pCorrelations->GetXaxis()->SetBinLabel(40,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",5*fHarmonic,2*fHarmonic,4*fHarmonic,3*fHarmonic));
3808  f4pCorrelations->GetXaxis()->SetBinLabel(41,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",6*fHarmonic,1*fHarmonic,4*fHarmonic,3*fHarmonic));
3809  f4pCorrelations->GetXaxis()->SetBinLabel(42,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",6*fHarmonic,1*fHarmonic,5*fHarmonic,2*fHarmonic));
3810  f4pCorrelations->GetXaxis()->SetBinLabel(43,Form("#LT#LT4#GT#GT_{%dn|%dn,%dn,%dn}",6*fHarmonic,3*fHarmonic,2*fHarmonic,1*fHarmonic));
3811  f4pCorrelations->GetXaxis()->SetBinLabel(44,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",6*fHarmonic,2*fHarmonic,5*fHarmonic,3*fHarmonic));
3812  f4pCorrelations->GetXaxis()->SetBinLabel(45,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",6*fHarmonic,3*fHarmonic,5*fHarmonic,4*fHarmonic));
3814  // b3) 5-p correlations (30+9+30+11+3):
3815  TString s5pCorrelationsName = "f5pCorrelations";
3816  s5pCorrelationsName += fAnalysisLabel->Data();
3817  f5pCorrelations = new TProfile(s5pCorrelationsName.Data(),Form("5-particle correlations (n = %d)",fHarmonic),87,0,87,"s");
3818  f5pCorrelations->SetTickLength(-0.01,"Y");
3819  f5pCorrelations->SetMarkerStyle(25);
3820  f5pCorrelations->SetLabelSize(0.02);
3821  f5pCorrelations->SetLabelOffset(0.02,"Y");
3822  f5pCorrelations->SetStats(kFALSE);
3823  f5pCorrelations->Sumw2();
3824  // "standard candles" (30):
3825  f5pCorrelations->GetXaxis()->SetBinLabel(1,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",3*fHarmonic,2*fHarmonic,3*fHarmonic,1*fHarmonic,1*fHarmonic));
3826  f5pCorrelations->GetXaxis()->SetBinLabel(2,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",4*fHarmonic,1*fHarmonic,2*fHarmonic,2*fHarmonic,1*fHarmonic));
3827  f5pCorrelations->GetXaxis()->SetBinLabel(3,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",4*fHarmonic,2*fHarmonic,3*fHarmonic,2*fHarmonic,1*fHarmonic));
3828  f5pCorrelations->GetXaxis()->SetBinLabel(4,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",4*fHarmonic,3*fHarmonic,3*fHarmonic,2*fHarmonic,2*fHarmonic));
3829  f5pCorrelations->GetXaxis()->SetBinLabel(5,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",4*fHarmonic,2*fHarmonic,4*fHarmonic,1*fHarmonic,1*fHarmonic));
3830  f5pCorrelations->GetXaxis()->SetBinLabel(6,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",4*fHarmonic,3*fHarmonic,4*fHarmonic,2*fHarmonic,1*fHarmonic));
3831  f5pCorrelations->GetXaxis()->SetBinLabel(7,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",5*fHarmonic,1*fHarmonic,3*fHarmonic,2*fHarmonic,1*fHarmonic));
3832  f5pCorrelations->GetXaxis()->SetBinLabel(8,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",5*fHarmonic,2*fHarmonic,5*fHarmonic,1*fHarmonic,1*fHarmonic));
3833  f5pCorrelations->GetXaxis()->SetBinLabel(9,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",5*fHarmonic,2*fHarmonic,4*fHarmonic,2*fHarmonic,1*fHarmonic));
3834  f5pCorrelations->GetXaxis()->SetBinLabel(10,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",5*fHarmonic,3*fHarmonic,4*fHarmonic,3*fHarmonic,1*fHarmonic));
3835  f5pCorrelations->GetXaxis()->SetBinLabel(11,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",5*fHarmonic,4*fHarmonic,4*fHarmonic,3*fHarmonic,2*fHarmonic));
3836  f5pCorrelations->GetXaxis()->SetBinLabel(12,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",5*fHarmonic,3*fHarmonic,5*fHarmonic,2*fHarmonic,1*fHarmonic));
3837  f5pCorrelations->GetXaxis()->SetBinLabel(13,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",5*fHarmonic,4*fHarmonic,5*fHarmonic,2*fHarmonic,2*fHarmonic));
3838  f5pCorrelations->GetXaxis()->SetBinLabel(14,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",5*fHarmonic,4*fHarmonic,5*fHarmonic,3*fHarmonic,1*fHarmonic));
3839  f5pCorrelations->GetXaxis()->SetBinLabel(15,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,1*fHarmonic,3*fHarmonic,3*fHarmonic,1*fHarmonic));
3840  f5pCorrelations->GetXaxis()->SetBinLabel(16,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,2*fHarmonic,3*fHarmonic,3*fHarmonic,2*fHarmonic));
3841  f5pCorrelations->GetXaxis()->SetBinLabel(17,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,1*fHarmonic,4*fHarmonic,2*fHarmonic,1*fHarmonic));
3842  f5pCorrelations->GetXaxis()->SetBinLabel(18,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,3*fHarmonic,4*fHarmonic,3*fHarmonic,2*fHarmonic));
3843  f5pCorrelations->GetXaxis()->SetBinLabel(19,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,4*fHarmonic,4*fHarmonic,3*fHarmonic,3*fHarmonic));
3844  f5pCorrelations->GetXaxis()->SetBinLabel(20,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,2*fHarmonic,5*fHarmonic,2*fHarmonic,1*fHarmonic));
3845  f5pCorrelations->GetXaxis()->SetBinLabel(21,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,3*fHarmonic,5*fHarmonic,3*fHarmonic,1*fHarmonic));
3846  f5pCorrelations->GetXaxis()->SetBinLabel(22,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,4*fHarmonic,5*fHarmonic,4*fHarmonic,1*fHarmonic));
3847  f5pCorrelations->GetXaxis()->SetBinLabel(23,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,5*fHarmonic,5*fHarmonic,3*fHarmonic,3*fHarmonic));
3848  f5pCorrelations->GetXaxis()->SetBinLabel(24,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,2*fHarmonic,6*fHarmonic,1*fHarmonic,1*fHarmonic));
3849  f5pCorrelations->GetXaxis()->SetBinLabel(25,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,3*fHarmonic,6*fHarmonic,2*fHarmonic,1*fHarmonic));
3850  f5pCorrelations->GetXaxis()->SetBinLabel(26,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,4*fHarmonic,6*fHarmonic,2*fHarmonic,2*fHarmonic));
3851  f5pCorrelations->GetXaxis()->SetBinLabel(27,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,4*fHarmonic,6*fHarmonic,3*fHarmonic,1*fHarmonic));
3852  f5pCorrelations->GetXaxis()->SetBinLabel(28,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,5*fHarmonic,5*fHarmonic,4*fHarmonic,2*fHarmonic));
3853  f5pCorrelations->GetXaxis()->SetBinLabel(29,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,5*fHarmonic,6*fHarmonic,3*fHarmonic,2*fHarmonic));
3854  f5pCorrelations->GetXaxis()->SetBinLabel(30,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,5*fHarmonic,6*fHarmonic,4*fHarmonic,1*fHarmonic));
3855  f5pCorrelations->GetXaxis()->SetBinLabel(31,""); // empty
3856  // 5-p correlations sensitive to two distinct harmonics (9):
3857  f5pCorrelations->GetXaxis()->SetBinLabel(32,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",2*fHarmonic,1*fHarmonic,1*fHarmonic,1*fHarmonic,1*fHarmonic));
3858  f5pCorrelations->GetXaxis()->SetBinLabel(33,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",2*fHarmonic,2*fHarmonic,2*fHarmonic,1*fHarmonic,1*fHarmonic));
3859  f5pCorrelations->GetXaxis()->SetBinLabel(34,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",3*fHarmonic,3*fHarmonic,2*fHarmonic,2*fHarmonic,2*fHarmonic));
3860  f5pCorrelations->GetXaxis()->SetBinLabel(35,Form("#LT#LT5#GT#GT_{%dn|%dn,%dn,%dn,%dn}",4*fHarmonic,1*fHarmonic,1*fHarmonic,1*fHarmonic,1*fHarmonic));
3861  f5pCorrelations->GetXaxis()->SetBinLabel(36,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",4*fHarmonic,2*fHarmonic,2*fHarmonic,2*fHarmonic,2*fHarmonic));
3862  f5pCorrelations->GetXaxis()->SetBinLabel(37,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",4*fHarmonic,4*fHarmonic,4*fHarmonic,2*fHarmonic,2*fHarmonic));
3863  f5pCorrelations->GetXaxis()->SetBinLabel(38,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,3*fHarmonic,3*fHarmonic,3*fHarmonic,3*fHarmonic));
3864  f5pCorrelations->GetXaxis()->SetBinLabel(39,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,6*fHarmonic,4*fHarmonic,4*fHarmonic,4*fHarmonic));
3865  f5pCorrelations->GetXaxis()->SetBinLabel(40,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,6*fHarmonic,6*fHarmonic,3*fHarmonic,3*fHarmonic));
3866  f5pCorrelations->GetXaxis()->SetBinLabel(41,""); // empty
3867  // 5-p correlations sensitive to three distinct harmonics (30):
3868  f5pCorrelations->GetXaxis()->SetBinLabel(42,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",3*fHarmonic,1*fHarmonic,2*fHarmonic,1*fHarmonic,1*fHarmonic));
3869  f5pCorrelations->GetXaxis()->SetBinLabel(43,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",3*fHarmonic,2*fHarmonic,2*fHarmonic,2*fHarmonic,1*fHarmonic));
3870  f5pCorrelations->GetXaxis()->SetBinLabel(44,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",3*fHarmonic,3*fHarmonic,3*fHarmonic,2*fHarmonic,1*fHarmonic));
3871  f5pCorrelations->GetXaxis()->SetBinLabel(45,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",4*fHarmonic,1*fHarmonic,3*fHarmonic,1*fHarmonic,1*fHarmonic));
3872  f5pCorrelations->GetXaxis()->SetBinLabel(46,Form("#LT#LT5#GT#GT_{%dn,%dn,%dn|%dn,%dn}",4*fHarmonic,1*fHarmonic,1*fHarmonic,3*fHarmonic,3*fHarmonic));
3873  f5pCorrelations->GetXaxis()->SetBinLabel(47,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",4*fHarmonic,3*fHarmonic,3*fHarmonic,3*fHarmonic,1*fHarmonic));
3874  f5pCorrelations->GetXaxis()->SetBinLabel(48,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",4*fHarmonic,4*fHarmonic,3*fHarmonic,3*fHarmonic,2*fHarmonic));
3875  f5pCorrelations->GetXaxis()->SetBinLabel(49,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",4*fHarmonic,4*fHarmonic,4*fHarmonic,3*fHarmonic,1*fHarmonic));
3876  f5pCorrelations->GetXaxis()->SetBinLabel(50,Form("#LT#LT5#GT#GT_{%dn|%dn,%dn,%dn,%dn}",5*fHarmonic,2*fHarmonic,1*fHarmonic,1*fHarmonic,1*fHarmonic));
3877  f5pCorrelations->GetXaxis()->SetBinLabel(51,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",5*fHarmonic,1*fHarmonic,2*fHarmonic,2*fHarmonic,2*fHarmonic));
3878  f5pCorrelations->GetXaxis()->SetBinLabel(52,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",5*fHarmonic,2*fHarmonic,3*fHarmonic,2*fHarmonic,2*fHarmonic));
3879  f5pCorrelations->GetXaxis()->SetBinLabel(53,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",5*fHarmonic,3*fHarmonic,3*fHarmonic,3*fHarmonic,2*fHarmonic));
3880  f5pCorrelations->GetXaxis()->SetBinLabel(54,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",5*fHarmonic,1*fHarmonic,4*fHarmonic,1*fHarmonic,1*fHarmonic));
3881  f5pCorrelations->GetXaxis()->SetBinLabel(55,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",5*fHarmonic,4*fHarmonic,3*fHarmonic,3*fHarmonic,3*fHarmonic));
3882  f5pCorrelations->GetXaxis()->SetBinLabel(56,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",5*fHarmonic,4*fHarmonic,4*fHarmonic,4*fHarmonic,1*fHarmonic));
3883  f5pCorrelations->GetXaxis()->SetBinLabel(57,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",5*fHarmonic,5*fHarmonic,4*fHarmonic,3*fHarmonic,3*fHarmonic));
3884  f5pCorrelations->GetXaxis()->SetBinLabel(58,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",5*fHarmonic,5*fHarmonic,4*fHarmonic,4*fHarmonic,2*fHarmonic));
3885  f5pCorrelations->GetXaxis()->SetBinLabel(59,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",5*fHarmonic,5*fHarmonic,5*fHarmonic,3*fHarmonic,2*fHarmonic));
3886  f5pCorrelations->GetXaxis()->SetBinLabel(60,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",5*fHarmonic,5*fHarmonic,5*fHarmonic,4*fHarmonic,1*fHarmonic));
3887  f5pCorrelations->GetXaxis()->SetBinLabel(61,Form("#LT#LT5#GT#GT_{%dn|%dn,%dn,%dn,%dn}",6*fHarmonic,2*fHarmonic,2*fHarmonic,1*fHarmonic,1*fHarmonic));
3888  f5pCorrelations->GetXaxis()->SetBinLabel(62,Form("#LT#LT5#GT#GT_{%dn|%dn,%dn,%dn,%dn}",6*fHarmonic,3*fHarmonic,1*fHarmonic,1*fHarmonic,1*fHarmonic));
3889  f5pCorrelations->GetXaxis()->SetBinLabel(63,Form("#LT#LT5#GT#GT_{%dn,%dn,%dn|%dn,%dn}",6*fHarmonic,1*fHarmonic,1*fHarmonic,4*fHarmonic,4*fHarmonic));
3890  f5pCorrelations->GetXaxis()->SetBinLabel(64,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,1*fHarmonic,5*fHarmonic,1*fHarmonic,1*fHarmonic));
3891  f5pCorrelations->GetXaxis()->SetBinLabel(65,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,2*fHarmonic,4*fHarmonic,2*fHarmonic,2*fHarmonic));
3892  f5pCorrelations->GetXaxis()->SetBinLabel(66,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,4*fHarmonic,4*fHarmonic,4*fHarmonic,2*fHarmonic));
3893  f5pCorrelations->GetXaxis()->SetBinLabel(67,Form("#LT#LT5#GT#GT_{%dn,%dn,%dn|%dn,%dn}",6*fHarmonic,2*fHarmonic,2*fHarmonic,5*fHarmonic,5*fHarmonic));
3894  f5pCorrelations->GetXaxis()->SetBinLabel(68,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,5*fHarmonic,5*fHarmonic,5*fHarmonic,1*fHarmonic));
3895  f5pCorrelations->GetXaxis()->SetBinLabel(69,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,6*fHarmonic,5*fHarmonic,5*fHarmonic,2*fHarmonic));
3896  f5pCorrelations->GetXaxis()->SetBinLabel(70,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,6*fHarmonic,6*fHarmonic,4*fHarmonic,2*fHarmonic));
3897  f5pCorrelations->GetXaxis()->SetBinLabel(71,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,6*fHarmonic,6*fHarmonic,5*fHarmonic,1*fHarmonic));
3898  f5pCorrelations->GetXaxis()->SetBinLabel(72,""); // empty
3899  // 5-p correlations sensitive to four distinct harmonics (11):
3900  f5pCorrelations->GetXaxis()->SetBinLabel(73,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",5*fHarmonic,2*fHarmonic,3*fHarmonic,3*fHarmonic,1*fHarmonic));
3901  f5pCorrelations->GetXaxis()->SetBinLabel(74,Form("#LT#LT5#GT#GT_{%dn,%dn,%dn|%dn,%dn}",5*fHarmonic,1*fHarmonic,1*fHarmonic,4*fHarmonic,3*fHarmonic));
3902  f5pCorrelations->GetXaxis()->SetBinLabel(75,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",5*fHarmonic,3*fHarmonic,4*fHarmonic,2*fHarmonic,2*fHarmonic));
3903  f5pCorrelations->GetXaxis()->SetBinLabel(76,Form("#LT#LT5#GT#GT_{%dn,%dn,%dn|%dn,%dn}",5*fHarmonic,2*fHarmonic,1*fHarmonic,4*fHarmonic,4*fHarmonic));
3904  f5pCorrelations->GetXaxis()->SetBinLabel(77,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,1*fHarmonic,3*fHarmonic,2*fHarmonic,2*fHarmonic));
3905  f5pCorrelations->GetXaxis()->SetBinLabel(78,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,3*fHarmonic,4*fHarmonic,4*fHarmonic,1*fHarmonic));
3906  f5pCorrelations->GetXaxis()->SetBinLabel(79,Form("#LT#LT5#GT#GT_{%dn,%dn,%dn|%dn,%dn}",6*fHarmonic,1*fHarmonic,1*fHarmonic,5*fHarmonic,3*fHarmonic));
3907  f5pCorrelations->GetXaxis()->SetBinLabel(80,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,3*fHarmonic,5*fHarmonic,2*fHarmonic,2*fHarmonic));
3908  f5pCorrelations->GetXaxis()->SetBinLabel(81,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,5*fHarmonic,4*fHarmonic,4*fHarmonic,3*fHarmonic));
3909  f5pCorrelations->GetXaxis()->SetBinLabel(82,Form("#LT#LT5#GT#GT_{%dn,%dn,%dn|%dn,%dn}",6*fHarmonic,3*fHarmonic,1*fHarmonic,5*fHarmonic,5*fHarmonic));
3910  f5pCorrelations->GetXaxis()->SetBinLabel(83,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,6*fHarmonic,5*fHarmonic,4*fHarmonic,3*fHarmonic));
3911  f5pCorrelations->GetXaxis()->SetBinLabel(84,""); // empty
3912  // 5-p correlations sensitive to five distinct harmonics (3):
3913  f5pCorrelations->GetXaxis()->SetBinLabel(85,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,2*fHarmonic,4*fHarmonic,3*fHarmonic,1*fHarmonic));
3914  f5pCorrelations->GetXaxis()->SetBinLabel(86,Form("#LT#LT5#GT#GT_{%dn,%dn,%dn|%dn,%dn}",6*fHarmonic,2*fHarmonic,1*fHarmonic,5*fHarmonic,4*fHarmonic));
3915  f5pCorrelations->GetXaxis()->SetBinLabel(87,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,4*fHarmonic,5*fHarmonic,3*fHarmonic,2*fHarmonic));
3917  // b4) 6-p correlations (??+??+??+??+??):
3918  TString s6pCorrelationsName = "f6pCorrelations";
3919  s6pCorrelationsName += fAnalysisLabel->Data();
3920  f6pCorrelations = new TProfile(s6pCorrelationsName.Data(),Form("6-particle correlations (n = %d)",fHarmonic),1,0.,1.);
3921  f6pCorrelations->SetTickLength(-0.01,"Y");
3922  f6pCorrelations->SetMarkerStyle(25);
3923  f6pCorrelations->SetLabelSize(0.02);
3924  f6pCorrelations->SetLabelOffset(0.02,"Y");
3925  f6pCorrelations->SetStats(kFALSE);
3926  f6pCorrelations->Sumw2();
3927  //fMixedHarmonicsProfiles->Add(f6pCorrelations); // TBI
3928  // b5) 7-p correlations (??+??+??+??+??):
3929  TString s7pCorrelationsName = "f7pCorrelations";
3930  s7pCorrelationsName += fAnalysisLabel->Data();
3931  f7pCorrelations = new TProfile(s7pCorrelationsName.Data(),Form("7-particle correlations (n = %d)",fHarmonic),1,0.,1.);
3932  f7pCorrelations->SetTickLength(-0.01,"Y");
3933  f7pCorrelations->SetMarkerStyle(25);
3934  f7pCorrelations->SetLabelSize(0.02);
3935  f7pCorrelations->SetLabelOffset(0.02,"Y");
3936  f7pCorrelations->SetStats(kFALSE);
3937  f7pCorrelations->Sumw2();
3938  //fMixedHarmonicsProfiles->Add(f7pCorrelations); // TBI
3939  // b6) 8-p correlations (??+??+??+??+??):
3940  TString s8pCorrelationsName = "f8pCorrelations";
3941  s8pCorrelationsName += fAnalysisLabel->Data();
3942  f8pCorrelations = new TProfile(s8pCorrelationsName.Data(),Form("8-particle correlations (n = %d)",fHarmonic),1,0.,1.);
3943  f8pCorrelations->SetTickLength(-0.01,"Y");
3944  f8pCorrelations->SetMarkerStyle(25);
3945  f8pCorrelations->SetLabelSize(0.02);
3946  f8pCorrelations->SetLabelOffset(0.02,"Y");
3947  f8pCorrelations->SetStats(kFALSE);
3948  f8pCorrelations->Sumw2();
3949  //fMixedHarmonicsProfiles->Add(f8pCorrelations); // TBI
3950 
3951  // c) Book all objects in TList fMixedHarmonicsResults:
3952  // QC{2}:
3953  f2pCumulants = f2pCorrelations->ProjectionX("f2pCumulants");
3954  f2pCumulants->SetTitle(Form("2-particle cumulants (n = %d)",fHarmonic));
3955  f2pCumulants->SetStats(kFALSE);
3956  f2pCumulants->SetMarkerStyle(kFullSquare);
3957  f2pCumulants->SetMarkerColor(kBlack);
3958  f2pCumulants->SetLineColor(kBlack);
3960  // QC{3}:
3961  f3pCumulants = f3pCorrelations->ProjectionX("f3pCumulants");
3962  f3pCumulants->SetTitle(Form("3-particle cumulants (n = %d)",fHarmonic));
3963  f3pCumulants->SetStats(kFALSE);
3964  f3pCumulants->SetMarkerStyle(kFullSquare);
3965  f3pCumulants->SetMarkerColor(kGreen+2);
3966  f3pCumulants->SetLineColor(kGreen+2);
3968  // QC{4}:
3969  f4pCumulants = f4pCorrelations->ProjectionX("f4pCumulants");
3970  f4pCumulants->SetTitle(Form("4-particle cumulants (n = %d)",fHarmonic));
3971  f4pCumulants->SetStats(kFALSE);
3972  f4pCumulants->SetMarkerStyle(kFullSquare);
3973  f4pCumulants->SetMarkerColor(kRed);
3974  f4pCumulants->SetLineColor(kRed);
3976  // QC{5}:
3977  f5pCumulants = f5pCorrelations->ProjectionX("f5pCumulants");
3978  f5pCumulants->SetTitle(Form("5-particle cumulants (n = %d)",fHarmonic));
3979  f5pCumulants->SetStats(kFALSE);
3980  f5pCumulants->SetMarkerStyle(kFullSquare);
3981  f5pCumulants->SetMarkerColor(kBlue);
3982  f5pCumulants->SetLineColor(kBlue);
3984 
3985  // d) Book all objects in TList fMixedHarmonicsErrorPropagation:
3986  // Sum of linear and quadratic event weights for mixed harmonics => [0=linear 1,1=quadratic]:
3987  TString mixedHarmonicEventWeightsName = "fMixedHarmonicEventWeights";
3988  mixedHarmonicEventWeightsName += fAnalysisLabel->Data();
3989  TString powerFlag[2] = {"linear","quadratic"};
3990  for(Int_t power=0;power<2;power++)
3991  {
3992  fMixedHarmonicEventWeights[power] = new TH1D(Form("%s: %s",mixedHarmonicEventWeightsName.Data(),powerFlag[power].Data()),Form("Sum of %s event weights for correlations",powerFlag[power].Data()),8,0.,8.);
3993  fMixedHarmonicEventWeights[power]->SetLabelSize(0.04);
3994  fMixedHarmonicEventWeights[power]->SetMarkerStyle(25);
3995  fMixedHarmonicEventWeights[power]->SetStats(kFALSE);
3996  if(power == 0)
3997  {
3998  (fMixedHarmonicEventWeights[power]->GetXaxis())->SetBinLabel(1,"#sum w_{#LT1#GT}");
3999  (fMixedHarmonicEventWeights[power]->GetXaxis())->SetBinLabel(2,"#sum w_{#LT2#GT}");
4000  (fMixedHarmonicEventWeights[power]->GetXaxis())->SetBinLabel(3,"#sum w_{#LT3#GT}");
4001  (fMixedHarmonicEventWeights[power]->GetXaxis())->SetBinLabel(4,"#sum w_{#LT4#GT}");
4002  (fMixedHarmonicEventWeights[power]->GetXaxis())->SetBinLabel(5,"#sum w_{#LT5#GT}");
4003  (fMixedHarmonicEventWeights[power]->GetXaxis())->SetBinLabel(6,"#sum w_{#LT6#GT}");
4004  (fMixedHarmonicEventWeights[power]->GetXaxis())->SetBinLabel(7,"#sum w_{#LT7#GT}");
4005  (fMixedHarmonicEventWeights[power]->GetXaxis())->SetBinLabel(8,"#sum w_{#LT8#GT}");
4006  } else if (power == 1)
4007  {
4008  (fMixedHarmonicEventWeights[power]->GetXaxis())->SetBinLabel(1,"#sum w_{#LT1#GT}^{2}");
4009  (fMixedHarmonicEventWeights[power]->GetXaxis())->SetBinLabel(2,"#sum w_{#LT2#GT}^{2}");
4010  (fMixedHarmonicEventWeights[power]->GetXaxis())->SetBinLabel(3,"#sum w_{#LT3#GT}^{2}");
4011  (fMixedHarmonicEventWeights[power]->GetXaxis())->SetBinLabel(4,"#sum w_{#LT4#GT}^{2}");
4012  (fMixedHarmonicEventWeights[power]->GetXaxis())->SetBinLabel(5,"#sum w_{#LT5#GT}^{2}");
4013  (fMixedHarmonicEventWeights[power]->GetXaxis())->SetBinLabel(6,"#sum w_{#LT6#GT}^{2}");
4014  (fMixedHarmonicEventWeights[power]->GetXaxis())->SetBinLabel(7,"#sum w_{#LT7#GT}^{2}");
4015  (fMixedHarmonicEventWeights[power]->GetXaxis())->SetBinLabel(8,"#sum w_{#LT8#GT}^{2}");
4016  }
4018  } // end of for(Int_t power=0;power<2;power++)
4019 
4020  // Sums of products of event weights for mixed harmonics:
4021  TString mixedHarmonicProductOfEventWeightsName = "fMixedHarmonicProductOfEventWeights";
4022  mixedHarmonicProductOfEventWeightsName += fAnalysisLabel->Data();
4023  fMixedHarmonicProductOfEventWeights = new TH2D(mixedHarmonicProductOfEventWeightsName.Data(),"Sums of products of event weights",8,0.,8.,8,0.,8.);
4024  fMixedHarmonicProductOfEventWeights->SetStats(kFALSE);
4025  fMixedHarmonicProductOfEventWeights->GetXaxis()->SetLabelSize(0.05);
4026  fMixedHarmonicProductOfEventWeights->GetYaxis()->SetLabelSize(0.05);
4027  for(Int_t b=1;b<=8;b++)
4028  {
4029  fMixedHarmonicProductOfEventWeights->GetXaxis()->SetBinLabel(b,Form("w_{#LT%i#GT}",b));
4030  fMixedHarmonicProductOfEventWeights->GetYaxis()->SetBinLabel(b,Form("w_{#LT%i#GT}",b));
4031  }
4033 
4034  // Averages of products of mixed harmonics correlations:
4035  TString mixedHarmonicProductOfCorrelationsName = "fMixedHarmonicProductOfCorrelations";
4036  mixedHarmonicProductOfCorrelationsName += fAnalysisLabel->Data();
4037  fMixedHarmonicProductOfCorrelations = new TProfile2D(mixedHarmonicProductOfCorrelationsName.Data(),"Averages of products of mixed correlators",139,0.,139.,139,0.,139.);
4039  fMixedHarmonicProductOfCorrelations->SetStats(kFALSE);
4040  fMixedHarmonicProductOfCorrelations->GetXaxis()->SetLabelSize(0.015);
4041  fMixedHarmonicProductOfCorrelations->GetYaxis()->SetLabelSize(0.015);
4042  // x-axis:
4043  fMixedHarmonicProductOfCorrelations->GetXaxis()->SetBinLabel(1,Form("#LT#LT2#GT#GT_{%dn|%dn}",1*fHarmonic,1*fHarmonic));
4044  fMixedHarmonicProductOfCorrelations->GetXaxis()->SetBinLabel(2,Form("#LT#LT2#GT#GT_{%dn|%dn}",2*fHarmonic,2*fHarmonic));
4045  fMixedHarmonicProductOfCorrelations->GetXaxis()->SetBinLabel(3,Form("#LT#LT2#GT#GT_{%dn|%dn}",3*fHarmonic,3*fHarmonic));
4046  fMixedHarmonicProductOfCorrelations->GetXaxis()->SetBinLabel(4,Form("#LT#LT2#GT#GT_{%dn|%dn}",4*fHarmonic,4*fHarmonic));
4047  fMixedHarmonicProductOfCorrelations->GetXaxis()->SetBinLabel(5,Form("#LT#LT2#GT#GT_{%dn|%dn}",5*fHarmonic,5*fHarmonic));
4048  fMixedHarmonicProductOfCorrelations->GetXaxis()->SetBinLabel(6,Form("#LT#LT2#GT#GT_{%dn|%dn}",6*fHarmonic,6*fHarmonic));
4049  fMixedHarmonicProductOfCorrelations->GetXaxis()->SetBinLabel(7,Form("#LT#LT3#GT#GT_{%dn|%dn,%dn}",2*fHarmonic,1*fHarmonic,1*fHarmonic));
4050  fMixedHarmonicProductOfCorrelations->GetXaxis()->SetBinLabel(8,Form("#LT#LT3#GT#GT_{%dn|%dn,%dn}",4*fHarmonic,2*fHarmonic,2*fHarmonic));
4051  fMixedHarmonicProductOfCorrelations->GetXaxis()->SetBinLabel(9,Form("#LT#LT3#GT#GT_{%dn|%dn,%dn}",6*fHarmonic,3*fHarmonic,3*fHarmonic));
4052  fMixedHarmonicProductOfCorrelations->GetXaxis()->SetBinLabel(10,Form("#LT#LT3#GT#GT_{%dn|%dn,%dn}",3*fHarmonic,2*fHarmonic,1*fHarmonic));
4053  fMixedHarmonicProductOfCorrelations->GetXaxis()->SetBinLabel(11,Form("#LT#LT3#GT#GT_{%dn|%dn,%dn}",4*fHarmonic,3*fHarmonic,1*fHarmonic));
4054  fMixedHarmonicProductOfCorrelations->GetXaxis()->SetBinLabel(12,Form("#LT#LT3#GT#GT_{%dn|%dn,%dn}",5*fHarmonic,3*fHarmonic,2*fHarmonic));
4055  fMixedHarmonicProductOfCorrelations->GetXaxis()->SetBinLabel(13,Form("#LT#LT3#GT#GT_{%dn|%dn,%dn}",5*fHarmonic,4*fHarmonic,1*fHarmonic));
4056  fMixedHarmonicProductOfCorrelations->GetXaxis()->SetBinLabel(14,Form("#LT#LT3#GT#GT_{%dn|%dn,%dn}",6*fHarmonic,4*fHarmonic,2*fHarmonic));
4057  fMixedHarmonicProductOfCorrelations->GetXaxis()->SetBinLabel(15,Form("#LT#LT3#GT#GT_{%dn|%dn,%dn}",6*fHarmonic,5*fHarmonic,1*fHarmonic));
4058  fMixedHarmonicProductOfCorrelations->GetXaxis()->SetBinLabel(16,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",1*fHarmonic,1*fHarmonic,1*fHarmonic,1*fHarmonic));
4059  fMixedHarmonicProductOfCorrelations->GetXaxis()->SetBinLabel(17,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",2*fHarmonic,2*fHarmonic,2*fHarmonic,2*fHarmonic));
4060  fMixedHarmonicProductOfCorrelations->GetXaxis()->SetBinLabel(18,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",3*fHarmonic,3*fHarmonic,3*fHarmonic,3*fHarmonic));
4061  fMixedHarmonicProductOfCorrelations->GetXaxis()->SetBinLabel(19,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",4*fHarmonic,4*fHarmonic,4*fHarmonic,4*fHarmonic));