]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithCumulants.cxx
removing warnings
[u/mrichter/AliRoot.git] / PWG2 / FLOW / AliFlowCommon / AliFlowAnalysisWithCumulants.cxx
CommitLineData
2188af53 1/*************************************************************************
2* Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *
3* *
4* Author: The ALICE Off-line Project. *
5* Contributors are mentioned in the code where appropriate. *
6* *
7* Permission to use, copy, modify and distribute this software and its *
8* documentation strictly for non-commercial purposes is hereby granted *
9* without fee, provided that the above copyright notice appears in all *
10* copies and that both the copyright notice and this permission notice *
11* appear in the supporting documentation. The authors make no claims *
12* about the suitability of this software for any purpose. It is *
13* provided "as is" without express or implied warranty. *
14**************************************************************************/
15
d6130938 16/* $Id$ */
17
18/*************************************************
19 * Flow analysis with cumulants. In this class *
20 * cumulants are calculated by making use of the *
21 * formalism of generating functions proposed by *
22 * Ollitrault et al. *
23 * *
24 * Author: Ante Bilandzic *
25 * (abilandzic@gmail.com) *
26 *************************************************/
2188af53 27
f1d945a1 28#define AliFlowAnalysisWithCumulants_cxx
29
30#include "Riostream.h"
929098e4 31#include "TMath.h"
f1d945a1 32#include "TFile.h"
929098e4 33#include "TList.h"
aaebd73d 34#include "TProfile.h"
35#include "TProfile2D.h"
36#include "TProfile3D.h"
929098e4 37#include "TH1F.h"
38#include "TH1D.h"
d6130938 39#include "TMatrixD.h"
40#include "TVectorD.h"
929098e4 41
42#include "AliFlowCommonConstants.h"
43#include "AliFlowCommonHist.h"
44#include "AliFlowCommonHistResults.h"
f1d945a1 45#include "AliFlowEventSimple.h"
46#include "AliFlowTrackSimple.h"
47#include "AliFlowAnalysisWithCumulants.h"
929098e4 48#include "AliFlowVector.h"
f1d945a1 49
2188af53 50//================================================================================================================
f1d945a1 51
52ClassImp(AliFlowAnalysisWithCumulants)
53
d6130938 54AliFlowAnalysisWithCumulants::AliFlowAnalysisWithCumulants():
2188af53 55 fHistList(NULL),
d6130938 56 fHistListName(NULL),
57 fAnalysisSettings(NULL),
58 fCommonHists(NULL),
52021ae2 59 fCommonHistsResults2nd(NULL),
60 fCommonHistsResults4th(NULL),
61 fCommonHistsResults6th(NULL),
62 fCommonHistsResults8th(NULL),
d6130938 63 fnBinsPhi(0),
64 fPhiMin(0),
65 fPhiMax(0),
66 fPhiBinWidth(0),
67 fnBinsPt(0),
68 fPtMin(0),
69 fPtMax(0),
70 fPtBinWidth(0),
71 fnBinsEta(0),
72 fEtaMin(0),
73 fEtaMax(0),
74 fEtaBinWidth(0),
75 fHarmonic(2),
76 fMultiple(1),
77 fR0(2.2),
78 fWeightsList(NULL),
e5e75b58 79 fUsePhiWeights(kFALSE),
80 fUsePtWeights(kFALSE),
9dd53ff2 81 fUseEtaWeights(kFALSE),
d6130938 82 fPhiWeights(NULL),
83 fPtWeights(NULL),
84 fEtaWeights(NULL),
85 fMultiplicityWeight(NULL),
86 fReferenceFlowList(NULL),
87 fReferenceFlowProfiles(NULL),
88 fReferenceFlowResults(NULL),
89 fReferenceFlowFlags(NULL),
3688e459 90 fCalculateVsMultiplicity(kFALSE),
d6130938 91 fnBinsMult(10000),
92 fMinMult(0.),
93 fMaxMult(10000.),
94 fGEBE(NULL),
95 fReferenceFlowGenFun(NULL),
96 fQvectorComponents(NULL),
97 fAverageOfSquaredWeight(NULL),
3688e459 98 fReferenceFlowGenFunVsM(NULL),
99 fQvectorComponentsVsM(NULL),
100 fAverageOfSquaredWeightVsM(NULL),
101 fAvMVsM(NULL),
d6130938 102 fAvM(0.),
103 fnEvts(0),
104 fReferenceFlowCumulants(NULL),
105 fReferenceFlow(NULL),
106 fChi(NULL),
107 fDiffFlowList(NULL),
108 fDiffFlowProfiles(NULL),
109 fDiffFlowResults(NULL),
110 fDiffFlowFlags(NULL),
111 fTuningList(NULL),
112 fTuningProfiles(NULL),
113 fTuningResults(NULL),
114 fTuningFlags(NULL),
3688e459 115 fTuneParameters(kFALSE),
116 fTuningAvM(NULL)
52021ae2 117 {
d6130938 118 // Constructor.
119
120 // Base list to hold all output objects:
121 fHistList = new TList();
122 fHistListName = new TString("cobjGFC");
123 fHistList->SetName(fHistListName->Data());
124 fHistList->SetOwner(kTRUE);
125
d6130938 126 // Multiplicity weight:
127 fMultiplicityWeight = new TString("unit");
128
129 // Initialize all arrays:
130 this->InitializeArrays();
813a4157 131
d6130938 132} // end of AliFlowAnalysisWithCumulants::AliFlowAnalysisWithCumulants()
133
134//================================================================================================================
f1d945a1 135
2188af53 136AliFlowAnalysisWithCumulants::~AliFlowAnalysisWithCumulants()
137{
d6130938 138 // Desctructor.
139
2188af53 140 delete fHistList;
d6130938 141
142} // end of AliFlowAnalysisWithCumulants::~AliFlowAnalysisWithCumulants()
729ec982 143
2188af53 144//================================================================================================================
145
e5e75b58 146void AliFlowAnalysisWithCumulants::Init()
2188af53 147{
d6130938 148 // Initialize and book all objects.
149
150 // a) Cross check if the user settings make sense before starting;
151 // b) Access all common constants;
152 // c) Book and fill weights histograms;
153 // d) Book and nest all lists in the base list fHistList;
154 // e) Book and fill profile holding analysis settings;
155 // f) Book common control and results histograms;
156 // g) Store flags for reference flow;
157 // h) Store flags for differential flow;
3688e459 158 // i) Book all objects needed for tuning;
159 // j) Book all objects needed for calculation versus multiplicity.
aaebd73d 160
489d5531 161 //save old value and prevent histograms from being added to directory
162 //to avoid name clashes in case multiple analaysis objects are used
163 //in an analysis
164 Bool_t oldHistAddStatus = TH1::AddDirectoryStatus();
165 TH1::AddDirectory(kFALSE);
166
d6130938 167 this->CrossCheckSettings();
168 this->AccessConstants();
3688e459 169 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights){this->BookAndFillWeightsHistograms();}
d6130938 170 this->BookAndNestAllLists();
171 this->BookProfileHoldingSettings();
172 this->BookCommonHistograms();
173 this->BookEverythingForReferenceFlow();
174 this->BookEverythingForDiffFlow();
175 this->StoreReferenceFlowFlags();
176 this->StoreDiffFlowFlags();
177 if(fTuneParameters){this->BookEverythingForTuning();}
3688e459 178 if(fCalculateVsMultiplicity){this->BookEverythingForCalculationVsMultiplicity();}
52021ae2 179
d6130938 180 (fCommonHists->GetHarmonic())->Fill(0.5,fHarmonic); // to be improved (moved somewhere else?)
52021ae2 181
489d5531 182 TH1::AddDirectory(oldHistAddStatus);
d6130938 183
184} // end of void AliFlowAnalysisWithCumulants::Init()
2188af53 185
186//================================================================================================================
187
188void AliFlowAnalysisWithCumulants::Make(AliFlowEventSimple* anEvent)
189{
d6130938 190 // Running over data only in this method.
cb308e83 191
d6130938 192 // a) Check all pointers used in this method;
193 // b) If tuning enabled, fill generating functions for different values of tuning parameters;
194 // c) For default values of tuning parameters (r0 = 2.2 and cutoff at 10th order):
195 // c1) Fill common control histograms;
196 // c2) Fill generating function for reference flow;
197 // c3) Fill profile holding average values of various Q-vector components;
198 // c4) Fill generating function for differential flow.
e5e75b58 199
d6130938 200 this->CheckPointersUsedInMake();
3688e459 201 if(fTuneParameters) {this->FillGeneratingFunctionsForDifferentTuningParameters(anEvent);}
d6130938 202 Int_t nRP = anEvent->GetEventNSelTracksRP(); // number of RPs (i.e. number of particles used to determine the reaction plane)
203 if(nRP<10) {return;} // generating function formalism make sense only for nRPs >= 10 for default settings
204 fCommonHists->FillControlHistograms(anEvent);
205 this->FillGeneratingFunctionForReferenceFlow(anEvent);
206 this->FillQvectorComponents(anEvent);
207 this->FillGeneratingFunctionForDiffFlow(anEvent);
208
209} // end of void AliFlowAnalysisWithCumulants::Make()
210
211//================================================================================================================
212
213void AliFlowAnalysisWithCumulants::Finish()
214{
215 // Calculate the final results.
9dd53ff2 216
d6130938 217 // a) Check all pointers used in this method;
0dd3b008 218 // b) Access all common constants;
219 // c) Access settings for analysis with Generating Function Cumulants;
220 // d) From relevant common control histogram get average multiplicity of RPs and number of events;
221 // e) Calculate cumulants for reference flow;
222 // f) Calculate from isotropic cumulants reference flow;
223 // g) Calculate error for reference flow estimates;
224 // h) Store the final results for reference flow in common hist results;
225 // i) Print on the screen the final results for reference flow;
226 // j) Calculate cumulants for differential flow;
227 // k) Calculate differential flow for RPs/POIs vs pt/eta from cumulants;
228 // l) Calculate integrated flow of RPs and POIs;
229 // m) Print on the screen the final results for integrated flow of RPs and POIs;
230 // n) If tuning enabled, calculate results for different tuning parameters.
e5e75b58 231
d6130938 232 this->CheckPointersUsedInFinish();
0dd3b008 233 this->AccessConstants();
d6130938 234 this->AccessSettings();
235 this->GetAvMultAndNoOfEvts();
236 this->CalculateCumulantsForReferenceFlow();
237 this->CalculateReferenceFlow();
238 this->CalculateReferenceFlowError();
239 this->FillCommonHistResultsForReferenceFlow();
240 if(fPrintFinalResults[0]){this->PrintFinalResults("RF");}
241 this->CalculateCumulantsForDiffFlow("RP","pt");
242 this->CalculateCumulantsForDiffFlow("RP","eta");
243 this->CalculateCumulantsForDiffFlow("POI","pt");
244 this->CalculateCumulantsForDiffFlow("POI","eta");
245 this->CalculateDifferentialFlow("RP","pt");
246 this->CalculateDifferentialFlow("RP","eta");
247 this->CalculateDifferentialFlow("POI","pt");
248 this->CalculateDifferentialFlow("POI","eta");
249 this->CalculateDifferentialFlowErrors("RP","pt");
250 this->CalculateDifferentialFlowErrors("RP","eta");
251 this->CalculateDifferentialFlowErrors("POI","pt");
252 this->CalculateDifferentialFlowErrors("POI","eta");
253 this->FillCommonHistResultsForDifferentialFlow("RP");
254 this->FillCommonHistResultsForDifferentialFlow("POI");
255 this->CalculateIntegratedFlow("RP");
256 this->CalculateIntegratedFlow("POI");
257 if(fPrintFinalResults[1]){this->PrintFinalResults("RP");}
258 if(fPrintFinalResults[2]){this->PrintFinalResults("POI");}
259 if(fTuneParameters){this->FinalizeTuning();}
260
261} // end of void AliFlowAnalysisWithCumulants::Finish()
262
263//================================================================================================================
264
265void AliFlowAnalysisWithCumulants::FinalizeTuning()
266{
267 // Finalize results with tuned inerpolating parameters.
268
269 for(Int_t r=0;r<10;r++)
270 {
271 if(TMath::Abs(fTuningR0[r])<1.e-10) continue; // protection against division by r0 bellow
272 for(Int_t pq=0;pq<5;pq++)
273 {
274 Int_t pMax = fTuningGenFun[r][pq]->GetXaxis()->GetNbins();
275 Int_t qMax = fTuningGenFun[r][pq]->GetYaxis()->GetNbins();
3688e459 276 fAvM = fTuningAvM->GetBinContent(pq+1);
d6130938 277 // <G[p][q]>
278 TMatrixD dAvG(pMax,qMax);
279 dAvG.Zero();
280 Bool_t someAvGEntryIsNegative = kFALSE;
281 for(Int_t p=0;p<pMax;p++)
282 {
283 for(Int_t q=0;q<qMax;q++)
284 {
285 dAvG(p,q) = fTuningGenFun[r][pq]->GetBinContent(fTuningGenFun[r][pq]->GetBin(p+1,q+1));
286 if(dAvG(p,q)<0.)
287 {
288 someAvGEntryIsNegative = kTRUE;
289 cout<<endl;
290 cout<<" WARNING: "<<Form("<G[%d][%d]> is negative !!!! GFC results are meaningless for r0 = %f, pq = %i.",p,q,fTuningR0[r],pq)<<endl;
291 cout<<endl;
292 }
293 }
294 }
295 // C[p][q] (generating function for the cumulants)
296 TMatrixD dC(pMax,qMax);
297 dC.Zero();
298 if(fAvM>0. && !someAvGEntryIsNegative)
299 {
300 for(Int_t p=0;p<pMax;p++)
301 {
302 for(Int_t q=0;q<qMax;q++)
303 {
304 dC(p,q) = fAvM*(pow(dAvG(p,q),(1./fAvM))-1.);
305 }
306 }
307 }
308 // Averaging the generating function for cumulants over azimuth
309 // in order to eliminate detector effects.
310 // <C[p][q]> (Remark: here <> stands for average over azimuth):
311 TVectorD dAvC(pMax);
312 dAvC.Zero();
313 for(Int_t p=0;p<pMax;p++)
314 {
315 Double_t temp = 0.;
316 for(Int_t q=0;q<qMax;q++)
317 {
318 temp += 1.*dC(p,q);
319 }
320 dAvC[p] = temp/qMax;
321 }
322 // Finally, the isotropic cumulants for reference flow and reference flow itself:
323 TVectorD cumulant(pMax);
324 cumulant.Zero();
325 TVectorD flow(pMax);
326 flow.Zero();
327 if(pMax==2)
328 {
329 cumulant[0]=(1./(fTuningR0[r]*fTuningR0[r]))*(2.*dAvC[0]-(1./2.)*dAvC[1]);
330 cumulant[1]=(2./pow(fTuningR0[r],4.))*((-2.)*dAvC[0]+1.*dAvC[1]);
331 if(cumulant[0]>=0.) {flow[0] = pow(cumulant[0],1./2.);}
332 if(cumulant[1]<=0.) {flow[1] = pow(-1.*cumulant[1],1./4.);}
333 }
334 else if(pMax==3)
335 {
336 cumulant[0] = (1./(fTuningR0[r]*fTuningR0[r]))*(3.*dAvC[0]-(3./2.)*dAvC[1]+(1./3.)*dAvC[2]);
337 cumulant[1] = (2./pow(fTuningR0[r],4.))*((-5.)*dAvC[0]+4.*dAvC[1]-1.*dAvC[2]);
338 cumulant[2] = (6./pow(fTuningR0[r],6.))*(3.*dAvC[0]-3.*dAvC[1]+1.*dAvC[2]);
339 if(cumulant[0]>=0.) {flow[0] = pow(cumulant[0],1./2.);}
340 if(cumulant[1]<=0.) {flow[1] = pow(-1.*cumulant[1],1./4.);}
341 if(cumulant[2]>=0.) {flow[2] = pow((1./4.)*cumulant[2],1./6.);}
342 }
343 else if(pMax==4)
344 {
345 cumulant[0] = (1./(fTuningR0[r]*fTuningR0[r]))*(4.*dAvC[0]-3.*dAvC[1]+(4./3.)*dAvC[2]-(1./4.)*dAvC[3]);
346 cumulant[1] = (1./pow(fTuningR0[r],4.))*((-52./3.)*dAvC[0]+19.*dAvC[1]-(28./3.)*dAvC[2]+(11./6.)*dAvC[3]);
347 cumulant[2] = (3./pow(fTuningR0[r],6.))*(18.*dAvC[0]-24.*dAvC[1]+14.*dAvC[2]-3.*dAvC[3]);
348 cumulant[3] = (24./pow(fTuningR0[r],8.))*((-4.)*dAvC[0]+6.*dAvC[1]-4.*dAvC[2]+1.*dAvC[3]);
349 if(cumulant[0]>=0.) {flow[0] = pow(cumulant[0],1./2.);}
350 if(cumulant[1]<=0.) {flow[1] = pow(-1.*cumulant[1],1./4.);}
351 if(cumulant[2]>=0.) {flow[2] = pow((1./4.)*cumulant[2],1./6.);}
352 if(cumulant[3]<=0.) {flow[3] = pow((-1./33.)*cumulant[3],1./8.);}
353 }
354 else if(pMax==5)
355 {
356 cumulant[0] = (-1./(60*fTuningR0[r]*fTuningR0[r]))*((-300.)*dAvC[0]+300.*dAvC[1]-200.*dAvC[2]+75.*dAvC[3]-12.*dAvC[4]);
357 cumulant[1] = (-1./(6.*pow(fTuningR0[r],4.)))*(154.*dAvC[0]-214.*dAvC[1]+156.*dAvC[2]-61.*dAvC[3]+10.*dAvC[4]);
358 cumulant[2] = (3./(2.*pow(fTuningR0[r],6.)))*(71.*dAvC[0]-118.*dAvC[1]+98.*dAvC[2]-41.*dAvC[3]+7.*dAvC[4]);
359 cumulant[3] = (-24./pow(fTuningR0[r],8.))*(14.*dAvC[0]-26.*dAvC[1]+24.*dAvC[2]-11.*dAvC[3]+2.*dAvC[4]);
360 cumulant[4] = (120./pow(fTuningR0[r],10.))*(5.*dAvC[0]-10.*dAvC[1]+10.*dAvC[2]-5.*dAvC[3]+1.*dAvC[4]);
361 if(cumulant[0]>=0.) {flow[0] = pow(cumulant[0],1./2.);}
362 if(cumulant[1]<=0.) {flow[1] = pow(-1.*cumulant[1],1./4.);}
363 if(cumulant[2]>=0.) {flow[2] = pow((1./4.)*cumulant[2],1./6.);}
364 if(cumulant[3]<=0.) {flow[3] = pow((-1./33.)*cumulant[3],1./8.);}
365 if(cumulant[4]>=0.) {flow[4] = pow((1./456.)*cumulant[4],1./10.);}
366 }
367 else if(pMax==8)
368 {
369 cumulant[0] = (1./(fTuningR0[r]*fTuningR0[r]))*(8.*dAvC[0]-14.*dAvC[1]+(56./3.)*dAvC[2]-(35./2.)*dAvC[3]
370 + (56./5.)*dAvC[4]-(14./3.)*dAvC[5]+(8./7.)*dAvC[6]-(1./8.)*dAvC[7]);
371 cumulant[1] = (1./pow(fTuningR0[r],4.))*((-1924./35.)*dAvC[0]+(621./5.)*dAvC[1]-(8012./45.)*dAvC[2]
372 + (691./4.)*dAvC[3]-(564./5.)*dAvC[4]+(2143./45.)*dAvC[5]-(412./35.)*dAvC[6]+(363./280.)*dAvC[7]);
373 cumulant[2] = (1./pow(fTuningR0[r],6.))*(349.*dAvC[0]-(18353./20.)*dAvC[1]+(7173./5.)*dAvC[2]
374 - 1457.*dAvC[3]+(4891./5.)*dAvC[4]-(1683./4.)*dAvC[5]+(527./5.)*dAvC[6]-(469./40.)*dAvC[7]);
375 cumulant[3] = (1./pow(fTuningR0[r],8.))*((-10528./5.)*dAvC[0]+(30578./5.)*dAvC[1]-(51456./5.)*dAvC[2]
376 + 10993.*dAvC[3]-(38176./5.)*dAvC[4]+(16818./5.)*dAvC[5]-(4288./5.)*dAvC[6]+(967./10.)*dAvC[7]);
377 cumulant[4] = (1./pow(fTuningR0[r],10.))*(11500.*dAvC[0]-35800.*dAvC[1]+63900.*dAvC[2]-71600.*dAvC[3]
378 + 51620.*dAvC[4]-23400.*dAvC[5]+6100.*dAvC[6]-700.*dAvC[7]);
379 cumulant[5] = (1./pow(fTuningR0[r],12.))*(-52560.*dAvC[0]+172080.*dAvC[1]-321840.*dAvC[2]+376200.*dAvC[3]
380 - 281520.*dAvC[4]+131760.*dAvC[5]-35280.*dAvC[6]+4140.*dAvC[7]);
381 cumulant[6] = (1./pow(fTuningR0[r],14.))*(176400.*dAvC[0]-599760.*dAvC[1]+1164240.*dAvC[2]-1411200.*dAvC[3]
382 + 1093680.*dAvC[4]-529200.*dAvC[5]+146160.*dAvC[6]-17640.*dAvC[7]);
383 cumulant[7] = (1./pow(fTuningR0[r],16.))*(-322560*dAvC[0]+1128960.*dAvC[1]-2257920.*dAvC[2]+2822400.*dAvC[3]
384 - 2257920.*dAvC[4]+1128960.*dAvC[5]-322560.*dAvC[6]+40320.*dAvC[7]);
385 if(cumulant[0]>=0.) {flow[0] = pow(cumulant[0],1./2.);}
386 if(cumulant[1]<=0.) {flow[1] = pow(-1.*cumulant[1],1./4.);}
387 if(cumulant[2]>=0.) {flow[2] = pow((1./4.)*cumulant[2],1./6.);}
388 if(cumulant[3]<=0.) {flow[3] = pow((-1./33.)*cumulant[3],1./8.);}
389 if(cumulant[4]>=0.) {flow[4] = pow((1./456.)*cumulant[4],1./10.);}
390 if(cumulant[5]<=0.) {flow[5] = pow((-1./9460.)*cumulant[5],1./12.);}
391 if(cumulant[6]>=0.) {flow[6] = pow((1./274800.)*cumulant[6],1./14.);}
392 if(cumulant[7]<=0.) {flow[7] = pow((-1./10643745.)*cumulant[7],1./16.);}
393 }
394 // Store cumulants and reference flow:
395 for(Int_t co=0;co<pMax;co++) // cumulant order
396 {
397 fTuningCumulants[r][pq]->SetBinContent(co+1,cumulant[co]);
398 fTuningFlow[r][pq]->SetBinContent(co+1,flow[co]);
399 }
400 } // end of for(Int_t pq=0;pq<5;pq++)
401 } // end of for(Int_t r=0;r<10;r++)
402
403} // end of void AliFlowAnalysisWithCumulants::FinalizeTuning()
e5e75b58 404
d6130938 405//================================================================================================================
406
407void AliFlowAnalysisWithCumulants::FillGeneratingFunctionsForDifferentTuningParameters(AliFlowEventSimple *anEvent)
408{
409 // Fill generating function for reference flow evaluated for different tuning parameters.
410
411 Int_t pMax[5] = {2,3,4,5,8};
412 Int_t qMax[5] = {5,7,9,11,17};
413
414 // Particle variables and weights:
415 Double_t dPhi = 0.; // azimuthal angle in the laboratory frame
416 Double_t dPt = 0.; // transverse momentum
417 Double_t dEta = 0.; // pseudorapidity
2f5e6dea 418 Double_t wPhi = 1.; // phi weight
419 Double_t wPt = 1.; // pt weight
420 Double_t wEta = 1.; // eta weight
d6130938 421
9f33751d 422 Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = total number of primary tracks, i.e. nPrim = nRP + nPOI, where:
d6130938 423 // nRP = # of particles used to determine the reaction plane;
9f33751d 424 // nPOI = # of particles of interest for a detailed flow analysis.
d6130938 425
426 Int_t nRP = anEvent->GetEventNSelTracksRP(); // nRP = # of particles used to determine the reaction plane;
3688e459 427 for(Int_t pq=0;pq<5;pq++)
428 {
429 if(nRP<2.*pMax[pq]) continue; // results doesn't make sense if nRP is smaller than serie's cutoff
430 fTuningAvM->Fill(pq+0.5,nRP,1.); // <M> for different classes of events }
431 }
432
d6130938 433 Double_t tuningGenFunEBE[10][5][8][17] = {{{{0.}}}};
434 for(Int_t r=0;r<10;r++)
e5e75b58 435 {
d6130938 436 for(Int_t pq=0;pq<5;pq++)
e5e75b58 437 {
d6130938 438 for(Int_t p=0;p<pMax[pq];p++)
e5e75b58 439 {
d6130938 440 for(Int_t q=0;q<qMax[pq];q++)
441 {
442 tuningGenFunEBE[r][pq][p][q] = 1.;
443 }
444 }
e5e75b58 445 }
d6130938 446 }
447
448 // Looping over tracks:
449 for(Int_t i=0;i<nPrim;i++)
450 {
451 AliFlowTrackSimple *aftsTrack = anEvent->GetTrack(i);
452 if(aftsTrack && aftsTrack->InRPSelection())
e5e75b58 453 {
d6130938 454 // Access particle variables and weights:
455 dPhi = aftsTrack->Phi();
456 dPt = aftsTrack->Pt();
457 dEta = aftsTrack->Eta();
458 if(fUsePhiWeights && fnBinsPhi) // determine phi weight for this particle:
e5e75b58 459 {
d6130938 460 wPhi = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*fnBinsPhi/TMath::TwoPi())));
e5e75b58 461 }
d6130938 462 if(fUsePtWeights && fnBinsPt) // determine pt weight for this particle:
463 {
464 wPt = fPtWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/fPtBinWidth)));
465 }
466 if(fUseEtaWeights && fEtaBinWidth) // determine eta weight for this particle:
467 {
468 wEta = fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/fEtaBinWidth)));
469 }
470 // Fill the generating functions:
471 for(Int_t r=0;r<10;r++) // 10 different values for interpolating parameter r0
472 {
473 if(TMath::Abs(fTuningR0[r])<1.e-10) continue;
474 for(Int_t pq=0;pq<5;pq++) // 5 different values for set (pMax,qMax)
475 {
3688e459 476 if(nRP<2.*pMax[pq]) continue; // results doesn't make sense if nRP is smaller than serie's cutoff
d6130938 477 for(Int_t p=0;p<pMax[pq];p++)
478 {
479 for(Int_t q=0;q<qMax[pq];q++)
480 {
481 tuningGenFunEBE[r][pq][p][q] *= (1.+wPhi*wPt*wEta*(2.*fTuningR0[r]*sqrt(p+1.)/nRP)*cos(fHarmonic*dPhi-2.*q*TMath::Pi()/qMax[pq]));
482 } // end of for(Int_t q=0;q<qMax[pq];q++)
483 } // end of for(Int_t p=0;p<pMax[pq];p++)
484 } // end for(Int_t pq=0;pq<5;pq++) // 5 different values for set (pMax,qMax)
485 } // end of for(Int_t r=0;r<10;r++) // 10 different values for interpolating parameter r0
486 } // end of if(aftsTrack && aftsTrack->InRPSelection())
487 } // end of for(Int_t i=0;i<nPrim;i++)
aaebd73d 488
d6130938 489 // Store G[p][q]:
490 for(Int_t r=0;r<10;r++)
491 {
492 for(Int_t pq=0;pq<5;pq++)
493 {
3688e459 494 if(nRP<2.*pMax[pq]) continue; // results doesn't make sense if nRP is smaller than serie's cutoff
d6130938 495 for(Int_t p=0;p<pMax[pq];p++)
496 {
497 for(Int_t q=0;q<qMax[pq];q++)
498 {
499 if(fTuningGenFun[r][pq]) {fTuningGenFun[r][pq]->Fill((Double_t)p,(Double_t)q,tuningGenFunEBE[r][pq][p][q],1.);}
500 }
501 }
502 }
503 }
f1d945a1 504
d6130938 505} // end of void AliFlowAnalysisWithCumulants::FillGeneratingFunctionsForDifferentTuningParameters(AliFlowEventSimple *anEvent)
506
507//================================================================================================================
508
509void AliFlowAnalysisWithCumulants::FillGeneratingFunctionForReferenceFlow(AliFlowEventSimple *anEvent)
510{
511 // Fill generating function for reference flow for current event.
512
0d11c335 513 if(!anEvent)
514 {
515 printf(" WARNING (GFC): anEvent is NULL !!!!");
516 return;
517 }
518
d6130938 519 // Particle variables and weights:
520 Double_t dPhi = 0.; // azimuthal angle in the laboratory frame
521 Double_t dPt = 0.; // transverse momentum
522 Double_t dEta = 0.; // pseudorapidity
523 Double_t wPhi = 1.; // phi weight
524 Double_t wPt = 1.; // pt weight
525 Double_t wEta = 1.; // eta weight
0d11c335 526
9f33751d 527 Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = total number of primary tracks, i.e. nPrim = nRP + nPOI, where:
d6130938 528 // nRP = # of particles used to determine the reaction plane;
9f33751d 529 // nPOI = # of particles of interest for a detailed flow analysis.
b6cd16a9 530
d6130938 531 Int_t nRP = anEvent->GetEventNSelTracksRP(); // nRP = # of particles used to determine the reaction plane;
a663ab5a 532 if(fCalculateVsMultiplicity){fAvMVsM->Fill(nRP+0.5,nRP,1.);}
d6130938 533
534 // Initializing the generating function G[p][q] for reference flow for current event:
535 Int_t pMax = fGEBE->GetNrows();
536 Int_t qMax = fGEBE->GetNcols();
537 for(Int_t p=0;p<pMax;p++)
17100608 538 {
d6130938 539 for(Int_t q=0;q<qMax;q++)
b6cd16a9 540 {
d6130938 541 (*fGEBE)(p,q) = 1.;
17100608 542 }
543 }
d6130938 544
545 // Cross-checking the number of RPs in current event:
546 Int_t crossCheckRP = 0;
b6cd16a9 547
d6130938 548 // Looping over tracks:
b6cd16a9 549 for(Int_t i=0;i<nPrim;i++)
550 {
d6130938 551 AliFlowTrackSimple *aftsTrack = anEvent->GetTrack(i);
552 if(aftsTrack && aftsTrack->InRPSelection())
b6cd16a9 553 {
d6130938 554 crossCheckRP++;
555 // Access particle variables and weights:
556 dPhi = aftsTrack->Phi();
557 dPt = aftsTrack->Pt();
558 dEta = aftsTrack->Eta();
559 if(fUsePhiWeights && fnBinsPhi) // determine phi weight for this particle:
560 {
561 wPhi = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*fnBinsPhi/TMath::TwoPi())));
2f5e6dea 562 }
d6130938 563 if(fUsePtWeights && fnBinsPt) // determine pt weight for this particle:
564 {
565 wPt = fPtWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/fPtBinWidth)));
566 }
567 if(fUseEtaWeights && fEtaBinWidth) // determine eta weight for this particle:
568 {
569 wEta = fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/fEtaBinWidth)));
570 }
571 // Fill the generating function:
572 for(Int_t p=0;p<pMax;p++)
b6cd16a9 573 {
d6130938 574 for(Int_t q=0;q<qMax;q++)
b6cd16a9 575 {
d6130938 576 (*fGEBE)(p,q) *= (1.+wPhi*wPt*wEta*(2.*fR0*sqrt(p+1.)/nRP)*cos(fHarmonic*dPhi-2.*q*TMath::Pi()/qMax));
f1d945a1 577 }
9dd53ff2 578 }
d6130938 579 // Fill the profile to calculate <<w^2>>:
580 fAverageOfSquaredWeight->Fill(0.5,pow(wPhi*wPt*wEta,2.),1.);
581 } // end of if(aftsTrack && aftsTrack->InRPSelection())
2f5e6dea 582 } // end of for(Int_t i=0;i<nPrim;i++)
b6cd16a9 583
d6130938 584 // Cross check # of RPs:
585 if(anEvent && (crossCheckRP != anEvent->GetEventNSelTracksRP()))
586 {
587 cout<<endl;
588 cout<<"WARNING (GFC): crossCheckRP != nRP in GFC::Make(). Something is wrong with RP flagging !!!!"<<endl;
589 cout<<endl;
590 exit(0);
591 }
592
593 // Storing the value of G[p][q] in 2D profile in order to get eventually the avarage <G[p][q]>:
594 // Determine first the event weight for G[p][q]:
595 // (to be improved - this can be implemented much better, this shall be executed only once out of Make(), eventWeight should be a data member)
596 Double_t eventWeight = 0.;
597 if(!strcmp(fMultiplicityWeight->Data(),"unit"))
598 {
599 eventWeight = 1.;
600 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
601 {
602 eventWeight = anEvent->GetEventNSelTracksRP();
603 }
604 // Store G[p][q] weighted appropriately:
605 for(Int_t p=0;p<pMax;p++)
b6cd16a9 606 {
d6130938 607 for(Int_t q=0;q<qMax;q++)
b6cd16a9 608 {
d6130938 609 fReferenceFlowGenFun->Fill((Double_t)p,(Double_t)q,(*fGEBE)(p,q),eventWeight);
a663ab5a 610 if(fCalculateVsMultiplicity){fReferenceFlowGenFunVsM->Fill(nRP+0.5,(Double_t)p,(Double_t)q,(*fGEBE)(p,q),eventWeight);}
b6cd16a9 611 }
612 }
2188af53 613
d6130938 614} // end of void AliFlowAnalysisWithCumulants::FillGeneratingFunctionForReferenceFlow(AliFlowEventSimple* anEvent)
615
616//================================================================================================================
617
618void AliFlowAnalysisWithCumulants::FillQvectorComponents(AliFlowEventSimple* anEvent)
619{
620 // Fill components of Q-vector for current event (needed for error calculation).
621
622 // Remark: Components are stored in profile fQvectorComponents whose binning is organized as follows:
623 // 1st bin: Q_x
624 // 2nd bin: Q_y
625 // 3rd bin: (Q_x)^2
626 // 4th bin: (Q_y)^2
627
628 AliFlowVector afv;
629 afv.Set(0.,0.);
630 afv.SetMult(0);
631
632 Int_t n = 2; // to be removed
633
634 if(anEvent)
2188af53 635 {
d6130938 636 afv = anEvent->GetQ(1*n,fWeightsList,fUsePhiWeights,fUsePtWeights,fUseEtaWeights); // get the Q-vector for this event
637 fQvectorComponents->Fill(0.5,afv.X(),1.); // in the 1st bin fill Q_x
638 fQvectorComponents->Fill(1.5,afv.Y(),1.); // in the 2nd bin fill Q_y
639 fQvectorComponents->Fill(2.5,pow(afv.X(),2.),1.); // in the 3rd bin fill (Q_x)^2
640 fQvectorComponents->Fill(3.5,pow(afv.Y(),2.),1.); // in the 4th bin fill (Q_y)^2
641 }
642
643} // end of void AliFlowAnalysisWithCumulants::FillQvectorComponents(AliFlowEventSimple* anEvent)
644
645//================================================================================================================
646
647void AliFlowAnalysisWithCumulants::FillGeneratingFunctionForDiffFlow(AliFlowEventSimple* anEvent)
648{
649 // Fill generating function for differential flow for the current event.
650
651 // Remark 0: Generating function D[b][p][q] is a complex number => real and imaginary part are calculated separately
652 // (b denotes pt or eta bin);
653 // Remark 1: Note that bellow G[p][q] is needed, the value of generating function for reference flow for the CURRENT event.
654 // This values is obtained in method FillGeneratingFunctionForReferenceFlow() as TMatrixD fGEBE;
655 // Remark 2: Results for D[b][p][q] are stored in 3D profiles fDiffFlowGenFun[0=Re,1=Im][0=RP,1=POI][0=pt,1=eta] in order to
656 // automatically get <Re(D[b][p][q])> and <Im(D[b][p][q])> at the end of the day.
657
658 // Particle variables and weights:
659 Double_t dPhi = 0.; // azimuthal angle in the laboratory frame
660 Double_t dPt = 0.; // transverse momentum
661 Double_t dEta = 0.; // pseudorapidity
662 Double_t wPhi = 1.; // phi weight
663 Double_t wPt = 1.; // pt weight
664 Double_t wEta = 1.; // eta weight
665
666 // pMax and qMax:
667 Int_t pMax = fGEBE->GetNrows();
668 Int_t qMax = fGEBE->GetNcols();
669
9f33751d 670 Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = total number of primary tracks, i.e. nPrim = nRP + nPOI, where:
d6130938 671 // nRP = # of particles used to determine the reaction plane;
9f33751d 672 // nPOI = # of particles of interest for a detailed flow analysis.
2188af53 673
d6130938 674 Int_t nRP = anEvent->GetEventNSelTracksRP(); // nRP = # of particles used to determine the reaction plane
675
676 // Start the second loop over event in order to evaluate the generating function D[b][p][q] for differential flow:
b6cd16a9 677 for(Int_t i=0;i<nPrim;i++)
678 {
d6130938 679 AliFlowTrackSimple *aftsTrack = anEvent->GetTrack(i);
680 if(aftsTrack)
b6cd16a9 681 {
d6130938 682 if(!(aftsTrack->InRPSelection() || aftsTrack->InPOISelection())) continue;
683 // Differential flow of POIs:
684 if(aftsTrack->InPOISelection())
b6cd16a9 685 {
d6130938 686 // Get azimuthal angle, momentum and pseudorapidity of a particle:
687 dPhi = aftsTrack->Phi();
688 dPt = aftsTrack->Pt();
689 dEta = aftsTrack->Eta();
690 Double_t ptEta[2] = {dPt,dEta};
b9639e20 691
d6130938 692 // Count number of POIs in pt/eta bin:
693 for(Int_t pe=0;pe<2;pe++)
694 {
695 fNoOfParticlesInBin[1][pe]->Fill(ptEta[pe],ptEta[pe],1.);
f1d945a1 696 }
d6130938 697
698 if(!(aftsTrack->InRPSelection())) // particle was flagged only as POI
b6cd16a9 699 {
d6130938 700 // Fill generating function:
701 for(Int_t p=0;p<pMax;p++)
b6cd16a9 702 {
d6130938 703 for(Int_t q=0;q<qMax;q++)
704 {
705 for(Int_t ri=0;ri<2;ri++)
706 {
707 for(Int_t pe=0;pe<2;pe++)
708 {
709 if(ri==0) // Real part (to be improved - this can be implemented better)
710 {
711 fDiffFlowGenFun[ri][1][pe]->Fill(ptEta[pe],(Double_t)p,(Double_t)q, // to be improved - hardwired weight 1. in the line bellow
712 (*fGEBE)(p,q)*cos(fMultiple*fHarmonic*dPhi),1.);
713 }
714 else if(ri==1) // Imaginary part (to be improved - this can be implemented better)
715 {
716 fDiffFlowGenFun[ri][1][pe]->Fill(ptEta[pe],(Double_t)p,(Double_t)q, // to be improved - hardwired weight 1. in the line bellow
717 (*fGEBE)(p,q)*sin(fMultiple*fHarmonic*dPhi),1.);
718 }
719 } // end of for(Int_t pe=0;pe<2;pe++)
720 } // end of for(Int_t ri=0;ri<2;ri++)
721 } // end of for(Int_t q=0;q<qMax;q++)
722 } // end of for(Int_t p=0;p<pMax;p++)
723 } // end of if(!(aftsTrack->InRPSelection())) // particle was flagged only as POI
724 else if(aftsTrack->InRPSelection()) // particle was flagged both as RP and POI
b9639e20 725 {
d6130938 726 // If particle weights were used, get them:
727 if(fUsePhiWeights && fnBinsPhi) // determine phi weight for this particle:
b9639e20 728 {
d6130938 729 wPhi = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*fnBinsPhi/TMath::TwoPi())));
b9639e20 730 }
d6130938 731 if(fUsePtWeights && fnBinsPt) // determine pt weight for this particle:
b9639e20 732 {
d6130938 733 wPt = fPtWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/fPtBinWidth)));
734 }
735 if(fUseEtaWeights && fEtaBinWidth) // determine eta weight for this particle:
b9639e20 736 {
d6130938 737 wEta = fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/fEtaBinWidth)));
738 }
739 // Fill generating function:
740 for(Int_t p=0;p<pMax;p++)
741 {
742 for(Int_t q=0;q<qMax;q++)
743 {
744 for(Int_t ri=0;ri<2;ri++)
745 {
746 for(Int_t pe=0;pe<2;pe++)
747 {
748 if(ri==0) // Real part (to be improved - this can be implemented better)
749 {
750 fDiffFlowGenFun[ri][1][pe]->Fill(ptEta[pe],(Double_t)p,(Double_t)q, // to be improved - hardwired weight 1. in the line bellow
751 (*fGEBE)(p,q)*cos(fMultiple*fHarmonic*dPhi)/(1.+wPhi*wPt*wEta*(2.*fR0*sqrt(p+1.)/nRP)*cos(fHarmonic*dPhi-2.*q*TMath::Pi()/qMax)),1.);
752 }
753 else if(ri==1) // Imaginary part (to be improved - this can be implemented better)
754 {
755 fDiffFlowGenFun[ri][1][pe]->Fill(ptEta[pe],(Double_t)p,(Double_t)q, // to be improved - hardwired weight 1. in the line bellow
756 (*fGEBE)(p,q)*sin(fMultiple*fHarmonic*dPhi)/(1.+wPhi*wPt*wEta*(2.*fR0*sqrt(p+1.)/nRP)*cos(fHarmonic*dPhi-2.*q*TMath::Pi()/qMax)),1.);
757 }
758 } // end of for(Int_t pe=0;pe<2;pe++)
759 } // end of for(Int_t ri=0;ri<2;ri++)
760 } // end of for(Int_t q=0;q<qMax;q++)
761 } // end of for(Int_t p=0;p<pMax;p++)
762 } // end of else if (aftsTrack->InRPSelection()) // particle was flagged both as RP and POI
763 } // end of if(aftsTrack->InPOISelection())
764 // Differential flow of RPs:
765 if(aftsTrack->InRPSelection())
766 {
767 // Get azimuthal angle, momentum and pseudorapidity of a particle:
768 dPhi = aftsTrack->Phi();
769 dPt = aftsTrack->Pt();
770 dEta = aftsTrack->Eta();
771 Double_t ptEta[2] = {dPt,dEta};
772
773 // Count number of RPs in pt/eta bin:
774 for(Int_t pe=0;pe<2;pe++)
775 {
776 fNoOfParticlesInBin[0][pe]->Fill(ptEta[pe],ptEta[pe],1.);
b9639e20 777 }
778
d6130938 779 // If particle weights were used, get them:
780 if(fUsePhiWeights && fnBinsPhi) // determine phi weight for this particle:
813a4157 781 {
d6130938 782 wPhi = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*fnBinsPhi/TMath::TwoPi())));
813a4157 783 }
d6130938 784 if(fUsePtWeights && fnBinsPt) // determine pt weight for this particle:
b6cd16a9 785 {
d6130938 786 wPt = fPtWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/fPtBinWidth)));
787 }
788 if(fUseEtaWeights && fEtaBinWidth) // determine eta weight for this particle:
789 {
790 wEta = fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/fEtaBinWidth)));
791 }
792 // Fill generating function:
793 for(Int_t p=0;p<pMax;p++)
b6cd16a9 794 {
d6130938 795 for(Int_t q=0;q<qMax;q++)
b6cd16a9 796 {
d6130938 797 for(Int_t ri=0;ri<2;ri++)
cb308e83 798 {
d6130938 799 for(Int_t pe=0;pe<2;pe++)
b6cd16a9 800 {
d6130938 801 if(ri==0) // Real part (to be improved - this can be implemented better)
cb308e83 802 {
d6130938 803 fDiffFlowGenFun[ri][0][pe]->Fill(ptEta[pe],(Double_t)p,(Double_t)q, // to be improved - hardwired weight 1. in the line bellow
804 (*fGEBE)(p,q)*cos(fMultiple*fHarmonic*dPhi)/(1.+wPhi*wPt*wEta*(2.*fR0*sqrt(p+1.)/nRP)*cos(fHarmonic*dPhi-2.*q*TMath::Pi()/qMax)),1.);
805 }
806 else if(ri==1) // Imaginary part (to be improved - this can be implemented better)
b6cd16a9 807 {
d6130938 808 fDiffFlowGenFun[ri][0][pe]->Fill(ptEta[pe],(Double_t)p,(Double_t)q, // to be improved - hardwired weight 1. in the line bellow
809 (*fGEBE)(p,q)*sin(fMultiple*fHarmonic*dPhi)/(1.+wPhi*wPt*wEta*(2.*fR0*sqrt(p+1.)/nRP)*cos(fHarmonic*dPhi-2.*q*TMath::Pi()/qMax)),1.);
b6cd16a9 810 }
d6130938 811 } // end of for(Int_t pe=0;pe<2;pe++)
812 } // end of for(Int_t ri=0;ri<2;ri++)
813 } // end of for(Int_t q=0;q<qMax;q++)
814 } // end of for(Int_t p=0;p<pMax;p++)
815 } // end of if(aftsTrack->InRPSelection())
816 } // end of if(aftsTrack)
817 } // end of for(Int_t i=0;i<nPrim;i++)
818
819} // end of void AliFlowAnalysisWithCumulants::FillGeneratingFunctionForDiffFlow(AliFlowEventSimple* anEvent)
820
821//================================================================================================================
822
823void AliFlowAnalysisWithCumulants::GetOutputHistograms(TList *outputListHistos)
824{
825 // Get pointers to all objects saved in the output file.
826
827 if(outputListHistos)
828 {
829 this->SetHistList(outputListHistos);
830 if(!fHistList)
831 {
832 cout<<endl;
833 cout<<" WARNING (GFC): fHistList is NULL in AFAWGFC::GOH() !!!!"<<endl;
834 cout<<endl;
835 exit(0);
836 }
837 this->GetPointersForBaseHistograms();
3688e459 838 this->AccessSettings();
d6130938 839 this->GetPointersForCommonControlHistograms();
840 this->GetPointersForCommonResultsHistograms();
d6130938 841 this->GetPointersForReferenceFlowObjects();
842 this->GetPointersForDiffFlowObjects();
3688e459 843 if(fTuneParameters){this->GetPointersForTuningObjects();}
d6130938 844 } else
845 {
846 cout<<endl;
847 cout<<" WARNING (GFC): outputListHistos is NULL in AFAWGFC::GOH() !!!!"<<endl;
848 cout<<endl;
849 exit(0);
850 }
851
852} // end of void AliFlowAnalysisWithCumulants::GetOutputHistograms(TList *outputListHistos)
853
854//================================================================================================================
855
856void AliFlowAnalysisWithCumulants::GetPointersForBaseHistograms()
857{
858 // Get pointers to base histograms.
859
860 TString analysisSettingsName = "fAnalysisSettings";
861 TProfile *analysisSettings = dynamic_cast<TProfile*>(fHistList->FindObject(analysisSettingsName.Data()));
862 if(analysisSettings)
863 {
864 this->SetAnalysisSettings(analysisSettings);
865 } else
866 {
867 cout<<endl;
868 cout<<" WARNING (GFC): analysisSettings is NULL in AFAWGFC::GPFBH() !!!!"<<endl;
869 cout<<endl;
870 exit(0);
871 }
872
873} // end of void AliFlowAnalysisWithCumulants::GetPointersForBaseHistograms()
874
875//================================================================================================================
876
877void AliFlowAnalysisWithCumulants::GetPointersForCommonControlHistograms()
878{
879 // Get pointers for common control histograms.
880
881 TString commonHistsName = "AliFlowCommonHistGFC";
882 AliFlowCommonHist *commonHist = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHistsName.Data()));
883 if(commonHist)
884 {
885 this->SetCommonHists(commonHist);
886 } else
887 {
888 cout<<endl;
889 cout<<" WARNING (GFC): commonHist is NULL in AFAWGFC::GPFCH() !!!!"<<endl;
890 cout<<endl;
891 exit(0);
892 }
893
894} // end of void AliFlowAnalysisWithCumulants::GetPointersForCommonControlHistograms()
895
896//================================================================================================================
897
898void AliFlowAnalysisWithCumulants::GetPointersForCommonResultsHistograms()
899{
900 // Get pointers for common results histograms.
901
902 TString commonHistResults2ndOrderName = "AliFlowCommonHistResults2ndOrderGFC";
903 AliFlowCommonHistResults *commonHistRes2nd = dynamic_cast<AliFlowCommonHistResults*>
904 (fHistList->FindObject(commonHistResults2ndOrderName.Data()));
905 if(commonHistRes2nd)
906 {
907 this->SetCommonHistsResults2nd(commonHistRes2nd);
908 } else
909 {
910 cout<<endl;
911 cout<<" WARNING (GFC): commonHistRes2nd is NULL in AFAWGFC::GPFCRH() !!!!"<<endl;
912 cout<<endl;
913 exit(0);
914 }
915 TString commonHistResults4thOrderName = "AliFlowCommonHistResults4thOrderGFC";
916 AliFlowCommonHistResults *commonHistRes4th = dynamic_cast<AliFlowCommonHistResults*>
917 (fHistList->FindObject(commonHistResults4thOrderName.Data()));
918 if(commonHistRes4th)
919 {
920 this->SetCommonHistsResults4th(commonHistRes4th);
921 } else
922 {
923 cout<<endl;
924 cout<<" WARNING (GFC): commonHistRes4th is NULL in AFAWGFC::GPFCRH() !!!!"<<endl;
925 cout<<endl;
926 exit(0);
927 }
928 TString commonHistResults6thOrderName = "AliFlowCommonHistResults6thOrderGFC";
929 AliFlowCommonHistResults *commonHistRes6th = dynamic_cast<AliFlowCommonHistResults*>
930 (fHistList->FindObject(commonHistResults6thOrderName.Data()));
931 if(commonHistRes6th)
932 {
933 this->SetCommonHistsResults6th(commonHistRes6th);
934 } else
935 {
936 cout<<endl;
937 cout<<" WARNING (GFC): commonHistRes6th is NULL in AFAWGFC::GPFCRH() !!!!"<<endl;
938 cout<<endl;
939 exit(0);
940 }
941 TString commonHistResults8thOrderName = "AliFlowCommonHistResults8thOrderGFC";
942 AliFlowCommonHistResults *commonHistRes8th = dynamic_cast<AliFlowCommonHistResults*>
943 (fHistList->FindObject(commonHistResults8thOrderName.Data()));
944 if(commonHistRes8th)
945 {
946 this->SetCommonHistsResults8th(commonHistRes8th);
947 } else
948 {
949 cout<<endl;
950 cout<<" WARNING (GFC): commonHistRes8th is NULL in AFAWGFC::GPFCRH() !!!!"<<endl;
951 cout<<endl;
952 exit(0);
953 }
954
955} // end of void AliFlowAnalysisWithCumulants::GetPointersForCommonResultsHistograms()
956
957//================================================================================================================
958
3688e459 959void AliFlowAnalysisWithCumulants::GetPointersForTuningObjects()
d6130938 960{
3688e459 961 // Get pointers to all objects used for tuning.
962
963 // a) Get pointers to all lists relevant for tuning;
964 // b) Get pointer to profile holding flags for tuning;
965 // c) Get pointers to all objects in the list fTuningProfiles;
966 // d) Get pointers to all objects in the list fTuningResults.
967
968 // a) Get pointers to all lists relevant for tuning:
969 TList *tuningList = dynamic_cast<TList*>(fHistList->FindObject("Tuning"));
970 if(!tuningList)
971 {
972 cout<<endl;
973 cout<<"WARNING (GFC): uningList is NULL in AFAWGFC::GPFTO() !!!!"<<endl;
974 cout<<endl;
975 exit(0);
976 }
977 TList *tuningProfiles = dynamic_cast<TList*>(tuningList->FindObject("Profiles"));
978 if(!tuningProfiles)
979 {
980 cout<<endl;
981 cout<<"WARNING (GFC): tuningProfiles is NULL in AFAWGFC::GPFTO() !!!!"<<endl;
982 cout<<endl;
983 exit(0);
984 }
985 TList *tuningResults = dynamic_cast<TList*>(tuningList->FindObject("Results"));
986 if(!tuningResults)
987 {
988 cout<<endl;
989 cout<<"WARNING (GFC): tuningResults is NULL in AFAWGFC::GPFTO() !!!!"<<endl;
990 cout<<endl;
991 exit(0);
d6130938 992 }
3688e459 993
994 // b) Get pointer to profile holding flags for tuning:
995 TString tuningFlagsName = "fTuningFlags";
996 TProfile *tuningFlags = dynamic_cast<TProfile*>(tuningList->FindObject(tuningFlagsName.Data()));
997 if(tuningFlags)
998 {
999 this->SetTuningFlags(tuningFlags);
1000 } else
1001 {
1002 cout<<endl;
1003 cout<<"WARNING (GFC): tuningFlags is NULL in AFAWGFC::GPFTO() !!!!"<<endl;
1004 cout<<endl;
1005 exit(0);
1006 }
1007
1008 // c) Get pointers to all objects in the list fTuningProfiles:
1009 // Generating function for different tuning parameters:
1010 TProfile2D *tuningGenFun[10][5] = {{NULL}};
1011 for(Int_t r=0;r<10;r++)
1012 {
1013 for(Int_t pq=0;pq<5;pq++)
1014 {
1015 tuningGenFun[r][pq] = dynamic_cast<TProfile2D*>(tuningProfiles->FindObject(Form("fTuningGenFun (r_{0,%i}, pq set %i)",r,pq)));
1016 if(tuningGenFun[r][pq])
1017 {
1018 this->SetTuningGenFun(tuningGenFun[r][pq],r,pq);
1019 } else
1020 {
1021 cout<<endl;
1022 cout<<"WARNING (GFC): "<<Form("tuningGenFun[%i][%i]",r,pq)<<" is NULL in AFAWGFC::GPFTO() !!!!"<<endl;
1023 cout<<endl;
1024 exit(0);
1025 }
1026 } // end of for(Int_t pq=0;pq<5;pq++)
1027 } // end of for(Int_t r=0;r<10;r++)
1028 // Average multiplicities for events with nRPs >= cuttof
1029 TProfile *tuningAvM = dynamic_cast<TProfile*>(tuningProfiles->FindObject("fTuningAvM"));
1030 if(tuningAvM)
1031 {
1032 this->SetTuningAvM(tuningAvM);
1033 } else
1034 {
1035 cout<<endl;
1036 cout<<"WARNING (GFC): tuningAvM is NULL in AFAWGFC::GPFTO() !!!!"<<endl;
1037 cout<<endl;
1038 exit(0);
1039 }
d6130938 1040
3688e459 1041 // d) Get pointers to all objects in the list fTuningResults.
1042 // Cumulants for reference flow for 10 different r0s and 5 different sets of (pmax,qmax):
1043 TH1D *tuningCumulants[10][5] = {{NULL}};
1044 for(Int_t r=0;r<10;r++)
1045 {
1046 for(Int_t pq=0;pq<5;pq++)
1047 {
1048 tuningCumulants[r][pq] = dynamic_cast<TH1D*>(tuningResults->FindObject(Form("fTuningCumulants (r_{0,%i}, pq set %i)",r,pq)));
1049 if(tuningCumulants[r][pq])
1050 {
1051 this->SetTuningCumulants(tuningCumulants[r][pq],r,pq);
1052 } else
1053 {
1054 cout<<endl;
1055 cout<<"WARNING (GFC): "<<Form("tuningCumulants[%i][%i]",r,pq)<<" is NULL in AFAWGFC::GPFTO() !!!!"<<endl;
1056 cout<<endl;
1057 exit(0);
1058 }
1059 } // end of for(Int_t pq=0;pq<5;pq++)
1060 } // end of for(Int_t r=0;r<10;r++)
1061 // Reference flow for 10 different r0s and 5 different sets of (pmax,qmax):
1062 TH1D *tuningFlow[10][5] = {{NULL}};
1063 for(Int_t r=0;r<10;r++)
1064 {
1065 for(Int_t pq=0;pq<5;pq++)
1066 {
1067 tuningFlow[r][pq] = dynamic_cast<TH1D*>(tuningResults->FindObject(Form("fTuningFlow (r_{0,%i}, pq set %i)",r,pq)));
1068 if(tuningFlow[r][pq])
1069 {
1070 this->SetTuningFlow(tuningFlow[r][pq],r,pq);
1071 } else
1072 {
1073 cout<<endl;
1074 cout<<"WARNING (GFC): "<<Form("tuningFlow[%i][%i]",r,pq)<<" is NULL in AFAWGFC::GPFTO() !!!!"<<endl;
1075 cout<<endl;
1076 exit(0);
1077 }
1078 } // end of for(Int_t pq=0;pq<5;pq++)
1079 } // end of for(Int_t r=0;r<10;r++)
1080
1081} // end of void AliFlowAnalysisWithCumulants::GetPointersForTuningObjects()
d6130938 1082
1083//================================================================================================================
1084
1085void AliFlowAnalysisWithCumulants::GetPointersForReferenceFlowObjects()
1086{
1087 // Get pointers for all objects relevant for calculation of reference flow.
1088
1089 // a) Get pointers to all lists relevant for reference flow;
1090 // b) Get pointer to profile holding flags;
1091 // c) Get pointers to all objects in the list fReferenceFlowProfiles;
3688e459 1092 // d) Get pointers to all objects in the list fReferenceFlowResults;
1093 // e) Get pointers for all objects relevant for calculation of reference flow versus multiplicity.
1094
d6130938 1095 // a) Get pointers to all lists relevant for reference flow:
1096 TList *referenceFlowList = dynamic_cast<TList*>(fHistList->FindObject("Reference Flow"));
1097 if(!referenceFlowList)
1098 {
1099 cout<<endl;
1100 cout<<"WARNING (GFC): referenceFlowList is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1101 cout<<endl;
1102 exit(0);
1103 }
1104 TList *referenceFlowProfiles = dynamic_cast<TList*>(referenceFlowList->FindObject("Profiles"));
1105 if(!referenceFlowProfiles)
1106 {
1107 cout<<endl;
1108 cout<<"WARNING (GFC): referenceFlowProfiles is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1109 cout<<endl;
1110 exit(0);
1111 }
1112 TList *referenceFlowResults = dynamic_cast<TList*>(referenceFlowList->FindObject("Results"));
1113 if(!referenceFlowResults)
1114 {
1115 cout<<endl;
1116 cout<<"WARNING (GFC): referenceFlowResults is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1117 cout<<endl;
1118 exit(0);
1119 }
1120
1121 // b) Get pointer to profile holding flags:
1122 TString referenceFlowFlagsName = "fReferenceFlowFlags";
1123 TProfile *referenceFlowFlags = dynamic_cast<TProfile*>(referenceFlowList->FindObject(referenceFlowFlagsName.Data()));
1124 if(referenceFlowFlags)
1125 {
1126 this->SetReferenceFlowFlags(referenceFlowFlags);
1127 } else
1128 {
1129 cout<<endl;
1130 cout<<"WARNING (GFC): referenceFlowFlags is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1131 cout<<endl;
1132 exit(0);
1133 }
1134
1135 // c) Get pointers to all objects in the list fReferenceFlowProfiles:
1136 TString referenceFlowGenFunName = "fReferenceFlowGenFun";
1137 TProfile2D *referenceFlowGenFun = dynamic_cast<TProfile2D*>(referenceFlowProfiles->FindObject(referenceFlowGenFunName.Data()));
1138 if(referenceFlowGenFun)
1139 {
1140 this->SetReferenceFlowGenFun(referenceFlowGenFun);
1141 } else
1142 {
1143 cout<<endl;
1144 cout<<"WARNING (GFC): referenceFlowGenFun is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1145 cout<<endl;
1146 exit(0);
1147 }
3688e459 1148 // Averages of various Q-vector components:
d6130938 1149 TString qvectorComponentsName = "fQvectorComponents";
1150 TProfile *qvectorComponents = dynamic_cast<TProfile*>(referenceFlowProfiles->FindObject(qvectorComponentsName.Data()));
1151 if(qvectorComponents)
1152 {
1153 this->SetQvectorComponents(qvectorComponents);
1154 } else
1155 {
1156 cout<<endl;
1157 cout<<"WARNING (GFC): qvectorComponents is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1158 cout<<endl;
1159 exit(0);
1160 }
1161 // <<w^2>>, where w = wPhi*wPt*wEta:
1162 TString averageOfSquaredWeightName = "fAverageOfSquaredWeight";
1163 TProfile *averageOfSquaredWeight = dynamic_cast<TProfile*>(referenceFlowProfiles->FindObject(averageOfSquaredWeightName.Data()));
1164 if(averageOfSquaredWeight)
1165 {
1166 this->SetAverageOfSquaredWeight(averageOfSquaredWeight);
1167 } else
1168 {
1169 cout<<endl;
1170 cout<<"WARNING (GFC): averageOfSquaredWeight is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1171 cout<<endl;
1172 exit(0);
1173 }
1174
1175 // d) Get pointers to all objects in the list fReferenceFlowResults:
1176 // Final results for isotropic cumulants for reference flow:
1177 TString referenceFlowCumulantsName = "fReferenceFlowCumulants";
1178 TH1D *referenceFlowCumulants = dynamic_cast<TH1D*>(referenceFlowResults->FindObject(referenceFlowCumulantsName.Data()));
1179 if(referenceFlowCumulants)
1180 {
1181 this->SetReferenceFlowCumulants(referenceFlowCumulants);
1182 } else
1183 {
1184 cout<<endl;
1185 cout<<"WARNING (GFC): referenceFlowCumulants is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1186 cout<<endl;
1187 exit(0);
1188 }
1189 // Final results for reference flow:
1190 TString referenceFlowName = "fReferenceFlow";
1191 TH1D *referenceFlow = dynamic_cast<TH1D*>(referenceFlowResults->FindObject(referenceFlowName.Data()));
1192 if(referenceFlow)
1193 {
1194 this->SetReferenceFlow(referenceFlow);
1195 } else
1196 {
1197 cout<<endl;
1198 cout<<"WARNING (GFC): referenceFlow is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1199 cout<<endl;
1200 exit(0);
1201 }
1202 // Final results for resolution:
1203 TString chiName = "fChi";
1204 TH1D *chi = dynamic_cast<TH1D*>(referenceFlowResults->FindObject(chiName.Data()));
1205 if(chi)
1206 {
1207 this->SetChi(chi);
1208 } else
1209 {
1210 cout<<endl;
1211 cout<<"WARNING (GFC): chi is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1212 cout<<endl;
1213 exit(0);
1214 }
3688e459 1215
1216 // e) Get pointers for all objects relevant for calculation of reference flow versus multiplicity:
1217 if(!fCalculateVsMultiplicity) {return;}
1218 // All-event average of the generating function used to calculate reference flow vs multiplicity:
1219 TString referenceFlowGenFunVsMName = "fReferenceFlowGenFunVsM";
1220 TProfile3D *referenceFlowGenFunVsM = dynamic_cast<TProfile3D*>(referenceFlowProfiles->FindObject(referenceFlowGenFunVsMName.Data()));
1221 if(referenceFlowGenFunVsM)
1222 {
1223 this->SetReferenceFlowGenFunVsM(referenceFlowGenFunVsM);
1224 } else
1225 {
1226 cout<<endl;
1227 cout<<"WARNING (GFC): referenceFlowGenFunVsM is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1228 cout<<endl;
1229 exit(0);
1230 }
1231 // Averages of various Q-vector components versus multiplicity:
1232 TString qvectorComponentsVsMName = "fQvectorComponentsVsM";
1233 TProfile2D *qvectorComponentsVsM = dynamic_cast<TProfile2D*>(referenceFlowProfiles->FindObject(qvectorComponentsVsMName.Data()));
1234 if(qvectorComponentsVsM)
1235 {
1236 this->SetQvectorComponentsVsM(qvectorComponentsVsM);
1237 } else
1238 {
1239 cout<<endl;
1240 cout<<"WARNING (GFC): qvectorComponentsVsM is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1241 cout<<endl;
1242 exit(0);
1243 }
1244 // <<w^2>>, where w = wPhi*wPt*wEta versus multiplicity:
1245 TString averageOfSquaredWeightVsMName = "fAverageOfSquaredWeightVsM";
1246 TProfile2D *averageOfSquaredWeightVsM = dynamic_cast<TProfile2D*>(referenceFlowProfiles->FindObject(averageOfSquaredWeightVsMName.Data()));
1247 if(averageOfSquaredWeightVsM)
1248 {
1249 this->SetAverageOfSquaredWeightVsM(averageOfSquaredWeightVsM);
1250 } else
1251 {
1252 cout<<endl;
1253 cout<<"WARNING (GFC): averageOfSquaredWeightVsM is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1254 cout<<endl;
1255 exit(0);
1256 }
1257 // Final results for reference GF-cumulants versus multiplicity:
1258 TString cumulantFlag[4] = {"GFC{2}","GFC{4}","GFC{6}","GFC{8}"};
1259 TString referenceFlowCumulantsVsMName = "fReferenceFlowCumulantsVsM";
1260 TH1D *referenceFlowCumulantsVsM[4] = {NULL};
1261 for(Int_t co=0;co<4;co++) // cumulant order
1262 {
1263 referenceFlowCumulantsVsM[co] = dynamic_cast<TH1D*>(referenceFlowResults->FindObject(Form("%s, %s",referenceFlowCumulantsVsMName.Data(),cumulantFlag[co].Data())));
1264 if(referenceFlowCumulantsVsM[co])
1265 {
1266 this->SetReferenceFlowCumulantsVsM(referenceFlowCumulantsVsM[co],co);
1267 } else
1268 {
1269 cout<<endl;
1270 cout<<"WARNING (GFC): "<<Form("referenceFlowCumulantsVsM[%i]",co)<<" is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1271 cout<<endl;
1272 exit(0);
1273 }
1274 } // end of for(Int_t co=0;co<4;co++) // cumulant order
1275 // <M> vs multiplicity bin:
1276 TProfile *avMVsM = dynamic_cast<TProfile*>(referenceFlowProfiles->FindObject("fAvMVsM"));
1277 if(avMVsM)
1278 {
1279 this->SetAvMVsM(avMVsM);
1280 } else
1281 {
1282 cout<<endl;
1283 cout<<"WARNING (GFC): avMVsM is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1284 cout<<endl;
1285 exit(0);
1286 }
d6130938 1287
3688e459 1288} // end of void AliFlowAnalysisWithCumulants::GetPointersForReferenceFlowObjects()
d6130938 1289
1290//================================================================================================================
1291
1292void AliFlowAnalysisWithCumulants::GetPointersForDiffFlowObjects()
1293{
1294 // Get pointers to all objects relevant for differential flow.
1295
1296 // a) Define flags locally (to be improved: should I promote flags to data members?);
1297 // b) Get pointer to base list for differential flow fDiffFlowList and nested lists fDiffFlowListProfiles and fDiffFlowListResults;
1298 // c) Get pointer to profile fDiffFlowFlags holding all flags for differential flow;
1299 // d) Get pointers to all profiles in the list fDiffFlowProfiles;
1300 // e) Get pointers to all profiles in the list fDiffFlowResults.
1301
1302 // a) Define flags locally (to be improved: should I promote flags to data members?):
1303 TString reIm[2] = {"Re","Im"};
1304 TString rpPoi[2] = {"RP","POI"};
1305 TString ptEta[2] = {"p_{t}","#eta"};
1306 TString order[4] = {"2nd order","4th order","6th order","8th order"};
1307 //TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
1308
1309 // b) Get pointer to base list for differential flow fDiffFlowList and nested lists fDiffFlowListProfiles and fDiffFlowListResults:
1310 TList *diffFlowList = dynamic_cast<TList*>(fHistList->FindObject("Differential Flow")); // to be improved (hardwired name)
1311 if(!diffFlowList)
1312 {
1313 cout<<endl;
3688e459 1314 cout<<"WARNING: diffFlowList is NULL in AFAWC::GPFDFO() !!!!"<<endl;
d6130938 1315 cout<<endl;
1316 exit(0);
1317 }
1318 TList *diffFlowProfiles = dynamic_cast<TList*>(diffFlowList->FindObject("Profiles")); // to be improved (hardwired name)
1319 if(!diffFlowProfiles)
1320 {
1321 cout<<endl;
3688e459 1322 cout<<"WARNING: diffFlowProfiles is NULL in AFAWC::GPFDFO() !!!!"<<endl;
d6130938 1323 cout<<endl;
1324 exit(0);
1325 }
1326 TList *diffFlowResults = dynamic_cast<TList*>(diffFlowList->FindObject("Results")); // to be improved (hardwired name)
1327 if(!diffFlowResults)
1328 {
1329 cout<<endl;
3688e459 1330 cout<<"WARNING: diffFlowResults is NULL in AFAWC::GPFDFO() !!!!"<<endl;
d6130938 1331 cout<<endl;
1332 exit(0);
1333 }
1334
1335 // c) Get pointer to profile holding flags:
1336 TString diffFlowFlagsName = "fDiffFlowFlags";
1337 TProfile *diffFlowFlags = dynamic_cast<TProfile*>(diffFlowList->FindObject(diffFlowFlagsName.Data()));
1338 if(diffFlowFlags)
1339 {
1340 this->SetDiffFlowFlags(diffFlowFlags);
1341 } else
1342 {
1343 cout<<endl;
1344 cout<<"WARNING (GFC): diffFlowFlags is NULL in AFAWGFC::GPFDFO() !!!!"<<endl;
1345 cout<<endl;
1346 exit(0);
1347 }
1348
1349 // d) Get pointers to all profiles in the list fDiffFlowListProfiles:
1350 // Generating functions for differential flow:
1351 TProfile3D *diffFlowGenFun[2][2][2] = {{{NULL}}};
1352 for(Int_t ri=0;ri<2;ri++)
1353 {
1354 for(Int_t rp=0;rp<2;rp++)
1355 {
1356 for(Int_t pe=0;pe<2;pe++)
1357 {
1358 diffFlowGenFun[ri][rp][pe] = dynamic_cast<TProfile3D*> // to be improved - harwired name fDiffFlowGenFun in the line bellow
1359 (diffFlowProfiles->FindObject(Form("fDiffFlowGenFun (%s, %s, %s)",reIm[ri].Data(),rpPoi[rp].Data(),ptEta[pe].Data())));
1360 if(diffFlowGenFun[ri][rp][pe])
1361 {
1362 this->SetDiffFlowGenFun(diffFlowGenFun[ri][rp][pe],ri,rp,pe);
1363 } else
1364 {
1365 cout<<endl;
1366 cout<<"WARNING (GFC): "<<Form("diffFlowGenFun[%d][%d][%d]",ri,rp,pe)<<" is NULL in AFAWGFC::GPFDFO() !!!!"<<endl;
1367 cout<<endl;
1368 exit(0);
1369 }
1370 }
1371 }
1372 }
1373 // Number of particles in pt/eta bin for RPs/POIs:
1374 TProfile *noOfParticlesInBin[2][2] = {{NULL}};
1375 for(Int_t rp=0;rp<2;rp++)
1376 {
1377 for(Int_t pe=0;pe<2;pe++)
1378 {
1379 noOfParticlesInBin[rp][pe] = dynamic_cast<TProfile*> // to be improved - harwired name fNoOfParticlesInBin in the line bellow
1380 (diffFlowProfiles->FindObject(Form("fNoOfParticlesInBin (%s, %s)",rpPoi[rp].Data(),ptEta[pe].Data())));
1381 if(noOfParticlesInBin[rp][pe])
1382 {
1383 this->SetNoOfParticlesInBin(noOfParticlesInBin[rp][pe],rp,pe);
1384 } else
1385 {
1386 cout<<endl;
1387 cout<<"WARNING (GFC): "<<Form("noOfParticlesInBin[%d][%d]",rp,pe)<<" is NULL in AFAWGFC::GPFDFO() !!!!"<<endl;
1388 cout<<endl;
1389 exit(0);
1390 }
1391 }
1392 }
1393 // Differential cumulants per pt/eta bin for RPs/POIs:
1394 TH1D *diffFlowCumulants[2][2][4] = {{{NULL}}};
1395 for(Int_t rp=0;rp<2;rp++)
1396 {
1397 for(Int_t pe=0;pe<2;pe++)
1398 {
1399 for(Int_t co=0;co<4;co++)
1400 {
1401 diffFlowCumulants[rp][pe][co] = dynamic_cast<TH1D*> // to be improved - hardwired name fDiffFlowCumulants in the line bellow
1402 (diffFlowResults->FindObject(Form("fDiffFlowCumulants (%s, %s, %s)",rpPoi[rp].Data(),ptEta[pe].Data(),order[co].Data())));
1403 if(diffFlowCumulants[rp][pe][co])
1404 {
1405 this->SetDiffFlowCumulants(diffFlowCumulants[rp][pe][co],rp,pe,co);
1406 } else
1407 {
1408 cout<<endl;
1409 cout<<"WARNING (GFC): "<<Form("diffFlowCumulants[%d][%d][%d]",rp,pe,co)<<" is NULL in AFAWGFC::GPFDFO() !!!!"<<endl;
1410 cout<<endl;
1411 exit(0);
b6cd16a9 1412 }
d6130938 1413 }
1414 }
1415 }
1416 // Differential flow per pt/eta bin for RPs/POIs:
1417 TH1D *diffFlow[2][2][4] = {{{NULL}}};
1418 for(Int_t rp=0;rp<2;rp++)
1419 {
1420 for(Int_t pe=0;pe<2;pe++)
1421 {
1422 for(Int_t co=0;co<4;co++)
1423 {
1424 diffFlow[rp][pe][co] = dynamic_cast<TH1D*> // to be improved - hardwired name fDiffFlow in the line bellow
1425 (diffFlowResults->FindObject(Form("fDiffFlow (%s, %s, %s)",rpPoi[rp].Data(),ptEta[pe].Data(),order[co].Data())));
1426 if(diffFlow[rp][pe][co])
1427 {
1428 this->SetDiffFlow(diffFlow[rp][pe][co],rp,pe,co);
1429 } else
1430 {
1431 cout<<endl;
1432 cout<<"WARNING (GFC): "<<Form("diffFlow[%d][%d][%d]",rp,pe,co)<<" is NULL in AFAWGFC::GPFDFO() !!!!"<<endl;
1433 cout<<endl;
1434 exit(0);
1435 }
1436 }
1437 }
1438 }
1439
1440} // end of void AliFlowAnalysisWithCumulants::GetPointersForDiffFlowObjects()
1441
1442//================================================================================================================
1443
1444void AliFlowAnalysisWithCumulants::CalculateIntegratedFlow(TString rpPoi)
1445{
1446 // Calculate final results for integrated flow of RPs and POIs.
1447 // (to be improved - this method can be implemented much better)
1448
ca5f47e7 1449 Int_t rp = 0;
d6130938 1450
1451 if(rpPoi == "RP")
1452 {
1453 rp = 0;
1454 } else if(rpPoi == "POI")
1455 {
1456 rp = 1;
1457 }
1458
1459 // pt yield:
1460 TH1F *yieldPt = NULL;
1461
1462 if(rpPoi == "POI")
1463 {
1464 yieldPt = (TH1F*)(fCommonHists->GetHistPtPOI())->Clone();
1465 } else if(rpPoi == "RP")
1466 {
1467 yieldPt = (TH1F*)(fCommonHists->GetHistPtRP())->Clone();
1468 }
1469
1470 TH1D *flow2ndPt = (TH1D*)fDiffFlow[rp][0][0]->Clone();
1471 TH1D *flow4thPt = (TH1D*)fDiffFlow[rp][0][1]->Clone();
1472 TH1D *flow6thPt = (TH1D*)fDiffFlow[rp][0][2]->Clone();
1473 TH1D *flow8thPt = (TH1D*)fDiffFlow[rp][0][3]->Clone();
1474 Double_t dvn2nd = 0., dvn4th = 0., dvn6th = 0., dvn8th = 0.; // differential flow
1475 Double_t dErrvn2nd = 0., dErrvn4th = 0., dErrvn6th = 0., dErrvn8th = 0.; // error on differential flow
1476 Double_t dVn2nd = 0., dVn4th = 0., dVn6th = 0., dVn8th = 0.; // integrated flow
1477 Double_t dErrVn2nd = 0., dErrVn4th = 0., dErrVn6th = 0., dErrVn8th = 0.; // error on integrated flow
1478 Double_t dYield = 0.; // pt yield
1479 Double_t dSum2nd = 0., dSum4th = 0., dSum6th = 0., dSum8th = 0.; // needed for normalizing integrated flow
1480 fnBinsPt = flow2ndPt->GetXaxis()->GetNbins();
1481 // looping over pt bins:
1482 for(Int_t p=1;p<=fnBinsPt;p++)
1483 {
1484 dvn2nd = flow2ndPt->GetBinContent(p);
1485 dvn4th = flow4thPt->GetBinContent(p);
1486 dvn6th = flow6thPt->GetBinContent(p);
1487 dvn8th = flow8thPt->GetBinContent(p);
1488
1489 dErrvn2nd = flow2ndPt->GetBinError(p);
1490 dErrvn4th = flow4thPt->GetBinError(p);
1491 dErrvn6th = flow6thPt->GetBinError(p);
1492 dErrvn8th = flow8thPt->GetBinError(p);
1493
1494 dYield = yieldPt->GetBinContent(p);
1495
1496 dVn2nd += dvn2nd*dYield;
1497 dVn4th += dvn4th*dYield;
1498 dVn6th += dvn6th*dYield;
1499 dVn8th += dvn8th*dYield;
1500
1501 dSum2nd += dYield;
1502 dSum4th += dYield;
1503 dSum6th += dYield;
1504 dSum8th += dYield;
1505
1506 dErrVn2nd += dYield*dYield*dErrvn2nd*dErrvn2nd;
1507 dErrVn4th += dYield*dYield*dErrvn4th*dErrvn4th;
1508 dErrVn6th += dYield*dYield*dErrvn6th*dErrvn6th;
1509 dErrVn8th += dYield*dYield*dErrvn8th*dErrvn8th;
1510 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
1511
1512 // normalizing the results for integrated flow:
1513 if(dSum2nd)
1514 {
1515 dVn2nd /= dSum2nd;
1516 dErrVn2nd /= (dSum2nd*dSum2nd);
1517 dErrVn2nd = TMath::Sqrt(dErrVn2nd);
1518 }
1519 if(dSum4th)
1520 {
1521 dVn4th /= dSum4th;
1522 dErrVn4th /= (dSum4th*dSum4th);
1523 dErrVn4th = TMath::Sqrt(dErrVn4th);
1524 }
1525 if(dSum6th)
1526 {
1527 dVn6th /= dSum6th;
1528 dErrVn6th /= (dSum6th*dSum6th);
1529 dErrVn6th = TMath::Sqrt(dErrVn6th);
1530 }
1531 if(dSum8th)
1532 {
1533 dVn8th /= dSum8th;
1534 dErrVn8th /= (dSum8th*dSum8th);
1535 dErrVn8th = TMath::Sqrt(dErrVn8th);
1536 }
1537
1538 // storing the results for integrated flow in common hist results:
1539 if(rpPoi == "POI")
1540 {
1541 fCommonHistsResults2nd->FillIntegratedFlowPOI(dVn2nd,dErrVn2nd);
1542 fCommonHistsResults4th->FillIntegratedFlowPOI(dVn4th,dErrVn4th);
1543 fCommonHistsResults6th->FillIntegratedFlowPOI(dVn6th,dErrVn6th);
1544 fCommonHistsResults8th->FillIntegratedFlowPOI(dVn8th,dErrVn8th);
1545 }
1546 else if(rpPoi == "RP")
1547 {
1548 fCommonHistsResults2nd->FillIntegratedFlowRP(dVn2nd,dErrVn2nd);
1549 fCommonHistsResults4th->FillIntegratedFlowRP(dVn4th,dErrVn4th);
1550 fCommonHistsResults6th->FillIntegratedFlowRP(dVn6th,dErrVn6th);
1551 fCommonHistsResults8th->FillIntegratedFlowRP(dVn8th,dErrVn8th);
1552 }
1553
1554 delete flow2ndPt;
1555 delete flow4thPt;
1556 delete flow6thPt;
1557 delete flow8thPt;
1558 delete yieldPt;
1559
1560} // end of void AliFlowAnalysisWithCumulants::CalculateIntegratedFlow(TString rpPoi)
1561
1562//================================================================================================================
1563
1564void AliFlowAnalysisWithCumulants::FillCommonHistResultsForDifferentialFlow(TString rpPoi)
1565{
1566 // Fill common result histograms for differential flow.
1567 // (to be improved - this method can be implemented much better)
1568
ca5f47e7 1569 Int_t rp = 0;
d6130938 1570
1571 if(rpPoi == "RP")
1572 {
1573 rp = 0;
1574 } else if(rpPoi == "POI")
1575 {
1576 rp = 1;
1577 }
0dd3b008 1578
d6130938 1579 // pt:
1580 for(Int_t p=1;p<=fnBinsPt;p++)
1581 {
1582 // Result:
1583 Double_t v2 = fDiffFlow[rp][0][0]->GetBinContent(p);
1584 Double_t v4 = fDiffFlow[rp][0][1]->GetBinContent(p);
1585 Double_t v6 = fDiffFlow[rp][0][2]->GetBinContent(p);
1586 Double_t v8 = fDiffFlow[rp][0][3]->GetBinContent(p);
1587 // Error:
1588 Double_t v2Error = fDiffFlow[rp][0][0]->GetBinError(p);
1589 Double_t v4Error = fDiffFlow[rp][0][1]->GetBinError(p);
1590 Double_t v6Error = fDiffFlow[rp][0][2]->GetBinError(p);
1591 Double_t v8Error = fDiffFlow[rp][0][3]->GetBinError(p);
1592 // Fill common hist results:
1593 if(rpPoi == "RP")
1594 {
1595 fCommonHistsResults2nd->FillDifferentialFlowPtRP(p,v2,v2Error);
1596 fCommonHistsResults4th->FillDifferentialFlowPtRP(p,v4,v4Error);
1597 fCommonHistsResults6th->FillDifferentialFlowPtRP(p,v6,v6Error);
1598 fCommonHistsResults8th->FillDifferentialFlowPtRP(p,v8,v8Error);
1599 } else if(rpPoi == "POI")
1600 {
1601 fCommonHistsResults2nd->FillDifferentialFlowPtPOI(p,v2,v2Error);
1602 fCommonHistsResults4th->FillDifferentialFlowPtPOI(p,v4,v4Error);
1603 fCommonHistsResults6th->FillDifferentialFlowPtPOI(p,v6,v6Error);
1604 fCommonHistsResults8th->FillDifferentialFlowPtPOI(p,v8,v8Error);
1605 }
1606 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
1607
1608 // eta:
1609 for(Int_t e=1;e<=fnBinsEta;e++)
1610 {
1611 // Results:
1612 Double_t v2 = fDiffFlow[rp][1][0]->GetBinContent(e);
1613 Double_t v4 = fDiffFlow[rp][1][1]->GetBinContent(e);
1614 Double_t v6 = fDiffFlow[rp][1][2]->GetBinContent(e);
1615 Double_t v8 = fDiffFlow[rp][1][3]->GetBinContent(e);
1616 // Errors:
1617 Double_t v2Error = fDiffFlow[rp][1][0]->GetBinError(e);
1618 Double_t v4Error = fDiffFlow[rp][1][1]->GetBinError(e);
1619 Double_t v6Error = fDiffFlow[rp][1][2]->GetBinError(e);
1620 Double_t v8Error = fDiffFlow[rp][1][3]->GetBinError(e);
1621 // Fill common hist results:
1622 if(rpPoi == "RP")
1623 {
1624 fCommonHistsResults2nd->FillDifferentialFlowEtaRP(e,v2,v2Error);
1625 fCommonHistsResults4th->FillDifferentialFlowEtaRP(e,v4,v4Error);
1626 fCommonHistsResults6th->FillDifferentialFlowEtaRP(e,v6,v6Error);
1627 fCommonHistsResults8th->FillDifferentialFlowEtaRP(e,v8,v8Error);
1628 } else if(rpPoi == "POI")
1629 {
1630 fCommonHistsResults2nd->FillDifferentialFlowEtaPOI(e,v2,v2Error);
1631 fCommonHistsResults4th->FillDifferentialFlowEtaPOI(e,v4,v4Error);
1632 fCommonHistsResults6th->FillDifferentialFlowEtaPOI(e,v6,v6Error);
1633 fCommonHistsResults8th->FillDifferentialFlowEtaPOI(e,v8,v8Error);
1634 }
1635 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
1636
1637} // end of void AliFlowAnalysisWithCumulants::FillCommonHistResultsForDifferentialFlow(TString rpPoi)
1638
1639//================================================================================================================
1640
1641void AliFlowAnalysisWithCumulants::CalculateDifferentialFlow(TString rpPoi, TString ptEta)
1642{
1643 // Calculate differential flow for RPs/POIs vs pt/eta from cumulants.
1644
ca5f47e7 1645 Int_t rp = 0; // RP or POI
1646 Int_t pe = 0; // pt or eta
d6130938 1647
1648 if(rpPoi == "RP")
1649 {
1650 rp = 0;
1651 } else if(rpPoi == "POI")
1652 {
1653 rp = 1;
1654 }
1655 if(ptEta == "pt")
1656 {
1657 pe = 0;
1658 } else if(ptEta == "eta")
1659 {
1660 pe = 1;
1661 }
1662
1663 // Reference cumulants:
1664 Double_t gfc2 = fReferenceFlowCumulants->GetBinContent(1); // reference 2nd order cumulant
1665 Double_t gfc4 = fReferenceFlowCumulants->GetBinContent(2); // reference 4th order cumulant
1666 Double_t gfc6 = fReferenceFlowCumulants->GetBinContent(3); // reference 6th order cumulant
1667 Double_t gfc8 = fReferenceFlowCumulants->GetBinContent(4); // reference 8th order cumulant
1668
1669 Int_t nBins = fDiffFlowCumulants[rp][pe][0]->GetXaxis()->GetNbins();
1670
1671 for(Int_t b=1;b<=nBins;b++)
1672 {
1673 // Differential cumulants:
1674 Double_t gfd2 = fDiffFlowCumulants[rp][pe][0]->GetBinContent(b); // differential 2nd order cumulant
1675 Double_t gfd4 = fDiffFlowCumulants[rp][pe][1]->GetBinContent(b); // differential 4th order cumulant
1676 Double_t gfd6 = fDiffFlowCumulants[rp][pe][2]->GetBinContent(b); // differential 6th order cumulant
1677 Double_t gfd8 = fDiffFlowCumulants[rp][pe][3]->GetBinContent(b); // differential 8th order cumulant
1678 // Differential flow:
1679 Double_t v2 = 0.; // v'{2,GFC}
1680 Double_t v4 = 0.; // v'{4,GFC}
1681 Double_t v6 = 0.; // v'{6,GFC}
1682 Double_t v8 = 0.; // v'{8,GFC}
1683 // 2nd order:
1684 if(gfc2>0.)
1685 {
1686 v2 = gfd2/pow(gfc2,0.5);
1687 fDiffFlow[rp][pe][0]->SetBinContent(b,v2);
1688 }
1689 // 4th order:
1690 if(gfc4<0.)
1691 {
1692 v4 = -gfd4/pow(-gfc4,.75);
1693 fDiffFlow[rp][pe][1]->SetBinContent(b,v4);
1694 }
1695 // 6th order:
1696 if(gfc6>0.)
1697 {
1698 v6 = gfd6/(4.*pow((1./4.)*gfc6,(5./6.)));
1699 fDiffFlow[rp][pe][2]->SetBinContent(b,v6);
1700 }
1701 // 8th order:
1702 if(gfc8<0.)
1703 {
1704 v8 = -gfd8/(33.*pow(-(1./33.)*gfc8,(7./8.)));
1705 fDiffFlow[rp][pe][3]->SetBinContent(b,v8);
1706 }
1707 } // end of for(Int_t b=1;b<=nBins;b++)
1708
1709} // end of void AliFlowAnalysisWithCumulants::CalculateDifferentialFlow(TString rpPoi,TString ptEta)
1710
1711//================================================================================================================
1712
1713void AliFlowAnalysisWithCumulants::CalculateDifferentialFlowErrors(TString rpPoi,TString ptEta)
1714{
1715 // Calculate errors of differential flow.
1716
ca5f47e7 1717 Int_t rp = 0; // RP or POI
1718 Int_t pe = 0; // pt or eta
d6130938 1719
1720 if(rpPoi == "RP")
1721 {
1722 rp = 0;
1723 } else if(rpPoi == "POI")
1724 {
1725 rp = 1;
1726 }
1727 if(ptEta == "pt")
1728 {
1729 pe = 0;
1730 } else if(ptEta == "eta")
1731 {
1732 pe = 1;
1733 }
1734
1735 // Resolution chi:
1736 Double_t chi2 = fChi->GetBinContent(1);
1737 Double_t chi4 = fChi->GetBinContent(2);
1738 //Double_t chi6 = fChi->GetBinContent(3);
1739 //Double_t chi8 = fChi->GetBinContent(4);
1740
1741 Int_t nBins = fNoOfParticlesInBin[rp][pe]->GetXaxis()->GetNbins();
1742 for(Int_t b=1;b<=nBins;b++)
1743 {
1744 Int_t nParticles = (Int_t)fNoOfParticlesInBin[rp][pe]->GetBinEntries(b);
1745 // Error of 2nd order estimate:
1746 if(chi2>0. && nParticles>0.)
1747 {
1748 Double_t v2Error = pow((1./(2.*nParticles))*((1.+pow(chi2,2.))/pow(chi2,2.)),0.5);
1749 fDiffFlow[rp][pe][0]->SetBinError(b,v2Error);
1750 }
1751 // Error of 4th order estimate:
1752 if(chi4>0. && nParticles>0.)
1753 {
1754 Double_t v4Error = pow((1./(2.*nParticles))*((2.+6.*pow(chi4,2.)+pow(chi4,4.)+pow(chi4,6.))/pow(chi4,6.)),0.5);
1755 fDiffFlow[rp][pe][1]->SetBinError(b,v4Error);
1756 }
1757 // Error of 6th order estimate:
1758 //if(chi6>0. && nParticles>0.)
1759 //{
1760 // Double_t v6Error = ... // to be improved - yet to be calculated
1761 fDiffFlow[rp][pe][2]->SetBinError(b,0.);
1762 //}
1763 // Error of 8th order estimate:
1764 //if(chi8>0. && nParticles>0.)
1765 //{
1766 // Double_t v8Error = ... // to be improved - yet to be calculated
1767 fDiffFlow[rp][pe][3]->SetBinError(b,0.);
1768 //}
1769 } // end of for(Int_t b=1;b<=nBins;b++)
1770
1771} // end of void AliFlowAnalysisWithCumulants::CalculateDifferentialFlowErrors(TString rpPoi,TString ptEta)
1772
1773//================================================================================================================
1774
1775void AliFlowAnalysisWithCumulants::CalculateCumulantsForDiffFlow(TString rpPoi,TString ptEta)
1776{
1777 // Calculate cumulants for differential flow.
1778
ca5f47e7 1779 Int_t rp = 0; // RP or POI
1780 Int_t pe = 0; // pt or eta
d6130938 1781
1782 if(rpPoi == "RP")
1783 {
1784 rp = 0;
1785 } else if(rpPoi == "POI")
1786 {
1787 rp = 1;
1788 }
1789 if(ptEta == "pt")
1790 {
1791 pe = 0;
1792 } else if(ptEta == "eta")
1793 {
1794 pe = 1;
1795 }
1796
1797 // [nBins][pMax][qMax]:
1798 Int_t nBins = fDiffFlowGenFun[0][rp][pe]->GetXaxis()->GetNbins();
1799 Int_t pMax = fDiffFlowGenFun[0][rp][pe]->GetYaxis()->GetNbins();
1800 Int_t qMax = fDiffFlowGenFun[0][rp][pe]->GetZaxis()->GetNbins();
1801 // <G[p][q]>
1802 TMatrixD dAvG(pMax,qMax);
1803 dAvG.Zero();
1804 for(Int_t p=0;p<pMax;p++)
1805 {
1806 for(Int_t q=0;q<qMax;q++)
1807 {
1808 dAvG(p,q) = fReferenceFlowGenFun->GetBinContent(fReferenceFlowGenFun->GetBin(p+1,q+1));
1809 }
1810 }
1811 // Loop over pt/eta bins and calculate differential cumulants:
1812 for(Int_t b=0;b<nBins;b++)
1813 {
1814 Double_t gfc[5] = {0.}; // to be improved (hardwired 5)
1815 Double_t D[5] = {0.}; // D_{p} in Eq. (11) in Practical guide // to be improved (hardwired 5)
1816 // ptBinRPNoOfParticles[b]=fPtBinRPNoOfParticles->GetBinEntries(b+1);
1817 for(Int_t p=0;p<pMax;p++)
1818 {
1819 Double_t tempSum = 0.;
1820 for(Int_t q=0;q<qMax;q++)
1821 {
1822 if(TMath::Abs(dAvG(p,q))>1.e-44)
1823 {
1824 Double_t X = fDiffFlowGenFun[0][rp][pe]->GetBinContent(fDiffFlowGenFun[0][rp][pe]->GetBin(b+1,p+1,q+1))/dAvG(p,q); // see Ollitrault's Practical guide (Eq. 11)
1825 Double_t Y = fDiffFlowGenFun[1][rp][pe]->GetBinContent(fDiffFlowGenFun[0][rp][pe]->GetBin(b+1,p+1,q+1))/dAvG(p,q); // see Ollitrault's Practical guide (Eq. 11)
1826 tempSum += cos(fMultiple*2.*q*TMath::Pi()/qMax)*X
1827 + sin(fMultiple*2.*q*TMath::Pi()/qMax)*Y;
1828 }
1829 }
1830 D[p] = (pow(fR0*pow(p+1.0,0.5),fMultiple)/qMax)*tempSum;
1831 }
1832 gfc[0] = (1./(fR0*fR0))*(5.*D[0]-5.*D[1]+(10./3.)*D[2]-(5./4.)*D[3]+(1./5.)*D[4]);
1833 gfc[1] = (1./pow(fR0,4.))*((-77./6.)*D[0]+(107./6.)*D[1]-(13./1.)*D[2]+(61./12.)*D[3]-(5./6.)*D[4]);
1834 gfc[2] = (1./pow(fR0,6.))*((71./2.)*D[0]-59.*D[1]+49.*D[2]-(41./2.)*D[3]+(7./2.)*D[4]);
1835 gfc[3] = (1./pow(fR0,8.))*(-84.*D[0]+156.*D[1]-144.*D[2]+66.*D[3]-12.*D[4]);
1836 // gfc[4] = (1./pow(fR0,10.))*(120.*D[0]-240.*D[1]+240.*D[2]-120.*D[3]+24.*D[4]); // 10th order cumulant (to be improved - where to store it?)
1837 // Store cumulants:
1838 for(Int_t co=0;co<4;co++)
1839 {
1840 fDiffFlowCumulants[rp][pe][co]->SetBinContent(b+1,gfc[co]);
1841 }
1842 }
1843
1844} // end of void AliFlowAnalysisWithCumulants::CalculateCumulantsForDiffFlow(TString rpPoi, TString ptEta)
1845
1846//================================================================================================================
1847
1848void AliFlowAnalysisWithCumulants::PrintFinalResults(TString type)
1849{
1850 // Printing on the screen the final results for reference flow and for integrated flow of RPs and POIs.
1851
1852 Int_t n = fHarmonic;
1853
1854 Double_t dVn[4] = {0.}; // array to hold Vn{2}, Vn{4}, Vn{6} and Vn{8}
1855 Double_t dVnErr[4] = {0.}; // array to hold errors of Vn{2}, Vn{4}, Vn{6} and Vn{8}
1856
1857 if(type == "RF")
1858 {
1859 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinContent(1);
1860 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinError(1);
1861 dVn[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinContent(1);
1862 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinError(1);
1863 dVn[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinContent(1);
1864 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinError(1);
1865 dVn[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinContent(1);
1866 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinError(1);
1867 } else if(type == "RP")
1868 {
1869 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinContent(1);
1870 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinError(1);
1871 dVn[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinContent(1);
1872 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinError(1);
1873 dVn[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinContent(1);
1874 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinError(1);
1875 dVn[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinContent(1);
1876 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinError(1);
1877 } else if(type == "POI")
1878 {
1879 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinContent(1);
1880 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinError(1);
1881 dVn[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinContent(1);
1882 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinError(1);
1883 dVn[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinContent(1);
1884 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinError(1);
1885 dVn[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinContent(1);
1886 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinError(1);
1887 } else
1888 {
1889 cout<<endl;
1890 cout<<" WARNING: Impossible type (can be RF, RP or POI) !!!!"<<endl;
1891 cout<<" Results will not be printed on the screen."<<endl;
1892 cout<<endl;
1893 exit(0);
1894 }
1895
1896 TString title = " flow estimates from GF-cumulants";
1897 TString subtitle = " (";
1898
1899 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
1900 {
1901 subtitle.Append(type);
1902 subtitle.Append(", without weights)");
1903 } else
1904 {
1905 subtitle.Append(type);
1906 subtitle.Append(", with weights)");
1907 }
1908
1909 cout<<endl;
1910 cout<<"*************************************"<<endl;
1911 cout<<"*************************************"<<endl;
1912 cout<<title.Data()<<endl;
1913 cout<<subtitle.Data()<<endl;
1914 cout<<endl;
1915
1916 for(Int_t i=0;i<4;i++)
1917 {
1918 cout<<" v_"<<n<<"{"<<2*(i+1)<<"} = "<<dVn[i]<<" +/- "<<dVnErr[i]<<endl;
1919 }
1920
1921 cout<<endl;
1922 if(type == "RF")
1923 {
1924 cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultRP()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultRP()->GetMean()<<endl;
1925 }
1926 else if (type == "RP")
1927 {
1928 cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultRP()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultRP()->GetMean()<<endl;
1929 }
1930 else if (type == "POI")
1931 {
1932 cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultPOI()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultPOI()->GetMean()<<endl;
1933 }
1934 cout<<"*************************************"<<endl;
1935 cout<<"*************************************"<<endl;
1936 cout<<endl;
1937
1938} // end of AliFlowAnalysisWithCumulants::PrintFinalResults(TString type);
1939
1940//================================================================================================================
1941
1942void AliFlowAnalysisWithCumulants::FillCommonHistResultsForReferenceFlow()
1943{
1944 // Fill in AliFlowCommonHistResults dedicated histograms for reference flow.
1945
1946 // Results:
1947 Double_t v2 = fReferenceFlow->GetBinContent(1);
1948 Double_t v4 = fReferenceFlow->GetBinContent(2);
1949 Double_t v6 = fReferenceFlow->GetBinContent(3);
1950 Double_t v8 = fReferenceFlow->GetBinContent(4);
1951 // Errors:
1952 Double_t v2Error = fReferenceFlow->GetBinError(1);
1953 Double_t v4Error = fReferenceFlow->GetBinError(2);
1954 Double_t v6Error = fReferenceFlow->GetBinError(3);
1955 Double_t v8Error = fReferenceFlow->GetBinError(4);
1956 // Fill results end errors in common hist results:
1957 fCommonHistsResults2nd->FillIntegratedFlow(v2,v2Error);
1958 fCommonHistsResults4th->FillIntegratedFlow(v4,v4Error);
1959 fCommonHistsResults6th->FillIntegratedFlow(v6,v6Error);
1960 fCommonHistsResults8th->FillIntegratedFlow(v8,v8Error);
1961 // Chi:
1962 Double_t chi2 = fChi->GetBinContent(1);
1963 Double_t chi4 = fChi->GetBinContent(2);
1964 Double_t chi6 = fChi->GetBinContent(3);
1965 Double_t chi8 = fChi->GetBinContent(4);
1966 // Fill resolution chi in common hist results:
1967 fCommonHistsResults2nd->FillChi(chi2);
1968 fCommonHistsResults4th->FillChi(chi4);
1969 fCommonHistsResults6th->FillChi(chi6);
1970 fCommonHistsResults8th->FillChi(chi8);
1971
1972} // end of AliFlowAnalysisWithCumulants::FillCommonHistResultsForReferenceFlow()
1973
1974//================================================================================================================
1975
1976void AliFlowAnalysisWithCumulants::CalculateReferenceFlowError()
1977{
1978 // Calculate error of reference flow harmonics.
1979
1980 // Generating Function Cumulants:
1981 Double_t gfc2 = fReferenceFlowCumulants->GetBinContent(1); // GFC{2}
1982 Double_t gfc4 = fReferenceFlowCumulants->GetBinContent(2); // GFC{4}
1983 Double_t gfc6 = fReferenceFlowCumulants->GetBinContent(3); // GFC{6}
1984 Double_t gfc8 = fReferenceFlowCumulants->GetBinContent(4); // GFC{8}
1985 // Reference flow estimates:
1986 Double_t v2 = fReferenceFlow->GetBinContent(1); // v{2,GFC}
1987 Double_t v4 = fReferenceFlow->GetBinContent(2); // v{4,GFC}
1988 Double_t v6 = fReferenceFlow->GetBinContent(3); // v{6,GFC}
1989 Double_t v8 = fReferenceFlow->GetBinContent(4); // v{8,GFC}
1990 // Statistical errors of reference flow estimates:
1991 Double_t v2Error = 0.; // statistical error of v{2,GFC}
1992 Double_t v4Error = 0.; // statistical error of v{4,GFC}
1993 Double_t v6Error = 0.; // statistical error of v{6,GFC}
1994 Double_t v8Error = 0.; // statistical error of v{8,GFC}
1995 // Chi:
1996 Double_t chi2 = 0.;
1997 Double_t chi4 = 0.;
1998 Double_t chi6 = 0.;
1999 Double_t chi8 = 0.;
2000 // <Q-vector stuff>:
2001 Double_t dAvQx = fQvectorComponents->GetBinContent(1); // <Q_x>
2002 Double_t dAvQy = fQvectorComponents->GetBinContent(2); // <Q_y>
2003 Double_t dAvQ2x = fQvectorComponents->GetBinContent(3); // <(Q_x)^2>
2004 Double_t dAvQ2y = fQvectorComponents->GetBinContent(4); // <(Q_y)^2>
2005 // <w^2>:
2006 Double_t dAvw2 = 1.;
2007 if(fnEvts>0)
2008 {
2009 dAvw2 = fAverageOfSquaredWeight->GetBinContent(1);
2010 if(TMath::Abs(dAvw2)<1.e-44)
2011 {
2012 cout<<endl;
2013 cout<<" WARNING (GFC): Average of squared weight is 0 in GFC. Most probably one of the histograms"<<endl;
2014 cout<<" in the file \"weights.root\" was empty. Nothing will be calculated !!!!"<<endl;
2015 cout<<endl;
2016 }
2017 }
2018 // Calculating statistical error of v{2,GFC}:
2019 if(fnEvts>0. && fAvM>0. && dAvw2>0. && gfc2>=0.)
2020 {
2021 if((dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow(gfc2,(1./2.))*(fAvM/dAvw2),2.)>0.))
2022 {
2023 chi2 = (fAvM*v2)/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(v2*fAvM/dAvw2,2.),0.5);
2024 }
2025 if(TMath::Abs(chi2)>1.e-44)
2026 {
2027 v2Error = pow(((1./(2.*fAvM*fnEvts))*((1.+2.*pow(chi2,2))/(2.*pow(chi2,2)))),0.5);
2028 }
2029 }
2030 // Calculating statistical error of v{4,GFC}:
2031 if(fnEvts>0 && fAvM>0 && dAvw2>0 && gfc4<=0.)
2032 {
2033 if((dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow(-gfc4,(1./4.))*(fAvM/dAvw2),2.)>0.))
2034 {
2035 chi4 = (fAvM*v4)/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(v4*fAvM/dAvw2,2.),0.5);
2036 }
2037 if(TMath::Abs(chi4)>1.e-44)
2038 {
2039 v4Error = (1./(pow(2.*fAvM*fnEvts,0.5)))*pow((1.+4.*pow(chi4,2)+1.*pow(chi4,4.)+2.*pow(chi4,6.))/(2.*pow(chi4,6.)),0.5);
2040 }
2041 }
2042 // Calculating statistical error of v{6,GFC}:
2043 if(fnEvts>0 && fAvM>0 && dAvw2>0 && gfc6>=0.)
2044 {
2045 if((dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow((1./4.)*gfc6,(1./6.))*(fAvM/dAvw2),2.)>0.))
2046 {
2047 chi6 = (fAvM*v6)/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(v6*fAvM/dAvw2,2.),0.5);
2048 }
2049 if(TMath::Abs(chi6)>1.e-44)
2050 {
2051 v6Error = (1./(pow(2.*fAvM*fnEvts,0.5)))*pow((3.+18.*pow(chi6,2)+9.*pow(chi6,4.)+28.*pow(chi6,6.)
2052 +12.*pow(chi6,8.)+24.*pow(chi6,10.))/(24.*pow(chi6,10.)),0.5);
2053 }
2054 }
2055 // Calculating statistical error of v{8,GFC}:
2056 if(fnEvts>0 && fAvM>0 && dAvw2>0 && gfc8<=0.)
2057 {
2058 if((dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow(-(1./33.)*gfc8,(1./8.))*(fAvM/dAvw2),2.)>0.))
2059 {
2060 chi8=(fAvM*v8)/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(v8*fAvM/dAvw2,2.),0.5);
2061 }
2062 if(TMath::Abs(chi8)>1.e-44)
2063 {
2064 v8Error = (1./(pow(2.*fAvM*fnEvts,0.5)))*pow((12.+96.*pow(chi8,2.)+72.*pow(chi8,4.)+304.*pow(chi8,6.)
2065 +257.*pow(chi8,8.)+804.*pow(chi8,10.)+363.*pow(chi8,12.)+726.*pow(chi8,14.))/(726.*pow(chi8,14.)),0.5);
2066 }
2067 }
2068
2069 // Store errors for reference flow:
2070 fReferenceFlow->SetBinError(1,v2Error);
2071 fReferenceFlow->SetBinError(2,v4Error);
2072 fReferenceFlow->SetBinError(3,v6Error);
2073 fReferenceFlow->SetBinError(4,v8Error);
2074 // Store resolution chi:
2075 fChi->SetBinContent(1,chi2);
2076 fChi->SetBinContent(2,chi4);
2077 fChi->SetBinContent(3,chi6);
2078 fChi->SetBinContent(4,chi8);
2079
2080} // end of void AliFlowAnalysisWithCumulants::CalculateReferenceFlowError()
2081
2082//================================================================================================================
2083
2084void AliFlowAnalysisWithCumulants::CalculateReferenceFlow()
2085{
2086 // Calculate from isotropic cumulants reference flow.
2087
2088 // Generating Function Cumulants:
2089 Double_t gfc2 = fReferenceFlowCumulants->GetBinContent(1); // GFC{2}
2090 Double_t gfc4 = fReferenceFlowCumulants->GetBinContent(2); // GFC{4}
2091 Double_t gfc6 = fReferenceFlowCumulants->GetBinContent(3); // GFC{6}
2092 Double_t gfc8 = fReferenceFlowCumulants->GetBinContent(4); // GFC{8}
d6130938 2093 // Reference flow estimates:
2094 Double_t v2 = 0.; // v{2,GFC}
2095 Double_t v4 = 0.; // v{4,GFC}
2096 Double_t v6 = 0.; // v{6,GFC}
2097 Double_t v8 = 0.; // v{8,GFC}
d6130938 2098 // Calculate reference flow estimates from Q-cumulants:
2099 if(gfc2>=0.) v2 = pow(gfc2,1./2.);
2100 if(gfc4<=0.) v4 = pow(-1.*gfc4,1./4.);
2101 if(gfc6>=0.) v6 = pow((1./4.)*gfc6,1./6.);
2102 if(gfc8<=0.) v8 = pow((-1./33.)*gfc8,1./8.);
d6130938 2103 // Store results for reference flow:
2104 fReferenceFlow->SetBinContent(1,v2);
2105 fReferenceFlow->SetBinContent(2,v4);
2106 fReferenceFlow->SetBinContent(3,v6);
2107 fReferenceFlow->SetBinContent(4,v8);
d6130938 2108
2109} // end of void AliFlowAnalysisWithCumulants::CalculateReferenceFlow()
2110
2111//================================================================================================================
2112
2113void AliFlowAnalysisWithCumulants::CalculateCumulantsForReferenceFlow()
2114{
2115 // Calculate cumulants for reference flow.
2116
2117 Int_t pMax = fReferenceFlowGenFun->GetXaxis()->GetNbins();
2118 Int_t qMax = fReferenceFlowGenFun->GetYaxis()->GetNbins();
2119
2120 // <G[p][q]>
2121 TMatrixD dAvG(pMax,qMax);
2122 dAvG.Zero();
2123 Bool_t someAvGEntryIsNegative = kFALSE;
2124 for(Int_t p=0;p<pMax;p++)
2125 {
2126 for(Int_t q=0;q<qMax;q++)
2127 {
2128 dAvG(p,q) = fReferenceFlowGenFun->GetBinContent(fReferenceFlowGenFun->GetBin(p+1,q+1));
2129 if(dAvG(p,q)<0.)
2130 {
2131 someAvGEntryIsNegative = kTRUE;
2132 cout<<endl;
2133 cout<<" WARNING: "<<Form("<G[%d][%d]> is negative !!!! GFC results are meaningless.",p,q)<<endl;
2134 cout<<endl;
2135 }
2136 }
2137 }
2138
2139 // C[p][q] (generating function for the cumulants)
2140 TMatrixD dC(pMax,qMax);
2141 dC.Zero();
2142 if(fAvM>0. && !someAvGEntryIsNegative)
2143 {
2144 for(Int_t p=0;p<pMax;p++)
2145 {
2146 for(Int_t q=0;q<qMax;q++)
2147 {
2148 dC(p,q) = fAvM*(pow(dAvG(p,q),(1./fAvM))-1.);
2149 }
2150 }
2151 }
2152
2153 // Averaging the generating function for cumulants over azimuth
2154 // in order to eliminate detector effects.
2155 // <C[p][q]> (Remark: here <> stands for average over azimuth):
2156 TVectorD dAvC(pMax);
2157 dAvC.Zero();
2158 for(Int_t p=0;p<pMax;p++)
2159 {
2160 Double_t temp = 0.;
2161 for(Int_t q=0;q<qMax;q++)
2162 {
2163 temp += 1.*dC(p,q);
2164 }
2165 dAvC[p] = temp/qMax;
2166 }
2167
2168 // Finally, the isotropic cumulants for reference flow:
2169 TVectorD cumulant(pMax);
2170 cumulant.Zero();
2171 cumulant[0] = (-1./(60*fR0*fR0))*((-300.)*dAvC[0]+300.*dAvC[1]-200.*dAvC[2]+75.*dAvC[3]-12.*dAvC[4]);
2172 cumulant[1] = (-1./(6.*pow(fR0,4.)))*(154.*dAvC[0]-214.*dAvC[1]+156.*dAvC[2]-61.*dAvC[3]+10.*dAvC[4]);
2173 cumulant[2] = (3./(2.*pow(fR0,6.)))*(71.*dAvC[0]-118.*dAvC[1]+98.*dAvC[2]-41.*dAvC[3]+7.*dAvC[4]);
2174 cumulant[3] = (-24./pow(fR0,8.))*(14.*dAvC[0]-26.*dAvC[1]+24.*dAvC[2]-11.*dAvC[3]+2.*dAvC[4]);
2175 cumulant[4] = (120./pow(fR0,10.))*(5.*dAvC[0]-10.*dAvC[1]+10.*dAvC[2]-5.*dAvC[3]+1.*dAvC[4]);
2176
2177 // Store cumulants:
2178 // Remark: the highest order cumulant is on purpose in the overflow.
2179 for(Int_t co=0;co<pMax;co++) // cumulant order
2180 {
2181 fReferenceFlowCumulants->SetBinContent(co+1,cumulant[co]);
2182 }
2183
3688e459 2184 // Calculation versus multiplicity:
2185 if(!fCalculateVsMultiplicity){return;}
2186 for(Int_t b=0;b<fnBinsMult;b++)
2187 {
2188 fAvM = fAvMVsM->GetBinContent(b+1);
2189 // <G[p][q]>
2190 TMatrixD dAvGVsM(pMax,qMax);
2191 dAvGVsM.Zero();
2192 Bool_t someAvGEntryIsNegativeVsM = kFALSE;
2193 for(Int_t p=0;p<pMax;p++)
2194 {
2195 for(Int_t q=0;q<qMax;q++)
2196 {
2197 dAvGVsM(p,q) = fReferenceFlowGenFunVsM->GetBinContent(fReferenceFlowGenFunVsM->GetBin(b+1,p+1,q+1));
2198 if(dAvGVsM(p,q)<0.)
2199 {
2200 someAvGEntryIsNegativeVsM = kTRUE;
2201 cout<<endl;
2202 cout<<" WARNING: "<<Form("<G[%d][%d]> is negative !!!! GFC vs multiplicity results are meaningless.",p,q)<<endl;
2203 cout<<endl;
2204 }
2205 }
2206 }
2207
2208 // C[p][q] (generating function for the cumulants)
2209 TMatrixD dCVsM(pMax,qMax);
2210 dCVsM.Zero();
2211 if(fAvM>0. && !someAvGEntryIsNegativeVsM)
2212 {
2213 for(Int_t p=0;p<pMax;p++)
2214 {
2215 for(Int_t q=0;q<qMax;q++)
2216 {
2217 dCVsM(p,q) = fAvM*(pow(dAvGVsM(p,q),(1./fAvM))-1.);
2218 }
2219 }
2220 }
2221
2222 // Averaging the generating function for cumulants over azimuth
2223 // in order to eliminate detector effects.
2224 // <C[p][q]> (Remark: here <> stands for average over azimuth):
2225 TVectorD dAvCVsM(pMax);
2226 dAvCVsM.Zero();
2227 for(Int_t p=0;p<pMax;p++)
2228 {
2229 Double_t tempVsM = 0.;
2230 for(Int_t q=0;q<qMax;q++)
2231 {
2232 tempVsM += 1.*dCVsM(p,q);
2233 }
2234 dAvCVsM[p] = tempVsM/qMax;
2235 }
2236
2237 // Finally, the isotropic cumulants for reference flow:
2238 TVectorD cumulantVsM(pMax);
2239 cumulantVsM.Zero();
2240 cumulantVsM[0] = (-1./(60*fR0*fR0))*((-300.)*dAvCVsM[0]+300.*dAvCVsM[1]-200.*dAvCVsM[2]+75.*dAvCVsM[3]-12.*dAvCVsM[4]);
2241 cumulantVsM[1] = (-1./(6.*pow(fR0,4.)))*(154.*dAvCVsM[0]-214.*dAvCVsM[1]+156.*dAvCVsM[2]-61.*dAvCVsM[3]+10.*dAvCVsM[4]);
2242 cumulantVsM[2] = (3./(2.*pow(fR0,6.)))*(71.*dAvCVsM[0]-118.*dAvCVsM[1]+98.*dAvCVsM[2]-41.*dAvCVsM[3]+7.*dAvCVsM[4]);
2243 cumulantVsM[3] = (-24./pow(fR0,8.))*(14.*dAvCVsM[0]-26.*dAvCVsM[1]+24.*dAvCVsM[2]-11.*dAvCVsM[3]+2.*dAvCVsM[4]);
2244 cumulantVsM[4] = (120./pow(fR0,10.))*(5.*dAvCVsM[0]-10.*dAvCVsM[1]+10.*dAvCVsM[2]-5.*dAvCVsM[3]+1.*dAvCVsM[4]);
2245
2246 // Store cumulants:
2247 for(Int_t co=0;co<pMax-1;co++) // cumulant order
2248 {
2249 fReferenceFlowCumulantsVsM[co]->SetBinContent(b+1,cumulantVsM[co]);
2250 }
2251 } // end of for(Int_t b=0;b<fnBinsMult;b++)
2252
d6130938 2253} // end of void AliFlowAnalysisWithCumulants::CalculateCumulantsForReferenceFlow()
2254
2255//================================================================================================================
2256
2257void AliFlowAnalysisWithCumulants::GetAvMultAndNoOfEvts()
2258{
2259 // From relevant common control histogram get average multiplicity of RPs and number of events.
2260
2261 fAvM = (Double_t)fCommonHists->GetHistMultRP()->GetMean();
2262 fnEvts = (Int_t)fCommonHists->GetHistMultRP()->GetEntries();
2263
2264} // end of void AliFlowAnalysisWithCumulants::GetAvMultAndNoOfEvts()
2265
2266//================================================================================================================
2267
2268void AliFlowAnalysisWithCumulants::InitializeArrays()
2269{
2270 // Initialize all arrays.
2271
2272 for(Int_t ri=0;ri<2;ri++)
2273 {
2274 for(Int_t rp=0;rp<2;rp++)
2275 {
2276 for(Int_t pe=0;pe<2;pe++)
2277 {
2278 fDiffFlowGenFun[ri][rp][pe] = NULL;
2279 }
2280 }
2281 }
2282 for(Int_t rp=0;rp<2;rp++)
2283 {
2284 for(Int_t pe=0;pe<2;pe++)
2285 {
2286 fNoOfParticlesInBin[rp][pe] = NULL;
2287 }
2288 }
2289 for(Int_t rp=0;rp<2;rp++)
2290 {
2291 for(Int_t pe=0;pe<2;pe++)
2292 {
2293 for(Int_t co=0;co<4;co++)
2294 {
2295 fDiffFlowCumulants[rp][pe][co] = NULL;
2296 fDiffFlow[rp][pe][co] = NULL;
2297 }
2298 }
2299 }
2300 for(Int_t i=0;i<3;i++)
2301 {
2302 fPrintFinalResults[i] = kTRUE;
2303 }
2304 for(Int_t r=0;r<10;r++)
2305 {
2306 fTuningR0[r] = 0.;
2307 for(Int_t pq=0;pq<5;pq++)
2308 {
2309 fTuningGenFun[r][pq] = NULL;
2310 fTuningCumulants[r][pq] = NULL;
2311 fTuningFlow[r][pq] = NULL;
2312 }
2313 }
3688e459 2314 for(Int_t co=0;co<4;co++)
2315 {
2316 fReferenceFlowCumulantsVsM[co] = NULL;
2317 }
d6130938 2318
2319} // end of void AliFlowAnalysisWithCumulants::InitializeArrays()
2320
2321//================================================================================================================
2322
2323void AliFlowAnalysisWithCumulants::CrossCheckSettings()
2324{
2325 // Cross-check the user settings before starting.
2326
2327 // a) Cross check if the choice for multiplicity weight make sense.
2328
2329 // a) Cross check if the choice for multiplicity weight make sense:
2330 if(strcmp(fMultiplicityWeight->Data(),"unit") &&
2331 strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2332 {
2333 cout<<endl;
2334 cout<<"WARNING (GFC): Multiplicity weight can be either \"unit\" or \"multiplicity\"."<<endl;
2335 cout<<" Certainly not \""<<fMultiplicityWeight->Data()<<"\"."<<endl;
2336 cout<<endl;
2337 exit(0);
2338 }
2339
2340
2341
2342} // end of void AliFlowAnalysisWithCumulants::CrossCheckSettings()
2343
2344//================================================================================================================
2345
2346void AliFlowAnalysisWithCumulants::AccessConstants()
2347{
2348 // Access needed common constants from AliFlowCommonConstants.
b6cd16a9 2349
d6130938 2350 fnBinsPhi = AliFlowCommonConstants::GetMaster()->GetNbinsPhi();
2351 fPhiMin = AliFlowCommonConstants::GetMaster()->GetPhiMin();
2352 fPhiMax = AliFlowCommonConstants::GetMaster()->GetPhiMax();
2353 if(fnBinsPhi) fPhiBinWidth = (fPhiMax-fPhiMin)/fnBinsPhi;
2354 fnBinsPt = AliFlowCommonConstants::GetMaster()->GetNbinsPt();
2355 fPtMin = AliFlowCommonConstants::GetMaster()->GetPtMin();
2356 fPtMax = AliFlowCommonConstants::GetMaster()->GetPtMax();
2357 if(fnBinsPt) fPtBinWidth = (fPtMax-fPtMin)/fnBinsPt;
2358 fnBinsEta = AliFlowCommonConstants::GetMaster()->GetNbinsEta();
2359 fEtaMin = AliFlowCommonConstants::GetMaster()->GetEtaMin();
2360 fEtaMax = AliFlowCommonConstants::GetMaster()->GetEtaMax();
2361 if(fnBinsEta) fEtaBinWidth = (fEtaMax-fEtaMin)/fnBinsEta;
2362
2363} // end of void AliFlowAnalysisWithCumulants::AccessConstants()
2364
2365//================================================================================================================
2366
2367void AliFlowAnalysisWithCumulants::BookAndFillWeightsHistograms()
2368{
3688e459 2369 // Book and fill histograms which hold phi, pt and eta weights.
d6130938 2370
2371 if(!fWeightsList)
2372 {
2373 cout<<"WARNING (GFC): fWeightsList is NULL in AFAWGFC::BAFWH() !!!!"<<endl;
2374 exit(0);
2375 }
2376
d6130938 2377 if(fUsePhiWeights)
b6cd16a9 2378 {
d6130938 2379 if(fWeightsList->FindObject("phi_weights"))
b6cd16a9 2380 {
d6130938 2381 fPhiWeights = dynamic_cast<TH1F*>(fWeightsList->FindObject("phi_weights"));
ca5f47e7 2382 if(!fPhiWeights){printf("\n WARNING (GFC): !fPhiWeights !!!!\n");exit(0);}
d6130938 2383 if(TMath::Abs(fPhiWeights->GetBinWidth(1)-fPhiBinWidth)>pow(10.,-6.))
b6cd16a9 2384 {
d6130938 2385 cout<<endl;
2386 cout<<"WARNING (GFC): Inconsistent binning in histograms for phi-weights throughout the code."<<endl;
2387 cout<<endl;
6fbbbbf1 2388 //exit(0);
d6130938 2389 }
2390 } else
b6cd16a9 2391 {
d6130938 2392 cout<<endl;
2393 cout<<"WARNING (GFC): fWeightsList->FindObject(\"phi_weights\") is NULL in AFAWGFC::BAFWH() !!!!"<<endl;
2394 cout<<endl;
2395 exit(0);
b6cd16a9 2396 }
d6130938 2397 } // end of if(fUsePhiWeights)
2398
2399 if(fUsePtWeights)
2400 {
2401 if(fWeightsList->FindObject("pt_weights"))
2402 {
2403 fPtWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("pt_weights"));
ca5f47e7 2404 if(!fPtWeights){printf("\n WARNING (GFC): !fPtWeights !!!!\n");exit(0);}
d6130938 2405 if(TMath::Abs(fPtWeights->GetBinWidth(1)-fPtBinWidth)>pow(10.,-6.))
2406 {
2407 cout<<endl;
2408 cout<<"WARNING (GFC): Inconsistent binning in histograms for pt-weights throughout the code."<<endl;
2409 cout<<endl;
6fbbbbf1 2410 //exit(0);
d6130938 2411 }
2412 } else
2413 {
2414 cout<<endl;
2415 cout<<"WARNING (GFC): fWeightsList->FindObject(\"pt_weights\") is NULL in AFAWGFC::BAFWH() !!!!"<<endl;
2416 cout<<endl;
2417 exit(0);
2418 }
2419 } // end of if(fUsePtWeights)
2420
2421 if(fUseEtaWeights)
2422 {
2423 if(fWeightsList->FindObject("eta_weights"))
2424 {
2425 fEtaWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("eta_weights"));
ca5f47e7 2426 if(!fEtaWeights){printf("\n WARNING (GFC): !fEtaWeights !!!!\n");exit(0);}
d6130938 2427 if(TMath::Abs(fEtaWeights->GetBinWidth(1)-fEtaBinWidth)>pow(10.,-6.))
2428 {
2429 cout<<endl;
2430 cout<<"WARNING (GFC): Inconsistent binning in histograms for eta-weights throughout the code."<<endl;
2431 cout<<endl;
6fbbbbf1 2432 //exit(0);
d6130938 2433 }
2434 } else
2435 {
2436 cout<<endl;
2437 cout<<"WARNING (GFC): fUseEtaWeights && fWeightsList->FindObject(\"eta_weights\") is NULL in AFAWGFC::BAFWH() !!!!"<<endl;
2438 cout<<endl;
2439 exit(0);
2440 }
2441 } // end of if(fUseEtaWeights)
2442
2443} // end of AliFlowAnalysisWithCumulants::BookAndFillWeightsHistograms()
2444
2445//================================================================================================================
2446
3688e459 2447void AliFlowAnalysisWithCumulants::BookEverythingForCalculationVsMultiplicity()
2448{
2449 // Book all objects relevant for flow analysis versus multiplicity.
2450
2451 // a) Define constants;
2452 // b) Book all profiles;
2453 // c) Book all results.
2454
2455 // a) Define constants and local flags:
2456 Int_t pMax = 5;
2457 Int_t qMax = 11;
2458 TString cumulantFlag[4] = {"GFC{2}","GFC{4}","GFC{6}","GFC{8}"};
2459
2460 // b) Book all profiles:
2461 // Average of the generating function for reference flow <G[p][q]> versus multiplicity:
2462 fReferenceFlowGenFunVsM = new TProfile3D("fReferenceFlowGenFunVsM","#LTG[p][q]#GT vs M",fnBinsMult,fMinMult,fMaxMult,pMax,0.,(Double_t)pMax,qMax,0.,(Double_t)qMax);
2463 fReferenceFlowGenFunVsM->SetXTitle("M");
2464 fReferenceFlowGenFunVsM->SetYTitle("p");
2465 fReferenceFlowGenFunVsM->SetZTitle("q");
2466 fReferenceFlowProfiles->Add(fReferenceFlowGenFunVsM);
2467 // Averages of Q-vector components versus multiplicity:
2468 fQvectorComponentsVsM = new TProfile2D("fQvectorComponentsVsM","Averages of Q-vector components",fnBinsMult,fMinMult,fMaxMult,4,0.,4.);
2469 //fQvectorComponentsVsM->SetLabelSize(0.06);
2470 fQvectorComponentsVsM->SetMarkerStyle(25);
2471 fQvectorComponentsVsM->SetXTitle("M");
2472 fQvectorComponentsVsM->GetYaxis()->SetBinLabel(1,"#LTQ_{x}#GT"); // Q_{x}
2473 fQvectorComponentsVsM->GetYaxis()->SetBinLabel(2,"#LTQ_{y}#GT"); // Q_{y}
2474 fQvectorComponentsVsM->GetYaxis()->SetBinLabel(3,"#LTQ_{x}^{2}#GT"); // Q_{x}^{2}
2475 fQvectorComponentsVsM->GetYaxis()->SetBinLabel(4,"#LTQ_{y}^{2}#GT"); // Q_{y}^{2}
2476 fReferenceFlowProfiles->Add(fQvectorComponentsVsM);
2477 // <<w^2>>, where w = wPhi*wPt*wEta versus multiplicity:
2478 fAverageOfSquaredWeightVsM = new TProfile2D("fAverageOfSquaredWeightVsM","#LT#LTw^{2}#GT#GT",fnBinsMult,fMinMult,fMaxMult,1,0,1);
2479 fAverageOfSquaredWeightVsM->SetLabelSize(0.06);
2480 fAverageOfSquaredWeightVsM->SetMarkerStyle(25);
2481 fAverageOfSquaredWeightVsM->SetLabelOffset(0.01);
2482 fAverageOfSquaredWeightVsM->GetXaxis()->SetBinLabel(1,"#LT#LTw^{2}#GT#GT");
2483 fReferenceFlowProfiles->Add(fAverageOfSquaredWeightVsM);
2484 // <M> vs multiplicity bin:
2485 fAvMVsM = new TProfile("fAvMVsM","#LTM#GT vs M",fnBinsMult,fMinMult,fMaxMult);
2486 //fAvMVsM->SetLabelSize(0.06);
2487 fAvMVsM->SetMarkerStyle(25);
2488 fAvMVsM->SetLabelOffset(0.01);
2489 fAvMVsM->SetXTitle("M");
2490 fAvMVsM->SetYTitle("#LTM#GT");
2491 fReferenceFlowProfiles->Add(fAvMVsM);
2492
2493 // c) Book all results:
2494 // Final results for reference GF-cumulants versus multiplicity:
2495 TString referenceFlowCumulantsVsMName = "fReferenceFlowCumulantsVsM";
2496 for(Int_t co=0;co<4;co++) // cumulant order
2497 {
2498 fReferenceFlowCumulantsVsM[co] = new TH1D(Form("%s, %s",referenceFlowCumulantsVsMName.Data(),cumulantFlag[co].Data()),
2499 Form("%s vs multipicity",cumulantFlag[co].Data()),
2500 fnBinsMult,fMinMult,fMaxMult);
2501 fReferenceFlowCumulantsVsM[co]->SetMarkerStyle(25);
2502 fReferenceFlowCumulantsVsM[co]->GetXaxis()->SetTitle("M");
2503 fReferenceFlowCumulantsVsM[co]->GetYaxis()->SetTitle(cumulantFlag[co].Data());
2504 fReferenceFlowResults->Add(fReferenceFlowCumulantsVsM[co]);
2505 } // end of for(Int_t co=0;co<4;co++) // cumulant order
2506
2507} // end of void AliFlowAnalysisWithCumulants::BookEverythingForCalculationVsMultiplicity()
2508
2509//================================================================================================================
2510
d6130938 2511void AliFlowAnalysisWithCumulants::BookEverythingForReferenceFlow()
2512{
2513 // Book all objects relevant for calculation of reference flow.
2514
2515 // a) Define static constants for array's boundaries;
2516 // b) Book profile to hold all flags for reference flow;
2517 // c) Book all event-by-event quantities;
2518 // d) Book all profiles;
2519 // e) Book all histograms.
2520
2521 // a) Define static constants for array's boundaries:
2522 static const Int_t pMax = 5;
2523 static const Int_t qMax = 11;
2524
2525 // b) Book profile to hold all flags for reference flow:
2526 TString referenceFlowFlagsName = "fReferenceFlowFlags";
2527 fReferenceFlowFlags = new TProfile(referenceFlowFlagsName.Data(),"Flags for Reference Flow",2,0,2);
2528 fReferenceFlowFlags->SetTickLength(-0.01,"Y");
2529 fReferenceFlowFlags->SetMarkerStyle(25);
2530 fReferenceFlowFlags->SetLabelSize(0.05);
2531 fReferenceFlowFlags->SetLabelOffset(0.02,"Y");
2532 fReferenceFlowFlags->GetXaxis()->SetBinLabel(1,"Particle weights");
2533 fReferenceFlowFlags->GetXaxis()->SetBinLabel(2,"Event weights");
2534 fReferenceFlowList->Add(fReferenceFlowFlags);
2535
2536 // c) Book all event-by-event quantities:
2537 fGEBE = new TMatrixD(pMax,qMax);
2538
2539 // d) Book all profiles:
2540 // Average of the generating function for reference flow <G[p][q]>:
2541 fReferenceFlowGenFun = new TProfile2D("fReferenceFlowGenFun","#LTG[p][q]#GT",pMax,0.,(Double_t)pMax,qMax,0.,(Double_t)qMax);
2542 fReferenceFlowGenFun->SetXTitle("p");
2543 fReferenceFlowGenFun->SetYTitle("q");
2544 fReferenceFlowProfiles->Add(fReferenceFlowGenFun);
2545 // Averages of Q-vector components:
2546 fQvectorComponents = new TProfile("fQvectorComponents","Averages of Q-vector components",4,0.,4.);
2547 fQvectorComponents->SetLabelSize(0.06);
2548 fQvectorComponents->SetMarkerStyle(25);
2549 fQvectorComponents->GetXaxis()->SetBinLabel(1,"#LTQ_{x}#GT"); // Q_{x}
2550 fQvectorComponents->GetXaxis()->SetBinLabel(2,"#LTQ_{y}#GT"); // Q_{y}
2551 fQvectorComponents->GetXaxis()->SetBinLabel(3,"#LTQ_{x}^{2}#GT"); // Q_{x}^{2}
2552 fQvectorComponents->GetXaxis()->SetBinLabel(4,"#LTQ_{y}^{2}#GT"); // Q_{y}^{2}
2553 fReferenceFlowProfiles->Add(fQvectorComponents);
2554 // <<w^2>>, where w = wPhi*wPt*wEta:
2555 fAverageOfSquaredWeight = new TProfile("fAverageOfSquaredWeight","#LT#LTw^{2}#GT#GT",1,0,1);
2556 fAverageOfSquaredWeight->SetLabelSize(0.06);
2557 fAverageOfSquaredWeight->SetMarkerStyle(25);
2558 fAverageOfSquaredWeight->SetLabelOffset(0.01);
2559 fAverageOfSquaredWeight->GetXaxis()->SetBinLabel(1,"#LT#LTw^{2}#GT#GT");
2560 fReferenceFlowProfiles->Add(fAverageOfSquaredWeight);
2561
2562 // e) Book all histograms:
2563 // Final results for isotropic cumulants for reference flow:
2564 TString referenceFlowCumulantsName = "fReferenceFlowCumulants";
2565 fReferenceFlowCumulants = new TH1D(referenceFlowCumulantsName.Data(),"Isotropic Generating Function Cumulants for reference flow",4,0,4); // to be improved (hw 4)
2566 fReferenceFlowCumulants->SetLabelSize(0.05);
2567 fReferenceFlowCumulants->SetMarkerStyle(25);
2568 fReferenceFlowCumulants->GetXaxis()->SetBinLabel(1,"GFC{2}");
2569 fReferenceFlowCumulants->GetXaxis()->SetBinLabel(2,"GFC{4}");
2570 fReferenceFlowCumulants->GetXaxis()->SetBinLabel(3,"GFC{6}");
2571 fReferenceFlowCumulants->GetXaxis()->SetBinLabel(4,"GFC{8}");
2572 fReferenceFlowResults->Add(fReferenceFlowCumulants);
2573 // Final results for reference flow:
2574 fReferenceFlow = new TH1D("fReferenceFlow","Reference flow",4,0,4); // to be improved (hardwired 4)
3688e459 2575 fReferenceFlow->SetLabelSize(0.05);
d6130938 2576 fReferenceFlow->SetMarkerStyle(25);
2577 fReferenceFlow->GetXaxis()->SetBinLabel(1,"v_{n}{2,GFC}");
2578 fReferenceFlow->GetXaxis()->SetBinLabel(2,"v_{n}{4,GFC}");
2579 fReferenceFlow->GetXaxis()->SetBinLabel(3,"v_{n}{6,GFC}");
2580 fReferenceFlow->GetXaxis()->SetBinLabel(4,"v_{n}{8,GFC}");
2581 fReferenceFlowResults->Add(fReferenceFlow);
2582 // Final results for resolution:
2583 fChi = new TH1D("fChi","Resolution",4,0,4); // to be improved (hardwired 4)
2584 fChi->SetLabelSize(0.06);
2585 fChi->SetMarkerStyle(25);
2586 fChi->GetXaxis()->SetBinLabel(1,"#chi_{2}");
2587 fChi->GetXaxis()->SetBinLabel(2,"#chi_{4}");
2588 fChi->GetXaxis()->SetBinLabel(3,"#chi_{6}");
2589 fChi->GetXaxis()->SetBinLabel(4,"#chi_{8}");
2590 fReferenceFlowResults->Add(fChi);
2591
2592} // end of void AliFlowAnalysisWithCumulants::BookEverythingForReferenceFlow()
2593
2594//================================================================================================================
2595
2596void AliFlowAnalysisWithCumulants::BookEverythingForTuning()
2597{
2598 // Book all objects relevant for tuning.
2599
2600 // a) Define pMax's and qMax's:
2601 // b) Book profile to hold all tuning parameters and flags;
2602 // c) Book all profiles;
2603 // d) Book all histograms.
2604
2605 // a) Define pMax's and qMax's:
2606 Int_t pMax[5] = {2,3,4,5,8};
2607 Int_t qMax[5] = {5,7,9,11,17};
2608
2609 // b) Book profile to hold all tuning parameters and flags:
2610 TString tuningFlagsName = "fTuningFlags";
2611 fTuningFlags = new TProfile(tuningFlagsName.Data(),"Tuning parameters",10,0,10);
2612 // fTuningFlags->SetTickLength(-0.01,"Y");
2613 fTuningFlags->SetMarkerStyle(25);
2614 fTuningFlags->SetLabelSize(0.05);
2615 fTuningFlags->SetLabelOffset(0.02,"X");
2616 for(Int_t r=1;r<=10;r++)
2617 {
2618 fTuningFlags->GetXaxis()->SetBinLabel(r,Form("r_{0,%d}",r-1));
2619 fTuningFlags->Fill(r-0.5,fTuningR0[r-1],1.);
2620 }
2621 fTuningList->Add(fTuningFlags);
2622
2623 // c) Book all profiles:
2624 // Average of the generating function for reference flow <G[p][q]> for different tuning parameters:
2625 for(Int_t r=0;r<10;r++)
2626 {
2627 for(Int_t pq=0;pq<5;pq++)
2628 {
2629 fTuningGenFun[r][pq] = new TProfile2D(Form("fTuningGenFun (r_{0,%i}, pq set %i)",r,pq),
2630 Form("#LTG[p][q]#GT for r_{0} = %f, p_{max} = %i, q_{max} = %i",fTuningR0[r],pMax[pq],qMax[pq]),
2631 pMax[pq],0.,(Double_t)pMax[pq],qMax[pq],0.,(Double_t)qMax[pq]);
2632 fTuningGenFun[r][pq]->SetXTitle("p");
2633 fTuningGenFun[r][pq]->SetYTitle("q");
2634 fTuningProfiles->Add(fTuningGenFun[r][pq]);
b6cd16a9 2635 }
2636 }
3688e459 2637 // Average multiplicities for events with nRPs >= cuttof:
2638 fTuningAvM = new TProfile("fTuningAvM","Average multiplicity",5,0,5);
2639 fTuningAvM->SetMarkerStyle(25);
2640 for(Int_t b=1;b<=5;b++)
2641 {
2642 fTuningAvM->GetXaxis()->SetBinLabel(b,Form("nRP #geq %i",2*pMax[b-1]));
2643 }
2644 fTuningProfiles->Add(fTuningAvM);
d6130938 2645
2646 // d) Book all histograms:
2647 // Final results for isotropic cumulants for reference flow for different tuning parameters:
2648 for(Int_t r=0;r<10;r++)
2649 {
2650 for(Int_t pq=0;pq<5;pq++)
2651 {
2652 fTuningCumulants[r][pq] = new TH1D(Form("fTuningCumulants (r_{0,%i}, pq set %i)",r,pq),
2653 Form("GFC for r_{0} = %f, p_{max} = %i, q_{max} = %i",fTuningR0[r],pMax[pq],qMax[pq]),
2654 pMax[pq],0,pMax[pq]);
2655 // fTuningCumulants[r][pq]->SetLabelSize(0.05);
2656 fTuningCumulants[r][pq]->SetMarkerStyle(25);
2657 for(Int_t b=1;b<=pMax[pq];b++)
2658 {
2659 fTuningCumulants[r][pq]->GetXaxis()->SetBinLabel(b,Form("GFC{%i}",2*b));
2660 }
2661 fTuningResults->Add(fTuningCumulants[r][pq]);
2662 }
2663 }
2664 // Final results for reference flow for different tuning parameters:
2665 for(Int_t r=0;r<10;r++)
2666 {
2667 for(Int_t pq=0;pq<5;pq++)
2668 {
2669 fTuningFlow[r][pq] = new TH1D(Form("fTuningFlow (r_{0,%i}, pq set %i)",r,pq),
3688e459 2670 Form("Reference flow for r_{0} = %f, p_{max} = %i, q_{max} = %i",fTuningR0[r],pMax[pq],qMax[pq]),
2671 pMax[pq],0,pMax[pq]);
d6130938 2672 // fTuningFlow[r][pq]->SetLabelSize(0.06);
2673 fTuningFlow[r][pq]->SetMarkerStyle(25);
2674 for(Int_t b=1;b<=pMax[pq];b++)
2675 {
2676 fTuningFlow[r][pq]->GetXaxis()->SetBinLabel(b,Form("v{%i,GFC}",2*b));
2677 }
2678 fTuningResults->Add(fTuningFlow[r][pq]);
2679 }
2680 }
3688e459 2681
d6130938 2682} // end of void AliFlowAnalysisWithCumulants::BookEverythingForTuning()
f1d945a1 2683
2188af53 2684//================================================================================================================
f1d945a1 2685
d6130938 2686void AliFlowAnalysisWithCumulants::BookEverythingForDiffFlow()
fd46c3dd 2687{
d6130938 2688 // Book all objects relevant for calculation of differential flow.
2689
2690 // a) Define static constants for array's boundaries;
2691 // b) Define local variables and local flags for booking;
2692 // c) Book profile to hold all flags for differential flow;
2693 // d) Book all event-by-event quantities;
2694 // e) Book all profiles;
2695 // f) Book all histograms.
2696
2697 // a) Define static constants for array's boundaries:
2698 static const Int_t pMax = 5;
2699 static const Int_t qMax = 11;
2700
2701 // b) Define local variables and local flags for booking:
2702 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
2703 Double_t minPtEta[2] = {fPtMin,fEtaMin};
2704 Double_t maxPtEta[2] = {fPtMax,fEtaMax};
2705 TString reIm[2] = {"Re","Im"};
2706 TString rpPoi[2] = {"RP","POI"};
2707 TString ptEta[2] = {"p_{t}","#eta"};
2708 TString order[4] = {"2nd order","4th order","6th order","8th order"};
2709
2710 // c) Book profile to hold all flags for differential flow:
2711 TString diffFlowFlagsName = "fDiffFlowFlags";
2712 fDiffFlowFlags = new TProfile(diffFlowFlagsName.Data(),"Flags for Differential Flow",1,0,1);
2713 fDiffFlowFlags->SetTickLength(-0.01,"Y");
2714 fDiffFlowFlags->SetMarkerStyle(25);
2715 fDiffFlowFlags->SetLabelSize(0.05);
2716 fDiffFlowFlags->SetLabelOffset(0.02,"Y");
2717 fDiffFlowFlags->GetXaxis()->SetBinLabel(1,"...");
2718 fDiffFlowList->Add(fDiffFlowFlags);
2719
2720 // d) Book all event-by-event quantities:
2721 // ... (to be improved - perhaps not needed)
2722
2723 // e) Book all profiles:
2724 // Generating functions for differential flow:
2725 for(Int_t ri=0;ri<2;ri++)
2726 {
2727 for(Int_t rp=0;rp<2;rp++)
2728 {
2729 for(Int_t pe=0;pe<2;pe++)
2730 {
2731 fDiffFlowGenFun[ri][rp][pe] = new TProfile3D(Form("fDiffFlowGenFun (%s, %s, %s)",reIm[ri].Data(),rpPoi[rp].Data(),ptEta[pe].Data()),
2732 Form("#LT%s[D[%s-bin][p][q]]#GT for %ss",reIm[ri].Data(),ptEta[pe].Data(),rpPoi[rp].Data()),
2733 nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe],pMax,0.,(Double_t)pMax,qMax,0.,(Double_t)qMax);
2734 fDiffFlowGenFun[ri][rp][pe]->SetXTitle(ptEta[pe].Data());
2735 fDiffFlowGenFun[ri][rp][pe]->SetYTitle("p");
2736 fDiffFlowGenFun[ri][rp][pe]->SetZTitle("q");
2737 fDiffFlowGenFun[ri][rp][pe]->SetTitleOffset(1.44,"X");
2738 fDiffFlowGenFun[ri][rp][pe]->SetTitleOffset(1.44,"Y");
2739 fDiffFlowProfiles->Add(fDiffFlowGenFun[ri][rp][pe]);
2740 // to be improved - alternative // nBinsPtEta[pe],(Double_t)(fPtMin/fPtBinWidth),(Double_t)(fPtMax/fPtBinWidth),pMax,0.,(Double_t)pMax,qMax,0.,(Double_t)qMax);
2741 }
2742 }
2743 }
2744 // Number of particles in pt/eta bin for RPs/POIs:
2745 for(Int_t rp=0;rp<2;rp++)
2746 {
2747 for(Int_t pe=0;pe<2;pe++)
2748 {
2749 fNoOfParticlesInBin[rp][pe] = new TProfile(Form("fNoOfParticlesInBin (%s, %s)",rpPoi[rp].Data(),ptEta[pe].Data()),
2750 Form("Number of %ss per %s bin",rpPoi[rp].Data(),ptEta[pe].Data()),
2751 nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
2752 fNoOfParticlesInBin[rp][pe]->SetXTitle(ptEta[pe].Data());
2753 fDiffFlowProfiles->Add(fNoOfParticlesInBin[rp][pe]);
2754 }
2755 }
2756 // Differential cumulants per pt/eta bin for RPs/POIs:
2757 for(Int_t rp=0;rp<2;rp++)
2758 {
2759 for(Int_t pe=0;pe<2;pe++)
2760 {
2761 for(Int_t co=0;co<4;co++)
2762 {
2763 fDiffFlowCumulants[rp][pe][co] = new TH1D(Form("fDiffFlowCumulants (%s, %s, %s)",rpPoi[rp].Data(),ptEta[pe].Data(),order[co].Data()),
2764 Form("Differential %s cumulant for %ss vs %s",order[co].Data(),rpPoi[rp].Data(),ptEta[pe].Data()),
2765 nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
2766 fDiffFlowCumulants[rp][pe][co]->SetXTitle(ptEta[pe].Data());
2767 fDiffFlowResults->Add(fDiffFlowCumulants[rp][pe][co]);
2768 }
2769 }
2770 }
2771 // Differential flow per pt/eta bin for RPs/POIs:
2772 for(Int_t rp=0;rp<2;rp++)
2773 {
2774 for(Int_t pe=0;pe<2;pe++)
2775 {
2776 for(Int_t co=0;co<4;co++)
2777 {
2778 fDiffFlow[rp][pe][co] = new TH1D(Form("fDiffFlow (%s, %s, %s)",rpPoi[rp].Data(),ptEta[pe].Data(),order[co].Data()),
2779 Form("Differential flow from %s cumulant for %ss vs %s",order[co].Data(),rpPoi[rp].Data(),ptEta[pe].Data()),
2780 nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
2781 fDiffFlow[rp][pe][co]->SetXTitle(ptEta[pe].Data());
2782 fDiffFlowResults->Add(fDiffFlow[rp][pe][co]);
2783 }
2784 }
2785 }
2786
2787}// end of void AliFlowAnalysisWithCumulants::BookEverythingForDiffFlow()
2788
2789//================================================================================================================
2790
2791void AliFlowAnalysisWithCumulants::StoreReferenceFlowFlags()
2792{
2793 // Store all flags for reference flow in profile fReferenceFlowFlags.
2794
2795 if(!fReferenceFlowFlags)
2796 {
2797 cout<<endl;
2798 cout<<"WARNING: !fReferenceFlowFlags is NULL in AFAWC::SRFF() !!!!"<<endl;
2799 cout<<endl;
2800 exit(0);
2801 }
2802
2803 // Particle weights used or not:
2804 fReferenceFlowFlags->Fill(0.5,(Double_t)fUsePhiWeights||fUsePtWeights||fUseEtaWeights);
2805 // Which event weight was used to weight generating function event-by-event:
2806 if(strcmp(fMultiplicityWeight->Data(),"unit"))
2807 {
2808 fReferenceFlowFlags->Fill(1.5,0.); // 0 = "unit" (default)
2809 } else if(strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2810 {
2811 fReferenceFlowFlags->Fill(1.5,1.); // 1 = "multiplicity"
2812 }
3688e459 2813 fReferenceFlowFlags->Fill(2.5,fCalculateVsMultiplicity); // evaluate vs M?
d6130938 2814
2815} // end of void AliFlowAnalysisWithCumulants::StoreReferenceFlowFlags()
2816
2817//================================================================================================================
2818
2819void AliFlowAnalysisWithCumulants::StoreDiffFlowFlags()
2820{
2821 // Store all flags for differential flow in profile fDiffFlowFlags.
2822
2823 if(!fDiffFlowFlags)
2824 {
2825 cout<<endl;
2826 cout<<"WARNING: !fDiffFlowFlags is NULL in AFAWC::SRFF() !!!!"<<endl;
2827 cout<<endl;
2828 exit(0);
2829 }
2830
2831 // fDiffFlags->Fill(0.5,(Double_t) ... );
2832
2833} // end of void AliFlowAnalysisWithCumulants::StoreDiffFlowFlags()
2834
2835//================================================================================================================
2836
2837void AliFlowAnalysisWithCumulants::BookAndNestAllLists()
2838{
2839 // Book and nest all list in base list fHistList.
2840
2841 // a) Book and nest lists for reference flow;
2842 // b) Book and nest lists for differential flow;
3688e459 2843 // c) Book and nest lists for tuning;
2844 // d) If used, nest list for particle weights.
fd46c3dd 2845
d6130938 2846 // a) Book and nest all lists for reference flow:
2847 fReferenceFlowList = new TList();
2848 fReferenceFlowList->SetName("Reference Flow");
2849 fReferenceFlowList->SetOwner(kTRUE);
2850 fHistList->Add(fReferenceFlowList);
2851 fReferenceFlowProfiles = new TList();
2852 fReferenceFlowProfiles->SetName("Profiles");
2853 fReferenceFlowProfiles->SetOwner(kTRUE);
2854 fReferenceFlowList->Add(fReferenceFlowProfiles);
2855 fReferenceFlowResults = new TList();
2856 fReferenceFlowResults->SetName("Results");
2857 fReferenceFlowResults->SetOwner(kTRUE);
2858 fReferenceFlowList->Add(fReferenceFlowResults);
2859 // b) Book and nest lists for differential flow:
2860 fDiffFlowList = new TList();
2861 fDiffFlowList->SetName("Differential Flow");
2862 fDiffFlowList->SetOwner(kTRUE);
2863 fHistList->Add(fDiffFlowList);
2864 fDiffFlowProfiles = new TList();
2865 fDiffFlowProfiles->SetName("Profiles");
2866 fDiffFlowProfiles->SetOwner(kTRUE);
2867 fDiffFlowList->Add(fDiffFlowProfiles);
2868 fDiffFlowResults = new TList();
2869 fDiffFlowResults->SetName("Results");
2870 fDiffFlowResults->SetOwner(kTRUE);
2871 fDiffFlowList->Add(fDiffFlowResults);
2872 // c) Book and nest lists for tuning:
2873 if(fTuneParameters)
2874 {
2875 fTuningList = new TList();
2876 fTuningList->SetName("Tuning");
2877 fTuningList->SetOwner(kTRUE);
2878 fHistList->Add(fTuningList);
2879 fTuningProfiles = new TList();
2880 fTuningProfiles->SetName("Profiles");
2881 fTuningProfiles->SetOwner(kTRUE);
2882 fTuningList->Add(fTuningProfiles);
2883 fTuningResults = new TList();
2884 fTuningResults->SetName("Results");
2885 fTuningResults->SetOwner(kTRUE);
2886 fTuningList->Add(fTuningResults);
2887 }
fd46c3dd 2888
3688e459 2889 // d) If used, nest list for particle weights.
2890 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
2891 {
2892 // Remark: pointer to this list is coming from the macro, no need to "new" it.
2893 fWeightsList->SetName("Weights");
2894 fWeightsList->SetOwner(kTRUE);
2895 fHistList->Add(fWeightsList);
2896 }
2897
d6130938 2898} // end of void AliFlowAnalysisWithCumulants::BookAndNestAllLists()
2899
2900//================================================================================================================
2901
2902void AliFlowAnalysisWithCumulants::BookProfileHoldingSettings()
2903{
2904 // Book profile to hold all analysis settings.
2905
2906 TString analysisSettingsName = "fAnalysisSettings";
3688e459 2907 fAnalysisSettings = new TProfile(analysisSettingsName.Data(),"Settings for analysis with Generating Function Cumulants",11,0.,11.);
d6130938 2908 fAnalysisSettings->GetXaxis()->SetLabelSize(0.035);
2909 fAnalysisSettings->GetXaxis()->SetBinLabel(1,"Harmonic");
2910 fAnalysisSettings->Fill(0.5,fHarmonic);
2911 fAnalysisSettings->GetXaxis()->SetBinLabel(2,"Multiple");
2912 fAnalysisSettings->Fill(1.5,fMultiple);
2913 fAnalysisSettings->GetXaxis()->SetBinLabel(3,"r_{0}");
3688e459 2914 fAnalysisSettings->Fill(2.5,fR0);
2915 fAnalysisSettings->GetXaxis()->SetBinLabel(4,"Use w_{#phi}?");
2916 fAnalysisSettings->Fill(3.5,fUsePhiWeights);
2917 fAnalysisSettings->GetXaxis()->SetBinLabel(5,"Use w_{p_{t}}?");
2918 fAnalysisSettings->Fill(4.5,fUsePtWeights);
2919 fAnalysisSettings->GetXaxis()->SetBinLabel(6,"Use w_{#eta}?");
2920 fAnalysisSettings->Fill(5.5,fUsePhiWeights);
2921 fAnalysisSettings->GetXaxis()->SetBinLabel(7,"Tune parameters?");
2922 fAnalysisSettings->Fill(6.5,fTuneParameters);
2923 fAnalysisSettings->GetXaxis()->SetBinLabel(8,"Print RF results");
2924 fAnalysisSettings->Fill(7.5,fPrintFinalResults[0]);
2925 fAnalysisSettings->GetXaxis()->SetBinLabel(9,"Print RP results");
2926 fAnalysisSettings->Fill(8.5,fPrintFinalResults[1]);
2927 fAnalysisSettings->GetXaxis()->SetBinLabel(10,"Print POI results");
2928 fAnalysisSettings->Fill(9.5,fPrintFinalResults[2]);
2929 fAnalysisSettings->GetXaxis()->SetBinLabel(11,"Evaluate vs M?");
2930 fAnalysisSettings->Fill(10.5,fCalculateVsMultiplicity);
d6130938 2931 fHistList->Add(fAnalysisSettings);
2932
2933} // end of void AliFlowAnalysisWithCumulants::BookProfileHoldingSettings()
2934
2935//================================================================================================================
2936
2937void AliFlowAnalysisWithCumulants::BookCommonHistograms()
2938{
2939 // Book common control histograms and common histograms for final results.
2940
2941 // Common control histogram:
2942 TString commonHistsName = "AliFlowCommonHistGFC";
2943 fCommonHists = new AliFlowCommonHist(commonHistsName.Data());
2944 fHistList->Add(fCommonHists);
2945 // Common histograms for final results from 2nd order GFC:
2946 TString commonHistResults2ndOrderName = "AliFlowCommonHistResults2ndOrderGFC";
2947 fCommonHistsResults2nd = new AliFlowCommonHistResults(commonHistResults2ndOrderName.Data());
2948 fHistList->Add(fCommonHistsResults2nd);
2949 // Common histograms for final results from 4th order GFC:
2950 TString commonHistResults4thOrderName = "AliFlowCommonHistResults4thOrderGFC";
2951 fCommonHistsResults4th = new AliFlowCommonHistResults(commonHistResults4thOrderName.Data());
2952 fHistList->Add(fCommonHistsResults4th);
2953 // Common histograms for final results from 6th order GFC:
2954 TString commonHistResults6thOrderName = "AliFlowCommonHistResults6thOrderGFC";
2955 fCommonHistsResults6th = new AliFlowCommonHistResults(commonHistResults6thOrderName.Data());
2956 fHistList->Add(fCommonHistsResults6th);
2957 // Common histograms for final results from 8th order GFC:
2958 TString commonHistResults8thOrderName = "AliFlowCommonHistResults8thOrderGFC";
2959 fCommonHistsResults8th = new AliFlowCommonHistResults(commonHistResults8thOrderName.Data());
2960 fHistList->Add(fCommonHistsResults8th);
2961
2962} // end of void AliFlowAnalysisWithCumulants::BookCommonHistograms()
2963
2964//================================================================================================================
2965
2966void AliFlowAnalysisWithCumulants::CheckPointersUsedInMake()
2967{
2968 // Check pointers used in method Make().
2969
2970 if(!fCommonHists)
2971 {
2972 cout<<endl;
3688e459 2973 cout<<" WARNING (GFC): fCommonHists is NULL in CPUIM() !!!!"<<endl;
d6130938 2974 cout<<endl;
2975 exit(0);
2976 }
2977 if(fUsePhiWeights && !fPhiWeights)
2978 {
2979 cout<<endl;
3688e459 2980 cout<<" WARNING (GFC): fPhiWeights is NULL in CPUIM() !!!!"<<endl;
d6130938 2981 cout<<endl;
2982 exit(0);
2983 }
2984 if(fUsePtWeights && !fPtWeights)
2985 {
2986 cout<<endl;
3688e459 2987 cout<<" WARNING (GFC): fPtWeights is NULL in CPUIM() !!!!"<<endl;
d6130938 2988 cout<<endl;
2989 exit(0);
2990 }
2991 if(fUseEtaWeights && !fEtaWeights)
2992 {
2993 cout<<endl;
3688e459 2994 cout<<" WARNING (GFC): fEtaWeights is NULL in CPUIM() !!!!"<<endl;
d6130938 2995 cout<<endl;
2996 exit(0);
2997 }
2998 if(!fAverageOfSquaredWeight)
2999 {
3000 cout<<endl;
3688e459 3001 cout<<" WARNING (GFC): fAverageOfSquaredWeight is NULL in CPUIM() !!!!"<<endl;
d6130938 3002 cout<<endl;
3003 exit(0);
3004 }
3005 if(!fReferenceFlowGenFun)
3006 {
3007 cout<<endl;
3688e459 3008 cout<<" WARNING (GFC): fReferenceFlowGenFun is NULL in CPUIM() !!!!"<<endl;
d6130938 3009 cout<<endl;
3010 exit(0);
3011 }
3012 if(!fQvectorComponents)
3013 {
3014 cout<<endl;
3688e459 3015 cout<<" WARNING (GFC): fQvectorComponents is NULL in CPUIM() !!!!"<<endl;
d6130938 3016 cout<<endl;
3017 exit(0);
3018 }
3019 if(!fGEBE)
3020 {
3021 cout<<endl;
3688e459 3022 cout<<"WARNING (GFC): fGEBE is NULL in CPUIM() !!!!"<<endl;
d6130938 3023 cout<<endl;
3024 exit(0);
3025 }
3688e459 3026 // Checking pointers for vs multiplicity calculation:
3027 if(fCalculateVsMultiplicity)
3028 {
3029 if(!fReferenceFlowGenFunVsM)
3030 {
3031 cout<<endl;
3032 cout<<"WARNING (GFC): fReferenceFlowGenFunVsM is NULL in CPUIM() !!!!"<<endl;
3033 cout<<endl;
3034 exit(0);
3035 }
3036 if(!fQvectorComponentsVsM)
3037 {
3038 cout<<endl;
3039 cout<<"WARNING (GFC): fQvectorComponentsVsM is NULL in CPUIM() !!!!"<<endl;
3040 cout<<endl;
3041 exit(0);
3042 }
3043 if(!fAverageOfSquaredWeightVsM)
3044 {
3045 cout<<endl;
3046 cout<<"WARNING (GFC): fAverageOfSquaredWeightVsM is NULL in CPUIM() !!!!"<<endl;
3047 cout<<endl;
3048 exit(0);
3049 }
3050 if(!fAvMVsM)
3051 {
3052 cout<<endl;
3053 cout<<"WARNING (GFC): fAvMVsM is NULL in CPUIM() !!!!"<<endl;
3054 cout<<endl;
3055 exit(0);
3056 }
3057 } // end of if(fCalculateVsMultiplicity)
d6130938 3058
3059} // end of void AliFlowAnalysisWithCumulants::CheckPointersUsedInMake()
3060
3061//================================================================================================================
3062
3063void AliFlowAnalysisWithCumulants::CheckPointersUsedInFinish()
3064{
3065 // Check pointers used in method Finish().
3066
3067 if(!fAnalysisSettings)
3068 {
3069 cout<<endl;
3070 cout<<" WARNING (GFC): fAnalysisSettings is NULL in CPUIF() !!!!"<<endl;
3071 cout<<endl;
3072 exit(0);
3073 }
3074 if(!(fCommonHists && fCommonHists->GetHistMultRP()))
3075 {
3076 cout<<endl;
3077 cout<<" WARNING (GFC): (fCommonHists && fCommonHists->GetHistMultRP) is NULL in CPUIF() !!!!"<<endl;
3078 cout<<endl;
3079 exit(0);
3080 }
3081 if(!fReferenceFlowGenFun)
3082 {
3083 cout<<endl;
3084 cout<<" WARNING (GFC): fReferenceFlowGenFun is NULL in CPUIF() !!!!"<<endl;
3085 cout<<endl;
3086 exit(0);
3087 }
3088 if(!fReferenceFlowCumulants)
3089 {
3090 cout<<endl;
3091 cout<<" WARNING (GFC): fReferenceFlowCumulants is NULL in CPUIF() !!!!"<<endl;
3092 cout<<endl;
3093 exit(0);
3094 }
3095 if(!fQvectorComponents)
3096 {
3097 cout<<endl;
3098 cout<<" WARNING (GFC): fQvectorComponents is NULL in CPUIF() !!!!"<<endl;
3099 cout<<endl;
3100 exit(0);
fd46c3dd 3101 }
d6130938 3102 if(!fAverageOfSquaredWeight)
3103 {
3104 cout<<endl;
3105 cout<<" WARNING (GFC): fAverageOfSquaredWeight is NULL in CPUIF() !!!!"<<endl;
3106 cout<<endl;
3107 exit(0);
3108 }
3109 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
3110 {
3111 cout<<endl;
3112 cout<<" WARNING (GFC): fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && "<<endl;
3113 cout<<" fCommonHistsResults8th is NULL in CPUIF() !!!!"<<endl;
3114 cout<<endl;
3115 exit(0);
3116 }
3117 if(!fReferenceFlow)
3118 {
3119 cout<<endl;
3120 cout<<" WARNING (GFC): fReferenceFlow is NULL in CPUIF() !!!!"<<endl;
3121 cout<<endl;
3122 exit(0);
3123 }
3124 if(!fChi)
3125 {
3126 cout<<endl;
3127 cout<<" WARNING (GFC): fChi is NULL in CPUIF() !!!!"<<endl;
3128 cout<<endl;
3129 exit(0);
3130 }
3131 for(Int_t ri=0;ri<2;ri++)
3132 {
3133 for(Int_t rp=0;rp<2;rp++)
3134 {
3135 for(Int_t pe=0;pe<2;pe++)
3136 {
3137 if(!fDiffFlowGenFun[ri][rp][pe])
3138 {
3139 cout<<endl;
3140 cout<<" WARNING (GFC): "<<Form("fDiffFlowGenFun[%d][%d][%d]",ri,rp,pe)<<" is NULL in CPUIF() !!!!"<<endl;
3141 cout<<endl;
3142 exit(0);
3143 }
3144 }
3145 }
3146 }
3147 for(Int_t rp=0;rp<2;rp++)
3148 {
3149 for(Int_t pe=0;pe<2;pe++)
3150 {
3151 for(Int_t co=0;co<4;co++)
3152 {
3153 if(!fDiffFlowCumulants[rp][pe][co])
3154 {
3155 cout<<endl;
3156 cout<<" WARNING (GFC): "<<Form("fDiffFlowCumulants[%d][%d][%d]",rp,pe,co)<<" is NULL in CPUIF() !!!!"<<endl;
3157 cout<<endl;
3158 exit(0);
3159 }
3160 if(!fDiffFlow[rp][pe][co])
3161 {
3162 cout<<endl;
3163 cout<<" WARNING (GFC): "<<Form("fDiffFlow[%d][%d][%d]",rp,pe,co)<<" is NULL in CPUIF() !!!!"<<endl;
3164 cout<<endl;
3165 exit(0);
3166 }
3167 }
3168 }
3169 }
3170 for(Int_t rp=0;rp<2;rp++)
3171 {
3172 for(Int_t pe=0;pe<2;pe++)
3173 {
3174 if(!fNoOfParticlesInBin[rp][pe])
3175 {
3176 cout<<endl;
3177 cout<<" WARNING (GFC): "<<Form("fNoOfParticlesInBin[%d][%d]",rp,pe)<<" is NULL in CPUIF() !!!!"<<endl;
3178 cout<<endl;
3179 exit(0);
3180 }
3181 }
3182 }
3688e459 3183 // Checking pointers for vs multiplicity calculation:
3184 if(fCalculateVsMultiplicity)
3185 {
3186 if(!fReferenceFlowGenFunVsM)
3187 {
3188 cout<<endl;
3189 cout<<"WARNING (GFC): fReferenceFlowGenFunVsM is NULL in CPUIF() !!!!"<<endl;
3190 cout<<endl;
3191 exit(0);
3192 }
3193 if(!fQvectorComponentsVsM)
3194 {
3195 cout<<endl;
3196 cout<<"WARNING (GFC): fQvectorComponentsVsM is NULL in CPUIF() !!!!"<<endl;
3197 cout<<endl;
3198 exit(0);
3199 }
3200 if(!fAverageOfSquaredWeightVsM)
3201 {
3202 cout<<endl;
3203 cout<<"WARNING (GFC): fAverageOfSquaredWeightVsM is NULL in CPUIF() !!!!"<<endl;
3204 cout<<endl;
3205 exit(0);
3206 }
3207 if(!fAvMVsM)
3208 {
3209 cout<<endl;
3210 cout<<"WARNING (GFC): fAvMVsM is NULL in CPUIF() !!!!"<<endl;
3211 cout<<endl;
3212 exit(0);
3213 }
3214 } // end of if(fCalculateVsMultiplicity)
d6130938 3215
3216} // end of void AliFlowAnalysisWithCumulants::CheckPointersUsedInFinish()
fd46c3dd 3217
3218//================================================================================================================
3219
d6130938 3220void AliFlowAnalysisWithCumulants::AccessSettings()
2188af53 3221{
d6130938 3222 // Access the settings for analysis with Generating Function Cumulants.
3223
3224 fHarmonic = (Int_t)fAnalysisSettings->GetBinContent(1);
3225 fMultiple = (Int_t)fAnalysisSettings->GetBinContent(2);
3226 fR0 = (Double_t)fAnalysisSettings->GetBinContent(3);
3688e459 3227 fUsePhiWeights = (Bool_t)fAnalysisSettings->GetBinContent(4);
3228 fUsePtWeights = (Bool_t)fAnalysisSettings->GetBinContent(5);
3229 fUseEtaWeights = (Bool_t)fAnalysisSettings->GetBinContent(6);
3230 fTuneParameters = (Bool_t)fAnalysisSettings->GetBinContent(7);
3231 fPrintFinalResults[0] = (Bool_t)fAnalysisSettings->GetBinContent(8);
3232 fPrintFinalResults[1] = (Bool_t)fAnalysisSettings->GetBinContent(9);
3233 fPrintFinalResults[2] = (Bool_t)fAnalysisSettings->GetBinContent(10);
3234 fCalculateVsMultiplicity = (Bool_t)fAnalysisSettings->GetBinContent(11);
3235
d6130938 3236} // end of AliFlowAnalysisWithCumulants::AccessSettings()
f1d945a1 3237
1315fe58 3238//================================================================================================================
3239
3240void AliFlowAnalysisWithCumulants::WriteHistograms(TString* outputFileName)
3241{
d6130938 3242 // Store the final results in output .root file.
3243
1315fe58 3244 TFile *output = new TFile(outputFileName->Data(),"RECREATE");
0fe80f88 3245 //output->WriteObject(fHistList, "cobjGFC","SingleKey");
3246 fHistList->SetName("cobjGFC");
9455e15e 3247 fHistList->SetOwner(kTRUE);
0fe80f88 3248 fHistList->Write(fHistList->GetName(), TObject::kSingleKey);
1315fe58 3249 delete output;
1315fe58 3250
d6130938 3251} // end of void AliFlowAnalysisWithCumulants::WriteHistograms(TString* outputFileName)
1315fe58 3252
b0fda271 3253//================================================================================================================
3254
3255void AliFlowAnalysisWithCumulants::WriteHistograms(TString outputFileName)
3256{
d6130938 3257 // Store the final results in output .root file.
3258
b0fda271 3259 TFile *output = new TFile(outputFileName.Data(),"RECREATE");
0fe80f88 3260 //output->WriteObject(fHistList, "cobjGFC","SingleKey");
3261 fHistList->SetName("cobjGFC");
9455e15e 3262 fHistList->SetOwner(kTRUE);
0fe80f88 3263 fHistList->Write(fHistList->GetName(), TObject::kSingleKey);
b0fda271 3264 delete output;
b0fda271 3265
d6130938 3266} // end of void AliFlowAnalysisWithCumulants::WriteHistograms(TString outputFileName)
b0fda271 3267
ad87ae62 3268//================================================================================================================
3269
3270void AliFlowAnalysisWithCumulants::WriteHistograms(TDirectoryFile *outputFileName)
3271{
d6130938 3272 // Store the final results in output .root file.
3273
ad87ae62 3274 fHistList->SetName("cobjGFC");
3275 fHistList->SetOwner(kTRUE);
3276 outputFileName->Add(fHistList);
3277 outputFileName->Write(outputFileName->GetName(), TObject::kSingleKey);
d6130938 3278
3279} // end of void AliFlowAnalysisWithCumulants::WriteHistograms(TDirectoryFile *outputFileName)
f1d945a1 3280
ad87ae62 3281//================================================================================================================
f1d945a1 3282
3283
d6130938 3284
3285