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