]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithQCumulants.cxx
Suppress warning for (not) writing tracklets (Jochen)
[u/mrichter/AliRoot.git] / PWG2 / FLOW / AliFlowCommon / AliFlowAnalysisWithQCumulants.cxx
CommitLineData
a5b7efd0 1/*************************************************************************\r
2* Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *\r
3* *\r
4* Author: The ALICE Off-line Project. *\r
5* Contributors are mentioned in the code where appropriate. *\r
6* *\r
7* Permission to use, copy, modify and distribute this software and its *\r
8* documentation strictly for non-commercial purposes is hereby granted *\r
9* without fee, provided that the above copyright notice appears in all *\r
10* copies and that both the copyright notice and this permission notice *\r
11* appear in the supporting documentation. The authors make no claims *\r
12* about the suitability of this software for any purpose. It is *\r
13* provided "as is" without express or implied warranty. * \r
14**************************************************************************/\r
15\r
16/********************************** \r
17 * flow analysis with Q-cumulants * \r
18 * * \r
19 * author: Ante Bilandzic * \r
20 * (anteb@nikhef.nl) *\r
21 *********************************/ \r
22\r
23#define AliFlowAnalysisWithQCumulants_cxx\r
24\r
25#include "Riostream.h"\r
26#include "AliFlowCommonConstants.h"\r
27#include "AliFlowCommonHist.h"\r
28#include "AliFlowCommonHistResults.h"\r
29#include "TChain.h"\r
30\r
31#include "TFile.h"\r
32#include "TList.h"\r
33#include "TGraph.h"\r
34#include "TParticle.h"\r
35#include "TRandom3.h"\r
36#include "TStyle.h"\r
37#include "TProfile.h"\r
38#include "TProfile2D.h" \r
39#include "TProfile3D.h"\r
40#include "TMath.h"\r
41#include "TArrow.h"\r
42#include "TPaveLabel.h"\r
43#include "TCanvas.h"\r
44#include "AliFlowEventSimple.h"\r
45#include "AliFlowTrackSimple.h"\r
46#include "AliFlowAnalysisWithQCumulants.h"\r
47#include "TArrayD.h"\r
48#include "TRandom.h"\r
49#include "TF1.h"\r
50\r
51class TH1;\r
52class TH2;\r
53class TGraph;\r
54class TPave;\r
55class TLatex;\r
56class TMarker;\r
57class TRandom3;\r
58class TObjArray;\r
59class TList;\r
60class TCanvas;\r
61class TSystem;\r
62class TROOT;\r
63class AliFlowVector;\r
64class TVector;\r
65\r
66\r
67//================================================================================================================\r
68\r
69\r
70ClassImp(AliFlowAnalysisWithQCumulants)\r
71\r
72AliFlowAnalysisWithQCumulants::AliFlowAnalysisWithQCumulants(): \r
73 // 0.) base:\r
74 fHistList(NULL),\r
75 // 1.) common:\r
76 fCommonHists(NULL),\r
77 fCommonHists2nd(NULL), \r
78 fCommonHists4th(NULL),\r
79 fCommonHists6th(NULL),\r
80 fCommonHists8th(NULL),\r
81 fCommonHistsResults2nd(NULL),\r
82 fCommonHistsResults4th(NULL),\r
83 fCommonHistsResults6th(NULL),\r
84 fCommonHistsResults8th(NULL),\r
85 fnBinsPhi(0),\r
86 fPhiMin(0),\r
87 fPhiMax(0),\r
88 fPhiBinWidth(0),\r
89 fnBinsPt(0),\r
90 fPtMin(0),\r
91 fPtMax(0),\r
92 fPtBinWidth(0),\r
93 fnBinsEta(0),\r
94 fEtaMin(0),\r
95 fEtaMax(0),\r
96 fEtaBinWidth(0),\r
97 fHarmonic(2),\r
98 fAnalysisLabel(NULL),\r
99 // 2a.) particle weights:\r
100 fWeightsList(NULL),\r
101 fUsePhiWeights(kFALSE),\r
102 fUsePtWeights(kFALSE),\r
103 fUseEtaWeights(kFALSE),\r
104 fUseParticleWeights(NULL),\r
105 fPhiWeights(NULL),\r
106 fPtWeights(NULL),\r
107 fEtaWeights(NULL),\r
108 // 2b.) event weights:\r
109 fMultiplicityWeight(NULL),\r
110 // 3.) integrated flow:\r
111 fIntFlowList(NULL), \r
112 fIntFlowProfiles(NULL),\r
113 fIntFlowResults(NULL),\r
114 fIntFlowFlags(NULL),\r
115 fApplyCorrectionForNUA(kTRUE), \r
116 fReQ(NULL),\r
117 fImQ(NULL),\r
118 fSMpk(NULL),\r
119 fIntFlowCorrelationsEBE(NULL),\r
120 fIntFlowEventWeightsForCorrelationsEBE(NULL),\r
121 fIntFlowCorrelationsAllEBE(NULL),\r
122 fAvMultiplicity(NULL),\r
123 fIntFlowCorrelationsPro(NULL),\r
124 fIntFlowCorrelationsAllPro(NULL),\r
125 fIntFlowExtraCorrelationsPro(NULL),\r
126 fIntFlowProductOfCorrelationsPro(NULL),\r
127 fIntFlowCorrelationsHist(NULL),\r
128 fIntFlowCorrelationsAllHist(NULL),\r
129 fIntFlowCovariances(NULL),\r
130 fIntFlowSumOfProductOfEventWeights(NULL),\r
131 fIntFlowQcumulants(NULL),\r
132 fIntFlow(NULL),\r
133 // 4.) differential flow:\r
134 fDiffFlowList(NULL),\r
135 fDiffFlowProfiles(NULL),\r
136 fDiffFlowResults(NULL),\r
137 fDiffFlowFlags(NULL),\r
138 fCalculate2DFlow(kFALSE),\r
139 // 5.) distributions:\r
57340a27 140 fDistributionsList(NULL),
141 fDistributionsFlags(NULL),
142 fStoreDistributions(kFALSE),\r
a5b7efd0 143 // x.) debugging and cross-checking:\r
144 fNestedLoopsList(NULL),\r
145 fEvaluateIntFlowNestedLoops(kFALSE),\r
146 fEvaluateDiffFlowNestedLoops(kFALSE),\r
147 fMaxAllowedMultiplicity(10),\r
148 fEvaluateNestedLoops(NULL),\r
149 fIntFlowDirectCorrelations(NULL),\r
150 fIntFlowExtraDirectCorrelations(NULL),\r
151 fCrossCheckInPtBinNo(10),\r
152 fCrossCheckInEtaBinNo(20)\r
153 {\r
154 // constructor \r
155 \r
156 // base list to hold all output objects:\r
157 fHistList = new TList();\r
158 fHistList->SetName("cobjQC");\r
159 fHistList->SetOwner(kTRUE);\r
160 \r
161 // list to hold histograms with phi, pt and eta weights: \r
162 fWeightsList = new TList();\r
163 \r
164 // multiplicity weight:\r
165 fMultiplicityWeight = new TString("combinations");\r
166 \r
167 // analysis label;\r
168 fAnalysisLabel = new TString();\r
169 \r
170 // initialize all arrays: \r
171 this->InitializeArraysForIntFlow();\r
172 this->InitializeArraysForDiffFlow();\r
173 this->InitializeArraysForDistributions();\r
174 this->InitializeArraysForNestedLoops();\r
175 \r
176 } // end of constructor\r
177 \r
178\r
179//================================================================================================================ \r
180\r
181\r
182AliFlowAnalysisWithQCumulants::~AliFlowAnalysisWithQCumulants()\r
183{\r
184 // destructor\r
185 \r
186 delete fHistList;\r
187\r
188} // end of AliFlowAnalysisWithQCumulants::~AliFlowAnalysisWithQCumulants()\r
189\r
190\r
191//================================================================================================================\r
192\r
193\r
194void AliFlowAnalysisWithQCumulants::Init()\r
195{\r
196 // a) Access all common constants;\r
197 // b) Book all objects;\r
57340a27 198 // c) Store flags for integrated and differential flow;
199 // d) Store flags for distributions of corelations;\r
200 // e) Store harmonic which will be estimated.\r
a5b7efd0 201 \r
202 // a) Access all common constants:\r
203 this->AccessConstants();\r
204 \r
205 // b) Book all objects:\r
206 this->BookAndFillWeightsHistograms();\r
207 this->BookAndNestAllLists();\r
208 this->BookCommonHistograms();\r
209 this->BookEverythingForIntegratedFlow(); \r
210 this->BookEverythingForDifferentialFlow(); \r
211 this->BookEverythingForDistributions();\r
212 this->BookEverythingForNestedLoops();\r
213 \r
214 // c) Store flags for integrated and differential flow:\r
215 this->StoreIntFlowFlags();\r
216 this->StoreDiffFlowFlags();\r
57340a27 217
218 // d) Store flags for distributions of corelations:\r
219 this->StoreFlagsForDistributions();\r
a5b7efd0 220\r
57340a27 221 // e) Store harmonic which will be estimated:\r
a5b7efd0 222 this->StoreHarmonic();\r
223 \r
224} // end of void AliFlowAnalysisWithQCumulants::Init()\r
225\r
226\r
227//================================================================================================================\r
228\r
229\r
230void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)\r
231{\r
232 // Running over data only in this method.\r
233 \r
234 // a) Fill the common control histograms and call the method to fill fAvMultiplicity;\r
235 // b) Loop over data and calculate e-b-e quantities;\r
57340a27 236 // c) Call all the methods;\r
a5b7efd0 237 // d) Debugging and cross-checking (evaluate nested loops);\r
238 // e) Reset all event by event quantities. \r
239 \r
240 Double_t dPhi = 0.; // azimuthal angle in the laboratory frame\r
241 Double_t dPt = 0.; // transverse momentum\r
242 Double_t dEta = 0.; // pseudorapidity\r
243\r
244 Double_t wPhi = 1.; // phi weight\r
245 Double_t wPt = 1.; // pt weight\r
246 Double_t wEta = 1.; // eta weight\r
247 \r
248 Int_t nRP = anEvent->GetEventNSelTracksRP(); // number of RPs (i.e. number of particles used to determine the reaction plane)\r
249 \r
250 // a) Fill the common control histograms and call the method to fill fAvMultiplicity:\r
251 this->FillCommonControlHistograms(anEvent); \r
252 this->FillAverageMultiplicities(nRP); \r
253 \r
254 // b) Loop over data and calculate e-b-e quantities:\r
255 Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = total number of primary tracks, i.e. nPrim = nRP + nPOI + rest, where:\r
256 // nRP = # of particles used to determine the reaction plane;\r
257 // nPOI = # of particles of interest for a detailed flow analysis;\r
258 // rest = # of particles which are not niether RPs nor POIs. \r
259 \r
260 AliFlowTrackSimple *aftsTrack = NULL;\r
261 \r
262 for(Int_t i=0;i<nPrim;i++) \r
263 { \r
264 aftsTrack=anEvent->GetTrack(i);\r
265 if(aftsTrack)\r
266 {\r
267 if(!(aftsTrack->InRPSelection() || aftsTrack->InPOISelection())) continue; // consider only tracks which are RPs or POIs\r
268 Int_t n = fHarmonic; // shortcut for the harmonic\r
269 if(aftsTrack->InRPSelection()) // RP condition:\r
270 { \r
271 dPhi = aftsTrack->Phi();\r
272 dPt = aftsTrack->Pt();\r
273 dEta = aftsTrack->Eta();\r
274 if(fUsePhiWeights && fPhiWeights && fnBinsPhi) // determine phi weight for this particle:\r
275 {\r
276 wPhi = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*fnBinsPhi/TMath::TwoPi())));\r
277 }\r
278 if(fUsePtWeights && fPtWeights && fnBinsPt) // determine pt weight for this particle:\r
279 {\r
280 wPt = fPtWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/fPtBinWidth))); \r
281 } \r
282 if(fUseEtaWeights && fEtaWeights && fEtaBinWidth) // determine eta weight for this particle: \r
283 {\r
284 wEta = fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/fEtaBinWidth))); \r
285 } \r
286 \r
287 // integrated flow: \r
288 // calculate Re[Q_{m*n,k}] and Im[Q_{m*n,k}], m = 1,2,3,4, for this event:\r
289 for(Int_t m=0;m<4;m++)\r
290 {\r
291 for(Int_t k=0;k<9;k++)\r
292 {\r
293 (*fReQ)(m,k)+=pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1)*n*dPhi); \r
294 (*fImQ)(m,k)+=pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1)*n*dPhi); \r
295 } \r
296 }\r
297 // calculate S^{M}_{p,k} for this event \r
298 // Remark: final calculation of S^{M}_{p,k} follows after the loop over data bellow:\r
299 for(Int_t p=0;p<8;p++)\r
300 {\r
301 for(Int_t k=0;k<9;k++)\r
302 { \r
303 (*fSMpk)(p,k)+=pow(wPhi*wPt*wEta,k);\r
304 }\r
305 } \r
306 \r
307 // differential flow:\r
308 // 1D (pt):\r
309 // (r_{m*m,k}(pt)): \r
310 for(Int_t m=0;m<4;m++)\r
311 {\r
312 for(Int_t k=0;k<9;k++)\r
313 {\r
314 fReRPQ1dEBE[0][0][m][k]->Fill(dPt,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);\r
315 fImRPQ1dEBE[0][0][m][k]->Fill(dPt,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);\r
316 }\r
317 }\r
318 \r
319 // s_{k}(pt) for RPs // to be improved (clarified)\r
320 // Remark: final calculation of s_{p,k}(pt) follows after the loop over data bellow:\r
321 for(Int_t k=0;k<9;k++)\r
322 {\r
323 fs1dEBE[0][0][k]->Fill(dPt,pow(wPhi*wPt*wEta,k),1.);\r
324 }\r
325 // 1D (eta):\r
326 // (r_{m*m,k}(eta)): \r
327 for(Int_t m=0;m<4;m++)\r
328 {\r
329 for(Int_t k=0;k<9;k++)\r
330 {\r
331 fReRPQ1dEBE[0][1][m][k]->Fill(dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);\r
332 fImRPQ1dEBE[0][1][m][k]->Fill(dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);\r
333 }\r
334 } \r
335 // s_{k}(eta) for RPs // to be improved (clarified)\r
336 // Remark: final calculation of s_{p,k}(eta) follows after the loop over data bellow:\r
337 for(Int_t k=0;k<9;k++)\r
338 {\r
339 fs1dEBE[0][1][k]->Fill(dEta,pow(wPhi*wPt*wEta,k),1.);\r
340 }\r
341 \r
342 \r
343 \r
344 /*\r
345 // 2D (pt,eta):\r
346 if(fCalculate2DFlow)\r
347 {\r
348 // (r_{m*m,k}(pt,eta)): \r
349 for(Int_t m=0;m<4;m++)\r
350 {\r
351 for(Int_t k=0;k<9;k++)\r
352 {\r
353 fReRPQ2dEBE[0][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);\r
354 fImRPQ2dEBE[0][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);\r
355 }\r
356 } \r
357 // s_{k}(pt,eta) for RPs // to be improved (clarified)\r
358 // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:\r
359 for(Int_t k=0;k<9;k++)\r
360 {\r
361 fs2dEBE[0][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k),1.);\r
362 }\r
363 } // end of if(fCalculate2DFlow) \r
364 */ \r
365 \r
366 \r
367 \r
368 if(aftsTrack->InPOISelection())\r
369 {\r
370 // 1D (pt): \r
371 // (q_{m*m,k}(pt)): \r
372 for(Int_t m=0;m<4;m++)\r
373 {\r
374 for(Int_t k=0;k<9;k++)\r
375 {\r
376 fReRPQ1dEBE[2][0][m][k]->Fill(dPt,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);\r
377 fImRPQ1dEBE[2][0][m][k]->Fill(dPt,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);\r
378 }\r
379 } \r
380 // s_{k}(pt) for RP&&POIs // to be improved (clarified)\r
381 // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:\r
382 for(Int_t k=0;k<9;k++)\r
383 {\r
384 fs1dEBE[2][0][k]->Fill(dPt,pow(wPhi*wPt*wEta,k),1.);\r
385 }\r
386 // 1D (eta): \r
387 // (q_{m*m,k}(eta)): \r
388 for(Int_t m=0;m<4;m++)\r
389 {\r
390 for(Int_t k=0;k<9;k++)\r
391 {\r
392 fReRPQ1dEBE[2][1][m][k]->Fill(dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);\r
393 fImRPQ1dEBE[2][1][m][k]->Fill(dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);\r
394 }\r
395 } \r
396 // s_{k}(eta) for RP&&POIs // to be improved (clarified)\r
397 // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:\r
398 for(Int_t k=0;k<9;k++)\r
399 {\r
400 fs1dEBE[2][1][k]->Fill(dEta,pow(wPhi*wPt*wEta,k),1.);\r
401 }\r
402 \r
403 /*\r
404 // 2D (pt,eta) \r
405 if(fCalculate2DFlow)\r
406 {\r
407 // (q_{m*m,k}(pt,eta)): \r
408 for(Int_t m=0;m<4;m++)\r
409 {\r
410 for(Int_t k=0;k<9;k++)\r
411 {\r
412 fReRPQ2dEBE[2][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1.)*n*dPhi),1.);\r
413 fImRPQ2dEBE[2][m][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1.)*n*dPhi),1.);\r
414 }\r
415 } \r
416 // s_{k}(pt,eta) for RP&&POIs // to be improved (clarified)\r
417 // Remark: final calculation of s_{p,k}(pt,eta) follows after the loop over data bellow:\r
418 for(Int_t k=0;k<9;k++)\r
419 {\r
420 fs2dEBE[2][k]->Fill(dPt,dEta,pow(wPhi*wPt*wEta,k),1.);\r
421 }\r
422 } // end of if(fCalculate2DFlow) \r
423 */\r
424 \r
425 } // end of if(aftsTrack->InPOISelection())\r
426 \r
427\r
428 \r
429 } // end of if(pTrack->InRPSelection())\r
430\r
431 \r
432 \r
433 if(aftsTrack->InPOISelection())\r
434 {\r
435 dPhi = aftsTrack->Phi();\r
436 dPt = aftsTrack->Pt();\r
437 dEta = aftsTrack->Eta();\r
438 \r
439 // 1D (pt)\r
440 // p_n(m*n,0): \r
441 for(Int_t m=0;m<4;m++)\r
442 {\r
443 fReRPQ1dEBE[1][0][m][0]->Fill(dPt,TMath::Cos((m+1.)*n*dPhi),1.);\r
444 fImRPQ1dEBE[1][0][m][0]->Fill(dPt,TMath::Sin((m+1.)*n*dPhi),1.);\r
445 }\r
446 // 1D (eta)\r
447 // p_n(m*n,0): \r
448 for(Int_t m=0;m<4;m++)\r
449 {\r
450 fReRPQ1dEBE[1][1][m][0]->Fill(dEta,TMath::Cos((m+1.)*n*dPhi),1.);\r
451 fImRPQ1dEBE[1][1][m][0]->Fill(dEta,TMath::Sin((m+1.)*n*dPhi),1.);\r
452 }\r
453 \r
454 \r
455 /*\r
456 // 2D (pt,eta):\r
457 if(fCalculate2DFlow)\r
458 { \r
459 // p_n(m*n,0): \r
460 for(Int_t m=0;m<4;m++)\r
461 {\r
462 fReRPQ2dEBE[1][m][0]->Fill(dPt,dEta,TMath::Cos((m+1.)*n*dPhi),1.);\r
463 fImRPQ2dEBE[1][m][0]->Fill(dPt,dEta,TMath::Sin((m+1.)*n*dPhi),1.);\r
464 }\r
465 } // end of if(fCalculate2DFlow) \r
466 */\r
467 \r
468 \r
469 } // end of if(pTrack->InPOISelection() ) \r
470 \r
471 \r
472 } else // to if(aftsTrack)\r
473 {\r
474 cout<<endl;\r
475 cout<<" WARNING: no particle! (i.e. aftsTrack is a NULL pointer in AFAWQC::Make().)"<<endl;\r
476 cout<<endl; \r
477 }\r
478 } // end of for(Int_t i=0;i<nPrim;i++) \r
479\r
480 // calculate the final expressions for S^{M}_{p,k}:\r
481 for(Int_t p=0;p<8;p++)\r
482 {\r
483 for(Int_t k=0;k<9;k++)\r
484 {\r
485 (*fSMpk)(p,k)=pow((*fSMpk)(p,k),p+1);\r
486 } \r
487 } \r
488 \r
489 // *****************************\r
490 // **** CALL THE METHODS *******\r
491 // *****************************\r
492 // integrated flow:\r
493 if(!fEvaluateIntFlowNestedLoops)\r
494 {\r
495 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))\r
496 {\r
497 if(nRP>1) this->CalculateIntFlowCorrelations(); // without using particle weights\r
498 } else \r
499 {\r
500 if(nRP>1) this->CalculateIntFlowCorrelationsUsingParticleWeights(); // with using particle weights \r
501 } \r
502 \r
503 if(nRP>3) this->CalculateIntFlowProductOfCorrelations();\r
504 if(nRP>1) this->CalculateIntFlowSumOfEventWeights();\r
505 if(nRP>1) this->CalculateIntFlowSumOfProductOfEventWeights();\r
57340a27 506 if(fApplyCorrectionForNUA)\r
507 {\r
508 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
509 {
510 if(nRP>0) this->CalculateIntFlowCorrectionsForNUASinTerms();\r
511 if(nRP>0) this->CalculateIntFlowCorrectionsForNUACosTerms();\r
512 } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
513 {
514 if(nRP>0) this->CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights();\r
515 if(nRP>0) this->CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights();
516 }
517 } // end of if(fApplyCorrectionForNUA)\r
a5b7efd0 518 } // end of if(!fEvaluateIntFlowNestedLoops)\r
519\r
520 // differential flow:\r
521 if(!fEvaluateDiffFlowNestedLoops)\r
522 {\r
523 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))\r
524 {\r
57340a27 525 // without using particle weights:\r
526 this->CalculateDiffFlowCorrelations("RP","Pt"); \r
527 this->CalculateDiffFlowCorrelations("RP","Eta");\r
528 this->CalculateDiffFlowCorrelations("POI","Pt");\r
529 this->CalculateDiffFlowCorrelations("POI","Eta");
530 if(fApplyCorrectionForNUA)
531 {
532 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Pt");\r
533 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Eta");\r
534 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Pt");\r
535 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Eta");\r
536 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Pt");\r
537 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Eta");\r
538 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Pt");\r
539 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Eta");
540 } // end of if(fApplyCorrectionForNUA) \r
541 } else // to if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))\r
a5b7efd0 542 {\r
543 // with using particle weights: \r
544 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Pt"); \r
545 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Eta"); \r
546 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Pt"); \r
547 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Eta"); \r
57340a27 548 if(fApplyCorrectionForNUA)
549 {
550 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Pt");\r
551 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Eta");\r
552 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Pt");\r
553 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Eta");\r
554 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Pt");\r
555 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Eta");\r
556 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Pt");\r
557 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Eta");
558 } // end of if(fApplyCorrectionForNUA) \r
a5b7efd0 559 } \r
57340a27 560
561 // whether or not using particle weights the following is calculated in the same way: \r
a5b7efd0 562 this->CalculateDiffFlowProductOfCorrelations("RP","Pt");\r
563 this->CalculateDiffFlowProductOfCorrelations("RP","Eta");\r
564 this->CalculateDiffFlowProductOfCorrelations("POI","Pt");\r
565 this->CalculateDiffFlowProductOfCorrelations("POI","Eta");\r
566 this->CalculateDiffFlowSumOfEventWeights("RP","Pt");\r
567 this->CalculateDiffFlowSumOfEventWeights("RP","Eta");\r
568 this->CalculateDiffFlowSumOfEventWeights("POI","Pt");\r
569 this->CalculateDiffFlowSumOfEventWeights("POI","Eta");\r
570 this->CalculateDiffFlowSumOfProductOfEventWeights("RP","Pt");\r
571 this->CalculateDiffFlowSumOfProductOfEventWeights("RP","Eta");\r
572 this->CalculateDiffFlowSumOfProductOfEventWeights("POI","Pt");\r
57340a27 573 this->CalculateDiffFlowSumOfProductOfEventWeights("POI","Eta"); \r
a5b7efd0 574 } // end of if(!fEvaluateDiffFlowNestedLoops)\r
575\r
576\r
577 \r
578 // with weights:\r
579 // ... \r
580 \r
581 /*\r
582 // 2D differential flow\r
583 if(fCalculate2DFlow)\r
584 {\r
585 // without weights:\r
586 if(nRP>1) this->CalculateCorrelationsForDifferentialFlow2D("RP");\r
587 if(nRP>1) this->CalculateCorrelationsForDifferentialFlow2D("POI");\r
588 \r
589 // with weights:\r
590 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)\r
591 {\r
592 if(nRP>1) this->CalculateWeightedCorrelationsForDifferentialFlow2D("RP");\r
593 if(nRP>1) this->CalculateWeightedCorrelationsForDifferentialFlow2D("POI");\r
594 } \r
595 } // end of if(fCalculate2DFlow)\r
596 */\r
57340a27 597
598 // distributions of correlations:
599 if(fStoreDistributions)
600 {
601 this->StoreDistributionsOfCorrelations();
602 }
a5b7efd0 603 \r
a5b7efd0 604 // d) Debugging and cross-checking (evaluate nested loops):\r
605 // d1) cross-checking results for integrated flow:\r
606 if(fEvaluateIntFlowNestedLoops)\r
607 {\r
608 if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10 \r
609 {\r
610 // without using particle weights:\r
611 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))\r
612 {\r
613 // correlations:\r
614 this->CalculateIntFlowCorrelations(); // from Q-vectors\r
615 this->EvaluateIntFlowCorrelationsWithNestedLoops(anEvent); // from nested loops (to be improved: do I have to pass here anEvent or not?)\r
616 // correction for non-uniform acceptance:\r
617 this->CalculateIntFlowCorrectionsForNUASinTerms(); // from Q-vectors (sin terms)\r
618 this->CalculateIntFlowCorrectionsForNUACosTerms(); // from Q-vectors (cos terms)\r
619 this->EvaluateIntFlowCorrectionsForNUAWithNestedLoops(anEvent); // from nested loops (both sin and cos terms)\r
620 }\r
621 // using particle weights:\r
622 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)\r
623 {\r
624 // correlations:\r
625 this->CalculateIntFlowCorrelationsUsingParticleWeights(); // from Q-vectors\r
626 this->EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent); // from nested loops (to be improved: do I have to pass here anEvent or not?)\r
57340a27 627 // correction for non-uniform acceptance:\r
628 this->CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights(); // from Q-vectors (sin terms)\r
629 this->CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights(); // from Q-vectors (cos terms)\r
630 this->EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(anEvent); // from nested loops (both sin and cos terms)
a5b7efd0 631 }\r
632 } else if (nPrim>fMaxAllowedMultiplicity) // to if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity)\r
633 {\r
634 cout<<endl;\r
635 cout<<"Skipping the event because multiplicity is "<<nPrim<<". Too high to evaluate nested loops!"<<endl;\r
636 } else\r
637 {\r
638 cout<<endl;\r
639 cout<<"Skipping the event because multiplicity is "<<nPrim<<"."<<endl; \r
640 } \r
641 } // end of if(fEvaluateIntFlowNestedLoops) \r
642 \r
643 // d2) cross-checking results for differential flow:\r
644 if(fEvaluateDiffFlowNestedLoops)\r
645 {\r
646 if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10\r
647 {\r
648 // without using particle weights:\r
649 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))\r
650 {\r
651 // reduced correlations:\r
652 // Q-vectors:\r
653 this->CalculateDiffFlowCorrelations("RP","Pt");\r
654 this->CalculateDiffFlowCorrelations("RP","Eta");\r
655 this->CalculateDiffFlowCorrelations("POI","Pt");\r
656 this->CalculateDiffFlowCorrelations("POI","Eta");\r
657 // nested loops:\r
658 //this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"RP","Pt"); // to be improved (enabled eventually)\r
659 //this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"RP","Eta"); // to be improved (enabled eventually)\r
660 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"POI","Pt"); // to be improved (do I need to pass here anEvent?)\r
661 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"POI","Eta"); // to be improved (do I need to pass here anEvent?)\r
662 // reduced corrections for non-uniform acceptance:\r
663 // Q-vectors:\r
664 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Pt");\r
665 this->CalculateDiffFlowCorrectionsForNUASinTerms("RP","Eta");\r
666 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Pt");\r
667 this->CalculateDiffFlowCorrectionsForNUASinTerms("POI","Eta");\r
668 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Pt");\r
669 this->CalculateDiffFlowCorrectionsForNUACosTerms("RP","Eta");\r
670 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Pt");\r
671 this->CalculateDiffFlowCorrectionsForNUACosTerms("POI","Eta");\r
672 // nested loops:\r
673 //this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"RP","Pt"); // to be improved (enabled eventually)\r
674 //this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"RP","Eta"); // to be improved (enabled eventually)\r
675 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"POI","Pt"); // to be improved (do I need to pass here anEvent?)\r
676 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"POI","Eta"); // to be improved (do I need to pass here anEvent?)\r
677 } // end of if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))\r
678 // using particle weights:\r
679 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)\r
680 {\r
681 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Pt"); \r
682 this->CalculateDiffFlowCorrelationsUsingParticleWeights("RP","Eta"); \r
683 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Pt"); \r
684 this->CalculateDiffFlowCorrelationsUsingParticleWeights("POI","Eta"); \r
57340a27 685 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Pt");\r
686 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("RP","Eta");\r
687 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Pt");\r
688 this->CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights("POI","Eta");\r
689 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Pt");\r
690 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("RP","Eta");\r
691 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Pt");\r
692 this->CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights("POI","Eta");\r
a5b7efd0 693 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"RP","Pt"); // to be improved (enabled eventually)\r
694 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"RP","Eta"); // to be improved (enabled eventually)\r
695 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"POI","Pt"); // to be improved (do I need to pass here anEvent?)\r
57340a27 696 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"POI","Eta"); // to be improved (do I need to pass here anEvent?)
697 //this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"RP","Pt"); // to be improved (enabled eventually)\r
698 //this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"RP","Eta"); // to be improved (enabled eventually)\r
699 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"POI","Pt"); // to be improved (do I need to pass here anEvent?)\r
700 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"POI","Eta"); // to be improved (do I need to pass here anEvent?)\r
a5b7efd0 701 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)\r
702 } // end of if(nPrim>0 && nPrim<=fMaxAllowedMultiplicity) // by default fMaxAllowedMultiplicity = 10\r
703 } // end of if(fEvaluateDiffFlowNestedLoops) \r
704 \r
705 // e) Reset all event by event quantities: \r
706 this->ResetEventByEventQuantities();\r
707 \r
708} // end of AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)\r
709\r
710\r
711//================================================================================================================================\r
712\r
713\r
714void AliFlowAnalysisWithQCumulants::Finish()\r
715{\r
716 // Calculate the final results.\r
717 // a) acces the constants;\r
718 // b) access the flags;\r
719 // c) calculate the final results for integrated flow (without and with weights);\r
720 // d) store in AliFlowCommonHistResults and print the final results for integrated flow;\r
721 // e) calculate the final results for differential flow (without and with weights);\r
722 // f) print the final results for integrated flow obtained from differential flow (to be improved (terminology));\r
723 // g) cross-check the results: results from Q-vectors vs results from nested loops\r
724 \r
725 // ******************************\r
726 // **** ACCESS THE CONSTANTS ****\r
727 // ******************************\r
728 \r
729 this->AccessConstants(); \r
730 \r
731 if(fCommonHists && fCommonHists->GetHarmonic())\r
732 {\r
733 fHarmonic = (Int_t)(fCommonHists->GetHarmonic())->GetBinContent(1); // to be improved (moved somewhere else)\r
734 } \r
735\r
736 // **************************\r
737 // **** ACCESS THE FLAGS ****\r
738 // ************************** \r
739 fUsePhiWeights = (Int_t)fUseParticleWeights->GetBinContent(1); \r
740 fUsePtWeights = (Int_t)fUseParticleWeights->GetBinContent(2); \r
741 fUseEtaWeights = (Int_t)fUseParticleWeights->GetBinContent(3); \r
742 fApplyCorrectionForNUA = (Int_t)fIntFlowFlags->GetBinContent(3); \r
743 fEvaluateIntFlowNestedLoops = (Int_t)fEvaluateNestedLoops->GetBinContent(1);\r
744 fEvaluateDiffFlowNestedLoops = (Int_t)fEvaluateNestedLoops->GetBinContent(2); \r
745 fCrossCheckInPtBinNo = (Int_t)fEvaluateNestedLoops->GetBinContent(3);\r
746 fCrossCheckInEtaBinNo = (Int_t)fEvaluateNestedLoops->GetBinContent(4); \r
747 \r
748 // *********************************************************\r
749 // **** CALCULATE THE FINAL RESULTS FOR INTEGRATED FLOW ****\r
750 // ********************************************************* \r
751 \r
752 this->FinalizeCorrelationsIntFlow();\r
753 this->CalculateCovariancesIntFlow();\r
754 this->CalculateCumulantsIntFlow();\r
755 this->CalculateIntFlow(); \r
756\r
46b94261 757 if(fApplyCorrectionForNUA) // to be improved (reorganized, etc)\r
a5b7efd0 758 {\r
759 this->FinalizeCorrectionTermsForNUAIntFlow();\r
760 this->CalculateQcumulantsCorrectedForNUAIntFlow(); \r
761 this->CalculateIntFlowCorrectedForNUA(); \r
762 }\r
763 \r
764 // ***************************************************************\r
765 // **** STORE AND PRINT THE FINAL RESULTS FOR INTEGRATED FLOW ****\r
766 // ***************************************************************\r
767 \r
768 this->FillCommonHistResultsIntFlow(); \r
769 \r
770 this->PrintFinalResultsForIntegratedFlow("NONAME"); // to be improved (name)\r
771 \r
772 // ***********************************************************\r
773 // **** CALCULATE THE FINAL RESULTS FOR DIFFERENTIAL FLOW ****\r
774 // *********************************************************** \r
775 \r
776 this->FinalizeReducedCorrelations("RP","Pt"); \r
777 this->FinalizeReducedCorrelations("RP","Eta"); \r
778 this->FinalizeReducedCorrelations("POI","Pt"); \r
779 this->FinalizeReducedCorrelations("POI","Eta");\r
780 this->CalculateDiffFlowCovariances("RP","Pt");\r
781 this->CalculateDiffFlowCovariances("RP","Eta");\r
782 this->CalculateDiffFlowCovariances("POI","Pt");\r
783 this->CalculateDiffFlowCovariances("POI","Eta");\r
784 this->CalculateDiffFlowCumulants("RP","Pt");\r
785 this->CalculateDiffFlowCumulants("RP","Eta");\r
786 this->CalculateDiffFlowCumulants("POI","Pt");\r
787 this->CalculateDiffFlowCumulants("POI","Eta");\r
788 this->CalculateDiffFlow("RP","Pt");\r
789 this->CalculateDiffFlow("RP","Eta");\r
790 this->CalculateDiffFlow("POI","Pt");\r
791 this->CalculateDiffFlow("POI","Eta");\r
792 \r
46b94261 793 if(fApplyCorrectionForNUA) // to be improved (reorganized, etc)\r
a5b7efd0 794 {\r
795 this->FinalizeCorrectionTermsForNUADiffFlow("RP","Pt");\r
796 this->FinalizeCorrectionTermsForNUADiffFlow("RP","Eta");\r
797 this->FinalizeCorrectionTermsForNUADiffFlow("POI","Pt");\r
798 this->FinalizeCorrectionTermsForNUADiffFlow("POI","Eta"); \r
799 this->CalculateDiffFlowCumulantsCorrectedForNUA("RP","Pt"); \r
800 this->CalculateDiffFlowCumulantsCorrectedForNUA("RP","Eta"); \r
801 this->CalculateDiffFlowCumulantsCorrectedForNUA("POI","Pt"); \r
802 this->CalculateDiffFlowCumulantsCorrectedForNUA("POI","Eta"); \r
803 this->CalculateDiffFlowCorrectedForNUA("RP","Pt"); \r
804 this->CalculateDiffFlowCorrectedForNUA("RP","Eta"); \r
805 this->CalculateDiffFlowCorrectedForNUA("POI","Pt"); \r
806 this->CalculateDiffFlowCorrectedForNUA("POI","Eta"); \r
807 }\r
808 \r
809 this->CalculateFinalResultsForRPandPOIIntegratedFlow("RP");\r
810 this->CalculateFinalResultsForRPandPOIIntegratedFlow("POI");\r
811\r
812 // *****************************************************************\r
813 // **** STORE AND PRINT THE FINAL RESULTS FOR DIFFERENTIAL FLOW ****\r
814 // *****************************************************************\r
815 this->FillCommonHistResultsDiffFlow("RP");\r
816 this->FillCommonHistResultsDiffFlow("POI");\r
817\r
818 this->PrintFinalResultsForIntegratedFlow("RP"); \r
819 this->PrintFinalResultsForIntegratedFlow("POI"); \r
820 \r
821 // g) cross-check the results: results from Q-vectors vs results from nested loops\r
57340a27 822
a5b7efd0 823 // g1) integrated flow:\r
824 if(fEvaluateIntFlowNestedLoops)\r
825 {\r
57340a27 826 this->CrossCheckIntFlowCorrelations();\r
827 this->CrossCheckIntFlowCorrectionTermsForNUA(); \r
828 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights) this->CrossCheckIntFlowExtraCorrelations(); \r
a5b7efd0 829 } // end of if(fEvaluateIntFlowNestedLoops) \r
57340a27 830
a5b7efd0 831 // g2) differential flow: \r
832 if(fEvaluateDiffFlowNestedLoops) \r
833 {\r
834 // correlations:\r
835 //this->CrossCheckDiffFlowCorrelations("RP","Pt"); // to be improved (enabled eventually) \r
836 //this->CrossCheckDiffFlowCorrelations("RP","Eta"); // to be improved (enabled eventually) \r
837 this->CrossCheckDiffFlowCorrelations("POI","Pt"); \r
838 this->CrossCheckDiffFlowCorrelations("POI","Eta");\r
839 // correction terms for non-uniform acceptance:\r
840 //this->CrossCheckDiffFlowCorrectionTermsForNUA("RP","Pt"); // to be improved (enabled eventually) \r
841 //this->CrossCheckDiffFlowCorrectionTermsForNUA("RP","Eta"); // to be improved (enabled eventually) \r
46b94261 842 this->CrossCheckDiffFlowCorrectionTermsForNUA("POI","Pt"); \r
843 this->CrossCheckDiffFlowCorrectionTermsForNUA("POI","Eta"); \r
a5b7efd0 844 } // end of if(fEvaluateDiffFlowNestedLoops)\r
845 \r
846} // end of AliFlowAnalysisWithQCumulants::Finish()\r
847\r
848\r
849//================================================================================================================================\r
850\r
851\r
852void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTerms()\r
853{\r
854 // calculate corrections for non-uniform acceptance of the detector for no-name integrated flow (cos terms)\r
855 \r
856 // multiplicity:\r
857 Double_t dMult = (*fSMpk)(0,0);\r
858 \r
859 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n: \r
860 Double_t dReQ1n = (*fReQ)(0,0);\r
861 Double_t dReQ2n = (*fReQ)(1,0);\r
862 //Double_t dReQ3n = (*fReQ)(2,0);\r
863 //Double_t dReQ4n = (*fReQ)(3,0);\r
864 Double_t dImQ1n = (*fImQ)(0,0);\r
865 Double_t dImQ2n = (*fImQ)(1,0);\r
866 //Double_t dImQ3n = (*fImQ)(2,0);\r
867 //Double_t dImQ4n = (*fImQ)(3,0);\r
868 \r
869 // *************************************************************\r
870 // **** corrections for non-uniform acceptance (cos terms): ****\r
871 // *************************************************************\r
872 //\r
873 // Remark 1: corrections for non-uniform acceptance (cos terms) calculated with non-weighted Q-vectors \r
874 // are stored in 1D profile fQCorrectionsCos.\r
875 // Remark 2: binning of fIntFlowCorrectionTermsForNUAPro[1] is organized as follows:\r
876 // --------------------------------------------------------------------------------------------------------------------\r
877 // 1st bin: <<cos(n*(phi1))>> = cosP1n\r
878 // 2nd bin: <<cos(n*(phi1+phi2))>> = cosP1nP1n\r
879 // 3rd bin: <<cos(n*(phi1-phi2-phi3))>> = cosP1nM1nM1n\r
880 // ...\r
881 // --------------------------------------------------------------------------------------------------------------------\r
882 \r
883 // 1-particle:\r
884 Double_t cosP1n = 0.; // <<cos(n*(phi1))>>\r
885 \r
886 if(dMult>0)\r
887 {\r
888 cosP1n = dReQ1n/dMult; \r
889 \r
890 // average non-weighted 1-particle correction (cos terms) for non-uniform acceptance for single event:\r
891 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(1,cosP1n);\r
892 \r
893 // final average non-weighted 1-particle correction (cos terms) for non-uniform acceptance for all events:\r
894 fIntFlowCorrectionTermsForNUAPro[1]->Fill(0.5,cosP1n,dMult); \r
895 } \r
896 \r
897 // 2-particle:\r
898 Double_t cosP1nP1n = 0.; // <<cos(n*(phi1+phi2))>>\r
899 \r
900 if(dMult>1)\r
901 {\r
902 cosP1nP1n = (pow(dReQ1n,2)-pow(dImQ1n,2)-dReQ2n)/(dMult*(dMult-1)); \r
903 \r
904 // average non-weighted 2-particle correction (cos terms) for non-uniform acceptance for single event:\r
905 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(2,cosP1nP1n);\r
906 \r
907 // final average non-weighted 2-particle correction (cos terms) for non-uniform acceptance for all events:\r
908 fIntFlowCorrectionTermsForNUAPro[1]->Fill(1.5,cosP1nP1n,dMult*(dMult-1)); \r
909 } \r
910 \r
911 // 3-particle:\r
912 Double_t cosP1nM1nM1n = 0.; // <<cos(n*(phi1-phi2-phi3))>>\r
913 \r
914 if(dMult>2)\r
915 {\r
916 cosP1nM1nM1n = (dReQ1n*(pow(dReQ1n,2)+pow(dImQ1n,2))-dReQ1n*dReQ2n-dImQ1n*dImQ2n-2.*(dMult-1)*dReQ1n)\r
917 / (dMult*(dMult-1)*(dMult-2)); \r
918 \r
919 // average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for single event:\r
920 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(3,cosP1nM1nM1n);\r
921 \r
922 // final average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for all events:\r
923 fIntFlowCorrectionTermsForNUAPro[1]->Fill(2.5,cosP1nM1nM1n,dMult*(dMult-1)*(dMult-2)); \r
924 } \r
925 \r
926} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTerms()\r
927\r
928\r
929//================================================================================================================================\r
930\r
931\r
932void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTerms()\r
933{\r
934 // calculate corrections for non-uniform acceptance of the detector for no-name integrated flow (sin terms)\r
935 \r
936 // multiplicity:\r
937 Double_t dMult = (*fSMpk)(0,0);\r
938 \r
939 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n: \r
940 Double_t dReQ1n = (*fReQ)(0,0);\r
941 Double_t dReQ2n = (*fReQ)(1,0);\r
942 //Double_t dReQ3n = (*fReQ)(2,0);\r
943 //Double_t dReQ4n = (*fReQ)(3,0);\r
944 Double_t dImQ1n = (*fImQ)(0,0);\r
945 Double_t dImQ2n = (*fImQ)(1,0);\r
946 //Double_t dImQ3n = (*fImQ)(2,0);\r
947 //Double_t dImQ4n = (*fImQ)(3,0);\r
948 \r
949 // *************************************************************\r
950 // **** corrections for non-uniform acceptance (sin terms): ****\r
951 // *************************************************************\r
952 //\r
953 // Remark 1: corrections for non-uniform acceptance (sin terms) calculated with non-weighted Q-vectors \r
954 // are stored in 1D profile fQCorrectionsSin.\r
955 // Remark 2: binning of fIntFlowCorrectionTermsForNUAPro[0] is organized as follows:\r
956 // --------------------------------------------------------------------------------------------------------------------\r
957 // 1st bin: <<sin(n*(phi1))>> = sinP1n\r
958 // 2nd bin: <<sin(n*(phi1+phi2))>> = sinP1nP1n\r
959 // 3rd bin: <<sin(n*(phi1-phi2-phi3))>> = sinP1nM1nM1n\r
960 // ...\r
961 // --------------------------------------------------------------------------------------------------------------------\r
962 \r
963 // 1-particle:\r
964 Double_t sinP1n = 0.; // <sin(n*(phi1))>\r
965 \r
966 if(dMult>0)\r
967 {\r
968 sinP1n = dImQ1n/dMult; \r
969 \r
970 // average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for single event:\r
971 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(1,sinP1n);\r
972 \r
973 // final average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for all events: \r
974 fIntFlowCorrectionTermsForNUAPro[0]->Fill(0.5,sinP1n,dMult); \r
975 } \r
976 \r
977 // 2-particle:\r
978 Double_t sinP1nP1n = 0.; // <<sin(n*(phi1+phi2))>>\r
979 \r
980 if(dMult>1)\r
981 {\r
982 sinP1nP1n = (2.*dReQ1n*dImQ1n-dImQ2n)/(dMult*(dMult-1)); \r
983 \r
984 // average non-weighted 2-particle correction (sin terms) for non-uniform acceptance for single event:\r
985 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(2,sinP1nP1n);\r
986 \r
987 // final average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for all events: \r
988 fIntFlowCorrectionTermsForNUAPro[0]->Fill(1.5,sinP1nP1n,dMult*(dMult-1)); \r
989 } \r
990 \r
991 // 3-particle:\r
992 Double_t sinP1nM1nM1n = 0.; // <<sin(n*(phi1-phi2-phi3))>>\r
993 \r
994 if(dMult>2)\r
995 {\r
996 sinP1nM1nM1n = (-dImQ1n*(pow(dReQ1n,2)+pow(dImQ1n,2))+dReQ1n*dImQ2n-dImQ1n*dReQ2n+2.*(dMult-1)*dImQ1n)\r
997 / (dMult*(dMult-1)*(dMult-2)); \r
998 \r
999 // average non-weighted 3-particle correction (sin terms) for non-uniform acceptance for single event:\r
1000 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(3,sinP1nM1nM1n);\r
1001 \r
1002 // final average non-weighted 3-particle correction (sin terms) for non-uniform acceptance for all events: \r
1003 fIntFlowCorrectionTermsForNUAPro[0]->Fill(2.5,sinP1nM1nM1n,dMult*(dMult-1)*(dMult-2)); \r
1004 } \r
1005 \r
1006} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTerms()\r
1007\r
1008\r
1009//================================================================================================================================\r
1010\r
1011\r
1012void AliFlowAnalysisWithQCumulants::GetOutputHistograms(TList *outputListHistos)\r
1013{\r
1014 // a) Get pointers for common control and common result histograms and profiles.\r
1015 // b) Get pointers for histograms with particle weights.\r
1016 // c) Get pointers for histograms and profiles relevant for integrated flow.\r
1017 // d) Get pointers for histograms and profiles relevant for differental flow.\r
1018 // e) Get pointers for histograms and profiles holding results obtained with nested loops.\r
1019 \r
1020 if(outputListHistos)\r
1021 { \r
1022 this->GetPointersForCommonHistograms(outputListHistos); // to be improved (no need to pass here argument, use setter for base list instead)\r
1023 this->GetPointersForParticleWeightsHistograms(outputListHistos); // to be improved (no need to pass here argument, use setter for base list instead)\r
1024 this->GetPointersForIntFlowHistograms(outputListHistos); // to be improved (no need to pass here argument, use setter for base list instead)\r
1025 this->GetPointersForDiffFlowHistograms(outputListHistos); // to be improved (no need to pass here argument, use setter for base list instead)\r
1026 this->GetPointersForNestedLoopsHistograms(outputListHistos); // to be improved (no need to pass here argument, use setter for base list instead)\r
1027 }\r
1028 \r
1029} // end of void AliFlowAnalysisWithQCumulants::GetOutputHistograms(TList *outputListHistos)\r
1030\r
1031\r
1032//================================================================================================================================\r
1033\r
1034\r
1035TProfile* AliFlowAnalysisWithQCumulants::MakePtProjection(TProfile2D *profilePtEta) const\r
1036{\r
1037 // project 2D profile onto pt axis to get 1D profile\r
1038 \r
1039 Int_t nBinsPt = profilePtEta->GetNbinsX();\r
1040 Double_t dPtMin = (profilePtEta->GetXaxis())->GetXmin();\r
1041 Double_t dPtMax = (profilePtEta->GetXaxis())->GetXmax();\r
1042 \r
1043 Int_t nBinsEta = profilePtEta->GetNbinsY();\r
1044 \r
1045 TProfile *profilePt = new TProfile("","",nBinsPt,dPtMin,dPtMax); \r
1046 \r
1047 for(Int_t p=1;p<=nBinsPt;p++)\r
1048 {\r
1049 Double_t contentPt = 0.;\r
1050 Double_t entryPt = 0.;\r
1051 Double_t spreadPt = 0.;\r
1052 Double_t sum1 = 0.;\r
1053 Double_t sum2 = 0.;\r
1054 Double_t sum3 = 0.;\r
1055 for(Int_t e=1;e<=nBinsEta;e++)\r
1056 {\r
1057 contentPt += (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)))\r
1058 * (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));\r
1059 entryPt += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));\r
1060 \r
1061 sum1 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)))\r
1062 * (pow(profilePtEta->GetBinError(profilePtEta->GetBin(p,e)),2.)\r
1063 + pow(profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)),2.)); \r
1064 sum2 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));\r
1065 sum3 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)))\r
1066 * (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e))); \r
1067 }\r
1068 if(sum2>0. && sum1/sum2-pow(sum3/sum2,2.) > 0.)\r
1069 {\r
1070 spreadPt = pow(sum1/sum2-pow(sum3/sum2,2.),0.5);\r
1071 }\r
1072 profilePt->SetBinContent(p,contentPt);\r
1073 profilePt->SetBinEntries(p,entryPt);\r
1074 {\r
1075 profilePt->SetBinError(p,spreadPt);\r
1076 }\r
1077 \r
1078 }\r
1079 \r
1080 return profilePt;\r
1081 \r
1082} // end of TProfile* AliFlowAnalysisWithQCumulants::MakePtProjection(TProfile2D *profilePtEta)\r
1083\r
1084\r
1085//================================================================================================================================\r
1086\r
1087\r
1088TProfile* AliFlowAnalysisWithQCumulants::MakeEtaProjection(TProfile2D *profilePtEta) const\r
1089{\r
1090 // project 2D profile onto eta axis to get 1D profile\r
1091 \r
1092 Int_t nBinsEta = profilePtEta->GetNbinsY();\r
1093 Double_t dEtaMin = (profilePtEta->GetYaxis())->GetXmin();\r
1094 Double_t dEtaMax = (profilePtEta->GetYaxis())->GetXmax();\r
1095 \r
1096 Int_t nBinsPt = profilePtEta->GetNbinsX();\r
1097 \r
1098 TProfile *profileEta = new TProfile("","",nBinsEta,dEtaMin,dEtaMax); \r
1099 \r
1100 for(Int_t e=1;e<=nBinsEta;e++)\r
1101 {\r
1102 Double_t contentEta = 0.;\r
1103 Double_t entryEta = 0.;\r
1104 for(Int_t p=1;p<=nBinsPt;p++)\r
1105 {\r
1106 contentEta += (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)))\r
1107 * (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));\r
1108 entryEta += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));\r
1109 }\r
1110 profileEta->SetBinContent(e,contentEta);\r
1111 profileEta->SetBinEntries(e,entryEta);\r
1112 }\r
1113 \r
1114 return profileEta;\r
1115 \r
1116} // end of TProfile* AliFlowAnalysisWithQCumulants::MakeEtaProjection(TProfile2D *profilePtEta)\r
1117\r
1118\r
1119//================================================================================================================================\r
1120\r
1121\r
1122void AliFlowAnalysisWithQCumulants::PrintFinalResultsForIntegratedFlow(TString type)\r
1123{\r
1124 // printing on the screen the final results for integrated flow (NONAME, POI and RP) // to be improved (NONAME) \r
1125 \r
1126 Int_t n = fHarmonic; \r
1127 \r
1128 if(type == "NONAME" || type == "RP" || type == "POI")\r
1129 {\r
1130 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))\r
1131 {\r
1132 cout<<"WARNING: fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th"<<endl;\r
1133 cout<<" is NULL in AFAWQC::PFRFIF() !!!!"<<endl;\r
1134 }\r
1135 } else\r
1136 {\r
1137 cout<<"WARNING: type in not from {NONAME, RP, POI} in AFAWQC::PFRFIF() !!!!"<<endl;\r
1138 exit(0);\r
1139 }\r
1140 \r
1141 Double_t dVn[4] = {0.}; // array to hold Vn{2}, Vn{4}, Vn{6} and Vn{8} \r
1142 Double_t dVnErr[4] = {0.}; // array to hold errors of Vn{2}, Vn{4}, Vn{6} and Vn{8} \r
1143 \r
1144 if(type == "NONAME")\r
1145 {\r
1146 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinContent(1); \r
1147 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinError(1); \r
1148 dVn[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinContent(1); \r
1149 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinError(1); \r
1150 dVn[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinContent(1); \r
1151 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinError(1); \r
1152 dVn[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinContent(1); \r
1153 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinError(1); \r
1154 } else if(type == "RP")\r
1155 {\r
1156 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinContent(1); \r
1157 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinError(1); \r
1158 dVn[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinContent(1); \r
1159 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinError(1); \r
1160 dVn[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinContent(1); \r
1161 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinError(1); \r
1162 dVn[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinContent(1); \r
1163 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinError(1); \r
1164 } else if(type == "POI")\r
1165 {\r
1166 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinContent(1); \r
1167 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinError(1); \r
1168 dVn[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinContent(1); \r
1169 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinError(1); \r
1170 dVn[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinContent(1); \r
1171 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinError(1); \r
1172 dVn[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinContent(1); \r
1173 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinError(1); \r
1174 }\r
1175 \r
1176 TString title = " flow estimates from Q-cumulants"; \r
1177 TString subtitle = " ("; \r
1178 \r
1179 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))\r
1180 {\r
1181 subtitle.Append(type);\r
1182 subtitle.Append(", without weights)");\r
1183 } else \r
1184 {\r
1185 subtitle.Append(type);\r
1186 subtitle.Append(", with weights)");\r
1187 }\r
1188 \r
1189 cout<<endl;\r
1190 cout<<"*************************************"<<endl;\r
1191 cout<<"*************************************"<<endl;\r
1192 cout<<title.Data()<<endl; \r
1193 cout<<subtitle.Data()<<endl; \r
1194 cout<<endl;\r
1195 \r
1196 for(Int_t i=0;i<4;i++)\r
1197 {\r
1198 if(dVn[i]>=0.)\r
1199 {\r
1200 cout<<" v_"<<n<<"{"<<2*(i+1)<<"} = "<<dVn[i]<<" +/- "<<dVnErr[i]<<endl;\r
1201 }\r
1202 else\r
1203 {\r
1204 cout<<" v_"<<n<<"{"<<2*(i+1)<<"} = Im"<<endl;\r
1205 } \r
1206 }\r
1207\r
1208 cout<<endl;\r
1209 /*\r
1210 if(type == "NONAME")\r
1211 {\r
1212 cout<<" nEvts = "<<nEvtsNoName<<", AvM = "<<dMultNoName<<endl; // to be improved\r
1213 }\r
1214 else if (type == "RP")\r
1215 {\r
1216 cout<<" nEvts = "<<nEvtsRP<<", AvM = "<<dMultRP<<endl; // to be improved \r
1217 } \r
1218 else if (type == "POI")\r
1219 {\r
1220 cout<<" nEvts = "<<nEvtsPOI<<", AvM = "<<dMultPOI<<endl; // to be improved \r
1221 } \r
1222 */\r
1223 cout<<"*************************************"<<endl;\r
1224 cout<<"*************************************"<<endl;\r
1225 cout<<endl; \r
1226 \r
1227}// end of AliFlowAnalysisWithQCumulants::PrintFinalResultsForIntegratedFlow(TString type="NONAME");\r
1228\r
1229\r
1230//================================================================================================================================\r
1231\r
1232\r
1233void AliFlowAnalysisWithQCumulants::WriteHistograms(TString outputFileName)\r
1234{\r
1235 //store the final results in output .root file\r
1236 TFile *output = new TFile(outputFileName.Data(),"RECREATE");\r
1237 //output->WriteObject(fHistList, "cobjQC","SingleKey");\r
1238 fHistList->Write(fHistList->GetName(), TObject::kSingleKey);\r
1239 delete output;\r
1240}\r
1241\r
1242\r
1243//================================================================================================================================\r
ad87ae62 1244
1245
1246void AliFlowAnalysisWithQCumulants::WriteHistograms(TDirectoryFile *outputFileName)
1247{
1248 //store the final results in output .root file
1249 fHistList->SetName("cobjQC");
1250 fHistList->SetOwner(kTRUE);
1251 outputFileName->Add(fHistList);
1252 outputFileName->Write(outputFileName->GetName(), TObject::kSingleKey);
1253}
1254\r
1255
1256//================================================================================================================================\r
1257
a5b7efd0 1258\r
1259void AliFlowAnalysisWithQCumulants::BookCommonHistograms()\r
1260{\r
1261 // Book common control histograms and common histograms for final results.\r
1262 // common control histogram (ALL events)\r
1263 TString commonHistsName = "AliFlowCommonHistQC";\r
1264 commonHistsName += fAnalysisLabel->Data();\r
1265 fCommonHists = new AliFlowCommonHist(commonHistsName.Data());\r
1266 fHistList->Add(fCommonHists); \r
1267 // common control histogram (for events with 2 and more particles)\r
1268 TString commonHists2ndOrderName = "AliFlowCommonHist2ndOrderQC";\r
1269 commonHists2ndOrderName += fAnalysisLabel->Data();\r
1270 fCommonHists2nd = new AliFlowCommonHist(commonHists2ndOrderName.Data());\r
1271 fHistList->Add(fCommonHists2nd); \r
1272 // common control histogram (for events with 4 and more particles)\r
1273 TString commonHists4thOrderName = "AliFlowCommonHist4thOrderQC";\r
1274 commonHists4thOrderName += fAnalysisLabel->Data();\r
1275 fCommonHists4th = new AliFlowCommonHist(commonHists4thOrderName.Data());\r
1276 fHistList->Add(fCommonHists4th); \r
1277 // common control histogram (for events with 6 and more particles)\r
1278 TString commonHists6thOrderName = "AliFlowCommonHist6thOrderQC";\r
1279 commonHists6thOrderName += fAnalysisLabel->Data();\r
1280 fCommonHists6th = new AliFlowCommonHist(commonHists6thOrderName.Data());\r
1281 fHistList->Add(fCommonHists6th); \r
1282 // common control histogram (for events with 8 and more particles)\r
1283 TString commonHists8thOrderName = "AliFlowCommonHist8thOrderQC";\r
1284 commonHists8thOrderName += fAnalysisLabel->Data();\r
1285 fCommonHists8th = new AliFlowCommonHist(commonHists8thOrderName.Data());\r
1286 fHistList->Add(fCommonHists8th); \r
1287 // common histograms for final results (calculated for events with 2 and more particles)\r
1288 TString commonHistResults2ndOrderName = "AliFlowCommonHistResults2ndOrderQC";\r
1289 commonHistResults2ndOrderName += fAnalysisLabel->Data();\r
1290 fCommonHistsResults2nd = new AliFlowCommonHistResults(commonHistResults2ndOrderName.Data());\r
1291 fHistList->Add(fCommonHistsResults2nd); \r
1292 // common histograms for final results (calculated for events with 4 and more particles)\r
1293 TString commonHistResults4thOrderName = "AliFlowCommonHistResults4thOrderQC";\r
1294 commonHistResults4thOrderName += fAnalysisLabel->Data();\r
1295 fCommonHistsResults4th = new AliFlowCommonHistResults(commonHistResults4thOrderName.Data());\r
1296 fHistList->Add(fCommonHistsResults4th); \r
1297 // common histograms for final results (calculated for events with 6 and more particles)\r
1298 TString commonHistResults6thOrderName = "AliFlowCommonHistResults6thOrderQC";\r
1299 commonHistResults6thOrderName += fAnalysisLabel->Data();\r
1300 fCommonHistsResults6th = new AliFlowCommonHistResults(commonHistResults6thOrderName.Data());\r
1301 fHistList->Add(fCommonHistsResults6th); \r
1302 // common histograms for final results (calculated for events with 8 and more particles)\r
1303 TString commonHistResults8thOrderName = "AliFlowCommonHistResults8thOrderQC";\r
1304 commonHistResults8thOrderName += fAnalysisLabel->Data();\r
1305 fCommonHistsResults8th = new AliFlowCommonHistResults(commonHistResults8thOrderName.Data());\r
1306 fHistList->Add(fCommonHistsResults8th); \r
1307 \r
1308} // end of void AliFlowAnalysisWithQCumulants::BookCommonHistograms()\r
1309\r
1310\r
1311//================================================================================================================================\r
1312\r
1313\r
1314void AliFlowAnalysisWithQCumulants::BookAndFillWeightsHistograms()\r
1315{\r
1316 // book and fill histograms which hold phi, pt and eta weights\r
1317\r
1318 if(!fWeightsList)\r
1319 {\r
1320 cout<<"WARNING: fWeightsList is NULL in AFAWQC::BAFWH() !!!!"<<endl;\r
1321 exit(0); \r
1322 }\r
1323 \r
1324 TString fUseParticleWeightsName = "fUseParticleWeightsQC";\r
1325 fUseParticleWeightsName += fAnalysisLabel->Data();\r
1326 fUseParticleWeights = new TProfile(fUseParticleWeightsName.Data(),"0 = particle weight not used, 1 = particle weight used ",3,0,3);\r
1327 fUseParticleWeights->SetLabelSize(0.06);\r
1328 (fUseParticleWeights->GetXaxis())->SetBinLabel(1,"w_{#phi}");\r
1329 (fUseParticleWeights->GetXaxis())->SetBinLabel(2,"w_{p_{T}}");\r
1330 (fUseParticleWeights->GetXaxis())->SetBinLabel(3,"w_{#eta}");\r
1331 fUseParticleWeights->Fill(0.5,(Int_t)fUsePhiWeights);\r
1332 fUseParticleWeights->Fill(1.5,(Int_t)fUsePtWeights);\r
1333 fUseParticleWeights->Fill(2.5,(Int_t)fUseEtaWeights);\r
1334 fWeightsList->Add(fUseParticleWeights); \r
1335 \r
1336 if(fUsePhiWeights)\r
1337 {\r
1338 if(fWeightsList->FindObject("phi_weights"))\r
1339 {\r
1340 fPhiWeights = dynamic_cast<TH1F*>(fWeightsList->FindObject("phi_weights"));\r
1341 if((fPhiWeights->GetBinWidth(1) > fPhiBinWidth) || (fPhiWeights->GetBinWidth(1) < fPhiBinWidth))\r
1342 {\r
1343 cout<<"WARNING: fPhiWeights->GetBinWidth(1) != fPhiBinWidth in AFAWQC::BAFWH() !!!! "<<endl;\r
1344 cout<<" This indicates inconsistent binning in phi histograms throughout the code."<<endl;\r
1345 exit(0);\r
1346 }\r
1347 } else \r
1348 {\r
1349 cout<<"WARNING: fWeightsList->FindObject(\"phi_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;\r
1350 exit(0);\r
1351 }\r
1352 } // end of if(fUsePhiWeights)\r
1353 \r
1354 if(fUsePtWeights) \r
1355 {\r
1356 if(fWeightsList->FindObject("pt_weights"))\r
1357 {\r
1358 fPtWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("pt_weights"));\r
1359 if((fPtWeights->GetBinWidth(1) > fPtBinWidth) || (fPtWeights->GetBinWidth(1) < fPtBinWidth))\r
1360 {\r
1361 cout<<"WARNING: fPtWeights->GetBinWidth(1) != fPtBinWidth in AFAWQC::BAFWH() !!!! "<<endl;\r
1362 cout<<" This indicates insconsistent binning in pt histograms throughout the code."<<endl;\r
1363 exit(0);\r
1364 }\r
1365 } else \r
1366 {\r
1367 cout<<"WARNING: fWeightsList->FindObject(\"pt_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;\r
1368 exit(0);\r
1369 }\r
1370 } // end of if(fUsePtWeights) \r
1371\r
1372 if(fUseEtaWeights) \r
1373 {\r
1374 if(fWeightsList->FindObject("eta_weights"))\r
1375 {\r
1376 fEtaWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("eta_weights"));\r
1377 if((fEtaWeights->GetBinWidth(1) > fEtaBinWidth) || (fEtaWeights->GetBinWidth(1) < fEtaBinWidth))\r
1378 {\r
1379 cout<<"WARNING: fEtaWeights->GetBinWidth(1) != fEtaBinWidth in AFAWQC::BAFWH() !!!! "<<endl;\r
1380 cout<<" This indicates insconsistent binning in eta histograms throughout the code."<<endl;\r
1381 exit(0);\r
1382 }\r
1383 } else \r
1384 {\r
1385 cout<<"WARNING: fUseEtaWeights && fWeightsList->FindObject(\"eta_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;\r
1386 exit(0);\r
1387 }\r
1388 } // end of if(fUseEtaWeights)\r
1389 \r
1390} // end of AliFlowAnalysisWithQCumulants::BookAndFillWeightsHistograms()\r
1391\r
1392\r
1393//================================================================================================================================\r
1394\r
1395\r
1396void AliFlowAnalysisWithQCumulants::BookEverythingForIntegratedFlow()\r
1397{\r
1398 // Book all objects for integrated flow:\r
1399 // a) Book profile to hold all flags for integrated flow.\r
1400 // b) Book event-by-event quantities.\r
1401 // c) Book profiles. // to be improved (comment)\r
1402 // d) Book histograms holding the final results.\r
1403 \r
1404 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)\r
1405 TString powerFlag[2] = {"linear","quadratic"}; // to be improved (should I promote this to data members?)\r
1406 \r
1407 // a) Book profile to hold all flags for integrated flow:\r
1408 TString intFlowFlagsName = "fIntFlowFlags";\r
1409 intFlowFlagsName += fAnalysisLabel->Data();\r
1410 fIntFlowFlags = new TProfile(intFlowFlagsName.Data(),"Flags for Integrated Flow",3,0,3);\r
1411 fIntFlowFlags->SetTickLength(-0.01,"Y");\r
1412 fIntFlowFlags->SetMarkerStyle(25);\r
1413 fIntFlowFlags->SetLabelSize(0.05);\r
1414 fIntFlowFlags->SetLabelOffset(0.02,"Y");\r
1415 (fIntFlowFlags->GetXaxis())->SetBinLabel(1,"Particle Weights");\r
1416 (fIntFlowFlags->GetXaxis())->SetBinLabel(2,"Event Weights");\r
1417 (fIntFlowFlags->GetXaxis())->SetBinLabel(3,"Corrected for NUA?");\r
1418 fIntFlowList->Add(fIntFlowFlags);\r
1419\r
1420 // b) Book event-by-event quantities:\r
1421 // Re[Q_{m*n,k}], Im[Q_{m*n,k}] and S_{p,k}^M: \r
1422 fReQ = new TMatrixD(4,9);\r
1423 fImQ = new TMatrixD(4,9);\r
1424 fSMpk = new TMatrixD(8,9);\r
1425 // average correlations <2>, <4>, <6> and <8> for single event (bining is the same as in fIntFlowCorrelationsPro and fIntFlowCorrelationsHist):\r
1426 TString intFlowCorrelationsEBEName = "fIntFlowCorrelationsEBE";\r
1427 intFlowCorrelationsEBEName += fAnalysisLabel->Data();\r
1428 fIntFlowCorrelationsEBE = new TH1D(intFlowCorrelationsEBEName.Data(),intFlowCorrelationsEBEName.Data(),4,0,4);\r
1429 // weights for average correlations <2>, <4>, <6> and <8> for single event:\r
1430 TString intFlowEventWeightsForCorrelationsEBEName = "fIntFlowEventWeightsForCorrelationsEBE";\r
1431 intFlowEventWeightsForCorrelationsEBEName += fAnalysisLabel->Data();\r
1432 fIntFlowEventWeightsForCorrelationsEBE = new TH1D(intFlowEventWeightsForCorrelationsEBEName.Data(),intFlowEventWeightsForCorrelationsEBEName.Data(),4,0,4);\r
1433 // average all correlations for single event (bining is the same as in fIntFlowCorrelationsAllPro and fIntFlowCorrelationsAllHist):\r
1434 TString intFlowCorrelationsAllEBEName = "fIntFlowCorrelationsAllEBE";\r
1435 intFlowCorrelationsAllEBEName += fAnalysisLabel->Data();\r
1436 fIntFlowCorrelationsAllEBE = new TH1D(intFlowCorrelationsAllEBEName.Data(),intFlowCorrelationsAllEBEName.Data(),32,0,32);\r
1437 // average correction terms for non-uniform acceptance for single event \r
1438 // (binning is the same as in fIntFlowCorrectionTermsForNUAPro[2] and fIntFlowCorrectionTermsForNUAHist[2]):\r
1439 TString fIntFlowCorrectionTermsForNUAEBEName = "fIntFlowCorrectionTermsForNUAEBE";\r
1440 fIntFlowCorrectionTermsForNUAEBEName += fAnalysisLabel->Data();\r
1441 for(Int_t sc=0;sc<2;sc++) // sin or cos terms\r
1442 {\r
1443 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()),10,0,10); \r
1444 }\r
1445 \r
1446 // c) Book profiles: // to be improved (comment)\r
1447 // profile to hold average multiplicities and number of events for events with nRP>=0, nRP>=1, ... , and nRP>=8:\r
1448 TString avMultiplicityName = "fAvMultiplicity";\r
1449 avMultiplicityName += fAnalysisLabel->Data();\r
1450 fAvMultiplicity = new TProfile(avMultiplicityName.Data(),"Average Multiplicities of RPs",9,0,9);\r
1451 fAvMultiplicity->SetTickLength(-0.01,"Y");\r
1452 fAvMultiplicity->SetMarkerStyle(25);\r
1453 fAvMultiplicity->SetLabelSize(0.05);\r
1454 fAvMultiplicity->SetLabelOffset(0.02,"Y");\r
1455 fAvMultiplicity->SetYTitle("Average Multiplicity");\r
1456 (fAvMultiplicity->GetXaxis())->SetBinLabel(1,"all evts");\r
1457 (fAvMultiplicity->GetXaxis())->SetBinLabel(2,"n_{RP} #geq 1");\r
1458 (fAvMultiplicity->GetXaxis())->SetBinLabel(3,"n_{RP} #geq 2");\r
1459 (fAvMultiplicity->GetXaxis())->SetBinLabel(4,"n_{RP} #geq 3");\r
1460 (fAvMultiplicity->GetXaxis())->SetBinLabel(5,"n_{RP} #geq 4");\r
1461 (fAvMultiplicity->GetXaxis())->SetBinLabel(6,"n_{RP} #geq 5");\r
1462 (fAvMultiplicity->GetXaxis())->SetBinLabel(7,"n_{RP} #geq 6");\r
1463 (fAvMultiplicity->GetXaxis())->SetBinLabel(8,"n_{RP} #geq 7");\r
1464 (fAvMultiplicity->GetXaxis())->SetBinLabel(9,"n_{RP} #geq 8");\r
1465 fIntFlowProfiles->Add(fAvMultiplicity);\r
1466 // average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with wrong errors!):\r
1467 TString intFlowCorrelationsProName = "fIntFlowCorrelationsPro";\r
1468 intFlowCorrelationsProName += fAnalysisLabel->Data();\r
1469 fIntFlowCorrelationsPro = new TProfile(intFlowCorrelationsProName.Data(),"Average correlations for all events",4,0,4,"s");\r
1470 fIntFlowCorrelationsPro->SetTickLength(-0.01,"Y");\r
1471 fIntFlowCorrelationsPro->SetMarkerStyle(25);\r
1472 fIntFlowCorrelationsPro->SetLabelSize(0.06);\r
1473 fIntFlowCorrelationsPro->SetLabelOffset(0.01,"Y");\r
1474 (fIntFlowCorrelationsPro->GetXaxis())->SetBinLabel(1,"<<2>>");\r
1475 (fIntFlowCorrelationsPro->GetXaxis())->SetBinLabel(2,"<<4>>");\r
1476 (fIntFlowCorrelationsPro->GetXaxis())->SetBinLabel(3,"<<6>>");\r
1477 (fIntFlowCorrelationsPro->GetXaxis())->SetBinLabel(4,"<<8>>");\r
1478 fIntFlowProfiles->Add(fIntFlowCorrelationsPro);\r
1479 // averaged all correlations for all events (with wrong errors!):\r
1480 TString intFlowCorrelationsAllProName = "fIntFlowCorrelationsAllPro";\r
1481 intFlowCorrelationsAllProName += fAnalysisLabel->Data();\r
1482 fIntFlowCorrelationsAllPro = new TProfile(intFlowCorrelationsAllProName.Data(),"Average correlations for all events",32,0,32,"s");\r
1483 fIntFlowCorrelationsAllPro->SetTickLength(-0.01,"Y");\r
1484 fIntFlowCorrelationsAllPro->SetMarkerStyle(25);\r
1485 fIntFlowCorrelationsAllPro->SetLabelSize(0.03);\r
1486 fIntFlowCorrelationsAllPro->SetLabelOffset(0.01,"Y");\r
1487 // 2-p correlations:\r
1488 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(1,"<<2>>_{n|n}");\r
1489 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(2,"<<2>>_{2n|2n}");\r
1490 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(3,"<<2>>_{3n|3n}");\r
1491 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(4,"<<2>>_{4n|4n}");\r
1492 // 3-p correlations:\r
1493 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(6,"<<3>>_{2n|n,n}");\r
1494 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(7,"<<3>>_{3n|2n,n}");\r
1495 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(8,"<<3>>_{4n|2n,2n}");\r
1496 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(9,"<<3>>_{4n|3n,n}");\r
1497 // 4-p correlations:\r
1498 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(11,"<<4>>_{n,n|n,n}"); \r
1499 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(12,"<<4>>_{2n,n|2n,n}");\r
1500 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(13,"<<4>>_{2n,2n|2n,2n}");\r
1501 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(14,"<<4>>_{3n|n,n,n}");\r
1502 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(15,"<<4>>_{3n,n|3n,n}");\r
1503 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(16,"<<4>>_{3n,n|2n,2n}"); \r
1504 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(17,"<<4>>_{4n|2n,n,n}");\r
1505 // 5-p correlations:\r
1506 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(19,"<<5>>_{2n|n,n,n,n}"); \r
1507 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(20,"<<5>>_{2n,2n|2n,n,n}");\r
1508 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(21,"<<5>>_{3n,n|2n,n,n}");\r
1509 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(22,"<<5>>_{4n|n,n,n,n}");\r
1510 // 6-p correlations:\r
1511 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(24,"<<6>>_{n,n,n|n,n,n}");\r
1512 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(25,"<<6>>_{2n,n,n|2n,n,n}");\r
1513 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(26,"<<6>>_{2n,2n|n,n,n,n}");\r
1514 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(27,"<<6>>_{3n,n|n,n,n,n}");\r
1515 // 7-p correlations: \r
1516 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(29,"<<7>>_{2n,n,n|n,n,n,n}");\r
1517 // 8-p correlations:\r
1518 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(31,"<<8>>_{n,n,n,n|n,n,n,n}");\r
1519 fIntFlowProfiles->Add(fIntFlowCorrelationsAllPro);\r
1520 // when particle weights are used some extra correlations appear:\r
1521 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights) \r
1522 {\r
1523 TString intFlowExtraCorrelationsProName = "fIntFlowExtraCorrelationsPro";\r
1524 intFlowExtraCorrelationsProName += fAnalysisLabel->Data();\r
1525 fIntFlowExtraCorrelationsPro = new TProfile(intFlowExtraCorrelationsProName.Data(),"Average extra correlations for all events",100,0,100,"s");\r
1526 fIntFlowExtraCorrelationsPro->SetTickLength(-0.01,"Y");\r
1527 fIntFlowExtraCorrelationsPro->SetMarkerStyle(25);\r
1528 fIntFlowExtraCorrelationsPro->SetLabelSize(0.03);\r
1529 fIntFlowExtraCorrelationsPro->SetLabelOffset(0.01,"Y");\r
1530 // extra 2-p correlations:\r
1531 (fIntFlowExtraCorrelationsPro->GetXaxis())->SetBinLabel(1,"<<w1^3 w2 cos(n*(phi1-phi2))>>");\r
1532 (fIntFlowExtraCorrelationsPro->GetXaxis())->SetBinLabel(2,"<<w1 w2 w3^2 cos(n*(phi1-phi2))>>");\r
a5b7efd0 1533 fIntFlowProfiles->Add(fIntFlowExtraCorrelationsPro);\r
1534 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)\r
1535 // average product of correlations <2>, <4>, <6> and <8>: \r
1536 TString intFlowProductOfCorrelationsProName = "fIntFlowProductOfCorrelationsPro";\r
1537 intFlowProductOfCorrelationsProName += fAnalysisLabel->Data();\r
1538 fIntFlowProductOfCorrelationsPro = new TProfile(intFlowProductOfCorrelationsProName.Data(),"Average products of correlations",6,0,6);\r
1539 fIntFlowProductOfCorrelationsPro->SetTickLength(-0.01,"Y");\r
1540 fIntFlowProductOfCorrelationsPro->SetMarkerStyle(25); \r
1541 fIntFlowProductOfCorrelationsPro->SetLabelSize(0.05);\r
1542 fIntFlowProductOfCorrelationsPro->SetLabelOffset(0.01,"Y");\r
1543 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(1,"<<2><4>>");\r
1544 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(2,"<<2><6>>");\r
1545 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(3,"<<2><8>>");\r
1546 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(4,"<<4><6>>");\r
1547 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(5,"<<4><8>>");\r
1548 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(6,"<<6><8>>");\r
1549 fIntFlowProfiles->Add(fIntFlowProductOfCorrelationsPro);\r
1550 // average correction terms for non-uniform acceptance (with wrong errors!):\r
1551 for(Int_t sc=0;sc<2;sc++) // sin or cos terms\r
1552 {\r
1553 TString intFlowCorrectionTermsForNUAProName = "fIntFlowCorrectionTermsForNUAPro";\r
1554 intFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();\r
1555 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()),10,0,10,"s");\r
1556 fIntFlowCorrectionTermsForNUAPro[sc]->SetTickLength(-0.01,"Y");\r
1557 fIntFlowCorrectionTermsForNUAPro[sc]->SetMarkerStyle(25);\r
1558 fIntFlowCorrectionTermsForNUAPro[sc]->SetLabelSize(0.03);\r
1559 fIntFlowCorrectionTermsForNUAPro[sc]->SetLabelOffset(0.01,"Y");\r
1560 // 1-particle terms:\r
1561 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(1,Form("<<%s(n(phi1))>>",sinCosFlag[sc].Data()));\r
1562 // 2-particle terms:\r
1563 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(2,Form("<<%s(n(phi1+phi2))>>",sinCosFlag[sc].Data())); \r
1564 // 3-particle terms:\r
1565 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(3,Form("<<%s(n(phi1-phi2-phi3))>>",sinCosFlag[sc].Data())); \r
1566 // ... \r
1567 fIntFlowProfiles->Add(fIntFlowCorrectionTermsForNUAPro[sc]);\r
1568 } // end of for(Int_t sc=0;sc<2;sc++) \r
1569 \r
1570 // d) Book histograms holding the final results:\r
1571 // average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with correct errors!):\r
1572 TString intFlowCorrelationsHistName = "fIntFlowCorrelationsHist";\r
1573 intFlowCorrelationsHistName += fAnalysisLabel->Data();\r
1574 fIntFlowCorrelationsHist = new TH1D(intFlowCorrelationsHistName.Data(),"Average correlations for all events",4,0,4);\r
1575 fIntFlowCorrelationsHist->SetTickLength(-0.01,"Y");\r
1576 fIntFlowCorrelationsHist->SetMarkerStyle(25);\r
1577 fIntFlowCorrelationsHist->SetLabelSize(0.06);\r
1578 fIntFlowCorrelationsHist->SetLabelOffset(0.01,"Y");\r
1579 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(1,"<<2>>");\r
1580 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(2,"<<4>>");\r
1581 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(3,"<<6>>");\r
1582 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(4,"<<8>>");\r
1583 fIntFlowResults->Add(fIntFlowCorrelationsHist);\r
1584 // average all correlations for all events (with correct errors!):\r
1585 TString intFlowCorrelationsAllHistName = "fIntFlowCorrelationsAllHist";\r
1586 intFlowCorrelationsAllHistName += fAnalysisLabel->Data();\r
1587 fIntFlowCorrelationsAllHist = new TH1D(intFlowCorrelationsAllHistName.Data(),"Average correlations for all events",32,0,32);\r
1588 fIntFlowCorrelationsAllHist->SetTickLength(-0.01,"Y");\r
1589 fIntFlowCorrelationsAllHist->SetMarkerStyle(25);\r
1590 fIntFlowCorrelationsAllHist->SetLabelSize(0.03);\r
1591 fIntFlowCorrelationsAllHist->SetLabelOffset(0.01,"Y");\r
1592 // 2-p correlations:\r
1593 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(1,"<<2>>_{n|n}");\r
1594 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(2,"<<2>>_{2n|2n}");\r
1595 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(3,"<<2>>_{3n|3n}");\r
1596 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(4,"<<2>>_{4n|4n}");\r
1597 // 3-p correlations:\r
1598 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(6,"<<3>>_{2n|n,n}");\r
1599 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(7,"<<3>>_{3n|2n,n}");\r
1600 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(8,"<<3>>_{4n|2n,2n}");\r
1601 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(9,"<<3>>_{4n|3n,n}");\r
1602 // 4-p correlations:\r
1603 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(11,"<<4>>_{n,n|n,n}"); \r
1604 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(12,"<<4>>_{2n,n|2n,n}");\r
1605 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(13,"<<4>>_{2n,2n|2n,2n}");\r
1606 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(14,"<<4>>_{3n|n,n,n}");\r
1607 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(15,"<<4>>_{3n,n|3n,n}");\r
1608 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(16,"<<4>>_{3n,n|2n,2n}"); \r
1609 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(17,"<<4>>_{4n|2n,n,n}");\r
1610 // 5-p correlations:\r
1611 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(19,"<<5>>_{2n|n,n,n,n}"); \r
1612 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(20,"<<5>>_{2n,2n|2n,n,n}");\r
1613 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(21,"<<5>>_{3n,n|2n,n,n}");\r
1614 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(22,"<<5>>_{4n|n,n,n,n}");\r
1615 // 6-p correlations:\r
1616 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(24,"<<6>>_{n,n,n|n,n,n}");\r
1617 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(25,"<<6>>_{2n,n,n|2n,n,n}");\r
1618 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(26,"<<6>>_{2n,2n|n,n,n,n}");\r
1619 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(27,"<<6>>_{3n,n|n,n,n,n}");\r
1620 // 7-p correlations: \r
1621 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(29,"<<7>>_{2n,n,n|n,n,n,n}");\r
1622 // 8-p correlations:\r
1623 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(31,"<<8>>_{n,n,n,n|n,n,n,n}");\r
1624 fIntFlowResults->Add(fIntFlowCorrelationsAllHist);\r
1625 // average correction terms for non-uniform acceptance (with correct errors!):\r
1626 for(Int_t sc=0;sc<2;sc++) // sin or cos terms\r
1627 {\r
1628 TString intFlowCorrectionTermsForNUAHistName = "fIntFlowCorrectionTermsForNUAHist";\r
1629 intFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();\r
1630 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()),10,0,10);\r
1631 fIntFlowCorrectionTermsForNUAHist[sc]->SetTickLength(-0.01,"Y");\r
1632 fIntFlowCorrectionTermsForNUAHist[sc]->SetMarkerStyle(25);\r
1633 fIntFlowCorrectionTermsForNUAHist[sc]->SetLabelSize(0.03);\r
1634 fIntFlowCorrectionTermsForNUAHist[sc]->SetLabelOffset(0.01,"Y");\r
1635 // ......................................................................... \r
1636 // 1-p terms:\r
1637 (fIntFlowCorrectionTermsForNUAHist[sc]->GetXaxis())->SetBinLabel(1,Form("%s(n(#phi_{1}))>",sinCosFlag[sc].Data()));\r
1638 // 2-p terms:\r
1639 // 3-p terms:\r
1640 // ...\r
1641 // ......................................................................... \r
1642 fIntFlowResults->Add(fIntFlowCorrectionTermsForNUAHist[sc]);\r
1643 } // end of for(Int_t sc=0;sc<2;sc++) \r
1644 // covariances (multiplied with weight dependent prefactor):\r
1645 TString intFlowCovariancesName = "fIntFlowCovariances";\r
1646 intFlowCovariancesName += fAnalysisLabel->Data();\r
1647 fIntFlowCovariances = new TH1D(intFlowCovariancesName.Data(),"Covariances (multiplied with weight dependent prefactor)",6,0,6);\r
1648 fIntFlowCovariances->SetLabelSize(0.04);\r
1649 fIntFlowCovariances->SetMarkerStyle(25);\r
1650 (fIntFlowCovariances->GetXaxis())->SetBinLabel(1,"Cov(<2>,<4>)");\r
1651 (fIntFlowCovariances->GetXaxis())->SetBinLabel(2,"Cov(<2>,<6>)");\r
1652 (fIntFlowCovariances->GetXaxis())->SetBinLabel(3,"Cov(<2>,<8>)");\r
1653 (fIntFlowCovariances->GetXaxis())->SetBinLabel(4,"Cov(<4>,<6>)");\r
1654 (fIntFlowCovariances->GetXaxis())->SetBinLabel(5,"Cov(<4>,<8>)");\r
1655 (fIntFlowCovariances->GetXaxis())->SetBinLabel(6,"Cov(<6>,<8>)"); \r
1656 fIntFlowResults->Add(fIntFlowCovariances);\r
1657 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8>:\r
1658 TString intFlowSumOfEventWeightsName = "fIntFlowSumOfEventWeights";\r
1659 intFlowSumOfEventWeightsName += fAnalysisLabel->Data();\r
1660 for(Int_t power=0;power<2;power++)\r
1661 {\r
1662 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);\r
1663 fIntFlowSumOfEventWeights[power]->SetLabelSize(0.05);\r
1664 fIntFlowSumOfEventWeights[power]->SetMarkerStyle(25);\r
1665 if(power == 0)\r
1666 {\r
1667 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>}");\r
1668 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<4>}");\r
1669 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<6>}");\r
1670 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<8>}");\r
1671 } else if (power == 1) \r
1672 {\r
1673 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>}^{2}");\r
1674 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<4>}^{2}");\r
1675 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<6>}^{2}");\r
1676 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<8>}^{2}");\r
1677 }\r
1678 fIntFlowResults->Add(fIntFlowSumOfEventWeights[power]);\r
1679 } \r
1680 // sum of products of event weights for correlations <2>, <4>, <6> and <8>: \r
1681 TString intFlowSumOfProductOfEventWeightsName = "fIntFlowSumOfProductOfEventWeights";\r
1682 intFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();\r
1683 fIntFlowSumOfProductOfEventWeights = new TH1D(intFlowSumOfProductOfEventWeightsName.Data(),"Sum of product of event weights for correlations",6,0,6);\r
1684 fIntFlowSumOfProductOfEventWeights->SetLabelSize(0.05);\r
1685 fIntFlowSumOfProductOfEventWeights->SetMarkerStyle(25);\r
1686 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>} w_{<4>}");\r
1687 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<2>} w_{<6>}");\r
1688 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<2>} w_{<8>}");\r
1689 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<4>} w_{<6>}");\r
1690 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(5,"#sum_{i=1}^{N} w_{<4>} w_{<8>}");\r
1691 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(6,"#sum_{i=1}^{N} w_{<6>} w_{<8>}");\r
1692 fIntFlowResults->Add(fIntFlowSumOfProductOfEventWeights);\r
1693 // final results for integrated Q-cumulants:\r
1694 TString intFlowQcumulantsName = "fIntFlowQcumulants";\r
1695 intFlowQcumulantsName += fAnalysisLabel->Data();\r
1696 fIntFlowQcumulants = new TH1D(intFlowQcumulantsName.Data(),"Integrated Q-cumulants",4,0,4);\r
1697 fIntFlowQcumulants->SetLabelSize(0.05);\r
1698 fIntFlowQcumulants->SetMarkerStyle(25);\r
1699 (fIntFlowQcumulants->GetXaxis())->SetBinLabel(1,"QC{2}");\r
1700 (fIntFlowQcumulants->GetXaxis())->SetBinLabel(2,"QC{4}");\r
1701 (fIntFlowQcumulants->GetXaxis())->SetBinLabel(3,"QC{6}");\r
1702 (fIntFlowQcumulants->GetXaxis())->SetBinLabel(4,"QC{8}");\r
1703 fIntFlowResults->Add(fIntFlowQcumulants);\r
1704 // final integrated flow estimates from Q-cumulants:\r
1705 TString intFlowName = "fIntFlow";\r
1706 intFlowName += fAnalysisLabel->Data(); \r
1707 // integrated flow from Q-cumulants:\r
1708 fIntFlow = new TH1D(intFlowName.Data(),"Integrated flow estimates from Q-cumulants",4,0,4);\r
1709 fIntFlow->SetLabelSize(0.05);\r
1710 fIntFlow->SetMarkerStyle(25);\r
1711 (fIntFlow->GetXaxis())->SetBinLabel(1,"v_{2}{2,QC}");\r
1712 (fIntFlow->GetXaxis())->SetBinLabel(2,"v_{2}{4,QC}");\r
1713 (fIntFlow->GetXaxis())->SetBinLabel(3,"v_{2}{6,QC}");\r
1714 (fIntFlow->GetXaxis())->SetBinLabel(4,"v_{2}{8,QC}");\r
1715 fIntFlowResults->Add(fIntFlow);\r
1716\r
1717 /* // to be improved (removed):\r
1718 // final average weighted multi-particle correlations for all events calculated from Q-vectors\r
1719 fQCorrelations[1] = new TProfile("Weighted correlations","final average multi-particle correlations from weighted Q-vectors",200,0,200,"s");\r
1720 fQCorrelations[1]->SetTickLength(-0.01,"Y");\r
1721 fQCorrelations[1]->SetMarkerStyle(25);\r
1722 fQCorrelations[1]->SetLabelSize(0.03);\r
1723 fQCorrelations[1]->SetLabelOffset(0.01,"Y");\r
1724 // 2-particle correlations:\r
1725 (fQCorrelations[1]->GetXaxis())->SetBinLabel(1,"<w_{1}w_{2}cos(n(#phi_{1}-#phi_{2}))>");\r
1726 (fQCorrelations[1]->GetXaxis())->SetBinLabel(2,"<w_{1}^{2}w_{2}^{2}cos(2n(#phi_{1}-#phi_{2}))>");\r
1727 (fQCorrelations[1]->GetXaxis())->SetBinLabel(3,"<w_{1}^{3}w_{2}^{3}cos(3n(#phi_{1}-#phi_{2}))>");\r
1728 (fQCorrelations[1]->GetXaxis())->SetBinLabel(4,"<w_{1}^{4}w_{2}^{4}cos(4n(#phi_{1}-#phi_{2}))>");\r
1729 (fQCorrelations[1]->GetXaxis())->SetBinLabel(5,"<w_{1}^{3}w_{2}cos(n(#phi_{1}-#phi_{2}))>");\r
1730 (fQCorrelations[1]->GetXaxis())->SetBinLabel(6,"<w_{1}^{2}w_{2}w_{3}cos(n(#phi_{1}-#phi_{2}))>");\r
1731 // 3-particle correlations:\r
1732 (fQCorrelations[1]->GetXaxis())->SetBinLabel(21,"<w_{1}w_{2}w_{3}^{2}cos(n(2#phi_{1}-#phi_{2}-#phi_{3}))>");\r
1733 // 4-particle correlations:\r
1734 (fQCorrelations[1]->GetXaxis())->SetBinLabel(41,"<w_{1}w_{2}w_{3}w_{4}cos(n(#phi_{1}+#phi_{2}-#phi_{3}-#phi_{4}))>");\r
1735 // add fQCorrelations[1] to the list fIntFlowList:\r
1736 fIntFlowList->Add(fQCorrelations[1]); \r
1737 */\r
1738 \r
1739} // end of AliFlowAnalysisWithQCumulants::BookEverythingForIntegratedFlow()\r
1740\r
1741\r
1742//================================================================================================================================\r
1743\r
1744\r
1745void AliFlowAnalysisWithQCumulants::InitializeArraysForNestedLoops()\r
1746{\r
1747 // Initialize arrays of all objects relevant for calculations with nested loops.\r
1748 \r
1749 // integrated flow:\r
1750 for(Int_t sc=0;sc<2;sc++) // sin or cos terms\r
1751 {\r
1752 fIntFlowDirectCorrectionTermsForNUA[sc] = NULL;\r
1753 } \r
1754\r
1755 // differential flow: \r
1756 // correlations:\r
1757 for(Int_t t=0;t<2;t++) // type: RP or POI\r
1758 { \r
1759 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
1760 {\r
1761 for(Int_t ci=0;ci<4;ci++) // correlation index\r
1762 {\r
1763 fDiffFlowDirectCorrelations[t][pe][ci] = NULL;\r
1764 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index \r
1765 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta\r
1766 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI\r
1767 // correction terms for non-uniform acceptance:\r
1768 for(Int_t t=0;t<2;t++) // type: RP or POI\r
1769 { \r
1770 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
1771 {\r
1772 for(Int_t sc=0;sc<2;sc++) // sin or cos terms\r
1773 {\r
1774 for(Int_t cti=0;cti<9;cti++) // correction term index\r
1775 {\r
1776 fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti] = NULL;\r
1777 } \r
1778 }\r
1779 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta\r
1780 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI\r
1781\r
1782\r
1783} // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForNestedLoops()\r
1784\r
1785\r
1786//================================================================================================================================\r
1787\r
1788\r
1789void AliFlowAnalysisWithQCumulants::BookEverythingForNestedLoops()\r
1790{\r
1791 // Book all objects relevant for calculations with nested loops.\r
1792 \r
1793 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)\r
1794 TString typeFlag[2] = {"RP","POI"}; // to be improved (should I promote this to data members?)\r
1795 TString ptEtaFlag[2] = {"p_{T}","#eta"}; // to be improved (should I promote this to data members?)\r
1796 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"}; // to be improved (should I promote this to data members?)\r
1797 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};\r
1798 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};\r
1799\r
1800 TString evaluateNestedLoopsName = "fEvaluateNestedLoops";\r
1801 evaluateNestedLoopsName += fAnalysisLabel->Data();\r
1802 fEvaluateNestedLoops = new TProfile(evaluateNestedLoopsName.Data(),"Flags for nested loops",4,0,4);\r
1803 fEvaluateNestedLoops->SetLabelSize(0.03);\r
1804 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(1,"fEvaluateIntFlowNestedLoops");\r
1805 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(2,"fEvaluateDiffFlowNestedLoops");\r
1806 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(3,"fCrossCheckInPtBinNo");\r
1807 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(4,"fCrossCheckInEtaBinNo");\r
1808 fEvaluateNestedLoops->Fill(0.5,(Int_t)fEvaluateIntFlowNestedLoops);\r
1809 fEvaluateNestedLoops->Fill(1.5,(Int_t)fEvaluateDiffFlowNestedLoops);\r
1810 fEvaluateNestedLoops->Fill(2.5,fCrossCheckInPtBinNo);\r
1811 fEvaluateNestedLoops->Fill(3.5,fCrossCheckInEtaBinNo);\r
1812 fNestedLoopsList->Add(fEvaluateNestedLoops);\r
1813 // nested loops for integrated flow:\r
1814 if(fEvaluateIntFlowNestedLoops)\r
1815 {\r
1816 // correlations:\r
1817 TString intFlowDirectCorrelationsName = "fIntFlowDirectCorrelations";\r
1818 intFlowDirectCorrelationsName += fAnalysisLabel->Data();\r
1819 fIntFlowDirectCorrelations = new TProfile(intFlowDirectCorrelationsName.Data(),"Multiparticle correlations calculated with nested loops (for int. flow)",32,0,32,"s");\r
1820 fNestedLoopsList->Add(fIntFlowDirectCorrelations);\r
1821 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)\r
1822 {\r
1823 TString intFlowExtraDirectCorrelationsName = "fIntFlowExtraDirectCorrelations";\r
1824 intFlowExtraDirectCorrelationsName += fAnalysisLabel->Data();\r
1825 fIntFlowExtraDirectCorrelations = new TProfile(intFlowExtraDirectCorrelationsName.Data(),"Extra multiparticle correlations calculated with nested loops (for int. flow)",100,0,100,"s");\r
1826 fNestedLoopsList->Add(fIntFlowExtraDirectCorrelations); \r
1827 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)\r
1828 // correction terms for non-uniform acceptance:\r
1829 for(Int_t sc=0;sc<2;sc++) // sin or cos terms\r
1830 {\r
1831 TString intFlowDirectCorrectionTermsForNUAName = "fIntFlowDirectCorrectionTermsForNUA";\r
1832 intFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();\r
1833 fIntFlowDirectCorrectionTermsForNUA[sc] = new TProfile(Form("%s: %s terms",intFlowDirectCorrectionTermsForNUAName.Data(),sinCosFlag[sc].Data()),Form("Correction terms for non-uniform acceptance (%s terms)",sinCosFlag[sc].Data()),10,0,10,"s");\r
1834 fNestedLoopsList->Add(fIntFlowDirectCorrectionTermsForNUA[sc]);\r
1835 } // end of for(Int_t sc=0;sc<2;sc++) \r
1836 } // end of if(fEvaluateIntFlowNestedLoops)\r
1837 \r
1838 // nested loops for differential flow: \r
1839 if(fEvaluateDiffFlowNestedLoops)\r
1840 {\r
1841 // reduced correlations:\r
1842 TString diffFlowDirectCorrelationsName = "fDiffFlowDirectCorrelations";\r
1843 diffFlowDirectCorrelationsName += fAnalysisLabel->Data();\r
1844 for(Int_t t=0;t<2;t++) // type: RP or POI\r
1845 { \r
1846 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
1847 {\r
1848 for(Int_t rci=0;rci<4;rci++) // reduced correlation index\r
1849 {\r
1850 // reduced correlations:\r
1851 fDiffFlowDirectCorrelations[t][pe][rci] = new TProfile(Form("%s, %s, %s, %s",diffFlowDirectCorrelationsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[rci].Data()),Form("%s, %s, %s, %s",diffFlowDirectCorrelationsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[rci].Data()),1,lowerPtEtaEdge[pe],upperPtEtaEdge[pe],"s");\r
1852 fDiffFlowDirectCorrelations[t][pe][rci]->SetXTitle(ptEtaFlag[pe].Data());\r
1853 fNestedLoopsList->Add(fDiffFlowDirectCorrelations[t][pe][rci]); // to be improved (add dedicated list to hold reduced correlations)\r
1854 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index\r
1855 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta \r
1856 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI \r
57340a27 1857 // correction terms for non-uniform acceptance:\r
1858 TString diffFlowDirectCorrectionTermsForNUAName = "fDiffFlowDirectCorrectionTermsForNUA";\r
1859 diffFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();\r
1860 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)\r
1861 { \r
1862 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
a5b7efd0 1863 {\r
57340a27 1864 for(Int_t sc=0;sc<2;sc++) // sin or cos\r
a5b7efd0 1865 {\r
57340a27 1866 for(Int_t cti=0;cti<9;cti++) // correction term index\r
1867 {\r
1868 fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti] = new TProfile(Form("%s, %s, %s, %s, cti = %d",diffFlowDirectCorrectionTermsForNUAName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),cti+1),Form("%s, %s, %s, %s, cti = %d",diffFlowDirectCorrectionTermsForNUAName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),cti+1),1,lowerPtEtaEdge[pe],upperPtEtaEdge[pe],"s"); \r
1869 fNestedLoopsList->Add(fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti]);\r
1870 }\r
a5b7efd0 1871 }\r
1872 }\r
57340a27 1873 } \r
1874 } // end of if(fEvaluateDiffFlowNestedLoops)\r
a5b7efd0 1875\r
1876} // end of AliFlowAnalysisWithQCumulants::BookEverythingForNestedLoops()\r
1877\r
1878\r
1879//================================================================================================================================\r
1880\r
1881\r
1882void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelations()\r
1883{\r
1884 // calculate all correlations needed for integrated flow\r
1885 \r
1886 // multiplicity:\r
1887 Double_t dMult = (*fSMpk)(0,0);\r
1888 \r
1889 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n: \r
1890 Double_t dReQ1n = (*fReQ)(0,0);\r
1891 Double_t dReQ2n = (*fReQ)(1,0);\r
1892 Double_t dReQ3n = (*fReQ)(2,0);\r
1893 Double_t dReQ4n = (*fReQ)(3,0);\r
1894 Double_t dImQ1n = (*fImQ)(0,0);\r
1895 Double_t dImQ2n = (*fImQ)(1,0);\r
1896 Double_t dImQ3n = (*fImQ)(2,0);\r
1897 Double_t dImQ4n = (*fImQ)(3,0);\r
1898 \r
1899 // real and imaginary parts of some expressions involving various combinations of Q-vectors evaluated in harmonics n, 2n, 3n and 4n:\r
1900 // (these expression appear in the Eqs. for the multi-particle correlations bellow)\r
1901 \r
1902 // Re[Q_{2n} Q_{n}^* Q_{n}^*]\r
1903 Double_t reQ2nQ1nstarQ1nstar = pow(dReQ1n,2.)*dReQ2n + 2.*dReQ1n*dImQ1n*dImQ2n - pow(dImQ1n,2.)*dReQ2n; \r
1904 \r
1905 // Im[Q_{2n} Q_{n}^* Q_{n}^*]\r
1906 //Double_t imQ2nQ1nstarQ1nstar = pow(dReQ1n,2.)*dImQ2n-2.*dReQ1n*dImQ1n*dReQ2n-pow(dImQ1n,2.)*dImQ2n; \r
1907 \r
1908 // Re[Q_{n} Q_{n} Q_{2n}^*] = Re[Q_{2n} Q_{n}^* Q_{n}^*]\r
1909 Double_t reQ1nQ1nQ2nstar = reQ2nQ1nstarQ1nstar; \r
1910 \r
1911 // Re[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]\r
1912 Double_t reQ3nQ1nQ2nstarQ2nstar = (pow(dReQ2n,2.)-pow(dImQ2n,2.))*(dReQ3n*dReQ1n-dImQ3n*dImQ1n) \r
1913 + 2.*dReQ2n*dImQ2n*(dReQ3n*dImQ1n+dImQ3n*dReQ1n);\r
1914\r
1915 // Im[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*] \r
1916 //Double_t imQ3nQ1nQ2nstarQ2nstar = calculate and implement this (deleteMe)\r
1917 \r
1918 // Re[Q_{2n} Q_{2n} Q_{3n}^* Q_{1n}^*] = Re[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]\r
1919 Double_t reQ2nQ2nQ3nstarQ1nstar = reQ3nQ1nQ2nstarQ2nstar;\r
1920 \r
1921 // Re[Q_{4n} Q_{2n}^* Q_{2n}^*]\r
1922 Double_t reQ4nQ2nstarQ2nstar = pow(dReQ2n,2.)*dReQ4n+2.*dReQ2n*dImQ2n*dImQ4n-pow(dImQ2n,2.)*dReQ4n;\r
1923\r
1924 // Im[Q_{4n} Q_{2n}^* Q_{2n}^*]\r
1925 //Double_t imQ4nQ2nstarQ2nstar = calculate and implement this (deleteMe)\r
1926 \r
1927 // Re[Q_{2n} Q_{2n} Q_{4n}^*] = Re[Q_{4n} Q_{2n}^* Q_{2n}^*]\r
1928 Double_t reQ2nQ2nQ4nstar = reQ4nQ2nstarQ2nstar;\r
1929 \r
1930 // Re[Q_{4n} Q_{3n}^* Q_{n}^*]\r
1931 Double_t reQ4nQ3nstarQ1nstar = dReQ4n*(dReQ3n*dReQ1n-dImQ3n*dImQ1n)+dImQ4n*(dReQ3n*dImQ1n+dImQ3n*dReQ1n);\r
1932 \r
1933 // Re[Q_{3n} Q_{n} Q_{4n}^*] = Re[Q_{4n} Q_{3n}^* Q_{n}^*]\r
1934 Double_t reQ3nQ1nQ4nstar = reQ4nQ3nstarQ1nstar;\r
1935 \r
1936 // Im[Q_{4n} Q_{3n}^* Q_{n}^*]\r
1937 //Double_t imQ4nQ3nstarQ1nstar = calculate and implement this (deleteMe)\r
1938\r
1939 // Re[Q_{3n} Q_{2n}^* Q_{n}^*]\r
1940 Double_t reQ3nQ2nstarQ1nstar = dReQ3n*dReQ2n*dReQ1n-dReQ3n*dImQ2n*dImQ1n+dImQ3n*dReQ2n*dImQ1n\r
1941 + dImQ3n*dImQ2n*dReQ1n;\r
1942 \r
1943 // Re[Q_{2n} Q_{n} Q_{3n}^*] = Re[Q_{3n} Q_{2n}^* Q_{n}^*]\r
1944 Double_t reQ2nQ1nQ3nstar = reQ3nQ2nstarQ1nstar;\r
1945 \r
1946 // Im[Q_{3n} Q_{2n}^* Q_{n}^*]\r
1947 //Double_t imQ3nQ2nstarQ1nstar; //calculate and implement this (deleteMe)\r
1948 \r
1949 // Re[Q_{3n} Q_{n}^* Q_{n}^* Q_{n}^*]\r
1950 Double_t reQ3nQ1nstarQ1nstarQ1nstar = dReQ3n*pow(dReQ1n,3)-3.*dReQ1n*dReQ3n*pow(dImQ1n,2)\r
1951 + 3.*dImQ1n*dImQ3n*pow(dReQ1n,2)-dImQ3n*pow(dImQ1n,3);\r
1952\r
1953 // Im[Q_{3n} Q_{n}^* Q_{n}^* Q_{n}^*]\r
1954 //Double_t imQ3nQ1nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)\r
1955 \r
1956 // |Q_{2n}|^2 |Q_{n}|^2\r
1957 Double_t dQ2nQ1nQ2nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.));\r
1958 \r
1959 // Re[Q_{4n} Q_{2n}^* Q_{n}^* Q_{n}^*]\r
1960 Double_t reQ4nQ2nstarQ1nstarQ1nstar = (dReQ4n*dReQ2n+dImQ4n*dImQ2n)*(pow(dReQ1n,2)-pow(dImQ1n,2))\r
1961 + 2.*dReQ1n*dImQ1n*(dImQ4n*dReQ2n-dReQ4n*dImQ2n); \r
1962 \r
1963 // Im[Q_{4n} Q_{2n}^* Q_{n}^* Q_{n}^*]\r
1964 //Double_t imQ4nQ2nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)\r
1965 \r
1966 // Re[Q_{2n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^*]\r
1967 Double_t reQ2nQ1nQ1nstarQ1nstarQ1nstar = (dReQ2n*dReQ1n-dImQ2n*dImQ1n)*(pow(dReQ1n,3)-3.*dReQ1n*pow(dImQ1n,2))\r
1968 + (dReQ2n*dImQ1n+dReQ1n*dImQ2n)*(3.*dImQ1n*pow(dReQ1n,2)-pow(dImQ1n,3));\r
1969\r
1970 // Im[Q_{2n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^*] \r
1971 //Double_t imQ2nQ1nQ1nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)\r
1972 \r
1973 // Re[Q_{2n} Q_{2n} Q_{2n}^* Q_{n}^* Q_{n}^*]\r
1974 Double_t reQ2nQ2nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))\r
1975 * (dReQ2n*(pow(dReQ1n,2.)-pow(dImQ1n,2.)) + 2.*dImQ2n*dReQ1n*dImQ1n);\r
1976\r
1977 // Im[Q_{2n} Q_{2n} Q_{2n}^* Q_{n}^* Q_{n}^*]\r
1978 //Double_t imQ2nQ2nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))\r
1979 // * (dImQ2n*(pow(dReQ1n,2.)-pow(dImQ1n,2.)) - 2.*dReQ2n*dReQ1n*dImQ1n);\r
1980 \r
1981 // Re[Q_{4n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]\r
1982 Double_t reQ4nQ1nstarQ1nstarQ1nstarQ1nstar = pow(dReQ1n,4.)*dReQ4n-6.*pow(dReQ1n,2.)*dReQ4n*pow(dImQ1n,2.)\r
1983 + pow(dImQ1n,4.)*dReQ4n+4.*pow(dReQ1n,3.)*dImQ1n*dImQ4n\r
1984 - 4.*pow(dImQ1n,3.)*dReQ1n*dImQ4n;\r
1985 \r
1986 // Im[Q_{4n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]\r
1987 //Double_t imQ4nQ1nstarQ1nstarQ1nstarQ1nstar = pow(dReQ1n,4.)*dImQ4n-6.*pow(dReQ1n,2.)*dImQ4n*pow(dImQ1n,2.)\r
1988 // + pow(dImQ1n,4.)*dImQ4n+4.*pow(dImQ1n,3.)*dReQ1n*dReQ4n\r
1989 // - 4.*pow(dReQ1n,3.)*dImQ1n*dReQ4n;\r
1990 \r
1991 // Re[Q_{3n} Q_{n} Q_{2n}^* Q_{n}^* Q_{n}^*]\r
1992 Double_t reQ3nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))\r
1993 * (dReQ1n*dReQ2n*dReQ3n-dReQ3n*dImQ1n*dImQ2n+dReQ2n*dImQ1n*dImQ3n+dReQ1n*dImQ2n*dImQ3n);\r
1994 \r
1995 // Im[Q_{3n} Q_{n} Q_{2n}^* Q_{n}^* Q_{n}^*]\r
1996 //Double_t imQ3nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))\r
1997 // * (-dReQ2n*dReQ3n*dImQ1n-dReQ1n*dReQ3n*dImQ2n+dReQ1n*dReQ2n*dImQ3n-dImQ1n*dImQ2n*dImQ3n);\r
1998 \r
1999 \r
2000 // Re[Q_{2n} Q_{2n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]\r
2001 Double_t reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)*dReQ2n-2.*dReQ1n*dReQ2n*dImQ1n-dReQ2n*pow(dImQ1n,2.)\r
2002 + dImQ2n*pow(dReQ1n,2.)+2.*dReQ1n*dImQ1n*dImQ2n-pow(dImQ1n,2.)*dImQ2n)\r
2003 * (pow(dReQ1n,2.)*dReQ2n+2.*dReQ1n*dReQ2n*dImQ1n-dReQ2n*pow(dImQ1n,2.)\r
2004 - dImQ2n*pow(dReQ1n,2.)+2.*dReQ1n*dImQ1n*dImQ2n+pow(dImQ1n,2.)*dImQ2n);\r
2005 \r
2006 // Im[Q_{2n} Q_{2n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]\r
2007 //Double_t imQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar = 2.*(pow(dReQ1n,2.)*dReQ2n-dReQ2n*pow(dImQ1n,2.)\r
2008 // + 2.*dReQ1n*dImQ1n*dImQ2n)*(pow(dReQ1n,2.)*dImQ2n\r
2009 // - 2.*dReQ1n*dImQ1n*dReQ2n-pow(dImQ1n,2.)*dImQ2n);\r
2010 \r
2011 // Re[Q_{3n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]\r
2012 Double_t reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))\r
2013 * (pow(dReQ1n,3.)*dReQ3n-3.*dReQ1n*dReQ3n*pow(dImQ1n,2.)\r
2014 + 3.*pow(dReQ1n,2.)*dImQ1n*dImQ3n-pow(dImQ1n,3.)*dImQ3n);\r
2015 \r
2016 // Im[Q_{3n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*] \r
2017 //Double_t imQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))\r
2018 // * (pow(dImQ1n,3.)*dReQ3n-3.*dImQ1n*dReQ3n*pow(dReQ1n,2.)\r
2019 // - 3.*pow(dImQ1n,2.)*dReQ1n*dImQ3n+pow(dReQ1n,3.)*dImQ3n);\r
2020 \r
2021 // |Q_{2n}|^2 |Q_{n}|^4\r
2022 Double_t dQ2nQ1nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))*pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.);\r
2023 \r
2024 // Re[Q_{2n} Q_{n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]\r
2025 Double_t reQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)\r
2026 * (pow(dReQ1n,2.)*dReQ2n-dReQ2n*pow(dImQ1n,2.)\r
2027 + 2.*dReQ1n*dImQ1n*dImQ2n);\r
2028 \r
2029 // Im[Q_{2n} Q_{n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*] \r
2030 //Double_t imQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)\r
2031 // * (pow(dReQ1n,2.)*dImQ2n-dImQ2n*pow(dImQ1n,2.)\r
2032 // - 2.*dReQ1n*dReQ2n*dImQ1n);\r
2033 \r
2034 \r
2035 \r
2036 \r
2037 // **************************************\r
2038 // **** multi-particle correlations: ****\r
2039 // **************************************\r
2040 //\r
2041 // Remark 1: multi-particle correlations calculated with non-weighted Q-vectors are stored in 1D profile fQCorrelations[0]. // to be improved (wrong profiles)\r
2042 // Remark 2: binning of fQCorrelations[0] is organized as follows: // to be improved (wrong profiles)\r
2043 // --------------------------------------------------------------------------------------------------------------------\r
2044 // 1st bin: <2>_{1n|1n} = two1n1n = cos(n*(phi1-phi2))>\r
2045 // 2nd bin: <2>_{2n|2n} = two2n2n = cos(2n*(phi1-phi2))>\r
2046 // 3rd bin: <2>_{3n|3n} = two3n3n = cos(3n*(phi1-phi2))> \r
2047 // 4th bin: <2>_{4n|4n} = two4n4n = cos(4n*(phi1-phi2))>\r
2048 // 5th bin: ---- EMPTY ----\r
2049 // 6th bin: <3>_{2n|1n,1n} = three2n1n1n = <cos(n*(2.*phi1-phi2-phi3))>\r
2050 // 7th bin: <3>_{3n|2n,1n} = three3n2n1n = <cos(n*(3.*phi1-2.*phi2-phi3))>\r
2051 // 8th bin: <3>_{4n|2n,2n} = three4n2n2n = <cos(n*(4.*phi1-2.*phi2-2.*phi3))>\r
2052 // 9th bin: <3>_{4n|3n,1n} = three4n3n1n = <cos(n*(4.*phi1-3.*phi2-phi3))>\r
2053 // 10th bin: ---- EMPTY ----\r
2054 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1n = <cos(n*(phi1+phi2-phi3-phi4))>\r
2055 // 12th bin: <4>_{2n,1n|2n,1n} = four2n1n2n1n = <cos(2.*n*(phi1+phi2-phi3-phi4))>\r
2056 // 13th bin: <4>_{2n,2n|2n,2n} = four2n2n2n2n = <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>\r
2057 // 14th bin: <4>_{3n|1n,1n,1n} = four3n1n1n1n = <cos(n*(3.*phi1-phi2-phi3-phi4))> \r
2058 // 15th bin: <4>_{3n,1n|3n,1n} = four3n1n3n1n = <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>\r
2059 // 16th bin: <4>_{3n,1n|2n,2n} = four3n1n2n2n = <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>\r
2060 // 17th bin: <4>_{4n|2n,1n,1n} = four4n2n1n1n = <cos(n*(3.*phi1+phi2-3.*phi3-phi4))> \r
2061 // 18th bin: ---- EMPTY ----\r
2062 // 19th bin: <5>_{2n|1n,1n,1n,1n} = five2n1n1n1n1n = <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>\r
2063 // 20th bin: <5>_{2n,2n|2n,1n,1n} = five2n2n2n1n1n = <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>\r
2064 // 21st bin: <5>_{3n,1n|2n,1n,1n} = five3n1n2n1n1n = <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>\r
2065 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = five4n1n1n1n1n = <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>\r
2066 // 23rd bin: ---- EMPTY ----\r
2067 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = six1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>\r
2068 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = six2n1n1n2n1n1n = <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>\r
2069 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = six2n2n1n1n1n1n = <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>\r
2070 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = six3n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>\r
2071 // 28th bin: ---- EMPTY ----\r
2072 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = seven2n1n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>\r
2073 // 30th bin: ---- EMPTY ----\r
2074 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = eight1n1n1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>\r
2075 // --------------------------------------------------------------------------------------------------------------------\r
2076 \r
2077 // 2-particle:\r
2078 Double_t two1n1n = 0.; // <cos(n*(phi1-phi2))>\r
2079 Double_t two2n2n = 0.; // <cos(2n*(phi1-phi2))>\r
2080 Double_t two3n3n = 0.; // <cos(3n*(phi1-phi2))>\r
2081 Double_t two4n4n = 0.; // <cos(4n*(phi1-phi2))>\r
2082 \r
2083 if(dMult>1)\r
2084 {\r
2085 two1n1n = (pow(dReQ1n,2.)+pow(dImQ1n,2.)-dMult)/(dMult*(dMult-1.)); \r
2086 two2n2n = (pow(dReQ2n,2.)+pow(dImQ2n,2.)-dMult)/(dMult*(dMult-1.)); \r
2087 two3n3n = (pow(dReQ3n,2.)+pow(dImQ3n,2.)-dMult)/(dMult*(dMult-1.)); \r
2088 two4n4n = (pow(dReQ4n,2.)+pow(dImQ4n,2.)-dMult)/(dMult*(dMult-1.)); \r
2089 \r
2090 // average 2-particle correlations for single event: \r
2091 fIntFlowCorrelationsAllEBE->SetBinContent(1,two1n1n);\r
2092 fIntFlowCorrelationsAllEBE->SetBinContent(2,two2n2n);\r
2093 fIntFlowCorrelationsAllEBE->SetBinContent(3,two3n3n);\r
2094 fIntFlowCorrelationsAllEBE->SetBinContent(4,two4n4n);\r
2095 \r
2096 // average 2-particle correlations for all events: \r
2097 fIntFlowCorrelationsAllPro->Fill(0.5,two1n1n,dMult*(dMult-1.)); \r
2098 fIntFlowCorrelationsAllPro->Fill(1.5,two2n2n,dMult*(dMult-1.)); \r
2099 fIntFlowCorrelationsAllPro->Fill(2.5,two3n3n,dMult*(dMult-1.)); \r
2100 fIntFlowCorrelationsAllPro->Fill(3.5,two4n4n,dMult*(dMult-1.)); \r
2101 \r
2102 // store separetately <2> (to be improved: do I really need this?)\r
2103 fIntFlowCorrelationsEBE->SetBinContent(1,two1n1n); // <2>\r
2104 \r
2105 // to be improved (this can be implemented better):\r
2106 Double_t mWeight2p = 0.;\r
2107 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))\r
2108 {\r
2109 mWeight2p = dMult*(dMult-1.);\r
2110 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))\r
2111 {\r
2112 mWeight2p = 1.; \r
2113 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))\r
2114 {\r
2115 mWeight2p = dMult; \r
2116 }\r
2117 \r
2118 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(1,mWeight2p); // eW_<2>\r
2119 fIntFlowCorrelationsPro->Fill(0.5,two1n1n,mWeight2p);\r
2120 \r
2121 // distribution of <cos(n*(phi1-phi2))>:\r
2122 //f2pDistribution->Fill(two1n1n,dMult*(dMult-1.)); \r
2123 } // end of if(dMult>1)\r
2124 \r
2125 // 3-particle:\r
2126 Double_t three2n1n1n = 0.; // <cos(n*(2.*phi1-phi2-phi3))>\r
2127 Double_t three3n2n1n = 0.; // <cos(n*(3.*phi1-2.*phi2-phi3))>\r
2128 Double_t three4n2n2n = 0.; // <cos(n*(4.*phi1-2.*phi2-2.*phi3))>\r
2129 Double_t three4n3n1n = 0.; // <cos(n*(4.*phi1-3.*phi2-phi3))>\r
2130 \r
2131 if(dMult>2)\r
2132 {\r
2133 three2n1n1n = (reQ2nQ1nstarQ1nstar-2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))\r
2134 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))+2.*dMult)\r
2135 / (dMult*(dMult-1.)*(dMult-2.)); \r
2136 three3n2n1n = (reQ3nQ2nstarQ1nstar-(pow(dReQ3n,2.)+pow(dImQ3n,2.))\r
2137 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))\r
2138 - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)\r
2139 / (dMult*(dMult-1.)*(dMult-2.));\r
2140 three4n2n2n = (reQ4nQ2nstarQ2nstar-2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))\r
2141 - (pow(dReQ4n,2.)+pow(dImQ4n,2.))+2.*dMult)\r
2142 / (dMult*(dMult-1.)*(dMult-2.)); \r
2143 three4n3n1n = (reQ4nQ3nstarQ1nstar-(pow(dReQ4n,2.)+pow(dImQ4n,2.))\r
2144 - (pow(dReQ3n,2.)+pow(dImQ3n,2.))\r
2145 - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)\r
2146 / (dMult*(dMult-1.)*(dMult-2.)); \r
2147 \r
2148 // average 3-particle correlations for single event: \r
2149 fIntFlowCorrelationsAllEBE->SetBinContent(6,three2n1n1n);\r
2150 fIntFlowCorrelationsAllEBE->SetBinContent(7,three3n2n1n);\r
2151 fIntFlowCorrelationsAllEBE->SetBinContent(8,three4n2n2n);\r
2152 fIntFlowCorrelationsAllEBE->SetBinContent(9,three4n3n1n);\r
2153 \r
2154 // average 3-particle correlations for all events: \r
2155 fIntFlowCorrelationsAllPro->Fill(5.5,three2n1n1n,dMult*(dMult-1.)*(dMult-2.)); \r
2156 fIntFlowCorrelationsAllPro->Fill(6.5,three3n2n1n,dMult*(dMult-1.)*(dMult-2.));\r
2157 fIntFlowCorrelationsAllPro->Fill(7.5,three4n2n2n,dMult*(dMult-1.)*(dMult-2.)); \r
2158 fIntFlowCorrelationsAllPro->Fill(8.5,three4n3n1n,dMult*(dMult-1.)*(dMult-2.)); \r
2159 } // end of if(dMult>2)\r
2160 \r
2161 // 4-particle:\r
2162 Double_t four1n1n1n1n = 0.; // <cos(n*(phi1+phi2-phi3-phi4))>\r
2163 Double_t four2n2n2n2n = 0.; // <cos(2.*n*(phi1+phi2-phi3-phi4))>\r
2164 Double_t four2n1n2n1n = 0.; // <cos(n*(2.*phi1+phi2-2.*phi3-phi4))> \r
2165 Double_t four3n1n1n1n = 0.; // <cos(n*(3.*phi1-phi2-phi3-phi4))> \r
2166 Double_t four4n2n1n1n = 0.; // <cos(n*(4.*phi1-2.*phi2-phi3-phi4))> \r
2167 Double_t four3n1n2n2n = 0.; // <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))> \r
2168 Double_t four3n1n3n1n = 0.; // <cos(n*(3.*phi1+phi2-3.*phi3-phi4))> \r
2169 \r
2170 if(dMult>3)\r
2171 {\r
2172 four1n1n1n1n = (2.*dMult*(dMult-3.)+pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)-4.*(dMult-2.)*(pow(dReQ1n,2.)\r
2173 + pow(dImQ1n,2.))-2.*reQ2nQ1nstarQ1nstar+(pow(dReQ2n,2.)+pow(dImQ2n,2.)))\r
2174 / (dMult*(dMult-1)*(dMult-2.)*(dMult-3.)); \r
2175 four2n2n2n2n = (2.*dMult*(dMult-3.)+pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)-4.*(dMult-2.)*(pow(dReQ2n,2.)\r
2176 + pow(dImQ2n,2.))-2.*reQ4nQ2nstarQ2nstar+(pow(dReQ4n,2.)+pow(dImQ4n,2.)))\r
2177 / (dMult*(dMult-1)*(dMult-2.)*(dMult-3.));\r
2178 four2n1n2n1n = (dQ2nQ1nQ2nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar-2.*reQ2nQ1nstarQ1nstar)\r
2179 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))\r
2180 - ((dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))\r
2181 + (dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-(pow(dReQ3n,2.)+pow(dImQ3n,2.)))\r
2182 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))\r
2183 + (dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.));\r
2184 four3n1n1n1n = (reQ3nQ1nstarQ1nstarQ1nstar-3.*reQ3nQ2nstarQ1nstar-3.*reQ2nQ1nstarQ1nstar)\r
2185 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))\r
2186 + (2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+3.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))\r
2187 + 6.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-6.*dMult)\r
2188 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));\r
2189 four4n2n1n1n = (reQ4nQ2nstarQ1nstarQ1nstar-2.*reQ4nQ3nstarQ1nstar-reQ4nQ2nstarQ2nstar-2.*reQ3nQ2nstarQ1nstar)\r
2190 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))\r
2191 - (reQ2nQ1nstarQ1nstar-2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))\r
2192 - 3.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))\r
2193 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))\r
2194 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));\r
2195 four3n1n2n2n = (reQ3nQ1nQ2nstarQ2nstar-reQ4nQ2nstarQ2nstar-reQ3nQ1nQ4nstar-2.*reQ3nQ2nstarQ1nstar)\r
2196 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))\r
2197 - (2.*reQ1nQ1nQ2nstar-(pow(dReQ4n,2.)+pow(dImQ4n,2.))-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))\r
2198 - 4.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))\r
2199 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))\r
2200 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.)); \r
2201 four3n1n3n1n = ((pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))\r
2202 - 2.*reQ4nQ3nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar)\r
2203 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))\r
2204 + ((pow(dReQ4n,2.)+pow(dImQ4n,2.))-(dMult-4.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))\r
2205 + (pow(dReQ2n,2.)+pow(dImQ2n,2.))-(dMult-4.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))\r
2206 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))\r
2207 + (dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.));\r
2208 \r
2209 // average 4-particle correlations for single event: \r
2210 fIntFlowCorrelationsAllEBE->SetBinContent(11,four1n1n1n1n);\r
2211 fIntFlowCorrelationsAllEBE->SetBinContent(12,four2n1n2n1n);\r
2212 fIntFlowCorrelationsAllEBE->SetBinContent(13,four2n2n2n2n);\r
2213 fIntFlowCorrelationsAllEBE->SetBinContent(14,four3n1n1n1n);\r
2214 fIntFlowCorrelationsAllEBE->SetBinContent(15,four3n1n3n1n);\r
2215 fIntFlowCorrelationsAllEBE->SetBinContent(16,four3n1n2n2n);\r
2216 fIntFlowCorrelationsAllEBE->SetBinContent(17,four4n2n1n1n);\r
2217 \r
2218 // average 4-particle correlations for all events: \r
2219 fIntFlowCorrelationsAllPro->Fill(10.5,four1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));\r
2220 fIntFlowCorrelationsAllPro->Fill(11.5,four2n1n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));\r
2221 fIntFlowCorrelationsAllPro->Fill(12.5,four2n2n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));\r
2222 fIntFlowCorrelationsAllPro->Fill(13.5,four3n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));\r
2223 fIntFlowCorrelationsAllPro->Fill(14.5,four3n1n3n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));\r
2224 fIntFlowCorrelationsAllPro->Fill(15.5,four3n1n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)); \r
2225 fIntFlowCorrelationsAllPro->Fill(16.5,four4n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)); \r
2226 \r
2227 // store separetately <4> (to be improved: do I really need this?)\r
2228 fIntFlowCorrelationsEBE->SetBinContent(2,four1n1n1n1n); // <4>\r
2229 \r
2230 // to be improved (this can be implemented better):\r
2231 Double_t mWeight4p = 0.;\r
2232 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))\r
2233 {\r
2234 mWeight4p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.);\r
2235 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))\r
2236 {\r
2237 mWeight4p = 1.; \r
2238 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))\r
2239 {\r
2240 mWeight4p = dMult; \r
2241 }\r
2242 \r
2243 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(2,mWeight4p); // eW_<4>\r
2244 fIntFlowCorrelationsPro->Fill(1.5,four1n1n1n1n,mWeight4p);\r
2245 \r
2246 // distribution of <cos(n*(phi1+phi2-phi3-phi4))>\r
2247 //f4pDistribution->Fill(four1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));\r
2248 \r
2249 } // end of if(dMult>3)\r
2250\r
2251 // 5-particle:\r
2252 Double_t five2n1n1n1n1n = 0.; // <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>\r
2253 Double_t five2n2n2n1n1n = 0.; // <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>\r
2254 Double_t five3n1n2n1n1n = 0.; // <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>\r
2255 Double_t five4n1n1n1n1n = 0.; // <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>\r
2256 \r
2257 if(dMult>4)\r
2258 {\r
2259 five2n1n1n1n1n = (reQ2nQ1nQ1nstarQ1nstarQ1nstar-reQ3nQ1nstarQ1nstarQ1nstar+6.*reQ3nQ2nstarQ1nstar)\r
2260 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
2261 - (reQ2nQ1nQ3nstar+3.*(dMult-6.)*reQ2nQ1nstarQ1nstar+3.*reQ1nQ1nQ2nstar)\r
2262 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
2263 - (2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))\r
2264 + 3.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.)) \r
2265 - 3.*(dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.)))\r
2266 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
2267 - 3.*(pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)\r
2268 - 2.*(2*dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult*(dMult-4.))\r
2269 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));\r
2270 \r
2271 five2n2n2n1n1n = (reQ2nQ2nQ2nstarQ1nstarQ1nstar-reQ4nQ2nstarQ1nstarQ1nstar-2.*reQ2nQ2nQ3nstarQ1nstar)\r
2272 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
2273 + 2.*(reQ4nQ2nstarQ2nstar+4.*reQ3nQ2nstarQ1nstar+reQ3nQ1nQ4nstar)\r
2274 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
2275 + (reQ2nQ2nQ4nstar-2.*(dMult-5.)*reQ2nQ1nstarQ1nstar+2.*reQ1nQ1nQ2nstar)\r
2276 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
2277 - (2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+4.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))\r
2278 + 1.*pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)\r
2279 - 2.*(3.*dMult-10.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.)))\r
2280 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
2281 - (4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))\r
2282 - 4.*(dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))+4.*dMult*(dMult-6.))\r
2283 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)); \r
2284\r
2285 five4n1n1n1n1n = (reQ4nQ1nstarQ1nstarQ1nstarQ1nstar-6.*reQ4nQ2nstarQ1nstarQ1nstar-4.*reQ3nQ1nstarQ1nstarQ1nstar)\r
2286 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
2287 + (8.*reQ4nQ3nstarQ1nstar+3.*reQ4nQ2nstarQ2nstar+12.*reQ3nQ2nstarQ1nstar+12.*reQ2nQ1nstarQ1nstar)\r
2288 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
2289 - (6.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+8.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))\r
2290 + 12.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))+24.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-24.*dMult)\r
2291 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));\r
2292 \r
2293 five3n1n2n1n1n = (reQ3nQ1nQ2nstarQ1nstarQ1nstar-reQ4nQ2nstarQ1nstarQ1nstar-reQ3nQ1nstarQ1nstarQ1nstar)\r
2294 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
2295 - (reQ3nQ1nQ2nstarQ2nstar-3.*reQ4nQ3nstarQ1nstar-reQ4nQ2nstarQ2nstar)\r
2296 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
2297 - ((2.*dMult-13.)*reQ3nQ2nstarQ1nstar-reQ3nQ1nQ4nstar-9.*reQ2nQ1nstarQ1nstar)\r
2298 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
2299 - (2.*reQ1nQ1nQ2nstar+2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))\r
2300 - 2.*(dMult-5.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+2.*(pow(dReQ3n,2.)\r
2301 + pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))\r
2302 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
2303 + (2.*(dMult-6.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))\r
2304 - 2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))\r
2305 - pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)\r
2306 + 2.*(3.*dMult-11.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))\r
2307 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
2308 - 4.*(dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));\r
2309 \r
2310 // average 5-particle correlations for single event: \r
2311 fIntFlowCorrelationsAllEBE->SetBinContent(19,five2n1n1n1n1n);\r
2312 fIntFlowCorrelationsAllEBE->SetBinContent(20,five2n2n2n1n1n);\r
2313 fIntFlowCorrelationsAllEBE->SetBinContent(21,five3n1n2n1n1n);\r
2314 fIntFlowCorrelationsAllEBE->SetBinContent(22,five4n1n1n1n1n);\r
2315 \r
2316 // average 5-particle correlations for all events: \r
2317 fIntFlowCorrelationsAllPro->Fill(18.5,five2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)); \r
2318 fIntFlowCorrelationsAllPro->Fill(19.5,five2n2n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));\r
2319 fIntFlowCorrelationsAllPro->Fill(20.5,five3n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));\r
2320 fIntFlowCorrelationsAllPro->Fill(21.5,five4n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));\r
2321 } // end of if(dMult>4)\r
2322 \r
2323 // 6-particle:\r
2324 Double_t six1n1n1n1n1n1n = 0.; // <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>\r
2325 Double_t six2n2n1n1n1n1n = 0.; // <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>\r
2326 Double_t six3n1n1n1n1n1n = 0.; // <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>\r
2327 Double_t six2n1n1n2n1n1n = 0.; // <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>\r
2328 \r
2329 if(dMult>5)\r
2330 {\r
2331 six1n1n1n1n1n1n = (pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),3.)+9.*dQ2nQ1nQ2nstarQ1nstar-6.*reQ2nQ1nQ1nstarQ1nstarQ1nstar)\r
2332 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))\r
2333 + 4.*(reQ3nQ1nstarQ1nstarQ1nstar-3.*reQ3nQ2nstarQ1nstar)\r
2334 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))\r
2335 + 2.*(9.*(dMult-4.)*reQ2nQ1nstarQ1nstar+2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.)))\r
2336 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))\r
2337 - 9.*(pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)+(pow(dReQ2n,2.)+pow(dImQ2n,2.)))\r
2338 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-5.))\r
2339 + (18.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))\r
2340 / (dMult*(dMult-1)*(dMult-3)*(dMult-4))\r
2341 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));\r
2342 \r
2343 six2n1n1n2n1n1n = (dQ2nQ1nQ1nQ2nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)\r
2344 * (2.*five2n2n2n1n1n+4.*five2n1n1n1n1n+4.*five3n1n2n1n1n+4.*four2n1n2n1n+1.*four1n1n1n1n)\r
2345 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four1n1n1n1n+4.*two1n1n\r
2346 + 2.*three2n1n1n+2.*three2n1n1n+4.*four3n1n1n1n+8.*three2n1n1n+2.*four4n2n1n1n\r
2347 + 4.*four2n1n2n1n+2.*two2n2n+8.*four2n1n2n1n+4.*four3n1n3n1n+8.*three3n2n1n\r
2348 + 4.*four3n1n2n2n+4.*four1n1n1n1n+4.*four2n1n2n1n+1.*four2n2n2n2n)\r
2349 - dMult*(dMult-1.)*(dMult-2.)*(2.*three2n1n1n+8.*two1n1n+4.*two1n1n+2.\r
2350 + 4.*two1n1n+4.*three2n1n1n+2.*two2n2n+4.*three2n1n1n+8.*three3n2n1n\r
2351 + 8.*two2n2n+4.*three4n3n1n+4.*two3n3n+4.*three3n2n1n+4.*two1n1n\r
2352 + 8.*three2n1n1n+4.*two1n1n+4.*three3n2n1n+4.*three2n1n1n+2.*two2n2n\r
2353 + 4.*three3n2n1n+2.*three4n2n2n)-dMult*(dMult-1.)\r
2354 * (4.*two1n1n+4.+4.*two1n1n+2.*two2n2n+1.+4.*two1n1n+4.*two2n2n+4.*two3n3n\r
2355 + 1.+2.*two2n2n+1.*two4n4n)-dMult)\r
2356 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)\r
2357 \r
2358 six2n2n1n1n1n1n = (reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)\r
2359 * (five4n1n1n1n1n+8.*five2n1n1n1n1n+6.*five2n2n2n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)\r
2360 * (4.*four3n1n1n1n+6.*four4n2n1n1n+12.*three2n1n1n+12.*four1n1n1n1n+24.*four2n1n2n1n\r
2361 + 4.*four3n1n2n2n+3.*four2n2n2n2n)-dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+12.*three3n2n1n\r
2362 + 4.*three4n3n1n+3.*three4n2n2n+8.*three2n1n1n+24.*two1n1n+12.*two2n2n+12.*three2n1n1n+8.*three3n2n1n\r
2363 + 1.*three4n2n2n)-dMult*(dMult-1.)*(4.*two1n1n+6.*two2n2n+4.*two3n3n+1.*two4n4n+2.*two2n2n+8.*two1n1n+6.)-dMult)\r
2364 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)\r
2365 \r
2366 six3n1n1n1n1n1n = (reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)\r
2367 * (five4n1n1n1n1n+4.*five2n1n1n1n1n+6.*five3n1n2n1n1n+4.*four3n1n1n1n)\r
2368 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four3n1n1n1n+6.*four4n2n1n1n+6.*four1n1n1n1n\r
2369 + 12.*three2n1n1n+12.*four2n1n2n1n+6.*four3n1n1n1n+12.*three3n2n1n+4.*four3n1n3n1n+3.*four3n1n2n2n)\r
2370 - dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+12.*three3n2n1n+4.*three4n3n1n+3.*three4n2n2n+4.*two1n1n\r
2371 + 12.*two1n1n+6.*three2n1n1n+12.*three2n1n1n+4.*three3n2n1n+12.*two2n2n+4.*three3n2n1n+4.*two3n3n+1.*three4n3n1n\r
2372 + 6.*three3n2n1n)-dMult*(dMult-1.)*(4.*two1n1n+6.*two2n2n+4.*two3n3n+1.*two4n4n+1.*two1n1n+4.+6.*two1n1n+4.*two2n2n\r
2373 + 1.*two3n3n)-dMult)/(dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)\r
2374 \r
2375 // average 6-particle correlations for single event: \r
2376 fIntFlowCorrelationsAllEBE->SetBinContent(24,six1n1n1n1n1n1n);\r
2377 fIntFlowCorrelationsAllEBE->SetBinContent(25,six2n1n1n2n1n1n);\r
2378 fIntFlowCorrelationsAllEBE->SetBinContent(26,six2n2n1n1n1n1n);\r
2379 fIntFlowCorrelationsAllEBE->SetBinContent(27,six3n1n1n1n1n1n);\r
2380 \r
2381 // average 6-particle correlations for all events: \r
2382 fIntFlowCorrelationsAllPro->Fill(23.5,six1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); \r
2383 fIntFlowCorrelationsAllPro->Fill(24.5,six2n1n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); \r
2384 fIntFlowCorrelationsAllPro->Fill(25.5,six2n2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));\r
2385 fIntFlowCorrelationsAllPro->Fill(26.5,six3n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); \r
2386\r
2387 // store separetately <6> (to be improved: do I really need this?)\r
2388 fIntFlowCorrelationsEBE->SetBinContent(3,six1n1n1n1n1n1n); // <6>\r
2389 \r
2390 // to be improved (this can be implemented better):\r
2391 Double_t mWeight6p = 0.;\r
2392 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))\r
2393 {\r
2394 mWeight6p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.);\r
2395 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))\r
2396 {\r
2397 mWeight6p = 1.; \r
2398 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))\r
2399 {\r
2400 mWeight6p = dMult; \r
2401 }\r
2402 \r
2403 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(3,mWeight6p); // eW_<6>\r
2404 fIntFlowCorrelationsPro->Fill(2.5,six1n1n1n1n1n1n,mWeight6p);\r
2405 \r
2406 // distribution of <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>\r
2407 //f6pDistribution->Fill(six1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); \r
2408 } // end of if(dMult>5)\r
2409 \r
2410 // 7-particle:\r
2411 Double_t seven2n1n1n1n1n1n1n = 0.; // <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>\r
2412 \r
2413 if(dMult>6)\r
2414 {\r
2415 seven2n1n1n1n1n1n1n = (reQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)\r
2416 * (2.*six3n1n1n1n1n1n+4.*six1n1n1n1n1n1n+1.*six2n2n1n1n1n1n+6.*six2n1n1n2n1n1n+8.*five2n1n1n1n1n)\r
2417 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(1.*five4n1n1n1n1n +8.*five2n1n1n1n1n+8.*four3n1n1n1n\r
2418 + 12.*five3n1n2n1n1n+4.*five2n1n1n1n1n+3.*five2n2n2n1n1n+6.*five2n2n2n1n1n+6.*four1n1n1n1n+24.*four1n1n1n1n\r
2419 + 12.*five2n1n1n1n1n+12.*five2n1n1n1n1n+12.*three2n1n1n+24.*four2n1n2n1n+4.*five3n1n2n1n1n+4.*five2n1n1n1n1n)\r
2420 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four3n1n1n1n+6.*four4n2n1n1n+12.*four1n1n1n1n+24.*three2n1n1n\r
2421 + 24.*four2n1n2n1n+12.*four3n1n1n1n+24.*three3n2n1n+8.*four3n1n3n1n+6.*four3n1n2n2n+6.*three2n1n1n+12.*four1n1n1n1n\r
2422 + 12.*four2n1n2n1n+6.*three2n1n1n+12.*four2n1n2n1n+4.*four3n1n2n2n+3.*four2n2n2n2n+4.*four1n1n1n1n+6.*three2n1n1n\r
2423 + 24.*two1n1n+24.*four1n1n1n1n+4.*four3n1n1n1n+24.*two1n1n+24.*three2n1n1n+12.*two2n2n+24.*three2n1n1n+12.*four2n1n2n1n\r
2424 + 8.*three3n2n1n+8.*four2n1n2n1n+1.*four4n2n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+1.*three2n1n1n+8.*two1n1n\r
2425 + 12.*three3n2n1n+24.*two1n1n+12.*three2n1n1n+4.*three2n1n1n+8.*two1n1n+4.*three4n3n1n+24.*three2n1n1n+8.*three3n2n1n\r
2426 + 12.*two1n1n+12.*two1n1n+3.*three4n2n2n+24.*two2n2n+6.*two2n2n+12.+12.*three3n2n1n+8.*two3n3n+12.*three2n1n1n+24.*two1n1n\r
2427 + 4.*three3n2n1n+8.*three3n2n1n+2.*three4n3n1n+12.*two1n1n+8.*three2n1n1n+4.*three2n1n1n+2.*three3n2n1n+6.*two2n2n+8.*two2n2n\r
2428 + 1.*three4n2n2n+4.*three3n2n1n+6.*three2n1n1n)-dMult*(dMult-1.)*(4.*two1n1n+2.*two1n1n+6.*two2n2n+8.+1.*two2n2n+4.*two3n3n\r
2429 + 12.*two1n1n+4.*two1n1n+1.*two4n4n+8.*two2n2n+6.+2.*two3n3n+4.*two1n1n+1.*two2n2n)-dMult)\r
2430 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)); // to be improved (direct formula needed)\r
2431 \r
2432 // average 7-particle correlations for single event: \r
2433 fIntFlowCorrelationsAllEBE->SetBinContent(29,seven2n1n1n1n1n1n1n);\r
2434 \r
2435 // average 7-particle correlations for all events: \r
2436 fIntFlowCorrelationsAllPro->Fill(28.5,seven2n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.));\r
2437 } // end of if(dMult>6)\r
2438 \r
2439 // 8-particle:\r
2440 Double_t eight1n1n1n1n1n1n1n1n = 0.; // <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>\r
2441 if(dMult>7)\r
2442 {\r
2443 eight1n1n1n1n1n1n1n1n = (pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),4.)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)\r
2444 * (12.*seven2n1n1n1n1n1n1n+16.*six1n1n1n1n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)\r
2445 * (8.*six3n1n1n1n1n1n+48.*six1n1n1n1n1n1n+6.*six2n2n1n1n1n1n+96.*five2n1n1n1n1n+72.*four1n1n1n1n+36.*six2n1n1n2n1n1n)\r
2446 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(2.*five4n1n1n1n1n+32.*five2n1n1n1n1n+36.*four1n1n1n1n\r
2447 + 32.*four3n1n1n1n+48.*five2n1n1n1n1n+48.*five3n1n2n1n1n+144.*five2n1n1n1n1n+288.*four1n1n1n1n+36.*five2n2n2n1n1n\r
2448 + 144.*three2n1n1n+96.*two1n1n+144.*four2n1n2n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)\r
2449 * (8.*four3n1n1n1n+48.*four1n1n1n1n+12.*four4n2n1n1n+96.*four2n1n2n1n+96.*three2n1n1n+72.*three2n1n1n+144.*two1n1n\r
2450 + 16.*four3n1n3n1n+48.*four3n1n1n1n+144.*four1n1n1n1n+72.*four1n1n1n1n+96.*three3n2n1n+24.*four3n1n2n2n+144.*four2n1n2n1n\r
2451 + 288.*two1n1n+288.*three2n1n1n+9.*four2n2n2n2n+72.*two2n2n+24.)-dMult*(dMult-1.)*(dMult-2.)*(12.*three2n1n1n+16.*two1n1n\r
2452 + 24.*three3n2n1n+48.*three2n1n1n+96.*two1n1n+8.*three4n3n1n+32.*three3n2n1n+96.*three2n1n1n+144.*two1n1n+6.*three4n2n2n\r
2453 + 96.*two2n2n+36.*two2n2n+72.+48.*three3n2n1n+16.*two3n3n+72.*three2n1n1n+144.*two1n1n)-dMult*(dMult-1.)*(8.*two1n1n\r
2454 + 12.*two2n2n+16.+8.*two3n3n+48.*two1n1n+1.*two4n4n+16.*two2n2n+18.)-dMult)\r
2455 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.)); // to be improved (direct formula needed)\r
2456 \r
2457 // average 8-particle correlations for single event: \r
2458 fIntFlowCorrelationsAllEBE->SetBinContent(31,eight1n1n1n1n1n1n1n1n);\r
2459 \r
2460 // average 8-particle correlations for all events: \r
2461 fIntFlowCorrelationsAllPro->Fill(30.5,eight1n1n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.));\r
2462 \r
2463 // store separetately <8> (to be improved: do I really need this?)\r
2464 fIntFlowCorrelationsEBE->SetBinContent(4,eight1n1n1n1n1n1n1n1n); // <8>\r
2465 \r
2466 // to be improved (this can be implemented better):\r
2467 Double_t mWeight8p = 0.;\r
2468 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))\r
2469 {\r
2470 mWeight8p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.);\r
2471 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))\r
2472 {\r
2473 mWeight8p = 1.; \r
2474 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))\r
2475 {\r
2476 mWeight8p = dMult; \r
2477 }\r
2478 \r
2479 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(4,mWeight8p); // eW_<8>\r
2480 fIntFlowCorrelationsPro->Fill(3.5,eight1n1n1n1n1n1n1n1n,mWeight8p); \r
2481 \r
2482 // distribution of <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>\r
2483 //f8pDistribution->Fill(eight1n1n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.));\r
2484 } // end of if(dMult>7) \r
2485 \r
2486} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelations()\r
2487\r
2488\r
2489//================================================================================================================================\r
2490\r
2491\r
2492void AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrelations()\r
2493{\r
2494 // Calculate averages of products of correlations for integrated flow // to be improved (this method can be implemented better)\r
2495 \r
2496 // a) Binning of fIntFlowProductOfCorrelationsPro is organized as follows:\r
2497 // 1st bin: <<2><4>> \r
2498 // 2nd bin: <<2><6>>\r
2499 // 3rd bin: <<2><8>>\r
2500 // 4th bin: <<4><6>>\r
2501 // 5th bin: <<4><8>>\r
2502 // 6th bin: <<6><8>>\r
2503\r
2504 /*\r
2505 Double_t dMult = (*fSMpk)(0,0); // multiplicity \r
2506\r
2507 Double_t twoEBE = fIntFlowCorrelationsEBE->GetBinContent(1); // <2>\r
2508 Double_t fourEBE = fIntFlowCorrelationsEBE->GetBinContent(2); // <4>\r
2509 Double_t sixEBE = fIntFlowCorrelationsEBE->GetBinContent(3); // <6>\r
2510 Double_t eightEBE = fIntFlowCorrelationsEBE->GetBinContent(4); // <8>\r
2511 \r
2512 Double_t eW2 = 0.; // event weight for <2>\r
2513 Double_t eW4 = 0.; // event weight for <4>\r
2514 Double_t eW6 = 0.; // event weight for <6>\r
2515 Double_t eW8 = 0.; // event weight for <8>\r
2516 \r
2517 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))\r
2518 {\r
2519 eW2 = dMult*(dMult-1);\r
2520 eW4 = dMult*(dMult-1)*(dMult-2)*(dMult-3);\r
2521 eW6 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5);\r
2522 eW8 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7);\r
2523 } else \r
2524 {\r
2525 eW2 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j;\r
2526 eW4 = (*fSMpk)(3,1)-6.*(*fSMpk)(0,2)*(*fSMpk)(1,1) \r
2527 + 8.*(*fSMpk)(0,3)*(*fSMpk)(0,1)\r
2528 + 3.*(*fSMpk)(1,2)-6.*(*fSMpk)(0,4); // dM1111 = sum_{i,j,k,l=1,i!=j!=k!=l}^M w_i w_j w_k w_l\r
2529 }\r
2530 \r
2531 fIntFlowProductOfCorrelationsPro->Fill(0.5,twoEBE*fourEBE,eW2*eW4); // <<2><4>> \r
2532 fIntFlowProductOfCorrelationsPro->Fill(1.5,twoEBE*sixEBE,eW2*eW6); // <<2><6>>\r
2533 fIntFlowProductOfCorrelationsPro->Fill(2.5,twoEBE*eightEBE,eW2*eW8); // <<2><8>>\r
2534 fIntFlowProductOfCorrelationsPro->Fill(3.5,fourEBE*sixEBE,eW4*eW6); // <<4><6>>\r
2535 fIntFlowProductOfCorrelationsPro->Fill(4.5,fourEBE*eightEBE,eW4*eW8); // <<4><8>>\r
2536 fIntFlowProductOfCorrelationsPro->Fill(5.5,sixEBE*eightEBE,eW6*eW8); // <<6><8>>\r
2537 */\r
2538 \r
2539 \r
2540 Int_t counter = 0;\r
2541 \r
2542 for(Int_t ci1=1;ci1<4;ci1++)\r
2543 {\r
2544 for(Int_t ci2=ci1+1;ci2<=4;ci2++)\r
2545 {\r
2546 fIntFlowProductOfCorrelationsPro->Fill(0.5+counter++,\r
2547 fIntFlowCorrelationsEBE->GetBinContent(ci1)*fIntFlowCorrelationsEBE->GetBinContent(ci2),\r
2548 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));\r
2549 }\r
2550 }\r
2551 \r
2552} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrelations()\r
2553\r
2554\r
2555//================================================================================================================================\r
2556\r
2557\r
2558void AliFlowAnalysisWithQCumulants::CalculateCovariancesIntFlow()\r
2559{\r
2560 // a) Calculate unbiased estimators Cov(<2>,<4>), Cov(<2>,<6>), Cov(<2>,<8>), Cov(<4>,<6>), Cov(<4>,<8>) and Cov(<6>,<8>)\r
2561 // for covariances V_(<2>,<4>), V_(<2>,<6>), V_(<2>,<8>), V_(<4>,<6>), V_(<4>,<8>) and V_(<6>,<8>).\r
2562 // b) Store in histogram fIntFlowCovariances for instance the following: \r
2563 //\r
2564 // Cov(<2>,<4>) * (sum_{i=1}^{N} w_{<2>}_i w_{<4>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<4>}_j)]\r
2565 // \r
2566 // where N is the number of events, w_{<2>} is event weight for <2> and w_{<4>} is event weight for <4>.\r
2567 // c) Binning of fIntFlowCovariances is organized as follows:\r
2568 // \r
2569 // 1st bin: Cov(<2>,<4>) * (sum_{i=1}^{N} w_{<2>}_i w_{<4>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<4>}_j)] \r
2570 // 2nd bin: Cov(<2>,<6>) * (sum_{i=1}^{N} w_{<2>}_i w_{<6>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<6>}_j)]\r
2571 // 3rd bin: Cov(<2>,<8>) * (sum_{i=1}^{N} w_{<2>}_i w_{<8>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<8>}_j)]\r
2572 // 4th bin: Cov(<4>,<6>) * (sum_{i=1}^{N} w_{<4>}_i w_{<6>}_i )/[(sum_{i=1}^{N} w_{<4>}_i) * (sum_{j=1}^{N} w_{<6>}_j)]\r
2573 // 5th bin: Cov(<4>,<8>) * (sum_{i=1}^{N} w_{<4>}_i w_{<8>}_i )/[(sum_{i=1}^{N} w_{<4>}_i) * (sum_{j=1}^{N} w_{<8>}_j)]\r
2574 // 6th bin: Cov(<6>,<8>) * (sum_{i=1}^{N} w_{<6>}_i w_{<8>}_i )/[(sum_{i=1}^{N} w_{<6>}_i) * (sum_{j=1}^{N} w_{<8>}_j)]\r
2575 \r
2576 for(Int_t power=0;power<2;power++)\r
2577 { \r
2578 if(!(fIntFlowCorrelationsPro && fIntFlowProductOfCorrelationsPro \r
2579 && fIntFlowSumOfEventWeights[power] && fIntFlowSumOfProductOfEventWeights\r
2580 && fIntFlowCovariances)) \r
2581 {\r
2582 cout<<"WARNING: fIntFlowCorrelationsPro && fIntFlowProductOfCorrelationsPro "<<endl;\r
2583 cout<<" && fIntFlowSumOfEventWeights[power] && fIntFlowSumOfProductOfEventWeights"<<endl;\r
2584 cout<<" && fIntFlowCovariances is NULL in AFAWQC::FCIF() !!!!"<<endl;\r
2585 cout<<"power = "<<power<<endl;\r
2586 exit(0);\r
2587 }\r
2588 }\r
2589 \r
2590 // average 2-, 4-, 6- and 8-particle correlations for all events:\r
2591 Double_t correlation[4] = {0.};\r
2592 for(Int_t ci=0;ci<4;ci++)\r
2593 {\r
2594 correlation[ci] = fIntFlowCorrelationsPro->GetBinContent(ci+1);\r
2595 } \r
2596 // average products of 2-, 4-, 6- and 8-particle correlations: \r
2597 Double_t productOfCorrelations[4][4] = {{0.}};\r
2598 Int_t productOfCorrelationsLabel = 1;\r
2599 // denominators in the expressions for the unbiased estimator for covariance:\r
2600 Double_t denominator[4][4] = {{0.}};\r
2601 Int_t sumOfProductOfEventWeightsLabel1 = 1;\r
2602 // weight dependent prefactor which multiply unbiased estimators for covariances:\r
2603 Double_t wPrefactor[4][4] = {{0.}}; \r
2604 Int_t sumOfProductOfEventWeightsLabel2 = 1;\r
2605 for(Int_t c1=0;c1<4;c1++)\r
2606 {\r
2607 for(Int_t c2=c1+1;c2<4;c2++)\r
2608 {\r
2609 productOfCorrelations[c1][c2] = fIntFlowProductOfCorrelationsPro->GetBinContent(productOfCorrelationsLabel);\r
2610 if(fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1) && fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1))\r
2611 {\r
2612 denominator[c1][c2] = 1.-(fIntFlowSumOfProductOfEventWeights->GetBinContent(sumOfProductOfEventWeightsLabel1))/\r
2613 (fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1) \r
2614 * fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1));\r
2615 \r
2616 wPrefactor[c1][c2] = fIntFlowSumOfProductOfEventWeights->GetBinContent(sumOfProductOfEventWeightsLabel2)/ \r
2617 (fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1)\r
2618 * fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1));\r
2619 \r
2620 \r
2621 }\r
2622 productOfCorrelationsLabel++;\r
2623 sumOfProductOfEventWeightsLabel1++;\r
2624 sumOfProductOfEventWeightsLabel2++; \r
2625 }\r
2626 }\r
2627 \r
2628 // covariance label:\r
2629 Int_t covarianceLabel = 1;\r
2630 for(Int_t c1=0;c1<4;c1++)\r
2631 {\r
2632 for(Int_t c2=c1+1;c2<4;c2++)\r
2633 {\r
2634 if(denominator[c1][c2])\r
2635 {\r
2636 // covariances:\r
2637 Double_t cov = (productOfCorrelations[c1][c2]-correlation[c1]*correlation[c2])/denominator[c1][c2]; \r
2638 // covarianced multiplied with weight dependent prefactor:\r
2639 Double_t wCov = cov * wPrefactor[c1][c2];\r
2640 fIntFlowCovariances->SetBinContent(covarianceLabel,wCov);\r
2641 }\r
2642 covarianceLabel++;\r
2643 }\r
2644 }\r
2645 \r
2646} // end of AliFlowAnalysisWithQCumulants::CalculateCovariancesIntFlow()\r
2647\r
2648\r
2649//================================================================================================================================\r
2650\r
2651\r
2652void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsIntFlow() \r
2653{\r
2654 // From profile fIntFlowCorrelationsPro access measured correlations and spread, \r
2655 // correctly calculate the statistical errors and store the final results and \r
2656 // statistical errors for correlations in histogram fIntFlowCorrelationsHist.\r
2657 //\r
2658 // Remark: Statistical error of correlation is calculated as:\r
2659 //\r
2660 // statistical error = termA * spread * termB:\r
2661 // termA = sqrt{sum_{i=1}^{N} w^2}/(sum_{i=1}^{N} w)\r
2662 // termB = 1/sqrt(1-termA^2) \r
2663 \r
2664 for(Int_t power=0;power<2;power++)\r
2665 { \r
2666 if(!(fIntFlowCorrelationsHist && fIntFlowCorrelationsPro && fIntFlowSumOfEventWeights[power])) \r
2667 {\r
2668 cout<<"WARNING: fIntFlowCorrelationsHist && fIntFlowCorrelationsPro && fIntFlowSumOfEventWeights[power] is NULL in AFAWQC::FCIF() !!!!"<<endl;\r
2669 cout<<"power = "<<power<<endl;\r
2670 exit(0);\r
2671 }\r
2672 }\r
2673 \r
2674 for(Int_t ci=1;ci<=4;ci++) // correlation index\r
2675 {\r
2676 Double_t correlation = fIntFlowCorrelationsPro->GetBinContent(ci);\r
2677 Double_t spread = fIntFlowCorrelationsPro->GetBinError(ci);\r
2678 Double_t sumOfLinearEventWeights = fIntFlowSumOfEventWeights[0]->GetBinContent(ci);\r
2679 Double_t sumOfQuadraticEventWeights = fIntFlowSumOfEventWeights[1]->GetBinContent(ci);\r
2680 Double_t termA = 0.;\r
2681 Double_t termB = 0.;\r
2682 if(sumOfLinearEventWeights)\r
2683 {\r
2684 termA = pow(sumOfQuadraticEventWeights,0.5)/sumOfLinearEventWeights;\r
2685 } else\r
2686 {\r
2687 cout<<"WARNING: sumOfLinearEventWeights == 0 in AFAWQC::FCIF() !!!!"<<endl;\r
2688 cout<<" (for "<<2*ci<<"-particle correlation)"<<endl;\r
2689 }\r
2690 if(1.-pow(termA,2.) > 0.)\r
2691 {\r
2692 termB = 1./pow(1-pow(termA,2.),0.5);\r
2693 } else\r
2694 {\r
2695 cout<<"WARNING: 1.-pow(termA,2.) <= 0 in AFAWQC::FCIF() !!!!"<<endl; \r
2696 cout<<" (for "<<2*ci<<"-particle correlation)"<<endl;\r
2697 } \r
2698 Double_t statisticalError = termA * spread * termB;\r
2699 fIntFlowCorrelationsHist->SetBinContent(ci,correlation);\r
2700 fIntFlowCorrelationsHist->SetBinError(ci,statisticalError);\r
2701 } // end of for(Int_t ci=1;ci<=4;ci++) // correlation index \r
2702 \r
2703} // end of AliFlowAnalysisWithQCumulants::FinalizeCorrelationsIntFlow()\r
2704\r
2705\r
2706//================================================================================================================================\r
2707\r
2708\r
2709void AliFlowAnalysisWithQCumulants::FillAverageMultiplicities(Int_t nRP)\r
2710{\r
2711 // Fill profile fAverageMultiplicity to hold average multiplicities and number of events for events with nRP>=0, nRP>=1, ... , and nRP>=8\r
2712 \r
2713 // Binning of fAverageMultiplicity is organized as follows:\r
2714 // 1st bin: all events (including the empty ones)\r
2715 // 2nd bin: event with # of RPs greater or equal to 1\r
2716 // 3rd bin: event with # of RPs greater or equal to 2\r
2717 // 4th bin: event with # of RPs greater or equal to 3\r
2718 // 5th bin: event with # of RPs greater or equal to 4\r
2719 // 6th bin: event with # of RPs greater or equal to 5\r
2720 // 7th bin: event with # of RPs greater or equal to 6\r
2721 // 8th bin: event with # of RPs greater or equal to 7\r
2722 // 9th bin: event with # of RPs greater or equal to 8\r
2723 \r
2724 if(!fAvMultiplicity)\r
2725 {\r
2726 cout<<"WARNING: fAvMultiplicity is NULL in AFAWQC::FAM() !!!!"<<endl;\r
2727 exit(0);\r
2728 }\r
2729 \r
2730 if(nRP<0)\r
2731 {\r
2732 cout<<"WARNING: nRP<0 in in AFAWQC::FAM() !!!!"<<endl;\r
2733 exit(0);\r
2734 }\r
2735 \r
2736 for(Int_t i=0;i<9;i++)\r
2737 {\r
2738 if(nRP>=i) fAvMultiplicity->Fill(i+0.5,nRP,1);\r
2739 }\r
2740 \r
2741} // end of AliFlowAnalysisWithQCumulants::FillAverageMultiplicities(nRP)\r
2742\r
2743\r
2744//================================================================================================================================\r
2745\r
2746\r
2747void AliFlowAnalysisWithQCumulants::CalculateCumulantsIntFlow()\r
2748{\r
2749 // a) Calculate Q-cumulants from the measured multiparticle correlations.\r
2750 // b) Propagate the statistical errors of measured multiparticle correlations to statistical errors of Q-cumulants. \r
2751 // c) REMARK: Q-cumulants calculated in this method are biased by non-uniform acceptance of detector !!!! \r
2752 // Method ApplyCorrectionForNonUniformAcceptance* (to be improved: finalize the name here)\r
2753 // is called afterwards to correct for this bias. \r
2754 // d) Store the results and statistical error of Q-cumulants in histogram fCumulants.\r
2755 // Binning of fCumulants is organized as follows:\r
2756 //\r
2757 // 1st bin: QC{2}\r
2758 // 2nd bin: QC{4}\r
2759 // 3rd bin: QC{6}\r
2760 // 4th bin: QC{8}\r
2761 \r
2762 if(!(fIntFlowCorrelationsHist && fIntFlowCovariances && fIntFlowQcumulants))\r
2763 {\r
2764 cout<<"WARNING: fIntFlowCorrelationsHist && fIntFlowCovariances && fIntFlowQcumulants is NULL in AFAWQC::CCIF() !!!!"<<endl;\r
2765 exit(0);\r
2766 }\r
2767 \r
2768 // correlations:\r
2769 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>> \r
2770 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>> \r
2771 Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>> \r
2772 Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>> \r
2773 \r
2774 // statistical errors of average 2-, 4-, 6- and 8-particle azimuthal correlations:\r
2775 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <2> \r
2776 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <4> \r
2777 Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <6> \r
2778 Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <8> \r
2779 \r
2780 // covariances (multiplied by prefactor depending on weights - see comments in CalculateCovariancesIntFlow()):\r
2781 Double_t wCov24 = fIntFlowCovariances->GetBinContent(1); // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)\r
2782 Double_t wCov26 = fIntFlowCovariances->GetBinContent(2); // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)\r
2783 Double_t wCov28 = fIntFlowCovariances->GetBinContent(3); // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)\r
2784 Double_t wCov46 = fIntFlowCovariances->GetBinContent(4); // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)\r
2785 Double_t wCov48 = fIntFlowCovariances->GetBinContent(5); // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)\r
2786 Double_t wCov68 = fIntFlowCovariances->GetBinContent(6); // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)\r
2787 \r
2788 // Q-cumulants: \r
2789 Double_t qc2 = 0.; // QC{2}\r
2790 Double_t qc4 = 0.; // QC{4}\r
2791 Double_t qc6 = 0.; // QC{6}\r
2792 Double_t qc8 = 0.; // QC{8}\r
2793 if(two) qc2 = two; \r
2794 if(four) qc4 = four-2.*pow(two,2.); \r
2795 if(six) qc6 = six-9.*two*four+12.*pow(two,3.); \r
2796 if(eight) qc8 = eight-16.*two*six-18.*pow(four,2.)+144.*pow(two,2.)*four-144.*pow(two,4.); \r
2797 \r
2798 // statistical errors of Q-cumulants: \r
2799 Double_t qc2Error = 0.;\r
2800 Double_t qc4Error = 0.;\r
2801 Double_t qc6Error = 0.;\r
2802 Double_t qc8Error = 0.;\r
2803 \r
2804 // squared statistical errors of Q-cumulants: \r
2805 //Double_t qc2ErrorSquared = 0.;\r
2806 Double_t qc4ErrorSquared = 0.;\r
2807 Double_t qc6ErrorSquared = 0.;\r
2808 Double_t qc8ErrorSquared = 0.;\r
2809 \r
2810 // statistical error of QC{2}: \r
2811 qc2Error = twoError; \r
2812 \r
2813 // statistical error of QC{4}: \r
2814 qc4ErrorSquared = 16.*pow(two,2.)*pow(twoError,2)+pow(fourError,2.)\r
2815 - 8.*two*wCov24; \r
2816 if(qc4ErrorSquared>0.)\r
2817 {\r
2818 qc4Error = pow(qc4ErrorSquared,0.5);\r
2819 } else \r
2820 {\r
2821 cout<<"WARNING: Statistical error of QC{4} is imaginary !!!!"<<endl;\r
2822 }\r
2823 \r
2824 // statistical error of QC{6}: \r
2825 qc6ErrorSquared = 81.*pow(4.*pow(two,2.)-four,2.)*pow(twoError,2.)\r
2826 + 81.*pow(two,2.)*pow(fourError,2.)\r
2827 + pow(sixError,2.)\r
2828 - 162.*two*(4.*pow(two,2.)-four)*wCov24\r
2829 + 18.*(4.*pow(two,2.)-four)*wCov26\r
2830 - 18.*two*wCov46; \r
2831 \r
2832 if(qc6ErrorSquared>0.)\r
2833 {\r
2834 qc6Error = pow(qc6ErrorSquared,0.5);\r
2835 } else \r
2836 {\r
2837 cout<<"WARNING: Statistical error of QC{6} is imaginary !!!!"<<endl;\r
2838 }\r
2839 \r
2840 // statistical error of QC{8}: \r
2841 qc8ErrorSquared = 256.*pow(36.*pow(two,3.)-18.*four*two+six,2.)*pow(twoError,2.)\r
2842 + 1296.*pow(4.*pow(two,2.)-four,2.)*pow(fourError,2.)\r
2843 + 256.*pow(two,2.)*pow(sixError,2.)\r
2844 + pow(eightError,2.)\r
2845 - 1152.*(36.*pow(two,3.)-18.*four*two+six)*(4.*pow(two,2.)-four)*wCov24\r
2846 + 512.*two*(36.*pow(two,3.)-18.*four*two+six)*wCov26\r
2847 - 32.*(36.*pow(two,3.)-18.*four*two+six)*wCov28\r
2848 - 1152.*two*(4.*pow(two,2.)-four)*wCov46\r
2849 + 72.*(4.*pow(two,2.)-four)*wCov48\r
2850 - 32.*two*wCov68; \r
2851 if(qc8ErrorSquared>0.)\r
2852 {\r
2853 qc8Error = pow(qc8ErrorSquared,0.5);\r
2854 } else \r
2855 {\r
2856 cout<<"WARNING: Statistical error of QC{8} is imaginary !!!!"<<endl;\r
2857 }\r
2858\r
2859 // store the results and statistical errors for Q-cumulants:\r
2860 fIntFlowQcumulants->SetBinContent(1,qc2);\r
2861 fIntFlowQcumulants->SetBinError(1,qc2Error);\r
2862 fIntFlowQcumulants->SetBinContent(2,qc4);\r
2863 fIntFlowQcumulants->SetBinError(2,qc4Error);\r
2864 fIntFlowQcumulants->SetBinContent(3,qc6);\r
2865 fIntFlowQcumulants->SetBinError(3,qc6Error);\r
2866 fIntFlowQcumulants->SetBinContent(4,qc8); \r
2867 fIntFlowQcumulants->SetBinError(4,qc8Error); \r
2868 \r
2869} // end of AliFlowAnalysisWithQCumulants::CalculateCumulantsIntFlow()\r
2870\r
2871\r
2872//================================================================================================================================ \r
2873\r
2874\r
2875void AliFlowAnalysisWithQCumulants::CalculateIntFlow()\r
2876{\r
2877 // a) Calculate the final results for integrated flow estimates from Q-cumulants.\r
2878 // b) Propagate the statistical errors of measured multiparticle correlations to statistical errors of integrated flow estimates. \r
2879 // c) Store the results and statistical errors of integrated flow estimates in histogram fIntFlow.\r
2880 // Binning of fIntFlow is organized as follows:\r
2881 //\r
2882 // 1st bin: v{2,QC}\r
2883 // 2nd bin: v{4,QC}\r
2884 // 3rd bin: v{6,QC}\r
2885 // 4th bin: v{8,QC}\r
2886 \r
2887 if(!(fIntFlowCorrelationsHist && fIntFlowCovariances && fIntFlowQcumulants && fIntFlow))\r
2888 {\r
2889 cout<<"WARNING: fIntFlowCorrelationsHist && fIntFlowCovariances && fIntFlowQcumulants && fIntFlow is NULL in AFAWQC::CCIF() !!!!"<<endl;\r
2890 exit(0);\r
2891 }\r
2892 \r
2893 // Q-cumulants:\r
2894 Double_t qc2 = fIntFlowQcumulants->GetBinContent(1); // QC{2} \r
2895 Double_t qc4 = fIntFlowQcumulants->GetBinContent(2); // QC{4} \r
2896 Double_t qc6 = fIntFlowQcumulants->GetBinContent(3); // QC{6} \r
2897 Double_t qc8 = fIntFlowQcumulants->GetBinContent(4); // QC{8}\r
2898 \r
2899 // correlations:\r
2900 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>> \r
2901 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>> \r
2902 Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>> \r
2903 Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>> \r
2904 \r
2905 // statistical errors of average 2-, 4-, 6- and 8-particle azimuthal correlations:\r
2906 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <2> \r
2907 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <4> \r
2908 Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <6> \r
2909 Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <8> \r
2910 \r
2911 // covariances (multiplied by prefactor depending on weights - see comments in CalculateCovariancesIntFlow()):\r
2912 Double_t wCov24 = fIntFlowCovariances->GetBinContent(1); // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)\r
2913 Double_t wCov26 = fIntFlowCovariances->GetBinContent(2); // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)\r
2914 Double_t wCov28 = fIntFlowCovariances->GetBinContent(3); // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)\r
2915 Double_t wCov46 = fIntFlowCovariances->GetBinContent(4); // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)\r
2916 Double_t wCov48 = fIntFlowCovariances->GetBinContent(5); // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)\r
2917 Double_t wCov68 = fIntFlowCovariances->GetBinContent(6); // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)\r
2918 \r
2919 // integrated flow estimates:\r
2920 Double_t v2 = 0.; // v{2,QC} \r
2921 Double_t v4 = 0.; // v{4,QC} \r
2922 Double_t v6 = 0.; // v{6,QC} \r
2923 Double_t v8 = 0.; // v{8,QC}\r
2924 \r
2925 // calculate integrated flow estimates from Q-cumulants: \r
2926 if(qc2>=0.) v2 = pow(qc2,1./2.); \r
2927 if(qc4<=0.) v4 = pow(-1.*qc4,1./4.); \r
2928 if(qc6>=0.) v6 = pow((1./4.)*qc6,1./6.); \r
2929 if(qc8<=0.) v8 = pow((-1./33.)*qc8,1./8.); \r
2930 \r
2931 // statistical errors of integrated flow estimates:\r
2932 Double_t v2Error = 0.; // statistical error of v{2,QC} \r
2933 Double_t v4Error = 0.; // statistical error of v{4,QC} \r
2934 Double_t v6Error = 0.; // statistical error of v{6,QC} \r
2935 Double_t v8Error = 0.; // statistical error of v{8,QC}\r
2936 \r
2937 // squares of statistical errors of integrated flow estimates:\r
2938 Double_t v2ErrorSquared = 0.; // squared statistical error of v{2,QC} \r
2939 Double_t v4ErrorSquared = 0.; // squared statistical error of v{4,QC} \r
2940 Double_t v6ErrorSquared = 0.; // squared statistical error of v{6,QC} \r
2941 Double_t v8ErrorSquared = 0.; // squared statistical error of v{8,QC} \r
2942 \r
2943 // calculate squared statistical errors of integrated flow estimates:\r
2944 if(two > 0.) \r
2945 { \r
2946 v2ErrorSquared = (1./(4.*two))*pow(twoError,2.);\r
2947 } \r
2948 if(2.*pow(two,2.)-four > 0.)\r
2949 {\r
2950 v4ErrorSquared = (1./pow(2.*pow(two,2.)-four,3./2.))*\r
2951 (pow(two,2.)*pow(twoError,2.)+(1./16.)*pow(fourError,2.)-(1./2.)*two*wCov24);\r
2952 }\r
2953 if(six-9.*four*two+12.*pow(two,3.) > 0.) \r
2954 {\r
2955 v6ErrorSquared = ((1./2.)*(1./pow(2.,2./3.))*(1./pow(six-9.*four*two+12.*pow(two,3.),5./3.)))*\r
2956 ((9./2.)*pow(4.*pow(two,2.)-four,2.)*pow(twoError,2.) \r
2957 + (9./2.)*pow(two,2.)*pow(fourError,2.)+(1./18.)*pow(sixError,2.)\r
2958 - 9.*two*(4.*pow(two,2.)-four)*wCov24+(4.*pow(two,2.)-four)*wCov26-two*wCov46); \r
2959 }\r
2960 if(-1.*eight+16.*six*two+18.*pow(four,2.)-144.*four*pow(two,2.)+144.*pow(two,4.) > 0.) \r
2961 {\r
2962 v8ErrorSquared = (4./pow(33,1./4.))*(1./pow(-1.*eight+16.*six*two+18.*pow(four,2.)-144.*four*pow(two,2.)+144.*pow(two,4.),7./4.))*\r
2963 (pow(36.*pow(two,3.)-18.*four*two+six,2.)*pow(twoError,2.)\r
2964 + (81./16.)*pow(4.*pow(two,2.)-four,2.)*pow(fourError,2.)\r
2965 + pow(two,2.)*pow(sixError,2.)\r
2966 + (1./256.)*pow(eightError,2.)\r
2967 - (9./2.)*(36.*pow(two,3.)-18.*four*two+six)*(4.*pow(two,2.)-four)*wCov24\r
2968 + 2.*two*(36.*pow(two,3.)-18.*four*two+six)*wCov26\r
2969 - (1./8.)*(36.*pow(two,3.)-18.*four*two+six)*wCov28 \r
2970 - (9./2.)*two*(4.*pow(two,2.)-four)*wCov46 \r
2971 + (9./32.)*(4.*pow(two,2.)-four)*wCov48 \r
2972 - (1./8.)*two*wCov68);\r
2973 } \r
2974\r
2975 // calculate statistical errors of integrated flow estimates: \r
2976 if(v2ErrorSquared > 0.)\r
2977 {\r
2978 v2Error = pow(v2ErrorSquared,0.5);\r
2979 } else\r
2980 {\r
2981 cout<<"WARNING: Statistical error of v{2,QC} is imaginary !!!!"<<endl;\r
2982 } \r
2983 if(v4ErrorSquared > 0.)\r
2984 {\r
2985 v4Error = pow(v4ErrorSquared,0.5);\r
2986 } else\r
2987 {\r
2988 cout<<"WARNING: Statistical error of v{4,QC} is imaginary !!!!"<<endl;\r
2989 } \r
2990 if(v6ErrorSquared > 0.)\r
2991 {\r
2992 v6Error = pow(v6ErrorSquared,0.5);\r
2993 } else\r
2994 {\r
2995 cout<<"WARNING: Statistical error of v{6,QC} is imaginary !!!!"<<endl;\r
2996 } \r
2997 if(v8ErrorSquared > 0.)\r
2998 {\r
2999 v8Error = pow(v8ErrorSquared,0.5);\r
3000 } else\r
3001 {\r
3002 cout<<"WARNING: Statistical error of v{8,QC} is imaginary !!!!"<<endl;\r
3003 } \r
3004 \r
3005 // store the results and statistical errors of integrated flow estimates:\r
3006 fIntFlow->SetBinContent(1,v2);\r
3007 fIntFlow->SetBinError(1,v2Error);\r
3008 fIntFlow->SetBinContent(2,v4);\r
3009 fIntFlow->SetBinError(2,v4Error);\r
3010 fIntFlow->SetBinContent(3,v6);\r
3011 fIntFlow->SetBinError(3,v6Error);\r
3012 fIntFlow->SetBinContent(4,v8);\r
3013 fIntFlow->SetBinError(4,v8Error);\r
3014 \r
3015} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlow()\r
3016\r
3017\r
3018//================================================================================================================================ \r
3019\r
3020\r
3021void AliFlowAnalysisWithQCumulants::FillCommonHistResultsIntFlow()\r
3022{\r
3023 // Fill in AliFlowCommonHistResults histograms relevant for 'NONAME' integrated flow (to be improved (name))\r
3024 \r
3025 if(!fIntFlow)\r
3026 {\r
3027 cout<<"WARNING: fIntFlow is NULL in AFAWQC::FCHRIF() !!!!"<<endl;\r
3028 exit(0); \r
3029 } \r
3030 \r
3031 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))\r
3032 {\r
3033 cout<<"WARNING: fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th"<<endl; \r
3034 cout<<" is NULL in AFAWQC::FCHRIF() !!!!"<<endl;\r
3035 exit(0);\r
3036 }\r
3037 \r
3038 Double_t v2 = fIntFlow->GetBinContent(1);\r
3039 Double_t v4 = fIntFlow->GetBinContent(2);\r
3040 Double_t v6 = fIntFlow->GetBinContent(3);\r
3041 Double_t v8 = fIntFlow->GetBinContent(4);\r
3042 \r
3043 Double_t v2Error = fIntFlow->GetBinError(1);\r
3044 Double_t v4Error = fIntFlow->GetBinError(2);\r
3045 Double_t v6Error = fIntFlow->GetBinError(3);\r
3046 Double_t v8Error = fIntFlow->GetBinError(4);\r
3047 \r
3048 fCommonHistsResults2nd->FillIntegratedFlow(v2,v2Error); // to be improved (hardwired 2nd in the name) \r
3049 fCommonHistsResults4th->FillIntegratedFlow(v4,v4Error); // to be improved (hardwired 4th in the name)\r
3050 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)) // to be improved (calculate also 6th and 8th order)\r
3051 {\r
3052 fCommonHistsResults6th->FillIntegratedFlow(v6,v6Error); // to be improved (hardwired 6th in the name)\r
3053 fCommonHistsResults8th->FillIntegratedFlow(v8,v8Error); // to be improved (hardwired 8th in the name) \r
3054 }\r
3055 \r
3056} // end of AliFlowAnalysisWithQCumulants::FillCommonHistResultsIntFlow()\r
3057\r
3058\r
3059//================================================================================================================================ \r
3060\r
3061\r
3062/*\r
3063void AliFlowAnalysisWithQCumulants::ApplyCorrectionForNonUniformAcceptanceToCumulantsForIntFlow(Bool_t useParticleWeights, TString eventWeights)\r
3064{\r
3065 // apply correction for non-uniform acceptance to cumulants for integrated flow \r
3066 // (Remark: non-corrected cumulants are accessed from fCumulants[pW][0], corrected cumulants are stored in fCumulants[pW][1])\r
3067 \r
3068 // shortcuts for the flags:\r
3069 Int_t pW = (Int_t)(useParticleWeights); // 0=pWeights not used, 1=pWeights used\r
3070 Int_t eW = -1;\r
3071 \r
3072 if(eventWeights == "exact")\r
3073 {\r
3074 eW = 0;\r
3075 }\r
3076 \r
3077 if(!(fCumulants[pW][eW][0] && fCumulants[pW][eW][1] && fCorrections[pW][eW]))\r
3078 {\r
3079 cout<<"WARNING: fCumulants[pW][eW][0] && fCumulants[pW][eW][1] && fCorrections[pW][eW] is NULL in AFAWQC::ACFNUATCFIF() !!!!"<<endl;\r
3080 cout<<"pW = "<<pW<<endl;\r
3081 cout<<"eW = "<<eW<<endl;\r
3082 exit(0);\r
3083 } \r
3084 \r
3085 // non-corrected cumulants:\r
3086 Double_t qc2 = fCumulants[pW][eW][0]->GetBinContent(1); \r
3087 Double_t qc4 = fCumulants[pW][eW][0]->GetBinContent(2); \r
3088 Double_t qc6 = fCumulants[pW][eW][0]->GetBinContent(3); \r
3089 Double_t qc8 = fCumulants[pW][eW][0]->GetBinContent(4); \r
3090 // statistical error of non-corrected cumulants: \r
3091 Double_t qc2Error = fCumulants[pW][eW][0]->GetBinError(1); \r
3092 Double_t qc4Error = fCumulants[pW][eW][0]->GetBinError(2); \r
3093 Double_t qc6Error = fCumulants[pW][eW][0]->GetBinError(3); \r
3094 Double_t qc8Error = fCumulants[pW][eW][0]->GetBinError(4); \r
3095 // corrections for non-uniform acceptance:\r
3096 Double_t qc2Correction = fCorrections[pW][eW]->GetBinContent(1); \r
3097 Double_t qc4Correction = fCorrections[pW][eW]->GetBinContent(2); \r
3098 Double_t qc6Correction = fCorrections[pW][eW]->GetBinContent(3); \r
3099 Double_t qc8Correction = fCorrections[pW][eW]->GetBinContent(4); \r
3100 // corrected cumulants:\r
3101 Double_t qc2Corrected = qc2 + qc2Correction;\r
3102 Double_t qc4Corrected = qc4 + qc4Correction;\r
3103 Double_t qc6Corrected = qc6 + qc6Correction;\r
3104 Double_t qc8Corrected = qc8 + qc8Correction;\r
3105 \r
3106 // ... to be improved (I need here also to correct error of QCs for NUA. \r
3107 // For simplicity sake I assume at the moment that this correction is negliglible, but it will be added eventually...)\r
3108 \r
3109 // store corrected results and statistical errors for cumulants: \r
3110 fCumulants[pW][eW][1]->SetBinContent(1,qc2Corrected);\r
3111 fCumulants[pW][eW][1]->SetBinContent(2,qc4Corrected);\r
3112 fCumulants[pW][eW][1]->SetBinContent(3,qc6Corrected);\r
3113 fCumulants[pW][eW][1]->SetBinContent(4,qc8Corrected);\r
3114 fCumulants[pW][eW][1]->SetBinError(1,qc2Error); // to be improved (correct also qc2Error for NUA)\r
3115 fCumulants[pW][eW][1]->SetBinError(2,qc4Error); // to be improved (correct also qc4Error for NUA)\r
3116 fCumulants[pW][eW][1]->SetBinError(3,qc6Error); // to be improved (correct also qc6Error for NUA)\r
3117 fCumulants[pW][eW][1]->SetBinError(4,qc8Error); // to be improved (correct also qc8Error for NUA) \r
3118 \r
3119} // end of AliFlowAnalysisWithQCumulants::ApplyCorrectionForNonUniformAcceptanceToCumulantsForIntFlow(Bool_t useParticleWeights, TString eventWeights)\r
3120*/\r
3121\r
3122\r
3123//================================================================================================================================\r
3124\r
3125\r
3126/* \r
3127void AliFlowAnalysisWithQCumulants::PrintQuantifyingCorrectionsForNonUniformAcceptance(Bool_t useParticleWeights, TString eventWeights)\r
3128{\r
3129 // print on the screen QC{n,biased}/QC{n,corrected}\r
3130 \r
3131 // shortcuts for the flags:\r
3132 Int_t pW = (Int_t)(useParticleWeights); // 0=pWeights not used, 1=pWeights used\r
3133 \r
3134 Int_t eW = -1;\r
3135 \r
3136 if(eventWeights == "exact")\r
3137 {\r
3138 eW = 0;\r
3139 } \r
3140 \r
3141 if(!(fCumulants[pW][eW][0] && fCumulants[pW][eW][1]))\r
3142 {\r
3143 cout<<"WARNING: fCumulants[pW][eW][0] && fCumulants[pW][eW][1] is NULL in AFAWQC::PQCFNUA() !!!!"<<endl;\r
3144 cout<<"pW = "<<pW<<endl;\r
3145 cout<<"eW = "<<eW<<endl;\r
3146 exit(0);\r
3147 }\r
3148 \r
3149 cout<<endl;\r
3150 cout<<" Quantifying the bias to Q-cumulants from"<<endl;\r
3151 cout<<" non-uniform acceptance of the detector:"<<endl;\r
3152 cout<<endl;\r
3153 \r
3154 if(fCumulants[pW][eW][1]->GetBinContent(1)) \r
3155 { \r
3156 cout<<" QC{2,biased}/QC{2,corrected} = "<<(fCumulants[pW][eW][0]->GetBinContent(1))/(fCumulants[pW][eW][1]->GetBinContent(1))<<endl; \r
3157 }\r
3158 if(fCumulants[pW][eW][1]->GetBinContent(2)) \r
3159 { \r
3160 cout<<" QC{4,biased}/QC{4,corrected} = "<<fCumulants[pW][eW][0]->GetBinContent(2)/fCumulants[pW][eW][1]->GetBinContent(2)<<endl; \r
3161 }\r
3162 \r
3163 cout<<endl;\r
3164 \r
3165} // end of AliFlowAnalysisWithQCumulants::PrintQuantifyingCorrectionsForNonUniformAcceptance(Bool_t useParticleWeights, TString eventWeights)\r
3166*/\r
3167\r
3168\r
3169//================================================================================================================================\r
3170\r
3171\r
3172void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelationsUsingParticleWeights()\r
3173{\r
3174 // Calculate all correlations needed for integrated flow using particle weights.\r
3175 \r
3176 // Remark 1: When particle weights are used the binning of fIntFlowCorrelationAllPro is organized as follows:\r
3177 //\r
3178 // 1st bin: <2>_{1n|1n} = two1n1nW1W1 = <w1 w2 cos(n*(phi1-phi2))>\r
3179 // 2nd bin: <2>_{2n|2n} = two2n2nW2W2 = <w1^2 w2^2 cos(2n*(phi1-phi2))>\r
3180 // 3rd bin: <2>_{3n|3n} = two3n3nW3W3 = <w1^3 w2^3 cos(3n*(phi1-phi2))> \r
3181 // 4th bin: <2>_{4n|4n} = two4n4nW4W4 = <w1^4 w2^4 cos(4n*(phi1-phi2))>\r
3182 // 5th bin: ---- EMPTY ----\r
3183 // 6th bin: <3>_{2n|1n,1n} = three2n1n1nW2W1W1 = <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>\r
3184 // 7th bin: <3>_{3n|2n,1n} = ...\r
3185 // 8th bin: <3>_{4n|2n,2n} = ...\r
3186 // 9th bin: <3>_{4n|3n,1n} = ...\r
3187 // 10th bin: ---- EMPTY ----\r
3188 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1nW1W1W1W1 = <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>\r
3189 // 12th bin: <4>_{2n,1n|2n,1n} = ...\r
3190 // 13th bin: <4>_{2n,2n|2n,2n} = ...\r
3191 // 14th bin: <4>_{3n|1n,1n,1n} = ... \r
3192 // 15th bin: <4>_{3n,1n|3n,1n} = ...\r
3193 // 16th bin: <4>_{3n,1n|2n,2n} = ...\r
3194 // 17th bin: <4>_{4n|2n,1n,1n} = ... \r
3195 // 18th bin: ---- EMPTY ----\r
3196 // 19th bin: <5>_{2n|1n,1n,1n,1n} = ...\r
3197 // 20th bin: <5>_{2n,2n|2n,1n,1n} = ...\r
3198 // 21st bin: <5>_{3n,1n|2n,1n,1n} = ...\r
3199 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = ...\r
3200 // 23rd bin: ---- EMPTY ----\r
3201 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = ...\r
3202 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = ...\r
3203 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = ...\r
3204 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = ...\r
3205 // 28th bin: ---- EMPTY ----\r
3206 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = ...\r
3207 // 30th bin: ---- EMPTY ----\r
3208 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = ...\r
3209 \r
3210 // Remark 2: When particle weights are used there are some extra correlations. They are stored in \r
3211 // fIntFlowExtraCorrelationsPro binning of which is organized as follows:\r
3212 \r
3213 // 1st bin: two1n1nW3W1 = <w1^3 w2 cos(n*(phi1-phi2))>\r
3214 // 2nd bin: two1n1nW1W1W2 = <w1 w2 w3^2 cos(n*(phi1-phi2))> \r
57340a27 3215
a5b7efd0 3216 // multiplicity (number of particles used to determine the reaction plane)\r
3217 Double_t dMult = (*fSMpk)(0,0);\r
3218 \r
3219 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n: \r
3220 Double_t dReQ1n1k = (*fReQ)(0,1);\r
3221 Double_t dReQ2n2k = (*fReQ)(1,2);\r
3222 Double_t dReQ3n3k = (*fReQ)(2,3);\r
3223 Double_t dReQ4n4k = (*fReQ)(3,4);\r
3224 Double_t dReQ1n3k = (*fReQ)(0,3);\r
3225 Double_t dImQ1n1k = (*fImQ)(0,1);\r
3226 Double_t dImQ2n2k = (*fImQ)(1,2);\r
3227 Double_t dImQ3n3k = (*fImQ)(2,3);\r
3228 Double_t dImQ4n4k = (*fImQ)(3,4);\r
3229 Double_t dImQ1n3k = (*fImQ)(0,3);\r
3230\r
3231 // dMs are variables introduced in order to simplify some Eqs. bellow:\r
3232 //..............................................................................................\r
3233 Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j\r
3234 Double_t dM22 = (*fSMpk)(1,2)-(*fSMpk)(0,4); // dM22 = sum_{i,j=1,i!=j}^M w_i^2 w_j^2\r
3235 Double_t dM33 = (*fSMpk)(1,3)-(*fSMpk)(0,6); // dM33 = sum_{i,j=1,i!=j}^M w_i^3 w_j^3\r
3236 Double_t dM44 = (*fSMpk)(1,4)-(*fSMpk)(0,8); // dM44 = sum_{i,j=1,i!=j}^M w_i^4 w_j^4\r
3237 Double_t dM31 = (*fSMpk)(0,3)*(*fSMpk)(0,1)-(*fSMpk)(0,4); // dM31 = sum_{i,j=1,i!=j}^M w_i^3 w_j\r
3238 Double_t dM211 = (*fSMpk)(0,2)*(*fSMpk)(1,1)-2.*(*fSMpk)(0,3)*(*fSMpk)(0,1)\r
3239 - (*fSMpk)(1,2)+2.*(*fSMpk)(0,4); // dM211 = sum_{i,j,k=1,i!=j!=k}^M w_i^2 w_j w_k\r
3240 Double_t dM1111 = (*fSMpk)(3,1)-6.*(*fSMpk)(0,2)*(*fSMpk)(1,1) \r
3241 + 8.*(*fSMpk)(0,3)*(*fSMpk)(0,1)\r
3242 + 3.*(*fSMpk)(1,2)-6.*(*fSMpk)(0,4); // dM1111 = sum_{i,j,k,l=1,i!=j!=k!=l}^M w_i w_j w_k w_l\r
3243 //..............................................................................................\r
3244\r
3245 // 2-particle correlations:\r
3246 Double_t two1n1nW1W1 = 0.; // <w1 w2 cos(n*(phi1-phi2))>\r
3247 Double_t two2n2nW2W2 = 0.; // <w1^2 w2^2 cos(2n*(phi1-phi2))>\r
3248 Double_t two3n3nW3W3 = 0.; // <w1^3 w2^3 cos(3n*(phi1-phi2))>\r
3249 Double_t two4n4nW4W4 = 0.; // <w1^4 w2^4 cos(4n*(phi1-phi2))>\r
3250 if(dMult>1) \r
3251 { \r
3252 if(dM11)\r
3253 {\r
3254 two1n1nW1W1 = (pow(dReQ1n1k,2)+pow(dImQ1n1k,2)-(*fSMpk)(0,2))/dM11; \r
3255 // average correlation <w1 w2 cos(n*(phi1-phi2))> for single event: \r
3256 fIntFlowCorrelationsEBE->SetBinContent(1,two1n1nW1W1);\r
3257 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(1,dM11);\r
3258 // average correlation <w1 w2 cos(n*(phi1-phi2))> for all events:\r
3259 fIntFlowCorrelationsPro->Fill(0.5,two1n1nW1W1,dM11); \r
3260 fIntFlowCorrelationsAllPro->Fill(0.5,two1n1nW1W1,dM11); \r
3261 }\r
3262 if(dM22)\r
3263 {\r
3264 two2n2nW2W2 = (pow(dReQ2n2k,2)+pow(dImQ2n2k,2)-(*fSMpk)(0,4))/dM22; \r
3265 // ...\r
3266 // average correlation <w1^2 w2^2 cos(2n*(phi1-phi2))> for all events:\r
3267 fIntFlowCorrelationsAllPro->Fill(1.5,two2n2nW2W2,dM22); \r
3268 }\r
3269 if(dM33)\r
3270 {\r
3271 two3n3nW3W3 = (pow(dReQ3n3k,2)+pow(dImQ3n3k,2)-(*fSMpk)(0,6))/dM33;\r
3272 // ...\r
3273 // average correlation <w1^3 w2^3 cos(3n*(phi1-phi2))> for all events:\r
3274 fIntFlowCorrelationsAllPro->Fill(2.5,two3n3nW3W3,dM33); \r
3275 }\r
3276 if(dM44)\r
3277 {\r
3278 two4n4nW4W4 = (pow(dReQ4n4k,2)+pow(dImQ4n4k,2)-(*fSMpk)(0,8))/dM44; \r
3279 // ...\r
3280 // average correlation <w1^4 w2^4 cos(4n*(phi1-phi2))> for all events:\r
3281 fIntFlowCorrelationsAllPro->Fill(3.5,two4n4nW4W4,dM44); \r
3282 }\r
3283 } // end of if(dMult>1) \r
3284\r
3285 // extra 2-particle correlations:\r
3286 Double_t two1n1nW3W1 = 0.; // <w1^3 w2 cos(n*(phi1-phi2))>\r
3287 Double_t two1n1nW1W1W2 = 0.; // <w1 w2 w3^2 cos(n*(phi1-phi2))> \r
3288 if(dMult>1) \r
3289 { \r
3290 if(dM31)\r
3291 {\r
3292 two1n1nW3W1 = (dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k-(*fSMpk)(0,4))/dM31; \r
3293 fIntFlowExtraCorrelationsPro->Fill(0.5,two1n1nW3W1,dM31); \r
3294 } \r
3295 if(dM211)\r
3296 {\r
3297 two1n1nW1W1W2 = ((*fSMpk)(0,2)*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2)-(*fSMpk)(0,2))\r
3298 - 2.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k\r
3299 - (*fSMpk)(0,4)))/dM211;\r
3300 fIntFlowExtraCorrelationsPro->Fill(1.5,two1n1nW1W1W2,dM211); \r
3301 } \r
3302 } // end of if(dMult>1)\r
3303 //..............................................................................................\r
3304 \r
3305 //..............................................................................................\r
3306 // 3-particle correlations:\r
3307 Double_t three2n1n1nW2W1W1 = 0.; // <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>\r
3308 \r
3309 if(dMult>2) \r
3310 { \r
3311 if(dM211)\r
3312 { \r
3313 three2n1n1nW2W1W1 = (pow(dReQ1n1k,2.)*dReQ2n2k+2.*dReQ1n1k*dImQ1n1k*dImQ2n2k-pow(dImQ1n1k,2.)*dReQ2n2k\r
3314 - 2.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k)\r
3315 - pow(dReQ2n2k,2)-pow(dImQ2n2k,2)\r
3316 + 2.*(*fSMpk)(0,4))/dM211; \r
3317 fIntFlowCorrelationsAllPro->Fill(5.5,three2n1n1nW2W1W1,dM211);\r
3318 } \r
3319 } // end of if(dMult>2) \r
3320 //..............................................................................................\r
3321 \r
3322 //..............................................................................................\r
3323 // 4-particle correlations:\r
3324 Double_t four1n1n1n1nW1W1W1W1 = 0.; // <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>\r
3325 if(dMult>3) \r
3326 { \r
3327 if(dM1111)\r
3328 { \r
3329 four1n1n1n1nW1W1W1W1 = (pow(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.),2)\r
3330 - 2.*(pow(dReQ1n1k,2.)*dReQ2n2k+2.*dReQ1n1k*dImQ1n1k*dImQ2n2k-pow(dImQ1n1k,2.)*dReQ2n2k)\r
3331 + 8.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k)\r
3332 + (pow(dReQ2n2k,2)+pow(dImQ2n2k,2))\r
3333 - 4.*(*fSMpk)(0,2)*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))\r
3334 - 6.*(*fSMpk)(0,4)+2.*(*fSMpk)(1,2))/dM1111; \r
3335 \r
3336 // average correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for single event: \r
3337 fIntFlowCorrelationsEBE->SetBinContent(2,four1n1n1n1nW1W1W1W1);\r
3338 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(2,dM1111);\r
3339 // average correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for all events:\r
3340 fIntFlowCorrelationsPro->Fill(1.5,four1n1n1n1nW1W1W1W1,dM1111); \r
3341 fIntFlowCorrelationsAllPro->Fill(10.5,four1n1n1n1nW1W1W1W1,dM1111); \r
3342 } \r
3343 } // end of if(dMult>3) \r
3344 //..............................................................................................\r
3345 \r
3346} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelationsUsingParticleWeights()\r
3347\r
3348\r
3349//================================================================================================================================\r
3350\r
3351\r
3352void AliFlowAnalysisWithQCumulants::CalculateWeightedQProductsForIntFlow() // to be improved (completed)\r
3353{\r
3354 // calculate averages like <<2><4>>, <<2><6>>, <<4><6>>, etc. which are needed to calculate covariances \r
3355 // Remark: here we take weighted correlations!\r
3356 \r
3357 /*\r
3358 \r
3359 // binning of fQProductsW is organized as follows:\r
3360 // \r
3361 // 1st bin: <2><4> \r
3362 // 2nd bin: <2><6>\r
3363 // 3rd bin: <2><8>\r
3364 // 4th bin: <4><6>\r
3365 // 5th bin: <4><8>\r
3366 // 6th bin: <6><8>\r
3367 \r
3368 Double_t dMult = (*fSMpk)(0,0); // multiplicity (number of particles used to determine the reaction plane)\r
3369\r
3370 Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j\r
3371 Double_t dM1111 = (*fSMpk)(3,1)-6.*(*fSMpk)(0,2)*(*fSMpk)(1,1) \r
3372 + 8.*(*fSMpk)(0,3)*(*fSMpk)(0,1)\r
3373 + 3.*(*fSMpk)(1,2)-6.*(*fSMpk)(0,4); // dM1111 = sum_{i,j,k,l=1,i!=j!=k!=l}^M w_i w_j w_k w_l\r
3374\r
3375 Double_t twoEBEW = 0.; // <2>\r
3376 Double_t fourEBEW = 0.; // <4>\r
3377 \r
3378 twoEBEW = fQCorrelationsEBE[1]->GetBinContent(1);\r
3379 fourEBEW = fQCorrelationsEBE[1]->GetBinContent(11);\r
3380 \r
3381 // <2><4>\r
3382 if(dMult>3)\r
3383 {\r
3384 fQProducts[1][0]->Fill(0.5,twoEBEW*fourEBEW,dM11*dM1111);\r
3385 }\r
3386 \r
3387 */\r
3388 \r
3389} // end of AliFlowAnalysisWithQCumulants::CalculateWeightedQProductsForIntFlow() \r
3390\r
3391\r
3392//================================================================================================================================\r
3393\r
3394\r
3395void AliFlowAnalysisWithQCumulants::InitializeArraysForIntFlow()\r
3396{\r
3397 // Initialize all arrays used to calculate integrated flow.\r
3398 \r
3399 for(Int_t sc=0;sc<2;sc++) // sin or cos terms\r
3400 {\r
3401 fIntFlowCorrectionTermsForNUAEBE[sc] = NULL;\r
3402 fIntFlowCorrectionTermsForNUAPro[sc] = NULL;\r
3403 fIntFlowCorrectionTermsForNUAHist[sc] = NULL;\r
3404 }\r
3405 \r
3406 for(Int_t power=0;power<2;power++) // linear or quadratic \r
3407 {\r
3408 fIntFlowSumOfEventWeights[power] = NULL; \r
3409 }\r
3410 \r
3411} // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForIntFlow()\r
3412\r
3413\r
3414//================================================================================================================================\r
3415\r
3416\r
3417void AliFlowAnalysisWithQCumulants::InitializeArraysForDiffFlow()\r
3418{\r
3419 // Initialize all arrays needed to calculate differential flow.\r
3420 // a) Initialize lists holding profiles;\r
3421 // b) Initialize lists holding histograms;\r
3422 // c) Initialize event-by-event quantities;\r
3423 // d) Initialize profiles;\r
3424 // e) Initialize histograms holding final results.\r
3425 \r
3426 // a) Initialize lists holding profiles;\r
3427 for(Int_t t=0;t<2;t++) // type (RP, POI)\r
3428 {\r
3429 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
3430 {\r
3431 fDiffFlowCorrelationsProList[t][pe] = NULL;\r
3432 fDiffFlowProductOfCorrelationsProList[t][pe] = NULL;\r
3433 fDiffFlowCorrectionsProList[t][pe] = NULL;\r
3434 }\r
3435 } \r
3436 \r
3437 // b) Initialize lists holding histograms;\r
3438 for(Int_t t=0;t<2;t++) // type (RP, POI)\r
3439 {\r
3440 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
3441 {\r
3442 fDiffFlowCorrelationsHistList[t][pe] = NULL;\r
3443 for(Int_t power=0;power<2;power++)\r
3444 {\r
3445 fDiffFlowSumOfEventWeightsHistList[t][pe][power] = NULL;\r
3446 } // end of for(Int_t power=0;power<2;power++) \r
3447 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe] = NULL;\r
3448 fDiffFlowCorrectionsHistList[t][pe] = NULL;\r
3449 fDiffFlowCovariancesHistList[t][pe] = NULL;\r
3450 fDiffFlowCumulantsHistList[t][pe] = NULL;\r
3451 fDiffFlowHistList[t][pe] = NULL;\r
3452 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta\r
3453 } // enf of for(Int_t t=0;t<2;t++) // type (RP, POI) \r
3454 \r
3455 // c) Initialize event-by-event quantities:\r
3456 // 1D:\r
3457 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)\r
3458 {\r
3459 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
3460 { \r
3461 for(Int_t m=0;m<4;m++) // multiple of harmonic\r
3462 {\r
3463 for(Int_t k=0;k<9;k++) // power of weight\r
3464 {\r
3465 fReRPQ1dEBE[t][pe][m][k] = NULL;\r
3466 fImRPQ1dEBE[t][pe][m][k] = NULL;\r
3467 fs1dEBE[t][pe][k] = NULL; // to be improved (this doesn't need to be within loop over m)\r
3468 } \r
3469 }\r
3470 }\r
3471 }\r
3472 // 1D:\r
3473 for(Int_t t=0;t<2;t++) // type (RP or POI)\r
3474 {\r
3475 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
3476 { \r
3477 for(Int_t sc=0;sc<2;sc++) // sin or cos terms\r
3478 {\r
3479 for(Int_t cti=0;cti<9;cti++) // correction term index\r
3480 {\r
3481 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti] = NULL;\r
3482 } \r
3483 }\r
3484 }\r
3485 }\r
3486 // 2D: \r
3487 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)\r
3488 {\r
3489 for(Int_t m=0;m<4;m++) // multiple of harmonic\r
3490 {\r
3491 for(Int_t k=0;k<9;k++) // power of weight\r
3492 {\r
3493 fReRPQ2dEBE[t][m][k] = NULL;\r
3494 fImRPQ2dEBE[t][m][k] = NULL;\r
3495 fs2dEBE[t][k] = NULL; // to be improved (this doesn't need to be within loop over m)\r
3496 } \r
3497 }\r
3498 }\r
3499 \r
3500 // d) Initialize profiles:\r
3501 for(Int_t t=0;t<2;t++) // type: RP or POI\r
3502 { \r
3503 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
3504 {\r
3505 for(Int_t ci=0;ci<4;ci++) // correlation index\r
3506 {\r
3507 fDiffFlowCorrelationsPro[t][pe][ci] = NULL;\r
3508 } // end of for(Int_t ci=0;ci<4;ci++) \r
3509 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index\r
3510 {\r
3511 for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index\r
3512 {\r
3513 fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2] = NULL;\r
3514 } // end of for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index\r
3515 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index \r
3516 // correction terms for nua:\r
3517 for(Int_t sc=0;sc<2;sc++) // sin or cos terms\r
3518 {\r
3519 for(Int_t cti=0;cti<9;cti++) // correction term index\r
3520 {\r
3521 fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti] = NULL;\r
3522 } \r
3523 }\r
3524 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta\r
3525 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI\r
3526 \r
3527 // e) Initialize histograms holding final results.\r
3528 for(Int_t t=0;t<2;t++) // type: RP or POI\r
3529 { \r
3530 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
3531 {\r
3532 for(Int_t ci=0;ci<4;ci++) // correlation index\r
3533 {\r
3534 fDiffFlowCorrelationsHist[t][pe][ci] = NULL;\r
3535 fDiffFlowCumulants[t][pe][ci] = NULL;\r
3536 fDiffFlow[t][pe][ci] = NULL;\r
3537 } // end of for(Int_t ci=0;ci<4;ci++) \r
3538 for(Int_t covarianceIndex=0;covarianceIndex<5;covarianceIndex++) \r
3539 {\r
3540 fDiffFlowCovariances[t][pe][covarianceIndex] = NULL; \r
3541 } // end of for(Int_t covarianceIndex=0;covarianceIndex<5;covarianceIndex++) \r
3542 // correction terms for nua:\r
3543 for(Int_t sc=0;sc<2;sc++) // sin or cos terms\r
3544 {\r
3545 for(Int_t cti=0;cti<9;cti++) // correction term index\r
3546 {\r
3547 fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti] = NULL;\r
3548 } \r
3549 }\r
3550 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta\r
3551 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI\r
3552 \r
3553 // sum of event weights for reduced correlations:\r
3554 for(Int_t t=0;t<2;t++) // type = RP or POI\r
3555 {\r
3556 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
3557 {\r
3558 for(Int_t p=0;p<2;p++) // power of weight is 1 or 2\r
3559 {\r
3560 for(Int_t ew=0;ew<4;ew++) // event weight index for reduced correlations\r
3561 {\r
3562 fDiffFlowSumOfEventWeights[t][pe][p][ew] = NULL;\r
3563 } \r
3564 } \r
3565 }\r
3566 }\r
3567 // product of event weights for both types of correlations:\r
3568 for(Int_t t=0;t<2;t++) // type = RP or POI\r
3569 {\r
3570 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
3571 {\r
3572 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index\r
3573 {\r
3574 for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index\r
3575 {\r
3576 fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2] = NULL;\r
3577 } \r
3578 } \r
3579 }\r
3580 }\r
3581\r
3582 \r
3583 \r
3584 \r
3585 /*\r
3586 \r
3587 // nested lists in fDiffFlowProfiles:\r
3588 for(Int_t t=0;t<2;t++)\r
3589 {\r
3590 fDFPType[t] = NULL;\r
3591 for(Int_t pW=0;pW<2;pW++) // particle weights not used (0) or used (1)\r
3592 {\r
3593 fDFPParticleWeights[t][pW] = NULL;\r
3594 for(Int_t eW=0;eW<2;eW++)\r
3595 { \r
3596 fDFPEventWeights[t][pW][eW] = NULL;\r
3597 fDiffFlowCorrelations[t][pW][eW] = NULL;\r
3598 fDiffFlowProductsOfCorrelations[t][pW][eW] = NULL;\r
3599 for(Int_t sc=0;sc<2;sc++)\r
3600 {\r
3601 fDiffFlowCorrectionTerms[t][pW][eW][sc] = NULL;\r
3602 }\r
3603 } \r
3604 }\r
3605 } \r
3606 \r
3607 \r
3608 */\r
3609 \r
3610 \r
3611 \r
3612 /*\r
3613 for(Int_t pW=0;pW<2;pW++) // particle weights not used (0) or used (1)\r
3614 {\r
3615 for(Int_t eW=0;eW<2;eW++)\r
3616 {\r
3617 // correlations:\r
3618 for(Int_t correlationIndex=0;correlationIndex<4;correlationIndex++)\r
3619 {\r
3620 fCorrelationsPro[t][pW][eW][correlationIndex] = NULL;\r
3621 }\r
3622 // products of correlations:\r
3623 for(Int_t productOfCorrelationsIndex=0;productOfCorrelationsIndex<6;productOfCorrelationsIndex++)\r
3624 {\r
3625 fProductsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex] = NULL;\r
3626 }\r
3627 // correction terms:\r
3628 for(Int_t sc=0;sc<2;sc++)\r
3629 {\r
3630 for(Int_t correctionsIndex=0;correctionsIndex<2;correctionsIndex++)\r
3631 {\r
3632 fCorrectionTermsPro[t][pW][eW][sc][correctionsIndex] = NULL;\r
3633 } \r
3634 } \r
3635 }\r
3636 } \r
3637 */\r
3638 \r
3639} // end of AliFlowAnalysisWithQCumulants::InitializeArraysForDiffFlow()\r
3640\r
3641\r
3642//================================================================================================================================\r
3643 /*\r
3644\r
3645\r
3646void AliFlowAnalysisWithQCumulants::CalculateCorrelationsForDifferentialFlow2D(TString type)\r
3647{\r
3648 // calculate all reduced correlations needed for differential flow for each (pt,eta) bin: \r
3649 \r
3650 if(type == "RP") // to be improved (removed)\r
3651 {\r
3652 cout<<endl;\r
3653 }\r
3654 // ... \r
3655 \r
3656 \r
3657 Int_t typeFlag = -1; \r
3658 \r
3659 // reduced correlations ares stored in fCorrelationsPro[t][pW][index] and are indexed as follows:\r
3660 // index:\r
3661 // 0: <2'>\r
3662 // 1: <4'>\r
3663\r
3664 // multiplicity:\r
3665 Double_t dMult = (*fSMpk)(0,0);\r
3666 \r
3667 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n: \r
3668 Double_t dReQ1n = (*fReQ)(0,0);\r
3669 Double_t dReQ2n = (*fReQ)(1,0);\r
3670 //Double_t dReQ3n = (*fReQ)(2,0);\r
3671 //Double_t dReQ4n = (*fReQ)(3,0);\r
3672 Double_t dImQ1n = (*fImQ)(0,0);\r
3673 Double_t dImQ2n = (*fImQ)(1,0);\r
3674 //Double_t dImQ3n = (*fImQ)(2,0);\r
3675 //Double_t dImQ4n = (*fImQ)(3,0);\r
3676\r
3677 // looping over all (pt,eta) bins and calculating correlations needed for differential flow: \r
3678 for(Int_t p=1;p<=fnBinsPt;p++)\r
3679 {\r
3680 for(Int_t e=1;e<=fnBinsEta;e++)\r
3681 {\r
3682 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin): \r
3683 Double_t p1n0kRe = 0.;\r
3684 Double_t p1n0kIm = 0.;\r
3685\r
3686 // number of POIs in particular (pt,eta) bin:\r
3687 Double_t mp = 0.;\r
3688\r
3689 // real and imaginary parts of q_{m*n,0} (non-weighted Q-vector evaluated for particles which are both RPs and POIs in particular (pt,eta) bin):\r
3690 Double_t q1n0kRe = 0.;\r
3691 Double_t q1n0kIm = 0.;\r
3692 Double_t q2n0kRe = 0.;\r
3693 Double_t q2n0kIm = 0.;\r
3694\r
3695 // number of particles which are both RPs and POIs in particular (pt,eta) bin:\r
3696 Double_t mq = 0.;\r
3697 \r
3698 // q_{m*n,0}:\r
3699 q1n0kRe = fReEBE2D[2][0][0]->GetBinContent(fReEBE2D[2][0][0]->GetBin(p,e))\r
3700 * fReEBE2D[2][0][0]->GetBinEntries(fReEBE2D[2][0][0]->GetBin(p,e));\r
3701 q1n0kIm = fImEBE2D[2][0][0]->GetBinContent(fImEBE2D[2][0][0]->GetBin(p,e))\r
3702 * fImEBE2D[2][0][0]->GetBinEntries(fImEBE2D[2][0][0]->GetBin(p,e));\r
3703 q2n0kRe = fReEBE2D[2][1][0]->GetBinContent(fReEBE2D[2][1][0]->GetBin(p,e))\r
3704 * fReEBE2D[2][1][0]->GetBinEntries(fReEBE2D[2][1][0]->GetBin(p,e));\r
3705 q2n0kIm = fImEBE2D[2][1][0]->GetBinContent(fImEBE2D[2][1][0]->GetBin(p,e))\r
3706 * fImEBE2D[2][1][0]->GetBinEntries(fImEBE2D[2][1][0]->GetBin(p,e));\r
3707 \r
3708 mq = fReEBE2D[2][0][0]->GetBinEntries(fReEBE2D[2][0][0]->GetBin(p,e)); // to be improved (cross-checked by accessing other profiles here)\r
3709 \r
3710 if(type == "POI")\r
3711 {\r
3712 // p_{m*n,0}:\r
3713 p1n0kRe = fReEBE2D[1][0][0]->GetBinContent(fReEBE2D[1][0][0]->GetBin(p,e))\r
3714 * fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e));\r
3715 p1n0kIm = fImEBE2D[1][0][0]->GetBinContent(fImEBE2D[1][0][0]->GetBin(p,e)) \r
3716 * fImEBE2D[1][0][0]->GetBinEntries(fImEBE2D[1][0][0]->GetBin(p,e));\r
3717 \r
3718 mp = fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e)); // to be improved (cross-checked by accessing other profiles here)\r
3719 \r
3720 typeFlag = 1;\r
3721 }\r
3722 else if(type == "RP")\r
3723 {\r
3724 // p_{m*n,0} = q_{m*n,0}:\r
3725 p1n0kRe = q1n0kRe; \r
3726 p1n0kIm = q1n0kIm; \r
3727 mp = mq; \r
3728 \r
3729 typeFlag = 0;\r
3730 }\r
3731 \r
3732 // count events with non-empty (pt,eta) bin:\r
3733 if(mp>0)\r
3734 {\r
3735 fNonEmptyBins2D[typeFlag]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,1);\r
3736 }\r
3737 \r
3738 // 2'-particle correlation for particular (pt,eta) bin:\r
3739 Double_t two1n1nPtEta = 0.;\r
3740 if(mp*dMult-mq)\r
3741 {\r
3742 two1n1nPtEta = (p1n0kRe*dReQ1n+p1n0kIm*dImQ1n-mq)\r
3743 / (mp*dMult-mq);\r
3744 \r
3745 // fill the 2D profile to get the average correlation for each (pt,eta) bin:\r
3746 if(type == "POI")\r
3747 { \r
3748 //f2pPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);\r
3749 \r
3750 fCorrelationsPro[1][0][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);\r
3751 }\r
3752 else if(type == "RP")\r
3753 {\r
3754 //f2pPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq); \r
3755 fCorrelationsPro[0][0][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);\r
3756 }\r
3757 } // end of if(mp*dMult-mq)\r
3758 \r
3759 // 4'-particle correlation:\r
3760 Double_t four1n1n1n1nPtEta = 0.;\r
3761 if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
3762 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)\r
3763 {\r
3764 four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)\r
3765 - q2n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))\r
3766 - 2.*q2n0kIm*dReQ1n*dImQ1n\r
3767 - p1n0kRe*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)\r
3768 + p1n0kIm*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)\r
3769 - 2.*dMult*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)\r
3770 - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*mq \r
3771 + 6.*(q1n0kRe*dReQ1n+q1n0kIm*dImQ1n) \r
3772 + 1.*(q2n0kRe*dReQ2n+q2n0kIm*dImQ2n) \r
3773 + 2.*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n) \r
3774 + 2.*mq*dMult \r
3775 - 6.*mq) \r
3776 / ((mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
3777 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)); \r
3778 \r
3779 // fill the 2D profile to get the average correlation for each (pt, eta) bin:\r
3780 if(type == "POI")\r
3781 {\r
3782 //f4pPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,\r
3783 // (mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
3784 // + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));\r
3785 \r
3786 fCorrelationsPro[1][0][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,\r
3787 (mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
3788 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));\r
3789 }\r
3790 else if(type == "RP")\r
3791 {\r
3792 //f4pPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,\r
3793 // (mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
3794 // + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)); \r
3795 \r
3796 fCorrelationsPro[0][0][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,\r
3797 (mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
3798 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)); \r
3799 }\r
3800 } // end of if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
3801 // +mq*(dMult-1.)*(dMult-2.)*(dMult-3.))\r
3802 \r
3803 } // end of for(Int_t e=1;e<=fnBinsEta;e++)\r
3804 } // end of for(Int_t p=1;p<=fnBinsPt;p++)\r
3805\r
3806 \r
3807 \r
3808 \r
3809 \r
3810} // end of AliFlowAnalysisWithQCumulants::CalculateCorrelationsForDifferentialFlow2D()\r
3811\r
3812\r
3813\r
3814 \r
3815 \r
3816\r
3817//================================================================================================================================\r
3818\r
3819\r
3820void AliFlowAnalysisWithQCumulants::CalculateWeightedCorrelationsForDifferentialFlow2D(TString type)\r
3821{\r
3822 // calculate all weighted correlations needed for differential flow \r
3823 \r
3824 if(type == "RP") // to be improved (removed)\r
3825 {\r
3826 cout<<endl;\r
3827 }\r
3828 // ... \r
3829 \r
3830 \r
3831 \r
3832 \r
3833 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n: \r
3834 Double_t dReQ1n1k = (*fReQ)(0,1);\r
3835 Double_t dReQ2n2k = (*fReQ)(1,2);\r
3836 Double_t dReQ1n3k = (*fReQ)(0,3);\r
3837 //Double_t dReQ4n4k = (*fReQ)(3,4);\r
3838 Double_t dImQ1n1k = (*fImQ)(0,1);\r
3839 Double_t dImQ2n2k = (*fImQ)(1,2);\r
3840 Double_t dImQ1n3k = (*fImQ)(0,3);\r
3841 //Double_t dImQ4n4k = (*fImQ)(3,4);\r
3842 \r
3843 // S^M_{p,k} (see .h file for the definition of fSMpk):\r
3844 Double_t dSM1p1k = (*fSMpk)(0,1);\r
3845 Double_t dSM1p2k = (*fSMpk)(0,2);\r
3846 Double_t dSM1p3k = (*fSMpk)(0,3);\r
3847 Double_t dSM2p1k = (*fSMpk)(1,1);\r
3848 Double_t dSM3p1k = (*fSMpk)(2,1);\r
3849 \r
3850 // looping over all (pt,eta) bins and calculating weighted correlations needed for differential flow: \r
3851 for(Int_t p=1;p<=fnBinsPt;p++)\r
3852 {\r
3853 for(Int_t e=1;e<=fnBinsEta;e++)\r
3854 {\r
3855 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin): \r
3856 Double_t p1n0kRe = 0.;\r
3857 Double_t p1n0kIm = 0.;\r
3858\r
3859 // number of POIs in particular (pt,eta) bin):\r
3860 Double_t mp = 0.;\r
3861\r
3862 // real and imaginary parts of q_{m*n,k}: \r
3863 // (weighted Q-vector evaluated for particles which are both RPs and POIs in particular (pt,eta) bin)\r
3864 Double_t q1n2kRe = 0.;\r
3865 Double_t q1n2kIm = 0.;\r
3866 Double_t q2n1kRe = 0.;\r
3867 Double_t q2n1kIm = 0.;\r
3868\r
3869 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation) \r
3870 Double_t s1p1k = 0.; \r
3871 Double_t s1p2k = 0.; \r
3872 Double_t s1p3k = 0.; \r
3873 \r
3874 // M0111 from Eq. (118) in QC2c (to be improved (notation))\r
3875 Double_t dM0111 = 0.;\r
3876 \r
3877 if(type == "POI")\r
3878 {\r
3879 // p_{m*n,0}:\r
3880 p1n0kRe = fReEBE2D[1][0][0]->GetBinContent(fReEBE2D[1][0][0]->GetBin(p,e))\r
3881 * fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e));\r
3882 p1n0kIm = fImEBE2D[1][0][0]->GetBinContent(fImEBE2D[1][0][0]->GetBin(p,e))\r
3883 * fImEBE2D[1][0][0]->GetBinEntries(fImEBE2D[1][0][0]->GetBin(p,e)); \r
3884 \r
3885 mp = fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e));\r
3886 \r
3887 // q_{m*n,k}: \r
3888 q1n2kRe = fReEBE2D[2][0][2]->GetBinContent(fReEBE2D[2][0][2]->GetBin(p,e))\r
3889 * fReEBE2D[2][0][2]->GetBinEntries(fReEBE2D[2][0][2]->GetBin(p,e));\r
3890 q1n2kIm = fImEBE2D[2][0][2]->GetBinContent(fImEBE2D[2][0][2]->GetBin(p,e))\r
3891 * fImEBE2D[2][0][2]->GetBinEntries(fImEBE2D[2][0][2]->GetBin(p,e));\r
3892 q2n1kRe = fReEBE2D[2][1][1]->GetBinContent(fReEBE2D[2][1][1]->GetBin(p,e))\r
3893 * fReEBE2D[2][1][1]->GetBinEntries(fReEBE2D[2][1][1]->GetBin(p,e)); \r
3894 q2n1kIm = fImEBE2D[2][1][1]->GetBinContent(fImEBE2D[2][1][1]->GetBin(p,e))\r
3895 * fImEBE2D[2][1][1]->GetBinEntries(fImEBE2D[2][1][1]->GetBin(p,e));\r
3896 \r
3897 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation) \r
3898 s1p1k = pow(fs2D[2][1]->GetBinContent(fs2D[2][1]->GetBin(p,e)),1.); \r
3899 s1p2k = pow(fs2D[2][2]->GetBinContent(fs2D[2][2]->GetBin(p,e)),1.); \r
3900 s1p3k = pow(fs2D[2][3]->GetBinContent(fs2D[2][3]->GetBin(p,e)),1.); \r
3901 \r
3902 // M0111 from Eq. (118) in QC2c (to be improved (notation)):\r
3903 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)\r
3904 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)\r
3905 + 2.*(s1p3k-s1p2k*dSM1p1k));\r
3906 }\r
3907 else if(type == "RP")\r
3908 {\r
3909 p1n0kRe = fReEBE2D[0][0][0]->GetBinContent(fReEBE2D[0][0][0]->GetBin(p,e))\r
3910 * fReEBE2D[0][0][0]->GetBinEntries(fReEBE2D[0][0][0]->GetBin(p,e));\r
3911 p1n0kIm = fImEBE2D[0][0][0]->GetBinContent(fImEBE2D[0][0][0]->GetBin(p,e))\r
3912 * fImEBE2D[0][0][0]->GetBinEntries(fImEBE2D[0][0][0]->GetBin(p,e));\r
3913 \r
3914 mp = fReEBE2D[0][0][0]->GetBinEntries(fReEBE2D[0][0][0]->GetBin(p,e));\r
3915 \r
3916 // q_{m*n,k}: \r
3917 q1n2kRe = fReEBE2D[0][0][2]->GetBinContent(fReEBE2D[0][0][2]->GetBin(p,e))\r
3918 * fReEBE2D[0][0][2]->GetBinEntries(fReEBE2D[0][0][2]->GetBin(p,e));\r
3919 q1n2kIm = fImEBE2D[0][0][2]->GetBinContent(fImEBE2D[0][0][2]->GetBin(p,e))\r
3920 * fImEBE2D[0][0][2]->GetBinEntries(fImEBE2D[0][0][2]->GetBin(p,e));\r
3921 q2n1kRe = fReEBE2D[0][1][1]->GetBinContent(fReEBE2D[0][1][1]->GetBin(p,e))\r
3922 * fReEBE2D[0][1][1]->GetBinEntries(fReEBE2D[0][1][1]->GetBin(p,e));\r
3923 q2n1kIm = fImEBE2D[0][1][1]->GetBinContent(fImEBE2D[0][1][1]->GetBin(p,e))\r
3924 * fImEBE2D[0][1][1]->GetBinEntries(fImEBE2D[0][1][1]->GetBin(p,e));\r
3925 \r
3926 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation) \r
3927 s1p1k = pow(fs2D[0][1]->GetBinContent(fs2D[0][1]->GetBin(p,e)),1.); \r
3928 s1p2k = pow(fs2D[0][2]->GetBinContent(fs2D[0][2]->GetBin(p,e)),1.); \r
3929 s1p3k = pow(fs2D[0][3]->GetBinContent(fs2D[0][3]->GetBin(p,e)),1.); \r
3930 \r
3931 // M0111 from Eq. (118) in QC2c (to be improved (notation)):\r
3932 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)\r
3933 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)\r
3934 + 2.*(s1p3k-s1p2k*dSM1p1k));\r
3935 //............................................................................................... \r
3936 }\r
3937 \r
3938 // 2'-particle correlation:\r
3939 Double_t two1n1nW0W1PtEta = 0.;\r
3940 if(mp*dSM1p1k-s1p1k)\r
3941 {\r
3942 two1n1nW0W1PtEta = (p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k-s1p1k)\r
3943 / (mp*dSM1p1k-s1p1k);\r
3944 \r
3945 // fill the 2D profile to get the average correlation for each (pt, eta) bin:\r
3946 if(type == "POI")\r
3947 {\r
3948 //f2pPtEtaPOIW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,\r
3949 // mp*dSM1p1k-s1p1k);\r
3950 fCorrelationsPro[1][1][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,mp*dSM1p1k-s1p1k);\r
3951 }\r
3952 else if(type == "RP")\r
3953 {\r
3954 //f2pPtEtaRPW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,\r
3955 // mp*dSM1p1k-s1p1k); \r
3956 fCorrelationsPro[0][1][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,mp*dSM1p1k-s1p1k); \r
3957 }\r
3958 } // end of if(mp*dMult-dmPrimePrimePtEta)\r
3959 \r
3960 // 4'-particle correlation:\r
3961 Double_t four1n1n1n1nW0W1W1W1PtEta = 0.;\r
3962 if(dM0111)\r
3963 {\r
3964 four1n1n1n1nW0W1W1W1PtEta = ((pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)\r
3965 - q2n1kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))\r
3966 - 2.*q2n1kIm*dReQ1n1k*dImQ1n1k\r
3967 - p1n0kRe*(dReQ1n1k*dReQ2n2k+dImQ1n1k*dImQ2n2k)\r
3968 + p1n0kIm*(dImQ1n1k*dReQ2n2k-dReQ1n1k*dImQ2n2k)\r
3969 - 2.*dSM1p2k*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)\r
3970 - 2.*(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*s1p1k \r
3971 + 6.*(q1n2kRe*dReQ1n1k+q1n2kIm*dImQ1n1k) \r
3972 + 1.*(q2n1kRe*dReQ2n2k+q2n1kIm*dImQ2n2k) \r
3973 + 2.*(p1n0kRe*dReQ1n3k+p1n0kIm*dImQ1n3k) \r
3974 + 2.*s1p1k*dSM1p2k \r
3975 - 6.*s1p3k) \r
3976 / dM0111; // to be imropoved (notation of dM0111)\r
3977 \r
3978 // fill the 2D profile to get the average correlation for each (pt, eta) bin:\r
3979 if(type == "POI")\r
3980 {\r
3981 //f4pPtEtaPOIW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);\r
3982 fCorrelationsPro[1][1][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);\r
3983 }\r
3984 else if(type == "RP")\r
3985 {\r
3986 //f4pPtEtaRPW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111); \r
3987 fCorrelationsPro[0][1][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111); \r
3988 }\r
3989 } // end of if(dM0111)\r
3990 \r
3991 } // end of for(Int_t e=1;e<=fnBinsEta;e++)\r
3992 } // end of for(Int_t p=1;p<=fnBinsPt;p++)\r
3993 \r
3994 \r
3995 \r
3996 \r
3997} // end of AliFlowAnalysisWithQCumulants::CalculateWeightedCorrelationsForDifferentialFlow2D(TString type)\r
3998\r
3999\r
4000//================================================================================================================================\r
4001\r
4002 */ \r
4003\r
4004/*\r
4005void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsForDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights)\r
4006{\r
4007 // 1.) Access average for 2D correlations from profiles and store them in 2D final results histograms;\r
4008 // 2.) Access spread for 2D correlations from profiles, calculate error and store it in 2D final results histograms;\r
4009 // 3.) Make projections along pt and eta axis and store results and errors in 1D final results histograms. \r
4010 \r
4011 Int_t typeFlag = -1;\r
4012 Int_t pWeightsFlag = -1;\r
4013 Int_t eWeightsFlag = -1;\r
4014\r
4015 if(type == "RP")\r
4016 {\r
4017 typeFlag = 0;\r
4018 } else if(type == "POI")\r
4019 {\r
4020 typeFlag = 1;\r
4021 } else \r
4022 {\r
4023 cout<<"WARNING: type must be either RP or POI in AFAWQC::FCFDF() !!!!"<<endl;\r
4024 exit(0);\r
4025 }\r
4026 \r
4027 if(!useParticleWeights)\r
4028 {\r
4029 pWeightsFlag = 0;\r
4030 } else \r
4031 {\r
4032 pWeightsFlag = 1; \r
4033 } \r
4034 \r
4035 if(eventWeights == "exact")\r
4036 {\r
4037 eWeightsFlag = 0;\r
4038 } \r
4039 \r
4040 // shortcuts:\r
4041 Int_t t = typeFlag;\r
4042 Int_t pW = pWeightsFlag;\r
4043 Int_t eW = eWeightsFlag;\r
4044 \r
4045 // from 2D histogram fNonEmptyBins2D make two 1D histograms fNonEmptyBins1D in pt and eta (to be improved (i.e. moved somewhere else)) \r
4046 // pt:\r
4047 for(Int_t p=1;p<fnBinsPt;p++)\r
4048 {\r
4049 Double_t contentPt = 0.;\r
4050 for(Int_t e=1;e<=fnBinsEta;e++)\r
4051 {\r
4052 contentPt += (fNonEmptyBins2D[t]->GetBinContent(fNonEmptyBins2D[t]->GetBin(p,e))); \r
4053 }\r
4054 fNonEmptyBins1D[t][0]->SetBinContent(p,contentPt);\r
4055 }\r
4056 // eta:\r
4057 for(Int_t e=1;e<fnBinsEta;e++)\r
4058 {\r
4059 Double_t contentEta = 0.;\r
4060 for(Int_t p=1;p<=fnBinsPt;p++)\r
4061 {\r
4062 contentEta += (fNonEmptyBins2D[t]->GetBinContent(fNonEmptyBins2D[t]->GetBin(p,e))); \r
4063 }\r
4064 fNonEmptyBins1D[t][1]->SetBinContent(e,contentEta);\r
4065 }\r
4066 \r
4067 // from 2D profile in (pt,eta) make two 1D profiles in (pt) and (eta):\r
4068 TProfile *profile[2][4]; // [0=pt,1=eta][correlation index] // to be improved (do not hardwire the correlation index)\r
4069 \r
4070 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
4071 {\r
4072 for(Int_t ci=0;ci<4;ci++) // correlation index\r
4073 {\r
4074 if(pe==0) profile[pe][ci] = this->MakePtProjection(fCorrelationsPro[t][pW][eW][ci]);\r
4075 if(pe==1) profile[pe][ci] = this->MakeEtaProjection(fCorrelationsPro[t][pW][eW][ci]);\r
4076 }\r
4077 }\r
4078 \r
4079 // transfer 2D profile into 2D histogram:\r
4080 // to be improved (see in documentation if there is a method to transfer values from 2D profile into 2D histogram) \r
4081 for(Int_t ci=0;ci<4;ci++)\r
4082 {\r
4083 for(Int_t p=1;p<=fnBinsPt;p++)\r
4084 {\r
4085 for(Int_t e=1;e<=fnBinsEta;e++)\r
4086 {\r
4087 Double_t correlation = fCorrelationsPro[t][pW][eW][ci]->GetBinContent(fCorrelationsPro[t][pW][eW][ci]->GetBin(p,e)); \r
4088 Double_t spread = fCorrelationsPro[t][pW][eW][ci]->GetBinError(fCorrelationsPro[t][pW][eW][ci]->GetBin(p,e));\r
4089 Double_t nEvts = fNonEmptyBins2D[t]->GetBinContent(fNonEmptyBins2D[t]->GetBin(p,e));\r
4090 Double_t error = 0.;\r
4091 fFinalCorrelations2D[t][pW][eW][ci]->SetBinContent(fFinalCorrelations2D[t][pW][eW][ci]->GetBin(p,e),correlation); \r
4092 if(nEvts>0)\r
4093 {\r
4094 error = spread/pow(nEvts,0.5);\r
4095 fFinalCorrelations2D[t][pW][eW][ci]->SetBinError(fFinalCorrelations2D[t][pW][eW][ci]->GetBin(p,e),error);\r
4096 }\r
4097 } // end of for(Int_t e=1;e<=fnBinsEta;e++)\r
4098 } // end of for(Int_t p=1;p<=fnBinsPt;p++)\r
4099 } // end of for(Int_t ci=0;ci<4;ci++)\r
4100 \r
4101 // transfer 1D profile into 1D histogram (pt):\r
4102 // to be improved (see in documentation if there is a method to transfer values from 1D profile into 1D histogram) \r
4103 for(Int_t ci=0;ci<4;ci++)\r
4104 {\r
4105 for(Int_t p=1;p<=fnBinsPt;p++)\r
4106 {\r
4107 if(profile[0][ci])\r
4108 {\r
4109 Double_t correlation = profile[0][ci]->GetBinContent(p); \r
4110 Double_t spread = profile[0][ci]->GetBinError(p);\r
4111 Double_t nEvts = fNonEmptyBins1D[t][0]->GetBinContent(p);\r
4112 Double_t error = 0.;\r
4113 fFinalCorrelations1D[t][pW][eW][0][ci]->SetBinContent(p,correlation); \r
4114 if(nEvts>0)\r
4115 {\r
4116 error = spread/pow(nEvts,0.5);\r
4117 fFinalCorrelations1D[t][pW][eW][0][ci]->SetBinError(p,error);\r
4118 } \r
4119 } \r
4120 } // end of for(Int_t p=1;p<=fnBinsPt;p++)\r
4121 } // end of for(Int_t ci=0;ci<4;ci++)\r
4122 \r
4123 // transfer 1D profile into 1D histogram (eta):\r
4124 // to be improved (see in documentation if there is a method to transfer values from 1D profile into 1D histogram) \r
4125 for(Int_t ci=0;ci<4;ci++)\r
4126 {\r
4127 for(Int_t e=1;e<=fnBinsEta;e++)\r
4128 {\r
4129 if(profile[1][ci])\r
4130 {\r
4131 Double_t correlation = profile[1][ci]->GetBinContent(e); \r
4132 fFinalCorrelations1D[t][pW][eW][1][ci]->SetBinContent(e,correlation); \r
4133 } \r
4134 } // end of for(Int_t e=1;e<=fnBinsEta;e++)\r
4135 } // end of for(Int_t ci=0;ci<4;ci++)\r
4136 \r
4137} // end of void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsForDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights)\r
4138*/\r
4139\r
4140\r
4141//================================================================================================================================\r
4142\r
4143\r
4144void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulants(TString type, TString ptOrEta)\r
4145{\r
4146 // calcualate cumulants for differential flow from measured correlations\r
4147 // Remark: cumulants calculated here are NOT corrected for non-uniform acceptance. This correction is applied in the method ...\r
4148 // to be improved (description) \r
4149 \r
4150 Int_t typeFlag = -1;\r
4151 Int_t ptEtaFlag = -1;\r
4152\r
4153 if(type == "RP")\r
4154 {\r
4155 typeFlag = 0;\r
4156 } else if(type == "POI")\r
4157 {\r
4158 typeFlag = 1;\r
4159 } \r
4160 \r
4161 if(ptOrEta == "Pt")\r
4162 {\r
4163 ptEtaFlag = 0;\r
4164 } else if(ptOrEta == "Eta")\r
4165 {\r
4166 ptEtaFlag = 1;\r
4167 } \r
4168 \r
4169 // shortcuts:\r
4170 Int_t t = typeFlag;\r
4171 Int_t pe = ptEtaFlag;\r
4172 \r
4173 // common:\r
4174 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
4175 \r
4176 // correlation <<2>>: \r
4177 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1);\r
4178 \r
4179 // 1D:\r
4180 for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
4181 {\r
4182 // reduced correlations: \r
4183 Double_t twoPrime = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b); // <<2'>>(pt)\r
4184 Double_t fourPrime = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b); // <<4'>>(pt)\r
4185 // final statistical error of reduced correlations:\r
4186 //Double_t twoPrimeError = fFinalCorrelations1D[t][pW][eW][0][0]->GetBinError(p); \r
4187 // QC{2'}:\r
4188 Double_t qc2Prime = twoPrime; // QC{2'}\r
4189 //Double_t qc2PrimeError = twoPrimeError; // final stat. error of QC{2'}\r
4190 fDiffFlowCumulants[t][pe][0]->SetBinContent(b,qc2Prime); \r
4191 //fFinalCumulantsPt[t][pW][eW][nua][0]->SetBinError(p,qc2PrimeError); \r
4192 // QC{4'}:\r
4193 Double_t qc4Prime = fourPrime - 2.*twoPrime*two; // QC{4'} = <<4'>> - 2*<<2'>><<2>>\r
4194 fDiffFlowCumulants[t][pe][1]->SetBinContent(b,qc4Prime); \r
4195 } // end of for(Int_t p=1;p<=fnBinsPt;p++)\r
4196 \r
4197 \r
4198 /* \r
4199 // 2D (pt,eta):\r
4200 // to be improved (see documentation if I can do all this without looping)\r
4201 for(Int_t p=1;p<=fnBinsPt;p++)\r
4202 {\r
4203 for(Int_t e=1;e<=fnBinsEta;e++) \r
4204 { \r
4205 // reduced correlations: \r
4206 Double_t twoPrime = fFinalCorrelations2D[t][pW][eW][0]->GetBinContent(fFinalCorrelations2D[t][pW][eW][0]->GetBin(p,e)); // <<2'>>(pt,eta)\r
4207 Double_t fourPrime = fFinalCorrelations2D[t][pW][eW][1]->GetBinContent(fFinalCorrelations2D[t][pW][eW][1]->GetBin(p,e)); // <<4'>>(pt,eta)\r
4208 for(Int_t nua=0;nua<2;nua++)\r
4209 {\r
4210 // QC{2'}:\r
4211 Double_t qc2Prime = twoPrime; // QC{2'} = <<2'>>\r
4212 fFinalCumulants2D[t][pW][eW][nua][0]->SetBinContent(fFinalCumulants2D[t][pW][eW][nua][0]->GetBin(p,e),qc2Prime); \r
4213 // QC{4'}:\r
4214 Double_t qc4Prime = fourPrime - 2.*twoPrime*two; // QC{4'} = <<4'>> - 2*<<2'>><<2>>\r
4215 fFinalCumulants2D[t][pW][eW][nua][1]->SetBinContent(fFinalCumulants2D[t][pW][eW][nua][1]->GetBin(p,e),qc4Prime); \r
4216 } // end of for(Int_t nua=0;nua<2;nua++) \r
4217 } // end of for(Int_t e=1;e<=fnBinsEta;e++)\r
4218 } // end of for(Int_t p=1;p<=fnBinsPt;p++)\r
4219 */\r
4220 \r
4221} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulants(TString type, Bool_t useParticleWeights, TString eventWeights); \r
4222\r
4223\r
4224//================================================================================================================================\r
4225\r
4226\r
4227void AliFlowAnalysisWithQCumulants::CalculateFinalResultsForRPandPOIIntegratedFlow(TString type)\r
4228{\r
4229 // calculate final results for integrated flow of RPs and POIs \r
4230 \r
4231 Int_t typeFlag = -1;\r
4232\r
4233 if(type == "RP")\r
4234 {\r
4235 typeFlag = 0;\r
4236 } else if(type == "POI")\r
4237 {\r
4238 typeFlag = 1;\r
4239 } else \r
4240 {\r
4241 cout<<"WARNING: type must be either RP or POI in AFAWQC::CDF() !!!!"<<endl;\r
4242 exit(0);\r
4243 }\r
4244 \r
4245 // shortcuts:\r
4246 Int_t t = typeFlag;\r
4247 \r
4248 // pt yield: \r
4249 TH1F *yield2ndPt = NULL;\r
4250 TH1F *yield4thPt = NULL;\r
4251 TH1F *yield6thPt = NULL;\r
4252 TH1F *yield8thPt = NULL;\r
4253 \r
4254 if(type == "POI")\r
4255 {\r
4256 yield2ndPt = (TH1F*)(fCommonHists2nd->GetHistPtPOI())->Clone();\r
4257 yield4thPt = (TH1F*)(fCommonHists4th->GetHistPtPOI())->Clone();\r
4258 yield6thPt = (TH1F*)(fCommonHists6th->GetHistPtPOI())->Clone();\r
4259 yield8thPt = (TH1F*)(fCommonHists8th->GetHistPtPOI())->Clone(); \r
4260 } \r
4261 else if(type == "RP")\r
4262 {\r
4263 yield2ndPt = (TH1F*)(fCommonHists2nd->GetHistPtRP())->Clone();\r
4264 yield4thPt = (TH1F*)(fCommonHists4th->GetHistPtRP())->Clone();\r
4265 yield6thPt = (TH1F*)(fCommonHists6th->GetHistPtRP())->Clone();\r
4266 yield8thPt = (TH1F*)(fCommonHists8th->GetHistPtRP())->Clone(); \r
4267 } \r
4268 \r
4269 Int_t nBinsPt = yield2ndPt->GetNbinsX();\r
4270 \r
4271 TH1D *flow2ndPt = NULL;\r
4272 TH1D *flow4thPt = NULL;\r
4273 TH1D *flow6thPt = NULL;\r
4274 TH1D *flow8thPt = NULL;\r
4275 \r
4276 // to be improved (hardwired pt index)\r
4277 flow2ndPt = (TH1D*)fDiffFlow[t][0][0]->Clone();\r
4278 flow4thPt = (TH1D*)fDiffFlow[t][0][1]->Clone();\r
4279 flow6thPt = (TH1D*)fDiffFlow[t][0][2]->Clone();\r
4280 flow8thPt = (TH1D*)fDiffFlow[t][0][3]->Clone(); \r
4281 \r
4282 Double_t dvn2nd = 0., dvn4th = 0., dvn6th = 0., dvn8th = 0.; // differential flow\r
4283 Double_t dErrvn2nd = 0., dErrvn4th = 0., dErrvn6th = 0., dErrvn8th = 0.; // error on differential flow\r
4284 \r
4285 Double_t dVn2nd = 0., dVn4th = 0., dVn6th = 0., dVn8th = 0.; // integrated flow \r
4286 Double_t dErrVn2nd = 0., dErrVn4th = 0., dErrVn6th = 0., dErrVn8th = 0.; // error on integrated flow\r
4287\r
4288 Double_t dYield2nd = 0., dYield4th = 0., dYield6th = 0., dYield8th = 0.; // pt yield \r
4289 Double_t dSum2nd = 0., dSum4th = 0., dSum6th = 0., dSum8th = 0.; // needed for normalizing integrated flow\r
4290 \r
4291 // looping over pt bins:\r
4292 for(Int_t p=1;p<nBinsPt+1;p++)\r
4293 {\r
4294 dvn2nd = flow2ndPt->GetBinContent(p);\r
4295 dvn4th = flow4thPt->GetBinContent(p);\r
4296 dvn6th = flow6thPt->GetBinContent(p);\r
4297 dvn8th = flow8thPt->GetBinContent(p);\r
4298 \r
4299 dErrvn2nd = flow2ndPt->GetBinError(p);\r
4300 dErrvn4th = flow4thPt->GetBinError(p);\r
4301 dErrvn6th = flow6thPt->GetBinError(p);\r
4302 dErrvn8th = flow8thPt->GetBinError(p);\r
4303\r
4304 dYield2nd = yield2ndPt->GetBinContent(p); \r
4305 dYield4th = yield4thPt->GetBinContent(p);\r
4306 dYield6th = yield6thPt->GetBinContent(p);\r
4307 dYield8th = yield8thPt->GetBinContent(p);\r
4308 \r
4309 dVn2nd += dvn2nd*dYield2nd;\r
4310 dVn4th += dvn4th*dYield4th;\r
4311 dVn6th += dvn6th*dYield6th;\r
4312 dVn8th += dvn8th*dYield8th;\r
4313 \r
4314 dSum2nd += dYield2nd;\r
4315 dSum4th += dYield4th;\r
4316 dSum6th += dYield6th;\r
4317 dSum8th += dYield8th;\r
4318 \r
4319 dErrVn2nd += dYield2nd*dYield2nd*dErrvn2nd*dErrvn2nd; // ro be improved (check this relation)\r
4320 dErrVn4th += dYield4th*dYield4th*dErrvn4th*dErrvn4th;\r
4321 dErrVn6th += dYield6th*dYield6th*dErrvn6th*dErrvn6th;\r
4322 dErrVn8th += dYield8th*dYield8th*dErrvn8th*dErrvn8th;\r
4323 \r
4324 } // end of for(Int_t p=1;p<nBinsPt+1;p++)\r
4325\r
4326 // normalizing the results for integrated flow:\r
4327 if(dSum2nd) \r
4328 {\r
4329 dVn2nd /= dSum2nd;\r
4330 dErrVn2nd /= (dSum2nd*dSum2nd);\r
4331 dErrVn2nd = TMath::Sqrt(dErrVn2nd);\r
4332 } \r
4333 if(dSum4th) \r
4334 {\r
4335 dVn4th /= dSum4th;\r
4336 dErrVn4th /= (dSum4th*dSum4th);\r
4337 dErrVn4th = TMath::Sqrt(dErrVn4th);\r
4338 } \r
4339 //if(dSum6th) dVn6th/=dSum6th;\r
4340 //if(dSum8th) dVn8th/=dSum8th;\r
4341 \r
4342 // storing the results for integrated flow in common histos: (to be improved: new method for this?)\r
4343 if(type == "POI")\r
4344 {\r
4345 fCommonHistsResults2nd->FillIntegratedFlowPOI(dVn2nd,dErrVn2nd); \r
4346 fCommonHistsResults4th->FillIntegratedFlowPOI(dVn4th,dErrVn4th); \r
4347 fCommonHistsResults6th->FillIntegratedFlowPOI(dVn6th,0.); // to be improved (errors)\r
4348 fCommonHistsResults8th->FillIntegratedFlowPOI(dVn8th,0.); // to be improved (errors)\r
4349 }\r
4350 else if (type == "RP")\r
4351 {\r
4352 fCommonHistsResults2nd->FillIntegratedFlowRP(dVn2nd,dErrVn2nd); \r
4353 fCommonHistsResults4th->FillIntegratedFlowRP(dVn4th,dErrVn4th);\r
4354 fCommonHistsResults6th->FillIntegratedFlowRP(dVn6th,0.); // to be improved (errors)\r
4355 fCommonHistsResults8th->FillIntegratedFlowRP(dVn8th,0.); // to be improved (errors)\r
4356 }\r
4357 \r
4358 delete flow2ndPt;\r
4359 delete flow4thPt;\r
4360 //delete flow6thPt;\r
4361 //delete flow8thPt;\r
4362 \r
4363 delete yield2ndPt;\r
4364 delete yield4thPt;\r
4365 delete yield6thPt;\r
4366 delete yield8thPt;\r
4367 \r
4368} // end of AliFlowAnalysisWithQCumulants::CalculateFinalResultsForRPandPOIIntegratedFlow(TString type)\r
4369\r
4370\r
4371//================================================================================================================================\r
4372\r
4373\r
4374void AliFlowAnalysisWithQCumulants::InitializeArraysForDistributions()\r
4375{\r
57340a27 4376 // Initialize all arrays used for distributions.
4377
4378 // a) Initialize arrays of histograms used to hold distributions of correlations;
4379 // b) Initialize array to hold min and max values of correlations.
4380
4381 // a) Initialize arrays of histograms used to hold distributions of correlations:
4382 for(Int_t di=0;di<4;di++) // distribution index\r
4383 {\r
4384 fDistributions[di] = NULL;\r
a5b7efd0 4385 }\r
57340a27 4386
4387 // b) Initialize default min and max values of correlations:
4388 // (Remark: The default values bellow were chosen for v2=5% and M=500)
4389 fMinValueOfCorrelation[0] = -0.01; // <2>_min
4390 fMaxValueOfCorrelation[0] = 0.04; // <2>_max
4391 fMinValueOfCorrelation[1] = -0.00002; // <4>_min
4392 fMaxValueOfCorrelation[1] = 0.00015; // <4>_max
4393 fMinValueOfCorrelation[2] = -0.0000003; // <6>_min
4394 fMaxValueOfCorrelation[2] = 0.0000006; // <6>_max
4395 fMinValueOfCorrelation[3] = -0.000000006; // <8>_min
4396 fMaxValueOfCorrelation[3] = 0.000000003; // <8>_max
a5b7efd0 4397 \r
4398} // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForDistributions()\r
4399\r
57340a27 4400
a5b7efd0 4401//================================================================================================================================\r
4402\r
4403\r
4404void AliFlowAnalysisWithQCumulants::BookEverythingForDistributions()\r
4405{\r
57340a27 4406 // a) Book profile to hold all flags for distributions of correlations;
4407 // b) Book all histograms to hold distributions of correlations.
4408
4409 TString correlationIndex[4] = {"<2>","<4>","<6>","<8>"}; // to be improved (should I promote this to data members?)
4410
4411 // a) Book profile to hold all flags for distributions of correlations:
4412 TString distributionsFlagsName = "fDistributionsFlags";\r
4413 distributionsFlagsName += fAnalysisLabel->Data();\r
4414 fDistributionsFlags = new TProfile(distributionsFlagsName.Data(),"Flags for Distributions of Correlations",9,0,9);\r
4415 fDistributionsFlags->SetTickLength(-0.01,"Y");\r
4416 fDistributionsFlags->SetMarkerStyle(25);\r
4417 fDistributionsFlags->SetLabelSize(0.05);\r
4418 fDistributionsFlags->SetLabelOffset(0.02,"Y");\r
4419 (fDistributionsFlags->GetXaxis())->SetBinLabel(1,"Store or not?");\r
4420 (fDistributionsFlags->GetXaxis())->SetBinLabel(2,"<2>_{min}");\r
4421 (fDistributionsFlags->GetXaxis())->SetBinLabel(3,"<2>_{max}");\r
4422 (fDistributionsFlags->GetXaxis())->SetBinLabel(4,"<4>_{min}");\r
4423 (fDistributionsFlags->GetXaxis())->SetBinLabel(5,"<4>_{max}");\r
4424 (fDistributionsFlags->GetXaxis())->SetBinLabel(6,"<6>_{min}");\r
4425 (fDistributionsFlags->GetXaxis())->SetBinLabel(7,"<6>_{max}");\r
4426 (fDistributionsFlags->GetXaxis())->SetBinLabel(8,"<8>_{min}");\r
4427 (fDistributionsFlags->GetXaxis())->SetBinLabel(9,"<8>_{max}");\r
4428 fDistributionsList->Add(fDistributionsFlags);\r
4429
4430 // b) Book all histograms to hold distributions of correlations.
4431 if(fStoreDistributions)
4432 {
4433 TString distributionsName = "fDistributions";\r
4434 distributionsName += fAnalysisLabel->Data();\r
4435 for(Int_t di=0;di<4;di++) // distribution index\r
4436 {
4437 fDistributions[di] = new TH1D(Form("Distribution of %s",correlationIndex[di].Data()),Form("Distribution of %s",correlationIndex[di].Data()),10000,fMinValueOfCorrelation[di],fMaxValueOfCorrelation[di]); \r
4438 fDistributions[di]->SetXTitle(correlationIndex[di].Data());\r
4439 fDistributionsList->Add(fDistributions[di]);\r
4440 } // end of for(Int_t di=0;di<4;di++) // distribution index
4441 } // end of if(fStoreDistributions)
4442
a5b7efd0 4443} // end of void AliFlowAnalysisWithQCumulants::BookEverythingForDistributions()\r
4444\r
4445\r
57340a27 4446//================================================================================================================================\r
4447\r
4448
4449void AliFlowAnalysisWithQCumulants::StoreFlagsForDistributions()\r
4450{\r
4451 // Store all flags for distributiuons of correlations in profile fDistributionsFlags.\r
4452 \r
4453 if(!fDistributionsFlags)\r
4454 {\r
4455 cout<<"WARNING: fDistributionsFlags is NULL in AFAWQC::SDF() !!!!"<<endl;\r
4456 exit(0);\r
4457 } \r
4458\r
4459 fDistributionsFlags->Fill(0.5,(Int_t)fStoreDistributions); // histos with distributions of correlations stored or not in the output file
4460 // store min and max values of correlations:
4461 for(Int_t di=0;di<4;di++) // distribution index\r
4462 {\r
4463 fDistributionsFlags->Fill(1.5+2.*(Double_t)di,fMinValueOfCorrelation[di]);
4464 fDistributionsFlags->Fill(2.5+2.*(Double_t)di,fMaxValueOfCorrelation[di]);
4465 }\r
4466 \r
4467} // end of void AliFlowAnalysisWithQCumulants::StoreFlagsForDistributions()\r
4468\r
4469
4470//================================================================================================================================\r
4471
4472
4473void AliFlowAnalysisWithQCumulants::StoreDistributionsOfCorrelations()
4474{
4475 // Store distributions of correlations.
4476
4477 if(!(fIntFlowCorrelationsEBE && fIntFlowEventWeightsForCorrelationsEBE))\r
4478 {\r
4479 cout<<"WARNING: fIntFlowCorrelationsEBE && fIntFlowEventWeightsForCorrelationsEBE"<<endl; \r
4480 cout<<" is NULL in AFAWQC::SDOC() !!!!"<<endl;\r
4481 exit(0);\r
4482 }\r
4483
4484 for(Int_t di=0;di<4;di++) // distribution index\r
4485 {
4486 if(!fDistributions[di])\r
4487 { \r
4488 cout<<"WARNING: fDistributions[di] is NULL in AFAWQC::SDOC() !!!!"<<endl;\r
4489 cout<<"di = "<<di<<endl;\r
4490 exit(0);\r
4491 } else
4492 {
4493 fDistributions[di]->Fill(fIntFlowCorrelationsEBE->GetBinContent(di+1),fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(di+1));
4494 } \r
4495 } // end of for(Int_t di=0;di<4;di++) // distribution index\r
4496
4497} // end of void AliFlowAnalysisWithQCumulants::StoreDistributionsOfCorrelations()
4498
4499
a5b7efd0 4500//================================================================================================================================\r
4501\r
4502\r
4503void AliFlowAnalysisWithQCumulants::BookAndNestAllLists()\r
4504{\r
4505 // Book and nest all lists nested in the base list fHistList.\r
4506 // a) Book and nest lists for integrated flow;\r
4507 // b) Book and nest lists for differential flow;\r
4508 // c) Book and nest list for particle weights;\r
4509 // d) Book and nest list for distributions;\r
4510 // e) Book and nest list for nested loops;\r
4511 \r
4512 // a) Book and nest all lists for integrated flow:\r
4513 // base list for integrated flow:\r
4514 fIntFlowList = new TList();\r
4515 fIntFlowList->SetName("Integrated Flow");\r
4516 fIntFlowList->SetOwner(kTRUE);\r
4517 fHistList->Add(fIntFlowList);\r
4518 // list holding profiles: \r
4519 fIntFlowProfiles = new TList();\r
4520 fIntFlowProfiles->SetName("Profiles");\r
4521 fIntFlowProfiles->SetOwner(kTRUE);\r
4522 fIntFlowList->Add(fIntFlowProfiles);\r
4523 // list holding histograms with results:\r
4524 fIntFlowResults = new TList();\r
4525 fIntFlowResults->SetName("Results");\r
4526 fIntFlowResults->SetOwner(kTRUE);\r
4527 fIntFlowList->Add(fIntFlowResults);\r
4528 \r
4529 // b) Book and nest lists for differential flow;\r
4530 fDiffFlowList = new TList();\r
4531 fDiffFlowList->SetName("Differential Flow");\r
4532 fDiffFlowList->SetOwner(kTRUE); \r
4533 fHistList->Add(fDiffFlowList);\r
4534 // list holding profiles: \r
4535 fDiffFlowProfiles = new TList(); \r
4536 fDiffFlowProfiles->SetName("Profiles");\r
4537 fDiffFlowProfiles->SetOwner(kTRUE);\r
4538 fDiffFlowList->Add(fDiffFlowProfiles);\r
4539 // list holding histograms with results: \r
4540 fDiffFlowResults = new TList();\r
4541 fDiffFlowResults->SetName("Results");\r
4542 fDiffFlowResults->SetOwner(kTRUE);\r
4543 fDiffFlowList->Add(fDiffFlowResults);\r
4544 // flags used for naming nested lists in list fDiffFlowProfiles and fDiffFlowResults: \r
4545 TList list;\r
4546 list.SetOwner(kTRUE);\r
4547 TString typeFlag[2] = {"RP","POI"}; \r
4548 TString ptEtaFlag[2] = {"p_{T}","#eta"}; \r
4549 TString powerFlag[2] = {"linear","quadratic"}; \r
4550 // nested lists in fDiffFlowProfiles (~/Differential Flow/Profiles):\r
4551 for(Int_t t=0;t<2;t++) // type: RP or POI\r
4552 {\r
4553 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
4554 {\r
4555 // list holding profiles with correlations:\r
4556 fDiffFlowCorrelationsProList[t][pe] = (TList*)list.Clone();\r
4557 fDiffFlowCorrelationsProList[t][pe]->SetName(Form("Profiles with correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));\r
4558 fDiffFlowProfiles->Add(fDiffFlowCorrelationsProList[t][pe]);\r
4559 // list holding profiles with products of correlations:\r
4560 fDiffFlowProductOfCorrelationsProList[t][pe] = (TList*)list.Clone();\r
4561 fDiffFlowProductOfCorrelationsProList[t][pe]->SetName(Form("Profiles with products of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));\r
4562 fDiffFlowProfiles->Add(fDiffFlowProductOfCorrelationsProList[t][pe]);\r
4563 // list holding profiles with corrections:\r
4564 fDiffFlowCorrectionsProList[t][pe] = (TList*)list.Clone();\r
4565 fDiffFlowCorrectionsProList[t][pe]->SetName(Form("Profiles with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));\r
4566 fDiffFlowProfiles->Add(fDiffFlowCorrectionsProList[t][pe]); \r
4567 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta \r
4568 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI \r
4569 // nested lists in fDiffFlowResults (~/Differential Flow/Results):\r
4570 for(Int_t t=0;t<2;t++) // type: RP or POI\r
4571 {\r
4572 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
4573 {\r
4574 // list holding histograms with correlations:\r
4575 fDiffFlowCorrelationsHistList[t][pe] = (TList*)list.Clone();\r
4576 fDiffFlowCorrelationsHistList[t][pe]->SetName(Form("Correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));\r
4577 fDiffFlowResults->Add(fDiffFlowCorrelationsHistList[t][pe]);\r
4578 // list holding histograms with corrections:\r
4579 fDiffFlowCorrectionsHistList[t][pe] = (TList*)list.Clone();\r
4580 fDiffFlowCorrectionsHistList[t][pe]->SetName(Form("Histograms with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));\r
4581 fDiffFlowResults->Add(fDiffFlowCorrectionsHistList[t][pe]); \r
4582 for(Int_t power=0;power<2;power++)\r
4583 {\r
4584 // list holding histograms with sums of event weights:\r
4585 fDiffFlowSumOfEventWeightsHistList[t][pe][power] = (TList*)list.Clone();\r
4586 fDiffFlowSumOfEventWeightsHistList[t][pe][power]->SetName(Form("Sum of %s event weights (%s, %s)",powerFlag[power].Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data()));\r
4587 fDiffFlowResults->Add(fDiffFlowSumOfEventWeightsHistList[t][pe][power]); \r
4588 } // end of for(Int_t power=0;power<2;power++)\r
4589 // list holding histograms with sums of products of event weights:\r
4590 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe] = (TList*)list.Clone();\r
4591 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]->SetName(Form("Sum of products of event weights (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));\r
4592 fDiffFlowResults->Add(fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]);\r
4593 // list holding histograms with covariances of correlations:\r
4594 fDiffFlowCovariancesHistList[t][pe] = (TList*)list.Clone();\r
4595 fDiffFlowCovariancesHistList[t][pe]->SetName(Form("Covariances of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));\r
4596 fDiffFlowResults->Add(fDiffFlowCovariancesHistList[t][pe]);\r
4597 // list holding histograms with differential Q-cumulants:\r
4598 fDiffFlowCumulantsHistList[t][pe] = (TList*)list.Clone();\r
4599 fDiffFlowCumulantsHistList[t][pe]->SetName(Form("Differential Q-cumulants (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));\r
4600 fDiffFlowResults->Add(fDiffFlowCumulantsHistList[t][pe]); \r
4601 // list holding histograms with differential flow estimates from Q-cumulants:\r
4602 fDiffFlowHistList[t][pe] = (TList*)list.Clone();\r
4603 fDiffFlowHistList[t][pe]->SetName(Form("Differential flow (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));\r
4604 fDiffFlowResults->Add(fDiffFlowHistList[t][pe]); \r
4605 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta\r
4606 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI\r
4607 \r
4608 // c) Book and nest list for particle weights:\r
4609 fWeightsList->SetName("Weights");\r
4610 fWeightsList->SetOwner(kTRUE); \r
4611 fHistList->Add(fWeightsList); \r
4612\r
4613 // d) Book and nest list for distributions:\r
4614 fDistributionsList = new TList();\r
4615 fDistributionsList->SetName("Distributions");\r
4616 fDistributionsList->SetOwner(kTRUE);\r
4617 fHistList->Add(fDistributionsList);\r
4618 \r
4619 // e) Book and nest list for nested loops:\r
4620 fNestedLoopsList = new TList();\r
4621 fNestedLoopsList->SetName("Nested Loops");\r
4622 fNestedLoopsList->SetOwner(kTRUE);\r
4623 fHistList->Add(fNestedLoopsList);\r
4624 \r
4625} // end of void AliFlowAnalysisWithQCumulants::BookAndNestAllLists()\r
4626\r
4627\r
4628//================================================================================================================================\r
4629\r
4630\r
4631void AliFlowAnalysisWithQCumulants::FillCommonHistResultsDiffFlow(TString type)\r
4632{\r
4633 // fill common result histograms for differential flow\r
4634 \r
4635 Int_t typeFlag = -1;\r
4636 //Int_t ptEtaFlag = -1;\r
4637\r
4638 if(type == "RP")\r
4639 {\r
4640 typeFlag = 0;\r
4641 } else if(type == "POI")\r
4642 {\r
4643 typeFlag = 1;\r
4644 } \r
4645 \r
4646 // shortcuts:\r
4647 Int_t t = typeFlag;\r
4648 //Int_t pe = ptEtaFlag;\r
4649\r
4650 // to be improved (implement protection here)\r
4651 \r
4652 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))\r
4653 {\r
4654 cout<<"WARNING: fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th"<<endl; \r
4655 cout<<" is NULL in AFAWQC::FCHRIF() !!!!"<<endl;\r
4656 exit(0);\r
4657 }\r
4658 \r
4659 // pt:\r
4660 for(Int_t p=1;p<=fnBinsPt;p++)\r
4661 {\r
4662 Double_t v2 = fDiffFlow[t][0][0]->GetBinContent(p);\r
4663 Double_t v4 = fDiffFlow[t][0][1]->GetBinContent(p);\r
4664 Double_t v6 = fDiffFlow[t][0][2]->GetBinContent(p);\r
4665 Double_t v8 = fDiffFlow[t][0][3]->GetBinContent(p);\r
4666 \r
4667 Double_t v2Error = fDiffFlow[t][0][0]->GetBinError(p);\r
4668 Double_t v4Error = fDiffFlow[t][0][1]->GetBinError(p);\r
4669 //Double_t v6Error = fFinalFlow1D[t][pW][nua][0][2]->GetBinError(p);\r
4670 //Double_t v8Error = fFinalFlow1D[t][pW][nua][0][3]->GetBinError(p);\r
4671 \r
4672 if(type == "RP")\r
4673 {\r
4674 fCommonHistsResults2nd->FillDifferentialFlowPtRP(p,v2,v2Error);\r
4675 fCommonHistsResults4th->FillDifferentialFlowPtRP(p,v4,v4Error);\r
4676 fCommonHistsResults6th->FillDifferentialFlowPtRP(p,v6,0.);\r
4677 fCommonHistsResults8th->FillDifferentialFlowPtRP(p,v8,0.);\r
4678 } else if(type == "POI")\r
4679 {\r
4680 fCommonHistsResults2nd->FillDifferentialFlowPtPOI(p,v2,v2Error);\r
4681 fCommonHistsResults4th->FillDifferentialFlowPtPOI(p,v4,v4Error);\r
4682 fCommonHistsResults6th->FillDifferentialFlowPtPOI(p,v6,0.);\r
4683 fCommonHistsResults8th->FillDifferentialFlowPtPOI(p,v8,0.);\r
4684 }\r
4685 } // end of for(Int_t p=1;p<=fnBinsPt;p++) \r
4686 \r
4687 // eta:\r
4688 for(Int_t e=1;e<=fnBinsEta;e++)\r
4689 {\r
4690 Double_t v2 = fDiffFlow[t][1][0]->GetBinContent(e);\r
4691 Double_t v4 = fDiffFlow[t][1][1]->GetBinContent(e);\r
4692 Double_t v6 = fDiffFlow[t][1][2]->GetBinContent(e);\r
4693 Double_t v8 = fDiffFlow[t][1][3]->GetBinContent(e);\r
4694 \r
4695 Double_t v2Error = fDiffFlow[t][1][0]->GetBinError(e);\r
4696 Double_t v4Error = fDiffFlow[t][1][1]->GetBinError(e);\r
4697 //Double_t v6Error = fDiffFlow[t][1][2]->GetBinError(e);\r
4698 //Double_t v8Error = fDiffFlow[t][1][3]->GetBinError(e);\r
4699 \r
4700 if(type == "RP")\r
4701 {\r
4702 fCommonHistsResults2nd->FillDifferentialFlowEtaRP(e,v2,v2Error);\r
4703 fCommonHistsResults4th->FillDifferentialFlowEtaRP(e,v4,v4Error);\r
4704 fCommonHistsResults6th->FillDifferentialFlowEtaRP(e,v6,0.);\r
4705 fCommonHistsResults8th->FillDifferentialFlowEtaRP(e,v8,0.);\r
4706 } else if(type == "POI")\r
4707 {\r
4708 fCommonHistsResults2nd->FillDifferentialFlowEtaPOI(e,v2,v2Error);\r
4709 fCommonHistsResults4th->FillDifferentialFlowEtaPOI(e,v4,v4Error);\r
4710 fCommonHistsResults6th->FillDifferentialFlowEtaPOI(e,v6,0.);\r
4711 fCommonHistsResults8th->FillDifferentialFlowEtaPOI(e,v8,0.);\r
4712 }\r
4713 } // end of for(Int_t e=1;e<=fnBinsEta;e++) \r
4714 \r
4715} // end of void AliFlowAnalysisWithQCumulants::FillCommonHistResultsDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights, Bool_t correctedForNUA)\r
4716\r
4717\r
4718//================================================================================================================================\r
4719\r
4720\r
4721void AliFlowAnalysisWithQCumulants::AccessConstants()\r
4722{\r
4723 // access needed common constants from AliFlowCommonConstants\r
4724 \r
4725 fnBinsPhi = AliFlowCommonConstants::GetMaster()->GetNbinsPhi();\r
4726 fPhiMin = AliFlowCommonConstants::GetMaster()->GetPhiMin(); \r
4727 fPhiMax = AliFlowCommonConstants::GetMaster()->GetPhiMax();\r
4728 if(fnBinsPhi) fPhiBinWidth = (fPhiMax-fPhiMin)/fnBinsPhi; \r
4729 fnBinsPt = AliFlowCommonConstants::GetMaster()->GetNbinsPt();\r
4730 fPtMin = AliFlowCommonConstants::GetMaster()->GetPtMin(); \r
4731 fPtMax = AliFlowCommonConstants::GetMaster()->GetPtMax();\r
4732 if(fnBinsPt) fPtBinWidth = (fPtMax-fPtMin)/fnBinsPt; \r
4733 fnBinsEta = AliFlowCommonConstants::GetMaster()->GetNbinsEta();\r
4734 fEtaMin = AliFlowCommonConstants::GetMaster()->GetEtaMin(); \r
4735 fEtaMax = AliFlowCommonConstants::GetMaster()->GetEtaMax();\r
4736 if(fnBinsEta) fEtaBinWidth = (fEtaMax-fEtaMin)/fnBinsEta; \r
4737 \r
4738} // end of void AliFlowAnalysisWithQCumulants::AccessConstants()\r
4739\r
4740\r
4741//================================================================================================================================\r
4742\r
4743\r
4744void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeights()\r
4745{\r
4746 // Calculate sum of linear and quadratic event weights for correlations\r
4747 \r
4748 \r
4749 /*\r
4750 Double_t dMult = (*fSMpk)(0,0); // multiplicity \r
4751\r
4752 Double_t eventWeight[4] = {0}; \r
4753 \r
4754 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))\r
4755 {\r
4756 eventWeight[0] = dMult*(dMult-1); // event weight for <2> \r
4757 eventWeight[1] = dMult*(dMult-1)*(dMult-2)*(dMult-3); // event weight for <4> \r
4758 eventWeight[2] = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5); // event weight for <6> \r
4759 eventWeight[3] = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7); // event weight for <8> \r
4760 } else\r
4761 {\r
4762 eventWeight[0] = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j;\r
4763 eventWeight[1] = (*fSMpk)(3,1)-6.*(*fSMpk)(0,2)*(*fSMpk)(1,1) \r
4764 + 8.*(*fSMpk)(0,3)*(*fSMpk)(0,1)\r
4765 + 3.*(*fSMpk)(1,2)-6.*(*fSMpk)(0,4); // dM1111 = sum_{i,j,k,l=1,i!=j!=k!=l}^M w_i w_j w_k w_l\r
4766 //eventWeight[2] = ... // to be improved (calculated) \r
4767 //eventWeight[3] = ... // to be improved (calculated) \r
4768 }\r
4769 */\r
4770 \r
4771 \r
4772 for(Int_t p=0;p<2;p++) // power-1\r
4773 {\r
4774 for(Int_t ci=0;ci<4;ci++) // correlation index\r
4775 { \r
4776 fIntFlowSumOfEventWeights[p]->Fill(ci+0.5,pow(fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci+1),p+1)); \r
4777 }\r
4778 }\r
4779 \r
4780} // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeights()\r
4781\r
4782\r
4783//================================================================================================================================\r
4784\r
4785\r
4786void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfProductOfEventWeights()\r
4787{\r
4788 // Calculate sum of product of event weights for correlations\r
4789 \r
4790 \r
4791 /*\r
4792 Double_t dMult = (*fSMpk)(0,0); // multiplicity \r
4793\r
4794 Double_t eventWeight[4] = {0}; \r
4795 \r
4796 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))\r
4797 {\r
4798 eventWeight[0] = dMult*(dMult-1); // event weight for <2> \r
4799 eventWeight[1] = dMult*(dMult-1)*(dMult-2)*(dMult-3); // event weight for <4> \r
4800 eventWeight[2] = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5); // event weight for <6> \r
4801 eventWeight[3] = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7); // event weight for <8> \r
4802 } else\r
4803 {\r
4804 eventWeight[0] = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j;\r
4805 eventWeight[1] = (*fSMpk)(3,1)-6.*(*fSMpk)(0,2)*(*fSMpk)(1,1) \r
4806 + 8.*(*fSMpk)(0,3)*(*fSMpk)(0,1)\r
4807 + 3.*(*fSMpk)(1,2)-6.*(*fSMpk)(0,4); // dM1111 = sum_{i,j,k,l=1,i!=j!=k!=l}^M w_i w_j w_k w_l\r
4808 //eventWeight[2] = ... // to be improved (calculated) \r
4809 //eventWeight[3] = ... // to be improved (calculated) \r
4810 }\r
4811\r
4812 fIntFlowSumOfProductOfEventWeights->Fill(0.5,eventWeight[0]*eventWeight[1]); \r
4813 fIntFlowSumOfProductOfEventWeights->Fill(1.5,eventWeight[0]*eventWeight[2]); \r
4814 fIntFlowSumOfProductOfEventWeights->Fill(2.5,eventWeight[0]*eventWeight[3]); \r
4815 fIntFlowSumOfProductOfEventWeights->Fill(3.5,eventWeight[1]*eventWeight[2]); \r
4816 fIntFlowSumOfProductOfEventWeights->Fill(4.5,eventWeight[1]*eventWeight[3]); \r
4817 fIntFlowSumOfProductOfEventWeights->Fill(5.5,eventWeight[2]*eventWeight[3]); \r
4818 */\r
4819 \r
4820 \r
4821 Int_t counter = 0;\r
4822 \r
4823 for(Int_t ci1=1;ci1<4;ci1++)\r
4824 {\r
4825 for(Int_t ci2=ci1+1;ci2<=4;ci2++)\r
4826 {\r
4827 fIntFlowSumOfProductOfEventWeights->Fill(0.5+counter++,\r
4828 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));\r
4829 }\r
4830 }\r
4831\r
4832 \r
4833\r
4834} // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowIntFlowSumOfProductOfEventWeights()\r
4835\r
4836\r
4837//================================================================================================================================\r
4838\r
4839\r
4840void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelations(TString type, TString ptOrEta)\r
4841{\r
4842 // calculate reduced correlations for RPs or POIs in pt or eta bins\r
4843\r
4844 // multiplicity:\r
4845 Double_t dMult = (*fSMpk)(0,0);\r
4846 \r
4847 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n: \r
4848 Double_t dReQ1n = (*fReQ)(0,0);\r
4849 Double_t dReQ2n = (*fReQ)(1,0);\r
4850 //Double_t dReQ3n = (*fReQ)(2,0);\r
4851 //Double_t dReQ4n = (*fReQ)(3,0);\r
4852 Double_t dImQ1n = (*fImQ)(0,0);\r
4853 Double_t dImQ2n = (*fImQ)(1,0);\r
4854 //Double_t dImQ3n = (*fImQ)(2,0);\r
4855 //Double_t dImQ4n = (*fImQ)(3,0);\r
4856\r
4857 // reduced correlations are stored in fDiffFlowCorrelationsPro[0=RP,1=POI][0=pt,1=eta][correlation index]. Correlation index runs as follows:\r
4858 // \r
4859 // 0: <<2'>>\r
4860 // 1: <<4'>>\r
4861 // 2: <<6'>>\r
4862 // 3: <<8'>>\r
4863 \r
4864 Int_t t = -1; // type flag \r
4865 Int_t pe = -1; // ptEta flag\r
4866 \r
4867 if(type == "RP")\r
4868 {\r
4869 t = 0;\r
4870 } else if(type == "POI")\r
4871 {\r
4872 t = 1;\r
4873 }\r
4874\r
4875 if(ptOrEta == "Pt")\r
4876 {\r
4877 pe = 0;\r
4878 } else if(ptOrEta == "Eta")\r
4879 {\r
4880 pe = 1;\r
4881 }\r
4882 \r
4883 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
4884 Double_t minPtEta[2] = {fPtMin,fEtaMin};\r
4885 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};\r
4886 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};\r
4887\r
4888 // looping over all bins and calculating reduced correlations: \r
4889 for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
4890 {\r
4891 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin): \r
4892 Double_t p1n0kRe = 0.;\r
4893 Double_t p1n0kIm = 0.;\r
4894\r
4895 // number of POIs in particular pt or eta bin:\r
4896 Double_t mp = 0.;\r
4897\r
4898 // real and imaginary parts of q_{m*n,0} (non-weighted Q-vector evaluated for particles which are both RPs and POIs in particular pt or eta bin):\r
4899 Double_t q1n0kRe = 0.;\r
4900 Double_t q1n0kIm = 0.;\r
4901 Double_t q2n0kRe = 0.;\r
4902 Double_t q2n0kIm = 0.;\r
4903\r
4904 // number of particles which are both RPs and POIs in particular pt or eta bin:\r
4905 Double_t mq = 0.;\r
4906 \r
4907 if(type == "POI")\r
4908 {\r
4909 // q_{m*n,0}:\r
4910 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))\r
4911 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));\r
4912 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))\r
4913 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));\r
4914 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))\r
4915 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));\r
4916 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))\r
4917 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b)); \r
4918 \r
4919 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)\r
4920 } \r
4921 else if(type == "RP")\r
4922 {\r
4923 // q_{m*n,0}:\r
4924 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))\r
4925 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));\r
4926 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))\r
4927 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));\r
4928 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))\r
4929 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));\r
4930 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))\r
4931 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b)); \r
4932 \r
4933 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here) \r
4934 }\r
4935 \r
4936 if(type == "POI")\r
4937 {\r
4938 // p_{m*n,0}:\r
4939 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))\r
4940 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));\r
4941 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b)) \r
4942 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));\r
4943 \r
4944 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)\r
4945 \r
4946 t = 1; // typeFlag = RP or POI\r
4947 }\r
4948 else if(type == "RP")\r
4949 {\r
4950 // p_{m*n,0} = q_{m*n,0}:\r
4951 p1n0kRe = q1n0kRe; \r
4952 p1n0kIm = q1n0kIm; \r
4953 \r
4954 mp = mq; \r
4955 \r
4956 t = 0; // typeFlag = RP or POI\r
4957 }\r
4958 \r
4959 // 2'-particle correlation for particular (pt,eta) bin:\r
4960 Double_t two1n1nPtEta = 0.;\r
4961 if(mp*dMult-mq)\r
4962 {\r
4963 two1n1nPtEta = (p1n0kRe*dReQ1n+p1n0kIm*dImQ1n-mq)\r
4964 / (mp*dMult-mq);\r
4965 \r
4966 if(type == "POI") // to be improved (I do not this if)\r
4967 { \r
4968 // fill profile to get <<2'>> for POIs\r
4969 fDiffFlowCorrelationsPro[1][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta,mp*dMult-mq);\r
4970 // histogram to store <2'> for POIs e-b-e (needed in some other methods):\r
4971 fDiffFlowCorrelationsEBE[1][pe][0]->SetBinContent(b,two1n1nPtEta); \r
4972 fDiffFlowEventWeightsForCorrelationsEBE[1][pe][0]->SetBinContent(b,mp*dMult-mq); \r
4973 }\r
4974 else if(type == "RP") // to be improved (I do not this if)\r
4975 {\r
4976 // profile to get <<2'>> for RPs:\r
4977 fDiffFlowCorrelationsPro[0][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta,mp*dMult-mq);\r
4978 // histogram to store <2'> for RPs e-b-e (needed in some other methods):\r
4979 fDiffFlowCorrelationsEBE[0][pe][0]->SetBinContent(b,two1n1nPtEta); \r
4980 fDiffFlowEventWeightsForCorrelationsEBE[0][pe][0]->SetBinContent(b,mp*dMult-mq); \r
4981 }\r
4982 } // end of if(mp*dMult-mq)\r
4983 \r
4984 // 4'-particle correlation:\r
4985 Double_t four1n1n1n1nPtEta = 0.;\r
4986 if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
4987 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)\r
4988 {\r
4989 four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)\r
4990 - q2n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))\r
4991 - 2.*q2n0kIm*dReQ1n*dImQ1n\r
4992 - p1n0kRe*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)\r
4993 + p1n0kIm*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)\r
4994 - 2.*dMult*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)\r
4995 - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*mq \r
4996 + 6.*(q1n0kRe*dReQ1n+q1n0kIm*dImQ1n) \r
4997 + 1.*(q2n0kRe*dReQ2n+q2n0kIm*dImQ2n) \r
4998 + 2.*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n) \r
4999 + 2.*mq*dMult \r
5000 - 6.*mq) \r
5001 / ((mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
5002 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)); \r
5003 \r
5004 if(type == "POI")\r
5005 {\r
5006 // profile to get <<4'>> for POIs:\r
5007 fDiffFlowCorrelationsPro[1][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta,\r
5008 (mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
5009 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)); \r
5010 // histogram to store <4'> for POIs e-b-e (needed in some other methods):\r
5011 fDiffFlowCorrelationsEBE[1][pe][1]->SetBinContent(b,four1n1n1n1nPtEta); \r
5012 fDiffFlowEventWeightsForCorrelationsEBE[1][pe][1]->SetBinContent(b,(mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
5013 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)); \r
5014 }\r
5015 else if(type == "RP")\r
5016 {\r
5017 // profile to get <<4'>> for RPs:\r
5018 fDiffFlowCorrelationsPro[0][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta,\r
5019 (mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
5020 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)); \r
5021 // histogram to store <4'> for RPs e-b-e (needed in some other methods):\r
5022 fDiffFlowCorrelationsEBE[0][pe][1]->SetBinContent(b,four1n1n1n1nPtEta); \r
5023 fDiffFlowEventWeightsForCorrelationsEBE[0][pe][1]->SetBinContent(b,(mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
5024 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)); \r
5025 }\r
5026 } // end of if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
5027 // +mq*(dMult-1.)*(dMult-2.)*(dMult-3.))\r
5028 \r
5029 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
5030 \r
5031 \r
5032} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelations(TString type, TString ptOrEta);\r
5033\r
5034\r
5035//================================================================================================================================\r
5036\r
5037\r
5038void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfEventWeights(TString type, TString ptOrEta)\r
5039{\r
5040 // Calculate sums of various event weights for reduced correlations. \r
5041 // (These quantitites are needed in expressions for unbiased estimators relevant for the statistical errors.)\r
5042\r
5043 Int_t typeFlag = -1;\r
5044 Int_t ptEtaFlag = -1;\r
5045\r
5046 if(type == "RP")\r
5047 {\r
5048 typeFlag = 0;\r
5049 } else if(type == "POI")\r
5050 {\r
5051 typeFlag = 1;\r
5052 } \r
5053 \r
5054 if(ptOrEta == "Pt")\r
5055 {\r
5056 ptEtaFlag = 0;\r
5057 } else if(ptOrEta == "Eta")\r
5058 {\r
5059 ptEtaFlag = 1;\r
5060 } \r
5061 \r
5062 // shortcuts:\r
5063 Int_t t = typeFlag;\r
5064 Int_t pe = ptEtaFlag;\r
5065 \r
5066 // binning:\r
5067 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
5068 Double_t minPtEta[2] = {fPtMin,fEtaMin};\r
5069 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};\r
5070 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};\r
5071 \r
5072 for(Int_t rpq=0;rpq<3;rpq++)\r
5073 {\r
5074 for(Int_t m=0;m<4;m++)\r
5075 {\r
5076 for(Int_t k=0;k<9;k++)\r
5077 {\r
5078 if(!fReRPQ1dEBE[rpq][pe][m][k])\r
5079 {\r
5080 cout<<"WARNING: fReRPQ1dEBE[rpq][pe][m][k] is NULL in AFAWQC::CSAPOEWFDF() !!!!"<<endl;\r
5081 cout<<"pe = "<<pe<<endl;\r
5082 cout<<"rpq = "<<rpq<<endl;\r
5083 cout<<"m = "<<m<<endl;\r
5084 cout<<"k = "<<k<<endl;\r
5085 exit(0); \r
5086 }\r
5087 }\r
5088 }\r
5089 } \r
5090\r
5091 // multiplicities:\r
5092 Double_t dMult = (*fSMpk)(0,0); // total event multiplicity\r
5093 //Double_t mr = 0.; // number of RPs in particular pt or eta bin\r
5094 Double_t mp = 0.; // number of POIs in particular pt or eta bin \r
5095 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin\r
5096 \r
5097 // event weights for reduced correlations:\r
5098 Double_t dw2 = 0.; // event weight for <2'>\r
5099 Double_t dw4 = 0.; // event weight for <4'>\r
5100 //Double_t dw6 = 0.; // event weight for <6'>\r
5101 //Double_t dw8 = 0.; // event weight for <8'>\r
5102\r
5103 // looping over bins:\r
5104 for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
5105 {\r
5106 if(type == "RP")\r
5107 {\r
5108 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);\r
5109 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow\r
5110 } else if(type == "POI")\r
5111 {\r
5112 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);\r
5113 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b); \r
5114 }\r
5115 \r
5116 // event weight for <2'>:\r
5117 dw2 = mp*dMult-mq; \r
5118 fDiffFlowSumOfEventWeights[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2);\r
5119 fDiffFlowSumOfEventWeights[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw2,2.));\r
5120 \r
5121 // event weight for <4'>:\r
5122 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
5123 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.); \r
5124 fDiffFlowSumOfEventWeights[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4);\r
5125 fDiffFlowSumOfEventWeights[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw4,2.));\r
5126 \r
5127 // event weight for <6'>:\r
5128 //dw6 = ...; \r
5129 //fDiffFlowSumOfEventWeights[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6);\r
5130 //fDiffFlowSumOfEventWeights[t][pe][t][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw6,2.));\r
5131 \r
5132 // event weight for <8'>:\r
5133 //dw8 = ...; \r
5134 //fDiffFlowSumOfEventWeights[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw8);\r
5135 //fDiffFlowSumOfEventWeights[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw8,2.)); \r
5136 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++) \r
5137 \r
5138} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfEventWeights()\r
5139\r
5140\r
5141//================================================================================================================================\r
5142\r
5143\r
5144void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfProductOfEventWeights(TString type, TString ptOrEta)\r
5145{\r
5146 // Calculate sum of products of various event weights for both types of correlations (the ones for int. and diff. flow). \r
5147 // (These quantitites are needed in expressions for unbiased estimators relevant for the statistical errors.)\r
5148 //\r
5149 // Important: To fill fDiffFlowSumOfProductOfEventWeights[][][][] use bellow table (i,j) with following constraints: \r
5150 // 1.) i<j \r
5151 // 2.) do not store terms which DO NOT include reduced correlations;\r
5152 // Table:\r
5153 // [0=<2>,1=<2'>,2=<4>,3=<4'>,4=<6>,5=<6'>,6=<8>,7=<8'>] x [0=<2>,1=<2'>,2=<4>,3=<4'>,4=<6>,5=<6'>,6=<8>,7=<8'>]\r
5154 \r
5155 Int_t typeFlag = -1;\r
5156 Int_t ptEtaFlag = -1;\r
5157\r
5158 if(type == "RP")\r
5159 {\r
5160 typeFlag = 0;\r
5161 } else if(type == "POI")\r
5162 {\r
5163 typeFlag = 1;\r
5164 } \r
5165 \r
5166 if(ptOrEta == "Pt")\r
5167 {\r
5168 ptEtaFlag = 0;\r
5169 } else if(ptOrEta == "Eta")\r
5170 {\r
5171 ptEtaFlag = 1;\r
5172 } \r
5173 \r
5174 // shortcuts:\r
5175 Int_t t = typeFlag;\r
5176 Int_t pe = ptEtaFlag;\r
5177 \r
5178 // binning:\r
5179 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
5180 Double_t minPtEta[2] = {fPtMin,fEtaMin};\r
5181 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};\r
5182 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};\r
5183 \r
5184 // protection:\r
5185 for(Int_t rpq=0;rpq<3;rpq++)\r
5186 {\r
5187 for(Int_t m=0;m<4;m++)\r
5188 {\r
5189 for(Int_t k=0;k<9;k++)\r
5190 {\r
5191 if(!fReRPQ1dEBE[rpq][pe][m][k])\r
5192 {\r
5193 cout<<"WARNING: fReRPQ1dEBE[rpq][pe][m][k] is NULL in AFAWQC::CSAPOEWFDF() !!!!"<<endl;\r
5194 cout<<"pe = "<<pe<<endl;\r
5195 cout<<"rpq = "<<rpq<<endl;\r
5196 cout<<"m = "<<m<<endl;\r
5197 cout<<"k = "<<k<<endl;\r
5198 exit(0); \r
5199 }\r
5200 }\r
5201 }\r
5202 } \r
5203 \r
5204 // multiplicities:\r
5205 Double_t dMult = (*fSMpk)(0,0); // total event multiplicity\r
5206 //Double_t mr = 0.; // number of RPs in particular pt or eta bin\r
5207 Double_t mp = 0.; // number of POIs in particular pt or eta bin \r
5208 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin\r
5209 \r
5210 // event weights for correlations:\r
5211 Double_t dW2 = dMult*(dMult-1); // event weight for <2> \r
5212 Double_t dW4 = dMult*(dMult-1)*(dMult-2)*(dMult-3); // event weight for <4> \r
5213 Double_t dW6 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5); // event weight for <6> \r
5214 Double_t dW8 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7); // event weight for <8> \r
5215\r
5216 // event weights for reduced correlations:\r
5217 Double_t dw2 = 0.; // event weight for <2'>\r
5218 Double_t dw4 = 0.; // event weight for <4'>\r
5219 //Double_t dw6 = 0.; // event weight for <6'>\r
5220 //Double_t dw8 = 0.; // event weight for <8'>\r
5221 \r
5222 // looping over bins:\r
5223 for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
5224 {\r
5225 if(type == "RP")\r
5226 {\r
5227 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);\r
5228 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow\r
5229 } else if(type == "POI")\r
5230 {\r
5231 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);\r
5232 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b); \r
5233 }\r
5234 \r
5235 // event weight for <2'>:\r
5236 dw2 = mp*dMult-mq; \r
5237 fDiffFlowSumOfProductOfEventWeights[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw2); // storing product of even weights for <2> and <2'>\r
5238 fDiffFlowSumOfProductOfEventWeights[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW4); // storing product of even weights for <4> and <2'>\r
5239 fDiffFlowSumOfProductOfEventWeights[t][pe][1][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW6); // storing product of even weights for <6> and <2'>\r
5240 fDiffFlowSumOfProductOfEventWeights[t][pe][1][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW8); // storing product of even weights for <8> and <2'>\r
5241 \r
5242 // event weight for <4'>:\r
5243 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
5244 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.); \r
5245 fDiffFlowSumOfProductOfEventWeights[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw4); // storing product of even weights for <2> and <4'>\r
5246 fDiffFlowSumOfProductOfEventWeights[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw4); // storing product of even weights for <2'> and <4'>\r
5247 fDiffFlowSumOfProductOfEventWeights[t][pe][2][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw4); // storing product of even weights for <4> and <4'>\r
5248 fDiffFlowSumOfProductOfEventWeights[t][pe][3][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dW6); // storing product of even weights for <6> and <4'> \r
5249 fDiffFlowSumOfProductOfEventWeights[t][pe][3][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dW8); // storing product of even weights for <8> and <4'>\r
5250\r
5251 // event weight for <6'>:\r
5252 //dw6 = ...; \r
5253 //fDiffFlowSumOfProductOfEventWeights[t][pe][0][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw6); // storing product of even weights for <2> and <6'>\r
5254 //fDiffFlowSumOfProductOfEventWeights[t][pe][1][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw6); // storing product of even weights for <2'> and <6'>\r
5255 //fDiffFlowSumOfProductOfEventWeights[t][pe][2][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw6); // storing product of even weights for <4> and <6'>\r
5256 //fDiffFlowSumOfProductOfEventWeights[t][pe][3][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dw6); // storing product of even weights for <4'> and <6'> \r
5257 //fDiffFlowSumOfProductOfEventWeights[t][pe][4][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW6*dw6); // storing product of even weights for <6> and <6'>\r
5258 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dW8); // storing product of even weights for <6'> and <8>\r
5259 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dw8); // storing product of even weights for <6'> and <8'>\r
5260\r
5261 // event weight for <8'>:\r
5262 //dw8 = ...; \r
5263 //fDiffFlowSumOfProductOfEventWeights[t][pe][0][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw8); // storing product of even weights for <2> and <8'>\r
5264 //fDiffFlowSumOfProductOfEventWeights[t][pe][1][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw8); // storing product of even weights for <2'> and <8'>\r
5265 //fDiffFlowSumOfProductOfEventWeights[t][pe][2][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw8); // storing product of even weights for <4> and <8'>\r
5266 //fDiffFlowSumOfProductOfEventWeights[t][pe][3][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dw8); // storing product of even weights for <4'> and <8'> \r
5267 //fDiffFlowSumOfProductOfEventWeights[t][pe][4][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW6*dw8); // storing product of even weights for <6> and <8'>\r
5268 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dw8); // storing product of even weights for <6'> and <8'>\r
5269 //fDiffFlowSumOfProductOfEventWeights[t][pe][6][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW8*dw8); // storing product of even weights for <8> and <8'>\r
5270 \r
5271 // Table:\r
5272 // [0=<2>,1=<2'>,2=<4>,3=<4'>,4=<6>,5=<6'>,6=<8>,7=<8'>] x [0=<2>,1=<2'>,2=<4>,3=<4'>,4=<6>,5=<6'>,6=<8>,7=<8'>]\r
5273 \r
5274 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
5275 \r
5276\r
5277\r
5278} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfProductOfEventWeights(TString type, TString ptOrEta)\r
5279\r
5280\r
5281//================================================================================================================================\r
5282\r
5283\r
5284void AliFlowAnalysisWithQCumulants::FinalizeReducedCorrelations(TString type, TString ptOrEta)\r
5285{\r
5286 // Transfer profiles into histograms and calculate statistical errors correctly.\r
5287\r
5288 Int_t typeFlag = -1;\r
5289 Int_t ptEtaFlag = -1;\r
5290\r
5291 if(type == "RP")\r
5292 {\r
5293 typeFlag = 0;\r
5294 } else if(type == "POI")\r
5295 {\r
5296 typeFlag = 1;\r
5297 } \r
5298 \r
5299 if(ptOrEta == "Pt")\r
5300 {\r
5301 ptEtaFlag = 0;\r
5302 } else if(ptOrEta == "Eta")\r
5303 {\r
5304 ptEtaFlag = 1;\r
5305 } \r
5306 \r
5307 // shortcuts:\r
5308 Int_t t = typeFlag;\r
5309 Int_t pe = ptEtaFlag;\r
5310 \r
5311 for(Int_t rci=0;rci<4;rci++)\r
5312 {\r
5313 if(!fDiffFlowCorrelationsPro[t][pe][rci])\r
5314 {\r
5315 cout<<"WARNING: fDiffFlowCorrelationsPro[t][pe][rci] is NULL in AFAWQC::FRC() !!!!"<<endl;\r
5316 cout<<"t = "<<t<<endl; \r
5317 cout<<"pe = "<<pe<<endl; \r
5318 cout<<"rci = "<<rci<<endl;\r
5319 exit(0); \r
5320 }\r
5321 for(Int_t power=0;power<2;power++)\r
5322 {\r
5323 if(!fDiffFlowSumOfEventWeights[t][pe][power][rci])\r
5324 {\r
5325 cout<<"WARNING: fDiffFlowSumOfEventWeights[t][pe][power][rci] is NULL in AFAWQC::FRC() !!!!"<<endl;\r
5326 cout<<"t = "<<t<<endl; \r
5327 cout<<"pe = "<<pe<<endl;\r
5328 cout<<"power = "<<power<<endl; \r
5329 cout<<"rci = "<<rci<<endl;\r
5330 exit(0); \r
5331 } \r
5332 } // end of for(Int_t power=0;power<2;power++)\r
5333 } // end of for(Int_t rci=0;rci<4;rci++)\r
5334 \r
5335 // common:\r
5336 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
5337 \r
5338 // transfer 1D profile into 1D histogram:\r
5339 Double_t correlation = 0.;\r
5340 Double_t spread = 0.;\r
5341 Double_t sumOfWeights = 0.; // sum of weights for particular reduced correlations for particular pt or eta bin\r
5342 Double_t sumOfSquaredWeights = 0.; // sum of squared weights for particular reduced correlations for particular pt or eta bin\r
5343 Double_t error = 0.; // error = termA * spread * termB\r
5344 // termA = (sqrt(sumOfSquaredWeights)/sumOfWeights) \r
5345 // termB = 1/pow(1-termA^2,0.5)\r
5346 Double_t termA = 0.; \r
5347 Double_t termB = 0.; \r
5348 for(Int_t rci=0;rci<4;rci++) // index of reduced correlation\r
5349 {\r
5350 for(Int_t b=1;b<=nBinsPtEta[pe];b++) // number of pt or eta bins\r
5351 {\r
5352 correlation = fDiffFlowCorrelationsPro[t][pe][rci]->GetBinContent(b); \r
5353 spread = fDiffFlowCorrelationsPro[t][pe][rci]->GetBinError(b);\r
5354 sumOfWeights = fDiffFlowSumOfEventWeights[t][pe][0][rci]->GetBinContent(b);\r
5355 sumOfSquaredWeights = fDiffFlowSumOfEventWeights[t][pe][1][rci]->GetBinContent(b);\r
5356 if(sumOfWeights) termA = (pow(sumOfSquaredWeights,0.5)/sumOfWeights);\r
5357 if(1.-pow(termA,2.)>0.) termB = 1./pow(1.-pow(termA,2.),0.5); \r
5358 error = termA*spread*termB; // final error (unbiased estimator for standard deviation)\r
5359 fDiffFlowCorrelationsHist[t][pe][rci]->SetBinContent(b,correlation); \r
5360 fDiffFlowCorrelationsHist[t][pe][rci]->SetBinError(b,error); \r
5361 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
5362 } // end of for(Int_t rci=0;rci<4;rci++)\r
5363 \r
5364} // end of void AliFlowAnalysisWithQCumulants::FinalizeReducedCorrelations(TString type, TString ptOrEta)\r
5365\r
5366\r
5367//================================================================================================================================\r
5368\r
5369\r
5370void AliFlowAnalysisWithQCumulants::CalculateDiffFlowProductOfCorrelations(TString type, TString ptOrEta)\r
5371{\r
5372 // store products: <2><2'>, <2><4'>, <2><6'>, <2><8'>, <2'><4>, \r
5373 // <2'><4'>, <2'><6>, <2'><6'>, <2'><8>, <2'><8'>,\r
5374 // <4><4'>, <4><6'>, <4><8'>, <4'><6>, <4'><6'>, \r
5375 // <4'><8>, <4'><8'>, <6><6'>, <6><8'>, <6'><8>, \r
5376 // <6'><8'>, <8><8'>.\r
5377 \r
5378 Int_t typeFlag = -1;\r
5379 Int_t ptEtaFlag = -1;\r
5380\r
5381 if(type == "RP")\r
5382 {\r
5383 typeFlag = 0;\r
5384 } else if(type == "POI")\r
5385 {\r
5386 typeFlag = 1;\r
5387 } \r
5388 \r
5389 if(ptOrEta == "Pt")\r
5390 {\r
5391 ptEtaFlag = 0;\r
5392 } else if(ptOrEta == "Eta")\r
5393 {\r
5394 ptEtaFlag = 1;\r
5395 } \r
5396 \r
5397 // shortcuts:\r
5398 Int_t t = typeFlag;\r
5399 Int_t pe = ptEtaFlag;\r
5400 \r
5401 // common:\r
5402 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
5403 Double_t minPtEta[2] = {fPtMin,fEtaMin};\r
5404 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};\r
5405 \r
5406 // protections // to be improved (add protection for all pointers in this method)\r
5407 if(!fIntFlowCorrelationsEBE)\r
5408 {\r
5409 cout<<"WARNING: fIntFlowCorrelationsEBE is NULL in AFAWQC::CDFPOC() !!!!"<<endl;\r
5410 exit(0);\r
5411 } \r
5412 \r
5413 /* \r
5414 Double_t dMult = (*fSMpk)(0,0); // multiplicity (number of particles used to determine the reaction plane)\r
5415 //Double_t mr = 0.; // number of RPs in particular pt or eta bin\r
5416 Double_t mp = 0.; // number of POIs in particular pt or eta bin \r
5417 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin\r
5418 */\r
5419\r
5420 // e-b-e correlations:\r
5421 Double_t twoEBE = fIntFlowCorrelationsEBE->GetBinContent(1); // <2>\r
5422 Double_t fourEBE = fIntFlowCorrelationsEBE->GetBinContent(2); // <4>\r
5423 Double_t sixEBE = fIntFlowCorrelationsEBE->GetBinContent(3); // <6>\r
5424 Double_t eightEBE = fIntFlowCorrelationsEBE->GetBinContent(4); // <8>\r
5425 \r
5426 // event weights for correlations:\r
5427 Double_t dW2 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1); // event weight for <2> \r
5428 Double_t dW4 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2); // event weight for <4> \r
5429 Double_t dW6 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(3); // event weight for <6> \r
5430 Double_t dW8 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(4); // event weight for <8> \r
5431 \r
5432 // e-b-e reduced correlations:\r
5433 Double_t twoReducedEBE = 0.; // <2'>\r
5434 Double_t fourReducedEBE = 0.; // <4'>\r
5435 Double_t sixReducedEBE = 0.; // <6'>\r
5436 Double_t eightReducedEBE = 0.; // <8'> \r
5437 \r
5438 // event weights for reduced correlations:\r
5439 Double_t dw2 = 0.; // event weight for <2'>\r
5440 Double_t dw4 = 0.; // event weight for <4'>\r
5441 //Double_t dw6 = 0.; // event weight for <6'>\r
5442 //Double_t dw8 = 0.; // event weight for <8'>\r
5443\r
5444 // looping over bins:\r
5445 for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
5446 {\r
5447 // e-b-e reduced correlations:\r
5448 twoReducedEBE = fDiffFlowCorrelationsEBE[t][pe][0]->GetBinContent(b);\r
5449 fourReducedEBE = fDiffFlowCorrelationsEBE[t][pe][1]->GetBinContent(b);\r
5450 sixReducedEBE = fDiffFlowCorrelationsEBE[t][pe][2]->GetBinContent(b);\r
5451 eightReducedEBE = fDiffFlowCorrelationsEBE[t][pe][3]->GetBinContent(b);\r
5452 \r
5453 /*\r
5454 // to be improved (I should not do this here again)\r
5455 if(type == "RP")\r
5456 {\r
5457 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);\r
5458 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow\r
5459 } else if(type == "POI")\r
5460 {\r
5461 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);\r
5462 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b); \r
5463 }\r
5464 \r
5465 // event weights for reduced correlations:\r
5466 dw2 = mp*dMult-mq; // weight for <2'> \r
5467 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
5468 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.); // weight for <4'>\r
5469 //dw6 = ... \r
5470 //dw8 = ... \r
5471 \r
5472 */\r
5473 \r
5474 dw2 = fDiffFlowEventWeightsForCorrelationsEBE[t][pe][0]->GetBinContent(b);\r
5475 dw4 = fDiffFlowEventWeightsForCorrelationsEBE[t][pe][1]->GetBinContent(b);\r
5476 \r
5477 // storing all products:\r
5478 fDiffFlowProductOfCorrelationsPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*twoReducedEBE,dW2*dw2); // storing <2><2'>\r
5479 fDiffFlowProductOfCorrelationsPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*twoReducedEBE,dW4*dw2); // storing <4><2'>\r
5480 fDiffFlowProductOfCorrelationsPro[t][pe][1][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*twoReducedEBE,dW6*dw2); // storing <6><2'>\r
5481 fDiffFlowProductOfCorrelationsPro[t][pe][1][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*twoReducedEBE,dW8*dw2); // storing <8><2'>\r
5482 \r
5483 // event weight for <4'>:\r
5484 fDiffFlowProductOfCorrelationsPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*fourReducedEBE,dW2*dw4); // storing <2><4'>\r
5485 fDiffFlowProductOfCorrelationsPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*fourReducedEBE,dw2*dw4); // storing <2'><4'>\r
5486 fDiffFlowProductOfCorrelationsPro[t][pe][2][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*fourReducedEBE,dW4*dw4); // storing <4><4'>\r
5487 fDiffFlowProductOfCorrelationsPro[t][pe][3][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*fourReducedEBE,dW6*dw4); // storing <6><4'> \r
5488 fDiffFlowProductOfCorrelationsPro[t][pe][3][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*fourReducedEBE,dW8*dw4); // storing <8><4'>\r
5489\r
5490 // event weight for <6'>:\r
5491 //dw6 = ...; \r
5492 //fDiffFlowProductOfCorrelationsPro[t][pe][0][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*sixReducedEBE,dW2*dw6); // storing <2><6'>\r
5493 //fDiffFlowProductOfCorrelationsPro[t][pe][1][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*sixReducedEBE,dw2*dw6); // storing <2'><6'>\r
5494 //fDiffFlowProductOfCorrelationsPro[t][pe][2][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*sixReducedEBE,dW4*dw6); // storing <4><6'>\r
5495 //fDiffFlowProductOfCorrelationsPro[t][pe][3][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourReducedEBE*sixReducedEBE,dw4*dw6); // storing <4'><6'> \r
5496 //fDiffFlowProductOfCorrelationsPro[t][pe][4][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*sixReducedEBE,dW6*dw6); // storing <6><6'>\r
5497 //fDiffFlowProductOfCorrelationsPro[t][pe][5][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightEBE,dw6*dW8); // storing <6'><8>\r
5498 //fDiffFlowProductOfCorrelationsPro[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightReducedEBE,dw6*dw8); // storing <6'><8'>\r
5499\r
5500 // event weight for <8'>:\r
5501 //dw8 = ...; \r
5502 //fDiffFlowProductOfCorrelationsPro[t][pe][0][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*eightReducedEBE,dW2*dw8); // storing <2><8'>\r
5503 //fDiffFlowProductOfCorrelationsPro[t][pe][1][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*eightReducedEBE,dw2*dw8); // storing <2'><8'>\r
5504 //fDiffFlowProductOfCorrelationsPro[t][pe][2][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*eightReducedEBE,dW4*dw8); // storing <4><8'>\r
5505 //fDiffFlowProductOfCorrelationsPro[t][pe][3][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourReducedEBE*eightReducedEBE,dw4*dw8); // storing <4'><8'> \r
5506 //fDiffFlowProductOfCorrelationsPro[t][pe][4][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*eightReducedEBE,dW6*dw8); // storing <6><8'>\r
5507 //fDiffFlowProductOfCorrelationsPro[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightReducedEBE,dw6*dw8); // storing <6'><8'>\r
5508 //fDiffFlowProductOfCorrelationsPro[t][pe][6][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*eightReducedEBE,dW8*dw8); // storing <8><8'> \r
5509 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++ \r
5510 \r
5511} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowProductOfCorrelations(TString type, TString ptOrEta)\r
5512\r
5513\r
5514//================================================================================================================================\r
5515 \r
5516 \r
5517void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCovariances(TString type, TString ptOrEta) // to be improved (reimplemented)\r
5518{\r
5519 // a) Calculate unbiased estimators Cov(<2>,<2'>), Cov(<2>,<4'>), Cov(<4>,<2'>), Cov(<4>,<4'>) and Cov(<2'>,<4'>)\r
5520 // for covariances V(<2>,<2'>), V(<2>,<4'>), V(<4>,<2'>), V(<4>,<4'>) and V(<2'>,<4'>). \r
5521 // b) Store in histogram fDiffFlowCovariances[t][pe][index] for instance the following: \r
5522 //\r
5523 // Cov(<2>,<2'>) * (sum_{i=1}^{N} w_{<2>}_i w_{<2'>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<2'>}_j)]\r
5524 // \r
5525 // where N is the number of events, w_{<2>} is event weight for <2> and w_{<2'>} is event weight for <2'>.\r
5526 // c) Binning of fDiffFlowCovariances[t][pe][index] is organized as follows:\r
5527 // \r
5528 // 1st bin: Cov(<2>,<2'>) * (sum_{i=1}^{N} w_{<2>}_i w_{<2'>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<2'>}_j)] \r
5529 // 2nd bin: Cov(<2>,<4'>) * (sum_{i=1}^{N} w_{<2>}_i w_{<4'>}_i )/[(sum_{i=1}^{N} w_{<2>}_i) * (sum_{j=1}^{N} w_{<4'>}_j)] \r
5530 // 3rd bin: Cov(<4>,<2'>) * (sum_{i=1}^{N} w_{<4>}_i w_{<2'>}_i )/[(sum_{i=1}^{N} w_{<4>}_i) * (sum_{j=1}^{N} w_{<2'>}_j)] \r
5531 // 4th bin: Cov(<4>,<4'>) * (sum_{i=1}^{N} w_{<4>}_i w_{<4'>}_i )/[(sum_{i=1}^{N} w_{<4>}_i) * (sum_{j=1}^{N} w_{<4'>}_j)] \r
5532 // 5th bin: Cov(<2'>,<4'>) * (sum_{i=1}^{N} w_{<2'>}_i w_{<4'>}_i )/[(sum_{i=1}^{N} w_{<2'>}_i) * (sum_{j=1}^{N} w_{<4'>}_j)] \r
5533 // ...\r
5534 \r
5535 Int_t typeFlag = -1;\r
5536 Int_t ptEtaFlag = -1;\r
5537\r
5538 if(type == "RP")\r
5539 {\r
5540 typeFlag = 0;\r
5541 } else if(type == "POI")\r
5542 {\r
5543 typeFlag = 1;\r
5544 } \r
5545 \r
5546 if(ptOrEta == "Pt")\r
5547 {\r
5548 ptEtaFlag = 0;\r
5549 } else if(ptOrEta == "Eta")\r
5550 {\r
5551 ptEtaFlag = 1;\r
5552 } \r
5553 \r
5554 // shortcuts:\r
5555 Int_t t = typeFlag;\r
5556 Int_t pe = ptEtaFlag;\r
5557 \r
5558 // common:\r
5559 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
5560 //Double_t minPtEta[2] = {fPtMin,fEtaMin};\r
5561 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};\r
5562 //Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};\r
5563 \r
5564 // average correlations:\r
5565 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>\r
5566 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>\r
5567 //Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>\r
5568 //Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>\r
5569 \r
5570 // sum of weights for correlation:\r
5571 Double_t sumOfWeightsForTwo = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // sum_{i=1}^{N} w_{<2>}\r
5572 Double_t sumOfWeightsForFour = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // sum_{i=1}^{N} w_{<4>}\r
5573 //Double_t sumOfWeightsForSix = fIntFlowSumOfEventWeights[0]->GetBinContent(3); // sum_{i=1}^{N} w_{<6>}\r
5574 //Double_t sumOfWeightsForEight = fIntFlowSumOfEventWeights[0]->GetBinContent(4); // sum_{i=1}^{N} w_{<8>}\r
5575 \r
5576 // average reduced correlations:\r
5577 Double_t twoReduced = 0.; // <<2'>> \r
5578 Double_t fourReduced = 0.; // <<4'>>\r
5579 //Double_t sixReduced = 0.; // <<6'>>\r
5580 //Double_t eightReduced = 0.; // <<8'>>\r
5581\r
5582 // sum of weights for reduced correlation:\r
5583 Double_t sumOfWeightsForTwoReduced = 0.; // sum_{i=1}^{N} w_{<2'>}\r
5584 Double_t sumOfWeightsForFourReduced = 0.; // sum_{i=1}^{N} w_{<4'>}\r
5585 //Double_t sumOfWeightsForSixReduced = 0.; // sum_{i=1}^{N} w_{<6'>}\r
5586 //Double_t sumOfWeightsForEightReduced = 0.; // sum_{i=1}^{N} w_{<8'>}\r
5587 \r
5588 // product of weights for reduced correlation:\r
5589 Double_t productOfWeightsForTwoTwoReduced = 0.; // sum_{i=1}^{N} w_{<2>}w_{<2'>}\r
5590 Double_t productOfWeightsForTwoFourReduced = 0.; // sum_{i=1}^{N} w_{<2>}w_{<4'>}\r
5591 Double_t productOfWeightsForFourTwoReduced = 0.; // sum_{i=1}^{N} w_{<4>}w_{<2'>}\r
5592 Double_t productOfWeightsForFourFourReduced = 0.; // sum_{i=1}^{N} w_{<4>}w_{<4'>}\r
5593 Double_t productOfWeightsForTwoReducedFourReduced = 0.; // sum_{i=1}^{N} w_{<2'>}w_{<4'>}\r
5594 // ...\r
5595 \r
5596 // products for differential flow:\r
5597 Double_t twoTwoReduced = 0; // <<2><2'>> \r
5598 Double_t twoFourReduced = 0; // <<2><4'>> \r
5599 Double_t fourTwoReduced = 0; // <<4><2'>> \r
5600 Double_t fourFourReduced = 0; // <<4><4'>> \r
5601 Double_t twoReducedFourReduced = 0; // <<2'><4'>> \r
5602\r
5603 // denominators in the expressions for the unbiased estimators for covariances:\r
5604 // denominator = 1 - term1/(term2*term3)\r
5605 // prefactor = term1/(term2*term3)\r
5606 Double_t denominator = 0.; \r
5607 Double_t prefactor = 0.;\r
5608 Double_t term1 = 0.; \r
5609 Double_t term2 = 0.; \r
5610 Double_t term3 = 0.; \r
5611 \r
5612 // unbiased estimators for covariances for differential flow:\r
5613 Double_t covTwoTwoReduced = 0.; // Cov(<2>,<2'>)\r
5614 Double_t wCovTwoTwoReduced = 0.; // Cov(<2>,<2'>) * prefactor(w_{<2>},w_{<2'>})\r
5615 Double_t covTwoFourReduced = 0.; // Cov(<2>,<4'>)\r
5616 Double_t wCovTwoFourReduced = 0.; // Cov(<2>,<4'>) * prefactor(w_{<2>},w_{<4'>})\r
5617 Double_t covFourTwoReduced = 0.; // Cov(<4>,<2'>)\r
5618 Double_t wCovFourTwoReduced = 0.; // Cov(<4>,<2'>) * prefactor(w_{<4>},w_{<2'>})\r
5619 Double_t covFourFourReduced = 0.; // Cov(<4>,<4'>)\r
5620 Double_t wCovFourFourReduced = 0.; // Cov(<4>,<4'>) * prefactor(w_{<4>},w_{<4'>})\r
5621 Double_t covTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>)\r
5622 Double_t wCovTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>) * prefactor(w_{<2'>},w_{<4'>})\r
5623 \r
5624 for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
5625 {\r
5626 // average reduced corelations:\r
5627 twoReduced = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b);\r
5628 fourReduced = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b);\r
5629 // average products:\r
5630 twoTwoReduced = fDiffFlowProductOfCorrelationsPro[t][pe][0][1]->GetBinContent(b);\r
5631 twoFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][0][3]->GetBinContent(b);\r
5632 fourTwoReduced = fDiffFlowProductOfCorrelationsPro[t][pe][1][2]->GetBinContent(b);\r
5633 fourFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][2][3]->GetBinContent(b);\r
5634 twoReducedFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][1][3]->GetBinContent(b); \r
5635 // sum of weights for reduced correlations:\r
5636 sumOfWeightsForTwoReduced = fDiffFlowSumOfEventWeights[t][pe][0][0]->GetBinContent(b);\r
5637 sumOfWeightsForFourReduced = fDiffFlowSumOfEventWeights[t][pe][0][1]->GetBinContent(b);\r
5638 // products of weights for correlations:\r
5639 productOfWeightsForTwoTwoReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][0][1]->GetBinContent(b); \r
5640 productOfWeightsForTwoFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][0][3]->GetBinContent(b);\r
5641 productOfWeightsForFourTwoReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][1][2]->GetBinContent(b);\r
5642 productOfWeightsForFourFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][2][3]->GetBinContent(b);\r
5643 productOfWeightsForTwoReducedFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][1][3]->GetBinContent(b);\r
5644 // denominator for the unbiased estimator for covariances: 1 - term1/(term2*term3) \r
5645 // prefactor (multiplies Cov's) = term1/(term2*term3) \r
5646 // <2>,<2'>:\r
5647 term1 = productOfWeightsForTwoTwoReduced; \r
5648 term2 = sumOfWeightsForTwo;\r
5649 term3 = sumOfWeightsForTwoReduced; \r
5650 if(term2*term3>0.)\r
5651 {\r
5652 denominator = 1.-term1/(term2*term3);\r
5653 prefactor = term1/(term2*term3);\r
5654 if(denominator!=0)\r
5655 {\r
5656 covTwoTwoReduced = (twoTwoReduced-two*twoReduced)/denominator; \r
5657 wCovTwoTwoReduced = covTwoTwoReduced*prefactor; \r
5658 fDiffFlowCovariances[t][pe][0]->SetBinContent(b,wCovTwoTwoReduced);\r
5659 }\r
5660 }\r
5661 // <2>,<4'>:\r
5662 term1 = productOfWeightsForTwoFourReduced; \r
5663 term2 = sumOfWeightsForTwo;\r
5664 term3 = sumOfWeightsForFourReduced; \r
5665 if(term2*term3>0.)\r
5666 {\r
5667 denominator = 1.-term1/(term2*term3);\r
5668 prefactor = term1/(term2*term3);\r
5669 if(denominator!=0)\r
5670 {\r
5671 covTwoFourReduced = (twoFourReduced-two*fourReduced)/denominator; \r
5672 wCovTwoFourReduced = covTwoFourReduced*prefactor; \r
5673 fDiffFlowCovariances[t][pe][1]->SetBinContent(b,wCovTwoFourReduced);\r
5674 }\r
5675 }\r
5676 // <4>,<2'>:\r
5677 term1 = productOfWeightsForFourTwoReduced; \r
5678 term2 = sumOfWeightsForFour;\r
5679 term3 = sumOfWeightsForTwoReduced; \r
5680 if(term2*term3>0.)\r
5681 {\r
5682 denominator = 1.-term1/(term2*term3);\r
5683 prefactor = term1/(term2*term3);\r
5684 if(denominator!=0)\r
5685 {\r
5686 covFourTwoReduced = (fourTwoReduced-four*twoReduced)/denominator; \r
5687 wCovFourTwoReduced = covFourTwoReduced*prefactor; \r
5688 fDiffFlowCovariances[t][pe][2]->SetBinContent(b,wCovFourTwoReduced);\r
5689 }\r
5690 }\r
5691 // <4>,<4'>:\r
5692 term1 = productOfWeightsForFourFourReduced; \r
5693 term2 = sumOfWeightsForFour;\r
5694 term3 = sumOfWeightsForFourReduced; \r
5695 if(term2*term3>0.)\r
5696 {\r
5697 denominator = 1.-term1/(term2*term3);\r
5698 prefactor = term1/(term2*term3);\r
5699 if(denominator!=0)\r
5700 {\r
5701 covFourFourReduced = (fourFourReduced-four*fourReduced)/denominator; \r
5702 wCovFourFourReduced = covFourFourReduced*prefactor; \r
5703 fDiffFlowCovariances[t][pe][3]->SetBinContent(b,wCovFourFourReduced);\r
5704 }\r
5705 }\r
5706 // <2'>,<4'>:\r
5707 term1 = productOfWeightsForTwoReducedFourReduced; \r
5708 term2 = sumOfWeightsForTwoReduced;\r
5709 term3 = sumOfWeightsForFourReduced; \r
5710 if(term2*term3>0.)\r
5711 {\r
5712 denominator = 1.-term1/(term2*term3);\r
5713 prefactor = term1/(term2*term3);\r
5714 if(denominator!=0)\r
5715 {\r
5716 covTwoReducedFourReduced = (twoReducedFourReduced-twoReduced*fourReduced)/denominator; \r
5717 wCovTwoReducedFourReduced = covTwoReducedFourReduced*prefactor; \r
5718 fDiffFlowCovariances[t][pe][4]->SetBinContent(b,wCovTwoReducedFourReduced);\r
5719 }\r
5720 } \r
5721 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
5722 \r
5723} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCovariances(TString type, TString ptOrEta)\r
5724\r
5725\r
5726//================================================================================================================================\r
5727\r
5728\r
5729void AliFlowAnalysisWithQCumulants::CalculateDiffFlow(TString type, TString ptOrEta)\r
5730{\r
5731 // calculate differential flow from differential cumulants and previously obtained integrated flow: (to be improved: description)\r
5732 \r
5733 Int_t typeFlag = -1;\r
5734 Int_t ptEtaFlag = -1;\r
5735\r
5736 if(type == "RP")\r
5737 {\r
5738 typeFlag = 0;\r
5739 } else if(type == "POI")\r
5740 {\r
5741 typeFlag = 1;\r
5742 } \r
5743 \r
5744 if(ptOrEta == "Pt")\r
5745 {\r
5746 ptEtaFlag = 0;\r
5747 } else if(ptOrEta == "Eta")\r
5748 {\r
5749 ptEtaFlag = 1;\r
5750 } \r
5751 \r
5752 // shortcuts:\r
5753 Int_t t = typeFlag;\r
5754 Int_t pe = ptEtaFlag;\r
5755 \r
5756 // common:\r
5757 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
5758 \r
5759 // correlations:\r
5760 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>\r
5761 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>\r
5762 \r
5763 // statistical errors of correlations:\r
5764 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1);\r
5765 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); \r
5766 \r
5767 // reduced correlations:\r
5768 Double_t twoReduced = 0.; // <<2'>>\r
5769 Double_t fourReduced = 0.; // <<4'>>\r
5770 \r
5771 // statistical errors of reduced correlations:\r
5772 Double_t twoReducedError = 0.; \r
5773 Double_t fourReducedError = 0.; \r
5774\r
5775 // covariances:\r
5776 Double_t wCovTwoFour = fIntFlowCovariances->GetBinContent(1);// // Cov(<2>,<4>) * prefactor(<2>,<4>)\r
5777 Double_t wCovTwoTwoReduced = 0.; // Cov(<2>,<2'>) * prefactor(<2>,<2'>)\r
5778 Double_t wCovTwoFourReduced = 0.; // Cov(<2>,<4'>) * prefactor(<2>,<4'>)\r
5779 Double_t wCovFourTwoReduced = 0.; // Cov(<4>,<2'>) * prefactor(<4>,<2'>)\r
5780 Double_t wCovFourFourReduced = 0.; // Cov(<4>,<4'>) * prefactor(<4>,<4'>)\r
5781 Double_t wCovTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>) * prefactor(<2'>,<4'>)\r
5782 \r
5783 // differential flow:\r
5784 Double_t v2Prime = 0.; // v'{2} \r
5785 Double_t v4Prime = 0.; // v'{4}\r
5786 \r
5787 // statistical error of differential flow:\r
5788 Double_t v2PrimeError = 0.; \r
5789 Double_t v4PrimeError = 0.; \r
5790 \r
5791 // squared statistical error of differential flow:\r
5792 Double_t v2PrimeErrorSquared = 0.; \r
5793 Double_t v4PrimeErrorSquared = 0.; \r
5794 \r
5795 // loop over pt or eta bins:\r
5796 for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
5797 {\r
5798 // reduced correlations and statistical errors:\r
5799 twoReduced = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b);\r
5800 twoReducedError = fDiffFlowCorrelationsHist[t][pe][0]->GetBinError(b);\r
5801 fourReduced = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b);\r
5802 fourReducedError = fDiffFlowCorrelationsHist[t][pe][1]->GetBinError(b);\r
5803 // covariances:\r
5804 wCovTwoTwoReduced = fDiffFlowCovariances[t][pe][0]->GetBinContent(b);\r
5805 wCovTwoFourReduced = fDiffFlowCovariances[t][pe][1]->GetBinContent(b);\r
5806 wCovFourTwoReduced = fDiffFlowCovariances[t][pe][2]->GetBinContent(b);\r
5807 wCovFourFourReduced = fDiffFlowCovariances[t][pe][3]->GetBinContent(b);\r
5808 wCovTwoReducedFourReduced = fDiffFlowCovariances[t][pe][4]->GetBinContent(b);\r
5809 // differential flow:\r
5810 // v'{2}:\r
5811 if(two>0.) \r
5812 {\r
5813 v2Prime = twoReduced/pow(two,0.5);\r
5814 v2PrimeErrorSquared = (1./4.)*pow(two,-3.)*\r
5815 (pow(twoReduced,2.)*pow(twoError,2.)\r
5816 + 4.*pow(two,2.)*pow(twoReducedError,2.)\r
5817 - 4.*two*twoReduced*wCovTwoTwoReduced);\r
5818 \r
5819 \r
5820 if(v2PrimeErrorSquared>0.) v2PrimeError = pow(v2PrimeErrorSquared,0.5);\r
5821 fDiffFlow[t][pe][0]->SetBinContent(b,v2Prime); \r
5822 fDiffFlow[t][pe][0]->SetBinError(b,v2PrimeError); \r
5823 }\r
5824 // differential flow:\r
5825 // v'{4}\r
5826 if(2.*pow(two,2.)-four > 0.) \r
5827 {\r
5828 v4Prime = (2.*two*twoReduced-fourReduced)/pow(2.*pow(two,2.)-four,3./4.);\r
5829 v4PrimeErrorSquared = pow(2.*pow(two,2.)-four,-7./2.)*\r
5830 (pow(2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced,2.)*pow(twoError,2.)\r
5831 + (9./16.)*pow(2.*two*twoReduced-fourReduced,2.)*pow(fourError,2.)\r
5832 + 4.*pow(two,2.)*pow(2.*pow(two,2.)-four,2.)*pow(twoReducedError,2.)\r
5833 + pow(2.*pow(two,2.)-four,2.)*pow(fourReducedError,2.) \r
5834 - (3./2.)*(2.*two*twoReduced-fourReduced)\r
5835 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoFour\r
5836 - 4.*two*(2.*pow(two,2.)-four)\r
5837 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoTwoReduced\r
5838 + 2.*(2.*pow(two,2.)-four)\r
5839 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoFourReduced\r
5840 + 3.*two*(2.*pow(two,2.)-four)*(2.*two*twoReduced-fourReduced)*wCovFourTwoReduced\r
5841 - (3./2.)*(2.*pow(two,2.)-four)*(2.*two*twoReduced-fourReduced)*wCovFourFourReduced \r
5842 - 4.*two*pow(2.*pow(two,2.)-four,2.)*wCovTwoReducedFourReduced); \r
5843 if(v4PrimeErrorSquared>0.) v4PrimeError = pow(v4PrimeErrorSquared,0.5); \r
5844 fDiffFlow[t][pe][1]->SetBinContent(b,v4Prime);\r
5845 fDiffFlow[t][pe][1]->SetBinError(b,v4PrimeError); \r
5846 }\r
5847 \r
5848 } // end of for(Int_t b=1;b<=fnBinsPtEta[pe];b++)\r
5849 \r
5850 \r
5851 \r
5852 \r
5853 /*\r
5854 // 2D:\r
5855 for(Int_t nua=0;nua<2;nua++)\r
5856 {\r
5857 for(Int_t p=1;p<=fnBinsPt;p++)\r
5858 {\r
5859 for(Int_t e=1;e<=fnBinsEta;e++) \r
5860 { \r
5861 // differential cumulants:\r
5862 Double_t qc2Prime = fFinalCumulants2D[t][pW][eW][nua][0]->GetBinContent(fFinalCumulants2D[t][pW][eW][nua][0]->GetBin(p,e)); // QC{2'} \r
5863 Double_t qc4Prime = fFinalCumulants2D[t][pW][eW][nua][1]->GetBinContent(fFinalCumulants2D[t][pW][eW][nua][1]->GetBin(p,e)); // QC{4'}\r
5864 // differential flow:\r
5865 Double_t v2Prime = 0.; \r
5866 Double_t v4Prime = 0.; \r
5867 if(v2) \r
5868 {\r
5869 v2Prime = qc2Prime/v2;\r
5870 fFinalFlow2D[t][pW][eW][nua][0]->SetBinContent(fFinalFlow2D[t][pW][eW][nua][0]->GetBin(p,e),v2Prime); \r
5871 } \r
5872 if(v4)\r
5873 {\r
5874 v4Prime = -qc4Prime/pow(v4,3.); \r
5875 fFinalFlow2D[t][pW][eW][nua][1]->SetBinContent(fFinalFlow2D[t][pW][eW][nua][1]->GetBin(p,e),v4Prime); \r
5876 } \r
5877 } // end of for(Int_t e=1;e<=fnBinsEta;e++)\r
5878 } // end of for(Int_t p=1;p<=fnBinsPt;p++)\r
5879 } // end of for(Int_t nua=0;nua<2;nua++)\r
5880 */\r
5881\r
5882} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlow(TString type, Bool_t useParticleWeights)\r
5883\r
5884\r
5885//================================================================================================================================\r
5886\r
5887\r
5888void AliFlowAnalysisWithQCumulants::StoreIntFlowFlags()\r
5889{\r
5890 // a) Store all flags for integrated flow in profile fIntFlowFlags.\r
5891 \r
5892 if(!fIntFlowFlags)\r
5893 {\r
5894 cout<<"WARNING: fIntFlowFlags is NULL in AFAWQC::SFFIF() !!!!"<<endl;\r
5895 exit(0);\r
5896 } \r
5897\r
5898 fIntFlowFlags->Fill(0.5,(Int_t)fUsePhiWeights||fUsePtWeights||fUseEtaWeights); // particle weights used or not\r
5899 //fIntFlowFlags->Fill(1.5,""); // which event weight was used? // to be improved\r
5900 fIntFlowFlags->Fill(2.5,(Int_t)fApplyCorrectionForNUA); // corrected for non-uniform acceptance or not\r
5901 \r
5902} // end of void AliFlowAnalysisWithQCumulants::StoreIntFlowFlags()\r
5903\r
5904\r
5905//================================================================================================================================\r
5906\r
5907\r
5908void AliFlowAnalysisWithQCumulants::StoreDiffFlowFlags()\r
5909{\r
5910 // Store all flags for differential flow in the profile fDiffFlowFlags.\r
5911 \r
5912 if(!fDiffFlowFlags)\r
5913 {\r
5914 cout<<"WARNING: fDiffFlowFlags is NULL in AFAWQC::SFFDF() !!!!"<<endl;\r
5915 exit(0);\r
5916 } \r
5917 \r
5918 fDiffFlowFlags->Fill(0.5,fUsePhiWeights||fUsePtWeights||fUseEtaWeights); // particle weights used or not\r
5919 //fDiffFlowFlags->Fill(1.5,""); // which event weight was used? // to be improved\r
5920 fDiffFlowFlags->Fill(2.5,fApplyCorrectionForNUA); // corrected for non-uniform acceptance or not\r
5921 fDiffFlowFlags->Fill(3.5,fCalculate2DFlow); // calculate also 2D differential flow in (pt,eta) or not\r
5922 \r
5923} // end of void AliFlowAnalysisWithQCumulants::StoreDiffFlowFlags()\r
5924\r
5925\r
5926//================================================================================================================================\r
5927\r
5928\r
5929void AliFlowAnalysisWithQCumulants::GetPointersForCommonHistograms(TList *outputListHistos) \r
5930{\r
5931 // Access all pointers to common control and common result histograms and profiles.\r
5932 \r
5933 if(outputListHistos) \r
5934 {\r
5935 TString commonHistsName = "AliFlowCommonHistQC";\r
5936 commonHistsName += fAnalysisLabel->Data();\r
5937 AliFlowCommonHist *commonHist = dynamic_cast<AliFlowCommonHist*>(outputListHistos->FindObject(commonHistsName.Data()));\r
5938 if(commonHist) this->SetCommonHists(commonHist); \r
5939 TString commonHists2ndOrderName = "AliFlowCommonHist2ndOrderQC";\r
5940 commonHists2ndOrderName += fAnalysisLabel->Data();\r
5941 AliFlowCommonHist *commonHist2nd = dynamic_cast<AliFlowCommonHist*>(outputListHistos->FindObject(commonHists2ndOrderName.Data()));\r
5942 if(commonHist2nd) this->SetCommonHists2nd(commonHist2nd); \r
5943 TString commonHists4thOrderName = "AliFlowCommonHist4thOrderQC";\r
5944 commonHists4thOrderName += fAnalysisLabel->Data();\r
5945 AliFlowCommonHist *commonHist4th = dynamic_cast<AliFlowCommonHist*>(outputListHistos->FindObject(commonHists4thOrderName.Data()));\r
5946 if(commonHist4th) this->SetCommonHists4th(commonHist4th); \r
5947 TString commonHists6thOrderName = "AliFlowCommonHist6thOrderQC";\r
5948 commonHists6thOrderName += fAnalysisLabel->Data();\r
5949 AliFlowCommonHist *commonHist6th = dynamic_cast<AliFlowCommonHist*>(outputListHistos->FindObject(commonHists6thOrderName.Data()));\r
5950 if(commonHist6th) this->SetCommonHists6th(commonHist6th); \r
5951 TString commonHists8thOrderName = "AliFlowCommonHist8thOrderQC";\r
5952 commonHists8thOrderName += fAnalysisLabel->Data();\r
5953 AliFlowCommonHist *commonHist8th = dynamic_cast<AliFlowCommonHist*>(outputListHistos->FindObject(commonHists8thOrderName.Data()));\r
5954 if(commonHist8th) this->SetCommonHists8th(commonHist8th); \r
5955 TString commonHistResults2ndOrderName = "AliFlowCommonHistResults2ndOrderQC"; \r
5956 commonHistResults2ndOrderName += fAnalysisLabel->Data(); \r
5957 AliFlowCommonHistResults *commonHistRes2nd = dynamic_cast<AliFlowCommonHistResults*>\r
5958 (outputListHistos->FindObject(commonHistResults2ndOrderName.Data()));\r
5959 if(commonHistRes2nd) this->SetCommonHistsResults2nd(commonHistRes2nd); \r
5960 TString commonHistResults4thOrderName = "AliFlowCommonHistResults4thOrderQC";\r
5961 commonHistResults4thOrderName += fAnalysisLabel->Data();\r
5962 AliFlowCommonHistResults *commonHistRes4th = dynamic_cast<AliFlowCommonHistResults*>\r
5963 (outputListHistos->FindObject(commonHistResults4thOrderName.Data()));\r
5964 if(commonHistRes4th) this->SetCommonHistsResults4th(commonHistRes4th); \r
5965 TString commonHistResults6thOrderName = "AliFlowCommonHistResults6thOrderQC";\r
5966 commonHistResults6thOrderName += fAnalysisLabel->Data();\r
5967 AliFlowCommonHistResults *commonHistRes6th = dynamic_cast<AliFlowCommonHistResults*>\r
5968 (outputListHistos->FindObject(commonHistResults6thOrderName.Data()));\r
5969 if(commonHistRes6th) this->SetCommonHistsResults6th(commonHistRes6th); \r
5970 TString commonHistResults8thOrderName = "AliFlowCommonHistResults8thOrderQC";\r
5971 commonHistResults8thOrderName += fAnalysisLabel->Data();\r
5972 AliFlowCommonHistResults *commonHistRes8th = dynamic_cast<AliFlowCommonHistResults*>\r
5973 (outputListHistos->FindObject(commonHistResults8thOrderName.Data())); \r
5974 if(commonHistRes8th) this->SetCommonHistsResults8th(commonHistRes8th);\r
5975 } else\r
5976 {\r
5977 cout<<"WARNING: outputListHistos is NULL in AFAWQC::GPFCH() !!!!"<<endl;\r
5978 exit(0);\r
5979 }\r
5980 \r
5981} // end of void AliFlowAnalysisWithQCumulants::GetPointersForCommonHistograms(TList *outputListHistos) \r
5982\r
5983\r
5984//================================================================================================================================\r
5985\r
5986\r
5987void AliFlowAnalysisWithQCumulants::GetPointersForParticleWeightsHistograms(TList *outputListHistos) \r
5988{\r
5989 // Get pointers for histograms with particle weights.\r
5990\r
5991 if(outputListHistos)\r
5992 {\r
5993 TList *weightsList = dynamic_cast<TList*>(outputListHistos->FindObject("Weights"));\r
5994 if(weightsList) this->SetWeightsList(weightsList);\r
5995 TString fUseParticleWeightsName = "fUseParticleWeightsQC"; // to be improved (hirdwired label QC)\r
5996 fUseParticleWeightsName += fAnalysisLabel->Data();\r
5997 TProfile *useParticleWeights = dynamic_cast<TProfile*>(weightsList->FindObject(fUseParticleWeightsName.Data()));\r
5998 if(useParticleWeights)\r
5999 {\r
6000 this->SetUseParticleWeights(useParticleWeights); \r
6001 fUsePhiWeights = (Int_t)fUseParticleWeights->GetBinContent(1); \r
6002 fUsePtWeights = (Int_t)fUseParticleWeights->GetBinContent(2); \r
6003 fUseEtaWeights = (Int_t)fUseParticleWeights->GetBinContent(3); \r
6004 }\r
6005 } else\r
6006 {\r
6007 cout<<"WARNING: outputListHistos is NULL in AFAWQC::GPFPWH() !!!!"<<endl;\r
6008 exit(0);\r
6009 }\r
6010\r
6011} // end of void AliFlowAnalysisWithQCumulants::GetPointersForParticleWeightsHistograms(TList *outputListHistos); \r
6012\r
6013\r
6014//================================================================================================================================\r
6015\r
6016\r
6017void AliFlowAnalysisWithQCumulants::GetPointersForIntFlowHistograms(TList *outputListHistos) \r
6018{\r
6019 // Get pointers for histograms and profiles relevant for integrated flow:\r
6020 // a) Get pointer to base list for integrated flow holding profile fIntFlowFlags and lists fIntFlowProfiles and fIntFlowResults.\r
6021 // b) Get pointer to profile fIntFlowFlags holding all flags for integrated flow.\r
6022 // c) Get pointer to list fIntFlowProfiles and pointers to all objects that she holds. \r
6023 // d) Get pointer to list fIntFlowResults and pointers to all objects that she holds. \r
6024 \r
6025 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data member?)\r
6026 TString powerFlag[2] = {"linear","quadratic"}; // to be improved (should I promote this to data member?)\r
6027 \r
6028 if(outputListHistos)\r
6029 {\r
6030 // a) Get pointer to base list for integrated flow holding profile fIntFlowFlags and lists fIntFlowProfiles and fIntFlowResults:\r
6031 TList *intFlowList = NULL;\r
6032 intFlowList = dynamic_cast<TList*>(outputListHistos->FindObject("Integrated Flow"));\r
6033 if(!intFlowList) \r
6034 {\r
6035 cout<<"WARNING: intFlowList is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
6036 exit(0); \r
6037 } \r
6038 \r
6039 // b) Get pointer to profile fIntFlowFlags holding all flags for integrated flow:\r
6040 TString intFlowFlagsName = "fIntFlowFlags";\r
6041 intFlowFlagsName += fAnalysisLabel->Data();\r
6042 TProfile *intFlowFlags = dynamic_cast<TProfile*>(intFlowList->FindObject(intFlowFlagsName.Data()));\r
6043 Bool_t bApplyCorrectionForNUA = kFALSE;\r
6044 if(intFlowFlags)\r
6045 {\r
6046 this->SetIntFlowFlags(intFlowFlags); \r
6047 bApplyCorrectionForNUA = (Int_t)intFlowFlags->GetBinContent(3); \r
6048 this->SetApplyCorrectionForNUA(bApplyCorrectionForNUA); \r
6049 } else \r
6050 {\r
6051 cout<<"WARNING: intFlowFlags is NULL in FAWQC::GPFIFH() !!!!"<<endl;\r
6052 }\r
6053 \r
6054 // c) Get pointer to list fIntFlowProfiles and pointers to all objects that she holds:\r
6055 TList *intFlowProfiles = NULL;\r
6056 intFlowProfiles = dynamic_cast<TList*>(intFlowList->FindObject("Profiles"));\r
6057 if(intFlowProfiles) \r
6058 {\r
6059 // average multiplicities:\r
6060 TString avMultiplicityName = "fAvMultiplicity";\r
6061 avMultiplicityName += fAnalysisLabel->Data();\r
6062 TProfile *avMultiplicity = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(avMultiplicityName.Data()));\r
6063 if(avMultiplicity) \r
6064 {\r
6065 this->SetAvMultiplicity(avMultiplicity);\r
6066 } else \r
6067 {\r
6068 cout<<"WARNING: avMultiplicity is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
6069 }\r
6070 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with wrong errors!):\r
6071 TString intFlowCorrelationsProName = "fIntFlowCorrelationsPro";\r
6072 intFlowCorrelationsProName += fAnalysisLabel->Data();\r
6073 TProfile *intFlowCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowCorrelationsProName.Data()));\r
6074 if(intFlowCorrelationsPro) \r
6075 {\r
6076 this->SetIntFlowCorrelationsPro(intFlowCorrelationsPro);\r
6077 } else \r
6078 {\r
6079 cout<<"WARNING: intFlowCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
6080 } \r
6081 // average all correlations for integrated flow (with wrong errors!):\r
6082 TString intFlowCorrelationsAllProName = "fIntFlowCorrelationsAllPro";\r
6083 intFlowCorrelationsAllProName += fAnalysisLabel->Data();\r
6084 TProfile *intFlowCorrelationsAllPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowCorrelationsAllProName.Data()));\r
6085 if(intFlowCorrelationsAllPro) \r
6086 {\r
6087 this->SetIntFlowCorrelationsAllPro(intFlowCorrelationsAllPro);\r
6088 } else \r
6089 {\r
6090 cout<<"WARNING: intFlowCorrelationsAllPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
6091 } \r
6092 // average extra correlations for integrated flow (which appear only when particle weights are used):\r
6093 // (to be improved: Weak point in implementation, I am assuming here that method GetPointersForParticleWeightsHistograms() was called)\r
6094 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)\r
6095 {\r
6096 TString intFlowExtraCorrelationsProName = "fIntFlowExtraCorrelationsPro";\r
6097 intFlowExtraCorrelationsProName += fAnalysisLabel->Data();\r
6098 TProfile *intFlowExtraCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowExtraCorrelationsProName.Data()));\r
6099 if(intFlowExtraCorrelationsPro) \r
6100 {\r
6101 this->SetIntFlowExtraCorrelationsPro(intFlowExtraCorrelationsPro);\r
6102 } else \r
6103 {\r
6104 cout<<"WARNING: intFlowExtraCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
6105 }\r
6106 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights) \r
6107 // average products of correlations <2>, <4>, <6> and <8>: \r
6108 TString intFlowProductOfCorrelationsProName = "fIntFlowProductOfCorrelationsPro";\r
6109 intFlowProductOfCorrelationsProName += fAnalysisLabel->Data();\r
6110 TProfile *intFlowProductOfCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowProductOfCorrelationsProName.Data()));\r
6111 if(intFlowProductOfCorrelationsPro) \r
6112 {\r
6113 this->SetIntFlowProductOfCorrelationsPro(intFlowProductOfCorrelationsPro);\r
6114 } else \r
6115 {\r
6116 cout<<"WARNING: intFlowProductOfCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
6117 } \r
6118 // average correction terms for non-uniform acceptance (with wrong errors!):\r
6119 for(Int_t sc=0;sc<2;sc++)\r
6120 {\r
6121 TString intFlowCorrectionTermsForNUAProName = "fIntFlowCorrectionTermsForNUAPro";\r
6122 intFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();\r
6123 TProfile *intFlowCorrectionTermsForNUAPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject((Form("%s: %s terms",intFlowCorrectionTermsForNUAProName.Data(),sinCosFlag[sc].Data()))));\r
6124 if(intFlowCorrectionTermsForNUAPro) \r
6125 {\r
6126 this->SetIntFlowCorrectionTermsForNUAPro(intFlowCorrectionTermsForNUAPro,sc);\r
6127 } else \r
6128 {\r
6129 cout<<"WARNING: intFlowCorrectionTermsForNUAPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
6130 cout<<"sc = "<<sc<<endl;\r
6131 } \r
6132 } // end of for(Int_t sc=0;sc<2;sc++) \r
6133 } else // to if(intFlowProfiles) \r
6134 {\r
6135 cout<<"WARNING: intFlowProfiles is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
6136 }\r
6137 \r
6138 // d) Get pointer to list fIntFlowResults and pointers to all objects that she holds. \r
6139 TList *intFlowResults = NULL;\r
6140 intFlowResults = dynamic_cast<TList*>(intFlowList->FindObject("Results"));\r
6141 if(intFlowResults)\r
6142 {\r
6143 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with correct errors!):\r
6144 TString intFlowCorrelationsHistName = "fIntFlowCorrelationsHist";\r
6145 intFlowCorrelationsHistName += fAnalysisLabel->Data();\r
6146 TH1D *intFlowCorrelationsHist = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCorrelationsHistName.Data()));\r
6147 if(intFlowCorrelationsHist) \r
6148 {\r
6149 this->SetIntFlowCorrelationsHist(intFlowCorrelationsHist);\r
6150 } else \r
6151 {\r
6152 cout<<"WARNING: intFlowCorrelationsHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
6153 } \r
6154 // average all correlations for integrated flow (with correct errors!):\r
6155 TString intFlowCorrelationsAllHistName = "fIntFlowCorrelationsAllHist";\r
6156 intFlowCorrelationsAllHistName += fAnalysisLabel->Data();\r
6157 TH1D *intFlowCorrelationsAllHist = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCorrelationsAllHistName.Data()));\r
6158 if(intFlowCorrelationsAllHist) \r
6159 {\r
6160 this->SetIntFlowCorrelationsAllHist(intFlowCorrelationsAllHist);\r
6161 } else \r
6162 {\r
6163 cout<<"WARNING: intFlowCorrelationsAllHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
6164 } \r
6165 // average correction terms for non-uniform acceptance (with correct errors!):\r
6166 TString intFlowCorrectionTermsForNUAHistName = "fIntFlowCorrectionTermsForNUAHist";\r
6167 intFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();\r
6168 for(Int_t sc=0;sc<2;sc++)\r
6169 {\r
6170 TH1D *intFlowCorrectionTermsForNUAHist = dynamic_cast<TH1D*>(intFlowResults->FindObject((Form("%s: %s terms",intFlowCorrectionTermsForNUAHistName.Data(),sinCosFlag[sc].Data()))));\r
6171 if(intFlowCorrectionTermsForNUAHist) \r
6172 {\r
6173 this->SetIntFlowCorrectionTermsForNUAHist(intFlowCorrectionTermsForNUAHist,sc);\r
6174 } else \r
6175 {\r
6176 cout<<"WARNING: intFlowCorrectionTermsForNUAHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
6177 cout<<"sc = "<<sc<<endl;\r
6178 } \r
6179 } // end of for(Int_t sc=0;sc<2;sc++) \r
6180 // covariances (multiplied with weight dependent prefactor):\r
6181 TString intFlowCovariancesName = "fIntFlowCovariances";\r
6182 intFlowCovariancesName += fAnalysisLabel->Data();\r
6183 TH1D *intFlowCovariances = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCovariancesName.Data()));\r
6184 if(intFlowCovariances) \r
6185 {\r
6186 this->SetIntFlowCovariances(intFlowCovariances); \r
6187 } else \r
6188 {\r
6189 cout<<"WARNING: intFlowCovariances is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
6190 } \r
6191 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8>:\r
6192 TString intFlowSumOfEventWeightsName = "fIntFlowSumOfEventWeights";\r
6193 intFlowSumOfEventWeightsName += fAnalysisLabel->Data();\r
6194 for(Int_t power=0;power<2;power++)\r
6195 {\r
6196 TH1D *intFlowSumOfEventWeights = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s: %s",intFlowSumOfEventWeightsName.Data(),powerFlag[power].Data())));\r
6197 if(intFlowSumOfEventWeights) \r
6198 {\r
6199 this->SetIntFlowSumOfEventWeights(intFlowSumOfEventWeights,power);\r
6200 } else \r
6201 {\r
6202 cout<<"WARNING: intFlowSumOfEventWeights is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
6203 cout<<"power = "<<power<<endl;\r
6204 } \r
6205 } // end of for(Int_t power=0;power<2;power++) \r
6206 // sum of products of event weights for correlations <2>, <4>, <6> and <8>: \r
6207 TString intFlowSumOfProductOfEventWeightsName = "fIntFlowSumOfProductOfEventWeights";\r
6208 intFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();\r
6209 TH1D *intFlowSumOfProductOfEventWeights = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowSumOfProductOfEventWeightsName.Data()));\r
6210 if(intFlowSumOfProductOfEventWeights) \r
6211 {\r
6212 this->SetIntFlowSumOfProductOfEventWeights(intFlowSumOfProductOfEventWeights);\r
6213 } else \r
6214 {\r
6215 cout<<"WARNING: intFlowSumOfProductOfEventWeights is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
6216 } \r
6217 // final results for integrated Q-cumulants:\r
6218 TString intFlowQcumulantsName = "fIntFlowQcumulants";\r
6219 intFlowQcumulantsName += fAnalysisLabel->Data();\r
6220 TH1D *intFlowQcumulants = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowQcumulantsName.Data()));\r
6221 if(intFlowQcumulants) \r
6222 {\r
6223 this->SetIntFlowQcumulants(intFlowQcumulants);\r
6224 } else \r
6225 {\r
6226 cout<<"WARNING: intFlowQcumulants is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
6227 } \r
6228 // final integrated flow estimates from Q-cumulants:\r
6229 TString intFlowName = "fIntFlow";\r
6230 intFlowName += fAnalysisLabel->Data();\r
6231 TH1D *intFlow = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowName.Data()));\r
6232 if(intFlow) \r
6233 {\r
6234 this->SetIntFlow(intFlow);\r
6235 } else \r
6236 {\r
6237 cout<<"WARNING: intFlow is NULL in AFAWQC::GPFIFH() !!!!"<<endl; \r
6238 } \r
6239 } else // to if(intFlowResults)\r
6240 {\r
6241 cout<<"WARNING: intFlowResults is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
6242 }\r
6243 } // end of if(outputListHistos)\r
6244\r
6245} // end of void AliFlowAnalysisWithQCumulants::GetPointersForIntFlowHistograms(TList *outputListHistos)\r
6246\r
6247\r
6248//================================================================================================================================\r
6249\r
6250\r
6251void AliFlowAnalysisWithQCumulants::GetPointersForDiffFlowHistograms(TList *outputListHistos)\r
6252{\r
6253 // Get pointer to all objects relevant for differential flow.\r
6254 // a) Define flags locally (to be improved: should I promote flags to data members?);\r
6255 // b) Get pointer to base list for differential flow fDiffFlowList and nested lists fDiffFlowListProfiles and fDiffFlowListResults;\r
6256 // c) Get pointer to profile fDiffFlowFlags holding all flags for differential flow;\r
6257 // d) Get pointers to all nested lists in fDiffFlowListProfiles and to profiles which they hold;\r
6258 // e) Get pointers to all nested lists in fDiffFlowListResults and to histograms which they hold.\r
6259 \r
6260 // a) Define flags locally (to be improved: should I promote flags to data members?): \r
6261 TString typeFlag[2] = {"RP","POI"}; \r
6262 TString ptEtaFlag[2] = {"p_{T}","#eta"};\r
6263 TString powerFlag[2] = {"linear","quadratic"};\r
6264 TString sinCosFlag[2] = {"sin","cos"};\r
6265 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"}; \r
6266 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"}; \r
6267 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};\r
6268 TString mixedCorrelationIndex[8] = {"<2>","<2'>","<4>","<4'>","<6>","<6'>","<8>","<8'>"};\r
6269 TString covarianceName[5] = {"Cov(<2>,<2'>)","Cov(<2>,<4'>)","Cov(<4>,<2'>)","Cov(<4>,<4'>)","Cov(<2'>,<4'>)"}; \r
6270 \r
6271 // b) Get pointer to base list for differential flow fDiffFlowList and nested lists fDiffFlowListProfiles and fDiffFlowListResults:\r
6272 TList *diffFlowList = NULL;\r
6273 diffFlowList = dynamic_cast<TList*>(outputListHistos->FindObject("Differential Flow")); \r
6274 if(!diffFlowList)\r
6275 { \r
6276 cout<<"WARNING: diffFlowList is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6277 exit(0);\r
6278 }\r
6279 // list holding nested lists containing profiles:\r
6280 TList *diffFlowListProfiles = NULL;\r
6281 diffFlowListProfiles = dynamic_cast<TList*>(diffFlowList->FindObject("Profiles"));\r
6282 if(!diffFlowListProfiles)\r
6283 { \r
6284 cout<<"WARNING: diffFlowListProfiles is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6285 exit(0);\r
6286 }\r
6287 // list holding nested lists containing 2D and 1D histograms with final results:\r
6288 TList *diffFlowListResults = NULL;\r
6289 diffFlowListResults = dynamic_cast<TList*>(diffFlowList->FindObject("Results"));\r
6290 if(!diffFlowListResults)\r
6291 { \r
6292 cout<<"WARNING: diffFlowListResults is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6293 exit(0);\r
6294 }\r
6295 \r
6296 // c) Get pointer to profile holding all flags for differential flow;\r
6297 TString diffFlowFlagsName = "fDiffFlowFlags";\r
6298 diffFlowFlagsName += fAnalysisLabel->Data();\r
6299 TProfile *diffFlowFlags = dynamic_cast<TProfile*>(diffFlowList->FindObject(diffFlowFlagsName.Data()));\r
6300 Bool_t bCalculate2DFlow = kFALSE;\r
6301 if(diffFlowFlags)\r
6302 {\r
6303 this->SetDiffFlowFlags(diffFlowFlags); \r
6304 bCalculate2DFlow = (Int_t)diffFlowFlags->GetBinContent(4);\r
6305 this->SetCalculate2DFlow(bCalculate2DFlow); // to be improved (shoul I call this setter somewhere else?) \r
6306 }\r
6307 \r
6308 // d) Get pointers to all nested lists in fDiffFlowListProfiles and to profiles which they hold;\r
6309 // correlations:\r
6310 TList *diffFlowCorrelationsProList[2][2] = {{NULL}};\r
6311 TString diffFlowCorrelationsProName = "fDiffFlowCorrelationsPro";\r
6312 diffFlowCorrelationsProName += fAnalysisLabel->Data();\r
6313 TProfile *diffFlowCorrelationsPro[2][2][4] = {{{NULL}}}; \r
6314 // products of correlations:\r
6315 TList *diffFlowProductOfCorrelationsProList[2][2] = {{NULL}};\r
6316 TString diffFlowProductOfCorrelationsProName = "fDiffFlowProductOfCorrelationsPro";\r
6317 diffFlowProductOfCorrelationsProName += fAnalysisLabel->Data(); \r
6318 TProfile *diffFlowProductOfCorrelationsPro[2][2][8][8] = {{{{NULL}}}}; \r
6319 // corrections:\r
6320 TList *diffFlowCorrectionsProList[2][2] = {{NULL}};\r
6321 TString diffFlowCorrectionTermsForNUAProName = "fDiffFlowCorrectionTermsForNUAPro";\r
6322 diffFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data(); \r
6323 TProfile *diffFlowCorrectionTermsForNUAPro[2][2][2][10] = {{{{NULL}}}}; \r
6324 for(Int_t t=0;t<2;t++)\r
6325 {\r
6326 for(Int_t pe=0;pe<2;pe++)\r
6327 {\r
6328 diffFlowCorrelationsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));\r
6329 if(!diffFlowCorrelationsProList[t][pe])\r
6330 { \r
6331 cout<<"WARNING: diffFlowCorrelationsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6332 cout<<"t = "<<t<<endl;\r
6333 cout<<"pe = "<<pe<<endl;\r
6334 exit(0);\r
6335 }\r
6336 for(Int_t ci=0;ci<4;ci++) // correlation index\r
6337 {\r
6338 diffFlowCorrelationsPro[t][pe][ci] = dynamic_cast<TProfile*>(diffFlowCorrelationsProList[t][pe]->FindObject(Form("%s, %s, %s, %s",diffFlowCorrelationsProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[ci].Data())));\r
6339 if(diffFlowCorrelationsPro[t][pe][ci])\r
6340 {\r
6341 this->SetDiffFlowCorrelationsPro(diffFlowCorrelationsPro[t][pe][ci],t,pe,ci);\r
6342 } else\r
6343 {\r
6344 cout<<"WARNING: diffFlowCorrelationsPro[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6345 cout<<"t = "<<t<<endl;\r
6346 cout<<"pe = "<<pe<<endl; \r
6347 cout<<"ci = "<<ci<<endl;\r
6348 } \r
6349 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index \r
6350 // products of correlations: \r
6351 diffFlowProductOfCorrelationsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with products of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()))); \r
6352 if(!diffFlowProductOfCorrelationsProList[t][pe])\r
6353 { \r
6354 cout<<"WARNING: ddiffFlowProductOfCorrelationsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6355 cout<<"t = "<<t<<endl;\r
6356 cout<<"pe = "<<pe<<endl;\r
6357 exit(0);\r
6358 }\r
6359 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index\r
6360 {\r
6361 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index\r
6362 {\r
6363 diffFlowProductOfCorrelationsPro[t][pe][mci1][mci2] = dynamic_cast<TProfile*>(diffFlowProductOfCorrelationsProList[t][pe]->FindObject(Form("%s, %s, %s, %s, %s",diffFlowProductOfCorrelationsProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),mixedCorrelationIndex[mci1].Data(),mixedCorrelationIndex[mci2].Data())));\r
6364 if(diffFlowProductOfCorrelationsPro[t][pe][mci1][mci2])\r
6365 {\r
6366 this->SetDiffFlowProductOfCorrelationsPro(diffFlowProductOfCorrelationsPro[t][pe][mci1][mci2],t,pe,mci1,mci2);\r
6367 } else\r
6368 {\r
6369 cout<<"WARNING: diffFlowCorrelationsPro[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6370 cout<<"t = "<<t<<endl;\r
6371 cout<<"pe = "<<pe<<endl; \r
6372 cout<<"mci1 = "<<mci1<<endl;\r
6373 cout<<"mci2 = "<<mci2<<endl;\r
6374 }\r
6375 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here\r
6376 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index\r
6377 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index \r
6378 // corrections:\r
6379 diffFlowCorrectionsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));\r
6380 if(!diffFlowCorrectionsProList[t][pe])\r
6381 { \r
6382 cout<<"WARNING: diffFlowCorrectionsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6383 cout<<"t = "<<t<<endl;\r
6384 cout<<"pe = "<<pe<<endl;\r
6385 exit(0);\r
6386 }\r
6387 // correction terms for NUA:\r
6388 for(Int_t sc=0;sc<2;sc++) // sin or cos\r
6389 {\r
6390 for(Int_t cti=0;cti<9;cti++) // correction term index\r
6391 {\r
6392 diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti] = dynamic_cast<TProfile*>(diffFlowCorrectionsProList[t][pe]->FindObject(Form("%s, %s, %s, %s, cti = %d",diffFlowCorrectionTermsForNUAProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),cti+1)));\r
6393 if(diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti])\r
6394 {\r
6395 this->SetDiffFlowCorrectionTermsForNUAPro(diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti],t,pe,sc,cti);\r
6396 } else\r
6397 {\r
6398 cout<<"WARNING: diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6399 cout<<"t = "<<t<<endl;\r
6400 cout<<"pe = "<<pe<<endl; \r
6401 cout<<"sc = "<<sc<<endl;\r
6402 cout<<"cti = "<<cti<<endl;\r
6403 } \r
6404 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index\r
6405 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos\r
6406 // ...\r
6407 } // end of for(Int_t pe=0;pe<2;pe++)\r
6408 } // end of for(Int_t t=0;t<2;t++)\r
6409 \r
6410 // e) Get pointers to all nested lists in fDiffFlowListResults and to histograms which they hold.\r
6411 // reduced correlations:\r
6412 TList *diffFlowCorrelationsHistList[2][2] = {{NULL}};\r
6413 TString diffFlowCorrelationsHistName = "fDiffFlowCorrelationsHist";\r
6414 diffFlowCorrelationsHistName += fAnalysisLabel->Data(); \r
6415 TH1D *diffFlowCorrelationsHist[2][2][4] = {{{NULL}}};\r
6416 // corrections for NUA:\r
6417 TList *diffFlowCorrectionsHistList[2][2] = {{NULL}};\r
6418 TString diffFlowCorrectionTermsForNUAHistName = "fDiffFlowCorrectionTermsForNUAHist";\r
6419 diffFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data(); \r
6420 TH1D *diffFlowCorrectionTermsForNUAHist[2][2][2][10] = {{{{NULL}}}};\r
6421 // differential Q-cumulants:\r
6422 TList *diffFlowCumulantsHistList[2][2] = {{NULL}};\r
6423 TString diffFlowCumulantsName = "fDiffFlowCumulants";\r
6424 diffFlowCumulantsName += fAnalysisLabel->Data(); \r
6425 TH1D *diffFlowCumulants[2][2][4] = {{{NULL}}};\r
6426 // differential flow estimates from Q-cumulants:\r
6427 TList *diffFlowHistList[2][2] = {{NULL}};\r
6428 TString diffFlowName = "fDiffFlow";\r
6429 diffFlowName += fAnalysisLabel->Data(); \r
6430 TH1D *diffFlow[2][2][4] = {{{NULL}}};\r
6431 // differential covariances:\r
6432 TList *diffFlowCovariancesHistList[2][2] = {{NULL}};\r
6433 TString diffFlowCovariancesName = "fDiffFlowCovariances";\r
6434 diffFlowCovariancesName += fAnalysisLabel->Data(); \r
6435 TH1D *diffFlowCovariances[2][2][5] = {{{NULL}}};\r
6436 for(Int_t t=0;t<2;t++) // type: RP or POI\r
6437 { \r
6438 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
6439 {\r
6440 // reduced correlations:\r
6441 diffFlowCorrelationsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));\r
6442 if(!diffFlowCorrelationsHistList[t][pe])\r
6443 { \r
6444 cout<<"WARNING: diffFlowCorrelationsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6445 cout<<"t = "<<t<<endl;\r
6446 cout<<"pe = "<<pe<<endl;\r
6447 exit(0);\r
6448 }\r
6449 for(Int_t index=0;index<4;index++) \r
6450 {\r
6451 diffFlowCorrelationsHist[t][pe][index] = dynamic_cast<TH1D*>(diffFlowCorrelationsHistList[t][pe]->FindObject(Form("%s, %s, %s, %s",diffFlowCorrelationsHistName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[index].Data())));\r
6452 if(diffFlowCorrelationsHist[t][pe][index])\r
6453 {\r
6454 this->SetDiffFlowCorrelationsHist(diffFlowCorrelationsHist[t][pe][index],t,pe,index);\r
6455 } else \r
6456 {\r
6457 cout<<"WARNING: diffFlowCorrelationsHist[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6458 cout<<"t = "<<t<<endl;\r
6459 cout<<"pe = "<<pe<<endl;\r
6460 cout<<"index = "<<index<<endl;\r
6461 exit(0); \r
6462 } \r
6463 } // end of for(Int_t index=0;index<4;index++)\r
6464 // corrections:\r
6465 diffFlowCorrectionsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Histograms with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));\r
6466 if(!diffFlowCorrectionsHistList[t][pe])\r
6467 { \r
6468 cout<<"WARNING: diffFlowCorrectionsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6469 cout<<"t = "<<t<<endl;\r
6470 cout<<"pe = "<<pe<<endl;\r
6471 exit(0);\r
6472 }\r
6473 // correction terms for NUA:\r
6474 for(Int_t sc=0;sc<2;sc++) // sin or cos\r
6475 {\r
6476 for(Int_t cti=0;cti<9;cti++) // correction term index\r
6477 {\r
6478 diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti] = dynamic_cast<TH1D*>(diffFlowCorrectionsHistList[t][pe]->FindObject(Form("%s, %s, %s, %s, cti = %d",diffFlowCorrectionTermsForNUAHistName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),cti+1)));\r
6479 if(diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti])\r
6480 {\r
6481 this->SetDiffFlowCorrectionTermsForNUAHist(diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti],t,pe,sc,cti);\r
6482 } else\r
6483 {\r
6484 cout<<"WARNING: diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6485 cout<<"t = "<<t<<endl;\r
6486 cout<<"pe = "<<pe<<endl; \r
6487 cout<<"sc = "<<sc<<endl;\r
6488 cout<<"cti = "<<cti<<endl;\r
6489 } \r
6490 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index\r
6491 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos\r
6492 // ...\r
6493 // differential Q-cumulants:\r
6494 diffFlowCumulantsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Differential Q-cumulants (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));\r
6495 if(!diffFlowCumulantsHistList[t][pe])\r
6496 { \r
6497 cout<<"WARNING: diffFlowCumulantsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6498 cout<<"t = "<<t<<endl;\r
6499 cout<<"pe = "<<pe<<endl;\r
6500 exit(0);\r
6501 }\r
6502 for(Int_t index=0;index<4;index++) \r
6503 {\r
6504 diffFlowCumulants[t][pe][index] = dynamic_cast<TH1D*>(diffFlowCumulantsHistList[t][pe]->FindObject(Form("%s, %s, %s, %s",diffFlowCumulantsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),differentialCumulantIndex[index].Data())));\r
6505 if(diffFlowCumulants[t][pe][index])\r
6506 {\r
6507 this->SetDiffFlowCumulants(diffFlowCumulants[t][pe][index],t,pe,index);\r
6508 } else \r
6509 {\r
6510 cout<<"WARNING: diffFlowCumulants[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6511 cout<<"t = "<<t<<endl;\r
6512 cout<<"pe = "<<pe<<endl;\r
6513 cout<<"index = "<<index<<endl;\r
6514 exit(0); \r
6515 } \r
6516 } // end of for(Int_t index=0;index<4;index++)\r
6517 // differential flow estimates from Q-cumulants:\r
6518 diffFlowHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Differential flow (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));\r
6519 if(!diffFlowHistList[t][pe])\r
6520 { \r
6521 cout<<"WARNING: diffFlowHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6522 cout<<"t = "<<t<<endl;\r
6523 cout<<"pe = "<<pe<<endl;\r
6524 exit(0);\r
6525 }\r
6526 for(Int_t index=0;index<4;index++) \r
6527 {\r
6528 diffFlow[t][pe][index] = dynamic_cast<TH1D*>(diffFlowHistList[t][pe]->FindObject(Form("%s, %s, %s, %s",diffFlowName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),differentialFlowIndex[index].Data())));\r
6529 if(diffFlow[t][pe][index])\r
6530 {\r
6531 this->SetDiffFlow(diffFlow[t][pe][index],t,pe,index);\r
6532 } else \r
6533 {\r
6534 cout<<"WARNING: diffFlow[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6535 cout<<"t = "<<t<<endl;\r
6536 cout<<"pe = "<<pe<<endl;\r
6537 cout<<"index = "<<index<<endl;\r
6538 exit(0); \r
6539 } \r
6540 } // end of for(Int_t index=0;index<4;index++)\r
6541 // differential covariances:\r
6542 diffFlowCovariancesHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Covariances of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));\r
6543 if(!diffFlowCovariancesHistList[t][pe])\r
6544 { \r
6545 cout<<"WARNING: diffFlowCovariancesHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6546 cout<<"t = "<<t<<endl;\r
6547 cout<<"pe = "<<pe<<endl;\r
6548 exit(0);\r
6549 }\r
6550 for(Int_t covIndex=0;covIndex<5;covIndex++) \r
6551 {\r
6552 diffFlowCovariances[t][pe][covIndex] = dynamic_cast<TH1D*>(diffFlowCovariancesHistList[t][pe]->FindObject(Form("%s, %s, %s, %s",diffFlowCovariancesName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),covarianceName[covIndex].Data())));\r
6553 if(diffFlowCovariances[t][pe][covIndex])\r
6554 {\r
6555 this->SetDiffFlowCovariances(diffFlowCovariances[t][pe][covIndex],t,pe,covIndex);\r
6556 } else \r
6557 {\r
6558 cout<<"WARNING: diffFlowCovariances[t][pe][covIndex] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6559 cout<<"t = "<<t<<endl;\r
6560 cout<<"pe = "<<pe<<endl;\r
6561 cout<<"covIndex = "<<covIndex<<endl;\r
6562 exit(0); \r
6563 } \r
6564 } // end of for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index \r
6565 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta\r
6566 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI \r
6567 // sum of event weights for reduced correlations:\r
6568 TList *diffFlowSumOfEventWeightsHistList[2][2][2] = {{{NULL}}};\r
6569 TString diffFlowSumOfEventWeightsName = "fDiffFlowSumOfEventWeights";\r
6570 diffFlowSumOfEventWeightsName += fAnalysisLabel->Data(); \r
6571 TH1D *diffFlowSumOfEventWeights[2][2][2][4] = {{{{NULL}}}};\r
6572 for(Int_t t=0;t<2;t++) // type is RP or POI\r
6573 { \r
6574 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
6575 { \r
6576 for(Int_t p=0;p<2;p++) // power of event weights is either 1 or 2\r
6577 {\r
6578 diffFlowSumOfEventWeightsHistList[t][pe][p] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Sum of %s event weights (%s, %s)",powerFlag[p].Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data())));\r
6579 if(!diffFlowSumOfEventWeightsHistList[t][pe][p])\r
6580 { \r
6581 cout<<"WARNING: diffFlowSumOfEventWeightsHistList[t][pe][p] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6582 cout<<"t = "<<t<<endl;\r
6583 cout<<"pe = "<<pe<<endl;\r
6584 cout<<"power = "<<p<<endl;\r
6585 exit(0);\r
6586 }\r
6587 for(Int_t ew=0;ew<4;ew++) // index of reduced correlation\r
6588 {\r
6589 diffFlowSumOfEventWeights[t][pe][p][ew] = dynamic_cast<TH1D*>(diffFlowSumOfEventWeightsHistList[t][pe][p]->FindObject(Form("%s, %s, %s, %s, %s",diffFlowSumOfEventWeightsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),powerFlag[p].Data(),reducedCorrelationIndex[ew].Data()))); \r
6590 if(diffFlowSumOfEventWeights[t][pe][p][ew])\r
6591 {\r
6592 this->SetDiffFlowSumOfEventWeights(diffFlowSumOfEventWeights[t][pe][p][ew],t,pe,p,ew);\r
6593 } else \r
6594 {\r
6595 cout<<"WARNING: diffFlowSumOfEventWeights[t][pe][p][ew] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6596 cout<<"t = "<<t<<endl;\r
6597 cout<<"pe = "<<pe<<endl;\r
6598 cout<<"power = "<<p<<endl;\r
6599 cout<<"ew = "<<ew<<endl;\r
6600 exit(0); \r
6601 } \r
6602 }\r
6603 } // end of for(Int_t p=0;p<2;p++) // power of event weights is either 1 or 2\r
6604 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta\r
6605 } // end of for(Int_t t=0;t<2;t++) // type is RP or POI\r
6606 // \r
6607 TList *diffFlowSumOfProductOfEventWeightsHistList[2][2] = {{NULL}};\r
6608 TString diffFlowSumOfProductOfEventWeightsName = "fDiffFlowSumOfProductOfEventWeights";\r
6609 diffFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data(); \r
6610 TH1D *diffFlowSumOfProductOfEventWeights[2][2][8][8] = {{{{NULL}}}};\r
6611 for(Int_t t=0;t<2;t++) // type is RP or POI\r
6612 { \r
6613 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
6614 { \r
6615 diffFlowSumOfProductOfEventWeightsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Sum of products of event weights (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));\r
6616 if(!diffFlowSumOfProductOfEventWeightsHistList[t][pe])\r
6617 { \r
6618 cout<<"WARNING: diffFlowSumOfProductOfEventWeightsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6619 cout<<"t = "<<t<<endl;\r
6620 cout<<"pe = "<<pe<<endl;\r
6621 exit(0);\r
6622 }\r
6623 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index\r
6624 {\r
6625 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index\r
6626 {\r
6627 diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2] = dynamic_cast<TH1D*>(diffFlowSumOfProductOfEventWeightsHistList[t][pe]->FindObject(Form("%s, %s, %s, %s, %s",diffFlowSumOfProductOfEventWeightsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),mixedCorrelationIndex[mci1].Data(),mixedCorrelationIndex[mci2].Data()))); \r
6628 if(diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2])\r
6629 {\r
6630 this->SetDiffFlowSumOfProductOfEventWeights(diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2],t,pe,mci1,mci2);\r
6631 } else \r
6632 {\r
6633 cout<<"WARNING: diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6634 cout<<"t = "<<t<<endl;\r
6635 cout<<"pe = "<<pe<<endl;\r
6636 cout<<"mci1 = "<<mci1<<endl;\r
6637 cout<<"mci2 = "<<mci2<<endl;\r
6638 exit(0); \r
6639 } \r
6640 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here\r
6641 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index\r
6642 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index\r
6643 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta\r
6644 } // end of for(Int_t t=0;t<2;t++) // type is RP or POI\r
6645\r
6646} // end void AliFlowAnalysisWithQCumulants::GetPointersForDiffFlowHistograms(TList *outputListHistos)\r
6647\r
6648\r
6649//================================================================================================================================\r
6650\r
6651\r
6652void AliFlowAnalysisWithQCumulants::BookEverythingForDifferentialFlow()\r
6653{\r
6654 // Book all histograms and profiles needed for differential flow.\r
6655 // a) Define flags locally (to be improved: should I promote flags to data members?);\r
6656 // b) Book profile to hold all flags for differential flow;\r
6657 // c) Book e-b-e quantities;\r
6658 // d) Book profiles;\r
6659 // e) Book histograms holding final results. \r
6660 \r
6661 // a) Define flags locally (to be improved: should I promote flags to data members?): \r
6662 TString typeFlag[2] = {"RP","POI"}; \r
6663 TString ptEtaFlag[2] = {"p_{T}","#eta"};\r
6664 TString powerFlag[2] = {"linear","quadratic"};\r
6665 TString sinCosFlag[2] = {"sin","cos"};\r
6666 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"}; \r
6667 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"}; \r
6668 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};\r
6669 TString mixedCorrelationIndex[8] = {"<2>","<2'>","<4>","<4'>","<6>","<6'>","<8>","<8'>"};\r
6670 TString covarianceName[5] = {"Cov(<2>,<2'>)","Cov(<2>,<4'>)","Cov(<4>,<2'>)","Cov(<4>,<4'>)","Cov(<2'>,<4'>)"}; \r
6671 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
6672 Double_t minPtEta[2] = {fPtMin,fEtaMin};\r
6673 Double_t maxPtEta[2] = {fPtMax,fEtaMax};\r
6674 \r
6675 // b) Book profile to hold all flags for differential flow:\r
6676 TString diffFlowFlagsName = "fDiffFlowFlags";\r
6677 diffFlowFlagsName += fAnalysisLabel->Data();\r
6678 fDiffFlowFlags = new TProfile(diffFlowFlagsName.Data(),"Flags for Differential Flow",4,0,4);\r
6679 fDiffFlowFlags->SetTickLength(-0.01,"Y");\r
6680 fDiffFlowFlags->SetMarkerStyle(25);\r
6681 fDiffFlowFlags->SetLabelSize(0.05);\r
6682 fDiffFlowFlags->SetLabelOffset(0.02,"Y");\r
6683 (fDiffFlowFlags->GetXaxis())->SetBinLabel(1,"Particle Weights");\r
6684 (fDiffFlowFlags->GetXaxis())->SetBinLabel(2,"Event Weights");\r
6685 (fDiffFlowFlags->GetXaxis())->SetBinLabel(3,"Corrected for NUA?");\r
6686 (fDiffFlowFlags->GetXaxis())->SetBinLabel(4,"Calculated 2D flow?");\r
6687 fDiffFlowList->Add(fDiffFlowFlags);\r
6688\r
6689 // c) Book e-b-e quantities:\r
6690 // Event-by-event r_{m*n,k}(pt,eta), p_{m*n,k}(pt,eta) and q_{m*n,k}(pt,eta)\r
6691 // Explanantion of notation:\r
6692 // 1.) n is harmonic, m is multiple of harmonic;\r
6693 // 2.) k is power of particle weight;\r
6694 // 3.) r_{m*n,k}(pt,eta) = Q-vector evaluated in harmonic m*n for RPs in particular (pt,eta) bin (i-th RP is weighted with w_i^k); \r
6695 // 4.) p_{m*n,k}(pt,eta) = Q-vector evaluated in harmonic m*n for POIs in particular (pt,eta) bin \r
6696 // (if i-th POI is also RP, than it is weighted with w_i^k); \r
6697 // 5.) q_{m*n,k}(pt,eta) = Q-vector evaluated in harmonic m*n for particles which are both RPs and POIs in particular (pt,eta) bin \r
6698 // (i-th RP&&POI is weighted with w_i^k) \r
6699 \r
6700 // 1D:\r
6701 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP && POI )\r
6702 { \r
6703 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
6704 {\r
6705 for(Int_t m=0;m<4;m++) // multiple of harmonic\r
6706 {\r
6707 for(Int_t k=0;k<9;k++) // power of particle weight\r
6708 {\r
6709 fReRPQ1dEBE[t][pe][m][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%dpower%dRe",t,pe,m,k),\r
6710 Form("TypeFlag%dpteta%dmultiple%dpower%dRe",t,pe,m,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]); \r
6711 fImRPQ1dEBE[t][pe][m][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%dpower%dIm",t,pe,m,k),\r
6712 Form("TypeFlag%dpteta%dmultiple%dpower%dIm",t,pe,m,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]); \r
6713 }\r
6714 }\r
6715 }\r
6716 } \r
6717 // to be improved (add explanation of fs1dEBE[t][pe][k]): \r
6718 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )\r
6719 { \r
6720 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
6721 {\r
6722 for(Int_t k=0;k<9;k++) // power of particle weight\r
6723 {\r
6724 fs1dEBE[t][pe][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%d",t,pe,k),\r
6725 Form("TypeFlag%dpteta%dmultiple%d",t,pe,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]); \r
6726 }\r
6727 }\r
6728 }\r
6729 // correction terms for nua:\r
6730 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)\r
6731 { \r
6732 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
6733 {\r
6734 for(Int_t sc=0;sc<2;sc++) // sin or cos\r
6735 {\r
6736 for(Int_t cti=0;cti<9;cti++) // correction term index\r
6737 {\r
6738 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti] = new TH1D(Form("typeFlag%d pteta%d sincos%d cti%d",t,pe,sc,cti),\r
6739 Form("typeFlag%d pteta%d sincos%d cti%d",t,pe,sc,cti),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]); \r
6740 }\r
6741 }\r
6742 }\r
6743 } \r
6744 // 2D:\r
6745 TProfile2D styleRe("typeMultiplePowerRe","typeMultiplePowerRe",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);\r
6746 TProfile2D styleIm("typeMultiplePowerIm","typeMultiplePowerIm",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);\r
6747 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )\r
6748 { \r
6749 for(Int_t m=0;m<4;m++)\r
6750 {\r
6751 for(Int_t k=0;k<9;k++)\r
6752 {\r
6753 fReRPQ2dEBE[t][m][k] = (TProfile2D*)styleRe.Clone(Form("typeFlag%dmultiple%dpower%dRe",t,m,k)); \r
6754 fImRPQ2dEBE[t][m][k] = (TProfile2D*)styleIm.Clone(Form("typeFlag%dmultiple%dpower%dIm",t,m,k));\r
6755 }\r
6756 } \r
6757 } \r
6758 TProfile2D styleS("typePower","typePower",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);\r
6759 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )\r
6760 { \r
6761 for(Int_t k=0;k<9;k++)\r
6762 {\r
6763 fs2dEBE[t][k] = (TProfile2D*)styleS.Clone(Form("typeFlag%dpower%d",t,k));\r
6764 }\r
6765 }\r
6766 // reduced correlations e-b-e:\r
6767 TString diffFlowCorrelationsEBEName = "fDiffFlowCorrelationsEBE";\r
6768 diffFlowCorrelationsEBEName += fAnalysisLabel->Data();\r
6769 for(Int_t t=0;t<2;t++) // type: RP or POI\r
6770 { \r
6771 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
6772 {\r
6773 for(Int_t rci=0;rci<4;rci++) // reduced correlation index\r
6774 {\r
6775 fDiffFlowCorrelationsEBE[t][pe][rci] = new TH1D(Form("%s, %s, %s, %s",diffFlowCorrelationsEBEName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[rci].Data()),Form("%s, %s, %s, %s",diffFlowCorrelationsEBEName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[rci].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);\r
6776 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index\r
6777 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta \r
6778 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI\r
6779 // event weights for reduced correlations e-b-e:\r
6780 TString diffFlowEventWeightsForCorrelationsEBEName = "fDiffFlowEventWeightsForCorrelationsEBE";\r
6781 diffFlowEventWeightsForCorrelationsEBEName += fAnalysisLabel->Data();\r
6782 for(Int_t t=0;t<2;t++) // type: RP or POI\r
6783 { \r
6784 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
6785 {\r
6786 for(Int_t rci=0;rci<4;rci++) // event weight for reduced correlation index\r
6787 {\r
6788 fDiffFlowEventWeightsForCorrelationsEBE[t][pe][rci] = new TH1D(Form("%s, %s, %s, eW for %s",diffFlowEventWeightsForCorrelationsEBEName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[rci].Data()),Form("%s, %s, %s, eW for %s",diffFlowEventWeightsForCorrelationsEBEName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[rci].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);\r
6789 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index\r
6790 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta \r
6791 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI\r
6792 \r
6793 // d) Book profiles;\r
6794 // reduced correlations:\r
6795 TString diffFlowCorrelationsProName = "fDiffFlowCorrelationsPro";\r
6796 diffFlowCorrelationsProName += fAnalysisLabel->Data();\r
6797 // corrections terms:\r
6798 TString diffFlowCorrectionTermsForNUAProName = "fDiffFlowCorrectionTermsForNUAPro";\r
6799 diffFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();\r
6800 for(Int_t t=0;t<2;t++) // type: RP or POI\r
6801 { \r
6802 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
6803 {\r
6804 for(Int_t rci=0;rci<4;rci++) // reduced correlation index\r
6805 {\r
6806 // reduced correlations:\r
6807 fDiffFlowCorrelationsPro[t][pe][rci] = new TProfile(Form("%s, %s, %s, %s",diffFlowCorrelationsProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[rci].Data()),Form("%s, %s, %s, %s",diffFlowCorrelationsProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[rci].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe],"s");\r
6808 fDiffFlowCorrelationsPro[t][pe][rci]->SetXTitle(ptEtaFlag[pe].Data());\r
6809 fDiffFlowCorrelationsProList[t][pe]->Add(fDiffFlowCorrelationsPro[t][pe][rci]); // to be improved (add dedicated list to hold reduced correlations)\r
6810 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index\r
6811 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta \r
6812 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI\r
6813 // correction terms for nua:\r
6814 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)\r
6815 { \r
6816 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
6817 {\r
6818 for(Int_t sc=0;sc<2;sc++) // sin or cos\r
6819 {\r
6820 for(Int_t cti=0;cti<9;cti++) // correction term index\r
6821 {\r
6822 fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti] = new TProfile(Form("%s, %s, %s, %s, cti = %d",diffFlowCorrectionTermsForNUAProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),cti+1),Form("%s, %s, %s, %s, cti = %d",diffFlowCorrectionTermsForNUAProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),cti+1),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]); \r
6823 fDiffFlowCorrectionsProList[t][pe]->Add(fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]);\r
6824 }\r
6825 }\r
6826 }\r
6827 } \r
6828 // e) Book histograms holding final results. \r
6829 // reduced correlations:\r
6830 TString diffFlowCorrelationsHistName = "fDiffFlowCorrelationsHist";\r
6831 diffFlowCorrelationsHistName += fAnalysisLabel->Data();\r
6832 // corrections terms:\r
6833 TString diffFlowCorrectionTermsForNUAHistName = "fDiffFlowCorrectionTermsForNUAHist";\r
6834 diffFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();\r
6835 // differential covariances:\r
6836 TString diffFlowCovariancesName = "fDiffFlowCovariances";\r
6837 diffFlowCovariancesName += fAnalysisLabel->Data();\r
6838 // differential Q-cumulants:\r
6839 TString diffFlowCumulantsName = "fDiffFlowCumulants";\r
6840 diffFlowCumulantsName += fAnalysisLabel->Data();\r
6841 // differential flow:\r
6842 TString diffFlowName = "fDiffFlow";\r
6843 diffFlowName += fAnalysisLabel->Data();\r
6844 for(Int_t t=0;t<2;t++) // type: RP or POI\r
6845 { \r
6846 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
6847 {\r
6848 for(Int_t index=0;index<4;index++) \r
6849 {\r
6850 // reduced correlations:\r
6851 fDiffFlowCorrelationsHist[t][pe][index] = new TH1D(Form("%s, %s, %s, %s",diffFlowCorrelationsHistName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[index].Data()),Form("%s, %s, %s, %s",diffFlowCorrelationsHistName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[index].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);\r
6852 fDiffFlowCorrelationsHist[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());\r
6853 fDiffFlowCorrelationsHistList[t][pe]->Add(fDiffFlowCorrelationsHist[t][pe][index]); \r
6854 // differential Q-cumulants:\r
6855 fDiffFlowCumulants[t][pe][index] = new TH1D(Form("%s, %s, %s, %s",diffFlowCumulantsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),differentialCumulantIndex[index].Data()),Form("%s, %s, %s, %s",diffFlowCumulantsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),differentialCumulantIndex[index].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);\r
6856 fDiffFlowCumulants[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());\r
6857 fDiffFlowCumulantsHistList[t][pe]->Add(fDiffFlowCumulants[t][pe][index]); \r
6858 // differential flow estimates from Q-cumulants:\r
6859 fDiffFlow[t][pe][index] = new TH1D(Form("%s, %s, %s, %s",diffFlowName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),differentialFlowIndex[index].Data()),Form("%s, %s, %s, %s",diffFlowName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),differentialFlowIndex[index].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);\r
6860 fDiffFlow[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());\r
6861 fDiffFlowHistList[t][pe]->Add(fDiffFlow[t][pe][index]); \r
6862 } // end of for(Int_t index=0;index<4;index++) \r
6863 for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index \r
6864 {\r
6865 // differential covariances:\r
6866 fDiffFlowCovariances[t][pe][covIndex] = new TH1D(Form("%s, %s, %s, %s",diffFlowCovariancesName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),covarianceName[covIndex].Data()),Form("%s, %s, %s, %s",diffFlowCovariancesName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),covarianceName[covIndex].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);\r
6867 fDiffFlowCovariances[t][pe][covIndex]->SetXTitle(ptEtaFlag[pe].Data());\r
6868 fDiffFlowCovariancesHistList[t][pe]->Add(fDiffFlowCovariances[t][pe][covIndex]); \r
6869 } // end of for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index\r
6870 // products of both types of correlations: \r
6871 TString diffFlowProductOfCorrelationsProName = "fDiffFlowProductOfCorrelationsPro";\r
6872 diffFlowProductOfCorrelationsProName += fAnalysisLabel->Data(); \r
6873 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index\r
6874 {\r
6875 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index\r
6876 {\r
6877 fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2] = new TProfile(Form("%s, %s, %s, %s, %s",diffFlowProductOfCorrelationsProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),mixedCorrelationIndex[mci1].Data(),mixedCorrelationIndex[mci2].Data()),Form("%s, %s, %s, %s #times %s",diffFlowProductOfCorrelationsProName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),mixedCorrelationIndex[mci1].Data(),mixedCorrelationIndex[mci2].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]); \r
6878 fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2]->SetXTitle(ptEtaFlag[pe].Data());\r
6879 fDiffFlowProductOfCorrelationsProList[t][pe]->Add(fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2]); \r
6880 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here\r
6881 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index\r
6882 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index \r
6883 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta \r
6884 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI\r
6885 // sums of event weights for reduced correlations: \r
6886 TString diffFlowSumOfEventWeightsName = "fDiffFlowSumOfEventWeights";\r
6887 diffFlowSumOfEventWeightsName += fAnalysisLabel->Data(); \r
6888 for(Int_t t=0;t<2;t++) // type is RP or POI\r
6889 { \r
6890 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
6891 { \r
6892 for(Int_t p=0;p<2;p++) // power of weights is either 1 or 2\r
6893 {\r
6894 for(Int_t ew=0;ew<4;ew++) // index of reduced correlation\r
6895 {\r
6896 fDiffFlowSumOfEventWeights[t][pe][p][ew] = new TH1D(Form("%s, %s, %s, %s, %s",diffFlowSumOfEventWeightsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),powerFlag[p].Data(),reducedCorrelationIndex[ew].Data()),Form("%s, %s, %s, power = %s, %s",diffFlowSumOfEventWeightsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),powerFlag[p].Data(),reducedCorrelationIndex[ew].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]); \r
6897 fDiffFlowSumOfEventWeights[t][pe][p][ew]->SetXTitle(ptEtaFlag[pe].Data());\r
6898 fDiffFlowSumOfEventWeightsHistList[t][pe][p]->Add(fDiffFlowSumOfEventWeights[t][pe][p][ew]); // to be improved (add dedicated list to hold all this)\r
6899 }\r
6900 }\r
6901 }\r
6902 } \r
6903 // sum of products of event weights for both types of correlations: \r
6904 TString diffFlowSumOfProductOfEventWeightsName = "fDiffFlowSumOfProductOfEventWeights";\r
6905 diffFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data(); \r
6906 for(Int_t t=0;t<2;t++) // type is RP or POI\r
6907 {\r
6908 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
6909 { \r
6910 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index\r
6911 {\r
6912 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index\r
6913 {\r
6914 fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2] = new TH1D(Form("%s, %s, %s, %s, %s",diffFlowSumOfProductOfEventWeightsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),mixedCorrelationIndex[mci1].Data(),mixedCorrelationIndex[mci2].Data()),Form("%s, %s, %s, %s #times %s",diffFlowSumOfProductOfEventWeightsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),mixedCorrelationIndex[mci1].Data(),mixedCorrelationIndex[mci2].Data()),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]); \r
6915 fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2]->SetXTitle(ptEtaFlag[pe].Data());\r
6916 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]->Add(fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2]); \r
6917 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here\r
6918 }\r
6919 }\r
6920 }\r
6921 } \r
6922 // correction terms for nua:\r
6923 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)\r
6924 { \r
6925 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
6926 {\r
6927 for(Int_t sc=0;sc<2;sc++) // sin or cos\r
6928 {\r
6929 for(Int_t cti=0;cti<9;cti++) // correction term index\r
6930 {\r
6931 fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti] = new TH1D(Form("%s, %s, %s, %s, cti = %d",diffFlowCorrectionTermsForNUAHistName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),cti+1),Form("%s, %s, %s, %s, cti = %d",diffFlowCorrectionTermsForNUAHistName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),cti+1),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]); \r
6932 fDiffFlowCorrectionsHistList[t][pe]->Add(fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti]);\r
6933 }\r
6934 }\r
6935 }\r
6936 } \r
6937 \r
6938} // end of AliFlowAnalysisWithQCumulants::BookEverythingForDifferentialFlow()\r
6939\r
6940\r
6941//================================================================================================================================\r
6942\r
6943/*\r
6944void AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNUAForIntQcumulants() // to be improved (do I really need this method?)\r
6945{\r
6946 // Calculate final corrections for non-uniform acceptance for Q-cumulants.\r
6947 \r
6948 // Corrections for non-uniform acceptance are stored in histogram fCorrectionsForNUA,\r
6949 // binning of fCorrectionsForNUA is organized as follows:\r
6950 //\r
6951 // 1st bin: correction to QC{2}\r
6952 // 2nd bin: correction to QC{4}\r
6953 // 3rd bin: correction to QC{6}\r
6954 // 4th bin: correction to QC{8}\r
6955 \r
6956 // shortcuts flags:\r
6957 Int_t pW = (Int_t)(useParticleWeights);\r
6958 \r
6959 Int_t eW = -1;\r
6960 \r
6961 if(eventWeights == "exact")\r
6962 {\r
6963 eW = 0;\r
6964 }\r
6965\r
6966 for(Int_t sc=0;sc<2;sc++) // sin or cos terms flag\r
6967 {\r
6968 if(!(fQCorrelations[pW][eW] && fQCorrections[pW][eW][sc] && fCorrections[pW][eW]))\r
6969 {\r
6970 cout<<"WARNING: fQCorrelations[pW][eW] && fQCorrections[pW][eW][sc] && fCorrections[pW][eW] is NULL in AFAWQC::CFCFNUAFIF() !!!!"<<endl;\r
6971 cout<<"pW = "<<pW<<endl;\r
6972 cout<<"eW = "<<eW<<endl;\r
6973 cout<<"sc = "<<sc<<endl;\r
6974 exit(0);\r
6975 }\r
6976 } \r
6977\r
6978 // measured 2-, 4-, 6- and 8-particle azimuthal correlations (biased with non-uniform acceptance!):\r
6979 Double_t two = fQCorrelations[pW][eW]->GetBinContent(1); // <<2>>\r
6980 //Double_t four = fQCorrelations[pW][eW]->GetBinContent(11); // <<4>>\r
6981 //Double_t six = fQCorrelations[pW][eW]->GetBinContent(24); // <<6>>\r
6982 //Double_t eight = fQCorrelations[pW][eW]->GetBinContent(31); // <<8>>\r
6983 \r
6984 // correction terms to QC{2}:\r
6985 // <<cos(n*phi1)>>^2\r
6986 Double_t two1stTerm = pow(fQCorrections[pW][eW][1]->GetBinContent(1),2); \r
6987 // <<sin(n*phi1)>>^2\r
6988 Double_t two2ndTerm = pow(fQCorrections[pW][eW][0]->GetBinContent(1),2); \r
6989 // final corrections for non-uniform acceptance to QC{2}:\r
6990 Double_t correctionQC2 = -1.*two1stTerm-1.*two2ndTerm;\r
6991 fCorrections[pW][eW]->SetBinContent(1,correctionQC2); \r
6992 \r
6993 // correction terms to QC{4}:\r
6994 // <<cos(n*phi1)>> <<cos(n*(phi1-phi2-phi3))>>\r
6995 Double_t four1stTerm = fQCorrections[pW][eW][1]->GetBinContent(1)*fQCorrections[pW][eW][1]->GetBinContent(3); \r
6996 // <<sin(n*phi1)>> <<sin(n*(phi1-phi2-phi3))>>\r
6997 Double_t four2ndTerm = fQCorrections[pW][eW][0]->GetBinContent(1)*fQCorrections[pW][eW][0]->GetBinContent(3); \r
6998 // <<cos(n*(phi1+phi2))>>^2\r
6999 Double_t four3rdTerm = pow(fQCorrections[pW][eW][1]->GetBinContent(2),2); \r
7000 // <<sin(n*(phi1+phi2))>>^2\r
7001 Double_t four4thTerm = pow(fQCorrections[pW][eW][0]->GetBinContent(2),2); \r
7002 // <<cos(n*(phi1+phi2))>> (<<cos(n*phi1)>>^2 - <<sin(n*phi1)>>^2)\r
7003 Double_t four5thTerm = fQCorrections[pW][eW][1]->GetBinContent(2)\r
7004 * (pow(fQCorrections[pW][eW][1]->GetBinContent(1),2)-pow(fQCorrections[pW][eW][0]->GetBinContent(1),2));\r
7005 // <<sin(n*(phi1+phi2))>> <<cos(n*phi1)>> <<sin(n*phi1)>>\r
7006 Double_t four6thTerm = fQCorrections[pW][eW][0]->GetBinContent(2)\r
7007 * fQCorrections[pW][eW][1]->GetBinContent(1)\r
7008 * fQCorrections[pW][eW][0]->GetBinContent(1); \r
7009 // <<cos(n*(phi1-phi2))>> (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2)\r
7010 Double_t four7thTerm = two*(pow(fQCorrections[pW][eW][1]->GetBinContent(1),2)+pow(fQCorrections[pW][eW][0]->GetBinContent(1),2)); \r
7011 // (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2)^2\r
7012 Double_t four8thTerm = pow(pow(fQCorrections[pW][eW][1]->GetBinContent(1),2)+pow(fQCorrections[pW][eW][0]->GetBinContent(1),2),2); \r
7013 // final correction to QC{4}:\r
7014 Double_t correctionQC4 = -4.*four1stTerm+4.*four2ndTerm-four3rdTerm-four4thTerm\r
7015 + 4.*four5thTerm+8.*four6thTerm+8.*four7thTerm-6.*four8thTerm; \r
7016 fCorrections[pW][eW]->SetBinContent(2,correctionQC4); \r
7017\r
7018 // ... to be improved (continued for 6th and 8th order) \r
7019\r
7020\r
7021} // end of AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNUAForIntQcumulants()\r
7022*/\r
7023\r
7024//================================================================================================================================\r
7025\r
7026\r
7027void AliFlowAnalysisWithQCumulants::CalculateQcumulantsCorrectedForNUAIntFlow()\r
7028{\r
7029 // Calculate generalized Q-cumulants (cumulants corrected for non-unifom acceptance).\r
7030 \r
7031 // measured 2-, 4-, 6- and 8-particle correlations (biased by non-uniform acceptance!):\r
7032 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>\r
7033 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>\r
7034 //Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>\r
7035 //Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>\r
7036 \r
7037 // statistical error of measured 2-, 4-, 6- and 8-particle correlations:\r
7038 //Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <<2>>\r
7039 //Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <<4>>\r
7040 //Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <<6>>\r
7041 //Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <<8>>\r
7042\r
7043 // QC{2}:\r
7044 // <<cos(n*phi1)>>^2\r
7045 Double_t two1stTerm = pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1),2); \r
7046 //Double_t two1stTermErrorSquared = pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(1),2); \r
7047 // <<sin(n*phi1)>>^2\r
7048 Double_t two2ndTerm = pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1),2); \r
7049 //Double_t two2ndTermErrorSquared = pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(1),2); \r
7050 // generalized QC{2}:\r
7051 Double_t gQC2 = two - two1stTerm - two2ndTerm; // to be improved (terminology, notation)\r
7052 fIntFlowQcumulants->SetBinContent(1,gQC2); \r
7053 //fIntFlowQcumulants->SetBinError(1,0.); // to be improved (propagate error) \r
7054 \r
7055 // QC{4}:\r
7056 // <<cos(n*phi1)>> <<cos(n*(phi1-phi2-phi3))>>\r
7057 Double_t four1stTerm = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1)\r
7058 * fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(3); \r
7059 // <<sin(n*phi1)>> <<sin(n*(phi1-phi2-phi3))>>\r
7060 Double_t four2ndTerm = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1)\r
7061 * fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(3); \r
7062 // <<cos(n*(phi1+phi2))>>^2\r
7063 Double_t four3rdTerm = pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2),2); \r
7064 // <<sin(n*(phi1+phi2))>>^2\r
7065 Double_t four4thTerm = pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2),2); \r
7066 // <<cos(n*(phi1+phi2))>> (<<cos(n*phi1)>>^2 - <<sin(n*phi1)>>^2)\r
7067 Double_t four5thTerm = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2)\r
7068 * (pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1),2)\r
7069 - pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1),2));\r
7070 // <<sin(n*(phi1+phi2))>> <<cos(n*phi1)>> <<sin(n*phi1)>>\r
7071 Double_t four6thTerm = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2)\r
7072 * fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1)\r
7073 * fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1); \r
7074 // <<cos(n*(phi1-phi2))>> (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2)\r
7075 Double_t four7thTerm = two*(pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1),2)\r
7076 + pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1),2)); \r
7077 // (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2)^2\r
7078 Double_t four8thTerm = pow(pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1),2)\r
7079 + pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1),2),2); \r
7080 // generalized QC{4}:\r
7081 Double_t gQC4 = four-2.*pow(two,2.)-4.*four1stTerm+4.*four2ndTerm-four3rdTerm\r
7082 - four4thTerm+4.*four5thTerm+8.*four6thTerm+8.*four7thTerm-6.*four8thTerm; \r
7083 fIntFlowQcumulants->SetBinContent(2,gQC4); \r
7084 //fIntFlowQcumulants->SetBinError(2,0.); // to be improved (propagate error) \r
7085\r
7086 // ... to be improved (continued for 6th and 8th order) \r
7087 \r
7088} // end of void AliFlowAnalysisWithQCumulants::CalculateQcumulantsCorrectedForNUAIntFlow()\r
7089\r
7090\r
7091//================================================================================================================================\r
7092\r
7093\r
7094void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectedForNUA()\r
7095{\r
7096 // Calculate integrated flow from generalized Q-cumulants (corrected for non-uniform acceptance).\r
7097 \r
7098 // to be improved: add protection for NULL pointers, propagate statistical errors from \r
7099 // measured correlations and correction terms\r
7100 \r
7101 // generalized Q-cumulants:\r
7102 Double_t qc2 = fIntFlowQcumulants->GetBinContent(1); // QC{2} \r
7103 Double_t qc4 = fIntFlowQcumulants->GetBinContent(2); // QC{4} \r
7104 //Double_t qc6 = fIntFlowQcumulants->GetBinContent(3); // QC{6} \r
7105 //Double_t qc8 = fIntFlowQcumulants->GetBinContent(4); // QC{8}\r
7106 \r
7107 // integrated flow estimates:\r
7108 Double_t v2 = 0.; // v{2,QC} \r
7109 Double_t v4 = 0.; // v{4,QC} \r
7110 //Double_t v6 = 0.; // v{6,QC} \r
7111 //Double_t v8 = 0.; // v{8,QC}\r
7112\r
7113 // calculate integrated flow estimates from generalized Q-cumulants: \r
7114 if(qc2>=0.) v2 = pow(qc2,1./2.); \r
7115 if(qc4<=0.) v4 = pow(-1.*qc4,1./4.); \r
7116 //if(qc6>=0.) v6 = pow((1./4.)*qc6,1./6.); \r
7117 //if(qc8<=0.) v8 = pow((-1./33.)*qc8,1./8.); \r
7118\r
7119 // store integrated flow estimates from generalized Q-cumulants:\r
7120 fIntFlow->SetBinContent(1,v2);\r
7121 fIntFlow->SetBinContent(2,v4);\r
7122 //fIntFlow->SetBinContent(3,v6);\r
7123 //fIntFlow->SetBinContent(4,v8);\r
7124\r
7125} // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectedForNUA()\r
7126\r
7127 \r
7128//================================================================================================================================\r
7129\r
7130\r
7131void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUAIntFlow() \r
7132{\r
7133 // From profile fIntFlowCorrectionTermsForNUAPro[2] access measured corretion terms\r
7134 // and their spread, correctly calculate the statistical errors and store the final \r
7135 // results and statistical errors for correction terms in histogram fIntFlowCorrectionTermsForNUAHist[2].\r
7136 //\r
7137 // Remark: Statistical error of correction temrs is calculated as:\r
7138 //\r
7139 // statistical error = termA * spread * termB:\r
7140 // termA = sqrt{sum_{i=1}^{N} w^2}/(sum_{i=1}^{N} w)\r
7141 // termB = 1/sqrt(1-termA^2) \r
7142 \r
7143 /* // to be improved (implement protection here)\r
7144 for(Int_t power=0;power<2;power++)\r
7145 { \r
7146 if(!(fIntFlowCorrelationsHist && fIntFlowCorrelationsPro && fIntFlowSumOfEventWeights[power])) \r
7147 {\r
7148 cout<<"WARNING: fIntFlowCorrelationsHist && fIntFlowCorrelationsPro && fIntFlowSumOfEventWeights[power] is NULL in AFAWQC::FCIF() !!!!"<<endl;\r
7149 cout<<"power = "<<power<<endl;\r
7150 exit(0);\r
7151 }\r
7152 }\r
7153 */\r
7154 \r
7155 for(Int_t sc=0;sc<2;sc++) // sin or cos correction terms \r
7156 {\r
7157 for(Int_t ci=1;ci<=10;ci++) // correction term index\r
7158 {\r
7159 Double_t correction = fIntFlowCorrectionTermsForNUAPro[sc]->GetBinContent(ci);\r
7160 //Double_t spread = fIntFlowCorrectionTermsForNUAPro[sc]->GetBinError(ci);\r
7161 //Double_t sumOfLinearEventWeights = fIntFlowSumOfEventWeights[0]->GetBinContent(ci);\r
7162 //Double_t sumOfQuadraticEventWeights = fIntFlowSumOfEventWeights[1]->GetBinContent(ci);\r
7163 //Double_t termA = 0.;\r
7164 //Double_t termB = 0.;\r
7165 //if(sumOfLinearEventWeights)\r
7166 //{\r
7167 // termA = pow(sumOfQuadraticEventWeights,0.5)/sumOfLinearEventWeights;\r
7168 //} else\r
7169 // {\r
7170 // cout<<"WARNING: sumOfLinearEventWeights == 0 in AFAWQC::FCIF() !!!!"<<endl;\r
7171 // cout<<" (for "<<2*ci<<"-particle correlation)"<<endl;\r
7172 // }\r
7173 /*\r
7174 if(1.-pow(termA,2.) > 0.)\r
7175 {\r
7176 termB = 1./pow(1-pow(termA,2.),0.5);\r
7177 } else\r
7178 {\r
7179 cout<<"WARNING: 1.-pow(termA,2.) <= 0 in AFAWQC::FCIF() !!!!"<<endl; \r
7180 cout<<" (for "<<2*ci<<"-particle correlation)"<<endl;\r
7181 } \r
7182 Double_t statisticalError = termA * spread * termB;\r
7183 */\r
7184 fIntFlowCorrectionTermsForNUAHist[sc]->SetBinContent(ci,correction);\r
7185 //fIntFlowCorrectionTermsForNUAHist[sc]->SetBinError(ci,statisticalError);\r
7186 } // end of for(Int_t ci=1;ci<=10;ci++) // correction term index\r
7187 } // end of for(Int sc=0;sc<2;sc++) // sin or cos correction terms \r
7188 \r
7189} // end of void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUAIntFlow()\r
7190\r
7191\r
7192//================================================================================================================================\r
7193\r
7194\r
7195void AliFlowAnalysisWithQCumulants::GetPointersForNestedLoopsHistograms(TList *outputListHistos)\r
7196{\r
7197 // Get pointers to all objects relevant for calculations with nested loops.\r
7198 \r
7199 if(outputListHistos)\r
7200 {\r
7201 TList *nestedLoopsList = dynamic_cast<TList*>(outputListHistos->FindObject("Nested Loops"));\r
7202 if(nestedLoopsList) \r
7203 {\r
7204 this->SetNestedLoopsList(nestedLoopsList);\r
7205 } else\r
7206 {\r
7207 cout<<"WARNING: nestedLoopsList is NULL in AFAWQC::GPFNLH() !!!!"<<endl;\r
7208 exit(0);\r
7209 }\r
7210 \r
7211 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)\r
7212 TString typeFlag[2] = {"RP","POI"}; // to be improved (should I promote this to data members?)\r
7213 TString ptEtaFlag[2] = {"p_{T}","#eta"}; // to be improved (should I promote this to data members?)\r
7214 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"}; // to be improved (should I promote this to data members?)\r
7215 \r
7216 TString evaluateNestedLoopsName = "fEvaluateNestedLoops";\r
7217 evaluateNestedLoopsName += fAnalysisLabel->Data(); \r
7218 TProfile *evaluateNestedLoops = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(evaluateNestedLoopsName.Data()));\r
7219 Bool_t bEvaluateIntFlowNestedLoops = kFALSE;\r
7220 Bool_t bEvaluateDiffFlowNestedLoops = kFALSE;\r
7221 if(evaluateNestedLoops)\r
7222 {\r
7223 this->SetEvaluateNestedLoops(evaluateNestedLoops);\r
7224 bEvaluateIntFlowNestedLoops = (Int_t)evaluateNestedLoops->GetBinContent(1);\r
7225 bEvaluateDiffFlowNestedLoops = (Int_t)evaluateNestedLoops->GetBinContent(2);\r
7226 }\r
7227 // nested loops relevant for integrated flow: \r
7228 if(bEvaluateIntFlowNestedLoops)\r
7229 {\r
7230 // correlations:\r
7231 TString intFlowDirectCorrelationsName = "fIntFlowDirectCorrelations";\r
7232 intFlowDirectCorrelationsName += fAnalysisLabel->Data();\r
7233 TProfile *intFlowDirectCorrelations = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(intFlowDirectCorrelationsName.Data()));\r
7234 if(intFlowDirectCorrelations) \r
7235 { \r
7236 this->SetIntFlowDirectCorrelations(intFlowDirectCorrelations);\r
7237 } else\r
7238 {\r
7239 cout<<"WARNING: intFlowDirectCorrelations is NULL in AFAWQC::GPFNLH() !!!!"<<endl;\r
7240 exit(0);\r
7241 }\r
7242 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights) \r
7243 {\r
7244 TString intFlowExtraDirectCorrelationsName = "fIntFlowExtraDirectCorrelations";\r
7245 intFlowExtraDirectCorrelationsName += fAnalysisLabel->Data();\r
7246 TProfile *intFlowExtraDirectCorrelations = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(intFlowExtraDirectCorrelationsName.Data()));\r
7247 if(intFlowExtraDirectCorrelations) \r
7248 { \r
7249 this->SetIntFlowExtraDirectCorrelations(intFlowExtraDirectCorrelations);\r
7250 } else\r
7251 {\r
7252 cout<<"WARNING: intFlowExtraDirectCorrelations is NULL in AFAWQC::GPFNLH() !!!!"<<endl;\r
7253 exit(0);\r
7254 } \r
7255 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights) \r
7256 // correction terms for non-uniform acceptance:\r
7257 TString intFlowDirectCorrectionTermsForNUAName = "fIntFlowDirectCorrectionTermsForNUA";\r
7258 intFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();\r
7259 TProfile *intFlowDirectCorrectionTermsForNUA[2] = {NULL};\r
7260 for(Int_t sc=0;sc<2;sc++) // sin or cos terms\r
7261 {\r
7262 intFlowDirectCorrectionTermsForNUA[sc] = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(Form("%s: %s terms",intFlowDirectCorrectionTermsForNUAName.Data(),sinCosFlag[sc].Data())));\r
7263 if(intFlowDirectCorrectionTermsForNUA[sc]) \r
7264 { \r
7265 this->SetIntFlowDirectCorrectionTermsForNUA(intFlowDirectCorrectionTermsForNUA[sc],sc);\r
7266 } else\r
7267 {\r
7268 cout<<"WARNING: intFlowDirectCorrectionTermsForNUA[sc] is NULL in AFAWQC::GPFNLH() !!!!"<<endl;\r
7269 cout<<"sc = "<<sc<<endl;\r
7270 exit(0);\r
7271 }\r
7272 } // end of for(Int_t sc=0;sc<2;sc++) \r
7273 } // end of if(bEvaluateIntFlowNestedLoops)\r
7274 \r
7275 // nested loops relevant for differential flow: \r
7276 if(bEvaluateDiffFlowNestedLoops)\r
7277 {\r
7278 // correlations:\r
7279 TString diffFlowDirectCorrelationsName = "fDiffFlowDirectCorrelations";\r
7280 diffFlowDirectCorrelationsName += fAnalysisLabel->Data();\r
7281 TProfile *diffFlowDirectCorrelations[2][2][4] = {{{NULL}}};\r
7282 for(Int_t t=0;t<2;t++)\r
7283 {\r
7284 for(Int_t pe=0;pe<2;pe++)\r
7285 {\r
7286 for(Int_t ci=0;ci<4;ci++) // correlation index\r
7287 {\r
7288 diffFlowDirectCorrelations[t][pe][ci] = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(Form("%s, %s, %s, %s",diffFlowDirectCorrelationsName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),reducedCorrelationIndex[ci].Data())));\r
7289 if(diffFlowDirectCorrelations[t][pe][ci])\r
7290 {\r
7291 this->SetDiffFlowDirectCorrelations(diffFlowDirectCorrelations[t][pe][ci],t,pe,ci);\r
7292 } else\r
7293 {\r
7294 cout<<"WARNING: diffFlowDirectCorrelations[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
7295 cout<<"t = "<<t<<endl;\r
7296 cout<<"pe = "<<pe<<endl; \r
7297 cout<<"ci = "<<ci<<endl;\r
7298 } \r
7299 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index \r
7300 } // end of for(Int_t pe=0;pe<2;pe++)\r
7301 } // end of for(Int_t t=0;t<2;t++) \r
7302 // correction terms for non-uniform acceptance:\r
7303 TString diffFlowDirectCorrectionTermsForNUAName = "fDiffFlowDirectCorrectionTermsForNUA";\r
7304 diffFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data(); \r
7305 TProfile *diffFlowDirectCorrectionTermsForNUA[2][2][2][10] = {{{{NULL}}}}; \r
7306 for(Int_t t=0;t<2;t++)\r
7307 {\r
7308 for(Int_t pe=0;pe<2;pe++)\r
7309 {\r
7310 // correction terms for NUA:\r
7311 for(Int_t sc=0;sc<2;sc++) // sin or cos\r
7312 {\r
7313 for(Int_t cti=0;cti<9;cti++) // correction term index\r
7314 {\r
7315 diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti] = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(Form("%s, %s, %s, %s, cti = %d",diffFlowDirectCorrectionTermsForNUAName.Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data(),sinCosFlag[sc].Data(),cti+1)));\r
7316 if(diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti])\r
7317 {\r
7318 this->SetDiffFlowDirectCorrectionTermsForNUA(diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti],t,pe,sc,cti);\r
7319 } else\r
7320 {\r
7321 cout<<"WARNING: diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
7322 cout<<"t = "<<t<<endl;\r
7323 cout<<"pe = "<<pe<<endl; \r
7324 cout<<"sc = "<<sc<<endl;\r
7325 cout<<"cti = "<<cti<<endl;\r
7326 } \r
7327 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index\r
7328 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos\r
7329 } // end of for(Int_t pe=0;pe<2;pe++)\r
7330 } // end of for(Int_t t=0;t<2;t++)\r
7331 } // end of if(bEvaluateDiffFlowNestedLoops)\r
7332 } else // to if(outputListHistos)\r
7333 {\r
7334 cout<<"WARNING: outputListHistos is NULL in AFAWQC::GPFNLH() !!!!"<<endl;\r
7335 exit(0);\r
7336 }\r
7337\r
7338} // end of void AliFlowAnalysisWithQCumulants::GetPointersForNestedLoopsHistograms(TList *outputListHistos)\r
7339\r
7340\r
7341//================================================================================================================================\r
7342\r
7343\r
7344void AliFlowAnalysisWithQCumulants::StoreHarmonic()\r
7345{\r
7346 // Store flow harmonic in common control histograms.\r
7347\r
7348 (fCommonHists->GetHarmonic())->Fill(0.5,fHarmonic);\r
7349 (fCommonHists2nd->GetHarmonic())->Fill(0.5,fHarmonic);\r
7350 (fCommonHists4th->GetHarmonic())->Fill(0.5,fHarmonic);\r
7351 (fCommonHists6th->GetHarmonic())->Fill(0.5,fHarmonic);\r
7352 (fCommonHists8th->GetHarmonic())->Fill(0.5,fHarmonic);\r
7353\r
7354} // end of void AliFlowAnalysisWithQCumulants::StoreHarmonic()\r
7355\r
7356\r
7357//================================================================================================================================\r
7358\r
7359\r
7360void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelationsUsingParticleWeights(TString type, TString ptOrEta) // type = RP or POI \r
7361{\r
7362 // Calculate all correlations needed for differential flow using particle weights.\r
7363 \r
7364 Int_t t = -1; // type flag \r
7365 Int_t pe = -1; // ptEta flag\r
7366 \r
7367 if(type == "RP")\r
7368 {\r
7369 t = 0;\r
7370 } else if(type == "POI")\r
7371 {\r
7372 t = 1;\r
7373 }\r
7374\r
7375 if(ptOrEta == "Pt")\r
7376 {\r
7377 pe = 0;\r
7378 } else if(ptOrEta == "Eta")\r
7379 {\r
7380 pe = 1;\r
7381 }\r
7382 \r
7383 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
7384 Double_t minPtEta[2] = {fPtMin,fEtaMin};\r
7385 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};\r
7386 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};\r
7387\r
7388 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n: \r
7389 Double_t dReQ1n1k = (*fReQ)(0,1);\r
7390 Double_t dReQ2n2k = (*fReQ)(1,2);\r
7391 Double_t dReQ1n3k = (*fReQ)(0,3);\r
7392 //Double_t dReQ4n4k = (*fReQ)(3,4);\r
7393 Double_t dImQ1n1k = (*fImQ)(0,1);\r
7394 Double_t dImQ2n2k = (*fImQ)(1,2);\r
7395 Double_t dImQ1n3k = (*fImQ)(0,3);\r
7396 //Double_t dImQ4n4k = (*fImQ)(3,4);\r
7397 \r
7398 // S^M_{p,k} (see .h file for the definition of fSMpk):\r
7399 Double_t dSM1p1k = (*fSMpk)(0,1);\r
7400 Double_t dSM1p2k = (*fSMpk)(0,2);\r
7401 Double_t dSM1p3k = (*fSMpk)(0,3);\r
7402 Double_t dSM2p1k = (*fSMpk)(1,1);\r
7403 Double_t dSM3p1k = (*fSMpk)(2,1);\r
7404 \r
7405 // looping over all bins and calculating reduced correlations: \r
7406 for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
7407 {\r
7408 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin): \r
7409 Double_t p1n0kRe = 0.;\r
7410 Double_t p1n0kIm = 0.;\r
7411\r
7412 // number of POIs in particular (pt,eta) bin):\r
7413 Double_t mp = 0.;\r
7414\r
7415 // real and imaginary parts of q_{m*n,k}: \r
7416 // (weighted Q-vector evaluated for particles which are both RPs and POIs in particular (pt,eta) bin)\r
7417 Double_t q1n2kRe = 0.;\r
7418 Double_t q1n2kIm = 0.;\r
7419 Double_t q2n1kRe = 0.;\r
7420 Double_t q2n1kIm = 0.;\r
7421\r
7422 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation) \r
7423 Double_t s1p1k = 0.; \r
7424 Double_t s1p2k = 0.; \r
7425 Double_t s1p3k = 0.; \r
7426 \r
7427 // M0111 from Eq. (118) in QC2c (to be improved (notation))\r
7428 Double_t dM0111 = 0.;\r
7429 \r
7430 if(type == "POI")\r
7431 {\r
7432 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))\r
7433 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));\r
7434 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b)) \r
7435 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));\r
7436 \r
7437 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)\r
7438 \r
7439 t = 1; // typeFlag = RP or POI\r
7440 \r
7441 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!)) \r
7442 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))\r
7443 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));\r
7444 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))\r
7445 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b));\r
7446 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))\r
7447 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));\r
7448 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))\r
7449 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b));\r
7450 \r
7451 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation) \r
7452 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.); \r
7453 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.); \r
7454 s1p3k = pow(fs1dEBE[2][pe][3]->GetBinContent(b)*fs1dEBE[2][pe][3]->GetBinEntries(b),1.); \r
7455 \r
7456 // M0111 from Eq. (118) in QC2c (to be improved (notation)):\r
7457 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)\r
7458 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)\r
7459 + 2.*(s1p3k-s1p2k*dSM1p1k));\r
7460 }\r
7461 else if(type == "RP")\r
7462 {\r
7463 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!)) \r
7464 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))\r
7465 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));\r
7466 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))\r
7467 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));\r
7468 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))\r
7469 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));\r
7470 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))\r
7471 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));\r
7472\r
7473 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation) \r
7474 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.); \r
7475 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.); \r
7476 s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.); \r
7477 \r
7478 // to be improved (cross-checked):\r
7479 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))\r
7480 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));\r
7481 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b)) \r
7482 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));\r
7483 \r
7484 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)\r
7485 \r
7486 t = 0; // typeFlag = RP or POI\r
7487 \r
7488 // M0111 from Eq. (118) in QC2c (to be improved (notation)):\r
7489 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)\r
7490 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)\r
7491 + 2.*(s1p3k-s1p2k*dSM1p1k));\r
7492 //............................................................................................... \r
7493 }\r
7494 \r
7495 // 2'-particle correlation:\r
7496 Double_t two1n1nW0W1 = 0.;\r
7497 if(mp*dSM1p1k-s1p1k)\r
7498 {\r
7499 two1n1nW0W1 = (p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k-s1p1k)\r
7500 / (mp*dSM1p1k-s1p1k);\r
7501 \r
7502 // fill profile to get <<2'>> \r
7503 fDiffFlowCorrelationsPro[t][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nW0W1,mp*dSM1p1k-s1p1k);\r
7504 // histogram to store <2'> e-b-e (needed in some other methods):\r
7505 fDiffFlowCorrelationsEBE[t][pe][0]->SetBinContent(b,two1n1nW0W1); \r
7506 fDiffFlowEventWeightsForCorrelationsEBE[t][pe][0]->SetBinContent(b,mp*dSM1p1k-s1p1k); \r
7507 } // end of if(mp*dSM1p1k-s1p1k)\r
7508 \r
7509 // 4'-particle correlation:\r
7510 Double_t four1n1n1n1nW0W1W1W1 = 0.;\r
7511 if(dM0111)\r
7512 {\r
7513 four1n1n1n1nW0W1W1W1 = ((pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)\r
7514 - q2n1kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))\r
7515 - 2.*q2n1kIm*dReQ1n1k*dImQ1n1k\r
7516 - p1n0kRe*(dReQ1n1k*dReQ2n2k+dImQ1n1k*dImQ2n2k)\r
7517 + p1n0kIm*(dImQ1n1k*dReQ2n2k-dReQ1n1k*dImQ2n2k)\r
7518 - 2.*dSM1p2k*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)\r
7519 - 2.*(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*s1p1k \r
7520 + 6.*(q1n2kRe*dReQ1n1k+q1n2kIm*dImQ1n1k) \r
7521 + 1.*(q2n1kRe*dReQ2n2k+q2n1kIm*dImQ2n2k) \r
7522 + 2.*(p1n0kRe*dReQ1n3k+p1n0kIm*dImQ1n3k) \r
7523 + 2.*s1p1k*dSM1p2k \r
7524 - 6.*s1p3k) \r
7525 / dM0111; // to be improved (notation of dM0111)\r
7526 \r
7527 // fill profile to get <<4'>> \r
7528 fDiffFlowCorrelationsPro[t][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nW0W1W1W1,dM0111);\r
7529 // histogram to store <4'> e-b-e (needed in some other methods):\r
7530 fDiffFlowCorrelationsEBE[t][pe][1]->SetBinContent(b,four1n1n1n1nW0W1W1W1); \r
7531 fDiffFlowEventWeightsForCorrelationsEBE[t][pe][1]->SetBinContent(b,dM0111); \r
7532 } // end of if(dM0111)\r
7533 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
7534\r
7535} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelationsUsingParticleWeights(TString type, TString ptOrEta); // type = RP or POI \r
7536\r
7537\r
7538//================================================================================================================================\r
7539\r
7540\r
7541void AliFlowAnalysisWithQCumulants::FillCommonControlHistograms(AliFlowEventSimple *anEvent)\r
7542{\r
7543 // Fill common control histograms.\r
7544 \r
7545 Int_t nRP = anEvent->GetEventNSelTracksRP(); // number of RPs (i.e. number of particles used to determine the reaction plane)\r
7546 fCommonHists->FillControlHistograms(anEvent); \r
7547 if(nRP>1)\r
7548 {\r
7549 fCommonHists2nd->FillControlHistograms(anEvent); \r
7550 if(nRP>3)\r
7551 {\r
7552 fCommonHists4th->FillControlHistograms(anEvent); \r
7553 if(nRP>5)\r
7554 {\r
7555 fCommonHists6th->FillControlHistograms(anEvent); \r
7556 if(nRP>7)\r
7557 {\r
7558 fCommonHists8th->FillControlHistograms(anEvent); \r
7559 } // end of if(nRP>7) \r
7560 } // end of if(nRP>5) \r
7561 } // end of if(nRP>3) \r
7562 } // end of if(nRP>1) \r
7563 \r
7564} // end of void AliFlowAnalysisWithQCumulants::FillCommonControlHistograms(AliFlowEventSimple *anEvent)\r
7565\r
7566\r
7567//================================================================================================================================\r
7568\r
7569\r
7570void AliFlowAnalysisWithQCumulants::ResetEventByEventQuantities()\r
7571{\r
7572 // Reset all event by event quantities.\r
7573 \r
7574 // integrated flow:\r
7575 fReQ->Zero();\r
7576 fImQ->Zero();\r
7577 fSMpk->Zero();\r
7578 fIntFlowCorrelationsEBE->Reset();\r
7579 fIntFlowEventWeightsForCorrelationsEBE->Reset();\r
7580 fIntFlowCorrelationsAllEBE->Reset();\r
7581 \r
7582 if(fApplyCorrectionForNUA) \r
7583 {\r
7584 for(Int_t sc=0;sc<2;sc++)\r
7585 {\r
7586 fIntFlowCorrectionTermsForNUAEBE[sc]->Reset();\r
7587 } \r
7588 }\r
7589 \r
7590 // differential flow:\r
7591 // 1D:\r
7592 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)\r
7593 {\r
7594 for(Int_t pe=0;pe<2;pe++) // 1D in pt or eta\r
7595 {\r
7596 for(Int_t m=0;m<4;m++) // multiple of harmonic\r
7597 {\r
7598 for(Int_t k=0;k<9;k++) // power of weight\r
7599 {\r
7600 if(fReRPQ1dEBE[t][pe][m][k]) fReRPQ1dEBE[t][pe][m][k]->Reset();\r
7601 if(fImRPQ1dEBE[t][pe][m][k]) fImRPQ1dEBE[t][pe][m][k]->Reset();\r
7602 } \r
7603 }\r
7604 }\r
7605 }\r
7606 \r
7607 for(Int_t t=0;t<3;t++) // type (0 = RP, 1 = POI, 2 = RP&&POI )\r
7608 { \r
7609 for(Int_t pe=0;pe<2;pe++) // 1D in pt or eta\r
7610 {\r
7611 for(Int_t k=0;k<9;k++)\r
7612 {\r
7613 if(fs1dEBE[t][pe][k]) fs1dEBE[t][pe][k]->Reset();\r
7614 }\r
7615 }\r
7616 }\r
7617\r
7618 // e-b-e reduced correlations:\r
7619 for(Int_t t=0;t<2;t++) // type (0 = RP, 1 = POI)\r
7620 { \r
7621 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
7622 {\r
7623 for(Int_t rci=0;rci<4;rci++) // reduced correlation index\r
7624 {\r
7625 if(fDiffFlowCorrelationsEBE[t][pe][rci]) fDiffFlowCorrelationsEBE[t][pe][rci]->Reset();\r
7626 if(fDiffFlowEventWeightsForCorrelationsEBE[t][pe][rci]) fDiffFlowEventWeightsForCorrelationsEBE[t][pe][rci]->Reset();\r
7627 }\r
7628 }\r
7629 }\r
7630 \r
7631 // correction terms for NUA:\r
7632 for(Int_t t=0;t<2;t++) // type (0 = RP, 1 = POI)\r
7633 { \r
7634 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
7635 {\r
7636 for(Int_t sc=0;sc<2;sc++) // sin or cos\r
7637 {\r
7638 for(Int_t cti=0;cti<9;cti++) // correction term index\r
7639 {\r
7640 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti]->Reset(); \r
7641 }\r
7642 }\r
7643 } \r
7644 }\r
7645 \r
7646 // 2D (pt,eta)\r
7647 if(fCalculate2DFlow)\r
7648 {\r
7649 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)\r
7650 {\r
7651 for(Int_t m=0;m<4;m++) // multiple of harmonic\r
7652 {\r
7653 for(Int_t k=0;k<9;k++) // power of weight\r
7654 {\r
7655 if(fReRPQ2dEBE[t][m][k]) fReRPQ2dEBE[t][m][k]->Reset();\r
7656 if(fImRPQ2dEBE[t][m][k]) fImRPQ2dEBE[t][m][k]->Reset();\r
7657 } \r
7658 }\r
7659 }\r
7660 for(Int_t t=0;t<3;t++) // type (0 = RP, 1 = POI, 2 = RP&&POI )\r
7661 { \r
7662 for(Int_t k=0;k<9;k++)\r
7663 {\r
7664 if(fs2dEBE[t][k]) fs2dEBE[t][k]->Reset();\r
7665 }\r
7666 } \r
7667 } // end of if(fCalculate2DFlow) \r
7668\r
7669} // end of void AliFlowAnalysisWithQCumulants::ResetEventByEventQuantities();\r
7670\r
7671\r
7672//================================================================================================================================\r
7673\r
7674\r
7675void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTerms(TString type, TString ptOrEta)\r
7676{\r
7677 // Calculate correction terms for non-uniform acceptance for differential flow (sin terms).\r
7678 \r
7679 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][0][cti], where cti runs as follows:\r
7680 // 0: <<sin n(psi1)>>\r
7681 // 1: <<sin n(psi1+phi2)>>\r
7682 // 2: <<sin n(psi1+phi2-phi3)>>\r
7683 // 3: <<sin n(psi1-phi2-phi3)>>:\r
7684 // 4:\r
7685 // 5:\r
7686 // 6:\r
7687 \r
7688 // multiplicity:\r
7689 Double_t dMult = (*fSMpk)(0,0);\r
7690 \r
7691 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n: \r
7692 Double_t dReQ1n = (*fReQ)(0,0);\r
7693 Double_t dReQ2n = (*fReQ)(1,0);\r
7694 //Double_t dReQ3n = (*fReQ)(2,0);\r
7695 //Double_t dReQ4n = (*fReQ)(3,0);\r
7696 Double_t dImQ1n = (*fImQ)(0,0);\r
7697 Double_t dImQ2n = (*fImQ)(1,0);\r
7698 //Double_t dImQ3n = (*fImQ)(2,0);\r
7699 //Double_t dImQ4n = (*fImQ)(3,0);\r
7700\r
7701 Int_t t = -1; // type flag \r
7702 Int_t pe = -1; // ptEta flag\r
7703 \r
7704 if(type == "RP")\r
7705 {\r
7706 t = 0;\r
7707 } else if(type == "POI")\r
7708 {\r
7709 t = 1;\r
7710 }\r
7711\r
7712 if(ptOrEta == "Pt")\r
7713 {\r
7714 pe = 0;\r
7715 } else if(ptOrEta == "Eta")\r
7716 {\r
7717 pe = 1;\r
7718 }\r
7719 \r
7720 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
7721 Double_t minPtEta[2] = {fPtMin,fEtaMin};\r
7722 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};\r
7723 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};\r
7724\r
7725 // looping over all bins and calculating correction terms: \r
7726 for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
7727 {\r
7728 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin): \r
7729 Double_t p1n0kRe = 0.;\r
7730 Double_t p1n0kIm = 0.;\r
7731\r
7732 // number of POIs in particular pt or eta bin:\r
7733 Double_t mp = 0.;\r
7734\r
7735 // real and imaginary parts of q_{m*n,0} (non-weighted Q-vector evaluated for particles which are both RPs and POIs in particular pt or eta bin):\r
7736 Double_t q1n0kRe = 0.;\r
7737 Double_t q1n0kIm = 0.;\r
7738 Double_t q2n0kRe = 0.;\r
7739 Double_t q2n0kIm = 0.;\r
7740\r
7741 // number of particles which are both RPs and POIs in particular pt or eta bin:\r
7742 Double_t mq = 0.;\r
7743 \r
7744 if(type == "POI")\r
7745 {\r
7746 // q_{m*n,0}:\r
7747 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))\r
7748 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));\r
7749 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))\r
7750 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));\r
7751 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))\r
7752 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));\r
7753 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))\r
7754 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b)); \r
7755 \r
7756 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)\r
7757 } \r
7758 else if(type == "RP")\r
7759 {\r
7760 // q_{m*n,0}:\r
7761 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))\r
7762 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));\r
7763 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))\r
7764 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));\r
7765 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))\r
7766 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));\r
7767 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))\r
7768 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b)); \r
7769 \r
7770 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here) \r
7771 } \r
7772 if(type == "POI")\r
7773 {\r
7774 // p_{m*n,0}:\r
7775 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))\r
7776 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));\r
7777 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b)) \r
7778 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));\r
7779 \r
7780 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)\r
7781 \r
7782 t = 1; // typeFlag = RP or POI\r
7783 }\r
7784 else if(type == "RP")\r
7785 {\r
7786 // p_{m*n,0} = q_{m*n,0}:\r
7787 p1n0kRe = q1n0kRe; \r
7788 p1n0kIm = q1n0kIm; \r
7789 \r
7790 mp = mq; \r
7791 \r
7792 t = 0; // typeFlag = RP or POI\r
7793 }\r
7794\r
7795 // <<sin n(psi1)>>:\r
7796 Double_t sinP1nPsi = 0.;\r
7797 if(mp)\r
7798 {\r
7799 sinP1nPsi = p1n0kIm/mp;\r
7800 // fill profile for <<sin n(psi1)>>:\r
7801 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi,mp);\r
7802 // histogram to store <sin n(psi1)> e-b-e (needed in some other methods):\r
7803 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][0]->SetBinContent(b,sinP1nPsi);\r
7804 } // end of if(mp) \r
7805 \r
7806 // <<sin n(psi1+phi2)>>:\r
7807 Double_t sinP1nPsiP1nPhi = 0.;\r
7808 if(mp*dMult-mq)\r
7809 {\r
7810 sinP1nPsiP1nPhi = (p1n0kRe*dImQ1n+p1n0kIm*dReQ1n-q2n0kIm)/(mp*dMult-mq);\r
7811 // fill profile for <<sin n(psi1+phi2)>>:\r
7812 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsiP1nPhi,mp*dMult-mq);\r
7813 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):\r
7814 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][1]->SetBinContent(b,sinP1nPsiP1nPhi);\r
7815 } // end of if(mp*dMult-mq) \r
7816 \r
7817 // <<sin n(psi1+phi2-phi3)>>:\r
7818 Double_t sinP1nPsi1P1nPhi2MPhi3 = 0.;\r
7819 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))\r
7820 {\r
7821 sinP1nPsi1P1nPhi2MPhi3 = (p1n0kIm*(pow(dImQ1n,2.)+pow(dReQ1n,2.)-dMult)\r
7822 - 1.*(q2n0kIm*dReQ1n-q2n0kRe*dImQ1n) \r
7823 - mq*dImQ1n+2.*q1n0kIm)\r
7824 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));\r
7825 // fill profile for <<sin n(psi1+phi2)>>:\r
7826 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1P1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));\r
7827 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):\r
7828 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][2]->SetBinContent(b,sinP1nPsi1P1nPhi2MPhi3);\r
7829 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.)) \r
7830 \r
7831 // <<sin n(psi1-phi2-phi3)>>:\r
7832 Double_t sinP1nPsi1M1nPhi2MPhi3 = 0.;\r
7833 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))\r
7834 {\r
7835 sinP1nPsi1M1nPhi2MPhi3 = (p1n0kIm*(pow(dReQ1n,2.)-pow(dImQ1n,2.))-2.*p1n0kRe*dReQ1n*dImQ1n\r
7836 - 1.*(p1n0kIm*dReQ2n-p1n0kRe*dImQ2n)\r
7837 + 2.*mq*dImQ1n-2.*q1n0kIm)\r
7838 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));\r
7839 // fill profile for <<sin n(psi1+phi2)>>:\r
7840 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1M1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));\r
7841 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):\r
7842 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][3]->SetBinContent(b,sinP1nPsi1M1nPhi2MPhi3);\r
7843 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.)) \r
7844 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
7845 \r
7846} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTerms(TString type, TString ptOrEta)\r
7847\r
7848\r
7849//================================================================================================================================\r
7850\r
7851\r
7852void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTerms(TString type, TString ptOrEta)\r
7853{\r
7854 // Calculate correction terms for non-uniform acceptance for differential flow (cos terms).\r
7855 \r
7856 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][1][cti], where cti runs as follows:\r
7857 // 0: <<cos n(psi)>>\r
7858 // 1: <<cos n(psi1+phi2)>>\r
7859 // 2: <<cos n(psi1+phi2-phi3)>>\r
7860 // 3: <<cos n(psi1-phi2-phi3)>>\r
7861 // 4:\r
7862 // 5:\r
7863 // 6:\r
7864 \r
7865 // multiplicity:\r
7866 Double_t dMult = (*fSMpk)(0,0);\r
7867 \r
7868 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n: \r
7869 Double_t dReQ1n = (*fReQ)(0,0);\r
7870 Double_t dReQ2n = (*fReQ)(1,0);\r
7871 //Double_t dReQ3n = (*fReQ)(2,0);\r
7872 //Double_t dReQ4n = (*fReQ)(3,0);\r
7873 Double_t dImQ1n = (*fImQ)(0,0);\r
7874 Double_t dImQ2n = (*fImQ)(1,0);\r
7875 //Double_t dImQ3n = (*fImQ)(2,0);\r
7876 //Double_t dImQ4n = (*fImQ)(3,0);\r
7877\r
7878 Int_t t = -1; // type flag \r
7879 Int_t pe = -1; // ptEta flag\r
7880 \r
7881 if(type == "RP")\r
7882 {\r
7883 t = 0;\r
7884 } else if(type == "POI")\r
7885 {\r
7886 t = 1;\r
7887 }\r
7888\r
7889 if(ptOrEta == "Pt")\r
7890 {\r
7891 pe = 0;\r
7892 } else if(ptOrEta == "Eta")\r
7893 {\r
7894 pe = 1;\r
7895 }\r
7896 \r
7897 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
7898 Double_t minPtEta[2] = {fPtMin,fEtaMin};\r
7899 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};\r
7900 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};\r
7901\r
7902 // looping over all bins and calculating correction terms: \r
7903 for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
7904 {\r
7905 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin): \r
7906 Double_t p1n0kRe = 0.;\r
7907 Double_t p1n0kIm = 0.;\r
7908\r
7909 // number of POIs in particular pt or eta bin:\r
7910 Double_t mp = 0.;\r
7911\r
7912 // real and imaginary parts of q_{m*n,0} (non-weighted Q-vector evaluated for particles which are both RPs and POIs in particular pt or eta bin):\r
7913 Double_t q1n0kRe = 0.;\r
7914 Double_t q1n0kIm = 0.;\r
7915 Double_t q2n0kRe = 0.;\r
7916 Double_t q2n0kIm = 0.;\r
7917\r
7918 // number of particles which are both RPs and POIs in particular pt or eta bin:\r
7919 Double_t mq = 0.;\r
7920 \r
7921 if(type == "POI")\r
7922 {\r
7923 // q_{m*n,0}:\r
7924 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))\r
7925 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));\r
7926 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))\r
7927 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));\r
7928 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))\r
7929 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));\r
7930 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))\r
7931 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b)); \r
7932 \r
7933 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)\r
7934 } \r
7935 else if(type == "RP")\r
7936 {\r
7937 // q_{m*n,0}:\r
7938 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))\r
7939 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));\r
7940 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))\r
7941 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));\r
7942 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))\r
7943 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));\r
7944 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))\r
7945 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b)); \r
7946 \r
7947 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here) \r
7948 } \r
7949 if(type == "POI")\r
7950 {\r
7951 // p_{m*n,0}:\r
7952 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))\r
7953 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));\r
7954 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b)) \r
7955 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));\r
7956 \r
7957 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)\r
7958 \r
7959 t = 1; // typeFlag = RP or POI\r
7960 }\r
7961 else if(type == "RP")\r
7962 {\r
7963 // p_{m*n,0} = q_{m*n,0}:\r
7964 p1n0kRe = q1n0kRe; \r
7965 p1n0kIm = q1n0kIm; \r
7966 \r
7967 mp = mq; \r
7968 \r
7969 t = 0; // typeFlag = RP or POI\r
7970 }\r
7971\r
7972 // <<cos n(psi1)>>:\r
7973 Double_t cosP1nPsi = 0.;\r
7974 if(mp)\r
7975 {\r
7976 cosP1nPsi = p1n0kRe/mp;\r
7977 \r
7978 // fill profile for <<cos n(psi1)>>:\r
7979 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi,mp);\r
7980 // histogram to store <cos n(psi1)> e-b-e (needed in some other methods):\r
7981 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][0]->SetBinContent(b,cosP1nPsi);\r
7982 } // end of if(mp) \r
7983 \r
7984 // <<cos n(psi1+phi2)>>:\r
7985 Double_t cosP1nPsiP1nPhi = 0.;\r
7986 if(mp*dMult-mq)\r
7987 {\r
7988 cosP1nPsiP1nPhi = (p1n0kRe*dReQ1n-p1n0kIm*dImQ1n-q2n0kRe)/(mp*dMult-mq);\r
7989 // fill profile for <<sin n(psi1+phi2)>>:\r
7990 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsiP1nPhi,mp*dMult-mq);\r
7991 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):\r
7992 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][1]->SetBinContent(b,cosP1nPsiP1nPhi);\r
7993 } // end of if(mp*dMult-mq) \r
7994 \r
7995 // <<cos n(psi1+phi2-phi3)>>:\r
7996 Double_t cosP1nPsi1P1nPhi2MPhi3 = 0.;\r
7997 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))\r
7998 {\r
7999 cosP1nPsi1P1nPhi2MPhi3 = (p1n0kRe*(pow(dImQ1n,2.)+pow(dReQ1n,2.)-dMult)\r
8000 - 1.*(q2n0kRe*dReQ1n+q2n0kIm*dImQ1n) \r
8001 - mq*dReQ1n+2.*q1n0kRe)\r
8002 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));\r
8003 // fill profile for <<sin n(psi1+phi2)>>:\r
8004 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1P1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));\r
8005 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):\r
8006 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][2]->SetBinContent(b,cosP1nPsi1P1nPhi2MPhi3);\r
8007 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.)) \r
8008 \r
8009 // <<cos n(psi1-phi2-phi3)>>:\r
8010 Double_t cosP1nPsi1M1nPhi2MPhi3 = 0.;\r
8011 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))\r
8012 {\r
8013 cosP1nPsi1M1nPhi2MPhi3 = (p1n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))+2.*p1n0kIm*dReQ1n*dImQ1n\r
8014 - 1.*(p1n0kRe*dReQ2n+p1n0kIm*dImQ2n) \r
8015 - 2.*mq*dReQ1n+2.*q1n0kRe)\r
8016 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));\r
8017 // fill profile for <<sin n(psi1+phi2)>>:\r
8018 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1M1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));\r
8019 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):\r
8020 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][3]->SetBinContent(b,cosP1nPsi1M1nPhi2MPhi3);\r
8021 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.)) \r
8022 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
8023 \r
8024} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTerms(TString type, TString ptOrEta)\r
8025\r
8026\r
8027//==================================================================================================================================\r
8028\r
8029\r
8030void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUADiffFlow(TString type, TString ptOrEta)\r
8031{\r
8032 // Transfer prolfiles into histogams and correctly propagate the error (to be improved: description)\r
8033 \r
8034 // to be improved: debugged - I do not correctly transfer all profiles into histos (bug appears only after merging) \r
8035 \r
8036 Int_t t = -1; // type flag \r
8037 Int_t pe = -1; // ptEta flag\r
8038 \r
8039 if(type == "RP")\r
8040 {\r
8041 t = 0;\r
8042 } else if(type == "POI")\r
8043 {\r
8044 t = 1;\r
8045 }\r
8046\r
8047 if(ptOrEta == "Pt")\r
8048 {\r
8049 pe = 0;\r
8050 } else if(ptOrEta == "Eta")\r
8051 {\r
8052 pe = 1;\r
8053 }\r
8054 \r
8055 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
8056 //Double_t minPtEta[2] = {fPtMin,fEtaMin};\r
8057 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};\r
8058 //Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};\r
8059\r
8060 for(Int_t sc=0;sc<2;sc++) // sin or cos\r
8061 {\r
8062 for(Int_t cti=0;cti<9;cti++) // correction term index\r
8063 {\r
8064 for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
8065 {\r
8066 Double_t correctionTerm = fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]->GetBinContent(b);\r
8067 fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti]->SetBinContent(b,correctionTerm);\r
8068 // to be improved (propagate error correctly)\r
8069 // ...\r
8070 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
8071 } // correction term index\r
8072 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos\r
8073\r
8074}// end of void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUADiffFlow(TString type, TString ptOrEta)\r
8075\r
8076\r
8077//==================================================================================================================================\r
8078\r
8079\r
8080void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulantsCorrectedForNUA(TString type, TString ptOrEta)\r
8081{ \r
8082 // Calculate generalized differential flow Q-cumulants (corrected for non-uniform acceptance)\r
8083 \r
8084 Int_t typeFlag = -1;\r
8085 Int_t ptEtaFlag = -1;\r
8086\r
8087 if(type == "RP")\r
8088 {\r
8089 typeFlag = 0;\r
8090 } else if(type == "POI")\r
8091 {\r
8092 typeFlag = 1;\r
8093 } \r
8094 \r
8095 if(ptOrEta == "Pt")\r
8096 {\r
8097 ptEtaFlag = 0;\r
8098 } else if(ptOrEta == "Eta")\r
8099 {\r
8100 ptEtaFlag = 1;\r
8101 } \r
8102 \r
8103 // shortcuts:\r
8104 Int_t t = typeFlag;\r
8105 Int_t pe = ptEtaFlag;\r
8106 \r
8107 // common:\r
8108 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
8109 \r
8110 // 2-particle correlation:\r
8111 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>\r
8112 // sin term coming from integrated flow: \r
8113 Double_t sinP1nPhi = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1); // <<sin(n*phi1)>>\r
8114 Double_t sinP1nPhi1P1nPhi2 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2); // <<sin(n*(phi1+phi2))>>\r
8115 Double_t sinP1nPhi1M1nPhi2M1nPhi3 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(3); // <<sin(n*(phi1-phi2-phi3))>>\r
8116 // cos term coming from integrated flow: \r
8117 Double_t cosP1nPhi = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1); // <<cos(n*phi1)>>\r
8118 Double_t cosP1nPhi1P1nPhi2 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2); // <<cos(n*(phi1+phi2))>>\r
8119 Double_t cosP1nPhi1M1nPhi2M1nPhi3 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(3); // <<cos(n*(phi1-phi2-phi3))>>\r
8120\r
8121 for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
8122 {\r
8123 Double_t twoPrime = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b); // <<2'>>\r
8124 Double_t fourPrime = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b); // <<4'>>\r
8125 Double_t sinP1nPsi = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][0]->GetBinContent(b); // <<sin n(Psi)>> \r
8126 Double_t cosP1nPsi = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][0]->GetBinContent(b); // <<cos n(Psi)>> \r
8127 Double_t sinP1nPsi1P1nPhi2 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][1]->GetBinContent(b); // <<sin n(psi1+phi2)>> \r
8128 Double_t cosP1nPsi1P1nPhi2 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][1]->GetBinContent(b); // <<cos n(psi1+phi2)>> \r
8129 Double_t sinP1nPsi1P1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][2]->GetBinContent(b); // <<sin n(psi1+phi2-phi3)>> \r
8130 Double_t cosP1nPsi1P1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][2]->GetBinContent(b); // <<cos n(psi1+phi2-phi3)>> \r
8131 Double_t sinP1nPsi1M1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][3]->GetBinContent(b); // <<sin n(psi1-phi2-phi3)>> \r
8132 Double_t cosP1nPsi1M1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][3]->GetBinContent(b); // <<cos n(psi1-phi2-phi3)>> \r
8133 // generalized QC{2'}:\r
8134 Double_t qc2Prime = twoPrime - sinP1nPsi*sinP1nPhi - cosP1nPsi*cosP1nPhi;\r
8135 fDiffFlowCumulants[t][pe][0]->SetBinContent(b,qc2Prime);\r
8136 // generalized QC{4'}:\r
8137 Double_t qc4Prime = fourPrime-2.*twoPrime*two\r
8138 - cosP1nPsi*cosP1nPhi1M1nPhi2M1nPhi3\r
8139 + sinP1nPsi*sinP1nPhi1M1nPhi2M1nPhi3\r
8140 - cosP1nPhi*cosP1nPsi1M1nPhi2M1nPhi3\r
8141 + sinP1nPhi*sinP1nPsi1M1nPhi2M1nPhi3\r
8142 - 2.*cosP1nPhi*cosP1nPsi1P1nPhi2M1nPhi3\r
8143 - 2.*sinP1nPhi*sinP1nPsi1P1nPhi2M1nPhi3\r
8144 - cosP1nPsi1P1nPhi2*cosP1nPhi1P1nPhi2\r
8145 - sinP1nPsi1P1nPhi2*sinP1nPhi1P1nPhi2\r
8146 + 2.*cosP1nPhi1P1nPhi2*(cosP1nPsi*cosP1nPhi-sinP1nPsi*sinP1nPhi)\r
8147 + 2.*sinP1nPhi1P1nPhi2*(cosP1nPsi*sinP1nPhi+sinP1nPsi*cosP1nPhi)\r
8148 + 4.*two*(cosP1nPsi*cosP1nPhi+sinP1nPsi*sinP1nPhi)\r
8149 + 2.*cosP1nPsi1P1nPhi2*(pow(cosP1nPhi,2.)-pow(sinP1nPhi,2.))\r
8150 + 4.*sinP1nPsi1P1nPhi2*cosP1nPhi*sinP1nPhi\r
8151 + 4.*twoPrime*(pow(cosP1nPhi,2.)+pow(sinP1nPhi,2.))\r
8152 - 6.*(pow(cosP1nPhi,2.)-pow(sinP1nPhi,2.)) \r
8153 * (cosP1nPsi*cosP1nPhi-sinP1nPsi*sinP1nPhi)\r
8154 - 12.*cosP1nPhi*sinP1nPhi\r
8155 * (sinP1nPsi*cosP1nPhi+cosP1nPsi*sinP1nPhi);\r
8156 fDiffFlowCumulants[t][pe][1]->SetBinContent(b,qc4Prime); \r
8157 } // end of for(Int_t p=1;p<=fnBinsPt;p++)\r
8158 \r
8159} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulantsCorrectedForNUA(TString type, TString ptOrEta)\r
8160\r
8161\r
8162//==================================================================================================================================\r
8163 \r
8164\r
8165void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectedForNUA(TString type, TString ptOrEta)\r
8166{\r
8167 // Calculate differential flow corrected for non-uniform acceptance.\r
8168 \r
8169 // to be improved (rewritten completely)\r
8170 \r
8171 Int_t typeFlag = -1;\r
8172 Int_t ptEtaFlag = -1;\r
8173\r
8174 if(type == "RP")\r
8175 {\r
8176 typeFlag = 0;\r
8177 } else if(type == "POI")\r
8178 {\r
8179 typeFlag = 1;\r
8180 } \r
8181 \r
8182 if(ptOrEta == "Pt")\r
8183 {\r
8184 ptEtaFlag = 0;\r
8185 } else if(ptOrEta == "Eta")\r
8186 {\r
8187 ptEtaFlag = 1;\r
8188 } \r
8189 \r
8190 // shortcuts:\r
8191 Int_t t = typeFlag;\r
8192 Int_t pe = ptEtaFlag;\r
8193 \r
8194 // common:\r
8195 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
8196 \r
8197 // to be improved: access here generalized QC{2} and QC{4} instead: \r
8198 Double_t dV2 = fIntFlow->GetBinContent(1); \r
8199 Double_t dV4 = fIntFlow->GetBinContent(2); \r
8200 \r
8201 // loop over pt or eta bins:\r
8202 for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
8203 {\r
8204 // generalized QC{2'}:\r
8205 Double_t gQC2Prime = fDiffFlowCumulants[t][pe][0]->GetBinContent(b);\r
8206 // v'{2}:\r
8207 if(dV2>0)\r
8208 { \r
8209 Double_t v2Prime = gQC2Prime/dV2;\r
8210 fDiffFlow[t][pe][0]->SetBinContent(b,v2Prime); \r
8211 } \r
8212 // generalized QC{4'}:\r
8213 Double_t gQC4Prime = fDiffFlowCumulants[t][pe][1]->GetBinContent(b);\r
8214 // v'{4}:\r
8215 if(dV4>0)\r
8216 { \r
8217 Double_t v4Prime = -gQC4Prime/pow(dV4,3.);\r
8218 fDiffFlow[t][pe][1]->SetBinContent(b,v4Prime); \r
8219 } \r
8220 } // end of for(Int_t b=1;b<=fnBinsPtEta[pe];b++)\r
8221 \r
8222} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectedForNUA(TString type, TString ptOrEta); \r
8223\r
8224\r
8225//==================================================================================================================================\r
8226\r
8227\r
8228void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoops(AliFlowEventSimple* anEvent)\r
8229{\r
8230 // Evaluate with nested loops multiparticle correlations for integrated flow (without using the particle weights). \r
8231\r
8232 // Remark: Results are stored in profile fIntFlowDirectCorrelations whose binning is organized as follows:\r
8233 // \r
8234 // 1st bin: <2>_{1n|1n} = two1n1n = cos(n*(phi1-phi2))>\r
8235 // 2nd bin: <2>_{2n|2n} = two2n2n = cos(2n*(phi1-phi2))>\r
8236 // 3rd bin: <2>_{3n|3n} = two3n3n = cos(3n*(phi1-phi2))> \r
8237 // 4th bin: <2>_{4n|4n} = two4n4n = cos(4n*(phi1-phi2))>\r
8238 // 5th bin: ---- EMPTY ----\r
8239 // 6th bin: <3>_{2n|1n,1n} = three2n1n1n = <cos(n*(2.*phi1-phi2-phi3))>\r
8240 // 7th bin: <3>_{3n|2n,1n} = three3n2n1n = <cos(n*(3.*phi1-2.*phi2-phi3))>\r
8241 // 8th bin: <3>_{4n|2n,2n} = three4n2n2n = <cos(n*(4.*phi1-2.*phi2-2.*phi3))>\r
8242 // 9th bin: <3>_{4n|3n,1n} = three4n3n1n = <cos(n*(4.*phi1-3.*phi2-phi3))>\r
8243 // 10th bin: ---- EMPTY ----\r
8244 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1n = <cos(n*(phi1+phi2-phi3-phi4))>\r
8245 // 12th bin: <4>_{2n,1n|2n,1n} = four2n1n2n1n = <cos(2.*n*(phi1+phi2-phi3-phi4))>\r
8246 // 13th bin: <4>_{2n,2n|2n,2n} = four2n2n2n2n = <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>\r
8247 // 14th bin: <4>_{3n|1n,1n,1n} = four3n1n1n1n = <cos(n*(3.*phi1-phi2-phi3-phi4))> \r
8248 // 15th bin: <4>_{3n,1n|3n,1n} = four3n1n3n1n = <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>\r
8249 // 16th bin: <4>_{3n,1n|2n,2n} = four3n1n2n2n = <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>\r
8250 // 17th bin: <4>_{4n|2n,1n,1n} = four4n2n1n1n = <cos(n*(3.*phi1+phi2-3.*phi3-phi4))> \r
8251 // 18th bin: ---- EMPTY ----\r
8252 // 19th bin: <5>_{2n|1n,1n,1n,1n} = five2n1n1n1n1n = <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>\r
8253 // 20th bin: <5>_{2n,2n|2n,1n,1n} = five2n2n2n1n1n = <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>\r
8254 // 21st bin: <5>_{3n,1n|2n,1n,1n} = five3n1n2n1n1n = <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>\r
8255 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = five4n1n1n1n1n = <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>\r
8256 // 23rd bin: ---- EMPTY ----\r
8257 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = six1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>\r
8258 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = six2n1n1n2n1n1n = <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>\r
8259 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = six2n2n1n1n1n1n = <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>\r
8260 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = six3n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>\r
8261 // 28th bin: ---- EMPTY ----\r
8262 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = seven2n1n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>\r
8263 // 30th bin: ---- EMPTY ----\r
8264 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = eight1n1n1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>\r
8265 \r
8266 Int_t nPrim = anEvent->NumberOfTracks(); \r
8267 AliFlowTrackSimple *aftsTrack = NULL; \r
8268 Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.; \r
8269 Int_t n = fHarmonic; \r
8270 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)\r
8271 Double_t dMult = (*fSMpk)(0,0);\r
8272 cout<<endl;\r
8273 cout<<"Multiparticle correlations: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;\r
8274 if(dMult<2)\r
8275 {\r
8276 cout<<"... skipping this event (multiplicity too low) ..."<<endl;\r
8277 } else if (dMult>fMaxAllowedMultiplicity)\r
8278 {\r
8279 cout<<"... skipping this event (multiplicity too high) ..."<<endl;\r
8280 } else \r
8281 { \r
8282 cout<<"... evaluating nested loops (without using particle weights)..."<<endl;\r
8283 } \r
8284 \r
8285 // 2-particle correlations: \r
8286 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)\r
8287 {\r
8288 for(Int_t i1=0;i1<nPrim;i1++)\r
8289 {\r
8290 aftsTrack=anEvent->GetTrack(i1);\r
8291 if(!(aftsTrack->InRPSelection())) continue;\r
8292 phi1=aftsTrack->Phi(); \r
8293 for(Int_t i2=0;i2<nPrim;i2++)\r
8294 {\r
8295 if(i2==i1)continue;\r
8296 aftsTrack=anEvent->GetTrack(i2);\r
8297 if(!(aftsTrack->InRPSelection())) continue;\r
8298 phi2=aftsTrack->Phi();\r
8299 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;\r
8300 // fill the profile with 2-p correlations: \r
8301 fIntFlowDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),1.); // <cos(n*(phi1-phi2))>\r
8302 fIntFlowDirectCorrelations->Fill(1.5,cos(2.*n*(phi1-phi2)),1.); // <cos(2n*(phi1-phi2))>\r
8303 fIntFlowDirectCorrelations->Fill(2.5,cos(3.*n*(phi1-phi2)),1.); // <cos(3n*(phi1-phi2))>\r
8304 fIntFlowDirectCorrelations->Fill(3.5,cos(4.*n*(phi1-phi2)),1.); // <cos(4n*(phi1-phi2))> \r
8305 } // end of for(Int_t i2=0;i2<nPrim;i2++)\r
8306 } // end of for(Int_t i1=0;i1<nPrim;i1++)\r
8307 } // end of if(nPrim>=2)\r
8308 \r
8309 // 3-particle correlations: \r
8310 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)\r
8311 {\r
8312 for(Int_t i1=0;i1<nPrim;i1++)\r
8313 {\r
8314 aftsTrack=anEvent->GetTrack(i1);\r
8315 if(!(aftsTrack->InRPSelection())) continue;\r
8316 phi1=aftsTrack->Phi();\r
8317 for(Int_t i2=0;i2<nPrim;i2++)\r
8318 {\r
8319 if(i2==i1)continue;\r
8320 aftsTrack=anEvent->GetTrack(i2);\r
8321 if(!(aftsTrack->InRPSelection())) continue;\r
8322 phi2=aftsTrack->Phi();\r
8323 for(Int_t i3=0;i3<nPrim;i3++)\r
8324 {\r
8325 if(i3==i1||i3==i2)continue;\r
8326 aftsTrack=anEvent->GetTrack(i3);\r
8327 if(!(aftsTrack->InRPSelection())) continue;\r
8328 phi3=aftsTrack->Phi();\r
8329 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;\r
8330 // fill the profile with 3-p correlations: \r
8331 fIntFlowDirectCorrelations->Fill(5.,cos(2.*n*phi1-n*(phi2+phi3)),1.); //<3>_{2n|nn,n}\r
8332 fIntFlowDirectCorrelations->Fill(6.,cos(3.*n*phi1-2.*n*phi2-n*phi3),1.); //<3>_{3n|2n,n}\r
8333 fIntFlowDirectCorrelations->Fill(7.,cos(4.*n*phi1-2.*n*phi2-2.*n*phi3),1.); //<3>_{4n|2n,2n}\r
8334 fIntFlowDirectCorrelations->Fill(8.,cos(4.*n*phi1-3.*n*phi2-n*phi3),1.); //<3>_{4n|3n,n}\r
8335 } // end of for(Int_t i3=0;i3<nPrim;i3++)\r
8336 } // end of for(Int_t i2=0;i2<nPrim;i2++)\r
8337 } // end of for(Int_t i1=0;i1<nPrim;i1++)\r
8338 } // end of if(nPrim>=3)\r
8339\r
8340 // 4-particle correlations:\r
8341 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)\r
8342 { \r
8343 for(Int_t i1=0;i1<nPrim;i1++)\r
8344 { \r
8345 aftsTrack=anEvent->GetTrack(i1);\r
8346 if(!(aftsTrack->InRPSelection())) continue;\r
8347 phi1=aftsTrack->Phi();\r
8348 for(Int_t i2=0;i2<nPrim;i2++)\r
8349 {\r
8350 if(i2==i1)continue;\r
8351 aftsTrack=anEvent->GetTrack(i2);\r
8352 if(!(aftsTrack->InRPSelection())) continue;\r
8353 phi2=aftsTrack->Phi();\r
8354 for(Int_t i3=0;i3<nPrim;i3++)\r
8355 {\r
8356 if(i3==i1||i3==i2)continue;\r
8357 aftsTrack=anEvent->GetTrack(i3);\r
8358 if(!(aftsTrack->InRPSelection())) continue;\r
8359 phi3=aftsTrack->Phi();\r
8360 for(Int_t i4=0;i4<nPrim;i4++)\r
8361 {\r
8362 if(i4==i1||i4==i2||i4==i3)continue;\r
8363 aftsTrack=anEvent->GetTrack(i4);\r
8364 if(!(aftsTrack->InRPSelection())) continue;\r
8365 phi4=aftsTrack->Phi();\r
8366 if(nPrim==4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush;\r
8367 // fill the profile with 4-p correlations: \r
8368 fIntFlowDirectCorrelations->Fill(10.,cos(n*phi1+n*phi2-n*phi3-n*phi4),1.); // <4>_{n,n|n,n} \r
8369 fIntFlowDirectCorrelations->Fill(11.,cos(2.*n*phi1+n*phi2-2.*n*phi3-n*phi4),1.); // <4>_{2n,n|2n,n}\r
8370 fIntFlowDirectCorrelations->Fill(12.,cos(2.*n*phi1+2*n*phi2-2.*n*phi3-2.*n*phi4),1.); // <4>_{2n,2n|2n,2n}\r
8371 fIntFlowDirectCorrelations->Fill(13.,cos(3.*n*phi1-n*phi2-n*phi3-n*phi4),1.); // <4>_{3n|n,n,n}\r
8372 fIntFlowDirectCorrelations->Fill(14.,cos(3.*n*phi1+n*phi2-3.*n*phi3-n*phi4),1.); // <4>_{3n,n|3n,n} \r
8373 fIntFlowDirectCorrelations->Fill(15.,cos(3.*n*phi1+n*phi2-2.*n*phi3-2.*n*phi4),1.); // <4>_{3n,n|2n,2n}\r
8374 fIntFlowDirectCorrelations->Fill(16.,cos(4.*n*phi1-2.*n*phi2-n*phi3-n*phi4),1.); // <4>_{4n|2n,n,n} \r
8375 } // end of for(Int_t i4=0;i4<nPrim;i4++) \r
8376 } // end of for(Int_t i3=0;i3<nPrim;i3++)\r
8377 } // end of for(Int_t i2=0;i2<nPrim;i2++)\r
8378 } // end of for(Int_t i1=0;i1<nPrim;i1++)\r
8379 } // end of if(nPrim>=)\r
8380\r
8381 // 5-particle correlations: \r
8382 if(nPrim>=5 && nPrim<=fMaxAllowedMultiplicity)\r
8383 {\r
8384 for(Int_t i1=0;i1<nPrim;i1++)\r
8385 {\r
8386 aftsTrack=anEvent->GetTrack(i1);\r
8387 if(!(aftsTrack->InRPSelection())) continue; \r
8388 phi1=aftsTrack->Phi();\r
8389 for(Int_t i2=0;i2<nPrim;i2++)\r
8390 {\r
8391 if(i2==i1)continue;\r
8392 aftsTrack=anEvent->GetTrack(i2);\r
8393 if(!(aftsTrack->InRPSelection())) continue;\r
8394 phi2=aftsTrack->Phi();\r
8395 for(Int_t i3=0;i3<nPrim;i3++)\r
8396 {\r
8397 if(i3==i1||i3==i2)continue;\r
8398 aftsTrack=anEvent->GetTrack(i3);\r
8399 if(!(aftsTrack->InRPSelection())) continue;\r
8400 phi3=aftsTrack->Phi();\r
8401 for(Int_t i4=0;i4<nPrim;i4++)\r
8402 {\r
8403 if(i4==i1||i4==i2||i4==i3)continue;\r
8404 aftsTrack=anEvent->GetTrack(i4);\r
8405 if(!(aftsTrack->InRPSelection())) continue;\r
8406 phi4=aftsTrack->Phi();\r
8407 for(Int_t i5=0;i5<nPrim;i5++)\r
8408 {\r
8409 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;\r
8410 aftsTrack=anEvent->GetTrack(i5);\r
8411 if(!(aftsTrack->InRPSelection())) continue;\r
8412 phi5=aftsTrack->Phi();\r
8413 if(nPrim==5) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<"\r"<<flush;\r
8414 // fill the profile with 5-p correlations: \r
8415 fIntFlowDirectCorrelations->Fill(18.,cos(2.*n*phi1+n*phi2-n*phi3-n*phi4-n*phi5),1.); //<5>_{2n,n|n,n,n}\r
8416 fIntFlowDirectCorrelations->Fill(19.,cos(2.*n*phi1+2.*n*phi2-2.*n*phi3-n*phi4-n*phi5),1.); //<5>_{2n,2n|2n,n,n}\r
8417 fIntFlowDirectCorrelations->Fill(20.,cos(3.*n*phi1+n*phi2-2.*n*phi3-n*phi4-n*phi5),1.); //<5>_{3n,n|2n,n,n}\r
8418 fIntFlowDirectCorrelations->Fill(21.,cos(4.*n*phi1-n*phi2-n*phi3-n*phi4-n*phi5),1.); //<5>_{4n|n,n,n,n}\r
8419 } // end of for(Int_t i5=0;i5<nPrim;i5++)\r
8420 } // end of for(Int_t i4=0;i4<nPrim;i4++) \r
8421 } // end of for(Int_t i3=0;i3<nPrim;i3++)\r
8422 } // end of for(Int_t i2=0;i2<nPrim;i2++)\r
8423 } // end of for(Int_t i1=0;i1<nPrim;i1++)\r
8424 } // end of if(nPrim>=5)\r
8425 \r
8426 // 6-particle correlations:\r
8427 if(nPrim>=6 && nPrim<=fMaxAllowedMultiplicity)\r
8428 {\r
8429 for(Int_t i1=0;i1<nPrim;i1++)\r
8430 {\r
8431 aftsTrack=anEvent->GetTrack(i1);\r
8432 if(!(aftsTrack->InRPSelection())) continue;\r
8433 phi1=aftsTrack->Phi();\r
8434 for(Int_t i2=0;i2<nPrim;i2++)\r
8435 {\r
8436 if(i2==i1)continue;\r
8437 aftsTrack=anEvent->GetTrack(i2);\r
8438 if(!(aftsTrack->InRPSelection())) continue;\r
8439 phi2=aftsTrack->Phi();\r
8440 for(Int_t i3=0;i3<nPrim;i3++)\r
8441 {\r
8442 if(i3==i1||i3==i2)continue;\r
8443 aftsTrack=anEvent->GetTrack(i3);\r
8444 if(!(aftsTrack->InRPSelection())) continue;\r
8445 phi3=aftsTrack->Phi();\r
8446 for(Int_t i4=0;i4<nPrim;i4++)\r
8447 {\r
8448 if(i4==i1||i4==i2||i4==i3)continue;\r
8449 aftsTrack=anEvent->GetTrack(i4);\r
8450 if(!(aftsTrack->InRPSelection())) continue;\r
8451 phi4=aftsTrack->Phi();\r
8452 for(Int_t i5=0;i5<nPrim;i5++)\r
8453 {\r
8454 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;\r
8455 aftsTrack=anEvent->GetTrack(i5);\r
8456 if(!(aftsTrack->InRPSelection())) continue;\r
8457 phi5=aftsTrack->Phi();\r
8458 for(Int_t i6=0;i6<nPrim;i6++)\r
8459 {\r
8460 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;\r
8461 aftsTrack=anEvent->GetTrack(i6);\r
8462 if(!(aftsTrack->InRPSelection())) continue;\r
8463 phi6=aftsTrack->Phi(); \r
8464 if(nPrim==6) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<"\r"<<flush;\r
8465 // fill the profile with 6-p correlations: \r
8466 fIntFlowDirectCorrelations->Fill(23.,cos(n*phi1+n*phi2+n*phi3-n*phi4-n*phi5-n*phi6),1.); //<6>_{n,n,n|n,n,n}\r
8467 fIntFlowDirectCorrelations->Fill(24.,cos(2.*n*phi1+n*phi2+n*phi3-2.*n*phi4-n*phi5-n*phi6),1.); //<6>_{2n,n,n|2n,n,n}\r
8468 fIntFlowDirectCorrelations->Fill(25.,cos(2.*n*phi1+2.*n*phi2-n*phi3-n*phi4-n*phi5-n*phi6),1.); //<6>_{2n,2n|n,n,n,n}\r
8469 fIntFlowDirectCorrelations->Fill(26.,cos(3.*n*phi1+n*phi2-n*phi3-n*phi4-n*phi5-n*phi6),1.); //<6>_{3n,n|n,n,n,n} \r
8470 } // end of for(Int_t i6=0;i6<nPrim;i6++)\r
8471 } // end of for(Int_t i5=0;i5<nPrim;i5++)\r
8472 } // end of for(Int_t i4=0;i4<nPrim;i4++)\r
8473 } // end of for(Int_t i3=0;i3<nPrim;i3++)\r
8474 } // end of for(Int_t i2=0;i2<nPrim;i2++)\r
8475 } // end of for(Int_t i1=0;i1<nPrim;i1++)\r
8476 } // end of if(nPrim>=6)\r
8477 \r
8478 // 7-particle correlations:\r
8479 if(nPrim>=7 && nPrim<=fMaxAllowedMultiplicity)\r
8480 {\r
8481 for(Int_t i1=0;i1<nPrim;i1++)\r
8482 { \r
8483 aftsTrack=anEvent->GetTrack(i1);\r
8484 if(!(aftsTrack->InRPSelection())) continue;\r
8485 phi1=aftsTrack->Phi();\r
8486 for(Int_t i2=0;i2<nPrim;i2++)\r
8487 {\r
8488 if(i2==i1)continue;\r
8489 aftsTrack=anEvent->GetTrack(i2);\r
8490 if(!(aftsTrack->InRPSelection())) continue;\r
8491 phi2=aftsTrack->Phi();\r
8492 for(Int_t i3=0;i3<nPrim;i3++)\r
8493 {\r
8494 if(i3==i1||i3==i2)continue;\r
8495 aftsTrack=anEvent->GetTrack(i3);\r
8496 if(!(aftsTrack->InRPSelection())) continue;\r
8497 phi3=aftsTrack->Phi();\r
8498 for(Int_t i4=0;i4<nPrim;i4++)\r
8499 {\r
8500 if(i4==i1||i4==i2||i4==i3)continue;\r
8501 aftsTrack=anEvent->GetTrack(i4);\r
8502 if(!(aftsTrack->InRPSelection())) continue;\r
8503 phi4=aftsTrack->Phi();\r
8504 for(Int_t i5=0;i5<nPrim;i5++)\r
8505 {\r
8506 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;\r
8507 aftsTrack=anEvent->GetTrack(i5);\r
8508 if(!(aftsTrack->InRPSelection())) continue;\r
8509 phi5=aftsTrack->Phi();\r
8510 for(Int_t i6=0;i6<nPrim;i6++)\r
8511 {\r
8512 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;\r
8513 aftsTrack=anEvent->GetTrack(i6);\r
8514 if(!(aftsTrack->InRPSelection())) continue;\r
8515 phi6=aftsTrack->Phi(); \r
8516 for(Int_t i7=0;i7<nPrim;i7++)\r
8517 {\r
8518 if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;\r
8519 aftsTrack=anEvent->GetTrack(i7);\r
8520 if(!(aftsTrack->InRPSelection())) continue;\r
8521 phi7=aftsTrack->Phi(); \r
8522 if(nPrim==7) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<" "<<i7<<"\r"<<flush;\r
8523 // fill the profile with 7-p correlation: \r
8524 fIntFlowDirectCorrelations->Fill(28.,cos(2.*n*phi1+n*phi2+n*phi3-n*phi4-n*phi5-n*phi6-n*phi7),1.); // <7>_{2n,n,n|n,n,n,n}\r
8525 } // end of for(Int_t i7=0;i7<nPrim;i7++)\r
8526 } // end of for(Int_t i6=0;i6<nPrim;i6++) \r
8527 } // end of for(Int_t i5=0;i5<nPrim;i5++)\r
8528 } // end of for(Int_t i4=0;i4<nPrim;i4++) \r
8529 } // end of for(Int_t i3=0;i3<nPrim;i3++)\r
8530 } // end of for(Int_t i2=0;i2<nPrim;i2++)\r
8531 } // end of for(Int_t i1=0;i1<nPrim;i1++)\r
8532 } // end of if(nPrim>=7)\r
8533 \r
8534 // 8-particle correlations:\r
8535 if(nPrim>=8 && nPrim<=fMaxAllowedMultiplicity)\r
8536 {\r
8537 for(Int_t i1=0;i1<nPrim;i1++)\r
8538 {\r
8539 aftsTrack=anEvent->GetTrack(i1);\r
8540 if(!(aftsTrack->InRPSelection())) continue;\r
8541 phi1=aftsTrack->Phi();\r
8542 for(Int_t i2=0;i2<nPrim;i2++)\r
8543 {\r
8544 if(i2==i1)continue;\r
8545 aftsTrack=anEvent->GetTrack(i2);\r
8546 if(!(aftsTrack->InRPSelection())) continue;\r
8547 phi2=aftsTrack->Phi();\r
8548 for(Int_t i3=0;i3<nPrim;i3++)\r
8549 {\r
8550 if(i3==i1||i3==i2)continue;\r
8551 aftsTrack=anEvent->GetTrack(i3);\r
8552 if(!(aftsTrack->InRPSelection())) continue;\r
8553 phi3=aftsTrack->Phi();\r
8554 for(Int_t i4=0;i4<nPrim;i4++)\r
8555 {\r
8556 if(i4==i1||i4==i2||i4==i3)continue;\r
8557 aftsTrack=anEvent->GetTrack(i4);\r
8558 if(!(aftsTrack->InRPSelection())) continue;\r
8559 phi4=aftsTrack->Phi();\r
8560 for(Int_t i5=0;i5<nPrim;i5++)\r
8561 {\r
8562 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;\r
8563 aftsTrack=anEvent->GetTrack(i5);\r
8564 if(!(aftsTrack->InRPSelection())) continue;\r
8565 phi5=aftsTrack->Phi();\r
8566 for(Int_t i6=0;i6<nPrim;i6++)\r
8567 {\r
8568 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;\r
8569 aftsTrack=anEvent->GetTrack(i6);\r
8570 if(!(aftsTrack->InRPSelection())) continue;\r
8571 phi6=aftsTrack->Phi();\r
8572 for(Int_t i7=0;i7<nPrim;i7++)\r
8573 {\r
8574 if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;\r
8575 aftsTrack=anEvent->GetTrack(i7);\r
8576 if(!(aftsTrack->InRPSelection())) continue;\r
8577 phi7=aftsTrack->Phi();\r
8578 for(Int_t i8=0;i8<nPrim;i8++)\r
8579 {\r
8580 if(i8==i1||i8==i2||i8==i3||i8==i4||i8==i5||i8==i6||i8==i7)continue;\r
8581 aftsTrack=anEvent->GetTrack(i8);\r
8582 if(!(aftsTrack->InRPSelection())) continue;\r
8583 phi8=aftsTrack->Phi();\r
8584 cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<" "<<i7<<" "<<i8<<"\r"<<flush;\r
8585 // fill the profile with 8-p correlation: \r
8586 fIntFlowDirectCorrelations->Fill(30.,cos(n*phi1+n*phi2+n*phi3+n*phi4-n*phi5-n*phi6-n*phi7-n*phi8),1.); // <8>_{n,n,n,n|n,n,n,n}\r
8587 } // end of for(Int_t i8=0;i8<nPrim;i8++)\r
8588 } // end of for(Int_t i7=0;i7<nPrim;i7++) \r
8589 } // end of for(Int_t i6=0;i6<nPrim;i6++) \r
8590 } // end of for(Int_t i5=0;i5<nPrim;i5++)\r
8591 } // end of for(Int_t i4=0;i4<nPrim;i4++) \r
8592 } // end of for(Int_t i3=0;i3<nPrim;i3++)\r
8593 } // end of for(Int_t i2=0;i2<nPrim;i2++)\r
8594 } // end of for(Int_t i1=0;i1<nPrim;i1++)\r
8595 } // end of if(nPrim>=8)\r
8596 \r
8597 cout<<endl;\r
8598\r
8599} // end of AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoops(AliFlowEventSimple* anEvent)\r
8600\r
8601\r
8602//==================================================================================================================================\r
8603\r
8604\r
8605void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrelations()\r
8606{\r
8607 // Cross-check results for multiparticle correlations needed for int. flow: results from Q-vectors vs results from nested loops.\r
8608\r
8609 cout<<endl;\r
8610 cout<<endl;\r
8611 cout<<" *****************************************"<<endl;\r
8612 cout<<" **** cross-checking the correlations ****"<<endl;\r
8613 cout<<" **** for integrated flow ****"<<endl;\r
8614 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))\r
8615 {\r
8616 cout<<" **** (particle weights not used) ****"<<endl;\r
8617 } else\r
8618 {\r
8619 cout<<" **** (particle weights used) ****"<<endl;\r
8620 } \r
8621 cout<<" *****************************************"<<endl;\r
8622 cout<<endl;\r
8623 cout<<endl;\r
8624\r
8625 Int_t ciMax = 32; // to be improved (removed eventually when I calculate 6th and 8th order with particle weights)\r
8626 \r
8627 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)\r
8628 {\r
8629 ciMax = 11;\r
8630 }\r
8631\r
8632 for(Int_t ci=1;ci<=ciMax;ci++)\r
8633 {\r
8634 if(strcmp((fIntFlowCorrelationsAllPro->GetXaxis())->GetBinLabel(ci), "") == 0) continue; // to be improved (access finalized histogram here)\r
8635 cout<<(fIntFlowCorrelationsAllPro->GetXaxis())->GetBinLabel(ci)<<":"<<endl; // to be improved (access finalized histogram here)\r
8636 cout<<"from Q-vectors = "<<fIntFlowCorrelationsAllPro->GetBinContent(ci)<<endl; // to be improved (access finalized histogram here)\r
8637 cout<<"from nested loops = "<<fIntFlowDirectCorrelations->GetBinContent(ci)<<endl;\r
8638 cout<<endl;\r
8639 }\r
8640 \r
8641} // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrelations()\r
8642\r
8643\r
8644//================================================================================================================================\r
8645\r
8646\r
8647void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrectionTermsForNUA()\r
8648{\r
8649 // Cross-check results for corrections terms for non-uniform acceptance needed for int. flow: results from Q-vectors vs results from nested loops.\r
8650\r
8651 cout<<endl;\r
8652 cout<<endl;\r
8653 cout<<" *********************************************"<<endl;\r
8654 cout<<" **** cross-checking the correction terms ****"<<endl;\r
8655 cout<<" **** for non-uniform acceptance relevant ****"<<endl;\r
8656 cout<<" **** for integrated flow ****"<<endl;\r
8657 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))\r
8658 {\r
8659 cout<<" **** (particle weights not used) ****"<<endl;\r
8660 } else\r
8661 {\r
8662 cout<<" **** (particle weights used) ****"<<endl;\r
8663 } \r
8664 cout<<" *********************************************"<<endl;\r
8665 cout<<endl;\r
8666 cout<<endl;\r
8667\r
8668 for(Int_t ci=1;ci<=10;ci++) // correction term index\r
8669 {\r
8670 for(Int_t sc=0;sc<2;sc++) // sin or cos term\r
8671 {\r
8672 if(strcmp((fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->GetBinLabel(ci), "") == 0) continue; // to be improved (access finalized histogram here)\r
8673 cout<<(fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->GetBinLabel(ci)<<":"<<endl; // to be improved (access finalized histogram here)\r
8674 cout<<"from Q-vectors = "<<fIntFlowCorrectionTermsForNUAPro[sc]->GetBinContent(ci)<<endl; // to be improved (access finalized histogram here)\r
8675 cout<<"from nested loops = "<<fIntFlowDirectCorrectionTermsForNUA[sc]->GetBinContent(ci)<<endl;\r
8676 cout<<endl;\r
8677 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos term\r
8678 } // end of for(Int_t ci=1;ci<=10;ci++) // correction term index\r
8679 \r
8680} // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrectionTermsForNUA() \r
8681\r
8682\r
8683//================================================================================================================================\r
8684\r
8685\r
8686void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent)\r
8687{\r
8688 // Evaluate with nested loops multiparticle correlations for integrated flow (using the particle weights). \r
8689\r
8690 // Results are stored in profile fIntFlowDirectCorrelations. \r
8691 // Remark 1: When particle weights are used the binning of fIntFlowDirectCorrelations is organized as follows:\r
8692 //\r
8693 // 1st bin: <2>_{1n|1n} = two1n1nW1W1 = <w1 w2 cos(n*(phi1-phi2))>\r
8694 // 2nd bin: <2>_{2n|2n} = two2n2nW2W2 = <w1^2 w2^2 cos(2n*(phi1-phi2))>\r
8695 // 3rd bin: <2>_{3n|3n} = two3n3nW3W3 = <w1^3 w2^3 cos(3n*(phi1-phi2))> \r
8696 // 4th bin: <2>_{4n|4n} = two4n4nW4W4 = <w1^4 w2^4 cos(4n*(phi1-phi2))>\r
8697 // 5th bin: ---- EMPTY ----\r
8698 // 6th bin: <3>_{2n|1n,1n} = three2n1n1nW2W1W1 = <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>\r
8699 // 7th bin: <3>_{3n|2n,1n} = ...\r
8700 // 8th bin: <3>_{4n|2n,2n} = ...\r
8701 // 9th bin: <3>_{4n|3n,1n} = ...\r
8702 // 10th bin: ---- EMPTY ----\r
8703 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1nW1W1W1W1 = <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>\r
8704 // 12th bin: <4>_{2n,1n|2n,1n} = ...\r
8705 // 13th bin: <4>_{2n,2n|2n,2n} = ...\r
8706 // 14th bin: <4>_{3n|1n,1n,1n} = ... \r
8707 // 15th bin: <4>_{3n,1n|3n,1n} = ...\r
8708 // 16th bin: <4>_{3n,1n|2n,2n} = ...\r
8709 // 17th bin: <4>_{4n|2n,1n,1n} = ... \r
8710 // 18th bin: ---- EMPTY ----\r
8711 // 19th bin: <5>_{2n|1n,1n,1n,1n} = ...\r
8712 // 20th bin: <5>_{2n,2n|2n,1n,1n} = ...\r
8713 // 21st bin: <5>_{3n,1n|2n,1n,1n} = ...\r
8714 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = ...\r
8715 // 23rd bin: ---- EMPTY ----\r
8716 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = ...\r
8717 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = ...\r
8718 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = ...\r
8719 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = ...\r
8720 // 28th bin: ---- EMPTY ----\r
8721 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = ...\r
8722 // 30th bin: ---- EMPTY ----\r
8723 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = ...\r
8724 \r
8725 // Remark 2: When particle weights are used there are some extra correlations. They are stored in \r
8726 // fIntFlowExtraDirectCorrelations binning of which is organized as follows:\r
8727 \r
8728 // 1st bin: two1n1nW3W1 = <w1^3 w2 cos(n*(phi1-phi2))>\r
8729 // 2nd bin: two1n1nW1W1W2 = <w1 w2 w3^2 cos(n*(phi1-phi2))> \r
8730 // ...\r
8731 \r
8732 Int_t nPrim = anEvent->NumberOfTracks(); \r
8733 AliFlowTrackSimple *aftsTrack = NULL;\r
8734 //Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;\r
8735 //Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1., wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;\r
8736 Double_t phi1=0., phi2=0., phi3=0., phi4=0.;\r
8737 Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1.;\r
8738 Int_t n = fHarmonic; \r
8739 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)\r
8740 Double_t dMult = (*fSMpk)(0,0);\r
8741 cout<<endl;\r
8742 cout<<"Multiparticle correlations: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;\r
8743 if(dMult<2)\r
8744 {\r
8745 cout<<"... skipping this event (multiplicity too low) ..."<<endl;\r
8746 } else if (dMult>fMaxAllowedMultiplicity)\r
8747 {\r
8748 cout<<"... skipping this event (multiplicity too high) ..."<<endl;\r
8749 } else \r
8750 { \r
8751 cout<<"... evaluating nested loops (using particle weights) ..."<<endl;\r
8752 } \r
8753 \r
8754 // 2-particle correlations: \r
8755 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)\r
8756 {\r
8757 // 2 nested loops multiparticle correlations using particle weights: \r
8758 for(Int_t i1=0;i1<nPrim;i1++)\r
8759 {\r
8760 aftsTrack=anEvent->GetTrack(i1);\r
8761 if(!(aftsTrack->InRPSelection())) continue;\r
8762 phi1=aftsTrack->Phi();\r
8763 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));\r
8764 for(Int_t i2=0;i2<nPrim;i2++)\r
8765 {\r
8766 if(i2==i1)continue;\r
8767 aftsTrack=anEvent->GetTrack(i2);\r
8768 if(!(aftsTrack->InRPSelection())) continue;\r
8769 phi2=aftsTrack->Phi();\r
8770 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi()))); \r
8771 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;\r
8772 // 2-p correlations using particle weights:\r
8773 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),wPhi1*wPhi2); // <w1 w2 cos( n*(phi1-phi2))>\r
8774 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(1.5,cos(2.*n*(phi1-phi2)),pow(wPhi1,2)*pow(wPhi2,2)); // <w1^2 w2^2 cos(2n*(phi1-phi2))>\r
8775 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(2.5,cos(3.*n*(phi1-phi2)),pow(wPhi1,3)*pow(wPhi2,3)); // <w1^3 w2^3 cos(3n*(phi1-phi2))>\r
8776 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(3.5,cos(4.*n*(phi1-phi2)),pow(wPhi1,4)*pow(wPhi2,4)); // <w1^4 w2^4 cos(4n*(phi1-phi2))> \r
8777 // extra correlations: \r
8778 // 2-p extra correlations (do not appear if particle weights are not used):\r
8779 if(fUsePhiWeights) fIntFlowExtraDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),pow(wPhi1,3)*wPhi2); // <w1^3 w2 cos(n*(phi1-phi2))>\r
8780 // ...\r
8781 } // end of for(Int_t i2=0;i2<nPrim;i2++)\r
8782 } // end of for(Int_t i1=0;i1<nPrim;i1++)\r
8783 } // end of if(nPrim>=2)\r
8784\r
8785 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)\r
8786 { \r
8787 // 3 nested loops multiparticle correlations using particle weights: \r
8788 for(Int_t i1=0;i1<nPrim;i1++)\r
8789 {\r
8790 aftsTrack=anEvent->GetTrack(i1);\r
8791 if(!(aftsTrack->InRPSelection())) continue;\r
8792 phi1=aftsTrack->Phi();\r
8793 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));\r
8794 for(Int_t i2=0;i2<nPrim;i2++)\r
8795 {\r
8796 if(i2==i1)continue;\r
8797 aftsTrack=anEvent->GetTrack(i2);\r
8798 if(!(aftsTrack->InRPSelection())) continue;\r
8799 phi2=aftsTrack->Phi();\r
8800 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));\r
8801 for(Int_t i3=0;i3<nPrim;i3++)\r
8802 {\r
8803 if(i3==i1||i3==i2)continue;\r
8804 aftsTrack=anEvent->GetTrack(i3);\r
8805 if(!(aftsTrack->InRPSelection())) continue;\r
8806 phi3=aftsTrack->Phi();\r
8807 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));\r
8808 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;\r
8809 // 3-p correlations using particle weights:\r
8810 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(5.5,cos(2.*n*phi1-n*(phi2+phi3)),pow(wPhi1,2)*wPhi2*wPhi3); // <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>\r
8811 // ...\r
8812 // extra correlations: \r
8813 // 2-p extra correlations (do not appear if particle weights are not used):\r
8814 if(fUsePhiWeights) fIntFlowExtraDirectCorrelations->Fill(1.5,cos(n*(phi1-phi2)),wPhi1*wPhi2*pow(wPhi3,2)); // <w1 w2 w3^2 cos(n*(phi1-phi2))>\r
8815 // ...\r
8816 // 3-p extra correlations (do not appear if particle weights are not used):\r
8817 // ...\r
8818 } // end of for(Int_t i3=0;i3<nPrim;i3++)\r
8819 } // end of for(Int_t i2=0;i2<nPrim;i2++)\r
8820 } // end of for(Int_t i1=0;i1<nPrim;i1++)\r
8821 } // end of if(nPrim>=3)\r
8822 \r
8823 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)\r
8824 {\r
8825 // 4 nested loops multiparticle correlations using particle weights: \r
8826 for(Int_t i1=0;i1<nPrim;i1++)\r
8827 {\r
8828 aftsTrack=anEvent->GetTrack(i1);\r
8829 if(!(aftsTrack->InRPSelection())) continue;\r
8830 phi1=aftsTrack->Phi();\r
8831 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));\r
8832 for(Int_t i2=0;i2<nPrim;i2++)\r
8833 {\r
8834 if(i2==i1)continue;\r
8835 aftsTrack=anEvent->GetTrack(i2);\r
8836 if(!(aftsTrack->InRPSelection())) continue;\r
8837 phi2=aftsTrack->Phi();\r
8838 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));\r
8839 for(Int_t i3=0;i3<nPrim;i3++)\r
8840 {\r
8841 if(i3==i1||i3==i2)continue;\r
8842 aftsTrack=anEvent->GetTrack(i3);\r
8843 if(!(aftsTrack->InRPSelection())) continue;\r
8844 phi3=aftsTrack->Phi();\r
8845 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));\r
8846 for(Int_t i4=0;i4<nPrim;i4++)\r
8847 {\r
8848 if(i4==i1||i4==i2||i4==i3)continue;\r
8849 aftsTrack=anEvent->GetTrack(i4);\r
8850 if(!(aftsTrack->InRPSelection())) continue;\r
8851 phi4=aftsTrack->Phi();\r
8852 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));\r
8853 if(nPrim>=4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush; // to be improved (replace eventually this if statement with if(nPrim==4))\r
8854 // 4-p correlations using particle weights:\r
8855 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(10.5,cos(n*phi1+n*phi2-n*phi3-n*phi4),wPhi1*wPhi2*wPhi3*wPhi4); \r
8856 // extra correlations: \r
8857 // 2-p extra correlations (do not appear if particle weights are not used):\r
8858 // ...\r
8859 // 3-p extra correlations (do not appear if particle weights are not used):\r
8860 // ...\r
8861 // 4-p extra correlations (do not appear if particle weights are not used):\r
8862 // ...\r
8863 } // end of for(Int_t i4=0;i4<nPrim;i4++) \r
8864 } // end of for(Int_t i3=0;i3<nPrim;i3++)\r
8865 } // end of for(Int_t i2=0;i2<nPrim;i2++)\r
8866 } // end of for(Int_t i1=0;i1<nPrim;i1++)\r
8867 } // end of if(nPrim>=4)\r
8868\r
8869 cout<<endl; \r
8870\r
8871} // end of void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent)\r
8872\r
8873\r
8874//================================================================================================================================\r
8875\r
8876\r
8877void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowExtraCorrelations()\r
8878{\r
8879 // Cross-check results for extra multiparticle correlations needed for int. flow \r
8880 // which appear only when particle weights are used: results from Q-vectors vs results from nested loops.\r
8881\r
8882 cout<<endl;\r
8883 cout<<endl;\r
8884 cout<<" ***********************************************"<<endl;\r
8885 cout<<" **** cross-checking the extra correlations ****"<<endl;\r
8886 cout<<" **** for integrated flow ****"<<endl;\r
8887 cout<<" ***********************************************"<<endl;\r
8888 cout<<endl;\r
8889 cout<<endl;\r
8890 \r
8891 for(Int_t eci=1;eci<=2;eci++) // to be improved (increased eciMax eventually when I calculate 6th and 8th)\r
8892 {\r
8893 if(strcmp((fIntFlowExtraCorrelationsPro->GetXaxis())->GetBinLabel(eci), "") == 0) continue;\r
8894 cout<<(fIntFlowExtraCorrelationsPro->GetXaxis())->GetBinLabel(eci)<<":"<<endl;\r
8895 cout<<"from Q-vectors = "<<fIntFlowExtraCorrelationsPro->GetBinContent(eci)<<endl;\r
8896 cout<<"from nested loops = "<<fIntFlowExtraDirectCorrelations->GetBinContent(eci)<<endl;\r
8897 cout<<endl;\r
8898 }\r
8899\r
8900} // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowExtraCorrelations()\r
8901\r
8902\r
8903//================================================================================================================================\r
8904\r
8905\r
8906void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoops(AliFlowEventSimple* anEvent)\r
8907{\r
8908 // Evaluate with nested loops correction terms for non-uniform acceptance relevant for NONAME integrated flow (to be improved (name)).\r
8909 //\r
8910 // Remark: Both sin and cos correction terms are calculated in this method. Sin terms are stored in fIntFlowDirectCorrectionTermsForNUA[0],\r
57340a27 8911 // and cos terms in fIntFlowDirectCorrectionTermsForNUA[1]. Binning of fIntFlowDirectCorrectionTermsForNUA[sc] is organized as follows \r
a5b7efd0 8912 // (sc stands for either sin or cos):\r
8913 \r
8914 // 1st bin: <<sc(n*(phi1))>> \r
8915 // 2nd bin: <<sc(n*(phi1+phi2))>> \r
8916 // 3rd bin: <<sc(n*(phi1-phi2-phi3))>>\r
8917 // ...\r
8918 \r
8919 Int_t nPrim = anEvent->NumberOfTracks(); \r
8920 AliFlowTrackSimple *aftsTrack = NULL;\r
8921 Double_t phi1=0., phi2=0., phi3=0.;\r
8922 Int_t n = fHarmonic; \r
8923 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)\r
8924 Double_t dMult = (*fSMpk)(0,0);\r
8925 cout<<endl;\r
8926 cout<<"Correction terms for non-uniform acceptance: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;\r
8927 if(dMult<1)\r
8928 {\r
8929 cout<<"... skipping this event (multiplicity too low) ..."<<endl;\r
8930 } else if (dMult>fMaxAllowedMultiplicity)\r
8931 {\r
8932 cout<<"... skipping this event (multiplicity too high) ..."<<endl;\r
8933 } else \r
8934 { \r
8935 cout<<"... evaluating nested loops (without using particle weights)..."<<endl;\r
8936 }\r
8937 \r
8938 if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)\r
8939 {\r
8940 // 1-particle correction terms for non-uniform acceptance: \r
8941 for(Int_t i1=0;i1<nPrim;i1++)\r
8942 {\r
8943 aftsTrack=anEvent->GetTrack(i1);\r
8944 if(!(aftsTrack->InRPSelection())) continue;\r
8945 phi1=aftsTrack->Phi();\r
8946 if(nPrim==1) cout<<i1<<"\r"<<flush;\r
8947 // sin terms:\r
8948 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(0.5,sin(n*phi1),1.); // <sin(n*phi1)> \r
8949 // cos terms:\r
8950 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(0.5,cos(n*phi1),1.); // <cos(n*phi1)>\r
8951 } // end of for(Int_t i1=0;i1<nPrim;i1++)\r
8952 } // end of if(nPrim>=1) \r
8953 \r
8954 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)\r
8955 {\r
8956 // 2-particle correction terms for non-uniform acceptance: \r
8957 for(Int_t i1=0;i1<nPrim;i1++)\r
8958 {\r
8959 aftsTrack=anEvent->GetTrack(i1);\r
8960 if(!(aftsTrack->InRPSelection())) continue;\r
8961 phi1=aftsTrack->Phi(); \r
8962 for(Int_t i2=0;i2<nPrim;i2++)\r
8963 {\r
8964 if(i2==i1)continue;\r
8965 aftsTrack=anEvent->GetTrack(i2);\r
8966 if(!(aftsTrack->InRPSelection())) continue;\r
8967 phi2=aftsTrack->Phi();\r
8968 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;\r
8969 // sin terms:\r
8970 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(1.5,sin(n*(phi1+phi2)),1.); // <<sin(n*(phi1+phi2))>>\r
8971 // cos terms:\r
8972 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(1.5,cos(n*(phi1+phi2)),1.); // <<cos(n*(phi1+phi2))>>\r
8973 } // end of for(Int_t i2=0;i2<nPrim;i2++)\r
8974 } // end of for(Int_t i1=0;i1<nPrim;i1++)\r
8975 } // end of if(nPrim>=2)\r
8976\r
8977 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)\r
8978 {\r
8979 // 3-particle correction terms for non-uniform acceptance: \r
8980 for(Int_t i1=0;i1<nPrim;i1++)\r
8981 {\r
8982 aftsTrack=anEvent->GetTrack(i1);\r
8983 if(!(aftsTrack->InRPSelection())) continue;\r
8984 phi1=aftsTrack->Phi();\r
8985 for(Int_t i2=0;i2<nPrim;i2++)\r
8986 {\r
8987 if(i2==i1)continue;\r
8988 aftsTrack=anEvent->GetTrack(i2);\r
8989 if(!(aftsTrack->InRPSelection())) continue;\r
8990 phi2=aftsTrack->Phi();\r
8991 for(Int_t i3=0;i3<nPrim;i3++)\r
8992 {\r
8993 if(i3==i1||i3==i2)continue;\r
8994 aftsTrack=anEvent->GetTrack(i3);\r
8995 if(!(aftsTrack->InRPSelection())) continue;\r
8996 phi3=aftsTrack->Phi();\r
8997 if(nPrim>=3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush; // to be improved (eventually I will change this if statement)\r
8998 // sin terms:\r
8999 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(2.5,sin(n*(phi1-phi2-phi3)),1.); // <<sin(n*(phi1-phi2-phi3))>>\r
9000 // cos terms:\r
9001 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(2.5,cos(n*(phi1-phi2-phi3)),1.); // <<cos(n*(phi1-phi2-phi3))>>\r
9002 } // end of for(Int_t i3=0;i3<nPrim;i3++)\r
9003 } // end of for(Int_t i2=0;i2<nPrim;i2++)\r
9004 } // end of for(Int_t i1=0;i1<nPrim;i1++)\r
9005 } // end of if(nPrim>=3)\r
9006\r
9007 cout<<endl;\r
9008}\r
9009//================================================================================================================================\r
9010void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoops(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)\r
9011{\r
9012 // Evaluate reduced correlations with nested loops without using the particle weights.\r
9013 \r
9014 // Remark 1: Reduced correlations are evaluated in pt bin number fCrossCheckInPtBinNo and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.\r
9015 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrelations[t][pe][ci], where indices runs as follows:\r
9016 // [0=RP,1=POI][0=Pt,1=Eta][0=<2'>,1=<4'>,2=<6'>,3=<8'>] \r
9017 // Remark 3: <2'> = <cos(n*(psi1-phi2))>\r
9018 // <4'> = <cos(n*(psi1+phi2-phi3-phi4))>\r
9019 // ...\r
9020 \r
9021 Int_t typeFlag = -1;\r
9022 Int_t ptEtaFlag = -1;\r
9023 if(type == "RP")\r
9024 {\r
9025 typeFlag = 0;\r
9026 } else if(type == "POI")\r
9027 {\r
9028 typeFlag = 1;\r
9029 } \r
9030 if(ptOrEta == "Pt")\r
9031 {\r
9032 ptEtaFlag = 0;\r
9033 } else if(ptOrEta == "Eta")\r
9034 {\r
9035 ptEtaFlag = 1;\r
9036 } \r
9037 // shortcuts:\r
9038 Int_t t = typeFlag;\r
9039 Int_t pe = ptEtaFlag;\r
9040 \r
9041 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};\r
9042 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};\r
9043 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};\r
9044 \r
9045 Int_t nPrim = anEvent->NumberOfTracks(); \r
9046 AliFlowTrackSimple *aftsTrack = NULL;\r
9047 \r
9048 Double_t psi1=0., phi2=0., phi3=0., phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;\r
9049 \r
9050 Int_t n = fHarmonic; \r
9051 \r
9052 // 2'-particle correlations:\r
9053 for(Int_t i1=0;i1<nPrim;i1++)\r
9054 {\r
9055 aftsTrack=anEvent->GetTrack(i1);\r
9056 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)\r
9057 if(ptOrEta == "Pt")\r
9058 { \r
9059 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;\r
9060 } else if (ptOrEta == "Eta")\r
9061 {\r
9062 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue; \r
9063 }\r
9064 psi1=aftsTrack->Phi(); \r
9065 for(Int_t i2=0;i2<nPrim;i2++)\r
9066 {\r
9067 if(i2==i1)continue;\r
9068 aftsTrack=anEvent->GetTrack(i2);\r
9069 // RP condition (!(first) particle in the correlator must be RP):\r
9070 if(!(aftsTrack->InRPSelection()))continue;\r
9071 phi2=aftsTrack->Phi(); \r
9072 // 2'-particle correlations: \r
9073 fDiffFlowDirectCorrelations[t][pe][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(1.*n*(psi1-phi2)),1.); // <cos(n*(psi1-phi2)) \r
9074 }//end of for(Int_t i2=0;i2<nPrim;i2++)\r
9075 }//end of for(Int_t i1=0;i1<nPrim;i1++)\r
9076 \r
9077 /*\r
9078 \r
9079 // 3'-particle correlations:\r
9080 for(Int_t i1=0;i1<nPrim;i1++)\r
9081 {\r
9082 aftsTrack=anEvent->GetTrack(i1);\r
9083 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)\r
9084 if(ptOrEta == "Pt")\r
9085 { \r
9086 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;\r
9087 } else if (ptOrEta == "Eta")\r
9088 {\r
9089 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue; \r
9090 }\r
9091 psi1=aftsTrack->Phi();\r
9092 for(Int_t i2=0;i2<nPrim;i2++)\r
9093 {\r
9094 if(i2==i1)continue;\r
9095 aftsTrack=anEvent->GetTrack(i2);\r
9096 // RP condition (!(first) particle in the correlator must be RP):\r
9097 if(!(aftsTrack->InRPSelection())) continue;\r
9098 phi2=aftsTrack->Phi();\r
9099 for(Int_t i3=0;i3<nPrim;i3++)\r
9100 {\r
9101 if(i3==i1||i3==i2)continue;\r
9102 aftsTrack=anEvent->GetTrack(i3);\r
9103 // RP condition (!(first) particle in the correlator must be RP):\r
9104 if(!(aftsTrack->InRPSelection())) continue;\r
9105 phi3=aftsTrack->Phi();\r
9106 // to be improved : where to store it? ->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(2.*phi1-phi2-phi3)),1.); // <w1 w2 w3 cos(n(2psi1-phi2-phi3))> \r
9107 }//end of for(Int_t i3=0;i3<nPrim;i3++) \r
9108 }//end of for(Int_t i2=0;i2<nPrim;i2++) \r
9109 }//end of for(Int_t i1=0;i1<nPrim;i1++)\r
9110 \r
9111 */\r
9112 \r
9113 // 4'-particle correlations:\r
9114 for(Int_t i1=0;i1<nPrim;i1++)\r
9115 {\r
9116 aftsTrack=anEvent->GetTrack(i1);\r
9117 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)\r
9118 if(ptOrEta == "Pt")\r
9119 { \r
9120 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;\r
9121 } else if (ptOrEta == "Eta")\r
9122 {\r
9123 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue; \r
9124 }\r
9125 psi1=aftsTrack->Phi();\r
9126 for(Int_t i2=0;i2<nPrim;i2++)\r
9127 {\r
9128 if(i2==i1) continue;\r
9129 aftsTrack=anEvent->GetTrack(i2);\r
9130 // RP condition (!(first) particle in the correlator must be RP): \r
9131 if(!(aftsTrack->InRPSelection())) continue;\r
9132 phi2=aftsTrack->Phi();\r
9133 for(Int_t i3=0;i3<nPrim;i3++)\r
9134 { \r
9135 if(i3==i1||i3==i2) continue;\r
9136 aftsTrack=anEvent->GetTrack(i3);\r
9137 // RP condition (!(first) particle in the correlator must be RP):\r
9138 if(!(aftsTrack->InRPSelection())) continue;\r
9139 phi3=aftsTrack->Phi();\r
9140 for(Int_t i4=0;i4<nPrim;i4++)\r
9141 {\r
9142 if(i4==i1||i4==i2||i4==i3) continue;\r
9143 aftsTrack=anEvent->GetTrack(i4);\r
9144 // RP condition (!(first) particle in the correlator must be RP):\r
9145 if(!(aftsTrack->InRPSelection())) continue; \r
9146 phi4=aftsTrack->Phi();\r
9147 // 4'-particle correlations:\r
9148 fDiffFlowDirectCorrelations[t][pe][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3-phi4)),1.); // <cos(n(psi1+phi2-phi3-phi4))> \r
9149 }//end of for(Int_t i4=0;i4<nPrim;i4++)\r
9150 }//end of for(Int_t i3=0;i3<nPrim;i3++)\r
9151 }//end of for(Int_t i2=0;i2<nPrim;i2++) \r
9152 }//end of for(Int_t i1=0;i1<nPrim;i1++)\r
9153 \r
9154 \r
9155} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoops(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)\r
9156\r
9157\r
9158//================================================================================================================================\r
9159\r
9160\r
9161void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrelations(TString type, TString ptOrEta)\r
9162{\r
9163 // Compare correlations needed for diff. flow calculated with nested loops and those calculated from Q-vectors\r
9164 \r
9165 Int_t typeFlag = -1;\r
9166 Int_t ptEtaFlag = -1;\r
9167 if(type == "RP")\r
9168 {\r
9169 typeFlag = 0;\r
9170 } else if(type == "POI")\r
9171 {\r
9172 typeFlag = 1;\r
9173 } \r
9174 if(ptOrEta == "Pt")\r
9175 {\r
9176 ptEtaFlag = 0;\r
9177 } else if(ptOrEta == "Eta")\r
9178 {\r
9179 ptEtaFlag = 1;\r
9180 } \r
9181 // shortcuts:\r
9182 Int_t t = typeFlag;\r
9183 Int_t pe = ptEtaFlag;\r
9184 \r
9185 TString rpORpoiString[2] = {"RP ","POI"}; // to be improved (name in the same way as in the other methods, eventually promote to data member) \r
9186 TString ptORetaString[2] = {"pt","eta"}; // to be improved (name in the same way as in the other methods, eventually promote to data member) \r
9187 TString reducedCorrelations[4] = {"<<cos(n(psi1-phi2))>>","<<cos(n(psi1+phi2-phi3-phi4))>>","",""}; // to be improved (access this from pro or hist)\r
9188 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};\r
9189 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};\r
9190 \r
9191 Int_t crossCheckInPtEtaBinNo[2] = {fCrossCheckInPtBinNo,fCrossCheckInEtaBinNo};\r
9192 \r
9193\r
9194 cout<<endl;\r
9195 cout<<" *****************************************"<<endl;\r
9196 cout<<" **** cross-checking the correlations ****"<<endl;\r
46b94261 9197 cout<<" **** for differential flow ("<<rpORpoiString[t]<<") ****"<<endl;\r
9198 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))\r
9199 {\r
9200 cout<<" **** (particle weights not used) ****"<<endl;\r
9201 } else\r
9202 {\r
9203 cout<<" **** (particle weights used) ****"<<endl;\r
9204 } \r
a5b7efd0 9205 cout<<" *****************************************"<<endl; \r
9206 cout<<endl;\r
9207 cout<<" "<<ptORetaString[pe]<<" bin: "<<lowerPtEtaEdge[pe]<<" <= "<<ptORetaString[pe]<<" < "<<upperPtEtaEdge[pe]<<endl;\r
9208 cout<<endl;\r
9209 \r
9210 for(Int_t rci=0;rci<2;rci++) // to be improved (calculate 6th and 8th order)\r
9211 {\r
9212 cout<<" "<<reducedCorrelations[rci].Data()<<":"<<endl;\r
9213 cout<<" from Q-vectors = "<<fDiffFlowCorrelationsPro[t][pe][rci]->GetBinContent(crossCheckInPtEtaBinNo[pe])<<endl;\r
9214 cout<<" from nested loops = "<<fDiffFlowDirectCorrelations[t][pe][rci]->GetBinContent(1)<<endl;\r
9215 cout<<endl; \r
9216 } // end of for(Int_t rci=0;rci<4;rci++)\r
9217 \r
9218} // end of void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrelations(TString type, TString ptOrEta)\r
9219\r
9220\r
9221//================================================================================================================================\r
9222\r
9223\r
9224void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)\r
9225{\r
9226 // Evaluate reduced correlations with nested loops without using the particle weights.\r
9227 \r
9228 // Remark 1: Reduced correlations are evaluated in pt bin number fCrossCheckInPtBinNo and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.\r
9229 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrelations[t][pe][ci], where indices runs as follows:\r
9230 // [0=RP,1=POI][0=Pt,1=Eta][0=<2'>,1=<4'>,2=<6'>,3=<8'>] \r
9231 // Remark 3: <2'> = <w2 cos(n*(psi1-phi2))>\r
9232 // <4'> = <w2 w3 w4 cos(n*(psi1+phi2-phi3-phi4))>\r
9233 // ...\r
9234 \r
9235 Int_t typeFlag = -1;\r
9236 Int_t ptEtaFlag = -1;\r
9237 if(type == "RP")\r
9238 {\r
9239 typeFlag = 0;\r
9240 } else if(type == "POI")\r
9241 {\r
9242 typeFlag = 1;\r
9243 } \r
9244 if(ptOrEta == "Pt")\r
9245 {\r
9246 ptEtaFlag = 0;\r
9247 } else if(ptOrEta == "Eta")\r
9248 {\r
9249 ptEtaFlag = 1;\r
9250 } \r
9251 // shortcuts:\r
9252 Int_t t = typeFlag;\r
9253 Int_t pe = ptEtaFlag;\r
9254 \r
9255 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};\r
9256 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};\r
9257 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};\r
9258 \r
9259 Int_t nPrim = anEvent->NumberOfTracks(); \r
9260 AliFlowTrackSimple *aftsTrack = NULL;\r
9261 \r
9262 Double_t psi1=0., phi2=0., phi3=0., phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;\r
9263 Double_t wPhi2=1., wPhi3=1., wPhi4=1.;// wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;\r
9264 \r
9265 Int_t n = fHarmonic; \r
9266 \r
9267 // 2'-particle correlations:\r
9268 for(Int_t i1=0;i1<nPrim;i1++)\r
9269 {\r
9270 aftsTrack=anEvent->GetTrack(i1);\r
9271 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)\r
9272 if(ptOrEta == "Pt")\r
9273 { \r
9274 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection()))) continue;\r
9275 } else if (ptOrEta == "Eta")\r
9276 {\r
9277 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection()))) continue; \r
9278 }\r
9279 psi1=aftsTrack->Phi(); \r
9280 for(Int_t i2=0;i2<nPrim;i2++)\r
9281 {\r
9282 if(i2==i1) continue;\r
9283 aftsTrack=anEvent->GetTrack(i2);\r
9284 // RP condition (!(first) particle in the correlator must be RP):\r
9285 if(!(aftsTrack->InRPSelection())) continue;\r
9286 phi2=aftsTrack->Phi(); \r
9287 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));\r
9288 // 2'-particle correlations: \r
9289 fDiffFlowDirectCorrelations[t][pe][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(1.*n*(psi1-phi2)),wPhi2); // <w2 cos(n*(psi1-phi2)) \r
9290 }//end of for(Int_t i2=0;i2<nPrim;i2++)\r
9291 }//end of for(Int_t i1=0;i1<nPrim;i1++)\r
9292 \r
9293 // 4'-particle correlations:\r
9294 for(Int_t i1=0;i1<nPrim;i1++)\r
9295 {\r
9296 aftsTrack=anEvent->GetTrack(i1);\r
9297 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)\r
9298 if(ptOrEta == "Pt")\r
9299 { \r
9300 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection()))) continue;\r
9301 } else if (ptOrEta == "Eta")\r
9302 {\r
9303 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection()))) continue; \r
9304 }\r
9305 psi1=aftsTrack->Phi();\r
9306 for(Int_t i2=0;i2<nPrim;i2++)\r
9307 {\r
9308 if(i2==i1) continue;\r
9309 aftsTrack=anEvent->GetTrack(i2);\r
9310 // RP condition (!(first) particle in the correlator must be RP): \r
9311 if(!(aftsTrack->InRPSelection())) continue;\r
9312 phi2=aftsTrack->Phi();\r
9313 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));\r
9314 for(Int_t i3=0;i3<nPrim;i3++)\r
9315 { \r
9316 if(i3==i1||i3==i2) continue;\r
9317 aftsTrack=anEvent->GetTrack(i3);\r
9318 // RP condition (!(first) particle in the correlator must be RP):\r
9319 if(!(aftsTrack->InRPSelection())) continue;\r
9320 phi3=aftsTrack->Phi();\r
9321 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));\r
9322 for(Int_t i4=0;i4<nPrim;i4++)\r
9323 {\r
9324 if(i4==i1||i4==i2||i4==i3) continue;\r
9325 aftsTrack=anEvent->GetTrack(i4);\r
9326 // RP condition (!(first) particle in the correlator must be RP):\r
9327 if(!(aftsTrack->InRPSelection())) continue; \r
9328 phi4=aftsTrack->Phi();\r
9329 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));\r
9330 // 4'-particle correlations <w2 w3 w4 cos(n(psi1+phi2-phi3-phi4))>:\r
9331 fDiffFlowDirectCorrelations[t][pe][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3-phi4)),wPhi2*wPhi3*wPhi4); \r
9332 }//end of for(Int_t i4=0;i4<nPrim;i4++)\r
9333 }//end of for(Int_t i3=0;i3<nPrim;i3++)\r
9334 }//end of for(Int_t i2=0;i2<nPrim;i2++) \r
9335 }//end of for(Int_t i1=0;i1<nPrim;i1++) \r
9336 \r
9337} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)\r
9338\r
9339\r
9340//================================================================================================================================\r
9341\r
9342 \r
9343void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)\r
9344{\r
9345 // Evaluate with nested loops correction terms for non-uniform acceptance (both sin and cos terms) relevant for differential flow.\r
9346 \r
9347 // Remark 1: Reduced correction terms for non-uniform acceptance are evaluated in pt bin number fCrossCheckInPtBinNo \r
9348 // and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.\r
9349 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrections[t][pe][sc][cti], where first three indices runs as: \r
9350 // [0=RP,1=POI][0=Pt,1=Eta][0=sin terms,1=cos terms], whilst the cti (correction term index) runs as follows: \r
9351 // cti: \r
9352 // 0: <<sc n(psi1)>>\r
9353 // 1: <<sc n(psi1+phi2)>> \r
9354 // 2: <<sc n(psi1+phi2-phi3)>>\r
9355 // 3: <<sc n(psi1-phi2-phi3)>>\r
9356 // 4:\r
9357 // 5:\r
9358 // 6:\r
9359 \r
9360 Int_t typeFlag = -1;\r
9361 Int_t ptEtaFlag = -1;\r
9362 if(type == "RP")\r
9363 {\r
9364 typeFlag = 0;\r
9365 } else if(type == "POI")\r
9366 {\r
9367 typeFlag = 1;\r
9368 } \r
9369 if(ptOrEta == "Pt")\r
9370 {\r
9371 ptEtaFlag = 0;\r
9372 } else if(ptOrEta == "Eta")\r
9373 {\r
9374 ptEtaFlag = 1;\r
9375 } \r
9376 // shortcuts:\r
9377 Int_t t = typeFlag;\r
9378 Int_t pe = ptEtaFlag;\r
9379 \r
9380 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};\r
9381 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};\r
9382 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};\r
9383 \r
9384 Int_t nPrim = anEvent->NumberOfTracks(); \r
9385 AliFlowTrackSimple *aftsTrack = NULL;\r
9386 \r
9387 Double_t psi1=0., phi2=0., phi3=0.;// phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;\r
9388 \r
9389 Int_t n = fHarmonic; \r
9390 \r
9391 // 1-particle correction terms:\r
9392 for(Int_t i1=0;i1<nPrim;i1++)\r
9393 {\r
9394 aftsTrack=anEvent->GetTrack(i1);\r
9395 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)\r
9396 if(ptOrEta == "Pt")\r
9397 { \r
9398 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection()))) continue;\r
9399 } else if (ptOrEta == "Eta")\r
9400 {\r
9401 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection()))) continue; \r
9402 }\r
9403 psi1=aftsTrack->Phi(); \r
9404 // sin terms: \r
9405 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*psi1),1.); // <<sin(n*(psi1))>> \r
9406 // cos terms: \r
9407 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*psi1),1.); // <<cos(n*(psi1))>> \r
9408 }//end of for(Int_t i1=0;i1<nPrim;i1++)\r
9409 \r
9410 // 2-particle correction terms:\r
9411 for(Int_t i1=0;i1<nPrim;i1++)\r
9412 {\r
9413 aftsTrack=anEvent->GetTrack(i1);\r
9414 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)\r
9415 if(ptOrEta == "Pt")\r
9416 { \r
9417 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection()))) continue;\r
9418 } else if (ptOrEta == "Eta")\r
9419 {\r
9420 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection()))) continue; \r
9421 }\r
9422 psi1=aftsTrack->Phi(); \r
9423 for(Int_t i2=0;i2<nPrim;i2++)\r
9424 {\r
9425 if(i2==i1) continue;\r
9426 aftsTrack=anEvent->GetTrack(i2);\r
9427 // RP condition (!(first) particle in the correlator must be RP):\r
9428 if(!(aftsTrack->InRPSelection())) continue;\r
9429 phi2=aftsTrack->Phi(); \r
9430 // sin terms: \r
9431 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2)),1.); // <<sin(n*(psi1+phi2))>> \r
9432 // cos terms: \r
9433 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2)),1.); // <<cos(n*(psi1+phi2))>> \r
9434 }//end of for(Int_t i2=0;i2<nPrim;i2++)\r
9435 }//end of for(Int_t i1=0;i1<nPrim;i1++) \r
9436 \r
9437 // 3-particle correction terms:\r
9438 for(Int_t i1=0;i1<nPrim;i1++)\r
9439 {\r
9440 aftsTrack=anEvent->GetTrack(i1);\r
9441 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)\r
9442 if(ptOrEta == "Pt")\r
9443 { \r
9444 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;\r
9445 } else if (ptOrEta == "Eta")\r
9446 {\r
9447 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue; \r
9448 }\r
9449 psi1=aftsTrack->Phi();\r
9450 for(Int_t i2=0;i2<nPrim;i2++)\r
9451 {\r
9452 if(i2==i1) continue;\r
9453 aftsTrack=anEvent->GetTrack(i2);\r
9454 // RP condition (!(first) particle in the correlator must be RP):\r
9455 if(!(aftsTrack->InRPSelection())) continue;\r
9456 phi2=aftsTrack->Phi();\r
9457 for(Int_t i3=0;i3<nPrim;i3++)\r
9458 {\r
9459 if(i3==i1||i3==i2) continue;\r
9460 aftsTrack=anEvent->GetTrack(i3);\r
9461 // RP condition (!(first) particle in the correlator must be RP):\r
9462 if(!(aftsTrack->InRPSelection())) continue;\r
9463 phi3=aftsTrack->Phi();\r
9464 // sin terms: \r
9465 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][2]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2-phi3)),1.); // <<sin(n*(psi1+phi2-phi3))>> \r
9466 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][3]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1-phi2-phi3)),1.); // <<sin(n*(psi1-phi2-phi3))>> \r
9467 // cos terms: \r
9468 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][2]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3)),1.); // <<cos(n*(psi1+phi2-phi3))>> \r
9469 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][3]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1-phi2-phi3)),1.); // <<cos(n*(psi1-phi2-phi3))>> \r
9470 }//end of for(Int_t i3=0;i3<nPrim;i3++) \r
9471 }//end of for(Int_t i2=0;i2<nPrim;i2++) \r
9472 }//end of for(Int_t i1=0;i1<nPrim;i1++)\r
9473 \r
9474} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)\r
9475\r
9476\r
9477//================================================================================================================================\r
9478\r
9479\r
9480void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrectionTermsForNUA(TString type, TString ptOrEta)\r
9481{\r
9482 // Compare corrections temrs for non-uniform acceptance needed for diff. flow calculated with nested loops and those calculated from Q-vectors\r
9483 \r
9484 Int_t typeFlag = -1;\r
9485 Int_t ptEtaFlag = -1;\r
9486 if(type == "RP")\r
9487 {\r
9488 typeFlag = 0;\r
9489 } else if(type == "POI")\r
9490 {\r
9491 typeFlag = 1;\r
9492 } \r
9493 if(ptOrEta == "Pt")\r
9494 {\r
9495 ptEtaFlag = 0;\r
9496 } else if(ptOrEta == "Eta")\r
9497 {\r
9498 ptEtaFlag = 1;\r
9499 } \r
9500 // shortcuts:\r
9501 Int_t t = typeFlag;\r
9502 Int_t pe = ptEtaFlag;\r
9503 \r
9504 TString rpORpoiString[2] = {"RP ","POI"}; // to be improved (name in the same way as in the other methods, eventually promote to data member) \r
9505 TString ptORetaString[2] = {"pt","eta"}; // to be improved (name in the same way as in the other methods, eventually promote to data member) \r
9506 //TString sinCosFlag[2] = {"sin","cos"}; // to be improved (eventually promote to data member)\r
9507 TString reducedCorrectionSinTerms[4] = {"<<sin(n(psi1))>>","<<sin(n(psi1+phi2))>>","<<sin(n*(psi1+phi2-phi3))>>","<<sin(n*(psi1-phi2-phi3))>>"}; // to be improved (access this from pro or hist)\r
9508 TString reducedCorrectionCosTerms[4] = {"<<cos(n(psi1))>>","<<cos(n(psi1+phi2))>>","<<cos(n*(psi1+phi2-phi3))>>","<<cos(n*(psi1-phi2-phi3))>>"}; // to be improved (access this from pro or hist)\r
9509 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};\r
9510 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};\r
9511 \r
9512 Int_t crossCheckInPtEtaBinNo[2] = {fCrossCheckInPtBinNo,fCrossCheckInEtaBinNo};\r
9513 \r
9514 cout<<endl;\r
9515 cout<<" ******************************************"<<endl;\r
9516 cout<<" **** cross-checking the correction ****"<<endl;\r
46b94261 9517 cout<<" **** terms for non-uniform acceptance ****"<<endl;
9518 cout<<" **** for differential flow ("<<rpORpoiString[t]<<") ****"<<endl;\r
9519 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))\r
9520 {\r
9521 cout<<" **** (particle weights not used) ****"<<endl;\r
9522 } else\r
9523 {\r
9524 cout<<" **** (particle weights used) ****"<<endl;\r
9525 } \r
a5b7efd0 9526 cout<<" ******************************************"<<endl; \r
9527 cout<<endl;\r
9528 cout<<" "<<ptORetaString[pe]<<" bin: "<<lowerPtEtaEdge[pe]<<" <= "<<ptORetaString[pe]<<" < "<<upperPtEtaEdge[pe]<<endl;\r
9529 cout<<endl;\r
9530 \r
9531 for(Int_t cti=0;cti<4;cti++) // correction term index\r
9532 {\r
9533 for(Int_t sc=0;sc<2;sc++) // sin or cos terms\r
9534 {\r
9535 if(sc==0) // to be improved (this can be implemented better)\r
9536 { \r
9537 cout<<" "<<reducedCorrectionSinTerms[cti].Data()<<":"<<endl;\r
9538 } else\r
9539 {\r
9540 cout<<" "<<reducedCorrectionCosTerms[cti].Data()<<":"<<endl; \r
9541 }\r
9542 cout<<" from Q-vectors = "<<fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]->GetBinContent(crossCheckInPtEtaBinNo[pe])<<endl;\r
9543 cout<<" from nested loops = "<<fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti]->GetBinContent(1)<<endl;\r
9544 cout<<endl; \r
9545 } \r
9546 } // end of for(Int_t rci=0;rci<4;rci++)\r
9547\r
9548} // end of void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrectionTermsForNUA(TString type, TString ptOrEta)\r
9549\r
9550\r
57340a27 9551//================================================================================================================================
9552
9553\r
9554void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights()\r
9555{\r
9556 // Calculate corrections using particle weights for non-uniform acceptance of the detector for no-name integrated flow (cos terms).\r
9557 \r
9558 // **********************************************************************\r
9559 // **** weighted corrections for non-uniform acceptance (cos terms): ****\r
9560 // **********************************************************************\r
9561
9562 // Remark 1: When particle weights are used the binning of fIntFlowCorrectionTermsForNUAPro[1] is organized as follows:\r
9563 //
9564 // 1st bin: <<w1 cos(n*(phi1))>> = cosP1nW1\r
9565 // 2nd bin: <<w1 w2 cos(n*(phi1+phi2))>> = cosP1nP1nW1W1\r
9566 // 3rd bin: <<w1 w2 w3 cos(n*(phi1-phi2-phi3))>> = cosP1nM1nM1nW1W1W1 \r
9567 // ...\r
9568
9569 // multiplicity (number of particles used to determine the reaction plane)\r
9570 Double_t dMult = (*fSMpk)(0,0);\r
9571 \r
9572 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n: \r
9573 Double_t dReQ1n1k = (*fReQ)(0,1);\r
9574 Double_t dReQ2n2k = (*fReQ)(1,2);\r
9575 //Double_t dReQ3n3k = (*fReQ)(2,3);\r
9576 //Double_t dReQ4n4k = (*fReQ)(3,4);\r
9577 Double_t dReQ1n3k = (*fReQ)(0,3);\r
9578 Double_t dImQ1n1k = (*fImQ)(0,1);\r
9579 Double_t dImQ2n2k = (*fImQ)(1,2);\r
9580 //Double_t dImQ3n3k = (*fImQ)(2,3);\r
9581 //Double_t dImQ4n4k = (*fImQ)(3,4);\r
9582 //Double_t dImQ1n3k = (*fImQ)(0,3);\r
9583\r
9584 // dMs are variables introduced in order to simplify some Eqs. bellow:\r
9585 //..............................................................................................\r
9586 Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j\r
9587 Double_t dM111 = (*fSMpk)(2,1)-3.*(*fSMpk)(0,2)*(*fSMpk)(0,1)
9588 + 2.*(*fSMpk)(0,3); // dM111 = sum_{i,j,k=1,i!=j!=k}^M w_i w_j w_k\r
9589 //..............................................................................................\r
9590 \r // 1-particle:\r
9591 Double_t cosP1nW1 = 0.; // <<w1 cos(n*(phi1))>>\r
9592 \r
9593 if(dMult>0 && (*fSMpk)(0,1) !=0.)\r
9594 {\r
9595 cosP1nW1 = dReQ1n1k/(*fSMpk)(0,1); \r
9596 \r
9597 // average weighted 1-particle correction (cos terms) for non-uniform acceptance for single event:\r
9598 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(1,cosP1nW1);\r
9599 \r
9600 // final average weighted 1-particle correction (cos terms) for non-uniform acceptance for all events:\r
9601 fIntFlowCorrectionTermsForNUAPro[1]->Fill(0.5,cosP1nW1,(*fSMpk)(0,1)); \r
9602 } \r
9603 \r
9604 // 2-particle:\r
9605 Double_t cosP1nP1nW1W1 = 0.; // <<w1 w2 cos(n*(phi1+phi2))>>\r
9606 \r
9607 if(dMult>1 && dM11 !=0.)\r
9608 {\r
9609 cosP1nP1nW1W1 = (pow(dReQ1n1k,2)-pow(dImQ1n1k,2)-dReQ2n2k)/dM11; \r
9610 \r
9611 // average weighted 2-particle correction (cos terms) for non-uniform acceptance for single event:\r
9612 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(2,cosP1nP1nW1W1);\r
9613 \r
9614 // final average weighted 2-particle correction (cos terms) for non-uniform acceptance for all events:\r
9615 fIntFlowCorrectionTermsForNUAPro[1]->Fill(1.5,cosP1nP1nW1W1,dM11); \r
9616 } \r
9617 \r
9618 // 3-particle:\r
9619 Double_t cosP1nM1nM1nW1W1W1 = 0.; // <<w1 w2 w3 cos(n*(phi1-phi2-phi3))>>\r
9620 \r
9621 if(dMult>2 && dM111 !=0.)\r
9622 {\r
9623 cosP1nM1nM1nW1W1W1 = (dReQ1n1k*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
9624 - dReQ1n1k*dReQ2n2k-dImQ1n1k*dImQ2n2k
9625 - 2.*((*fSMpk)(0,2))*dReQ1n1k
9626 + 2.*dReQ1n3k) \r
9627 / dM111; \r
9628 \r
9629 // average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for single event:\r
9630 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(3,cosP1nM1nM1nW1W1W1);\r
9631 \r
9632 // final average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for all events:\r
9633 fIntFlowCorrectionTermsForNUAPro[1]->Fill(2.5,cosP1nM1nM1nW1W1W1,dM111); \r
9634 } \r
9635 \r
9636} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights()\r
9637\r
9638\r
a5b7efd0 9639//================================================================================================================================\r
57340a27 9640\r
9641\r
9642void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights()\r
9643{\r
9644 // calculate corrections using particle weights for non-uniform acceptance of the detector for no-name integrated flow (sin terms)\r
9645 \r
9646 // **********************************************************************\r
9647 // **** weighted corrections for non-uniform acceptance (sin terms): ****\r
9648 // **********************************************************************\r
9649
9650 // Remark 1: When particle weights are used the binning of fIntFlowCorrectionTermsForNUAPro[0] is organized as follows:\r
9651 //
9652 // 1st bin: <<w1 sin(n*(phi1))>> = sinP1nW1\r
9653 // 2nd bin: <<w1 w2 sin(n*(phi1+phi2))>> = sinP1nP1nW1W1\r
9654 // 3rd bin: <<w1 w2 w3 sin(n*(phi1-phi2-phi3))>> = sinP1nM1nM1nW1W1W1 \r
9655 // ...\r
9656
9657 // multiplicity (number of particles used to determine the reaction plane)\r
9658 Double_t dMult = (*fSMpk)(0,0);\r
9659 \r
9660 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n: \r
9661 Double_t dReQ1n1k = (*fReQ)(0,1);\r
9662 Double_t dReQ2n2k = (*fReQ)(1,2);\r
9663 //Double_t dReQ3n3k = (*fReQ)(2,3);\r
9664 //Double_t dReQ4n4k = (*fReQ)(3,4);\r
9665 //Double_t dReQ1n3k = (*fReQ)(0,3);\r
9666 Double_t dImQ1n1k = (*fImQ)(0,1);\r
9667 Double_t dImQ2n2k = (*fImQ)(1,2);\r
9668 //Double_t dImQ3n3k = (*fImQ)(2,3);\r
9669 //Double_t dImQ4n4k = (*fImQ)(3,4);\r
9670 Double_t dImQ1n3k = (*fImQ)(0,3);\r
9671\r
9672 // dMs are variables introduced in order to simplify some Eqs. bellow:\r
9673 //..............................................................................................\r
9674 Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j\r
9675 Double_t dM111 = (*fSMpk)(2,1)-3.*(*fSMpk)(0,2)*(*fSMpk)(0,1)
9676 + 2.*(*fSMpk)(0,3); // dM111 = sum_{i,j,k=1,i!=j!=k}^M w_i w_j w_k\r
9677 //..............................................................................................\r
9678 \r
9679 // 1-particle:\r
9680 Double_t sinP1nW1 = 0.; // <<w1 sin(n*(phi1))>>\r
9681 \r
9682 if(dMult>0 && (*fSMpk)(0,1) !=0.)\r
9683 {\r
9684 sinP1nW1 = dImQ1n1k/((*fSMpk)(0,1)); \r
9685 \r
9686 // average weighted 1-particle correction (sin terms) for non-uniform acceptance for single event:\r
9687 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(1,sinP1nW1);\r
9688 \r
9689 // final average weighted 1-particle correction (sin terms) for non-uniform acceptance for all events: \r
9690 fIntFlowCorrectionTermsForNUAPro[0]->Fill(0.5,sinP1nW1,(*fSMpk)(0,1)); \r
9691 } \r
9692 \r
9693 // 2-particle:\r
9694 Double_t sinP1nP1nW1W1 = 0.; // <<w1 w2 sin(n*(phi1+phi2))>>\r
9695 \r
9696 if(dMult>1 && dM11 !=0.)\r
9697 {\r
9698 sinP1nP1nW1W1 = (2.*dReQ1n1k*dImQ1n1k-dImQ2n2k)/dM11; \r
9699 \r
9700 // average weighted 2-particle correction (sin terms) for non-uniform acceptance for single event:\r
9701 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(2,sinP1nP1nW1W1);\r
9702 \r
9703 // final average weighted 1-particle correction (sin terms) for non-uniform acceptance for all events: \r
9704 fIntFlowCorrectionTermsForNUAPro[0]->Fill(1.5,sinP1nP1nW1W1,dM11); \r
9705 } \r
9706 \r
9707 // 3-particle:\r
9708 Double_t sinP1nM1nM1nW1W1W1 = 0.; // <<w1 w2 w3 sin(n*(phi1-phi2-phi3))>>\r
9709 \r
9710 if(dMult>2 && dM111 !=0.)\r
9711 {\r
9712 sinP1nM1nM1nW1W1W1 = (-dImQ1n1k*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
9713 + dReQ1n1k*dImQ2n2k-dImQ1n1k*dReQ2n2k
9714 + 2.*((*fSMpk)(0,2))*dImQ1n1k
9715 - 2.*dImQ1n3k)\r
9716 / dM111; \r
9717 \r
9718 // average weighted 3-particle correction (sin terms) for non-uniform acceptance for single event:\r
9719 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(3,sinP1nM1nM1nW1W1W1);\r
9720 \r
9721 // final average weighted 3-particle correction (sin terms) for non-uniform acceptance for all events: \r
9722 fIntFlowCorrectionTermsForNUAPro[0]->Fill(2.5,sinP1nM1nM1nW1W1W1,dM111); \r
9723 } \r
9724 \r
9725} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights()\r
9726\r
9727\r
9728//================================================================================================================================
9729\r
9730\r
9731void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent)\r
9732{\r
9733 // Evaluate with nested loops correction terms for non-uniform acceptance for integrated flow (using the particle weights). \r
9734\r
9735 // Results are stored in profiles fIntFlowDirectCorrectionTermsForNUA[0] (sin terms) and
9736 // fIntFlowDirectCorrectionTermsForNUA[1] (cos terms).
9737 \r
9738 // Remark 1: When particle weights are used the binning of fIntFlowDirectCorrectionTermsForNUA[sc] is
9739 // organized as follows (sc stands for either sin or cos):\r
9740 //\r
9741 // 1st bin: <<w1 sc(n*(phi1))>> = scP1nW1\r
9742 // 2nd bin: <<w1 w2 sc(n*(phi1+phi2))>> = scP1nP1nW1W1\r
9743 // 3rd bin: <<w1 w2 w3 sc(n*(phi1-phi2-phi3))>> = scP1nM1nM1nW1W1W1 \r
9744 // ...\r
9745 \r
9746 Int_t nPrim = anEvent->NumberOfTracks(); \r
9747 AliFlowTrackSimple *aftsTrack = NULL;\r
9748 //Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;\r
9749 //Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1., wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;\r
9750 Double_t phi1=0., phi2=0., phi3=0.;\r
9751 Double_t wPhi1=1., wPhi2=1., wPhi3=1.;\r
9752 Int_t n = fHarmonic; \r
9753 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)\r
9754 Double_t dMult = (*fSMpk)(0,0);\r
9755 cout<<endl;\r
9756 cout<<"Correction terms for non-uniform acceptance: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;\r
9757 if(dMult<1)\r
9758 {\r
9759 cout<<"... skipping this event (multiplicity too low) ..."<<endl;\r
9760 } else if (dMult>fMaxAllowedMultiplicity)\r
9761 {\r
9762 cout<<"... skipping this event (multiplicity too high) ..."<<endl;\r
9763 } else \r
9764 { \r
9765 cout<<"... evaluating nested loops (using particle weights) ..."<<endl;\r
9766 } \r
9767 \r
9768 // 1-particle correction terms using particle weights: \r
9769 if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)\r
9770 {\r
9771 for(Int_t i1=0;i1<nPrim;i1++)\r
9772 {\r
9773 aftsTrack=anEvent->GetTrack(i1);\r
9774 if(!(aftsTrack->InRPSelection())) continue;\r
9775 phi1=aftsTrack->Phi();\r
9776 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));\r
9777 // 1-particle correction terms using particle weights:
9778 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(0.5,sin(n*phi1),wPhi1); // <w1 sin(n*phi1)>\r
9779 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(0.5,cos(n*phi1),wPhi1); // <w1 cos(n*phi1)>\r
9780 } // end of for(Int_t i1=0;i1<nPrim;i1++)
9781 } // end of if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)
9782
9783 // 2-particle correction terms using particle weights: \r
9784 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)\r
9785 {\r
9786 for(Int_t i1=0;i1<nPrim;i1++)\r
9787 {\r
9788 aftsTrack=anEvent->GetTrack(i1);\r
9789 if(!(aftsTrack->InRPSelection())) continue;\r
9790 phi1=aftsTrack->Phi();\r
9791 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));\r
9792 for(Int_t i2=0;i2<nPrim;i2++)\r
9793 {\r
9794 if(i2==i1)continue;\r
9795 aftsTrack=anEvent->GetTrack(i2);\r
9796 if(!(aftsTrack->InRPSelection())) continue;\r
9797 phi2=aftsTrack->Phi();\r
9798 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi()))); \r
9799 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;\r
9800 // 2-p correction terms using particle weights:
9801 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(1.5,sin(n*(phi1+phi2)),wPhi1*wPhi2); // <w1 w2 sin(n*(phi1+phi2))>\r
9802 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(1.5,cos(n*(phi1+phi2)),wPhi1*wPhi2); // <w1 w2 cos(n*(phi1+phi2))>\r
9803 } // end of for(Int_t i2=0;i2<nPrim;i2++)\r
9804 } // end of for(Int_t i1=0;i1<nPrim;i1++)\r
9805 } // end of if(nPrim>=2)\r
9806\r
9807 // 3-particle correction terms using particle weights: \r
9808 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)\r
9809 { \r
9810 for(Int_t i1=0;i1<nPrim;i1++)\r
9811 {\r
9812 aftsTrack=anEvent->GetTrack(i1);\r
9813 if(!(aftsTrack->InRPSelection())) continue;\r
9814 phi1=aftsTrack->Phi();\r
9815 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));\r
9816 for(Int_t i2=0;i2<nPrim;i2++)\r
9817 {\r
9818 if(i2==i1)continue;\r
9819 aftsTrack=anEvent->GetTrack(i2);\r
9820 if(!(aftsTrack->InRPSelection())) continue;\r
9821 phi2=aftsTrack->Phi();\r
9822 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));\r
9823 for(Int_t i3=0;i3<nPrim;i3++)\r
9824 {\r
9825 if(i3==i1||i3==i2)continue;\r
9826 aftsTrack=anEvent->GetTrack(i3);\r
9827 if(!(aftsTrack->InRPSelection())) continue;\r
9828 phi3=aftsTrack->Phi();\r
9829 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));\r
9830 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;\r
9831 // 3-p correction terms using particle weights:
9832 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(2.5,sin(n*(phi1-phi2-phi3)),wPhi1*wPhi2*wPhi3); // <w1 w2 w3 sin(n*(phi1-phi2-phi3))>\r
9833 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(2.5,cos(n*(phi1-phi2-phi3)),wPhi1*wPhi2*wPhi3); // <w1 w2 w3 cos(n*(phi1-phi2-phi3))>\r
9834 } // end of for(Int_t i3=0;i3<nPrim;i3++)\r
9835 } // end of for(Int_t i2=0;i2<nPrim;i2++)\r
9836 } // end of for(Int_t i1=0;i1<nPrim;i1++)\r
9837 } // end of if(nPrim>=3)\r
9838 \r
9839 /*
9840
9841 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)\r
9842 {\r
9843 // 4 nested loops multiparticle correlations using particle weights: \r
9844 for(Int_t i1=0;i1<nPrim;i1++)\r
9845 {\r
9846 aftsTrack=anEvent->GetTrack(i1);\r
9847 if(!(aftsTrack->InRPSelection())) continue;\r
9848 phi1=aftsTrack->Phi();\r
9849 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));\r
9850 for(Int_t i2=0;i2<nPrim;i2++)\r
9851 {\r
9852 if(i2==i1)continue;\r
9853 aftsTrack=anEvent->GetTrack(i2);\r
9854 if(!(aftsTrack->InRPSelection())) continue;\r
9855 phi2=aftsTrack->Phi();\r
9856 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));\r
9857 for(Int_t i3=0;i3<nPrim;i3++)\r
9858 {\r
9859 if(i3==i1||i3==i2)continue;\r
9860 aftsTrack=anEvent->GetTrack(i3);\r
9861 if(!(aftsTrack->InRPSelection())) continue;\r
9862 phi3=aftsTrack->Phi();\r
9863 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));\r
9864 for(Int_t i4=0;i4<nPrim;i4++)\r
9865 {\r
9866 if(i4==i1||i4==i2||i4==i3)continue;\r
9867 aftsTrack=anEvent->GetTrack(i4);\r
9868 if(!(aftsTrack->InRPSelection())) continue;\r
9869 phi4=aftsTrack->Phi();\r
9870 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));\r
9871 if(nPrim>=4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush; // to be improved (replace eventually this if statement with if(nPrim==4))\r
9872 // 4-p correlations using particle weights:\r
9873 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(10.5,cos(n*phi1+n*phi2-n*phi3-n*phi4),wPhi1*wPhi2*wPhi3*wPhi4); \r
9874 // extra correlations: \r
9875 // 2-p extra correlations (do not appear if particle weights are not used):\r
9876 // ...\r
9877 // 3-p extra correlations (do not appear if particle weights are not used):\r
9878 // ...\r
9879 // 4-p extra correlations (do not appear if particle weights are not used):\r
9880 // ...\r
9881 } // end of for(Int_t i4=0;i4<nPrim;i4++) \r
9882 } // end of for(Int_t i3=0;i3<nPrim;i3++)\r
9883 } // end of for(Int_t i2=0;i2<nPrim;i2++)\r
9884 } // end of for(Int_t i1=0;i1<nPrim;i1++)\r
9885 } // end of if(nPrim>=4)\r
9886
9887 */\r
9888
9889 cout<<endl; \r
9890\r
9891} // end of void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent)\r
9892\r
9893\r
9894//================================================================================================================================
9895\r
9896\r
9897void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights(TString type, TString ptOrEta)\r
9898{\r
9899 // Calculate correction terms for non-uniform acceptance for differential flow (cos terms) using particle weights.\r
9900
57340a27 9901 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][1][cti], where cti runs as follows:\r
9902 //
46b94261 9903 // 0: <<cos n(psi)>>\r
9904 // 1: <<w2 cos n(psi1+phi2)>>\r
9905 // 2: <<w2 w3 cos n(psi1+phi2-phi3)>>\r
9906 // 3: <<w2 w3 cos n(psi1-phi2-phi3)>>\r
57340a27 9907 // 4:\r
9908 // 5:\r
9909 // 6:\r
9910 \r
57340a27 9911 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n: \r
9912 Double_t dReQ1n1k = (*fReQ)(0,1);\r
9913 Double_t dReQ2n2k = (*fReQ)(1,2);\r
46b94261 9914 //Double_t dReQ1n3k = (*fReQ)(0,3);\r
57340a27 9915 //Double_t dReQ4n4k = (*fReQ)(3,4);\r
9916 Double_t dImQ1n1k = (*fImQ)(0,1);\r
9917 Double_t dImQ2n2k = (*fImQ)(1,2);\r
46b94261 9918 //Double_t dImQ1n3k = (*fImQ)(0,3);\r
57340a27 9919 //Double_t dImQ4n4k = (*fImQ)(3,4);\r
9920
9921 // S^M_{p,k} (see .h file for the definition of fSMpk):\r
9922 Double_t dSM1p1k = (*fSMpk)(0,1);\r
9923 Double_t dSM1p2k = (*fSMpk)(0,2);\r
57340a27 9924 Double_t dSM2p1k = (*fSMpk)(1,1);\r
57340a27 9925\r
9926 Int_t t = -1; // type flag \r
9927 Int_t pe = -1; // ptEta flag\r
9928 \r
9929 if(type == "RP")\r
9930 {\r
9931 t = 0;\r
9932 } else if(type == "POI")\r
9933 {\r
9934 t = 1;\r
9935 }\r
9936\r
9937 if(ptOrEta == "Pt")\r
9938 {\r
9939 pe = 0;\r
9940 } else if(ptOrEta == "Eta")\r
9941 {\r
9942 pe = 1;\r
9943 }\r
9944 \r
9945 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
9946 Double_t minPtEta[2] = {fPtMin,fEtaMin};\r
9947 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};\r
9948 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};\r
46b94261 9949
57340a27 9950 // looping over all bins and calculating correction terms: \r
9951 for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
9952 {\r
9953 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin): \r
9954 Double_t p1n0kRe = 0.;\r
9955 Double_t p1n0kIm = 0.;\r
9956\r
9957 // number of POIs in particular pt or eta bin:\r
9958 Double_t mp = 0.;\r
9959\r
57340a27 9960 // real and imaginary parts of q_{m*n,0} (weighted Q-vector evaluated for particles which are both RPs and POIs in particular pt or eta bin):\r
57340a27 9961 Double_t q1n2kRe = 0.;\r
9962 Double_t q1n2kIm = 0.;\r
9963 Double_t q2n1kRe = 0.;\r
9964 Double_t q2n1kIm = 0.;\r
46b94261 9965
9966 // s_{1,1}, s_{1,2} // to be improved (add explanation) \r
57340a27 9967 Double_t s1p1k = 0.; \r
9968 Double_t s1p2k = 0.; \r
46b94261 9969
9970 // number of particles which are both RPs and POIs in particular pt or eta bin:\r
9971 Double_t mq = 0.;
9972 \r
9973 // M0111 from Eq. (118) in QC2c (to be improved (notation))\r
9974 Double_t dM01 = 0.;\r
9975 Double_t dM011 = 0.;\r
57340a27 9976
9977 if(type == "POI")\r
9978 {\r
9979 // p_{m*n,k}:
9980 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))\r
9981 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));\r
9982 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b)) \r
9983 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
9984 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here) \r
9985 // q_{m*n,k}:\r
46b94261 9986 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))\r
9987 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));\r
9988 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))\r
9989 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b)); \r
9990 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))\r
9991 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));\r
9992 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))\r
9993 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b)); \r
9994 mq = fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)\r
9995
57340a27 9996 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.); \r
9997 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.); \r
46b94261 9998
9999 // M01 from Eq. (118) in QC2c (to be improved (notation)):\r
10000 dM01 = mp*dSM1p1k-s1p1k;
10001 dM011 = mp*(dSM2p1k-dSM1p2k)
10002 - 2.*(s1p1k*dSM1p1k-s1p2k);
10003
57340a27 10004 // typeFlag = RP (0) or POI (1):
10005 t = 1; \r
10006 }else if(type == "RP")\r
10007 {\r
46b94261 10008 /*
57340a27 10009 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!)) \r
10010 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))\r
10011 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));\r
10012 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))\r
10013 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));\r
10014 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))\r
10015 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));\r
10016 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))\r
10017 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));\r
10018 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation) \r
10019 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.); \r
10020 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.); \r
10021 s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.); \r
10022 \r
10023 // to be improved (cross-checked):\r
10024 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))\r
10025 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));\r
10026 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b)) \r
10027 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));\r
10028 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)\r
10029 // typeFlag = RP (0) or POI (1): \r
46b94261 10030 t = 0;
10031 */\r
57340a27 10032 } \r
10033 \r
46b94261 10034 // <<cos n(psi1)>>:\r
10035 Double_t cosP1nPsi = 0.;\r
10036 if(mp)\r
57340a27 10037 {\r
46b94261 10038 cosP1nPsi = p1n0kRe/mp;\r
57340a27 10039 \r
46b94261 10040 // fill profile for <<cos n(psi1)>>:\r
10041 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi,mp);\r
10042 // histogram to store <cos n(psi1)> e-b-e (needed in some other methods):\r
10043 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][0]->SetBinContent(b,cosP1nPsi);\r
10044 } // end of if(mp)
57340a27 10045
46b94261 10046 // <<w2 cos n(psi1+phi2)>>:\r
10047 Double_t cosP1nPsiP1nPhiW2 = 0.;\r
10048 if(dM01)\r
10049 {\r
10050 cosP1nPsiP1nPhiW2 = (p1n0kRe*dReQ1n1k-p1n0kIm*dImQ1n1k-q2n1kRe)/(dM01);\r
10051 // fill profile for <<w2 cos n(psi1+phi2)>>:\r
10052 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsiP1nPhiW2,dM01);\r
10053 // histogram to store <w2 cos n(psi1+phi2)> e-b-e (needed in some other methods):\r
10054 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][1]->SetBinContent(b,cosP1nPsiP1nPhiW2);\r
10055 } // end of if(dM01) \r
57340a27 10056
46b94261 10057 // <<w2 w3 cos n(psi1+phi2-phi3)>>:\r
10058 Double_t cosP1nPsi1P1nPhi2MPhi3W2W3 = 0.;\r
10059 if(dM011)\r
10060 {\r
10061 cosP1nPsi1P1nPhi2MPhi3W2W3 = (p1n0kRe*(pow(dImQ1n1k,2.)+pow(dReQ1n1k,2.))
10062 - p1n0kRe*dSM1p2k
10063 - q2n1kRe*dReQ1n1k-q2n1kIm*dImQ1n1k
10064 - s1p1k*dReQ1n1k
10065 + 2.*q1n2kRe)
10066 / dM011;
57340a27 10067 // fill profile for <<w1 w2 w3 cos n(psi1+phi2)>>:\r
46b94261 10068 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1P1nPhi2MPhi3W2W3,dM011);\r
57340a27 10069 // histogram to store <w1 w2 w3 cos n(psi1+phi2)> e-b-e (needed in some other methods):\r
46b94261 10070 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][2]->SetBinContent(b,cosP1nPsi1P1nPhi2MPhi3W2W3);\r
10071 } // end of if(dM011) \r
10072 \r
10073 // <<w2 w3 cos n(psi1-phi2-phi3)>>:\r
10074 Double_t cosP1nPsi1M1nPhi2MPhi3W2W3 = 0.;\r
10075 if(dM011)\r
10076 {\r
10077 cosP1nPsi1M1nPhi2MPhi3W2W3 = (p1n0kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))+2.*p1n0kIm*dReQ1n1k*dImQ1n1k\r
10078 - 1.*(p1n0kRe*dReQ2n2k+p1n0kIm*dImQ2n2k) \r
10079 - 2.*s1p1k*dReQ1n1k
10080 + 2.*q1n2kRe)\r
10081 / dM011;\r
57340a27 10082 // fill profile for <<w1 w2 w3 cos n(psi1+phi2)>>:\r
46b94261 10083 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1M1nPhi2MPhi3W2W3,dM011);\r
57340a27 10084 // histogram to store <w1 w2 w3 cos n(psi1+phi2)> e-b-e (needed in some other methods):\r
46b94261 10085 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][3]->SetBinContent(b,cosP1nPsi1M1nPhi2MPhi3W2W3);\r
10086 } // end of if(dM011) \r
57340a27 10087
10088 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
46b94261 10089
57340a27 10090} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights(TString type, TString ptOrEta)
10091
10092\r
10093//================================================================================================================================\r
10094\r
10095\r
10096void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights(TString type, TString ptOrEta)\r
10097{\r
10098 // Calculate correction terms for non-uniform acceptance for differential flow (sin terms).\r
10099
57340a27 10100 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][0][cti], where cti runs as follows:\r
10101 // 0: <<sin n(psi1)>>\r
46b94261 10102 // 1: <<w2 sin n(psi1+phi2)>>\r
10103 // 2: <<w2 w3 sin n(psi1+phi2-phi3)>>\r
10104 // 3: <<w2 w3 sin n(psi1-phi2-phi3)>>:\r
57340a27 10105 // 4:\r
10106 // 5:\r
10107 // 6:\r
57340a27 10108 \r
46b94261 10109 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n: \r
10110 Double_t dReQ1n1k = (*fReQ)(0,1);\r
10111 Double_t dReQ2n2k = (*fReQ)(1,2);\r
10112 //Double_t dReQ1n3k = (*fReQ)(0,3);\r
10113 //Double_t dReQ4n4k = (*fReQ)(3,4);\r
10114 Double_t dImQ1n1k = (*fImQ)(0,1);\r
10115 Double_t dImQ2n2k = (*fImQ)(1,2);\r
10116 //Double_t dImQ1n3k = (*fImQ)(0,3);\r
10117 //Double_t dImQ4n4k = (*fImQ)(3,4);\r
10118
10119 // S^M_{p,k} (see .h file for the definition of fSMpk):\r
10120 Double_t dSM1p1k = (*fSMpk)(0,1);\r
10121 Double_t dSM1p2k = (*fSMpk)(0,2);\r
10122 Double_t dSM2p1k = (*fSMpk)(1,1);\r
57340a27 10123\r
10124 Int_t t = -1; // type flag \r
10125 Int_t pe = -1; // ptEta flag\r
10126 \r
10127 if(type == "RP")\r
10128 {\r
10129 t = 0;\r
10130 } else if(type == "POI")\r
10131 {\r
10132 t = 1;\r
10133 }\r
10134\r
10135 if(ptOrEta == "Pt")\r
10136 {\r
10137 pe = 0;\r
10138 } else if(ptOrEta == "Eta")\r
10139 {\r
10140 pe = 1;\r
10141 }\r
10142 \r
10143 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
10144 Double_t minPtEta[2] = {fPtMin,fEtaMin};\r
10145 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};\r
10146 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};\r
10147\r
10148 // looping over all bins and calculating correction terms: \r
10149 for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
10150 {\r
10151 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin): \r
10152 Double_t p1n0kRe = 0.;\r
10153 Double_t p1n0kIm = 0.;\r
10154\r
10155 // number of POIs in particular pt or eta bin:\r
10156 Double_t mp = 0.;\r
10157\r
46b94261 10158 // real and imaginary parts of q_{m*n,0} (weighted Q-vector evaluated for particles which are both RPs and POIs in particular pt or eta bin):\r
10159 Double_t q1n2kRe = 0.;\r
10160 Double_t q1n2kIm = 0.;\r
10161 Double_t q2n1kRe = 0.;\r
10162 Double_t q2n1kIm = 0.;\r
10163
10164 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation) \r
10165 Double_t s1p1k = 0.; \r
10166 Double_t s1p2k = 0.; \r
10167
57340a27 10168 // number of particles which are both RPs and POIs in particular pt or eta bin:\r
46b94261 10169 Double_t mq = 0.;
10170 \r
10171 // M0111 from Eq. (118) in QC2c (to be improved (notation))\r
10172 Double_t dM01 = 0.;\r
10173 Double_t dM011 = 0.;\r
10174\r
57340a27 10175 if(type == "POI")\r
10176 {\r
46b94261 10177 // p_{m*n,k}:
57340a27 10178 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))\r
10179 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));\r
10180 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b)) \r
46b94261 10181 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
10182 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here) \r
10183 // q_{m*n,k}:\r
10184 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))\r
10185 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));\r
10186 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))\r
10187 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b)); \r
10188 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))\r
10189 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));\r
10190 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))\r
10191 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b)); \r
10192 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)\r
10193
10194 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.); \r
10195 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.); \r
10196
10197 // M01 from Eq. (118) in QC2c (to be improved (notation)):\r
10198 dM01 = mp*dSM1p1k-s1p1k;
10199 dM011 = mp*(dSM2p1k-dSM1p2k)
10200 - 2.*(s1p1k*dSM1p1k-s1p2k);
10201
10202 // typeFlag = RP (0) or POI (1):
10203 t = 1; \r
10204 }else if(type == "RP")\r
10205 {\r
10206 /*
10207 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!)) \r
10208 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))\r
10209 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));\r
10210 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))\r
10211 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));\r
10212 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))\r
10213 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));\r
10214 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))\r
10215 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));\r
10216 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation) \r
10217 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.); \r
10218 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.); \r
10219 s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.); \r
57340a27 10220 \r
46b94261 10221 // to be improved (cross-checked):\r
10222 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))\r
10223 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));\r
10224 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b)) \r
10225 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));\r
10226 mp = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)\r
10227 // typeFlag = RP (0) or POI (1): \r
10228 t = 0;
10229 */\r
10230 } \r
10231 \r
57340a27 10232 // <<sin n(psi1)>>:\r
10233 Double_t sinP1nPsi = 0.;\r
10234 if(mp)\r
10235 {\r
10236 sinP1nPsi = p1n0kIm/mp;\r
46b94261 10237 \r
57340a27 10238 // fill profile for <<sin n(psi1)>>:\r
10239 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi,mp);\r
10240 // histogram to store <sin n(psi1)> e-b-e (needed in some other methods):\r
10241 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][0]->SetBinContent(b,sinP1nPsi);\r
46b94261 10242 } // end of if(mp)
10243
10244 // <<w2 sin n(psi1+phi2)>>:\r
10245 Double_t sinP1nPsiP1nPhiW2 = 0.;\r
10246 if(dM01)\r
10247 {\r
10248 sinP1nPsiP1nPhiW2 = (p1n0kRe*dImQ1n1k+p1n0kIm*dReQ1n1k-q2n1kIm)/(dM01);\r
10249 // fill profile for <<w2 sin n(psi1+phi2)>>:\r
10250 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsiP1nPhiW2,dM01);\r
10251 // histogram to store <w2 sin n(psi1+phi2)> e-b-e (needed in some other methods):\r
10252 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][1]->SetBinContent(b,sinP1nPsiP1nPhiW2);\r
57340a27 10253 } // end of if(mp*dMult-mq) \r
46b94261 10254
10255 // <<w2 w3 sin n(psi1+phi2-phi3)>>:\r
10256 Double_t sinP1nPsi1P1nPhi2MPhi3W2W3 = 0.;\r
10257 if(dM011)\r
10258 {\r
10259 sinP1nPsi1P1nPhi2MPhi3W2W3 = (p1n0kIm*(pow(dImQ1n1k,2.)+pow(dReQ1n1k,2.))
10260 - p1n0kIm*dSM1p2k
10261 + q2n1kRe*dImQ1n1k-q2n1kIm*dReQ1n1k
10262 - s1p1k*dImQ1n1k
10263 + 2.*q1n2kIm)
10264 / dM011;
10265 // fill profile for <<w2 w3 sin n(psi1+phi2-phi3)>>:\r
10266 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1P1nPhi2MPhi3W2W3,dM011);\r
10267 // histogram to store <w2 w3 sin n(psi1+phi2-phi3)> e-b-e (needed in some other methods):\r
10268 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][2]->SetBinContent(b,sinP1nPsi1P1nPhi2MPhi3W2W3);\r
10269 } // end of if(dM011) \r
10270
10271 // <<w2 w3 sin n(psi1-phi2-phi3)>>:\r
10272 Double_t sinP1nPsi1M1nPhi2MPhi3W2W3 = 0.;\r
10273 if(dM011)\r
10274 {\r
10275 sinP1nPsi1M1nPhi2MPhi3W2W3 = (p1n0kIm*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))-2.*p1n0kRe*dReQ1n1k*dImQ1n1k\r
10276 + 1.*(p1n0kRe*dImQ2n2k-p1n0kIm*dReQ2n2k) \r
10277 + 2.*s1p1k*dImQ1n1k
10278 - 2.*q1n2kIm)\r
10279 / dM011;\r
10280 // fill profile for <<w2 w3 sin n(psi1-phi2-phi3)>>:\r
10281 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1M1nPhi2MPhi3W2W3,dM011);\r
10282 // histogram to store <w2 w3 sin n(psi1-phi2-phi3)> e-b-e (needed in some other methods):\r
10283 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][3]->SetBinContent(b,sinP1nPsi1M1nPhi2MPhi3W2W3);\r
10284 } // end of if(dM011) \r
10285
57340a27 10286 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
57340a27 10287
10288} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights(TString type, TString ptOrEta)\r
10289\r
10290\r
10291//================================================================================================================================\r
10292\r
10293 \r
10294void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)\r
10295{\r
10296 // Evaluate with nested loops correction terms for non-uniform acceptance
10297 // with using particle weights (both sin and cos terms) relevant for differential flow.\r
10298 \r
57340a27 10299 // Remark 1: "w1" in expressions bellow is a particle weight used only for particles which were
10300 // flagged both as POI and RP.
10301 // Remark 2: Reduced correction terms for non-uniform acceptance are evaluated in pt bin number fCrossCheckInPtBinNo \r
10302 // and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.\r
10303 // Remark 3: Results are stored in 1 bin profiles fDiffFlowDirectCorrections[t][pe][sc][cti], where first three indices runs as: \r
10304 // [0=RP,1=POI][0=Pt,1=Eta][0=sin terms,1=cos terms], whilst the cti (correction term index) runs as follows: \r
10305 // cti: \r
46b94261 10306 // 0: <<sc n(psi1)>>\r
10307 // 1: <<w2 sc n(psi1+phi2)>> \r
10308 // 2: <<w2 w3 sc n(psi1+phi2-phi3)>>\r
10309 // 3: <<w2 w3 sc n(psi1-phi2-phi3)>>\r
57340a27 10310 // 4:\r
10311 // 5:\r
10312 // 6:\r
46b94261 10313
57340a27 10314 Int_t typeFlag = -1;\r
10315 Int_t ptEtaFlag = -1;\r
10316 if(type == "RP")\r
10317 {\r
10318 typeFlag = 0;\r
10319 } else if(type == "POI")\r
10320 {\r
10321 typeFlag = 1;\r
10322 } \r
10323 if(ptOrEta == "Pt")\r
10324 {\r
10325 ptEtaFlag = 0;\r
10326 } else if(ptOrEta == "Eta")\r
10327 {\r
10328 ptEtaFlag = 1;\r
10329 } \r
10330 // shortcuts:\r
10331 Int_t t = typeFlag;\r
10332 Int_t pe = ptEtaFlag;\r
10333 \r
10334 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};\r
10335 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};\r
10336 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};\r
10337 \r
10338 Int_t nPrim = anEvent->NumberOfTracks(); \r
10339 AliFlowTrackSimple *aftsTrack = NULL;\r
10340 \r
10341 Double_t psi1=0., phi2=0., phi3=0.;// phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;\r
46b94261 10342 Double_t wPhi2=1., wPhi3=1.;\r
10343
57340a27 10344 Int_t n = fHarmonic; \r
10345 \r
46b94261 10346 // 1'-particle correction terms:\r
57340a27 10347 for(Int_t i1=0;i1<nPrim;i1++)\r
10348 {\r
10349 aftsTrack=anEvent->GetTrack(i1);\r
10350 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)\r
10351 if(ptOrEta == "Pt")\r
10352 { \r
10353 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection()))) continue;\r
10354 } else if (ptOrEta == "Eta")\r
10355 {\r
10356 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection()))) continue; \r
10357 }\r
10358 psi1=aftsTrack->Phi(); \r
10359 // sin terms: \r
10360 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*psi1),1.); // <<sin(n*(psi1))>> \r
10361 // cos terms: \r
10362 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*psi1),1.); // <<cos(n*(psi1))>> \r
10363 }//end of for(Int_t i1=0;i1<nPrim;i1++)\r
10364 \r
46b94261 10365 // 2'-particle correction terms:\r
57340a27 10366 for(Int_t i1=0;i1<nPrim;i1++)\r
10367 {\r
10368 aftsTrack=anEvent->GetTrack(i1);\r
10369 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)\r
10370 if(ptOrEta == "Pt")\r
10371 { \r
10372 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection()))) continue;\r
10373 } else if (ptOrEta == "Eta")\r
10374 {\r
10375 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection()))) continue; \r
10376 }\r
10377 psi1=aftsTrack->Phi(); \r
10378 for(Int_t i2=0;i2<nPrim;i2++)\r
10379 {\r
10380 if(i2==i1) continue;\r
10381 aftsTrack=anEvent->GetTrack(i2);\r
10382 // RP condition (!(first) particle in the correlator must be RP):\r
10383 if(!(aftsTrack->InRPSelection())) continue;\r
46b94261 10384 phi2=aftsTrack->Phi();
10385 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi()))); \r
57340a27 10386 // sin terms: \r
46b94261 10387 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2)),wPhi2); // <<w2 sin(n*(psi1+phi2))>> \r
57340a27 10388 // cos terms: \r
46b94261 10389 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2)),wPhi2); // <<w2 cos(n*(psi1+phi2))>> \r
57340a27 10390 }//end of for(Int_t i2=0;i2<nPrim;i2++)\r
10391 }//end of for(Int_t i1=0;i1<nPrim;i1++) \r
10392 \r
46b94261 10393 // 3'-particle correction terms:\r
57340a27 10394 for(Int_t i1=0;i1<nPrim;i1++)\r
10395 {\r
10396 aftsTrack=anEvent->GetTrack(i1);\r
10397 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)\r
10398 if(ptOrEta == "Pt")\r
10399 { \r
10400 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;\r
10401 } else if (ptOrEta == "Eta")\r
10402 {\r
10403 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue; \r
10404 }\r
10405 psi1=aftsTrack->Phi();\r
10406 for(Int_t i2=0;i2<nPrim;i2++)\r
10407 {\r
10408 if(i2==i1) continue;\r
10409 aftsTrack=anEvent->GetTrack(i2);\r
10410 // RP condition (!(first) particle in the correlator must be RP):\r
10411 if(!(aftsTrack->InRPSelection())) continue;\r
10412 phi2=aftsTrack->Phi();\r
46b94261 10413 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi()))); \r
57340a27 10414 for(Int_t i3=0;i3<nPrim;i3++)\r
10415 {\r
10416 if(i3==i1||i3==i2) continue;\r
10417 aftsTrack=anEvent->GetTrack(i3);\r
10418 // RP condition (!(first) particle in the correlator must be RP):\r
10419 if(!(aftsTrack->InRPSelection())) continue;\r
10420 phi3=aftsTrack->Phi();\r
46b94261 10421 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi()))); \r
57340a27 10422 // sin terms: \r
46b94261 10423 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][2]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2-phi3)),wPhi2*wPhi3); // <<wPhi2*wPhi3 sin(n*(psi1+phi2-phi3))>> \r
10424 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][3]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1-phi2-phi3)),wPhi2*wPhi3); // <<wPhi2*wPhi3 sin(n*(psi1-phi2-phi3))>> \r
57340a27 10425 // cos terms: \r
46b94261 10426 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][2]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3)),wPhi2*wPhi3); // <<wPhi2*wPhi3 cos(n*(psi1+phi2-phi3))>> \r
10427 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][3]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1-phi2-phi3)),wPhi2*wPhi3); // <<wPhi2*wPhi3 cos(n*(psi1-phi2-phi3))>> \r
57340a27 10428 }//end of for(Int_t i3=0;i3<nPrim;i3++) \r
10429 }//end of for(Int_t i2=0;i2<nPrim;i2++) \r
46b94261 10430 }//end of for(Int_t i1=0;i1<nPrim;i1++)
57340a27 10431 \r
10432} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)\r
10433\r
10434\r
10435
10436
10437