]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithQCumulants.cxx
Remove QA reference from EMCAL directory, already available in QAref/EMCAL
[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
3b552efe 152 fCrossCheckInEtaBinNo(20),
153 fNoOfParticlesInBin(NULL)\r
a5b7efd0 154 {\r
155 // constructor \r
156 \r
157 // base list to hold all output objects:\r
158 fHistList = new TList();\r
159 fHistList->SetName("cobjQC");\r
160 fHistList->SetOwner(kTRUE);\r
161 \r
162 // list to hold histograms with phi, pt and eta weights: \r
163 fWeightsList = new TList();\r
164 \r
165 // multiplicity weight:\r
166 fMultiplicityWeight = new TString("combinations");\r
167 \r
168 // analysis label;\r
169 fAnalysisLabel = new TString();\r
170 \r
171 // initialize all arrays: \r
172 this->InitializeArraysForIntFlow();\r
173 this->InitializeArraysForDiffFlow();\r
174 this->InitializeArraysForDistributions();\r
175 this->InitializeArraysForNestedLoops();\r
176 \r
177 } // end of constructor\r
178 \r
179\r
180//================================================================================================================ \r
181\r
182\r
183AliFlowAnalysisWithQCumulants::~AliFlowAnalysisWithQCumulants()\r
184{\r
185 // destructor\r
186 \r
187 delete fHistList;\r
188\r
189} // end of AliFlowAnalysisWithQCumulants::~AliFlowAnalysisWithQCumulants()\r
190\r
191\r
192//================================================================================================================\r
193\r
194\r
195void AliFlowAnalysisWithQCumulants::Init()\r
196{\r
3b552efe 197 // a) Cross check if the settings make sense before starting the QC adventure;
198 // b) Access all common constants;\r
199 // c) Book all objects;\r
200 // d) Store flags for integrated and differential flow;
201 // e) Store flags for distributions of corelations;\r
202 // f) Store harmonic which will be estimated.\r
203
204 // a) Cross check if the settings make sense before starting the QC adventure;
205 this->CrossCheckSettings();\r
206 // b) Access all common constants:\r
a5b7efd0 207 this->AccessConstants();\r
3b552efe 208 // c) Book all objects:\r
a5b7efd0 209 this->BookAndFillWeightsHistograms();\r
210 this->BookAndNestAllLists();\r
211 this->BookCommonHistograms();\r
212 this->BookEverythingForIntegratedFlow(); \r
213 this->BookEverythingForDifferentialFlow(); \r
214 this->BookEverythingForDistributions();\r
215 this->BookEverythingForNestedLoops();\r
3b552efe 216 // d) Store flags for integrated and differential flow:\r
a5b7efd0 217 this->StoreIntFlowFlags();\r
3b552efe 218 this->StoreDiffFlowFlags();
219 // e) Store flags for distributions of corelations:\r
57340a27 220 this->StoreFlagsForDistributions();\r
3b552efe 221 // f) 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
3b552efe 658 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"RP","Pt"); \r
659 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"RP","Eta"); \r
660 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"POI","Pt"); \r
661 this->EvaluateDiffFlowCorrelationsWithNestedLoops(anEvent,"POI","Eta"); \r
a5b7efd0 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
3b552efe 673 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"RP","Pt");\r
674 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"RP","Eta");\r
675 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"POI","Pt"); \r
676 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(anEvent,"POI","Eta"); \r
a5b7efd0 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
3b552efe 693 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"RP","Pt"); \r
694 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"RP","Eta");\r
695 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"POI","Pt"); \r
696 this->EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(anEvent,"POI","Eta");
697 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"RP","Pt"); \r
698 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"RP","Eta"); \r
699 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"POI","Pt"); \r
700 this->EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(anEvent,"POI","Eta"); \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
3b552efe 742 fApplyCorrectionForNUA = (Int_t)fIntFlowFlags->GetBinContent(3);
743 fPrintFinalResults[0] = (Int_t)fIntFlowFlags->GetBinContent(4);\r
744 fPrintFinalResults[1] = (Int_t)fIntFlowFlags->GetBinContent(5);\r
745 fPrintFinalResults[2] = (Int_t)fIntFlowFlags->GetBinContent(6);\r
a5b7efd0 746 fEvaluateIntFlowNestedLoops = (Int_t)fEvaluateNestedLoops->GetBinContent(1);\r
747 fEvaluateDiffFlowNestedLoops = (Int_t)fEvaluateNestedLoops->GetBinContent(2); \r
748 fCrossCheckInPtBinNo = (Int_t)fEvaluateNestedLoops->GetBinContent(3);\r
749 fCrossCheckInEtaBinNo = (Int_t)fEvaluateNestedLoops->GetBinContent(4); \r
750 \r
751 // *********************************************************\r
752 // **** CALCULATE THE FINAL RESULTS FOR INTEGRATED FLOW ****\r
753 // ********************************************************* \r
754 \r
755 this->FinalizeCorrelationsIntFlow();\r
756 this->CalculateCovariancesIntFlow();\r
757 this->CalculateCumulantsIntFlow();\r
758 this->CalculateIntFlow(); \r
759\r
46b94261 760 if(fApplyCorrectionForNUA) // to be improved (reorganized, etc)\r
a5b7efd0 761 {\r
762 this->FinalizeCorrectionTermsForNUAIntFlow();\r
763 this->CalculateQcumulantsCorrectedForNUAIntFlow(); \r
764 this->CalculateIntFlowCorrectedForNUA(); \r
765 }\r
766 \r
767 // ***************************************************************\r
768 // **** STORE AND PRINT THE FINAL RESULTS FOR INTEGRATED FLOW ****\r
769 // ***************************************************************\r
770 \r
771 this->FillCommonHistResultsIntFlow(); \r
772 \r
3b552efe 773 if(fPrintFinalResults[0])
774 {
775 this->PrintFinalResultsForIntegratedFlow("NONAME"); // to be improved (name)\r
776 }
a5b7efd0 777 \r
778 // ***********************************************************\r
779 // **** CALCULATE THE FINAL RESULTS FOR DIFFERENTIAL FLOW ****\r
780 // *********************************************************** \r
781 \r
782 this->FinalizeReducedCorrelations("RP","Pt"); \r
783 this->FinalizeReducedCorrelations("RP","Eta"); \r
784 this->FinalizeReducedCorrelations("POI","Pt"); \r
785 this->FinalizeReducedCorrelations("POI","Eta");\r
786 this->CalculateDiffFlowCovariances("RP","Pt");\r
787 this->CalculateDiffFlowCovariances("RP","Eta");\r
788 this->CalculateDiffFlowCovariances("POI","Pt");\r
789 this->CalculateDiffFlowCovariances("POI","Eta");\r
790 this->CalculateDiffFlowCumulants("RP","Pt");\r
791 this->CalculateDiffFlowCumulants("RP","Eta");\r
792 this->CalculateDiffFlowCumulants("POI","Pt");\r
793 this->CalculateDiffFlowCumulants("POI","Eta");\r
794 this->CalculateDiffFlow("RP","Pt");\r
795 this->CalculateDiffFlow("RP","Eta");\r
796 this->CalculateDiffFlow("POI","Pt");\r
797 this->CalculateDiffFlow("POI","Eta");\r
798 \r
46b94261 799 if(fApplyCorrectionForNUA) // to be improved (reorganized, etc)\r
a5b7efd0 800 {\r
801 this->FinalizeCorrectionTermsForNUADiffFlow("RP","Pt");\r
802 this->FinalizeCorrectionTermsForNUADiffFlow("RP","Eta");\r
803 this->FinalizeCorrectionTermsForNUADiffFlow("POI","Pt");\r
804 this->FinalizeCorrectionTermsForNUADiffFlow("POI","Eta"); \r
805 this->CalculateDiffFlowCumulantsCorrectedForNUA("RP","Pt"); \r
806 this->CalculateDiffFlowCumulantsCorrectedForNUA("RP","Eta"); \r
807 this->CalculateDiffFlowCumulantsCorrectedForNUA("POI","Pt"); \r
808 this->CalculateDiffFlowCumulantsCorrectedForNUA("POI","Eta"); \r
809 this->CalculateDiffFlowCorrectedForNUA("RP","Pt"); \r
810 this->CalculateDiffFlowCorrectedForNUA("RP","Eta"); \r
811 this->CalculateDiffFlowCorrectedForNUA("POI","Pt"); \r
812 this->CalculateDiffFlowCorrectedForNUA("POI","Eta"); \r
813 }\r
814 \r
815 this->CalculateFinalResultsForRPandPOIIntegratedFlow("RP");\r
816 this->CalculateFinalResultsForRPandPOIIntegratedFlow("POI");\r
817\r
818 // *****************************************************************\r
819 // **** STORE AND PRINT THE FINAL RESULTS FOR DIFFERENTIAL FLOW ****\r
820 // *****************************************************************\r
821 this->FillCommonHistResultsDiffFlow("RP");\r
822 this->FillCommonHistResultsDiffFlow("POI");\r
823\r
3b552efe 824 if(fPrintFinalResults[1])
825 {
826 this->PrintFinalResultsForIntegratedFlow("RP"); \r
827 }
828 if(fPrintFinalResults[2])
829 {
830 this->PrintFinalResultsForIntegratedFlow("POI"); \r
831 } \r
a5b7efd0 832 // g) cross-check the results: results from Q-vectors vs results from nested loops\r
57340a27 833
a5b7efd0 834 // g1) integrated flow:\r
835 if(fEvaluateIntFlowNestedLoops)\r
836 {\r
57340a27 837 this->CrossCheckIntFlowCorrelations();\r
838 this->CrossCheckIntFlowCorrectionTermsForNUA(); \r
839 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights) this->CrossCheckIntFlowExtraCorrelations(); \r
a5b7efd0 840 } // end of if(fEvaluateIntFlowNestedLoops) \r
57340a27 841
a5b7efd0 842 // g2) differential flow: \r
843 if(fEvaluateDiffFlowNestedLoops) \r
844 {\r
3b552efe 845 // correlations:
846 this->PrintNumberOfParticlesInSelectedBin();\r
847 this->CrossCheckDiffFlowCorrelations("RP","Pt"); \r
848 this->CrossCheckDiffFlowCorrelations("RP","Eta"); \r
a5b7efd0 849 this->CrossCheckDiffFlowCorrelations("POI","Pt"); \r
850 this->CrossCheckDiffFlowCorrelations("POI","Eta");\r
851 // correction terms for non-uniform acceptance:\r
3b552efe 852 this->CrossCheckDiffFlowCorrectionTermsForNUA("RP","Pt"); \r
853 this->CrossCheckDiffFlowCorrectionTermsForNUA("RP","Eta"); \r
46b94261 854 this->CrossCheckDiffFlowCorrectionTermsForNUA("POI","Pt"); \r
855 this->CrossCheckDiffFlowCorrectionTermsForNUA("POI","Eta"); \r
a5b7efd0 856 } // end of if(fEvaluateDiffFlowNestedLoops)\r
857 \r
858} // end of AliFlowAnalysisWithQCumulants::Finish()\r
859\r
860\r
861//================================================================================================================================\r
862\r
863\r
864void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTerms()\r
865{\r
866 // calculate corrections for non-uniform acceptance of the detector for no-name integrated flow (cos terms)\r
867 \r
868 // multiplicity:\r
869 Double_t dMult = (*fSMpk)(0,0);\r
870 \r
871 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n: \r
872 Double_t dReQ1n = (*fReQ)(0,0);\r
873 Double_t dReQ2n = (*fReQ)(1,0);\r
874 //Double_t dReQ3n = (*fReQ)(2,0);\r
875 //Double_t dReQ4n = (*fReQ)(3,0);\r
876 Double_t dImQ1n = (*fImQ)(0,0);\r
877 Double_t dImQ2n = (*fImQ)(1,0);\r
878 //Double_t dImQ3n = (*fImQ)(2,0);\r
879 //Double_t dImQ4n = (*fImQ)(3,0);\r
880 \r
881 // *************************************************************\r
882 // **** corrections for non-uniform acceptance (cos terms): ****\r
883 // *************************************************************\r
884 //\r
885 // Remark 1: corrections for non-uniform acceptance (cos terms) calculated with non-weighted Q-vectors \r
886 // are stored in 1D profile fQCorrectionsCos.\r
887 // Remark 2: binning of fIntFlowCorrectionTermsForNUAPro[1] is organized as follows:\r
888 // --------------------------------------------------------------------------------------------------------------------\r
889 // 1st bin: <<cos(n*(phi1))>> = cosP1n\r
890 // 2nd bin: <<cos(n*(phi1+phi2))>> = cosP1nP1n\r
891 // 3rd bin: <<cos(n*(phi1-phi2-phi3))>> = cosP1nM1nM1n\r
3b552efe 892 // 4th bin: <<cos(n*(2phi1-phi2))>> = cosP2nM1n\r
a5b7efd0 893 // --------------------------------------------------------------------------------------------------------------------\r
894 \r
895 // 1-particle:\r
896 Double_t cosP1n = 0.; // <<cos(n*(phi1))>>\r
897 \r
898 if(dMult>0)\r
899 {\r
900 cosP1n = dReQ1n/dMult; \r
901 \r
902 // average non-weighted 1-particle correction (cos terms) for non-uniform acceptance for single event:\r
903 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(1,cosP1n);\r
904 \r
905 // final average non-weighted 1-particle correction (cos terms) for non-uniform acceptance for all events:\r
906 fIntFlowCorrectionTermsForNUAPro[1]->Fill(0.5,cosP1n,dMult); \r
907 } \r
908 \r
909 // 2-particle:\r
3b552efe 910 Double_t cosP1nP1n = 0.; // <<cos(n*(phi1+phi2))>>
911 Double_t cosP2nM1n = 0.; // <<cos(n*(2phi1-phi2))>>\r
a5b7efd0 912 \r
913 if(dMult>1)\r
914 {\r
915 cosP1nP1n = (pow(dReQ1n,2)-pow(dImQ1n,2)-dReQ2n)/(dMult*(dMult-1)); \r
3b552efe 916 cosP2nM1n = (dReQ2n*dReQ1n+dImQ2n*dImQ1n-dReQ1n)/(dMult*(dMult-1)); \r
a5b7efd0 917 \r
918 // average non-weighted 2-particle correction (cos terms) for non-uniform acceptance for single event:\r
3b552efe 919 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(2,cosP1nP1n);
920 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(4,cosP2nM1n);\r
a5b7efd0 921 \r
922 // final average non-weighted 2-particle correction (cos terms) for non-uniform acceptance for all events:\r
3b552efe 923 fIntFlowCorrectionTermsForNUAPro[1]->Fill(1.5,cosP1nP1n,dMult*(dMult-1));
924 fIntFlowCorrectionTermsForNUAPro[1]->Fill(3.5,cosP2nM1n,dMult*(dMult-1));\r
a5b7efd0 925 } \r
926 \r
927 // 3-particle:\r
928 Double_t cosP1nM1nM1n = 0.; // <<cos(n*(phi1-phi2-phi3))>>\r
929 \r
930 if(dMult>2)\r
931 {\r
932 cosP1nM1nM1n = (dReQ1n*(pow(dReQ1n,2)+pow(dImQ1n,2))-dReQ1n*dReQ2n-dImQ1n*dImQ2n-2.*(dMult-1)*dReQ1n)\r
933 / (dMult*(dMult-1)*(dMult-2)); \r
934 \r
935 // average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for single event:\r
936 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(3,cosP1nM1nM1n);\r
937 \r
938 // final average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for all events:\r
939 fIntFlowCorrectionTermsForNUAPro[1]->Fill(2.5,cosP1nM1nM1n,dMult*(dMult-1)*(dMult-2)); \r
940 } \r
941 \r
942} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTerms()\r
943\r
944\r
945//================================================================================================================================\r
946\r
947\r
948void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTerms()\r
949{\r
950 // calculate corrections for non-uniform acceptance of the detector for no-name integrated flow (sin terms)\r
951 \r
952 // multiplicity:\r
953 Double_t dMult = (*fSMpk)(0,0);\r
954 \r
955 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n: \r
956 Double_t dReQ1n = (*fReQ)(0,0);\r
957 Double_t dReQ2n = (*fReQ)(1,0);\r
958 //Double_t dReQ3n = (*fReQ)(2,0);\r
959 //Double_t dReQ4n = (*fReQ)(3,0);\r
960 Double_t dImQ1n = (*fImQ)(0,0);\r
961 Double_t dImQ2n = (*fImQ)(1,0);\r
962 //Double_t dImQ3n = (*fImQ)(2,0);\r
963 //Double_t dImQ4n = (*fImQ)(3,0);\r
964 \r
965 // *************************************************************\r
966 // **** corrections for non-uniform acceptance (sin terms): ****\r
967 // *************************************************************\r
968 //\r
969 // Remark 1: corrections for non-uniform acceptance (sin terms) calculated with non-weighted Q-vectors \r
970 // are stored in 1D profile fQCorrectionsSin.\r
971 // Remark 2: binning of fIntFlowCorrectionTermsForNUAPro[0] is organized as follows:\r
972 // --------------------------------------------------------------------------------------------------------------------\r
973 // 1st bin: <<sin(n*(phi1))>> = sinP1n\r
974 // 2nd bin: <<sin(n*(phi1+phi2))>> = sinP1nP1n\r
975 // 3rd bin: <<sin(n*(phi1-phi2-phi3))>> = sinP1nM1nM1n\r
3b552efe 976 // 4th bin: <<sin(n*(2phi1-phi2))>> = sinP2nM1n\r
a5b7efd0 977 // --------------------------------------------------------------------------------------------------------------------\r
978 \r
979 // 1-particle:\r
980 Double_t sinP1n = 0.; // <sin(n*(phi1))>\r
981 \r
982 if(dMult>0)\r
983 {\r
984 sinP1n = dImQ1n/dMult; \r
985 \r
986 // average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for single event:\r
987 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(1,sinP1n);\r
988 \r
989 // final average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for all events: \r
990 fIntFlowCorrectionTermsForNUAPro[0]->Fill(0.5,sinP1n,dMult); \r
991 } \r
992 \r
993 // 2-particle:\r
994 Double_t sinP1nP1n = 0.; // <<sin(n*(phi1+phi2))>>\r
3b552efe 995 Double_t sinP2nM1n = 0.; // <<sin(n*(2phi1-phi2))>>\r
a5b7efd0 996 if(dMult>1)\r
997 {\r
3b552efe 998 sinP1nP1n = (2.*dReQ1n*dImQ1n-dImQ2n)/(dMult*(dMult-1));
999 sinP2nM1n = (dImQ2n*dReQ1n-dReQ2n*dImQ1n-dImQ1n)/(dMult*(dMult-1)); \r
a5b7efd0 1000 \r
1001 // average non-weighted 2-particle correction (sin terms) for non-uniform acceptance for single event:\r
1002 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(2,sinP1nP1n);\r
3b552efe 1003 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(4,sinP2nM1n);
a5b7efd0 1004 \r
1005 // final average non-weighted 1-particle correction (sin terms) for non-uniform acceptance for all events: \r
1006 fIntFlowCorrectionTermsForNUAPro[0]->Fill(1.5,sinP1nP1n,dMult*(dMult-1)); \r
3b552efe 1007 fIntFlowCorrectionTermsForNUAPro[0]->Fill(3.5,sinP2nM1n,dMult*(dMult-1)); \r
a5b7efd0 1008 } \r
1009 \r
1010 // 3-particle:\r
1011 Double_t sinP1nM1nM1n = 0.; // <<sin(n*(phi1-phi2-phi3))>>\r
1012 \r
1013 if(dMult>2)\r
1014 {\r
1015 sinP1nM1nM1n = (-dImQ1n*(pow(dReQ1n,2)+pow(dImQ1n,2))+dReQ1n*dImQ2n-dImQ1n*dReQ2n+2.*(dMult-1)*dImQ1n)\r
1016 / (dMult*(dMult-1)*(dMult-2)); \r
1017 \r
1018 // average non-weighted 3-particle correction (sin terms) for non-uniform acceptance for single event:\r
1019 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(3,sinP1nM1nM1n);\r
1020 \r
1021 // final average non-weighted 3-particle correction (sin terms) for non-uniform acceptance for all events: \r
1022 fIntFlowCorrectionTermsForNUAPro[0]->Fill(2.5,sinP1nM1nM1n,dMult*(dMult-1)*(dMult-2)); \r
1023 } \r
1024 \r
1025} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTerms()\r
1026\r
1027\r
1028//================================================================================================================================\r
1029\r
1030\r
1031void AliFlowAnalysisWithQCumulants::GetOutputHistograms(TList *outputListHistos)\r
1032{\r
1033 // a) Get pointers for common control and common result histograms and profiles.\r
1034 // b) Get pointers for histograms with particle weights.\r
1035 // c) Get pointers for histograms and profiles relevant for integrated flow.\r
1036 // d) Get pointers for histograms and profiles relevant for differental flow.\r
1037 // e) Get pointers for histograms and profiles holding results obtained with nested loops.\r
1038 \r
1039 if(outputListHistos)\r
3b552efe 1040 {
1041 this->SetHistList(outputListHistos);
1042 if(!fHistList)
1043 {
1044 cout<<endl;
1045 cout<<" WARNING (QC): fHistList is NULL in AFAWQC::GOH() !!!!"<<endl;
1046 cout<<endl;
1047 exit(0);
1048 }\r
1049 this->GetPointersForCommonHistograms(); \r
1050 this->GetPointersForParticleWeightsHistograms(); \r
1051 this->GetPointersForIntFlowHistograms();\r
1052 this->GetPointersForDiffFlowHistograms(); \r
1053 this->GetPointersForNestedLoopsHistograms(); \r
1054 } else
1055 {
1056 cout<<endl;
1057 cout<<" WARNING (QC): outputListHistos is NULL in AFAWQC::GOH() !!!!"<<endl;
1058 cout<<endl;
1059 exit(0);
1060 }\r
a5b7efd0 1061 \r
1062} // end of void AliFlowAnalysisWithQCumulants::GetOutputHistograms(TList *outputListHistos)\r
1063\r
1064\r
1065//================================================================================================================================\r
1066\r
1067\r
1068TProfile* AliFlowAnalysisWithQCumulants::MakePtProjection(TProfile2D *profilePtEta) const\r
1069{\r
1070 // project 2D profile onto pt axis to get 1D profile\r
1071 \r
1072 Int_t nBinsPt = profilePtEta->GetNbinsX();\r
1073 Double_t dPtMin = (profilePtEta->GetXaxis())->GetXmin();\r
1074 Double_t dPtMax = (profilePtEta->GetXaxis())->GetXmax();\r
1075 \r
1076 Int_t nBinsEta = profilePtEta->GetNbinsY();\r
1077 \r
1078 TProfile *profilePt = new TProfile("","",nBinsPt,dPtMin,dPtMax); \r
1079 \r
1080 for(Int_t p=1;p<=nBinsPt;p++)\r
1081 {\r
1082 Double_t contentPt = 0.;\r
1083 Double_t entryPt = 0.;\r
1084 Double_t spreadPt = 0.;\r
1085 Double_t sum1 = 0.;\r
1086 Double_t sum2 = 0.;\r
1087 Double_t sum3 = 0.;\r
1088 for(Int_t e=1;e<=nBinsEta;e++)\r
1089 {\r
1090 contentPt += (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)))\r
1091 * (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));\r
1092 entryPt += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));\r
1093 \r
1094 sum1 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)))\r
1095 * (pow(profilePtEta->GetBinError(profilePtEta->GetBin(p,e)),2.)\r
1096 + pow(profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)),2.)); \r
1097 sum2 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));\r
1098 sum3 += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)))\r
1099 * (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e))); \r
1100 }\r
1101 if(sum2>0. && sum1/sum2-pow(sum3/sum2,2.) > 0.)\r
1102 {\r
1103 spreadPt = pow(sum1/sum2-pow(sum3/sum2,2.),0.5);\r
1104 }\r
1105 profilePt->SetBinContent(p,contentPt);\r
1106 profilePt->SetBinEntries(p,entryPt);\r
1107 {\r
1108 profilePt->SetBinError(p,spreadPt);\r
1109 }\r
1110 \r
1111 }\r
1112 \r
1113 return profilePt;\r
1114 \r
1115} // end of TProfile* AliFlowAnalysisWithQCumulants::MakePtProjection(TProfile2D *profilePtEta)\r
1116\r
1117\r
1118//================================================================================================================================\r
1119\r
1120\r
1121TProfile* AliFlowAnalysisWithQCumulants::MakeEtaProjection(TProfile2D *profilePtEta) const\r
1122{\r
1123 // project 2D profile onto eta axis to get 1D profile\r
1124 \r
1125 Int_t nBinsEta = profilePtEta->GetNbinsY();\r
1126 Double_t dEtaMin = (profilePtEta->GetYaxis())->GetXmin();\r
1127 Double_t dEtaMax = (profilePtEta->GetYaxis())->GetXmax();\r
1128 \r
1129 Int_t nBinsPt = profilePtEta->GetNbinsX();\r
1130 \r
1131 TProfile *profileEta = new TProfile("","",nBinsEta,dEtaMin,dEtaMax); \r
1132 \r
1133 for(Int_t e=1;e<=nBinsEta;e++)\r
1134 {\r
1135 Double_t contentEta = 0.;\r
1136 Double_t entryEta = 0.;\r
1137 for(Int_t p=1;p<=nBinsPt;p++)\r
1138 {\r
1139 contentEta += (profilePtEta->GetBinContent(profilePtEta->GetBin(p,e)))\r
1140 * (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));\r
1141 entryEta += (profilePtEta->GetBinEntries(profilePtEta->GetBin(p,e)));\r
1142 }\r
1143 profileEta->SetBinContent(e,contentEta);\r
1144 profileEta->SetBinEntries(e,entryEta);\r
1145 }\r
1146 \r
1147 return profileEta;\r
1148 \r
1149} // end of TProfile* AliFlowAnalysisWithQCumulants::MakeEtaProjection(TProfile2D *profilePtEta)\r
1150\r
1151\r
1152//================================================================================================================================\r
1153\r
1154\r
1155void AliFlowAnalysisWithQCumulants::PrintFinalResultsForIntegratedFlow(TString type)\r
1156{\r
1157 // printing on the screen the final results for integrated flow (NONAME, POI and RP) // to be improved (NONAME) \r
1158 \r
1159 Int_t n = fHarmonic; \r
1160 \r
1161 if(type == "NONAME" || type == "RP" || type == "POI")\r
1162 {\r
1163 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))\r
1164 {\r
1165 cout<<"WARNING: fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th"<<endl;\r
1166 cout<<" is NULL in AFAWQC::PFRFIF() !!!!"<<endl;\r
1167 }\r
1168 } else\r
1169 {\r
1170 cout<<"WARNING: type in not from {NONAME, RP, POI} in AFAWQC::PFRFIF() !!!!"<<endl;\r
1171 exit(0);\r
1172 }\r
1173 \r
1174 Double_t dVn[4] = {0.}; // array to hold Vn{2}, Vn{4}, Vn{6} and Vn{8} \r
1175 Double_t dVnErr[4] = {0.}; // array to hold errors of Vn{2}, Vn{4}, Vn{6} and Vn{8} \r
1176 \r
1177 if(type == "NONAME")\r
1178 {\r
1179 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinContent(1); \r
1180 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinError(1); \r
1181 dVn[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinContent(1); \r
1182 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinError(1); \r
1183 dVn[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinContent(1); \r
1184 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinError(1); \r
1185 dVn[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinContent(1); \r
1186 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinError(1); \r
1187 } else if(type == "RP")\r
1188 {\r
1189 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinContent(1); \r
1190 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinError(1); \r
1191 dVn[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinContent(1); \r
1192 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinError(1); \r
1193 dVn[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinContent(1); \r
1194 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinError(1); \r
1195 dVn[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinContent(1); \r
1196 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinError(1); \r
1197 } else if(type == "POI")\r
1198 {\r
1199 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinContent(1); \r
1200 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinError(1); \r
1201 dVn[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinContent(1); \r
1202 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinError(1); \r
1203 dVn[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinContent(1); \r
1204 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinError(1); \r
1205 dVn[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinContent(1); \r
1206 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinError(1); \r
1207 }\r
1208 \r
1209 TString title = " flow estimates from Q-cumulants"; \r
1210 TString subtitle = " ("; \r
1211 \r
1212 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))\r
1213 {\r
1214 subtitle.Append(type);\r
1215 subtitle.Append(", without weights)");\r
1216 } else \r
1217 {\r
1218 subtitle.Append(type);\r
1219 subtitle.Append(", with weights)");\r
1220 }\r
1221 \r
1222 cout<<endl;\r
1223 cout<<"*************************************"<<endl;\r
1224 cout<<"*************************************"<<endl;\r
1225 cout<<title.Data()<<endl; \r
1226 cout<<subtitle.Data()<<endl; \r
1227 cout<<endl;\r
1228 \r
1229 for(Int_t i=0;i<4;i++)\r
1230 {\r
1231 if(dVn[i]>=0.)\r
1232 {\r
1233 cout<<" v_"<<n<<"{"<<2*(i+1)<<"} = "<<dVn[i]<<" +/- "<<dVnErr[i]<<endl;\r
1234 }\r
1235 else\r
1236 {\r
1237 cout<<" v_"<<n<<"{"<<2*(i+1)<<"} = Im"<<endl;\r
1238 } \r
1239 }\r
1240\r
1241 cout<<endl;\r
1242 /*\r
1243 if(type == "NONAME")\r
1244 {\r
1245 cout<<" nEvts = "<<nEvtsNoName<<", AvM = "<<dMultNoName<<endl; // to be improved\r
1246 }\r
1247 else if (type == "RP")\r
1248 {\r
1249 cout<<" nEvts = "<<nEvtsRP<<", AvM = "<<dMultRP<<endl; // to be improved \r
1250 } \r
1251 else if (type == "POI")\r
1252 {\r
1253 cout<<" nEvts = "<<nEvtsPOI<<", AvM = "<<dMultPOI<<endl; // to be improved \r
1254 } \r
1255 */\r
1256 cout<<"*************************************"<<endl;\r
1257 cout<<"*************************************"<<endl;\r
1258 cout<<endl; \r
1259 \r
1260}// end of AliFlowAnalysisWithQCumulants::PrintFinalResultsForIntegratedFlow(TString type="NONAME");\r
1261\r
1262\r
1263//================================================================================================================================\r
1264\r
1265\r
1266void AliFlowAnalysisWithQCumulants::WriteHistograms(TString outputFileName)\r
1267{\r
1268 //store the final results in output .root file\r
1269 TFile *output = new TFile(outputFileName.Data(),"RECREATE");\r
1270 //output->WriteObject(fHistList, "cobjQC","SingleKey");\r
1271 fHistList->Write(fHistList->GetName(), TObject::kSingleKey);\r
1272 delete output;\r
1273}\r
1274\r
1275\r
1276//================================================================================================================================\r
ad87ae62 1277
1278
1279void AliFlowAnalysisWithQCumulants::WriteHistograms(TDirectoryFile *outputFileName)
1280{
1281 //store the final results in output .root file
1282 fHistList->SetName("cobjQC");
1283 fHistList->SetOwner(kTRUE);
1284 outputFileName->Add(fHistList);
1285 outputFileName->Write(outputFileName->GetName(), TObject::kSingleKey);
1286}
1287\r
1288
1289//================================================================================================================================\r
1290
a5b7efd0 1291\r
1292void AliFlowAnalysisWithQCumulants::BookCommonHistograms()\r
1293{\r
1294 // Book common control histograms and common histograms for final results.\r
1295 // common control histogram (ALL events)\r
1296 TString commonHistsName = "AliFlowCommonHistQC";\r
1297 commonHistsName += fAnalysisLabel->Data();\r
1298 fCommonHists = new AliFlowCommonHist(commonHistsName.Data());\r
1299 fHistList->Add(fCommonHists); \r
1300 // common control histogram (for events with 2 and more particles)\r
1301 TString commonHists2ndOrderName = "AliFlowCommonHist2ndOrderQC";\r
1302 commonHists2ndOrderName += fAnalysisLabel->Data();\r
1303 fCommonHists2nd = new AliFlowCommonHist(commonHists2ndOrderName.Data());\r
1304 fHistList->Add(fCommonHists2nd); \r
1305 // common control histogram (for events with 4 and more particles)\r
1306 TString commonHists4thOrderName = "AliFlowCommonHist4thOrderQC";\r
1307 commonHists4thOrderName += fAnalysisLabel->Data();\r
1308 fCommonHists4th = new AliFlowCommonHist(commonHists4thOrderName.Data());\r
1309 fHistList->Add(fCommonHists4th); \r
1310 // common control histogram (for events with 6 and more particles)\r
1311 TString commonHists6thOrderName = "AliFlowCommonHist6thOrderQC";\r
1312 commonHists6thOrderName += fAnalysisLabel->Data();\r
1313 fCommonHists6th = new AliFlowCommonHist(commonHists6thOrderName.Data());\r
1314 fHistList->Add(fCommonHists6th); \r
1315 // common control histogram (for events with 8 and more particles)\r
1316 TString commonHists8thOrderName = "AliFlowCommonHist8thOrderQC";\r
1317 commonHists8thOrderName += fAnalysisLabel->Data();\r
1318 fCommonHists8th = new AliFlowCommonHist(commonHists8thOrderName.Data());\r
1319 fHistList->Add(fCommonHists8th); \r
1320 // common histograms for final results (calculated for events with 2 and more particles)\r
1321 TString commonHistResults2ndOrderName = "AliFlowCommonHistResults2ndOrderQC";\r
1322 commonHistResults2ndOrderName += fAnalysisLabel->Data();\r
1323 fCommonHistsResults2nd = new AliFlowCommonHistResults(commonHistResults2ndOrderName.Data());\r
1324 fHistList->Add(fCommonHistsResults2nd); \r
1325 // common histograms for final results (calculated for events with 4 and more particles)\r
1326 TString commonHistResults4thOrderName = "AliFlowCommonHistResults4thOrderQC";\r
1327 commonHistResults4thOrderName += fAnalysisLabel->Data();\r
1328 fCommonHistsResults4th = new AliFlowCommonHistResults(commonHistResults4thOrderName.Data());\r
1329 fHistList->Add(fCommonHistsResults4th); \r
1330 // common histograms for final results (calculated for events with 6 and more particles)\r
1331 TString commonHistResults6thOrderName = "AliFlowCommonHistResults6thOrderQC";\r
1332 commonHistResults6thOrderName += fAnalysisLabel->Data();\r
1333 fCommonHistsResults6th = new AliFlowCommonHistResults(commonHistResults6thOrderName.Data());\r
1334 fHistList->Add(fCommonHistsResults6th); \r
1335 // common histograms for final results (calculated for events with 8 and more particles)\r
1336 TString commonHistResults8thOrderName = "AliFlowCommonHistResults8thOrderQC";\r
1337 commonHistResults8thOrderName += fAnalysisLabel->Data();\r
1338 fCommonHistsResults8th = new AliFlowCommonHistResults(commonHistResults8thOrderName.Data());\r
1339 fHistList->Add(fCommonHistsResults8th); \r
1340 \r
1341} // end of void AliFlowAnalysisWithQCumulants::BookCommonHistograms()\r
1342\r
1343\r
1344//================================================================================================================================\r
1345\r
1346\r
1347void AliFlowAnalysisWithQCumulants::BookAndFillWeightsHistograms()\r
1348{\r
1349 // book and fill histograms which hold phi, pt and eta weights\r
1350\r
1351 if(!fWeightsList)\r
1352 {\r
1353 cout<<"WARNING: fWeightsList is NULL in AFAWQC::BAFWH() !!!!"<<endl;\r
1354 exit(0); \r
1355 }\r
1356 \r
1357 TString fUseParticleWeightsName = "fUseParticleWeightsQC";\r
1358 fUseParticleWeightsName += fAnalysisLabel->Data();\r
1359 fUseParticleWeights = new TProfile(fUseParticleWeightsName.Data(),"0 = particle weight not used, 1 = particle weight used ",3,0,3);\r
1360 fUseParticleWeights->SetLabelSize(0.06);\r
1361 (fUseParticleWeights->GetXaxis())->SetBinLabel(1,"w_{#phi}");\r
1362 (fUseParticleWeights->GetXaxis())->SetBinLabel(2,"w_{p_{T}}");\r
1363 (fUseParticleWeights->GetXaxis())->SetBinLabel(3,"w_{#eta}");\r
1364 fUseParticleWeights->Fill(0.5,(Int_t)fUsePhiWeights);\r
1365 fUseParticleWeights->Fill(1.5,(Int_t)fUsePtWeights);\r
1366 fUseParticleWeights->Fill(2.5,(Int_t)fUseEtaWeights);\r
1367 fWeightsList->Add(fUseParticleWeights); \r
1368 \r
1369 if(fUsePhiWeights)\r
1370 {\r
1371 if(fWeightsList->FindObject("phi_weights"))\r
1372 {\r
1373 fPhiWeights = dynamic_cast<TH1F*>(fWeightsList->FindObject("phi_weights"));\r
3b552efe 1374 if(TMath::Abs(fPhiWeights->GetBinWidth(1)-fPhiBinWidth)>pow(10.,-6.))\r
a5b7efd0 1375 {\r
3b552efe 1376 cout<<endl;
1377 cout<<"WARNING (QC): Inconsistent binning in histograms for phi-weights throughout the code."<<endl;\r
1378 cout<<endl;\r
a5b7efd0 1379 exit(0);\r
1380 }\r
1381 } else \r
1382 {\r
1383 cout<<"WARNING: fWeightsList->FindObject(\"phi_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;\r
1384 exit(0);\r
1385 }\r
1386 } // end of if(fUsePhiWeights)\r
1387 \r
1388 if(fUsePtWeights) \r
1389 {\r
1390 if(fWeightsList->FindObject("pt_weights"))\r
1391 {\r
1392 fPtWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("pt_weights"));\r
3b552efe 1393 if(TMath::Abs(fPtWeights->GetBinWidth(1)-fPtBinWidth)>pow(10.,-6.))\r
a5b7efd0 1394 {\r
3b552efe 1395 cout<<endl;
1396 cout<<"WARNING (QC): Inconsistent binning in histograms for pt-weights throughout the code."<<endl;\r
1397 cout<<endl;\r
a5b7efd0 1398 exit(0);\r
1399 }\r
1400 } else \r
1401 {\r
1402 cout<<"WARNING: fWeightsList->FindObject(\"pt_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;\r
1403 exit(0);\r
1404 }\r
1405 } // end of if(fUsePtWeights) \r
1406\r
1407 if(fUseEtaWeights) \r
1408 {\r
1409 if(fWeightsList->FindObject("eta_weights"))\r
1410 {\r
1411 fEtaWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("eta_weights"));\r
3b552efe 1412 if(TMath::Abs(fEtaWeights->GetBinWidth(1)-fEtaBinWidth)>pow(10.,-6.))\r
a5b7efd0 1413 {\r
3b552efe 1414 cout<<endl;
1415 cout<<"WARNING (QC): Inconsistent binning in histograms for eta-weights throughout the code."<<endl;\r
1416 cout<<endl;\r
a5b7efd0 1417 exit(0);\r
1418 }\r
1419 } else \r
1420 {\r
1421 cout<<"WARNING: fUseEtaWeights && fWeightsList->FindObject(\"eta_weights\") is NULL in AFAWQC::BAFWH() !!!!"<<endl;\r
1422 exit(0);\r
1423 }\r
1424 } // end of if(fUseEtaWeights)\r
1425 \r
1426} // end of AliFlowAnalysisWithQCumulants::BookAndFillWeightsHistograms()\r
1427\r
1428\r
1429//================================================================================================================================\r
1430\r
1431\r
1432void AliFlowAnalysisWithQCumulants::BookEverythingForIntegratedFlow()\r
1433{\r
1434 // Book all objects for integrated flow:\r
1435 // a) Book profile to hold all flags for integrated flow.\r
1436 // b) Book event-by-event quantities.\r
1437 // c) Book profiles. // to be improved (comment)\r
1438 // d) Book histograms holding the final results.\r
1439 \r
1440 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)\r
1441 TString powerFlag[2] = {"linear","quadratic"}; // to be improved (should I promote this to data members?)\r
1442 \r
1443 // a) Book profile to hold all flags for integrated flow:\r
1444 TString intFlowFlagsName = "fIntFlowFlags";\r
1445 intFlowFlagsName += fAnalysisLabel->Data();\r
3b552efe 1446 fIntFlowFlags = new TProfile(intFlowFlagsName.Data(),"Flags for Integrated Flow",6,0,6);\r
a5b7efd0 1447 fIntFlowFlags->SetTickLength(-0.01,"Y");\r
1448 fIntFlowFlags->SetMarkerStyle(25);\r
1449 fIntFlowFlags->SetLabelSize(0.05);\r
1450 fIntFlowFlags->SetLabelOffset(0.02,"Y");\r
3b552efe 1451 fIntFlowFlags->GetXaxis()->SetBinLabel(1,"Particle Weights");\r
1452 fIntFlowFlags->GetXaxis()->SetBinLabel(2,"Event Weights");\r
1453 fIntFlowFlags->GetXaxis()->SetBinLabel(3,"Corrected for NUA?");
1454 fIntFlowFlags->GetXaxis()->SetBinLabel(4,"Print NONAME results");\r
1455 fIntFlowFlags->GetXaxis()->SetBinLabel(5,"Print RP results");\r
1456 fIntFlowFlags->GetXaxis()->SetBinLabel(6,"Print POI results");
a5b7efd0 1457 fIntFlowList->Add(fIntFlowFlags);\r
1458\r
1459 // b) Book event-by-event quantities:\r
1460 // Re[Q_{m*n,k}], Im[Q_{m*n,k}] and S_{p,k}^M: \r
1461 fReQ = new TMatrixD(4,9);\r
1462 fImQ = new TMatrixD(4,9);\r
1463 fSMpk = new TMatrixD(8,9);\r
1464 // average correlations <2>, <4>, <6> and <8> for single event (bining is the same as in fIntFlowCorrelationsPro and fIntFlowCorrelationsHist):\r
1465 TString intFlowCorrelationsEBEName = "fIntFlowCorrelationsEBE";\r
1466 intFlowCorrelationsEBEName += fAnalysisLabel->Data();\r
1467 fIntFlowCorrelationsEBE = new TH1D(intFlowCorrelationsEBEName.Data(),intFlowCorrelationsEBEName.Data(),4,0,4);\r
1468 // weights for average correlations <2>, <4>, <6> and <8> for single event:\r
1469 TString intFlowEventWeightsForCorrelationsEBEName = "fIntFlowEventWeightsForCorrelationsEBE";\r
1470 intFlowEventWeightsForCorrelationsEBEName += fAnalysisLabel->Data();\r
1471 fIntFlowEventWeightsForCorrelationsEBE = new TH1D(intFlowEventWeightsForCorrelationsEBEName.Data(),intFlowEventWeightsForCorrelationsEBEName.Data(),4,0,4);\r
1472 // average all correlations for single event (bining is the same as in fIntFlowCorrelationsAllPro and fIntFlowCorrelationsAllHist):\r
1473 TString intFlowCorrelationsAllEBEName = "fIntFlowCorrelationsAllEBE";\r
1474 intFlowCorrelationsAllEBEName += fAnalysisLabel->Data();\r
1475 fIntFlowCorrelationsAllEBE = new TH1D(intFlowCorrelationsAllEBEName.Data(),intFlowCorrelationsAllEBEName.Data(),32,0,32);\r
1476 // average correction terms for non-uniform acceptance for single event \r
1477 // (binning is the same as in fIntFlowCorrectionTermsForNUAPro[2] and fIntFlowCorrectionTermsForNUAHist[2]):\r
1478 TString fIntFlowCorrectionTermsForNUAEBEName = "fIntFlowCorrectionTermsForNUAEBE";\r
1479 fIntFlowCorrectionTermsForNUAEBEName += fAnalysisLabel->Data();\r
1480 for(Int_t sc=0;sc<2;sc++) // sin or cos terms\r
1481 {\r
1482 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
1483 }\r
1484 \r
1485 // c) Book profiles: // to be improved (comment)\r
1486 // profile to hold average multiplicities and number of events for events with nRP>=0, nRP>=1, ... , and nRP>=8:\r
1487 TString avMultiplicityName = "fAvMultiplicity";\r
1488 avMultiplicityName += fAnalysisLabel->Data();\r
1489 fAvMultiplicity = new TProfile(avMultiplicityName.Data(),"Average Multiplicities of RPs",9,0,9);\r
1490 fAvMultiplicity->SetTickLength(-0.01,"Y");\r
1491 fAvMultiplicity->SetMarkerStyle(25);\r
1492 fAvMultiplicity->SetLabelSize(0.05);\r
1493 fAvMultiplicity->SetLabelOffset(0.02,"Y");\r
1494 fAvMultiplicity->SetYTitle("Average Multiplicity");\r
1495 (fAvMultiplicity->GetXaxis())->SetBinLabel(1,"all evts");\r
1496 (fAvMultiplicity->GetXaxis())->SetBinLabel(2,"n_{RP} #geq 1");\r
1497 (fAvMultiplicity->GetXaxis())->SetBinLabel(3,"n_{RP} #geq 2");\r
1498 (fAvMultiplicity->GetXaxis())->SetBinLabel(4,"n_{RP} #geq 3");\r
1499 (fAvMultiplicity->GetXaxis())->SetBinLabel(5,"n_{RP} #geq 4");\r
1500 (fAvMultiplicity->GetXaxis())->SetBinLabel(6,"n_{RP} #geq 5");\r
1501 (fAvMultiplicity->GetXaxis())->SetBinLabel(7,"n_{RP} #geq 6");\r
1502 (fAvMultiplicity->GetXaxis())->SetBinLabel(8,"n_{RP} #geq 7");\r
1503 (fAvMultiplicity->GetXaxis())->SetBinLabel(9,"n_{RP} #geq 8");\r
1504 fIntFlowProfiles->Add(fAvMultiplicity);\r
1505 // average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with wrong errors!):\r
1506 TString intFlowCorrelationsProName = "fIntFlowCorrelationsPro";\r
1507 intFlowCorrelationsProName += fAnalysisLabel->Data();\r
1508 fIntFlowCorrelationsPro = new TProfile(intFlowCorrelationsProName.Data(),"Average correlations for all events",4,0,4,"s");\r
1509 fIntFlowCorrelationsPro->SetTickLength(-0.01,"Y");\r
1510 fIntFlowCorrelationsPro->SetMarkerStyle(25);\r
1511 fIntFlowCorrelationsPro->SetLabelSize(0.06);\r
1512 fIntFlowCorrelationsPro->SetLabelOffset(0.01,"Y");\r
1513 (fIntFlowCorrelationsPro->GetXaxis())->SetBinLabel(1,"<<2>>");\r
1514 (fIntFlowCorrelationsPro->GetXaxis())->SetBinLabel(2,"<<4>>");\r
1515 (fIntFlowCorrelationsPro->GetXaxis())->SetBinLabel(3,"<<6>>");\r
1516 (fIntFlowCorrelationsPro->GetXaxis())->SetBinLabel(4,"<<8>>");\r
1517 fIntFlowProfiles->Add(fIntFlowCorrelationsPro);\r
1518 // averaged all correlations for all events (with wrong errors!):\r
1519 TString intFlowCorrelationsAllProName = "fIntFlowCorrelationsAllPro";\r
1520 intFlowCorrelationsAllProName += fAnalysisLabel->Data();\r
1521 fIntFlowCorrelationsAllPro = new TProfile(intFlowCorrelationsAllProName.Data(),"Average correlations for all events",32,0,32,"s");\r
1522 fIntFlowCorrelationsAllPro->SetTickLength(-0.01,"Y");\r
1523 fIntFlowCorrelationsAllPro->SetMarkerStyle(25);\r
1524 fIntFlowCorrelationsAllPro->SetLabelSize(0.03);\r
1525 fIntFlowCorrelationsAllPro->SetLabelOffset(0.01,"Y");\r
1526 // 2-p correlations:\r
1527 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(1,"<<2>>_{n|n}");\r
1528 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(2,"<<2>>_{2n|2n}");\r
1529 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(3,"<<2>>_{3n|3n}");\r
1530 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(4,"<<2>>_{4n|4n}");\r
1531 // 3-p correlations:\r
1532 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(6,"<<3>>_{2n|n,n}");\r
1533 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(7,"<<3>>_{3n|2n,n}");\r
1534 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(8,"<<3>>_{4n|2n,2n}");\r
1535 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(9,"<<3>>_{4n|3n,n}");\r
1536 // 4-p correlations:\r
1537 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(11,"<<4>>_{n,n|n,n}"); \r
1538 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(12,"<<4>>_{2n,n|2n,n}");\r
1539 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(13,"<<4>>_{2n,2n|2n,2n}");\r
1540 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(14,"<<4>>_{3n|n,n,n}");\r
1541 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(15,"<<4>>_{3n,n|3n,n}");\r
1542 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(16,"<<4>>_{3n,n|2n,2n}"); \r
1543 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(17,"<<4>>_{4n|2n,n,n}");\r
1544 // 5-p correlations:\r
1545 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(19,"<<5>>_{2n|n,n,n,n}"); \r
1546 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(20,"<<5>>_{2n,2n|2n,n,n}");\r
1547 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(21,"<<5>>_{3n,n|2n,n,n}");\r
1548 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(22,"<<5>>_{4n|n,n,n,n}");\r
1549 // 6-p correlations:\r
1550 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(24,"<<6>>_{n,n,n|n,n,n}");\r
1551 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(25,"<<6>>_{2n,n,n|2n,n,n}");\r
1552 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(26,"<<6>>_{2n,2n|n,n,n,n}");\r
1553 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(27,"<<6>>_{3n,n|n,n,n,n}");\r
1554 // 7-p correlations: \r
1555 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(29,"<<7>>_{2n,n,n|n,n,n,n}");\r
1556 // 8-p correlations:\r
1557 (fIntFlowCorrelationsAllPro->GetXaxis())->SetBinLabel(31,"<<8>>_{n,n,n,n|n,n,n,n}");\r
1558 fIntFlowProfiles->Add(fIntFlowCorrelationsAllPro);\r
1559 // when particle weights are used some extra correlations appear:\r
1560 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights) \r
1561 {\r
1562 TString intFlowExtraCorrelationsProName = "fIntFlowExtraCorrelationsPro";\r
1563 intFlowExtraCorrelationsProName += fAnalysisLabel->Data();\r
1564 fIntFlowExtraCorrelationsPro = new TProfile(intFlowExtraCorrelationsProName.Data(),"Average extra correlations for all events",100,0,100,"s");\r
1565 fIntFlowExtraCorrelationsPro->SetTickLength(-0.01,"Y");\r
1566 fIntFlowExtraCorrelationsPro->SetMarkerStyle(25);\r
1567 fIntFlowExtraCorrelationsPro->SetLabelSize(0.03);\r
1568 fIntFlowExtraCorrelationsPro->SetLabelOffset(0.01,"Y");\r
1569 // extra 2-p correlations:\r
1570 (fIntFlowExtraCorrelationsPro->GetXaxis())->SetBinLabel(1,"<<w1^3 w2 cos(n*(phi1-phi2))>>");\r
1571 (fIntFlowExtraCorrelationsPro->GetXaxis())->SetBinLabel(2,"<<w1 w2 w3^2 cos(n*(phi1-phi2))>>");\r
a5b7efd0 1572 fIntFlowProfiles->Add(fIntFlowExtraCorrelationsPro);\r
1573 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)\r
1574 // average product of correlations <2>, <4>, <6> and <8>: \r
1575 TString intFlowProductOfCorrelationsProName = "fIntFlowProductOfCorrelationsPro";\r
1576 intFlowProductOfCorrelationsProName += fAnalysisLabel->Data();\r
1577 fIntFlowProductOfCorrelationsPro = new TProfile(intFlowProductOfCorrelationsProName.Data(),"Average products of correlations",6,0,6);\r
1578 fIntFlowProductOfCorrelationsPro->SetTickLength(-0.01,"Y");\r
1579 fIntFlowProductOfCorrelationsPro->SetMarkerStyle(25); \r
1580 fIntFlowProductOfCorrelationsPro->SetLabelSize(0.05);\r
1581 fIntFlowProductOfCorrelationsPro->SetLabelOffset(0.01,"Y");\r
1582 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(1,"<<2><4>>");\r
1583 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(2,"<<2><6>>");\r
1584 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(3,"<<2><8>>");\r
1585 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(4,"<<4><6>>");\r
1586 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(5,"<<4><8>>");\r
1587 (fIntFlowProductOfCorrelationsPro->GetXaxis())->SetBinLabel(6,"<<6><8>>");\r
1588 fIntFlowProfiles->Add(fIntFlowProductOfCorrelationsPro);\r
1589 // average correction terms for non-uniform acceptance (with wrong errors!):\r
1590 for(Int_t sc=0;sc<2;sc++) // sin or cos terms\r
1591 {\r
1592 TString intFlowCorrectionTermsForNUAProName = "fIntFlowCorrectionTermsForNUAPro";\r
1593 intFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();\r
1594 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
1595 fIntFlowCorrectionTermsForNUAPro[sc]->SetTickLength(-0.01,"Y");\r
1596 fIntFlowCorrectionTermsForNUAPro[sc]->SetMarkerStyle(25);\r
1597 fIntFlowCorrectionTermsForNUAPro[sc]->SetLabelSize(0.03);\r
1598 fIntFlowCorrectionTermsForNUAPro[sc]->SetLabelOffset(0.01,"Y");\r
a5b7efd0 1599 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(1,Form("<<%s(n(phi1))>>",sinCosFlag[sc].Data()));\r
a5b7efd0 1600 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(2,Form("<<%s(n(phi1+phi2))>>",sinCosFlag[sc].Data())); \r
a5b7efd0 1601 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(3,Form("<<%s(n(phi1-phi2-phi3))>>",sinCosFlag[sc].Data())); \r
3b552efe 1602 (fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->SetBinLabel(4,Form("<<%s(n(2phi1-phi2))>>",sinCosFlag[sc].Data())); \r
a5b7efd0 1603 fIntFlowProfiles->Add(fIntFlowCorrectionTermsForNUAPro[sc]);\r
1604 } // end of for(Int_t sc=0;sc<2;sc++) \r
1605 \r
1606 // d) Book histograms holding the final results:\r
1607 // average correlations <<2>>, <<4>>, <<6>> and <<8>> for all events (with correct errors!):\r
1608 TString intFlowCorrelationsHistName = "fIntFlowCorrelationsHist";\r
1609 intFlowCorrelationsHistName += fAnalysisLabel->Data();\r
1610 fIntFlowCorrelationsHist = new TH1D(intFlowCorrelationsHistName.Data(),"Average correlations for all events",4,0,4);\r
1611 fIntFlowCorrelationsHist->SetTickLength(-0.01,"Y");\r
1612 fIntFlowCorrelationsHist->SetMarkerStyle(25);\r
1613 fIntFlowCorrelationsHist->SetLabelSize(0.06);\r
1614 fIntFlowCorrelationsHist->SetLabelOffset(0.01,"Y");\r
1615 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(1,"<<2>>");\r
1616 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(2,"<<4>>");\r
1617 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(3,"<<6>>");\r
1618 (fIntFlowCorrelationsHist->GetXaxis())->SetBinLabel(4,"<<8>>");\r
1619 fIntFlowResults->Add(fIntFlowCorrelationsHist);\r
1620 // average all correlations for all events (with correct errors!):\r
1621 TString intFlowCorrelationsAllHistName = "fIntFlowCorrelationsAllHist";\r
1622 intFlowCorrelationsAllHistName += fAnalysisLabel->Data();\r
1623 fIntFlowCorrelationsAllHist = new TH1D(intFlowCorrelationsAllHistName.Data(),"Average correlations for all events",32,0,32);\r
1624 fIntFlowCorrelationsAllHist->SetTickLength(-0.01,"Y");\r
1625 fIntFlowCorrelationsAllHist->SetMarkerStyle(25);\r
1626 fIntFlowCorrelationsAllHist->SetLabelSize(0.03);\r
1627 fIntFlowCorrelationsAllHist->SetLabelOffset(0.01,"Y");\r
1628 // 2-p correlations:\r
1629 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(1,"<<2>>_{n|n}");\r
1630 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(2,"<<2>>_{2n|2n}");\r
1631 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(3,"<<2>>_{3n|3n}");\r
1632 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(4,"<<2>>_{4n|4n}");\r
1633 // 3-p correlations:\r
1634 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(6,"<<3>>_{2n|n,n}");\r
1635 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(7,"<<3>>_{3n|2n,n}");\r
1636 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(8,"<<3>>_{4n|2n,2n}");\r
1637 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(9,"<<3>>_{4n|3n,n}");\r
1638 // 4-p correlations:\r
1639 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(11,"<<4>>_{n,n|n,n}"); \r
1640 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(12,"<<4>>_{2n,n|2n,n}");\r
1641 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(13,"<<4>>_{2n,2n|2n,2n}");\r
1642 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(14,"<<4>>_{3n|n,n,n}");\r
1643 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(15,"<<4>>_{3n,n|3n,n}");\r
1644 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(16,"<<4>>_{3n,n|2n,2n}"); \r
1645 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(17,"<<4>>_{4n|2n,n,n}");\r
1646 // 5-p correlations:\r
1647 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(19,"<<5>>_{2n|n,n,n,n}"); \r
1648 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(20,"<<5>>_{2n,2n|2n,n,n}");\r
1649 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(21,"<<5>>_{3n,n|2n,n,n}");\r
1650 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(22,"<<5>>_{4n|n,n,n,n}");\r
1651 // 6-p correlations:\r
1652 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(24,"<<6>>_{n,n,n|n,n,n}");\r
1653 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(25,"<<6>>_{2n,n,n|2n,n,n}");\r
1654 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(26,"<<6>>_{2n,2n|n,n,n,n}");\r
1655 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(27,"<<6>>_{3n,n|n,n,n,n}");\r
1656 // 7-p correlations: \r
1657 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(29,"<<7>>_{2n,n,n|n,n,n,n}");\r
1658 // 8-p correlations:\r
1659 (fIntFlowCorrelationsAllHist->GetXaxis())->SetBinLabel(31,"<<8>>_{n,n,n,n|n,n,n,n}");\r
1660 fIntFlowResults->Add(fIntFlowCorrelationsAllHist);\r
1661 // average correction terms for non-uniform acceptance (with correct errors!):\r
1662 for(Int_t sc=0;sc<2;sc++) // sin or cos terms\r
1663 {\r
1664 TString intFlowCorrectionTermsForNUAHistName = "fIntFlowCorrectionTermsForNUAHist";\r
1665 intFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();\r
1666 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
1667 fIntFlowCorrectionTermsForNUAHist[sc]->SetTickLength(-0.01,"Y");\r
1668 fIntFlowCorrectionTermsForNUAHist[sc]->SetMarkerStyle(25);\r
1669 fIntFlowCorrectionTermsForNUAHist[sc]->SetLabelSize(0.03);\r
1670 fIntFlowCorrectionTermsForNUAHist[sc]->SetLabelOffset(0.01,"Y");\r
1671 // ......................................................................... \r
1672 // 1-p terms:\r
1673 (fIntFlowCorrectionTermsForNUAHist[sc]->GetXaxis())->SetBinLabel(1,Form("%s(n(#phi_{1}))>",sinCosFlag[sc].Data()));\r
1674 // 2-p terms:\r
1675 // 3-p terms:\r
1676 // ...\r
1677 // ......................................................................... \r
1678 fIntFlowResults->Add(fIntFlowCorrectionTermsForNUAHist[sc]);\r
1679 } // end of for(Int_t sc=0;sc<2;sc++) \r
1680 // covariances (multiplied with weight dependent prefactor):\r
1681 TString intFlowCovariancesName = "fIntFlowCovariances";\r
1682 intFlowCovariancesName += fAnalysisLabel->Data();\r
1683 fIntFlowCovariances = new TH1D(intFlowCovariancesName.Data(),"Covariances (multiplied with weight dependent prefactor)",6,0,6);\r
1684 fIntFlowCovariances->SetLabelSize(0.04);\r
1685 fIntFlowCovariances->SetMarkerStyle(25);\r
1686 (fIntFlowCovariances->GetXaxis())->SetBinLabel(1,"Cov(<2>,<4>)");\r
1687 (fIntFlowCovariances->GetXaxis())->SetBinLabel(2,"Cov(<2>,<6>)");\r
1688 (fIntFlowCovariances->GetXaxis())->SetBinLabel(3,"Cov(<2>,<8>)");\r
1689 (fIntFlowCovariances->GetXaxis())->SetBinLabel(4,"Cov(<4>,<6>)");\r
1690 (fIntFlowCovariances->GetXaxis())->SetBinLabel(5,"Cov(<4>,<8>)");\r
1691 (fIntFlowCovariances->GetXaxis())->SetBinLabel(6,"Cov(<6>,<8>)"); \r
1692 fIntFlowResults->Add(fIntFlowCovariances);\r
1693 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8>:\r
1694 TString intFlowSumOfEventWeightsName = "fIntFlowSumOfEventWeights";\r
1695 intFlowSumOfEventWeightsName += fAnalysisLabel->Data();\r
1696 for(Int_t power=0;power<2;power++)\r
1697 {\r
1698 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
1699 fIntFlowSumOfEventWeights[power]->SetLabelSize(0.05);\r
1700 fIntFlowSumOfEventWeights[power]->SetMarkerStyle(25);\r
1701 if(power == 0)\r
1702 {\r
1703 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>}");\r
1704 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<4>}");\r
1705 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<6>}");\r
1706 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<8>}");\r
1707 } else if (power == 1) \r
1708 {\r
1709 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>}^{2}");\r
1710 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<4>}^{2}");\r
1711 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<6>}^{2}");\r
1712 (fIntFlowSumOfEventWeights[power]->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<8>}^{2}");\r
1713 }\r
1714 fIntFlowResults->Add(fIntFlowSumOfEventWeights[power]);\r
1715 } \r
1716 // sum of products of event weights for correlations <2>, <4>, <6> and <8>: \r
1717 TString intFlowSumOfProductOfEventWeightsName = "fIntFlowSumOfProductOfEventWeights";\r
1718 intFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();\r
1719 fIntFlowSumOfProductOfEventWeights = new TH1D(intFlowSumOfProductOfEventWeightsName.Data(),"Sum of product of event weights for correlations",6,0,6);\r
1720 fIntFlowSumOfProductOfEventWeights->SetLabelSize(0.05);\r
1721 fIntFlowSumOfProductOfEventWeights->SetMarkerStyle(25);\r
1722 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(1,"#sum_{i=1}^{N} w_{<2>} w_{<4>}");\r
1723 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(2,"#sum_{i=1}^{N} w_{<2>} w_{<6>}");\r
1724 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(3,"#sum_{i=1}^{N} w_{<2>} w_{<8>}");\r
1725 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(4,"#sum_{i=1}^{N} w_{<4>} w_{<6>}");\r
1726 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(5,"#sum_{i=1}^{N} w_{<4>} w_{<8>}");\r
1727 (fIntFlowSumOfProductOfEventWeights->GetXaxis())->SetBinLabel(6,"#sum_{i=1}^{N} w_{<6>} w_{<8>}");\r
1728 fIntFlowResults->Add(fIntFlowSumOfProductOfEventWeights);\r
1729 // final results for integrated Q-cumulants:\r
1730 TString intFlowQcumulantsName = "fIntFlowQcumulants";\r
1731 intFlowQcumulantsName += fAnalysisLabel->Data();\r
1732 fIntFlowQcumulants = new TH1D(intFlowQcumulantsName.Data(),"Integrated Q-cumulants",4,0,4);\r
1733 fIntFlowQcumulants->SetLabelSize(0.05);\r
1734 fIntFlowQcumulants->SetMarkerStyle(25);\r
1735 (fIntFlowQcumulants->GetXaxis())->SetBinLabel(1,"QC{2}");\r
1736 (fIntFlowQcumulants->GetXaxis())->SetBinLabel(2,"QC{4}");\r
1737 (fIntFlowQcumulants->GetXaxis())->SetBinLabel(3,"QC{6}");\r
1738 (fIntFlowQcumulants->GetXaxis())->SetBinLabel(4,"QC{8}");\r
1739 fIntFlowResults->Add(fIntFlowQcumulants);\r
1740 // final integrated flow estimates from Q-cumulants:\r
1741 TString intFlowName = "fIntFlow";\r
1742 intFlowName += fAnalysisLabel->Data(); \r
1743 // integrated flow from Q-cumulants:\r
1744 fIntFlow = new TH1D(intFlowName.Data(),"Integrated flow estimates from Q-cumulants",4,0,4);\r
1745 fIntFlow->SetLabelSize(0.05);\r
1746 fIntFlow->SetMarkerStyle(25);\r
1747 (fIntFlow->GetXaxis())->SetBinLabel(1,"v_{2}{2,QC}");\r
1748 (fIntFlow->GetXaxis())->SetBinLabel(2,"v_{2}{4,QC}");\r
1749 (fIntFlow->GetXaxis())->SetBinLabel(3,"v_{2}{6,QC}");\r
1750 (fIntFlow->GetXaxis())->SetBinLabel(4,"v_{2}{8,QC}");\r
1751 fIntFlowResults->Add(fIntFlow);\r
1752\r
1753 /* // to be improved (removed):\r
1754 // final average weighted multi-particle correlations for all events calculated from Q-vectors\r
1755 fQCorrelations[1] = new TProfile("Weighted correlations","final average multi-particle correlations from weighted Q-vectors",200,0,200,"s");\r
1756 fQCorrelations[1]->SetTickLength(-0.01,"Y");\r
1757 fQCorrelations[1]->SetMarkerStyle(25);\r
1758 fQCorrelations[1]->SetLabelSize(0.03);\r
1759 fQCorrelations[1]->SetLabelOffset(0.01,"Y");\r
1760 // 2-particle correlations:\r
1761 (fQCorrelations[1]->GetXaxis())->SetBinLabel(1,"<w_{1}w_{2}cos(n(#phi_{1}-#phi_{2}))>");\r
1762 (fQCorrelations[1]->GetXaxis())->SetBinLabel(2,"<w_{1}^{2}w_{2}^{2}cos(2n(#phi_{1}-#phi_{2}))>");\r
1763 (fQCorrelations[1]->GetXaxis())->SetBinLabel(3,"<w_{1}^{3}w_{2}^{3}cos(3n(#phi_{1}-#phi_{2}))>");\r
1764 (fQCorrelations[1]->GetXaxis())->SetBinLabel(4,"<w_{1}^{4}w_{2}^{4}cos(4n(#phi_{1}-#phi_{2}))>");\r
1765 (fQCorrelations[1]->GetXaxis())->SetBinLabel(5,"<w_{1}^{3}w_{2}cos(n(#phi_{1}-#phi_{2}))>");\r
1766 (fQCorrelations[1]->GetXaxis())->SetBinLabel(6,"<w_{1}^{2}w_{2}w_{3}cos(n(#phi_{1}-#phi_{2}))>");\r
1767 // 3-particle correlations:\r
1768 (fQCorrelations[1]->GetXaxis())->SetBinLabel(21,"<w_{1}w_{2}w_{3}^{2}cos(n(2#phi_{1}-#phi_{2}-#phi_{3}))>");\r
1769 // 4-particle correlations:\r
1770 (fQCorrelations[1]->GetXaxis())->SetBinLabel(41,"<w_{1}w_{2}w_{3}w_{4}cos(n(#phi_{1}+#phi_{2}-#phi_{3}-#phi_{4}))>");\r
1771 // add fQCorrelations[1] to the list fIntFlowList:\r
1772 fIntFlowList->Add(fQCorrelations[1]); \r
1773 */\r
1774 \r
1775} // end of AliFlowAnalysisWithQCumulants::BookEverythingForIntegratedFlow()\r
1776\r
1777\r
1778//================================================================================================================================\r
1779\r
1780\r
1781void AliFlowAnalysisWithQCumulants::InitializeArraysForNestedLoops()\r
1782{\r
1783 // Initialize arrays of all objects relevant for calculations with nested loops.\r
1784 \r
1785 // integrated flow:\r
1786 for(Int_t sc=0;sc<2;sc++) // sin or cos terms\r
1787 {\r
1788 fIntFlowDirectCorrectionTermsForNUA[sc] = NULL;\r
1789 } \r
1790\r
1791 // differential flow: \r
1792 // correlations:\r
1793 for(Int_t t=0;t<2;t++) // type: RP or POI\r
1794 { \r
1795 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
1796 {\r
1797 for(Int_t ci=0;ci<4;ci++) // correlation index\r
1798 {\r
1799 fDiffFlowDirectCorrelations[t][pe][ci] = NULL;\r
1800 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index \r
1801 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta\r
1802 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI\r
1803 // correction terms for non-uniform acceptance:\r
1804 for(Int_t t=0;t<2;t++) // type: RP or POI\r
1805 { \r
1806 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
1807 {\r
1808 for(Int_t sc=0;sc<2;sc++) // sin or cos terms\r
1809 {\r
1810 for(Int_t cti=0;cti<9;cti++) // correction term index\r
1811 {\r
1812 fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti] = NULL;\r
1813 } \r
1814 }\r
1815 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta\r
1816 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI\r
1817\r
1818\r
1819} // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForNestedLoops()\r
1820\r
1821\r
1822//================================================================================================================================\r
1823\r
1824\r
1825void AliFlowAnalysisWithQCumulants::BookEverythingForNestedLoops()\r
1826{\r
1827 // Book all objects relevant for calculations with nested loops.\r
1828 \r
1829 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)\r
1830 TString typeFlag[2] = {"RP","POI"}; // to be improved (should I promote this to data members?)\r
1831 TString ptEtaFlag[2] = {"p_{T}","#eta"}; // to be improved (should I promote this to data members?)\r
1832 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"}; // to be improved (should I promote this to data members?)\r
1833 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};\r
1834 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};\r
1835\r
1836 TString evaluateNestedLoopsName = "fEvaluateNestedLoops";\r
1837 evaluateNestedLoopsName += fAnalysisLabel->Data();\r
1838 fEvaluateNestedLoops = new TProfile(evaluateNestedLoopsName.Data(),"Flags for nested loops",4,0,4);\r
1839 fEvaluateNestedLoops->SetLabelSize(0.03);\r
1840 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(1,"fEvaluateIntFlowNestedLoops");\r
1841 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(2,"fEvaluateDiffFlowNestedLoops");\r
1842 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(3,"fCrossCheckInPtBinNo");\r
1843 (fEvaluateNestedLoops->GetXaxis())->SetBinLabel(4,"fCrossCheckInEtaBinNo");\r
1844 fEvaluateNestedLoops->Fill(0.5,(Int_t)fEvaluateIntFlowNestedLoops);\r
1845 fEvaluateNestedLoops->Fill(1.5,(Int_t)fEvaluateDiffFlowNestedLoops);\r
1846 fEvaluateNestedLoops->Fill(2.5,fCrossCheckInPtBinNo);\r
1847 fEvaluateNestedLoops->Fill(3.5,fCrossCheckInEtaBinNo);\r
1848 fNestedLoopsList->Add(fEvaluateNestedLoops);\r
1849 // nested loops for integrated flow:\r
1850 if(fEvaluateIntFlowNestedLoops)\r
1851 {\r
1852 // correlations:\r
1853 TString intFlowDirectCorrelationsName = "fIntFlowDirectCorrelations";\r
1854 intFlowDirectCorrelationsName += fAnalysisLabel->Data();\r
1855 fIntFlowDirectCorrelations = new TProfile(intFlowDirectCorrelationsName.Data(),"Multiparticle correlations calculated with nested loops (for int. flow)",32,0,32,"s");\r
1856 fNestedLoopsList->Add(fIntFlowDirectCorrelations);\r
1857 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)\r
1858 {\r
1859 TString intFlowExtraDirectCorrelationsName = "fIntFlowExtraDirectCorrelations";\r
1860 intFlowExtraDirectCorrelationsName += fAnalysisLabel->Data();\r
1861 fIntFlowExtraDirectCorrelations = new TProfile(intFlowExtraDirectCorrelationsName.Data(),"Extra multiparticle correlations calculated with nested loops (for int. flow)",100,0,100,"s");\r
1862 fNestedLoopsList->Add(fIntFlowExtraDirectCorrelations); \r
1863 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)\r
1864 // correction terms for non-uniform acceptance:\r
1865 for(Int_t sc=0;sc<2;sc++) // sin or cos terms\r
1866 {\r
1867 TString intFlowDirectCorrectionTermsForNUAName = "fIntFlowDirectCorrectionTermsForNUA";\r
1868 intFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();\r
1869 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
1870 fNestedLoopsList->Add(fIntFlowDirectCorrectionTermsForNUA[sc]);\r
1871 } // end of for(Int_t sc=0;sc<2;sc++) \r
1872 } // end of if(fEvaluateIntFlowNestedLoops)\r
1873 \r
1874 // nested loops for differential flow: \r
1875 if(fEvaluateDiffFlowNestedLoops)\r
1876 {\r
1877 // reduced correlations:\r
1878 TString diffFlowDirectCorrelationsName = "fDiffFlowDirectCorrelations";\r
1879 diffFlowDirectCorrelationsName += fAnalysisLabel->Data();\r
1880 for(Int_t t=0;t<2;t++) // type: RP or POI\r
1881 { \r
1882 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
1883 {\r
1884 for(Int_t rci=0;rci<4;rci++) // reduced correlation index\r
1885 {\r
1886 // reduced correlations:\r
1887 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
1888 fDiffFlowDirectCorrelations[t][pe][rci]->SetXTitle(ptEtaFlag[pe].Data());\r
1889 fNestedLoopsList->Add(fDiffFlowDirectCorrelations[t][pe][rci]); // to be improved (add dedicated list to hold reduced correlations)\r
1890 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index\r
1891 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta \r
1892 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI \r
57340a27 1893 // correction terms for non-uniform acceptance:\r
1894 TString diffFlowDirectCorrectionTermsForNUAName = "fDiffFlowDirectCorrectionTermsForNUA";\r
1895 diffFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();\r
1896 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)\r
1897 { \r
1898 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
a5b7efd0 1899 {\r
57340a27 1900 for(Int_t sc=0;sc<2;sc++) // sin or cos\r
a5b7efd0 1901 {\r
57340a27 1902 for(Int_t cti=0;cti<9;cti++) // correction term index\r
1903 {\r
1904 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
1905 fNestedLoopsList->Add(fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti]);\r
1906 }\r
a5b7efd0 1907 }\r
1908 }\r
3b552efe 1909 }
1910 // number of RPs and POIs in selected pt and eta bins for cross-checkings:
1911 TString noOfParticlesInBinName = "fNoOfParticlesInBin";
1912 fNoOfParticlesInBin = new TH1D(noOfParticlesInBinName.Data(),"Number of RPs and POIs in selected p_{T} and #eta bin",4,0,4);
1913 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(1,"# of RPs in p_{T} bin");\r
1914 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(2,"# of RPs in #eta bin");\r
1915 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(3,"# of POIs in p_{T} bin");\r
1916 fNoOfParticlesInBin->GetXaxis()->SetBinLabel(4,"# of POIs in #eta bin");
1917 fNestedLoopsList->Add(fNoOfParticlesInBin);\r
57340a27 1918 } // end of if(fEvaluateDiffFlowNestedLoops)\r
a5b7efd0 1919\r
1920} // end of AliFlowAnalysisWithQCumulants::BookEverythingForNestedLoops()\r
1921\r
1922\r
1923//================================================================================================================================\r
1924\r
1925\r
1926void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelations()\r
1927{\r
1928 // calculate all correlations needed for integrated flow\r
1929 \r
1930 // multiplicity:\r
1931 Double_t dMult = (*fSMpk)(0,0);\r
1932 \r
1933 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n: \r
1934 Double_t dReQ1n = (*fReQ)(0,0);\r
1935 Double_t dReQ2n = (*fReQ)(1,0);\r
1936 Double_t dReQ3n = (*fReQ)(2,0);\r
1937 Double_t dReQ4n = (*fReQ)(3,0);\r
1938 Double_t dImQ1n = (*fImQ)(0,0);\r
1939 Double_t dImQ2n = (*fImQ)(1,0);\r
1940 Double_t dImQ3n = (*fImQ)(2,0);\r
1941 Double_t dImQ4n = (*fImQ)(3,0);\r
1942 \r
1943 // real and imaginary parts of some expressions involving various combinations of Q-vectors evaluated in harmonics n, 2n, 3n and 4n:\r
1944 // (these expression appear in the Eqs. for the multi-particle correlations bellow)\r
1945 \r
1946 // Re[Q_{2n} Q_{n}^* Q_{n}^*]\r
1947 Double_t reQ2nQ1nstarQ1nstar = pow(dReQ1n,2.)*dReQ2n + 2.*dReQ1n*dImQ1n*dImQ2n - pow(dImQ1n,2.)*dReQ2n; \r
1948 \r
1949 // Im[Q_{2n} Q_{n}^* Q_{n}^*]\r
1950 //Double_t imQ2nQ1nstarQ1nstar = pow(dReQ1n,2.)*dImQ2n-2.*dReQ1n*dImQ1n*dReQ2n-pow(dImQ1n,2.)*dImQ2n; \r
1951 \r
1952 // Re[Q_{n} Q_{n} Q_{2n}^*] = Re[Q_{2n} Q_{n}^* Q_{n}^*]\r
1953 Double_t reQ1nQ1nQ2nstar = reQ2nQ1nstarQ1nstar; \r
1954 \r
1955 // Re[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]\r
1956 Double_t reQ3nQ1nQ2nstarQ2nstar = (pow(dReQ2n,2.)-pow(dImQ2n,2.))*(dReQ3n*dReQ1n-dImQ3n*dImQ1n) \r
1957 + 2.*dReQ2n*dImQ2n*(dReQ3n*dImQ1n+dImQ3n*dReQ1n);\r
1958\r
1959 // Im[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*] \r
1960 //Double_t imQ3nQ1nQ2nstarQ2nstar = calculate and implement this (deleteMe)\r
1961 \r
1962 // Re[Q_{2n} Q_{2n} Q_{3n}^* Q_{1n}^*] = Re[Q_{3n} Q_{n} Q_{2n}^* Q_{2n}^*]\r
1963 Double_t reQ2nQ2nQ3nstarQ1nstar = reQ3nQ1nQ2nstarQ2nstar;\r
1964 \r
1965 // Re[Q_{4n} Q_{2n}^* Q_{2n}^*]\r
1966 Double_t reQ4nQ2nstarQ2nstar = pow(dReQ2n,2.)*dReQ4n+2.*dReQ2n*dImQ2n*dImQ4n-pow(dImQ2n,2.)*dReQ4n;\r
1967\r
1968 // Im[Q_{4n} Q_{2n}^* Q_{2n}^*]\r
1969 //Double_t imQ4nQ2nstarQ2nstar = calculate and implement this (deleteMe)\r
1970 \r
1971 // Re[Q_{2n} Q_{2n} Q_{4n}^*] = Re[Q_{4n} Q_{2n}^* Q_{2n}^*]\r
1972 Double_t reQ2nQ2nQ4nstar = reQ4nQ2nstarQ2nstar;\r
1973 \r
1974 // Re[Q_{4n} Q_{3n}^* Q_{n}^*]\r
1975 Double_t reQ4nQ3nstarQ1nstar = dReQ4n*(dReQ3n*dReQ1n-dImQ3n*dImQ1n)+dImQ4n*(dReQ3n*dImQ1n+dImQ3n*dReQ1n);\r
1976 \r
1977 // Re[Q_{3n} Q_{n} Q_{4n}^*] = Re[Q_{4n} Q_{3n}^* Q_{n}^*]\r
1978 Double_t reQ3nQ1nQ4nstar = reQ4nQ3nstarQ1nstar;\r
1979 \r
1980 // Im[Q_{4n} Q_{3n}^* Q_{n}^*]\r
1981 //Double_t imQ4nQ3nstarQ1nstar = calculate and implement this (deleteMe)\r
1982\r
1983 // Re[Q_{3n} Q_{2n}^* Q_{n}^*]\r
1984 Double_t reQ3nQ2nstarQ1nstar = dReQ3n*dReQ2n*dReQ1n-dReQ3n*dImQ2n*dImQ1n+dImQ3n*dReQ2n*dImQ1n\r
1985 + dImQ3n*dImQ2n*dReQ1n;\r
1986 \r
1987 // Re[Q_{2n} Q_{n} Q_{3n}^*] = Re[Q_{3n} Q_{2n}^* Q_{n}^*]\r
1988 Double_t reQ2nQ1nQ3nstar = reQ3nQ2nstarQ1nstar;\r
1989 \r
1990 // Im[Q_{3n} Q_{2n}^* Q_{n}^*]\r
1991 //Double_t imQ3nQ2nstarQ1nstar; //calculate and implement this (deleteMe)\r
1992 \r
1993 // Re[Q_{3n} Q_{n}^* Q_{n}^* Q_{n}^*]\r
1994 Double_t reQ3nQ1nstarQ1nstarQ1nstar = dReQ3n*pow(dReQ1n,3)-3.*dReQ1n*dReQ3n*pow(dImQ1n,2)\r
1995 + 3.*dImQ1n*dImQ3n*pow(dReQ1n,2)-dImQ3n*pow(dImQ1n,3);\r
1996\r
1997 // Im[Q_{3n} Q_{n}^* Q_{n}^* Q_{n}^*]\r
1998 //Double_t imQ3nQ1nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)\r
1999 \r
2000 // |Q_{2n}|^2 |Q_{n}|^2\r
2001 Double_t dQ2nQ1nQ2nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.));\r
2002 \r
2003 // Re[Q_{4n} Q_{2n}^* Q_{n}^* Q_{n}^*]\r
2004 Double_t reQ4nQ2nstarQ1nstarQ1nstar = (dReQ4n*dReQ2n+dImQ4n*dImQ2n)*(pow(dReQ1n,2)-pow(dImQ1n,2))\r
2005 + 2.*dReQ1n*dImQ1n*(dImQ4n*dReQ2n-dReQ4n*dImQ2n); \r
2006 \r
2007 // Im[Q_{4n} Q_{2n}^* Q_{n}^* Q_{n}^*]\r
2008 //Double_t imQ4nQ2nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)\r
2009 \r
2010 // Re[Q_{2n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^*]\r
2011 Double_t reQ2nQ1nQ1nstarQ1nstarQ1nstar = (dReQ2n*dReQ1n-dImQ2n*dImQ1n)*(pow(dReQ1n,3)-3.*dReQ1n*pow(dImQ1n,2))\r
2012 + (dReQ2n*dImQ1n+dReQ1n*dImQ2n)*(3.*dImQ1n*pow(dReQ1n,2)-pow(dImQ1n,3));\r
2013\r
2014 // Im[Q_{2n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^*] \r
2015 //Double_t imQ2nQ1nQ1nstarQ1nstarQ1nstar; //calculate and implement this (deleteMe)\r
2016 \r
2017 // Re[Q_{2n} Q_{2n} Q_{2n}^* Q_{n}^* Q_{n}^*]\r
2018 Double_t reQ2nQ2nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))\r
2019 * (dReQ2n*(pow(dReQ1n,2.)-pow(dImQ1n,2.)) + 2.*dImQ2n*dReQ1n*dImQ1n);\r
2020\r
2021 // Im[Q_{2n} Q_{2n} Q_{2n}^* Q_{n}^* Q_{n}^*]\r
2022 //Double_t imQ2nQ2nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))\r
2023 // * (dImQ2n*(pow(dReQ1n,2.)-pow(dImQ1n,2.)) - 2.*dReQ2n*dReQ1n*dImQ1n);\r
2024 \r
2025 // Re[Q_{4n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]\r
2026 Double_t reQ4nQ1nstarQ1nstarQ1nstarQ1nstar = pow(dReQ1n,4.)*dReQ4n-6.*pow(dReQ1n,2.)*dReQ4n*pow(dImQ1n,2.)\r
2027 + pow(dImQ1n,4.)*dReQ4n+4.*pow(dReQ1n,3.)*dImQ1n*dImQ4n\r
2028 - 4.*pow(dImQ1n,3.)*dReQ1n*dImQ4n;\r
2029 \r
2030 // Im[Q_{4n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]\r
2031 //Double_t imQ4nQ1nstarQ1nstarQ1nstarQ1nstar = pow(dReQ1n,4.)*dImQ4n-6.*pow(dReQ1n,2.)*dImQ4n*pow(dImQ1n,2.)\r
2032 // + pow(dImQ1n,4.)*dImQ4n+4.*pow(dImQ1n,3.)*dReQ1n*dReQ4n\r
2033 // - 4.*pow(dReQ1n,3.)*dImQ1n*dReQ4n;\r
2034 \r
2035 // Re[Q_{3n} Q_{n} Q_{2n}^* Q_{n}^* Q_{n}^*]\r
2036 Double_t reQ3nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))\r
2037 * (dReQ1n*dReQ2n*dReQ3n-dReQ3n*dImQ1n*dImQ2n+dReQ2n*dImQ1n*dImQ3n+dReQ1n*dImQ2n*dImQ3n);\r
2038 \r
2039 // Im[Q_{3n} Q_{n} Q_{2n}^* Q_{n}^* Q_{n}^*]\r
2040 //Double_t imQ3nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))\r
2041 // * (-dReQ2n*dReQ3n*dImQ1n-dReQ1n*dReQ3n*dImQ2n+dReQ1n*dReQ2n*dImQ3n-dImQ1n*dImQ2n*dImQ3n);\r
2042 \r
2043 \r
2044 // Re[Q_{2n} Q_{2n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]\r
2045 Double_t reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)*dReQ2n-2.*dReQ1n*dReQ2n*dImQ1n-dReQ2n*pow(dImQ1n,2.)\r
2046 + dImQ2n*pow(dReQ1n,2.)+2.*dReQ1n*dImQ1n*dImQ2n-pow(dImQ1n,2.)*dImQ2n)\r
2047 * (pow(dReQ1n,2.)*dReQ2n+2.*dReQ1n*dReQ2n*dImQ1n-dReQ2n*pow(dImQ1n,2.)\r
2048 - dImQ2n*pow(dReQ1n,2.)+2.*dReQ1n*dImQ1n*dImQ2n+pow(dImQ1n,2.)*dImQ2n);\r
2049 \r
2050 // Im[Q_{2n} Q_{2n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]\r
2051 //Double_t imQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar = 2.*(pow(dReQ1n,2.)*dReQ2n-dReQ2n*pow(dImQ1n,2.)\r
2052 // + 2.*dReQ1n*dImQ1n*dImQ2n)*(pow(dReQ1n,2.)*dImQ2n\r
2053 // - 2.*dReQ1n*dImQ1n*dReQ2n-pow(dImQ1n,2.)*dImQ2n);\r
2054 \r
2055 // Re[Q_{3n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]\r
2056 Double_t reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))\r
2057 * (pow(dReQ1n,3.)*dReQ3n-3.*dReQ1n*dReQ3n*pow(dImQ1n,2.)\r
2058 + 3.*pow(dReQ1n,2.)*dImQ1n*dImQ3n-pow(dImQ1n,3.)*dImQ3n);\r
2059 \r
2060 // Im[Q_{3n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*] \r
2061 //Double_t imQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = (pow(dReQ1n,2.)+pow(dImQ1n,2.))\r
2062 // * (pow(dImQ1n,3.)*dReQ3n-3.*dImQ1n*dReQ3n*pow(dReQ1n,2.)\r
2063 // - 3.*pow(dImQ1n,2.)*dReQ1n*dImQ3n+pow(dReQ1n,3.)*dImQ3n);\r
2064 \r
2065 // |Q_{2n}|^2 |Q_{n}|^4\r
2066 Double_t dQ2nQ1nQ1nQ2nstarQ1nstarQ1nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))*pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.);\r
2067 \r
2068 // Re[Q_{2n} Q_{n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*]\r
2069 Double_t reQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)\r
2070 * (pow(dReQ1n,2.)*dReQ2n-dReQ2n*pow(dImQ1n,2.)\r
2071 + 2.*dReQ1n*dImQ1n*dImQ2n);\r
2072 \r
2073 // Im[Q_{2n} Q_{n} Q_{n} Q_{n}^* Q_{n}^* Q_{n}^* Q_{n}^*] \r
2074 //Double_t imQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)\r
2075 // * (pow(dReQ1n,2.)*dImQ2n-dImQ2n*pow(dImQ1n,2.)\r
2076 // - 2.*dReQ1n*dReQ2n*dImQ1n);\r
2077 \r
2078 \r
2079 \r
2080 \r
2081 // **************************************\r
2082 // **** multi-particle correlations: ****\r
2083 // **************************************\r
2084 //\r
2085 // Remark 1: multi-particle correlations calculated with non-weighted Q-vectors are stored in 1D profile fQCorrelations[0]. // to be improved (wrong profiles)\r
2086 // Remark 2: binning of fQCorrelations[0] is organized as follows: // to be improved (wrong profiles)\r
2087 // --------------------------------------------------------------------------------------------------------------------\r
2088 // 1st bin: <2>_{1n|1n} = two1n1n = cos(n*(phi1-phi2))>\r
2089 // 2nd bin: <2>_{2n|2n} = two2n2n = cos(2n*(phi1-phi2))>\r
2090 // 3rd bin: <2>_{3n|3n} = two3n3n = cos(3n*(phi1-phi2))> \r
2091 // 4th bin: <2>_{4n|4n} = two4n4n = cos(4n*(phi1-phi2))>\r
2092 // 5th bin: ---- EMPTY ----\r
2093 // 6th bin: <3>_{2n|1n,1n} = three2n1n1n = <cos(n*(2.*phi1-phi2-phi3))>\r
2094 // 7th bin: <3>_{3n|2n,1n} = three3n2n1n = <cos(n*(3.*phi1-2.*phi2-phi3))>\r
2095 // 8th bin: <3>_{4n|2n,2n} = three4n2n2n = <cos(n*(4.*phi1-2.*phi2-2.*phi3))>\r
2096 // 9th bin: <3>_{4n|3n,1n} = three4n3n1n = <cos(n*(4.*phi1-3.*phi2-phi3))>\r
2097 // 10th bin: ---- EMPTY ----\r
2098 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1n = <cos(n*(phi1+phi2-phi3-phi4))>\r
2099 // 12th bin: <4>_{2n,1n|2n,1n} = four2n1n2n1n = <cos(2.*n*(phi1+phi2-phi3-phi4))>\r
2100 // 13th bin: <4>_{2n,2n|2n,2n} = four2n2n2n2n = <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>\r
2101 // 14th bin: <4>_{3n|1n,1n,1n} = four3n1n1n1n = <cos(n*(3.*phi1-phi2-phi3-phi4))> \r
2102 // 15th bin: <4>_{3n,1n|3n,1n} = four3n1n3n1n = <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>\r
2103 // 16th bin: <4>_{3n,1n|2n,2n} = four3n1n2n2n = <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>\r
2104 // 17th bin: <4>_{4n|2n,1n,1n} = four4n2n1n1n = <cos(n*(3.*phi1+phi2-3.*phi3-phi4))> \r
2105 // 18th bin: ---- EMPTY ----\r
2106 // 19th bin: <5>_{2n|1n,1n,1n,1n} = five2n1n1n1n1n = <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>\r
2107 // 20th bin: <5>_{2n,2n|2n,1n,1n} = five2n2n2n1n1n = <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>\r
2108 // 21st bin: <5>_{3n,1n|2n,1n,1n} = five3n1n2n1n1n = <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>\r
2109 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = five4n1n1n1n1n = <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>\r
2110 // 23rd bin: ---- EMPTY ----\r
2111 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = six1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>\r
2112 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = six2n1n1n2n1n1n = <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>\r
2113 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = six2n2n1n1n1n1n = <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>\r
2114 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = six3n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>\r
2115 // 28th bin: ---- EMPTY ----\r
2116 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = seven2n1n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>\r
2117 // 30th bin: ---- EMPTY ----\r
2118 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = eight1n1n1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>\r
2119 // --------------------------------------------------------------------------------------------------------------------\r
2120 \r
2121 // 2-particle:\r
2122 Double_t two1n1n = 0.; // <cos(n*(phi1-phi2))>\r
2123 Double_t two2n2n = 0.; // <cos(2n*(phi1-phi2))>\r
2124 Double_t two3n3n = 0.; // <cos(3n*(phi1-phi2))>\r
2125 Double_t two4n4n = 0.; // <cos(4n*(phi1-phi2))>\r
2126 \r
2127 if(dMult>1)\r
2128 {\r
2129 two1n1n = (pow(dReQ1n,2.)+pow(dImQ1n,2.)-dMult)/(dMult*(dMult-1.)); \r
2130 two2n2n = (pow(dReQ2n,2.)+pow(dImQ2n,2.)-dMult)/(dMult*(dMult-1.)); \r
2131 two3n3n = (pow(dReQ3n,2.)+pow(dImQ3n,2.)-dMult)/(dMult*(dMult-1.)); \r
2132 two4n4n = (pow(dReQ4n,2.)+pow(dImQ4n,2.)-dMult)/(dMult*(dMult-1.)); \r
2133 \r
2134 // average 2-particle correlations for single event: \r
2135 fIntFlowCorrelationsAllEBE->SetBinContent(1,two1n1n);\r
2136 fIntFlowCorrelationsAllEBE->SetBinContent(2,two2n2n);\r
2137 fIntFlowCorrelationsAllEBE->SetBinContent(3,two3n3n);\r
2138 fIntFlowCorrelationsAllEBE->SetBinContent(4,two4n4n);\r
2139 \r
2140 // average 2-particle correlations for all events: \r
2141 fIntFlowCorrelationsAllPro->Fill(0.5,two1n1n,dMult*(dMult-1.)); \r
2142 fIntFlowCorrelationsAllPro->Fill(1.5,two2n2n,dMult*(dMult-1.)); \r
2143 fIntFlowCorrelationsAllPro->Fill(2.5,two3n3n,dMult*(dMult-1.)); \r
2144 fIntFlowCorrelationsAllPro->Fill(3.5,two4n4n,dMult*(dMult-1.)); \r
2145 \r
2146 // store separetately <2> (to be improved: do I really need this?)\r
2147 fIntFlowCorrelationsEBE->SetBinContent(1,two1n1n); // <2>\r
2148 \r
2149 // to be improved (this can be implemented better):\r
2150 Double_t mWeight2p = 0.;\r
2151 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))\r
2152 {\r
2153 mWeight2p = dMult*(dMult-1.);\r
2154 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))\r
2155 {\r
2156 mWeight2p = 1.; \r
2157 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))\r
2158 {\r
2159 mWeight2p = dMult; \r
2160 }\r
2161 \r
2162 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(1,mWeight2p); // eW_<2>\r
2163 fIntFlowCorrelationsPro->Fill(0.5,two1n1n,mWeight2p);\r
2164 \r
2165 // distribution of <cos(n*(phi1-phi2))>:\r
2166 //f2pDistribution->Fill(two1n1n,dMult*(dMult-1.)); \r
2167 } // end of if(dMult>1)\r
2168 \r
2169 // 3-particle:\r
2170 Double_t three2n1n1n = 0.; // <cos(n*(2.*phi1-phi2-phi3))>\r
2171 Double_t three3n2n1n = 0.; // <cos(n*(3.*phi1-2.*phi2-phi3))>\r
2172 Double_t three4n2n2n = 0.; // <cos(n*(4.*phi1-2.*phi2-2.*phi3))>\r
2173 Double_t three4n3n1n = 0.; // <cos(n*(4.*phi1-3.*phi2-phi3))>\r
2174 \r
2175 if(dMult>2)\r
2176 {\r
2177 three2n1n1n = (reQ2nQ1nstarQ1nstar-2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))\r
2178 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))+2.*dMult)\r
3b552efe 2179 / (dMult*(dMult-1.)*(dMult-2.)); \r
a5b7efd0 2180 three3n2n1n = (reQ3nQ2nstarQ1nstar-(pow(dReQ3n,2.)+pow(dImQ3n,2.))\r
2181 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))\r
2182 - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)\r
2183 / (dMult*(dMult-1.)*(dMult-2.));\r
2184 three4n2n2n = (reQ4nQ2nstarQ2nstar-2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))\r
2185 - (pow(dReQ4n,2.)+pow(dImQ4n,2.))+2.*dMult)\r
2186 / (dMult*(dMult-1.)*(dMult-2.)); \r
2187 three4n3n1n = (reQ4nQ3nstarQ1nstar-(pow(dReQ4n,2.)+pow(dImQ4n,2.))\r
2188 - (pow(dReQ3n,2.)+pow(dImQ3n,2.))\r
2189 - (pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult)\r
2190 / (dMult*(dMult-1.)*(dMult-2.)); \r
2191 \r
2192 // average 3-particle correlations for single event: \r
2193 fIntFlowCorrelationsAllEBE->SetBinContent(6,three2n1n1n);\r
2194 fIntFlowCorrelationsAllEBE->SetBinContent(7,three3n2n1n);\r
2195 fIntFlowCorrelationsAllEBE->SetBinContent(8,three4n2n2n);\r
2196 fIntFlowCorrelationsAllEBE->SetBinContent(9,three4n3n1n);\r
2197 \r
2198 // average 3-particle correlations for all events: \r
2199 fIntFlowCorrelationsAllPro->Fill(5.5,three2n1n1n,dMult*(dMult-1.)*(dMult-2.)); \r
2200 fIntFlowCorrelationsAllPro->Fill(6.5,three3n2n1n,dMult*(dMult-1.)*(dMult-2.));\r
2201 fIntFlowCorrelationsAllPro->Fill(7.5,three4n2n2n,dMult*(dMult-1.)*(dMult-2.)); \r
2202 fIntFlowCorrelationsAllPro->Fill(8.5,three4n3n1n,dMult*(dMult-1.)*(dMult-2.)); \r
2203 } // end of if(dMult>2)\r
2204 \r
2205 // 4-particle:\r
2206 Double_t four1n1n1n1n = 0.; // <cos(n*(phi1+phi2-phi3-phi4))>\r
2207 Double_t four2n2n2n2n = 0.; // <cos(2.*n*(phi1+phi2-phi3-phi4))>\r
2208 Double_t four2n1n2n1n = 0.; // <cos(n*(2.*phi1+phi2-2.*phi3-phi4))> \r
2209 Double_t four3n1n1n1n = 0.; // <cos(n*(3.*phi1-phi2-phi3-phi4))> \r
2210 Double_t four4n2n1n1n = 0.; // <cos(n*(4.*phi1-2.*phi2-phi3-phi4))> \r
2211 Double_t four3n1n2n2n = 0.; // <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))> \r
2212 Double_t four3n1n3n1n = 0.; // <cos(n*(3.*phi1+phi2-3.*phi3-phi4))> \r
2213 \r
2214 if(dMult>3)\r
2215 {\r
2216 four1n1n1n1n = (2.*dMult*(dMult-3.)+pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)-4.*(dMult-2.)*(pow(dReQ1n,2.)\r
2217 + pow(dImQ1n,2.))-2.*reQ2nQ1nstarQ1nstar+(pow(dReQ2n,2.)+pow(dImQ2n,2.)))\r
2218 / (dMult*(dMult-1)*(dMult-2.)*(dMult-3.)); \r
2219 four2n2n2n2n = (2.*dMult*(dMult-3.)+pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)-4.*(dMult-2.)*(pow(dReQ2n,2.)\r
2220 + pow(dImQ2n,2.))-2.*reQ4nQ2nstarQ2nstar+(pow(dReQ4n,2.)+pow(dImQ4n,2.)))\r
2221 / (dMult*(dMult-1)*(dMult-2.)*(dMult-3.));\r
2222 four2n1n2n1n = (dQ2nQ1nQ2nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar-2.*reQ2nQ1nstarQ1nstar)\r
2223 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))\r
2224 - ((dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))\r
2225 + (dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-(pow(dReQ3n,2.)+pow(dImQ3n,2.)))\r
2226 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))\r
2227 + (dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.));\r
2228 four3n1n1n1n = (reQ3nQ1nstarQ1nstarQ1nstar-3.*reQ3nQ2nstarQ1nstar-3.*reQ2nQ1nstarQ1nstar)\r
2229 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))\r
2230 + (2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+3.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))\r
2231 + 6.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-6.*dMult)\r
2232 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));\r
2233 four4n2n1n1n = (reQ4nQ2nstarQ1nstarQ1nstar-2.*reQ4nQ3nstarQ1nstar-reQ4nQ2nstarQ2nstar-2.*reQ3nQ2nstarQ1nstar)\r
2234 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))\r
2235 - (reQ2nQ1nstarQ1nstar-2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))\r
2236 - 3.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))\r
2237 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))\r
2238 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));\r
2239 four3n1n2n2n = (reQ3nQ1nQ2nstarQ2nstar-reQ4nQ2nstarQ2nstar-reQ3nQ1nQ4nstar-2.*reQ3nQ2nstarQ1nstar)\r
2240 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))\r
2241 - (2.*reQ1nQ1nQ2nstar-(pow(dReQ4n,2.)+pow(dImQ4n,2.))-2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))\r
2242 - 4.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))\r
2243 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))\r
2244 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.)); \r
2245 four3n1n3n1n = ((pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))\r
2246 - 2.*reQ4nQ3nstarQ1nstar-2.*reQ3nQ2nstarQ1nstar)\r
2247 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))\r
2248 + ((pow(dReQ4n,2.)+pow(dImQ4n,2.))-(dMult-4.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))\r
2249 + (pow(dReQ2n,2.)+pow(dImQ2n,2.))-(dMult-4.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))\r
2250 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.))\r
2251 + (dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.));\r
2252 \r
2253 // average 4-particle correlations for single event: \r
2254 fIntFlowCorrelationsAllEBE->SetBinContent(11,four1n1n1n1n);\r
2255 fIntFlowCorrelationsAllEBE->SetBinContent(12,four2n1n2n1n);\r
2256 fIntFlowCorrelationsAllEBE->SetBinContent(13,four2n2n2n2n);\r
2257 fIntFlowCorrelationsAllEBE->SetBinContent(14,four3n1n1n1n);\r
2258 fIntFlowCorrelationsAllEBE->SetBinContent(15,four3n1n3n1n);\r
2259 fIntFlowCorrelationsAllEBE->SetBinContent(16,four3n1n2n2n);\r
2260 fIntFlowCorrelationsAllEBE->SetBinContent(17,four4n2n1n1n);\r
2261 \r
2262 // average 4-particle correlations for all events: \r
2263 fIntFlowCorrelationsAllPro->Fill(10.5,four1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));\r
2264 fIntFlowCorrelationsAllPro->Fill(11.5,four2n1n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));\r
2265 fIntFlowCorrelationsAllPro->Fill(12.5,four2n2n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));\r
2266 fIntFlowCorrelationsAllPro->Fill(13.5,four3n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));\r
2267 fIntFlowCorrelationsAllPro->Fill(14.5,four3n1n3n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));\r
2268 fIntFlowCorrelationsAllPro->Fill(15.5,four3n1n2n2n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)); \r
2269 fIntFlowCorrelationsAllPro->Fill(16.5,four4n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)); \r
2270 \r
2271 // store separetately <4> (to be improved: do I really need this?)\r
2272 fIntFlowCorrelationsEBE->SetBinContent(2,four1n1n1n1n); // <4>\r
2273 \r
2274 // to be improved (this can be implemented better):\r
2275 Double_t mWeight4p = 0.;\r
2276 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))\r
2277 {\r
2278 mWeight4p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.);\r
2279 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))\r
2280 {\r
2281 mWeight4p = 1.; \r
2282 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))\r
2283 {\r
2284 mWeight4p = dMult; \r
2285 }\r
2286 \r
2287 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(2,mWeight4p); // eW_<4>\r
2288 fIntFlowCorrelationsPro->Fill(1.5,four1n1n1n1n,mWeight4p);\r
2289 \r
2290 // distribution of <cos(n*(phi1+phi2-phi3-phi4))>\r
2291 //f4pDistribution->Fill(four1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));\r
2292 \r
2293 } // end of if(dMult>3)\r
2294\r
2295 // 5-particle:\r
2296 Double_t five2n1n1n1n1n = 0.; // <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>\r
2297 Double_t five2n2n2n1n1n = 0.; // <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>\r
2298 Double_t five3n1n2n1n1n = 0.; // <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>\r
2299 Double_t five4n1n1n1n1n = 0.; // <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>\r
2300 \r
2301 if(dMult>4)\r
2302 {\r
2303 five2n1n1n1n1n = (reQ2nQ1nQ1nstarQ1nstarQ1nstar-reQ3nQ1nstarQ1nstarQ1nstar+6.*reQ3nQ2nstarQ1nstar)\r
2304 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
2305 - (reQ2nQ1nQ3nstar+3.*(dMult-6.)*reQ2nQ1nstarQ1nstar+3.*reQ1nQ1nQ2nstar)\r
2306 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
2307 - (2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))\r
2308 + 3.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.)) \r
2309 - 3.*(dMult-4.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.)))\r
2310 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
2311 - 3.*(pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)\r
2312 - 2.*(2*dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))+2.*dMult*(dMult-4.))\r
2313 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));\r
2314 \r
2315 five2n2n2n1n1n = (reQ2nQ2nQ2nstarQ1nstarQ1nstar-reQ4nQ2nstarQ1nstarQ1nstar-2.*reQ2nQ2nQ3nstarQ1nstar)\r
2316 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
2317 + 2.*(reQ4nQ2nstarQ2nstar+4.*reQ3nQ2nstarQ1nstar+reQ3nQ1nQ4nstar)\r
2318 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
2319 + (reQ2nQ2nQ4nstar-2.*(dMult-5.)*reQ2nQ1nstarQ1nstar+2.*reQ1nQ1nQ2nstar)\r
2320 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
2321 - (2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+4.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))\r
2322 + 1.*pow((pow(dReQ2n,2.)+pow(dImQ2n,2.)),2.)\r
2323 - 2.*(3.*dMult-10.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.)))\r
2324 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
2325 - (4.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*(pow(dReQ2n,2.)+pow(dImQ2n,2.))\r
2326 - 4.*(dMult-5.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))+4.*dMult*(dMult-6.))\r
2327 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)); \r
2328\r
2329 five4n1n1n1n1n = (reQ4nQ1nstarQ1nstarQ1nstarQ1nstar-6.*reQ4nQ2nstarQ1nstarQ1nstar-4.*reQ3nQ1nstarQ1nstarQ1nstar)\r
2330 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
2331 + (8.*reQ4nQ3nstarQ1nstar+3.*reQ4nQ2nstarQ2nstar+12.*reQ3nQ2nstarQ1nstar+12.*reQ2nQ1nstarQ1nstar)\r
2332 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
2333 - (6.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))+8.*(pow(dReQ3n,2.)+pow(dImQ3n,2.))\r
2334 + 12.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))+24.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-24.*dMult)\r
2335 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));\r
2336 \r
2337 five3n1n2n1n1n = (reQ3nQ1nQ2nstarQ1nstarQ1nstar-reQ4nQ2nstarQ1nstarQ1nstar-reQ3nQ1nstarQ1nstarQ1nstar)\r
2338 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
2339 - (reQ3nQ1nQ2nstarQ2nstar-3.*reQ4nQ3nstarQ1nstar-reQ4nQ2nstarQ2nstar)\r
2340 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
2341 - ((2.*dMult-13.)*reQ3nQ2nstarQ1nstar-reQ3nQ1nQ4nstar-9.*reQ2nQ1nstarQ1nstar)\r
2342 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
2343 - (2.*reQ1nQ1nQ2nstar+2.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))\r
2344 - 2.*(dMult-5.)*(pow(dReQ3n,2.)+pow(dImQ3n,2.))+2.*(pow(dReQ3n,2.)\r
2345 + pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))\r
2346 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
2347 + (2.*(dMult-6.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))\r
2348 - 2.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.))\r
2349 - pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)\r
2350 + 2.*(3.*dMult-11.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))\r
2351 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.))\r
2352 - 4.*(dMult-6.)/((dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));\r
2353 \r
2354 // average 5-particle correlations for single event: \r
2355 fIntFlowCorrelationsAllEBE->SetBinContent(19,five2n1n1n1n1n);\r
2356 fIntFlowCorrelationsAllEBE->SetBinContent(20,five2n2n2n1n1n);\r
2357 fIntFlowCorrelationsAllEBE->SetBinContent(21,five3n1n2n1n1n);\r
2358 fIntFlowCorrelationsAllEBE->SetBinContent(22,five4n1n1n1n1n);\r
2359 \r
2360 // average 5-particle correlations for all events: \r
2361 fIntFlowCorrelationsAllPro->Fill(18.5,five2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)); \r
2362 fIntFlowCorrelationsAllPro->Fill(19.5,five2n2n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));\r
2363 fIntFlowCorrelationsAllPro->Fill(20.5,five3n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));\r
2364 fIntFlowCorrelationsAllPro->Fill(21.5,five4n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));\r
2365 } // end of if(dMult>4)\r
2366 \r
2367 // 6-particle:\r
2368 Double_t six1n1n1n1n1n1n = 0.; // <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>\r
2369 Double_t six2n2n1n1n1n1n = 0.; // <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>\r
2370 Double_t six3n1n1n1n1n1n = 0.; // <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>\r
2371 Double_t six2n1n1n2n1n1n = 0.; // <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>\r
2372 \r
2373 if(dMult>5)\r
2374 {\r
2375 six1n1n1n1n1n1n = (pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),3.)+9.*dQ2nQ1nQ2nstarQ1nstar-6.*reQ2nQ1nQ1nstarQ1nstarQ1nstar)\r
2376 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))\r
2377 + 4.*(reQ3nQ1nstarQ1nstarQ1nstar-3.*reQ3nQ2nstarQ1nstar)\r
2378 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))\r
2379 + 2.*(9.*(dMult-4.)*reQ2nQ1nstarQ1nstar+2.*(pow(dReQ3n,2.)+pow(dImQ3n,2.)))\r
2380 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.))\r
2381 - 9.*(pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)+(pow(dReQ2n,2.)+pow(dImQ2n,2.)))\r
2382 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-5.))\r
2383 + (18.*(pow(dReQ1n,2.)+pow(dImQ1n,2.)))\r
2384 / (dMult*(dMult-1)*(dMult-3)*(dMult-4))\r
2385 - 6./((dMult-1.)*(dMult-2.)*(dMult-3.));\r
2386 \r
2387 six2n1n1n2n1n1n = (dQ2nQ1nQ1nQ2nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)\r
2388 * (2.*five2n2n2n1n1n+4.*five2n1n1n1n1n+4.*five3n1n2n1n1n+4.*four2n1n2n1n+1.*four1n1n1n1n)\r
2389 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four1n1n1n1n+4.*two1n1n\r
2390 + 2.*three2n1n1n+2.*three2n1n1n+4.*four3n1n1n1n+8.*three2n1n1n+2.*four4n2n1n1n\r
2391 + 4.*four2n1n2n1n+2.*two2n2n+8.*four2n1n2n1n+4.*four3n1n3n1n+8.*three3n2n1n\r
2392 + 4.*four3n1n2n2n+4.*four1n1n1n1n+4.*four2n1n2n1n+1.*four2n2n2n2n)\r
2393 - dMult*(dMult-1.)*(dMult-2.)*(2.*three2n1n1n+8.*two1n1n+4.*two1n1n+2.\r
2394 + 4.*two1n1n+4.*three2n1n1n+2.*two2n2n+4.*three2n1n1n+8.*three3n2n1n\r
2395 + 8.*two2n2n+4.*three4n3n1n+4.*two3n3n+4.*three3n2n1n+4.*two1n1n\r
2396 + 8.*three2n1n1n+4.*two1n1n+4.*three3n2n1n+4.*three2n1n1n+2.*two2n2n\r
2397 + 4.*three3n2n1n+2.*three4n2n2n)-dMult*(dMult-1.)\r
2398 * (4.*two1n1n+4.+4.*two1n1n+2.*two2n2n+1.+4.*two1n1n+4.*two2n2n+4.*two3n3n\r
2399 + 1.+2.*two2n2n+1.*two4n4n)-dMult)\r
2400 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)\r
2401 \r
2402 six2n2n1n1n1n1n = (reQ2nQ2nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)\r
2403 * (five4n1n1n1n1n+8.*five2n1n1n1n1n+6.*five2n2n2n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)\r
2404 * (4.*four3n1n1n1n+6.*four4n2n1n1n+12.*three2n1n1n+12.*four1n1n1n1n+24.*four2n1n2n1n\r
2405 + 4.*four3n1n2n2n+3.*four2n2n2n2n)-dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+12.*three3n2n1n\r
2406 + 4.*three4n3n1n+3.*three4n2n2n+8.*three2n1n1n+24.*two1n1n+12.*two2n2n+12.*three2n1n1n+8.*three3n2n1n\r
2407 + 1.*three4n2n2n)-dMult*(dMult-1.)*(4.*two1n1n+6.*two2n2n+4.*two3n3n+1.*two4n4n+2.*two2n2n+8.*two1n1n+6.)-dMult)\r
2408 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)\r
2409 \r
2410 six3n1n1n1n1n1n = (reQ3nQ1nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)\r
2411 * (five4n1n1n1n1n+4.*five2n1n1n1n1n+6.*five3n1n2n1n1n+4.*four3n1n1n1n)\r
2412 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four3n1n1n1n+6.*four4n2n1n1n+6.*four1n1n1n1n\r
2413 + 12.*three2n1n1n+12.*four2n1n2n1n+6.*four3n1n1n1n+12.*three3n2n1n+4.*four3n1n3n1n+3.*four3n1n2n2n)\r
2414 - dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+12.*three3n2n1n+4.*three4n3n1n+3.*three4n2n2n+4.*two1n1n\r
2415 + 12.*two1n1n+6.*three2n1n1n+12.*three2n1n1n+4.*three3n2n1n+12.*two2n2n+4.*three3n2n1n+4.*two3n3n+1.*three4n3n1n\r
2416 + 6.*three3n2n1n)-dMult*(dMult-1.)*(4.*two1n1n+6.*two2n2n+4.*two3n3n+1.*two4n4n+1.*two1n1n+4.+6.*two1n1n+4.*two2n2n\r
2417 + 1.*two3n3n)-dMult)/(dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); // to be improved (direct formula needed)\r
2418 \r
2419 // average 6-particle correlations for single event: \r
2420 fIntFlowCorrelationsAllEBE->SetBinContent(24,six1n1n1n1n1n1n);\r
2421 fIntFlowCorrelationsAllEBE->SetBinContent(25,six2n1n1n2n1n1n);\r
2422 fIntFlowCorrelationsAllEBE->SetBinContent(26,six2n2n1n1n1n1n);\r
2423 fIntFlowCorrelationsAllEBE->SetBinContent(27,six3n1n1n1n1n1n);\r
2424 \r
2425 // average 6-particle correlations for all events: \r
2426 fIntFlowCorrelationsAllPro->Fill(23.5,six1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); \r
2427 fIntFlowCorrelationsAllPro->Fill(24.5,six2n1n1n2n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); \r
2428 fIntFlowCorrelationsAllPro->Fill(25.5,six2n2n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));\r
2429 fIntFlowCorrelationsAllPro->Fill(26.5,six3n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); \r
2430\r
2431 // store separetately <6> (to be improved: do I really need this?)\r
2432 fIntFlowCorrelationsEBE->SetBinContent(3,six1n1n1n1n1n1n); // <6>\r
2433 \r
2434 // to be improved (this can be implemented better):\r
2435 Double_t mWeight6p = 0.;\r
2436 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))\r
2437 {\r
2438 mWeight6p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.);\r
2439 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))\r
2440 {\r
2441 mWeight6p = 1.; \r
2442 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))\r
2443 {\r
2444 mWeight6p = dMult; \r
2445 }\r
2446 \r
2447 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(3,mWeight6p); // eW_<6>\r
2448 fIntFlowCorrelationsPro->Fill(2.5,six1n1n1n1n1n1n,mWeight6p);\r
2449 \r
2450 // distribution of <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>\r
2451 //f6pDistribution->Fill(six1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)); \r
2452 } // end of if(dMult>5)\r
2453 \r
2454 // 7-particle:\r
2455 Double_t seven2n1n1n1n1n1n1n = 0.; // <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>\r
2456 \r
2457 if(dMult>6)\r
2458 {\r
2459 seven2n1n1n1n1n1n1n = (reQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)\r
2460 * (2.*six3n1n1n1n1n1n+4.*six1n1n1n1n1n1n+1.*six2n2n1n1n1n1n+6.*six2n1n1n2n1n1n+8.*five2n1n1n1n1n)\r
2461 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(1.*five4n1n1n1n1n +8.*five2n1n1n1n1n+8.*four3n1n1n1n\r
2462 + 12.*five3n1n2n1n1n+4.*five2n1n1n1n1n+3.*five2n2n2n1n1n+6.*five2n2n2n1n1n+6.*four1n1n1n1n+24.*four1n1n1n1n\r
2463 + 12.*five2n1n1n1n1n+12.*five2n1n1n1n1n+12.*three2n1n1n+24.*four2n1n2n1n+4.*five3n1n2n1n1n+4.*five2n1n1n1n1n)\r
2464 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(4.*four3n1n1n1n+6.*four4n2n1n1n+12.*four1n1n1n1n+24.*three2n1n1n\r
2465 + 24.*four2n1n2n1n+12.*four3n1n1n1n+24.*three3n2n1n+8.*four3n1n3n1n+6.*four3n1n2n2n+6.*three2n1n1n+12.*four1n1n1n1n\r
2466 + 12.*four2n1n2n1n+6.*three2n1n1n+12.*four2n1n2n1n+4.*four3n1n2n2n+3.*four2n2n2n2n+4.*four1n1n1n1n+6.*three2n1n1n\r
2467 + 24.*two1n1n+24.*four1n1n1n1n+4.*four3n1n1n1n+24.*two1n1n+24.*three2n1n1n+12.*two2n2n+24.*three2n1n1n+12.*four2n1n2n1n\r
2468 + 8.*three3n2n1n+8.*four2n1n2n1n+1.*four4n2n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(6.*three2n1n1n+1.*three2n1n1n+8.*two1n1n\r
2469 + 12.*three3n2n1n+24.*two1n1n+12.*three2n1n1n+4.*three2n1n1n+8.*two1n1n+4.*three4n3n1n+24.*three2n1n1n+8.*three3n2n1n\r
2470 + 12.*two1n1n+12.*two1n1n+3.*three4n2n2n+24.*two2n2n+6.*two2n2n+12.+12.*three3n2n1n+8.*two3n3n+12.*three2n1n1n+24.*two1n1n\r
2471 + 4.*three3n2n1n+8.*three3n2n1n+2.*three4n3n1n+12.*two1n1n+8.*three2n1n1n+4.*three2n1n1n+2.*three3n2n1n+6.*two2n2n+8.*two2n2n\r
2472 + 1.*three4n2n2n+4.*three3n2n1n+6.*three2n1n1n)-dMult*(dMult-1.)*(4.*two1n1n+2.*two1n1n+6.*two2n2n+8.+1.*two2n2n+4.*two3n3n\r
2473 + 12.*two1n1n+4.*two1n1n+1.*two4n4n+8.*two2n2n+6.+2.*two3n3n+4.*two1n1n+1.*two2n2n)-dMult)\r
2474 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)); // to be improved (direct formula needed)\r
2475 \r
2476 // average 7-particle correlations for single event: \r
2477 fIntFlowCorrelationsAllEBE->SetBinContent(29,seven2n1n1n1n1n1n1n);\r
2478 \r
2479 // average 7-particle correlations for all events: \r
2480 fIntFlowCorrelationsAllPro->Fill(28.5,seven2n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.));\r
2481 } // end of if(dMult>6)\r
2482 \r
2483 // 8-particle:\r
2484 Double_t eight1n1n1n1n1n1n1n1n = 0.; // <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>\r
2485 if(dMult>7)\r
2486 {\r
2487 eight1n1n1n1n1n1n1n1n = (pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),4.)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)\r
2488 * (12.*seven2n1n1n1n1n1n1n+16.*six1n1n1n1n1n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)\r
2489 * (8.*six3n1n1n1n1n1n+48.*six1n1n1n1n1n1n+6.*six2n2n1n1n1n1n+96.*five2n1n1n1n1n+72.*four1n1n1n1n+36.*six2n1n1n2n1n1n)\r
2490 - dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(2.*five4n1n1n1n1n+32.*five2n1n1n1n1n+36.*four1n1n1n1n\r
2491 + 32.*four3n1n1n1n+48.*five2n1n1n1n1n+48.*five3n1n2n1n1n+144.*five2n1n1n1n1n+288.*four1n1n1n1n+36.*five2n2n2n1n1n\r
2492 + 144.*three2n1n1n+96.*two1n1n+144.*four2n1n2n1n)-dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)\r
2493 * (8.*four3n1n1n1n+48.*four1n1n1n1n+12.*four4n2n1n1n+96.*four2n1n2n1n+96.*three2n1n1n+72.*three2n1n1n+144.*two1n1n\r
2494 + 16.*four3n1n3n1n+48.*four3n1n1n1n+144.*four1n1n1n1n+72.*four1n1n1n1n+96.*three3n2n1n+24.*four3n1n2n2n+144.*four2n1n2n1n\r
2495 + 288.*two1n1n+288.*three2n1n1n+9.*four2n2n2n2n+72.*two2n2n+24.)-dMult*(dMult-1.)*(dMult-2.)*(12.*three2n1n1n+16.*two1n1n\r
2496 + 24.*three3n2n1n+48.*three2n1n1n+96.*two1n1n+8.*three4n3n1n+32.*three3n2n1n+96.*three2n1n1n+144.*two1n1n+6.*three4n2n2n\r
2497 + 96.*two2n2n+36.*two2n2n+72.+48.*three3n2n1n+16.*two3n3n+72.*three2n1n1n+144.*two1n1n)-dMult*(dMult-1.)*(8.*two1n1n\r
2498 + 12.*two2n2n+16.+8.*two3n3n+48.*two1n1n+1.*two4n4n+16.*two2n2n+18.)-dMult)\r
2499 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.)); // to be improved (direct formula needed)\r
2500 \r
2501 // average 8-particle correlations for single event: \r
2502 fIntFlowCorrelationsAllEBE->SetBinContent(31,eight1n1n1n1n1n1n1n1n);\r
2503 \r
2504 // average 8-particle correlations for all events: \r
2505 fIntFlowCorrelationsAllPro->Fill(30.5,eight1n1n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.));\r
2506 \r
2507 // store separetately <8> (to be improved: do I really need this?)\r
2508 fIntFlowCorrelationsEBE->SetBinContent(4,eight1n1n1n1n1n1n1n1n); // <8>\r
2509 \r
2510 // to be improved (this can be implemented better):\r
2511 Double_t mWeight8p = 0.;\r
2512 if(!strcmp(fMultiplicityWeight->Data(),"combinations"))\r
2513 {\r
2514 mWeight8p = dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.);\r
2515 } else if(!strcmp(fMultiplicityWeight->Data(),"unit"))\r
2516 {\r
2517 mWeight8p = 1.; \r
2518 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))\r
2519 {\r
2520 mWeight8p = dMult; \r
2521 }\r
2522 \r
2523 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(4,mWeight8p); // eW_<8>\r
2524 fIntFlowCorrelationsPro->Fill(3.5,eight1n1n1n1n1n1n1n1n,mWeight8p); \r
2525 \r
2526 // distribution of <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>\r
2527 //f8pDistribution->Fill(eight1n1n1n1n1n1n1n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.)*(dMult-6.)*(dMult-7.));\r
2528 } // end of if(dMult>7) \r
2529 \r
2530} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelations()\r
2531\r
2532\r
2533//================================================================================================================================\r
2534\r
2535\r
2536void AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrelations()\r
2537{\r
2538 // Calculate averages of products of correlations for integrated flow // to be improved (this method can be implemented better)\r
2539 \r
2540 // a) Binning of fIntFlowProductOfCorrelationsPro is organized as follows:\r
2541 // 1st bin: <<2><4>> \r
2542 // 2nd bin: <<2><6>>\r
2543 // 3rd bin: <<2><8>>\r
2544 // 4th bin: <<4><6>>\r
2545 // 5th bin: <<4><8>>\r
2546 // 6th bin: <<6><8>>\r
2547\r
2548 /*\r
2549 Double_t dMult = (*fSMpk)(0,0); // multiplicity \r
2550\r
2551 Double_t twoEBE = fIntFlowCorrelationsEBE->GetBinContent(1); // <2>\r
2552 Double_t fourEBE = fIntFlowCorrelationsEBE->GetBinContent(2); // <4>\r
2553 Double_t sixEBE = fIntFlowCorrelationsEBE->GetBinContent(3); // <6>\r
2554 Double_t eightEBE = fIntFlowCorrelationsEBE->GetBinContent(4); // <8>\r
2555 \r
2556 Double_t eW2 = 0.; // event weight for <2>\r
2557 Double_t eW4 = 0.; // event weight for <4>\r
2558 Double_t eW6 = 0.; // event weight for <6>\r
2559 Double_t eW8 = 0.; // event weight for <8>\r
2560 \r
2561 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))\r
2562 {\r
2563 eW2 = dMult*(dMult-1);\r
2564 eW4 = dMult*(dMult-1)*(dMult-2)*(dMult-3);\r
2565 eW6 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5);\r
2566 eW8 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7);\r
2567 } else \r
2568 {\r
2569 eW2 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j;\r
2570 eW4 = (*fSMpk)(3,1)-6.*(*fSMpk)(0,2)*(*fSMpk)(1,1) \r
2571 + 8.*(*fSMpk)(0,3)*(*fSMpk)(0,1)\r
2572 + 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
2573 }\r
2574 \r
2575 fIntFlowProductOfCorrelationsPro->Fill(0.5,twoEBE*fourEBE,eW2*eW4); // <<2><4>> \r
2576 fIntFlowProductOfCorrelationsPro->Fill(1.5,twoEBE*sixEBE,eW2*eW6); // <<2><6>>\r
2577 fIntFlowProductOfCorrelationsPro->Fill(2.5,twoEBE*eightEBE,eW2*eW8); // <<2><8>>\r
2578 fIntFlowProductOfCorrelationsPro->Fill(3.5,fourEBE*sixEBE,eW4*eW6); // <<4><6>>\r
2579 fIntFlowProductOfCorrelationsPro->Fill(4.5,fourEBE*eightEBE,eW4*eW8); // <<4><8>>\r
2580 fIntFlowProductOfCorrelationsPro->Fill(5.5,sixEBE*eightEBE,eW6*eW8); // <<6><8>>\r
2581 */\r
2582 \r
2583 \r
2584 Int_t counter = 0;\r
2585 \r
2586 for(Int_t ci1=1;ci1<4;ci1++)\r
2587 {\r
2588 for(Int_t ci2=ci1+1;ci2<=4;ci2++)\r
2589 {\r
2590 fIntFlowProductOfCorrelationsPro->Fill(0.5+counter++,\r
2591 fIntFlowCorrelationsEBE->GetBinContent(ci1)*fIntFlowCorrelationsEBE->GetBinContent(ci2),\r
2592 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));\r
2593 }\r
2594 }\r
2595 \r
2596} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowProductOfCorrelations()\r
2597\r
2598\r
2599//================================================================================================================================\r
2600\r
2601\r
2602void AliFlowAnalysisWithQCumulants::CalculateCovariancesIntFlow()\r
2603{\r
2604 // a) Calculate unbiased estimators Cov(<2>,<4>), Cov(<2>,<6>), Cov(<2>,<8>), Cov(<4>,<6>), Cov(<4>,<8>) and Cov(<6>,<8>)\r
2605 // for covariances V_(<2>,<4>), V_(<2>,<6>), V_(<2>,<8>), V_(<4>,<6>), V_(<4>,<8>) and V_(<6>,<8>).\r
2606 // b) Store in histogram fIntFlowCovariances for instance the following: \r
2607 //\r
2608 // 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
2609 // \r
2610 // where N is the number of events, w_{<2>} is event weight for <2> and w_{<4>} is event weight for <4>.\r
2611 // c) Binning of fIntFlowCovariances is organized as follows:\r
2612 // \r
2613 // 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
2614 // 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
2615 // 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
2616 // 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
2617 // 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
2618 // 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
2619 \r
2620 for(Int_t power=0;power<2;power++)\r
2621 { \r
2622 if(!(fIntFlowCorrelationsPro && fIntFlowProductOfCorrelationsPro \r
2623 && fIntFlowSumOfEventWeights[power] && fIntFlowSumOfProductOfEventWeights\r
2624 && fIntFlowCovariances)) \r
2625 {\r
2626 cout<<"WARNING: fIntFlowCorrelationsPro && fIntFlowProductOfCorrelationsPro "<<endl;\r
2627 cout<<" && fIntFlowSumOfEventWeights[power] && fIntFlowSumOfProductOfEventWeights"<<endl;\r
2628 cout<<" && fIntFlowCovariances is NULL in AFAWQC::FCIF() !!!!"<<endl;\r
2629 cout<<"power = "<<power<<endl;\r
2630 exit(0);\r
2631 }\r
2632 }\r
2633 \r
2634 // average 2-, 4-, 6- and 8-particle correlations for all events:\r
2635 Double_t correlation[4] = {0.};\r
2636 for(Int_t ci=0;ci<4;ci++)\r
2637 {\r
2638 correlation[ci] = fIntFlowCorrelationsPro->GetBinContent(ci+1);\r
2639 } \r
2640 // average products of 2-, 4-, 6- and 8-particle correlations: \r
2641 Double_t productOfCorrelations[4][4] = {{0.}};\r
2642 Int_t productOfCorrelationsLabel = 1;\r
2643 // denominators in the expressions for the unbiased estimator for covariance:\r
2644 Double_t denominator[4][4] = {{0.}};\r
2645 Int_t sumOfProductOfEventWeightsLabel1 = 1;\r
2646 // weight dependent prefactor which multiply unbiased estimators for covariances:\r
2647 Double_t wPrefactor[4][4] = {{0.}}; \r
2648 Int_t sumOfProductOfEventWeightsLabel2 = 1;\r
2649 for(Int_t c1=0;c1<4;c1++)\r
2650 {\r
2651 for(Int_t c2=c1+1;c2<4;c2++)\r
2652 {\r
2653 productOfCorrelations[c1][c2] = fIntFlowProductOfCorrelationsPro->GetBinContent(productOfCorrelationsLabel);\r
2654 if(fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1) && fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1))\r
2655 {\r
2656 denominator[c1][c2] = 1.-(fIntFlowSumOfProductOfEventWeights->GetBinContent(sumOfProductOfEventWeightsLabel1))/\r
2657 (fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1) \r
2658 * fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1));\r
2659 \r
2660 wPrefactor[c1][c2] = fIntFlowSumOfProductOfEventWeights->GetBinContent(sumOfProductOfEventWeightsLabel2)/ \r
2661 (fIntFlowSumOfEventWeights[0]->GetBinContent(c1+1)\r
2662 * fIntFlowSumOfEventWeights[0]->GetBinContent(c2+1));\r
2663 \r
2664 \r
2665 }\r
2666 productOfCorrelationsLabel++;\r
2667 sumOfProductOfEventWeightsLabel1++;\r
2668 sumOfProductOfEventWeightsLabel2++; \r
2669 }\r
2670 }\r
2671 \r
2672 // covariance label:\r
2673 Int_t covarianceLabel = 1;\r
2674 for(Int_t c1=0;c1<4;c1++)\r
2675 {\r
2676 for(Int_t c2=c1+1;c2<4;c2++)\r
2677 {\r
2678 if(denominator[c1][c2])\r
2679 {\r
2680 // covariances:\r
2681 Double_t cov = (productOfCorrelations[c1][c2]-correlation[c1]*correlation[c2])/denominator[c1][c2]; \r
2682 // covarianced multiplied with weight dependent prefactor:\r
2683 Double_t wCov = cov * wPrefactor[c1][c2];\r
2684 fIntFlowCovariances->SetBinContent(covarianceLabel,wCov);\r
2685 }\r
2686 covarianceLabel++;\r
2687 }\r
2688 }\r
2689 \r
2690} // end of AliFlowAnalysisWithQCumulants::CalculateCovariancesIntFlow()\r
2691\r
2692\r
2693//================================================================================================================================\r
2694\r
2695\r
2696void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsIntFlow() \r
2697{\r
2698 // From profile fIntFlowCorrelationsPro access measured correlations and spread, \r
2699 // correctly calculate the statistical errors and store the final results and \r
2700 // statistical errors for correlations in histogram fIntFlowCorrelationsHist.\r
2701 //\r
2702 // Remark: Statistical error of correlation is calculated as:\r
2703 //\r
2704 // statistical error = termA * spread * termB:\r
2705 // termA = sqrt{sum_{i=1}^{N} w^2}/(sum_{i=1}^{N} w)\r
2706 // termB = 1/sqrt(1-termA^2) \r
2707 \r
2708 for(Int_t power=0;power<2;power++)\r
2709 { \r
2710 if(!(fIntFlowCorrelationsHist && fIntFlowCorrelationsPro && fIntFlowSumOfEventWeights[power])) \r
2711 {\r
2712 cout<<"WARNING: fIntFlowCorrelationsHist && fIntFlowCorrelationsPro && fIntFlowSumOfEventWeights[power] is NULL in AFAWQC::FCIF() !!!!"<<endl;\r
2713 cout<<"power = "<<power<<endl;\r
2714 exit(0);\r
2715 }\r
2716 }\r
2717 \r
2718 for(Int_t ci=1;ci<=4;ci++) // correlation index\r
2719 {\r
2720 Double_t correlation = fIntFlowCorrelationsPro->GetBinContent(ci);\r
2721 Double_t spread = fIntFlowCorrelationsPro->GetBinError(ci);\r
2722 Double_t sumOfLinearEventWeights = fIntFlowSumOfEventWeights[0]->GetBinContent(ci);\r
2723 Double_t sumOfQuadraticEventWeights = fIntFlowSumOfEventWeights[1]->GetBinContent(ci);\r
2724 Double_t termA = 0.;\r
2725 Double_t termB = 0.;\r
2726 if(sumOfLinearEventWeights)\r
2727 {\r
2728 termA = pow(sumOfQuadraticEventWeights,0.5)/sumOfLinearEventWeights;\r
2729 } else\r
2730 {\r
2731 cout<<"WARNING: sumOfLinearEventWeights == 0 in AFAWQC::FCIF() !!!!"<<endl;\r
2732 cout<<" (for "<<2*ci<<"-particle correlation)"<<endl;\r
2733 }\r
2734 if(1.-pow(termA,2.) > 0.)\r
2735 {\r
2736 termB = 1./pow(1-pow(termA,2.),0.5);\r
2737 } else\r
2738 {\r
2739 cout<<"WARNING: 1.-pow(termA,2.) <= 0 in AFAWQC::FCIF() !!!!"<<endl; \r
2740 cout<<" (for "<<2*ci<<"-particle correlation)"<<endl;\r
2741 } \r
2742 Double_t statisticalError = termA * spread * termB;\r
2743 fIntFlowCorrelationsHist->SetBinContent(ci,correlation);\r
2744 fIntFlowCorrelationsHist->SetBinError(ci,statisticalError);\r
2745 } // end of for(Int_t ci=1;ci<=4;ci++) // correlation index \r
2746 \r
2747} // end of AliFlowAnalysisWithQCumulants::FinalizeCorrelationsIntFlow()\r
2748\r
2749\r
2750//================================================================================================================================\r
2751\r
2752\r
2753void AliFlowAnalysisWithQCumulants::FillAverageMultiplicities(Int_t nRP)\r
2754{\r
2755 // Fill profile fAverageMultiplicity to hold average multiplicities and number of events for events with nRP>=0, nRP>=1, ... , and nRP>=8\r
2756 \r
2757 // Binning of fAverageMultiplicity is organized as follows:\r
2758 // 1st bin: all events (including the empty ones)\r
2759 // 2nd bin: event with # of RPs greater or equal to 1\r
2760 // 3rd bin: event with # of RPs greater or equal to 2\r
2761 // 4th bin: event with # of RPs greater or equal to 3\r
2762 // 5th bin: event with # of RPs greater or equal to 4\r
2763 // 6th bin: event with # of RPs greater or equal to 5\r
2764 // 7th bin: event with # of RPs greater or equal to 6\r
2765 // 8th bin: event with # of RPs greater or equal to 7\r
2766 // 9th bin: event with # of RPs greater or equal to 8\r
2767 \r
2768 if(!fAvMultiplicity)\r
2769 {\r
2770 cout<<"WARNING: fAvMultiplicity is NULL in AFAWQC::FAM() !!!!"<<endl;\r
2771 exit(0);\r
2772 }\r
2773 \r
2774 if(nRP<0)\r
2775 {\r
2776 cout<<"WARNING: nRP<0 in in AFAWQC::FAM() !!!!"<<endl;\r
2777 exit(0);\r
2778 }\r
2779 \r
2780 for(Int_t i=0;i<9;i++)\r
2781 {\r
2782 if(nRP>=i) fAvMultiplicity->Fill(i+0.5,nRP,1);\r
2783 }\r
2784 \r
2785} // end of AliFlowAnalysisWithQCumulants::FillAverageMultiplicities(nRP)\r
2786\r
2787\r
2788//================================================================================================================================\r
2789\r
2790\r
2791void AliFlowAnalysisWithQCumulants::CalculateCumulantsIntFlow()\r
2792{\r
2793 // a) Calculate Q-cumulants from the measured multiparticle correlations.\r
2794 // b) Propagate the statistical errors of measured multiparticle correlations to statistical errors of Q-cumulants. \r
2795 // c) REMARK: Q-cumulants calculated in this method are biased by non-uniform acceptance of detector !!!! \r
2796 // Method ApplyCorrectionForNonUniformAcceptance* (to be improved: finalize the name here)\r
2797 // is called afterwards to correct for this bias. \r
2798 // d) Store the results and statistical error of Q-cumulants in histogram fCumulants.\r
2799 // Binning of fCumulants is organized as follows:\r
2800 //\r
2801 // 1st bin: QC{2}\r
2802 // 2nd bin: QC{4}\r
2803 // 3rd bin: QC{6}\r
2804 // 4th bin: QC{8}\r
2805 \r
2806 if(!(fIntFlowCorrelationsHist && fIntFlowCovariances && fIntFlowQcumulants))\r
2807 {\r
2808 cout<<"WARNING: fIntFlowCorrelationsHist && fIntFlowCovariances && fIntFlowQcumulants is NULL in AFAWQC::CCIF() !!!!"<<endl;\r
2809 exit(0);\r
2810 }\r
2811 \r
2812 // correlations:\r
2813 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>> \r
2814 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>> \r
2815 Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>> \r
2816 Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>> \r
2817 \r
2818 // statistical errors of average 2-, 4-, 6- and 8-particle azimuthal correlations:\r
2819 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <2> \r
2820 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <4> \r
2821 Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <6> \r
2822 Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <8> \r
2823 \r
2824 // covariances (multiplied by prefactor depending on weights - see comments in CalculateCovariancesIntFlow()):\r
2825 Double_t wCov24 = fIntFlowCovariances->GetBinContent(1); // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)\r
2826 Double_t wCov26 = fIntFlowCovariances->GetBinContent(2); // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)\r
2827 Double_t wCov28 = fIntFlowCovariances->GetBinContent(3); // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)\r
2828 Double_t wCov46 = fIntFlowCovariances->GetBinContent(4); // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)\r
2829 Double_t wCov48 = fIntFlowCovariances->GetBinContent(5); // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)\r
2830 Double_t wCov68 = fIntFlowCovariances->GetBinContent(6); // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)\r
2831 \r
2832 // Q-cumulants: \r
2833 Double_t qc2 = 0.; // QC{2}\r
2834 Double_t qc4 = 0.; // QC{4}\r
2835 Double_t qc6 = 0.; // QC{6}\r
2836 Double_t qc8 = 0.; // QC{8}\r
2837 if(two) qc2 = two; \r
2838 if(four) qc4 = four-2.*pow(two,2.); \r
2839 if(six) qc6 = six-9.*two*four+12.*pow(two,3.); \r
2840 if(eight) qc8 = eight-16.*two*six-18.*pow(four,2.)+144.*pow(two,2.)*four-144.*pow(two,4.); \r
2841 \r
2842 // statistical errors of Q-cumulants: \r
2843 Double_t qc2Error = 0.;\r
2844 Double_t qc4Error = 0.;\r
2845 Double_t qc6Error = 0.;\r
2846 Double_t qc8Error = 0.;\r
2847 \r
2848 // squared statistical errors of Q-cumulants: \r
2849 //Double_t qc2ErrorSquared = 0.;\r
2850 Double_t qc4ErrorSquared = 0.;\r
2851 Double_t qc6ErrorSquared = 0.;\r
2852 Double_t qc8ErrorSquared = 0.;\r
2853 \r
2854 // statistical error of QC{2}: \r
2855 qc2Error = twoError; \r
2856 \r
2857 // statistical error of QC{4}: \r
2858 qc4ErrorSquared = 16.*pow(two,2.)*pow(twoError,2)+pow(fourError,2.)\r
2859 - 8.*two*wCov24; \r
2860 if(qc4ErrorSquared>0.)\r
2861 {\r
2862 qc4Error = pow(qc4ErrorSquared,0.5);\r
2863 } else \r
2864 {\r
2865 cout<<"WARNING: Statistical error of QC{4} is imaginary !!!!"<<endl;\r
2866 }\r
2867 \r
2868 // statistical error of QC{6}: \r
2869 qc6ErrorSquared = 81.*pow(4.*pow(two,2.)-four,2.)*pow(twoError,2.)\r
2870 + 81.*pow(two,2.)*pow(fourError,2.)\r
2871 + pow(sixError,2.)\r
2872 - 162.*two*(4.*pow(two,2.)-four)*wCov24\r
2873 + 18.*(4.*pow(two,2.)-four)*wCov26\r
2874 - 18.*two*wCov46; \r
2875 \r
2876 if(qc6ErrorSquared>0.)\r
2877 {\r
2878 qc6Error = pow(qc6ErrorSquared,0.5);\r
2879 } else \r
2880 {\r
2881 cout<<"WARNING: Statistical error of QC{6} is imaginary !!!!"<<endl;\r
2882 }\r
2883 \r
2884 // statistical error of QC{8}: \r
2885 qc8ErrorSquared = 256.*pow(36.*pow(two,3.)-18.*four*two+six,2.)*pow(twoError,2.)\r
2886 + 1296.*pow(4.*pow(two,2.)-four,2.)*pow(fourError,2.)\r
2887 + 256.*pow(two,2.)*pow(sixError,2.)\r
2888 + pow(eightError,2.)\r
2889 - 1152.*(36.*pow(two,3.)-18.*four*two+six)*(4.*pow(two,2.)-four)*wCov24\r
2890 + 512.*two*(36.*pow(two,3.)-18.*four*two+six)*wCov26\r
2891 - 32.*(36.*pow(two,3.)-18.*four*two+six)*wCov28\r
2892 - 1152.*two*(4.*pow(two,2.)-four)*wCov46\r
2893 + 72.*(4.*pow(two,2.)-four)*wCov48\r
2894 - 32.*two*wCov68; \r
2895 if(qc8ErrorSquared>0.)\r
2896 {\r
2897 qc8Error = pow(qc8ErrorSquared,0.5);\r
2898 } else \r
2899 {\r
2900 cout<<"WARNING: Statistical error of QC{8} is imaginary !!!!"<<endl;\r
2901 }\r
2902\r
2903 // store the results and statistical errors for Q-cumulants:\r
2904 fIntFlowQcumulants->SetBinContent(1,qc2);\r
2905 fIntFlowQcumulants->SetBinError(1,qc2Error);\r
2906 fIntFlowQcumulants->SetBinContent(2,qc4);\r
2907 fIntFlowQcumulants->SetBinError(2,qc4Error);\r
2908 fIntFlowQcumulants->SetBinContent(3,qc6);\r
2909 fIntFlowQcumulants->SetBinError(3,qc6Error);\r
2910 fIntFlowQcumulants->SetBinContent(4,qc8); \r
2911 fIntFlowQcumulants->SetBinError(4,qc8Error); \r
2912 \r
2913} // end of AliFlowAnalysisWithQCumulants::CalculateCumulantsIntFlow()\r
2914\r
2915\r
2916//================================================================================================================================ \r
2917\r
2918\r
2919void AliFlowAnalysisWithQCumulants::CalculateIntFlow()\r
2920{\r
2921 // a) Calculate the final results for integrated flow estimates from Q-cumulants.\r
2922 // b) Propagate the statistical errors of measured multiparticle correlations to statistical errors of integrated flow estimates. \r
2923 // c) Store the results and statistical errors of integrated flow estimates in histogram fIntFlow.\r
2924 // Binning of fIntFlow is organized as follows:\r
2925 //\r
2926 // 1st bin: v{2,QC}\r
2927 // 2nd bin: v{4,QC}\r
2928 // 3rd bin: v{6,QC}\r
2929 // 4th bin: v{8,QC}\r
2930 \r
2931 if(!(fIntFlowCorrelationsHist && fIntFlowCovariances && fIntFlowQcumulants && fIntFlow))\r
2932 {\r
2933 cout<<"WARNING: fIntFlowCorrelationsHist && fIntFlowCovariances && fIntFlowQcumulants && fIntFlow is NULL in AFAWQC::CCIF() !!!!"<<endl;\r
2934 exit(0);\r
2935 }\r
2936 \r
2937 // Q-cumulants:\r
2938 Double_t qc2 = fIntFlowQcumulants->GetBinContent(1); // QC{2} \r
2939 Double_t qc4 = fIntFlowQcumulants->GetBinContent(2); // QC{4} \r
2940 Double_t qc6 = fIntFlowQcumulants->GetBinContent(3); // QC{6} \r
2941 Double_t qc8 = fIntFlowQcumulants->GetBinContent(4); // QC{8}\r
2942 \r
2943 // correlations:\r
2944 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>> \r
2945 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>> \r
2946 Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>> \r
2947 Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>> \r
2948 \r
2949 // statistical errors of average 2-, 4-, 6- and 8-particle azimuthal correlations:\r
2950 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <2> \r
2951 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <4> \r
2952 Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <6> \r
2953 Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <8> \r
2954 \r
2955 // covariances (multiplied by prefactor depending on weights - see comments in CalculateCovariancesIntFlow()):\r
2956 Double_t wCov24 = fIntFlowCovariances->GetBinContent(1); // Cov(<2>,<4>) * prefactor(w_<2>,w_<4>)\r
2957 Double_t wCov26 = fIntFlowCovariances->GetBinContent(2); // Cov(<2>,<6>) * prefactor(w_<2>,w_<6>)\r
2958 Double_t wCov28 = fIntFlowCovariances->GetBinContent(3); // Cov(<2>,<8>) * prefactor(w_<2>,w_<8>)\r
2959 Double_t wCov46 = fIntFlowCovariances->GetBinContent(4); // Cov(<4>,<6>) * prefactor(w_<4>,w_<6>)\r
2960 Double_t wCov48 = fIntFlowCovariances->GetBinContent(5); // Cov(<4>,<8>) * prefactor(w_<4>,w_<8>)\r
2961 Double_t wCov68 = fIntFlowCovariances->GetBinContent(6); // Cov(<6>,<8>) * prefactor(w_<6>,w_<8>)\r
2962 \r
2963 // integrated flow estimates:\r
2964 Double_t v2 = 0.; // v{2,QC} \r
2965 Double_t v4 = 0.; // v{4,QC} \r
2966 Double_t v6 = 0.; // v{6,QC} \r
2967 Double_t v8 = 0.; // v{8,QC}\r
2968 \r
2969 // calculate integrated flow estimates from Q-cumulants: \r
2970 if(qc2>=0.) v2 = pow(qc2,1./2.); \r
2971 if(qc4<=0.) v4 = pow(-1.*qc4,1./4.); \r
2972 if(qc6>=0.) v6 = pow((1./4.)*qc6,1./6.); \r
2973 if(qc8<=0.) v8 = pow((-1./33.)*qc8,1./8.); \r
2974 \r
2975 // statistical errors of integrated flow estimates:\r
2976 Double_t v2Error = 0.; // statistical error of v{2,QC} \r
2977 Double_t v4Error = 0.; // statistical error of v{4,QC} \r
2978 Double_t v6Error = 0.; // statistical error of v{6,QC} \r
2979 Double_t v8Error = 0.; // statistical error of v{8,QC}\r
2980 \r
2981 // squares of statistical errors of integrated flow estimates:\r
2982 Double_t v2ErrorSquared = 0.; // squared statistical error of v{2,QC} \r
2983 Double_t v4ErrorSquared = 0.; // squared statistical error of v{4,QC} \r
2984 Double_t v6ErrorSquared = 0.; // squared statistical error of v{6,QC} \r
2985 Double_t v8ErrorSquared = 0.; // squared statistical error of v{8,QC} \r
2986 \r
2987 // calculate squared statistical errors of integrated flow estimates:\r
2988 if(two > 0.) \r
2989 { \r
2990 v2ErrorSquared = (1./(4.*two))*pow(twoError,2.);\r
2991 } \r
2992 if(2.*pow(two,2.)-four > 0.)\r
2993 {\r
2994 v4ErrorSquared = (1./pow(2.*pow(two,2.)-four,3./2.))*\r
2995 (pow(two,2.)*pow(twoError,2.)+(1./16.)*pow(fourError,2.)-(1./2.)*two*wCov24);\r
2996 }\r
2997 if(six-9.*four*two+12.*pow(two,3.) > 0.) \r
2998 {\r
2999 v6ErrorSquared = ((1./2.)*(1./pow(2.,2./3.))*(1./pow(six-9.*four*two+12.*pow(two,3.),5./3.)))*\r
3000 ((9./2.)*pow(4.*pow(two,2.)-four,2.)*pow(twoError,2.) \r
3001 + (9./2.)*pow(two,2.)*pow(fourError,2.)+(1./18.)*pow(sixError,2.)\r
3002 - 9.*two*(4.*pow(two,2.)-four)*wCov24+(4.*pow(two,2.)-four)*wCov26-two*wCov46); \r
3003 }\r
3004 if(-1.*eight+16.*six*two+18.*pow(four,2.)-144.*four*pow(two,2.)+144.*pow(two,4.) > 0.) \r
3005 {\r
3006 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
3007 (pow(36.*pow(two,3.)-18.*four*two+six,2.)*pow(twoError,2.)\r
3008 + (81./16.)*pow(4.*pow(two,2.)-four,2.)*pow(fourError,2.)\r
3009 + pow(two,2.)*pow(sixError,2.)\r
3010 + (1./256.)*pow(eightError,2.)\r
3011 - (9./2.)*(36.*pow(two,3.)-18.*four*two+six)*(4.*pow(two,2.)-four)*wCov24\r
3012 + 2.*two*(36.*pow(two,3.)-18.*four*two+six)*wCov26\r
3013 - (1./8.)*(36.*pow(two,3.)-18.*four*two+six)*wCov28 \r
3014 - (9./2.)*two*(4.*pow(two,2.)-four)*wCov46 \r
3015 + (9./32.)*(4.*pow(two,2.)-four)*wCov48 \r
3016 - (1./8.)*two*wCov68);\r
3017 } \r
3018\r
3019 // calculate statistical errors of integrated flow estimates: \r
3020 if(v2ErrorSquared > 0.)\r
3021 {\r
3022 v2Error = pow(v2ErrorSquared,0.5);\r
3023 } else\r
3024 {\r
3025 cout<<"WARNING: Statistical error of v{2,QC} is imaginary !!!!"<<endl;\r
3026 } \r
3027 if(v4ErrorSquared > 0.)\r
3028 {\r
3029 v4Error = pow(v4ErrorSquared,0.5);\r
3030 } else\r
3031 {\r
3032 cout<<"WARNING: Statistical error of v{4,QC} is imaginary !!!!"<<endl;\r
3033 } \r
3034 if(v6ErrorSquared > 0.)\r
3035 {\r
3036 v6Error = pow(v6ErrorSquared,0.5);\r
3037 } else\r
3038 {\r
3039 cout<<"WARNING: Statistical error of v{6,QC} is imaginary !!!!"<<endl;\r
3040 } \r
3041 if(v8ErrorSquared > 0.)\r
3042 {\r
3043 v8Error = pow(v8ErrorSquared,0.5);\r
3044 } else\r
3045 {\r
3046 cout<<"WARNING: Statistical error of v{8,QC} is imaginary !!!!"<<endl;\r
3047 } \r
3048 \r
3049 // store the results and statistical errors of integrated flow estimates:\r
3050 fIntFlow->SetBinContent(1,v2);\r
3051 fIntFlow->SetBinError(1,v2Error);\r
3052 fIntFlow->SetBinContent(2,v4);\r
3053 fIntFlow->SetBinError(2,v4Error);\r
3054 fIntFlow->SetBinContent(3,v6);\r
3055 fIntFlow->SetBinError(3,v6Error);\r
3056 fIntFlow->SetBinContent(4,v8);\r
3057 fIntFlow->SetBinError(4,v8Error);\r
3058 \r
3059} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlow()\r
3060\r
3061\r
3062//================================================================================================================================ \r
3063\r
3064\r
3065void AliFlowAnalysisWithQCumulants::FillCommonHistResultsIntFlow()\r
3066{\r
3067 // Fill in AliFlowCommonHistResults histograms relevant for 'NONAME' integrated flow (to be improved (name))\r
3068 \r
3069 if(!fIntFlow)\r
3070 {\r
3071 cout<<"WARNING: fIntFlow is NULL in AFAWQC::FCHRIF() !!!!"<<endl;\r
3072 exit(0); \r
3073 } \r
3074 \r
3075 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))\r
3076 {\r
3077 cout<<"WARNING: fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th"<<endl; \r
3078 cout<<" is NULL in AFAWQC::FCHRIF() !!!!"<<endl;\r
3079 exit(0);\r
3080 }\r
3081 \r
3082 Double_t v2 = fIntFlow->GetBinContent(1);\r
3083 Double_t v4 = fIntFlow->GetBinContent(2);\r
3084 Double_t v6 = fIntFlow->GetBinContent(3);\r
3085 Double_t v8 = fIntFlow->GetBinContent(4);\r
3086 \r
3087 Double_t v2Error = fIntFlow->GetBinError(1);\r
3088 Double_t v4Error = fIntFlow->GetBinError(2);\r
3089 Double_t v6Error = fIntFlow->GetBinError(3);\r
3090 Double_t v8Error = fIntFlow->GetBinError(4);\r
3091 \r
3092 fCommonHistsResults2nd->FillIntegratedFlow(v2,v2Error); // to be improved (hardwired 2nd in the name) \r
3093 fCommonHistsResults4th->FillIntegratedFlow(v4,v4Error); // to be improved (hardwired 4th in the name)\r
3094 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)) // to be improved (calculate also 6th and 8th order)\r
3095 {\r
3096 fCommonHistsResults6th->FillIntegratedFlow(v6,v6Error); // to be improved (hardwired 6th in the name)\r
3097 fCommonHistsResults8th->FillIntegratedFlow(v8,v8Error); // to be improved (hardwired 8th in the name) \r
3098 }\r
3099 \r
3100} // end of AliFlowAnalysisWithQCumulants::FillCommonHistResultsIntFlow()\r
3101\r
3102\r
3103//================================================================================================================================ \r
3104\r
3105\r
3106/*\r
3107void AliFlowAnalysisWithQCumulants::ApplyCorrectionForNonUniformAcceptanceToCumulantsForIntFlow(Bool_t useParticleWeights, TString eventWeights)\r
3108{\r
3109 // apply correction for non-uniform acceptance to cumulants for integrated flow \r
3110 // (Remark: non-corrected cumulants are accessed from fCumulants[pW][0], corrected cumulants are stored in fCumulants[pW][1])\r
3111 \r
3112 // shortcuts for the flags:\r
3113 Int_t pW = (Int_t)(useParticleWeights); // 0=pWeights not used, 1=pWeights used\r
3114 Int_t eW = -1;\r
3115 \r
3116 if(eventWeights == "exact")\r
3117 {\r
3118 eW = 0;\r
3119 }\r
3120 \r
3121 if(!(fCumulants[pW][eW][0] && fCumulants[pW][eW][1] && fCorrections[pW][eW]))\r
3122 {\r
3123 cout<<"WARNING: fCumulants[pW][eW][0] && fCumulants[pW][eW][1] && fCorrections[pW][eW] is NULL in AFAWQC::ACFNUATCFIF() !!!!"<<endl;\r
3124 cout<<"pW = "<<pW<<endl;\r
3125 cout<<"eW = "<<eW<<endl;\r
3126 exit(0);\r
3127 } \r
3128 \r
3129 // non-corrected cumulants:\r
3130 Double_t qc2 = fCumulants[pW][eW][0]->GetBinContent(1); \r
3131 Double_t qc4 = fCumulants[pW][eW][0]->GetBinContent(2); \r
3132 Double_t qc6 = fCumulants[pW][eW][0]->GetBinContent(3); \r
3133 Double_t qc8 = fCumulants[pW][eW][0]->GetBinContent(4); \r
3134 // statistical error of non-corrected cumulants: \r
3135 Double_t qc2Error = fCumulants[pW][eW][0]->GetBinError(1); \r
3136 Double_t qc4Error = fCumulants[pW][eW][0]->GetBinError(2); \r
3137 Double_t qc6Error = fCumulants[pW][eW][0]->GetBinError(3); \r
3138 Double_t qc8Error = fCumulants[pW][eW][0]->GetBinError(4); \r
3139 // corrections for non-uniform acceptance:\r
3140 Double_t qc2Correction = fCorrections[pW][eW]->GetBinContent(1); \r
3141 Double_t qc4Correction = fCorrections[pW][eW]->GetBinContent(2); \r
3142 Double_t qc6Correction = fCorrections[pW][eW]->GetBinContent(3); \r
3143 Double_t qc8Correction = fCorrections[pW][eW]->GetBinContent(4); \r
3144 // corrected cumulants:\r
3145 Double_t qc2Corrected = qc2 + qc2Correction;\r
3146 Double_t qc4Corrected = qc4 + qc4Correction;\r
3147 Double_t qc6Corrected = qc6 + qc6Correction;\r
3148 Double_t qc8Corrected = qc8 + qc8Correction;\r
3149 \r
3150 // ... to be improved (I need here also to correct error of QCs for NUA. \r
3151 // For simplicity sake I assume at the moment that this correction is negliglible, but it will be added eventually...)\r
3152 \r
3153 // store corrected results and statistical errors for cumulants: \r
3154 fCumulants[pW][eW][1]->SetBinContent(1,qc2Corrected);\r
3155 fCumulants[pW][eW][1]->SetBinContent(2,qc4Corrected);\r
3156 fCumulants[pW][eW][1]->SetBinContent(3,qc6Corrected);\r
3157 fCumulants[pW][eW][1]->SetBinContent(4,qc8Corrected);\r
3158 fCumulants[pW][eW][1]->SetBinError(1,qc2Error); // to be improved (correct also qc2Error for NUA)\r
3159 fCumulants[pW][eW][1]->SetBinError(2,qc4Error); // to be improved (correct also qc4Error for NUA)\r
3160 fCumulants[pW][eW][1]->SetBinError(3,qc6Error); // to be improved (correct also qc6Error for NUA)\r
3161 fCumulants[pW][eW][1]->SetBinError(4,qc8Error); // to be improved (correct also qc8Error for NUA) \r
3162 \r
3163} // end of AliFlowAnalysisWithQCumulants::ApplyCorrectionForNonUniformAcceptanceToCumulantsForIntFlow(Bool_t useParticleWeights, TString eventWeights)\r
3164*/\r
3165\r
3166\r
3167//================================================================================================================================\r
3168\r
3169\r
3170/* \r
3171void AliFlowAnalysisWithQCumulants::PrintQuantifyingCorrectionsForNonUniformAcceptance(Bool_t useParticleWeights, TString eventWeights)\r
3172{\r
3173 // print on the screen QC{n,biased}/QC{n,corrected}\r
3174 \r
3175 // shortcuts for the flags:\r
3176 Int_t pW = (Int_t)(useParticleWeights); // 0=pWeights not used, 1=pWeights used\r
3177 \r
3178 Int_t eW = -1;\r
3179 \r
3180 if(eventWeights == "exact")\r
3181 {\r
3182 eW = 0;\r
3183 } \r
3184 \r
3185 if(!(fCumulants[pW][eW][0] && fCumulants[pW][eW][1]))\r
3186 {\r
3187 cout<<"WARNING: fCumulants[pW][eW][0] && fCumulants[pW][eW][1] is NULL in AFAWQC::PQCFNUA() !!!!"<<endl;\r
3188 cout<<"pW = "<<pW<<endl;\r
3189 cout<<"eW = "<<eW<<endl;\r
3190 exit(0);\r
3191 }\r
3192 \r
3193 cout<<endl;\r
3194 cout<<" Quantifying the bias to Q-cumulants from"<<endl;\r
3195 cout<<" non-uniform acceptance of the detector:"<<endl;\r
3196 cout<<endl;\r
3197 \r
3198 if(fCumulants[pW][eW][1]->GetBinContent(1)) \r
3199 { \r
3200 cout<<" QC{2,biased}/QC{2,corrected} = "<<(fCumulants[pW][eW][0]->GetBinContent(1))/(fCumulants[pW][eW][1]->GetBinContent(1))<<endl; \r
3201 }\r
3202 if(fCumulants[pW][eW][1]->GetBinContent(2)) \r
3203 { \r
3204 cout<<" QC{4,biased}/QC{4,corrected} = "<<fCumulants[pW][eW][0]->GetBinContent(2)/fCumulants[pW][eW][1]->GetBinContent(2)<<endl; \r
3205 }\r
3206 \r
3207 cout<<endl;\r
3208 \r
3209} // end of AliFlowAnalysisWithQCumulants::PrintQuantifyingCorrectionsForNonUniformAcceptance(Bool_t useParticleWeights, TString eventWeights)\r
3210*/\r
3211\r
3212\r
3213//================================================================================================================================\r
3214\r
3215\r
3216void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelationsUsingParticleWeights()\r
3217{\r
3218 // Calculate all correlations needed for integrated flow using particle weights.\r
3219 \r
3220 // Remark 1: When particle weights are used the binning of fIntFlowCorrelationAllPro is organized as follows:\r
3221 //\r
3222 // 1st bin: <2>_{1n|1n} = two1n1nW1W1 = <w1 w2 cos(n*(phi1-phi2))>\r
3223 // 2nd bin: <2>_{2n|2n} = two2n2nW2W2 = <w1^2 w2^2 cos(2n*(phi1-phi2))>\r
3224 // 3rd bin: <2>_{3n|3n} = two3n3nW3W3 = <w1^3 w2^3 cos(3n*(phi1-phi2))> \r
3225 // 4th bin: <2>_{4n|4n} = two4n4nW4W4 = <w1^4 w2^4 cos(4n*(phi1-phi2))>\r
3226 // 5th bin: ---- EMPTY ----\r
3227 // 6th bin: <3>_{2n|1n,1n} = three2n1n1nW2W1W1 = <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>\r
3228 // 7th bin: <3>_{3n|2n,1n} = ...\r
3229 // 8th bin: <3>_{4n|2n,2n} = ...\r
3230 // 9th bin: <3>_{4n|3n,1n} = ...\r
3231 // 10th bin: ---- EMPTY ----\r
3232 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1nW1W1W1W1 = <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>\r
3233 // 12th bin: <4>_{2n,1n|2n,1n} = ...\r
3234 // 13th bin: <4>_{2n,2n|2n,2n} = ...\r
3235 // 14th bin: <4>_{3n|1n,1n,1n} = ... \r
3236 // 15th bin: <4>_{3n,1n|3n,1n} = ...\r
3237 // 16th bin: <4>_{3n,1n|2n,2n} = ...\r
3238 // 17th bin: <4>_{4n|2n,1n,1n} = ... \r
3239 // 18th bin: ---- EMPTY ----\r
3240 // 19th bin: <5>_{2n|1n,1n,1n,1n} = ...\r
3241 // 20th bin: <5>_{2n,2n|2n,1n,1n} = ...\r
3242 // 21st bin: <5>_{3n,1n|2n,1n,1n} = ...\r
3243 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = ...\r
3244 // 23rd bin: ---- EMPTY ----\r
3245 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = ...\r
3246 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = ...\r
3247 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = ...\r
3248 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = ...\r
3249 // 28th bin: ---- EMPTY ----\r
3250 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = ...\r
3251 // 30th bin: ---- EMPTY ----\r
3252 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = ...\r
3253 \r
3254 // Remark 2: When particle weights are used there are some extra correlations. They are stored in \r
3255 // fIntFlowExtraCorrelationsPro binning of which is organized as follows:\r
3256 \r
3257 // 1st bin: two1n1nW3W1 = <w1^3 w2 cos(n*(phi1-phi2))>\r
3258 // 2nd bin: two1n1nW1W1W2 = <w1 w2 w3^2 cos(n*(phi1-phi2))> \r
57340a27 3259
a5b7efd0 3260 // multiplicity (number of particles used to determine the reaction plane)\r
3261 Double_t dMult = (*fSMpk)(0,0);\r
3262 \r
3263 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n: \r
3264 Double_t dReQ1n1k = (*fReQ)(0,1);\r
3265 Double_t dReQ2n2k = (*fReQ)(1,2);\r
3266 Double_t dReQ3n3k = (*fReQ)(2,3);\r
3267 Double_t dReQ4n4k = (*fReQ)(3,4);\r
3268 Double_t dReQ1n3k = (*fReQ)(0,3);\r
3269 Double_t dImQ1n1k = (*fImQ)(0,1);\r
3270 Double_t dImQ2n2k = (*fImQ)(1,2);\r
3271 Double_t dImQ3n3k = (*fImQ)(2,3);\r
3272 Double_t dImQ4n4k = (*fImQ)(3,4);\r
3273 Double_t dImQ1n3k = (*fImQ)(0,3);\r
3274\r
3275 // dMs are variables introduced in order to simplify some Eqs. bellow:\r
3276 //..............................................................................................\r
3277 Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j\r
3278 Double_t dM22 = (*fSMpk)(1,2)-(*fSMpk)(0,4); // dM22 = sum_{i,j=1,i!=j}^M w_i^2 w_j^2\r
3279 Double_t dM33 = (*fSMpk)(1,3)-(*fSMpk)(0,6); // dM33 = sum_{i,j=1,i!=j}^M w_i^3 w_j^3\r
3280 Double_t dM44 = (*fSMpk)(1,4)-(*fSMpk)(0,8); // dM44 = sum_{i,j=1,i!=j}^M w_i^4 w_j^4\r
3281 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
3282 Double_t dM211 = (*fSMpk)(0,2)*(*fSMpk)(1,1)-2.*(*fSMpk)(0,3)*(*fSMpk)(0,1)\r
3283 - (*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
3284 Double_t dM1111 = (*fSMpk)(3,1)-6.*(*fSMpk)(0,2)*(*fSMpk)(1,1) \r
3285 + 8.*(*fSMpk)(0,3)*(*fSMpk)(0,1)\r
3286 + 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
3287 //..............................................................................................\r
3288\r
3289 // 2-particle correlations:\r
3290 Double_t two1n1nW1W1 = 0.; // <w1 w2 cos(n*(phi1-phi2))>\r
3291 Double_t two2n2nW2W2 = 0.; // <w1^2 w2^2 cos(2n*(phi1-phi2))>\r
3292 Double_t two3n3nW3W3 = 0.; // <w1^3 w2^3 cos(3n*(phi1-phi2))>\r
3293 Double_t two4n4nW4W4 = 0.; // <w1^4 w2^4 cos(4n*(phi1-phi2))>\r
3294 if(dMult>1) \r
3295 { \r
3296 if(dM11)\r
3297 {\r
3298 two1n1nW1W1 = (pow(dReQ1n1k,2)+pow(dImQ1n1k,2)-(*fSMpk)(0,2))/dM11; \r
3299 // average correlation <w1 w2 cos(n*(phi1-phi2))> for single event: \r
3300 fIntFlowCorrelationsEBE->SetBinContent(1,two1n1nW1W1);\r
3301 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(1,dM11);\r
3302 // average correlation <w1 w2 cos(n*(phi1-phi2))> for all events:\r
3303 fIntFlowCorrelationsPro->Fill(0.5,two1n1nW1W1,dM11); \r
3304 fIntFlowCorrelationsAllPro->Fill(0.5,two1n1nW1W1,dM11); \r
3305 }\r
3306 if(dM22)\r
3307 {\r
3308 two2n2nW2W2 = (pow(dReQ2n2k,2)+pow(dImQ2n2k,2)-(*fSMpk)(0,4))/dM22; \r
3309 // ...\r
3310 // average correlation <w1^2 w2^2 cos(2n*(phi1-phi2))> for all events:\r
3311 fIntFlowCorrelationsAllPro->Fill(1.5,two2n2nW2W2,dM22); \r
3312 }\r
3313 if(dM33)\r
3314 {\r
3315 two3n3nW3W3 = (pow(dReQ3n3k,2)+pow(dImQ3n3k,2)-(*fSMpk)(0,6))/dM33;\r
3316 // ...\r
3317 // average correlation <w1^3 w2^3 cos(3n*(phi1-phi2))> for all events:\r
3318 fIntFlowCorrelationsAllPro->Fill(2.5,two3n3nW3W3,dM33); \r
3319 }\r
3320 if(dM44)\r
3321 {\r
3322 two4n4nW4W4 = (pow(dReQ4n4k,2)+pow(dImQ4n4k,2)-(*fSMpk)(0,8))/dM44; \r
3323 // ...\r
3324 // average correlation <w1^4 w2^4 cos(4n*(phi1-phi2))> for all events:\r
3325 fIntFlowCorrelationsAllPro->Fill(3.5,two4n4nW4W4,dM44); \r
3326 }\r
3327 } // end of if(dMult>1) \r
3328\r
3329 // extra 2-particle correlations:\r
3330 Double_t two1n1nW3W1 = 0.; // <w1^3 w2 cos(n*(phi1-phi2))>\r
3331 Double_t two1n1nW1W1W2 = 0.; // <w1 w2 w3^2 cos(n*(phi1-phi2))> \r
3332 if(dMult>1) \r
3333 { \r
3334 if(dM31)\r
3335 {\r
3336 two1n1nW3W1 = (dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k-(*fSMpk)(0,4))/dM31; \r
3337 fIntFlowExtraCorrelationsPro->Fill(0.5,two1n1nW3W1,dM31); \r
3338 } \r
3339 if(dM211)\r
3340 {\r
3341 two1n1nW1W1W2 = ((*fSMpk)(0,2)*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2)-(*fSMpk)(0,2))\r
3342 - 2.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k\r
3343 - (*fSMpk)(0,4)))/dM211;\r
3344 fIntFlowExtraCorrelationsPro->Fill(1.5,two1n1nW1W1W2,dM211); \r
3345 } \r
3346 } // end of if(dMult>1)\r
3347 //..............................................................................................\r
3348 \r
3349 //..............................................................................................\r
3350 // 3-particle correlations:\r
3351 Double_t three2n1n1nW2W1W1 = 0.; // <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>\r
3352 \r
3353 if(dMult>2) \r
3354 { \r
3355 if(dM211)\r
3356 { \r
3357 three2n1n1nW2W1W1 = (pow(dReQ1n1k,2.)*dReQ2n2k+2.*dReQ1n1k*dImQ1n1k*dImQ2n2k-pow(dImQ1n1k,2.)*dReQ2n2k\r
3358 - 2.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k)\r
3359 - pow(dReQ2n2k,2)-pow(dImQ2n2k,2)\r
3360 + 2.*(*fSMpk)(0,4))/dM211; \r
3361 fIntFlowCorrelationsAllPro->Fill(5.5,three2n1n1nW2W1W1,dM211);\r
3362 } \r
3363 } // end of if(dMult>2) \r
3364 //..............................................................................................\r
3365 \r
3366 //..............................................................................................\r
3367 // 4-particle correlations:\r
3368 Double_t four1n1n1n1nW1W1W1W1 = 0.; // <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>\r
3369 if(dMult>3) \r
3370 { \r
3371 if(dM1111)\r
3372 { \r
3373 four1n1n1n1nW1W1W1W1 = (pow(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.),2)\r
3374 - 2.*(pow(dReQ1n1k,2.)*dReQ2n2k+2.*dReQ1n1k*dImQ1n1k*dImQ2n2k-pow(dImQ1n1k,2.)*dReQ2n2k)\r
3375 + 8.*(dReQ1n3k*dReQ1n1k+dImQ1n3k*dImQ1n1k)\r
3376 + (pow(dReQ2n2k,2)+pow(dImQ2n2k,2))\r
3377 - 4.*(*fSMpk)(0,2)*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))\r
3378 - 6.*(*fSMpk)(0,4)+2.*(*fSMpk)(1,2))/dM1111; \r
3379 \r
3380 // average correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for single event: \r
3381 fIntFlowCorrelationsEBE->SetBinContent(2,four1n1n1n1nW1W1W1W1);\r
3382 fIntFlowEventWeightsForCorrelationsEBE->SetBinContent(2,dM1111);\r
3383 // average correlation <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))> for all events:\r
3384 fIntFlowCorrelationsPro->Fill(1.5,four1n1n1n1nW1W1W1W1,dM1111); \r
3385 fIntFlowCorrelationsAllPro->Fill(10.5,four1n1n1n1nW1W1W1W1,dM1111); \r
3386 } \r
3387 } // end of if(dMult>3) \r
3388 //..............................................................................................\r
3389 \r
3390} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelationsUsingParticleWeights()\r
3391\r
3392\r
3393//================================================================================================================================\r
3394\r
3395\r
3396void AliFlowAnalysisWithQCumulants::CalculateWeightedQProductsForIntFlow() // to be improved (completed)\r
3397{\r
3398 // calculate averages like <<2><4>>, <<2><6>>, <<4><6>>, etc. which are needed to calculate covariances \r
3399 // Remark: here we take weighted correlations!\r
3400 \r
3401 /*\r
3402 \r
3403 // binning of fQProductsW is organized as follows:\r
3404 // \r
3405 // 1st bin: <2><4> \r
3406 // 2nd bin: <2><6>\r
3407 // 3rd bin: <2><8>\r
3408 // 4th bin: <4><6>\r
3409 // 5th bin: <4><8>\r
3410 // 6th bin: <6><8>\r
3411 \r
3412 Double_t dMult = (*fSMpk)(0,0); // multiplicity (number of particles used to determine the reaction plane)\r
3413\r
3414 Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j\r
3415 Double_t dM1111 = (*fSMpk)(3,1)-6.*(*fSMpk)(0,2)*(*fSMpk)(1,1) \r
3416 + 8.*(*fSMpk)(0,3)*(*fSMpk)(0,1)\r
3417 + 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
3418\r
3419 Double_t twoEBEW = 0.; // <2>\r
3420 Double_t fourEBEW = 0.; // <4>\r
3421 \r
3422 twoEBEW = fQCorrelationsEBE[1]->GetBinContent(1);\r
3423 fourEBEW = fQCorrelationsEBE[1]->GetBinContent(11);\r
3424 \r
3425 // <2><4>\r
3426 if(dMult>3)\r
3427 {\r
3428 fQProducts[1][0]->Fill(0.5,twoEBEW*fourEBEW,dM11*dM1111);\r
3429 }\r
3430 \r
3431 */\r
3432 \r
3433} // end of AliFlowAnalysisWithQCumulants::CalculateWeightedQProductsForIntFlow() \r
3434\r
3435\r
3436//================================================================================================================================\r
3437\r
3438\r
3439void AliFlowAnalysisWithQCumulants::InitializeArraysForIntFlow()\r
3440{\r
3441 // Initialize all arrays used to calculate integrated flow.\r
3442 \r
3443 for(Int_t sc=0;sc<2;sc++) // sin or cos terms\r
3444 {\r
3445 fIntFlowCorrectionTermsForNUAEBE[sc] = NULL;\r
3446 fIntFlowCorrectionTermsForNUAPro[sc] = NULL;\r
3447 fIntFlowCorrectionTermsForNUAHist[sc] = NULL;\r
3448 }\r
a5b7efd0 3449 for(Int_t power=0;power<2;power++) // linear or quadratic \r
3450 {\r
3451 fIntFlowSumOfEventWeights[power] = NULL; \r
3b552efe 3452 }
3453 for(Int_t i=0;i<3;i++) // print on the screen the final results (0=NONAME, 1=RP, 2=POI)
3454 {
3455 fPrintFinalResults[i] = kTRUE;
3456 }
a5b7efd0 3457 \r
3458} // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForIntFlow()\r
3459\r
3460\r
3461//================================================================================================================================\r
3462\r
3463\r
3464void AliFlowAnalysisWithQCumulants::InitializeArraysForDiffFlow()\r
3465{\r
3466 // Initialize all arrays needed to calculate differential flow.\r
3467 // a) Initialize lists holding profiles;\r
3468 // b) Initialize lists holding histograms;\r
3469 // c) Initialize event-by-event quantities;\r
3470 // d) Initialize profiles;\r
3471 // e) Initialize histograms holding final results.\r
3472 \r
3473 // a) Initialize lists holding profiles;\r
3474 for(Int_t t=0;t<2;t++) // type (RP, POI)\r
3475 {\r
3476 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
3477 {\r
3478 fDiffFlowCorrelationsProList[t][pe] = NULL;\r
3479 fDiffFlowProductOfCorrelationsProList[t][pe] = NULL;\r
3480 fDiffFlowCorrectionsProList[t][pe] = NULL;\r
3481 }\r
3482 } \r
3483 \r
3484 // b) Initialize lists holding histograms;\r
3485 for(Int_t t=0;t<2;t++) // type (RP, POI)\r
3486 {\r
3487 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
3488 {\r
3489 fDiffFlowCorrelationsHistList[t][pe] = NULL;\r
3490 for(Int_t power=0;power<2;power++)\r
3491 {\r
3492 fDiffFlowSumOfEventWeightsHistList[t][pe][power] = NULL;\r
3493 } // end of for(Int_t power=0;power<2;power++) \r
3494 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe] = NULL;\r
3495 fDiffFlowCorrectionsHistList[t][pe] = NULL;\r
3496 fDiffFlowCovariancesHistList[t][pe] = NULL;\r
3497 fDiffFlowCumulantsHistList[t][pe] = NULL;\r
3498 fDiffFlowHistList[t][pe] = NULL;\r
3499 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta\r
3500 } // enf of for(Int_t t=0;t<2;t++) // type (RP, POI) \r
3501 \r
3502 // c) Initialize event-by-event quantities:\r
3503 // 1D:\r
3504 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)\r
3505 {\r
3506 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
3507 { \r
3508 for(Int_t m=0;m<4;m++) // multiple of harmonic\r
3509 {\r
3510 for(Int_t k=0;k<9;k++) // power of weight\r
3511 {\r
3512 fReRPQ1dEBE[t][pe][m][k] = NULL;\r
3513 fImRPQ1dEBE[t][pe][m][k] = NULL;\r
3514 fs1dEBE[t][pe][k] = NULL; // to be improved (this doesn't need to be within loop over m)\r
3515 } \r
3516 }\r
3517 }\r
3518 }\r
3519 // 1D:\r
3520 for(Int_t t=0;t<2;t++) // type (RP or POI)\r
3521 {\r
3522 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
3523 { \r
3524 for(Int_t sc=0;sc<2;sc++) // sin or cos terms\r
3525 {\r
3526 for(Int_t cti=0;cti<9;cti++) // correction term index\r
3527 {\r
3528 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti] = NULL;\r
3529 } \r
3530 }\r
3531 }\r
3532 }\r
3533 // 2D: \r
3534 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)\r
3535 {\r
3536 for(Int_t m=0;m<4;m++) // multiple of harmonic\r
3537 {\r
3538 for(Int_t k=0;k<9;k++) // power of weight\r
3539 {\r
3540 fReRPQ2dEBE[t][m][k] = NULL;\r
3541 fImRPQ2dEBE[t][m][k] = NULL;\r
3542 fs2dEBE[t][k] = NULL; // to be improved (this doesn't need to be within loop over m)\r
3543 } \r
3544 }\r
3545 }\r
3546 \r
3547 // d) Initialize profiles:\r
3548 for(Int_t t=0;t<2;t++) // type: RP or POI\r
3549 { \r
3550 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
3551 {\r
3552 for(Int_t ci=0;ci<4;ci++) // correlation index\r
3553 {\r
3554 fDiffFlowCorrelationsPro[t][pe][ci] = NULL;\r
3555 } // end of for(Int_t ci=0;ci<4;ci++) \r
3556 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index\r
3557 {\r
3558 for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index\r
3559 {\r
3560 fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2] = NULL;\r
3561 } // end of for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index\r
3562 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index \r
3563 // correction terms for nua:\r
3564 for(Int_t sc=0;sc<2;sc++) // sin or cos terms\r
3565 {\r
3566 for(Int_t cti=0;cti<9;cti++) // correction term index\r
3567 {\r
3568 fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti] = NULL;\r
3569 } \r
3570 }\r
3571 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta\r
3572 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI\r
3573 \r
3574 // e) Initialize histograms holding final results.\r
3575 for(Int_t t=0;t<2;t++) // type: RP or POI\r
3576 { \r
3577 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
3578 {\r
3579 for(Int_t ci=0;ci<4;ci++) // correlation index\r
3580 {\r
3581 fDiffFlowCorrelationsHist[t][pe][ci] = NULL;\r
3582 fDiffFlowCumulants[t][pe][ci] = NULL;\r
3583 fDiffFlow[t][pe][ci] = NULL;\r
3584 } // end of for(Int_t ci=0;ci<4;ci++) \r
3585 for(Int_t covarianceIndex=0;covarianceIndex<5;covarianceIndex++) \r
3586 {\r
3587 fDiffFlowCovariances[t][pe][covarianceIndex] = NULL; \r
3588 } // end of for(Int_t covarianceIndex=0;covarianceIndex<5;covarianceIndex++) \r
3589 // correction terms for nua:\r
3590 for(Int_t sc=0;sc<2;sc++) // sin or cos terms\r
3591 {\r
3592 for(Int_t cti=0;cti<9;cti++) // correction term index\r
3593 {\r
3594 fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti] = NULL;\r
3595 } \r
3596 }\r
3597 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta\r
3598 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI\r
3599 \r
3600 // sum of event weights for reduced correlations:\r
3601 for(Int_t t=0;t<2;t++) // type = RP or POI\r
3602 {\r
3603 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
3604 {\r
3605 for(Int_t p=0;p<2;p++) // power of weight is 1 or 2\r
3606 {\r
3607 for(Int_t ew=0;ew<4;ew++) // event weight index for reduced correlations\r
3608 {\r
3609 fDiffFlowSumOfEventWeights[t][pe][p][ew] = NULL;\r
3610 } \r
3611 } \r
3612 }\r
3613 }\r
3614 // product of event weights for both types of correlations:\r
3615 for(Int_t t=0;t<2;t++) // type = RP or POI\r
3616 {\r
3617 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
3618 {\r
3619 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index\r
3620 {\r
3621 for(Int_t mci2=0;mci2<8;mci2++) // mixed correlation index\r
3622 {\r
3623 fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2] = NULL;\r
3624 } \r
3625 } \r
3626 }\r
3627 }\r
3628\r
3629 \r
3630 \r
3631 \r
3632 /*\r
3633 \r
3634 // nested lists in fDiffFlowProfiles:\r
3635 for(Int_t t=0;t<2;t++)\r
3636 {\r
3637 fDFPType[t] = NULL;\r
3638 for(Int_t pW=0;pW<2;pW++) // particle weights not used (0) or used (1)\r
3639 {\r
3640 fDFPParticleWeights[t][pW] = NULL;\r
3641 for(Int_t eW=0;eW<2;eW++)\r
3642 { \r
3643 fDFPEventWeights[t][pW][eW] = NULL;\r
3644 fDiffFlowCorrelations[t][pW][eW] = NULL;\r
3645 fDiffFlowProductsOfCorrelations[t][pW][eW] = NULL;\r
3646 for(Int_t sc=0;sc<2;sc++)\r
3647 {\r
3648 fDiffFlowCorrectionTerms[t][pW][eW][sc] = NULL;\r
3649 }\r
3650 } \r
3651 }\r
3652 } \r
3653 \r
3654 \r
3655 */\r
3656 \r
3657 \r
3658 \r
3659 /*\r
3660 for(Int_t pW=0;pW<2;pW++) // particle weights not used (0) or used (1)\r
3661 {\r
3662 for(Int_t eW=0;eW<2;eW++)\r
3663 {\r
3664 // correlations:\r
3665 for(Int_t correlationIndex=0;correlationIndex<4;correlationIndex++)\r
3666 {\r
3667 fCorrelationsPro[t][pW][eW][correlationIndex] = NULL;\r
3668 }\r
3669 // products of correlations:\r
3670 for(Int_t productOfCorrelationsIndex=0;productOfCorrelationsIndex<6;productOfCorrelationsIndex++)\r
3671 {\r
3672 fProductsOfCorrelationsPro[t][pW][eW][productOfCorrelationsIndex] = NULL;\r
3673 }\r
3674 // correction terms:\r
3675 for(Int_t sc=0;sc<2;sc++)\r
3676 {\r
3677 for(Int_t correctionsIndex=0;correctionsIndex<2;correctionsIndex++)\r
3678 {\r
3679 fCorrectionTermsPro[t][pW][eW][sc][correctionsIndex] = NULL;\r
3680 } \r
3681 } \r
3682 }\r
3683 } \r
3684 */\r
3685 \r
3686} // end of AliFlowAnalysisWithQCumulants::InitializeArraysForDiffFlow()\r
3687\r
3688\r
3689//================================================================================================================================\r
3690 /*\r
3691\r
3692\r
3693void AliFlowAnalysisWithQCumulants::CalculateCorrelationsForDifferentialFlow2D(TString type)\r
3694{\r
3695 // calculate all reduced correlations needed for differential flow for each (pt,eta) bin: \r
3696 \r
3697 if(type == "RP") // to be improved (removed)\r
3698 {\r
3699 cout<<endl;\r
3700 }\r
3701 // ... \r
3702 \r
3703 \r
3704 Int_t typeFlag = -1; \r
3705 \r
3706 // reduced correlations ares stored in fCorrelationsPro[t][pW][index] and are indexed as follows:\r
3707 // index:\r
3708 // 0: <2'>\r
3709 // 1: <4'>\r
3710\r
3711 // multiplicity:\r
3712 Double_t dMult = (*fSMpk)(0,0);\r
3713 \r
3714 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n: \r
3715 Double_t dReQ1n = (*fReQ)(0,0);\r
3716 Double_t dReQ2n = (*fReQ)(1,0);\r
3717 //Double_t dReQ3n = (*fReQ)(2,0);\r
3718 //Double_t dReQ4n = (*fReQ)(3,0);\r
3719 Double_t dImQ1n = (*fImQ)(0,0);\r
3720 Double_t dImQ2n = (*fImQ)(1,0);\r
3721 //Double_t dImQ3n = (*fImQ)(2,0);\r
3722 //Double_t dImQ4n = (*fImQ)(3,0);\r
3723\r
3724 // looping over all (pt,eta) bins and calculating correlations needed for differential flow: \r
3725 for(Int_t p=1;p<=fnBinsPt;p++)\r
3726 {\r
3727 for(Int_t e=1;e<=fnBinsEta;e++)\r
3728 {\r
3729 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin): \r
3730 Double_t p1n0kRe = 0.;\r
3731 Double_t p1n0kIm = 0.;\r
3732\r
3733 // number of POIs in particular (pt,eta) bin:\r
3734 Double_t mp = 0.;\r
3735\r
3736 // 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
3737 Double_t q1n0kRe = 0.;\r
3738 Double_t q1n0kIm = 0.;\r
3739 Double_t q2n0kRe = 0.;\r
3740 Double_t q2n0kIm = 0.;\r
3741\r
3742 // number of particles which are both RPs and POIs in particular (pt,eta) bin:\r
3743 Double_t mq = 0.;\r
3744 \r
3745 // q_{m*n,0}:\r
3746 q1n0kRe = fReEBE2D[2][0][0]->GetBinContent(fReEBE2D[2][0][0]->GetBin(p,e))\r
3747 * fReEBE2D[2][0][0]->GetBinEntries(fReEBE2D[2][0][0]->GetBin(p,e));\r
3748 q1n0kIm = fImEBE2D[2][0][0]->GetBinContent(fImEBE2D[2][0][0]->GetBin(p,e))\r
3749 * fImEBE2D[2][0][0]->GetBinEntries(fImEBE2D[2][0][0]->GetBin(p,e));\r
3750 q2n0kRe = fReEBE2D[2][1][0]->GetBinContent(fReEBE2D[2][1][0]->GetBin(p,e))\r
3751 * fReEBE2D[2][1][0]->GetBinEntries(fReEBE2D[2][1][0]->GetBin(p,e));\r
3752 q2n0kIm = fImEBE2D[2][1][0]->GetBinContent(fImEBE2D[2][1][0]->GetBin(p,e))\r
3753 * fImEBE2D[2][1][0]->GetBinEntries(fImEBE2D[2][1][0]->GetBin(p,e));\r
3754 \r
3755 mq = fReEBE2D[2][0][0]->GetBinEntries(fReEBE2D[2][0][0]->GetBin(p,e)); // to be improved (cross-checked by accessing other profiles here)\r
3756 \r
3757 if(type == "POI")\r
3758 {\r
3759 // p_{m*n,0}:\r
3760 p1n0kRe = fReEBE2D[1][0][0]->GetBinContent(fReEBE2D[1][0][0]->GetBin(p,e))\r
3761 * fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e));\r
3762 p1n0kIm = fImEBE2D[1][0][0]->GetBinContent(fImEBE2D[1][0][0]->GetBin(p,e)) \r
3763 * fImEBE2D[1][0][0]->GetBinEntries(fImEBE2D[1][0][0]->GetBin(p,e));\r
3764 \r
3765 mp = fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e)); // to be improved (cross-checked by accessing other profiles here)\r
3766 \r
3767 typeFlag = 1;\r
3768 }\r
3769 else if(type == "RP")\r
3770 {\r
3771 // p_{m*n,0} = q_{m*n,0}:\r
3772 p1n0kRe = q1n0kRe; \r
3773 p1n0kIm = q1n0kIm; \r
3774 mp = mq; \r
3775 \r
3776 typeFlag = 0;\r
3777 }\r
3778 \r
3779 // count events with non-empty (pt,eta) bin:\r
3780 if(mp>0)\r
3781 {\r
3782 fNonEmptyBins2D[typeFlag]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,1);\r
3783 }\r
3784 \r
3785 // 2'-particle correlation for particular (pt,eta) bin:\r
3786 Double_t two1n1nPtEta = 0.;\r
3787 if(mp*dMult-mq)\r
3788 {\r
3789 two1n1nPtEta = (p1n0kRe*dReQ1n+p1n0kIm*dImQ1n-mq)\r
3790 / (mp*dMult-mq);\r
3791 \r
3792 // fill the 2D profile to get the average correlation for each (pt,eta) bin:\r
3793 if(type == "POI")\r
3794 { \r
3795 //f2pPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);\r
3796 \r
3797 fCorrelationsPro[1][0][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);\r
3798 }\r
3799 else if(type == "RP")\r
3800 {\r
3801 //f2pPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq); \r
3802 fCorrelationsPro[0][0][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nPtEta,mp*dMult-mq);\r
3803 }\r
3804 } // end of if(mp*dMult-mq)\r
3805 \r
3806 // 4'-particle correlation:\r
3807 Double_t four1n1n1n1nPtEta = 0.;\r
3808 if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
3809 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)\r
3810 {\r
3811 four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)\r
3812 - q2n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))\r
3813 - 2.*q2n0kIm*dReQ1n*dImQ1n\r
3814 - p1n0kRe*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)\r
3815 + p1n0kIm*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)\r
3816 - 2.*dMult*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)\r
3817 - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*mq \r
3818 + 6.*(q1n0kRe*dReQ1n+q1n0kIm*dImQ1n) \r
3819 + 1.*(q2n0kRe*dReQ2n+q2n0kIm*dImQ2n) \r
3820 + 2.*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n) \r
3821 + 2.*mq*dMult \r
3822 - 6.*mq) \r
3823 / ((mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
3824 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)); \r
3825 \r
3826 // fill the 2D profile to get the average correlation for each (pt, eta) bin:\r
3827 if(type == "POI")\r
3828 {\r
3829 //f4pPtEtaPOI->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,\r
3830 // (mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
3831 // + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));\r
3832 \r
3833 fCorrelationsPro[1][0][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,\r
3834 (mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
3835 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.));\r
3836 }\r
3837 else if(type == "RP")\r
3838 {\r
3839 //f4pPtEtaRP->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,\r
3840 // (mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
3841 // + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)); \r
3842 \r
3843 fCorrelationsPro[0][0][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nPtEta,\r
3844 (mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
3845 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)); \r
3846 }\r
3847 } // end of if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
3848 // +mq*(dMult-1.)*(dMult-2.)*(dMult-3.))\r
3849 \r
3850 } // end of for(Int_t e=1;e<=fnBinsEta;e++)\r
3851 } // end of for(Int_t p=1;p<=fnBinsPt;p++)\r
3852\r
3853 \r
3854 \r
3855 \r
3856 \r
3857} // end of AliFlowAnalysisWithQCumulants::CalculateCorrelationsForDifferentialFlow2D()\r
3858\r
3859\r
3860\r
3861 \r
3862 \r
3863\r
3864//================================================================================================================================\r
3865\r
3866\r
3867void AliFlowAnalysisWithQCumulants::CalculateWeightedCorrelationsForDifferentialFlow2D(TString type)\r
3868{\r
3869 // calculate all weighted correlations needed for differential flow \r
3870 \r
3871 if(type == "RP") // to be improved (removed)\r
3872 {\r
3873 cout<<endl;\r
3874 }\r
3875 // ... \r
3876 \r
3877 \r
3878 \r
3879 \r
3880 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n: \r
3881 Double_t dReQ1n1k = (*fReQ)(0,1);\r
3882 Double_t dReQ2n2k = (*fReQ)(1,2);\r
3883 Double_t dReQ1n3k = (*fReQ)(0,3);\r
3884 //Double_t dReQ4n4k = (*fReQ)(3,4);\r
3885 Double_t dImQ1n1k = (*fImQ)(0,1);\r
3886 Double_t dImQ2n2k = (*fImQ)(1,2);\r
3887 Double_t dImQ1n3k = (*fImQ)(0,3);\r
3888 //Double_t dImQ4n4k = (*fImQ)(3,4);\r
3889 \r
3890 // S^M_{p,k} (see .h file for the definition of fSMpk):\r
3891 Double_t dSM1p1k = (*fSMpk)(0,1);\r
3892 Double_t dSM1p2k = (*fSMpk)(0,2);\r
3893 Double_t dSM1p3k = (*fSMpk)(0,3);\r
3894 Double_t dSM2p1k = (*fSMpk)(1,1);\r
3895 Double_t dSM3p1k = (*fSMpk)(2,1);\r
3896 \r
3897 // looping over all (pt,eta) bins and calculating weighted correlations needed for differential flow: \r
3898 for(Int_t p=1;p<=fnBinsPt;p++)\r
3899 {\r
3900 for(Int_t e=1;e<=fnBinsEta;e++)\r
3901 {\r
3902 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin): \r
3903 Double_t p1n0kRe = 0.;\r
3904 Double_t p1n0kIm = 0.;\r
3905\r
3906 // number of POIs in particular (pt,eta) bin):\r
3907 Double_t mp = 0.;\r
3908\r
3909 // real and imaginary parts of q_{m*n,k}: \r
3910 // (weighted Q-vector evaluated for particles which are both RPs and POIs in particular (pt,eta) bin)\r
3911 Double_t q1n2kRe = 0.;\r
3912 Double_t q1n2kIm = 0.;\r
3913 Double_t q2n1kRe = 0.;\r
3914 Double_t q2n1kIm = 0.;\r
3915\r
3916 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation) \r
3917 Double_t s1p1k = 0.; \r
3918 Double_t s1p2k = 0.; \r
3919 Double_t s1p3k = 0.; \r
3920 \r
3921 // M0111 from Eq. (118) in QC2c (to be improved (notation))\r
3922 Double_t dM0111 = 0.;\r
3923 \r
3924 if(type == "POI")\r
3925 {\r
3926 // p_{m*n,0}:\r
3927 p1n0kRe = fReEBE2D[1][0][0]->GetBinContent(fReEBE2D[1][0][0]->GetBin(p,e))\r
3928 * fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e));\r
3929 p1n0kIm = fImEBE2D[1][0][0]->GetBinContent(fImEBE2D[1][0][0]->GetBin(p,e))\r
3930 * fImEBE2D[1][0][0]->GetBinEntries(fImEBE2D[1][0][0]->GetBin(p,e)); \r
3931 \r
3932 mp = fReEBE2D[1][0][0]->GetBinEntries(fReEBE2D[1][0][0]->GetBin(p,e));\r
3933 \r
3934 // q_{m*n,k}: \r
3935 q1n2kRe = fReEBE2D[2][0][2]->GetBinContent(fReEBE2D[2][0][2]->GetBin(p,e))\r
3936 * fReEBE2D[2][0][2]->GetBinEntries(fReEBE2D[2][0][2]->GetBin(p,e));\r
3937 q1n2kIm = fImEBE2D[2][0][2]->GetBinContent(fImEBE2D[2][0][2]->GetBin(p,e))\r
3938 * fImEBE2D[2][0][2]->GetBinEntries(fImEBE2D[2][0][2]->GetBin(p,e));\r
3939 q2n1kRe = fReEBE2D[2][1][1]->GetBinContent(fReEBE2D[2][1][1]->GetBin(p,e))\r
3940 * fReEBE2D[2][1][1]->GetBinEntries(fReEBE2D[2][1][1]->GetBin(p,e)); \r
3941 q2n1kIm = fImEBE2D[2][1][1]->GetBinContent(fImEBE2D[2][1][1]->GetBin(p,e))\r
3942 * fImEBE2D[2][1][1]->GetBinEntries(fImEBE2D[2][1][1]->GetBin(p,e));\r
3943 \r
3944 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation) \r
3945 s1p1k = pow(fs2D[2][1]->GetBinContent(fs2D[2][1]->GetBin(p,e)),1.); \r
3946 s1p2k = pow(fs2D[2][2]->GetBinContent(fs2D[2][2]->GetBin(p,e)),1.); \r
3947 s1p3k = pow(fs2D[2][3]->GetBinContent(fs2D[2][3]->GetBin(p,e)),1.); \r
3948 \r
3949 // M0111 from Eq. (118) in QC2c (to be improved (notation)):\r
3950 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)\r
3951 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)\r
3952 + 2.*(s1p3k-s1p2k*dSM1p1k));\r
3953 }\r
3954 else if(type == "RP")\r
3955 {\r
3956 p1n0kRe = fReEBE2D[0][0][0]->GetBinContent(fReEBE2D[0][0][0]->GetBin(p,e))\r
3957 * fReEBE2D[0][0][0]->GetBinEntries(fReEBE2D[0][0][0]->GetBin(p,e));\r
3958 p1n0kIm = fImEBE2D[0][0][0]->GetBinContent(fImEBE2D[0][0][0]->GetBin(p,e))\r
3959 * fImEBE2D[0][0][0]->GetBinEntries(fImEBE2D[0][0][0]->GetBin(p,e));\r
3960 \r
3961 mp = fReEBE2D[0][0][0]->GetBinEntries(fReEBE2D[0][0][0]->GetBin(p,e));\r
3962 \r
3963 // q_{m*n,k}: \r
3964 q1n2kRe = fReEBE2D[0][0][2]->GetBinContent(fReEBE2D[0][0][2]->GetBin(p,e))\r
3965 * fReEBE2D[0][0][2]->GetBinEntries(fReEBE2D[0][0][2]->GetBin(p,e));\r
3966 q1n2kIm = fImEBE2D[0][0][2]->GetBinContent(fImEBE2D[0][0][2]->GetBin(p,e))\r
3967 * fImEBE2D[0][0][2]->GetBinEntries(fImEBE2D[0][0][2]->GetBin(p,e));\r
3968 q2n1kRe = fReEBE2D[0][1][1]->GetBinContent(fReEBE2D[0][1][1]->GetBin(p,e))\r
3969 * fReEBE2D[0][1][1]->GetBinEntries(fReEBE2D[0][1][1]->GetBin(p,e));\r
3970 q2n1kIm = fImEBE2D[0][1][1]->GetBinContent(fImEBE2D[0][1][1]->GetBin(p,e))\r
3971 * fImEBE2D[0][1][1]->GetBinEntries(fImEBE2D[0][1][1]->GetBin(p,e));\r
3972 \r
3973 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation) \r
3974 s1p1k = pow(fs2D[0][1]->GetBinContent(fs2D[0][1]->GetBin(p,e)),1.); \r
3975 s1p2k = pow(fs2D[0][2]->GetBinContent(fs2D[0][2]->GetBin(p,e)),1.); \r
3976 s1p3k = pow(fs2D[0][3]->GetBinContent(fs2D[0][3]->GetBin(p,e)),1.); \r
3977 \r
3978 // M0111 from Eq. (118) in QC2c (to be improved (notation)):\r
3979 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)\r
3980 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)\r
3981 + 2.*(s1p3k-s1p2k*dSM1p1k));\r
3982 //............................................................................................... \r
3983 }\r
3984 \r
3985 // 2'-particle correlation:\r
3986 Double_t two1n1nW0W1PtEta = 0.;\r
3987 if(mp*dSM1p1k-s1p1k)\r
3988 {\r
3989 two1n1nW0W1PtEta = (p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k-s1p1k)\r
3990 / (mp*dSM1p1k-s1p1k);\r
3991 \r
3992 // fill the 2D profile to get the average correlation for each (pt, eta) bin:\r
3993 if(type == "POI")\r
3994 {\r
3995 //f2pPtEtaPOIW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,\r
3996 // mp*dSM1p1k-s1p1k);\r
3997 fCorrelationsPro[1][1][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,mp*dSM1p1k-s1p1k);\r
3998 }\r
3999 else if(type == "RP")\r
4000 {\r
4001 //f2pPtEtaRPW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,\r
4002 // mp*dSM1p1k-s1p1k); \r
4003 fCorrelationsPro[0][1][0][0]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,two1n1nW0W1PtEta,mp*dSM1p1k-s1p1k); \r
4004 }\r
4005 } // end of if(mp*dMult-dmPrimePrimePtEta)\r
4006 \r
4007 // 4'-particle correlation:\r
4008 Double_t four1n1n1n1nW0W1W1W1PtEta = 0.;\r
4009 if(dM0111)\r
4010 {\r
4011 four1n1n1n1nW0W1W1W1PtEta = ((pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)\r
4012 - q2n1kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))\r
4013 - 2.*q2n1kIm*dReQ1n1k*dImQ1n1k\r
4014 - p1n0kRe*(dReQ1n1k*dReQ2n2k+dImQ1n1k*dImQ2n2k)\r
4015 + p1n0kIm*(dImQ1n1k*dReQ2n2k-dReQ1n1k*dImQ2n2k)\r
4016 - 2.*dSM1p2k*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)\r
4017 - 2.*(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*s1p1k \r
4018 + 6.*(q1n2kRe*dReQ1n1k+q1n2kIm*dImQ1n1k) \r
4019 + 1.*(q2n1kRe*dReQ2n2k+q2n1kIm*dImQ2n2k) \r
4020 + 2.*(p1n0kRe*dReQ1n3k+p1n0kIm*dImQ1n3k) \r
4021 + 2.*s1p1k*dSM1p2k \r
4022 - 6.*s1p3k) \r
4023 / dM0111; // to be imropoved (notation of dM0111)\r
4024 \r
4025 // fill the 2D profile to get the average correlation for each (pt, eta) bin:\r
4026 if(type == "POI")\r
4027 {\r
4028 //f4pPtEtaPOIW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);\r
4029 fCorrelationsPro[1][1][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111);\r
4030 }\r
4031 else if(type == "RP")\r
4032 {\r
4033 //f4pPtEtaRPW->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111); \r
4034 fCorrelationsPro[0][1][0][1]->Fill(fPtMin+(p-1)*fPtBinWidth,fEtaMin+(e-1)*fEtaBinWidth,four1n1n1n1nW0W1W1W1PtEta,dM0111); \r
4035 }\r
4036 } // end of if(dM0111)\r
4037 \r
4038 } // end of for(Int_t e=1;e<=fnBinsEta;e++)\r
4039 } // end of for(Int_t p=1;p<=fnBinsPt;p++)\r
4040 \r
4041 \r
4042 \r
4043 \r
4044} // end of AliFlowAnalysisWithQCumulants::CalculateWeightedCorrelationsForDifferentialFlow2D(TString type)\r
4045\r
4046\r
4047//================================================================================================================================\r
4048\r
4049 */ \r
4050\r
4051/*\r
4052void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsForDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights)\r
4053{\r
4054 // 1.) Access average for 2D correlations from profiles and store them in 2D final results histograms;\r
4055 // 2.) Access spread for 2D correlations from profiles, calculate error and store it in 2D final results histograms;\r
4056 // 3.) Make projections along pt and eta axis and store results and errors in 1D final results histograms. \r
4057 \r
4058 Int_t typeFlag = -1;\r
4059 Int_t pWeightsFlag = -1;\r
4060 Int_t eWeightsFlag = -1;\r
4061\r
4062 if(type == "RP")\r
4063 {\r
4064 typeFlag = 0;\r
4065 } else if(type == "POI")\r
4066 {\r
4067 typeFlag = 1;\r
4068 } else \r
4069 {\r
4070 cout<<"WARNING: type must be either RP or POI in AFAWQC::FCFDF() !!!!"<<endl;\r
4071 exit(0);\r
4072 }\r
4073 \r
4074 if(!useParticleWeights)\r
4075 {\r
4076 pWeightsFlag = 0;\r
4077 } else \r
4078 {\r
4079 pWeightsFlag = 1; \r
4080 } \r
4081 \r
4082 if(eventWeights == "exact")\r
4083 {\r
4084 eWeightsFlag = 0;\r
4085 } \r
4086 \r
4087 // shortcuts:\r
4088 Int_t t = typeFlag;\r
4089 Int_t pW = pWeightsFlag;\r
4090 Int_t eW = eWeightsFlag;\r
4091 \r
4092 // from 2D histogram fNonEmptyBins2D make two 1D histograms fNonEmptyBins1D in pt and eta (to be improved (i.e. moved somewhere else)) \r
4093 // pt:\r
4094 for(Int_t p=1;p<fnBinsPt;p++)\r
4095 {\r
4096 Double_t contentPt = 0.;\r
4097 for(Int_t e=1;e<=fnBinsEta;e++)\r
4098 {\r
4099 contentPt += (fNonEmptyBins2D[t]->GetBinContent(fNonEmptyBins2D[t]->GetBin(p,e))); \r
4100 }\r
4101 fNonEmptyBins1D[t][0]->SetBinContent(p,contentPt);\r
4102 }\r
4103 // eta:\r
4104 for(Int_t e=1;e<fnBinsEta;e++)\r
4105 {\r
4106 Double_t contentEta = 0.;\r
4107 for(Int_t p=1;p<=fnBinsPt;p++)\r
4108 {\r
4109 contentEta += (fNonEmptyBins2D[t]->GetBinContent(fNonEmptyBins2D[t]->GetBin(p,e))); \r
4110 }\r
4111 fNonEmptyBins1D[t][1]->SetBinContent(e,contentEta);\r
4112 }\r
4113 \r
4114 // from 2D profile in (pt,eta) make two 1D profiles in (pt) and (eta):\r
4115 TProfile *profile[2][4]; // [0=pt,1=eta][correlation index] // to be improved (do not hardwire the correlation index)\r
4116 \r
4117 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
4118 {\r
4119 for(Int_t ci=0;ci<4;ci++) // correlation index\r
4120 {\r
4121 if(pe==0) profile[pe][ci] = this->MakePtProjection(fCorrelationsPro[t][pW][eW][ci]);\r
4122 if(pe==1) profile[pe][ci] = this->MakeEtaProjection(fCorrelationsPro[t][pW][eW][ci]);\r
4123 }\r
4124 }\r
4125 \r
4126 // transfer 2D profile into 2D histogram:\r
4127 // to be improved (see in documentation if there is a method to transfer values from 2D profile into 2D histogram) \r
4128 for(Int_t ci=0;ci<4;ci++)\r
4129 {\r
4130 for(Int_t p=1;p<=fnBinsPt;p++)\r
4131 {\r
4132 for(Int_t e=1;e<=fnBinsEta;e++)\r
4133 {\r
4134 Double_t correlation = fCorrelationsPro[t][pW][eW][ci]->GetBinContent(fCorrelationsPro[t][pW][eW][ci]->GetBin(p,e)); \r
4135 Double_t spread = fCorrelationsPro[t][pW][eW][ci]->GetBinError(fCorrelationsPro[t][pW][eW][ci]->GetBin(p,e));\r
4136 Double_t nEvts = fNonEmptyBins2D[t]->GetBinContent(fNonEmptyBins2D[t]->GetBin(p,e));\r
4137 Double_t error = 0.;\r
4138 fFinalCorrelations2D[t][pW][eW][ci]->SetBinContent(fFinalCorrelations2D[t][pW][eW][ci]->GetBin(p,e),correlation); \r
4139 if(nEvts>0)\r
4140 {\r
4141 error = spread/pow(nEvts,0.5);\r
4142 fFinalCorrelations2D[t][pW][eW][ci]->SetBinError(fFinalCorrelations2D[t][pW][eW][ci]->GetBin(p,e),error);\r
4143 }\r
4144 } // end of for(Int_t e=1;e<=fnBinsEta;e++)\r
4145 } // end of for(Int_t p=1;p<=fnBinsPt;p++)\r
4146 } // end of for(Int_t ci=0;ci<4;ci++)\r
4147 \r
4148 // transfer 1D profile into 1D histogram (pt):\r
4149 // to be improved (see in documentation if there is a method to transfer values from 1D profile into 1D histogram) \r
4150 for(Int_t ci=0;ci<4;ci++)\r
4151 {\r
4152 for(Int_t p=1;p<=fnBinsPt;p++)\r
4153 {\r
4154 if(profile[0][ci])\r
4155 {\r
4156 Double_t correlation = profile[0][ci]->GetBinContent(p); \r
4157 Double_t spread = profile[0][ci]->GetBinError(p);\r
4158 Double_t nEvts = fNonEmptyBins1D[t][0]->GetBinContent(p);\r
4159 Double_t error = 0.;\r
4160 fFinalCorrelations1D[t][pW][eW][0][ci]->SetBinContent(p,correlation); \r
4161 if(nEvts>0)\r
4162 {\r
4163 error = spread/pow(nEvts,0.5);\r
4164 fFinalCorrelations1D[t][pW][eW][0][ci]->SetBinError(p,error);\r
4165 } \r
4166 } \r
4167 } // end of for(Int_t p=1;p<=fnBinsPt;p++)\r
4168 } // end of for(Int_t ci=0;ci<4;ci++)\r
4169 \r
4170 // transfer 1D profile into 1D histogram (eta):\r
4171 // to be improved (see in documentation if there is a method to transfer values from 1D profile into 1D histogram) \r
4172 for(Int_t ci=0;ci<4;ci++)\r
4173 {\r
4174 for(Int_t e=1;e<=fnBinsEta;e++)\r
4175 {\r
4176 if(profile[1][ci])\r
4177 {\r
4178 Double_t correlation = profile[1][ci]->GetBinContent(e); \r
4179 fFinalCorrelations1D[t][pW][eW][1][ci]->SetBinContent(e,correlation); \r
4180 } \r
4181 } // end of for(Int_t e=1;e<=fnBinsEta;e++)\r
4182 } // end of for(Int_t ci=0;ci<4;ci++)\r
4183 \r
4184} // end of void AliFlowAnalysisWithQCumulants::FinalizeCorrelationsForDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights)\r
4185*/\r
4186\r
4187\r
4188//================================================================================================================================\r
4189\r
4190\r
4191void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulants(TString type, TString ptOrEta)\r
4192{\r
4193 // calcualate cumulants for differential flow from measured correlations\r
4194 // Remark: cumulants calculated here are NOT corrected for non-uniform acceptance. This correction is applied in the method ...\r
4195 // to be improved (description) \r
4196 \r
4197 Int_t typeFlag = -1;\r
4198 Int_t ptEtaFlag = -1;\r
4199\r
4200 if(type == "RP")\r
4201 {\r
4202 typeFlag = 0;\r
4203 } else if(type == "POI")\r
4204 {\r
4205 typeFlag = 1;\r
4206 } \r
4207 \r
4208 if(ptOrEta == "Pt")\r
4209 {\r
4210 ptEtaFlag = 0;\r
4211 } else if(ptOrEta == "Eta")\r
4212 {\r
4213 ptEtaFlag = 1;\r
4214 } \r
4215 \r
4216 // shortcuts:\r
4217 Int_t t = typeFlag;\r
4218 Int_t pe = ptEtaFlag;\r
4219 \r
4220 // common:\r
4221 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
4222 \r
4223 // correlation <<2>>: \r
4224 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1);\r
4225 \r
4226 // 1D:\r
4227 for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
4228 {\r
4229 // reduced correlations: \r
4230 Double_t twoPrime = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b); // <<2'>>(pt)\r
4231 Double_t fourPrime = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b); // <<4'>>(pt)\r
4232 // final statistical error of reduced correlations:\r
4233 //Double_t twoPrimeError = fFinalCorrelations1D[t][pW][eW][0][0]->GetBinError(p); \r
4234 // QC{2'}:\r
4235 Double_t qc2Prime = twoPrime; // QC{2'}\r
4236 //Double_t qc2PrimeError = twoPrimeError; // final stat. error of QC{2'}\r
4237 fDiffFlowCumulants[t][pe][0]->SetBinContent(b,qc2Prime); \r
4238 //fFinalCumulantsPt[t][pW][eW][nua][0]->SetBinError(p,qc2PrimeError); \r
4239 // QC{4'}:\r
4240 Double_t qc4Prime = fourPrime - 2.*twoPrime*two; // QC{4'} = <<4'>> - 2*<<2'>><<2>>\r
4241 fDiffFlowCumulants[t][pe][1]->SetBinContent(b,qc4Prime); \r
4242 } // end of for(Int_t p=1;p<=fnBinsPt;p++)\r
4243 \r
4244 \r
4245 /* \r
4246 // 2D (pt,eta):\r
4247 // to be improved (see documentation if I can do all this without looping)\r
4248 for(Int_t p=1;p<=fnBinsPt;p++)\r
4249 {\r
4250 for(Int_t e=1;e<=fnBinsEta;e++) \r
4251 { \r
4252 // reduced correlations: \r
4253 Double_t twoPrime = fFinalCorrelations2D[t][pW][eW][0]->GetBinContent(fFinalCorrelations2D[t][pW][eW][0]->GetBin(p,e)); // <<2'>>(pt,eta)\r
4254 Double_t fourPrime = fFinalCorrelations2D[t][pW][eW][1]->GetBinContent(fFinalCorrelations2D[t][pW][eW][1]->GetBin(p,e)); // <<4'>>(pt,eta)\r
4255 for(Int_t nua=0;nua<2;nua++)\r
4256 {\r
4257 // QC{2'}:\r
4258 Double_t qc2Prime = twoPrime; // QC{2'} = <<2'>>\r
4259 fFinalCumulants2D[t][pW][eW][nua][0]->SetBinContent(fFinalCumulants2D[t][pW][eW][nua][0]->GetBin(p,e),qc2Prime); \r
4260 // QC{4'}:\r
4261 Double_t qc4Prime = fourPrime - 2.*twoPrime*two; // QC{4'} = <<4'>> - 2*<<2'>><<2>>\r
4262 fFinalCumulants2D[t][pW][eW][nua][1]->SetBinContent(fFinalCumulants2D[t][pW][eW][nua][1]->GetBin(p,e),qc4Prime); \r
4263 } // end of for(Int_t nua=0;nua<2;nua++) \r
4264 } // end of for(Int_t e=1;e<=fnBinsEta;e++)\r
4265 } // end of for(Int_t p=1;p<=fnBinsPt;p++)\r
4266 */\r
4267 \r
4268} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulants(TString type, Bool_t useParticleWeights, TString eventWeights); \r
4269\r
4270\r
4271//================================================================================================================================\r
4272\r
4273\r
4274void AliFlowAnalysisWithQCumulants::CalculateFinalResultsForRPandPOIIntegratedFlow(TString type)\r
4275{\r
4276 // calculate final results for integrated flow of RPs and POIs \r
4277 \r
4278 Int_t typeFlag = -1;\r
4279\r
4280 if(type == "RP")\r
4281 {\r
4282 typeFlag = 0;\r
4283 } else if(type == "POI")\r
4284 {\r
4285 typeFlag = 1;\r
4286 } else \r
4287 {\r
4288 cout<<"WARNING: type must be either RP or POI in AFAWQC::CDF() !!!!"<<endl;\r
4289 exit(0);\r
4290 }\r
4291 \r
4292 // shortcuts:\r
4293 Int_t t = typeFlag;\r
4294 \r
4295 // pt yield: \r
4296 TH1F *yield2ndPt = NULL;\r
4297 TH1F *yield4thPt = NULL;\r
4298 TH1F *yield6thPt = NULL;\r
4299 TH1F *yield8thPt = NULL;\r
4300 \r
4301 if(type == "POI")\r
4302 {\r
4303 yield2ndPt = (TH1F*)(fCommonHists2nd->GetHistPtPOI())->Clone();\r
4304 yield4thPt = (TH1F*)(fCommonHists4th->GetHistPtPOI())->Clone();\r
4305 yield6thPt = (TH1F*)(fCommonHists6th->GetHistPtPOI())->Clone();\r
4306 yield8thPt = (TH1F*)(fCommonHists8th->GetHistPtPOI())->Clone(); \r
4307 } \r
4308 else if(type == "RP")\r
4309 {\r
4310 yield2ndPt = (TH1F*)(fCommonHists2nd->GetHistPtRP())->Clone();\r
4311 yield4thPt = (TH1F*)(fCommonHists4th->GetHistPtRP())->Clone();\r
4312 yield6thPt = (TH1F*)(fCommonHists6th->GetHistPtRP())->Clone();\r
4313 yield8thPt = (TH1F*)(fCommonHists8th->GetHistPtRP())->Clone(); \r
4314 } \r
4315 \r
4316 Int_t nBinsPt = yield2ndPt->GetNbinsX();\r
4317 \r
4318 TH1D *flow2ndPt = NULL;\r
4319 TH1D *flow4thPt = NULL;\r
4320 TH1D *flow6thPt = NULL;\r
4321 TH1D *flow8thPt = NULL;\r
4322 \r
4323 // to be improved (hardwired pt index)\r
4324 flow2ndPt = (TH1D*)fDiffFlow[t][0][0]->Clone();\r
4325 flow4thPt = (TH1D*)fDiffFlow[t][0][1]->Clone();\r
4326 flow6thPt = (TH1D*)fDiffFlow[t][0][2]->Clone();\r
4327 flow8thPt = (TH1D*)fDiffFlow[t][0][3]->Clone(); \r
4328 \r
4329 Double_t dvn2nd = 0., dvn4th = 0., dvn6th = 0., dvn8th = 0.; // differential flow\r
4330 Double_t dErrvn2nd = 0., dErrvn4th = 0., dErrvn6th = 0., dErrvn8th = 0.; // error on differential flow\r
4331 \r
4332 Double_t dVn2nd = 0., dVn4th = 0., dVn6th = 0., dVn8th = 0.; // integrated flow \r
4333 Double_t dErrVn2nd = 0., dErrVn4th = 0., dErrVn6th = 0., dErrVn8th = 0.; // error on integrated flow\r
4334\r
4335 Double_t dYield2nd = 0., dYield4th = 0., dYield6th = 0., dYield8th = 0.; // pt yield \r
4336 Double_t dSum2nd = 0., dSum4th = 0., dSum6th = 0., dSum8th = 0.; // needed for normalizing integrated flow\r
4337 \r
4338 // looping over pt bins:\r
4339 for(Int_t p=1;p<nBinsPt+1;p++)\r
4340 {\r
4341 dvn2nd = flow2ndPt->GetBinContent(p);\r
4342 dvn4th = flow4thPt->GetBinContent(p);\r
4343 dvn6th = flow6thPt->GetBinContent(p);\r
4344 dvn8th = flow8thPt->GetBinContent(p);\r
4345 \r
4346 dErrvn2nd = flow2ndPt->GetBinError(p);\r
4347 dErrvn4th = flow4thPt->GetBinError(p);\r
4348 dErrvn6th = flow6thPt->GetBinError(p);\r
4349 dErrvn8th = flow8thPt->GetBinError(p);\r
4350\r
4351 dYield2nd = yield2ndPt->GetBinContent(p); \r
4352 dYield4th = yield4thPt->GetBinContent(p);\r
4353 dYield6th = yield6thPt->GetBinContent(p);\r
4354 dYield8th = yield8thPt->GetBinContent(p);\r
4355 \r
4356 dVn2nd += dvn2nd*dYield2nd;\r
4357 dVn4th += dvn4th*dYield4th;\r
4358 dVn6th += dvn6th*dYield6th;\r
4359 dVn8th += dvn8th*dYield8th;\r
4360 \r
4361 dSum2nd += dYield2nd;\r
4362 dSum4th += dYield4th;\r
4363 dSum6th += dYield6th;\r
4364 dSum8th += dYield8th;\r
4365 \r
4366 dErrVn2nd += dYield2nd*dYield2nd*dErrvn2nd*dErrvn2nd; // ro be improved (check this relation)\r
4367 dErrVn4th += dYield4th*dYield4th*dErrvn4th*dErrvn4th;\r
4368 dErrVn6th += dYield6th*dYield6th*dErrvn6th*dErrvn6th;\r
4369 dErrVn8th += dYield8th*dYield8th*dErrvn8th*dErrvn8th;\r
4370 \r
4371 } // end of for(Int_t p=1;p<nBinsPt+1;p++)\r
4372\r
4373 // normalizing the results for integrated flow:\r
4374 if(dSum2nd) \r
4375 {\r
4376 dVn2nd /= dSum2nd;\r
4377 dErrVn2nd /= (dSum2nd*dSum2nd);\r
4378 dErrVn2nd = TMath::Sqrt(dErrVn2nd);\r
4379 } \r
4380 if(dSum4th) \r
4381 {\r
4382 dVn4th /= dSum4th;\r
4383 dErrVn4th /= (dSum4th*dSum4th);\r
4384 dErrVn4th = TMath::Sqrt(dErrVn4th);\r
4385 } \r
4386 //if(dSum6th) dVn6th/=dSum6th;\r
4387 //if(dSum8th) dVn8th/=dSum8th;\r
4388 \r
4389 // storing the results for integrated flow in common histos: (to be improved: new method for this?)\r
4390 if(type == "POI")\r
4391 {\r
4392 fCommonHistsResults2nd->FillIntegratedFlowPOI(dVn2nd,dErrVn2nd); \r
4393 fCommonHistsResults4th->FillIntegratedFlowPOI(dVn4th,dErrVn4th); \r
4394 fCommonHistsResults6th->FillIntegratedFlowPOI(dVn6th,0.); // to be improved (errors)\r
4395 fCommonHistsResults8th->FillIntegratedFlowPOI(dVn8th,0.); // to be improved (errors)\r
4396 }\r
4397 else if (type == "RP")\r
4398 {\r
4399 fCommonHistsResults2nd->FillIntegratedFlowRP(dVn2nd,dErrVn2nd); \r
4400 fCommonHistsResults4th->FillIntegratedFlowRP(dVn4th,dErrVn4th);\r
4401 fCommonHistsResults6th->FillIntegratedFlowRP(dVn6th,0.); // to be improved (errors)\r
4402 fCommonHistsResults8th->FillIntegratedFlowRP(dVn8th,0.); // to be improved (errors)\r
4403 }\r
4404 \r
4405 delete flow2ndPt;\r
4406 delete flow4thPt;\r
4407 //delete flow6thPt;\r
4408 //delete flow8thPt;\r
4409 \r
4410 delete yield2ndPt;\r
4411 delete yield4thPt;\r
4412 delete yield6thPt;\r
4413 delete yield8thPt;\r
4414 \r
4415} // end of AliFlowAnalysisWithQCumulants::CalculateFinalResultsForRPandPOIIntegratedFlow(TString type)\r
4416\r
4417\r
4418//================================================================================================================================\r
4419\r
4420\r
4421void AliFlowAnalysisWithQCumulants::InitializeArraysForDistributions()\r
4422{\r
57340a27 4423 // Initialize all arrays used for distributions.
4424
4425 // a) Initialize arrays of histograms used to hold distributions of correlations;
4426 // b) Initialize array to hold min and max values of correlations.
4427
4428 // a) Initialize arrays of histograms used to hold distributions of correlations:
4429 for(Int_t di=0;di<4;di++) // distribution index\r
4430 {\r
4431 fDistributions[di] = NULL;\r
a5b7efd0 4432 }\r
57340a27 4433
4434 // b) Initialize default min and max values of correlations:
4435 // (Remark: The default values bellow were chosen for v2=5% and M=500)
4436 fMinValueOfCorrelation[0] = -0.01; // <2>_min
4437 fMaxValueOfCorrelation[0] = 0.04; // <2>_max
4438 fMinValueOfCorrelation[1] = -0.00002; // <4>_min
4439 fMaxValueOfCorrelation[1] = 0.00015; // <4>_max
4440 fMinValueOfCorrelation[2] = -0.0000003; // <6>_min
4441 fMaxValueOfCorrelation[2] = 0.0000006; // <6>_max
4442 fMinValueOfCorrelation[3] = -0.000000006; // <8>_min
4443 fMaxValueOfCorrelation[3] = 0.000000003; // <8>_max
a5b7efd0 4444 \r
4445} // end of void AliFlowAnalysisWithQCumulants::InitializeArraysForDistributions()\r
4446\r
57340a27 4447
a5b7efd0 4448//================================================================================================================================\r
4449\r
4450\r
4451void AliFlowAnalysisWithQCumulants::BookEverythingForDistributions()\r
4452{\r
57340a27 4453 // a) Book profile to hold all flags for distributions of correlations;
4454 // b) Book all histograms to hold distributions of correlations.
4455
4456 TString correlationIndex[4] = {"<2>","<4>","<6>","<8>"}; // to be improved (should I promote this to data members?)
4457
4458 // a) Book profile to hold all flags for distributions of correlations:
4459 TString distributionsFlagsName = "fDistributionsFlags";\r
4460 distributionsFlagsName += fAnalysisLabel->Data();\r
4461 fDistributionsFlags = new TProfile(distributionsFlagsName.Data(),"Flags for Distributions of Correlations",9,0,9);\r
4462 fDistributionsFlags->SetTickLength(-0.01,"Y");\r
4463 fDistributionsFlags->SetMarkerStyle(25);\r
4464 fDistributionsFlags->SetLabelSize(0.05);\r
4465 fDistributionsFlags->SetLabelOffset(0.02,"Y");\r
3b552efe 4466 fDistributionsFlags->GetXaxis()->SetBinLabel(1,"Store or not?");\r
4467 fDistributionsFlags->GetXaxis()->SetBinLabel(2,"<2>_{min}");\r
4468 fDistributionsFlags->GetXaxis()->SetBinLabel(3,"<2>_{max}");\r
4469 fDistributionsFlags->GetXaxis()->SetBinLabel(4,"<4>_{min}");\r
4470 fDistributionsFlags->GetXaxis()->SetBinLabel(5,"<4>_{max}");\r
4471 fDistributionsFlags->GetXaxis()->SetBinLabel(6,"<6>_{min}");\r
4472 fDistributionsFlags->GetXaxis()->SetBinLabel(7,"<6>_{max}");\r
4473 fDistributionsFlags->GetXaxis()->SetBinLabel(8,"<8>_{min}");\r
4474 fDistributionsFlags->GetXaxis()->SetBinLabel(9,"<8>_{max}");\r
57340a27 4475 fDistributionsList->Add(fDistributionsFlags);\r
4476
4477 // b) Book all histograms to hold distributions of correlations.
4478 if(fStoreDistributions)
4479 {
4480 TString distributionsName = "fDistributions";\r
4481 distributionsName += fAnalysisLabel->Data();\r
4482 for(Int_t di=0;di<4;di++) // distribution index\r
4483 {
4484 fDistributions[di] = new TH1D(Form("Distribution of %s",correlationIndex[di].Data()),Form("Distribution of %s",correlationIndex[di].Data()),10000,fMinValueOfCorrelation[di],fMaxValueOfCorrelation[di]); \r
4485 fDistributions[di]->SetXTitle(correlationIndex[di].Data());\r
4486 fDistributionsList->Add(fDistributions[di]);\r
4487 } // end of for(Int_t di=0;di<4;di++) // distribution index
4488 } // end of if(fStoreDistributions)
4489
a5b7efd0 4490} // end of void AliFlowAnalysisWithQCumulants::BookEverythingForDistributions()\r
4491\r
4492\r
57340a27 4493//================================================================================================================================\r
4494\r
4495
4496void AliFlowAnalysisWithQCumulants::StoreFlagsForDistributions()\r
4497{\r
4498 // Store all flags for distributiuons of correlations in profile fDistributionsFlags.\r
4499 \r
4500 if(!fDistributionsFlags)\r
4501 {\r
4502 cout<<"WARNING: fDistributionsFlags is NULL in AFAWQC::SDF() !!!!"<<endl;\r
4503 exit(0);\r
4504 } \r
4505\r
4506 fDistributionsFlags->Fill(0.5,(Int_t)fStoreDistributions); // histos with distributions of correlations stored or not in the output file
4507 // store min and max values of correlations:
4508 for(Int_t di=0;di<4;di++) // distribution index\r
4509 {\r
4510 fDistributionsFlags->Fill(1.5+2.*(Double_t)di,fMinValueOfCorrelation[di]);
4511 fDistributionsFlags->Fill(2.5+2.*(Double_t)di,fMaxValueOfCorrelation[di]);
4512 }\r
4513 \r
4514} // end of void AliFlowAnalysisWithQCumulants::StoreFlagsForDistributions()\r
4515\r
4516
4517//================================================================================================================================\r
4518
4519
4520void AliFlowAnalysisWithQCumulants::StoreDistributionsOfCorrelations()
4521{
4522 // Store distributions of correlations.
4523
4524 if(!(fIntFlowCorrelationsEBE && fIntFlowEventWeightsForCorrelationsEBE))\r
4525 {\r
4526 cout<<"WARNING: fIntFlowCorrelationsEBE && fIntFlowEventWeightsForCorrelationsEBE"<<endl; \r
4527 cout<<" is NULL in AFAWQC::SDOC() !!!!"<<endl;\r
4528 exit(0);\r
4529 }\r
4530
4531 for(Int_t di=0;di<4;di++) // distribution index\r
4532 {
4533 if(!fDistributions[di])\r
4534 { \r
4535 cout<<"WARNING: fDistributions[di] is NULL in AFAWQC::SDOC() !!!!"<<endl;\r
4536 cout<<"di = "<<di<<endl;\r
4537 exit(0);\r
4538 } else
4539 {
4540 fDistributions[di]->Fill(fIntFlowCorrelationsEBE->GetBinContent(di+1),fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(di+1));
4541 } \r
4542 } // end of for(Int_t di=0;di<4;di++) // distribution index\r
4543
4544} // end of void AliFlowAnalysisWithQCumulants::StoreDistributionsOfCorrelations()
4545
4546
a5b7efd0 4547//================================================================================================================================\r
4548\r
4549\r
4550void AliFlowAnalysisWithQCumulants::BookAndNestAllLists()\r
4551{\r
4552 // Book and nest all lists nested in the base list fHistList.\r
4553 // a) Book and nest lists for integrated flow;\r
4554 // b) Book and nest lists for differential flow;\r
4555 // c) Book and nest list for particle weights;\r
4556 // d) Book and nest list for distributions;\r
4557 // e) Book and nest list for nested loops;\r
4558 \r
4559 // a) Book and nest all lists for integrated flow:\r
4560 // base list for integrated flow:\r
4561 fIntFlowList = new TList();\r
4562 fIntFlowList->SetName("Integrated Flow");\r
4563 fIntFlowList->SetOwner(kTRUE);\r
4564 fHistList->Add(fIntFlowList);\r
4565 // list holding profiles: \r
4566 fIntFlowProfiles = new TList();\r
4567 fIntFlowProfiles->SetName("Profiles");\r
4568 fIntFlowProfiles->SetOwner(kTRUE);\r
4569 fIntFlowList->Add(fIntFlowProfiles);\r
4570 // list holding histograms with results:\r
4571 fIntFlowResults = new TList();\r
4572 fIntFlowResults->SetName("Results");\r
4573 fIntFlowResults->SetOwner(kTRUE);\r
4574 fIntFlowList->Add(fIntFlowResults);\r
4575 \r
4576 // b) Book and nest lists for differential flow;\r
4577 fDiffFlowList = new TList();\r
4578 fDiffFlowList->SetName("Differential Flow");\r
4579 fDiffFlowList->SetOwner(kTRUE); \r
4580 fHistList->Add(fDiffFlowList);\r
4581 // list holding profiles: \r
4582 fDiffFlowProfiles = new TList(); \r
4583 fDiffFlowProfiles->SetName("Profiles");\r
4584 fDiffFlowProfiles->SetOwner(kTRUE);\r
4585 fDiffFlowList->Add(fDiffFlowProfiles);\r
4586 // list holding histograms with results: \r
4587 fDiffFlowResults = new TList();\r
4588 fDiffFlowResults->SetName("Results");\r
4589 fDiffFlowResults->SetOwner(kTRUE);\r
4590 fDiffFlowList->Add(fDiffFlowResults);\r
4591 // flags used for naming nested lists in list fDiffFlowProfiles and fDiffFlowResults: \r
4592 TList list;\r
4593 list.SetOwner(kTRUE);\r
4594 TString typeFlag[2] = {"RP","POI"}; \r
4595 TString ptEtaFlag[2] = {"p_{T}","#eta"}; \r
4596 TString powerFlag[2] = {"linear","quadratic"}; \r
4597 // nested lists in fDiffFlowProfiles (~/Differential Flow/Profiles):\r
4598 for(Int_t t=0;t<2;t++) // type: RP or POI\r
4599 {\r
4600 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
4601 {\r
4602 // list holding profiles with correlations:\r
4603 fDiffFlowCorrelationsProList[t][pe] = (TList*)list.Clone();\r
4604 fDiffFlowCorrelationsProList[t][pe]->SetName(Form("Profiles with correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));\r
4605 fDiffFlowProfiles->Add(fDiffFlowCorrelationsProList[t][pe]);\r
4606 // list holding profiles with products of correlations:\r
4607 fDiffFlowProductOfCorrelationsProList[t][pe] = (TList*)list.Clone();\r
4608 fDiffFlowProductOfCorrelationsProList[t][pe]->SetName(Form("Profiles with products of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));\r
4609 fDiffFlowProfiles->Add(fDiffFlowProductOfCorrelationsProList[t][pe]);\r
4610 // list holding profiles with corrections:\r
4611 fDiffFlowCorrectionsProList[t][pe] = (TList*)list.Clone();\r
4612 fDiffFlowCorrectionsProList[t][pe]->SetName(Form("Profiles with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));\r
4613 fDiffFlowProfiles->Add(fDiffFlowCorrectionsProList[t][pe]); \r
4614 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta \r
4615 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI \r
4616 // nested lists in fDiffFlowResults (~/Differential Flow/Results):\r
4617 for(Int_t t=0;t<2;t++) // type: RP or POI\r
4618 {\r
4619 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
4620 {\r
4621 // list holding histograms with correlations:\r
4622 fDiffFlowCorrelationsHistList[t][pe] = (TList*)list.Clone();\r
4623 fDiffFlowCorrelationsHistList[t][pe]->SetName(Form("Correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));\r
4624 fDiffFlowResults->Add(fDiffFlowCorrelationsHistList[t][pe]);\r
4625 // list holding histograms with corrections:\r
4626 fDiffFlowCorrectionsHistList[t][pe] = (TList*)list.Clone();\r
4627 fDiffFlowCorrectionsHistList[t][pe]->SetName(Form("Histograms with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));\r
4628 fDiffFlowResults->Add(fDiffFlowCorrectionsHistList[t][pe]); \r
4629 for(Int_t power=0;power<2;power++)\r
4630 {\r
4631 // list holding histograms with sums of event weights:\r
4632 fDiffFlowSumOfEventWeightsHistList[t][pe][power] = (TList*)list.Clone();\r
4633 fDiffFlowSumOfEventWeightsHistList[t][pe][power]->SetName(Form("Sum of %s event weights (%s, %s)",powerFlag[power].Data(),typeFlag[t].Data(),ptEtaFlag[pe].Data()));\r
4634 fDiffFlowResults->Add(fDiffFlowSumOfEventWeightsHistList[t][pe][power]); \r
4635 } // end of for(Int_t power=0;power<2;power++)\r
4636 // list holding histograms with sums of products of event weights:\r
4637 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe] = (TList*)list.Clone();\r
4638 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]->SetName(Form("Sum of products of event weights (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));\r
4639 fDiffFlowResults->Add(fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]);\r
4640 // list holding histograms with covariances of correlations:\r
4641 fDiffFlowCovariancesHistList[t][pe] = (TList*)list.Clone();\r
4642 fDiffFlowCovariancesHistList[t][pe]->SetName(Form("Covariances of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));\r
4643 fDiffFlowResults->Add(fDiffFlowCovariancesHistList[t][pe]);\r
4644 // list holding histograms with differential Q-cumulants:\r
4645 fDiffFlowCumulantsHistList[t][pe] = (TList*)list.Clone();\r
4646 fDiffFlowCumulantsHistList[t][pe]->SetName(Form("Differential Q-cumulants (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));\r
4647 fDiffFlowResults->Add(fDiffFlowCumulantsHistList[t][pe]); \r
4648 // list holding histograms with differential flow estimates from Q-cumulants:\r
4649 fDiffFlowHistList[t][pe] = (TList*)list.Clone();\r
4650 fDiffFlowHistList[t][pe]->SetName(Form("Differential flow (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()));\r
4651 fDiffFlowResults->Add(fDiffFlowHistList[t][pe]); \r
4652 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta\r
4653 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI\r
4654 \r
4655 // c) Book and nest list for particle weights:\r
4656 fWeightsList->SetName("Weights");\r
4657 fWeightsList->SetOwner(kTRUE); \r
4658 fHistList->Add(fWeightsList); \r
4659\r
4660 // d) Book and nest list for distributions:\r
4661 fDistributionsList = new TList();\r
4662 fDistributionsList->SetName("Distributions");\r
4663 fDistributionsList->SetOwner(kTRUE);\r
4664 fHistList->Add(fDistributionsList);\r
4665 \r
4666 // e) Book and nest list for nested loops:\r
4667 fNestedLoopsList = new TList();\r
4668 fNestedLoopsList->SetName("Nested Loops");\r
4669 fNestedLoopsList->SetOwner(kTRUE);\r
4670 fHistList->Add(fNestedLoopsList);\r
4671 \r
4672} // end of void AliFlowAnalysisWithQCumulants::BookAndNestAllLists()\r
4673\r
4674\r
4675//================================================================================================================================\r
4676\r
4677\r
4678void AliFlowAnalysisWithQCumulants::FillCommonHistResultsDiffFlow(TString type)\r
4679{\r
4680 // fill common result histograms for differential flow\r
4681 \r
4682 Int_t typeFlag = -1;\r
4683 //Int_t ptEtaFlag = -1;\r
4684\r
4685 if(type == "RP")\r
4686 {\r
4687 typeFlag = 0;\r
4688 } else if(type == "POI")\r
4689 {\r
4690 typeFlag = 1;\r
4691 } \r
4692 \r
4693 // shortcuts:\r
4694 Int_t t = typeFlag;\r
4695 //Int_t pe = ptEtaFlag;\r
4696\r
4697 // to be improved (implement protection here)\r
4698 \r
4699 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))\r
4700 {\r
4701 cout<<"WARNING: fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th"<<endl; \r
4702 cout<<" is NULL in AFAWQC::FCHRIF() !!!!"<<endl;\r
4703 exit(0);\r
4704 }\r
4705 \r
4706 // pt:\r
4707 for(Int_t p=1;p<=fnBinsPt;p++)\r
4708 {\r
4709 Double_t v2 = fDiffFlow[t][0][0]->GetBinContent(p);\r
4710 Double_t v4 = fDiffFlow[t][0][1]->GetBinContent(p);\r
4711 Double_t v6 = fDiffFlow[t][0][2]->GetBinContent(p);\r
4712 Double_t v8 = fDiffFlow[t][0][3]->GetBinContent(p);\r
4713 \r
4714 Double_t v2Error = fDiffFlow[t][0][0]->GetBinError(p);\r
4715 Double_t v4Error = fDiffFlow[t][0][1]->GetBinError(p);\r
4716 //Double_t v6Error = fFinalFlow1D[t][pW][nua][0][2]->GetBinError(p);\r
4717 //Double_t v8Error = fFinalFlow1D[t][pW][nua][0][3]->GetBinError(p);\r
4718 \r
4719 if(type == "RP")\r
4720 {\r
4721 fCommonHistsResults2nd->FillDifferentialFlowPtRP(p,v2,v2Error);\r
4722 fCommonHistsResults4th->FillDifferentialFlowPtRP(p,v4,v4Error);\r
4723 fCommonHistsResults6th->FillDifferentialFlowPtRP(p,v6,0.);\r
4724 fCommonHistsResults8th->FillDifferentialFlowPtRP(p,v8,0.);\r
4725 } else if(type == "POI")\r
4726 {\r
4727 fCommonHistsResults2nd->FillDifferentialFlowPtPOI(p,v2,v2Error);\r
4728 fCommonHistsResults4th->FillDifferentialFlowPtPOI(p,v4,v4Error);\r
4729 fCommonHistsResults6th->FillDifferentialFlowPtPOI(p,v6,0.);\r
4730 fCommonHistsResults8th->FillDifferentialFlowPtPOI(p,v8,0.);\r
4731 }\r
4732 } // end of for(Int_t p=1;p<=fnBinsPt;p++) \r
4733 \r
4734 // eta:\r
4735 for(Int_t e=1;e<=fnBinsEta;e++)\r
4736 {\r
4737 Double_t v2 = fDiffFlow[t][1][0]->GetBinContent(e);\r
4738 Double_t v4 = fDiffFlow[t][1][1]->GetBinContent(e);\r
4739 Double_t v6 = fDiffFlow[t][1][2]->GetBinContent(e);\r
4740 Double_t v8 = fDiffFlow[t][1][3]->GetBinContent(e);\r
4741 \r
4742 Double_t v2Error = fDiffFlow[t][1][0]->GetBinError(e);\r
4743 Double_t v4Error = fDiffFlow[t][1][1]->GetBinError(e);\r
4744 //Double_t v6Error = fDiffFlow[t][1][2]->GetBinError(e);\r
4745 //Double_t v8Error = fDiffFlow[t][1][3]->GetBinError(e);\r
4746 \r
4747 if(type == "RP")\r
4748 {\r
4749 fCommonHistsResults2nd->FillDifferentialFlowEtaRP(e,v2,v2Error);\r
4750 fCommonHistsResults4th->FillDifferentialFlowEtaRP(e,v4,v4Error);\r
4751 fCommonHistsResults6th->FillDifferentialFlowEtaRP(e,v6,0.);\r
4752 fCommonHistsResults8th->FillDifferentialFlowEtaRP(e,v8,0.);\r
4753 } else if(type == "POI")\r
4754 {\r
4755 fCommonHistsResults2nd->FillDifferentialFlowEtaPOI(e,v2,v2Error);\r
4756 fCommonHistsResults4th->FillDifferentialFlowEtaPOI(e,v4,v4Error);\r
4757 fCommonHistsResults6th->FillDifferentialFlowEtaPOI(e,v6,0.);\r
4758 fCommonHistsResults8th->FillDifferentialFlowEtaPOI(e,v8,0.);\r
4759 }\r
4760 } // end of for(Int_t e=1;e<=fnBinsEta;e++) \r
4761 \r
4762} // end of void AliFlowAnalysisWithQCumulants::FillCommonHistResultsDiffFlow(TString type, Bool_t useParticleWeights, TString eventWeights, Bool_t correctedForNUA)\r
4763\r
4764\r
4765//================================================================================================================================\r
4766\r
4767\r
4768void AliFlowAnalysisWithQCumulants::AccessConstants()\r
4769{\r
3b552efe 4770 // Access needed common constants from AliFlowCommonConstants\r
a5b7efd0 4771 \r
4772 fnBinsPhi = AliFlowCommonConstants::GetMaster()->GetNbinsPhi();\r
4773 fPhiMin = AliFlowCommonConstants::GetMaster()->GetPhiMin(); \r
4774 fPhiMax = AliFlowCommonConstants::GetMaster()->GetPhiMax();\r
4775 if(fnBinsPhi) fPhiBinWidth = (fPhiMax-fPhiMin)/fnBinsPhi; \r
4776 fnBinsPt = AliFlowCommonConstants::GetMaster()->GetNbinsPt();\r
4777 fPtMin = AliFlowCommonConstants::GetMaster()->GetPtMin(); \r
4778 fPtMax = AliFlowCommonConstants::GetMaster()->GetPtMax();\r
4779 if(fnBinsPt) fPtBinWidth = (fPtMax-fPtMin)/fnBinsPt; \r
4780 fnBinsEta = AliFlowCommonConstants::GetMaster()->GetNbinsEta();\r
4781 fEtaMin = AliFlowCommonConstants::GetMaster()->GetEtaMin(); \r
4782 fEtaMax = AliFlowCommonConstants::GetMaster()->GetEtaMax();\r
4783 if(fnBinsEta) fEtaBinWidth = (fEtaMax-fEtaMin)/fnBinsEta; \r
4784 \r
3b552efe 4785} // end of void AliFlowAnalysisWithQCumulants::AccessConstants()
4786
4787
4788//================================================================================================================================\r
4789\r
4790\r
4791void AliFlowAnalysisWithQCumulants::CrossCheckSettings()\r
4792{\r
4793 // a) Cross check if the choice for multiplicity weights make sense;\r
4794 \r
4795 // a) Cross check if the choice for multiplicity weights make sense:
4796 if(strcmp(fMultiplicityWeight->Data(),"combinations") &&
4797 strcmp(fMultiplicityWeight->Data(),"unit") &&
4798 strcmp(fMultiplicityWeight->Data(),"multiplicity"))
4799 {
4800 cout<<"WARNING (QC): Multiplicity weight can be either \"combinations\", \"unit\""<<endl;
4801 cout<<" or \"multiplicity\". Certainly not \""<<fMultiplicityWeight->Data()<<"\"."<<endl;
4802 exit(0);
4803 } \r
4804 \r
4805} // end of void AliFlowAnalysisWithQCumulants::CrossCheckSettings()\r
a5b7efd0 4806\r
4807\r
4808//================================================================================================================================\r
4809\r
4810\r
4811void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeights()\r
4812{\r
4813 // Calculate sum of linear and quadratic event weights for correlations\r
4814 \r
4815 \r
4816 /*\r
4817 Double_t dMult = (*fSMpk)(0,0); // multiplicity \r
4818\r
4819 Double_t eventWeight[4] = {0}; \r
4820 \r
4821 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))\r
4822 {\r
4823 eventWeight[0] = dMult*(dMult-1); // event weight for <2> \r
4824 eventWeight[1] = dMult*(dMult-1)*(dMult-2)*(dMult-3); // event weight for <4> \r
4825 eventWeight[2] = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5); // event weight for <6> \r
4826 eventWeight[3] = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7); // event weight for <8> \r
4827 } else\r
4828 {\r
4829 eventWeight[0] = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j;\r
4830 eventWeight[1] = (*fSMpk)(3,1)-6.*(*fSMpk)(0,2)*(*fSMpk)(1,1) \r
4831 + 8.*(*fSMpk)(0,3)*(*fSMpk)(0,1)\r
4832 + 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
4833 //eventWeight[2] = ... // to be improved (calculated) \r
4834 //eventWeight[3] = ... // to be improved (calculated) \r
4835 }\r
4836 */\r
4837 \r
4838 \r
4839 for(Int_t p=0;p<2;p++) // power-1\r
4840 {\r
4841 for(Int_t ci=0;ci<4;ci++) // correlation index\r
4842 { \r
4843 fIntFlowSumOfEventWeights[p]->Fill(ci+0.5,pow(fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci+1),p+1)); \r
4844 }\r
4845 }\r
4846 \r
4847} // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfEventWeights()\r
4848\r
4849\r
4850//================================================================================================================================\r
4851\r
4852\r
4853void AliFlowAnalysisWithQCumulants::CalculateIntFlowSumOfProductOfEventWeights()\r
4854{\r
4855 // Calculate sum of product of event weights for correlations\r
4856 \r
4857 \r
4858 /*\r
4859 Double_t dMult = (*fSMpk)(0,0); // multiplicity \r
4860\r
4861 Double_t eventWeight[4] = {0}; \r
4862 \r
4863 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))\r
4864 {\r
4865 eventWeight[0] = dMult*(dMult-1); // event weight for <2> \r
4866 eventWeight[1] = dMult*(dMult-1)*(dMult-2)*(dMult-3); // event weight for <4> \r
4867 eventWeight[2] = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5); // event weight for <6> \r
4868 eventWeight[3] = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7); // event weight for <8> \r
4869 } else\r
4870 {\r
4871 eventWeight[0] = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j;\r
4872 eventWeight[1] = (*fSMpk)(3,1)-6.*(*fSMpk)(0,2)*(*fSMpk)(1,1) \r
4873 + 8.*(*fSMpk)(0,3)*(*fSMpk)(0,1)\r
4874 + 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
4875 //eventWeight[2] = ... // to be improved (calculated) \r
4876 //eventWeight[3] = ... // to be improved (calculated) \r
4877 }\r
4878\r
4879 fIntFlowSumOfProductOfEventWeights->Fill(0.5,eventWeight[0]*eventWeight[1]); \r
4880 fIntFlowSumOfProductOfEventWeights->Fill(1.5,eventWeight[0]*eventWeight[2]); \r
4881 fIntFlowSumOfProductOfEventWeights->Fill(2.5,eventWeight[0]*eventWeight[3]); \r
4882 fIntFlowSumOfProductOfEventWeights->Fill(3.5,eventWeight[1]*eventWeight[2]); \r
4883 fIntFlowSumOfProductOfEventWeights->Fill(4.5,eventWeight[1]*eventWeight[3]); \r
4884 fIntFlowSumOfProductOfEventWeights->Fill(5.5,eventWeight[2]*eventWeight[3]); \r
4885 */\r
4886 \r
4887 \r
4888 Int_t counter = 0;\r
4889 \r
4890 for(Int_t ci1=1;ci1<4;ci1++)\r
4891 {\r
4892 for(Int_t ci2=ci1+1;ci2<=4;ci2++)\r
4893 {\r
4894 fIntFlowSumOfProductOfEventWeights->Fill(0.5+counter++,\r
4895 fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci1)*fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(ci2));\r
4896 }\r
4897 }\r
4898\r
4899 \r
4900\r
4901} // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowIntFlowSumOfProductOfEventWeights()\r
4902\r
4903\r
4904//================================================================================================================================\r
4905\r
4906\r
4907void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelations(TString type, TString ptOrEta)\r
4908{\r
4909 // calculate reduced correlations for RPs or POIs in pt or eta bins\r
4910\r
4911 // multiplicity:\r
4912 Double_t dMult = (*fSMpk)(0,0);\r
4913 \r
4914 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n: \r
4915 Double_t dReQ1n = (*fReQ)(0,0);\r
4916 Double_t dReQ2n = (*fReQ)(1,0);\r
4917 //Double_t dReQ3n = (*fReQ)(2,0);\r
4918 //Double_t dReQ4n = (*fReQ)(3,0);\r
4919 Double_t dImQ1n = (*fImQ)(0,0);\r
4920 Double_t dImQ2n = (*fImQ)(1,0);\r
4921 //Double_t dImQ3n = (*fImQ)(2,0);\r
4922 //Double_t dImQ4n = (*fImQ)(3,0);\r
4923\r
4924 // reduced correlations are stored in fDiffFlowCorrelationsPro[0=RP,1=POI][0=pt,1=eta][correlation index]. Correlation index runs as follows:\r
4925 // \r
4926 // 0: <<2'>>\r
4927 // 1: <<4'>>\r
4928 // 2: <<6'>>\r
4929 // 3: <<8'>>\r
4930 \r
4931 Int_t t = -1; // type flag \r
4932 Int_t pe = -1; // ptEta flag\r
4933 \r
4934 if(type == "RP")\r
4935 {\r
4936 t = 0;\r
4937 } else if(type == "POI")\r
4938 {\r
4939 t = 1;\r
4940 }\r
4941\r
4942 if(ptOrEta == "Pt")\r
4943 {\r
4944 pe = 0;\r
4945 } else if(ptOrEta == "Eta")\r
4946 {\r
4947 pe = 1;\r
4948 }\r
4949 \r
4950 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
4951 Double_t minPtEta[2] = {fPtMin,fEtaMin};\r
4952 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};\r
4953 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};\r
4954\r
4955 // looping over all bins and calculating reduced correlations: \r
4956 for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
4957 {\r
4958 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin): \r
4959 Double_t p1n0kRe = 0.;\r
4960 Double_t p1n0kIm = 0.;\r
4961\r
4962 // number of POIs in particular pt or eta bin:\r
4963 Double_t mp = 0.;\r
4964\r
4965 // 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
4966 Double_t q1n0kRe = 0.;\r
4967 Double_t q1n0kIm = 0.;\r
4968 Double_t q2n0kRe = 0.;\r
4969 Double_t q2n0kIm = 0.;\r
4970\r
4971 // number of particles which are both RPs and POIs in particular pt or eta bin:\r
4972 Double_t mq = 0.;\r
4973 \r
4974 if(type == "POI")\r
4975 {\r
4976 // q_{m*n,0}:\r
4977 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))\r
4978 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));\r
4979 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))\r
4980 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));\r
4981 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))\r
4982 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));\r
4983 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))\r
4984 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b)); \r
4985 \r
4986 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
4987 } \r
4988 else if(type == "RP")\r
4989 {\r
4990 // q_{m*n,0}:\r
4991 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))\r
4992 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));\r
4993 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))\r
4994 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));\r
4995 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))\r
4996 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));\r
4997 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))\r
4998 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b)); \r
4999 \r
5000 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
5001 }\r
5002 \r
5003 if(type == "POI")\r
5004 {\r
5005 // p_{m*n,0}:\r
5006 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))\r
5007 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));\r
5008 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b)) \r
5009 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));\r
5010 \r
5011 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
5012 \r
5013 t = 1; // typeFlag = RP or POI\r
5014 }\r
5015 else if(type == "RP")\r
5016 {\r
5017 // p_{m*n,0} = q_{m*n,0}:\r
5018 p1n0kRe = q1n0kRe; \r
5019 p1n0kIm = q1n0kIm; \r
5020 \r
5021 mp = mq; \r
5022 \r
5023 t = 0; // typeFlag = RP or POI\r
5024 }\r
5025 \r
5026 // 2'-particle correlation for particular (pt,eta) bin:\r
5027 Double_t two1n1nPtEta = 0.;\r
5028 if(mp*dMult-mq)\r
5029 {\r
5030 two1n1nPtEta = (p1n0kRe*dReQ1n+p1n0kIm*dImQ1n-mq)\r
5031 / (mp*dMult-mq);\r
5032 \r
5033 if(type == "POI") // to be improved (I do not this if)\r
5034 { \r
5035 // fill profile to get <<2'>> for POIs\r
5036 fDiffFlowCorrelationsPro[1][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta,mp*dMult-mq);\r
5037 // histogram to store <2'> for POIs e-b-e (needed in some other methods):\r
5038 fDiffFlowCorrelationsEBE[1][pe][0]->SetBinContent(b,two1n1nPtEta); \r
5039 fDiffFlowEventWeightsForCorrelationsEBE[1][pe][0]->SetBinContent(b,mp*dMult-mq); \r
5040 }\r
5041 else if(type == "RP") // to be improved (I do not this if)\r
5042 {\r
5043 // profile to get <<2'>> for RPs:\r
5044 fDiffFlowCorrelationsPro[0][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nPtEta,mp*dMult-mq);\r
5045 // histogram to store <2'> for RPs e-b-e (needed in some other methods):\r
5046 fDiffFlowCorrelationsEBE[0][pe][0]->SetBinContent(b,two1n1nPtEta); \r
5047 fDiffFlowEventWeightsForCorrelationsEBE[0][pe][0]->SetBinContent(b,mp*dMult-mq); \r
5048 }\r
5049 } // end of if(mp*dMult-mq)\r
5050 \r
5051 // 4'-particle correlation:\r
5052 Double_t four1n1n1n1nPtEta = 0.;\r
5053 if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
5054 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)) // to be improved (introduce a new variable for this expression)\r
5055 {\r
5056 four1n1n1n1nPtEta = ((pow(dReQ1n,2.)+pow(dImQ1n,2.))*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)\r
5057 - q2n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))\r
5058 - 2.*q2n0kIm*dReQ1n*dImQ1n\r
5059 - p1n0kRe*(dReQ1n*dReQ2n+dImQ1n*dImQ2n)\r
5060 + p1n0kIm*(dImQ1n*dReQ2n-dReQ1n*dImQ2n)\r
5061 - 2.*dMult*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n)\r
5062 - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))*mq \r
5063 + 6.*(q1n0kRe*dReQ1n+q1n0kIm*dImQ1n) \r
5064 + 1.*(q2n0kRe*dReQ2n+q2n0kIm*dImQ2n) \r
5065 + 2.*(p1n0kRe*dReQ1n+p1n0kIm*dImQ1n) \r
5066 + 2.*mq*dMult \r
5067 - 6.*mq) \r
5068 / ((mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
5069 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)); \r
5070 \r
5071 if(type == "POI")\r
5072 {\r
5073 // profile to get <<4'>> for POIs:\r
5074 fDiffFlowCorrelationsPro[1][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta,\r
5075 (mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
5076 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)); \r
5077 // histogram to store <4'> for POIs e-b-e (needed in some other methods):\r
5078 fDiffFlowCorrelationsEBE[1][pe][1]->SetBinContent(b,four1n1n1n1nPtEta); \r
5079 fDiffFlowEventWeightsForCorrelationsEBE[1][pe][1]->SetBinContent(b,(mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
5080 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)); \r
5081 }\r
5082 else if(type == "RP")\r
5083 {\r
5084 // profile to get <<4'>> for RPs:\r
5085 fDiffFlowCorrelationsPro[0][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nPtEta,\r
5086 (mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
5087 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)); \r
5088 // histogram to store <4'> for RPs e-b-e (needed in some other methods):\r
5089 fDiffFlowCorrelationsEBE[0][pe][1]->SetBinContent(b,four1n1n1n1nPtEta); \r
5090 fDiffFlowEventWeightsForCorrelationsEBE[0][pe][1]->SetBinContent(b,(mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
5091 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.)); \r
5092 }\r
5093 } // end of if((mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
5094 // +mq*(dMult-1.)*(dMult-2.)*(dMult-3.))\r
5095 \r
5096 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
5097 \r
5098 \r
5099} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelations(TString type, TString ptOrEta);\r
5100\r
5101\r
5102//================================================================================================================================\r
5103\r
5104\r
5105void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfEventWeights(TString type, TString ptOrEta)\r
5106{\r
5107 // Calculate sums of various event weights for reduced correlations. \r
5108 // (These quantitites are needed in expressions for unbiased estimators relevant for the statistical errors.)\r
5109\r
5110 Int_t typeFlag = -1;\r
5111 Int_t ptEtaFlag = -1;\r
5112\r
5113 if(type == "RP")\r
5114 {\r
5115 typeFlag = 0;\r
5116 } else if(type == "POI")\r
5117 {\r
5118 typeFlag = 1;\r
5119 } \r
5120 \r
5121 if(ptOrEta == "Pt")\r
5122 {\r
5123 ptEtaFlag = 0;\r
5124 } else if(ptOrEta == "Eta")\r
5125 {\r
5126 ptEtaFlag = 1;\r
5127 } \r
5128 \r
5129 // shortcuts:\r
5130 Int_t t = typeFlag;\r
5131 Int_t pe = ptEtaFlag;\r
5132 \r
5133 // binning:\r
5134 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
5135 Double_t minPtEta[2] = {fPtMin,fEtaMin};\r
5136 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};\r
5137 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};\r
5138 \r
5139 for(Int_t rpq=0;rpq<3;rpq++)\r
5140 {\r
5141 for(Int_t m=0;m<4;m++)\r
5142 {\r
5143 for(Int_t k=0;k<9;k++)\r
5144 {\r
5145 if(!fReRPQ1dEBE[rpq][pe][m][k])\r
5146 {\r
5147 cout<<"WARNING: fReRPQ1dEBE[rpq][pe][m][k] is NULL in AFAWQC::CSAPOEWFDF() !!!!"<<endl;\r
5148 cout<<"pe = "<<pe<<endl;\r
5149 cout<<"rpq = "<<rpq<<endl;\r
5150 cout<<"m = "<<m<<endl;\r
5151 cout<<"k = "<<k<<endl;\r
5152 exit(0); \r
5153 }\r
5154 }\r
5155 }\r
5156 } \r
5157\r
5158 // multiplicities:\r
5159 Double_t dMult = (*fSMpk)(0,0); // total event multiplicity\r
5160 //Double_t mr = 0.; // number of RPs in particular pt or eta bin\r
5161 Double_t mp = 0.; // number of POIs in particular pt or eta bin \r
5162 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin\r
5163 \r
5164 // event weights for reduced correlations:\r
5165 Double_t dw2 = 0.; // event weight for <2'>\r
5166 Double_t dw4 = 0.; // event weight for <4'>\r
5167 //Double_t dw6 = 0.; // event weight for <6'>\r
5168 //Double_t dw8 = 0.; // event weight for <8'>\r
5169\r
5170 // looping over bins:\r
5171 for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
5172 {\r
5173 if(type == "RP")\r
5174 {\r
5175 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);\r
5176 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow\r
5177 } else if(type == "POI")\r
5178 {\r
5179 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);\r
5180 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b); \r
5181 }\r
5182 \r
5183 // event weight for <2'>:\r
5184 dw2 = mp*dMult-mq; \r
5185 fDiffFlowSumOfEventWeights[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2);\r
5186 fDiffFlowSumOfEventWeights[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw2,2.));\r
5187 \r
5188 // event weight for <4'>:\r
5189 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
5190 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.); \r
5191 fDiffFlowSumOfEventWeights[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4);\r
5192 fDiffFlowSumOfEventWeights[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw4,2.));\r
5193 \r
5194 // event weight for <6'>:\r
5195 //dw6 = ...; \r
5196 //fDiffFlowSumOfEventWeights[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6);\r
5197 //fDiffFlowSumOfEventWeights[t][pe][t][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw6,2.));\r
5198 \r
5199 // event weight for <8'>:\r
5200 //dw8 = ...; \r
5201 //fDiffFlowSumOfEventWeights[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw8);\r
5202 //fDiffFlowSumOfEventWeights[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],pow(dw8,2.)); \r
5203 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++) \r
5204 \r
5205} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfEventWeights()\r
5206\r
5207\r
5208//================================================================================================================================\r
5209\r
5210\r
5211void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfProductOfEventWeights(TString type, TString ptOrEta)\r
5212{\r
5213 // Calculate sum of products of various event weights for both types of correlations (the ones for int. and diff. flow). \r
5214 // (These quantitites are needed in expressions for unbiased estimators relevant for the statistical errors.)\r
5215 //\r
5216 // Important: To fill fDiffFlowSumOfProductOfEventWeights[][][][] use bellow table (i,j) with following constraints: \r
5217 // 1.) i<j \r
5218 // 2.) do not store terms which DO NOT include reduced correlations;\r
5219 // Table:\r
5220 // [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
5221 \r
5222 Int_t typeFlag = -1;\r
5223 Int_t ptEtaFlag = -1;\r
5224\r
5225 if(type == "RP")\r
5226 {\r
5227 typeFlag = 0;\r
5228 } else if(type == "POI")\r
5229 {\r
5230 typeFlag = 1;\r
5231 } \r
5232 \r
5233 if(ptOrEta == "Pt")\r
5234 {\r
5235 ptEtaFlag = 0;\r
5236 } else if(ptOrEta == "Eta")\r
5237 {\r
5238 ptEtaFlag = 1;\r
5239 } \r
5240 \r
5241 // shortcuts:\r
5242 Int_t t = typeFlag;\r
5243 Int_t pe = ptEtaFlag;\r
5244 \r
5245 // binning:\r
5246 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
5247 Double_t minPtEta[2] = {fPtMin,fEtaMin};\r
5248 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};\r
5249 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};\r
5250 \r
5251 // protection:\r
5252 for(Int_t rpq=0;rpq<3;rpq++)\r
5253 {\r
5254 for(Int_t m=0;m<4;m++)\r
5255 {\r
5256 for(Int_t k=0;k<9;k++)\r
5257 {\r
5258 if(!fReRPQ1dEBE[rpq][pe][m][k])\r
5259 {\r
5260 cout<<"WARNING: fReRPQ1dEBE[rpq][pe][m][k] is NULL in AFAWQC::CSAPOEWFDF() !!!!"<<endl;\r
5261 cout<<"pe = "<<pe<<endl;\r
5262 cout<<"rpq = "<<rpq<<endl;\r
5263 cout<<"m = "<<m<<endl;\r
5264 cout<<"k = "<<k<<endl;\r
5265 exit(0); \r
5266 }\r
5267 }\r
5268 }\r
5269 } \r
5270 \r
5271 // multiplicities:\r
5272 Double_t dMult = (*fSMpk)(0,0); // total event multiplicity\r
5273 //Double_t mr = 0.; // number of RPs in particular pt or eta bin\r
5274 Double_t mp = 0.; // number of POIs in particular pt or eta bin \r
5275 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin\r
5276 \r
5277 // event weights for correlations:\r
5278 Double_t dW2 = dMult*(dMult-1); // event weight for <2> \r
5279 Double_t dW4 = dMult*(dMult-1)*(dMult-2)*(dMult-3); // event weight for <4> \r
5280 Double_t dW6 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5); // event weight for <6> \r
5281 Double_t dW8 = dMult*(dMult-1)*(dMult-2)*(dMult-3)*(dMult-4)*(dMult-5)*(dMult-6)*(dMult-7); // event weight for <8> \r
5282\r
5283 // event weights for reduced correlations:\r
5284 Double_t dw2 = 0.; // event weight for <2'>\r
5285 Double_t dw4 = 0.; // event weight for <4'>\r
5286 //Double_t dw6 = 0.; // event weight for <6'>\r
5287 //Double_t dw8 = 0.; // event weight for <8'>\r
5288 \r
5289 // looping over bins:\r
5290 for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
5291 {\r
5292 if(type == "RP")\r
5293 {\r
5294 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);\r
5295 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow\r
5296 } else if(type == "POI")\r
5297 {\r
5298 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);\r
5299 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b); \r
5300 }\r
5301 \r
5302 // event weight for <2'>:\r
5303 dw2 = mp*dMult-mq; \r
5304 fDiffFlowSumOfProductOfEventWeights[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw2); // storing product of even weights for <2> and <2'>\r
5305 fDiffFlowSumOfProductOfEventWeights[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW4); // storing product of even weights for <4> and <2'>\r
5306 fDiffFlowSumOfProductOfEventWeights[t][pe][1][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW6); // storing product of even weights for <6> and <2'>\r
5307 fDiffFlowSumOfProductOfEventWeights[t][pe][1][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dW8); // storing product of even weights for <8> and <2'>\r
5308 \r
5309 // event weight for <4'>:\r
5310 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
5311 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.); \r
5312 fDiffFlowSumOfProductOfEventWeights[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw4); // storing product of even weights for <2> and <4'>\r
5313 fDiffFlowSumOfProductOfEventWeights[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw4); // storing product of even weights for <2'> and <4'>\r
5314 fDiffFlowSumOfProductOfEventWeights[t][pe][2][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw4); // storing product of even weights for <4> and <4'>\r
5315 fDiffFlowSumOfProductOfEventWeights[t][pe][3][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dW6); // storing product of even weights for <6> and <4'> \r
5316 fDiffFlowSumOfProductOfEventWeights[t][pe][3][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dW8); // storing product of even weights for <8> and <4'>\r
5317\r
5318 // event weight for <6'>:\r
5319 //dw6 = ...; \r
5320 //fDiffFlowSumOfProductOfEventWeights[t][pe][0][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw6); // storing product of even weights for <2> and <6'>\r
5321 //fDiffFlowSumOfProductOfEventWeights[t][pe][1][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw6); // storing product of even weights for <2'> and <6'>\r
5322 //fDiffFlowSumOfProductOfEventWeights[t][pe][2][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw6); // storing product of even weights for <4> and <6'>\r
5323 //fDiffFlowSumOfProductOfEventWeights[t][pe][3][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dw6); // storing product of even weights for <4'> and <6'> \r
5324 //fDiffFlowSumOfProductOfEventWeights[t][pe][4][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW6*dw6); // storing product of even weights for <6> and <6'>\r
5325 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dW8); // storing product of even weights for <6'> and <8>\r
5326 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dw8); // storing product of even weights for <6'> and <8'>\r
5327\r
5328 // event weight for <8'>:\r
5329 //dw8 = ...; \r
5330 //fDiffFlowSumOfProductOfEventWeights[t][pe][0][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW2*dw8); // storing product of even weights for <2> and <8'>\r
5331 //fDiffFlowSumOfProductOfEventWeights[t][pe][1][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw2*dw8); // storing product of even weights for <2'> and <8'>\r
5332 //fDiffFlowSumOfProductOfEventWeights[t][pe][2][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW4*dw8); // storing product of even weights for <4> and <8'>\r
5333 //fDiffFlowSumOfProductOfEventWeights[t][pe][3][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw4*dw8); // storing product of even weights for <4'> and <8'> \r
5334 //fDiffFlowSumOfProductOfEventWeights[t][pe][4][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW6*dw8); // storing product of even weights for <6> and <8'>\r
5335 //fDiffFlowSumOfProductOfEventWeights[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dw6*dw8); // storing product of even weights for <6'> and <8'>\r
5336 //fDiffFlowSumOfProductOfEventWeights[t][pe][6][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],dW8*dw8); // storing product of even weights for <8> and <8'>\r
5337 \r
5338 // Table:\r
5339 // [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
5340 \r
5341 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
5342 \r
5343\r
5344\r
5345} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowSumOfProductOfEventWeights(TString type, TString ptOrEta)\r
5346\r
5347\r
5348//================================================================================================================================\r
5349\r
5350\r
5351void AliFlowAnalysisWithQCumulants::FinalizeReducedCorrelations(TString type, TString ptOrEta)\r
5352{\r
5353 // Transfer profiles into histograms and calculate statistical errors correctly.\r
5354\r
5355 Int_t typeFlag = -1;\r
5356 Int_t ptEtaFlag = -1;\r
5357\r
5358 if(type == "RP")\r
5359 {\r
5360 typeFlag = 0;\r
5361 } else if(type == "POI")\r
5362 {\r
5363 typeFlag = 1;\r
5364 } \r
5365 \r
5366 if(ptOrEta == "Pt")\r
5367 {\r
5368 ptEtaFlag = 0;\r
5369 } else if(ptOrEta == "Eta")\r
5370 {\r
5371 ptEtaFlag = 1;\r
5372 } \r
5373 \r
5374 // shortcuts:\r
5375 Int_t t = typeFlag;\r
5376 Int_t pe = ptEtaFlag;\r
5377 \r
5378 for(Int_t rci=0;rci<4;rci++)\r
5379 {\r
5380 if(!fDiffFlowCorrelationsPro[t][pe][rci])\r
5381 {\r
5382 cout<<"WARNING: fDiffFlowCorrelationsPro[t][pe][rci] is NULL in AFAWQC::FRC() !!!!"<<endl;\r
5383 cout<<"t = "<<t<<endl; \r
5384 cout<<"pe = "<<pe<<endl; \r
5385 cout<<"rci = "<<rci<<endl;\r
5386 exit(0); \r
5387 }\r
5388 for(Int_t power=0;power<2;power++)\r
5389 {\r
5390 if(!fDiffFlowSumOfEventWeights[t][pe][power][rci])\r
5391 {\r
5392 cout<<"WARNING: fDiffFlowSumOfEventWeights[t][pe][power][rci] is NULL in AFAWQC::FRC() !!!!"<<endl;\r
5393 cout<<"t = "<<t<<endl; \r
5394 cout<<"pe = "<<pe<<endl;\r
5395 cout<<"power = "<<power<<endl; \r
5396 cout<<"rci = "<<rci<<endl;\r
5397 exit(0); \r
5398 } \r
5399 } // end of for(Int_t power=0;power<2;power++)\r
5400 } // end of for(Int_t rci=0;rci<4;rci++)\r
5401 \r
5402 // common:\r
5403 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
5404 \r
5405 // transfer 1D profile into 1D histogram:\r
5406 Double_t correlation = 0.;\r
5407 Double_t spread = 0.;\r
5408 Double_t sumOfWeights = 0.; // sum of weights for particular reduced correlations for particular pt or eta bin\r
5409 Double_t sumOfSquaredWeights = 0.; // sum of squared weights for particular reduced correlations for particular pt or eta bin\r
5410 Double_t error = 0.; // error = termA * spread * termB\r
5411 // termA = (sqrt(sumOfSquaredWeights)/sumOfWeights) \r
5412 // termB = 1/pow(1-termA^2,0.5)\r
5413 Double_t termA = 0.; \r
5414 Double_t termB = 0.; \r
5415 for(Int_t rci=0;rci<4;rci++) // index of reduced correlation\r
5416 {\r
5417 for(Int_t b=1;b<=nBinsPtEta[pe];b++) // number of pt or eta bins\r
5418 {\r
5419 correlation = fDiffFlowCorrelationsPro[t][pe][rci]->GetBinContent(b); \r
5420 spread = fDiffFlowCorrelationsPro[t][pe][rci]->GetBinError(b);\r
5421 sumOfWeights = fDiffFlowSumOfEventWeights[t][pe][0][rci]->GetBinContent(b);\r
5422 sumOfSquaredWeights = fDiffFlowSumOfEventWeights[t][pe][1][rci]->GetBinContent(b);\r
5423 if(sumOfWeights) termA = (pow(sumOfSquaredWeights,0.5)/sumOfWeights);\r
5424 if(1.-pow(termA,2.)>0.) termB = 1./pow(1.-pow(termA,2.),0.5); \r
5425 error = termA*spread*termB; // final error (unbiased estimator for standard deviation)\r
5426 fDiffFlowCorrelationsHist[t][pe][rci]->SetBinContent(b,correlation); \r
5427 fDiffFlowCorrelationsHist[t][pe][rci]->SetBinError(b,error); \r
5428 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
5429 } // end of for(Int_t rci=0;rci<4;rci++)\r
5430 \r
5431} // end of void AliFlowAnalysisWithQCumulants::FinalizeReducedCorrelations(TString type, TString ptOrEta)\r
5432\r
5433\r
5434//================================================================================================================================\r
5435\r
5436\r
5437void AliFlowAnalysisWithQCumulants::CalculateDiffFlowProductOfCorrelations(TString type, TString ptOrEta)\r
5438{\r
5439 // store products: <2><2'>, <2><4'>, <2><6'>, <2><8'>, <2'><4>, \r
5440 // <2'><4'>, <2'><6>, <2'><6'>, <2'><8>, <2'><8'>,\r
5441 // <4><4'>, <4><6'>, <4><8'>, <4'><6>, <4'><6'>, \r
5442 // <4'><8>, <4'><8'>, <6><6'>, <6><8'>, <6'><8>, \r
5443 // <6'><8'>, <8><8'>.\r
5444 \r
5445 Int_t typeFlag = -1;\r
5446 Int_t ptEtaFlag = -1;\r
5447\r
5448 if(type == "RP")\r
5449 {\r
5450 typeFlag = 0;\r
5451 } else if(type == "POI")\r
5452 {\r
5453 typeFlag = 1;\r
5454 } \r
5455 \r
5456 if(ptOrEta == "Pt")\r
5457 {\r
5458 ptEtaFlag = 0;\r
5459 } else if(ptOrEta == "Eta")\r
5460 {\r
5461 ptEtaFlag = 1;\r
5462 } \r
5463 \r
5464 // shortcuts:\r
5465 Int_t t = typeFlag;\r
5466 Int_t pe = ptEtaFlag;\r
5467 \r
5468 // common:\r
5469 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
5470 Double_t minPtEta[2] = {fPtMin,fEtaMin};\r
5471 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};\r
5472 \r
5473 // protections // to be improved (add protection for all pointers in this method)\r
5474 if(!fIntFlowCorrelationsEBE)\r
5475 {\r
5476 cout<<"WARNING: fIntFlowCorrelationsEBE is NULL in AFAWQC::CDFPOC() !!!!"<<endl;\r
5477 exit(0);\r
5478 } \r
5479 \r
5480 /* \r
5481 Double_t dMult = (*fSMpk)(0,0); // multiplicity (number of particles used to determine the reaction plane)\r
5482 //Double_t mr = 0.; // number of RPs in particular pt or eta bin\r
5483 Double_t mp = 0.; // number of POIs in particular pt or eta bin \r
5484 Double_t mq = 0.; // number of particles which are both RPs and POIs in particular pt or eta bin\r
5485 */\r
5486\r
5487 // e-b-e correlations:\r
5488 Double_t twoEBE = fIntFlowCorrelationsEBE->GetBinContent(1); // <2>\r
5489 Double_t fourEBE = fIntFlowCorrelationsEBE->GetBinContent(2); // <4>\r
5490 Double_t sixEBE = fIntFlowCorrelationsEBE->GetBinContent(3); // <6>\r
5491 Double_t eightEBE = fIntFlowCorrelationsEBE->GetBinContent(4); // <8>\r
5492 \r
5493 // event weights for correlations:\r
5494 Double_t dW2 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(1); // event weight for <2> \r
5495 Double_t dW4 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(2); // event weight for <4> \r
5496 Double_t dW6 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(3); // event weight for <6> \r
5497 Double_t dW8 = fIntFlowEventWeightsForCorrelationsEBE->GetBinContent(4); // event weight for <8> \r
5498 \r
5499 // e-b-e reduced correlations:\r
5500 Double_t twoReducedEBE = 0.; // <2'>\r
5501 Double_t fourReducedEBE = 0.; // <4'>\r
5502 Double_t sixReducedEBE = 0.; // <6'>\r
5503 Double_t eightReducedEBE = 0.; // <8'> \r
5504 \r
5505 // event weights for reduced correlations:\r
5506 Double_t dw2 = 0.; // event weight for <2'>\r
5507 Double_t dw4 = 0.; // event weight for <4'>\r
5508 //Double_t dw6 = 0.; // event weight for <6'>\r
5509 //Double_t dw8 = 0.; // event weight for <8'>\r
5510\r
5511 // looping over bins:\r
5512 for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
5513 {\r
5514 // e-b-e reduced correlations:\r
5515 twoReducedEBE = fDiffFlowCorrelationsEBE[t][pe][0]->GetBinContent(b);\r
5516 fourReducedEBE = fDiffFlowCorrelationsEBE[t][pe][1]->GetBinContent(b);\r
5517 sixReducedEBE = fDiffFlowCorrelationsEBE[t][pe][2]->GetBinContent(b);\r
5518 eightReducedEBE = fDiffFlowCorrelationsEBE[t][pe][3]->GetBinContent(b);\r
5519 \r
5520 /*\r
5521 // to be improved (I should not do this here again)\r
5522 if(type == "RP")\r
5523 {\r
5524 mq = fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(b);\r
5525 mp = mq; // trick to use the very same Eqs. bellow both for RP's and POI's diff. flow\r
5526 } else if(type == "POI")\r
5527 {\r
5528 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(b);\r
5529 mq = fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(b); \r
5530 }\r
5531 \r
5532 // event weights for reduced correlations:\r
5533 dw2 = mp*dMult-mq; // weight for <2'> \r
5534 dw4 = (mp-mq)*dMult*(dMult-1.)*(dMult-2.)\r
5535 + mq*(dMult-1.)*(dMult-2.)*(dMult-3.); // weight for <4'>\r
5536 //dw6 = ... \r
5537 //dw8 = ... \r
5538 \r
5539 */\r
5540 \r
5541 dw2 = fDiffFlowEventWeightsForCorrelationsEBE[t][pe][0]->GetBinContent(b);\r
5542 dw4 = fDiffFlowEventWeightsForCorrelationsEBE[t][pe][1]->GetBinContent(b);\r
5543 \r
5544 // storing all products:\r
5545 fDiffFlowProductOfCorrelationsPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*twoReducedEBE,dW2*dw2); // storing <2><2'>\r
5546 fDiffFlowProductOfCorrelationsPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*twoReducedEBE,dW4*dw2); // storing <4><2'>\r
5547 fDiffFlowProductOfCorrelationsPro[t][pe][1][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*twoReducedEBE,dW6*dw2); // storing <6><2'>\r
5548 fDiffFlowProductOfCorrelationsPro[t][pe][1][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*twoReducedEBE,dW8*dw2); // storing <8><2'>\r
5549 \r
5550 // event weight for <4'>:\r
5551 fDiffFlowProductOfCorrelationsPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*fourReducedEBE,dW2*dw4); // storing <2><4'>\r
5552 fDiffFlowProductOfCorrelationsPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*fourReducedEBE,dw2*dw4); // storing <2'><4'>\r
5553 fDiffFlowProductOfCorrelationsPro[t][pe][2][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*fourReducedEBE,dW4*dw4); // storing <4><4'>\r
5554 fDiffFlowProductOfCorrelationsPro[t][pe][3][4]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*fourReducedEBE,dW6*dw4); // storing <6><4'> \r
5555 fDiffFlowProductOfCorrelationsPro[t][pe][3][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*fourReducedEBE,dW8*dw4); // storing <8><4'>\r
5556\r
5557 // event weight for <6'>:\r
5558 //dw6 = ...; \r
5559 //fDiffFlowProductOfCorrelationsPro[t][pe][0][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*sixReducedEBE,dW2*dw6); // storing <2><6'>\r
5560 //fDiffFlowProductOfCorrelationsPro[t][pe][1][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*sixReducedEBE,dw2*dw6); // storing <2'><6'>\r
5561 //fDiffFlowProductOfCorrelationsPro[t][pe][2][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*sixReducedEBE,dW4*dw6); // storing <4><6'>\r
5562 //fDiffFlowProductOfCorrelationsPro[t][pe][3][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourReducedEBE*sixReducedEBE,dw4*dw6); // storing <4'><6'> \r
5563 //fDiffFlowProductOfCorrelationsPro[t][pe][4][5]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*sixReducedEBE,dW6*dw6); // storing <6><6'>\r
5564 //fDiffFlowProductOfCorrelationsPro[t][pe][5][6]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightEBE,dw6*dW8); // storing <6'><8>\r
5565 //fDiffFlowProductOfCorrelationsPro[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightReducedEBE,dw6*dw8); // storing <6'><8'>\r
5566\r
5567 // event weight for <8'>:\r
5568 //dw8 = ...; \r
5569 //fDiffFlowProductOfCorrelationsPro[t][pe][0][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoEBE*eightReducedEBE,dW2*dw8); // storing <2><8'>\r
5570 //fDiffFlowProductOfCorrelationsPro[t][pe][1][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],twoReducedEBE*eightReducedEBE,dw2*dw8); // storing <2'><8'>\r
5571 //fDiffFlowProductOfCorrelationsPro[t][pe][2][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourEBE*eightReducedEBE,dW4*dw8); // storing <4><8'>\r
5572 //fDiffFlowProductOfCorrelationsPro[t][pe][3][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],fourReducedEBE*eightReducedEBE,dw4*dw8); // storing <4'><8'> \r
5573 //fDiffFlowProductOfCorrelationsPro[t][pe][4][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixEBE*eightReducedEBE,dW6*dw8); // storing <6><8'>\r
5574 //fDiffFlowProductOfCorrelationsPro[t][pe][5][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sixReducedEBE*eightReducedEBE,dw6*dw8); // storing <6'><8'>\r
5575 //fDiffFlowProductOfCorrelationsPro[t][pe][6][7]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],eightEBE*eightReducedEBE,dW8*dw8); // storing <8><8'> \r
5576 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++ \r
5577 \r
5578} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowProductOfCorrelations(TString type, TString ptOrEta)\r
5579\r
5580\r
5581//================================================================================================================================\r
5582 \r
5583 \r
5584void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCovariances(TString type, TString ptOrEta) // to be improved (reimplemented)\r
5585{\r
5586 // a) Calculate unbiased estimators Cov(<2>,<2'>), Cov(<2>,<4'>), Cov(<4>,<2'>), Cov(<4>,<4'>) and Cov(<2'>,<4'>)\r
5587 // for covariances V(<2>,<2'>), V(<2>,<4'>), V(<4>,<2'>), V(<4>,<4'>) and V(<2'>,<4'>). \r
5588 // b) Store in histogram fDiffFlowCovariances[t][pe][index] for instance the following: \r
5589 //\r
5590 // 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
5591 // \r
5592 // where N is the number of events, w_{<2>} is event weight for <2> and w_{<2'>} is event weight for <2'>.\r
5593 // c) Binning of fDiffFlowCovariances[t][pe][index] is organized as follows:\r
5594 // \r
5595 // 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
5596 // 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
5597 // 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
5598 // 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
5599 // 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
5600 // ...\r
5601 \r
5602 Int_t typeFlag = -1;\r
5603 Int_t ptEtaFlag = -1;\r
5604\r
5605 if(type == "RP")\r
5606 {\r
5607 typeFlag = 0;\r
5608 } else if(type == "POI")\r
5609 {\r
5610 typeFlag = 1;\r
5611 } \r
5612 \r
5613 if(ptOrEta == "Pt")\r
5614 {\r
5615 ptEtaFlag = 0;\r
5616 } else if(ptOrEta == "Eta")\r
5617 {\r
5618 ptEtaFlag = 1;\r
5619 } \r
5620 \r
5621 // shortcuts:\r
5622 Int_t t = typeFlag;\r
5623 Int_t pe = ptEtaFlag;\r
5624 \r
5625 // common:\r
5626 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
5627 //Double_t minPtEta[2] = {fPtMin,fEtaMin};\r
5628 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};\r
5629 //Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};\r
5630 \r
5631 // average correlations:\r
5632 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>\r
5633 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>\r
5634 //Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>\r
5635 //Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>\r
5636 \r
5637 // sum of weights for correlation:\r
5638 Double_t sumOfWeightsForTwo = fIntFlowSumOfEventWeights[0]->GetBinContent(1); // sum_{i=1}^{N} w_{<2>}\r
5639 Double_t sumOfWeightsForFour = fIntFlowSumOfEventWeights[0]->GetBinContent(2); // sum_{i=1}^{N} w_{<4>}\r
5640 //Double_t sumOfWeightsForSix = fIntFlowSumOfEventWeights[0]->GetBinContent(3); // sum_{i=1}^{N} w_{<6>}\r
5641 //Double_t sumOfWeightsForEight = fIntFlowSumOfEventWeights[0]->GetBinContent(4); // sum_{i=1}^{N} w_{<8>}\r
5642 \r
5643 // average reduced correlations:\r
5644 Double_t twoReduced = 0.; // <<2'>> \r
5645 Double_t fourReduced = 0.; // <<4'>>\r
5646 //Double_t sixReduced = 0.; // <<6'>>\r
5647 //Double_t eightReduced = 0.; // <<8'>>\r
5648\r
5649 // sum of weights for reduced correlation:\r
5650 Double_t sumOfWeightsForTwoReduced = 0.; // sum_{i=1}^{N} w_{<2'>}\r
5651 Double_t sumOfWeightsForFourReduced = 0.; // sum_{i=1}^{N} w_{<4'>}\r
5652 //Double_t sumOfWeightsForSixReduced = 0.; // sum_{i=1}^{N} w_{<6'>}\r
5653 //Double_t sumOfWeightsForEightReduced = 0.; // sum_{i=1}^{N} w_{<8'>}\r
5654 \r
5655 // product of weights for reduced correlation:\r
5656 Double_t productOfWeightsForTwoTwoReduced = 0.; // sum_{i=1}^{N} w_{<2>}w_{<2'>}\r
5657 Double_t productOfWeightsForTwoFourReduced = 0.; // sum_{i=1}^{N} w_{<2>}w_{<4'>}\r
5658 Double_t productOfWeightsForFourTwoReduced = 0.; // sum_{i=1}^{N} w_{<4>}w_{<2'>}\r
5659 Double_t productOfWeightsForFourFourReduced = 0.; // sum_{i=1}^{N} w_{<4>}w_{<4'>}\r
5660 Double_t productOfWeightsForTwoReducedFourReduced = 0.; // sum_{i=1}^{N} w_{<2'>}w_{<4'>}\r
5661 // ...\r
5662 \r
5663 // products for differential flow:\r
5664 Double_t twoTwoReduced = 0; // <<2><2'>> \r
5665 Double_t twoFourReduced = 0; // <<2><4'>> \r
5666 Double_t fourTwoReduced = 0; // <<4><2'>> \r
5667 Double_t fourFourReduced = 0; // <<4><4'>> \r
5668 Double_t twoReducedFourReduced = 0; // <<2'><4'>> \r
5669\r
5670 // denominators in the expressions for the unbiased estimators for covariances:\r
5671 // denominator = 1 - term1/(term2*term3)\r
5672 // prefactor = term1/(term2*term3)\r
5673 Double_t denominator = 0.; \r
5674 Double_t prefactor = 0.;\r
5675 Double_t term1 = 0.; \r
5676 Double_t term2 = 0.; \r
5677 Double_t term3 = 0.; \r
5678 \r
5679 // unbiased estimators for covariances for differential flow:\r
5680 Double_t covTwoTwoReduced = 0.; // Cov(<2>,<2'>)\r
5681 Double_t wCovTwoTwoReduced = 0.; // Cov(<2>,<2'>) * prefactor(w_{<2>},w_{<2'>})\r
5682 Double_t covTwoFourReduced = 0.; // Cov(<2>,<4'>)\r
5683 Double_t wCovTwoFourReduced = 0.; // Cov(<2>,<4'>) * prefactor(w_{<2>},w_{<4'>})\r
5684 Double_t covFourTwoReduced = 0.; // Cov(<4>,<2'>)\r
5685 Double_t wCovFourTwoReduced = 0.; // Cov(<4>,<2'>) * prefactor(w_{<4>},w_{<2'>})\r
5686 Double_t covFourFourReduced = 0.; // Cov(<4>,<4'>)\r
5687 Double_t wCovFourFourReduced = 0.; // Cov(<4>,<4'>) * prefactor(w_{<4>},w_{<4'>})\r
5688 Double_t covTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>)\r
5689 Double_t wCovTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>) * prefactor(w_{<2'>},w_{<4'>})\r
5690 \r
5691 for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
5692 {\r
5693 // average reduced corelations:\r
5694 twoReduced = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b);\r
5695 fourReduced = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b);\r
5696 // average products:\r
5697 twoTwoReduced = fDiffFlowProductOfCorrelationsPro[t][pe][0][1]->GetBinContent(b);\r
5698 twoFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][0][3]->GetBinContent(b);\r
5699 fourTwoReduced = fDiffFlowProductOfCorrelationsPro[t][pe][1][2]->GetBinContent(b);\r
5700 fourFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][2][3]->GetBinContent(b);\r
5701 twoReducedFourReduced = fDiffFlowProductOfCorrelationsPro[t][pe][1][3]->GetBinContent(b); \r
5702 // sum of weights for reduced correlations:\r
5703 sumOfWeightsForTwoReduced = fDiffFlowSumOfEventWeights[t][pe][0][0]->GetBinContent(b);\r
5704 sumOfWeightsForFourReduced = fDiffFlowSumOfEventWeights[t][pe][0][1]->GetBinContent(b);\r
5705 // products of weights for correlations:\r
5706 productOfWeightsForTwoTwoReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][0][1]->GetBinContent(b); \r
5707 productOfWeightsForTwoFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][0][3]->GetBinContent(b);\r
5708 productOfWeightsForFourTwoReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][1][2]->GetBinContent(b);\r
5709 productOfWeightsForFourFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][2][3]->GetBinContent(b);\r
5710 productOfWeightsForTwoReducedFourReduced = fDiffFlowSumOfProductOfEventWeights[t][pe][1][3]->GetBinContent(b);\r
5711 // denominator for the unbiased estimator for covariances: 1 - term1/(term2*term3) \r
5712 // prefactor (multiplies Cov's) = term1/(term2*term3) \r
5713 // <2>,<2'>:\r
5714 term1 = productOfWeightsForTwoTwoReduced; \r
5715 term2 = sumOfWeightsForTwo;\r
5716 term3 = sumOfWeightsForTwoReduced; \r
5717 if(term2*term3>0.)\r
5718 {\r
5719 denominator = 1.-term1/(term2*term3);\r
5720 prefactor = term1/(term2*term3);\r
5721 if(denominator!=0)\r
5722 {\r
5723 covTwoTwoReduced = (twoTwoReduced-two*twoReduced)/denominator; \r
5724 wCovTwoTwoReduced = covTwoTwoReduced*prefactor; \r
5725 fDiffFlowCovariances[t][pe][0]->SetBinContent(b,wCovTwoTwoReduced);\r
5726 }\r
5727 }\r
5728 // <2>,<4'>:\r
5729 term1 = productOfWeightsForTwoFourReduced; \r
5730 term2 = sumOfWeightsForTwo;\r
5731 term3 = sumOfWeightsForFourReduced; \r
5732 if(term2*term3>0.)\r
5733 {\r
5734 denominator = 1.-term1/(term2*term3);\r
5735 prefactor = term1/(term2*term3);\r
5736 if(denominator!=0)\r
5737 {\r
5738 covTwoFourReduced = (twoFourReduced-two*fourReduced)/denominator; \r
5739 wCovTwoFourReduced = covTwoFourReduced*prefactor; \r
5740 fDiffFlowCovariances[t][pe][1]->SetBinContent(b,wCovTwoFourReduced);\r
5741 }\r
5742 }\r
5743 // <4>,<2'>:\r
5744 term1 = productOfWeightsForFourTwoReduced; \r
5745 term2 = sumOfWeightsForFour;\r
5746 term3 = sumOfWeightsForTwoReduced; \r
5747 if(term2*term3>0.)\r
5748 {\r
5749 denominator = 1.-term1/(term2*term3);\r
5750 prefactor = term1/(term2*term3);\r
5751 if(denominator!=0)\r
5752 {\r
5753 covFourTwoReduced = (fourTwoReduced-four*twoReduced)/denominator; \r
5754 wCovFourTwoReduced = covFourTwoReduced*prefactor; \r
5755 fDiffFlowCovariances[t][pe][2]->SetBinContent(b,wCovFourTwoReduced);\r
5756 }\r
5757 }\r
5758 // <4>,<4'>:\r
5759 term1 = productOfWeightsForFourFourReduced; \r
5760 term2 = sumOfWeightsForFour;\r
5761 term3 = sumOfWeightsForFourReduced; \r
5762 if(term2*term3>0.)\r
5763 {\r
5764 denominator = 1.-term1/(term2*term3);\r
5765 prefactor = term1/(term2*term3);\r
5766 if(denominator!=0)\r
5767 {\r
5768 covFourFourReduced = (fourFourReduced-four*fourReduced)/denominator; \r
5769 wCovFourFourReduced = covFourFourReduced*prefactor; \r
5770 fDiffFlowCovariances[t][pe][3]->SetBinContent(b,wCovFourFourReduced);\r
5771 }\r
5772 }\r
5773 // <2'>,<4'>:\r
5774 term1 = productOfWeightsForTwoReducedFourReduced; \r
5775 term2 = sumOfWeightsForTwoReduced;\r
5776 term3 = sumOfWeightsForFourReduced; \r
5777 if(term2*term3>0.)\r
5778 {\r
5779 denominator = 1.-term1/(term2*term3);\r
5780 prefactor = term1/(term2*term3);\r
5781 if(denominator!=0)\r
5782 {\r
5783 covTwoReducedFourReduced = (twoReducedFourReduced-twoReduced*fourReduced)/denominator; \r
5784 wCovTwoReducedFourReduced = covTwoReducedFourReduced*prefactor; \r
5785 fDiffFlowCovariances[t][pe][4]->SetBinContent(b,wCovTwoReducedFourReduced);\r
5786 }\r
5787 } \r
5788 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
5789 \r
5790} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCovariances(TString type, TString ptOrEta)\r
5791\r
5792\r
5793//================================================================================================================================\r
5794\r
5795\r
5796void AliFlowAnalysisWithQCumulants::CalculateDiffFlow(TString type, TString ptOrEta)\r
5797{\r
5798 // calculate differential flow from differential cumulants and previously obtained integrated flow: (to be improved: description)\r
5799 \r
5800 Int_t typeFlag = -1;\r
5801 Int_t ptEtaFlag = -1;\r
5802\r
5803 if(type == "RP")\r
5804 {\r
5805 typeFlag = 0;\r
5806 } else if(type == "POI")\r
5807 {\r
5808 typeFlag = 1;\r
5809 } \r
5810 \r
5811 if(ptOrEta == "Pt")\r
5812 {\r
5813 ptEtaFlag = 0;\r
5814 } else if(ptOrEta == "Eta")\r
5815 {\r
5816 ptEtaFlag = 1;\r
5817 } \r
5818 \r
5819 // shortcuts:\r
5820 Int_t t = typeFlag;\r
5821 Int_t pe = ptEtaFlag;\r
5822 \r
5823 // common:\r
5824 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
5825 \r
5826 // correlations:\r
5827 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>\r
5828 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>\r
5829 \r
5830 // statistical errors of correlations:\r
5831 Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1);\r
5832 Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); \r
5833 \r
5834 // reduced correlations:\r
5835 Double_t twoReduced = 0.; // <<2'>>\r
5836 Double_t fourReduced = 0.; // <<4'>>\r
5837 \r
5838 // statistical errors of reduced correlations:\r
5839 Double_t twoReducedError = 0.; \r
5840 Double_t fourReducedError = 0.; \r
5841\r
5842 // covariances:\r
5843 Double_t wCovTwoFour = fIntFlowCovariances->GetBinContent(1);// // Cov(<2>,<4>) * prefactor(<2>,<4>)\r
5844 Double_t wCovTwoTwoReduced = 0.; // Cov(<2>,<2'>) * prefactor(<2>,<2'>)\r
5845 Double_t wCovTwoFourReduced = 0.; // Cov(<2>,<4'>) * prefactor(<2>,<4'>)\r
5846 Double_t wCovFourTwoReduced = 0.; // Cov(<4>,<2'>) * prefactor(<4>,<2'>)\r
5847 Double_t wCovFourFourReduced = 0.; // Cov(<4>,<4'>) * prefactor(<4>,<4'>)\r
5848 Double_t wCovTwoReducedFourReduced = 0.; // Cov(<2'>,<4'>) * prefactor(<2'>,<4'>)\r
5849 \r
5850 // differential flow:\r
5851 Double_t v2Prime = 0.; // v'{2} \r
5852 Double_t v4Prime = 0.; // v'{4}\r
5853 \r
5854 // statistical error of differential flow:\r
5855 Double_t v2PrimeError = 0.; \r
5856 Double_t v4PrimeError = 0.; \r
5857 \r
5858 // squared statistical error of differential flow:\r
5859 Double_t v2PrimeErrorSquared = 0.; \r
5860 Double_t v4PrimeErrorSquared = 0.; \r
5861 \r
5862 // loop over pt or eta bins:\r
5863 for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
5864 {\r
5865 // reduced correlations and statistical errors:\r
5866 twoReduced = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b);\r
5867 twoReducedError = fDiffFlowCorrelationsHist[t][pe][0]->GetBinError(b);\r
5868 fourReduced = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b);\r
5869 fourReducedError = fDiffFlowCorrelationsHist[t][pe][1]->GetBinError(b);\r
5870 // covariances:\r
5871 wCovTwoTwoReduced = fDiffFlowCovariances[t][pe][0]->GetBinContent(b);\r
5872 wCovTwoFourReduced = fDiffFlowCovariances[t][pe][1]->GetBinContent(b);\r
5873 wCovFourTwoReduced = fDiffFlowCovariances[t][pe][2]->GetBinContent(b);\r
5874 wCovFourFourReduced = fDiffFlowCovariances[t][pe][3]->GetBinContent(b);\r
5875 wCovTwoReducedFourReduced = fDiffFlowCovariances[t][pe][4]->GetBinContent(b);\r
5876 // differential flow:\r
5877 // v'{2}:\r
5878 if(two>0.) \r
5879 {\r
5880 v2Prime = twoReduced/pow(two,0.5);\r
5881 v2PrimeErrorSquared = (1./4.)*pow(two,-3.)*\r
5882 (pow(twoReduced,2.)*pow(twoError,2.)\r
5883 + 4.*pow(two,2.)*pow(twoReducedError,2.)\r
5884 - 4.*two*twoReduced*wCovTwoTwoReduced);\r
5885 \r
5886 \r
5887 if(v2PrimeErrorSquared>0.) v2PrimeError = pow(v2PrimeErrorSquared,0.5);\r
5888 fDiffFlow[t][pe][0]->SetBinContent(b,v2Prime); \r
5889 fDiffFlow[t][pe][0]->SetBinError(b,v2PrimeError); \r
5890 }\r
5891 // differential flow:\r
5892 // v'{4}\r
5893 if(2.*pow(two,2.)-four > 0.) \r
5894 {\r
5895 v4Prime = (2.*two*twoReduced-fourReduced)/pow(2.*pow(two,2.)-four,3./4.);\r
5896 v4PrimeErrorSquared = pow(2.*pow(two,2.)-four,-7./2.)*\r
5897 (pow(2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced,2.)*pow(twoError,2.)\r
5898 + (9./16.)*pow(2.*two*twoReduced-fourReduced,2.)*pow(fourError,2.)\r
5899 + 4.*pow(two,2.)*pow(2.*pow(two,2.)-four,2.)*pow(twoReducedError,2.)\r
5900 + pow(2.*pow(two,2.)-four,2.)*pow(fourReducedError,2.) \r
5901 - (3./2.)*(2.*two*twoReduced-fourReduced)\r
5902 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoFour\r
5903 - 4.*two*(2.*pow(two,2.)-four)\r
5904 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoTwoReduced\r
5905 + 2.*(2.*pow(two,2.)-four)\r
5906 * (2.*pow(two,2.)*twoReduced-3.*two*fourReduced+2.*four*twoReduced)*wCovTwoFourReduced\r
5907 + 3.*two*(2.*pow(two,2.)-four)*(2.*two*twoReduced-fourReduced)*wCovFourTwoReduced\r
5908 - (3./2.)*(2.*pow(two,2.)-four)*(2.*two*twoReduced-fourReduced)*wCovFourFourReduced \r
5909 - 4.*two*pow(2.*pow(two,2.)-four,2.)*wCovTwoReducedFourReduced); \r
5910 if(v4PrimeErrorSquared>0.) v4PrimeError = pow(v4PrimeErrorSquared,0.5); \r
5911 fDiffFlow[t][pe][1]->SetBinContent(b,v4Prime);\r
5912 fDiffFlow[t][pe][1]->SetBinError(b,v4PrimeError); \r
5913 }\r
5914 \r
5915 } // end of for(Int_t b=1;b<=fnBinsPtEta[pe];b++)\r
5916 \r
5917 \r
5918 \r
5919 \r
5920 /*\r
5921 // 2D:\r
5922 for(Int_t nua=0;nua<2;nua++)\r
5923 {\r
5924 for(Int_t p=1;p<=fnBinsPt;p++)\r
5925 {\r
5926 for(Int_t e=1;e<=fnBinsEta;e++) \r
5927 { \r
5928 // differential cumulants:\r
5929 Double_t qc2Prime = fFinalCumulants2D[t][pW][eW][nua][0]->GetBinContent(fFinalCumulants2D[t][pW][eW][nua][0]->GetBin(p,e)); // QC{2'} \r
5930 Double_t qc4Prime = fFinalCumulants2D[t][pW][eW][nua][1]->GetBinContent(fFinalCumulants2D[t][pW][eW][nua][1]->GetBin(p,e)); // QC{4'}\r
5931 // differential flow:\r
5932 Double_t v2Prime = 0.; \r
5933 Double_t v4Prime = 0.; \r
5934 if(v2) \r
5935 {\r
5936 v2Prime = qc2Prime/v2;\r
5937 fFinalFlow2D[t][pW][eW][nua][0]->SetBinContent(fFinalFlow2D[t][pW][eW][nua][0]->GetBin(p,e),v2Prime); \r
5938 } \r
5939 if(v4)\r
5940 {\r
5941 v4Prime = -qc4Prime/pow(v4,3.); \r
5942 fFinalFlow2D[t][pW][eW][nua][1]->SetBinContent(fFinalFlow2D[t][pW][eW][nua][1]->GetBin(p,e),v4Prime); \r
5943 } \r
5944 } // end of for(Int_t e=1;e<=fnBinsEta;e++)\r
5945 } // end of for(Int_t p=1;p<=fnBinsPt;p++)\r
5946 } // end of for(Int_t nua=0;nua<2;nua++)\r
5947 */\r
5948\r
5949} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlow(TString type, Bool_t useParticleWeights)\r
5950\r
5951\r
5952//================================================================================================================================\r
5953\r
5954\r
5955void AliFlowAnalysisWithQCumulants::StoreIntFlowFlags()\r
5956{\r
5957 // a) Store all flags for integrated flow in profile fIntFlowFlags.\r
5958 \r
5959 if(!fIntFlowFlags)\r
5960 {\r
5961 cout<<"WARNING: fIntFlowFlags is NULL in AFAWQC::SFFIF() !!!!"<<endl;\r
5962 exit(0);\r
5963 } \r
3b552efe 5964
5965 // particle weights used or not:\r
5966 fIntFlowFlags->Fill(0.5,(Int_t)fUsePhiWeights||fUsePtWeights||fUseEtaWeights);\r
5967 // which event weights were used:
5968 if(strcmp(fMultiplicityWeight->Data(),"combinations"))
5969 {
5970 fIntFlowFlags->Fill(1.5,0); // 0 = "combinations" (default)\r
5971 } else if(strcmp(fMultiplicityWeight->Data(),"unit"))
5972 {
5973 fIntFlowFlags->Fill(1.5,1); // 1 = "unit"
5974 } else if(strcmp(fMultiplicityWeight->Data(),"multiplicity"))
5975 {
5976 fIntFlowFlags->Fill(1.5,2); // 2 = "multiplicity"
5977 }
5978 // corrected for non-uniform acceptance or not:
5979 fIntFlowFlags->Fill(2.5,(Int_t)fApplyCorrectionForNUA);
5980 fIntFlowFlags->Fill(3.5,(Int_t)fPrintFinalResults[0]);\r
5981 fIntFlowFlags->Fill(4.5,(Int_t)fPrintFinalResults[1]);\r
5982 fIntFlowFlags->Fill(5.5,(Int_t)fPrintFinalResults[2]);\r
a5b7efd0 5983 \r
5984} // end of void AliFlowAnalysisWithQCumulants::StoreIntFlowFlags()\r
5985\r
5986\r
5987//================================================================================================================================\r
5988\r
5989\r
5990void AliFlowAnalysisWithQCumulants::StoreDiffFlowFlags()\r
5991{\r
5992 // Store all flags for differential flow in the profile fDiffFlowFlags.\r
5993 \r
5994 if(!fDiffFlowFlags)\r
5995 {\r
5996 cout<<"WARNING: fDiffFlowFlags is NULL in AFAWQC::SFFDF() !!!!"<<endl;\r
5997 exit(0);\r
5998 } \r
5999 \r
6000 fDiffFlowFlags->Fill(0.5,fUsePhiWeights||fUsePtWeights||fUseEtaWeights); // particle weights used or not\r
6001 //fDiffFlowFlags->Fill(1.5,""); // which event weight was used? // to be improved\r
6002 fDiffFlowFlags->Fill(2.5,fApplyCorrectionForNUA); // corrected for non-uniform acceptance or not\r
6003 fDiffFlowFlags->Fill(3.5,fCalculate2DFlow); // calculate also 2D differential flow in (pt,eta) or not\r
6004 \r
6005} // end of void AliFlowAnalysisWithQCumulants::StoreDiffFlowFlags()\r
6006\r
6007\r
6008//================================================================================================================================\r
6009\r
6010\r
3b552efe 6011void AliFlowAnalysisWithQCumulants::GetPointersForCommonHistograms() \r
a5b7efd0 6012{\r
6013 // Access all pointers to common control and common result histograms and profiles.\r
6014 \r
3b552efe 6015 TString commonHistsName = "AliFlowCommonHistQC";\r
6016 commonHistsName += fAnalysisLabel->Data();\r
6017 AliFlowCommonHist *commonHist = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHistsName.Data()));\r
6018 if(commonHist) this->SetCommonHists(commonHist); \r
6019 TString commonHists2ndOrderName = "AliFlowCommonHist2ndOrderQC";\r
6020 commonHists2ndOrderName += fAnalysisLabel->Data();\r
6021 AliFlowCommonHist *commonHist2nd = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists2ndOrderName.Data()));\r
6022 if(commonHist2nd) this->SetCommonHists2nd(commonHist2nd); \r
6023 TString commonHists4thOrderName = "AliFlowCommonHist4thOrderQC";\r
6024 commonHists4thOrderName += fAnalysisLabel->Data();\r
6025 AliFlowCommonHist *commonHist4th = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists4thOrderName.Data()));\r
6026 if(commonHist4th) this->SetCommonHists4th(commonHist4th); \r
6027 TString commonHists6thOrderName = "AliFlowCommonHist6thOrderQC";\r
6028 commonHists6thOrderName += fAnalysisLabel->Data();\r
6029 AliFlowCommonHist *commonHist6th = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists6thOrderName.Data()));\r
6030 if(commonHist6th) this->SetCommonHists6th(commonHist6th); \r
6031 TString commonHists8thOrderName = "AliFlowCommonHist8thOrderQC";\r
6032 commonHists8thOrderName += fAnalysisLabel->Data();\r
6033 AliFlowCommonHist *commonHist8th = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHists8thOrderName.Data()));\r
6034 if(commonHist8th) this->SetCommonHists8th(commonHist8th); \r
6035 TString commonHistResults2ndOrderName = "AliFlowCommonHistResults2ndOrderQC"; \r
6036 commonHistResults2ndOrderName += fAnalysisLabel->Data(); \r
6037 AliFlowCommonHistResults *commonHistRes2nd = dynamic_cast<AliFlowCommonHistResults*>\r (fHistList->FindObject(commonHistResults2ndOrderName.Data()));\r
6038 if(commonHistRes2nd) this->SetCommonHistsResults2nd(commonHistRes2nd); \r
6039 TString commonHistResults4thOrderName = "AliFlowCommonHistResults4thOrderQC";\r
6040 commonHistResults4thOrderName += fAnalysisLabel->Data();\r
6041 AliFlowCommonHistResults *commonHistRes4th = dynamic_cast<AliFlowCommonHistResults*>\r
6042 (fHistList->FindObject(commonHistResults4thOrderName.Data()));\r
6043 if(commonHistRes4th) this->SetCommonHistsResults4th(commonHistRes4th); \r
6044 TString commonHistResults6thOrderName = "AliFlowCommonHistResults6thOrderQC";\r
6045 commonHistResults6thOrderName += fAnalysisLabel->Data();\r
6046 AliFlowCommonHistResults *commonHistRes6th = dynamic_cast<AliFlowCommonHistResults*>\r
6047 (fHistList->FindObject(commonHistResults6thOrderName.Data()));\r
6048 if(commonHistRes6th) this->SetCommonHistsResults6th(commonHistRes6th); \r
6049 TString commonHistResults8thOrderName = "AliFlowCommonHistResults8thOrderQC";\r
6050 commonHistResults8thOrderName += fAnalysisLabel->Data();\r
6051 AliFlowCommonHistResults *commonHistRes8th = dynamic_cast<AliFlowCommonHistResults*>\r
6052 (fHistList->FindObject(commonHistResults8thOrderName.Data())); \r
6053 if(commonHistRes8th) this->SetCommonHistsResults8th(commonHistRes8th);
6054 \r
6055} // end of void AliFlowAnalysisWithQCumulants::GetPointersForCommonHistograms() \r
a5b7efd0 6056\r
6057\r
6058//================================================================================================================================\r
6059\r
6060\r
3b552efe 6061void AliFlowAnalysisWithQCumulants::GetPointersForParticleWeightsHistograms() \r
a5b7efd0 6062{\r
6063 // Get pointers for histograms with particle weights.\r
6064\r
3b552efe 6065 TList *weightsList = dynamic_cast<TList*>(fHistList->FindObject("Weights"));\r
6066 if(weightsList) this->SetWeightsList(weightsList);\r
6067 TString fUseParticleWeightsName = "fUseParticleWeightsQC"; // to be improved (hirdwired label QC)\r
6068 fUseParticleWeightsName += fAnalysisLabel->Data();\r
6069 TProfile *useParticleWeights = dynamic_cast<TProfile*>(weightsList->FindObject(fUseParticleWeightsName.Data()));\r
6070 if(useParticleWeights)\r
a5b7efd0 6071 {\r
3b552efe 6072 this->SetUseParticleWeights(useParticleWeights); \r
6073 fUsePhiWeights = (Int_t)fUseParticleWeights->GetBinContent(1); \r
6074 fUsePtWeights = (Int_t)fUseParticleWeights->GetBinContent(2); \r
6075 fUseEtaWeights = (Int_t)fUseParticleWeights->GetBinContent(3); \r
6076 }\r\r
6077} // end of void AliFlowAnalysisWithQCumulants::GetPointersForParticleWeightsHistograms(); \r
a5b7efd0 6078\r
6079\r
6080//================================================================================================================================\r
6081\r
6082\r
3b552efe 6083void AliFlowAnalysisWithQCumulants::GetPointersForIntFlowHistograms() \r
a5b7efd0 6084{\r
6085 // Get pointers for histograms and profiles relevant for integrated flow:\r
6086 // a) Get pointer to base list for integrated flow holding profile fIntFlowFlags and lists fIntFlowProfiles and fIntFlowResults.\r
6087 // b) Get pointer to profile fIntFlowFlags holding all flags for integrated flow.\r
6088 // c) Get pointer to list fIntFlowProfiles and pointers to all objects that she holds. \r
6089 // d) Get pointer to list fIntFlowResults and pointers to all objects that she holds. \r
6090 \r
6091 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data member?)\r
6092 TString powerFlag[2] = {"linear","quadratic"}; // to be improved (should I promote this to data member?)\r
6093 \r
3b552efe 6094 // a) Get pointer to base list for integrated flow holding profile fIntFlowFlags and lists fIntFlowProfiles and fIntFlowResults:\r
6095 TList *intFlowList = NULL;\r
6096 intFlowList = dynamic_cast<TList*>(fHistList->FindObject("Integrated Flow"));\r
6097 if(!intFlowList) \r
a5b7efd0 6098 {\r
3b552efe 6099 cout<<"WARNING: intFlowList is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
6100 exit(0); \r
6101 } \r
a5b7efd0 6102 \r
6103 // b) Get pointer to profile fIntFlowFlags holding all flags for integrated flow:\r
6104 TString intFlowFlagsName = "fIntFlowFlags";\r
6105 intFlowFlagsName += fAnalysisLabel->Data();\r
6106 TProfile *intFlowFlags = dynamic_cast<TProfile*>(intFlowList->FindObject(intFlowFlagsName.Data()));\r
6107 Bool_t bApplyCorrectionForNUA = kFALSE;\r
6108 if(intFlowFlags)\r
6109 {\r
6110 this->SetIntFlowFlags(intFlowFlags); \r
6111 bApplyCorrectionForNUA = (Int_t)intFlowFlags->GetBinContent(3); \r
6112 this->SetApplyCorrectionForNUA(bApplyCorrectionForNUA); \r
6113 } else \r
6114 {\r
6115 cout<<"WARNING: intFlowFlags is NULL in FAWQC::GPFIFH() !!!!"<<endl;\r
6116 }\r
6117 \r
6118 // c) Get pointer to list fIntFlowProfiles and pointers to all objects that she holds:\r
6119 TList *intFlowProfiles = NULL;\r
6120 intFlowProfiles = dynamic_cast<TList*>(intFlowList->FindObject("Profiles"));\r
6121 if(intFlowProfiles) \r
6122 {\r
6123 // average multiplicities:\r
6124 TString avMultiplicityName = "fAvMultiplicity";\r
6125 avMultiplicityName += fAnalysisLabel->Data();\r
6126 TProfile *avMultiplicity = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(avMultiplicityName.Data()));\r
6127 if(avMultiplicity) \r
6128 {\r
6129 this->SetAvMultiplicity(avMultiplicity);\r
6130 } else \r
6131 {\r
6132 cout<<"WARNING: avMultiplicity is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
6133 }\r
6134 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with wrong errors!):\r
6135 TString intFlowCorrelationsProName = "fIntFlowCorrelationsPro";\r
6136 intFlowCorrelationsProName += fAnalysisLabel->Data();\r
6137 TProfile *intFlowCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowCorrelationsProName.Data()));\r
6138 if(intFlowCorrelationsPro) \r
6139 {\r
6140 this->SetIntFlowCorrelationsPro(intFlowCorrelationsPro);\r
6141 } else \r
6142 {\r
6143 cout<<"WARNING: intFlowCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
6144 } \r
6145 // average all correlations for integrated flow (with wrong errors!):\r
6146 TString intFlowCorrelationsAllProName = "fIntFlowCorrelationsAllPro";\r
6147 intFlowCorrelationsAllProName += fAnalysisLabel->Data();\r
6148 TProfile *intFlowCorrelationsAllPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowCorrelationsAllProName.Data()));\r
6149 if(intFlowCorrelationsAllPro) \r
6150 {\r
6151 this->SetIntFlowCorrelationsAllPro(intFlowCorrelationsAllPro);\r
6152 } else \r
6153 {\r
6154 cout<<"WARNING: intFlowCorrelationsAllPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
6155 } \r
6156 // average extra correlations for integrated flow (which appear only when particle weights are used):\r
6157 // (to be improved: Weak point in implementation, I am assuming here that method GetPointersForParticleWeightsHistograms() was called)\r
6158 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)\r
6159 {\r
6160 TString intFlowExtraCorrelationsProName = "fIntFlowExtraCorrelationsPro";\r
6161 intFlowExtraCorrelationsProName += fAnalysisLabel->Data();\r
6162 TProfile *intFlowExtraCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowExtraCorrelationsProName.Data()));\r
6163 if(intFlowExtraCorrelationsPro) \r
6164 {\r
6165 this->SetIntFlowExtraCorrelationsPro(intFlowExtraCorrelationsPro);\r
6166 } else \r
6167 {\r
6168 cout<<"WARNING: intFlowExtraCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
6169 }\r
6170 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights) \r
6171 // average products of correlations <2>, <4>, <6> and <8>: \r
6172 TString intFlowProductOfCorrelationsProName = "fIntFlowProductOfCorrelationsPro";\r
6173 intFlowProductOfCorrelationsProName += fAnalysisLabel->Data();\r
6174 TProfile *intFlowProductOfCorrelationsPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject(intFlowProductOfCorrelationsProName.Data()));\r
6175 if(intFlowProductOfCorrelationsPro) \r
6176 {\r
6177 this->SetIntFlowProductOfCorrelationsPro(intFlowProductOfCorrelationsPro);\r
6178 } else \r
6179 {\r
6180 cout<<"WARNING: intFlowProductOfCorrelationsPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
6181 } \r
6182 // average correction terms for non-uniform acceptance (with wrong errors!):\r
6183 for(Int_t sc=0;sc<2;sc++)\r
6184 {\r
6185 TString intFlowCorrectionTermsForNUAProName = "fIntFlowCorrectionTermsForNUAPro";\r
6186 intFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();\r
6187 TProfile *intFlowCorrectionTermsForNUAPro = dynamic_cast<TProfile*>(intFlowProfiles->FindObject((Form("%s: %s terms",intFlowCorrectionTermsForNUAProName.Data(),sinCosFlag[sc].Data()))));\r
6188 if(intFlowCorrectionTermsForNUAPro) \r
6189 {\r
6190 this->SetIntFlowCorrectionTermsForNUAPro(intFlowCorrectionTermsForNUAPro,sc);\r
6191 } else \r
6192 {\r
6193 cout<<"WARNING: intFlowCorrectionTermsForNUAPro is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
6194 cout<<"sc = "<<sc<<endl;\r
6195 } \r
6196 } // end of for(Int_t sc=0;sc<2;sc++) \r
6197 } else // to if(intFlowProfiles) \r
6198 {\r
6199 cout<<"WARNING: intFlowProfiles is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
6200 }\r
6201 \r
6202 // d) Get pointer to list fIntFlowResults and pointers to all objects that she holds. \r
6203 TList *intFlowResults = NULL;\r
6204 intFlowResults = dynamic_cast<TList*>(intFlowList->FindObject("Results"));\r
6205 if(intFlowResults)\r
6206 {\r
6207 // average correlations <<2>>, <<4>>, <<6>> and <<8>> (with correct errors!):\r
6208 TString intFlowCorrelationsHistName = "fIntFlowCorrelationsHist";\r
6209 intFlowCorrelationsHistName += fAnalysisLabel->Data();\r
6210 TH1D *intFlowCorrelationsHist = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCorrelationsHistName.Data()));\r
6211 if(intFlowCorrelationsHist) \r
6212 {\r
6213 this->SetIntFlowCorrelationsHist(intFlowCorrelationsHist);\r
6214 } else \r
6215 {\r
6216 cout<<"WARNING: intFlowCorrelationsHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
6217 } \r
6218 // average all correlations for integrated flow (with correct errors!):\r
6219 TString intFlowCorrelationsAllHistName = "fIntFlowCorrelationsAllHist";\r
6220 intFlowCorrelationsAllHistName += fAnalysisLabel->Data();\r
6221 TH1D *intFlowCorrelationsAllHist = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCorrelationsAllHistName.Data()));\r
6222 if(intFlowCorrelationsAllHist) \r
6223 {\r
6224 this->SetIntFlowCorrelationsAllHist(intFlowCorrelationsAllHist);\r
6225 } else \r
6226 {\r
6227 cout<<"WARNING: intFlowCorrelationsAllHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
6228 } \r
6229 // average correction terms for non-uniform acceptance (with correct errors!):\r
6230 TString intFlowCorrectionTermsForNUAHistName = "fIntFlowCorrectionTermsForNUAHist";\r
6231 intFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();\r
6232 for(Int_t sc=0;sc<2;sc++)\r
6233 {\r
6234 TH1D *intFlowCorrectionTermsForNUAHist = dynamic_cast<TH1D*>(intFlowResults->FindObject((Form("%s: %s terms",intFlowCorrectionTermsForNUAHistName.Data(),sinCosFlag[sc].Data()))));\r
6235 if(intFlowCorrectionTermsForNUAHist) \r
6236 {\r
6237 this->SetIntFlowCorrectionTermsForNUAHist(intFlowCorrectionTermsForNUAHist,sc);\r
6238 } else \r
6239 {\r
6240 cout<<"WARNING: intFlowCorrectionTermsForNUAHist is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
6241 cout<<"sc = "<<sc<<endl;\r
6242 } \r
6243 } // end of for(Int_t sc=0;sc<2;sc++) \r
6244 // covariances (multiplied with weight dependent prefactor):\r
6245 TString intFlowCovariancesName = "fIntFlowCovariances";\r
6246 intFlowCovariancesName += fAnalysisLabel->Data();\r
6247 TH1D *intFlowCovariances = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowCovariancesName.Data()));\r
6248 if(intFlowCovariances) \r
6249 {\r
6250 this->SetIntFlowCovariances(intFlowCovariances); \r
6251 } else \r
6252 {\r
6253 cout<<"WARNING: intFlowCovariances is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
6254 } \r
6255 // sum of linear and quadratic event weights for <2>, <4>, <6> and <8>:\r
6256 TString intFlowSumOfEventWeightsName = "fIntFlowSumOfEventWeights";\r
6257 intFlowSumOfEventWeightsName += fAnalysisLabel->Data();\r
6258 for(Int_t power=0;power<2;power++)\r
6259 {\r
6260 TH1D *intFlowSumOfEventWeights = dynamic_cast<TH1D*>(intFlowResults->FindObject(Form("%s: %s",intFlowSumOfEventWeightsName.Data(),powerFlag[power].Data())));\r
6261 if(intFlowSumOfEventWeights) \r
6262 {\r
6263 this->SetIntFlowSumOfEventWeights(intFlowSumOfEventWeights,power);\r
6264 } else \r
6265 {\r
6266 cout<<"WARNING: intFlowSumOfEventWeights is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
6267 cout<<"power = "<<power<<endl;\r
6268 } \r
6269 } // end of for(Int_t power=0;power<2;power++) \r
6270 // sum of products of event weights for correlations <2>, <4>, <6> and <8>: \r
6271 TString intFlowSumOfProductOfEventWeightsName = "fIntFlowSumOfProductOfEventWeights";\r
6272 intFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data();\r
6273 TH1D *intFlowSumOfProductOfEventWeights = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowSumOfProductOfEventWeightsName.Data()));\r
6274 if(intFlowSumOfProductOfEventWeights) \r
6275 {\r
6276 this->SetIntFlowSumOfProductOfEventWeights(intFlowSumOfProductOfEventWeights);\r
6277 } else \r
6278 {\r
6279 cout<<"WARNING: intFlowSumOfProductOfEventWeights is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
6280 } \r
6281 // final results for integrated Q-cumulants:\r
6282 TString intFlowQcumulantsName = "fIntFlowQcumulants";\r
6283 intFlowQcumulantsName += fAnalysisLabel->Data();\r
6284 TH1D *intFlowQcumulants = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowQcumulantsName.Data()));\r
6285 if(intFlowQcumulants) \r
6286 {\r
6287 this->SetIntFlowQcumulants(intFlowQcumulants);\r
6288 } else \r
6289 {\r
6290 cout<<"WARNING: intFlowQcumulants is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
6291 } \r
6292 // final integrated flow estimates from Q-cumulants:\r
6293 TString intFlowName = "fIntFlow";\r
6294 intFlowName += fAnalysisLabel->Data();\r
6295 TH1D *intFlow = dynamic_cast<TH1D*>(intFlowResults->FindObject(intFlowName.Data()));\r
6296 if(intFlow) \r
6297 {\r
6298 this->SetIntFlow(intFlow);\r
6299 } else \r
6300 {\r
6301 cout<<"WARNING: intFlow is NULL in AFAWQC::GPFIFH() !!!!"<<endl; \r
6302 } \r
6303 } else // to if(intFlowResults)\r
6304 {\r
6305 cout<<"WARNING: intFlowResults is NULL in AFAWQC::GPFIFH() !!!!"<<endl;\r
6306 }\r
a5b7efd0 6307\r
3b552efe 6308} // end of void AliFlowAnalysisWithQCumulants::GetPointersForIntFlowHistograms()\r
a5b7efd0 6309\r
6310\r
6311//================================================================================================================================\r
6312\r
6313\r
3b552efe 6314void AliFlowAnalysisWithQCumulants::GetPointersForDiffFlowHistograms()\r
a5b7efd0 6315{\r
6316 // Get pointer to all objects relevant for differential flow.\r
6317 // a) Define flags locally (to be improved: should I promote flags to data members?);\r
6318 // b) Get pointer to base list for differential flow fDiffFlowList and nested lists fDiffFlowListProfiles and fDiffFlowListResults;\r
6319 // c) Get pointer to profile fDiffFlowFlags holding all flags for differential flow;\r
6320 // d) Get pointers to all nested lists in fDiffFlowListProfiles and to profiles which they hold;\r
6321 // e) Get pointers to all nested lists in fDiffFlowListResults and to histograms which they hold.\r
6322 \r
6323 // a) Define flags locally (to be improved: should I promote flags to data members?): \r
6324 TString typeFlag[2] = {"RP","POI"}; \r
6325 TString ptEtaFlag[2] = {"p_{T}","#eta"};\r
6326 TString powerFlag[2] = {"linear","quadratic"};\r
6327 TString sinCosFlag[2] = {"sin","cos"};\r
6328 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"}; \r
6329 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"}; \r
6330 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};\r
6331 TString mixedCorrelationIndex[8] = {"<2>","<2'>","<4>","<4'>","<6>","<6'>","<8>","<8'>"};\r
6332 TString covarianceName[5] = {"Cov(<2>,<2'>)","Cov(<2>,<4'>)","Cov(<4>,<2'>)","Cov(<4>,<4'>)","Cov(<2'>,<4'>)"}; \r
6333 \r
6334 // b) Get pointer to base list for differential flow fDiffFlowList and nested lists fDiffFlowListProfiles and fDiffFlowListResults:\r
6335 TList *diffFlowList = NULL;\r
3b552efe 6336 diffFlowList = dynamic_cast<TList*>(fHistList->FindObject("Differential Flow")); \r
a5b7efd0 6337 if(!diffFlowList)\r
6338 { \r
6339 cout<<"WARNING: diffFlowList is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6340 exit(0);\r
6341 }\r
6342 // list holding nested lists containing profiles:\r
6343 TList *diffFlowListProfiles = NULL;\r
6344 diffFlowListProfiles = dynamic_cast<TList*>(diffFlowList->FindObject("Profiles"));\r
6345 if(!diffFlowListProfiles)\r
6346 { \r
6347 cout<<"WARNING: diffFlowListProfiles is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6348 exit(0);\r
6349 }\r
6350 // list holding nested lists containing 2D and 1D histograms with final results:\r
6351 TList *diffFlowListResults = NULL;\r
6352 diffFlowListResults = dynamic_cast<TList*>(diffFlowList->FindObject("Results"));\r
6353 if(!diffFlowListResults)\r
6354 { \r
6355 cout<<"WARNING: diffFlowListResults is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6356 exit(0);\r
6357 }\r
6358 \r
6359 // c) Get pointer to profile holding all flags for differential flow;\r
6360 TString diffFlowFlagsName = "fDiffFlowFlags";\r
6361 diffFlowFlagsName += fAnalysisLabel->Data();\r
6362 TProfile *diffFlowFlags = dynamic_cast<TProfile*>(diffFlowList->FindObject(diffFlowFlagsName.Data()));\r
6363 Bool_t bCalculate2DFlow = kFALSE;\r
6364 if(diffFlowFlags)\r
6365 {\r
6366 this->SetDiffFlowFlags(diffFlowFlags); \r
6367 bCalculate2DFlow = (Int_t)diffFlowFlags->GetBinContent(4);\r
6368 this->SetCalculate2DFlow(bCalculate2DFlow); // to be improved (shoul I call this setter somewhere else?) \r
6369 }\r
6370 \r
6371 // d) Get pointers to all nested lists in fDiffFlowListProfiles and to profiles which they hold;\r
6372 // correlations:\r
6373 TList *diffFlowCorrelationsProList[2][2] = {{NULL}};\r
6374 TString diffFlowCorrelationsProName = "fDiffFlowCorrelationsPro";\r
6375 diffFlowCorrelationsProName += fAnalysisLabel->Data();\r
6376 TProfile *diffFlowCorrelationsPro[2][2][4] = {{{NULL}}}; \r
6377 // products of correlations:\r
6378 TList *diffFlowProductOfCorrelationsProList[2][2] = {{NULL}};\r
6379 TString diffFlowProductOfCorrelationsProName = "fDiffFlowProductOfCorrelationsPro";\r
6380 diffFlowProductOfCorrelationsProName += fAnalysisLabel->Data(); \r
6381 TProfile *diffFlowProductOfCorrelationsPro[2][2][8][8] = {{{{NULL}}}}; \r
6382 // corrections:\r
6383 TList *diffFlowCorrectionsProList[2][2] = {{NULL}};\r
6384 TString diffFlowCorrectionTermsForNUAProName = "fDiffFlowCorrectionTermsForNUAPro";\r
6385 diffFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data(); \r
6386 TProfile *diffFlowCorrectionTermsForNUAPro[2][2][2][10] = {{{{NULL}}}}; \r
6387 for(Int_t t=0;t<2;t++)\r
6388 {\r
6389 for(Int_t pe=0;pe<2;pe++)\r
6390 {\r
6391 diffFlowCorrelationsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));\r
6392 if(!diffFlowCorrelationsProList[t][pe])\r
6393 { \r
6394 cout<<"WARNING: diffFlowCorrelationsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6395 cout<<"t = "<<t<<endl;\r
6396 cout<<"pe = "<<pe<<endl;\r
6397 exit(0);\r
6398 }\r
6399 for(Int_t ci=0;ci<4;ci++) // correlation index\r
6400 {\r
6401 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
6402 if(diffFlowCorrelationsPro[t][pe][ci])\r
6403 {\r
6404 this->SetDiffFlowCorrelationsPro(diffFlowCorrelationsPro[t][pe][ci],t,pe,ci);\r
6405 } else\r
6406 {\r
6407 cout<<"WARNING: diffFlowCorrelationsPro[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6408 cout<<"t = "<<t<<endl;\r
6409 cout<<"pe = "<<pe<<endl; \r
6410 cout<<"ci = "<<ci<<endl;\r
6411 } \r
6412 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index \r
6413 // products of correlations: \r
6414 diffFlowProductOfCorrelationsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with products of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data()))); \r
6415 if(!diffFlowProductOfCorrelationsProList[t][pe])\r
6416 { \r
6417 cout<<"WARNING: ddiffFlowProductOfCorrelationsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6418 cout<<"t = "<<t<<endl;\r
6419 cout<<"pe = "<<pe<<endl;\r
6420 exit(0);\r
6421 }\r
6422 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index\r
6423 {\r
6424 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index\r
6425 {\r
6426 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
6427 if(diffFlowProductOfCorrelationsPro[t][pe][mci1][mci2])\r
6428 {\r
6429 this->SetDiffFlowProductOfCorrelationsPro(diffFlowProductOfCorrelationsPro[t][pe][mci1][mci2],t,pe,mci1,mci2);\r
6430 } else\r
6431 {\r
6432 cout<<"WARNING: diffFlowCorrelationsPro[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6433 cout<<"t = "<<t<<endl;\r
6434 cout<<"pe = "<<pe<<endl; \r
6435 cout<<"mci1 = "<<mci1<<endl;\r
6436 cout<<"mci2 = "<<mci2<<endl;\r
6437 }\r
6438 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here\r
6439 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index\r
6440 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index \r
6441 // corrections:\r
6442 diffFlowCorrectionsProList[t][pe] = dynamic_cast<TList*>(diffFlowListProfiles->FindObject(Form("Profiles with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));\r
6443 if(!diffFlowCorrectionsProList[t][pe])\r
6444 { \r
6445 cout<<"WARNING: diffFlowCorrectionsProList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6446 cout<<"t = "<<t<<endl;\r
6447 cout<<"pe = "<<pe<<endl;\r
6448 exit(0);\r
6449 }\r
6450 // correction terms for NUA:\r
6451 for(Int_t sc=0;sc<2;sc++) // sin or cos\r
6452 {\r
6453 for(Int_t cti=0;cti<9;cti++) // correction term index\r
6454 {\r
6455 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
6456 if(diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti])\r
6457 {\r
6458 this->SetDiffFlowCorrectionTermsForNUAPro(diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti],t,pe,sc,cti);\r
6459 } else\r
6460 {\r
6461 cout<<"WARNING: diffFlowCorrectionTermsForNUAPro[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6462 cout<<"t = "<<t<<endl;\r
6463 cout<<"pe = "<<pe<<endl; \r
6464 cout<<"sc = "<<sc<<endl;\r
6465 cout<<"cti = "<<cti<<endl;\r
6466 } \r
6467 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index\r
6468 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos\r
6469 // ...\r
6470 } // end of for(Int_t pe=0;pe<2;pe++)\r
6471 } // end of for(Int_t t=0;t<2;t++)\r
6472 \r
6473 // e) Get pointers to all nested lists in fDiffFlowListResults and to histograms which they hold.\r
6474 // reduced correlations:\r
6475 TList *diffFlowCorrelationsHistList[2][2] = {{NULL}};\r
6476 TString diffFlowCorrelationsHistName = "fDiffFlowCorrelationsHist";\r
6477 diffFlowCorrelationsHistName += fAnalysisLabel->Data(); \r
6478 TH1D *diffFlowCorrelationsHist[2][2][4] = {{{NULL}}};\r
6479 // corrections for NUA:\r
6480 TList *diffFlowCorrectionsHistList[2][2] = {{NULL}};\r
6481 TString diffFlowCorrectionTermsForNUAHistName = "fDiffFlowCorrectionTermsForNUAHist";\r
6482 diffFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data(); \r
6483 TH1D *diffFlowCorrectionTermsForNUAHist[2][2][2][10] = {{{{NULL}}}};\r
6484 // differential Q-cumulants:\r
6485 TList *diffFlowCumulantsHistList[2][2] = {{NULL}};\r
6486 TString diffFlowCumulantsName = "fDiffFlowCumulants";\r
6487 diffFlowCumulantsName += fAnalysisLabel->Data(); \r
6488 TH1D *diffFlowCumulants[2][2][4] = {{{NULL}}};\r
6489 // differential flow estimates from Q-cumulants:\r
6490 TList *diffFlowHistList[2][2] = {{NULL}};\r
6491 TString diffFlowName = "fDiffFlow";\r
6492 diffFlowName += fAnalysisLabel->Data(); \r
6493 TH1D *diffFlow[2][2][4] = {{{NULL}}};\r
6494 // differential covariances:\r
6495 TList *diffFlowCovariancesHistList[2][2] = {{NULL}};\r
6496 TString diffFlowCovariancesName = "fDiffFlowCovariances";\r
6497 diffFlowCovariancesName += fAnalysisLabel->Data(); \r
6498 TH1D *diffFlowCovariances[2][2][5] = {{{NULL}}};\r
6499 for(Int_t t=0;t<2;t++) // type: RP or POI\r
6500 { \r
6501 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
6502 {\r
6503 // reduced correlations:\r
6504 diffFlowCorrelationsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));\r
6505 if(!diffFlowCorrelationsHistList[t][pe])\r
6506 { \r
6507 cout<<"WARNING: diffFlowCorrelationsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6508 cout<<"t = "<<t<<endl;\r
6509 cout<<"pe = "<<pe<<endl;\r
6510 exit(0);\r
6511 }\r
6512 for(Int_t index=0;index<4;index++) \r
6513 {\r
6514 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
6515 if(diffFlowCorrelationsHist[t][pe][index])\r
6516 {\r
6517 this->SetDiffFlowCorrelationsHist(diffFlowCorrelationsHist[t][pe][index],t,pe,index);\r
6518 } else \r
6519 {\r
6520 cout<<"WARNING: diffFlowCorrelationsHist[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6521 cout<<"t = "<<t<<endl;\r
6522 cout<<"pe = "<<pe<<endl;\r
6523 cout<<"index = "<<index<<endl;\r
6524 exit(0); \r
6525 } \r
6526 } // end of for(Int_t index=0;index<4;index++)\r
6527 // corrections:\r
6528 diffFlowCorrectionsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Histograms with correction terms for NUA (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));\r
6529 if(!diffFlowCorrectionsHistList[t][pe])\r
6530 { \r
6531 cout<<"WARNING: diffFlowCorrectionsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6532 cout<<"t = "<<t<<endl;\r
6533 cout<<"pe = "<<pe<<endl;\r
6534 exit(0);\r
6535 }\r
6536 // correction terms for NUA:\r
6537 for(Int_t sc=0;sc<2;sc++) // sin or cos\r
6538 {\r
6539 for(Int_t cti=0;cti<9;cti++) // correction term index\r
6540 {\r
6541 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
6542 if(diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti])\r
6543 {\r
6544 this->SetDiffFlowCorrectionTermsForNUAHist(diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti],t,pe,sc,cti);\r
6545 } else\r
6546 {\r
6547 cout<<"WARNING: diffFlowCorrectionTermsForNUAHist[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6548 cout<<"t = "<<t<<endl;\r
6549 cout<<"pe = "<<pe<<endl; \r
6550 cout<<"sc = "<<sc<<endl;\r
6551 cout<<"cti = "<<cti<<endl;\r
6552 } \r
6553 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index\r
6554 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos\r
6555 // ...\r
6556 // differential Q-cumulants:\r
6557 diffFlowCumulantsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Differential Q-cumulants (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));\r
6558 if(!diffFlowCumulantsHistList[t][pe])\r
6559 { \r
6560 cout<<"WARNING: diffFlowCumulantsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6561 cout<<"t = "<<t<<endl;\r
6562 cout<<"pe = "<<pe<<endl;\r
6563 exit(0);\r
6564 }\r
6565 for(Int_t index=0;index<4;index++) \r
6566 {\r
6567 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
6568 if(diffFlowCumulants[t][pe][index])\r
6569 {\r
6570 this->SetDiffFlowCumulants(diffFlowCumulants[t][pe][index],t,pe,index);\r
6571 } else \r
6572 {\r
6573 cout<<"WARNING: diffFlowCumulants[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6574 cout<<"t = "<<t<<endl;\r
6575 cout<<"pe = "<<pe<<endl;\r
6576 cout<<"index = "<<index<<endl;\r
6577 exit(0); \r
6578 } \r
6579 } // end of for(Int_t index=0;index<4;index++)\r
6580 // differential flow estimates from Q-cumulants:\r
6581 diffFlowHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Differential flow (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));\r
6582 if(!diffFlowHistList[t][pe])\r
6583 { \r
6584 cout<<"WARNING: diffFlowHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6585 cout<<"t = "<<t<<endl;\r
6586 cout<<"pe = "<<pe<<endl;\r
6587 exit(0);\r
6588 }\r
6589 for(Int_t index=0;index<4;index++) \r
6590 {\r
6591 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
6592 if(diffFlow[t][pe][index])\r
6593 {\r
6594 this->SetDiffFlow(diffFlow[t][pe][index],t,pe,index);\r
6595 } else \r
6596 {\r
6597 cout<<"WARNING: diffFlow[t][pe][index] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6598 cout<<"t = "<<t<<endl;\r
6599 cout<<"pe = "<<pe<<endl;\r
6600 cout<<"index = "<<index<<endl;\r
6601 exit(0); \r
6602 } \r
6603 } // end of for(Int_t index=0;index<4;index++)\r
6604 // differential covariances:\r
6605 diffFlowCovariancesHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Covariances of correlations (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));\r
6606 if(!diffFlowCovariancesHistList[t][pe])\r
6607 { \r
6608 cout<<"WARNING: diffFlowCovariancesHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6609 cout<<"t = "<<t<<endl;\r
6610 cout<<"pe = "<<pe<<endl;\r
6611 exit(0);\r
6612 }\r
6613 for(Int_t covIndex=0;covIndex<5;covIndex++) \r
6614 {\r
6615 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
6616 if(diffFlowCovariances[t][pe][covIndex])\r
6617 {\r
6618 this->SetDiffFlowCovariances(diffFlowCovariances[t][pe][covIndex],t,pe,covIndex);\r
6619 } else \r
6620 {\r
6621 cout<<"WARNING: diffFlowCovariances[t][pe][covIndex] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6622 cout<<"t = "<<t<<endl;\r
6623 cout<<"pe = "<<pe<<endl;\r
6624 cout<<"covIndex = "<<covIndex<<endl;\r
6625 exit(0); \r
6626 } \r
6627 } // end of for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index \r
6628 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta\r
6629 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI \r
6630 // sum of event weights for reduced correlations:\r
6631 TList *diffFlowSumOfEventWeightsHistList[2][2][2] = {{{NULL}}};\r
6632 TString diffFlowSumOfEventWeightsName = "fDiffFlowSumOfEventWeights";\r
6633 diffFlowSumOfEventWeightsName += fAnalysisLabel->Data(); \r
6634 TH1D *diffFlowSumOfEventWeights[2][2][2][4] = {{{{NULL}}}};\r
6635 for(Int_t t=0;t<2;t++) // type is RP or POI\r
6636 { \r
6637 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
6638 { \r
6639 for(Int_t p=0;p<2;p++) // power of event weights is either 1 or 2\r
6640 {\r
6641 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
6642 if(!diffFlowSumOfEventWeightsHistList[t][pe][p])\r
6643 { \r
6644 cout<<"WARNING: diffFlowSumOfEventWeightsHistList[t][pe][p] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6645 cout<<"t = "<<t<<endl;\r
6646 cout<<"pe = "<<pe<<endl;\r
6647 cout<<"power = "<<p<<endl;\r
6648 exit(0);\r
6649 }\r
6650 for(Int_t ew=0;ew<4;ew++) // index of reduced correlation\r
6651 {\r
6652 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
6653 if(diffFlowSumOfEventWeights[t][pe][p][ew])\r
6654 {\r
6655 this->SetDiffFlowSumOfEventWeights(diffFlowSumOfEventWeights[t][pe][p][ew],t,pe,p,ew);\r
6656 } else \r
6657 {\r
6658 cout<<"WARNING: diffFlowSumOfEventWeights[t][pe][p][ew] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6659 cout<<"t = "<<t<<endl;\r
6660 cout<<"pe = "<<pe<<endl;\r
6661 cout<<"power = "<<p<<endl;\r
6662 cout<<"ew = "<<ew<<endl;\r
6663 exit(0); \r
6664 } \r
6665 }\r
6666 } // end of for(Int_t p=0;p<2;p++) // power of event weights is either 1 or 2\r
6667 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta\r
6668 } // end of for(Int_t t=0;t<2;t++) // type is RP or POI\r
6669 // \r
6670 TList *diffFlowSumOfProductOfEventWeightsHistList[2][2] = {{NULL}};\r
6671 TString diffFlowSumOfProductOfEventWeightsName = "fDiffFlowSumOfProductOfEventWeights";\r
6672 diffFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data(); \r
6673 TH1D *diffFlowSumOfProductOfEventWeights[2][2][8][8] = {{{{NULL}}}};\r
6674 for(Int_t t=0;t<2;t++) // type is RP or POI\r
6675 { \r
6676 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
6677 { \r
6678 diffFlowSumOfProductOfEventWeightsHistList[t][pe] = dynamic_cast<TList*>(diffFlowListResults->FindObject(Form("Sum of products of event weights (%s, %s)",typeFlag[t].Data(),ptEtaFlag[pe].Data())));\r
6679 if(!diffFlowSumOfProductOfEventWeightsHistList[t][pe])\r
6680 { \r
6681 cout<<"WARNING: diffFlowSumOfProductOfEventWeightsHistList[t][pe] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6682 cout<<"t = "<<t<<endl;\r
6683 cout<<"pe = "<<pe<<endl;\r
6684 exit(0);\r
6685 }\r
6686 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index\r
6687 {\r
6688 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index\r
6689 {\r
6690 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
6691 if(diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2])\r
6692 {\r
6693 this->SetDiffFlowSumOfProductOfEventWeights(diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2],t,pe,mci1,mci2);\r
6694 } else \r
6695 {\r
6696 cout<<"WARNING: diffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
6697 cout<<"t = "<<t<<endl;\r
6698 cout<<"pe = "<<pe<<endl;\r
6699 cout<<"mci1 = "<<mci1<<endl;\r
6700 cout<<"mci2 = "<<mci2<<endl;\r
6701 exit(0); \r
6702 } \r
6703 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here\r
6704 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index\r
6705 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index\r
6706 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta\r
6707 } // end of for(Int_t t=0;t<2;t++) // type is RP or POI\r
6708\r
3b552efe 6709} // end void AliFlowAnalysisWithQCumulants::GetPointersForDiffFlowHistograms()\r
a5b7efd0 6710\r
6711\r
6712//================================================================================================================================\r
6713\r
6714\r
6715void AliFlowAnalysisWithQCumulants::BookEverythingForDifferentialFlow()\r
6716{\r
6717 // Book all histograms and profiles needed for differential flow.\r
6718 // a) Define flags locally (to be improved: should I promote flags to data members?);\r
6719 // b) Book profile to hold all flags for differential flow;\r
6720 // c) Book e-b-e quantities;\r
6721 // d) Book profiles;\r
6722 // e) Book histograms holding final results. \r
6723 \r
6724 // a) Define flags locally (to be improved: should I promote flags to data members?): \r
6725 TString typeFlag[2] = {"RP","POI"}; \r
6726 TString ptEtaFlag[2] = {"p_{T}","#eta"};\r
6727 TString powerFlag[2] = {"linear","quadratic"};\r
6728 TString sinCosFlag[2] = {"sin","cos"};\r
6729 TString differentialCumulantIndex[4] = {"QC{2'}","QC{4'}","QC{6'}","QC{8'}"}; \r
6730 TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"}; \r
6731 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"};\r
6732 TString mixedCorrelationIndex[8] = {"<2>","<2'>","<4>","<4'>","<6>","<6'>","<8>","<8'>"};\r
6733 TString covarianceName[5] = {"Cov(<2>,<2'>)","Cov(<2>,<4'>)","Cov(<4>,<2'>)","Cov(<4>,<4'>)","Cov(<2'>,<4'>)"}; \r
6734 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
6735 Double_t minPtEta[2] = {fPtMin,fEtaMin};\r
6736 Double_t maxPtEta[2] = {fPtMax,fEtaMax};\r
6737 \r
6738 // b) Book profile to hold all flags for differential flow:\r
6739 TString diffFlowFlagsName = "fDiffFlowFlags";\r
6740 diffFlowFlagsName += fAnalysisLabel->Data();\r
6741 fDiffFlowFlags = new TProfile(diffFlowFlagsName.Data(),"Flags for Differential Flow",4,0,4);\r
6742 fDiffFlowFlags->SetTickLength(-0.01,"Y");\r
6743 fDiffFlowFlags->SetMarkerStyle(25);\r
6744 fDiffFlowFlags->SetLabelSize(0.05);\r
6745 fDiffFlowFlags->SetLabelOffset(0.02,"Y");\r
6746 (fDiffFlowFlags->GetXaxis())->SetBinLabel(1,"Particle Weights");\r
6747 (fDiffFlowFlags->GetXaxis())->SetBinLabel(2,"Event Weights");\r
6748 (fDiffFlowFlags->GetXaxis())->SetBinLabel(3,"Corrected for NUA?");\r
6749 (fDiffFlowFlags->GetXaxis())->SetBinLabel(4,"Calculated 2D flow?");\r
6750 fDiffFlowList->Add(fDiffFlowFlags);\r
6751\r
6752 // c) Book e-b-e quantities:\r
6753 // Event-by-event r_{m*n,k}(pt,eta), p_{m*n,k}(pt,eta) and q_{m*n,k}(pt,eta)\r
6754 // Explanantion of notation:\r
6755 // 1.) n is harmonic, m is multiple of harmonic;\r
6756 // 2.) k is power of particle weight;\r
6757 // 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
6758 // 4.) p_{m*n,k}(pt,eta) = Q-vector evaluated in harmonic m*n for POIs in particular (pt,eta) bin \r
6759 // (if i-th POI is also RP, than it is weighted with w_i^k); \r
6760 // 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
6761 // (i-th RP&&POI is weighted with w_i^k) \r
6762 \r
6763 // 1D:\r
6764 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP && POI )\r
6765 { \r
6766 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
6767 {\r
6768 for(Int_t m=0;m<4;m++) // multiple of harmonic\r
6769 {\r
6770 for(Int_t k=0;k<9;k++) // power of particle weight\r
6771 {\r
6772 fReRPQ1dEBE[t][pe][m][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%dpower%dRe",t,pe,m,k),\r
6773 Form("TypeFlag%dpteta%dmultiple%dpower%dRe",t,pe,m,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]); \r
6774 fImRPQ1dEBE[t][pe][m][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%dpower%dIm",t,pe,m,k),\r
6775 Form("TypeFlag%dpteta%dmultiple%dpower%dIm",t,pe,m,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]); \r
6776 }\r
6777 }\r
6778 }\r
6779 } \r
6780 // to be improved (add explanation of fs1dEBE[t][pe][k]): \r
6781 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )\r
6782 { \r
6783 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
6784 {\r
6785 for(Int_t k=0;k<9;k++) // power of particle weight\r
6786 {\r
6787 fs1dEBE[t][pe][k] = new TProfile(Form("TypeFlag%dpteta%dmultiple%d",t,pe,k),\r
6788 Form("TypeFlag%dpteta%dmultiple%d",t,pe,k),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]); \r
6789 }\r
6790 }\r
6791 }\r
6792 // correction terms for nua:\r
6793 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)\r
6794 { \r
6795 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
6796 {\r
6797 for(Int_t sc=0;sc<2;sc++) // sin or cos\r
6798 {\r
6799 for(Int_t cti=0;cti<9;cti++) // correction term index\r
6800 {\r
6801 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti] = new TH1D(Form("typeFlag%d pteta%d sincos%d cti%d",t,pe,sc,cti),\r
6802 Form("typeFlag%d pteta%d sincos%d cti%d",t,pe,sc,cti),nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]); \r
6803 }\r
6804 }\r
6805 }\r
6806 } \r
6807 // 2D:\r
6808 TProfile2D styleRe("typeMultiplePowerRe","typeMultiplePowerRe",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);\r
6809 TProfile2D styleIm("typeMultiplePowerIm","typeMultiplePowerIm",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);\r
6810 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )\r
6811 { \r
6812 for(Int_t m=0;m<4;m++)\r
6813 {\r
6814 for(Int_t k=0;k<9;k++)\r
6815 {\r
6816 fReRPQ2dEBE[t][m][k] = (TProfile2D*)styleRe.Clone(Form("typeFlag%dmultiple%dpower%dRe",t,m,k)); \r
6817 fImRPQ2dEBE[t][m][k] = (TProfile2D*)styleIm.Clone(Form("typeFlag%dmultiple%dpower%dIm",t,m,k));\r
6818 }\r
6819 } \r
6820 } \r
6821 TProfile2D styleS("typePower","typePower",fnBinsPt,fPtMin,fPtMax,fnBinsEta,fEtaMin,fEtaMax);\r
6822 for(Int_t t=0;t<3;t++) // typeFlag (0 = RP, 1 = POI, 2 = RP&&POI )\r
6823 { \r
6824 for(Int_t k=0;k<9;k++)\r
6825 {\r
6826 fs2dEBE[t][k] = (TProfile2D*)styleS.Clone(Form("typeFlag%dpower%d",t,k));\r
6827 }\r
6828 }\r
6829 // reduced correlations e-b-e:\r
6830 TString diffFlowCorrelationsEBEName = "fDiffFlowCorrelationsEBE";\r
6831 diffFlowCorrelationsEBEName += fAnalysisLabel->Data();\r
6832 for(Int_t t=0;t<2;t++) // type: RP or POI\r
6833 { \r
6834 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
6835 {\r
6836 for(Int_t rci=0;rci<4;rci++) // reduced correlation index\r
6837 {\r
6838 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
6839 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index\r
6840 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta \r
6841 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI\r
6842 // event weights for reduced correlations e-b-e:\r
6843 TString diffFlowEventWeightsForCorrelationsEBEName = "fDiffFlowEventWeightsForCorrelationsEBE";\r
6844 diffFlowEventWeightsForCorrelationsEBEName += fAnalysisLabel->Data();\r
6845 for(Int_t t=0;t<2;t++) // type: RP or POI\r
6846 { \r
6847 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
6848 {\r
6849 for(Int_t rci=0;rci<4;rci++) // event weight for reduced correlation index\r
6850 {\r
6851 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
6852 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index\r
6853 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta \r
6854 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI\r
6855 \r
6856 // d) Book profiles;\r
6857 // reduced correlations:\r
6858 TString diffFlowCorrelationsProName = "fDiffFlowCorrelationsPro";\r
6859 diffFlowCorrelationsProName += fAnalysisLabel->Data();\r
6860 // corrections terms:\r
6861 TString diffFlowCorrectionTermsForNUAProName = "fDiffFlowCorrectionTermsForNUAPro";\r
6862 diffFlowCorrectionTermsForNUAProName += fAnalysisLabel->Data();\r
6863 for(Int_t t=0;t<2;t++) // type: RP or POI\r
6864 { \r
6865 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
6866 {\r
6867 for(Int_t rci=0;rci<4;rci++) // reduced correlation index\r
6868 {\r
6869 // reduced correlations:\r
6870 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
6871 fDiffFlowCorrelationsPro[t][pe][rci]->SetXTitle(ptEtaFlag[pe].Data());\r
6872 fDiffFlowCorrelationsProList[t][pe]->Add(fDiffFlowCorrelationsPro[t][pe][rci]); // to be improved (add dedicated list to hold reduced correlations)\r
6873 } // end of for(Int_t rci=0;rci<4;rci++) // correlation index\r
6874 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta \r
6875 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI\r
6876 // correction terms for nua:\r
6877 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)\r
6878 { \r
6879 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
6880 {\r
6881 for(Int_t sc=0;sc<2;sc++) // sin or cos\r
6882 {\r
6883 for(Int_t cti=0;cti<9;cti++) // correction term index\r
6884 {\r
6885 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
6886 fDiffFlowCorrectionsProList[t][pe]->Add(fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]);\r
6887 }\r
6888 }\r
6889 }\r
6890 } \r
6891 // e) Book histograms holding final results. \r
6892 // reduced correlations:\r
6893 TString diffFlowCorrelationsHistName = "fDiffFlowCorrelationsHist";\r
6894 diffFlowCorrelationsHistName += fAnalysisLabel->Data();\r
6895 // corrections terms:\r
6896 TString diffFlowCorrectionTermsForNUAHistName = "fDiffFlowCorrectionTermsForNUAHist";\r
6897 diffFlowCorrectionTermsForNUAHistName += fAnalysisLabel->Data();\r
6898 // differential covariances:\r
6899 TString diffFlowCovariancesName = "fDiffFlowCovariances";\r
6900 diffFlowCovariancesName += fAnalysisLabel->Data();\r
6901 // differential Q-cumulants:\r
6902 TString diffFlowCumulantsName = "fDiffFlowCumulants";\r
6903 diffFlowCumulantsName += fAnalysisLabel->Data();\r
6904 // differential flow:\r
6905 TString diffFlowName = "fDiffFlow";\r
6906 diffFlowName += fAnalysisLabel->Data();\r
6907 for(Int_t t=0;t<2;t++) // type: RP or POI\r
6908 { \r
6909 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
6910 {\r
6911 for(Int_t index=0;index<4;index++) \r
6912 {\r
6913 // reduced correlations:\r
6914 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
6915 fDiffFlowCorrelationsHist[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());\r
6916 fDiffFlowCorrelationsHistList[t][pe]->Add(fDiffFlowCorrelationsHist[t][pe][index]); \r
6917 // differential Q-cumulants:\r
6918 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
6919 fDiffFlowCumulants[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());\r
6920 fDiffFlowCumulantsHistList[t][pe]->Add(fDiffFlowCumulants[t][pe][index]); \r
6921 // differential flow estimates from Q-cumulants:\r
6922 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
6923 fDiffFlow[t][pe][index]->SetXTitle(ptEtaFlag[pe].Data());\r
6924 fDiffFlowHistList[t][pe]->Add(fDiffFlow[t][pe][index]); \r
6925 } // end of for(Int_t index=0;index<4;index++) \r
6926 for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index \r
6927 {\r
6928 // differential covariances:\r
6929 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
6930 fDiffFlowCovariances[t][pe][covIndex]->SetXTitle(ptEtaFlag[pe].Data());\r
6931 fDiffFlowCovariancesHistList[t][pe]->Add(fDiffFlowCovariances[t][pe][covIndex]); \r
6932 } // end of for(Int_t covIndex=0;covIndex<5;covIndex++) // covariance index\r
6933 // products of both types of correlations: \r
6934 TString diffFlowProductOfCorrelationsProName = "fDiffFlowProductOfCorrelationsPro";\r
6935 diffFlowProductOfCorrelationsProName += fAnalysisLabel->Data(); \r
6936 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index\r
6937 {\r
6938 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index\r
6939 {\r
6940 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
6941 fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2]->SetXTitle(ptEtaFlag[pe].Data());\r
6942 fDiffFlowProductOfCorrelationsProList[t][pe]->Add(fDiffFlowProductOfCorrelationsPro[t][pe][mci1][mci2]); \r
6943 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here\r
6944 } // end of for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index\r
6945 } // end of for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index \r
6946 } // end of for(Int_t pe=0;pe<2;pe++) // pt or eta \r
6947 } // end of for(Int_t t=0;t<2;t++) // type: RP or POI\r
6948 // sums of event weights for reduced correlations: \r
6949 TString diffFlowSumOfEventWeightsName = "fDiffFlowSumOfEventWeights";\r
6950 diffFlowSumOfEventWeightsName += fAnalysisLabel->Data(); \r
6951 for(Int_t t=0;t<2;t++) // type is RP or POI\r
6952 { \r
6953 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
6954 { \r
6955 for(Int_t p=0;p<2;p++) // power of weights is either 1 or 2\r
6956 {\r
6957 for(Int_t ew=0;ew<4;ew++) // index of reduced correlation\r
6958 {\r
6959 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
6960 fDiffFlowSumOfEventWeights[t][pe][p][ew]->SetXTitle(ptEtaFlag[pe].Data());\r
6961 fDiffFlowSumOfEventWeightsHistList[t][pe][p]->Add(fDiffFlowSumOfEventWeights[t][pe][p][ew]); // to be improved (add dedicated list to hold all this)\r
6962 }\r
6963 }\r
6964 }\r
6965 } \r
6966 // sum of products of event weights for both types of correlations: \r
6967 TString diffFlowSumOfProductOfEventWeightsName = "fDiffFlowSumOfProductOfEventWeights";\r
6968 diffFlowSumOfProductOfEventWeightsName += fAnalysisLabel->Data(); \r
6969 for(Int_t t=0;t<2;t++) // type is RP or POI\r
6970 {\r
6971 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
6972 { \r
6973 for(Int_t mci1=0;mci1<8;mci1++) // mixed correlation index\r
6974 {\r
6975 for(Int_t mci2=mci1+1;mci2<8;mci2++) // mixed correlation index\r
6976 {\r
6977 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
6978 fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2]->SetXTitle(ptEtaFlag[pe].Data());\r
6979 fDiffFlowSumOfProductOfEventWeightsHistList[t][pe]->Add(fDiffFlowSumOfProductOfEventWeights[t][pe][mci1][mci2]); \r
6980 if(mci1%2 == 0) mci2++; // products which DO NOT include reduced correlations are not stored here\r
6981 }\r
6982 }\r
6983 }\r
6984 } \r
6985 // correction terms for nua:\r
6986 for(Int_t t=0;t<2;t++) // typeFlag (0 = RP, 1 = POI)\r
6987 { \r
6988 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
6989 {\r
6990 for(Int_t sc=0;sc<2;sc++) // sin or cos\r
6991 {\r
6992 for(Int_t cti=0;cti<9;cti++) // correction term index\r
6993 {\r
6994 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
6995 fDiffFlowCorrectionsHistList[t][pe]->Add(fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti]);\r
6996 }\r
6997 }\r
6998 }\r
6999 } \r
7000 \r
7001} // end of AliFlowAnalysisWithQCumulants::BookEverythingForDifferentialFlow()\r
7002\r
7003\r
7004//================================================================================================================================\r
7005\r
7006/*\r
7007void AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNUAForIntQcumulants() // to be improved (do I really need this method?)\r
7008{\r
7009 // Calculate final corrections for non-uniform acceptance for Q-cumulants.\r
7010 \r
7011 // Corrections for non-uniform acceptance are stored in histogram fCorrectionsForNUA,\r
7012 // binning of fCorrectionsForNUA is organized as follows:\r
7013 //\r
7014 // 1st bin: correction to QC{2}\r
7015 // 2nd bin: correction to QC{4}\r
7016 // 3rd bin: correction to QC{6}\r
7017 // 4th bin: correction to QC{8}\r
7018 \r
7019 // shortcuts flags:\r
7020 Int_t pW = (Int_t)(useParticleWeights);\r
7021 \r
7022 Int_t eW = -1;\r
7023 \r
7024 if(eventWeights == "exact")\r
7025 {\r
7026 eW = 0;\r
7027 }\r
7028\r
7029 for(Int_t sc=0;sc<2;sc++) // sin or cos terms flag\r
7030 {\r
7031 if(!(fQCorrelations[pW][eW] && fQCorrections[pW][eW][sc] && fCorrections[pW][eW]))\r
7032 {\r
7033 cout<<"WARNING: fQCorrelations[pW][eW] && fQCorrections[pW][eW][sc] && fCorrections[pW][eW] is NULL in AFAWQC::CFCFNUAFIF() !!!!"<<endl;\r
7034 cout<<"pW = "<<pW<<endl;\r
7035 cout<<"eW = "<<eW<<endl;\r
7036 cout<<"sc = "<<sc<<endl;\r
7037 exit(0);\r
7038 }\r
7039 } \r
7040\r
7041 // measured 2-, 4-, 6- and 8-particle azimuthal correlations (biased with non-uniform acceptance!):\r
7042 Double_t two = fQCorrelations[pW][eW]->GetBinContent(1); // <<2>>\r
7043 //Double_t four = fQCorrelations[pW][eW]->GetBinContent(11); // <<4>>\r
7044 //Double_t six = fQCorrelations[pW][eW]->GetBinContent(24); // <<6>>\r
7045 //Double_t eight = fQCorrelations[pW][eW]->GetBinContent(31); // <<8>>\r
7046 \r
7047 // correction terms to QC{2}:\r
7048 // <<cos(n*phi1)>>^2\r
7049 Double_t two1stTerm = pow(fQCorrections[pW][eW][1]->GetBinContent(1),2); \r
7050 // <<sin(n*phi1)>>^2\r
7051 Double_t two2ndTerm = pow(fQCorrections[pW][eW][0]->GetBinContent(1),2); \r
7052 // final corrections for non-uniform acceptance to QC{2}:\r
7053 Double_t correctionQC2 = -1.*two1stTerm-1.*two2ndTerm;\r
7054 fCorrections[pW][eW]->SetBinContent(1,correctionQC2); \r
7055 \r
7056 // correction terms to QC{4}:\r
7057 // <<cos(n*phi1)>> <<cos(n*(phi1-phi2-phi3))>>\r
7058 Double_t four1stTerm = fQCorrections[pW][eW][1]->GetBinContent(1)*fQCorrections[pW][eW][1]->GetBinContent(3); \r
7059 // <<sin(n*phi1)>> <<sin(n*(phi1-phi2-phi3))>>\r
7060 Double_t four2ndTerm = fQCorrections[pW][eW][0]->GetBinContent(1)*fQCorrections[pW][eW][0]->GetBinContent(3); \r
7061 // <<cos(n*(phi1+phi2))>>^2\r
7062 Double_t four3rdTerm = pow(fQCorrections[pW][eW][1]->GetBinContent(2),2); \r
7063 // <<sin(n*(phi1+phi2))>>^2\r
7064 Double_t four4thTerm = pow(fQCorrections[pW][eW][0]->GetBinContent(2),2); \r
7065 // <<cos(n*(phi1+phi2))>> (<<cos(n*phi1)>>^2 - <<sin(n*phi1)>>^2)\r
7066 Double_t four5thTerm = fQCorrections[pW][eW][1]->GetBinContent(2)\r
7067 * (pow(fQCorrections[pW][eW][1]->GetBinContent(1),2)-pow(fQCorrections[pW][eW][0]->GetBinContent(1),2));\r
7068 // <<sin(n*(phi1+phi2))>> <<cos(n*phi1)>> <<sin(n*phi1)>>\r
7069 Double_t four6thTerm = fQCorrections[pW][eW][0]->GetBinContent(2)\r
7070 * fQCorrections[pW][eW][1]->GetBinContent(1)\r
7071 * fQCorrections[pW][eW][0]->GetBinContent(1); \r
7072 // <<cos(n*(phi1-phi2))>> (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2)\r
7073 Double_t four7thTerm = two*(pow(fQCorrections[pW][eW][1]->GetBinContent(1),2)+pow(fQCorrections[pW][eW][0]->GetBinContent(1),2)); \r
7074 // (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2)^2\r
7075 Double_t four8thTerm = pow(pow(fQCorrections[pW][eW][1]->GetBinContent(1),2)+pow(fQCorrections[pW][eW][0]->GetBinContent(1),2),2); \r
7076 // final correction to QC{4}:\r
7077 Double_t correctionQC4 = -4.*four1stTerm+4.*four2ndTerm-four3rdTerm-four4thTerm\r
7078 + 4.*four5thTerm+8.*four6thTerm+8.*four7thTerm-6.*four8thTerm; \r
7079 fCorrections[pW][eW]->SetBinContent(2,correctionQC4); \r
7080\r
7081 // ... to be improved (continued for 6th and 8th order) \r
7082\r
7083\r
7084} // end of AliFlowAnalysisWithQCumulants::CalculateCorrectionsForNUAForIntQcumulants()\r
7085*/\r
7086\r
7087//================================================================================================================================\r
7088\r
7089\r
7090void AliFlowAnalysisWithQCumulants::CalculateQcumulantsCorrectedForNUAIntFlow()\r
7091{\r
7092 // Calculate generalized Q-cumulants (cumulants corrected for non-unifom acceptance).\r
7093 \r
7094 // measured 2-, 4-, 6- and 8-particle correlations (biased by non-uniform acceptance!):\r
7095 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>\r
7096 Double_t four = fIntFlowCorrelationsHist->GetBinContent(2); // <<4>>\r
7097 //Double_t six = fIntFlowCorrelationsHist->GetBinContent(3); // <<6>>\r
7098 //Double_t eight = fIntFlowCorrelationsHist->GetBinContent(4); // <<8>>\r
7099 \r
7100 // statistical error of measured 2-, 4-, 6- and 8-particle correlations:\r
7101 //Double_t twoError = fIntFlowCorrelationsHist->GetBinError(1); // statistical error of <<2>>\r
7102 //Double_t fourError = fIntFlowCorrelationsHist->GetBinError(2); // statistical error of <<4>>\r
7103 //Double_t sixError = fIntFlowCorrelationsHist->GetBinError(3); // statistical error of <<6>>\r
7104 //Double_t eightError = fIntFlowCorrelationsHist->GetBinError(4); // statistical error of <<8>>\r
7105\r
7106 // QC{2}:\r
7107 // <<cos(n*phi1)>>^2\r
7108 Double_t two1stTerm = pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1),2); \r
7109 //Double_t two1stTermErrorSquared = pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinError(1),2); \r
7110 // <<sin(n*phi1)>>^2\r
7111 Double_t two2ndTerm = pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1),2); \r
7112 //Double_t two2ndTermErrorSquared = pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinError(1),2); \r
7113 // generalized QC{2}:\r
7114 Double_t gQC2 = two - two1stTerm - two2ndTerm; // to be improved (terminology, notation)\r
7115 fIntFlowQcumulants->SetBinContent(1,gQC2); \r
7116 //fIntFlowQcumulants->SetBinError(1,0.); // to be improved (propagate error) \r
7117 \r
7118 // QC{4}:\r
7119 // <<cos(n*phi1)>> <<cos(n*(phi1-phi2-phi3))>>\r
7120 Double_t four1stTerm = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1)\r
7121 * fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(3); \r
7122 // <<sin(n*phi1)>> <<sin(n*(phi1-phi2-phi3))>>\r
7123 Double_t four2ndTerm = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1)\r
7124 * fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(3); \r
7125 // <<cos(n*(phi1+phi2))>>^2\r
7126 Double_t four3rdTerm = pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2),2); \r
7127 // <<sin(n*(phi1+phi2))>>^2\r
7128 Double_t four4thTerm = pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2),2); \r
7129 // <<cos(n*(phi1+phi2))>> (<<cos(n*phi1)>>^2 - <<sin(n*phi1)>>^2)\r
7130 Double_t four5thTerm = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2)\r
7131 * (pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1),2)\r
7132 - pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1),2));\r
7133 // <<sin(n*(phi1+phi2))>> <<cos(n*phi1)>> <<sin(n*phi1)>>\r
7134 Double_t four6thTerm = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2)\r
7135 * fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1)\r
7136 * fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1); \r
7137 // <<cos(n*(phi1-phi2))>> (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2)\r
7138 Double_t four7thTerm = two*(pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1),2)\r
7139 + pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1),2)); \r
7140 // (<<cos(n*phi1)>>^2 + <<sin(n*phi1)>>^2)^2\r
7141 Double_t four8thTerm = pow(pow(fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1),2)\r
7142 + pow(fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1),2),2); \r
7143 // generalized QC{4}:\r
7144 Double_t gQC4 = four-2.*pow(two,2.)-4.*four1stTerm+4.*four2ndTerm-four3rdTerm\r
7145 - four4thTerm+4.*four5thTerm+8.*four6thTerm+8.*four7thTerm-6.*four8thTerm; \r
7146 fIntFlowQcumulants->SetBinContent(2,gQC4); \r
7147 //fIntFlowQcumulants->SetBinError(2,0.); // to be improved (propagate error) \r
7148\r
7149 // ... to be improved (continued for 6th and 8th order) \r
7150 \r
7151} // end of void AliFlowAnalysisWithQCumulants::CalculateQcumulantsCorrectedForNUAIntFlow()\r
7152\r
7153\r
7154//================================================================================================================================\r
7155\r
7156\r
7157void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectedForNUA()\r
7158{\r
7159 // Calculate integrated flow from generalized Q-cumulants (corrected for non-uniform acceptance).\r
7160 \r
7161 // to be improved: add protection for NULL pointers, propagate statistical errors from \r
7162 // measured correlations and correction terms\r
7163 \r
7164 // generalized Q-cumulants:\r
7165 Double_t qc2 = fIntFlowQcumulants->GetBinContent(1); // QC{2} \r
7166 Double_t qc4 = fIntFlowQcumulants->GetBinContent(2); // QC{4} \r
7167 //Double_t qc6 = fIntFlowQcumulants->GetBinContent(3); // QC{6} \r
7168 //Double_t qc8 = fIntFlowQcumulants->GetBinContent(4); // QC{8}\r
7169 \r
7170 // integrated flow estimates:\r
7171 Double_t v2 = 0.; // v{2,QC} \r
7172 Double_t v4 = 0.; // v{4,QC} \r
7173 //Double_t v6 = 0.; // v{6,QC} \r
7174 //Double_t v8 = 0.; // v{8,QC}\r
7175\r
7176 // calculate integrated flow estimates from generalized Q-cumulants: \r
7177 if(qc2>=0.) v2 = pow(qc2,1./2.); \r
7178 if(qc4<=0.) v4 = pow(-1.*qc4,1./4.); \r
7179 //if(qc6>=0.) v6 = pow((1./4.)*qc6,1./6.); \r
7180 //if(qc8<=0.) v8 = pow((-1./33.)*qc8,1./8.); \r
7181\r
7182 // store integrated flow estimates from generalized Q-cumulants:\r
7183 fIntFlow->SetBinContent(1,v2);\r
7184 fIntFlow->SetBinContent(2,v4);\r
7185 //fIntFlow->SetBinContent(3,v6);\r
7186 //fIntFlow->SetBinContent(4,v8);\r
7187\r
7188} // end of void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectedForNUA()\r
7189\r
7190 \r
7191//================================================================================================================================\r
7192\r
7193\r
7194void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUAIntFlow() \r
7195{\r
7196 // From profile fIntFlowCorrectionTermsForNUAPro[2] access measured corretion terms\r
7197 // and their spread, correctly calculate the statistical errors and store the final \r
7198 // results and statistical errors for correction terms in histogram fIntFlowCorrectionTermsForNUAHist[2].\r
7199 //\r
7200 // Remark: Statistical error of correction temrs is calculated as:\r
7201 //\r
7202 // statistical error = termA * spread * termB:\r
7203 // termA = sqrt{sum_{i=1}^{N} w^2}/(sum_{i=1}^{N} w)\r
7204 // termB = 1/sqrt(1-termA^2) \r
7205 \r
7206 /* // to be improved (implement protection here)\r
7207 for(Int_t power=0;power<2;power++)\r
7208 { \r
7209 if(!(fIntFlowCorrelationsHist && fIntFlowCorrelationsPro && fIntFlowSumOfEventWeights[power])) \r
7210 {\r
7211 cout<<"WARNING: fIntFlowCorrelationsHist && fIntFlowCorrelationsPro && fIntFlowSumOfEventWeights[power] is NULL in AFAWQC::FCIF() !!!!"<<endl;\r
7212 cout<<"power = "<<power<<endl;\r
7213 exit(0);\r
7214 }\r
7215 }\r
7216 */\r
7217 \r
7218 for(Int_t sc=0;sc<2;sc++) // sin or cos correction terms \r
7219 {\r
7220 for(Int_t ci=1;ci<=10;ci++) // correction term index\r
7221 {\r
7222 Double_t correction = fIntFlowCorrectionTermsForNUAPro[sc]->GetBinContent(ci);\r
7223 //Double_t spread = fIntFlowCorrectionTermsForNUAPro[sc]->GetBinError(ci);\r
7224 //Double_t sumOfLinearEventWeights = fIntFlowSumOfEventWeights[0]->GetBinContent(ci);\r
7225 //Double_t sumOfQuadraticEventWeights = fIntFlowSumOfEventWeights[1]->GetBinContent(ci);\r
7226 //Double_t termA = 0.;\r
7227 //Double_t termB = 0.;\r
7228 //if(sumOfLinearEventWeights)\r
7229 //{\r
7230 // termA = pow(sumOfQuadraticEventWeights,0.5)/sumOfLinearEventWeights;\r
7231 //} else\r
7232 // {\r
7233 // cout<<"WARNING: sumOfLinearEventWeights == 0 in AFAWQC::FCIF() !!!!"<<endl;\r
7234 // cout<<" (for "<<2*ci<<"-particle correlation)"<<endl;\r
7235 // }\r
7236 /*\r
7237 if(1.-pow(termA,2.) > 0.)\r
7238 {\r
7239 termB = 1./pow(1-pow(termA,2.),0.5);\r
7240 } else\r
7241 {\r
7242 cout<<"WARNING: 1.-pow(termA,2.) <= 0 in AFAWQC::FCIF() !!!!"<<endl; \r
7243 cout<<" (for "<<2*ci<<"-particle correlation)"<<endl;\r
7244 } \r
7245 Double_t statisticalError = termA * spread * termB;\r
7246 */\r
7247 fIntFlowCorrectionTermsForNUAHist[sc]->SetBinContent(ci,correction);\r
7248 //fIntFlowCorrectionTermsForNUAHist[sc]->SetBinError(ci,statisticalError);\r
7249 } // end of for(Int_t ci=1;ci<=10;ci++) // correction term index\r
7250 } // end of for(Int sc=0;sc<2;sc++) // sin or cos correction terms \r
7251 \r
7252} // end of void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUAIntFlow()\r
7253\r
7254\r
7255//================================================================================================================================\r
7256\r
7257\r
3b552efe 7258void AliFlowAnalysisWithQCumulants::GetPointersForNestedLoopsHistograms()\r
a5b7efd0 7259{\r
7260 // Get pointers to all objects relevant for calculations with nested loops.\r
7261 \r
3b552efe 7262 TList *nestedLoopsList = dynamic_cast<TList*>(fHistList->FindObject("Nested Loops"));\r
7263 if(nestedLoopsList) \r
a5b7efd0 7264 {\r
3b552efe 7265 this->SetNestedLoopsList(nestedLoopsList);\r
7266 } else\r
7267 {\r
7268 cout<<"WARNING: nestedLoopsList is NULL in AFAWQC::GPFNLH() !!!!"<<endl;\r
7269 exit(0);\r
7270 }\r
a5b7efd0 7271 \r
7272 TString sinCosFlag[2] = {"sin","cos"}; // to be improved (should I promote this to data members?)\r
7273 TString typeFlag[2] = {"RP","POI"}; // to be improved (should I promote this to data members?)\r
7274 TString ptEtaFlag[2] = {"p_{T}","#eta"}; // to be improved (should I promote this to data members?)\r
7275 TString reducedCorrelationIndex[4] = {"<2'>","<4'>","<6'>","<8'>"}; // to be improved (should I promote this to data members?)\r
7276 \r
7277 TString evaluateNestedLoopsName = "fEvaluateNestedLoops";\r
7278 evaluateNestedLoopsName += fAnalysisLabel->Data(); \r
7279 TProfile *evaluateNestedLoops = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(evaluateNestedLoopsName.Data()));\r
7280 Bool_t bEvaluateIntFlowNestedLoops = kFALSE;\r
7281 Bool_t bEvaluateDiffFlowNestedLoops = kFALSE;\r
7282 if(evaluateNestedLoops)\r
7283 {\r
7284 this->SetEvaluateNestedLoops(evaluateNestedLoops);\r
7285 bEvaluateIntFlowNestedLoops = (Int_t)evaluateNestedLoops->GetBinContent(1);\r
7286 bEvaluateDiffFlowNestedLoops = (Int_t)evaluateNestedLoops->GetBinContent(2);\r
7287 }\r
7288 // nested loops relevant for integrated flow: \r
7289 if(bEvaluateIntFlowNestedLoops)\r
7290 {\r
7291 // correlations:\r
7292 TString intFlowDirectCorrelationsName = "fIntFlowDirectCorrelations";\r
7293 intFlowDirectCorrelationsName += fAnalysisLabel->Data();\r
7294 TProfile *intFlowDirectCorrelations = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(intFlowDirectCorrelationsName.Data()));\r
7295 if(intFlowDirectCorrelations) \r
7296 { \r
7297 this->SetIntFlowDirectCorrelations(intFlowDirectCorrelations);\r
7298 } else\r
7299 {\r
7300 cout<<"WARNING: intFlowDirectCorrelations is NULL in AFAWQC::GPFNLH() !!!!"<<endl;\r
7301 exit(0);\r
7302 }\r
7303 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights) \r
7304 {\r
7305 TString intFlowExtraDirectCorrelationsName = "fIntFlowExtraDirectCorrelations";\r
7306 intFlowExtraDirectCorrelationsName += fAnalysisLabel->Data();\r
7307 TProfile *intFlowExtraDirectCorrelations = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(intFlowExtraDirectCorrelationsName.Data()));\r
7308 if(intFlowExtraDirectCorrelations) \r
7309 { \r
7310 this->SetIntFlowExtraDirectCorrelations(intFlowExtraDirectCorrelations);\r
7311 } else\r
7312 {\r
7313 cout<<"WARNING: intFlowExtraDirectCorrelations is NULL in AFAWQC::GPFNLH() !!!!"<<endl;\r
7314 exit(0);\r
7315 } \r
7316 } // end of if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights) \r
7317 // correction terms for non-uniform acceptance:\r
7318 TString intFlowDirectCorrectionTermsForNUAName = "fIntFlowDirectCorrectionTermsForNUA";\r
7319 intFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data();\r
7320 TProfile *intFlowDirectCorrectionTermsForNUA[2] = {NULL};\r
7321 for(Int_t sc=0;sc<2;sc++) // sin or cos terms\r
7322 {\r
7323 intFlowDirectCorrectionTermsForNUA[sc] = dynamic_cast<TProfile*>(nestedLoopsList->FindObject(Form("%s: %s terms",intFlowDirectCorrectionTermsForNUAName.Data(),sinCosFlag[sc].Data())));\r
7324 if(intFlowDirectCorrectionTermsForNUA[sc]) \r
7325 { \r
7326 this->SetIntFlowDirectCorrectionTermsForNUA(intFlowDirectCorrectionTermsForNUA[sc],sc);\r
7327 } else\r
7328 {\r
7329 cout<<"WARNING: intFlowDirectCorrectionTermsForNUA[sc] is NULL in AFAWQC::GPFNLH() !!!!"<<endl;\r
7330 cout<<"sc = "<<sc<<endl;\r
7331 exit(0);\r
7332 }\r
7333 } // end of for(Int_t sc=0;sc<2;sc++) \r
7334 } // end of if(bEvaluateIntFlowNestedLoops)\r
7335 \r
7336 // nested loops relevant for differential flow: \r
7337 if(bEvaluateDiffFlowNestedLoops)\r
7338 {\r
7339 // correlations:\r
7340 TString diffFlowDirectCorrelationsName = "fDiffFlowDirectCorrelations";\r
7341 diffFlowDirectCorrelationsName += fAnalysisLabel->Data();\r
7342 TProfile *diffFlowDirectCorrelations[2][2][4] = {{{NULL}}};\r
7343 for(Int_t t=0;t<2;t++)\r
7344 {\r
7345 for(Int_t pe=0;pe<2;pe++)\r
7346 {\r
7347 for(Int_t ci=0;ci<4;ci++) // correlation index\r
7348 {\r
7349 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
7350 if(diffFlowDirectCorrelations[t][pe][ci])\r
7351 {\r
7352 this->SetDiffFlowDirectCorrelations(diffFlowDirectCorrelations[t][pe][ci],t,pe,ci);\r
7353 } else\r
7354 {\r
7355 cout<<"WARNING: diffFlowDirectCorrelations[t][pe][ci] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
7356 cout<<"t = "<<t<<endl;\r
7357 cout<<"pe = "<<pe<<endl; \r
7358 cout<<"ci = "<<ci<<endl;\r
7359 } \r
7360 } // end of for(Int_t ci=0;ci<4;ci++) // correlation index \r
7361 } // end of for(Int_t pe=0;pe<2;pe++)\r
7362 } // end of for(Int_t t=0;t<2;t++) \r
7363 // correction terms for non-uniform acceptance:\r
7364 TString diffFlowDirectCorrectionTermsForNUAName = "fDiffFlowDirectCorrectionTermsForNUA";\r
7365 diffFlowDirectCorrectionTermsForNUAName += fAnalysisLabel->Data(); \r
7366 TProfile *diffFlowDirectCorrectionTermsForNUA[2][2][2][10] = {{{{NULL}}}}; \r
7367 for(Int_t t=0;t<2;t++)\r
7368 {\r
7369 for(Int_t pe=0;pe<2;pe++)\r
7370 {\r
7371 // correction terms for NUA:\r
7372 for(Int_t sc=0;sc<2;sc++) // sin or cos\r
7373 {\r
7374 for(Int_t cti=0;cti<9;cti++) // correction term index\r
7375 {\r
7376 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
7377 if(diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti])\r
7378 {\r
7379 this->SetDiffFlowDirectCorrectionTermsForNUA(diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti],t,pe,sc,cti);\r
7380 } else\r
7381 {\r
7382 cout<<"WARNING: diffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti] is NULL in AFAWQC::GPFDFH() !!!!"<<endl;\r
7383 cout<<"t = "<<t<<endl;\r
7384 cout<<"pe = "<<pe<<endl; \r
7385 cout<<"sc = "<<sc<<endl;\r
7386 cout<<"cti = "<<cti<<endl;\r
7387 } \r
7388 } // end of for(Int_t cti=0;cti<9;cti++) // correction term index\r
7389 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos\r
7390 } // end of for(Int_t pe=0;pe<2;pe++)\r
3b552efe 7391 } // end of for(Int_t t=0;t<2;t++)
7392 // number of RPs and POIs in selected pt and eta bins for cross-checkings:
7393 TString noOfParticlesInBinName = "fNoOfParticlesInBin";
7394 TH1D *noOfParticlesInBin = NULL;
7395 noOfParticlesInBin = dynamic_cast<TH1D*>(nestedLoopsList->FindObject(noOfParticlesInBinName.Data()));
7396 if(noOfParticlesInBin)
7397 {
7398 this->SetNoOfParticlesInBin(noOfParticlesInBin);
7399 } else
7400 {
7401 cout<<endl;
7402 cout<<" WARNING (QC): noOfParticlesInBin is NULL in AFAWQC::GPFDFH() !!!!"<<endl;
7403 cout<<endl;
7404 }\r
a5b7efd0 7405 } // end of if(bEvaluateDiffFlowNestedLoops)\r
a5b7efd0 7406\r
3b552efe 7407} // end of void AliFlowAnalysisWithQCumulants::GetPointersForNestedLoopsHistograms()\r
a5b7efd0 7408\r
7409\r
7410//================================================================================================================================\r
7411\r
7412\r
7413void AliFlowAnalysisWithQCumulants::StoreHarmonic()\r
7414{\r
7415 // Store flow harmonic in common control histograms.\r
7416\r
7417 (fCommonHists->GetHarmonic())->Fill(0.5,fHarmonic);\r
7418 (fCommonHists2nd->GetHarmonic())->Fill(0.5,fHarmonic);\r
7419 (fCommonHists4th->GetHarmonic())->Fill(0.5,fHarmonic);\r
7420 (fCommonHists6th->GetHarmonic())->Fill(0.5,fHarmonic);\r
7421 (fCommonHists8th->GetHarmonic())->Fill(0.5,fHarmonic);\r
7422\r
7423} // end of void AliFlowAnalysisWithQCumulants::StoreHarmonic()\r
7424\r
7425\r
7426//================================================================================================================================\r
7427\r
7428\r
7429void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelationsUsingParticleWeights(TString type, TString ptOrEta) // type = RP or POI \r
7430{\r
7431 // Calculate all correlations needed for differential flow using particle weights.\r
7432 \r
7433 Int_t t = -1; // type flag \r
7434 Int_t pe = -1; // ptEta flag\r
7435 \r
7436 if(type == "RP")\r
7437 {\r
7438 t = 0;\r
7439 } else if(type == "POI")\r
7440 {\r
7441 t = 1;\r
7442 }\r
7443\r
7444 if(ptOrEta == "Pt")\r
7445 {\r
7446 pe = 0;\r
7447 } else if(ptOrEta == "Eta")\r
7448 {\r
7449 pe = 1;\r
7450 }\r
7451 \r
7452 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
7453 Double_t minPtEta[2] = {fPtMin,fEtaMin};\r
7454 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};\r
7455 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};\r
7456\r
7457 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n: \r
7458 Double_t dReQ1n1k = (*fReQ)(0,1);\r
7459 Double_t dReQ2n2k = (*fReQ)(1,2);\r
7460 Double_t dReQ1n3k = (*fReQ)(0,3);\r
7461 //Double_t dReQ4n4k = (*fReQ)(3,4);\r
7462 Double_t dImQ1n1k = (*fImQ)(0,1);\r
7463 Double_t dImQ2n2k = (*fImQ)(1,2);\r
7464 Double_t dImQ1n3k = (*fImQ)(0,3);\r
7465 //Double_t dImQ4n4k = (*fImQ)(3,4);\r
7466 \r
7467 // S^M_{p,k} (see .h file for the definition of fSMpk):\r
7468 Double_t dSM1p1k = (*fSMpk)(0,1);\r
7469 Double_t dSM1p2k = (*fSMpk)(0,2);\r
7470 Double_t dSM1p3k = (*fSMpk)(0,3);\r
7471 Double_t dSM2p1k = (*fSMpk)(1,1);\r
7472 Double_t dSM3p1k = (*fSMpk)(2,1);\r
7473 \r
7474 // looping over all bins and calculating reduced correlations: \r
7475 for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
7476 {\r
7477 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular (pt,eta) bin): \r
7478 Double_t p1n0kRe = 0.;\r
7479 Double_t p1n0kIm = 0.;\r
7480\r
7481 // number of POIs in particular (pt,eta) bin):\r
7482 Double_t mp = 0.;\r
7483\r
7484 // real and imaginary parts of q_{m*n,k}: \r
7485 // (weighted Q-vector evaluated for particles which are both RPs and POIs in particular (pt,eta) bin)\r
7486 Double_t q1n2kRe = 0.;\r
7487 Double_t q1n2kIm = 0.;\r
7488 Double_t q2n1kRe = 0.;\r
7489 Double_t q2n1kIm = 0.;\r
7490\r
7491 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation) \r
7492 Double_t s1p1k = 0.; \r
7493 Double_t s1p2k = 0.; \r
7494 Double_t s1p3k = 0.; \r
7495 \r
7496 // M0111 from Eq. (118) in QC2c (to be improved (notation))\r
7497 Double_t dM0111 = 0.;\r
7498 \r
7499 if(type == "POI")\r
7500 {\r
7501 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))\r
7502 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));\r
7503 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b)) \r
7504 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));\r
7505 \r
7506 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
7507 \r
7508 t = 1; // typeFlag = RP or POI\r
7509 \r
7510 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!)) \r
7511 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))\r
7512 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));\r
7513 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))\r
7514 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b));\r
7515 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))\r
7516 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));\r
7517 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))\r
7518 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b));\r
7519 \r
7520 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation) \r
7521 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.); \r
7522 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.); \r
7523 s1p3k = pow(fs1dEBE[2][pe][3]->GetBinContent(b)*fs1dEBE[2][pe][3]->GetBinEntries(b),1.); \r
7524 \r
7525 // M0111 from Eq. (118) in QC2c (to be improved (notation)):\r
7526 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)\r
7527 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)\r
7528 + 2.*(s1p3k-s1p2k*dSM1p1k));\r
7529 }\r
7530 else if(type == "RP")\r
7531 {\r
7532 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!)) \r
7533 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))\r
7534 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));\r
7535 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))\r
7536 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));\r
7537 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))\r
7538 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));\r
7539 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))\r
7540 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));\r
7541\r
7542 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation) \r
7543 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.); \r
7544 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.); \r
7545 s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.); \r
7546 \r
7547 // to be improved (cross-checked):\r
7548 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))\r
7549 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));\r
7550 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b)) \r
7551 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));\r
7552 \r
7553 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
7554 \r
7555 t = 0; // typeFlag = RP or POI\r
7556 \r
7557 // M0111 from Eq. (118) in QC2c (to be improved (notation)):\r
7558 dM0111 = mp*(dSM3p1k-3.*dSM1p1k*dSM1p2k+2.*dSM1p3k)\r
7559 - 3.*(s1p1k*(dSM2p1k-dSM1p2k)\r
7560 + 2.*(s1p3k-s1p2k*dSM1p1k));\r
7561 //............................................................................................... \r
7562 }\r
7563 \r
7564 // 2'-particle correlation:\r
7565 Double_t two1n1nW0W1 = 0.;\r
7566 if(mp*dSM1p1k-s1p1k)\r
7567 {\r
7568 two1n1nW0W1 = (p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k-s1p1k)\r
7569 / (mp*dSM1p1k-s1p1k);\r
7570 \r
7571 // fill profile to get <<2'>> \r
7572 fDiffFlowCorrelationsPro[t][pe][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],two1n1nW0W1,mp*dSM1p1k-s1p1k);\r
7573 // histogram to store <2'> e-b-e (needed in some other methods):\r
7574 fDiffFlowCorrelationsEBE[t][pe][0]->SetBinContent(b,two1n1nW0W1); \r
7575 fDiffFlowEventWeightsForCorrelationsEBE[t][pe][0]->SetBinContent(b,mp*dSM1p1k-s1p1k); \r
7576 } // end of if(mp*dSM1p1k-s1p1k)\r
7577 \r
7578 // 4'-particle correlation:\r
7579 Double_t four1n1n1n1nW0W1W1W1 = 0.;\r
7580 if(dM0111)\r
7581 {\r
7582 four1n1n1n1nW0W1W1W1 = ((pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)\r
7583 - q2n1kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))\r
7584 - 2.*q2n1kIm*dReQ1n1k*dImQ1n1k\r
7585 - p1n0kRe*(dReQ1n1k*dReQ2n2k+dImQ1n1k*dImQ2n2k)\r
7586 + p1n0kIm*(dImQ1n1k*dReQ2n2k-dReQ1n1k*dImQ2n2k)\r
7587 - 2.*dSM1p2k*(p1n0kRe*dReQ1n1k+p1n0kIm*dImQ1n1k)\r
7588 - 2.*(pow(dReQ1n1k,2.)+pow(dImQ1n1k,2.))*s1p1k \r
7589 + 6.*(q1n2kRe*dReQ1n1k+q1n2kIm*dImQ1n1k) \r
7590 + 1.*(q2n1kRe*dReQ2n2k+q2n1kIm*dImQ2n2k) \r
7591 + 2.*(p1n0kRe*dReQ1n3k+p1n0kIm*dImQ1n3k) \r
7592 + 2.*s1p1k*dSM1p2k \r
7593 - 6.*s1p3k) \r
7594 / dM0111; // to be improved (notation of dM0111)\r
7595 \r
7596 // fill profile to get <<4'>> \r
7597 fDiffFlowCorrelationsPro[t][pe][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],four1n1n1n1nW0W1W1W1,dM0111);\r
7598 // histogram to store <4'> e-b-e (needed in some other methods):\r
7599 fDiffFlowCorrelationsEBE[t][pe][1]->SetBinContent(b,four1n1n1n1nW0W1W1W1); \r
7600 fDiffFlowEventWeightsForCorrelationsEBE[t][pe][1]->SetBinContent(b,dM0111); \r
7601 } // end of if(dM0111)\r
7602 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
7603\r
7604} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrelationsUsingParticleWeights(TString type, TString ptOrEta); // type = RP or POI \r
7605\r
7606\r
7607//================================================================================================================================\r
7608\r
7609\r
7610void AliFlowAnalysisWithQCumulants::FillCommonControlHistograms(AliFlowEventSimple *anEvent)\r
7611{\r
7612 // Fill common control histograms.\r
7613 \r
7614 Int_t nRP = anEvent->GetEventNSelTracksRP(); // number of RPs (i.e. number of particles used to determine the reaction plane)\r
7615 fCommonHists->FillControlHistograms(anEvent); \r
7616 if(nRP>1)\r
7617 {\r
7618 fCommonHists2nd->FillControlHistograms(anEvent); \r
7619 if(nRP>3)\r
7620 {\r
7621 fCommonHists4th->FillControlHistograms(anEvent); \r
7622 if(nRP>5)\r
7623 {\r
7624 fCommonHists6th->FillControlHistograms(anEvent); \r
7625 if(nRP>7)\r
7626 {\r
7627 fCommonHists8th->FillControlHistograms(anEvent); \r
7628 } // end of if(nRP>7) \r
7629 } // end of if(nRP>5) \r
7630 } // end of if(nRP>3) \r
7631 } // end of if(nRP>1) \r
7632 \r
7633} // end of void AliFlowAnalysisWithQCumulants::FillCommonControlHistograms(AliFlowEventSimple *anEvent)\r
7634\r
7635\r
7636//================================================================================================================================\r
7637\r
7638\r
7639void AliFlowAnalysisWithQCumulants::ResetEventByEventQuantities()\r
7640{\r
7641 // Reset all event by event quantities.\r
7642 \r
7643 // integrated flow:\r
7644 fReQ->Zero();\r
7645 fImQ->Zero();\r
7646 fSMpk->Zero();\r
7647 fIntFlowCorrelationsEBE->Reset();\r
7648 fIntFlowEventWeightsForCorrelationsEBE->Reset();\r
7649 fIntFlowCorrelationsAllEBE->Reset();\r
7650 \r
7651 if(fApplyCorrectionForNUA) \r
7652 {\r
7653 for(Int_t sc=0;sc<2;sc++)\r
7654 {\r
7655 fIntFlowCorrectionTermsForNUAEBE[sc]->Reset();\r
7656 } \r
7657 }\r
7658 \r
7659 // differential flow:\r
7660 // 1D:\r
7661 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)\r
7662 {\r
7663 for(Int_t pe=0;pe<2;pe++) // 1D in pt or eta\r
7664 {\r
7665 for(Int_t m=0;m<4;m++) // multiple of harmonic\r
7666 {\r
7667 for(Int_t k=0;k<9;k++) // power of weight\r
7668 {\r
7669 if(fReRPQ1dEBE[t][pe][m][k]) fReRPQ1dEBE[t][pe][m][k]->Reset();\r
7670 if(fImRPQ1dEBE[t][pe][m][k]) fImRPQ1dEBE[t][pe][m][k]->Reset();\r
7671 } \r
7672 }\r
7673 }\r
7674 }\r
7675 \r
7676 for(Int_t t=0;t<3;t++) // type (0 = RP, 1 = POI, 2 = RP&&POI )\r
7677 { \r
7678 for(Int_t pe=0;pe<2;pe++) // 1D in pt or eta\r
7679 {\r
7680 for(Int_t k=0;k<9;k++)\r
7681 {\r
7682 if(fs1dEBE[t][pe][k]) fs1dEBE[t][pe][k]->Reset();\r
7683 }\r
7684 }\r
7685 }\r
7686\r
7687 // e-b-e reduced correlations:\r
7688 for(Int_t t=0;t<2;t++) // type (0 = RP, 1 = POI)\r
7689 { \r
7690 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
7691 {\r
7692 for(Int_t rci=0;rci<4;rci++) // reduced correlation index\r
7693 {\r
7694 if(fDiffFlowCorrelationsEBE[t][pe][rci]) fDiffFlowCorrelationsEBE[t][pe][rci]->Reset();\r
7695 if(fDiffFlowEventWeightsForCorrelationsEBE[t][pe][rci]) fDiffFlowEventWeightsForCorrelationsEBE[t][pe][rci]->Reset();\r
7696 }\r
7697 }\r
7698 }\r
7699 \r
7700 // correction terms for NUA:\r
7701 for(Int_t t=0;t<2;t++) // type (0 = RP, 1 = POI)\r
7702 { \r
7703 for(Int_t pe=0;pe<2;pe++) // pt or eta\r
7704 {\r
7705 for(Int_t sc=0;sc<2;sc++) // sin or cos\r
7706 {\r
7707 for(Int_t cti=0;cti<9;cti++) // correction term index\r
7708 {\r
7709 fDiffFlowCorrectionTermsForNUAEBE[t][pe][sc][cti]->Reset(); \r
7710 }\r
7711 }\r
7712 } \r
7713 }\r
7714 \r
7715 // 2D (pt,eta)\r
7716 if(fCalculate2DFlow)\r
7717 {\r
7718 for(Int_t t=0;t<3;t++) // type (RP, POI, POI&&RP)\r
7719 {\r
7720 for(Int_t m=0;m<4;m++) // multiple of harmonic\r
7721 {\r
7722 for(Int_t k=0;k<9;k++) // power of weight\r
7723 {\r
7724 if(fReRPQ2dEBE[t][m][k]) fReRPQ2dEBE[t][m][k]->Reset();\r
7725 if(fImRPQ2dEBE[t][m][k]) fImRPQ2dEBE[t][m][k]->Reset();\r
7726 } \r
7727 }\r
7728 }\r
7729 for(Int_t t=0;t<3;t++) // type (0 = RP, 1 = POI, 2 = RP&&POI )\r
7730 { \r
7731 for(Int_t k=0;k<9;k++)\r
7732 {\r
7733 if(fs2dEBE[t][k]) fs2dEBE[t][k]->Reset();\r
7734 }\r
7735 } \r
7736 } // end of if(fCalculate2DFlow) \r
7737\r
7738} // end of void AliFlowAnalysisWithQCumulants::ResetEventByEventQuantities();\r
7739\r
7740\r
7741//================================================================================================================================\r
7742\r
7743\r
7744void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTerms(TString type, TString ptOrEta)\r
7745{\r
7746 // Calculate correction terms for non-uniform acceptance for differential flow (sin terms).\r
7747 \r
7748 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][0][cti], where cti runs as follows:\r
7749 // 0: <<sin n(psi1)>>\r
7750 // 1: <<sin n(psi1+phi2)>>\r
7751 // 2: <<sin n(psi1+phi2-phi3)>>\r
7752 // 3: <<sin n(psi1-phi2-phi3)>>:\r
7753 // 4:\r
7754 // 5:\r
7755 // 6:\r
7756 \r
7757 // multiplicity:\r
7758 Double_t dMult = (*fSMpk)(0,0);\r
7759 \r
7760 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n: \r
7761 Double_t dReQ1n = (*fReQ)(0,0);\r
7762 Double_t dReQ2n = (*fReQ)(1,0);\r
7763 //Double_t dReQ3n = (*fReQ)(2,0);\r
7764 //Double_t dReQ4n = (*fReQ)(3,0);\r
7765 Double_t dImQ1n = (*fImQ)(0,0);\r
7766 Double_t dImQ2n = (*fImQ)(1,0);\r
7767 //Double_t dImQ3n = (*fImQ)(2,0);\r
7768 //Double_t dImQ4n = (*fImQ)(3,0);\r
7769\r
7770 Int_t t = -1; // type flag \r
7771 Int_t pe = -1; // ptEta flag\r
7772 \r
7773 if(type == "RP")\r
7774 {\r
7775 t = 0;\r
7776 } else if(type == "POI")\r
7777 {\r
7778 t = 1;\r
7779 }\r
7780\r
7781 if(ptOrEta == "Pt")\r
7782 {\r
7783 pe = 0;\r
7784 } else if(ptOrEta == "Eta")\r
7785 {\r
7786 pe = 1;\r
7787 }\r
7788 \r
7789 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
7790 Double_t minPtEta[2] = {fPtMin,fEtaMin};\r
7791 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};\r
7792 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};\r
7793\r
7794 // looping over all bins and calculating correction terms: \r
7795 for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
7796 {\r
7797 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin): \r
7798 Double_t p1n0kRe = 0.;\r
7799 Double_t p1n0kIm = 0.;\r
7800\r
7801 // number of POIs in particular pt or eta bin:\r
7802 Double_t mp = 0.;\r
7803\r
7804 // 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
7805 Double_t q1n0kRe = 0.;\r
7806 Double_t q1n0kIm = 0.;\r
7807 Double_t q2n0kRe = 0.;\r
7808 Double_t q2n0kIm = 0.;\r
7809\r
7810 // number of particles which are both RPs and POIs in particular pt or eta bin:\r
7811 Double_t mq = 0.;\r
7812 \r
7813 if(type == "POI")\r
7814 {\r
7815 // q_{m*n,0}:\r
7816 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))\r
7817 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));\r
7818 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))\r
7819 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));\r
7820 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))\r
7821 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));\r
7822 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))\r
7823 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b)); \r
7824 \r
7825 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
7826 } \r
7827 else if(type == "RP")\r
7828 {\r
7829 // q_{m*n,0}:\r
7830 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))\r
7831 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));\r
7832 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))\r
7833 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));\r
7834 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))\r
7835 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));\r
7836 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))\r
7837 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b)); \r
7838 \r
7839 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
7840 } \r
7841 if(type == "POI")\r
7842 {\r
7843 // p_{m*n,0}:\r
7844 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))\r
7845 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));\r
7846 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b)) \r
7847 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));\r
7848 \r
7849 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
7850 \r
7851 t = 1; // typeFlag = RP or POI\r
7852 }\r
7853 else if(type == "RP")\r
7854 {\r
7855 // p_{m*n,0} = q_{m*n,0}:\r
7856 p1n0kRe = q1n0kRe; \r
7857 p1n0kIm = q1n0kIm; \r
7858 \r
7859 mp = mq; \r
7860 \r
7861 t = 0; // typeFlag = RP or POI\r
7862 }\r
7863\r
7864 // <<sin n(psi1)>>:\r
7865 Double_t sinP1nPsi = 0.;\r
7866 if(mp)\r
7867 {\r
7868 sinP1nPsi = p1n0kIm/mp;\r
7869 // fill profile for <<sin n(psi1)>>:\r
7870 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi,mp);\r
7871 // histogram to store <sin n(psi1)> e-b-e (needed in some other methods):\r
7872 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][0]->SetBinContent(b,sinP1nPsi);\r
7873 } // end of if(mp) \r
7874 \r
7875 // <<sin n(psi1+phi2)>>:\r
7876 Double_t sinP1nPsiP1nPhi = 0.;\r
7877 if(mp*dMult-mq)\r
7878 {\r
7879 sinP1nPsiP1nPhi = (p1n0kRe*dImQ1n+p1n0kIm*dReQ1n-q2n0kIm)/(mp*dMult-mq);\r
7880 // fill profile for <<sin n(psi1+phi2)>>:\r
7881 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsiP1nPhi,mp*dMult-mq);\r
7882 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):\r
7883 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][1]->SetBinContent(b,sinP1nPsiP1nPhi);\r
7884 } // end of if(mp*dMult-mq) \r
7885 \r
7886 // <<sin n(psi1+phi2-phi3)>>:\r
7887 Double_t sinP1nPsi1P1nPhi2MPhi3 = 0.;\r
7888 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))\r
7889 {\r
7890 sinP1nPsi1P1nPhi2MPhi3 = (p1n0kIm*(pow(dImQ1n,2.)+pow(dReQ1n,2.)-dMult)\r
7891 - 1.*(q2n0kIm*dReQ1n-q2n0kRe*dImQ1n) \r
7892 - mq*dImQ1n+2.*q1n0kIm)\r
7893 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));\r
7894 // fill profile for <<sin n(psi1+phi2)>>:\r
7895 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1P1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));\r
7896 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):\r
7897 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][2]->SetBinContent(b,sinP1nPsi1P1nPhi2MPhi3);\r
7898 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.)) \r
7899 \r
7900 // <<sin n(psi1-phi2-phi3)>>:\r
7901 Double_t sinP1nPsi1M1nPhi2MPhi3 = 0.;\r
7902 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))\r
7903 {\r
7904 sinP1nPsi1M1nPhi2MPhi3 = (p1n0kIm*(pow(dReQ1n,2.)-pow(dImQ1n,2.))-2.*p1n0kRe*dReQ1n*dImQ1n\r
7905 - 1.*(p1n0kIm*dReQ2n-p1n0kRe*dImQ2n)\r
7906 + 2.*mq*dImQ1n-2.*q1n0kIm)\r
7907 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));\r
7908 // fill profile for <<sin n(psi1+phi2)>>:\r
7909 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1M1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));\r
7910 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):\r
7911 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][3]->SetBinContent(b,sinP1nPsi1M1nPhi2MPhi3);\r
7912 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.)) \r
7913 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
7914 \r
7915} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTerms(TString type, TString ptOrEta)\r
7916\r
7917\r
7918//================================================================================================================================\r
7919\r
7920\r
7921void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTerms(TString type, TString ptOrEta)\r
7922{\r
7923 // Calculate correction terms for non-uniform acceptance for differential flow (cos terms).\r
7924 \r
7925 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][1][cti], where cti runs as follows:\r
7926 // 0: <<cos n(psi)>>\r
7927 // 1: <<cos n(psi1+phi2)>>\r
7928 // 2: <<cos n(psi1+phi2-phi3)>>\r
7929 // 3: <<cos n(psi1-phi2-phi3)>>\r
7930 // 4:\r
7931 // 5:\r
7932 // 6:\r
7933 \r
7934 // multiplicity:\r
7935 Double_t dMult = (*fSMpk)(0,0);\r
7936 \r
7937 // real and imaginary parts of non-weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n: \r
7938 Double_t dReQ1n = (*fReQ)(0,0);\r
7939 Double_t dReQ2n = (*fReQ)(1,0);\r
7940 //Double_t dReQ3n = (*fReQ)(2,0);\r
7941 //Double_t dReQ4n = (*fReQ)(3,0);\r
7942 Double_t dImQ1n = (*fImQ)(0,0);\r
7943 Double_t dImQ2n = (*fImQ)(1,0);\r
7944 //Double_t dImQ3n = (*fImQ)(2,0);\r
7945 //Double_t dImQ4n = (*fImQ)(3,0);\r
7946\r
7947 Int_t t = -1; // type flag \r
7948 Int_t pe = -1; // ptEta flag\r
7949 \r
7950 if(type == "RP")\r
7951 {\r
7952 t = 0;\r
7953 } else if(type == "POI")\r
7954 {\r
7955 t = 1;\r
7956 }\r
7957\r
7958 if(ptOrEta == "Pt")\r
7959 {\r
7960 pe = 0;\r
7961 } else if(ptOrEta == "Eta")\r
7962 {\r
7963 pe = 1;\r
7964 }\r
7965 \r
7966 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
7967 Double_t minPtEta[2] = {fPtMin,fEtaMin};\r
7968 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};\r
7969 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};\r
7970\r
7971 // looping over all bins and calculating correction terms: \r
7972 for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
7973 {\r
7974 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin): \r
7975 Double_t p1n0kRe = 0.;\r
7976 Double_t p1n0kIm = 0.;\r
7977\r
7978 // number of POIs in particular pt or eta bin:\r
7979 Double_t mp = 0.;\r
7980\r
7981 // 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
7982 Double_t q1n0kRe = 0.;\r
7983 Double_t q1n0kIm = 0.;\r
7984 Double_t q2n0kRe = 0.;\r
7985 Double_t q2n0kIm = 0.;\r
7986\r
7987 // number of particles which are both RPs and POIs in particular pt or eta bin:\r
7988 Double_t mq = 0.;\r
7989 \r
7990 if(type == "POI")\r
7991 {\r
7992 // q_{m*n,0}:\r
7993 q1n0kRe = fReRPQ1dEBE[2][pe][0][0]->GetBinContent(fReRPQ1dEBE[2][pe][0][0]->GetBin(b))\r
7994 * fReRPQ1dEBE[2][pe][0][0]->GetBinEntries(fReRPQ1dEBE[2][pe][0][0]->GetBin(b));\r
7995 q1n0kIm = fImRPQ1dEBE[2][pe][0][0]->GetBinContent(fImRPQ1dEBE[2][pe][0][0]->GetBin(b))\r
7996 * fImRPQ1dEBE[2][pe][0][0]->GetBinEntries(fImRPQ1dEBE[2][pe][0][0]->GetBin(b));\r
7997 q2n0kRe = fReRPQ1dEBE[2][pe][1][0]->GetBinContent(fReRPQ1dEBE[2][pe][1][0]->GetBin(b))\r
7998 * fReRPQ1dEBE[2][pe][1][0]->GetBinEntries(fReRPQ1dEBE[2][pe][1][0]->GetBin(b));\r
7999 q2n0kIm = fImRPQ1dEBE[2][pe][1][0]->GetBinContent(fImRPQ1dEBE[2][pe][1][0]->GetBin(b))\r
8000 * fImRPQ1dEBE[2][pe][1][0]->GetBinEntries(fImRPQ1dEBE[2][pe][1][0]->GetBin(b)); \r
8001 \r
8002 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
8003 } \r
8004 else if(type == "RP")\r
8005 {\r
8006 // q_{m*n,0}:\r
8007 q1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))\r
8008 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));\r
8009 q1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b))\r
8010 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));\r
8011 q2n0kRe = fReRPQ1dEBE[0][pe][1][0]->GetBinContent(fReRPQ1dEBE[0][pe][1][0]->GetBin(b))\r
8012 * fReRPQ1dEBE[0][pe][1][0]->GetBinEntries(fReRPQ1dEBE[0][pe][1][0]->GetBin(b));\r
8013 q2n0kIm = fImRPQ1dEBE[0][pe][1][0]->GetBinContent(fImRPQ1dEBE[0][pe][1][0]->GetBin(b))\r
8014 * fImRPQ1dEBE[0][pe][1][0]->GetBinEntries(fImRPQ1dEBE[0][pe][1][0]->GetBin(b)); \r
8015 \r
8016 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
8017 } \r
8018 if(type == "POI")\r
8019 {\r
8020 // p_{m*n,0}:\r
8021 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))\r
8022 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));\r
8023 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b)) \r
8024 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));\r
8025 \r
8026 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
8027 \r
8028 t = 1; // typeFlag = RP or POI\r
8029 }\r
8030 else if(type == "RP")\r
8031 {\r
8032 // p_{m*n,0} = q_{m*n,0}:\r
8033 p1n0kRe = q1n0kRe; \r
8034 p1n0kIm = q1n0kIm; \r
8035 \r
8036 mp = mq; \r
8037 \r
8038 t = 0; // typeFlag = RP or POI\r
8039 }\r
8040\r
8041 // <<cos n(psi1)>>:\r
8042 Double_t cosP1nPsi = 0.;\r
8043 if(mp)\r
8044 {\r
8045 cosP1nPsi = p1n0kRe/mp;\r
8046 \r
8047 // fill profile for <<cos n(psi1)>>:\r
8048 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi,mp);\r
8049 // histogram to store <cos n(psi1)> e-b-e (needed in some other methods):\r
8050 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][0]->SetBinContent(b,cosP1nPsi);\r
8051 } // end of if(mp) \r
8052 \r
8053 // <<cos n(psi1+phi2)>>:\r
8054 Double_t cosP1nPsiP1nPhi = 0.;\r
8055 if(mp*dMult-mq)\r
8056 {\r
8057 cosP1nPsiP1nPhi = (p1n0kRe*dReQ1n-p1n0kIm*dImQ1n-q2n0kRe)/(mp*dMult-mq);\r
8058 // fill profile for <<sin n(psi1+phi2)>>:\r
8059 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsiP1nPhi,mp*dMult-mq);\r
8060 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):\r
8061 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][1]->SetBinContent(b,cosP1nPsiP1nPhi);\r
8062 } // end of if(mp*dMult-mq) \r
8063 \r
8064 // <<cos n(psi1+phi2-phi3)>>:\r
8065 Double_t cosP1nPsi1P1nPhi2MPhi3 = 0.;\r
8066 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))\r
8067 {\r
8068 cosP1nPsi1P1nPhi2MPhi3 = (p1n0kRe*(pow(dImQ1n,2.)+pow(dReQ1n,2.)-dMult)\r
8069 - 1.*(q2n0kRe*dReQ1n+q2n0kIm*dImQ1n) \r
8070 - mq*dReQ1n+2.*q1n0kRe)\r
8071 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));\r
8072 // fill profile for <<sin n(psi1+phi2)>>:\r
8073 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1P1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));\r
8074 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):\r
8075 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][2]->SetBinContent(b,cosP1nPsi1P1nPhi2MPhi3);\r
8076 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.)) \r
8077 \r
8078 // <<cos n(psi1-phi2-phi3)>>:\r
8079 Double_t cosP1nPsi1M1nPhi2MPhi3 = 0.;\r
8080 if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.))\r
8081 {\r
8082 cosP1nPsi1M1nPhi2MPhi3 = (p1n0kRe*(pow(dReQ1n,2.)-pow(dImQ1n,2.))+2.*p1n0kIm*dReQ1n*dImQ1n\r
8083 - 1.*(p1n0kRe*dReQ2n+p1n0kIm*dImQ2n) \r
8084 - 2.*mq*dReQ1n+2.*q1n0kRe)\r
8085 / (mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));\r
8086 // fill profile for <<sin n(psi1+phi2)>>:\r
8087 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1M1nPhi2MPhi3,mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.));\r
8088 // histogram to store <sin n(psi1+phi2)> e-b-e (needed in some other methods):\r
8089 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][3]->SetBinContent(b,cosP1nPsi1M1nPhi2MPhi3);\r
8090 } // end of if(mq*(dMult-1.)*(dMult-2.)+(mp-mq)*dMult*(dMult-1.)) \r
8091 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
8092 \r
8093} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTerms(TString type, TString ptOrEta)\r
8094\r
8095\r
8096//==================================================================================================================================\r
8097\r
8098\r
8099void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUADiffFlow(TString type, TString ptOrEta)\r
8100{\r
8101 // Transfer prolfiles into histogams and correctly propagate the error (to be improved: description)\r
8102 \r
8103 // to be improved: debugged - I do not correctly transfer all profiles into histos (bug appears only after merging) \r
8104 \r
8105 Int_t t = -1; // type flag \r
8106 Int_t pe = -1; // ptEta flag\r
8107 \r
8108 if(type == "RP")\r
8109 {\r
8110 t = 0;\r
8111 } else if(type == "POI")\r
8112 {\r
8113 t = 1;\r
8114 }\r
8115\r
8116 if(ptOrEta == "Pt")\r
8117 {\r
8118 pe = 0;\r
8119 } else if(ptOrEta == "Eta")\r
8120 {\r
8121 pe = 1;\r
8122 }\r
8123 \r
8124 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
8125 //Double_t minPtEta[2] = {fPtMin,fEtaMin};\r
8126 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};\r
8127 //Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};\r
8128\r
8129 for(Int_t sc=0;sc<2;sc++) // sin or cos\r
8130 {\r
8131 for(Int_t cti=0;cti<9;cti++) // correction term index\r
8132 {\r
8133 for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
8134 {\r
8135 Double_t correctionTerm = fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]->GetBinContent(b);\r
8136 fDiffFlowCorrectionTermsForNUAHist[t][pe][sc][cti]->SetBinContent(b,correctionTerm);\r
8137 // to be improved (propagate error correctly)\r
8138 // ...\r
8139 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
8140 } // correction term index\r
8141 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos\r
8142\r
8143}// end of void AliFlowAnalysisWithQCumulants::FinalizeCorrectionTermsForNUADiffFlow(TString type, TString ptOrEta)\r
8144\r
8145\r
8146//==================================================================================================================================\r
8147\r
8148\r
8149void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulantsCorrectedForNUA(TString type, TString ptOrEta)\r
8150{ \r
8151 // Calculate generalized differential flow Q-cumulants (corrected for non-uniform acceptance)\r
8152 \r
8153 Int_t typeFlag = -1;\r
8154 Int_t ptEtaFlag = -1;\r
8155\r
8156 if(type == "RP")\r
8157 {\r
8158 typeFlag = 0;\r
8159 } else if(type == "POI")\r
8160 {\r
8161 typeFlag = 1;\r
8162 } \r
8163 \r
8164 if(ptOrEta == "Pt")\r
8165 {\r
8166 ptEtaFlag = 0;\r
8167 } else if(ptOrEta == "Eta")\r
8168 {\r
8169 ptEtaFlag = 1;\r
8170 } \r
8171 \r
8172 // shortcuts:\r
8173 Int_t t = typeFlag;\r
8174 Int_t pe = ptEtaFlag;\r
8175 \r
8176 // common:\r
8177 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
8178 \r
8179 // 2-particle correlation:\r
8180 Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>\r
8181 // sin term coming from integrated flow: \r
8182 Double_t sinP1nPhi = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(1); // <<sin(n*phi1)>>\r
8183 Double_t sinP1nPhi1P1nPhi2 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(2); // <<sin(n*(phi1+phi2))>>\r
8184 Double_t sinP1nPhi1M1nPhi2M1nPhi3 = fIntFlowCorrectionTermsForNUAHist[0]->GetBinContent(3); // <<sin(n*(phi1-phi2-phi3))>>\r
8185 // cos term coming from integrated flow: \r
8186 Double_t cosP1nPhi = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(1); // <<cos(n*phi1)>>\r
8187 Double_t cosP1nPhi1P1nPhi2 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(2); // <<cos(n*(phi1+phi2))>>\r
8188 Double_t cosP1nPhi1M1nPhi2M1nPhi3 = fIntFlowCorrectionTermsForNUAHist[1]->GetBinContent(3); // <<cos(n*(phi1-phi2-phi3))>>\r
8189\r
8190 for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
8191 {\r
8192 Double_t twoPrime = fDiffFlowCorrelationsHist[t][pe][0]->GetBinContent(b); // <<2'>>\r
8193 Double_t fourPrime = fDiffFlowCorrelationsHist[t][pe][1]->GetBinContent(b); // <<4'>>\r
8194 Double_t sinP1nPsi = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][0]->GetBinContent(b); // <<sin n(Psi)>> \r
8195 Double_t cosP1nPsi = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][0]->GetBinContent(b); // <<cos n(Psi)>> \r
8196 Double_t sinP1nPsi1P1nPhi2 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][1]->GetBinContent(b); // <<sin n(psi1+phi2)>> \r
8197 Double_t cosP1nPsi1P1nPhi2 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][1]->GetBinContent(b); // <<cos n(psi1+phi2)>> \r
8198 Double_t sinP1nPsi1P1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][2]->GetBinContent(b); // <<sin n(psi1+phi2-phi3)>> \r
8199 Double_t cosP1nPsi1P1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][2]->GetBinContent(b); // <<cos n(psi1+phi2-phi3)>> \r
8200 Double_t sinP1nPsi1M1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][0][3]->GetBinContent(b); // <<sin n(psi1-phi2-phi3)>> \r
8201 Double_t cosP1nPsi1M1nPhi2M1nPhi3 = fDiffFlowCorrectionTermsForNUAHist[t][pe][1][3]->GetBinContent(b); // <<cos n(psi1-phi2-phi3)>> \r
8202 // generalized QC{2'}:\r
8203 Double_t qc2Prime = twoPrime - sinP1nPsi*sinP1nPhi - cosP1nPsi*cosP1nPhi;\r
8204 fDiffFlowCumulants[t][pe][0]->SetBinContent(b,qc2Prime);\r
8205 // generalized QC{4'}:\r
8206 Double_t qc4Prime = fourPrime-2.*twoPrime*two\r
8207 - cosP1nPsi*cosP1nPhi1M1nPhi2M1nPhi3\r
8208 + sinP1nPsi*sinP1nPhi1M1nPhi2M1nPhi3\r
8209 - cosP1nPhi*cosP1nPsi1M1nPhi2M1nPhi3\r
8210 + sinP1nPhi*sinP1nPsi1M1nPhi2M1nPhi3\r
8211 - 2.*cosP1nPhi*cosP1nPsi1P1nPhi2M1nPhi3\r
8212 - 2.*sinP1nPhi*sinP1nPsi1P1nPhi2M1nPhi3\r
8213 - cosP1nPsi1P1nPhi2*cosP1nPhi1P1nPhi2\r
8214 - sinP1nPsi1P1nPhi2*sinP1nPhi1P1nPhi2\r
8215 + 2.*cosP1nPhi1P1nPhi2*(cosP1nPsi*cosP1nPhi-sinP1nPsi*sinP1nPhi)\r
8216 + 2.*sinP1nPhi1P1nPhi2*(cosP1nPsi*sinP1nPhi+sinP1nPsi*cosP1nPhi)\r
8217 + 4.*two*(cosP1nPsi*cosP1nPhi+sinP1nPsi*sinP1nPhi)\r
8218 + 2.*cosP1nPsi1P1nPhi2*(pow(cosP1nPhi,2.)-pow(sinP1nPhi,2.))\r
8219 + 4.*sinP1nPsi1P1nPhi2*cosP1nPhi*sinP1nPhi\r
8220 + 4.*twoPrime*(pow(cosP1nPhi,2.)+pow(sinP1nPhi,2.))\r
8221 - 6.*(pow(cosP1nPhi,2.)-pow(sinP1nPhi,2.)) \r
8222 * (cosP1nPsi*cosP1nPhi-sinP1nPsi*sinP1nPhi)\r
8223 - 12.*cosP1nPhi*sinP1nPhi\r
8224 * (sinP1nPsi*cosP1nPhi+cosP1nPsi*sinP1nPhi);\r
8225 fDiffFlowCumulants[t][pe][1]->SetBinContent(b,qc4Prime); \r
8226 } // end of for(Int_t p=1;p<=fnBinsPt;p++)\r
8227 \r
8228} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCumulantsCorrectedForNUA(TString type, TString ptOrEta)\r
8229\r
8230\r
8231//==================================================================================================================================\r
8232 \r
8233\r
8234void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectedForNUA(TString type, TString ptOrEta)\r
8235{\r
8236 // Calculate differential flow corrected for non-uniform acceptance.\r
8237 \r
8238 // to be improved (rewritten completely)\r
8239 \r
8240 Int_t typeFlag = -1;\r
8241 Int_t ptEtaFlag = -1;\r
8242\r
8243 if(type == "RP")\r
8244 {\r
8245 typeFlag = 0;\r
8246 } else if(type == "POI")\r
8247 {\r
8248 typeFlag = 1;\r
8249 } \r
8250 \r
8251 if(ptOrEta == "Pt")\r
8252 {\r
8253 ptEtaFlag = 0;\r
8254 } else if(ptOrEta == "Eta")\r
8255 {\r
8256 ptEtaFlag = 1;\r
8257 } \r
8258 \r
8259 // shortcuts:\r
8260 Int_t t = typeFlag;\r
8261 Int_t pe = ptEtaFlag;\r
8262 \r
8263 // common:\r
8264 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
8265 \r
8266 // to be improved: access here generalized QC{2} and QC{4} instead: \r
8267 Double_t dV2 = fIntFlow->GetBinContent(1); \r
8268 Double_t dV4 = fIntFlow->GetBinContent(2); \r
8269 \r
8270 // loop over pt or eta bins:\r
8271 for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
8272 {\r
8273 // generalized QC{2'}:\r
8274 Double_t gQC2Prime = fDiffFlowCumulants[t][pe][0]->GetBinContent(b);\r
8275 // v'{2}:\r
8276 if(dV2>0)\r
8277 { \r
8278 Double_t v2Prime = gQC2Prime/dV2;\r
8279 fDiffFlow[t][pe][0]->SetBinContent(b,v2Prime); \r
8280 } \r
8281 // generalized QC{4'}:\r
8282 Double_t gQC4Prime = fDiffFlowCumulants[t][pe][1]->GetBinContent(b);\r
8283 // v'{4}:\r
8284 if(dV4>0)\r
8285 { \r
8286 Double_t v4Prime = -gQC4Prime/pow(dV4,3.);\r
8287 fDiffFlow[t][pe][1]->SetBinContent(b,v4Prime); \r
8288 } \r
8289 } // end of for(Int_t b=1;b<=fnBinsPtEta[pe];b++)\r
8290 \r
8291} // end of void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectedForNUA(TString type, TString ptOrEta); \r
8292\r
8293\r
8294//==================================================================================================================================\r
8295\r
8296\r
8297void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoops(AliFlowEventSimple* anEvent)\r
8298{\r
8299 // Evaluate with nested loops multiparticle correlations for integrated flow (without using the particle weights). \r
8300\r
8301 // Remark: Results are stored in profile fIntFlowDirectCorrelations whose binning is organized as follows:\r
8302 // \r
8303 // 1st bin: <2>_{1n|1n} = two1n1n = cos(n*(phi1-phi2))>\r
8304 // 2nd bin: <2>_{2n|2n} = two2n2n = cos(2n*(phi1-phi2))>\r
8305 // 3rd bin: <2>_{3n|3n} = two3n3n = cos(3n*(phi1-phi2))> \r
8306 // 4th bin: <2>_{4n|4n} = two4n4n = cos(4n*(phi1-phi2))>\r
8307 // 5th bin: ---- EMPTY ----\r
8308 // 6th bin: <3>_{2n|1n,1n} = three2n1n1n = <cos(n*(2.*phi1-phi2-phi3))>\r
8309 // 7th bin: <3>_{3n|2n,1n} = three3n2n1n = <cos(n*(3.*phi1-2.*phi2-phi3))>\r
8310 // 8th bin: <3>_{4n|2n,2n} = three4n2n2n = <cos(n*(4.*phi1-2.*phi2-2.*phi3))>\r
8311 // 9th bin: <3>_{4n|3n,1n} = three4n3n1n = <cos(n*(4.*phi1-3.*phi2-phi3))>\r
8312 // 10th bin: ---- EMPTY ----\r
8313 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1n = <cos(n*(phi1+phi2-phi3-phi4))>\r
8314 // 12th bin: <4>_{2n,1n|2n,1n} = four2n1n2n1n = <cos(2.*n*(phi1+phi2-phi3-phi4))>\r
8315 // 13th bin: <4>_{2n,2n|2n,2n} = four2n2n2n2n = <cos(n*(2.*phi1+phi2-2.*phi3-phi4))>\r
8316 // 14th bin: <4>_{3n|1n,1n,1n} = four3n1n1n1n = <cos(n*(3.*phi1-phi2-phi3-phi4))> \r
8317 // 15th bin: <4>_{3n,1n|3n,1n} = four3n1n3n1n = <cos(n*(4.*phi1-2.*phi2-phi3-phi4))>\r
8318 // 16th bin: <4>_{3n,1n|2n,2n} = four3n1n2n2n = <cos(n*(3.*phi1+phi2-2.*phi3-2.*phi4))>\r
8319 // 17th bin: <4>_{4n|2n,1n,1n} = four4n2n1n1n = <cos(n*(3.*phi1+phi2-3.*phi3-phi4))> \r
8320 // 18th bin: ---- EMPTY ----\r
8321 // 19th bin: <5>_{2n|1n,1n,1n,1n} = five2n1n1n1n1n = <cos(n*(2.*phi1+phi2-phi3-phi4-phi5))>\r
8322 // 20th bin: <5>_{2n,2n|2n,1n,1n} = five2n2n2n1n1n = <cos(n*(2.*phi1+2.*phi2-2.*phi3-phi4-phi5))>\r
8323 // 21st bin: <5>_{3n,1n|2n,1n,1n} = five3n1n2n1n1n = <cos(n*(3.*phi1+phi2-2.*phi3-phi4-phi5))>\r
8324 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = five4n1n1n1n1n = <cos(n*(4.*phi1-phi2-phi3-phi4-phi5))>\r
8325 // 23rd bin: ---- EMPTY ----\r
8326 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = six1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3-phi4-phi5-phi6))>\r
8327 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = six2n1n1n2n1n1n = <cos(n*(2.*phi1+2.*phi2-phi3-phi4-phi5-phi6))>\r
8328 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = six2n2n1n1n1n1n = <cos(n*(3.*phi1+phi2-phi3-phi4-phi5-phi6))>\r
8329 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = six3n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-2.*phi4-phi5-phi6))>\r
8330 // 28th bin: ---- EMPTY ----\r
8331 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = seven2n1n1n1n1n1n1n = <cos(n*(2.*phi1+phi2+phi3-phi4-phi5-phi6-phi7))>\r
8332 // 30th bin: ---- EMPTY ----\r
8333 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = eight1n1n1n1n1n1n1n1n = <cos(n*(phi1+phi2+phi3+phi4-phi5-phi6-phi7-phi8))>\r
8334 \r
8335 Int_t nPrim = anEvent->NumberOfTracks(); \r
8336 AliFlowTrackSimple *aftsTrack = NULL; \r
8337 Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.; \r
8338 Int_t n = fHarmonic; \r
8339 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)\r
8340 Double_t dMult = (*fSMpk)(0,0);\r
8341 cout<<endl;\r
8342 cout<<"Multiparticle correlations: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;\r
8343 if(dMult<2)\r
8344 {\r
8345 cout<<"... skipping this event (multiplicity too low) ..."<<endl;\r
8346 } else if (dMult>fMaxAllowedMultiplicity)\r
8347 {\r
8348 cout<<"... skipping this event (multiplicity too high) ..."<<endl;\r
8349 } else \r
8350 { \r
8351 cout<<"... evaluating nested loops (without using particle weights)..."<<endl;\r
8352 } \r
8353 \r
8354 // 2-particle correlations: \r
8355 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)\r
8356 {\r
8357 for(Int_t i1=0;i1<nPrim;i1++)\r
8358 {\r
8359 aftsTrack=anEvent->GetTrack(i1);\r
8360 if(!(aftsTrack->InRPSelection())) continue;\r
8361 phi1=aftsTrack->Phi(); \r
8362 for(Int_t i2=0;i2<nPrim;i2++)\r
8363 {\r
8364 if(i2==i1)continue;\r
8365 aftsTrack=anEvent->GetTrack(i2);\r
8366 if(!(aftsTrack->InRPSelection())) continue;\r
8367 phi2=aftsTrack->Phi();\r
8368 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;\r
8369 // fill the profile with 2-p correlations: \r
8370 fIntFlowDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),1.); // <cos(n*(phi1-phi2))>\r
8371 fIntFlowDirectCorrelations->Fill(1.5,cos(2.*n*(phi1-phi2)),1.); // <cos(2n*(phi1-phi2))>\r
8372 fIntFlowDirectCorrelations->Fill(2.5,cos(3.*n*(phi1-phi2)),1.); // <cos(3n*(phi1-phi2))>\r
8373 fIntFlowDirectCorrelations->Fill(3.5,cos(4.*n*(phi1-phi2)),1.); // <cos(4n*(phi1-phi2))> \r
8374 } // end of for(Int_t i2=0;i2<nPrim;i2++)\r
8375 } // end of for(Int_t i1=0;i1<nPrim;i1++)\r
8376 } // end of if(nPrim>=2)\r
8377 \r
8378 // 3-particle correlations: \r
8379 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)\r
8380 {\r
8381 for(Int_t i1=0;i1<nPrim;i1++)\r
8382 {\r
8383 aftsTrack=anEvent->GetTrack(i1);\r
8384 if(!(aftsTrack->InRPSelection())) continue;\r
8385 phi1=aftsTrack->Phi();\r
8386 for(Int_t i2=0;i2<nPrim;i2++)\r
8387 {\r
8388 if(i2==i1)continue;\r
8389 aftsTrack=anEvent->GetTrack(i2);\r
8390 if(!(aftsTrack->InRPSelection())) continue;\r
8391 phi2=aftsTrack->Phi();\r
8392 for(Int_t i3=0;i3<nPrim;i3++)\r
8393 {\r
8394 if(i3==i1||i3==i2)continue;\r
8395 aftsTrack=anEvent->GetTrack(i3);\r
8396 if(!(aftsTrack->InRPSelection())) continue;\r
8397 phi3=aftsTrack->Phi();\r
8398 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;\r
8399 // fill the profile with 3-p correlations: \r
8400 fIntFlowDirectCorrelations->Fill(5.,cos(2.*n*phi1-n*(phi2+phi3)),1.); //<3>_{2n|nn,n}\r
8401 fIntFlowDirectCorrelations->Fill(6.,cos(3.*n*phi1-2.*n*phi2-n*phi3),1.); //<3>_{3n|2n,n}\r
8402 fIntFlowDirectCorrelations->Fill(7.,cos(4.*n*phi1-2.*n*phi2-2.*n*phi3),1.); //<3>_{4n|2n,2n}\r
8403 fIntFlowDirectCorrelations->Fill(8.,cos(4.*n*phi1-3.*n*phi2-n*phi3),1.); //<3>_{4n|3n,n}\r
8404 } // end of for(Int_t i3=0;i3<nPrim;i3++)\r
8405 } // end of for(Int_t i2=0;i2<nPrim;i2++)\r
8406 } // end of for(Int_t i1=0;i1<nPrim;i1++)\r
8407 } // end of if(nPrim>=3)\r
8408\r
8409 // 4-particle correlations:\r
8410 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)\r
8411 { \r
8412 for(Int_t i1=0;i1<nPrim;i1++)\r
8413 { \r
8414 aftsTrack=anEvent->GetTrack(i1);\r
8415 if(!(aftsTrack->InRPSelection())) continue;\r
8416 phi1=aftsTrack->Phi();\r
8417 for(Int_t i2=0;i2<nPrim;i2++)\r
8418 {\r
8419 if(i2==i1)continue;\r
8420 aftsTrack=anEvent->GetTrack(i2);\r
8421 if(!(aftsTrack->InRPSelection())) continue;\r
8422 phi2=aftsTrack->Phi();\r
8423 for(Int_t i3=0;i3<nPrim;i3++)\r
8424 {\r
8425 if(i3==i1||i3==i2)continue;\r
8426 aftsTrack=anEvent->GetTrack(i3);\r
8427 if(!(aftsTrack->InRPSelection())) continue;\r
8428 phi3=aftsTrack->Phi();\r
8429 for(Int_t i4=0;i4<nPrim;i4++)\r
8430 {\r
8431 if(i4==i1||i4==i2||i4==i3)continue;\r
8432 aftsTrack=anEvent->GetTrack(i4);\r
8433 if(!(aftsTrack->InRPSelection())) continue;\r
8434 phi4=aftsTrack->Phi();\r
8435 if(nPrim==4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush;\r
8436 // fill the profile with 4-p correlations: \r
8437 fIntFlowDirectCorrelations->Fill(10.,cos(n*phi1+n*phi2-n*phi3-n*phi4),1.); // <4>_{n,n|n,n} \r
8438 fIntFlowDirectCorrelations->Fill(11.,cos(2.*n*phi1+n*phi2-2.*n*phi3-n*phi4),1.); // <4>_{2n,n|2n,n}\r
8439 fIntFlowDirectCorrelations->Fill(12.,cos(2.*n*phi1+2*n*phi2-2.*n*phi3-2.*n*phi4),1.); // <4>_{2n,2n|2n,2n}\r
8440 fIntFlowDirectCorrelations->Fill(13.,cos(3.*n*phi1-n*phi2-n*phi3-n*phi4),1.); // <4>_{3n|n,n,n}\r
8441 fIntFlowDirectCorrelations->Fill(14.,cos(3.*n*phi1+n*phi2-3.*n*phi3-n*phi4),1.); // <4>_{3n,n|3n,n} \r
8442 fIntFlowDirectCorrelations->Fill(15.,cos(3.*n*phi1+n*phi2-2.*n*phi3-2.*n*phi4),1.); // <4>_{3n,n|2n,2n}\r
8443 fIntFlowDirectCorrelations->Fill(16.,cos(4.*n*phi1-2.*n*phi2-n*phi3-n*phi4),1.); // <4>_{4n|2n,n,n} \r
8444 } // end of for(Int_t i4=0;i4<nPrim;i4++) \r
8445 } // end of for(Int_t i3=0;i3<nPrim;i3++)\r
8446 } // end of for(Int_t i2=0;i2<nPrim;i2++)\r
8447 } // end of for(Int_t i1=0;i1<nPrim;i1++)\r
8448 } // end of if(nPrim>=)\r
8449\r
8450 // 5-particle correlations: \r
8451 if(nPrim>=5 && nPrim<=fMaxAllowedMultiplicity)\r
8452 {\r
8453 for(Int_t i1=0;i1<nPrim;i1++)\r
8454 {\r
8455 aftsTrack=anEvent->GetTrack(i1);\r
8456 if(!(aftsTrack->InRPSelection())) continue; \r
8457 phi1=aftsTrack->Phi();\r
8458 for(Int_t i2=0;i2<nPrim;i2++)\r
8459 {\r
8460 if(i2==i1)continue;\r
8461 aftsTrack=anEvent->GetTrack(i2);\r
8462 if(!(aftsTrack->InRPSelection())) continue;\r
8463 phi2=aftsTrack->Phi();\r
8464 for(Int_t i3=0;i3<nPrim;i3++)\r
8465 {\r
8466 if(i3==i1||i3==i2)continue;\r
8467 aftsTrack=anEvent->GetTrack(i3);\r
8468 if(!(aftsTrack->InRPSelection())) continue;\r
8469 phi3=aftsTrack->Phi();\r
8470 for(Int_t i4=0;i4<nPrim;i4++)\r
8471 {\r
8472 if(i4==i1||i4==i2||i4==i3)continue;\r
8473 aftsTrack=anEvent->GetTrack(i4);\r
8474 if(!(aftsTrack->InRPSelection())) continue;\r
8475 phi4=aftsTrack->Phi();\r
8476 for(Int_t i5=0;i5<nPrim;i5++)\r
8477 {\r
8478 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;\r
8479 aftsTrack=anEvent->GetTrack(i5);\r
8480 if(!(aftsTrack->InRPSelection())) continue;\r
8481 phi5=aftsTrack->Phi();\r
8482 if(nPrim==5) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<"\r"<<flush;\r
8483 // fill the profile with 5-p correlations: \r
8484 fIntFlowDirectCorrelations->Fill(18.,cos(2.*n*phi1+n*phi2-n*phi3-n*phi4-n*phi5),1.); //<5>_{2n,n|n,n,n}\r
8485 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
8486 fIntFlowDirectCorrelations->Fill(20.,cos(3.*n*phi1+n*phi2-2.*n*phi3-n*phi4-n*phi5),1.); //<5>_{3n,n|2n,n,n}\r
8487 fIntFlowDirectCorrelations->Fill(21.,cos(4.*n*phi1-n*phi2-n*phi3-n*phi4-n*phi5),1.); //<5>_{4n|n,n,n,n}\r
8488 } // end of for(Int_t i5=0;i5<nPrim;i5++)\r
8489 } // end of for(Int_t i4=0;i4<nPrim;i4++) \r
8490 } // end of for(Int_t i3=0;i3<nPrim;i3++)\r
8491 } // end of for(Int_t i2=0;i2<nPrim;i2++)\r
8492 } // end of for(Int_t i1=0;i1<nPrim;i1++)\r
8493 } // end of if(nPrim>=5)\r
8494 \r
8495 // 6-particle correlations:\r
8496 if(nPrim>=6 && nPrim<=fMaxAllowedMultiplicity)\r
8497 {\r
8498 for(Int_t i1=0;i1<nPrim;i1++)\r
8499 {\r
8500 aftsTrack=anEvent->GetTrack(i1);\r
8501 if(!(aftsTrack->InRPSelection())) continue;\r
8502 phi1=aftsTrack->Phi();\r
8503 for(Int_t i2=0;i2<nPrim;i2++)\r
8504 {\r
8505 if(i2==i1)continue;\r
8506 aftsTrack=anEvent->GetTrack(i2);\r
8507 if(!(aftsTrack->InRPSelection())) continue;\r
8508 phi2=aftsTrack->Phi();\r
8509 for(Int_t i3=0;i3<nPrim;i3++)\r
8510 {\r
8511 if(i3==i1||i3==i2)continue;\r
8512 aftsTrack=anEvent->GetTrack(i3);\r
8513 if(!(aftsTrack->InRPSelection())) continue;\r
8514 phi3=aftsTrack->Phi();\r
8515 for(Int_t i4=0;i4<nPrim;i4++)\r
8516 {\r
8517 if(i4==i1||i4==i2||i4==i3)continue;\r
8518 aftsTrack=anEvent->GetTrack(i4);\r
8519 if(!(aftsTrack->InRPSelection())) continue;\r
8520 phi4=aftsTrack->Phi();\r
8521 for(Int_t i5=0;i5<nPrim;i5++)\r
8522 {\r
8523 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;\r
8524 aftsTrack=anEvent->GetTrack(i5);\r
8525 if(!(aftsTrack->InRPSelection())) continue;\r
8526 phi5=aftsTrack->Phi();\r
8527 for(Int_t i6=0;i6<nPrim;i6++)\r
8528 {\r
8529 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;\r
8530 aftsTrack=anEvent->GetTrack(i6);\r
8531 if(!(aftsTrack->InRPSelection())) continue;\r
8532 phi6=aftsTrack->Phi(); \r
8533 if(nPrim==6) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<"\r"<<flush;\r
8534 // fill the profile with 6-p correlations: \r
8535 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
8536 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
8537 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
8538 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
8539 } // end of for(Int_t i6=0;i6<nPrim;i6++)\r
8540 } // end of for(Int_t i5=0;i5<nPrim;i5++)\r
8541 } // end of for(Int_t i4=0;i4<nPrim;i4++)\r
8542 } // end of for(Int_t i3=0;i3<nPrim;i3++)\r
8543 } // end of for(Int_t i2=0;i2<nPrim;i2++)\r
8544 } // end of for(Int_t i1=0;i1<nPrim;i1++)\r
8545 } // end of if(nPrim>=6)\r
8546 \r
8547 // 7-particle correlations:\r
8548 if(nPrim>=7 && nPrim<=fMaxAllowedMultiplicity)\r
8549 {\r
8550 for(Int_t i1=0;i1<nPrim;i1++)\r
8551 { \r
8552 aftsTrack=anEvent->GetTrack(i1);\r
8553 if(!(aftsTrack->InRPSelection())) continue;\r
8554 phi1=aftsTrack->Phi();\r
8555 for(Int_t i2=0;i2<nPrim;i2++)\r
8556 {\r
8557 if(i2==i1)continue;\r
8558 aftsTrack=anEvent->GetTrack(i2);\r
8559 if(!(aftsTrack->InRPSelection())) continue;\r
8560 phi2=aftsTrack->Phi();\r
8561 for(Int_t i3=0;i3<nPrim;i3++)\r
8562 {\r
8563 if(i3==i1||i3==i2)continue;\r
8564 aftsTrack=anEvent->GetTrack(i3);\r
8565 if(!(aftsTrack->InRPSelection())) continue;\r
8566 phi3=aftsTrack->Phi();\r
8567 for(Int_t i4=0;i4<nPrim;i4++)\r
8568 {\r
8569 if(i4==i1||i4==i2||i4==i3)continue;\r
8570 aftsTrack=anEvent->GetTrack(i4);\r
8571 if(!(aftsTrack->InRPSelection())) continue;\r
8572 phi4=aftsTrack->Phi();\r
8573 for(Int_t i5=0;i5<nPrim;i5++)\r
8574 {\r
8575 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;\r
8576 aftsTrack=anEvent->GetTrack(i5);\r
8577 if(!(aftsTrack->InRPSelection())) continue;\r
8578 phi5=aftsTrack->Phi();\r
8579 for(Int_t i6=0;i6<nPrim;i6++)\r
8580 {\r
8581 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;\r
8582 aftsTrack=anEvent->GetTrack(i6);\r
8583 if(!(aftsTrack->InRPSelection())) continue;\r
8584 phi6=aftsTrack->Phi(); \r
8585 for(Int_t i7=0;i7<nPrim;i7++)\r
8586 {\r
8587 if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;\r
8588 aftsTrack=anEvent->GetTrack(i7);\r
8589 if(!(aftsTrack->InRPSelection())) continue;\r
8590 phi7=aftsTrack->Phi(); \r
8591 if(nPrim==7) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<" "<<i7<<"\r"<<flush;\r
8592 // fill the profile with 7-p correlation: \r
8593 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
8594 } // end of for(Int_t i7=0;i7<nPrim;i7++)\r
8595 } // end of for(Int_t i6=0;i6<nPrim;i6++) \r
8596 } // end of for(Int_t i5=0;i5<nPrim;i5++)\r
8597 } // end of for(Int_t i4=0;i4<nPrim;i4++) \r
8598 } // end of for(Int_t i3=0;i3<nPrim;i3++)\r
8599 } // end of for(Int_t i2=0;i2<nPrim;i2++)\r
8600 } // end of for(Int_t i1=0;i1<nPrim;i1++)\r
8601 } // end of if(nPrim>=7)\r
8602 \r
8603 // 8-particle correlations:\r
8604 if(nPrim>=8 && nPrim<=fMaxAllowedMultiplicity)\r
8605 {\r
8606 for(Int_t i1=0;i1<nPrim;i1++)\r
8607 {\r
8608 aftsTrack=anEvent->GetTrack(i1);\r
8609 if(!(aftsTrack->InRPSelection())) continue;\r
8610 phi1=aftsTrack->Phi();\r
8611 for(Int_t i2=0;i2<nPrim;i2++)\r
8612 {\r
8613 if(i2==i1)continue;\r
8614 aftsTrack=anEvent->GetTrack(i2);\r
8615 if(!(aftsTrack->InRPSelection())) continue;\r
8616 phi2=aftsTrack->Phi();\r
8617 for(Int_t i3=0;i3<nPrim;i3++)\r
8618 {\r
8619 if(i3==i1||i3==i2)continue;\r
8620 aftsTrack=anEvent->GetTrack(i3);\r
8621 if(!(aftsTrack->InRPSelection())) continue;\r
8622 phi3=aftsTrack->Phi();\r
8623 for(Int_t i4=0;i4<nPrim;i4++)\r
8624 {\r
8625 if(i4==i1||i4==i2||i4==i3)continue;\r
8626 aftsTrack=anEvent->GetTrack(i4);\r
8627 if(!(aftsTrack->InRPSelection())) continue;\r
8628 phi4=aftsTrack->Phi();\r
8629 for(Int_t i5=0;i5<nPrim;i5++)\r
8630 {\r
8631 if(i5==i1||i5==i2||i5==i3||i5==i4)continue;\r
8632 aftsTrack=anEvent->GetTrack(i5);\r
8633 if(!(aftsTrack->InRPSelection())) continue;\r
8634 phi5=aftsTrack->Phi();\r
8635 for(Int_t i6=0;i6<nPrim;i6++)\r
8636 {\r
8637 if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5)continue;\r
8638 aftsTrack=anEvent->GetTrack(i6);\r
8639 if(!(aftsTrack->InRPSelection())) continue;\r
8640 phi6=aftsTrack->Phi();\r
8641 for(Int_t i7=0;i7<nPrim;i7++)\r
8642 {\r
8643 if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6)continue;\r
8644 aftsTrack=anEvent->GetTrack(i7);\r
8645 if(!(aftsTrack->InRPSelection())) continue;\r
8646 phi7=aftsTrack->Phi();\r
8647 for(Int_t i8=0;i8<nPrim;i8++)\r
8648 {\r
8649 if(i8==i1||i8==i2||i8==i3||i8==i4||i8==i5||i8==i6||i8==i7)continue;\r
8650 aftsTrack=anEvent->GetTrack(i8);\r
8651 if(!(aftsTrack->InRPSelection())) continue;\r
8652 phi8=aftsTrack->Phi();\r
8653 cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<i5<<" "<<i6<<" "<<i7<<" "<<i8<<"\r"<<flush;\r
8654 // fill the profile with 8-p correlation: \r
8655 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
8656 } // end of for(Int_t i8=0;i8<nPrim;i8++)\r
8657 } // end of for(Int_t i7=0;i7<nPrim;i7++) \r
8658 } // end of for(Int_t i6=0;i6<nPrim;i6++) \r
8659 } // end of for(Int_t i5=0;i5<nPrim;i5++)\r
8660 } // end of for(Int_t i4=0;i4<nPrim;i4++) \r
8661 } // end of for(Int_t i3=0;i3<nPrim;i3++)\r
8662 } // end of for(Int_t i2=0;i2<nPrim;i2++)\r
8663 } // end of for(Int_t i1=0;i1<nPrim;i1++)\r
8664 } // end of if(nPrim>=8)\r
8665 \r
8666 cout<<endl;\r
8667\r
8668} // end of AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoops(AliFlowEventSimple* anEvent)\r
8669\r
8670\r
8671//==================================================================================================================================\r
8672\r
8673\r
8674void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrelations()\r
8675{\r
8676 // Cross-check results for multiparticle correlations needed for int. flow: results from Q-vectors vs results from nested loops.\r
8677\r
8678 cout<<endl;\r
8679 cout<<endl;\r
8680 cout<<" *****************************************"<<endl;\r
8681 cout<<" **** cross-checking the correlations ****"<<endl;\r
8682 cout<<" **** for integrated flow ****"<<endl;\r
8683 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))\r
8684 {\r
8685 cout<<" **** (particle weights not used) ****"<<endl;\r
8686 } else\r
8687 {\r
8688 cout<<" **** (particle weights used) ****"<<endl;\r
8689 } \r
8690 cout<<" *****************************************"<<endl;\r
8691 cout<<endl;\r
8692 cout<<endl;\r
8693\r
8694 Int_t ciMax = 32; // to be improved (removed eventually when I calculate 6th and 8th order with particle weights)\r
8695 \r
8696 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)\r
8697 {\r
8698 ciMax = 11;\r
8699 }\r
8700\r
8701 for(Int_t ci=1;ci<=ciMax;ci++)\r
8702 {\r
8703 if(strcmp((fIntFlowCorrelationsAllPro->GetXaxis())->GetBinLabel(ci), "") == 0) continue; // to be improved (access finalized histogram here)\r
8704 cout<<(fIntFlowCorrelationsAllPro->GetXaxis())->GetBinLabel(ci)<<":"<<endl; // to be improved (access finalized histogram here)\r
8705 cout<<"from Q-vectors = "<<fIntFlowCorrelationsAllPro->GetBinContent(ci)<<endl; // to be improved (access finalized histogram here)\r
8706 cout<<"from nested loops = "<<fIntFlowDirectCorrelations->GetBinContent(ci)<<endl;\r
8707 cout<<endl;\r
8708 }\r
8709 \r
8710} // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrelations()\r
8711\r
8712\r
8713//================================================================================================================================\r
8714\r
8715\r
8716void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrectionTermsForNUA()\r
8717{\r
8718 // Cross-check results for corrections terms for non-uniform acceptance needed for int. flow: results from Q-vectors vs results from nested loops.\r
8719\r
8720 cout<<endl;\r
8721 cout<<endl;\r
8722 cout<<" *********************************************"<<endl;\r
8723 cout<<" **** cross-checking the correction terms ****"<<endl;\r
8724 cout<<" **** for non-uniform acceptance relevant ****"<<endl;\r
8725 cout<<" **** for integrated flow ****"<<endl;\r
8726 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))\r
8727 {\r
8728 cout<<" **** (particle weights not used) ****"<<endl;\r
8729 } else\r
8730 {\r
8731 cout<<" **** (particle weights used) ****"<<endl;\r
8732 } \r
8733 cout<<" *********************************************"<<endl;\r
8734 cout<<endl;\r
8735 cout<<endl;\r
8736\r
8737 for(Int_t ci=1;ci<=10;ci++) // correction term index\r
8738 {\r
8739 for(Int_t sc=0;sc<2;sc++) // sin or cos term\r
8740 {\r
8741 if(strcmp((fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->GetBinLabel(ci), "") == 0) continue; // to be improved (access finalized histogram here)\r
8742 cout<<(fIntFlowCorrectionTermsForNUAPro[sc]->GetXaxis())->GetBinLabel(ci)<<":"<<endl; // to be improved (access finalized histogram here)\r
3b552efe 8743 cout<<"from Q-vectors = "<<fIntFlowCorrectionTermsForNUAPro[sc]->GetBinContent(ci)<<endl; // to be improved (access finalized histogram here)
a5b7efd0 8744 cout<<"from nested loops = "<<fIntFlowDirectCorrectionTermsForNUA[sc]->GetBinContent(ci)<<endl;\r
8745 cout<<endl;\r
8746 } // end of for(Int_t sc=0;sc<2;sc++) // sin or cos term\r
8747 } // end of for(Int_t ci=1;ci<=10;ci++) // correction term index\r
8748 \r
8749} // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowCorrectionTermsForNUA() \r
8750\r
8751\r
8752//================================================================================================================================\r
8753\r
8754\r
8755void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent)\r
8756{\r
8757 // Evaluate with nested loops multiparticle correlations for integrated flow (using the particle weights). \r
8758\r
8759 // Results are stored in profile fIntFlowDirectCorrelations. \r
8760 // Remark 1: When particle weights are used the binning of fIntFlowDirectCorrelations is organized as follows:\r
8761 //\r
8762 // 1st bin: <2>_{1n|1n} = two1n1nW1W1 = <w1 w2 cos(n*(phi1-phi2))>\r
8763 // 2nd bin: <2>_{2n|2n} = two2n2nW2W2 = <w1^2 w2^2 cos(2n*(phi1-phi2))>\r
8764 // 3rd bin: <2>_{3n|3n} = two3n3nW3W3 = <w1^3 w2^3 cos(3n*(phi1-phi2))> \r
8765 // 4th bin: <2>_{4n|4n} = two4n4nW4W4 = <w1^4 w2^4 cos(4n*(phi1-phi2))>\r
8766 // 5th bin: ---- EMPTY ----\r
8767 // 6th bin: <3>_{2n|1n,1n} = three2n1n1nW2W1W1 = <w1^2 w2 w3 cos(n*(2phi1-phi2-phi3))>\r
8768 // 7th bin: <3>_{3n|2n,1n} = ...\r
8769 // 8th bin: <3>_{4n|2n,2n} = ...\r
8770 // 9th bin: <3>_{4n|3n,1n} = ...\r
8771 // 10th bin: ---- EMPTY ----\r
8772 // 11th bin: <4>_{1n,1n|1n,1n} = four1n1n1n1nW1W1W1W1 = <w1 w2 w3 w4 cos(n*(phi1+phi2-phi3-phi4))>\r
8773 // 12th bin: <4>_{2n,1n|2n,1n} = ...\r
8774 // 13th bin: <4>_{2n,2n|2n,2n} = ...\r
8775 // 14th bin: <4>_{3n|1n,1n,1n} = ... \r
8776 // 15th bin: <4>_{3n,1n|3n,1n} = ...\r
8777 // 16th bin: <4>_{3n,1n|2n,2n} = ...\r
8778 // 17th bin: <4>_{4n|2n,1n,1n} = ... \r
8779 // 18th bin: ---- EMPTY ----\r
8780 // 19th bin: <5>_{2n|1n,1n,1n,1n} = ...\r
8781 // 20th bin: <5>_{2n,2n|2n,1n,1n} = ...\r
8782 // 21st bin: <5>_{3n,1n|2n,1n,1n} = ...\r
8783 // 22nd bin: <5>_{4n|1n,1n,1n,1n} = ...\r
8784 // 23rd bin: ---- EMPTY ----\r
8785 // 24th bin: <6>_{1n,1n,1n|1n,1n,1n} = ...\r
8786 // 25th bin: <6>_{2n,1n,1n|2n,1n,1n} = ...\r
8787 // 26th bin: <6>_{2n,2n|1n,1n,1n,1n} = ...\r
8788 // 27th bin: <6>_{3n,1n|1n,1n,1n,1n} = ...\r
8789 // 28th bin: ---- EMPTY ----\r
8790 // 29th bin: <7>_{2n,1n,1n|1n,1n,1n,1n} = ...\r
8791 // 30th bin: ---- EMPTY ----\r
8792 // 31st bin: <8>_{1n,1n,1n,1n|1n,1n,1n,1n} = ...\r
8793 \r
8794 // Remark 2: When particle weights are used there are some extra correlations. They are stored in \r
8795 // fIntFlowExtraDirectCorrelations binning of which is organized as follows:\r
8796 \r
8797 // 1st bin: two1n1nW3W1 = <w1^3 w2 cos(n*(phi1-phi2))>\r
8798 // 2nd bin: two1n1nW1W1W2 = <w1 w2 w3^2 cos(n*(phi1-phi2))> \r
8799 // ...\r
8800 \r
8801 Int_t nPrim = anEvent->NumberOfTracks(); \r
8802 AliFlowTrackSimple *aftsTrack = NULL;\r
8803 //Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;\r
8804 //Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1., wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;\r
8805 Double_t phi1=0., phi2=0., phi3=0., phi4=0.;\r
8806 Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1.;\r
8807 Int_t n = fHarmonic; \r
8808 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)\r
8809 Double_t dMult = (*fSMpk)(0,0);\r
8810 cout<<endl;\r
8811 cout<<"Multiparticle correlations: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;\r
8812 if(dMult<2)\r
8813 {\r
8814 cout<<"... skipping this event (multiplicity too low) ..."<<endl;\r
8815 } else if (dMult>fMaxAllowedMultiplicity)\r
8816 {\r
8817 cout<<"... skipping this event (multiplicity too high) ..."<<endl;\r
8818 } else \r
8819 { \r
8820 cout<<"... evaluating nested loops (using particle weights) ..."<<endl;\r
8821 } \r
8822 \r
8823 // 2-particle correlations: \r
8824 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)\r
8825 {\r
8826 // 2 nested loops multiparticle correlations using particle weights: \r
8827 for(Int_t i1=0;i1<nPrim;i1++)\r
8828 {\r
8829 aftsTrack=anEvent->GetTrack(i1);\r
8830 if(!(aftsTrack->InRPSelection())) continue;\r
8831 phi1=aftsTrack->Phi();\r
8832 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));\r
8833 for(Int_t i2=0;i2<nPrim;i2++)\r
8834 {\r
8835 if(i2==i1)continue;\r
8836 aftsTrack=anEvent->GetTrack(i2);\r
8837 if(!(aftsTrack->InRPSelection())) continue;\r
8838 phi2=aftsTrack->Phi();\r
8839 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi()))); \r
8840 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;\r
8841 // 2-p correlations using particle weights:\r
8842 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),wPhi1*wPhi2); // <w1 w2 cos( n*(phi1-phi2))>\r
8843 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
8844 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
8845 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
8846 // extra correlations: \r
8847 // 2-p extra correlations (do not appear if particle weights are not used):\r
8848 if(fUsePhiWeights) fIntFlowExtraDirectCorrelations->Fill(0.5,cos(n*(phi1-phi2)),pow(wPhi1,3)*wPhi2); // <w1^3 w2 cos(n*(phi1-phi2))>\r
8849 // ...\r
8850 } // end of for(Int_t i2=0;i2<nPrim;i2++)\r
8851 } // end of for(Int_t i1=0;i1<nPrim;i1++)\r
8852 } // end of if(nPrim>=2)\r
8853\r
8854 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)\r
8855 { \r
8856 // 3 nested loops multiparticle correlations using particle weights: \r
8857 for(Int_t i1=0;i1<nPrim;i1++)\r
8858 {\r
8859 aftsTrack=anEvent->GetTrack(i1);\r
8860 if(!(aftsTrack->InRPSelection())) continue;\r
8861 phi1=aftsTrack->Phi();\r
8862 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));\r
8863 for(Int_t i2=0;i2<nPrim;i2++)\r
8864 {\r
8865 if(i2==i1)continue;\r
8866 aftsTrack=anEvent->GetTrack(i2);\r
8867 if(!(aftsTrack->InRPSelection())) continue;\r
8868 phi2=aftsTrack->Phi();\r
8869 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));\r
8870 for(Int_t i3=0;i3<nPrim;i3++)\r
8871 {\r
8872 if(i3==i1||i3==i2)continue;\r
8873 aftsTrack=anEvent->GetTrack(i3);\r
8874 if(!(aftsTrack->InRPSelection())) continue;\r
8875 phi3=aftsTrack->Phi();\r
8876 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));\r
8877 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;\r
8878 // 3-p correlations using particle weights:\r
8879 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
8880 // ...\r
8881 // extra correlations: \r
8882 // 2-p extra correlations (do not appear if particle weights are not used):\r
8883 if(fUsePhiWeights) fIntFlowExtraDirectCorrelations->Fill(1.5,cos(n*(phi1-phi2)),wPhi1*wPhi2*pow(wPhi3,2)); // <w1 w2 w3^2 cos(n*(phi1-phi2))>\r
8884 // ...\r
8885 // 3-p extra correlations (do not appear if particle weights are not used):\r
8886 // ...\r
8887 } // end of for(Int_t i3=0;i3<nPrim;i3++)\r
8888 } // end of for(Int_t i2=0;i2<nPrim;i2++)\r
8889 } // end of for(Int_t i1=0;i1<nPrim;i1++)\r
8890 } // end of if(nPrim>=3)\r
8891 \r
8892 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)\r
8893 {\r
8894 // 4 nested loops multiparticle correlations using particle weights: \r
8895 for(Int_t i1=0;i1<nPrim;i1++)\r
8896 {\r
8897 aftsTrack=anEvent->GetTrack(i1);\r
8898 if(!(aftsTrack->InRPSelection())) continue;\r
8899 phi1=aftsTrack->Phi();\r
8900 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));\r
8901 for(Int_t i2=0;i2<nPrim;i2++)\r
8902 {\r
8903 if(i2==i1)continue;\r
8904 aftsTrack=anEvent->GetTrack(i2);\r
8905 if(!(aftsTrack->InRPSelection())) continue;\r
8906 phi2=aftsTrack->Phi();\r
8907 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));\r
8908 for(Int_t i3=0;i3<nPrim;i3++)\r
8909 {\r
8910 if(i3==i1||i3==i2)continue;\r
8911 aftsTrack=anEvent->GetTrack(i3);\r
8912 if(!(aftsTrack->InRPSelection())) continue;\r
8913 phi3=aftsTrack->Phi();\r
8914 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));\r
8915 for(Int_t i4=0;i4<nPrim;i4++)\r
8916 {\r
8917 if(i4==i1||i4==i2||i4==i3)continue;\r
8918 aftsTrack=anEvent->GetTrack(i4);\r
8919 if(!(aftsTrack->InRPSelection())) continue;\r
8920 phi4=aftsTrack->Phi();\r
8921 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));\r
8922 if(nPrim>=4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush; // to be improved (replace eventually this if statement with if(nPrim==4))\r
8923 // 4-p correlations using particle weights:\r
8924 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(10.5,cos(n*phi1+n*phi2-n*phi3-n*phi4),wPhi1*wPhi2*wPhi3*wPhi4); \r
8925 // extra correlations: \r
8926 // 2-p extra correlations (do not appear if particle weights are not used):\r
8927 // ...\r
8928 // 3-p extra correlations (do not appear if particle weights are not used):\r
8929 // ...\r
8930 // 4-p extra correlations (do not appear if particle weights are not used):\r
8931 // ...\r
8932 } // end of for(Int_t i4=0;i4<nPrim;i4++) \r
8933 } // end of for(Int_t i3=0;i3<nPrim;i3++)\r
8934 } // end of for(Int_t i2=0;i2<nPrim;i2++)\r
8935 } // end of for(Int_t i1=0;i1<nPrim;i1++)\r
8936 } // end of if(nPrim>=4)\r
8937\r
8938 cout<<endl; \r
8939\r
8940} // end of void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent)\r
8941\r
8942\r
8943//================================================================================================================================\r
8944\r
8945\r
8946void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowExtraCorrelations()\r
8947{\r
8948 // Cross-check results for extra multiparticle correlations needed for int. flow \r
8949 // which appear only when particle weights are used: results from Q-vectors vs results from nested loops.\r
8950\r
8951 cout<<endl;\r
8952 cout<<endl;\r
8953 cout<<" ***********************************************"<<endl;\r
8954 cout<<" **** cross-checking the extra correlations ****"<<endl;\r
8955 cout<<" **** for integrated flow ****"<<endl;\r
8956 cout<<" ***********************************************"<<endl;\r
8957 cout<<endl;\r
8958 cout<<endl;\r
8959 \r
8960 for(Int_t eci=1;eci<=2;eci++) // to be improved (increased eciMax eventually when I calculate 6th and 8th)\r
8961 {\r
8962 if(strcmp((fIntFlowExtraCorrelationsPro->GetXaxis())->GetBinLabel(eci), "") == 0) continue;\r
8963 cout<<(fIntFlowExtraCorrelationsPro->GetXaxis())->GetBinLabel(eci)<<":"<<endl;\r
8964 cout<<"from Q-vectors = "<<fIntFlowExtraCorrelationsPro->GetBinContent(eci)<<endl;\r
8965 cout<<"from nested loops = "<<fIntFlowExtraDirectCorrelations->GetBinContent(eci)<<endl;\r
8966 cout<<endl;\r
8967 }\r
8968\r
8969} // end of void AliFlowAnalysisWithQCumulants::CrossCheckIntFlowExtraCorrelations()\r
8970\r
8971\r
8972//================================================================================================================================\r
8973\r
8974\r
8975void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoops(AliFlowEventSimple* anEvent)\r
8976{\r
8977 // Evaluate with nested loops correction terms for non-uniform acceptance relevant for NONAME integrated flow (to be improved (name)).\r
8978 //\r
8979 // Remark: Both sin and cos correction terms are calculated in this method. Sin terms are stored in fIntFlowDirectCorrectionTermsForNUA[0],\r
57340a27 8980 // and cos terms in fIntFlowDirectCorrectionTermsForNUA[1]. Binning of fIntFlowDirectCorrectionTermsForNUA[sc] is organized as follows \r
a5b7efd0 8981 // (sc stands for either sin or cos):\r
8982 \r
8983 // 1st bin: <<sc(n*(phi1))>> \r
8984 // 2nd bin: <<sc(n*(phi1+phi2))>> \r
8985 // 3rd bin: <<sc(n*(phi1-phi2-phi3))>>\r
3b552efe 8986 // 4th bin: <<sc(n*(2phi1-phi2))>>\r
a5b7efd0 8987 \r
8988 Int_t nPrim = anEvent->NumberOfTracks(); \r
8989 AliFlowTrackSimple *aftsTrack = NULL;\r
8990 Double_t phi1=0., phi2=0., phi3=0.;\r
8991 Int_t n = fHarmonic; \r
8992 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)\r
8993 Double_t dMult = (*fSMpk)(0,0);\r
8994 cout<<endl;\r
8995 cout<<"Correction terms for non-uniform acceptance: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;\r
8996 if(dMult<1)\r
8997 {\r
8998 cout<<"... skipping this event (multiplicity too low) ..."<<endl;\r
8999 } else if (dMult>fMaxAllowedMultiplicity)\r
9000 {\r
9001 cout<<"... skipping this event (multiplicity too high) ..."<<endl;\r
9002 } else \r
9003 { \r
9004 cout<<"... evaluating nested loops (without using particle weights)..."<<endl;\r
9005 }\r
9006 \r
9007 if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)\r
9008 {\r
9009 // 1-particle correction terms for non-uniform acceptance: \r
9010 for(Int_t i1=0;i1<nPrim;i1++)\r
9011 {\r
9012 aftsTrack=anEvent->GetTrack(i1);\r
9013 if(!(aftsTrack->InRPSelection())) continue;\r
9014 phi1=aftsTrack->Phi();\r
9015 if(nPrim==1) cout<<i1<<"\r"<<flush;\r
9016 // sin terms:\r
9017 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(0.5,sin(n*phi1),1.); // <sin(n*phi1)> \r
9018 // cos terms:\r
9019 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(0.5,cos(n*phi1),1.); // <cos(n*phi1)>\r
9020 } // end of for(Int_t i1=0;i1<nPrim;i1++)\r
9021 } // end of if(nPrim>=1) \r
9022 \r
9023 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)\r
9024 {\r
9025 // 2-particle correction terms for non-uniform acceptance: \r
9026 for(Int_t i1=0;i1<nPrim;i1++)\r
9027 {\r
9028 aftsTrack=anEvent->GetTrack(i1);\r
9029 if(!(aftsTrack->InRPSelection())) continue;\r
9030 phi1=aftsTrack->Phi(); \r
9031 for(Int_t i2=0;i2<nPrim;i2++)\r
9032 {\r
9033 if(i2==i1)continue;\r
9034 aftsTrack=anEvent->GetTrack(i2);\r
9035 if(!(aftsTrack->InRPSelection())) continue;\r
9036 phi2=aftsTrack->Phi();\r
9037 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;\r
9038 // sin terms:\r
3b552efe 9039 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(1.5,sin(n*(phi1+phi2)),1.); // <<sin(n*(phi1+phi2))>>
9040 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(3.5,sin(n*(2*phi1-phi2)),1.); // <<sin(n*(2*phi1-phi2))>>\r
a5b7efd0 9041 // cos terms:\r
3b552efe 9042 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(1.5,cos(n*(phi1+phi2)),1.); // <<cos(n*(phi1+phi2))>>
9043 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(3.5,cos(n*(2*phi1-phi2)),1.); // <<cos(n*(2*phi1-phi2))>>\r
a5b7efd0 9044 } // end of for(Int_t i2=0;i2<nPrim;i2++)\r
9045 } // end of for(Int_t i1=0;i1<nPrim;i1++)\r
9046 } // end of if(nPrim>=2)\r
9047\r
9048 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)\r
9049 {\r
9050 // 3-particle correction terms for non-uniform acceptance: \r
9051 for(Int_t i1=0;i1<nPrim;i1++)\r
9052 {\r
9053 aftsTrack=anEvent->GetTrack(i1);\r
9054 if(!(aftsTrack->InRPSelection())) continue;\r
9055 phi1=aftsTrack->Phi();\r
9056 for(Int_t i2=0;i2<nPrim;i2++)\r
9057 {\r
9058 if(i2==i1)continue;\r
9059 aftsTrack=anEvent->GetTrack(i2);\r
9060 if(!(aftsTrack->InRPSelection())) continue;\r
9061 phi2=aftsTrack->Phi();\r
9062 for(Int_t i3=0;i3<nPrim;i3++)\r
9063 {\r
9064 if(i3==i1||i3==i2)continue;\r
9065 aftsTrack=anEvent->GetTrack(i3);\r
9066 if(!(aftsTrack->InRPSelection())) continue;\r
9067 phi3=aftsTrack->Phi();\r
9068 if(nPrim>=3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush; // to be improved (eventually I will change this if statement)\r
9069 // sin terms:\r
9070 fIntFlowDirectCorrectionTermsForNUA[0]->Fill(2.5,sin(n*(phi1-phi2-phi3)),1.); // <<sin(n*(phi1-phi2-phi3))>>\r
9071 // cos terms:\r
9072 fIntFlowDirectCorrectionTermsForNUA[1]->Fill(2.5,cos(n*(phi1-phi2-phi3)),1.); // <<cos(n*(phi1-phi2-phi3))>>\r
9073 } // end of for(Int_t i3=0;i3<nPrim;i3++)\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 } // end of if(nPrim>=3)\r
9077\r
9078 cout<<endl;\r
9079}\r
9080//================================================================================================================================\r
9081void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoops(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)\r
9082{\r
9083 // Evaluate reduced correlations with nested loops without using the particle weights.\r
9084 \r
9085 // Remark 1: Reduced correlations are evaluated in pt bin number fCrossCheckInPtBinNo and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.\r
9086 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrelations[t][pe][ci], where indices runs as follows:\r
9087 // [0=RP,1=POI][0=Pt,1=Eta][0=<2'>,1=<4'>,2=<6'>,3=<8'>] \r
9088 // Remark 3: <2'> = <cos(n*(psi1-phi2))>\r
9089 // <4'> = <cos(n*(psi1+phi2-phi3-phi4))>\r
9090 // ...\r
9091 \r
9092 Int_t typeFlag = -1;\r
9093 Int_t ptEtaFlag = -1;\r
9094 if(type == "RP")\r
9095 {\r
9096 typeFlag = 0;\r
9097 } else if(type == "POI")\r
9098 {\r
9099 typeFlag = 1;\r
9100 } \r
9101 if(ptOrEta == "Pt")\r
9102 {\r
9103 ptEtaFlag = 0;\r
9104 } else if(ptOrEta == "Eta")\r
9105 {\r
9106 ptEtaFlag = 1;\r
9107 } \r
9108 // shortcuts:\r
9109 Int_t t = typeFlag;\r
9110 Int_t pe = ptEtaFlag;\r
9111 \r
9112 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};\r
9113 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};\r
9114 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};\r
9115 \r
9116 Int_t nPrim = anEvent->NumberOfTracks(); \r
9117 AliFlowTrackSimple *aftsTrack = NULL;\r
9118 \r
9119 Double_t psi1=0., phi2=0., phi3=0., phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;\r
9120 \r
3b552efe 9121 Int_t n = fHarmonic;
9122 \r
a5b7efd0 9123 // 2'-particle correlations:\r
9124 for(Int_t i1=0;i1<nPrim;i1++)\r
9125 {\r
9126 aftsTrack=anEvent->GetTrack(i1);\r
3b552efe 9127 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
9128 if(typeFlag==1) // this is diff flow of POIs
9129 {\r
9130 if(ptOrEta == "Pt")\r
9131 { \r
9132 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;\r
9133 } else if (ptOrEta == "Eta")\r
9134 {\r
9135 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue; \r
9136 }
9137 } else // this is diff flow of RPs
9138 {
9139 if(ptOrEta == "Pt")\r
9140 { \r
9141 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;\r
9142 } else if (ptOrEta == "Eta")\r
9143 {\r
9144 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue; \r
9145 }
9146 }
9147 \r
a5b7efd0 9148 psi1=aftsTrack->Phi(); \r
9149 for(Int_t i2=0;i2<nPrim;i2++)\r
9150 {\r
9151 if(i2==i1)continue;\r
9152 aftsTrack=anEvent->GetTrack(i2);\r
9153 // RP condition (!(first) particle in the correlator must be RP):\r
9154 if(!(aftsTrack->InRPSelection()))continue;\r
9155 phi2=aftsTrack->Phi(); \r
9156 // 2'-particle correlations: \r
9157 fDiffFlowDirectCorrelations[t][pe][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(1.*n*(psi1-phi2)),1.); // <cos(n*(psi1-phi2)) \r
9158 }//end of for(Int_t i2=0;i2<nPrim;i2++)\r
9159 }//end of for(Int_t i1=0;i1<nPrim;i1++)\r
9160 \r
9161 /*\r
9162 \r
9163 // 3'-particle correlations:\r
9164 for(Int_t i1=0;i1<nPrim;i1++)\r
9165 {\r
9166 aftsTrack=anEvent->GetTrack(i1);\r
9167 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)\r
9168 if(ptOrEta == "Pt")\r
9169 { \r
9170 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;\r
9171 } else if (ptOrEta == "Eta")\r
9172 {\r
9173 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue; \r
9174 }\r
9175 psi1=aftsTrack->Phi();\r
9176 for(Int_t i2=0;i2<nPrim;i2++)\r
9177 {\r
9178 if(i2==i1)continue;\r
9179 aftsTrack=anEvent->GetTrack(i2);\r
9180 // RP condition (!(first) particle in the correlator must be RP):\r
9181 if(!(aftsTrack->InRPSelection())) continue;\r
9182 phi2=aftsTrack->Phi();\r
9183 for(Int_t i3=0;i3<nPrim;i3++)\r
9184 {\r
9185 if(i3==i1||i3==i2)continue;\r
9186 aftsTrack=anEvent->GetTrack(i3);\r
9187 // RP condition (!(first) particle in the correlator must be RP):\r
9188 if(!(aftsTrack->InRPSelection())) continue;\r
9189 phi3=aftsTrack->Phi();\r
9190 // 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
9191 }//end of for(Int_t i3=0;i3<nPrim;i3++) \r
9192 }//end of for(Int_t i2=0;i2<nPrim;i2++) \r
9193 }//end of for(Int_t i1=0;i1<nPrim;i1++)\r
9194 \r
9195 */\r
9196 \r
9197 // 4'-particle correlations:\r
9198 for(Int_t i1=0;i1<nPrim;i1++)\r
9199 {\r
9200 aftsTrack=anEvent->GetTrack(i1);\r
3b552efe 9201 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
9202 if(typeFlag==1) // this is diff flow of POIs
9203 {\r
9204 if(ptOrEta == "Pt")\r
9205 { \r
9206 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;\r
9207 } else if (ptOrEta == "Eta")\r
9208 {\r
9209 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue; \r
9210 }
9211 } else // this is diff flow of RPs
9212 {
9213 if(ptOrEta == "Pt")\r
9214 { \r
9215 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;\r
9216 } else if (ptOrEta == "Eta")\r
9217 {\r
9218 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue; \r
9219 }
9220 }
9221 \r
a5b7efd0 9222 psi1=aftsTrack->Phi();\r
9223 for(Int_t i2=0;i2<nPrim;i2++)\r
9224 {\r
9225 if(i2==i1) continue;\r
9226 aftsTrack=anEvent->GetTrack(i2);\r
9227 // RP condition (!(first) particle in the correlator must be RP): \r
9228 if(!(aftsTrack->InRPSelection())) continue;\r
9229 phi2=aftsTrack->Phi();\r
9230 for(Int_t i3=0;i3<nPrim;i3++)\r
9231 { \r
9232 if(i3==i1||i3==i2) continue;\r
9233 aftsTrack=anEvent->GetTrack(i3);\r
9234 // RP condition (!(first) particle in the correlator must be RP):\r
9235 if(!(aftsTrack->InRPSelection())) continue;\r
9236 phi3=aftsTrack->Phi();\r
9237 for(Int_t i4=0;i4<nPrim;i4++)\r
9238 {\r
9239 if(i4==i1||i4==i2||i4==i3) continue;\r
9240 aftsTrack=anEvent->GetTrack(i4);\r
9241 // RP condition (!(first) particle in the correlator must be RP):\r
9242 if(!(aftsTrack->InRPSelection())) continue; \r
9243 phi4=aftsTrack->Phi();\r
9244 // 4'-particle correlations:\r
9245 fDiffFlowDirectCorrelations[t][pe][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3-phi4)),1.); // <cos(n(psi1+phi2-phi3-phi4))> \r
9246 }//end of for(Int_t i4=0;i4<nPrim;i4++)\r
9247 }//end of for(Int_t i3=0;i3<nPrim;i3++)\r
9248 }//end of for(Int_t i2=0;i2<nPrim;i2++) \r
9249 }//end of for(Int_t i1=0;i1<nPrim;i1++)\r
9250 \r
3b552efe 9251 // count # of RPs and POIs in selected pt and eta bins for cross-checkings:\r
9252 for(Int_t i=0;i<nPrim;i++)
9253 {
9254 aftsTrack=anEvent->GetTrack(i);
9255 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
9256 if(typeFlag==1) // this is diff flow of POIs
9257 {\r
9258 if(ptOrEta == "Pt")\r
9259 { \r
9260 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;\r
9261 } else if (ptOrEta == "Eta")\r
9262 {\r
9263 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue; \r
9264 }
9265 } else // this is diff flow of RPs
9266 {
9267 if(ptOrEta == "Pt")\r
9268 { \r
9269 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;\r
9270 } else if (ptOrEta == "Eta")\r
9271 {\r
9272 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue; \r
9273 }
9274 }
9275 if(t==1)t++;
9276 fNoOfParticlesInBin->Fill(t+pe+0.5);
9277 }\r
9278\r
a5b7efd0 9279} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoops(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)\r
9280\r
9281\r
9282//================================================================================================================================\r
9283\r
9284\r
9285void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrelations(TString type, TString ptOrEta)\r
9286{\r
9287 // Compare correlations needed for diff. flow calculated with nested loops and those calculated from Q-vectors\r
9288 \r
9289 Int_t typeFlag = -1;\r
9290 Int_t ptEtaFlag = -1;\r
9291 if(type == "RP")\r
9292 {\r
9293 typeFlag = 0;\r
9294 } else if(type == "POI")\r
9295 {\r
9296 typeFlag = 1;\r
9297 } \r
9298 if(ptOrEta == "Pt")\r
9299 {\r
9300 ptEtaFlag = 0;\r
9301 } else if(ptOrEta == "Eta")\r
9302 {\r
9303 ptEtaFlag = 1;\r
9304 } \r
9305 // shortcuts:\r
9306 Int_t t = typeFlag;\r
9307 Int_t pe = ptEtaFlag;\r
9308 \r
9309 TString rpORpoiString[2] = {"RP ","POI"}; // to be improved (name in the same way as in the other methods, eventually promote to data member) \r
9310 TString ptORetaString[2] = {"pt","eta"}; // to be improved (name in the same way as in the other methods, eventually promote to data member) \r
9311 TString reducedCorrelations[4] = {"<<cos(n(psi1-phi2))>>","<<cos(n(psi1+phi2-phi3-phi4))>>","",""}; // to be improved (access this from pro or hist)\r
9312 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};\r
9313 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};\r
9314 \r
9315 Int_t crossCheckInPtEtaBinNo[2] = {fCrossCheckInPtBinNo,fCrossCheckInEtaBinNo};\r
9316 \r
9317\r
9318 cout<<endl;\r
9319 cout<<" *****************************************"<<endl;\r
9320 cout<<" **** cross-checking the correlations ****"<<endl;\r
46b94261 9321 cout<<" **** for differential flow ("<<rpORpoiString[t]<<") ****"<<endl;\r
9322 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))\r
9323 {\r
9324 cout<<" **** (particle weights not used) ****"<<endl;\r
9325 } else\r
9326 {\r
9327 cout<<" **** (particle weights used) ****"<<endl;\r
9328 } \r
a5b7efd0 9329 cout<<" *****************************************"<<endl; \r
9330 cout<<endl;\r
9331 cout<<" "<<ptORetaString[pe]<<" bin: "<<lowerPtEtaEdge[pe]<<" <= "<<ptORetaString[pe]<<" < "<<upperPtEtaEdge[pe]<<endl;\r
9332 cout<<endl;\r
9333 \r
9334 for(Int_t rci=0;rci<2;rci++) // to be improved (calculate 6th and 8th order)\r
9335 {\r
9336 cout<<" "<<reducedCorrelations[rci].Data()<<":"<<endl;\r
9337 cout<<" from Q-vectors = "<<fDiffFlowCorrelationsPro[t][pe][rci]->GetBinContent(crossCheckInPtEtaBinNo[pe])<<endl;\r
9338 cout<<" from nested loops = "<<fDiffFlowDirectCorrelations[t][pe][rci]->GetBinContent(1)<<endl;\r
9339 cout<<endl; \r
9340 } // end of for(Int_t rci=0;rci<4;rci++)\r
3b552efe 9341 \r
a5b7efd0 9342} // end of void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrelations(TString type, TString ptOrEta)\r
9343\r
3b552efe 9344//================================================================================================================================
9345
9346void AliFlowAnalysisWithQCumulants::PrintNumberOfParticlesInSelectedBin()\r
9347{
9348 // Print on the screen number of RPs and POIs in selected pt and eta bin for cross checkings.
9349
9350 cout<<endl;
9351 cout<<"Number of RPs in selected pt bin = "<<fNoOfParticlesInBin->GetBinContent(1)<<endl;
9352 cout<<"Number of RPs in selected eta bin = "<<fNoOfParticlesInBin->GetBinContent(2)<<endl;
9353 cout<<"Number of POIs in selected pt bin = "<<fNoOfParticlesInBin->GetBinContent(3)<<endl;
9354 cout<<"Number of POIs in selected eta bin = "<<fNoOfParticlesInBin->GetBinContent(4)<<endl;
9355
9356} // end of void AliFlowAnalysisWithQCumulants::PrintNumberOfParticlesInSelectedBin()\r
a5b7efd0 9357\r
3b552efe 9358//================================================================================================================================
9359
a5b7efd0 9360void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)\r
9361{\r
9362 // Evaluate reduced correlations with nested loops without using the particle weights.\r
9363 \r
9364 // Remark 1: Reduced correlations are evaluated in pt bin number fCrossCheckInPtBinNo and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.\r
9365 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrelations[t][pe][ci], where indices runs as follows:\r
9366 // [0=RP,1=POI][0=Pt,1=Eta][0=<2'>,1=<4'>,2=<6'>,3=<8'>] \r
9367 // Remark 3: <2'> = <w2 cos(n*(psi1-phi2))>\r
9368 // <4'> = <w2 w3 w4 cos(n*(psi1+phi2-phi3-phi4))>\r
9369 // ...\r
9370 \r
9371 Int_t typeFlag = -1;\r
9372 Int_t ptEtaFlag = -1;\r
9373 if(type == "RP")\r
9374 {\r
9375 typeFlag = 0;\r
9376 } else if(type == "POI")\r
9377 {\r
9378 typeFlag = 1;\r
9379 } \r
9380 if(ptOrEta == "Pt")\r
9381 {\r
9382 ptEtaFlag = 0;\r
9383 } else if(ptOrEta == "Eta")\r
9384 {\r
9385 ptEtaFlag = 1;\r
9386 } \r
9387 // shortcuts:\r
9388 Int_t t = typeFlag;\r
9389 Int_t pe = ptEtaFlag;\r
9390 \r
9391 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};\r
9392 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};\r
9393 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};\r
9394 \r
9395 Int_t nPrim = anEvent->NumberOfTracks(); \r
9396 AliFlowTrackSimple *aftsTrack = NULL;\r
9397 \r
9398 Double_t psi1=0., phi2=0., phi3=0., phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;\r
9399 Double_t wPhi2=1., wPhi3=1., wPhi4=1.;// wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;\r
9400 \r
9401 Int_t n = fHarmonic; \r
9402 \r
9403 // 2'-particle correlations:\r
9404 for(Int_t i1=0;i1<nPrim;i1++)\r
9405 {\r
9406 aftsTrack=anEvent->GetTrack(i1);\r
3b552efe 9407 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
9408 if(typeFlag==1) // this is diff flow of POIs
9409 {\r
9410 if(ptOrEta == "Pt")\r
9411 { \r
9412 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;\r
9413 } else if (ptOrEta == "Eta")\r
9414 {\r
9415 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue; \r
9416 }
9417 } else // this is diff flow of RPs
9418 {
9419 if(ptOrEta == "Pt")\r
9420 { \r
9421 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;\r
9422 } else if (ptOrEta == "Eta")\r
9423 {\r
9424 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue; \r
9425 }
a5b7efd0 9426 }\r
9427 psi1=aftsTrack->Phi(); \r
9428 for(Int_t i2=0;i2<nPrim;i2++)\r
9429 {\r
9430 if(i2==i1) continue;\r
9431 aftsTrack=anEvent->GetTrack(i2);\r
9432 // RP condition (!(first) particle in the correlator must be RP):\r
9433 if(!(aftsTrack->InRPSelection())) continue;\r
9434 phi2=aftsTrack->Phi(); \r
9435 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));\r
9436 // 2'-particle correlations: \r
9437 fDiffFlowDirectCorrelations[t][pe][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(1.*n*(psi1-phi2)),wPhi2); // <w2 cos(n*(psi1-phi2)) \r
9438 }//end of for(Int_t i2=0;i2<nPrim;i2++)\r
9439 }//end of for(Int_t i1=0;i1<nPrim;i1++)\r
9440 \r
9441 // 4'-particle correlations:\r
9442 for(Int_t i1=0;i1<nPrim;i1++)\r
9443 {\r
9444 aftsTrack=anEvent->GetTrack(i1);\r
3b552efe 9445 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
9446 if(typeFlag==1) // this is diff flow of POIs
9447 {\r
9448 if(ptOrEta == "Pt")\r
9449 { \r
9450 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;\r
9451 } else if (ptOrEta == "Eta")\r
9452 {\r
9453 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue; \r
9454 }
9455 } else // this is diff flow of RPs
9456 {
9457 if(ptOrEta == "Pt")\r
9458 { \r
9459 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;\r
9460 } else if (ptOrEta == "Eta")\r
9461 {\r
9462 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue; \r
9463 }
a5b7efd0 9464 }\r
9465 psi1=aftsTrack->Phi();\r
9466 for(Int_t i2=0;i2<nPrim;i2++)\r
9467 {\r
9468 if(i2==i1) continue;\r
9469 aftsTrack=anEvent->GetTrack(i2);\r
9470 // RP condition (!(first) particle in the correlator must be RP): \r
9471 if(!(aftsTrack->InRPSelection())) continue;\r
9472 phi2=aftsTrack->Phi();\r
9473 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));\r
9474 for(Int_t i3=0;i3<nPrim;i3++)\r
9475 { \r
9476 if(i3==i1||i3==i2) continue;\r
9477 aftsTrack=anEvent->GetTrack(i3);\r
9478 // RP condition (!(first) particle in the correlator must be RP):\r
9479 if(!(aftsTrack->InRPSelection())) continue;\r
9480 phi3=aftsTrack->Phi();\r
9481 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));\r
9482 for(Int_t i4=0;i4<nPrim;i4++)\r
9483 {\r
9484 if(i4==i1||i4==i2||i4==i3) continue;\r
9485 aftsTrack=anEvent->GetTrack(i4);\r
9486 // RP condition (!(first) particle in the correlator must be RP):\r
9487 if(!(aftsTrack->InRPSelection())) continue; \r
9488 phi4=aftsTrack->Phi();\r
9489 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));\r
9490 // 4'-particle correlations <w2 w3 w4 cos(n(psi1+phi2-phi3-phi4))>:\r
9491 fDiffFlowDirectCorrelations[t][pe][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3-phi4)),wPhi2*wPhi3*wPhi4); \r
9492 }//end of for(Int_t i4=0;i4<nPrim;i4++)\r
9493 }//end of for(Int_t i3=0;i3<nPrim;i3++)\r
9494 }//end of for(Int_t i2=0;i2<nPrim;i2++) \r
9495 }//end of for(Int_t i1=0;i1<nPrim;i1++) \r
3b552efe 9496
9497 // count # of RPs and POIs in selected pt and eta bins for cross-checkings: (to be improved - moved to dedicated method)\r
9498 for(Int_t i=0;i<nPrim;i++)
9499 {
9500 aftsTrack=anEvent->GetTrack(i);
9501 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
9502 if(typeFlag==1) // this is diff flow of POIs
9503 {\r
9504 if(ptOrEta == "Pt")\r
9505 { \r
9506 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;\r
9507 } else if (ptOrEta == "Eta")\r
9508 {\r
9509 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue; \r
9510 }
9511 } else // this is diff flow of RPs
9512 {
9513 if(ptOrEta == "Pt")\r
9514 { \r
9515 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;\r
9516 } else if (ptOrEta == "Eta")\r
9517 {\r
9518 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue; \r
9519 }
9520 }
9521 if(t==1)t++;
9522 fNoOfParticlesInBin->Fill(t+pe+0.5);
9523 }
a5b7efd0 9524 \r
9525} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrelationsWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)\r
9526\r
9527\r
9528//================================================================================================================================\r
9529\r
9530 \r
9531void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)\r
9532{\r
9533 // Evaluate with nested loops correction terms for non-uniform acceptance (both sin and cos terms) relevant for differential flow.\r
9534 \r
9535 // Remark 1: Reduced correction terms for non-uniform acceptance are evaluated in pt bin number fCrossCheckInPtBinNo \r
9536 // and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.\r
9537 // Remark 2: Results are stored in 1 bin profiles fDiffFlowDirectCorrections[t][pe][sc][cti], where first three indices runs as: \r
9538 // [0=RP,1=POI][0=Pt,1=Eta][0=sin terms,1=cos terms], whilst the cti (correction term index) runs as follows: \r
9539 // cti: \r
9540 // 0: <<sc n(psi1)>>\r
9541 // 1: <<sc n(psi1+phi2)>> \r
9542 // 2: <<sc n(psi1+phi2-phi3)>>\r
9543 // 3: <<sc n(psi1-phi2-phi3)>>\r
9544 // 4:\r
9545 // 5:\r
9546 // 6:\r
9547 \r
9548 Int_t typeFlag = -1;\r
9549 Int_t ptEtaFlag = -1;\r
9550 if(type == "RP")\r
9551 {\r
9552 typeFlag = 0;\r
9553 } else if(type == "POI")\r
9554 {\r
9555 typeFlag = 1;\r
9556 } \r
9557 if(ptOrEta == "Pt")\r
9558 {\r
9559 ptEtaFlag = 0;\r
9560 } else if(ptOrEta == "Eta")\r
9561 {\r
9562 ptEtaFlag = 1;\r
9563 } \r
9564 // shortcuts:\r
9565 Int_t t = typeFlag;\r
9566 Int_t pe = ptEtaFlag;\r
9567 \r
9568 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};\r
9569 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};\r
9570 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};\r
9571 \r
9572 Int_t nPrim = anEvent->NumberOfTracks(); \r
9573 AliFlowTrackSimple *aftsTrack = NULL;\r
9574 \r
9575 Double_t psi1=0., phi2=0., phi3=0.;// phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;\r
9576 \r
9577 Int_t n = fHarmonic; \r
9578 \r
9579 // 1-particle correction terms:\r
9580 for(Int_t i1=0;i1<nPrim;i1++)\r
9581 {\r
9582 aftsTrack=anEvent->GetTrack(i1);\r
3b552efe 9583 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
9584 if(typeFlag==1) // this is diff flow of POIs
9585 {\r
9586 if(ptOrEta == "Pt")\r
9587 { \r
9588 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;\r
9589 } else if (ptOrEta == "Eta")\r
9590 {\r
9591 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue; \r
9592 }
9593 } else // this is diff flow of RPs
9594 {
9595 if(ptOrEta == "Pt")\r
9596 { \r
9597 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;\r
9598 } else if (ptOrEta == "Eta")\r
9599 {\r
9600 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue; \r
9601 }
a5b7efd0 9602 }\r
9603 psi1=aftsTrack->Phi(); \r
9604 // sin terms: \r
9605 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*psi1),1.); // <<sin(n*(psi1))>> \r
9606 // cos terms: \r
9607 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*psi1),1.); // <<cos(n*(psi1))>> \r
9608 }//end of for(Int_t i1=0;i1<nPrim;i1++)\r
9609 \r
9610 // 2-particle correction terms:\r
9611 for(Int_t i1=0;i1<nPrim;i1++)\r
9612 {\r
9613 aftsTrack=anEvent->GetTrack(i1);\r
3b552efe 9614 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
9615 if(typeFlag==1) // this is diff flow of POIs
9616 {\r
9617 if(ptOrEta == "Pt")\r
9618 { \r
9619 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;\r
9620 } else if (ptOrEta == "Eta")\r
9621 {\r
9622 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue; \r
9623 }
9624 } else // this is diff flow of RPs
9625 {
9626 if(ptOrEta == "Pt")\r
9627 { \r
9628 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;\r
9629 } else if (ptOrEta == "Eta")\r
9630 {\r
9631 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue; \r
9632 }
a5b7efd0 9633 }\r
9634 psi1=aftsTrack->Phi(); \r
9635 for(Int_t i2=0;i2<nPrim;i2++)\r
9636 {\r
9637 if(i2==i1) continue;\r
9638 aftsTrack=anEvent->GetTrack(i2);\r
9639 // RP condition (!(first) particle in the correlator must be RP):\r
9640 if(!(aftsTrack->InRPSelection())) continue;\r
9641 phi2=aftsTrack->Phi(); \r
9642 // sin terms: \r
9643 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2)),1.); // <<sin(n*(psi1+phi2))>> \r
9644 // cos terms: \r
9645 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2)),1.); // <<cos(n*(psi1+phi2))>> \r
9646 }//end of for(Int_t i2=0;i2<nPrim;i2++)\r
9647 }//end of for(Int_t i1=0;i1<nPrim;i1++) \r
9648 \r
9649 // 3-particle correction terms:\r
9650 for(Int_t i1=0;i1<nPrim;i1++)\r
9651 {\r
9652 aftsTrack=anEvent->GetTrack(i1);\r
3b552efe 9653 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
9654 if(typeFlag==1) // this is diff flow of POIs
9655 {\r
9656 if(ptOrEta == "Pt")\r
9657 { \r
9658 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;\r
9659 } else if (ptOrEta == "Eta")\r
9660 {\r
9661 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue; \r
9662 }
9663 } else // this is diff flow of RPs
9664 {
9665 if(ptOrEta == "Pt")\r
9666 { \r
9667 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;\r
9668 } else if (ptOrEta == "Eta")\r
9669 {\r
9670 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue; \r
9671 }
a5b7efd0 9672 }\r
9673 psi1=aftsTrack->Phi();\r
9674 for(Int_t i2=0;i2<nPrim;i2++)\r
9675 {\r
9676 if(i2==i1) continue;\r
9677 aftsTrack=anEvent->GetTrack(i2);\r
9678 // RP condition (!(first) particle in the correlator must be RP):\r
9679 if(!(aftsTrack->InRPSelection())) continue;\r
9680 phi2=aftsTrack->Phi();\r
9681 for(Int_t i3=0;i3<nPrim;i3++)\r
9682 {\r
9683 if(i3==i1||i3==i2) continue;\r
9684 aftsTrack=anEvent->GetTrack(i3);\r
9685 // RP condition (!(first) particle in the correlator must be RP):\r
9686 if(!(aftsTrack->InRPSelection())) continue;\r
9687 phi3=aftsTrack->Phi();\r
9688 // sin terms: \r
9689 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][2]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2-phi3)),1.); // <<sin(n*(psi1+phi2-phi3))>> \r
9690 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][3]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1-phi2-phi3)),1.); // <<sin(n*(psi1-phi2-phi3))>> \r
9691 // cos terms: \r
9692 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][2]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2-phi3)),1.); // <<cos(n*(psi1+phi2-phi3))>> \r
9693 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][3]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1-phi2-phi3)),1.); // <<cos(n*(psi1-phi2-phi3))>> \r
9694 }//end of for(Int_t i3=0;i3<nPrim;i3++) \r
9695 }//end of for(Int_t i2=0;i2<nPrim;i2++) \r
9696 }//end of for(Int_t i1=0;i1<nPrim;i1++)\r
9697 \r
9698} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoops(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)\r
9699\r
9700\r
9701//================================================================================================================================\r
9702\r
9703\r
9704void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrectionTermsForNUA(TString type, TString ptOrEta)\r
9705{\r
9706 // Compare corrections temrs for non-uniform acceptance needed for diff. flow calculated with nested loops and those calculated from Q-vectors\r
9707 \r
9708 Int_t typeFlag = -1;\r
9709 Int_t ptEtaFlag = -1;\r
9710 if(type == "RP")\r
9711 {\r
9712 typeFlag = 0;\r
9713 } else if(type == "POI")\r
9714 {\r
9715 typeFlag = 1;\r
9716 } \r
9717 if(ptOrEta == "Pt")\r
9718 {\r
9719 ptEtaFlag = 0;\r
9720 } else if(ptOrEta == "Eta")\r
9721 {\r
9722 ptEtaFlag = 1;\r
9723 } \r
9724 // shortcuts:\r
9725 Int_t t = typeFlag;\r
9726 Int_t pe = ptEtaFlag;\r
9727 \r
9728 TString rpORpoiString[2] = {"RP ","POI"}; // to be improved (name in the same way as in the other methods, eventually promote to data member) \r
9729 TString ptORetaString[2] = {"pt","eta"}; // to be improved (name in the same way as in the other methods, eventually promote to data member) \r
9730 //TString sinCosFlag[2] = {"sin","cos"}; // to be improved (eventually promote to data member)\r
9731 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
9732 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
9733 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};\r
9734 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};\r
9735 \r
9736 Int_t crossCheckInPtEtaBinNo[2] = {fCrossCheckInPtBinNo,fCrossCheckInEtaBinNo};\r
9737 \r
9738 cout<<endl;\r
9739 cout<<" ******************************************"<<endl;\r
9740 cout<<" **** cross-checking the correction ****"<<endl;\r
46b94261 9741 cout<<" **** terms for non-uniform acceptance ****"<<endl;
9742 cout<<" **** for differential flow ("<<rpORpoiString[t]<<") ****"<<endl;\r
9743 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))\r
9744 {\r
9745 cout<<" **** (particle weights not used) ****"<<endl;\r
9746 } else\r
9747 {\r
9748 cout<<" **** (particle weights used) ****"<<endl;\r
9749 } \r
a5b7efd0 9750 cout<<" ******************************************"<<endl; \r
9751 cout<<endl;\r
9752 cout<<" "<<ptORetaString[pe]<<" bin: "<<lowerPtEtaEdge[pe]<<" <= "<<ptORetaString[pe]<<" < "<<upperPtEtaEdge[pe]<<endl;\r
9753 cout<<endl;\r
9754 \r
9755 for(Int_t cti=0;cti<4;cti++) // correction term index\r
9756 {\r
9757 for(Int_t sc=0;sc<2;sc++) // sin or cos terms\r
9758 {\r
9759 if(sc==0) // to be improved (this can be implemented better)\r
9760 { \r
9761 cout<<" "<<reducedCorrectionSinTerms[cti].Data()<<":"<<endl;\r
9762 } else\r
9763 {\r
9764 cout<<" "<<reducedCorrectionCosTerms[cti].Data()<<":"<<endl; \r
9765 }\r
9766 cout<<" from Q-vectors = "<<fDiffFlowCorrectionTermsForNUAPro[t][pe][sc][cti]->GetBinContent(crossCheckInPtEtaBinNo[pe])<<endl;\r
9767 cout<<" from nested loops = "<<fDiffFlowDirectCorrectionTermsForNUA[t][pe][sc][cti]->GetBinContent(1)<<endl;\r
9768 cout<<endl; \r
9769 } \r
9770 } // end of for(Int_t rci=0;rci<4;rci++)\r
9771\r
9772} // end of void AliFlowAnalysisWithQCumulants::CrossCheckDiffFlowCorrectionTermsForNUA(TString type, TString ptOrEta)\r
9773\r
9774\r
57340a27 9775//================================================================================================================================
9776
9777\r
9778void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights()\r
9779{\r
9780 // Calculate corrections using particle weights for non-uniform acceptance of the detector for no-name integrated flow (cos terms).\r
9781 \r
9782 // **********************************************************************\r
9783 // **** weighted corrections for non-uniform acceptance (cos terms): ****\r
9784 // **********************************************************************\r
9785
9786 // Remark 1: When particle weights are used the binning of fIntFlowCorrectionTermsForNUAPro[1] is organized as follows:\r
9787 //
9788 // 1st bin: <<w1 cos(n*(phi1))>> = cosP1nW1\r
9789 // 2nd bin: <<w1 w2 cos(n*(phi1+phi2))>> = cosP1nP1nW1W1\r
9790 // 3rd bin: <<w1 w2 w3 cos(n*(phi1-phi2-phi3))>> = cosP1nM1nM1nW1W1W1 \r
9791 // ...\r
9792
9793 // multiplicity (number of particles used to determine the reaction plane)\r
9794 Double_t dMult = (*fSMpk)(0,0);\r
9795 \r
9796 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n: \r
9797 Double_t dReQ1n1k = (*fReQ)(0,1);\r
9798 Double_t dReQ2n2k = (*fReQ)(1,2);\r
9799 //Double_t dReQ3n3k = (*fReQ)(2,3);\r
9800 //Double_t dReQ4n4k = (*fReQ)(3,4);\r
9801 Double_t dReQ1n3k = (*fReQ)(0,3);\r
9802 Double_t dImQ1n1k = (*fImQ)(0,1);\r
9803 Double_t dImQ2n2k = (*fImQ)(1,2);\r
9804 //Double_t dImQ3n3k = (*fImQ)(2,3);\r
9805 //Double_t dImQ4n4k = (*fImQ)(3,4);\r
9806 //Double_t dImQ1n3k = (*fImQ)(0,3);\r
9807\r
9808 // dMs are variables introduced in order to simplify some Eqs. bellow:\r
9809 //..............................................................................................\r
9810 Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j\r
9811 Double_t dM111 = (*fSMpk)(2,1)-3.*(*fSMpk)(0,2)*(*fSMpk)(0,1)
9812 + 2.*(*fSMpk)(0,3); // dM111 = sum_{i,j,k=1,i!=j!=k}^M w_i w_j w_k\r
9813 //..............................................................................................\r
9814 \r // 1-particle:\r
9815 Double_t cosP1nW1 = 0.; // <<w1 cos(n*(phi1))>>\r
9816 \r
9817 if(dMult>0 && (*fSMpk)(0,1) !=0.)\r
9818 {\r
9819 cosP1nW1 = dReQ1n1k/(*fSMpk)(0,1); \r
9820 \r
9821 // average weighted 1-particle correction (cos terms) for non-uniform acceptance for single event:\r
9822 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(1,cosP1nW1);\r
9823 \r
9824 // final average weighted 1-particle correction (cos terms) for non-uniform acceptance for all events:\r
9825 fIntFlowCorrectionTermsForNUAPro[1]->Fill(0.5,cosP1nW1,(*fSMpk)(0,1)); \r
9826 } \r
9827 \r
9828 // 2-particle:\r
9829 Double_t cosP1nP1nW1W1 = 0.; // <<w1 w2 cos(n*(phi1+phi2))>>\r
9830 \r
9831 if(dMult>1 && dM11 !=0.)\r
9832 {\r
9833 cosP1nP1nW1W1 = (pow(dReQ1n1k,2)-pow(dImQ1n1k,2)-dReQ2n2k)/dM11; \r
9834 \r
9835 // average weighted 2-particle correction (cos terms) for non-uniform acceptance for single event:\r
9836 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(2,cosP1nP1nW1W1);\r
9837 \r
9838 // final average weighted 2-particle correction (cos terms) for non-uniform acceptance for all events:\r
9839 fIntFlowCorrectionTermsForNUAPro[1]->Fill(1.5,cosP1nP1nW1W1,dM11); \r
9840 } \r
9841 \r
9842 // 3-particle:\r
9843 Double_t cosP1nM1nM1nW1W1W1 = 0.; // <<w1 w2 w3 cos(n*(phi1-phi2-phi3))>>\r
9844 \r
9845 if(dMult>2 && dM111 !=0.)\r
9846 {\r
9847 cosP1nM1nM1nW1W1W1 = (dReQ1n1k*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
9848 - dReQ1n1k*dReQ2n2k-dImQ1n1k*dImQ2n2k
9849 - 2.*((*fSMpk)(0,2))*dReQ1n1k
9850 + 2.*dReQ1n3k) \r
9851 / dM111; \r
9852 \r
9853 // average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for single event:\r
9854 fIntFlowCorrectionTermsForNUAEBE[1]->SetBinContent(3,cosP1nM1nM1nW1W1W1);\r
9855 \r
9856 // final average non-weighted 3-particle correction (cos terms) for non-uniform acceptance for all events:\r
9857 fIntFlowCorrectionTermsForNUAPro[1]->Fill(2.5,cosP1nM1nM1nW1W1W1,dM111); \r
9858 } \r
9859 \r
9860} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUACosTermsUsingParticleWeights()\r
9861\r
9862\r
a5b7efd0 9863//================================================================================================================================\r
57340a27 9864\r
9865\r
9866void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights()\r
9867{\r
9868 // calculate corrections using particle weights for non-uniform acceptance of the detector for no-name integrated flow (sin terms)\r
9869 \r
9870 // **********************************************************************\r
9871 // **** weighted corrections for non-uniform acceptance (sin terms): ****\r
9872 // **********************************************************************\r
9873
9874 // Remark 1: When particle weights are used the binning of fIntFlowCorrectionTermsForNUAPro[0] is organized as follows:\r
9875 //
9876 // 1st bin: <<w1 sin(n*(phi1))>> = sinP1nW1\r
9877 // 2nd bin: <<w1 w2 sin(n*(phi1+phi2))>> = sinP1nP1nW1W1\r
9878 // 3rd bin: <<w1 w2 w3 sin(n*(phi1-phi2-phi3))>> = sinP1nM1nM1nW1W1W1 \r
9879 // ...\r
9880
9881 // multiplicity (number of particles used to determine the reaction plane)\r
9882 Double_t dMult = (*fSMpk)(0,0);\r
9883 \r
9884 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n: \r
9885 Double_t dReQ1n1k = (*fReQ)(0,1);\r
9886 Double_t dReQ2n2k = (*fReQ)(1,2);\r
9887 //Double_t dReQ3n3k = (*fReQ)(2,3);\r
9888 //Double_t dReQ4n4k = (*fReQ)(3,4);\r
9889 //Double_t dReQ1n3k = (*fReQ)(0,3);\r
9890 Double_t dImQ1n1k = (*fImQ)(0,1);\r
9891 Double_t dImQ2n2k = (*fImQ)(1,2);\r
9892 //Double_t dImQ3n3k = (*fImQ)(2,3);\r
9893 //Double_t dImQ4n4k = (*fImQ)(3,4);\r
9894 Double_t dImQ1n3k = (*fImQ)(0,3);\r
9895\r
9896 // dMs are variables introduced in order to simplify some Eqs. bellow:\r
9897 //..............................................................................................\r
9898 Double_t dM11 = (*fSMpk)(1,1)-(*fSMpk)(0,2); // dM11 = sum_{i,j=1,i!=j}^M w_i w_j\r
9899 Double_t dM111 = (*fSMpk)(2,1)-3.*(*fSMpk)(0,2)*(*fSMpk)(0,1)
9900 + 2.*(*fSMpk)(0,3); // dM111 = sum_{i,j,k=1,i!=j!=k}^M w_i w_j w_k\r
9901 //..............................................................................................\r
9902 \r
9903 // 1-particle:\r
9904 Double_t sinP1nW1 = 0.; // <<w1 sin(n*(phi1))>>\r
9905 \r
9906 if(dMult>0 && (*fSMpk)(0,1) !=0.)\r
9907 {\r
9908 sinP1nW1 = dImQ1n1k/((*fSMpk)(0,1)); \r
9909 \r
9910 // average weighted 1-particle correction (sin terms) for non-uniform acceptance for single event:\r
9911 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(1,sinP1nW1);\r
9912 \r
9913 // final average weighted 1-particle correction (sin terms) for non-uniform acceptance for all events: \r
9914 fIntFlowCorrectionTermsForNUAPro[0]->Fill(0.5,sinP1nW1,(*fSMpk)(0,1)); \r
9915 } \r
9916 \r
9917 // 2-particle:\r
9918 Double_t sinP1nP1nW1W1 = 0.; // <<w1 w2 sin(n*(phi1+phi2))>>\r
9919 \r
9920 if(dMult>1 && dM11 !=0.)\r
9921 {\r
9922 sinP1nP1nW1W1 = (2.*dReQ1n1k*dImQ1n1k-dImQ2n2k)/dM11; \r
9923 \r
9924 // average weighted 2-particle correction (sin terms) for non-uniform acceptance for single event:\r
9925 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(2,sinP1nP1nW1W1);\r
9926 \r
9927 // final average weighted 1-particle correction (sin terms) for non-uniform acceptance for all events: \r
9928 fIntFlowCorrectionTermsForNUAPro[0]->Fill(1.5,sinP1nP1nW1W1,dM11); \r
9929 } \r
9930 \r
9931 // 3-particle:\r
9932 Double_t sinP1nM1nM1nW1W1W1 = 0.; // <<w1 w2 w3 sin(n*(phi1-phi2-phi3))>>\r
9933 \r
9934 if(dMult>2 && dM111 !=0.)\r
9935 {\r
9936 sinP1nM1nM1nW1W1W1 = (-dImQ1n1k*(pow(dReQ1n1k,2)+pow(dImQ1n1k,2))
9937 + dReQ1n1k*dImQ2n2k-dImQ1n1k*dReQ2n2k
9938 + 2.*((*fSMpk)(0,2))*dImQ1n1k
9939 - 2.*dImQ1n3k)\r
9940 / dM111; \r
9941 \r
9942 // average weighted 3-particle correction (sin terms) for non-uniform acceptance for single event:\r
9943 fIntFlowCorrectionTermsForNUAEBE[0]->SetBinContent(3,sinP1nM1nM1nW1W1W1);\r
9944 \r
9945 // final average weighted 3-particle correction (sin terms) for non-uniform acceptance for all events: \r
9946 fIntFlowCorrectionTermsForNUAPro[0]->Fill(2.5,sinP1nM1nM1nW1W1W1,dM111); \r
9947 } \r
9948 \r
9949} // end of AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrectionsForNUASinTermsUsingParticleWeights()\r
9950\r
9951\r
9952//================================================================================================================================
9953\r
9954\r
9955void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent)\r
9956{\r
9957 // Evaluate with nested loops correction terms for non-uniform acceptance for integrated flow (using the particle weights). \r
9958\r
9959 // Results are stored in profiles fIntFlowDirectCorrectionTermsForNUA[0] (sin terms) and
9960 // fIntFlowDirectCorrectionTermsForNUA[1] (cos terms).
9961 \r
9962 // Remark 1: When particle weights are used the binning of fIntFlowDirectCorrectionTermsForNUA[sc] is
9963 // organized as follows (sc stands for either sin or cos):\r
9964 //\r
9965 // 1st bin: <<w1 sc(n*(phi1))>> = scP1nW1\r
9966 // 2nd bin: <<w1 w2 sc(n*(phi1+phi2))>> = scP1nP1nW1W1\r
9967 // 3rd bin: <<w1 w2 w3 sc(n*(phi1-phi2-phi3))>> = scP1nM1nM1nW1W1W1 \r
3b552efe 9968 // ...
9969 \r
57340a27 9970 Int_t nPrim = anEvent->NumberOfTracks(); \r
9971 AliFlowTrackSimple *aftsTrack = NULL;\r
9972 //Double_t phi1=0., phi2=0., phi3=0., phi4=0., phi5=0., phi6=0., phi7=0., phi8=0.;\r
9973 //Double_t wPhi1=1., wPhi2=1., wPhi3=1., wPhi4=1., wPhi5=1., wPhi6=1., wPhi7=1., wPhi8=1.;\r
9974 Double_t phi1=0., phi2=0., phi3=0.;\r
9975 Double_t wPhi1=1., wPhi2=1., wPhi3=1.;\r
9976 Int_t n = fHarmonic; \r
9977 Int_t eventNo = (Int_t)fAvMultiplicity->GetBinEntries(1); // to be improved (is this casting safe in general?)\r
9978 Double_t dMult = (*fSMpk)(0,0);\r
9979 cout<<endl;\r
9980 cout<<"Correction terms for non-uniform acceptance: Event number: "<<eventNo<<", multiplicity is "<<dMult<<endl;\r
9981 if(dMult<1)\r
9982 {\r
9983 cout<<"... skipping this event (multiplicity too low) ..."<<endl;\r
9984 } else if (dMult>fMaxAllowedMultiplicity)\r
9985 {\r
9986 cout<<"... skipping this event (multiplicity too high) ..."<<endl;\r
9987 } else \r
9988 { \r
9989 cout<<"... evaluating nested loops (using particle weights) ..."<<endl;\r
9990 } \r
9991 \r
9992 // 1-particle correction terms using particle weights: \r
9993 if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)\r
9994 {\r
9995 for(Int_t i1=0;i1<nPrim;i1++)\r
9996 {\r
9997 aftsTrack=anEvent->GetTrack(i1);\r
9998 if(!(aftsTrack->InRPSelection())) continue;\r
9999 phi1=aftsTrack->Phi();\r
10000 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));\r
10001 // 1-particle correction terms using particle weights:
10002 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(0.5,sin(n*phi1),wPhi1); // <w1 sin(n*phi1)>\r
10003 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(0.5,cos(n*phi1),wPhi1); // <w1 cos(n*phi1)>\r
10004 } // end of for(Int_t i1=0;i1<nPrim;i1++)
10005 } // end of if(nPrim>=1 && nPrim<=fMaxAllowedMultiplicity)
10006
10007 // 2-particle correction terms using particle weights: \r
10008 if(nPrim>=2 && nPrim<=fMaxAllowedMultiplicity)\r
10009 {\r
10010 for(Int_t i1=0;i1<nPrim;i1++)\r
10011 {\r
10012 aftsTrack=anEvent->GetTrack(i1);\r
10013 if(!(aftsTrack->InRPSelection())) continue;\r
10014 phi1=aftsTrack->Phi();\r
10015 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));\r
10016 for(Int_t i2=0;i2<nPrim;i2++)\r
10017 {\r
10018 if(i2==i1)continue;\r
10019 aftsTrack=anEvent->GetTrack(i2);\r
10020 if(!(aftsTrack->InRPSelection())) continue;\r
10021 phi2=aftsTrack->Phi();\r
10022 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi()))); \r
10023 if(nPrim==2) cout<<i1<<" "<<i2<<"\r"<<flush;\r
10024 // 2-p correction terms using particle weights:
10025 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(1.5,sin(n*(phi1+phi2)),wPhi1*wPhi2); // <w1 w2 sin(n*(phi1+phi2))>\r
10026 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(1.5,cos(n*(phi1+phi2)),wPhi1*wPhi2); // <w1 w2 cos(n*(phi1+phi2))>\r
10027 } // end of for(Int_t i2=0;i2<nPrim;i2++)\r
10028 } // end of for(Int_t i1=0;i1<nPrim;i1++)\r
10029 } // end of if(nPrim>=2)\r
10030\r
10031 // 3-particle correction terms using particle weights: \r
10032 if(nPrim>=3 && nPrim<=fMaxAllowedMultiplicity)\r
10033 { \r
10034 for(Int_t i1=0;i1<nPrim;i1++)\r
10035 {\r
10036 aftsTrack=anEvent->GetTrack(i1);\r
10037 if(!(aftsTrack->InRPSelection())) continue;\r
10038 phi1=aftsTrack->Phi();\r
10039 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));\r
10040 for(Int_t i2=0;i2<nPrim;i2++)\r
10041 {\r
10042 if(i2==i1)continue;\r
10043 aftsTrack=anEvent->GetTrack(i2);\r
10044 if(!(aftsTrack->InRPSelection())) continue;\r
10045 phi2=aftsTrack->Phi();\r
10046 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));\r
10047 for(Int_t i3=0;i3<nPrim;i3++)\r
10048 {\r
10049 if(i3==i1||i3==i2)continue;\r
10050 aftsTrack=anEvent->GetTrack(i3);\r
10051 if(!(aftsTrack->InRPSelection())) continue;\r
10052 phi3=aftsTrack->Phi();\r
10053 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));\r
10054 if(nPrim==3) cout<<i1<<" "<<i2<<" "<<i3<<"\r"<<flush;\r
10055 // 3-p correction terms using particle weights:
10056 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[0]->Fill(2.5,sin(n*(phi1-phi2-phi3)),wPhi1*wPhi2*wPhi3); // <w1 w2 w3 sin(n*(phi1-phi2-phi3))>\r
10057 if(fUsePhiWeights) fIntFlowDirectCorrectionTermsForNUA[1]->Fill(2.5,cos(n*(phi1-phi2-phi3)),wPhi1*wPhi2*wPhi3); // <w1 w2 w3 cos(n*(phi1-phi2-phi3))>\r
10058 } // end of for(Int_t i3=0;i3<nPrim;i3++)\r
10059 } // end of for(Int_t i2=0;i2<nPrim;i2++)\r
10060 } // end of for(Int_t i1=0;i1<nPrim;i1++)\r
10061 } // end of if(nPrim>=3)\r
10062 \r
10063 /*
10064
10065 if(nPrim>=4 && nPrim<=fMaxAllowedMultiplicity)\r
10066 {\r
10067 // 4 nested loops multiparticle correlations using particle weights: \r
10068 for(Int_t i1=0;i1<nPrim;i1++)\r
10069 {\r
10070 aftsTrack=anEvent->GetTrack(i1);\r
10071 if(!(aftsTrack->InRPSelection())) continue;\r
10072 phi1=aftsTrack->Phi();\r
10073 if(fUsePhiWeights && fPhiWeights) wPhi1 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi1*fnBinsPhi/TMath::TwoPi())));\r
10074 for(Int_t i2=0;i2<nPrim;i2++)\r
10075 {\r
10076 if(i2==i1)continue;\r
10077 aftsTrack=anEvent->GetTrack(i2);\r
10078 if(!(aftsTrack->InRPSelection())) continue;\r
10079 phi2=aftsTrack->Phi();\r
10080 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi())));\r
10081 for(Int_t i3=0;i3<nPrim;i3++)\r
10082 {\r
10083 if(i3==i1||i3==i2)continue;\r
10084 aftsTrack=anEvent->GetTrack(i3);\r
10085 if(!(aftsTrack->InRPSelection())) continue;\r
10086 phi3=aftsTrack->Phi();\r
10087 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi())));\r
10088 for(Int_t i4=0;i4<nPrim;i4++)\r
10089 {\r
10090 if(i4==i1||i4==i2||i4==i3)continue;\r
10091 aftsTrack=anEvent->GetTrack(i4);\r
10092 if(!(aftsTrack->InRPSelection())) continue;\r
10093 phi4=aftsTrack->Phi();\r
10094 if(fUsePhiWeights && fPhiWeights) wPhi4 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi4*fnBinsPhi/TMath::TwoPi())));\r
10095 if(nPrim>=4) cout<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<"\r"<<flush; // to be improved (replace eventually this if statement with if(nPrim==4))\r
10096 // 4-p correlations using particle weights:\r
10097 if(fUsePhiWeights) fIntFlowDirectCorrelations->Fill(10.5,cos(n*phi1+n*phi2-n*phi3-n*phi4),wPhi1*wPhi2*wPhi3*wPhi4); \r
10098 // extra correlations: \r
10099 // 2-p extra correlations (do not appear if particle weights are not used):\r
10100 // ...\r
10101 // 3-p extra correlations (do not appear if particle weights are not used):\r
10102 // ...\r
10103 // 4-p extra correlations (do not appear if particle weights are not used):\r
10104 // ...\r
10105 } // end of for(Int_t i4=0;i4<nPrim;i4++) \r
10106 } // end of for(Int_t i3=0;i3<nPrim;i3++)\r
10107 } // end of for(Int_t i2=0;i2<nPrim;i2++)\r
10108 } // end of for(Int_t i1=0;i1<nPrim;i1++)\r
10109 } // end of if(nPrim>=4)\r
10110
10111 */\r
10112
10113 cout<<endl; \r
10114\r
10115} // end of void AliFlowAnalysisWithQCumulants::EvaluateIntFlowCorrectionsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent)\r
10116\r
10117\r
10118//================================================================================================================================
10119\r
10120\r
10121void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights(TString type, TString ptOrEta)\r
10122{\r
10123 // Calculate correction terms for non-uniform acceptance for differential flow (cos terms) using particle weights.\r
10124
57340a27 10125 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][1][cti], where cti runs as follows:\r
10126 //
46b94261 10127 // 0: <<cos n(psi)>>\r
10128 // 1: <<w2 cos n(psi1+phi2)>>\r
10129 // 2: <<w2 w3 cos n(psi1+phi2-phi3)>>\r
10130 // 3: <<w2 w3 cos n(psi1-phi2-phi3)>>\r
57340a27 10131 // 4:\r
10132 // 5:\r
10133 // 6:\r
10134 \r
57340a27 10135 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n: \r
10136 Double_t dReQ1n1k = (*fReQ)(0,1);\r
10137 Double_t dReQ2n2k = (*fReQ)(1,2);\r
46b94261 10138 //Double_t dReQ1n3k = (*fReQ)(0,3);\r
57340a27 10139 //Double_t dReQ4n4k = (*fReQ)(3,4);\r
10140 Double_t dImQ1n1k = (*fImQ)(0,1);\r
10141 Double_t dImQ2n2k = (*fImQ)(1,2);\r
46b94261 10142 //Double_t dImQ1n3k = (*fImQ)(0,3);\r
57340a27 10143 //Double_t dImQ4n4k = (*fImQ)(3,4);\r
10144
10145 // S^M_{p,k} (see .h file for the definition of fSMpk):\r
10146 Double_t dSM1p1k = (*fSMpk)(0,1);\r
10147 Double_t dSM1p2k = (*fSMpk)(0,2);\r
57340a27 10148 Double_t dSM2p1k = (*fSMpk)(1,1);\r
57340a27 10149\r
10150 Int_t t = -1; // type flag \r
10151 Int_t pe = -1; // ptEta flag\r
10152 \r
10153 if(type == "RP")\r
10154 {\r
10155 t = 0;\r
10156 } else if(type == "POI")\r
10157 {\r
10158 t = 1;\r
10159 }\r
10160\r
10161 if(ptOrEta == "Pt")\r
10162 {\r
10163 pe = 0;\r
10164 } else if(ptOrEta == "Eta")\r
10165 {\r
10166 pe = 1;\r
10167 }\r
10168 \r
10169 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
10170 Double_t minPtEta[2] = {fPtMin,fEtaMin};\r
10171 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};\r
10172 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};\r
46b94261 10173
57340a27 10174 // looping over all bins and calculating correction terms: \r
10175 for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
10176 {\r
10177 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin): \r
10178 Double_t p1n0kRe = 0.;\r
10179 Double_t p1n0kIm = 0.;\r
10180\r
10181 // number of POIs in particular pt or eta bin:\r
10182 Double_t mp = 0.;\r
10183\r
57340a27 10184 // 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 10185 Double_t q1n2kRe = 0.;\r
10186 Double_t q1n2kIm = 0.;\r
10187 Double_t q2n1kRe = 0.;\r
10188 Double_t q2n1kIm = 0.;\r
46b94261 10189
10190 // s_{1,1}, s_{1,2} // to be improved (add explanation) \r
57340a27 10191 Double_t s1p1k = 0.; \r
10192 Double_t s1p2k = 0.; \r
46b94261 10193
10194 // number of particles which are both RPs and POIs in particular pt or eta bin:\r
10195 Double_t mq = 0.;
10196 \r
10197 // M0111 from Eq. (118) in QC2c (to be improved (notation))\r
10198 Double_t dM01 = 0.;\r
10199 Double_t dM011 = 0.;\r
57340a27 10200
10201 if(type == "POI")\r
3b552efe 10202 { \r
57340a27 10203 // q_{m*n,k}:\r
46b94261 10204 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))\r
10205 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));\r
10206 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))\r
10207 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b)); \r
10208 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))\r
10209 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));\r
10210 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))\r
10211 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b)); \r
10212 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
10213
57340a27 10214 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.); \r
10215 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.); \r
57340a27 10216 }else if(type == "RP")\r
3b552efe 10217 {
57340a27 10218 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!)) \r
10219 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))\r
10220 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));\r
10221 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))\r
10222 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));\r
10223 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))\r
10224 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));\r
10225 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))\r
10226 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));\r
10227 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation) \r
10228 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.); \r
10229 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.); \r
3b552efe 10230 //s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.);
10231
10232 mq = fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here) \r
57340a27 10233 } \r
3b552efe 10234
10235 if(type == "POI")\r
10236 {
10237 // p_{m*n,k}:
10238 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))\r
10239 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));\r
10240 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b)) \r
10241 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
10242 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
10243 // M01 from Eq. (118) in QC2c (to be improved (notation)):\r
10244 dM01 = mp*dSM1p1k-s1p1k;
10245 dM011 = mp*(dSM2p1k-dSM1p2k)
10246 - 2.*(s1p1k*dSM1p1k-s1p2k);
10247
10248 // typeFlag = RP (0) or POI (1):
10249 t = 1;
10250 } else if(type == "RP")
10251 { \r
10252 // to be improved (cross-checked):\r
10253 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))\r
10254 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));\r
10255 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b)) \r
10256 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));\r
10257 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
10258 // M01 from Eq. (118) in QC2c (to be improved (notation)):\r
10259 dM01 = mp*dSM1p1k-s1p1k;
10260 dM011 = mp*(dSM2p1k-dSM1p2k)
10261 - 2.*(s1p1k*dSM1p1k-s1p2k);
10262 // typeFlag = RP (0) or POI (1): \r
10263 t = 0;
10264 }
57340a27 10265 \r
46b94261 10266 // <<cos n(psi1)>>:\r
10267 Double_t cosP1nPsi = 0.;\r
10268 if(mp)\r
57340a27 10269 {\r
46b94261 10270 cosP1nPsi = p1n0kRe/mp;\r
57340a27 10271 \r
46b94261 10272 // fill profile for <<cos n(psi1)>>:\r
10273 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi,mp);\r
10274 // histogram to store <cos n(psi1)> e-b-e (needed in some other methods):\r
10275 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][0]->SetBinContent(b,cosP1nPsi);\r
10276 } // end of if(mp)
57340a27 10277
46b94261 10278 // <<w2 cos n(psi1+phi2)>>:\r
10279 Double_t cosP1nPsiP1nPhiW2 = 0.;\r
10280 if(dM01)\r
10281 {\r
10282 cosP1nPsiP1nPhiW2 = (p1n0kRe*dReQ1n1k-p1n0kIm*dImQ1n1k-q2n1kRe)/(dM01);\r
10283 // fill profile for <<w2 cos n(psi1+phi2)>>:\r
10284 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsiP1nPhiW2,dM01);\r
10285 // histogram to store <w2 cos n(psi1+phi2)> e-b-e (needed in some other methods):\r
10286 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][1]->SetBinContent(b,cosP1nPsiP1nPhiW2);\r
10287 } // end of if(dM01) \r
57340a27 10288
46b94261 10289 // <<w2 w3 cos n(psi1+phi2-phi3)>>:\r
10290 Double_t cosP1nPsi1P1nPhi2MPhi3W2W3 = 0.;\r
10291 if(dM011)\r
10292 {\r
10293 cosP1nPsi1P1nPhi2MPhi3W2W3 = (p1n0kRe*(pow(dImQ1n1k,2.)+pow(dReQ1n1k,2.))
10294 - p1n0kRe*dSM1p2k
10295 - q2n1kRe*dReQ1n1k-q2n1kIm*dImQ1n1k
10296 - s1p1k*dReQ1n1k
10297 + 2.*q1n2kRe)
10298 / dM011;
57340a27 10299 // fill profile for <<w1 w2 w3 cos n(psi1+phi2)>>:\r
46b94261 10300 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1P1nPhi2MPhi3W2W3,dM011);\r
57340a27 10301 // histogram to store <w1 w2 w3 cos n(psi1+phi2)> e-b-e (needed in some other methods):\r
46b94261 10302 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][2]->SetBinContent(b,cosP1nPsi1P1nPhi2MPhi3W2W3);\r
10303 } // end of if(dM011) \r
10304 \r
10305 // <<w2 w3 cos n(psi1-phi2-phi3)>>:\r
10306 Double_t cosP1nPsi1M1nPhi2MPhi3W2W3 = 0.;\r
10307 if(dM011)\r
10308 {\r
10309 cosP1nPsi1M1nPhi2MPhi3W2W3 = (p1n0kRe*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))+2.*p1n0kIm*dReQ1n1k*dImQ1n1k\r
10310 - 1.*(p1n0kRe*dReQ2n2k+p1n0kIm*dImQ2n2k) \r
10311 - 2.*s1p1k*dReQ1n1k
10312 + 2.*q1n2kRe)\r
10313 / dM011;\r
57340a27 10314 // fill profile for <<w1 w2 w3 cos n(psi1+phi2)>>:\r
46b94261 10315 fDiffFlowCorrectionTermsForNUAPro[t][pe][1][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],cosP1nPsi1M1nPhi2MPhi3W2W3,dM011);\r
57340a27 10316 // histogram to store <w1 w2 w3 cos n(psi1+phi2)> e-b-e (needed in some other methods):\r
46b94261 10317 fDiffFlowCorrectionTermsForNUAEBE[t][pe][1][3]->SetBinContent(b,cosP1nPsi1M1nPhi2MPhi3W2W3);\r
10318 } // end of if(dM011) \r
57340a27 10319
10320 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
46b94261 10321
57340a27 10322} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUACosTermsUsingParticleWeights(TString type, TString ptOrEta)
10323
10324\r
10325//================================================================================================================================\r
10326\r
10327\r
10328void AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights(TString type, TString ptOrEta)\r
10329{\r
10330 // Calculate correction terms for non-uniform acceptance for differential flow (sin terms).\r
10331
57340a27 10332 // Results are stored in fDiffFlowCorrectionTermsForNUAPro[t][pe][0][cti], where cti runs as follows:\r
10333 // 0: <<sin n(psi1)>>\r
46b94261 10334 // 1: <<w2 sin n(psi1+phi2)>>\r
10335 // 2: <<w2 w3 sin n(psi1+phi2-phi3)>>\r
10336 // 3: <<w2 w3 sin n(psi1-phi2-phi3)>>:\r
57340a27 10337 // 4:\r
10338 // 5:\r
10339 // 6:\r
57340a27 10340 \r
46b94261 10341 // real and imaginary parts of weighted Q-vectors evaluated in harmonics n, 2n, 3n and 4n: \r
10342 Double_t dReQ1n1k = (*fReQ)(0,1);\r
10343 Double_t dReQ2n2k = (*fReQ)(1,2);\r
10344 //Double_t dReQ1n3k = (*fReQ)(0,3);\r
10345 //Double_t dReQ4n4k = (*fReQ)(3,4);\r
10346 Double_t dImQ1n1k = (*fImQ)(0,1);\r
10347 Double_t dImQ2n2k = (*fImQ)(1,2);\r
10348 //Double_t dImQ1n3k = (*fImQ)(0,3);\r
10349 //Double_t dImQ4n4k = (*fImQ)(3,4);\r
10350
10351 // S^M_{p,k} (see .h file for the definition of fSMpk):\r
10352 Double_t dSM1p1k = (*fSMpk)(0,1);\r
10353 Double_t dSM1p2k = (*fSMpk)(0,2);\r
10354 Double_t dSM2p1k = (*fSMpk)(1,1);\r
57340a27 10355\r
10356 Int_t t = -1; // type flag \r
10357 Int_t pe = -1; // ptEta flag\r
10358 \r
10359 if(type == "RP")\r
10360 {\r
10361 t = 0;\r
10362 } else if(type == "POI")\r
10363 {\r
10364 t = 1;\r
10365 }\r
10366\r
10367 if(ptOrEta == "Pt")\r
10368 {\r
10369 pe = 0;\r
10370 } else if(ptOrEta == "Eta")\r
10371 {\r
10372 pe = 1;\r
10373 }\r
10374 \r
10375 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};\r
10376 Double_t minPtEta[2] = {fPtMin,fEtaMin};\r
10377 //Double_t maxPtEta[2] = {fPtMax,fEtaMax};\r
10378 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};\r
10379\r
10380 // looping over all bins and calculating correction terms: \r
10381 for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
10382 {\r
10383 // real and imaginary parts of p_{m*n,0} (non-weighted Q-vector evaluated for POIs in particular pt or eta bin): \r
10384 Double_t p1n0kRe = 0.;\r
10385 Double_t p1n0kIm = 0.;\r
10386\r
10387 // number of POIs in particular pt or eta bin:\r
10388 Double_t mp = 0.;\r
10389\r
46b94261 10390 // 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
10391 Double_t q1n2kRe = 0.;\r
10392 Double_t q1n2kIm = 0.;\r
10393 Double_t q2n1kRe = 0.;\r
10394 Double_t q2n1kIm = 0.;\r
10395
10396 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation) \r
10397 Double_t s1p1k = 0.; \r
10398 Double_t s1p2k = 0.; \r
10399
57340a27 10400 // number of particles which are both RPs and POIs in particular pt or eta bin:\r
46b94261 10401 Double_t mq = 0.;
10402 \r
10403 // M0111 from Eq. (118) in QC2c (to be improved (notation))\r
10404 Double_t dM01 = 0.;\r
10405 Double_t dM011 = 0.;\r
10406\r
57340a27 10407 if(type == "POI")\r
3b552efe 10408 { \r
46b94261 10409 // q_{m*n,k}:\r
10410 q1n2kRe = fReRPQ1dEBE[2][pe][0][2]->GetBinContent(fReRPQ1dEBE[2][pe][0][2]->GetBin(b))\r
10411 * fReRPQ1dEBE[2][pe][0][2]->GetBinEntries(fReRPQ1dEBE[2][pe][0][2]->GetBin(b));\r
10412 q1n2kIm = fImRPQ1dEBE[2][pe][0][2]->GetBinContent(fImRPQ1dEBE[2][pe][0][2]->GetBin(b))\r
10413 * fImRPQ1dEBE[2][pe][0][2]->GetBinEntries(fImRPQ1dEBE[2][pe][0][2]->GetBin(b)); \r
10414 q2n1kRe = fReRPQ1dEBE[2][pe][1][1]->GetBinContent(fReRPQ1dEBE[2][pe][1][1]->GetBin(b))\r
10415 * fReRPQ1dEBE[2][pe][1][1]->GetBinEntries(fReRPQ1dEBE[2][pe][1][1]->GetBin(b));\r
10416 q2n1kIm = fImRPQ1dEBE[2][pe][1][1]->GetBinContent(fImRPQ1dEBE[2][pe][1][1]->GetBin(b))\r
10417 * fImRPQ1dEBE[2][pe][1][1]->GetBinEntries(fImRPQ1dEBE[2][pe][1][1]->GetBin(b)); \r
10418 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
10419
10420 s1p1k = pow(fs1dEBE[2][pe][1]->GetBinContent(b)*fs1dEBE[2][pe][1]->GetBinEntries(b),1.); \r
10421 s1p2k = pow(fs1dEBE[2][pe][2]->GetBinContent(b)*fs1dEBE[2][pe][2]->GetBinEntries(b),1.); \r
46b94261 10422 }else if(type == "RP")\r
3b552efe 10423 {
46b94261 10424 // q_{m*n,k}: (Remark: m=1 is 0, k=0 iz zero (to be improved!)) \r
10425 q1n2kRe = fReRPQ1dEBE[0][pe][0][2]->GetBinContent(fReRPQ1dEBE[0][pe][0][2]->GetBin(b))\r
10426 * fReRPQ1dEBE[0][pe][0][2]->GetBinEntries(fReRPQ1dEBE[0][pe][0][2]->GetBin(b));\r
10427 q1n2kIm = fImRPQ1dEBE[0][pe][0][2]->GetBinContent(fImRPQ1dEBE[0][pe][0][2]->GetBin(b))\r
10428 * fImRPQ1dEBE[0][pe][0][2]->GetBinEntries(fImRPQ1dEBE[0][pe][0][2]->GetBin(b));\r
10429 q2n1kRe = fReRPQ1dEBE[0][pe][1][1]->GetBinContent(fReRPQ1dEBE[0][pe][1][1]->GetBin(b))\r
10430 * fReRPQ1dEBE[0][pe][1][1]->GetBinEntries(fReRPQ1dEBE[0][pe][1][1]->GetBin(b));\r
10431 q2n1kIm = fImRPQ1dEBE[0][pe][1][1]->GetBinContent(fImRPQ1dEBE[0][pe][1][1]->GetBin(b))\r
10432 * fImRPQ1dEBE[0][pe][1][1]->GetBinEntries(fImRPQ1dEBE[0][pe][1][1]->GetBin(b));\r
10433 // s_{1,1}, s_{1,2} and s_{1,3} // to be improved (add explanation) \r
10434 s1p1k = pow(fs1dEBE[0][pe][1]->GetBinContent(b)*fs1dEBE[0][pe][1]->GetBinEntries(b),1.); \r
10435 s1p2k = pow(fs1dEBE[0][pe][2]->GetBinContent(b)*fs1dEBE[0][pe][2]->GetBinEntries(b),1.); \r
3b552efe 10436 //s1p3k = pow(fs1dEBE[0][pe][3]->GetBinContent(b)*fs1dEBE[0][pe][3]->GetBinEntries(b),1.); \r
10437 }
10438
10439 if(type == "POI")
10440 {
10441 // p_{m*n,k}:
10442 p1n0kRe = fReRPQ1dEBE[1][pe][0][0]->GetBinContent(fReRPQ1dEBE[1][pe][0][0]->GetBin(b))\r
10443 * fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b));\r
10444 p1n0kIm = fImRPQ1dEBE[1][pe][0][0]->GetBinContent(fImRPQ1dEBE[1][pe][0][0]->GetBin(b)) \r
10445 * fImRPQ1dEBE[1][pe][0][0]->GetBinEntries(fImRPQ1dEBE[1][pe][0][0]->GetBin(b));
10446 mp = fReRPQ1dEBE[1][pe][0][0]->GetBinEntries(fReRPQ1dEBE[1][pe][0][0]->GetBin(b)); // to be improved (cross-checked by accessing other profiles here)
10447 // M01 from Eq. (118) in QC2c (to be improved (notation)):\r
10448 dM01 = mp*dSM1p1k-s1p1k;
10449 dM011 = mp*(dSM2p1k-dSM1p2k)
10450 - 2.*(s1p1k*dSM1p1k-s1p2k);
10451 // typeFlag = RP (0) or POI (1):
10452 t = 1;
10453 } else if(type == "RP")\r
10454 {
10455 // to be improved (cross-checked):\r
10456 p1n0kRe = fReRPQ1dEBE[0][pe][0][0]->GetBinContent(fReRPQ1dEBE[0][pe][0][0]->GetBin(b))\r
10457 * fReRPQ1dEBE[0][pe][0][0]->GetBinEntries(fReRPQ1dEBE[0][pe][0][0]->GetBin(b));\r
10458 p1n0kIm = fImRPQ1dEBE[0][pe][0][0]->GetBinContent(fImRPQ1dEBE[0][pe][0][0]->GetBin(b)) \r
10459 * fImRPQ1dEBE[0][pe][0][0]->GetBinEntries(fImRPQ1dEBE[0][pe][0][0]->GetBin(b));\r
10460 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
10461 // M01 from Eq. (118) in QC2c (to be improved (notation)):\r
10462 dM01 = mp*dSM1p1k-s1p1k;
10463 dM011 = mp*(dSM2p1k-dSM1p2k)
10464 - 2.*(s1p1k*dSM1p1k-s1p2k); \r
10465 // typeFlag = RP (0) or POI (1): \r
10466 t = 0;
10467 }
10468
57340a27 10469 // <<sin n(psi1)>>:\r
10470 Double_t sinP1nPsi = 0.;\r
10471 if(mp)\r
10472 {\r
10473 sinP1nPsi = p1n0kIm/mp;\r
46b94261 10474 \r
57340a27 10475 // fill profile for <<sin n(psi1)>>:\r
10476 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][0]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi,mp);\r
10477 // histogram to store <sin n(psi1)> e-b-e (needed in some other methods):\r
10478 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][0]->SetBinContent(b,sinP1nPsi);\r
46b94261 10479 } // end of if(mp)
10480
10481 // <<w2 sin n(psi1+phi2)>>:\r
10482 Double_t sinP1nPsiP1nPhiW2 = 0.;\r
10483 if(dM01)\r
10484 {\r
10485 sinP1nPsiP1nPhiW2 = (p1n0kRe*dImQ1n1k+p1n0kIm*dReQ1n1k-q2n1kIm)/(dM01);\r
10486 // fill profile for <<w2 sin n(psi1+phi2)>>:\r
10487 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][1]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsiP1nPhiW2,dM01);\r
10488 // histogram to store <w2 sin n(psi1+phi2)> e-b-e (needed in some other methods):\r
10489 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][1]->SetBinContent(b,sinP1nPsiP1nPhiW2);\r
57340a27 10490 } // end of if(mp*dMult-mq) \r
46b94261 10491
10492 // <<w2 w3 sin n(psi1+phi2-phi3)>>:\r
10493 Double_t sinP1nPsi1P1nPhi2MPhi3W2W3 = 0.;\r
10494 if(dM011)\r
10495 {\r
10496 sinP1nPsi1P1nPhi2MPhi3W2W3 = (p1n0kIm*(pow(dImQ1n1k,2.)+pow(dReQ1n1k,2.))
10497 - p1n0kIm*dSM1p2k
10498 + q2n1kRe*dImQ1n1k-q2n1kIm*dReQ1n1k
10499 - s1p1k*dImQ1n1k
10500 + 2.*q1n2kIm)
10501 / dM011;
10502 // fill profile for <<w2 w3 sin n(psi1+phi2-phi3)>>:\r
10503 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][2]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1P1nPhi2MPhi3W2W3,dM011);\r
10504 // histogram to store <w2 w3 sin n(psi1+phi2-phi3)> e-b-e (needed in some other methods):\r
10505 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][2]->SetBinContent(b,sinP1nPsi1P1nPhi2MPhi3W2W3);\r
10506 } // end of if(dM011) \r
10507
10508 // <<w2 w3 sin n(psi1-phi2-phi3)>>:\r
10509 Double_t sinP1nPsi1M1nPhi2MPhi3W2W3 = 0.;\r
10510 if(dM011)\r
10511 {\r
10512 sinP1nPsi1M1nPhi2MPhi3W2W3 = (p1n0kIm*(pow(dReQ1n1k,2.)-pow(dImQ1n1k,2.))-2.*p1n0kRe*dReQ1n1k*dImQ1n1k\r
10513 + 1.*(p1n0kRe*dImQ2n2k-p1n0kIm*dReQ2n2k) \r
10514 + 2.*s1p1k*dImQ1n1k
10515 - 2.*q1n2kIm)\r
10516 / dM011;\r
10517 // fill profile for <<w2 w3 sin n(psi1-phi2-phi3)>>:\r
10518 fDiffFlowCorrectionTermsForNUAPro[t][pe][0][3]->Fill(minPtEta[pe]+(b-1)*binWidthPtEta[pe],sinP1nPsi1M1nPhi2MPhi3W2W3,dM011);\r
10519 // histogram to store <w2 w3 sin n(psi1-phi2-phi3)> e-b-e (needed in some other methods):\r
10520 fDiffFlowCorrectionTermsForNUAEBE[t][pe][0][3]->SetBinContent(b,sinP1nPsi1M1nPhi2MPhi3W2W3);\r
10521 } // end of if(dM011) \r
10522
57340a27 10523 } // end of for(Int_t b=1;b<=nBinsPtEta[pe];b++)\r
57340a27 10524
10525} // end of AliFlowAnalysisWithQCumulants::CalculateDiffFlowCorrectionsForNUASinTermsUsingParticleWeights(TString type, TString ptOrEta)\r
10526\r
10527\r
10528//================================================================================================================================\r
10529\r
10530 \r
10531void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)\r
10532{\r
10533 // Evaluate with nested loops correction terms for non-uniform acceptance
10534 // with using particle weights (both sin and cos terms) relevant for differential flow.\r
10535 \r
57340a27 10536 // Remark 1: "w1" in expressions bellow is a particle weight used only for particles which were
10537 // flagged both as POI and RP.
10538 // Remark 2: Reduced correction terms for non-uniform acceptance are evaluated in pt bin number fCrossCheckInPtBinNo \r
10539 // and eta bin number fCrossCheckInEtaBinNo both for RPs and POIs.\r
10540 // Remark 3: Results are stored in 1 bin profiles fDiffFlowDirectCorrections[t][pe][sc][cti], where first three indices runs as: \r
10541 // [0=RP,1=POI][0=Pt,1=Eta][0=sin terms,1=cos terms], whilst the cti (correction term index) runs as follows: \r
10542 // cti: \r
46b94261 10543 // 0: <<sc n(psi1)>>\r
10544 // 1: <<w2 sc n(psi1+phi2)>> \r
10545 // 2: <<w2 w3 sc n(psi1+phi2-phi3)>>\r
10546 // 3: <<w2 w3 sc n(psi1-phi2-phi3)>>\r
57340a27 10547 // 4:\r
10548 // 5:\r
10549 // 6:\r
46b94261 10550
57340a27 10551 Int_t typeFlag = -1;\r
10552 Int_t ptEtaFlag = -1;\r
10553 if(type == "RP")\r
10554 {\r
10555 typeFlag = 0;\r
10556 } else if(type == "POI")\r
10557 {\r
10558 typeFlag = 1;\r
10559 } \r
10560 if(ptOrEta == "Pt")\r
10561 {\r
10562 ptEtaFlag = 0;\r
10563 } else if(ptOrEta == "Eta")\r
10564 {\r
10565 ptEtaFlag = 1;\r
10566 } \r
10567 // shortcuts:\r
10568 Int_t t = typeFlag;\r
10569 Int_t pe = ptEtaFlag;\r
10570 \r
10571 Double_t lowerPtEtaEdge[2] = {fPtMin+(fCrossCheckInPtBinNo-1)*fPtBinWidth,fEtaMin+(fCrossCheckInEtaBinNo-1)*fEtaBinWidth};\r
10572 Double_t upperPtEtaEdge[2] = {fPtMin+fCrossCheckInPtBinNo*fPtBinWidth,fEtaMin+fCrossCheckInEtaBinNo*fEtaBinWidth};\r
10573 Double_t binWidthPtEta[2] = {fPtBinWidth,fEtaBinWidth};\r
10574 \r
10575 Int_t nPrim = anEvent->NumberOfTracks(); \r
10576 AliFlowTrackSimple *aftsTrack = NULL;\r
10577 \r
10578 Double_t psi1=0., phi2=0., phi3=0.;// phi4=0.;// phi5=0., phi6=0., phi7=0., phi8=0.;\r
46b94261 10579 Double_t wPhi2=1., wPhi3=1.;\r
10580
57340a27 10581 Int_t n = fHarmonic; \r
10582 \r
46b94261 10583 // 1'-particle correction terms:\r
57340a27 10584 for(Int_t i1=0;i1<nPrim;i1++)\r
10585 {\r
10586 aftsTrack=anEvent->GetTrack(i1);\r
3b552efe 10587 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
10588 if(typeFlag==1) // this is diff flow of POIs
10589 {\r
10590 if(ptOrEta == "Pt")\r
10591 { \r
10592 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;\r
10593 } else if (ptOrEta == "Eta")\r
10594 {\r
10595 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue; \r
10596 }
10597 } else // this is diff flow of RPs
10598 {
10599 if(ptOrEta == "Pt")\r
10600 { \r
10601 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;\r
10602 } else if (ptOrEta == "Eta")\r
10603 {\r
10604 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue; \r
10605 }
57340a27 10606 }\r
10607 psi1=aftsTrack->Phi(); \r
10608 // sin terms: \r
10609 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*psi1),1.); // <<sin(n*(psi1))>> \r
10610 // cos terms: \r
10611 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][0]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*psi1),1.); // <<cos(n*(psi1))>> \r
10612 }//end of for(Int_t i1=0;i1<nPrim;i1++)\r
10613 \r
46b94261 10614 // 2'-particle correction terms:\r
57340a27 10615 for(Int_t i1=0;i1<nPrim;i1++)\r
10616 {\r
10617 aftsTrack=anEvent->GetTrack(i1);\r
3b552efe 10618 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
10619 if(typeFlag==1) // this is diff flow of POIs
10620 {\r
10621 if(ptOrEta == "Pt")\r
10622 { \r
10623 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;\r
10624 } else if (ptOrEta == "Eta")\r
10625 {\r
10626 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue; \r
10627 }
10628 } else // this is diff flow of RPs
10629 {
10630 if(ptOrEta == "Pt")\r
10631 { \r
10632 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;\r
10633 } else if (ptOrEta == "Eta")\r
10634 {\r
10635 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue; \r
10636 }
57340a27 10637 }\r
10638 psi1=aftsTrack->Phi(); \r
10639 for(Int_t i2=0;i2<nPrim;i2++)\r
10640 {\r
10641 if(i2==i1) continue;\r
10642 aftsTrack=anEvent->GetTrack(i2);\r
10643 // RP condition (!(first) particle in the correlator must be RP):\r
10644 if(!(aftsTrack->InRPSelection())) continue;\r
46b94261 10645 phi2=aftsTrack->Phi();
10646 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi()))); \r
57340a27 10647 // sin terms: \r
46b94261 10648 fDiffFlowDirectCorrectionTermsForNUA[t][pe][0][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,sin(n*(psi1+phi2)),wPhi2); // <<w2 sin(n*(psi1+phi2))>> \r
57340a27 10649 // cos terms: \r
46b94261 10650 fDiffFlowDirectCorrectionTermsForNUA[t][pe][1][1]->Fill(lowerPtEtaEdge[pe]+binWidthPtEta[pe]/2.,cos(n*(psi1+phi2)),wPhi2); // <<w2 cos(n*(psi1+phi2))>> \r
57340a27 10651 }//end of for(Int_t i2=0;i2<nPrim;i2++)\r
10652 }//end of for(Int_t i1=0;i1<nPrim;i1++) \r
10653 \r
46b94261 10654 // 3'-particle correction terms:\r
57340a27 10655 for(Int_t i1=0;i1<nPrim;i1++)\r
10656 {\r
10657 aftsTrack=anEvent->GetTrack(i1);\r
3b552efe 10658 // POI condition (first particle in the correlator must be POI): // to be improved (this can be implemented much better)
10659 if(typeFlag==1) // this is diff flow of POIs
10660 {\r
10661 if(ptOrEta == "Pt")\r
10662 { \r
10663 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue;\r
10664 } else if (ptOrEta == "Eta")\r
10665 {\r
10666 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InPOISelection())))continue; \r
10667 }
10668 } else // this is diff flow of RPs
10669 {
10670 if(ptOrEta == "Pt")\r
10671 { \r
10672 if(!((aftsTrack->Pt()>=lowerPtEtaEdge[pe] && aftsTrack->Pt()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue;\r
10673 } else if (ptOrEta == "Eta")\r
10674 {\r
10675 if(!((aftsTrack->Eta()>=lowerPtEtaEdge[pe] && aftsTrack->Eta()<upperPtEtaEdge[pe]) && (aftsTrack->InRPSelection())))continue; \r
10676 }
57340a27 10677 }\r
10678 psi1=aftsTrack->Phi();\r
10679 for(Int_t i2=0;i2<nPrim;i2++)\r
10680 {\r
10681 if(i2==i1) continue;\r
10682 aftsTrack=anEvent->GetTrack(i2);\r
10683 // RP condition (!(first) particle in the correlator must be RP):\r
10684 if(!(aftsTrack->InRPSelection())) continue;\r
10685 phi2=aftsTrack->Phi();\r
46b94261 10686 if(fUsePhiWeights && fPhiWeights) wPhi2 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi2*fnBinsPhi/TMath::TwoPi()))); \r
57340a27 10687 for(Int_t i3=0;i3<nPrim;i3++)\r
10688 {\r
10689 if(i3==i1||i3==i2) continue;\r
10690 aftsTrack=anEvent->GetTrack(i3);\r
10691 // RP condition (!(first) particle in the correlator must be RP):\r
10692 if(!(aftsTrack->InRPSelection())) continue;\r
10693 phi3=aftsTrack->Phi();\r
46b94261 10694 if(fUsePhiWeights && fPhiWeights) wPhi3 = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(phi3*fnBinsPhi/TMath::TwoPi()))); \r
57340a27 10695 // sin terms: \r
46b94261 10696 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
10697 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 10698 // cos terms: \r
46b94261 10699 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
10700 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 10701 }//end of for(Int_t i3=0;i3<nPrim;i3++) \r
10702 }//end of for(Int_t i2=0;i2<nPrim;i2++) \r
46b94261 10703 }//end of for(Int_t i1=0;i1<nPrim;i1++)
57340a27 10704 \r
10705} // end of void AliFlowAnalysisWithQCumulants::EvaluateDiffFlowCorrectionTermsForNUAWithNestedLoopsUsingParticleWeights(AliFlowEventSimple* anEvent, TString type, TString ptOrEta)\r
10706\r
10707\r
10708
10709
10710