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