AliPhysics  b752f14 (b752f14)
 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 fRunBin(0),
289 fCenBin(0),
290 fCorrWeightTPC(kUnit),
291 fCorrWeightVZ(kUnit),
292 fCorrWeightZDC(kUnit),
293 fCRCIntList(NULL),
294 fCRCnCen(nCen),
295 fCRCCenBinWidth(CenWidth),
296 fCRCIntRbRList(NULL),
297 fCRCnRun(211),
298 fDataSet(kAny),
299 fInteractionRate(kAll),
300 fSelectCharge(kAllCh),
301 fPOIExtraWeights(kNone),
302 fCRCQVecList(NULL),
303 fCRCQVecListTPC(NULL),
304 fCRCQVecWeightsList(NULL),
305 fCRCZDCCalibList(NULL),
306 fCRCVZEROCalibList(NULL),
307 fCRCZDCResList(NULL),
308 fZDCESEList(NULL),
309 fCRCVZList(NULL),
310 fCRCZDCList(NULL),
311 fCRCZDCRbRList(NULL),
312 fCRCPtList(NULL),
313 fCMEList(NULL),
314 fCMETPCList(NULL),
315 fCMEZDCList(NULL),
316 fCRC2List(NULL),
317 fCRC2nEtaBins(6),
318 fFlowSPZDCList(NULL),
319 fFlowQCList(NULL),
320 //fFlowQCOrdMagList(NULL),
321 fFlowQCHOList(NULL),
322 fFlowQCCenBin(100),
323 fFlowQCDeltaEta(0.4),
324 fFlowSPVZList(NULL),
325 fVariousList(NULL),
326 fEbEFlowList(NULL),
327 fCenWeightEbE(0.),
328 fQAZDCCuts(kFALSE),
329 fQAZDCCutsFlag(kTRUE),
330 fUseTracklets(kFALSE),
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("begin AliFlowAnalysisCRC::Make \n");
538 
539  if(fExactNoRPs > 0 && fNumberOfRPsEBE<fExactNoRPs){return;}
540  if(!fCentralityEBE){return;}
541  if(!fNumberOfRPsEBE || !fNumberOfPOIsEBE){return;}
543  if((fDataSet==k2015 || fDataSet==k2015v6 || fDataSet==k2015pidfix) && !MultCut2015o()){return;}
544 
545  if(!fRefMultRbRPro) {
547  } else {
548  Int_t runbin = fRefMultRbRPro->GetXaxis()->FindBin(Form("%d",fRunNum));
549  Int_t cenbin = fRefMultRbRPro->GetYaxis()->FindBin(fCentralityEBE);
551  }
552 
553  // centrality flattening with weights
554  fCenWeightEbE = 1.;
556 
557  // primary vertex position (x,y,z)
558  anEvent->GetVertexPosition(fVtxPos);
560  if(fAvVtxPosY[fRunBin]) fVtxPosCor[1] = fVtxPos[1]-fAvVtxPosY[fRunBin];
561  if(fAvVtxPosZ[fRunBin]) fVtxPosCor[2] = fVtxPos[2]-fAvVtxPosZ[fRunBin];
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  if(fhAvAbsOrbit) {
584  UInt_t TimeStamp = (UInt_t)anEvent->GetAbsOrbit();
585  fhAvAbsOrbit->Fill(fRunBin+0.5,(Double_t)TimeStamp);
586  }
587 
588  if(fRunNum!=fCachedRunNum) {
589  fbFlagIsPosMagField = kFALSE;
590  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};
591  for (Int_t i=0; i<40; i++) {
592  if(fRunNum==dRun15hPos[i]) fbFlagIsPosMagField = kTRUE;
593  }
594  }
595 
596  // VZERO *********************************************************************************************************
597 
598  if(fUseVZERO) {
599 
600  for(Int_t h=0; h<fCRCnHar; h++) {
601  // Get Q vectors for the subevents
602  AliFlowVector vQarray[2];
603  anEvent->GetV02Qsub(vQarray,h+1);
604  fVZFlowVect[0][h] = vQarray[0];
605  fVZFlowVect[1][h] = vQarray[1];
606  // re-center VZERO Q-vectors
608 
609  // fill Q-vector RbR
610 // if(fCRCVZEROQVec[fRunBin][h]) {
611 // fCRCVZEROQVec[fRunBin][h]->Fill(0.5,fCentralityEBE,fVZFlowVect[0][h].X());
612 // fCRCVZEROQVec[fRunBin][h]->Fill(1.5,fCentralityEBE,fVZFlowVect[0][h].Y());
613 // fCRCVZEROQVec[fRunBin][h]->Fill(2.5,fCentralityEBE,fVZFlowVect[1][h].X());
614 // fCRCVZEROQVec[fRunBin][h]->Fill(3.5,fCentralityEBE,fVZFlowVect[1][h].Y());
615 // fCRCVZEROQVec[fRunBin][h]->Fill(4.5,fCentralityEBE,fVZFlowVect[0][h].X()*fVZFlowVect[1][h].X());
616 // fCRCVZEROQVec[fRunBin][h]->Fill(5.5,fCentralityEBE,fVZFlowVect[0][h].Y()*fVZFlowVect[1][h].Y());
617 // fCRCVZEROQVec[fRunBin][h]->Fill(6.5,fCentralityEBE,fVZFlowVect[0][h].X()*fVZFlowVect[1][h].Y());
618 // fCRCVZEROQVec[fRunBin][h]->Fill(7.5,fCentralityEBE,fVZFlowVect[0][h].Y()*fVZFlowVect[1][h].X());
619 // }
620  } // end of for(Int_t h=0; h<fCRCnHar; h++)
621  } // end of if(fUseVZERO)
622 
623  // ZDC *********************************************************************************************************
624 
625  if(fUseZDC) {
626  // Get Q vectors for the subevents
627  AliFlowVector vQarray[2];
628  anEvent->GetZDC2Qsub(vQarray);
629  fZDCFlowVect[0] = vQarray[0];
630  fZDCFlowVect[1] = vQarray[1];
631  fZNCen = anEvent->GetZNCEnergy()/fEnNucl;
632  fZNAen = anEvent->GetZNAEnergy()/fEnNucl;
633  } // end of if(fUseZDC)
634 
635  this->CalculateCRCQVec();
636 
637  if(fUseZDC) {
638  if(fRecenterZDC) {
639  this->RecenterCRCQVecZDC();
640  }
641  }
642  // ZDC-C (eta < -8.8)
643  Double_t ZCRe = fZDCFlowVect[0].X();
644  Double_t ZCIm = fZDCFlowVect[0].Y();
645  Double_t ZCM = fZDCFlowVect[0].GetMult();
646  // ZDC-A (eta > 8.8)
647  Double_t ZARe = fZDCFlowVect[1].X();
648  Double_t ZAIm = fZDCFlowVect[1].Y();
649  Double_t ZAM = fZDCFlowVect[1].GetMult();
650  if( fInvertZDC ) ZARe = -ZARe;
651 
652  if(fCalculateCRC) {
653  fQAZDCCutsFlag = this->PassQAZDCCuts();
654  }
655  // ZDC QA cuts
656  Bool_t bPassZDCcuts = kTRUE;
657  if( ZCM<=0. || ZAM<=0. || sqrt(ZCRe*ZCRe+ZCIm*ZCIm)<1.E-6 || sqrt(ZARe*ZARe+ZAIm*ZAIm)<1.E-6 ) bPassZDCcuts=kFALSE;
658  if( !std::isfinite(fZDCFlowVect[0].Mod()) || !std::isfinite(fZDCFlowVect[1].Mod())) bPassZDCcuts=kFALSE;
659  if(fQAZDCCuts && !fQAZDCCutsFlag) bPassZDCcuts=kFALSE;
660  if(bPassZDCcuts) fEventCounter->Fill(1.5);
661 
662  // EbE flow *********************************************************************************************************
663 
664  if(fCalculateEbEFlow) {
665  if(fNumberOfPOIsEBE>0 && fNumberOfPOIsEBE<=2500) {
667  } else {
668  fEBEFlowMulBin = -1;
669  }
670  }
671 
672  // run-by-run corrections ********************************************************************************************
673 
674  if(fRunNum!=fCachedRunNum) {
676  if(fWeightsList->FindObject(Form("fCRCQVecPhiHistRbR[%d]",fRunNum))) {
677  fPhiEtaRbRWeights = (TH3D*)(fWeightsList->FindObject(Form("fCRCQVecPhiRbRHist[%d]",fRunNum)));
678  } else {
679  AliWarning("WARNING: POIExtraWeights (kEtaPhiRbR) not found ! \n");
680  }
681  }
683  for (Int_t i=0; i<2; i++) {
684  if(fWeightsList->FindObject(Form("fCRCQVecPhiRbRHistCh[%d][%d]",fRunNum,i))) {
685  fPhiEtaRbRWeightsCh[i] = (TH3D*)(fWeightsList->FindObject(Form("fCRCQVecPhiRbRHistCh[%d][%d]",fRunNum,i)));
686  } else {
687  AliWarning("WARNING: POIExtraWeights (kEtaPhiChRbR) not found ! \n");
688  }
689  }
690  }
691  }
692 
693  // loop over particles **********************************************************************************************
694 
695  for(Int_t i=0;i<nPrim;i++) {
696  if(fExactNoRPs > 0 && nCounterNoRPs>fExactNoRPs){continue;}
697  aftsTrack=anEvent->GetTrack(i);
698  if(aftsTrack) {
699 
700  if(!(aftsTrack->InRPSelection() || aftsTrack->InPOISelection() || aftsTrack->InPOISelection(2))){continue;} // safety measure: consider only tracks which are RPs or POIs
701 
702  // RPs *********************************************************************************************************
703 
704  if(aftsTrack->InRPSelection()) {
705  nCounterNoRPs++;
706  dPhi = aftsTrack->Phi();
707  dPt = aftsTrack->Pt();
708  dEta = aftsTrack->Eta();
709  dCharge = aftsTrack->Charge();
710 
711  if(fSelectCharge==kPosCh && dCharge<0.) continue;
712  if(fSelectCharge==kNegCh && dCharge>0.) continue;
713 
714  cw = (dCharge > 0. ? 0 : 1);
715  wPhi = 1.;
716  wPt = 1.;
717  wEta = 1.;
718  wTrack = 1.;
719  wPhiEta = 1.;
720  wProbCut = 0.;
721  // pT weights
723  if(dPt>fPtWeightsHist[fCenBin]->GetXaxis()->GetXmin() && dPt<fPtWeightsHist[fCenBin]->GetXaxis()->GetXmax()) wt = fPtWeightsHist[fCenBin]->Interpolate(dPt);
724  else if(dPt<fPtWeightsHist[fCenBin]->GetXaxis()->GetXmin()) wt = fPtWeightsHist[fCenBin]->Interpolate(fPtWeightsHist[fCenBin]->GetXaxis()->GetXmin());
725  else if(dPt>fPtWeightsHist[fCenBin]->GetXaxis()->GetXmax()) wt = fPtWeightsHist[fCenBin]->Interpolate(fPtWeightsHist[fCenBin]->GetXaxis()->GetXmax());
726  if(std::isfinite(1./wt)) wPhiEta *= 1./wt;
727  }
728 
729  // extra weights: eta, phi, ch, vtx
730  if(fPOIExtraWeights==kEtaPhi && fPhiEtaWeights) // determine phieta weight for POI:
731  {
732  wt = fPhiEtaWeights->GetBinContent(fPhiEtaWeights->FindBin(fCentralityEBE,dPhi,dEta));
733  if(std::isfinite(1./wt)) wPhiEta *= 1./wt;
734  }
735  if(fPOIExtraWeights==kEtaPhiCh && fPhiEtaWeightsCh[cw]) // determine phieta weight for POI, ch dep:
736  {
737  wt = fPhiEtaWeightsCh[cw]->GetBinContent(fPhiEtaWeightsCh[cw]->FindBin(fCentralityEBE,dPhi,dEta));
738  if(std::isfinite(1./wt)) wPhiEta *= 1./wt;
739  }
740  if(fPOIExtraWeights==kEtaPhiVtx) // determine phieta weight for POI:
741  {
742  // TBI
743  }
744  Int_t ptbebe = (dPt>1.? 2 : (dPt>0.5 ? 1 : 0)); // hardcoded
745  if(fPOIExtraWeights==kEtaPhiChPt && fPhiEtaWeightsChPt[cw][ptbebe]) // determine phieta weight for POI, ch dep:
746  {
747  wt = fPhiEtaWeightsChPt[cw][ptbebe]->GetBinContent(fPhiEtaWeightsChPt[cw][ptbebe]->FindBin(fCentralityEBE,dPhi,dEta));
748  if(std::isfinite(1./wt)) wPhiEta *= 1./wt;
749  }
750  // run-by-run
751  if(fPOIExtraWeights==kEtaPhiRbR && fPhiEtaRbRWeights) // determine phieta weight for POI:
752  {
753  wt = fPhiEtaRbRWeights->GetBinContent(fPhiEtaRbRWeights->FindBin(fCentralityEBE,dPhi,dEta));
754  if(std::isfinite(1./wt)) wPhiEta *= 1./wt;
755  }
756  if(fPOIExtraWeights==kEtaPhiChRbR && fPhiEtaRbRWeightsCh[cw]) // determine phieta weight for POI, ch dep:
757  {
758  wt = fPhiEtaRbRWeightsCh[cw]->GetBinContent(fPhiEtaRbRWeightsCh[cw]->FindBin(fCentralityEBE,dPhi,dEta));
759  if(std::isfinite(1./wt)) wPhiEta *= 1./wt;
760  }
761 
762  if(fPhiExclZoneHist) {
763  if(fPhiExclZoneHist->GetBinContent(fPhiExclZoneHist->FindBin(dEta,dPhi))<0.5) continue;
764  }
765 
766  // Calculate Re[Q_{m*n,k}] and Im[Q_{m*n,k}] for this event (m = 1,2,...,12, k = 0,1,...,8):
767  for(Int_t m=0;m<12;m++) // to be improved - hardwired 6
768  {
769  for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
770  {
771  (*fReQ)(m,k)+=pow(wPhiEta*wPhi*wPt*wEta*wTrack,k)*TMath::Cos((m+1)*n*dPhi);
772  (*fImQ)(m,k)+=pow(wPhiEta*wPhi*wPt*wEta*wTrack,k)*TMath::Sin((m+1)*n*dPhi);
773  }
774  }
775  // Calculate S_{p,k} for this event (Remark: final calculation of S_{p,k} follows after the loop over data bellow):
776  for(Int_t p=0;p<8;p++)
777  {
778  for(Int_t k=0;k<9;k++)
779  {
780  (*fSpk)(p,k)+=pow(wPhiEta*wPhi*wPt*wEta*wTrack,k);
781  }
782  }
783  // Differential flow:
785  {
786  ptEta[0] = dPt;
787  ptEta[1] = dEta;
788  // Calculate r_{m*n,k} and s_{p,k} (r_{m,k} is 'p-vector' for RPs):
789  for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
790  {
791  for(Int_t m=0;m<4;m++) // to be improved - hardwired 4
792  {
794  {
795  for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
796  {
797  fReRPQ1dEBE[0][pe][m][k]->Fill(ptEta[pe],pow(wPhiEta*wPhi*wPt*wEta*wTrack,k)*TMath::Cos((m+1.)*n*dPhi),1.);
798  fImRPQ1dEBE[0][pe][m][k]->Fill(ptEta[pe],pow(wPhiEta*wPhi*wPt*wEta*wTrack,k)*TMath::Sin((m+1.)*n*dPhi),1.);
799  if(m==0) // s_{p,k} does not depend on index m
800  {
801  fs1dEBE[0][pe][k]->Fill(ptEta[pe],pow(wPhiEta*wPhi*wPt*wEta*wTrack,k),1.);
802  } // end of if(m==0) // s_{p,k} does not depend on index m
803  } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
804  } // end of if(fCalculateDiffFlow)
806  {
807  fReRPQ2dEBE[0][m][k]->Fill(dPt,dEta,pow(wPhiEta*wPhi*wPt*wEta*wTrack,k)*TMath::Cos((m+1.)*n*dPhi),1.);
808  fImRPQ2dEBE[0][m][k]->Fill(dPt,dEta,pow(wPhiEta*wPhi*wPt*wEta*wTrack,k)*TMath::Sin((m+1.)*n*dPhi),1.);
809  if(m==0) // s_{p,k} does not depend on index m
810  {
811  fs2dEBE[0][k]->Fill(dPt,dEta,pow(wPhiEta*wPhi*wPt*wEta*wTrack,k),1.);
812  } // end of if(m==0) // s_{p,k} does not depend on index m
813  } // end of if(fCalculate2DDiffFlow)
814  } // end of for(Int_t m=0;m<4;m++) // to be improved - hardwired 4
815  } // end of for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
816  // Checking if RP particle is also POI particle:
817  if(aftsTrack->InPOISelection())
818  {
819  // Calculate q_{m*n,k} and s_{p,k} ('q-vector' and 's' for RPs && POIs):
820  for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
821  {
822  for(Int_t m=0;m<4;m++) // to be improved - hardwired 4
823  {
825  {
826  for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
827  {
828  fReRPQ1dEBE[2][pe][m][k]->Fill(ptEta[pe],pow(wPhiEta*wPhi*wPt*wEta*wTrack,k)*TMath::Cos((m+1.)*n*dPhi),1.);
829  fImRPQ1dEBE[2][pe][m][k]->Fill(ptEta[pe],pow(wPhiEta*wPhi*wPt*wEta*wTrack,k)*TMath::Sin((m+1.)*n*dPhi),1.);
830  if(m==0) // s_{p,k} does not depend on index m
831  {
832  fs1dEBE[2][pe][k]->Fill(ptEta[pe],pow(wPhiEta*wPhi*wPt*wEta*wTrack,k),1.);
833  } // end of if(m==0) // s_{p,k} does not depend on index m
834  } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
835  } // end of if(fCalculateDiffFlow)
837  {
838  fReRPQ2dEBE[2][m][k]->Fill(dPt,dEta,pow(wPhiEta*wPhi*wPt*wEta*wTrack,k)*TMath::Cos((m+1.)*n*dPhi),1.);
839  fImRPQ2dEBE[2][m][k]->Fill(dPt,dEta,pow(wPhiEta*wPhi*wPt*wEta*wTrack,k)*TMath::Sin((m+1.)*n*dPhi),1.);
840  if(m==0) // s_{p,k} does not depend on index m
841  {
842  fs2dEBE[2][k]->Fill(dPt,dEta,pow(wPhiEta*wPhi*wPt*wEta*wTrack,k),1.);
843  } // end of if(m==0) // s_{p,k} does not depend on index m
844  } // end of if(fCalculate2DDiffFlow)
845  } // end of for(Int_t m=0;m<4;m++) // to be improved - hardwired 4
846  } // end of for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
847  } // end of if(aftsTrack->InPOISelection())
848  } // end of if(fCalculateDiffFlow || fCalculate2DDiffFlow)
849 
850  } // end of if(pTrack->InRPSelection())
851 
852  // POIs ********************************************************************************************************
853 
854  if(aftsTrack->InPOISelection() || aftsTrack->InPOISelection(2)) {
855 
856  if(!fUseTracklets && aftsTrack->InPOISelection(2)) continue;
857  if(fUseTracklets && !aftsTrack->InPOISelection(2)) continue;
858 
859  dPhi = aftsTrack->Phi();
860  dPt = aftsTrack->Pt();
861  dEta = aftsTrack->Eta();
862  dCharge = aftsTrack->Charge();
863  Int_t ITStype = aftsTrack->ITStype();
864 
865  if(fSelectCharge==kPosCh && dCharge<0.) continue;
866  if(fSelectCharge==kNegCh && dCharge>0.) continue;
867 
868  if(fCRCTestSin) {
869  if(dCharge > 0.) dPt += 1.E-2;
870  else dPt -= 1.E-2;
871  }
872 
873  cw = (dCharge > 0. ? 0 : 1);
874  wPhi = 1.;
875  wPt = 1.;
876  wEta = 1.;
877  wTrack = 1.;
878  wPhiEta = 1.;
879  wProbCut = 0.;
880 
881  // pT weights
883  if(dPt>fPtWeightsHist[fCenBin]->GetXaxis()->GetXmin() && dPt<fPtWeightsHist[fCenBin]->GetXaxis()->GetXmax()) wt = fPtWeightsHist[fCenBin]->Interpolate(dPt);
884  else if(dPt<fPtWeightsHist[fCenBin]->GetXaxis()->GetXmin()) wt = fPtWeightsHist[fCenBin]->Interpolate(fPtWeightsHist[fCenBin]->GetXaxis()->GetXmin());
885  else if(dPt>fPtWeightsHist[fCenBin]->GetXaxis()->GetXmax()) wt = fPtWeightsHist[fCenBin]->Interpolate(fPtWeightsHist[fCenBin]->GetXaxis()->GetXmax());
886  if(std::isfinite(1./wt)) wPhiEta *= 1./wt;
887  }
888 
889  // extra weights: eta, phi, ch, vtx
890  if(fPOIExtraWeights==kEtaPhi && fPhiEtaWeights) // determine phieta weight for POI:
891  {
892  wt = fPhiEtaWeights->GetBinContent(fPhiEtaWeights->FindBin(fCentralityEBE,dPhi,dEta));
893  if(std::isfinite(1./wt)) wPhiEta *= 1./wt;
894  }
895  if(fPOIExtraWeights==kEtaPhiCh && fPhiEtaWeightsCh[cw]) // determine phieta weight for POI, ch dep:
896  {
897  wt = fPhiEtaWeightsCh[cw]->GetBinContent(fPhiEtaWeightsCh[cw]->FindBin(fCentralityEBE,dPhi,dEta));
898  if(std::isfinite(1./wt)) wPhiEta *= 1./wt;
899  }
900  if(fPOIExtraWeights==kEtaPhiVtx) // determine phieta weight for POI:
901  {
902  // TBI
903  }
904  Int_t ptbebe = (dPt>1.? 2 : (dPt>0.5 ? 1 : 0)); // hardcoded
905  if(fPOIExtraWeights==kEtaPhiChPt && fPhiEtaWeightsChPt[cw][ptbebe]) // determine phieta weight for POI, ch dep:
906  {
907  wt = fPhiEtaWeightsChPt[cw][ptbebe]->GetBinContent(fPhiEtaWeightsChPt[cw][ptbebe]->FindBin(fCentralityEBE,dPhi,dEta));
908  if(std::isfinite(1./wt)) wPhiEta *= 1./wt;
909  }
910  // run-by-run
911  if(fPOIExtraWeights==kEtaPhiRbR && fPhiEtaRbRWeights) // determine phieta weight for POI:
912  {
913  wt = fPhiEtaRbRWeights->GetBinContent(fPhiEtaRbRWeights->FindBin(fCentralityEBE,dPhi,dEta));
914  if(std::isfinite(1./wt)) wPhiEta *= 1./wt;
915  }
916  if(fPOIExtraWeights==kEtaPhiChRbR && fPhiEtaRbRWeightsCh[cw]) // determine phieta weight for POI, ch dep:
917  {
918  wt = fPhiEtaRbRWeightsCh[cw]->GetBinContent(fPhiEtaRbRWeightsCh[cw]->FindBin(fCentralityEBE,dPhi,dEta));
919  if(std::isfinite(1./wt)) wPhiEta *= 1./wt;
920  }
921 
922  if(fUsePhiEtaCuts)
923  {
924  // test: remove region with low SPD efficiency
925  if(dPhi>2.136283 && dPhi<2.324779) continue;
926  }
927 
928  ptEta[0] = dPt;
929  ptEta[1] = dEta;
930  // Calculate p_{m*n,k} ('p-vector' for POIs):
931  for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
932  {
933  for(Int_t m=0;m<4;m++) // to be improved - hardwired 4
934  {
936  {
937  for(Int_t pe=0;pe<1+(Int_t)fCalculateDiffFlowVsEta;pe++) // pt or eta
938  {
939  fReRPQ1dEBE[1][pe][m][k]->Fill(ptEta[pe],pow(wPhiEta*wPhi*wPt*wEta*wTrack,k)*TMath::Cos((m+1.)*n*dPhi),1.);
940  fImRPQ1dEBE[1][pe][m][k]->Fill(ptEta[pe],pow(wPhiEta*wPhi*wPt*wEta*wTrack,k)*TMath::Sin((m+1.)*n*dPhi),1.);
941  } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta
942  } // end of if(fCalculateDiffFlow)
944  {
945  fReRPQ2dEBE[1][m][k]->Fill(dPt,dEta,pow(wPhiEta*wPhi*wPt*wEta*wTrack,k)*TMath::Cos((m+1.)*n*dPhi),1.);
946  fImRPQ2dEBE[1][m][k]->Fill(dPt,dEta,pow(wPhiEta*wPhi*wPt*wEta*wTrack,k)*TMath::Sin((m+1.)*n*dPhi),1.);
947  } // end of if(fCalculate2DDiffFlow)
948  } // end of for(Int_t m=0;m<4;m++) // to be improved - hardwired 4
949  } // end of for(Int_t k=0;k<9;k++) // to be improved - hardwired 9
950 
951  // Charge-Rapidity Correlations
952  for (Int_t h=0;h<fCRCnHar;h++) {
953 
954  fCRCQRe[cw][h]->Fill(dEta,wPhiEta*TMath::Cos((h+1.)*dPhi));
955  fCRCQIm[cw][h]->Fill(dEta,wPhiEta*TMath::Sin((h+1.)*dPhi));
956  fCRCMult[cw][h]->Fill(dEta,wPhiEta);
957 
958  fCRC2QRe[cw][h]->Fill(dEta,wPhiEta*TMath::Cos((h+1.)*dPhi));
959  fCRC2QIm[cw][h]->Fill(dEta,wPhiEta*TMath::Sin((h+1.)*dPhi));
960  fCRC2Mul[cw][h]->Fill(dEta,pow(wPhiEta,h));
961 
962  fCRCZDCQRe[cw][h]->Fill(dEta,wPhiEta*TMath::Cos((h+1.)*dPhi));
963  fCRCZDCQIm[cw][h]->Fill(dEta,wPhiEta*TMath::Sin((h+1.)*dPhi));
964  fCRCZDCMult[cw][h]->Fill(dEta,wPhiEta);
965 
966  if(fRandom->Integer(2)>0.5) {
967  fCRC2QRe[2][h]->Fill(dEta,wPhiEta*TMath::Cos((h+1.)*dPhi));
968  fCRC2QIm[2][h]->Fill(dEta,wPhiEta*TMath::Sin((h+1.)*dPhi));
969  fCRC2Mul[2][h]->Fill(dEta,pow(wPhiEta,h));
970  }
971 
972  if(fRandom->Integer(2)>0.5) {
973  fCRCZDCQRe[2][h]->Fill(dEta,wPhiEta*TMath::Cos((h+1.)*dPhi));
974  fCRCZDCQIm[2][h]->Fill(dEta,wPhiEta*TMath::Sin((h+1.)*dPhi));
975  fCRCZDCMult[2][h]->Fill(dEta,wPhiEta);
976  } else {
977  fCRCZDCQRe[3][h]->Fill(dEta,wPhiEta*TMath::Cos((h+1.)*dPhi));
978  fCRCZDCQIm[3][h]->Fill(dEta,wPhiEta*TMath::Sin((h+1.)*dPhi));
979  fCRCZDCMult[3][h]->Fill(dEta,wPhiEta);
980  }
981 
982  if(fCalculateCME) {
983  Double_t SpecWeig = 1.;
984  if(fUseZDCESESpecWeights && fZDCESESpecWeightsHist[fZDCESEclEbE] && dPt>0.2 && dPt<20.2) {
986  if(weraw > 0.) SpecWeig = 1./weraw;
987  }
988  fCMEQRe[cw][h]->Fill(dEta,SpecWeig*wPhiEta*TMath::Cos((h+1.)*dPhi));
989  fCMEQIm[cw][h]->Fill(dEta,SpecWeig*wPhiEta*TMath::Sin((h+1.)*dPhi));
990  fCMEMult[cw][h]->Fill(dEta,SpecWeig*wPhiEta);
991  fCMEQRe[2+cw][h]->Fill(dEta,pow(SpecWeig*wPhiEta,2.)*TMath::Cos((h+1.)*dPhi));
992  fCMEQIm[2+cw][h]->Fill(dEta,pow(SpecWeig*wPhiEta,2.)*TMath::Sin((h+1.)*dPhi));
993  fCMEMult[2+cw][h]->Fill(dEta,pow(SpecWeig*wPhiEta,2.));
994 
995  // spectra
996  fhCenvsSpec[fZDCESEclEbE]->Fill(fCentralityEBE,dPt,SpecWeig*wPhiEta);
997  fhCenvsSpec[fZDCESEnCl]->Fill(fCentralityEBE,dPt,SpecWeig*wPhiEta);
998  }
999 
1000  } // end of for (Int_t h=0;h<fCRCnHar;h++)
1001 
1002  // Flow SP ZDC
1003  Bool_t bFillDis=kTRUE;
1004  for (Int_t k=0; k<fQVecPower; k++) {
1005  for (Int_t h=0;h<fFlowNHarmMax;h++) {
1006 
1007  if(fFlowQCDeltaEta>0.) {
1008 
1009  fPOIPtDiffQRe[k][h]->Fill(dPt,pow(wPhiEta,k)*TMath::Cos((h+1.)*dPhi));
1010  fPOIPtDiffQIm[k][h]->Fill(dPt,pow(wPhiEta,k)*TMath::Sin((h+1.)*dPhi));
1011  fPOIPtDiffMul[k][h]->Fill(dPt,pow(wPhiEta,k));
1012 
1013  fPOIPtDiffQReCh[cw][k][h]->Fill(dPt,pow(wPhiEta,k)*TMath::Cos((h+1.)*dPhi));
1014  fPOIPtDiffQImCh[cw][k][h]->Fill(dPt,pow(wPhiEta,k)*TMath::Sin((h+1.)*dPhi));
1015  fPOIPtDiffMulCh[cw][k][h]->Fill(dPt,pow(wPhiEta,k));
1016 
1017  fPOIPhiDiffQRe[k][h]->Fill(dPhi,pow(wPhiEta,k)*TMath::Cos((h+1.)*dPhi));
1018  fPOIPhiDiffQIm[k][h]->Fill(dPhi,pow(wPhiEta,k)*TMath::Sin((h+1.)*dPhi));
1019  fPOIPhiDiffMul[k][h]->Fill(dPhi,pow(wPhiEta,k));
1020 
1021  fPOIPhiEtaDiffQRe[ITStype][k][h]->Fill(dPhi,dEta,pow(wPhiEta,k)*TMath::Cos((h+1.)*dPhi));
1022  fPOIPhiEtaDiffQIm[ITStype][k][h]->Fill(dPhi,dEta,pow(wPhiEta,k)*TMath::Sin((h+1.)*dPhi));
1023  fPOIPhiEtaDiffMul[ITStype][k][h]->Fill(dPhi,dEta,pow(wPhiEta,k));
1024 
1025  if(fabs(dEta)>fFlowQCDeltaEta/2.) {
1026  Int_t keta = (dEta<0.?0:1);
1027  fPOIPtDiffQReEG[keta][k][h]->Fill(dPt,pow(wPhiEta,k)*TMath::Cos((h+1.)*dPhi));
1028  fPOIPtDiffQImEG[keta][k][h]->Fill(dPt,pow(wPhiEta,k)*TMath::Sin((h+1.)*dPhi));
1029  fPOIPtDiffMulEG[keta][k][h]->Fill(dPt,pow(wPhiEta,k));
1030  fPOIPhiDiffQReEG[keta][k][h]->Fill(dPhi,pow(wPhiEta,k)*TMath::Cos((h+1.)*dPhi));
1031  fPOIPhiDiffQImEG[keta][k][h]->Fill(dPhi,pow(wPhiEta,k)*TMath::Sin((h+1.)*dPhi));
1032  fPOIPhiDiffMulEG[keta][k][h]->Fill(dPhi,pow(wPhiEta,k));
1033  }
1034 
1035  } else if(fFlowQCDeltaEta<0. && fFlowQCDeltaEta>-1.) {
1036 
1037  if(dEta>0.) {
1038  fPOIPtDiffQRe[k][h]->Fill(dPt,pow(wPhiEta,k)*TMath::Cos((h+1.)*dPhi));
1039  fPOIPtDiffQIm[k][h]->Fill(dPt,pow(wPhiEta,k)*TMath::Sin((h+1.)*dPhi));
1040  fPOIPtDiffMul[k][h]->Fill(dPt,pow(wPhiEta,k));
1041 
1042  fPOIPhiDiffQRe[k][h]->Fill(dPhi,pow(wPhiEta,k)*TMath::Cos((h+1.)*dPhi));
1043  fPOIPhiDiffQIm[k][h]->Fill(dPhi,pow(wPhiEta,k)*TMath::Sin((h+1.)*dPhi));
1044  fPOIPhiDiffMul[k][h]->Fill(dPhi,pow(wPhiEta,k));
1045 
1046  Double_t boundetagap = fabs(fFlowQCDeltaEta);
1047 
1048  if((dEta>0. && dEta<0.4-boundetagap/2.) || (dEta>0.4+boundetagap/2. && dEta<0.8)) {
1049  Int_t keta;
1050  if(dEta>0. && dEta<0.4-boundetagap/2.) keta = 0;
1051  else keta = 1;
1052  fPOIPtDiffQReEG[keta][k][h]->Fill(dPt,pow(wPhiEta,k)*TMath::Cos((h+1.)*dPhi));
1053  fPOIPtDiffQImEG[keta][k][h]->Fill(dPt,pow(wPhiEta,k)*TMath::Sin((h+1.)*dPhi));
1054  fPOIPtDiffMulEG[keta][k][h]->Fill(dPt,pow(wPhiEta,k));
1055  }
1056  } else {
1057  bFillDis = kFALSE;
1058  continue;
1059  }
1060 
1061  } else if(fFlowQCDeltaEta<-1. && fFlowQCDeltaEta>-2.) {
1062 
1063  if(dEta<0.) {
1064  fPOIPtDiffQRe[k][h]->Fill(dPt,pow(wPhiEta,k)*TMath::Cos((h+1.)*dPhi));
1065  fPOIPtDiffQIm[k][h]->Fill(dPt,pow(wPhiEta,k)*TMath::Sin((h+1.)*dPhi));
1066  fPOIPtDiffMul[k][h]->Fill(dPt,pow(wPhiEta,k));
1067 
1068  fPOIPhiDiffQRe[k][h]->Fill(dPhi,pow(wPhiEta,k)*TMath::Cos((h+1.)*dPhi));
1069  fPOIPhiDiffQIm[k][h]->Fill(dPhi,pow(wPhiEta,k)*TMath::Sin((h+1.)*dPhi));
1070  fPOIPhiDiffMul[k][h]->Fill(dPhi,pow(wPhiEta,k));
1071 
1072  Double_t boundetagap = fabs(fFlowQCDeltaEta)-1.;
1073 
1074  if((dEta<0. && dEta>-0.4+boundetagap/2.) || (dEta<-0.4-boundetagap/2. && dEta>-0.8)) {
1075  Int_t keta;
1076  if(dEta<0. && dEta>-0.4+boundetagap/2.) keta = 0;
1077  else keta = 1;
1078  fPOIPtDiffQReEG[keta][k][h]->Fill(dPt,pow(wPhiEta,k)*TMath::Cos((h+1.)*dPhi));
1079  fPOIPtDiffQImEG[keta][k][h]->Fill(dPt,pow(wPhiEta,k)*TMath::Sin((h+1.)*dPhi));
1080  fPOIPtDiffMulEG[keta][k][h]->Fill(dPt,pow(wPhiEta,k));
1081  }
1082  } else {
1083  bFillDis = kFALSE;
1084  continue;
1085  }
1086 
1087  }
1088  }
1089  }
1090 
1091  for (Int_t h=0;h<fFlowNHarmMax;h++) {
1092  fEtaDiffQRe[cw][h]->Fill(dEta,wPhiEta*TMath::Cos((h+1.)*dPhi));
1093  fEtaDiffQIm[cw][h]->Fill(dEta,wPhiEta*TMath::Sin((h+1.)*dPhi));
1094  fEtaDiffMul[cw][h]->Fill(dEta,pow(wPhiEta,h+1));
1095  fPOIEtaPtQRe[cw][h]->Fill(dEta,dPt,wPhiEta*TMath::Cos((h+1.)*dPhi));
1096  fPOIEtaPtQIm[cw][h]->Fill(dEta,dPt,wPhiEta*TMath::Sin((h+1.)*dPhi));
1097  fPOIEtaPtMul[cw][h]->Fill(dEta,dPt,wPhiEta);
1098  }
1099 
1100  if(fCalculateEbEFlow) {
1101  if(fEBEFlowMulBin>=0) fEbEFlowAzimDis[fEBEFlowMulBin]->Fill(dPhi,wPhiEta);
1102  }
1103 
1104  // WARNING: do not invert order of SPZDC and QC, used in SC
1105  if(bPassZDCcuts && fCalculateFlowZDC && fUseZDC) this->CalculateFlowSPZDC(ZCRe,ZCIm,ZARe,ZAIm,dPhi,dEta,dPt,wPhiEta,dCharge,i);
1106 
1107  if(bFillDis && bPassZDCcuts && fCalculateFlowZDC && fUseZDC) {
1108 
1109  fFlowSPZDCv1etaPro[fCenBin][0][7]->Fill(dEta,TMath::Cos(dPhi)*ZARe+TMath::Sin(dPhi)*ZAIm,wPhiEta);
1110  fFlowSPZDCv1etaPro[fCenBin][0][8]->Fill(dEta,TMath::Cos(dPhi)*ZCRe+TMath::Sin(dPhi)*ZCIm,wPhiEta);
1111  if(cw==0) {
1112  fFlowSPZDCv1etaPro[fCenBin][0][9]->Fill(dEta,TMath::Cos(dPhi)*ZARe+TMath::Sin(dPhi)*ZAIm,wPhiEta);
1113  fFlowSPZDCv1etaPro[fCenBin][0][10]->Fill(dEta,TMath::Cos(dPhi)*ZCRe+TMath::Sin(dPhi)*ZCIm,wPhiEta);
1114  } else {
1115  fFlowSPZDCv1etaPro[fCenBin][0][11]->Fill(dEta,TMath::Cos(dPhi)*ZARe+TMath::Sin(dPhi)*ZAIm,wPhiEta);
1116  fFlowSPZDCv1etaPro[fCenBin][0][12]->Fill(dEta,TMath::Cos(dPhi)*ZCRe+TMath::Sin(dPhi)*ZCIm,wPhiEta);
1117  }
1118 
1119  if(fStoreZDCQVecVtxPos) {
1120 // if(fCentralityEBE>5. && fCentralityEBE<40.) {
1121 // Int_t bw = (fbFlagIsPosMagField==kTRUE?0:1);
1122 // fCRCZDCQVecResv1QA[bw][0]->Fill(ZARe,ZAIm,TMath::Cos(dPhi)*ZARe+TMath::Sin(dPhi)*ZAIm,wPhiEta);
1123 // fCRCZDCQVecResv1QA[bw][1]->Fill(ZARe,ZAIm,TMath::Cos(dPhi)*ZCRe+TMath::Sin(dPhi)*ZCIm,wPhiEta);
1124 // if(i==0) fCRCZDCQVecResv1QA[bw][2]->Fill(ZARe,ZAIm,ZARe*ZAIm+ZCRe*ZCIm);
1125 //
1126 // fCRCZDCQVecResv1QC[bw][0]->Fill(ZCRe,ZCIm,TMath::Cos(dPhi)*ZARe+TMath::Sin(dPhi)*ZAIm,wPhiEta);
1127 // fCRCZDCQVecResv1QC[bw][1]->Fill(ZCRe,ZCIm,TMath::Cos(dPhi)*ZCRe+TMath::Sin(dPhi)*ZCIm,wPhiEta);
1128 // if(i==0) fCRCZDCQVecResv1QC[bw][2]->Fill(ZCRe,ZCIm,ZARe*ZAIm+ZCRe*ZCIm);
1129 //
1130 // fCRCZDCQVecResv1Cross[bw][0]->Fill(ZCRe*ZAIm,ZCIm*ZARe,TMath::Cos(dPhi)*ZARe+TMath::Sin(dPhi)*ZAIm,wPhiEta);
1131 // fCRCZDCQVecResv1Cross[bw][1]->Fill(ZCRe*ZAIm,ZCIm*ZARe,TMath::Cos(dPhi)*ZCRe+TMath::Sin(dPhi)*ZCIm,wPhiEta);
1132 // if(i==0) fCRCZDCQVecResv1Cross[bw][2]->Fill(ZCRe*ZAIm,ZCIm*ZARe,ZARe*ZAIm+ZCRe*ZCIm);
1133 // }
1134  }
1135 
1136 // if(fCentralityEBE>5. && fCentralityEBE<40.) {
1137 // if(fbFlagIsPosMagField) {
1138 // fFlowSPZDCv1etaProPhi[0]->Fill(dEta,dPhi,TMath::Cos(dPhi)*ZARe+TMath::Sin(dPhi)*ZAIm,wPhiEta);
1139 // fFlowSPZDCv1etaProPhi[1]->Fill(dEta,dPhi,TMath::Cos(dPhi)*ZCRe+TMath::Sin(dPhi)*ZCIm,wPhiEta);
1140 // if(cw==0) {
1141 // fFlowSPZDCv1etaProPhi[2]->Fill(dEta,dPhi,TMath::Cos(dPhi)*ZARe+TMath::Sin(dPhi)*ZAIm,wPhiEta);
1142 // fFlowSPZDCv1etaProPhi[3]->Fill(dEta,dPhi,TMath::Cos(dPhi)*ZCRe+TMath::Sin(dPhi)*ZCIm,wPhiEta);
1143 // } else {
1144 // fFlowSPZDCv1etaProPhi[4]->Fill(dEta,dPhi,TMath::Cos(dPhi)*ZARe+TMath::Sin(dPhi)*ZAIm,wPhiEta);
1145 // fFlowSPZDCv1etaProPhi[5]->Fill(dEta,dPhi,TMath::Cos(dPhi)*ZCRe+TMath::Sin(dPhi)*ZCIm,wPhiEta);
1146 // }
1147 // } else {
1148 // fFlowSPZDCv1etaProPhi[6]->Fill(dEta,dPhi,TMath::Cos(dPhi)*ZARe+TMath::Sin(dPhi)*ZAIm,wPhiEta);
1149 // fFlowSPZDCv1etaProPhi[7]->Fill(dEta,dPhi,TMath::Cos(dPhi)*ZCRe+TMath::Sin(dPhi)*ZCIm,wPhiEta);
1150 // if(cw==0) {
1151 // fFlowSPZDCv1etaProPhi[8]->Fill(dEta,dPhi,TMath::Cos(dPhi)*ZARe+TMath::Sin(dPhi)*ZAIm,wPhiEta);
1152 // fFlowSPZDCv1etaProPhi[9]->Fill(dEta,dPhi,TMath::Cos(dPhi)*ZCRe+TMath::Sin(dPhi)*ZCIm,wPhiEta);
1153 // } else {
1154 // fFlowSPZDCv1etaProPhi[10]->Fill(dEta,dPhi,TMath::Cos(dPhi)*ZARe+TMath::Sin(dPhi)*ZAIm,wPhiEta);
1155 // fFlowSPZDCv1etaProPhi[11]->Fill(dEta,dPhi,TMath::Cos(dPhi)*ZCRe+TMath::Sin(dPhi)*ZCIm,wPhiEta);
1156 // }
1157 // }
1158 // }
1159 // if(fCentralityEBE>5. && fCentralityEBE<40.) {
1160 // Double_t dITStype = ITStype+0.5;
1161 // if(fbFlagIsPosMagField) {
1162 // fFlowSPZDCv1etaProITS[0]->Fill(dEta,dITStype,TMath::Cos(dPhi)*ZARe+TMath::Sin(dPhi)*ZAIm,wPhiEta);
1163 // fFlowSPZDCv1etaProITS[1]->Fill(dEta,dITStype,TMath::Cos(dPhi)*ZCRe+TMath::Sin(dPhi)*ZCIm,wPhiEta);
1164 // if(cw==0) {
1165 // fFlowSPZDCv1etaProITS[2]->Fill(dEta,dITStype,TMath::Cos(dPhi)*ZARe+TMath::Sin(dPhi)*ZAIm,wPhiEta);
1166 // fFlowSPZDCv1etaProITS[3]->Fill(dEta,dITStype,TMath::Cos(dPhi)*ZCRe+TMath::Sin(dPhi)*ZCIm,wPhiEta);
1167 // } else {
1168 // fFlowSPZDCv1etaProITS[4]->Fill(dEta,dITStype,TMath::Cos(dPhi)*ZARe+TMath::Sin(dPhi)*ZAIm,wPhiEta);
1169 // fFlowSPZDCv1etaProITS[5]->Fill(dEta,dITStype,TMath::Cos(dPhi)*ZCRe+TMath::Sin(dPhi)*ZCIm,wPhiEta);
1170 // }
1171 // } else {
1172 // fFlowSPZDCv1etaProITS[6]->Fill(dEta,dITStype,TMath::Cos(dPhi)*ZARe+TMath::Sin(dPhi)*ZAIm,wPhiEta);
1173 // fFlowSPZDCv1etaProITS[7]->Fill(dEta,dITStype,TMath::Cos(dPhi)*ZCRe+TMath::Sin(dPhi)*ZCIm,wPhiEta);
1174 // if(cw==0) {
1175 // fFlowSPZDCv1etaProITS[8]->Fill(dEta,dITStype,TMath::Cos(dPhi)*ZARe+TMath::Sin(dPhi)*ZAIm,wPhiEta);
1176 // fFlowSPZDCv1etaProITS[9]->Fill(dEta,dITStype,TMath::Cos(dPhi)*ZCRe+TMath::Sin(dPhi)*ZCIm,wPhiEta);
1177 // } else {
1178 // fFlowSPZDCv1etaProITS[10]->Fill(dEta,dITStype,TMath::Cos(dPhi)*ZARe+TMath::Sin(dPhi)*ZAIm,wPhiEta);
1179 // fFlowSPZDCv1etaProITS[11]->Fill(dEta,dITStype,TMath::Cos(dPhi)*ZCRe+TMath::Sin(dPhi)*ZCIm,wPhiEta);
1180 // }
1181 // }
1182 // if(fbFlagIsPosMagField) {
1183 // fFlowSPZDCv1etaProITSDis[0][ITStype]->Fill(dEta,dPhi,wPhiEta);
1184 // } else {
1185 // fFlowSPZDCv1etaProITSDis[1][ITStype]->Fill(dEta,dPhi,wPhiEta);
1186 // }
1187 // }
1188 
1189  // all runs
1190  fCRCQVecPhiHist->Fill(fCentralityEBE,dPhi,dEta,wPhiEta);
1191  fCRCQVecPhiHistCh[cw]->Fill(fCentralityEBE,dPhi,dEta,wPhiEta);
1192  Int_t ptbebe = (dPt>1.? 2 : (dPt>0.5 ? 1 : 0)); // hardcoded
1193  fCRCQVecPhiHistChPt[cw][ptbebe]->Fill(fCentralityEBE,dPhi,dEta,wPhiEta);
1194  for (Int_t h=0;h<6;h++) {
1195  fCRCQVecHarCosProCh[cw]->Fill(fCentralityEBE,(Double_t)h+0.5,dEta,TMath::Cos((h+1.)*dPhi),wPhiEta);
1196  fCRCQVecHarSinProCh[cw]->Fill(fCentralityEBE,(Double_t)h+0.5,dEta,TMath::Sin((h+1.)*dPhi),wPhiEta);
1197  }
1198  Double_t FillCw = (fbFlagIsPosMagField==kTRUE?(cw==0?0.5:1.5):(cw==0?2.5:3.5));
1199  if(fCentralityEBE>5. && fCentralityEBE<40.) {
1200  fCRCQVecPtHistMagField->Fill(dPt,FillCw,wPhiEta);
1201  }
1202 
1203  // run-by-run
1204 // fCRCQVecPhiRbRHist[fRunBin]->Fill(fCentralityEBE,dPhi,dEta,wPhiEta);
1205 // fCRCQVecPhiRbRHistCh[fRunBin][cw]->Fill(fCentralityEBE,dPhi,dEta,wPhiEta);
1206  if(fCentralityEBE>0. && fCentralityEBE<70.) {
1207 // fCRCQVecPhiVtxHist[etab]->Fill(fVtxPosCor[0],fVtxPosCor[1],fVtxPosCor[2],dPhi,wPhiEta);
1208 // fCRCQVecEtaHist[fRunBin][0]->Fill(dEta,fVtxPosCor[0],TMath::Cos(dPhi),wPhiEta*fCenWeightEbE);
1209 // fCRCQVecEtaHist[fRunBin][1]->Fill(dEta,fVtxPosCor[1],TMath::Cos(dPhi),wPhiEta*fCenWeightEbE);
1210 // fCRCQVecEtaHist[fRunBin][2]->Fill(dEta,fVtxPosCor[2],TMath::Cos(dPhi),wPhiEta*fCenWeightEbE);
1211 // fCRCQVecEtaHist[fRunBin][3]->Fill(dEta,fVtxPosCor[0],TMath::Sin(dPhi),wPhiEta*fCenWeightEbE);
1212 // fCRCQVecEtaHist[fRunBin][4]->Fill(dEta,fVtxPosCor[1],TMath::Sin(dPhi),wPhiEta*fCenWeightEbE);
1213 // fCRCQVecEtaHist[fRunBin][5]->Fill(dEta,fVtxPosCor[2],TMath::Sin(dPhi),wPhiEta*fCenWeightEbE);
1214  }
1215 
1216 // fCRCTPCQVecCenEComTot[fRunBin][0+cw*2]->Fill(fCentralityEBE,(ZCM+ZAM)/2.,TMath::Cos(dPhi),wPhiEta);
1217 // fCRCTPCQVecCenEComTot[fRunBin][1+cw*2]->Fill(fCentralityEBE,(ZCM+ZAM)/2.,TMath::Sin(dPhi),wPhiEta);
1218 // fCRCTPCQVecCenRefMulTot[fRunBin][0+cw*2]->Fill(fCentralityEBE,fReferenceMultiplicityRecEBE,TMath::Cos(dPhi),wPhiEta);
1219 // fCRCTPCQVecCenRefMulTot[fRunBin][1+cw*2]->Fill(fCentralityEBE,fReferenceMultiplicityRecEBE,TMath::Sin(dPhi),wPhiEta);
1220 // Int_t bw = (fbFlagIsPosMagField==kTRUE?0:1);
1221 // fCRCTPCQVecCenEtaRefMulTot[bw][0+cw*2]->Fill(fCentralityEBE,dEta,fReferenceMultiplicityEBE,TMath::Cos(dPhi),wPhiEta);
1222 // fCRCTPCQVecCenEtaRefMulTot[bw][1+cw*2]->Fill(fCentralityEBE,dEta,fReferenceMultiplicityEBE,TMath::Sin(dPhi),wPhiEta);
1223 
1224  }
1225 // fCRCQVecPhiHistVtxDep[fRunBin][fCenBin]->Fill(fVtxPos[2],dPhi,dEta,wPhiEta);
1227  fFlowQCSpectraCharge[cw]->Fill(fCentralityEBE,dPt,wPhiEta*fCenWeightEbE);
1228 
1229  } // end of if(pTrack->InPOISelection())
1230  } else // to if(aftsTrack)
1231  {
1232  printf("\n WARNING (QC): No particle (i.e. aftsTrack is a NULL pointer in AFAWQC::Make())!!!!\n\n");
1233  }
1234  } // end of for(Int_t i=0;i<nPrim;i++)
1235 
1236  // ************************************************************************************************************
1237 
1238  // e) Calculate the final expressions for S_{p,k} and s_{p,k} (important !!!!):
1239  for(Int_t p=0;p<8;p++)
1240  {
1241  for(Int_t k=0;k<9;k++)
1242  {
1243  (*fSpk)(p,k)=pow((*fSpk)(p,k),p+1);
1244  }
1245  }
1246 
1247  // f) Call the methods which calculate correlations for reference flow:
1249  {
1251  {
1252  if(fNumberOfRPsEBE>1){this->CalculateIntFlowCorrelations();} // without using particle weights
1253  } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
1254  {
1255  if(fNumberOfRPsEBE>1){this->CalculateIntFlowCorrelationsUsingParticleWeights();} // with using particle weights
1256  }
1257  // Whether or not using particle weights the following is calculated in the same way:
1261  // Non-isotropic terms:
1263  {
1266  } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
1267  {
1270  }
1271  // Whether or not using particle weights the following is calculated in the same way:
1275  // Mixed harmonics:
1277  } // end of if(!fEvaluateIntFlowNestedLoops)
1278 
1279  // g) Call the methods which calculate correlations for differential flow:
1281  {
1283  {
1284  // Without using particle weights:
1285  this->CalculateDiffFlowCorrelations("RP","Pt");
1287  this->CalculateDiffFlowCorrelations("POI","Pt");
1289  // Non-isotropic terms:
1298  } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
1299  {
1300  // With using particle weights:
1305  // Non-isotropic terms:
1314  }
1315  // Whether or not using particle weights the following is calculated in the same way:
1316  this->CalculateDiffFlowProductOfCorrelations("RP","Pt");
1318  this->CalculateDiffFlowProductOfCorrelations("POI","Pt");
1320  this->CalculateDiffFlowSumOfEventWeights("RP","Pt");
1322  this->CalculateDiffFlowSumOfEventWeights("POI","Pt");
1328  } // end of if(!fEvaluateDiffFlowNestedLoops && fCalculateDiffFlow)
1329 
1330  // h) Call the methods which calculate correlations for 2D differential flow:
1332  {
1334  {
1335  // Without using particle weights:
1336  this->Calculate2DDiffFlowCorrelations("RP");
1337  this->Calculate2DDiffFlowCorrelations("POI");
1338  // Non-isotropic terms:
1339  // ... to be ctd ...
1340  } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
1341  {
1342  // With using particle weights:
1343  // ... to be ctd ...
1344  // Non-isotropic terms:
1345  // ... to be ctd ...
1346  }
1347  // Whether or not using particle weights the following is calculated in the same way:
1348  // ... to be ctd ...
1349  } // end of if(!fEvaluateDiffFlowNestedLoops && fCalculate2DDiffFlow)
1350 
1351  // i) Call the methods which calculate other differential correlators:
1353  {
1355  {
1356  // Without using particle weights:
1357  this->CalculateOtherDiffCorrelators("RP","Pt");
1359  this->CalculateOtherDiffCorrelators("POI","Pt");
1361  } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
1362  {
1363  // With using particle weights:
1364  // ... to be ctd ...
1365  }
1366  // Whether or not using particle weights the following is calculated in the same way:
1367  // ... to be ctd ...
1368  } // end of if(!fEvaluateDiffFlowNestedLoops)
1369 
1370  // i.2) Calculate CRC quantities:
1371  if(fCalculateCRC) {
1372  if(fCalculateCRCInt) this->CalculateCRCCorr();
1373  if(fCalculateCRC2) this->CalculateCRC2Cor();
1375  if(fCalculateCRCZDC && fUseZDC) this->CalculateCRCZDC();
1376  if(fCalculateCRCPt) this->CalculateCRCPtCorr();
1377  // if(fUseVZERO && fUseZDC) this->CalculateVZvsZDC();
1378  if(fCalculateCME && fUseZDC) {
1379  this->CalculateCMETPC();
1380  this->CalculateCMEZDC();
1381  }
1382  }
1383  if(fCalculateFlowQC) {
1384  this->CalculateFlowSCZDC();
1385  this->CalculateFlowQC();
1386  this->CalculateFlowQCHighOrders();
1387  }
1389  if(fCalculateEbEFlow) this->FitEbEFlow();
1390 
1391  // j) Distributions of correlations:
1393 
1394  // l) Cross-check with nested loops correlators for reference flow:
1396 
1397  // m) Cross-check with nested loops correlators for differential flow:
1399 
1400  // n) Store multiplicity in various:
1401  if(fStoreVarious) this->FillVarious();
1402 
1403  // o) Reset all event-by-event quantities (very important !!!!):
1405 
1406  // p) cache run number
1408 
1409  fQAZDCCutsFlag = kTRUE;
1410 
1411 // printf("end AliFlowAnalysisCRC::Make \n");
1412 
1413 } // end of AliFlowAnalysisCRC::Make(AliFlowEventSimple* anEvent)
1414 
1415 //=======================================================================================================================
1416 
1418 {
1419  // Calculate the final results.
1420 
1421  // a) Check all pointers used in this method;
1422  // b) Access the constants;
1423  // c) Access the flags;
1424  // d) Calculate reference cumulants (not corrected for detector effects);
1425  // e) Correct reference cumulants for detector effects;
1426  // f) Calculate reference flow;
1427  // g) Store results for reference flow in AliFlowCommonHistResults and print them on the screen;
1428  // h) Calculate the final results for differential flow (without/with weights);
1429  // i) Correct the results for differential flow (without/with weights) for effects of non-uniform acceptance (NUA);
1430  // j) Calculate the final results for integrated flow (RP/POI) and store in AliFlowCommonHistResults;
1431  // k) Store results for differential flow in AliFlowCommonHistResults;
1432  // l) Print the final results for integrated flow (RP/POI) on the screen;
1433  // m) Cross-checking: Results from Q-vectors vs results from nested loops;
1434  // n) Calculate cumulants for mixed harmonics;
1435  // o) Calculate charge-rapidity correlations;
1436  // p) Calculate cumulants for bootstrap;
1437  // q) Finalize various;
1438 
1439  // a) Check all pointers used in this method:
1440  this->CheckPointersUsedInFinish();
1441 
1442  // b) Access the constants:
1443  this->CommonConstants("Finish");
1444 
1446  fHarmonic = (Int_t)(fCommonHists->GetHarmonic())->GetBinContent(1);
1447  }
1448 
1449  // c) Access the flags: // tbi (implement a method for this? should I store again the flags because they can get modified with redoFinish?)
1450  fUsePhiWeights = (Bool_t)fUseParticleWeights->GetBinContent(1);
1451  fUsePtWeights = (Bool_t)fUseParticleWeights->GetBinContent(2);
1452  fUseEtaWeights = (Bool_t)fUseParticleWeights->GetBinContent(3);
1453  fUseTrackWeights = (Bool_t)fUseParticleWeights->GetBinContent(4);
1454  fUsePhiEtaWeights = (Bool_t)fUseParticleWeights->GetBinContent(5);
1455  fUsePhiEtaWeightsChDep = (Bool_t)fUseParticleWeights->GetBinContent(6);
1456  fUsePhiEtaWeightsVtxDep = (Bool_t)fUseParticleWeights->GetBinContent(7);
1458  fApplyCorrectionForNUA = (Bool_t)fIntFlowFlags->GetBinContent(3);
1459  fPrintFinalResults[0] = (Bool_t)fIntFlowFlags->GetBinContent(4);
1460  fPrintFinalResults[1] = (Bool_t)fIntFlowFlags->GetBinContent(5);
1461  fPrintFinalResults[2] = (Bool_t)fIntFlowFlags->GetBinContent(6);
1462  fPrintFinalResults[3] = (Bool_t)fIntFlowFlags->GetBinContent(7);
1463  fApplyCorrectionForNUAVsM = (Bool_t)fIntFlowFlags->GetBinContent(8);
1464  fPropagateErrorAlsoFromNIT = (Bool_t)fIntFlowFlags->GetBinContent(9);
1465  fCalculateCumulantsVsM = (Bool_t)fIntFlowFlags->GetBinContent(10);
1466  fMinimumBiasReferenceFlow = (Bool_t)fIntFlowFlags->GetBinContent(11);
1467  fForgetAboutCovariances = (Bool_t)fIntFlowFlags->GetBinContent(12);
1468  fStoreVarious = (Bool_t)fIntFlowFlags->GetBinContent(13);
1469  fFillMultipleControlHistograms = (Bool_t)fIntFlowFlags->GetBinContent(14);
1470  fCalculateAllCorrelationsVsM = (Bool_t)fIntFlowFlags->GetBinContent(15);
1471  fUse2DHistograms = (Bool_t)fIntFlowFlags->GetBinContent(18);
1472  fFillProfilesVsMUsingWeights = (Bool_t)fIntFlowFlags->GetBinContent(19);
1473  fUseQvectorTerms = (Bool_t)fIntFlowFlags->GetBinContent(20);
1476  fCrossCheckInPtBinNo = (Int_t)fEvaluateNestedLoops->GetBinContent(3);
1477  fCrossCheckInEtaBinNo = (Int_t)fEvaluateNestedLoops->GetBinContent(4);
1479  //fHarmonic = (Int_t)fMixedHarmonicsFlags->GetBinContent(2); // TBI should I add inpdependent generic harmonic here?
1481  fUseBootstrap = (Bool_t)fBootstrapFlags->GetBinContent(1);
1482  fUseBootstrapVsM = (Bool_t)fBootstrapFlags->GetBinContent(2);
1483  fnSubsamples = (Int_t)fBootstrapFlags->GetBinContent(3);
1484 
1485  // d) Calculate reference cumulants (not corrected for detector effects):
1488  this->CalculateCumulantsIntFlow();
1489 
1490  // e) Correct reference cumulants for detector effects:
1494 
1495  // f) Calculate reference flow:
1496  this->CalculateReferenceFlow();
1497 
1498  // g) Store results for reference flow in AliFlowCommonHistResults and print them on the screen:
1502 
1503  // h) Calculate the final results for differential flow (without/with weights):
1504  if(fCalculateDiffFlow)
1505  {
1506  this->FinalizeReducedCorrelations("RP","Pt");
1508  this->FinalizeReducedCorrelations("POI","Pt");
1509  if(fCalculateDiffFlowVsEta){this->FinalizeReducedCorrelations("POI","Eta");}
1510  this->CalculateDiffFlowCovariances("RP","Pt");
1512  this->CalculateDiffFlowCovariances("POI","Pt");
1513  if(fCalculateDiffFlowVsEta){this->CalculateDiffFlowCovariances("POI","Eta");}
1514  this->CalculateDiffFlowCumulants("RP","Pt");
1515  if(fCalculateDiffFlowVsEta){this->CalculateDiffFlowCumulants("RP","Eta");}
1516  this->CalculateDiffFlowCumulants("POI","Pt");
1517  if(fCalculateDiffFlowVsEta){this->CalculateDiffFlowCumulants("POI","Eta");}
1518  this->CalculateDiffFlow("RP","Pt");
1519  if(fCalculateDiffFlowVsEta){this->CalculateDiffFlow("RP","Eta");}
1520  this->CalculateDiffFlow("POI","Pt");
1521  if(fCalculateDiffFlowVsEta){this->CalculateDiffFlow("POI","Eta");}
1522  } // if(fCalculateDiffFlow)
1523 
1524  // i) Correct the results for differential flow (without/with weights) for effects of non-uniform acceptance (NUA):
1525  if(fCalculateDiffFlow)
1526  {
1527  this->FinalizeCorrectionTermsForNUADiffFlow("RP","Pt");
1529  this->FinalizeCorrectionTermsForNUADiffFlow("POI","Pt");
1536  {
1537  this->CalculateDiffFlowCorrectedForNUA("RP","Pt");
1539  this->CalculateDiffFlowCorrectedForNUA("POI","Pt");
1541  }
1542  } // end of if(fCalculateDiffFlow && fApplyCorrectionForNUA)
1543 
1544  // i) Calcualate final results for 2D differential flow:
1546  {
1547  this->Calculate2DDiffFlowCumulants("RP");
1548  this->Calculate2DDiffFlowCumulants("POI");
1549  this->Calculate2DDiffFlow("RP");
1550  this->Calculate2DDiffFlow("POI");
1551  } // end of if(fCalculate2DDiffFlow)
1552 
1553  // j) Calculate the final results for integrated flow (RP/POI) and store in AliFlowCommonHistResults:
1554  if(fCalculateDiffFlow)
1555  {
1558  }
1559 
1560  // k) Store results for differential flow in AliFlowCommonHistResults:
1561  if(fCalculateDiffFlow)
1562  {
1563  this->FillCommonHistResultsDiffFlow("RP");
1564  this->FillCommonHistResultsDiffFlow("POI");
1565  }
1566 
1567  // l) Print the final results for integrated flow (RP/POI) on the screen:
1570 
1571  // m) Cross-checking: Results from Q-vectors vs results from nested loops:
1572  // m1) Reference flow:
1574  {
1579  } // end of if(fEvaluateIntFlowNestedLoops)
1580  // m2) Differential flow:
1582  {
1583  // Correlations:
1585  this->CrossCheckDiffFlowCorrelations("RP","Pt");
1587  this->CrossCheckDiffFlowCorrelations("POI","Pt");
1589  // Correction terms for non-uniform acceptance:
1590  this->CrossCheckDiffFlowCorrectionTermsForNUA("RP","Pt");
1592  this->CrossCheckDiffFlowCorrectionTermsForNUA("POI","Pt");
1594  // Other differential correlators:
1595  this->CrossCheckOtherDiffCorrelators("RP","Pt");
1597  this->CrossCheckOtherDiffCorrelators("POI","Pt");
1599  } // end of if(fEvaluateDiffFlowNestedLoops)
1600 
1601  // n) Calculate cumulants for mixed harmonics:
1603 
1604  // o) Calculate charge-rapidity correlations:
1605  if(fCalculateCRC) {
1606  if(fCalculateCRCInt) this->FinalizeCRCCorr();
1607  if(fCalculateCRC2) this->FinalizeCRC2Cor();
1609  if(fCalculateCRCZDC && fUseZDC) this->FinalizeCRCZDC();
1610  if(fCalculateCRCPt) this->FinalizeCRCPtCorr();
1611  if(fCalculateCME && fUseZDC) {
1612  this->FinalizeCMETPC();
1613  this->FinalizeCMEZDC();
1614  }
1615  }
1616  // WARNING: do not invert order of SPZDC and QC, used in SC
1618  if(fCalculateFlowQC) {
1619  this->FinalizeFlowQC();
1620  this->FinalizeFlowQCHighOrders();
1621  }
1623 
1624  // p) Calculate cumulants for bootstrap:
1626 
1627  // q) Finalize various:
1628  if(fStoreVarious) this->FinalizeVarious();
1629 
1630 } // end of AliFlowAnalysisCRC::Finish()
1631 
1632 //=======================================================================================================================
1633 
1635 {
1636  // Evaluate all correlators for reference flow with nested loops.
1637 
1638  Int_t nPrim = anEvent->NumberOfTracks(); // number of primaries
1639  if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10
1640  {
1641  // Without using particle weights:
1643  {
1644  // Correlations:
1645  this->CalculateIntFlowCorrelations(); // from Q-vectors
1646  this->EvaluateIntFlowCorrelationsWithNestedLoops(anEvent); // from nested loops (TBI: do I have to pass here anEvent or not?)
1647  // Correction for non-uniform acceptance:
1648  this->CalculateIntFlowCorrectionsForNUASinTerms(); // from Q-vectors (sin terms)
1649  this->CalculateIntFlowCorrectionsForNUACosTerms(); // from Q-vectors (cos terms)
1650  this->EvaluateIntFlowCorrectionsForNUAWithNestedLoops(anEvent); // from nested loops (both sin and cos terms)
1651  // Mixed harmonics:
1653  {
1654  this->CalculateMixedHarmonics(); // from Q-vectors
1655  this->EvaluateMixedHarmonicsWithNestedLoops(anEvent); // from nested loops (TBI: do I have to pass here anEvent or not?)
1656  } // end of if(fCalculateMixedHarmonics)
1657  }
1658  // Using particle weights:
1660  {
1661  // Correlations
1662  this->CalculateIntFlowCorrelationsUsingParticleWeights(); // from Q-vectors
1663  this->EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent); // from nested loops (to be improved: do I have to pass here anEvent or not?)
1664  // Correction for non-uniform acceptance:
1665  this->CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights(); // from Q-vectors (sin terms)
1666  this->CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights(); // from Q-vectors (cos terms)
1667  this->EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(anEvent); // from nested loops (both sin and cos terms)
1668  }
1669  } else if(nPrim>fMaxAllowedMultiplicity) // to if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity)
1670  {
1671  cout<<endl;
1672  cout<<"Skipping the event because multiplicity is "<<nPrim<<". Too high to evaluate nested loops!"<<endl;
1673  } else
1674  {
1675  cout<<endl;
1676  cout<<"Skipping the event because multiplicity is "<<nPrim<<"."<<endl;
1677  }
1678 
1679 } // end of void AliFlowAnalysisCRC::EvaluateIntFlowNestedLoops(AliFlowEventSimple* anEvent)
1680 
1681 //=======================================================================================================================
1682 
1684 {
1685  // Evalauted all correlators for differential flow with nested loops.
1686 
1687  if(!fCalculateDiffFlow){return;}
1688 
1689  Int_t nPrim = anEvent->NumberOfTracks(); // number of primaries
1690  if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10
1691  {
1692  // Without using particle weights:
1694  {
1695  // 1.) Reduced correlations:
1696  // Q-vectors:
1697  this->CalculateDiffFlowCorrelations("RP","Pt");
1698  this->CalculateDiffFlowCorrelations("RP","Eta");
1699  this->CalculateDiffFlowCorrelations("POI","Pt");
1700  this->CalculateDiffFlowCorrelations("POI","Eta");
1701  // Nested loops:
1702  this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"RP","Pt");
1703  this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"RP","Eta");
1704  this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"POI","Pt");
1705  this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"POI","Eta");
1706  // 2.) Reduced corrections for non-uniform acceptance:
1707  // Q-vectors:
1711  this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Eta");
1715  this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Eta");
1716  // Nested loops:
1718  this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"RP","Eta");
1719  this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"POI","Pt");
1720  this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"POI","Eta");
1721  // 3.) Other differential correlators:
1722  // Q-vectors:
1723  this->CalculateOtherDiffCorrelators("RP","Pt");
1724  this->CalculateOtherDiffCorrelators("RP","Eta");
1725  this->CalculateOtherDiffCorrelators("POI","Pt");
1726  this->CalculateOtherDiffCorrelators("POI","Eta");
1727  // Nested loops:
1728  this->EvaluateOtherDiffCorrelatorsWithNestedLoops(anEvent,"RP","Pt");
1729  this->EvaluateOtherDiffCorrelatorsWithNestedLoops(anEvent,"RP","Eta");
1730  this->EvaluateOtherDiffCorrelatorsWithNestedLoops(anEvent,"POI","Pt");
1731  this->EvaluateOtherDiffCorrelatorsWithNestedLoops(anEvent,"POI","Eta");
1732  } // end of if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights))
1733  // Using particle weights:
1735  {
1756  } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights)
1757  } // end of if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10
1758 
1759 } // end of void AliFlowAnalysisCRC::EvaluateDiffFlowNestedLoops(AliFlowEventSimple* anEvent)
1760 
1761 //=======================================================================================================================
1762 
1764 {
1765  // Calculate correction terms for non-uniform acceptance of the detector for reference flow (cos terms).
1766 
1767  // multiplicity:
1768  Double_t dMult = (*fSpk)(0,0);
1769 
1770  // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
1771  Double_t dReQ1n = (*fReQ)(0,0);
1772  Double_t dReQ2n = (*fReQ)(1,0);
1773  //Double_t dReQ3n = (*fReQ)(2,0);
1774  //Double_t dReQ4n = (*fReQ)(3,0);
1775  Double_t dImQ1n = (*fImQ)(0,0);
1776  Double_t dImQ2n = (*fImQ)(1,0);
1777  //Double_t dImQ3n = (*fImQ)(2,0);
1778  //Double_t dImQ4n = (*fImQ)(3,0);
1779 
1780  // Multiplicity bin of an event (relevant for all histos vs M):
1781  Double_t dMultiplicityBin = 0.;
1783  {
1784  dMultiplicityBin = fNumberOfRPsEBE+0.5;
1786  {
1787  dMultiplicityBin = fReferenceMultiplicityEBE+0.5;
1789  {
1790  dMultiplicityBin = fNumberOfPOIsEBE+0.5;
1791  }
1792 
1793  // *************************************************************
1794  // **** corrections for non-uniform acceptance (cos terms): ****
1795  // *************************************************************
1796  //
1797  // Remark 1: corrections for non-uniform acceptance (cos terms) calculated with non-weighted Q-vectors
1798  // are stored in 1D profile fQCorrectionsCos.
1799  // Remark 2: binning of fIntFlowCorrectionTermsForNUAPro[1] is organized as follows:
1800  // --------------------------------------------------------------------------------------------------------------------
1801  // 1st bin: <<cos(n*(phi1))>> = cosP1n
1802  // 2nd bin: <<cos(n*(phi1+phi2))>> = cosP1nP1n
1803  // 3rd bin: <<cos(n*(phi1-phi2-phi3))>> = cosP1nM1nM1n
1804  // 4th bin: <<cos(n*(2phi1-phi2))>> = cosP2nM1n
1805  // --------------------------------------------------------------------------------------------------------------------
1806 
1807  // 1-particle:
1808  Double_t cosP1n = 0.; // <<cos(n*(phi1))>>
1809 
1810  if(dMult>0)
1811  {
1812  cosP1n = dReQ1n/dMult;
1813 
1814  // average non-weighted 1-particle correction (cos terms) for non-uniform acceptance for single event:
1815  fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(1,cosP1n);
1816  // event weights for NUA terms:
1817  fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(1,dMult);
1818 
1819  // final average non-weighted 1-particle correction (cos terms) for non-uniform acceptance for all events:
1820  fIntFlowCorrectionTermsForNUAPro[1]->Fill(0.5,cosP1n,dMult);
1821  if(fCalculateCumulantsVsM){fIntFlowCorrectionTermsForNUAVsMPro[1][0]->Fill(dMultiplicityBin,cosP1n,dMult);}
1822  }
1823 
1824  // 2-particle:
1825  Double_t cosP1nP1n = 0.; // <<cos(n*(phi1+phi2))>>
1826  Double_t cosP2nM1n = 0.; // <<cos(n*(2phi1-phi2))>>
1827 
1828  if(dMult>1)
1829  {
1830  cosP1nP1n = (pow(dReQ1n,2)-pow(dImQ1n,2)-dReQ2n)/(dMult*(dMult-1));
1831  cosP2nM1n = (dReQ2n*dReQ1n+dImQ2n*dImQ1n-dReQ1n)/(dMult*(dMult-1));
1832 
1833  // average non-weighted 2-particle correction (cos terms) for non-uniform acceptance for single event:
1834  fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(2,cosP1nP1n);
1835  fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(4,cosP2nM1n);
1836  // event weights for NUA terms:
1837  fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(2,dMult*(dMult-1));
1838  fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(4,dMult*(dMult-1));
1839 
1840  // final average non-weighted 2-particle correction (cos terms) for non-uniform acceptance for all events:
1841  fIntFlowCorrectionTermsForNUAPro[1]->Fill(1.5,cosP1nP1n,dMult*(dMult-1));
1842  fIntFlowCorrectionTermsForNUAPro[1]->Fill(3.5,cosP2nM1n,dMult*(dMult-1));
1844  {
1845  fIntFlowCorrectionTermsForNUAVsMPro[1][1]->Fill(dMultiplicityBin,cosP1nP1n,dMult*(dMult-1));
1846  fIntFlowCorrectionTermsForNUAVsMPro[1][3]->Fill(dMultiplicityBin,cosP2nM1n,dMult*(dMult-1));
1847  }
1848  }
1849 
1850  // 3-particle:
1851  Double_t cosP1nM1nM1n = 0.; // <<cos(n*(phi1-phi2-phi3))>>
1852 
1853  if(dMult>2)
1854  {
1855  cosP1nM1nM1n = (dReQ1n*(pow(dReQ1n,2)+pow(dImQ1n,2))-dReQ1n*dReQ2n-dImQ1n*dImQ2n-2.*(dMult-1)*dReQ1n)
1856  / (dMult*(dMult-1)*(dMult-2));
1857 
1858  // average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for single event:
1859  fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(3,cosP1nM1nM1n);
1860  // event weights for NUA terms:
1861  fIntFlowEventWeightForCorrectionTermsForNUAEBE[1]->SetBinContent(3,dMult*(dMult-1)*(dMult-2));
1862 
1863  // final average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for all events:
1864  fIntFlowCorrectionTermsForNUAPro[1]->Fill(2.5,cosP1nM1nM1n,dMult*(dMult-1)*(dMult-2));
1865  if(fCalculateCumulantsVsM){fIntFlowCorrectionTermsForNUAVsMPro[1][2]->Fill(dMultiplicityBin,cosP1nM1nM1n,dMult*(dMult-1)*(dMult-2));}
1866  }
1867 
1868 } // end of AliFlowAnalysisCRC::CalculateIntFlowCorrectionsForNUACosTerms()
1869 
1870 //=======================================================================================================================
1871 
1873 {
1874  // calculate corrections for non-uniform acceptance of the detector for no-name integrated flow (sin terms)
1875 
1876  // multiplicity:
1877  Double_t dMult = (*fSpk)(0,0);
1878 
1879  // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n:
1880  Double_t dReQ1n = (*fReQ)(0,0);
1881  Double_t dReQ2n = (*fReQ)(1,0);
1882  //Double_t dReQ3n = (*fReQ)(2,0);
1883  //Double_t dReQ4n = (*fReQ)(3,0);
1884  Double_t dImQ1n = (*fImQ)(0,0);
1885  Double_t dImQ2n = (*fImQ)(1,0);
1886  //Double_t dImQ3n = (*fImQ)(2,0);
1887  //Double_t dImQ4n = (*fImQ)(3,0);
1888 
1889  // Multiplicity bin of an event (relevant for all histos vs M):
1890  Double_t dMultiplicityBin = 0.;
1892  {
1893  dMultiplicityBin = fNumberOfRPsEBE+0.5;
1895  {
1896  dMultiplicityBin = fReferenceMultiplicityEBE+0.5;
1898  {
1899  dMultiplicityBin = fNumberOfPOIsEBE+0.5;
1900  }
1901 
1902  // *************************************************************
1903  // **** corrections for non-uniform acceptance (sin terms): ****
1904  // *************************************************************
1905  //
1906  // Remark 1: corrections for non-uniform acceptance (sin terms) calculated with non-weighted Q-vectors
1907  // are stored in 1D profile fQCorrectionsSin.
1908  // Remark 2: binning of fIntFlowCorrectionTermsForNUAPro[0] is organized as follows:
1909  // --------------------------------------------------------------------------------------------------------------------
1910  // 1st bin: <<sin(n*(phi1))>> = sinP1n
1911  // 2nd bin: <<sin(n*(phi1+phi2))>> = sinP1nP1n
1912  // 3rd bin: <<sin(n*(phi1-phi2-phi3))>> = sinP1nM1nM1n
1913  // 4th bin: <<sin(n*(2phi1-phi2))>> = sinP2nM1n
1914  // --------------------------------------------------------------------------------------------------------------------
1915 
1916  // 1-particle:
1917  Double_t sinP1n = 0.; // <sin(n*(phi1))>
1918 
1919  if(dMult>0)
1920  {
1921  sinP1n = dImQ1n/dMult;
1922 
1923  // average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for single event:
1924  fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(1,sinP1n);
1925  // event weights for NUA terms:
1926  fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(1,dMult);
1927 
1928  // final average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
1929  fIntFlowCorrectionTermsForNUAPro[0]->Fill(0.5,sinP1n,dMult);
1930  if(fCalculateCumulantsVsM){fIntFlowCorrectionTermsForNUAVsMPro[0][0]->Fill(dMultiplicityBin,sinP1n,dMult);}
1931  }
1932 
1933  // 2-particle:
1934  Double_t sinP1nP1n = 0.; // <<sin(n*(phi1+phi2))>>
1935  Double_t sinP2nM1n = 0.; // <<sin(n*(2phi1-phi2))>>
1936  if(dMult>1)
1937  {
1938  sinP1nP1n = (2.*dReQ1n*dImQ1n-dImQ2n)/(dMult*(dMult-1));
1939  sinP2nM1n = (dImQ2n*dReQ1n-dReQ2n*dImQ1n-dImQ1n)/(dMult*(dMult-1));
1940 
1941  // average non-weighted 2-particle correction (sin terms) for non-uniform acceptance for single event:
1942  fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(2,sinP1nP1n);
1943  fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(4,sinP2nM1n);
1944  // event weights for NUA terms:
1945  fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(2,dMult*(dMult-1));
1946  fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(4,dMult*(dMult-1));
1947 
1948  // final average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for all events:
1949  fIntFlowCorrectionTermsForNUAPro[0]->Fill(1.5,sinP1nP1n,dMult*(dMult-1));
1950  fIntFlowCorrectionTermsForNUAPro[0]->Fill(3.5,sinP2nM1n,dMult*(dMult-1));
1952  {
1953  fIntFlowCorrectionTermsForNUAVsMPro[0][1]->Fill(dMultiplicityBin,sinP1nP1n,dMult*(dMult-1));
1954  fIntFlowCorrectionTermsForNUAVsMPro[0][3]->Fill(dMultiplicityBin,sinP2nM1n,dMult*(dMult-1));
1955  }
1956  }
1957 
1958  // 3-particle:
1959  Double_t sinP1nM1nM1n = 0.; // <<sin(n*(phi1-phi2-phi3))>>
1960 
1961  if(dMult>2)
1962  {
1963  sinP1nM1nM1n = (-dImQ1n*(pow(dReQ1n,2)+pow(dImQ1n,2))+dReQ1n*dImQ2n-dImQ1n*dReQ2n+2.*(dMult-1)*dImQ1n)
1964  / (dMult*(dMult-1)*(dMult-2));
1965 
1966  // average non-weighted 3-particle correction (sin terms) for non-uniform acceptance for single event:
1967  fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(3,sinP1nM1nM1n);
1968  // event weights for NUA terms:
1969  fIntFlowEventWeightForCorrectionTermsForNUAEBE[0]->SetBinContent(3,dMult*(dMult-1)*(dMult-2));
1970 
1971  // final average non-weighted 3-particle correction (sin terms) for non-uniform acceptance for all events:
1972  fIntFlowCorrectionTermsForNUAPro[0]->Fill(2.5,sinP1nM1nM1n,dMult*(dMult-1)*(dMult-2));
1973  if(fCalculateCumulantsVsM){fIntFlowCorrectionTermsForNUAVsMPro[0][2]->Fill(dMultiplicityBin,sinP1nM1nM1n,dMult*(dMult-1)*(dMult-2));}
1974  }
1975 
1976 } // end of AliFlowAnalysisCRC::CalculateIntFlowCorrectionsForNUASinTerms()
1977 
1978 //=======================================================================================================================
1979 
1981 {
1982  // a) Get pointers for common control and common result histograms;
1983  // b) Get pointers for histograms holding particle weights;
1984  // c) Get pointers for reference flow histograms;
1985  // d) Get pointers for differential flow histograms;
1986  // e) Get pointers for 2D differential flow histograms;
1987  // f) Get pointers for other differential correlators;
1988  // g) Get pointers for mixed harmonics histograms;
1989  // h) Get pointers for nested loops' histograms;
1990  // i) Get pointers for control histograms;
1991  // j) Get pointers for bootstrap.
1992  // k) Get pointers for CRC histograms;
1993 
1994  if(outputListHistos)
1995  {
1996  this->SetHistList(outputListHistos);
1997  if(!fHistList)
1998  {
1999  printf("\n WARNING (QC): fHistList is NULL in AFAWQC::GOH() !!!!\n\n");
2000  exit(0);
2001  }
2011  this->GetPointersForBootstrap();
2012  this->GetPointersForCRC();
2013  this->GetPointersForCRCVZ();
2014  this->GetPointersForCRCZDC();
2015  this->GetPointersForCRCPt();
2016  this->GetPointersForCRC2();
2017  this->GetPointersForQVec();
2018  this->GetPointersForCME();
2019  this->GetPointersForFlowQC();
2021  this->GetPointersForFlowSPZDC();
2022  this->GetPointersForFlowSPVZ();
2023  this->GetPointersForEbEFlow();
2024  this->GetPointersForVarious();
2025  } else
2026  {
2027  printf("\n WARNING (QC): outputListHistos is NULL in AFAWQC::GOH() !!!!\n\n");
2028  exit(0);
2029  }
2030 
2031 } // end of void AliFlowAnalysisCRC::GetOutputHistograms(TList *outputListHistos)
2032 
2033 //=======================================================================================================================
2034 
2035 TProfile* AliFlowAnalysisCRC::MakePtProjection(TProfile2D *profilePtEta) const
2036 {
2037  // project 2D profile onto pt axis to get 1D profile
2038 
2039  Int_t nBinsPt = profilePtEta->GetNbinsX();
2040  Double_t dPtMin = (profilePtEta->GetXaxis())->GetXmin();
2041  Double_t dPtMax = (profilePtEta->GetXaxis())->GetXmax();
2042 
2043  Int_t nBinsEta = profilePtEta->GetNbinsY();
2044 
2045  TProfile *profilePt = new TProfile("","",nBinsPt,dPtMin,dPtMax);
2046 
2047  for(Int_t p=1;p<=nBinsPt;p++)
2048  {
2049  Double_t contentPt = 0.;
2050  Double_t entryPt = 0.;
2051  Double_t spreadPt = 0.;
2052  Double_t sum1 = 0.;
2053  Double_t sum2 = 0.;
2054  Double_t sum3 = 0.;
2055  for(Int_t e=1;e<=nBinsEta;e++)
2056  {
2057  contentPt += (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)))
2058  * (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
2059  entryPt += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
2060 
2061  sum1 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)))
2062  * (pow(profilePtEta->GetBinError(profilePtEta->GetBin(p,e)),2.)
2063  + pow(profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)),2.));
2064  sum2 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
2065  sum3 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)))
2066  * (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)));
2067  }
2068  if(sum2>0. && sum1/sum2-pow(sum3/sum2,2.) > 0.)
2069  {
2070  spreadPt = pow(sum1/sum2-pow(sum3/sum2,2.),0.5);
2071  }
2072  profilePt->SetBinContent(p,contentPt);
2073  profilePt->SetBinEntries(p,entryPt);
2074  {
2075  profilePt->SetBinError(p,spreadPt);
2076  }
2077 
2078  }
2079 
2080  return profilePt;
2081 
2082 } // end of TProfile* AliFlowAnalysisCRC::MakePtProjection(TProfile2D *profilePtEta)
2083 
2084 
2085 //=======================================================================================================================
2086 
2087 
2088 TProfile* AliFlowAnalysisCRC::MakeEtaProjection(TProfile2D *profilePtEta) const
2089 {
2090  // project 2D profile onto eta axis to get 1D profile
2091 
2092  Int_t nBinsEta = profilePtEta->GetNbinsY();
2093  Double_t dEtaMin = (profilePtEta->GetYaxis())->GetXmin();
2094  Double_t dEtaMax = (profilePtEta->GetYaxis())->GetXmax();
2095 
2096  Int_t nBinsPt = profilePtEta->GetNbinsX();
2097 
2098  TProfile *profileEta = new TProfile("","",nBinsEta,dEtaMin,dEtaMax);
2099 
2100  for(Int_t e=1;e<=nBinsEta;e++)
2101  {
2102  Double_t contentEta = 0.;
2103  Double_t entryEta = 0.;
2104  for(Int_t p=1;p<=nBinsPt;p++)
2105  {
2106  contentEta += (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)))
2107  * (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
2108  entryEta += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));
2109  }
2110  profileEta->SetBinContent(e,contentEta);
2111  profileEta->SetBinEntries(e,entryEta);
2112  }
2113 
2114  return profileEta;
2115 
2116 } // end of TProfile* AliFlowAnalysisCRC::MakeEtaProjection(TProfile2D *profilePtEta)
2117 
2118 //=======================================================================================================================
2119 
2121 {
2122  // Printing on the screen the final results for integrated flow (RF, POI and RP).
2123 
2124  Int_t n = fHarmonic;
2125 
2126  Double_t dVn[4] = {0.}; // array to hold Vn{2}, Vn{4}, Vn{6} and Vn{8}
2127  Double_t dVnErr[4] = {0.}; // array to hold errors of Vn{2}, Vn{4}, Vn{6} and Vn{8}
2128 
2129  if(type == "RF")
2130  {
2131  for(Int_t b=0;b<4;b++)
2132  {
2133  dVn[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinContent(1);
2134  dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinError(1);
2135  dVn[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinContent(1);
2136  dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinError(1);
2137  dVn[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinContent(1);
2138  dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinError(1);
2139  dVn[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinContent(1);
2140  dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinError(1);
2141  }
2142  } else if(type == "RP")
2143  {
2144  dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinContent(1);
2145  dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinError(1);
2146  dVn[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinContent(1);
2147  dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinError(1);
2148  dVn[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinContent(1);
2149  dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinError(1);
2150  dVn[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinContent(1);
2151  dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinError(1);
2152  } else if(type == "POI")
2153  {
2154  dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinContent(1);
2155  dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinError(1);
2156  dVn[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinContent(1);
2157  dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinError(1);
2158  dVn[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinContent(1);
2159  dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinError(1);
2160  dVn[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinContent(1);
2161  dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinError(1);
2162  } else if(type == "RF, rebinned in M" && fCalculateCumulantsVsM)
2163  {
2164  for(Int_t b=0;b<4;b++)
2165  {
2166  dVn[b] = fIntFlowRebinnedInM->GetBinContent(b+1);
2167  dVnErr[b] = fIntFlowRebinnedInM->GetBinError(b+1);
2168  }
2169  }
2170 
2171  TString title = " flow estimates from Q-cumulants";
2172  TString subtitle = " (";
2173  TString subtitle2 = " (rebinned in M)";
2174 
2175  if(type != "RF, rebinned in M")
2176  {
2178  {
2179  subtitle.Append(type);
2180  subtitle.Append(", without weights)");
2181  } else
2182  {
2183  subtitle.Append(type);
2184  subtitle.Append(", with weights)");
2185  }
2186  } else
2187  {
2189  {
2190  subtitle.Append("RF");
2191  subtitle.Append(", without weights)");
2192  } else
2193  {
2194  subtitle.Append("RF");
2195  subtitle.Append(", with weights)");
2196  }
2197  }
2198 
2199  cout<<endl;
2200  cout<<"*************************************"<<endl;
2201  cout<<"*************************************"<<endl;
2202  cout<<title.Data()<<endl;
2203  cout<<subtitle.Data()<<endl;
2204  if(type == "RF, rebinned in M"){cout<<subtitle2.Data()<<endl;}
2205  cout<<endl;
2206 
2207  for(Int_t i=0;i<4;i++)
2208  {
2209  cout<<" v_"<<n<<"{"<<2*(i+1)<<"} = "<<dVn[i]<<" +/- "<<dVnErr[i]<<endl;
2210  }
2211 
2212  cout<<endl;
2213  if(type == "RF")
2214  {
2216  {
2217  cout<<" detector bias (corrected for): "<<endl;
2218  } else
2219  {
2220  cout<<" detector bias (not corrected for):"<<endl;
2221  }
2222  cout<<" to QC{2}: "<<fIntFlowDetectorBias->GetBinContent(1)<<" +/- "<<fIntFlowDetectorBias->GetBinError(1)<<endl;
2223  cout<<" to QC{4}: "<<fIntFlowDetectorBias->GetBinContent(2)<<" +/- "<<fIntFlowDetectorBias->GetBinError(2)<<endl;
2224  cout<<endl;
2225  }
2226  if(type == "RF" || type == "RF, rebinned in M")
2227  {
2228  cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultRP()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultRP()->GetMean()<<endl;
2229  }
2230  else if (type == "RP")
2231  {
2232  cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultRP()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultRP()->GetMean()<<endl;
2233  }
2234  else if (type == "POI")
2235  {
2236  cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultPOI()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultPOI()->GetMean()<<endl;
2237  }
2238 
2239  cout<<"*************************************"<<endl;
2240  cout<<"*************************************"<<endl;
2241  cout<<endl;
2242 
2243 }// end of AliFlowAnalysisCRC::PrintFinalResultsForIntegratedFlow(TString type="RF");
2244 
2245 //=======================================================================================================================
2246 
2248 {
2249  //store the final results in output .root file
2250  TFile *output = new TFile(outputFileName.Data(),"RECREATE");
2251  //output->WriteObject(fHistList, "cobjQC","SingleKey");
2252  fHistList->Write(fHistList->GetName(), TObject::kSingleKey);
2253  delete output;
2254 }
2255 
2256 
2257 //=======================================================================================================================
2258 
2259 
2260 void AliFlowAnalysisCRC::WriteHistograms(TDirectoryFile *outputFileName)
2261 {
2262  //store the final results in output .root file
2263  fHistList->SetName("cobjQC");
2264  fHistList->SetOwner(kTRUE);
2265  outputFileName->Add(fHistList);
2266  outputFileName->Write(outputFileName->GetName(), TObject::kSingleKey);
2267 }
2268 
2269 //=======================================================================================================================
2270 
2272 {
2273  // Book common control histograms and common histograms for final results.
2274  // a) Book common control histograms;
2275  // b) Book common result histograms.
2276 
2277  // a) Book common control histograms:
2278  // Common control histograms (all events):
2279  TString commonHistsName = "AliFlowCommonHistQC";
2280  commonHistsName += fAnalysisLabel->Data();
2281  fCommonHists = new AliFlowCommonHist(commonHistsName.Data(),commonHistsName.Data(),fBookOnlyBasicCCH);
2282  fHistList->Add(fCommonHists);
2283  // Common control histograms (selected events):
2285  {
2286  // Common control histogram filled for events with 2 and more reference particles:
2287  TString commonHists2ndOrderName = "AliFlowCommonHist2ndOrderQC";
2288  commonHists2ndOrderName += fAnalysisLabel->Data();
2289  fCommonHists2nd = new AliFlowCommonHist(commonHists2ndOrderName.Data(),commonHists2ndOrderName.Data(),fBookOnlyBasicCCH);
2290  fHistList->Add(fCommonHists2nd);
2291  // Common control histogram filled for events with 2 and more reference particles:
2292  TString commonHists4thOrderName = "AliFlowCommonHist4thOrderQC";
2293  commonHists4thOrderName += fAnalysisLabel->Data();
2294  fCommonHists4th = new AliFlowCommonHist(commonHists4thOrderName.Data(),commonHists4thOrderName.Data(),fBookOnlyBasicCCH);
2295  fHistList->Add(fCommonHists4th);
2296  // Common control histogram filled for events with 6 and more reference particles:
2297  TString commonHists6thOrderName = "AliFlowCommonHist6thOrderQC";
2298  commonHists6thOrderName += fAnalysisLabel->Data();
2299  fCommonHists6th = new AliFlowCommonHist(commonHists6thOrderName.Data(),commonHists6thOrderName.Data(),fBookOnlyBasicCCH);
2300  fHistList->Add(fCommonHists6th);
2301  // Common control histogram filled for events with 8 and more reference particles:
2302  TString commonHists8thOrderName = "AliFlowCommonHist8thOrderQC";
2303  commonHists8thOrderName += fAnalysisLabel->Data();
2304  fCommonHists8th = new AliFlowCommonHist(commonHists8thOrderName.Data(),commonHists8thOrderName.Data(),fBookOnlyBasicCCH);
2305  fHistList->Add(fCommonHists8th);
2306  } // end of if(fFillMultipleControlHistograms)
2307 
2308  // b) Book common result histograms:
2309  // Common result histograms for QC{2}:
2310  TString commonHistResults2ndOrderName = "AliFlowCommonHistResults2ndOrderQC";
2311  commonHistResults2ndOrderName += fAnalysisLabel->Data();
2312  fCommonHistsResults2nd = new AliFlowCommonHistResults(commonHistResults2ndOrderName.Data(),"",fHarmonic);
2314  // Common result histograms for QC{4}:
2315  TString commonHistResults4thOrderName = "AliFlowCommonHistResults4thOrderQC";
2316  commonHistResults4thOrderName += fAnalysisLabel->Data();
2317  fCommonHistsResults4th = new AliFlowCommonHistResults(commonHistResults4thOrderName.Data(),"",fHarmonic);
2319  // Common result histograms for QC{6}:
2320  TString commonHistResults6thOrderName = "AliFlowCommonHistResults6thOrderQC";
2321  commonHistResults6thOrderName += fAnalysisLabel->Data();
2322  fCommonHistsResults6th = new AliFlowCommonHistResults(commonHistResults6thOrderName.Data(),"",fHarmonic);
2324  // Common result histograms for QC{8}:
2325  TString commonHistResults8thOrderName = "AliFlowCommonHistResults8thOrderQC";
2326  commonHistResults8thOrderName += fAnalysisLabel->Data();
2327  fCommonHistsResults8th = new AliFlowCommonHistResults(commonHistResults8thOrderName.Data(),"",fHarmonic);
2329 
2330 } // end of void AliFlowAnalysisCRC::BookCommonHistograms()
2331 
2332 //=======================================================================================================================
2333 
2335 {
2336  // Book and fill histograms which hold phi, pt and eta weights.
2337 
2338  if(!fWeightsList)
2339  {
2340  printf("\n WARNING (QC): fWeightsList is NULL in AFAWQC::BAFWH() !!!! \n\n");
2341  exit(0);
2342  }
2343 
2344  TString fUseParticleWeightsName = "fUseParticleWeightsQC";
2345  fUseParticleWeightsName += fAnalysisLabel->Data();
2346  fUseParticleWeights = new TProfile(fUseParticleWeightsName.Data(),"0 = particle weight not used, 1 = particle weight used ",8,0,8);
2347  fUseParticleWeights->SetLabelSize(0.06);
2348  fUseParticleWeights->SetStats(kFALSE);
2349  (fUseParticleWeights->GetXaxis())->SetBinLabel(1,"w_{#phi}");
2350  (fUseParticleWeights->GetXaxis())->SetBinLabel(2,"w_{p_{T}}");
2351  (fUseParticleWeights->GetXaxis())->SetBinLabel(3,"w_{#eta}");
2352  (fUseParticleWeights->GetXaxis())->SetBinLabel(4,"w_{track}");
2353  (fUseParticleWeights->GetXaxis())->SetBinLabel(5,"w_{#phi,#eta}");
2354  (fUseParticleWeights->GetXaxis())->SetBinLabel(6,"w_{#phi,#eta} ch_dep");
2355  (fUseParticleWeights->GetXaxis())->SetBinLabel(7,"w_{#phi,#eta} vtx_dep");
2356  (fUseParticleWeights->GetXaxis())->SetBinLabel(8,"w_{#phi,#eta} ch_pT_dep");
2366 
2367  // // POIs
2368  // for(Int_t c=0; c<2; c++)
2369  // {
2370  // fPhiWeightsPOIs[c] = new TH1F(Form("fPhiWeightsPOIs[%d][%d]",c,h),Form("fPhiWeightsPOIs[%d][%d]",c,h),fnBinsPhi,fPhiMin,fPhiMax);
2371  // fPhiWeightsPOIs[c]->Sumw2();
2372  // fEtaWeightsPOIs[c] = new TH1D(Form("fEtaWeightsPOIs[%d][%d]",c,h),Form("fEtaWeightsPOIs[%d][%d]",c,h),fnBinsEta,fEtaMin,fEtaMax);
2373  // fEtaWeightsPOIs[c]->Sumw2();
2374  // fPhiEtaWeightsPOIs[c] = new TH2D(Form("fPhiEtaWeightsPOIs[%d][%d]",c,h),Form("fPhiEtaWeightsPOIs[%d][%d]",c,h),fnBinsPhi,fPhiMin,fPhiMax,fnBinsEta,fEtaMin,fEtaMax);
2375  // fPhiEtaWeightsPOIs[c]->Sumw2();
2376  //
2377  // if(fUsePhiWeights)
2378  // {
2379  // if(fWeightsList->FindObject(Form("fPhiHist[%d][%d]",c,h)))
2380  // {
2381  // fPhiDistrRefPOIs[c] = dynamic_cast<TH1F*>(fWeightsList->FindObject(Form("fPhiHist[%d][%d]",c,h)));
2382  // if(!fPhiDistrRefPOIs[c])
2383  // {
2384  // printf("\n WARNING (QC): fPhiDistrRefPOIs is NULL in AFAWQC::BAFWH() !!!!\n\n");
2385  // exit(0);
2386  // }
2387  // if(TMath::Abs(fPhiDistrRefPOIs[c]->GetBinWidth(1)-fPhiBinWidth)>pow(10.,-6.))
2388  // {
2389  // cout<<endl;
2390  // cout<<"WARNING (QC): Inconsistent binning in histograms for phi-weights throughout the code."<<endl;
2391  // cout<<endl;
2392  // //exit(0);
2393  // }
2394  // } else
2395  // {
2396  // cout<<"WARNING: fWeightsList->FindObject(\"fPhiHist\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
2397  // exit(0);
2398  // }
2399  // } // end of if(fUsePhiWeights)
2400  //
2401  // if(fUsePtWeights)
2402  // {
2403  // if(fWeightsList->FindObject(Form("fPtHist[%d][%d]",c,h)))
2404  // {
2405  // fPtDistrRefPOIs[c] = dynamic_cast<TH1D*>(fWeightsList->FindObject(Form("fPtHist[%d][%d]",c,h)));
2406  // if(!fPtDistrRefPOIs[c])
2407  // {
2408  // printf("\n WARNING (QC): fPtDistrRefPOIs is NULL in AFAWQC::BAFWH() !!!!\n\n");
2409  // exit(0);
2410  // }
2411  // if(TMath::Abs(fPtDistrRefPOIs[c]->GetBinWidth(1)-fPtBinWidth)>pow(10.,-6.))
2412  // {
2413  // cout<<endl;
2414  // cout<<"WARNING (QC): Inconsistent binning in histograms for pt-weights throughout the code."<<endl;
2415  // cout<<endl;
2416  // //exit(0);
2417  // }
2418  // } else
2419  // {
2420  // cout<<"WARNING: fWeightsList->FindObject(\"fPtHist\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
2421  // exit(0);
2422  // }
2423  // } // end of if(fUsePtWeights)
2424  //
2425  // if(fUseEtaWeights)
2426  // {
2427  // if(fWeightsList->FindObject(Form("fEtaHist[%d][%d]",c,h)))
2428  // {
2429  // fEtaDistrRefPOIs[c] = dynamic_cast<TH1D*>(fWeightsList->FindObject(Form("fEtaHist[%d][%d]",c,h)));
2430  // if(!fEtaDistrRefPOIs[c])
2431  // {
2432  // printf("\n WARNING (QC): fEtaDistrRefPOIs is NULL in AFAWQC::BAFWH() !!!!\n\n");
2433  // exit(0);
2434  // }
2435  // if(TMath::Abs(fEtaDistrRefPOIs[c]->GetBinWidth(1)-fEtaBinWidth)>pow(10.,-6.))
2436  // {
2437  // cout<<endl;
2438  // cout<<"WARNING (QC): Inconsistent binning in histograms for eta-weights throughout the code."<<endl;
2439  // cout<<endl;
2440  // //exit(0);
2441  // }
2442  // } else
2443  // {
2444  // cout<<"WARNING: fWeightsList->FindObject(\"fEtaHist\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
2445  // exit(0);
2446  // }
2447  // } // end of if(fUseEtaWeights)
2448  //
2449  //
2450  // } // end of for(Int_t c=0; c<2; c++)
2451 
2452  //**********************************************************************************************************
2453 
2454  // RPs
2455 
2456  // fPhiWeightsRPs = new TH1F("fPhiWeightsRPs","fPhiWeightsRPs",fnBinsPhi,fPhiMin,fPhiMax);
2457  // fEtaWeightsRPs = new TH1D("fEtaWeightsRPs","fEtaWeightsRPs",fnBinsEta,fEtaMin,fEtaMax);
2458  //
2459  // if(fUsePhiWeights)
2460  // {
2461  // if(fWeightsList->FindObject("fPhiDistrRPs"))
2462  // {
2463  // fPhiDistrRefRPs = dynamic_cast<TH1F*>(fWeightsList->FindObject("fPhiDistrRPs"));
2464  // if(!fPhiDistrRefRPs)
2465  // {
2466  // printf("\n WARNING (QC): fPhiDistrRefRPs is NULL in AFAWQC::BAFWH() !!!!\n\n");
2467  // exit(0);
2468  // }
2469  // if(TMath::Abs(fPhiDistrRefRPs->GetBinWidth(1)-fPhiBinWidth)>pow(10.,-6.))
2470  // {
2471  // cout<<endl;
2472  // cout<<"WARNING (QC): Inconsistent binning in histograms for phi-weights throughout the code."<<endl;
2473  // cout<<endl;
2474  // //exit(0);
2475  // }
2476  // } else
2477  // {
2478  // cout<<"WARNING: fWeightsList->FindObject(\"fPhiDistrRPs\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
2479  // exit(0);
2480  // }
2481  // } // end of if(fUsePhiWeights)
2482  //
2483  // if(fUsePtWeights)
2484  // {
2485  // if(fWeightsList->FindObject("fPtDistrRPs"))
2486  // {
2487  // fPtDistrRefRPs = dynamic_cast<TH1D*>(fWeightsList->FindObject("fPtDistrRPs"));
2488  // if(!fPtDistrRefRPs)
2489  // {
2490  // printf("\n WARNING (QC): fPtDistrRefRPs is NULL in AFAWQC::BAFWH() !!!!\n\n");
2491  // exit(0);
2492  // }
2493  // if(TMath::Abs(fPtDistrRefRPs->GetBinWidth(1)-fPtBinWidth)>pow(10.,-6.))
2494  // {
2495  // cout<<endl;
2496  // cout<<"WARNING (QC): Inconsistent binning in histograms for phi-weights throughout the code."<<endl;
2497  // cout<<endl;
2498  // //exit(0);
2499  // }
2500  // } else
2501  // {
2502  // cout<<"WARNING: fWeightsList->FindObject(\"fPtDistrRPs\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
2503  // exit(0);
2504  // }
2505  // } // end of if(fUsePtWeights)
2506  //
2507  // if(fUseEtaWeights)
2508  // {
2509  // if(fWeightsList->FindObject("fEtaDistrRPs"))
2510  // {
2511  // fEtaDistrRefRPs = dynamic_cast<TH1D*>(fWeightsList->FindObject("fEtaDistrRPs"));
2512  // if(!fEtaDistrRefRPs)
2513  // {
2514  // printf("\n WARNING (QC): fEtaDistrRefRPs is NULL in AFAWQC::BAFWH() !!!!\n\n");
2515  // exit(0);
2516  // }
2517  // if(TMath::Abs(fEtaDistrRefRPs->GetBinWidth(1)-fEtaBinWidth)>pow(10.,-6.))
2518  // {
2519  // cout<<endl;
2520  // cout<<"WARNING (QC): Inconsistent binning in histograms for eta-weights throughout the code."<<endl;
2521  // cout<<endl;
2522  // //exit(0);
2523  // }
2524  // } else
2525  // {
2526  // cout<<"WARNING: fWeightsList->FindObject(\"fEtaDistrRPs\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;
2527  // exit(0);
2528  // }
2529  // } // end of if(fUseEtaWeights)
2530  //
2531 
2532 } // end of AliFlowAnalysisCRC::BookAndFillWeightsHistograms()
2533 
2534 //=======================================================================================================================
2535 
2537 {
2538  if(!fCenWeightsHist) return;
2539  fCenWeigCalHist = (TH1D*)(fCenWeightsHist->Clone("fCenWeigCalHist"));
2540  TF1 *CenFit = new TF1("CenFit","pol0", 0., 100.);
2542  fCenWeigCalHist->Fit("CenFit","QNR","",0.,50.);
2543  Double_t CenAv = CenFit->GetParameter(0);
2544  for(Int_t b=1; b<=fCenWeigCalHist->GetNbinsX(); b++) {
2545  Double_t newbin = fCenWeigCalHist->GetBinContent(b);
2546  if(newbin) {
2547  fCenWeigCalHist->SetBinContent(b,CenAv/newbin);
2548  } else {
2549  fCenWeigCalHist->SetBinContent(b,1.);
2550  }
2551  }
2552  }
2553  else {
2554  fCenWeigCalHist->Fit("CenFit","QNR","",0.,8.);
2555  Double_t CenAv = CenFit->GetParameter(0);
2556  fCenWeigCalHist->Fit("CenFit","QNR","",12.,50.);
2557  Double_t SemiCenAv = CenFit->GetParameter(0);
2558  for(Int_t b=1; b<=fCenWeigCalHist->GetNbinsX(); b++) {
2559  Double_t newbin = fCenWeigCalHist->GetBinContent(b);
2560  if(newbin) {
2561  if(b<=10) fCenWeigCalHist->SetBinContent(b,CenAv/newbin);
2562  if(b>10 && b<=50) fCenWeigCalHist->SetBinContent(b,SemiCenAv/newbin);
2563  if(b>50) fCenWeigCalHist->SetBinContent(b,1.);
2564  } else {
2565  fCenWeigCalHist->SetBinContent(b,1.);
2566  }
2567  }
2568  }
2569  fCenWeigCalHist->SetName("CenWeights");
2571 } // end of AliFlowAnalysisCRC::SetCentralityWeights()
2572 
2573 //=======================================================================================================================
2574 
2576 {
2577  // Book all objects for integrated flow:
2578  // a) Book profile to hold all flags for integrated flow;
2579  // b) Book event-by-event quantities;
2580  // c) Book profiles; // to be improved (comment)
2581  // d) Book histograms holding the final results.
2582 
2583  TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)
2584  TString powerFlag[2] = {"linear","quadratic"}; // to be improved (should I promote this to data members?)
2585 
2586  // a) Book profile to hold all flags for integrated flow:
2587  TString intFlowFlagsName = "fIntFlowFlags";
2588  intFlowFlagsName += fAnalysisLabel->Data();
2589  fIntFlowFlags = new TProfile(intFlowFlagsName.Data(),"Flags for Integrated Flow",20,0.,20.);
2590  fIntFlowFlags->SetTickLength(-0.01,"Y");
2591  fIntFlowFlags->SetMarkerStyle(25);
2592  fIntFlowFlags->SetLabelSize(0.04);
2593  fIntFlowFlags->SetLabelOffset(0.02,"Y");
2594  fIntFlowFlags->SetStats(kFALSE);
2595  fIntFlowFlags->GetXaxis()->SetBinLabel(1,"Particle Weights");
2596  fIntFlowFlags->GetXaxis()->SetBinLabel(2,"Event Weights");
2597  fIntFlowFlags->GetXaxis()->SetBinLabel(3,"Corrected for NUA?");
2598  fIntFlowFlags->GetXaxis()->SetBinLabel(4,"Print RF results");
2599  fIntFlowFlags->GetXaxis()->SetBinLabel(5,"Print RP results");
2600  fIntFlowFlags->GetXaxis()->SetBinLabel(6,"Print POI results");
2601  fIntFlowFlags->GetXaxis()->SetBinLabel(7,"Print RF (rebinned in M) results");
2602  fIntFlowFlags->GetXaxis()->SetBinLabel(8,"Corrected for NUA vs M?");
2603  fIntFlowFlags->GetXaxis()->SetBinLabel(9,"Propagate errors to v_{n} from correlations?");
2604  fIntFlowFlags->GetXaxis()->SetBinLabel(10,"Calculate cumulants vs M");
2605  fIntFlowFlags->GetXaxis()->SetBinLabel(11,"fMinimumBiasReferenceFlow");
2606  fIntFlowFlags->GetXaxis()->SetBinLabel(12,"fForgetAboutCovariances");
2607  fIntFlowFlags->GetXaxis()->SetBinLabel(13,"fStoreVarious");
2608  fIntFlowFlags->GetXaxis()->SetBinLabel(14,"fFillMultipleControlHistograms");
2609  fIntFlowFlags->GetXaxis()->SetBinLabel(15,"Calculate all correlations vs M");
2610  fIntFlowFlags->GetXaxis()->SetBinLabel(16,"fMultiplicityIs");
2611  fIntFlowFlags->GetXaxis()->SetBinLabel(17,"fExactNoRPs");
2612  fIntFlowFlags->GetXaxis()->SetBinLabel(18,"fUse2DHistograms");
2613  fIntFlowFlags->GetXaxis()->SetBinLabel(19,"fFillProfilesVsMUsingWeights");
2614  fIntFlowFlags->GetXaxis()->SetBinLabel(20,"fUseQvectorTerms");
2616 
2617  // b) Book event-by-event quantities:
2618  // Re[Q_{m*n,k}], Im[Q_{m*n,k}] and S_{p,k}^M:
2619  fReQ = new TMatrixD(12,9);
2620  fImQ = new TMatrixD(12,9);
2621  fSpk = new TMatrixD(8,9);
2622  // average correlations <2>, <4>, <6> and <8> for single event (bining is the same as in fIntFlowCorrelationsPro and fIntFlowCorrelationsHist):
2623  TString intFlowCorrelationsEBEName = "fIntFlowCorrelationsEBE";
2624  intFlowCorrelationsEBEName += fAnalysisLabel->Data();
2625  fIntFlowCorrelationsEBE = new TH1D(intFlowCorrelationsEBEName.Data(),intFlowCorrelationsEBEName.Data(),4,0,4);
2626  // weights for average correlations <2>, <4>, <6> and <8> for single event:
2627  TString intFlowEventWeightsForCorrelationsEBEName = "fIntFlowEventWeightsForCorrelationsEBE";
2628  intFlowEventWeightsForCorrelationsEBEName += fAnalysisLabel->Data();
2629  fIntFlowEventWeightsForCorrelationsEBE = new TH1D(intFlowEventWeightsForCorrelationsEBEName.Data(),intFlowEventWeightsForCorrelationsEBEName.Data(),4,0,4);
2630  // average all correlations for single event (bining is the same as in fIntFlowCorrelationsAllPro and fIntFlowCorrelationsAllHist):
2631  TString intFlowCorrelationsAllEBEName = "fIntFlowCorrelationsAllEBE";
2632  intFlowCorrelationsAllEBEName += fAnalysisLabel->Data();
2633  fIntFlowCorrelationsAllEBE = new TH1D(intFlowCorrelationsAllEBEName.Data(),intFlowCorrelationsAllEBEName.Data(),64,0,64);
2634  // average correction terms for non-uniform acceptance for single event
2635  // (binning is the same as in fIntFlowCorrectionTermsForNUAPro[2] and fIntFlowCorrectionTermsForNUAHist[2]):
2636  TString fIntFlowCorrectionTermsForNUAEBEName = "fIntFlowCorrectionTermsForNUAEBE";
2637  fIntFlowCorrectionTermsForNUAEBEName += fAnalysisLabel->Data();
2638  for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2639  {
2640  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);
2641  }
2642  // event weights for terms for non-uniform acceptance:
2643  TString fIntFlowEventWeightForCorrectionTermsForNUAEBEName = "fIntFlowEventWeightForCorrectionTermsForNUAEBE";
2644  fIntFlowEventWeightForCorrectionTermsForNUAEBEName += fAnalysisLabel->Data();
2645  for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2646  {
2647  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
2648  }
2649  // c) Book profiles: // to be improved (comment)
2650  // profile to hold average multiplicities and number of events for events with nRP>=0, nRP>=1, ... , and nRP>=8:
2651  TString avMultiplicityName = "fAvMultiplicity";
2652  avMultiplicityName += fAnalysisLabel->Data();
2653  fAvMultiplicity = new TProfile(avMultiplicityName.Data(),"Average multiplicities of reference particles (RPs)",9,0,9);
2654  fAvMultiplicity->SetTickLength(-0.01,"Y");
2655  fAvMultiplicity->SetMarkerStyle(25);
2656  fAvMultiplicity->SetLabelSize(0.05);
2657  fAvMultiplicity->SetLabelOffset(0.02,"Y");
2658  fAvMultiplicity->SetYTitle("Average multiplicity");
2659  (fAvMultiplicity->GetXaxis())->SetBinLabel(1,"all evts");
2660  (fAvMultiplicity->GetXaxis())->SetBinLabel(2,"n_{RP} #geq 1");
2661  (fAvMultiplicity->GetXaxis())->SetBinLabel(3,"n_{RP} #geq 2");
2662  (fAvMultiplicity->GetXaxis())->SetBinLabel(4,"n_{RP} #geq 3");
2663  (fAvMultiplicity->GetXaxis())->SetBinLabel(5,"n_{RP} #geq 4");
2664  (fAvMultiplicity->GetXaxis())->SetBinLabel(6,"n_{RP} #geq 5");
2665  (fAvMultiplicity->GetXaxis())->SetBinLabel(7,"n_{RP} #geq 6");
2666  (fAvMultiplicity->GetXaxis())->SetBinLabel(8,"n_{RP} #geq 7");
2667  (fAvMultiplicity->GetXaxis())->SetBinLabel(9,"n_{RP} #geq 8");
2669  // Average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with wrong errors!):
2670  TString correlationFlag[4] = {"#LT#LT2#GT#GT","#LT#LT4#GT#GT","#LT#LT6#GT#GT","#LT#LT8#GT#GT"};
2671  TString intFlowCorrelationsProName = "fIntFlowCorrelationsPro";
2672  intFlowCorrelationsProName += fAnalysisLabel->Data();
2673  fIntFlowCorrelationsPro = new TProfile(intFlowCorrelationsProName.Data(),"Average correlations for all events",4,0,4,"s");
2674  fIntFlowCorrelationsPro->Sumw2();
2675  fIntFlowCorrelationsPro->SetTickLength(-0.01,"Y");
2676  fIntFlowCorrelationsPro->SetMarkerStyle(25);
2677  fIntFlowCorrelationsPro->SetLabelSize(0.06);
2678  fIntFlowCorrelationsPro->SetLabelOffset(0.01,"Y");
2679  for(Int_t b=0;b<4;b++)
2680  {
2681  (fIntFlowCorrelationsPro->GetXaxis())->SetBinLabel(b+1,correlationFlag[b].Data());
2682  }
2684  // Average correlations squared <<2>^2>, <<4>^2>, <<6>^2> and <<8>^2> for all events:
2685  TString squaredCorrelationFlag[4] = {"#LT#LT2#GT^{2}#GT","#LT#LT4#GT^{2}#GT","#LT#LT6#GT^{2}#GT","#LT#LT8#GT^{2}#GT"};
2686  TString intFlowSquaredCorrelationsProName = "fIntFlowSquaredCorrelationsPro";
2687  intFlowSquaredCorrelationsProName += fAnalysisLabel->Data();
2688  fIntFlowSquaredCorrelationsPro = new TProfile(intFlowSquaredCorrelationsProName.Data(),"Average squared correlations for all events",4,0,4,"s");
2690  fIntFlowSquaredCorrelationsPro->SetTickLength(-0.01,"Y");
2691  fIntFlowSquaredCorrelationsPro->SetMarkerStyle(25);
2692  fIntFlowSquaredCorrelationsPro->SetLabelSize(0.06);
2693  fIntFlowSquaredCorrelationsPro->SetLabelOffset(0.01,"Y");
2694  for(Int_t b=0;b<4;b++)
2695  {
2696  (fIntFlowSquaredCorrelationsPro->GetXaxis())->SetBinLabel(b+1,squaredCorrelationFlag[b].Data());
2697  }
2700  {
2701  for(Int_t ci=0;ci<4;ci++) // correlation index
2702  {
2703  // average correlations <<2>>, <<4>>, <<6>> and <<8>> versus multiplicity for all events (with wrong errors):
2704  TString intFlowCorrelationsVsMProName = "fIntFlowCorrelationsVsMPro";
2705  intFlowCorrelationsVsMProName += fAnalysisLabel->Data();
2706  fIntFlowCorrelationsVsMPro[ci] = new TProfile(Form("%s, %s",intFlowCorrelationsVsMProName.Data(),correlationFlag[ci].Data()),
2707  Form("%s vs multiplicity",correlationFlag[ci].Data()),
2709  fIntFlowCorrelationsVsMPro[ci]->Sumw2();
2710  fIntFlowCorrelationsVsMPro[ci]->GetYaxis()->SetTitle(correlationFlag[ci].Data());
2712  {
2713  fIntFlowCorrelationsVsMPro[ci]->GetXaxis()->SetTitle("# RPs");
2715  {
2716  fIntFlowCorrelationsVsMPro[ci]->GetXaxis()->SetTitle("Reference multiplicity (from ESD)");
2718  {
2719  fIntFlowCorrelationsVsMPro[ci]->GetXaxis()->SetTitle("# POIs");
2720  }
2722  // average squared correlations <<2>^2>, <<4>^2>, <<6>^2> and <<8>^2> versus multiplicity for all events:
2723  TString intFlowSquaredCorrelationsVsMProName = "fIntFlowSquaredCorrelationsVsMPro";
2724  intFlowSquaredCorrelationsVsMProName += fAnalysisLabel->Data();
2725  fIntFlowSquaredCorrelationsVsMPro[ci] = new TProfile(Form("%s, %s",intFlowSquaredCorrelationsVsMProName.Data(),squaredCorrelationFlag[ci].Data()),
2726  Form("%s vs multiplicity",squaredCorrelationFlag[ci].Data()),
2728  fIntFlowSquaredCorrelationsVsMPro[ci]->Sumw2();
2729  fIntFlowSquaredCorrelationsVsMPro[ci]->GetYaxis()->SetTitle(squaredCorrelationFlag[ci].Data());
2731  {
2732  fIntFlowSquaredCorrelationsVsMPro[ci]->GetXaxis()->SetTitle("# RPs");
2734  {
2735  fIntFlowSquaredCorrelationsVsMPro[ci]->GetXaxis()->SetTitle("Reference multiplicity (from ESD)");
2737  {
2738  fIntFlowSquaredCorrelationsVsMPro[ci]->GetXaxis()->SetTitle("# POIs");
2739  }
2741  } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
2742  } // end of if(fCalculateCumulantsVsM)
2743  // averaged all correlations for all events (with wrong errors!):
2744  TString intFlowCorrelationsAllProName = "fIntFlowCorrelationsAllPro";
2745  intFlowCorrelationsAllProName += fAnalysisLabel->Data();
2746  fIntFlowCorrelationsAllPro = new TProfile(intFlowCorrelationsAllProName.Data(),"Average all correlations for all events",64,0,64);
2747  fIntFlowCorrelationsAllPro->Sumw2();
2748  fIntFlowCorrelationsAllPro->SetTickLength(-0.01,"Y");
2749  fIntFlowCorrelationsAllPro->SetMarkerStyle(25);
2750  fIntFlowCorrelationsAllPro->SetLabelSize(0.03);
2751  fIntFlowCorrelationsAllPro->SetLabelOffset(0.01,"Y");
2752  // 2-p correlations:
2753  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(1,"#LT#LT2#GT#GT_{n|n}");
2754  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(2,"#LT#LT2#GT#GT_{2n|2n}");
2755  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(3,"#LT#LT2#GT#GT_{3n|3n}");
2756  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(4,"#LT#LT2#GT#GT_{4n|4n}");
2757  // 3-p correlations:
2758  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(6,"#LT#LT3#GT#GT_{2n|n,n}");
2759  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(7,"#LT#LT3#GT#GT_{3n|2n,n}");
2760  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(8,"#LT#LT3#GT#GT_{4n|2n,2n}");
2761  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(9,"#LT#LT3#GT#GT_{4n|3n,n}");
2762  // 4-p correlations:
2763  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(11,"#LT#LT4#GT#GT_{n,n|n,n}");
2764  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(12,"#LT#LT4#GT#GT_{2n,n|2n,n}");
2765  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(13,"#LT#LT4#GT#GT_{2n,2n|2n,2n}");
2766  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(14,"#LT#LT4#GT#GT_{3n|n,n,n}");
2767  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(15,"#LT#LT4#GT#GT_{3n,n|3n,n}");
2768  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(16,"#LT#LT4#GT#GT_{3n,n|2n,2n}");
2769  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(17,"#LT#LT4#GT#GT_{4n|2n,n,n}");
2770  // 5-p correlations:
2771  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(19,"#LT#LT5#GT#GT_{2n,n|n,n,n}");
2772  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(20,"#LT#LT5#GT#GT_{2n,2n|2n,n,n}");
2773  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(21,"#LT#LT5#GT#GT_{3n,n|2n,n,n}");
2774  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(22,"#LT#LT5#GT#GT_{4n|n,n,n,n}");
2775  // 6-p correlations:
2776  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(24,"#LT#LT6#GT#GT_{n,n,n|n,n,n}");
2777  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(25,"#LT#LT6#GT#GT_{2n,n,n|2n,n,n}");
2778  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(26,"#LT#LT6#GT#GT_{2n,2n|n,n,n,n}");
2779  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(27,"#LT#LT6#GT#GT_{3n,n|n,n,n,n}");
2780  // 7-p correlations:
2781  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(29,"#LT#LT7#GT#GT_{2n,n,n|n,n,n,n}");
2782  // 8-p correlations:
2783  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(31,"#LT#LT8#GT#GT_{n,n,n,n|n,n,n,n}");
2784  // EXTRA correlations for v3{5} study:
2785  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(33,"#LT#LT4#GT#GT_{4n,2n|3n,3n}");
2786  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(34,"#LT#LT5#GT#GT_{3n,3n|2n,2n,2n}");
2787  // EXTRA correlations for Teaney-Yan study:
2788  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(35,"#LT#LT2#GT#GT_{5n|5n}");
2789  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(36,"#LT#LT2#GT#GT_{6n|6n}");
2790  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(37,"#LT#LT3#GT#GT_{5n|3n,2n}");
2791  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(38,"#LT#LT3#GT#GT_{5n|4n,1n}");
2792  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(39,"#LT#LT3#GT#GT_{6n|3n,3n}");
2793  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(40,"#LT#LT3#GT#GT_{6n|4n,2n}");
2794  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(41,"#LT#LT3#GT#GT_{6n|5n,1n}");
2795  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(42,"#LT#LT4#GT#GT_{6n|3n,2n,1n}");
2796  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(43,"#LT#LT4#GT#GT_{3n,2n|3n,2n}");
2797  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(44,"#LT#LT4#GT#GT_{4n,1n|3n,2n}");
2798  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(45,"#LT#LT4#GT#GT_{3n,3n|3n,3n}");
2799  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(46,"#LT#LT4#GT#GT_{4n,2n|3n,3n}");
2800  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(47,"#LT#LT4#GT#GT_{5n,1n|3n,3n}");
2801  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(48,"#LT#LT4#GT#GT_{4n,2n|4n,2n}");
2802  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(49,"#LT#LT4#GT#GT_{5n,1n|4n,2n}");
2803  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(50,"#LT#LT4#GT#GT_{5n|3n,1n,1n}");
2804  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(51,"#LT#LT4#GT#GT_{5n|2n,2n,1n}");
2805  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(52,"#LT#LT4#GT#GT_{5n,1n|5n,1n}");
2806  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(53,"#LT#LT5#GT#GT_{3n,3n|3n,2n,1n}");
2807  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(54,"#LT#LT5#GT#GT_{4n,2n|3n,2n,1n}");
2808  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(55,"#LT#LT5#GT#GT_{3n,2n|3n,1n,1n}");
2809  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(56,"#LT#LT5#GT#GT_{3n,2n|2n,2n,1n}");
2810  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(57,"#LT#LT5#GT#GT_{5n,1n|3n,2n,1n}");
2811  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(58,"#LT#LT6#GT#GT_{3n,2n,1n|3n,2n,1n}");
2812  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(59,"#LT#LT4#GT#GT_{6n|4n,1n,1n}");
2813  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(60,"#LT#LT4#GT#GT_{6n|2n,2n,2n}");
2814  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(61,"#LT#LT5#GT#GT_{6n|2n,2n,1n,1n}");
2815  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(62,"#LT#LT5#GT#GT_{4n,1n,1n|3n,3n}");
2816  (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(63,"#LT#LT6#GT#GT_{3n,3n|2n,2n,1n,1n}");
2818  // average all correlations versus multiplicity (errors via Sumw2 - to be improved):
2820  {
2821  // 2-p correlations vs M:
2822  fIntFlowCorrelationsAllVsMPro[0] = new TProfile("two1n1n","#LT#LT2#GT#GT_{n|n}",fnBinsMult,fMinMult,fMaxMult);
2823  fIntFlowCorrelationsAllVsMPro[1] = new TProfile("two2n2n","#LT#LT2#GT#GT_{2n|2n}",fnBinsMult,fMinMult,fMaxMult);
2824  fIntFlowCorrelationsAllVsMPro[2] = new TProfile("two3n3n","#LT#LT2#GT#GT_{3n|3n}",fnBinsMult,fMinMult,fMaxMult);
2825  fIntFlowCorrelationsAllVsMPro[3] = new TProfile("two4n4n","#LT#LT2#GT#GT_{4n|4n}",fnBinsMult,fMinMult,fMaxMult);
2826  // 3-p correlations vs M:
2827  fIntFlowCorrelationsAllVsMPro[5] = new TProfile("three2n1n1n","#LT#LT3#GT#GT_{2n|n,n}",fnBinsMult,fMinMult,fMaxMult);
2828  fIntFlowCorrelationsAllVsMPro[6] = new TProfile("three3n2n1n","#LT#LT3#GT#GT_{3n|2n,n}",fnBinsMult,fMinMult,fMaxMult);
2829  fIntFlowCorrelationsAllVsMPro[7] = new TProfile("three4n2n2n","#LT#LT3#GT#GT_{4n|2n,2n}",fnBinsMult,fMinMult,fMaxMult);
2830  fIntFlowCorrelationsAllVsMPro[8] = new TProfile("three4n3n1n","#LT#LT3#GT#GT_{4n|3n,n}",fnBinsMult,fMinMult,fMaxMult);
2831  // 4-p correlations vs M:
2832  fIntFlowCorrelationsAllVsMPro[10] = new TProfile("four1n1n1n1n","#LT#LT4#GT#GT_{n,n|n,n}",fnBinsMult,fMinMult,fMaxMult);
2833  fIntFlowCorrelationsAllVsMPro[11] = new TProfile("four2n1n2n1n","#LT#LT4#GT#GT_{2n,n|2n,n}",fnBinsMult,fMinMult,fMaxMult);
2834  fIntFlowCorrelationsAllVsMPro[12] = new TProfile("four2n2n2n2n","#LT#LT4#GT#GT_{2n,2n|2n,2n}",fnBinsMult,fMinMult,fMaxMult);
2835  fIntFlowCorrelationsAllVsMPro[13] = new TProfile("four3n1n1n1n","#LT#LT4#GT#GT_{3n|n,n,n}",fnBinsMult,fMinMult,fMaxMult);
2836  fIntFlowCorrelationsAllVsMPro[14] = new TProfile("four3n1n3n1n","#LT#LT4#GT#GT_{3n,n|3n,n}",fnBinsMult,fMinMult,fMaxMult);
2837  fIntFlowCorrelationsAllVsMPro[15] = new TProfile("four3n1n2n2n","#LT#LT4#GT#GT_{3n,n|2n,2n}",fnBinsMult,fMinMult,fMaxMult);
2838  fIntFlowCorrelationsAllVsMPro[16] = new TProfile("four4n2n1n1n","#LT#LT4#GT#GT_{4n|2n,n,n}",fnBinsMult,fMinMult,fMaxMult);
2839  // 5-p correlations vs M:
2840  fIntFlowCorrelationsAllVsMPro[18] = new TProfile("five2n1n1n1n1n","#LT#LT5#GT#GT_{2n,n|n,n,n}",fnBinsMult,fMinMult,fMaxMult);
2841  fIntFlowCorrelationsAllVsMPro[19] = new TProfile("five2n2n2n1n1n","#LT#LT5#GT#GT_{2n,2n|2n,n,n}",fnBinsMult,fMinMult,fMaxMult);
2842  fIntFlowCorrelationsAllVsMPro[20] = new TProfile("five3n1n2n1n1n","#LT#LT5#GT#GT_{3n,n|2n,n,n}",fnBinsMult,fMinMult,fMaxMult);
2843  fIntFlowCorrelationsAllVsMPro[21] = new TProfile("five4n1n1n1n1n","#LT#LT5#GT#GT_{4n|n,n,n,n}",fnBinsMult,fMinMult,fMaxMult);
2844  // 6-p correlations vs M:
2845  fIntFlowCorrelationsAllVsMPro[23] = new TProfile("six1n1n1n1n1n1n","#LT#LT6#GT#GT_{n,n,n|n,n,n}",fnBinsMult,fMinMult,fMaxMult);
2846  fIntFlowCorrelationsAllVsMPro[24] = new TProfile("six2n1n1n2n1n1n","#LT#LT6#GT#GT_{2n,n,n|2n,n,n}",fnBinsMult,fMinMult,fMaxMult);
2847  fIntFlowCorrelationsAllVsMPro[25] = new TProfile("six2n2n1n1n1n1n","#LT#LT6#GT#GT_{2n,2n|n,n,n,n}",fnBinsMult,fMinMult,fMaxMult);
2848  fIntFlowCorrelationsAllVsMPro[26] = new TProfile("six3n1n1n1n1n1n","#LT#LT6#GT#GT_{3n,n|n,n,n,n}",fnBinsMult,fMinMult,fMaxMult);
2849  // 7-p correlations vs M:
2850  fIntFlowCorrelationsAllVsMPro[28] = new TProfile("seven2n1n1n1n1n1n1n","#LT#LT7#GT#GT_{2n,n,n|n,n,n,n}",fnBinsMult,fMinMult,fMaxMult);
2851  // 8-p correlations vs M:
2852  fIntFlowCorrelationsAllVsMPro[30] = new TProfile("eight1n1n1n1n1n1n1n1n","#LT#LT8#GT#GT_{n,n,n,n|n,n,n,n}",fnBinsMult,fMinMult,fMaxMult);
2853  // EXTRA correlations vs M for v3{5} study (to be improved - put them in a right order somewhere):
2854  fIntFlowCorrelationsAllVsMPro[32] = new TProfile("four4n2n3n3n","#LT#LT4#GT#GT_{4n,2n|3n,3n}",fnBinsMult,fMinMult,fMaxMult);
2855  fIntFlowCorrelationsAllVsMPro[33] = new TProfile("five3n3n2n2n2n","#LT#LT5#GT#GT_{3n,3n|2n,2n,2n}",fnBinsMult,fMinMult,fMaxMult);
2856  // EXTRA correlations vs M for Teaney-Yan study (to be improved - put them in a right order somewhere):
2857  fIntFlowCorrelationsAllVsMPro[34] = new TProfile("two5n5n","#LT#LT2#GT#GT_{5n|5n}",fnBinsMult,fMinMult,fMaxMult);
2858  fIntFlowCorrelationsAllVsMPro[35] = new TProfile("two6n6n","#LT#LT2#GT#GT_{6n|6n}",fnBinsMult,fMinMult,fMaxMult);
2859  fIntFlowCorrelationsAllVsMPro[36] = new TProfile("three5n3n2n","#LT#LT3#GT#GT_{5n|3n,2n}",fnBinsMult,fMinMult,fMaxMult);
2860  fIntFlowCorrelationsAllVsMPro[37] = new TProfile("three5n4n1n","#LT#LT3#GT#GT_{5n|4n,1n}",fnBinsMult,fMinMult,fMaxMult);
2861  fIntFlowCorrelationsAllVsMPro[38] = new TProfile("three6n3n3n","#LT#LT3#GT#GT_{6n|3n,3n}",fnBinsMult,fMinMult,fMaxMult);
2862  fIntFlowCorrelationsAllVsMPro[39] = new TProfile("three6n4n2n","#LT#LT3#GT#GT_{6n|4n,2n}",fnBinsMult,fMinMult,fMaxMult);
2863  fIntFlowCorrelationsAllVsMPro[40] = new TProfile("three6n5n1n","#LT#LT3#GT#GT_{6n|5n,1n}",fnBinsMult,fMinMult,fMaxMult);
2864  fIntFlowCorrelationsAllVsMPro[41] = new TProfile("four6n3n2n1n","#LT#LT4#GT#GT_{6n|3n,2n,1n}",fnBinsMult,fMinMult,fMaxMult);
2865  fIntFlowCorrelationsAllVsMPro[42] = new TProfile("four3n2n3n2n","#LT#LT4#GT#GT_{3n,2n|3n,2n}",fnBinsMult,fMinMult,fMaxMult);
2866  fIntFlowCorrelationsAllVsMPro[43] = new TProfile("four4n1n3n2n","#LT#LT4#GT#GT_{4n,1n|3n,2n}",fnBinsMult,fMinMult,fMaxMult);
2867  fIntFlowCorrelationsAllVsMPro[44] = new TProfile("four3n3n3n3n","#LT#LT4#GT#GT_{3n,3n|3n,3n}",fnBinsMult,fMinMult,fMaxMult);
2868  fIntFlowCorrelationsAllVsMPro[45] = new TProfile("four4n2n3n3n","#LT#LT4#GT#GT_{4n,2n|3n,3n}",fnBinsMult,fMinMult,fMaxMult);
2869  fIntFlowCorrelationsAllVsMPro[46] = new TProfile("four5n1n3n3n","#LT#LT4#GT#GT_{5n,1n|3n,3n}",fnBinsMult,fMinMult,fMaxMult);
2870  fIntFlowCorrelationsAllVsMPro[47] = new TProfile("four4n2n4n2n","#LT#LT4#GT#GT_{4n,2n|4n,2n}",fnBinsMult,fMinMult,fMaxMult);
2871  fIntFlowCorrelationsAllVsMPro[48] = new TProfile("four5n1n4n2n","#LT#LT4#GT#GT_{5n,1n|4n,2n}",fnBinsMult,fMinMult,fMaxMult);
2872  fIntFlowCorrelationsAllVsMPro[49] = new TProfile("four5n3n1n1n","#LT#LT4#GT#GT_{5n|3n,1n,1n}",fnBinsMult,fMinMult,fMaxMult);
2873  fIntFlowCorrelationsAllVsMPro[50] = new TProfile("four5n2n2n1n","#LT#LT4#GT#GT_{5n|2n,2n,1n}",fnBinsMult,fMinMult,fMaxMult);
2874  fIntFlowCorrelationsAllVsMPro[51] = new TProfile("four5n1n5n1n","#LT#LT4#GT#GT_{5n,1n|5n,1n}",fnBinsMult,fMinMult,fMaxMult);
2875  fIntFlowCorrelationsAllVsMPro[52] = new TProfile("five3n3n3n2n1n","#LT#LT5#GT#GT_{3n,3n|3n,2n,1n}",fnBinsMult,fMinMult,fMaxMult);
2876  fIntFlowCorrelationsAllVsMPro[53] = new TProfile("five4n2n3n2n1n","#LT#LT5#GT#GT_{4n,2n|3n,2n,1n}",fnBinsMult,fMinMult,fMaxMult);
2877  fIntFlowCorrelationsAllVsMPro[54] = new TProfile("five3n2n3n1n1n","#LT#LT5#GT#GT_{3n,2n|3n,1n,1n}",fnBinsMult,fMinMult,fMaxMult);
2878  fIntFlowCorrelationsAllVsMPro[55] = new TProfile("five3n2n2n2n1n","#LT#LT5#GT#GT_{3n,2n|2n,2n,1n}",fnBinsMult,fMinMult,fMaxMult);
2879  fIntFlowCorrelationsAllVsMPro[56] = new TProfile("five5n1n3n2n1n","#LT#LT5#GT#GT_{5n,1n|3n,2n,1n}",fnBinsMult,fMinMult,fMaxMult);
2880  fIntFlowCorrelationsAllVsMPro[57] = new TProfile("six3n2n1n3n2n1n","#LT#LT6#GT#GT_{3n,2n,1n|3n,2n,1n}",fnBinsMult,fMinMult,fMaxMult);
2881  fIntFlowCorrelationsAllVsMPro[58] = new TProfile("four6n4n1n1n","#LT#LT4#GT#GT_{6n|4n,1n,1n}",fnBinsMult,fMinMult,fMaxMult);
2882  fIntFlowCorrelationsAllVsMPro[59] = new TProfile("four6n2n2n2n","#LT#LT4#GT#GT_{6n|2n,2n,2n}",fnBinsMult,fMinMult,fMaxMult);
2883  fIntFlowCorrelationsAllVsMPro[60] = new TProfile("five6n2n2n1n1n","#LT#LT5#GT#GT_{6n|2n,2n,1n,1n}",fnBinsMult,fMinMult,fMaxMult);
2884  fIntFlowCorrelationsAllVsMPro[61] = new TProfile("five4n1n1n3n3n","#LT#LT5#GT#GT_{4n,1n,1n|3n,3n}",fnBinsMult,fMinMult,fMaxMult);
2885  fIntFlowCorrelationsAllVsMPro[62] = new TProfile("six3n3n2n2n1n1n","#LT#LT6#GT#GT_{3n,3n|2n,2n,1n,1n}",fnBinsMult,fMinMult,fMaxMult);
2886  for(Int_t n=0;n<63;n++)
2887  {
2889  {
2890  fIntFlowCorrelationsAllVsMPro[n]->Sumw2();
2892  {
2893  fIntFlowCorrelationsAllVsMPro[n]->GetXaxis()->SetTitle("# RPs");
2895  {
2896  fIntFlowCorrelationsAllVsMPro[n]->GetXaxis()->SetTitle("Reference multiplicity (from ESD)");
2898  {
2899  fIntFlowCorrelationsAllVsMPro[n]->GetXaxis()->SetTitle("# POIs");
2900  }
2902  } // end of if(fIntFlowCorrelationsAllVsMPro[n])
2903  } // end of for(Int_t n=0;n<63;n++)
2904  } // end of if(fCalculateAllCorrelationsVsM)
2905  // when particle weights are used some extra correlations appear:
2907  {
2908  TString intFlowExtraCorrelationsProName = "fIntFlowExtraCorrelationsPro";
2909  intFlowExtraCorrelationsProName += fAnalysisLabel->Data();
2910  fIntFlowExtraCorrelationsPro = new TProfile(intFlowExtraCorrelationsProName.Data(),"Average extra correlations for all events",100,0,100,"s");
2911  fIntFlowExtraCorrelationsPro->SetTickLength(-0.01,"Y");
2912  fIntFlowExtraCorrelationsPro->SetMarkerStyle(25);
2913  fIntFlowExtraCorrelationsPro->SetLabelSize(0.03);
2914  fIntFlowExtraCorrelationsPro->SetLabelOffset(0.01,"Y");
2915  // extra 2-p correlations:
2916  (fIntFlowExtraCorrelationsPro->GetXaxis())->SetBinLabel(1,"<<w1^3 w2 cos(n*(phi1-phi2))>>");
2917  (fIntFlowExtraCorrelationsPro->GetXaxis())->SetBinLabel(2,"<<w1 w2 w3^2 cos(n*(phi1-phi2))>>");
2919  } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights||fUseTrackWeights)
2920  // average product of correlations <2>, <4>, <6> and <8>:
2921  TString productFlag[6] = {"#LT#LT2#GT#LT4#GT#GT","#LT#LT2#GT#LT6#GT#GT","#LT#LT2#GT#LT8#GT#GT",
2922  "#LT#LT4#GT#LT6#GT#GT","#LT#LT4#GT#LT8#GT#GT","#LT#LT6#GT#LT8#GT#GT"};
2923  TString intFlowProductOfCorrelationsProName = "fIntFlowProductOfCorrelationsPro";
2924  intFlowProductOfCorrelationsProName += fAnalysisLabel->Data();
2925  fIntFlowProductOfCorrelationsPro = new TProfile(intFlowProductOfCorrelationsProName.Data(),"Average products of correlations",6,0,6);
2926  fIntFlowProductOfCorrelationsPro->SetTickLength(-0.01,"Y");
2927  fIntFlowProductOfCorrelationsPro->SetMarkerStyle(25);
2928  fIntFlowProductOfCorrelationsPro->SetLabelSize(0.05);
2929  fIntFlowProductOfCorrelationsPro->SetLabelOffset(0.01,"Y");
2930  for(Int_t b=0;b<6;b++)
2931  {
2932  (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(b+1,productFlag[b].Data());
2933  }
2935  // average product of correlations <2>, <4>, <6> and <8> versus multiplicity
2936  // [0=<<2><4>>,1=<<2><6>>,2=<<2><8>>,3=<<4><6>>,4=<<4><8>>,5=<<6><8>>]
2938  {
2939  TString intFlowProductOfCorrelationsVsMProName = "fIntFlowProductOfCorrelationsVsMPro";
2940  intFlowProductOfCorrelationsVsMProName += fAnalysisLabel->Data();
2941  for(Int_t pi=0;pi<6;pi++)
2942  {
2943  fIntFlowProductOfCorrelationsVsMPro[pi] = new TProfile(Form("%s, %s",intFlowProductOfCorrelationsVsMProName.Data(),productFlag[pi].Data()),
2944  Form("%s versus multiplicity",productFlag[pi].Data()),
2947  {
2948  fIntFlowProductOfCorrelationsVsMPro[pi]->GetXaxis()->SetTitle("# RPs");
2950  {
2951  fIntFlowProductOfCorrelationsVsMPro[pi]->GetXaxis()->SetTitle("Reference multiplicity (from ESD)");
2953  {
2954  fIntFlowProductOfCorrelationsVsMPro[pi]->GetXaxis()->SetTitle("# POIs");
2955  }
2957  } // end of for(Int_t pi=0;pi<6;pi++)
2958  } // end of if(fCalculateCumulantsVsM)
2959  // average product of correction terms for NUA:
2960  TString intFlowProductOfCorrectionTermsForNUAProName = "fIntFlowProductOfCorrectionTermsForNUAPro";
2961  intFlowProductOfCorrectionTermsForNUAProName += fAnalysisLabel->Data();
2962  fIntFlowProductOfCorrectionTermsForNUAPro = new TProfile(intFlowProductOfCorrectionTermsForNUAProName.Data(),"Average products of correction terms for NUA",27,0,27);
2963  fIntFlowProductOfCorrectionTermsForNUAPro->SetTickLength(-0.01,"Y");
2964  fIntFlowProductOfCorrectionTermsForNUAPro->SetMarkerStyle(25);
2965  fIntFlowProductOfCorrectionTermsForNUAPro->SetLabelSize(0.03);
2966  fIntFlowProductOfCorrectionTermsForNUAPro->SetLabelOffset(0.01,"Y");
2967  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(1,"<<2><cos(#phi)>>");
2968  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(2,"<<2><sin(#phi)>>");
2969  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(3,"<<cos(#phi)><sin(#phi)>>");
2970  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(4,"Cov(<2>,<cos(#phi_{1}+#phi_{2})>)");
2971  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(5,"Cov(<2>,<sin(#phi_{1}+#phi_{2})>)");
2972  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(6,"Cov(<2>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
2973  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(7,"Cov(<2>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
2974  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(8,"Cov(<4>,<cos(#phi)>)");
2975  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(9,"Cov(<4>,<sin(#phi)>)");
2976  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(10,"Cov(<4>,<cos(#phi_{1}+#phi_{2})>)");
2977  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(11,"Cov(<4>,<sin(#phi_{1}+#phi_{2})>)");
2978  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(12,"Cov(<4>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>>)");
2979  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(13,"Cov(<4>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>>)");
2980  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(14,"Cov(<cos(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
2981  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(15,"Cov(<cos(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
2982  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(16,"Cov(<cos(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
2983  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(17,"Cov(<cos(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
2984  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(18,"Cov(<sin(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
2985  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(19,"Cov(<sin(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
2986  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(20,"Cov(<sin(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
2987  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(21,"Cov(<sin(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
2988  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(22,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}+#phi_{2})>)");
2989  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(23,"Cov(<cos(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
2990  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(24,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
2991  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(25,"Cov(<sin(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
2992  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(26,"Cov(<sin(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
2993  (fIntFlowProductOfCorrectionTermsForNUAPro->GetXaxis())->SetBinLabel(27,"Cov(<cos(#phi_{1}-#phi_{2}-#phi_{3}>,<sin(#phi_{1}-#phi_{2}-#phi_{3}>)");
2995  // average correction terms for non-uniform acceptance (with wrong errors!):
2996  for(Int_t sc=0;sc<2;sc++) // sin or cos terms
2997  {
2998  TString intFlowCorrectionTermsForNUAProName = "fIntFlowCorrectionTermsForNUAPro";
2999  intFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();
3000  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");
3001  fIntFlowCorrectionTermsForNUAPro[sc]->SetTickLength(-0.01,"Y");
3002  fIntFlowCorrectionTermsForNUAPro[sc]->SetMarkerStyle(25);
3003  fIntFlowCorrectionTermsForNUAPro[sc]->SetLabelSize(0.05);
3004  fIntFlowCorrectionTermsForNUAPro[sc]->SetLabelOffset(0.01,"Y");
3005  (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(1,Form("#LT#LT%s(n(#phi_{1}))#GT#GT",sinCosFlag[sc].Data()));
3006  (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(2,Form("#LT#LT%s(n(#phi_{1}+#phi_{2}))#GT#GT",sinCosFlag[sc].Data()));
3007  (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(3,Form("#LT#LT%s(n(#phi_{1}-#phi_{2}-#phi_{3}))#GT#GT",sinCosFlag[sc].Data()));
3008  (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(4,Form("#LT#LT%s(n(2#phi_{1}-#phi_{2}))#GT#GT",sinCosFlag[sc].Data()));
3010  // versus multiplicity:
3012  {
3013  TString correctionTermFlag[4] = {"(n(phi1))","(n(phi1+phi2))","(n(phi1-phi2-phi3))","(n(2phi1-phi2))"}; // to be improved - hardwired 4
3014  for(Int_t ci=0;ci<4;ci++) // correction term index (to be improved - hardwired 4)
3015  {
3016  TString intFlowCorrectionTermsForNUAVsMProName = "fIntFlowCorrectionTermsForNUAVsMPro";
3017  intFlowCorrectionTermsForNUAVsMProName += fAnalysisLabel->Data();
3018  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");
3020  }
3021  } // end of if(fCalculateCumulantsVsM)
3022  } // end of for(Int_t sc=0;sc<2;sc++)
3023 
3024  // d) Book histograms holding the final results:
3025  // average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with correct errors!):
3026  TString intFlowCorrelationsHistName = "fIntFlowCorrelationsHist";
3027  intFlowCorrelationsHistName += fAnalysisLabel->Data();
3028  fIntFlowCorrelationsHist = new TH1D(intFlowCorrelationsHistName.Data(),"Average correlations for all events",4,0,4);
3029  fIntFlowCorrelationsHist->SetTickLength(-0.01,"Y");
3030  fIntFlowCorrelationsHist->SetMarkerStyle(25);
3031  fIntFlowCorrelationsHist->SetLabelSize(0.06);
3032  fIntFlowCorrelationsHist->SetLabelOffset(0.01,"Y");
3033  (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(1,"#LT#LT2#GT#GT");
3034  (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(2,"#LT#LT4#GT#GT");
3035  (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(3,"#LT#LT6#GT#GT");
3036  (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(4,"#LT#LT8#GT#GT");
3038  // average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with correct errors!) vs M:
3040  {
3041  for(Int_t ci=0;ci<4;ci++) // correlation index
3042  {
3043  TString intFlowCorrelationsVsMHistName = "fIntFlowCorrelationsVsMHist";
3044  intFlowCorrelationsVsMHistName += fAnalysisLabel->Data();
3045  fIntFlowCorrelationsVsMHist[ci] = new TH1D(Form("%s, %s",intFlowCorrelationsVsMHistName.Data(),correlationFlag[ci].Data()),
3046  Form("%s vs multiplicity",correlationFlag[ci].Data()),
3048  fIntFlowCorrelationsVsMHist[ci]->GetYaxis()->SetTitle(correlationFlag[ci].Data());
3050  {
3051  fIntFlowCorrelationsVsMHist[ci]->GetXaxis()->SetTitle("# RPs");
3053  {
3054  fIntFlowCorrelationsVsMHist[ci]->GetXaxis()->SetTitle("Reference multiplicity (from ESD)");
3056  {
3057  fIntFlowCorrelationsVsMHist[ci]->GetXaxis()->SetTitle("# POIs");
3058  }
3060  } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
3061  } // end of if(fCalculateCumulantsVsM)
3062  // average all correlations for all events (with correct errors!):
3063  TString intFlowCorrelationsAllHistName = "fIntFlowCorrelationsAllHist";
3064  intFlowCorrelationsAllHistName += fAnalysisLabel->Data();
3065  fIntFlowCorrelationsAllHist = new TH1D(intFlowCorrelationsAllHistName.Data(),"Average correlations for all events",34,0,34);
3066  fIntFlowCorrelationsAllHist->SetTickLength(-0.01,"Y");
3067  fIntFlowCorrelationsAllHist->SetMarkerStyle(25);
3068  fIntFlowCorrelationsAllHist->SetLabelSize(0.03);
3069  fIntFlowCorrelationsAllHist->SetLabelOffset(0.01,"Y");
3070  // 2-p correlations:
3071  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(1,"<<2>>_{n|n}");
3072  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(2,"<<2>>_{2n|2n}");
3073  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(3,"<<2>>_{3n|3n}");
3074  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(4,"<<2>>_{4n|4n}");
3075  // 3-p correlations:
3076  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(6,"<<3>>_{2n|n,n}");
3077  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(7,"<<3>>_{3n|2n,n}");
3078  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(8,"<<3>>_{4n|2n,2n}");
3079  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(9,"<<3>>_{4n|3n,n}");
3080  // 4-p correlations:
3081  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(11,"<<4>>_{n,n|n,n}");
3082  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(12,"<<4>>_{2n,n|2n,n}");
3083  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(13,"<<4>>_{2n,2n|2n,2n}");
3084  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(14,"<<4>>_{3n|n,n,n}");
3085  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(15,"<<4>>_{3n,n|3n,n}");
3086  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(16,"<<4>>_{3n,n|2n,2n}");
3087  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(17,"<<4>>_{4n|2n,n,n}");
3088  // 5-p correlations:
3089  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(19,"<<5>>_{2n|n,n,n,n}");
3090  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(20,"<<5>>_{2n,2n|2n,n,n}");
3091  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(21,"<<5>>_{3n,n|2n,n,n}");
3092  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(22,"<<5>>_{4n|n,n,n,n}");
3093  // 6-p correlations:
3094  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(24,"<<6>>_{n,n,n|n,n,n}");
3095  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(25,"<<6>>_{2n,n,n|2n,n,n}");
3096  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(26,"<<6>>_{2n,2n|n,n,n,n}");
3097  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(27,"<<6>>_{3n,n|n,n,n,n}");
3098  // 7-p correlations:
3099  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(29,"<<7>>_{2n,n,n|n,n,n,n}");
3100  // 8-p correlations:
3101  (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(31,"<<8>>_{n,n,n,n|n,n,n,n}");
3103  // average correction terms for non-uniform acceptance (with correct errors!):
3104  for(Int_t sc=0;sc<2;sc++) // sin or cos terms
3105  {
3106  TString intFlowCorrectionTermsForNUAHistName = "fIntFlowCorrectionTermsForNUAHist";
3107  intFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();
3108  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);
3109  fIntFlowCorrectionTermsForNUAHist[sc]->SetTickLength(-0.01,"Y");
3110  fIntFlowCorrectionTermsForNUAHist[sc]->SetMarkerStyle(25);
3111  fIntFlowCorrectionTermsForNUAHist[sc]->SetLabelSize(0.05);
3112  fIntFlowCorrectionTermsForNUAHist[sc]->SetLabelOffset(0.01,"Y");
3113  (fIntFlowCorrectionTermsForNUAHist[sc]->GetXaxis())->SetBinLabel(1,Form("#LT#LT%s(n(#phi_{1}))#GT#GT",sinCosFlag[sc].Data()));
3114  (fIntFlowCorrectionTermsForNUAHist[sc]->GetXaxis())->SetBinLabel(2,Form("#LT#LT%s(n(#phi_{1}+#phi_{2}))#GT#GT",sinCosFlag[sc].Data()));
3115  (fIntFlowCorrectionTermsForNUAHist[sc]->GetXaxis())->SetBinLabel(3,Form("#LT#LT%s(n(#phi_{1}-#phi_{2}-#phi_{3}))#GT#GT",sinCosFlag[sc].Data()));
3116  (fIntFlowCorrectionTermsForNUAHist[sc]->GetXaxis())->SetBinLabel(4,Form("#LT#LT%s(n(2#phi_{1}-#phi_{2}))#GT#GT",sinCosFlag[sc].Data()));
3118  } // end of for(Int_t sc=0;sc<2;sc++)
3119  // covariances (multiplied with weight dependent prefactor):
3120  TString intFlowCovariancesName = "fIntFlowCovariances";
3121  intFlowCovariancesName += fAnalysisLabel->Data();
3122  fIntFlowCovariances = new TH1D(intFlowCovariancesName.Data(),"Covariances (multiplied with weight dependent prefactor)",6,0,6);
3123  fIntFlowCovariances->SetLabelSize(0.04);
3124  fIntFlowCovariances->SetMarkerStyle(25);
3125  (fIntFlowCovariances->GetXaxis())->SetBinLabel(1,"Cov(#LT2#GT,#LT4#GT)");
3126  (fIntFlowCovariances->GetXaxis())->SetBinLabel(2,"Cov(#LT2#GT,#LT6#GT)");
3127  (fIntFlowCovariances->GetXaxis())->SetBinLabel(3,"Cov(#LT2#GT,#LT8#GT)");
3128  (fIntFlowCovariances->GetXaxis())->SetBinLabel(4,"Cov(#LT4#GT,#LT6#GT)");
3129  (fIntFlowCovariances->GetXaxis())->SetBinLabel(5,"Cov(#LT4#GT,#LT8#GT)");
3130  (fIntFlowCovariances->GetXaxis())->SetBinLabel(6,"Cov(#LT6#GT,#LT8#GT)");
3132  // sum of linear and quadratic event weights for <2>, <4>, <6> and <8>:
3133  TString intFlowSumOfEventWeightsName = "fIntFlowSumOfEventWeights";
3134  intFlowSumOfEventWeightsName += fAnalysisLabel->Data();
3135  for(Int_t power=0;power<2;power++)
3136  {
3137  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);
3138  fIntFlowSumOfEventWeights[power]->SetLabelSize(0.04);
3139  fIntFlowSumOfEventWeights[power]->SetMarkerStyle(25);
3140  if(power == 0)
3141  {
3142  (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{#LT2#GT}");
3143  (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{#LT4#GT}");
3144  (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{#LT6#GT}");
3145  (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{#LT8#GT}");
3146  } else if (power == 1)
3147  {
3148  (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{#LT2#GT}^{2}");
3149  (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{#LT4#GT}^{2}");
3150  (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{#LT6#GT}^{2}");
3151  (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{#LT8#GT}^{2}");
3152  }
3154  }
3155  // sum of products of event weights for correlations <2>, <4>, <6> and <8>:
3156  TString intFlowSumOfProductOfEventWeightsName = "fIntFlowSumOfProductOfEventWeights";
3157  intFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();
3158  fIntFlowSumOfProductOfEventWeights = new TH1D(intFlowSumOfProductOfEventWeightsName.Data(),"Sum of product of event weights for correlations",6,0,6);
3159  fIntFlowSumOfProductOfEventWeights->SetLabelSize(0.04);
3160  fIntFlowSumOfProductOfEventWeights->SetMarkerStyle(25);
3161  (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{#LT2#GT} w_{#LT4#GT}");
3162  (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{#LT2#GT} w_{#LT6#GT}");
3163  (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{#LT2#GT} w_{#LT8#GT}");
3164  (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{#LT4#GT} w_{#LT6#GT}");
3165  (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(5,"#sum_{i=1}^{N} w_{#LT4#GT} w_{#LT8#GT}");
3166  (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(6,"#sum_{i=1}^{N} w_{#LT6#GT} w_{#LT8#GT}");
3168  // final result for covariances of correlations (multiplied with weight dependent prefactor) versus M
3169  // [0=Cov(2,4),1=Cov(2,6),2=Cov(2,8),3=Cov(4,6),4=Cov(4,8),5=Cov(6,8)]:
3171  {
3172  TString intFlowCovariancesVsMName = "fIntFlowCovariancesVsM";
3173  intFlowCovariancesVsMName += fAnalysisLabel->Data();
3174  TString covarianceFlag[6] = {"Cov(<2>,<4>)","Cov(<2>,<6>)","Cov(<2>,<8>)","Cov(<4>,<6>)","Cov(<4>,<8>)","Cov(<6>,<8>)"};
3175  for(Int_t ci=0;ci<6;ci++)
3176  {
3177  fIntFlowCovariancesVsM[ci] = new TH1D(Form("%s, %s",intFlowCovariancesVsMName.Data(),covarianceFlag[ci].Data()),
3178  Form("%s vs multiplicity",covarianceFlag[ci].Data()),
3180  fIntFlowCovariancesVsM[ci]->GetYaxis()->SetTitle(covarianceFlag[ci].Data());
3182  {
3183  fIntFlowCovariancesVsM[ci]->GetXaxis()->SetTitle("# RPs");
3185  {
3186  fIntFlowCovariancesVsM[ci]->GetXaxis()->SetTitle("Reference multiplicity (from ESD)");
3188  {
3189  fIntFlowCovariancesVsM[ci]->GetXaxis()->SetTitle("# POIs");
3190  }
3192  }
3193  } // end of if(fCalculateCumulantsVsM)
3194  // sum of linear and quadratic event weights for <2>, <4>, <6> and <8> versus multiplicity
3195  // [0=sum{w_{<2>}},1=sum{w_{<4>}},2=sum{w_{<6>}},3=sum{w_{<8>}}][0=linear 1,1=quadratic]:
3197  {
3198  TString intFlowSumOfEventWeightsVsMName = "fIntFlowSumOfEventWeightsVsM";
3199  intFlowSumOfEventWeightsVsMName += fAnalysisLabel->Data();
3200  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>}"},
3201  {"#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}"}};
3202  for(Int_t si=0;si<4;si++)
3203  {
3204  for(Int_t power=0;power<2;power++)
3205  {
3206  fIntFlowSumOfEventWeightsVsM[si][power] = new TH1D(Form("%s, %s",intFlowSumOfEventWeightsVsMName.Data(),sumFlag[power][si].Data()),
3207  Form("%s vs multiplicity",sumFlag[power][si].Data()),
3209  fIntFlowSumOfEventWeightsVsM[si][power]->GetYaxis()->SetTitle(sumFlag[power][si].Data());
3211  {
3212  fIntFlowSumOfEventWeightsVsM[si][power]->GetXaxis()->SetTitle("# RPs");
3214  {
3215  fIntFlowSumOfEventWeightsVsM[si][power]->GetXaxis()->SetTitle("Reference multiplicity (from ESD)");
3217  {
3218  fIntFlowSumOfEventWeightsVsM[si][power]->GetXaxis()->SetTitle("# POIs");
3219  }
3221  } // end of for(Int_t power=0;power<2;power++)
3222  } // end of for(Int_t si=0;si<4;si++)
3223  } // end of if(fCalculateCumulantsVsM)
3224  // sum of products of event weights for correlations <2>, <4>, <6> and <8> vs M
3225  // [0=sum{w_{<2>}w_{<4>}},1=sum{w_{<2>}w_{<6>}},2=sum{w_{<2>}w_{<8>}},
3226  // 3=sum{w_{<4>}w_{<6>}},4=sum{w_{<4>}w_{<8>}},5=sum{w_{<6>}w_{<8>}}]:
3228  {
3229  TString intFlowSumOfProductOfEventWeightsVsMName = "fIntFlowSumOfProductOfEventWeightsVsM";
3230  intFlowSumOfProductOfEventWeightsVsMName += fAnalysisLabel->Data();
3231  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>}",
3232  "#sum_{i=1}^{N} w_{<4>} w_{<6>}","#sum_{i=1}^{N} w_{<4>} w_{<8>}","#sum_{i=1}^{N} w_{<6>} w_{<8>}"};
3233  for(Int_t pi=0;pi<6;pi++)
3234  {
3235  fIntFlowSumOfProductOfEventWeightsVsM[pi] = new TH1D(Form("%s, %s",intFlowSumOfProductOfEventWeightsVsMName.Data(),sopowFlag[pi].Data()),
3236  Form("%s versus multiplicity",sopowFlag[pi].Data()),
3239  {
3240  fIntFlowSumOfProductOfEventWeightsVsM[pi]->GetXaxis()->SetTitle("# RPs");
3242  {
3243  fIntFlowSumOfProductOfEventWeightsVsM[pi]->GetXaxis()->SetTitle("Reference multiplicity (from ESD)");
3245  {
3246  fIntFlowSumOfProductOfEventWeightsVsM[pi]->GetXaxis()->SetTitle("# POIs");
3247  }
3248  fIntFlowSumOfProductOfEventWeightsVsM[pi]->GetYaxis()->SetTitle(sopowFlag[pi].Data());
3250  } // end of for(Int_t pi=0;pi<6;pi++)
3251  } // end of if(fCalculateCumulantsVsM)
3252  // covariances of NUA terms (multiplied with weight dependent prefactor):
3253  TString intFlowCovariancesNUAName = "fIntFlowCovariancesNUA";
3254  intFlowCovariancesNUAName += fAnalysisLabel->Data();
3255  fIntFlowCovariancesNUA = new TH1D(intFlowCovariancesNUAName.Data(),"Covariances for NUA (multiplied with weight dependent prefactor)",27,0,27);
3256  fIntFlowCovariancesNUA->SetLabelSize(0.04);
3257  fIntFlowCovariancesNUA->SetMarkerStyle(25);
3258  fIntFlowCovariancesNUA->GetXaxis()->SetLabelSize(0.02);
3259  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(1,"Cov(<2>,<cos(#phi)>");
3260  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(2,"Cov(<2>,<sin(#phi)>)");
3261  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(3,"Cov(<cos(#phi)>,<sin(#phi)>)");
3262  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(4,"Cov(<2>,<cos(#phi_{1}+#phi_{2})>)");
3263  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(5,"Cov(<2>,<sin(#phi_{1}+#phi_{2})>)");
3264  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(6,"Cov(<2>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
3265  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(7,"Cov(<2>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
3266  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(8,"Cov(<4>,<cos(#phi)>)");
3267  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(9,"Cov(<4>,<sin(#phi)>)");
3268  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(10,"Cov(<4>,<cos(#phi_{1}+#phi_{2})>)");
3269  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(11,"Cov(<4>,<sin(#phi_{1}+#phi_{2})>)");
3270  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(12,"Cov(<4>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>>)");
3271  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(13,"Cov(<4>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>>)");
3272  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(14,"Cov(<cos(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
3273  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(15,"Cov(<cos(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
3274  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(16,"Cov(<cos(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
3275  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(17,"Cov(<cos(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
3276  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(18,"Cov(<sin(#phi)>,<cos(#phi_{1}+#phi_{2})>)");
3277  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(19,"Cov(<sin(#phi)>,<sin(#phi_{1}+#phi_{2})>)");
3278  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(20,"Cov(<sin(#phi)>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
3279  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(21,"Cov(<sin(#phi)>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
3280  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(22,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}+#phi_{2})>)");
3281  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(23,"Cov(<cos(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
3282  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(24,"Cov(<cos(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
3283  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(25,"Cov(<sin(#phi_{1}+#phi_{2})>,<cos(#phi_{1}-#phi_{2}-#phi_{3})>)");
3284  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(26,"Cov(<sin(#phi_{1}+#phi_{2})>,<sin(#phi_{1}-#phi_{2}-#phi_{3})>)");
3285  (fIntFlowCovariancesNUA->GetXaxis())->SetBinLabel(27,"Cov(<cos(#phi_{1}-#phi_{2}-#phi_{3}>,<sin(#phi_{1}-#phi_{2}-#phi_{3}>)");
3287  // sum of linear and quadratic event weights for NUA terms:
3288  TString intFlowSumOfEventWeightsNUAName = "fIntFlowSumOfEventWeightsNUA";
3289  intFlowSumOfEventWeightsNUAName += fAnalysisLabel->Data();
3290  for(Int_t sc=0;sc<2;sc++)
3291  {
3292  for(Int_t power=0;power<2;power++)
3293  {
3294  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
3295  fIntFlowSumOfEventWeightsNUA[sc][power]->SetLabelSize(0.05);
3296  fIntFlowSumOfEventWeightsNUA[sc][power]->SetMarkerStyle(25);
3297  if(power == 0)
3298  {
3299  (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(1,Form("#sum_{i=1}^{N} w_{<%s(#phi)>}",sinCosFlag[sc].Data()));
3300  (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(2,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}+#phi_{2})>}",sinCosFlag[sc].Data()));
3301  (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(3,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}-#phi_{2}-#phi_{3})>}",sinCosFlag[sc].Data()));
3302  (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(4,Form("#sum_{i=1}^{N} w_{<%s(2#phi_{1}-#phi_{2})>}",sinCosFlag[sc].Data()));
3303  } else if(power == 1)
3304  {
3305  (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(1,Form("#sum_{i=1}^{N} w_{<%s(#phi)>}^{2}",sinCosFlag[sc].Data()));
3306  (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(2,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}+#phi_{2})>}^{2}",sinCosFlag[sc].Data()));
3307  (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(3,Form("#sum_{i=1}^{N} w_{<%s(#phi_{1}-#phi_{2}-#phi_{3})>}^{2}",sinCosFlag[sc].Data()));
3308  (fIntFlowSumOfEventWeightsNUA[sc][power]->GetXaxis())->SetBinLabel(4,Form("#sum_{i=1}^{N} w_{<%s(2#phi_{1}-#phi_{2})>}^{2}",sinCosFlag[sc].Data()));
3309  }
3311  }
3312  }
3313  // sum of products of event weights for NUA terms:
3314  TString intFlowSumOfProductOfEventWeightsNUAName = "fIntFlowSumOfProductOfEventWeightsNUA";
3315  intFlowSumOfProductOfEventWeightsNUAName += fAnalysisLabel->Data();
3316  fIntFlowSumOfProductOfEventWeightsNUA = new TH1D(intFlowSumOfProductOfEventWeightsNUAName.Data(),"Sum of product of event weights for NUA terms",27,0,27);
3317  fIntFlowSumOfProductOfEventWeightsNUA->SetLabelSize(0.02);
3318  fIntFlowSumOfProductOfEventWeightsNUA->SetMarkerStyle(25);
3319  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{#LT2#GT} w_{#LTcos(#phi)#GT}");
3320  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{#LT2#GT} w_{#LTsin(#phi)#GT}");
3321  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{#LTcos(#phi)#GT} w_{#LTsin(#phi)#GT}");
3322  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{#LT2#GT} w_{#LTcos(#phi_{1}+#phi_{2})#GT}");
3323  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(5,"#sum_{i=1}^{N} w_{#LT2#GT} w_{#LTsin(#phi_{1}+#phi_{2})#GT}");
3324  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(6,"#sum_{i=1}^{N} w_{#LT2#GT} w_{#LTcos(#phi_{1}-#phi_{2}-#phi_{3})#GT}");
3325  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(7,"#sum_{i=1}^{N} w_{#LT2#GT} w_{#LTsin(#phi_{1}-#phi_{2}-#phi_{3})#GT}");
3326  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(8,"#sum_{i=1}^{N} w_{#LT4#GT} w_{#LTcos(#phi)#GT}");
3327  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(9,"#sum_{i=1}^{N} w_{#LT4#GT} w_{#LTsin(#phi)#GT}");
3328  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(10,"#sum_{i=1}^{N} w_{#LT4#GT} w_{#LTcos(#phi_{1}+#phi_{2})#GT}");
3329  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(11,"#sum_{i=1}^{N} w_{#LT4#GT} w_{#LTsin(#phi_{1}+#phi_{2})#GT}");
3330  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(12,"#sum_{i=1}^{N} w_{#LT4#GT} w_{#LTcos(#phi_{1}-#phi_{2}-#phi_{3})#GT}");
3331  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(13,"#sum_{i=1}^{N} w_{#LT4#GT} w_{#LTsin(#phi_{1}-#phi_{2}-#phi_{3})#GT}");
3332  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(14,"#sum_{i=1}^{N} w_{#LTcos(#phi)#GT} w_{#LTcos(#phi_{1}+#phi_{2})#GT}");
3333  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(15,"#sum_{i=1}^{N} w_{#LTcos(#phi)#GT} w_{#LTsin(#phi_{1}+#phi_{2})#GT}");
3334  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(16,"#sum_{i=1}^{N} w_{#LTcos(#phi)#GT} w_{#LTcos(#phi_{1}-#phi_{2}-#phi_{3})#GT}");
3335  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(17,"#sum_{i=1}^{N} w_{#LTcos(#phi)#GT} w_{#LTsin(#phi_{1}-#phi_{2}-#phi_{3})#GT}");
3336  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(18,"#sum_{i=1}^{N} w_{#LTsin(#phi)#GT} w_{#LTcos(#phi_{1}+#phi_{2})#GT}");
3337  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(19,"#sum_{i=1}^{N} w_{#LTsin(#phi)#GT} w_{#LTsin(#phi_{1}+#phi_{2})#GT}");
3338  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(20,"#sum_{i=1}^{N} w_{#LTsin(#phi)#GT} w_{#LTcos(#phi_{1}-#phi_{2}-#phi_{3})#GT}");
3339  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(21,"#sum_{i=1}^{N} w_{#LTsin(#phi)#GT} w_{#LTsin(#phi_{1}-#phi_{2}-#phi_{3})#GT}");
3340  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(22,"#sum_{i=1}^{N} w_{#LTcos(#phi_{1}+#phi_{2})#GT} w_{#LTsin(#phi_{1}+#phi_{2})#GT}");
3341  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(23,"#sum_{i=1}^{N} w_{#LTcos(#phi_{1}+#phi_{2})#GT} w_{#LTcos(#phi_{1}-#phi_{2}-#phi_{3})#GT}");
3342  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(24,"#sum_{i=1}^{N} w_{#LTcos(#phi_{1}+#phi_{2})#GT} w_{#LTsin(#phi_{1}-#phi_{2}-#phi_{3})#GT}");
3343  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(25,"#sum_{i=1}^{N} w_{#LTsin(#phi_{1}+#phi_{2})#GT} w_{#LTcos(#phi_{1}-#phi_{2}-#phi_{3})#GT}");
3344  (fIntFlowSumOfProductOfEventWeightsNUA->GetXaxis())->SetBinLabel(26,"#sum_{i=1}^{N} w_{#LTsin(#phi_{1}+#phi_{2})#GT} w_{#LTsin(#phi_{1}-#phi_{2}-#phi_{3})#GT}");
3345  (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}");
3347  // Final results for reference Q-cumulants:
3348  TString cumulantFlag[4] = {"QC{2}","QC{4}","QC{6}","QC{8}"};
3349  TString intFlowQcumulantsName = "fIntFlowQcumulants";
3350  intFlowQcumulantsName += fAnalysisLabel->Data();
3351  fIntFlowQcumulants = new TH1D(intFlowQcumulantsName.Data(),"Reference Q-cumulants",4,0,4);
3353  {
3354  fIntFlowQcumulants->SetTitle("Reference Q-cumulants (error from non-isotropic terms also propagated)");
3355  }
3356  fIntFlowQcumulants->SetLabelSize(0.05);
3357  fIntFlowQcumulants->SetMarkerStyle(25);
3358  for(Int_t b=0;b<4;b++)
3359  {
3360  (fIntFlowQcumulants->GetXaxis())->SetBinLabel(b+1,cumulantFlag[b].Data());
3361  }
3363  // Final results for reference Q-cumulants rebinned in M:
3365  {
3366  TString intFlowQcumulantsRebinnedInMName = "fIntFlowQcumulantsRebinnedInM";
3367  intFlowQcumulantsRebinnedInMName += fAnalysisLabel->Data();
3368  fIntFlowQcumulantsRebinnedInM = new TH1D(intFlowQcumulantsRebinnedInMName.Data(),"Reference Q-cumulants rebinned in M",4,0,4);
3369  fIntFlowQcumulantsRebinnedInM->SetLabelSize(0.05);
3370  fIntFlowQcumulantsRebinnedInM->SetMarkerStyle(25);
3371  for(Int_t b=0;b<4;b++)
3372  {
3373  (fIntFlowQcumulantsRebinnedInM->GetXaxis())->SetBinLabel(b+1,cumulantFlag[b].Data());
3374  }
3376  } // end of if(fCalculateCumulantsVsM)
3377  // Ratio between error squared: with/without non-isotropic terms:
3378  TString intFlowQcumulantsErrorSquaredRatioName = "fIntFlowQcumulantsErrorSquaredRatio";
3379  intFlowQcumulantsErrorSquaredRatioName += fAnalysisLabel->Data();
3380  fIntFlowQcumulantsErrorSquaredRatio = new TH1D(intFlowQcumulantsErrorSquaredRatioName.Data(),"Error squared of reference Q-cumulants: #frac{with NUA terms}{without NUA terms}",4,0,4);
3381  fIntFlowQcumulantsErrorSquaredRatio->SetLabelSize(0.05);
3382  fIntFlowQcumulantsErrorSquaredRatio->SetMarkerStyle(25);
3383  for(Int_t b=0;b<4;b++)
3384  {
3385  (fIntFlowQcumulantsErrorSquaredRatio->GetXaxis())->SetBinLabel(b+1,cumulantFlag[b].Data());
3386  }
3388  // final results for integrated Q-cumulants versus multiplicity:
3390  {
3391  TString intFlowQcumulantsVsMName = "fIntFlowQcumulantsVsM";
3392  intFlowQcumulantsVsMName += fAnalysisLabel->Data();
3393  for(Int_t co=0;co<4;co++) // cumulant order
3394  {
3395  fIntFlowQcumulantsVsM[co] = new TH1D(Form("%s, %s",intFlowQcumulantsVsMName.Data(),cumulantFlag[co].Data()),
3396  Form("%s vs multiplicity",cumulantFlag[co].Data()),
3399  {
3400  fIntFlowQcumulantsVsM[co]->GetXaxis()->SetTitle("# RPs");
3402  {
3403  fIntFlowQcumulantsVsM[co]->GetXaxis()->SetTitle("Reference multiplicity (from ESD)");
3405  {
3406  fIntFlowQcumulantsVsM[co]->GetXaxis()->SetTitle("# POIs");
3407  }
3408  fIntFlowQcumulantsVsM[co]->GetYaxis()->SetTitle(cumulantFlag[co].Data());
3410  } // end of for(Int_t co=0;co<4;co++) // cumulant order
3411  } // end of if(fCalculateCumulantsVsM)
3412  // final integrated flow estimates from Q-cumulants:
3413  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)};
3414  TString intFlowName = "fIntFlow";
3415  intFlowName += fAnalysisLabel->Data();
3416  // integrated flow from Q-cumulants:
3417  fIntFlow = new TH1D(intFlowName.Data(),"Reference flow estimates from Q-cumulants",4,0,4);
3418  fIntFlow->SetLabelSize(0.05);
3419  fIntFlow->SetMarkerStyle(25);
3420  for(Int_t b=0;b<4;b++)
3421  {
3422  (fIntFlow->GetXaxis())->SetBinLabel(b+1,flowFlag[b].Data());
3423  }
3424  fIntFlowResults->Add(fIntFlow);
3425  // Reference flow vs M rebinned in one huge bin:
3427  {
3428  TString intFlowRebinnedInMName = "fIntFlowRebinnedInM";
3429  intFlowRebinnedInMName += fAnalysisLabel->Data();
3430  fIntFlowRebinnedInM = new TH1D(intFlowRebinnedInMName.Data(),"Reference flow estimates from Q-cumulants (rebinned in M)",4,0,4);
3431  fIntFlowRebinnedInM->SetLabelSize(0.05);
3432  fIntFlowRebinnedInM->SetMarkerStyle(25);
3433  for(Int_t b=0;b<4;b++)
3434  {
3435  (fIntFlowRebinnedInM->GetXaxis())->SetBinLabel(b+1,flowFlag[b].Data());
3436  }
3438  }
3439  // integrated flow from Q-cumulants: versus multiplicity:
3441  {
3442  TString intFlowVsMName = "fIntFlowVsM";
3443  intFlowVsMName += fAnalysisLabel->Data();
3444  for(Int_t co=0;co<4;co++) // cumulant order
3445  {
3446  fIntFlowVsM[co] = new TH1D(Form("%s, %s",intFlowVsMName.Data(),flowFlag[co].Data()),
3447  Form("%s vs multiplicity",flowFlag[co].Data()),
3450  {
3451  fIntFlowVsM[co]->GetXaxis()->SetTitle("# RPs");
3453  {
3454  fIntFlowVsM[co]->GetXaxis()->SetTitle("Reference multiplicity (from ESD)");
3456  {
3457  fIntFlowVsM[co]->GetXaxis()->SetTitle("# POIs");
3458  }
3459  fIntFlowVsM[co]->GetYaxis()->SetTitle(flowFlag[co].Data());
3460  fIntFlowResults->Add(fIntFlowVsM[co]);
3461  } // end of for(Int_t co=0;co<4;co++) // cumulant order
3462  } // end of if(fCalculateCumulantsVsM)
3463  // quantifying detector effects effects to correlations:
3464  TString intFlowDetectorBiasName = "fIntFlowDetectorBias";
3465  intFlowDetectorBiasName += fAnalysisLabel->Data();
3466  fIntFlowDetectorBias = new TH1D(intFlowDetectorBiasName.Data(),"Quantifying detector bias",4,0,4);
3467  fIntFlowDetectorBias->SetLabelSize(0.05);
3468  fIntFlowDetectorBias->SetMarkerStyle(25);
3469  for(Int_t ci=0;ci<4;ci++)
3470  {
3471  (fIntFlowDetectorBias->GetXaxis())->SetBinLabel(ci+1,Form("#frac{corrected}{measured} %s",cumulantFlag[ci].Data()));
3472  }
3474  // quantifying detector effects to correlations versus multiplicity:
3476  {
3477  TString intFlowDetectorBiasVsMName = "fIntFlowDetectorBiasVsM";
3478  intFlowDetectorBiasVsMName += fAnalysisLabel->Data();
3479  for(Int_t ci=0;ci<4;ci++) // correlation index
3480  {
3481  fIntFlowDetectorBiasVsM[ci] = new TH1D(Form("%s for %s",intFlowDetectorBiasVsMName.Data(),cumulantFlag[ci].Data()),
3482  Form("Quantifying detector bias for %s vs multiplicity",cumulantFlag[ci].Data()),
3485  {
3486  fIntFlowDetectorBiasVsM[ci]->GetXaxis()->SetTitle("# RPs");
3488  {
3489  fIntFlowDetectorBiasVsM[ci]->GetXaxis()->SetTitle("Reference multiplicity (from ESD)");
3491  {
3492  fIntFlowDetectorBiasVsM[ci]->GetXaxis()->SetTitle("# POIs");
3493  }
3494  fIntFlowDetectorBiasVsM[ci]->GetYaxis()->SetTitle("#frac{corrected}{measured}");
3496  } // end of for(Int_t co=0;co<4;co++) // cumulant order
3497  } // end of if(fCalculateCumulantsVsM)
3498 
3499 } // end of AliFlowAnalysisCRC::BookEverythingForIntegratedFlow()
3500 
3501 //=======================================================================================================================
3502 
3504 {
3505  // Book all objects for control histograms.
3506 
3507  // a) Book profile to hold all flags for control histograms;
3508  // b) Book all control histograms.
3509 
3510  // a) Book profile to hold all flags for control histograms:
3511  TString controlHistogramsFlagsName = "fControlHistogramsFlags";
3512  controlHistogramsFlagsName += fAnalysisLabel->Data();
3513  fControlHistogramsFlags = new TProfile(controlHistogramsFlagsName.Data(),"Flags for Control Histograms",2,0,2);
3514  fControlHistogramsFlags->SetTickLength(-0.01,"Y");
3515  fControlHistogramsFlags->SetMarkerStyle(25);
3516  fControlHistogramsFlags->SetLabelSize(0.04);
3517  fControlHistogramsFlags->SetLabelOffset(0.02,"Y");
3518  fControlHistogramsFlags->SetStats(kFALSE);
3519  fControlHistogramsFlags->GetXaxis()->SetBinLabel(1,"fStoreControlHistograms");
3520  fControlHistogramsFlags->GetXaxis()->SetBinLabel(2,"fUseQvectorTerms");
3522 
3523  if(!fStoreControlHistograms){return;}
3524 
3525  // b) Book all control histograms:
3526  // b1) Correlation between # RPs and ref. mult. determined centrally:
3527  TString sCorrelationNoRPsVsRefMultName = "fCorrelationNoRPsVsRefMult";
3528  sCorrelationNoRPsVsRefMultName += fAnalysisLabel->Data();
3529  fCorrelationNoRPsVsRefMult = new TH2D(sCorrelationNoRPsVsRefMultName.Data(),"# RPs vs. Reference Multiplicity",fnBinsMult,fMinMult,fMaxMult,fnBinsMult,fMinMult,fMaxMult);
3530  fCorrelationNoRPsVsRefMult->SetTickLength(-0.01,"Y");
3531  fCorrelationNoRPsVsRefMult->SetLabelSize(0.04);
3532  fCorrelationNoRPsVsRefMult->SetLabelOffset(0.02,"Y");
3533  fCorrelationNoRPsVsRefMult->SetStats(kTRUE);
3534  fCorrelationNoRPsVsRefMult->GetXaxis()->SetTitle("# RPs");
3535  fCorrelationNoRPsVsRefMult->GetYaxis()->SetTitle("Reference Multiplicity");
3537  // b2) Correlation between # POIs and ref. mult. determined centrally:
3538  TString sCorrelationNoPOIsVsRefMultName = "fCorrelationNoPOIsVsRefMult";
3539  sCorrelationNoPOIsVsRefMultName += fAnalysisLabel->Data();
3540  fCorrelationNoPOIsVsRefMult = new TH2D(sCorrelationNoPOIsVsRefMultName.Data(),"# POIs vs. Reference Multiplicity",fnBinsMult,fMinMult,fMaxMult,fnBinsMult,fMinMult,fMaxMult);
3541  fCorrelationNoPOIsVsRefMult->SetTickLength(-0.01,"Y");
3542  fCorrelationNoPOIsVsRefMult->SetLabelSize(0.04);
3543  fCorrelationNoPOIsVsRefMult->SetLabelOffset(0.02,"Y");
3544  fCorrelationNoPOIsVsRefMult->SetStats(kTRUE);
3545  fCorrelationNoPOIsVsRefMult->GetXaxis()->SetTitle("# POIs");
3546  fCorrelationNoPOIsVsRefMult->GetYaxis()->SetTitle("Reference Multiplicity");
3548  // b3) Correlation between # RPs and # POIs:
3549  TString sCorrelationNoRPsVsNoPOIsName = "fCorrelationNoRPsVsNoPOIs";
3550  sCorrelationNoRPsVsNoPOIsName += fAnalysisLabel->Data();
3551  fCorrelationNoRPsVsNoPOIs = new TH2D(sCorrelationNoRPsVsNoPOIsName.Data(),"# RPs vs. # POIs",fnBinsMult,fMinMult,fMaxMult,fnBinsMult,fMinMult,fMaxMult);
3552  fCorrelationNoRPsVsNoPOIs->SetTickLength(-0.01,"Y");
3553  fCorrelationNoRPsVsNoPOIs->SetLabelSize(0.04);
3554  fCorrelationNoRPsVsNoPOIs->SetLabelOffset(0.02,"Y");
3555  fCorrelationNoRPsVsNoPOIs->SetStats(kTRUE);
3556  fCorrelationNoRPsVsNoPOIs->GetXaxis()->SetTitle("# RPs");
3557  fCorrelationNoRPsVsNoPOIs->GetYaxis()->SetTitle("# POIs");
3559  // b4) <2>, <4>, <6> and <8> vs multiplicity (#RPs, #POIs or external):
3560  TString sCorrelation[4] = {"#LT2#GT","#LT4#GT","#LT6#GT","#LT8#GT"};
3561  TString sMultiplicity = "";
3563  {
3564  sMultiplicity = "# RPs";
3566  {
3567  sMultiplicity = "Reference multiplicity (from ESD)";
3569  {
3570  sMultiplicity = "# POIs";
3571  }
3572  for(Int_t ci=0;ci<4;ci++)
3573  {
3574  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]);
3575  fCorrelation2468VsMult[ci]->SetTickLength(-0.01,"Y");
3576  fCorrelation2468VsMult[ci]->SetLabelSize(0.04);
3577  fCorrelation2468VsMult[ci]->SetLabelOffset(0.02,"Y");
3578  fCorrelation2468VsMult[ci]->SetStats(kTRUE);
3579  fCorrelation2468VsMult[ci]->GetXaxis()->SetTitle(sMultiplicity.Data());
3580  fCorrelation2468VsMult[ci]->GetYaxis()->SetTitle(sCorrelation[ci].Data());
3582  } // end of for(Int_t ci=0;ci<4;ci++)
3583  // b5) <2><4>, <2><6>, <2><8>, <4><6> etc. vs multiplicity (#RPs, #POIs or external):
3584  TString sCorrelationProduct[1] = {"#LT2#GT#LT4#GT"}; // TBI: add the other ones when needed first time
3585  for(Int_t cpi=0;cpi<1;cpi++) // TBI: hardwired 1
3586  {
3587  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]);
3588  fCorrelationProduct2468VsMult[cpi]->SetTickLength(-0.01,"Y");
3589  fCorrelationProduct2468VsMult[cpi]->SetLabelSize(0.04);
3590  fCorrelationProduct2468VsMult[cpi]->SetLabelOffset(0.02,"Y");
3591  fCorrelationProduct2468VsMult[cpi]->SetStats(kTRUE);
3592  fCorrelationProduct2468VsMult[cpi]->GetXaxis()->SetTitle(sMultiplicity.Data());
3593  fCorrelationProduct2468VsMult[cpi]->GetYaxis()->SetTitle(sCorrelationProduct[cpi].Data());
3595  } // end of for(Int_t cpi=0;cpi<4;cpi++)
3596  // b6) |Qn|^2/M, |Q2n|^2/M, |Qn|^4/(M(2M-1)), Re[Q2nQn^*Qn^*]/M, ... vs multiplicity (#RPs, #POIs or external)
3597  if(fUseQvectorTerms)
3598  {
3599  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
3600  for(Int_t qvti=0;qvti<4;qvti++) // TBI: hardwired 4
3601  {
3602  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]);
3603  fQvectorTermsVsMult[qvti]->SetTickLength(-0.01,"Y");
3604  fQvectorTermsVsMult[qvti]->SetLabelSize(0.04);
3605  fQvectorTermsVsMult[qvti]->SetLabelOffset(0.02,"Y");
3606  fQvectorTermsVsMult[qvti]->SetStats(kTRUE);
3607  fQvectorTermsVsMult[qvti]->GetXaxis()->SetTitle(sMultiplicity.Data());
3608  fQvectorTermsVsMult[qvti]->GetYaxis()->SetTitle(sQvectorTerms[qvti].Data());
3610  } // end of for(Int_t qvti=0;qvti<4;qvti++)
3611  } // end of if(fUseQvectorTerms)
3612 
3613 } // end of void AliFlowAnalysisCRC::BookEverythingForControlHistograms()
3614 
3615 //=======================================================================================================================
3616 
3618 {
3619  // Book all objects needed for bootstrap.
3620 
3621  // a) Book profile to hold all flags for bootstrap;
3622  // b) Book local random generator;
3623  // c) Book all bootstrap objects;
3624  // d) Book all bootstrap objects 'vs M'.
3625 
3626  // a) Book profile to hold all flags for bootstrap;
3627  TString bootstrapFlagsName = "fBootstrapFlags";
3628  bootstrapFlagsName += fAnalysisLabel->Data();
3629  fBootstrapFlags = new TProfile(bootstrapFlagsName.Data(),"Flags for bootstrap",3,0,3);
3630  fBootstrapFlags->SetTickLength(-0.01,"Y");
3631  fBootstrapFlags->SetMarkerStyle(25);
3632  fBootstrapFlags->SetLabelSize(0.04);
3633  fBootstrapFlags->SetLabelOffset(0.02,"Y");
3634  fBootstrapFlags->SetStats(kFALSE);
3635  fBootstrapFlags->GetXaxis()->SetBinLabel(1,"fUseBootstrap");
3636  fBootstrapFlags->GetXaxis()->SetBinLabel(2,"fUseBootstrapVsM");
3637  fBootstrapFlags->GetXaxis()->SetBinLabel(3,"fnSubsamples");
3639 
3640  // c) Book all bootstrap objects:
3641  TString correlationFlag[4] = {"#LT#LT2#GT#GT","#LT#LT4#GT#GT","#LT#LT6#GT#GT","#LT#LT8#GT#GT"};
3642  TString cumulantFlag[4] = {"QC{2}","QC{4}","QC{6}","QC{8}"};
3643  if(fUseBootstrap)
3644  {
3645  // ....
3646  TString bootstrapCorrelationsName = "fBootstrapCorrelations";
3647  bootstrapCorrelationsName += fAnalysisLabel->Data();
3648  fBootstrapCorrelations = new TProfile2D(bootstrapCorrelationsName.Data(),"Bootstrap Correlations",4,0.,4.,fnSubsamples,0,fnSubsamples); // x-axis => <2>, <4>, <6>, <8>; y-axis => subsample #
3649  fBootstrapCorrelations->SetStats(kFALSE);
3650  for(Int_t ci=0;ci<4;ci++) // correlation index
3651  {
3652  fBootstrapCorrelations->GetXaxis()->SetBinLabel(ci+1,correlationFlag[ci].Data());
3653  } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
3654  for(Int_t ss=0;ss<fnSubsamples;ss++)
3655  {
3656  fBootstrapCorrelations->GetYaxis()->SetBinLabel(ss+1,Form("#%d",ss));
3657  } // end of for(Int_t ss=0;ss<fnSubsamples;ss++)
3659  // ....
3660  TString bootstrapCumulantsName = "fBootstrapCumulants";
3661  bootstrapCumulantsName += fAnalysisLabel->Data();
3662  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 #
3663  fBootstrapCumulants->SetStats(kFALSE);
3664  for(Int_t co=0;co<4;co++) // cumulant order
3665  {
3666  fBootstrapCumulants->GetXaxis()->SetBinLabel(co+1,cumulantFlag[co].Data());
3667  } // end of for(Int_t co=0;co<4;co++) // cumulant order
3668  for(Int_t ss=0;ss<fnSubsamples;ss++)
3669  {
3670  fBootstrapCumulants->GetYaxis()->SetBinLabel(ss+1,Form("#%d",ss));
3671  } // end of for(Int_t ss=0;ss<fnSubsamples;ss++)
3673  } // end of if(fUseBootstrap)
3674 
3675  // d) Book all bootstrap objects 'vs M':
3676  TString sMultiplicity = "";
3678  {
3679  sMultiplicity = "# RPs";
3681  {
3682  sMultiplicity = "Reference multiplicity (from ESD)";
3684  {
3685  sMultiplicity = "# POIs";
3686  }
3687  if(fUseBootstrapVsM)
3688  {
3689  // ....
3690  TString bootstrapCorrelationsVsMName = "fBootstrapCorrelationsVsM";
3691  bootstrapCorrelationsVsMName += fAnalysisLabel->Data();
3692  for(Int_t ci=0;ci<4;ci++) // correlation index
3693  {
3694  fBootstrapCorrelationsVsM[ci] = new TProfile2D(Form("%s, %s",bootstrapCorrelationsVsMName.Data(),correlationFlag[ci].Data()),
3695  Form("Bootstrap Correlations Vs. M, %s",correlationFlag[ci].Data()),
3696  fnBinsMult,fMinMult,fMaxMult,fnSubsamples,0,fnSubsamples); // index => <2>, <4>, <6>, <8>; x-axis => multiplicity; y-axis => subsample #
3697  fBootstrapCorrelationsVsM[ci]->SetStats(kFALSE);
3698  fBootstrapCorrelationsVsM[ci]->GetXaxis()->SetTitle(sMultiplicity.Data());
3699  for(Int_t ss=0;ss<fnSubsamples;ss++)
3700  {
3701  fBootstrapCorrelationsVsM[ci]->GetYaxis()->SetBinLabel(ss+1,Form("#%d",ss));
3702  } // end of for(Int_t ss=0;ss<fnSubsamples;ss++)
3704  } // end of for(Int_t ci=0;ci<4;ci++) // correlation index
3705  // ....
3706  TString bootstrapCumulantsVsMName = "fBootstrapCumulantsVsM";
3707  bootstrapCumulantsVsMName += fAnalysisLabel->Data();
3708  for(Int_t co=0;co<4;co++) // cumulant order
3709  {
3710  fBootstrapCumulantsVsM[co] = new TH2D(Form("%s, %s",bootstrapCumulantsVsMName.Data(),cumulantFlag[co].Data()),
3711  Form("Bootstrap Cumulants Vs. M, %s",cumulantFlag[co].Data()),
3712  fnBinsMult,fMinMult,fMaxMult,fnSubsamples,0,fnSubsamples); // index => <2>, <4>, <6>, <8>; x-axis => multiplicity; y-axis => subsample #
3713  fBootstrapCumulantsVsM[co]->SetStats(kFALSE);
3714  fBootstrapCumulantsVsM[co]->GetXaxis()->SetTitle(sMultiplicity.Data());
3715  for(Int_t ss=0;ss<fnSubsamples;ss++)
3716  {
3717  fBootstrapCumulantsVsM[co]->GetYaxis()->SetBinLabel(ss+1,Form("#%d",ss));
3718  } // end of for(Int_t ss=0;ss<fnSubsamples;ss++)
3720  } // end of for(Int_t co=0;co<4;co++) // correlation index
3721  } // end of if(fUseBootstrapVsM)
3722 
3723 } // end of void AliFlowAnalysisCRC::BookEverythingForBootstrap()
3724 
3725 //=======================================================================================================================
3726 
3728 {
3729  // Book all objects for mixed harmonics.
3730 
3731  // a) Book profile to hold all flags for mixed harmonics;
3732  // b) Book all objects in TList fMixedHarmonicsProfiles;
3733  // c) Book all objects in TList fMixedHarmonicsResults;
3734  // d) Book all objects in TList fMixedHarmonicsErrorPropagation.
3735 
3736  // a) Book profile to hold all flags for mixed harmonics:
3737  TString mixedHarmonicsFlagsName = "fMixedHarmonicsFlags";
3738  mixedHarmonicsFlagsName += fAnalysisLabel->Data();
3739  fMixedHarmonicsFlags = new TProfile(mixedHarmonicsFlagsName.Data(),"Flags for Mixed Harmonics",4,0,4);
3740  fMixedHarmonicsFlags->SetTickLength(-0.01,"Y");
3741  fMixedHarmonicsFlags->SetMarkerStyle(25);
3742  fMixedHarmonicsFlags->SetLabelSize(0.04);
3743  fMixedHarmonicsFlags->SetLabelOffset(0.02,"Y");
3744  fMixedHarmonicsFlags->SetStats(kFALSE);
3745  fMixedHarmonicsFlags->GetXaxis()->SetBinLabel(1,"Calculate Mixed Harmonics");
3746  fMixedHarmonicsFlags->GetXaxis()->SetBinLabel(2,"Generic Harmonic");
3747  fMixedHarmonicsFlags->GetXaxis()->SetBinLabel(3,"Calculate vs Multiplicity");
3748  fMixedHarmonicsFlags->GetXaxis()->SetBinLabel(4,"Multiplicity Weight");
3750 
3751  if(!fCalculateMixedHarmonics){return;}
3752 
3753  // b) Book all objects in TList fMixedHarmonicsProfiles:
3754  // b1) 2-p correlations:
3755  TString s2pCorrelationsName = "f2pCorrelations";
3756  s2pCorrelationsName += fAnalysisLabel->Data();
3757  f2pCorrelations = new TProfile(s2pCorrelationsName.Data(),Form("2-particle correlations (n = %d)",fHarmonic),6,0,6,"s");
3758  f2pCorrelations->SetTickLength(-0.01,"Y");
3759  f2pCorrelations->SetMarkerStyle(25);
3760  f2pCorrelations->SetLabelSize(0.04);
3761  f2pCorrelations->SetLabelOffset(0.02,"Y");
3762  f2pCorrelations->SetStats(kFALSE);
3763  f2pCorrelations->Sumw2();
3764  f2pCorrelations->GetXaxis()->SetBinLabel(1,Form("#LT#LT2#GT#GT_{%dn|%dn}",1*fHarmonic,1*fHarmonic));
3765  f2pCorrelations->GetXaxis()->SetBinLabel(2,Form("#LT#LT2#GT#GT_{%dn|%dn}",2*fHarmonic,2*fHarmonic));
3766  f2pCorrelations->GetXaxis()->SetBinLabel(3,Form("#LT#LT2#GT#GT_{%dn|%dn}",3*fHarmonic,3*fHarmonic));
3767  f2pCorrelations->GetXaxis()->SetBinLabel(4,Form("#LT#LT2#GT#GT_{%dn|%dn}",4*fHarmonic,4*fHarmonic));
3768  f2pCorrelations->GetXaxis()->SetBinLabel(5,Form("#LT#LT2#GT#GT_{%dn|%dn}",5*fHarmonic,5*fHarmonic));
3769  f2pCorrelations->GetXaxis()->SetBinLabel(6,Form("#LT#LT2#GT#GT_{%dn|%dn}",6*fHarmonic,6*fHarmonic));
3771  // b2) 3-p correlations (3+6):
3772  TString s3pCorrelationsName = "f3pCorrelations";
3773  s3pCorrelationsName += fAnalysisLabel->Data();
3774  f3pCorrelations = new TProfile(s3pCorrelationsName.Data(),Form("3-particle correlations (n = %d)",fHarmonic),10,0,10,"s");
3775  f3pCorrelations->SetTickLength(-0.01,"Y");
3776  f3pCorrelations->SetMarkerStyle(25);
3777  f3pCorrelations->SetLabelSize(0.04);
3778  f3pCorrelations->SetLabelOffset(0.02,"Y");
3779  f3pCorrelations->SetStats(kFALSE);
3780  f3pCorrelations->Sumw2();
3781  // 3-p correlations sensitive to two distinct harmonics (3):
3782  f3pCorrelations->GetXaxis()->SetBinLabel(1,Form("#LT#LT3#GT#GT_{%dn|%dn,%dn}",2*fHarmonic,1*fHarmonic,1*fHarmonic));
3783  f3pCorrelations->GetXaxis()->SetBinLabel(2,Form("#LT#LT3#GT#GT_{%dn|%dn,%dn}",4*fHarmonic,2*fHarmonic,2*fHarmonic));
3784  f3pCorrelations->GetXaxis()->SetBinLabel(3,Form("#LT#LT3#GT#GT_{%dn|%dn,%dn}",6*fHarmonic,3*fHarmonic,3*fHarmonic));
3785  f3pCorrelations->GetXaxis()->SetBinLabel(4,""); // empty
3786  // 3-p correlations sensitive to three distinct harmonics (6):
3787  f3pCorrelations->GetXaxis()->SetBinLabel(5,Form("#LT#LT3#GT#GT_{%dn|%dn,%dn}",3*fHarmonic,2*fHarmonic,1*fHarmonic));
3788  f3pCorrelations->GetXaxis()->SetBinLabel(6,Form("#LT#LT3#GT#GT_{%dn|%dn,%dn}",4*fHarmonic,3*fHarmonic,1*fHarmonic));
3789  f3pCorrelations->GetXaxis()->SetBinLabel(7,Form("#LT#LT3#GT#GT_{%dn|%dn,%dn}",5*fHarmonic,3*fHarmonic,2*fHarmonic));
3790  f3pCorrelations->GetXaxis()->SetBinLabel(8,Form("#LT#LT3#GT#GT_{%dn|%dn,%dn}",5*fHarmonic,4*fHarmonic,1*fHarmonic));
3791  f3pCorrelations->GetXaxis()->SetBinLabel(9,Form("#LT#LT3#GT#GT_{%dn|%dn,%dn}",6*fHarmonic,4*fHarmonic,2*fHarmonic));
3792  f3pCorrelations->GetXaxis()->SetBinLabel(10,Form("#LT#LT3#GT#GT_{%dn|%dn,%dn}",6*fHarmonic,5*fHarmonic,1*fHarmonic));
3794  // b3) 4-p correlations (6+15+2+10+8):
3795  TString s4pCorrelationsName = "f4pCorrelations";
3796  s4pCorrelationsName += fAnalysisLabel->Data();
3797  f4pCorrelations = new TProfile(s4pCorrelationsName.Data(),Form("4-particle correlations (n = %d)",fHarmonic),45,0,45,"s");
3798  f4pCorrelations->SetTickLength(-0.01,"Y");
3799  f4pCorrelations->SetMarkerStyle(25);
3800  f4pCorrelations->SetLabelSize(0.03);
3801  f4pCorrelations->SetLabelOffset(0.02,"Y");
3802  f4pCorrelations->SetStats(kFALSE);
3803  f4pCorrelations->Sumw2();
3804  // "same harmonic" (6):
3805  f4pCorrelations->GetXaxis()->SetBinLabel(1,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",1*fHarmonic,1*fHarmonic,1*fHarmonic,1*fHarmonic));
3806  f4pCorrelations->GetXaxis()->SetBinLabel(2,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",2*fHarmonic,2*fHarmonic,2*fHarmonic,2*fHarmonic));
3807  f4pCorrelations->GetXaxis()->SetBinLabel(3,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",3*fHarmonic,3*fHarmonic,3*fHarmonic,3*fHarmonic));
3808  f4pCorrelations->GetXaxis()->SetBinLabel(4,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",4*fHarmonic,4*fHarmonic,4*fHarmonic,4*fHarmonic));
3809  f4pCorrelations->GetXaxis()->SetBinLabel(5,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",5*fHarmonic,5*fHarmonic,5*fHarmonic,5*fHarmonic));
3810  f4pCorrelations->GetXaxis()->SetBinLabel(6,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",6*fHarmonic,6*fHarmonic,6*fHarmonic,6*fHarmonic));
3811  f4pCorrelations->GetXaxis()->SetBinLabel(7,""); // empty
3812  // "standard candles" (15):
3813  f4pCorrelations->GetXaxis()->SetBinLabel(8,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",2*fHarmonic,1*fHarmonic,2*fHarmonic,1*fHarmonic));
3814  f4pCorrelations->GetXaxis()->SetBinLabel(9,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",3*fHarmonic,1*fHarmonic,3*fHarmonic,1*fHarmonic));
3815  f4pCorrelations->GetXaxis()->SetBinLabel(10,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",3*fHarmonic,2*fHarmonic,3*fHarmonic,2*fHarmonic));
3816  f4pCorrelations->GetXaxis()->SetBinLabel(11,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",4*fHarmonic,1*fHarmonic,4*fHarmonic,1*fHarmonic));
3817  f4pCorrelations->GetXaxis()->SetBinLabel(12,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",4*fHarmonic,2*fHarmonic,4*fHarmonic,2*fHarmonic));
3818  f4pCorrelations->GetXaxis()->SetBinLabel(13,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",4*fHarmonic,3*fHarmonic,4*fHarmonic,3*fHarmonic));
3819  f4pCorrelations->GetXaxis()->SetBinLabel(14,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",5*fHarmonic,1*fHarmonic,5*fHarmonic,1*fHarmonic));
3820  f4pCorrelations->GetXaxis()->SetBinLabel(15,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",5*fHarmonic,2*fHarmonic,5*fHarmonic,2*fHarmonic));
3821  f4pCorrelations->GetXaxis()->SetBinLabel(16,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",5*fHarmonic,3*fHarmonic,5*fHarmonic,3*fHarmonic));
3822  f4pCorrelations->GetXaxis()->SetBinLabel(17,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",5*fHarmonic,4*fHarmonic,5*fHarmonic,4*fHarmonic));
3823  f4pCorrelations->GetXaxis()->SetBinLabel(18,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",6*fHarmonic,1*fHarmonic,6*fHarmonic,1*fHarmonic));
3824  f4pCorrelations->GetXaxis()->SetBinLabel(19,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",6*fHarmonic,2*fHarmonic,6*fHarmonic,2*fHarmonic));
3825  f4pCorrelations->GetXaxis()->SetBinLabel(20,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",6*fHarmonic,3*fHarmonic,6*fHarmonic,3*fHarmonic));
3826  f4pCorrelations->GetXaxis()->SetBinLabel(21,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",6*fHarmonic,4*fHarmonic,6*fHarmonic,4*fHarmonic));
3827  f4pCorrelations->GetXaxis()->SetBinLabel(22,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",6*fHarmonic,5*fHarmonic,6*fHarmonic,5*fHarmonic));
3828  f4pCorrelations->GetXaxis()->SetBinLabel(23,""); // empty
3829  // 4-p correlations sensitive to two distinct harmonics (2):
3830  f4pCorrelations->GetXaxis()->SetBinLabel(24,Form("#LT#LT4#GT#GT_{%dn|%dn,%dn,%dn}",3*fHarmonic,1*fHarmonic,1*fHarmonic,1*fHarmonic));
3831  f4pCorrelations->GetXaxis()->SetBinLabel(25,Form("#LT#LT4#GT#GT_{%dn|%dn,%dn,%dn}",6*fHarmonic,2*fHarmonic,2*fHarmonic,2*fHarmonic));
3832  f4pCorrelations->GetXaxis()->SetBinLabel(26,""); // empty
3833  // 4-p correlations sensitive to three distinct harmonics (10):
3834  f4pCorrelations->GetXaxis()->SetBinLabel(27,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",3*fHarmonic,1*fHarmonic,2*fHarmonic,2*fHarmonic));
3835  f4pCorrelations->GetXaxis()->SetBinLabel(28,Form("#LT#LT4#GT#GT_{%dn|%dn,%dn,%dn}",4*fHarmonic,2*fHarmonic,1*fHarmonic,1*fHarmonic));
3836  f4pCorrelations->GetXaxis()->SetBinLabel(29,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",4*fHarmonic,2*fHarmonic,3*fHarmonic,3*fHarmonic));
3837  f4pCorrelations->GetXaxis()->SetBinLabel(30,Form("#LT#LT4#GT#GT_{%dn|%dn,%dn,%dn}",5*fHarmonic,2*fHarmonic,2*fHarmonic,1*fHarmonic));
3838  f4pCorrelations->GetXaxis()->SetBinLabel(31,Form("#LT#LT4#GT#GT_{%dn|%dn,%dn,%dn}",5*fHarmonic,3*fHarmonic,1*fHarmonic,1*fHarmonic));
3839  f4pCorrelations->GetXaxis()->SetBinLabel(32,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",5*fHarmonic,1*fHarmonic,3*fHarmonic,3*fHarmonic));
3840  f4pCorrelations->GetXaxis()->SetBinLabel(33,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",5*fHarmonic,3*fHarmonic,4*fHarmonic,4*fHarmonic));
3841  f4pCorrelations->GetXaxis()->SetBinLabel(34,Form("#LT#LT4#GT#GT_{%dn|%dn,%dn,%dn}",6*fHarmonic,4*fHarmonic,1*fHarmonic,1*fHarmonic));
3842  f4pCorrelations->GetXaxis()->SetBinLabel(35,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",6*fHarmonic,2*fHarmonic,4*fHarmonic,4*fHarmonic));
3843  f4pCorrelations->GetXaxis()->SetBinLabel(36,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",6*fHarmonic,4*fHarmonic,5*fHarmonic,5*fHarmonic));
3844  f4pCorrelations->GetXaxis()->SetBinLabel(37,""); // empty
3845  // 4-p correlations sensitive to four distinct harmonics (8):
3846  f4pCorrelations->GetXaxis()->SetBinLabel(38,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",4*fHarmonic,1*fHarmonic,3*fHarmonic,2*fHarmonic));
3847  f4pCorrelations->GetXaxis()->SetBinLabel(39,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",5*fHarmonic,1*fHarmonic,4*fHarmonic,2*fHarmonic));
3848  f4pCorrelations->GetXaxis()->SetBinLabel(40,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",5*fHarmonic,2*fHarmonic,4*fHarmonic,3*fHarmonic));
3849  f4pCorrelations->GetXaxis()->SetBinLabel(41,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",6*fHarmonic,1*fHarmonic,4*fHarmonic,3*fHarmonic));
3850  f4pCorrelations->GetXaxis()->SetBinLabel(42,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",6*fHarmonic,1*fHarmonic,5*fHarmonic,2*fHarmonic));
3851  f4pCorrelations->GetXaxis()->SetBinLabel(43,Form("#LT#LT4#GT#GT_{%dn|%dn,%dn,%dn}",6*fHarmonic,3*fHarmonic,2*fHarmonic,1*fHarmonic));
3852  f4pCorrelations->GetXaxis()->SetBinLabel(44,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",6*fHarmonic,2*fHarmonic,5*fHarmonic,3*fHarmonic));
3853  f4pCorrelations->GetXaxis()->SetBinLabel(45,Form("#LT#LT4#GT#GT_{%dn,%dn|%dn,%dn}",6*fHarmonic,3*fHarmonic,5*fHarmonic,4*fHarmonic));
3855  // b3) 5-p correlations (30+9+30+11+3):
3856  TString s5pCorrelationsName = "f5pCorrelations";
3857  s5pCorrelationsName += fAnalysisLabel->Data();
3858  f5pCorrelations = new TProfile(s5pCorrelationsName.Data(),Form("5-particle correlations (n = %d)",fHarmonic),87,0,87,"s");
3859  f5pCorrelations->SetTickLength(-0.01,"Y");
3860  f5pCorrelations->SetMarkerStyle(25);
3861  f5pCorrelations->SetLabelSize(0.02);
3862  f5pCorrelations->SetLabelOffset(0.02,"Y");
3863  f5pCorrelations->SetStats(kFALSE);
3864  f5pCorrelations->Sumw2();
3865  // "standard candles" (30):
3866  f5pCorrelations->GetXaxis()->SetBinLabel(1,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",3*fHarmonic,2*fHarmonic,3*fHarmonic,1*fHarmonic,1*fHarmonic));
3867  f5pCorrelations->GetXaxis()->SetBinLabel(2,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",4*fHarmonic,1*fHarmonic,2*fHarmonic,2*fHarmonic,1*fHarmonic));
3868  f5pCorrelations->GetXaxis()->SetBinLabel(3,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",4*fHarmonic,2*fHarmonic,3*fHarmonic,2*fHarmonic,1*fHarmonic));
3869  f5pCorrelations->GetXaxis()->SetBinLabel(4,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",4*fHarmonic,3*fHarmonic,3*fHarmonic,2*fHarmonic,2*fHarmonic));
3870  f5pCorrelations->GetXaxis()->SetBinLabel(5,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",4*fHarmonic,2*fHarmonic,4*fHarmonic,1*fHarmonic,1*fHarmonic));
3871  f5pCorrelations->GetXaxis()->SetBinLabel(6,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",4*fHarmonic,3*fHarmonic,4*fHarmonic,2*fHarmonic,1*fHarmonic));
3872  f5pCorrelations->GetXaxis()->SetBinLabel(7,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",5*fHarmonic,1*fHarmonic,3*fHarmonic,2*fHarmonic,1*fHarmonic));
3873  f5pCorrelations->GetXaxis()->SetBinLabel(8,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",5*fHarmonic,2*fHarmonic,5*fHarmonic,1*fHarmonic,1*fHarmonic));
3874  f5pCorrelations->GetXaxis()->SetBinLabel(9,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",5*fHarmonic,2*fHarmonic,4*fHarmonic,2*fHarmonic,1*fHarmonic));
3875  f5pCorrelations->GetXaxis()->SetBinLabel(10,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",5*fHarmonic,3*fHarmonic,4*fHarmonic,3*fHarmonic,1*fHarmonic));
3876  f5pCorrelations->GetXaxis()->SetBinLabel(11,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",5*fHarmonic,4*fHarmonic,4*fHarmonic,3*fHarmonic,2*fHarmonic));
3877  f5pCorrelations->GetXaxis()->SetBinLabel(12,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",5*fHarmonic,3*fHarmonic,5*fHarmonic,2*fHarmonic,1*fHarmonic));
3878  f5pCorrelations->GetXaxis()->SetBinLabel(13,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",5*fHarmonic,4*fHarmonic,5*fHarmonic,2*fHarmonic,2*fHarmonic));
3879  f5pCorrelations->GetXaxis()->SetBinLabel(14,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",5*fHarmonic,4*fHarmonic,5*fHarmonic,3*fHarmonic,1*fHarmonic));
3880  f5pCorrelations->GetXaxis()->SetBinLabel(15,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,1*fHarmonic,3*fHarmonic,3*fHarmonic,1*fHarmonic));
3881  f5pCorrelations->GetXaxis()->SetBinLabel(16,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,2*fHarmonic,3*fHarmonic,3*fHarmonic,2*fHarmonic));
3882  f5pCorrelations->GetXaxis()->SetBinLabel(17,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,1*fHarmonic,4*fHarmonic,2*fHarmonic,1*fHarmonic));
3883  f5pCorrelations->GetXaxis()->SetBinLabel(18,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,3*fHarmonic,4*fHarmonic,3*fHarmonic,2*fHarmonic));
3884  f5pCorrelations->GetXaxis()->SetBinLabel(19,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,4*fHarmonic,4*fHarmonic,3*fHarmonic,3*fHarmonic));
3885  f5pCorrelations->GetXaxis()->SetBinLabel(20,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,2*fHarmonic,5*fHarmonic,2*fHarmonic,1*fHarmonic));
3886  f5pCorrelations->GetXaxis()->SetBinLabel(21,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,3*fHarmonic,5*fHarmonic,3*fHarmonic,1*fHarmonic));
3887  f5pCorrelations->GetXaxis()->SetBinLabel(22,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,4*fHarmonic,5*fHarmonic,4*fHarmonic,1*fHarmonic));
3888  f5pCorrelations->GetXaxis()->SetBinLabel(23,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,5*fHarmonic,5*fHarmonic,3*fHarmonic,3*fHarmonic));
3889  f5pCorrelations->GetXaxis()->SetBinLabel(24,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,2*fHarmonic,6*fHarmonic,1*fHarmonic,1*fHarmonic));
3890  f5pCorrelations->GetXaxis()->SetBinLabel(25,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,3*fHarmonic,6*fHarmonic,2*fHarmonic,1*fHarmonic));
3891  f5pCorrelations->GetXaxis()->SetBinLabel(26,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,4*fHarmonic,6*fHarmonic,2*fHarmonic,2*fHarmonic));
3892  f5pCorrelations->GetXaxis()->SetBinLabel(27,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,4*fHarmonic,6*fHarmonic,3*fHarmonic,1*fHarmonic));
3893  f5pCorrelations->GetXaxis()->SetBinLabel(28,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,5*fHarmonic,5*fHarmonic,4*fHarmonic,2*fHarmonic));
3894  f5pCorrelations->GetXaxis()->SetBinLabel(29,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,5*fHarmonic,6*fHarmonic,3*fHarmonic,2*fHarmonic));
3895  f5pCorrelations->GetXaxis()->SetBinLabel(30,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,5*fHarmonic,6*fHarmonic,4*fHarmonic,1*fHarmonic));
3896  f5pCorrelations->GetXaxis()->SetBinLabel(31,""); // empty
3897  // 5-p correlations sensitive to two distinct harmonics (9):
3898  f5pCorrelations->GetXaxis()->SetBinLabel(32,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",2*fHarmonic,1*fHarmonic,1*fHarmonic,1*fHarmonic,1*fHarmonic));
3899  f5pCorrelations->GetXaxis()->SetBinLabel(33,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",2*fHarmonic,2*fHarmonic,2*fHarmonic,1*fHarmonic,1*fHarmonic));
3900  f5pCorrelations->GetXaxis()->SetBinLabel(34,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",3*fHarmonic,3*fHarmonic,2*fHarmonic,2*fHarmonic,2*fHarmonic));
3901  f5pCorrelations->GetXaxis()->SetBinLabel(35,Form("#LT#LT5#GT#GT_{%dn|%dn,%dn,%dn,%dn}",4*fHarmonic,1*fHarmonic,1*fHarmonic,1*fHarmonic,1*fHarmonic));
3902  f5pCorrelations->GetXaxis()->SetBinLabel(36,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",4*fHarmonic,2*fHarmonic,2*fHarmonic,2*fHarmonic,2*fHarmonic));
3903  f5pCorrelations->GetXaxis()->SetBinLabel(37,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",4*fHarmonic,4*fHarmonic,4*fHarmonic,2*fHarmonic,2*fHarmonic));
3904  f5pCorrelations->GetXaxis()->SetBinLabel(38,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,3*fHarmonic,3*fHarmonic,3*fHarmonic,3*fHarmonic));
3905  f5pCorrelations->GetXaxis()->SetBinLabel(39,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,6*fHarmonic,4*fHarmonic,4*fHarmonic,4*fHarmonic));
3906  f5pCorrelations->GetXaxis()->SetBinLabel(40,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,6*fHarmonic,6*fHarmonic,3*fHarmonic,3*fHarmonic));
3907  f5pCorrelations->GetXaxis()->SetBinLabel(41,""); // empty
3908  // 5-p correlations sensitive to three distinct harmonics (30):
3909  f5pCorrelations->GetXaxis()->SetBinLabel(42,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",3*fHarmonic,1*fHarmonic,2*fHarmonic,1*fHarmonic,1*fHarmonic));
3910  f5pCorrelations->GetXaxis()->SetBinLabel(43,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",3*fHarmonic,2*fHarmonic,2*fHarmonic,2*fHarmonic,1*fHarmonic));
3911  f5pCorrelations->GetXaxis()->SetBinLabel(44,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",3*fHarmonic,3*fHarmonic,3*fHarmonic,2*fHarmonic,1*fHarmonic));
3912  f5pCorrelations->GetXaxis()->SetBinLabel(45,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",4*fHarmonic,1*fHarmonic,3*fHarmonic,1*fHarmonic,1*fHarmonic));
3913  f5pCorrelations->GetXaxis()->SetBinLabel(46,Form("#LT#LT5#GT#GT_{%dn,%dn,%dn|%dn,%dn}",4*fHarmonic,1*fHarmonic,1*fHarmonic,3*fHarmonic,3*fHarmonic));
3914  f5pCorrelations->GetXaxis()->SetBinLabel(47,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",4*fHarmonic,3*fHarmonic,3*fHarmonic,3*fHarmonic,1*fHarmonic));
3915  f5pCorrelations->GetXaxis()->SetBinLabel(48,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",4*fHarmonic,4*fHarmonic,3*fHarmonic,3*fHarmonic,2*fHarmonic));
3916  f5pCorrelations->GetXaxis()->SetBinLabel(49,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",4*fHarmonic,4*fHarmonic,4*fHarmonic,3*fHarmonic,1*fHarmonic));
3917  f5pCorrelations->GetXaxis()->SetBinLabel(50,Form("#LT#LT5#GT#GT_{%dn|%dn,%dn,%dn,%dn}",5*fHarmonic,2*fHarmonic,1*fHarmonic,1*fHarmonic,1*fHarmonic));
3918  f5pCorrelations->GetXaxis()->SetBinLabel(51,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",5*fHarmonic,1*fHarmonic,2*fHarmonic,2*fHarmonic,2*fHarmonic));
3919  f5pCorrelations->GetXaxis()->SetBinLabel(52,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",5*fHarmonic,2*fHarmonic,3*fHarmonic,2*fHarmonic,2*fHarmonic));
3920  f5pCorrelations->GetXaxis()->SetBinLabel(53,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",5*fHarmonic,3*fHarmonic,3*fHarmonic,3*fHarmonic,2*fHarmonic));
3921  f5pCorrelations->GetXaxis()->SetBinLabel(54,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",5*fHarmonic,1*fHarmonic,4*fHarmonic,1*fHarmonic,1*fHarmonic));
3922  f5pCorrelations->GetXaxis()->SetBinLabel(55,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",5*fHarmonic,4*fHarmonic,3*fHarmonic,3*fHarmonic,3*fHarmonic));
3923  f5pCorrelations->GetXaxis()->SetBinLabel(56,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",5*fHarmonic,4*fHarmonic,4*fHarmonic,4*fHarmonic,1*fHarmonic));
3924  f5pCorrelations->GetXaxis()->SetBinLabel(57,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",5*fHarmonic,5*fHarmonic,4*fHarmonic,3*fHarmonic,3*fHarmonic));
3925  f5pCorrelations->GetXaxis()->SetBinLabel(58,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",5*fHarmonic,5*fHarmonic,4*fHarmonic,4*fHarmonic,2*fHarmonic));
3926  f5pCorrelations->GetXaxis()->SetBinLabel(59,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",5*fHarmonic,5*fHarmonic,5*fHarmonic,3*fHarmonic,2*fHarmonic));
3927  f5pCorrelations->GetXaxis()->SetBinLabel(60,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",5*fHarmonic,5*fHarmonic,5*fHarmonic,4*fHarmonic,1*fHarmonic));
3928  f5pCorrelations->GetXaxis()->SetBinLabel(61,Form("#LT#LT5#GT#GT_{%dn|%dn,%dn,%dn,%dn}",6*fHarmonic,2*fHarmonic,2*fHarmonic,1*fHarmonic,1*fHarmonic));
3929  f5pCorrelations->GetXaxis()->SetBinLabel(62,Form("#LT#LT5#GT#GT_{%dn|%dn,%dn,%dn,%dn}",6*fHarmonic,3*fHarmonic,1*fHarmonic,1*fHarmonic,1*fHarmonic));
3930  f5pCorrelations->GetXaxis()->SetBinLabel(63,Form("#LT#LT5#GT#GT_{%dn,%dn,%dn|%dn,%dn}",6*fHarmonic,1*fHarmonic,1*fHarmonic,4*fHarmonic,4*fHarmonic));
3931  f5pCorrelations->GetXaxis()->SetBinLabel(64,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,1*fHarmonic,5*fHarmonic,1*fHarmonic,1*fHarmonic));
3932  f5pCorrelations->GetXaxis()->SetBinLabel(65,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,2*fHarmonic,4*fHarmonic,2*fHarmonic,2*fHarmonic));
3933  f5pCorrelations->GetXaxis()->SetBinLabel(66,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,4*fHarmonic,4*fHarmonic,4*fHarmonic,2*fHarmonic));
3934  f5pCorrelations->GetXaxis()->SetBinLabel(67,Form("#LT#LT5#GT#GT_{%dn,%dn,%dn|%dn,%dn}",6*fHarmonic,2*fHarmonic,2*fHarmonic,5*fHarmonic,5*fHarmonic));
3935  f5pCorrelations->GetXaxis()->SetBinLabel(68,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,5*fHarmonic,5*fHarmonic,5*fHarmonic,1*fHarmonic));
3936  f5pCorrelations->GetXaxis()->SetBinLabel(69,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,6*fHarmonic,5*fHarmonic,5*fHarmonic,2*fHarmonic));
3937  f5pCorrelations->GetXaxis()->SetBinLabel(70,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,6*fHarmonic,6*fHarmonic,4*fHarmonic,2*fHarmonic));
3938  f5pCorrelations->GetXaxis()->SetBinLabel(71,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,6*fHarmonic,6*fHarmonic,5*fHarmonic,1*fHarmonic));
3939  f5pCorrelations->GetXaxis()->SetBinLabel(72,""); // empty
3940  // 5-p correlations sensitive to four distinct harmonics (11):
3941  f5pCorrelations->GetXaxis()->SetBinLabel(73,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",5*fHarmonic,2*fHarmonic,3*fHarmonic,3*fHarmonic,1*fHarmonic));
3942  f5pCorrelations->GetXaxis()->SetBinLabel(74,Form("#LT#LT5#GT#GT_{%dn,%dn,%dn|%dn,%dn}",5*fHarmonic,1*fHarmonic,1*fHarmonic,4*fHarmonic,3*fHarmonic));
3943  f5pCorrelations->GetXaxis()->SetBinLabel(75,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",5*fHarmonic,3*fHarmonic,4*fHarmonic,2*fHarmonic,2*fHarmonic));
3944  f5pCorrelations->GetXaxis()->SetBinLabel(76,Form("#LT#LT5#GT#GT_{%dn,%dn,%dn|%dn,%dn}",5*fHarmonic,2*fHarmonic,1*fHarmonic,4*fHarmonic,4*fHarmonic));
3945  f5pCorrelations->GetXaxis()->SetBinLabel(77,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,1*fHarmonic,3*fHarmonic,2*fHarmonic,2*fHarmonic));
3946  f5pCorrelations->GetXaxis()->SetBinLabel(78,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,3*fHarmonic,4*fHarmonic,4*fHarmonic,1*fHarmonic));
3947  f5pCorrelations->GetXaxis()->SetBinLabel(79,Form("#LT#LT5#GT#GT_{%dn,%dn,%dn|%dn,%dn}",6*fHarmonic,1*fHarmonic,1*fHarmonic,5*fHarmonic,3*fHarmonic));
3948  f5pCorrelations->GetXaxis()->SetBinLabel(80,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,3*fHarmonic,5*fHarmonic,2*fHarmonic,2*fHarmonic));
3949  f5pCorrelations->GetXaxis()->SetBinLabel(81,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,5*fHarmonic,4*fHarmonic,4*fHarmonic,3*fHarmonic));
3950  f5pCorrelations->GetXaxis()->SetBinLabel(82,Form("#LT#LT5#GT#GT_{%dn,%dn,%dn|%dn,%dn}",6*fHarmonic,3*fHarmonic,1*fHarmonic,5*fHarmonic,5*fHarmonic));
3951  f5pCorrelations->GetXaxis()->SetBinLabel(83,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,6*fHarmonic,5*fHarmonic,4*fHarmonic,3*fHarmonic));
3952  f5pCorrelations->GetXaxis()->SetBinLabel(84,""); // empty
3953  // 5-p correlations sensitive to five distinct harmonics (3):
3954  f5pCorrelations->GetXaxis()->SetBinLabel(85,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,2*fHarmonic,4*fHarmonic,3*fHarmonic,1*fHarmonic));
3955  f5pCorrelations->GetXaxis()->SetBinLabel(86,Form("#LT#LT5#GT#GT_{%dn,%dn,%dn|%dn,%dn}",6*fHarmonic,2*fHarmonic,1*fHarmonic,5*fHarmonic,4*fHarmonic));
3956  f5pCorrelations->GetXaxis()->SetBinLabel(87,Form("#LT#LT5#GT#GT_{%dn,%dn|%dn,%dn,%dn}",6*fHarmonic,4*fHarmonic,5*fHarmonic,3*fHarmonic,2*fHarmonic));
3958  // b4) 6-p correlations (??+??+??+??+??):
3959  TString s6pCorrelationsName = "f6pCorrelations";
3960  s6pCorrelationsName += fAnalysisLabel->Data();
3961  f6pCorrelations = new TProfile(s6pCorrelationsName.Data(),Form("6-particle correlations (n = %d)",fHarmonic),1,0.,1.);
3962  f6pCorrelations->SetTickLength(-0.01,"Y");
3963  f6pCorrelations->SetMarkerStyle(25);
3964  f6pCorrelations->SetLabelSize(0.02);
3965  f6pCorrelations->SetLabelOffset(0.02,"Y");
3966  f6pCorrelations->SetStats(kFALSE);
3967  f6pCorrelations->Sumw2();
3968  //fMixedHarmonicsProfiles->Add(f6pCorrelations); // TBI
3969  // b5) 7-p correlations (??+??+??+??+??):
3970  TString s7pCorrelationsName = "f7pCorrelations";
3971  s7pCorrelationsName += fAnalysisLabel->Data();
3972  f7pCorrelations = new TProfile(s7pCorrelationsName.Data(),Form("7-particle correlations (n = %d)",fHarmonic),1,0.,1.);
3973  f7pCorrelations->SetTickLength(-0.01,"Y");
3974  f7pCorrelations->SetMarkerStyle(25);
3975  f7pCorrelations->SetLabelSize(0.02);
3976  f7pCorrelations->SetLabelOffset(0.02,"Y");
3977  f7pCorrelations->SetStats(kFALSE);
3978  f7pCorrelations->Sumw2();
3979  //fMixedHarmonicsProfiles->Add(f7pCorrelations); // TBI
3980  // b6) 8-p correlations (??+??+??+??+??):
3981  TString s8pCorrelationsName = "f8pCorrelations";
3982  s8pCorrelationsName += fAnalysisLabel->Data();
3983  f8pCorrelations = new TProfile(s8pCorrelationsName.Data(),Form("8-particle correlations (n = %d)",fHarmonic),1,0.,1.);
3984  f8pCorrelations->SetTickLength(-0.01,"Y");
3985  f8pCorrelations->SetMarkerStyle(25);
3986  f8pCorrelations->SetLabelSize(0.02);
3987  f8pCorrelations->SetLabelOffset(0.02,"Y");
3988  f8pCorrelations->SetStats(kFALSE);
3989  f8pCorrelations->Sumw2();
3990  //fMixedHarmonicsProfiles->Add(f8pCorrelations); // TBI
3991 
3992  // c) Book all objects in TList fMixedHarmonicsResults:
3993  // QC{2}:
3994  f2pCumulants = f2pCorrelations->ProjectionX("f2pCumulants");
3995  f2pCumulants->SetTitle(Form("2-particle cumulants (n = %d)",fHarmonic));
3996  f2pCumulants->SetStats(kFALSE);
3997  f2pCumulants->SetMarkerStyle(kFullSquare);
3998  f2pCumulants->SetMarkerColor(kBlack);
3999  f2pCumulants->SetLineColor(kBlack);
4001  // QC{3}:
4002  f3pCumulants = f3pCorrelations->ProjectionX("f3pCumulants");
4003  f3pCumulants->SetTitle(Form("3-particle cumulants (n = %d)",fHarmonic));
4004  f3pCumulants->SetStats(kFALSE);
4005  f3pCumulants->SetMarkerStyle(kFullSquare);
4006  f3pCumulants->SetMarkerColor(kGreen+2);
4007  f3pCumulants->SetLineColor(kGreen+2);
4009  // QC{4}:
4010  f4pCumulants = f4pCorrelations->ProjectionX("f4pCumulants");
4011  f4pCumulants->SetTitle(Form("4-particle cumulants (n = %d)",fHarmonic));
4012  f4pCumulants->SetStats(kFALSE);
4013  f4pCumulants->SetMarkerStyle(kFullSquare);
4014  f4pCumulants->SetMarkerColor(kRed);
4015  f4pCumulants->SetLineColor(kRed);
4017  // QC{5}:
4018  f5pCumulants = f5pCorrelations->ProjectionX("f5pCumulants");
4019  f5pCumulants->SetTitle(Form("5-particle cumulants (n = %d)",fHarmonic));
4020  f5pCumulants->SetStats(kFALSE);
4021  f5pCumulants->SetMarkerStyle(kFullSquare);
4022  f5pCumulants->SetMarkerColor(kBlue);
4023  f5pCumulants->SetLineColor(kBlue);
4025 
4026  // d) Book all objects in TList fMixedHarmonicsErrorPropagation:
4027  // Sum of linear and quadratic event weights for mixed harmonics => [0=linear 1,1=quadratic]:
4028  TString mixedHarmonicEventWeightsName = "fMixedHarmonicEventWeights";
4029  mixedHarmonicEventWeightsName += fAnalysisLabel->Data();
4030  TString powerFlag[2] = {"linear","quadratic"};
4031  for(Int_t power=0;power<2;power++)
4032  {
4033  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.);
4034  fMixedHarmonicEventWeights[power]->SetLabelSize(0.04);
4035  fMixedHarmonicEventWeights[power]->SetMarkerStyle(25);
4036  fMixedHarmonicEventWeights[power]->SetStats(kFALSE);
4037  if(power == 0)
4038  {
4039  (fMixedHarmonicEventWeights[power]->GetXaxis())->SetBinLabel(1,"#sum w_{#LT1#GT}");
4040  (fMixedHarmonicEventWeights[power]->GetXaxis())->SetBinLabel(2,"#sum w_{#LT2#GT}");
4041  (fMixedHarmonicEventWeights[power]->GetXaxis())->SetBinLabel(3,"#sum w_{#LT3#GT}");
4042  (fMixedHarmonicEventWeights[power]->GetXaxis())->SetBinLabel(4,"#sum w_{#LT4#GT}");
4043  (fMixedHarmonicEventWeights[power]->GetXaxis())->SetBinLabel(5,"#sum w_{#LT5#GT}");
4044  (fMixedHarmonicEventWeights[power]->GetXaxis())->SetBinLabel(6,"#sum w_{#LT6#GT}");
4045  (fMixedHarmonicEventWeights[power]->GetXaxis())->SetBinLabel(7,"#sum w_{#LT7#GT}");
4046  (fMixedHarmonicEventWeights[power]->GetXaxis())->SetBinLabel(8,"#sum w_{#LT8#GT}");
4047  } else if (power == 1)
4048  {
4049  (fMixedHarmonicEventWeights[power]->GetXaxis())->SetBinLabel(1,"#sum w_{#LT1#GT}^{2}");
4050  (fMixedHarmonicEventWeights[power]->GetXaxis())->SetBinLabel(2,"#sum w_{#LT2#GT}^{2}");
4051  (fMixedHarmonicEventWeights[power]->GetXaxis())->SetBinLabel(3,"#sum w_{#LT3#GT}^{2}");
4052  (fMixedHarmonicEventWeights[power]->GetXaxis())->SetBinLabel(4,"#sum w_{#LT4#GT}^{2}");
4053  (fMixedHarmonicEventWeights[power]->GetXaxis())->SetBinLabel(5,"#sum w_{#LT5#GT}^{2}");
4054  (fMixedHarmonicEventWeights[power]->GetXaxis())->SetBinLabel(6,"#sum w_{#LT6#GT}^{2}");
4055  (fMixedHarmonicEventWeights[power]->GetXaxis())->SetBinLabel(7,"#sum w_{#LT7#GT}^{2}");
4056  (fMixedHarmonicEventWeights[power]->GetXaxis())->SetBinLabel(8,"#sum w_{#LT8#GT}^{2}");
4057  }
4059  } // end of for(Int_t power=0;power<2;power++)
4060 
4061  // Sums of products of event weights for mixed harmonics:
4062  TString mixedHarmonicProductOfEventWeightsName = "fMixedHarmonicProductOfEventWeights";
4063  mixedHarmonicProductOfEventWeightsName += fAnalysisLabel->Data();
4064  fMixedHarmonicProductOfEventWeights = new TH2D(mixedHarmonicProductOfEventWeightsName.Data(),"Sums of products of event weights",8,0.,8.,8,0.,8.);
4065  fMixedHarmonicProductOfEventWeights->SetStats(kFALSE);
4066  fMixedHarmonicProductOfEventWeights->GetXaxis()->SetLabelSize(0.05);
4067  fMixedHarmonicProductOfEventWeights->GetYaxis()->SetLabelSize(0.05);
4068  for(Int_t b=1;b<=8;b++)
4069  {
4070  fMixedHarmonicProductOfEventWeights->GetXaxis()->SetBinLabel(b,Form("w_{#LT%i#GT}",b));
4071  fMixedHarmonicProductOfEventWeights->GetYaxis()->SetBinLabel(b,Form("w_{#LT%i#GT}",b));
4072  }
4074 
4075  // Averages of products of mixed harmonics correlations:
4076  TString mixedHarmonicProductOfCorrelationsName = "fMixedHarmonicProductOfCorrelations";
4077  mixedHarmonicProductOfCorrelationsName += fAnalysisLabel->Data();
4078  fMixedHarmonicProductOfCorrelations = new TProfile2D(mixedHarmonicProductOfCorrelationsName.Data(),"Averages of products of mixed correlators",139,0.,139.,139,0.,139.);
4080  fMixedHarmonicProductOfCorrelations->SetStats(kFALSE);
4081  fMixedHarmonicProductOfCorrelations->GetXaxis()->SetLabelSize(0.015);
4082  fMixedHarmonicProductOfCorrelations->GetYaxis()->SetLabelSize(0.015);
4083  // x-axis:
4084  fMixedHarmonicProductOfCorrelations->GetXaxis()->SetBinLabel(1,Form("#LT#LT2#GT#GT_{%dn|%dn}",1*fHarmonic,1*fHarmonic));
4085  fMixedHarmonicProductOfCorrelations->GetXaxis()->SetBinLabel(2,Form("#LT#LT2#GT#GT_{%dn|%dn}",2*fHarmonic,2*fHarmonic));
4086  fMixedHarmonicProductOfCorrelations->GetXaxis()->SetBinLabel(3,Form("#LT#LT2#GT#GT_{%dn|%dn}",3*fHarmonic,3*fHarmonic));
4087  fMixedHarmonicProductOfCorrelations->GetXaxis()->SetBinLabel(4,Form("#LT#LT2#GT#GT_{%dn|%dn}",4*fHarmonic,4*fHarmonic));