1 /*************************************************************************
2 * Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
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 *
24 * Author: Ante Bilandzic *
25 * (abilandzic@gmail.com) *
26 *************************************************/
28 #define AliFlowAnalysisWithCumulants_cxx
30 #include "Riostream.h"
35 #include "TProfile2D.h"
36 #include "TProfile3D.h"
42 #include "AliFlowCommonConstants.h"
43 #include "AliFlowCommonHist.h"
44 #include "AliFlowCommonHistResults.h"
45 #include "AliFlowEventSimple.h"
46 #include "AliFlowTrackSimple.h"
47 #include "AliFlowAnalysisWithCumulants.h"
48 #include "AliFlowVector.h"
50 //================================================================================================================
52 ClassImp(AliFlowAnalysisWithCumulants)
54 AliFlowAnalysisWithCumulants::AliFlowAnalysisWithCumulants():
57 fAnalysisSettings(NULL),
59 fCommonHistsResults2nd(NULL),
60 fCommonHistsResults4th(NULL),
61 fCommonHistsResults6th(NULL),
62 fCommonHistsResults8th(NULL),
79 fUsePhiWeights(kFALSE),
80 fUsePtWeights(kFALSE),
81 fUseEtaWeights(kFALSE),
82 fUseParticleWeights(NULL),
86 fMultiplicityWeight(NULL),
87 fReferenceFlowList(NULL),
88 fReferenceFlowProfiles(NULL),
89 fReferenceFlowResults(NULL),
90 fReferenceFlowFlags(NULL),
95 fReferenceFlowGenFun(NULL),
96 fQvectorComponents(NULL),
97 fAverageOfSquaredWeight(NULL),
100 fReferenceFlowCumulants(NULL),
101 fReferenceFlow(NULL),
104 fDiffFlowProfiles(NULL),
105 fDiffFlowResults(NULL),
106 fDiffFlowFlags(NULL),
108 fTuningProfiles(NULL),
109 fTuningResults(NULL),
111 fTuneParameters(kFALSE)
115 // Base list to hold all output objects:
116 fHistList = new TList();
117 fHistListName = new TString("cobjGFC");
118 fHistList->SetName(fHistListName->Data());
119 fHistList->SetOwner(kTRUE);
121 // List to hold histograms with phi, pt and eta weights:
122 fWeightsList = new TList();
123 fWeightsList->SetName("Weights");
124 fWeightsList->SetOwner(kTRUE);
125 fHistList->Add(fWeightsList);
127 // Multiplicity weight:
128 fMultiplicityWeight = new TString("unit");
130 // Initialize all arrays:
131 this->InitializeArrays();
133 } // end of AliFlowAnalysisWithCumulants::AliFlowAnalysisWithCumulants()
135 //================================================================================================================
137 AliFlowAnalysisWithCumulants::~AliFlowAnalysisWithCumulants()
144 } // end of AliFlowAnalysisWithCumulants::~AliFlowAnalysisWithCumulants()
146 //================================================================================================================
148 void AliFlowAnalysisWithCumulants::Init()
150 // Initialize and book all objects.
152 // a) Cross check if the user settings make sense before starting;
153 // b) Access all common constants;
154 // c) Book and fill weights histograms;
155 // d) Book and nest all lists in the base list fHistList;
156 // e) Book and fill profile holding analysis settings;
157 // f) Book common control and results histograms;
158 // g) Store flags for reference flow;
159 // h) Store flags for differential flow;
160 // i) Book all objects needed for tuning.
162 //save old value and prevent histograms from being added to directory
163 //to avoid name clashes in case multiple analaysis objects are used
165 Bool_t oldHistAddStatus = TH1::AddDirectoryStatus();
166 TH1::AddDirectory(kFALSE);
168 this->CrossCheckSettings();
169 this->AccessConstants();
170 this->BookAndFillWeightsHistograms();
171 this->BookAndNestAllLists();
172 this->BookProfileHoldingSettings();
173 this->BookCommonHistograms();
174 this->BookEverythingForReferenceFlow();
175 this->BookEverythingForDiffFlow();
176 this->StoreReferenceFlowFlags();
177 this->StoreDiffFlowFlags();
178 if(fTuneParameters){this->BookEverythingForTuning();}
180 (fCommonHists->GetHarmonic())->Fill(0.5,fHarmonic); // to be improved (moved somewhere else?)
182 TH1::AddDirectory(oldHistAddStatus);
184 } // end of void AliFlowAnalysisWithCumulants::Init()
186 //================================================================================================================
188 void AliFlowAnalysisWithCumulants::Make(AliFlowEventSimple* anEvent)
190 // Running over data only in this method.
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.
200 this->CheckPointersUsedInMake();
201 if(fTuneParameters) {this->FillGeneratingFunctionsForDifferentTuningParameters(anEvent);}
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);
209 } // end of void AliFlowAnalysisWithCumulants::Make()
211 //================================================================================================================
213 void AliFlowAnalysisWithCumulants::Finish()
215 // Calculate the final results.
217 // a) Check all pointers used in this method;
218 // b) Access settings for analysis with Generating Function Cumulants;
219 // c) From relevant common control histogram get average multiplicity of RPs and number of events;
220 // d) Calculate cumulants for reference flow;
221 // e) Calculate from isotropic cumulants reference flow;
222 // f) Calculate error for reference flow estimates;
223 // g) Store the final results for reference flow in common hist results;
224 // h) Print on the screen the final results for reference flow;
225 // i) Calculate cumulants for differential flow;
226 // j) Calculate differential flow for RPs/POIs vs pt/eta from cumulants;
227 // k) Calculate integrated flow of RPs and POIs;
228 // l) Print on the screen the final results for integrated flow of RPs and POIs;
229 // m) If tuning enabled, calculate results for different tuning parameters.
231 this->CheckPointersUsedInFinish();
232 this->AccessSettings();
233 this->GetAvMultAndNoOfEvts();
234 this->CalculateCumulantsForReferenceFlow();
235 this->CalculateReferenceFlow();
236 this->CalculateReferenceFlowError();
237 this->FillCommonHistResultsForReferenceFlow();
238 if(fPrintFinalResults[0]){this->PrintFinalResults("RF");}
239 this->CalculateCumulantsForDiffFlow("RP","pt");
240 this->CalculateCumulantsForDiffFlow("RP","eta");
241 this->CalculateCumulantsForDiffFlow("POI","pt");
242 this->CalculateCumulantsForDiffFlow("POI","eta");
243 this->CalculateDifferentialFlow("RP","pt");
244 this->CalculateDifferentialFlow("RP","eta");
245 this->CalculateDifferentialFlow("POI","pt");
246 this->CalculateDifferentialFlow("POI","eta");
247 this->CalculateDifferentialFlowErrors("RP","pt");
248 this->CalculateDifferentialFlowErrors("RP","eta");
249 this->CalculateDifferentialFlowErrors("POI","pt");
250 this->CalculateDifferentialFlowErrors("POI","eta");
251 this->FillCommonHistResultsForDifferentialFlow("RP");
252 this->FillCommonHistResultsForDifferentialFlow("POI");
253 this->CalculateIntegratedFlow("RP");
254 this->CalculateIntegratedFlow("POI");
255 if(fPrintFinalResults[1]){this->PrintFinalResults("RP");}
256 if(fPrintFinalResults[2]){this->PrintFinalResults("POI");}
257 if(fTuneParameters){this->FinalizeTuning();}
259 } // end of void AliFlowAnalysisWithCumulants::Finish()
261 //================================================================================================================
263 void AliFlowAnalysisWithCumulants::FinalizeTuning()
265 // Finalize results with tuned inerpolating parameters.
267 for(Int_t r=0;r<10;r++)
269 if(TMath::Abs(fTuningR0[r])<1.e-10) continue; // protection against division by r0 bellow
270 for(Int_t pq=0;pq<5;pq++)
272 Int_t pMax = fTuningGenFun[r][pq]->GetXaxis()->GetNbins();
273 Int_t qMax = fTuningGenFun[r][pq]->GetYaxis()->GetNbins();
275 TMatrixD dAvG(pMax,qMax);
277 Bool_t someAvGEntryIsNegative = kFALSE;
278 for(Int_t p=0;p<pMax;p++)
280 for(Int_t q=0;q<qMax;q++)
282 dAvG(p,q) = fTuningGenFun[r][pq]->GetBinContent(fTuningGenFun[r][pq]->GetBin(p+1,q+1));
285 someAvGEntryIsNegative = kTRUE;
287 cout<<" WARNING: "<<Form("<G[%d][%d]> is negative !!!! GFC results are meaningless for r0 = %f, pq = %i.",p,q,fTuningR0[r],pq)<<endl;
292 // C[p][q] (generating function for the cumulants)
293 TMatrixD dC(pMax,qMax);
295 if(fAvM>0. && !someAvGEntryIsNegative)
297 for(Int_t p=0;p<pMax;p++)
299 for(Int_t q=0;q<qMax;q++)
301 dC(p,q) = fAvM*(pow(dAvG(p,q),(1./fAvM))-1.);
305 // Averaging the generating function for cumulants over azimuth
306 // in order to eliminate detector effects.
307 // <C[p][q]> (Remark: here <> stands for average over azimuth):
310 for(Int_t p=0;p<pMax;p++)
313 for(Int_t q=0;q<qMax;q++)
319 // Finally, the isotropic cumulants for reference flow and reference flow itself:
320 TVectorD cumulant(pMax);
326 cumulant[0]=(1./(fTuningR0[r]*fTuningR0[r]))*(2.*dAvC[0]-(1./2.)*dAvC[1]);
327 cumulant[1]=(2./pow(fTuningR0[r],4.))*((-2.)*dAvC[0]+1.*dAvC[1]);
328 if(cumulant[0]>=0.) {flow[0] = pow(cumulant[0],1./2.);}
329 if(cumulant[1]<=0.) {flow[1] = pow(-1.*cumulant[1],1./4.);}
333 cumulant[0] = (1./(fTuningR0[r]*fTuningR0[r]))*(3.*dAvC[0]-(3./2.)*dAvC[1]+(1./3.)*dAvC[2]);
334 cumulant[1] = (2./pow(fTuningR0[r],4.))*((-5.)*dAvC[0]+4.*dAvC[1]-1.*dAvC[2]);
335 cumulant[2] = (6./pow(fTuningR0[r],6.))*(3.*dAvC[0]-3.*dAvC[1]+1.*dAvC[2]);
336 if(cumulant[0]>=0.) {flow[0] = pow(cumulant[0],1./2.);}
337 if(cumulant[1]<=0.) {flow[1] = pow(-1.*cumulant[1],1./4.);}
338 if(cumulant[2]>=0.) {flow[2] = pow((1./4.)*cumulant[2],1./6.);}
342 cumulant[0] = (1./(fTuningR0[r]*fTuningR0[r]))*(4.*dAvC[0]-3.*dAvC[1]+(4./3.)*dAvC[2]-(1./4.)*dAvC[3]);
343 cumulant[1] = (1./pow(fTuningR0[r],4.))*((-52./3.)*dAvC[0]+19.*dAvC[1]-(28./3.)*dAvC[2]+(11./6.)*dAvC[3]);
344 cumulant[2] = (3./pow(fTuningR0[r],6.))*(18.*dAvC[0]-24.*dAvC[1]+14.*dAvC[2]-3.*dAvC[3]);
345 cumulant[3] = (24./pow(fTuningR0[r],8.))*((-4.)*dAvC[0]+6.*dAvC[1]-4.*dAvC[2]+1.*dAvC[3]);
346 if(cumulant[0]>=0.) {flow[0] = pow(cumulant[0],1./2.);}
347 if(cumulant[1]<=0.) {flow[1] = pow(-1.*cumulant[1],1./4.);}
348 if(cumulant[2]>=0.) {flow[2] = pow((1./4.)*cumulant[2],1./6.);}
349 if(cumulant[3]<=0.) {flow[3] = pow((-1./33.)*cumulant[3],1./8.);}
353 cumulant[0] = (-1./(60*fTuningR0[r]*fTuningR0[r]))*((-300.)*dAvC[0]+300.*dAvC[1]-200.*dAvC[2]+75.*dAvC[3]-12.*dAvC[4]);
354 cumulant[1] = (-1./(6.*pow(fTuningR0[r],4.)))*(154.*dAvC[0]-214.*dAvC[1]+156.*dAvC[2]-61.*dAvC[3]+10.*dAvC[4]);
355 cumulant[2] = (3./(2.*pow(fTuningR0[r],6.)))*(71.*dAvC[0]-118.*dAvC[1]+98.*dAvC[2]-41.*dAvC[3]+7.*dAvC[4]);
356 cumulant[3] = (-24./pow(fTuningR0[r],8.))*(14.*dAvC[0]-26.*dAvC[1]+24.*dAvC[2]-11.*dAvC[3]+2.*dAvC[4]);
357 cumulant[4] = (120./pow(fTuningR0[r],10.))*(5.*dAvC[0]-10.*dAvC[1]+10.*dAvC[2]-5.*dAvC[3]+1.*dAvC[4]);
358 if(cumulant[0]>=0.) {flow[0] = pow(cumulant[0],1./2.);}
359 if(cumulant[1]<=0.) {flow[1] = pow(-1.*cumulant[1],1./4.);}
360 if(cumulant[2]>=0.) {flow[2] = pow((1./4.)*cumulant[2],1./6.);}
361 if(cumulant[3]<=0.) {flow[3] = pow((-1./33.)*cumulant[3],1./8.);}
362 if(cumulant[4]>=0.) {flow[4] = pow((1./456.)*cumulant[4],1./10.);}
366 cumulant[0] = (1./(fTuningR0[r]*fTuningR0[r]))*(8.*dAvC[0]-14.*dAvC[1]+(56./3.)*dAvC[2]-(35./2.)*dAvC[3]
367 + (56./5.)*dAvC[4]-(14./3.)*dAvC[5]+(8./7.)*dAvC[6]-(1./8.)*dAvC[7]);
368 cumulant[1] = (1./pow(fTuningR0[r],4.))*((-1924./35.)*dAvC[0]+(621./5.)*dAvC[1]-(8012./45.)*dAvC[2]
369 + (691./4.)*dAvC[3]-(564./5.)*dAvC[4]+(2143./45.)*dAvC[5]-(412./35.)*dAvC[6]+(363./280.)*dAvC[7]);
370 cumulant[2] = (1./pow(fTuningR0[r],6.))*(349.*dAvC[0]-(18353./20.)*dAvC[1]+(7173./5.)*dAvC[2]
371 - 1457.*dAvC[3]+(4891./5.)*dAvC[4]-(1683./4.)*dAvC[5]+(527./5.)*dAvC[6]-(469./40.)*dAvC[7]);
372 cumulant[3] = (1./pow(fTuningR0[r],8.))*((-10528./5.)*dAvC[0]+(30578./5.)*dAvC[1]-(51456./5.)*dAvC[2]
373 + 10993.*dAvC[3]-(38176./5.)*dAvC[4]+(16818./5.)*dAvC[5]-(4288./5.)*dAvC[6]+(967./10.)*dAvC[7]);
374 cumulant[4] = (1./pow(fTuningR0[r],10.))*(11500.*dAvC[0]-35800.*dAvC[1]+63900.*dAvC[2]-71600.*dAvC[3]
375 + 51620.*dAvC[4]-23400.*dAvC[5]+6100.*dAvC[6]-700.*dAvC[7]);
376 cumulant[5] = (1./pow(fTuningR0[r],12.))*(-52560.*dAvC[0]+172080.*dAvC[1]-321840.*dAvC[2]+376200.*dAvC[3]
377 - 281520.*dAvC[4]+131760.*dAvC[5]-35280.*dAvC[6]+4140.*dAvC[7]);
378 cumulant[6] = (1./pow(fTuningR0[r],14.))*(176400.*dAvC[0]-599760.*dAvC[1]+1164240.*dAvC[2]-1411200.*dAvC[3]
379 + 1093680.*dAvC[4]-529200.*dAvC[5]+146160.*dAvC[6]-17640.*dAvC[7]);
380 cumulant[7] = (1./pow(fTuningR0[r],16.))*(-322560*dAvC[0]+1128960.*dAvC[1]-2257920.*dAvC[2]+2822400.*dAvC[3]
381 - 2257920.*dAvC[4]+1128960.*dAvC[5]-322560.*dAvC[6]+40320.*dAvC[7]);
382 if(cumulant[0]>=0.) {flow[0] = pow(cumulant[0],1./2.);}
383 if(cumulant[1]<=0.) {flow[1] = pow(-1.*cumulant[1],1./4.);}
384 if(cumulant[2]>=0.) {flow[2] = pow((1./4.)*cumulant[2],1./6.);}
385 if(cumulant[3]<=0.) {flow[3] = pow((-1./33.)*cumulant[3],1./8.);}
386 if(cumulant[4]>=0.) {flow[4] = pow((1./456.)*cumulant[4],1./10.);}
387 if(cumulant[5]<=0.) {flow[5] = pow((-1./9460.)*cumulant[5],1./12.);}
388 if(cumulant[6]>=0.) {flow[6] = pow((1./274800.)*cumulant[6],1./14.);}
389 if(cumulant[7]<=0.) {flow[7] = pow((-1./10643745.)*cumulant[7],1./16.);}
391 // Store cumulants and reference flow:
392 for(Int_t co=0;co<pMax;co++) // cumulant order
394 fTuningCumulants[r][pq]->SetBinContent(co+1,cumulant[co]);
395 fTuningFlow[r][pq]->SetBinContent(co+1,flow[co]);
397 } // end of for(Int_t pq=0;pq<5;pq++)
398 } // end of for(Int_t r=0;r<10;r++)
400 } // end of void AliFlowAnalysisWithCumulants::FinalizeTuning()
402 //================================================================================================================
404 void AliFlowAnalysisWithCumulants::FillGeneratingFunctionsForDifferentTuningParameters(AliFlowEventSimple *anEvent)
406 // Fill generating function for reference flow evaluated for different tuning parameters.
408 Int_t pMax[5] = {2,3,4,5,8};
409 Int_t qMax[5] = {5,7,9,11,17};
411 // Particle variables and weights:
412 Double_t dPhi = 0.; // azimuthal angle in the laboratory frame
413 Double_t dPt = 0.; // transverse momentum
414 Double_t dEta = 0.; // pseudorapidity
415 Double_t wPhi = 1.; // phi weight
416 Double_t wPt = 1.; // pt weight
417 Double_t wEta = 1.; // eta weight
419 Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = total number of primary tracks, i.e. nPrim = nRP + nPOI + rest, where:
420 // nRP = # of particles used to determine the reaction plane;
421 // nPOI = # of particles of interest for a detailed flow analysis;
422 // rest = # of particles which are not niether RPs nor POIs.
424 Int_t nRP = anEvent->GetEventNSelTracksRP(); // nRP = # of particles used to determine the reaction plane;
426 Double_t tuningGenFunEBE[10][5][8][17] = {{{{0.}}}};
427 for(Int_t r=0;r<10;r++)
429 for(Int_t pq=0;pq<5;pq++)
431 for(Int_t p=0;p<pMax[pq];p++)
433 for(Int_t q=0;q<qMax[pq];q++)
435 tuningGenFunEBE[r][pq][p][q] = 1.;
441 // Looping over tracks:
442 for(Int_t i=0;i<nPrim;i++)
444 AliFlowTrackSimple *aftsTrack = anEvent->GetTrack(i);
445 if(aftsTrack && aftsTrack->InRPSelection())
447 // Access particle variables and weights:
448 dPhi = aftsTrack->Phi();
449 dPt = aftsTrack->Pt();
450 dEta = aftsTrack->Eta();
451 if(fUsePhiWeights && fnBinsPhi) // determine phi weight for this particle:
453 wPhi = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*fnBinsPhi/TMath::TwoPi())));
455 if(fUsePtWeights && fnBinsPt) // determine pt weight for this particle:
457 wPt = fPtWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/fPtBinWidth)));
459 if(fUseEtaWeights && fEtaBinWidth) // determine eta weight for this particle:
461 wEta = fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/fEtaBinWidth)));
463 // Fill the generating functions:
464 for(Int_t r=0;r<10;r++) // 10 different values for interpolating parameter r0
466 if(TMath::Abs(fTuningR0[r])<1.e-10) continue;
467 for(Int_t pq=0;pq<5;pq++) // 5 different values for set (pMax,qMax)
469 for(Int_t p=0;p<pMax[pq];p++)
471 for(Int_t q=0;q<qMax[pq];q++)
473 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]));
474 } // end of for(Int_t q=0;q<qMax[pq];q++)
475 } // end of for(Int_t p=0;p<pMax[pq];p++)
476 } // end for(Int_t pq=0;pq<5;pq++) // 5 different values for set (pMax,qMax)
477 } // end of for(Int_t r=0;r<10;r++) // 10 different values for interpolating parameter r0
478 } // end of if(aftsTrack && aftsTrack->InRPSelection())
479 } // end of for(Int_t i=0;i<nPrim;i++)
482 for(Int_t r=0;r<10;r++)
484 for(Int_t pq=0;pq<5;pq++)
486 for(Int_t p=0;p<pMax[pq];p++)
488 for(Int_t q=0;q<qMax[pq];q++)
490 if(fTuningGenFun[r][pq]) {fTuningGenFun[r][pq]->Fill((Double_t)p,(Double_t)q,tuningGenFunEBE[r][pq][p][q],1.);}
496 } // end of void AliFlowAnalysisWithCumulants::FillGeneratingFunctionsForDifferentTuningParameters(AliFlowEventSimple *anEvent)
498 //================================================================================================================
500 void AliFlowAnalysisWithCumulants::FillGeneratingFunctionForReferenceFlow(AliFlowEventSimple *anEvent)
502 // Fill generating function for reference flow for current event.
504 // Particle variables and weights:
505 Double_t dPhi = 0.; // azimuthal angle in the laboratory frame
506 Double_t dPt = 0.; // transverse momentum
507 Double_t dEta = 0.; // pseudorapidity
508 Double_t wPhi = 1.; // phi weight
509 Double_t wPt = 1.; // pt weight
510 Double_t wEta = 1.; // eta weight
512 Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = total number of primary tracks, i.e. nPrim = nRP + nPOI + rest, where:
513 // nRP = # of particles used to determine the reaction plane;
514 // nPOI = # of particles of interest for a detailed flow analysis;
515 // rest = # of particles which are not niether RPs nor POIs.
517 Int_t nRP = anEvent->GetEventNSelTracksRP(); // nRP = # of particles used to determine the reaction plane;
519 // Initializing the generating function G[p][q] for reference flow for current event:
520 Int_t pMax = fGEBE->GetNrows();
521 Int_t qMax = fGEBE->GetNcols();
522 for(Int_t p=0;p<pMax;p++)
524 for(Int_t q=0;q<qMax;q++)
530 // Cross-checking the number of RPs in current event:
531 Int_t crossCheckRP = 0;
533 // Looping over tracks:
534 for(Int_t i=0;i<nPrim;i++)
536 AliFlowTrackSimple *aftsTrack = anEvent->GetTrack(i);
537 if(aftsTrack && aftsTrack->InRPSelection())
540 // Access particle variables and weights:
541 dPhi = aftsTrack->Phi();
542 dPt = aftsTrack->Pt();
543 dEta = aftsTrack->Eta();
544 if(fUsePhiWeights && fnBinsPhi) // determine phi weight for this particle:
546 wPhi = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*fnBinsPhi/TMath::TwoPi())));
548 if(fUsePtWeights && fnBinsPt) // determine pt weight for this particle:
550 wPt = fPtWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/fPtBinWidth)));
552 if(fUseEtaWeights && fEtaBinWidth) // determine eta weight for this particle:
554 wEta = fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/fEtaBinWidth)));
556 // Fill the generating function:
557 for(Int_t p=0;p<pMax;p++)
559 for(Int_t q=0;q<qMax;q++)
561 (*fGEBE)(p,q) *= (1.+wPhi*wPt*wEta*(2.*fR0*sqrt(p+1.)/nRP)*cos(fHarmonic*dPhi-2.*q*TMath::Pi()/qMax));
564 // Fill the profile to calculate <<w^2>>:
565 fAverageOfSquaredWeight->Fill(0.5,pow(wPhi*wPt*wEta,2.),1.);
566 } // end of if(aftsTrack && aftsTrack->InRPSelection())
567 } // end of for(Int_t i=0;i<nPrim;i++)
569 // Cross check # of RPs:
570 if(anEvent && (crossCheckRP != anEvent->GetEventNSelTracksRP()))
573 cout<<"WARNING (GFC): crossCheckRP != nRP in GFC::Make(). Something is wrong with RP flagging !!!!"<<endl;
578 // Storing the value of G[p][q] in 2D profile in order to get eventually the avarage <G[p][q]>:
579 // Determine first the event weight for G[p][q]:
580 // (to be improved - this can be implemented much better, this shall be executed only once out of Make(), eventWeight should be a data member)
581 Double_t eventWeight = 0.;
582 if(!strcmp(fMultiplicityWeight->Data(),"unit"))
585 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
587 eventWeight = anEvent->GetEventNSelTracksRP();
589 // Store G[p][q] weighted appropriately:
590 for(Int_t p=0;p<pMax;p++)
592 for(Int_t q=0;q<qMax;q++)
594 fReferenceFlowGenFun->Fill((Double_t)p,(Double_t)q,(*fGEBE)(p,q),eventWeight);
598 } // end of void AliFlowAnalysisWithCumulants::FillGeneratingFunctionForReferenceFlow(AliFlowEventSimple* anEvent)
600 //================================================================================================================
602 void AliFlowAnalysisWithCumulants::FillQvectorComponents(AliFlowEventSimple* anEvent)
604 // Fill components of Q-vector for current event (needed for error calculation).
606 // Remark: Components are stored in profile fQvectorComponents whose binning is organized as follows:
616 Int_t n = 2; // to be removed
620 afv = anEvent->GetQ(1*n,fWeightsList,fUsePhiWeights,fUsePtWeights,fUseEtaWeights); // get the Q-vector for this event
621 fQvectorComponents->Fill(0.5,afv.X(),1.); // in the 1st bin fill Q_x
622 fQvectorComponents->Fill(1.5,afv.Y(),1.); // in the 2nd bin fill Q_y
623 fQvectorComponents->Fill(2.5,pow(afv.X(),2.),1.); // in the 3rd bin fill (Q_x)^2
624 fQvectorComponents->Fill(3.5,pow(afv.Y(),2.),1.); // in the 4th bin fill (Q_y)^2
627 } // end of void AliFlowAnalysisWithCumulants::FillQvectorComponents(AliFlowEventSimple* anEvent)
629 //================================================================================================================
631 void AliFlowAnalysisWithCumulants::FillGeneratingFunctionForDiffFlow(AliFlowEventSimple* anEvent)
633 // Fill generating function for differential flow for the current event.
635 // Remark 0: Generating function D[b][p][q] is a complex number => real and imaginary part are calculated separately
636 // (b denotes pt or eta bin);
637 // Remark 1: Note that bellow G[p][q] is needed, the value of generating function for reference flow for the CURRENT event.
638 // This values is obtained in method FillGeneratingFunctionForReferenceFlow() as TMatrixD fGEBE;
639 // 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
640 // automatically get <Re(D[b][p][q])> and <Im(D[b][p][q])> at the end of the day.
642 // Particle variables and weights:
643 Double_t dPhi = 0.; // azimuthal angle in the laboratory frame
644 Double_t dPt = 0.; // transverse momentum
645 Double_t dEta = 0.; // pseudorapidity
646 Double_t wPhi = 1.; // phi weight
647 Double_t wPt = 1.; // pt weight
648 Double_t wEta = 1.; // eta weight
651 Int_t pMax = fGEBE->GetNrows();
652 Int_t qMax = fGEBE->GetNcols();
654 Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = total number of primary tracks, i.e. nPrim = nRP + nPOI + rest, where:
655 // nRP = # of particles used to determine the reaction plane;
656 // nPOI = # of particles of interest for a detailed flow analysis;
657 // rest = # of particles which are not niether RPs nor POIs.
659 Int_t nRP = anEvent->GetEventNSelTracksRP(); // nRP = # of particles used to determine the reaction plane
661 // Start the second loop over event in order to evaluate the generating function D[b][p][q] for differential flow:
662 for(Int_t i=0;i<nPrim;i++)
664 AliFlowTrackSimple *aftsTrack = anEvent->GetTrack(i);
667 if(!(aftsTrack->InRPSelection() || aftsTrack->InPOISelection())) continue;
668 // Differential flow of POIs:
669 if(aftsTrack->InPOISelection())
671 // Get azimuthal angle, momentum and pseudorapidity of a particle:
672 dPhi = aftsTrack->Phi();
673 dPt = aftsTrack->Pt();
674 dEta = aftsTrack->Eta();
675 Double_t ptEta[2] = {dPt,dEta};
677 // Count number of POIs in pt/eta bin:
678 for(Int_t pe=0;pe<2;pe++)
680 fNoOfParticlesInBin[1][pe]->Fill(ptEta[pe],ptEta[pe],1.);
683 if(!(aftsTrack->InRPSelection())) // particle was flagged only as POI
685 // Fill generating function:
686 for(Int_t p=0;p<pMax;p++)
688 for(Int_t q=0;q<qMax;q++)
690 for(Int_t ri=0;ri<2;ri++)
692 for(Int_t pe=0;pe<2;pe++)
694 if(ri==0) // Real part (to be improved - this can be implemented better)
696 fDiffFlowGenFun[ri][1][pe]->Fill(ptEta[pe],(Double_t)p,(Double_t)q, // to be improved - hardwired weight 1. in the line bellow
697 (*fGEBE)(p,q)*cos(fMultiple*fHarmonic*dPhi),1.);
699 else if(ri==1) // Imaginary part (to be improved - this can be implemented better)
701 fDiffFlowGenFun[ri][1][pe]->Fill(ptEta[pe],(Double_t)p,(Double_t)q, // to be improved - hardwired weight 1. in the line bellow
702 (*fGEBE)(p,q)*sin(fMultiple*fHarmonic*dPhi),1.);
704 } // end of for(Int_t pe=0;pe<2;pe++)
705 } // end of for(Int_t ri=0;ri<2;ri++)
706 } // end of for(Int_t q=0;q<qMax;q++)
707 } // end of for(Int_t p=0;p<pMax;p++)
708 } // end of if(!(aftsTrack->InRPSelection())) // particle was flagged only as POI
709 else if(aftsTrack->InRPSelection()) // particle was flagged both as RP and POI
711 // If particle weights were used, get them:
712 if(fUsePhiWeights && fnBinsPhi) // determine phi weight for this particle:
714 wPhi = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*fnBinsPhi/TMath::TwoPi())));
716 if(fUsePtWeights && fnBinsPt) // determine pt weight for this particle:
718 wPt = fPtWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/fPtBinWidth)));
720 if(fUseEtaWeights && fEtaBinWidth) // determine eta weight for this particle:
722 wEta = fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/fEtaBinWidth)));
724 // Fill generating function:
725 for(Int_t p=0;p<pMax;p++)
727 for(Int_t q=0;q<qMax;q++)
729 for(Int_t ri=0;ri<2;ri++)
731 for(Int_t pe=0;pe<2;pe++)
733 if(ri==0) // Real part (to be improved - this can be implemented better)
735 fDiffFlowGenFun[ri][1][pe]->Fill(ptEta[pe],(Double_t)p,(Double_t)q, // to be improved - hardwired weight 1. in the line bellow
736 (*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.);
738 else if(ri==1) // Imaginary part (to be improved - this can be implemented better)
740 fDiffFlowGenFun[ri][1][pe]->Fill(ptEta[pe],(Double_t)p,(Double_t)q, // to be improved - hardwired weight 1. in the line bellow
741 (*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.);
743 } // end of for(Int_t pe=0;pe<2;pe++)
744 } // end of for(Int_t ri=0;ri<2;ri++)
745 } // end of for(Int_t q=0;q<qMax;q++)
746 } // end of for(Int_t p=0;p<pMax;p++)
747 } // end of else if (aftsTrack->InRPSelection()) // particle was flagged both as RP and POI
748 } // end of if(aftsTrack->InPOISelection())
749 // Differential flow of RPs:
750 if(aftsTrack->InRPSelection())
752 // Get azimuthal angle, momentum and pseudorapidity of a particle:
753 dPhi = aftsTrack->Phi();
754 dPt = aftsTrack->Pt();
755 dEta = aftsTrack->Eta();
756 Double_t ptEta[2] = {dPt,dEta};
758 // Count number of RPs in pt/eta bin:
759 for(Int_t pe=0;pe<2;pe++)
761 fNoOfParticlesInBin[0][pe]->Fill(ptEta[pe],ptEta[pe],1.);
764 // If particle weights were used, get them:
765 if(fUsePhiWeights && fnBinsPhi) // determine phi weight for this particle:
767 wPhi = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*fnBinsPhi/TMath::TwoPi())));
769 if(fUsePtWeights && fnBinsPt) // determine pt weight for this particle:
771 wPt = fPtWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/fPtBinWidth)));
773 if(fUseEtaWeights && fEtaBinWidth) // determine eta weight for this particle:
775 wEta = fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/fEtaBinWidth)));
777 // Fill generating function:
778 for(Int_t p=0;p<pMax;p++)
780 for(Int_t q=0;q<qMax;q++)
782 for(Int_t ri=0;ri<2;ri++)
784 for(Int_t pe=0;pe<2;pe++)
786 if(ri==0) // Real part (to be improved - this can be implemented better)
788 fDiffFlowGenFun[ri][0][pe]->Fill(ptEta[pe],(Double_t)p,(Double_t)q, // to be improved - hardwired weight 1. in the line bellow
789 (*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.);
791 else if(ri==1) // Imaginary part (to be improved - this can be implemented better)
793 fDiffFlowGenFun[ri][0][pe]->Fill(ptEta[pe],(Double_t)p,(Double_t)q, // to be improved - hardwired weight 1. in the line bellow
794 (*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.);
796 } // end of for(Int_t pe=0;pe<2;pe++)
797 } // end of for(Int_t ri=0;ri<2;ri++)
798 } // end of for(Int_t q=0;q<qMax;q++)
799 } // end of for(Int_t p=0;p<pMax;p++)
800 } // end of if(aftsTrack->InRPSelection())
801 } // end of if(aftsTrack)
802 } // end of for(Int_t i=0;i<nPrim;i++)
804 } // end of void AliFlowAnalysisWithCumulants::FillGeneratingFunctionForDiffFlow(AliFlowEventSimple* anEvent)
806 //================================================================================================================
808 void AliFlowAnalysisWithCumulants::GetOutputHistograms(TList *outputListHistos)
810 // Get pointers to all objects saved in the output file.
814 this->SetHistList(outputListHistos);
818 cout<<" WARNING (GFC): fHistList is NULL in AFAWGFC::GOH() !!!!"<<endl;
822 this->GetPointersForBaseHistograms();
823 this->GetPointersForCommonControlHistograms();
824 this->GetPointersForCommonResultsHistograms();
825 this->GetPointersForParticleWeightsHistograms();
826 this->GetPointersForReferenceFlowObjects();
827 this->GetPointersForDiffFlowObjects();
831 cout<<" WARNING (GFC): outputListHistos is NULL in AFAWGFC::GOH() !!!!"<<endl;
836 } // end of void AliFlowAnalysisWithCumulants::GetOutputHistograms(TList *outputListHistos)
838 //================================================================================================================
840 void AliFlowAnalysisWithCumulants::GetPointersForBaseHistograms()
842 // Get pointers to base histograms.
844 TString analysisSettingsName = "fAnalysisSettings";
845 TProfile *analysisSettings = dynamic_cast<TProfile*>(fHistList->FindObject(analysisSettingsName.Data()));
848 this->SetAnalysisSettings(analysisSettings);
852 cout<<" WARNING (GFC): analysisSettings is NULL in AFAWGFC::GPFBH() !!!!"<<endl;
857 } // end of void AliFlowAnalysisWithCumulants::GetPointersForBaseHistograms()
859 //================================================================================================================
861 void AliFlowAnalysisWithCumulants::GetPointersForCommonControlHistograms()
863 // Get pointers for common control histograms.
865 TString commonHistsName = "AliFlowCommonHistGFC";
866 AliFlowCommonHist *commonHist = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHistsName.Data()));
869 this->SetCommonHists(commonHist);
873 cout<<" WARNING (GFC): commonHist is NULL in AFAWGFC::GPFCH() !!!!"<<endl;
878 } // end of void AliFlowAnalysisWithCumulants::GetPointersForCommonControlHistograms()
880 //================================================================================================================
882 void AliFlowAnalysisWithCumulants::GetPointersForCommonResultsHistograms()
884 // Get pointers for common results histograms.
886 TString commonHistResults2ndOrderName = "AliFlowCommonHistResults2ndOrderGFC";
887 AliFlowCommonHistResults *commonHistRes2nd = dynamic_cast<AliFlowCommonHistResults*>
888 (fHistList->FindObject(commonHistResults2ndOrderName.Data()));
891 this->SetCommonHistsResults2nd(commonHistRes2nd);
895 cout<<" WARNING (GFC): commonHistRes2nd is NULL in AFAWGFC::GPFCRH() !!!!"<<endl;
899 TString commonHistResults4thOrderName = "AliFlowCommonHistResults4thOrderGFC";
900 AliFlowCommonHistResults *commonHistRes4th = dynamic_cast<AliFlowCommonHistResults*>
901 (fHistList->FindObject(commonHistResults4thOrderName.Data()));
904 this->SetCommonHistsResults4th(commonHistRes4th);
908 cout<<" WARNING (GFC): commonHistRes4th is NULL in AFAWGFC::GPFCRH() !!!!"<<endl;
912 TString commonHistResults6thOrderName = "AliFlowCommonHistResults6thOrderGFC";
913 AliFlowCommonHistResults *commonHistRes6th = dynamic_cast<AliFlowCommonHistResults*>
914 (fHistList->FindObject(commonHistResults6thOrderName.Data()));
917 this->SetCommonHistsResults6th(commonHistRes6th);
921 cout<<" WARNING (GFC): commonHistRes6th is NULL in AFAWGFC::GPFCRH() !!!!"<<endl;
925 TString commonHistResults8thOrderName = "AliFlowCommonHistResults8thOrderGFC";
926 AliFlowCommonHistResults *commonHistRes8th = dynamic_cast<AliFlowCommonHistResults*>
927 (fHistList->FindObject(commonHistResults8thOrderName.Data()));
930 this->SetCommonHistsResults8th(commonHistRes8th);
934 cout<<" WARNING (GFC): commonHistRes8th is NULL in AFAWGFC::GPFCRH() !!!!"<<endl;
939 } // end of void AliFlowAnalysisWithCumulants::GetPointersForCommonResultsHistograms()
941 //================================================================================================================
943 void AliFlowAnalysisWithCumulants::GetPointersForParticleWeightsHistograms()
945 // Get pointers for histograms holding particle weights.
947 TList *weightsList = dynamic_cast<TList*>(fHistList->FindObject("Weights"));
948 if(weightsList) this->SetWeightsList(weightsList);
949 TString fUseParticleWeightsName = "fUseParticleWeights";
950 TProfile *useParticleWeights = dynamic_cast<TProfile*>(weightsList->FindObject(fUseParticleWeightsName.Data()));
951 if(useParticleWeights)
953 this->SetUseParticleWeights(useParticleWeights);
954 fUsePhiWeights = (Int_t)fUseParticleWeights->GetBinContent(1);
955 fUsePtWeights = (Int_t)fUseParticleWeights->GetBinContent(2);
956 fUseEtaWeights = (Int_t)fUseParticleWeights->GetBinContent(3);
959 } // end of void AliFlowAnalysisWithCumulants::GetPointersForParticleWeightsHistograms();
961 //================================================================================================================
963 void AliFlowAnalysisWithCumulants::GetPointersForReferenceFlowObjects()
965 // Get pointers for all objects relevant for calculation of reference flow.
967 // a) Get pointers to all lists relevant for reference flow;
968 // b) Get pointer to profile holding flags;
969 // c) Get pointers to all objects in the list fReferenceFlowProfiles;
970 // d) Get pointers to all objects in the list fReferenceFlowResults.
972 // a) Get pointers to all lists relevant for reference flow:
973 TList *referenceFlowList = dynamic_cast<TList*>(fHistList->FindObject("Reference Flow"));
974 if(!referenceFlowList)
977 cout<<"WARNING (GFC): referenceFlowList is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
981 TList *referenceFlowProfiles = dynamic_cast<TList*>(referenceFlowList->FindObject("Profiles"));
982 if(!referenceFlowProfiles)
985 cout<<"WARNING (GFC): referenceFlowProfiles is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
989 TList *referenceFlowResults = dynamic_cast<TList*>(referenceFlowList->FindObject("Results"));
990 if(!referenceFlowResults)
993 cout<<"WARNING (GFC): referenceFlowResults is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
998 // b) Get pointer to profile holding flags:
999 TString referenceFlowFlagsName = "fReferenceFlowFlags";
1000 TProfile *referenceFlowFlags = dynamic_cast<TProfile*>(referenceFlowList->FindObject(referenceFlowFlagsName.Data()));
1001 if(referenceFlowFlags)
1003 this->SetReferenceFlowFlags(referenceFlowFlags);
1007 cout<<"WARNING (GFC): referenceFlowFlags is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1012 // c) Get pointers to all objects in the list fReferenceFlowProfiles:
1013 TString referenceFlowGenFunName = "fReferenceFlowGenFun";
1014 TProfile2D *referenceFlowGenFun = dynamic_cast<TProfile2D*>(referenceFlowProfiles->FindObject(referenceFlowGenFunName.Data()));
1015 if(referenceFlowGenFun)
1017 this->SetReferenceFlowGenFun(referenceFlowGenFun);
1021 cout<<"WARNING (GFC): referenceFlowGenFun is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1025 TString qvectorComponentsName = "fQvectorComponents";
1026 TProfile *qvectorComponents = dynamic_cast<TProfile*>(referenceFlowProfiles->FindObject(qvectorComponentsName.Data()));
1027 if(qvectorComponents)
1029 this->SetQvectorComponents(qvectorComponents);
1033 cout<<"WARNING (GFC): qvectorComponents is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1037 // <<w^2>>, where w = wPhi*wPt*wEta:
1038 TString averageOfSquaredWeightName = "fAverageOfSquaredWeight";
1039 TProfile *averageOfSquaredWeight = dynamic_cast<TProfile*>(referenceFlowProfiles->FindObject(averageOfSquaredWeightName.Data()));
1040 if(averageOfSquaredWeight)
1042 this->SetAverageOfSquaredWeight(averageOfSquaredWeight);
1046 cout<<"WARNING (GFC): averageOfSquaredWeight is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1051 // d) Get pointers to all objects in the list fReferenceFlowResults:
1052 // Final results for isotropic cumulants for reference flow:
1053 TString referenceFlowCumulantsName = "fReferenceFlowCumulants";
1054 TH1D *referenceFlowCumulants = dynamic_cast<TH1D*>(referenceFlowResults->FindObject(referenceFlowCumulantsName.Data()));
1055 if(referenceFlowCumulants)
1057 this->SetReferenceFlowCumulants(referenceFlowCumulants);
1061 cout<<"WARNING (GFC): referenceFlowCumulants is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1065 // Final results for reference flow:
1066 TString referenceFlowName = "fReferenceFlow";
1067 TH1D *referenceFlow = dynamic_cast<TH1D*>(referenceFlowResults->FindObject(referenceFlowName.Data()));
1070 this->SetReferenceFlow(referenceFlow);
1074 cout<<"WARNING (GFC): referenceFlow is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1078 // Final results for resolution:
1079 TString chiName = "fChi";
1080 TH1D *chi = dynamic_cast<TH1D*>(referenceFlowResults->FindObject(chiName.Data()));
1087 cout<<"WARNING (GFC): chi is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1092 } // end of void AliFlowAnalysisWithCumulants::GetPointersForReferenceFlowObjects()
1094 //================================================================================================================
1096 void AliFlowAnalysisWithCumulants::GetPointersForDiffFlowObjects()
1098 // Get pointers to all objects relevant for differential flow.
1100 // a) Define flags locally (to be improved: should I promote flags to data members?);
1101 // b) Get pointer to base list for differential flow fDiffFlowList and nested lists fDiffFlowListProfiles and fDiffFlowListResults;
1102 // c) Get pointer to profile fDiffFlowFlags holding all flags for differential flow;
1103 // d) Get pointers to all profiles in the list fDiffFlowProfiles;
1104 // e) Get pointers to all profiles in the list fDiffFlowResults.
1106 // a) Define flags locally (to be improved: should I promote flags to data members?):
1107 TString reIm[2] = {"Re","Im"};
1108 TString rpPoi[2] = {"RP","POI"};
1109 TString ptEta[2] = {"p_{t}","#eta"};
1110 TString order[4] = {"2nd order","4th order","6th order","8th order"};
1111 //TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
1113 // b) Get pointer to base list for differential flow fDiffFlowList and nested lists fDiffFlowListProfiles and fDiffFlowListResults:
1114 TList *diffFlowList = dynamic_cast<TList*>(fHistList->FindObject("Differential Flow")); // to be improved (hardwired name)
1118 cout<<"WARNING: diffFlowList is NULL in AFAWQC::GPFDFO() !!!!"<<endl;
1122 TList *diffFlowProfiles = dynamic_cast<TList*>(diffFlowList->FindObject("Profiles")); // to be improved (hardwired name)
1123 if(!diffFlowProfiles)
1126 cout<<"WARNING: diffFlowProfiles is NULL in AFAWQC::GPFDFO() !!!!"<<endl;
1130 TList *diffFlowResults = dynamic_cast<TList*>(diffFlowList->FindObject("Results")); // to be improved (hardwired name)
1131 if(!diffFlowResults)
1134 cout<<"WARNING: diffFlowResults is NULL in AFAWQC::GPFDFO() !!!!"<<endl;
1139 // c) Get pointer to profile holding flags:
1140 TString diffFlowFlagsName = "fDiffFlowFlags";
1141 TProfile *diffFlowFlags = dynamic_cast<TProfile*>(diffFlowList->FindObject(diffFlowFlagsName.Data()));
1144 this->SetDiffFlowFlags(diffFlowFlags);
1148 cout<<"WARNING (GFC): diffFlowFlags is NULL in AFAWGFC::GPFDFO() !!!!"<<endl;
1153 // d) Get pointers to all profiles in the list fDiffFlowListProfiles:
1154 // Generating functions for differential flow:
1155 TProfile3D *diffFlowGenFun[2][2][2] = {{{NULL}}};
1156 for(Int_t ri=0;ri<2;ri++)
1158 for(Int_t rp=0;rp<2;rp++)
1160 for(Int_t pe=0;pe<2;pe++)
1162 diffFlowGenFun[ri][rp][pe] = dynamic_cast<TProfile3D*> // to be improved - harwired name fDiffFlowGenFun in the line bellow
1163 (diffFlowProfiles->FindObject(Form("fDiffFlowGenFun (%s, %s, %s)",reIm[ri].Data(),rpPoi[rp].Data(),ptEta[pe].Data())));
1164 if(diffFlowGenFun[ri][rp][pe])
1166 this->SetDiffFlowGenFun(diffFlowGenFun[ri][rp][pe],ri,rp,pe);
1170 cout<<"WARNING (GFC): "<<Form("diffFlowGenFun[%d][%d][%d]",ri,rp,pe)<<" is NULL in AFAWGFC::GPFDFO() !!!!"<<endl;
1177 // Number of particles in pt/eta bin for RPs/POIs:
1178 TProfile *noOfParticlesInBin[2][2] = {{NULL}};
1179 for(Int_t rp=0;rp<2;rp++)
1181 for(Int_t pe=0;pe<2;pe++)
1183 noOfParticlesInBin[rp][pe] = dynamic_cast<TProfile*> // to be improved - harwired name fNoOfParticlesInBin in the line bellow
1184 (diffFlowProfiles->FindObject(Form("fNoOfParticlesInBin (%s, %s)",rpPoi[rp].Data(),ptEta[pe].Data())));
1185 if(noOfParticlesInBin[rp][pe])
1187 this->SetNoOfParticlesInBin(noOfParticlesInBin[rp][pe],rp,pe);
1191 cout<<"WARNING (GFC): "<<Form("noOfParticlesInBin[%d][%d]",rp,pe)<<" is NULL in AFAWGFC::GPFDFO() !!!!"<<endl;
1197 // Differential cumulants per pt/eta bin for RPs/POIs:
1198 TH1D *diffFlowCumulants[2][2][4] = {{{NULL}}};
1199 for(Int_t rp=0;rp<2;rp++)
1201 for(Int_t pe=0;pe<2;pe++)
1203 for(Int_t co=0;co<4;co++)
1205 diffFlowCumulants[rp][pe][co] = dynamic_cast<TH1D*> // to be improved - hardwired name fDiffFlowCumulants in the line bellow
1206 (diffFlowResults->FindObject(Form("fDiffFlowCumulants (%s, %s, %s)",rpPoi[rp].Data(),ptEta[pe].Data(),order[co].Data())));
1207 if(diffFlowCumulants[rp][pe][co])
1209 this->SetDiffFlowCumulants(diffFlowCumulants[rp][pe][co],rp,pe,co);
1213 cout<<"WARNING (GFC): "<<Form("diffFlowCumulants[%d][%d][%d]",rp,pe,co)<<" is NULL in AFAWGFC::GPFDFO() !!!!"<<endl;
1220 // Differential flow per pt/eta bin for RPs/POIs:
1221 TH1D *diffFlow[2][2][4] = {{{NULL}}};
1222 for(Int_t rp=0;rp<2;rp++)
1224 for(Int_t pe=0;pe<2;pe++)
1226 for(Int_t co=0;co<4;co++)
1228 diffFlow[rp][pe][co] = dynamic_cast<TH1D*> // to be improved - hardwired name fDiffFlow in the line bellow
1229 (diffFlowResults->FindObject(Form("fDiffFlow (%s, %s, %s)",rpPoi[rp].Data(),ptEta[pe].Data(),order[co].Data())));
1230 if(diffFlow[rp][pe][co])
1232 this->SetDiffFlow(diffFlow[rp][pe][co],rp,pe,co);
1236 cout<<"WARNING (GFC): "<<Form("diffFlow[%d][%d][%d]",rp,pe,co)<<" is NULL in AFAWGFC::GPFDFO() !!!!"<<endl;
1244 } // end of void AliFlowAnalysisWithCumulants::GetPointersForDiffFlowObjects()
1246 //================================================================================================================
1248 void AliFlowAnalysisWithCumulants::CalculateIntegratedFlow(TString rpPoi)
1250 // Calculate final results for integrated flow of RPs and POIs.
1251 // (to be improved - this method can be implemented much better)
1258 } else if(rpPoi == "POI")
1264 TH1F *yieldPt = NULL;
1268 yieldPt = (TH1F*)(fCommonHists->GetHistPtPOI())->Clone();
1269 } else if(rpPoi == "RP")
1271 yieldPt = (TH1F*)(fCommonHists->GetHistPtRP())->Clone();
1274 TH1D *flow2ndPt = (TH1D*)fDiffFlow[rp][0][0]->Clone();
1275 TH1D *flow4thPt = (TH1D*)fDiffFlow[rp][0][1]->Clone();
1276 TH1D *flow6thPt = (TH1D*)fDiffFlow[rp][0][2]->Clone();
1277 TH1D *flow8thPt = (TH1D*)fDiffFlow[rp][0][3]->Clone();
1278 Double_t dvn2nd = 0., dvn4th = 0., dvn6th = 0., dvn8th = 0.; // differential flow
1279 Double_t dErrvn2nd = 0., dErrvn4th = 0., dErrvn6th = 0., dErrvn8th = 0.; // error on differential flow
1280 Double_t dVn2nd = 0., dVn4th = 0., dVn6th = 0., dVn8th = 0.; // integrated flow
1281 Double_t dErrVn2nd = 0., dErrVn4th = 0., dErrVn6th = 0., dErrVn8th = 0.; // error on integrated flow
1282 Double_t dYield = 0.; // pt yield
1283 Double_t dSum2nd = 0., dSum4th = 0., dSum6th = 0., dSum8th = 0.; // needed for normalizing integrated flow
1284 fnBinsPt = flow2ndPt->GetXaxis()->GetNbins();
1285 // looping over pt bins:
1286 for(Int_t p=1;p<=fnBinsPt;p++)
1288 dvn2nd = flow2ndPt->GetBinContent(p);
1289 dvn4th = flow4thPt->GetBinContent(p);
1290 dvn6th = flow6thPt->GetBinContent(p);
1291 dvn8th = flow8thPt->GetBinContent(p);
1293 dErrvn2nd = flow2ndPt->GetBinError(p);
1294 dErrvn4th = flow4thPt->GetBinError(p);
1295 dErrvn6th = flow6thPt->GetBinError(p);
1296 dErrvn8th = flow8thPt->GetBinError(p);
1298 dYield = yieldPt->GetBinContent(p);
1300 dVn2nd += dvn2nd*dYield;
1301 dVn4th += dvn4th*dYield;
1302 dVn6th += dvn6th*dYield;
1303 dVn8th += dvn8th*dYield;
1310 dErrVn2nd += dYield*dYield*dErrvn2nd*dErrvn2nd;
1311 dErrVn4th += dYield*dYield*dErrvn4th*dErrvn4th;
1312 dErrVn6th += dYield*dYield*dErrvn6th*dErrvn6th;
1313 dErrVn8th += dYield*dYield*dErrvn8th*dErrvn8th;
1314 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
1316 // normalizing the results for integrated flow:
1320 dErrVn2nd /= (dSum2nd*dSum2nd);
1321 dErrVn2nd = TMath::Sqrt(dErrVn2nd);
1326 dErrVn4th /= (dSum4th*dSum4th);
1327 dErrVn4th = TMath::Sqrt(dErrVn4th);
1332 dErrVn6th /= (dSum6th*dSum6th);
1333 dErrVn6th = TMath::Sqrt(dErrVn6th);
1338 dErrVn8th /= (dSum8th*dSum8th);
1339 dErrVn8th = TMath::Sqrt(dErrVn8th);
1342 // storing the results for integrated flow in common hist results:
1345 fCommonHistsResults2nd->FillIntegratedFlowPOI(dVn2nd,dErrVn2nd);
1346 fCommonHistsResults4th->FillIntegratedFlowPOI(dVn4th,dErrVn4th);
1347 fCommonHistsResults6th->FillIntegratedFlowPOI(dVn6th,dErrVn6th);
1348 fCommonHistsResults8th->FillIntegratedFlowPOI(dVn8th,dErrVn8th);
1350 else if(rpPoi == "RP")
1352 fCommonHistsResults2nd->FillIntegratedFlowRP(dVn2nd,dErrVn2nd);
1353 fCommonHistsResults4th->FillIntegratedFlowRP(dVn4th,dErrVn4th);
1354 fCommonHistsResults6th->FillIntegratedFlowRP(dVn6th,dErrVn6th);
1355 fCommonHistsResults8th->FillIntegratedFlowRP(dVn8th,dErrVn8th);
1364 } // end of void AliFlowAnalysisWithCumulants::CalculateIntegratedFlow(TString rpPoi)
1366 //================================================================================================================
1368 void AliFlowAnalysisWithCumulants::FillCommonHistResultsForDifferentialFlow(TString rpPoi)
1370 // Fill common result histograms for differential flow.
1371 // (to be improved - this method can be implemented much better)
1378 } else if(rpPoi == "POI")
1384 for(Int_t p=1;p<=fnBinsPt;p++)
1387 Double_t v2 = fDiffFlow[rp][0][0]->GetBinContent(p);
1388 Double_t v4 = fDiffFlow[rp][0][1]->GetBinContent(p);
1389 Double_t v6 = fDiffFlow[rp][0][2]->GetBinContent(p);
1390 Double_t v8 = fDiffFlow[rp][0][3]->GetBinContent(p);
1392 Double_t v2Error = fDiffFlow[rp][0][0]->GetBinError(p);
1393 Double_t v4Error = fDiffFlow[rp][0][1]->GetBinError(p);
1394 Double_t v6Error = fDiffFlow[rp][0][2]->GetBinError(p);
1395 Double_t v8Error = fDiffFlow[rp][0][3]->GetBinError(p);
1396 // Fill common hist results:
1399 fCommonHistsResults2nd->FillDifferentialFlowPtRP(p,v2,v2Error);
1400 fCommonHistsResults4th->FillDifferentialFlowPtRP(p,v4,v4Error);
1401 fCommonHistsResults6th->FillDifferentialFlowPtRP(p,v6,v6Error);
1402 fCommonHistsResults8th->FillDifferentialFlowPtRP(p,v8,v8Error);
1403 } else if(rpPoi == "POI")
1405 fCommonHistsResults2nd->FillDifferentialFlowPtPOI(p,v2,v2Error);
1406 fCommonHistsResults4th->FillDifferentialFlowPtPOI(p,v4,v4Error);
1407 fCommonHistsResults6th->FillDifferentialFlowPtPOI(p,v6,v6Error);
1408 fCommonHistsResults8th->FillDifferentialFlowPtPOI(p,v8,v8Error);
1410 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
1413 for(Int_t e=1;e<=fnBinsEta;e++)
1416 Double_t v2 = fDiffFlow[rp][1][0]->GetBinContent(e);
1417 Double_t v4 = fDiffFlow[rp][1][1]->GetBinContent(e);
1418 Double_t v6 = fDiffFlow[rp][1][2]->GetBinContent(e);
1419 Double_t v8 = fDiffFlow[rp][1][3]->GetBinContent(e);
1421 Double_t v2Error = fDiffFlow[rp][1][0]->GetBinError(e);
1422 Double_t v4Error = fDiffFlow[rp][1][1]->GetBinError(e);
1423 Double_t v6Error = fDiffFlow[rp][1][2]->GetBinError(e);
1424 Double_t v8Error = fDiffFlow[rp][1][3]->GetBinError(e);
1425 // Fill common hist results:
1428 fCommonHistsResults2nd->FillDifferentialFlowEtaRP(e,v2,v2Error);
1429 fCommonHistsResults4th->FillDifferentialFlowEtaRP(e,v4,v4Error);
1430 fCommonHistsResults6th->FillDifferentialFlowEtaRP(e,v6,v6Error);
1431 fCommonHistsResults8th->FillDifferentialFlowEtaRP(e,v8,v8Error);
1432 } else if(rpPoi == "POI")
1434 fCommonHistsResults2nd->FillDifferentialFlowEtaPOI(e,v2,v2Error);
1435 fCommonHistsResults4th->FillDifferentialFlowEtaPOI(e,v4,v4Error);
1436 fCommonHistsResults6th->FillDifferentialFlowEtaPOI(e,v6,v6Error);
1437 fCommonHistsResults8th->FillDifferentialFlowEtaPOI(e,v8,v8Error);
1439 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
1441 } // end of void AliFlowAnalysisWithCumulants::FillCommonHistResultsForDifferentialFlow(TString rpPoi)
1443 //================================================================================================================
1445 void AliFlowAnalysisWithCumulants::CalculateDifferentialFlow(TString rpPoi, TString ptEta)
1447 // Calculate differential flow for RPs/POIs vs pt/eta from cumulants.
1449 Int_t rp = -1; // RP or POI
1450 Int_t pe = -1; // pt or eta
1455 } else if(rpPoi == "POI")
1462 } else if(ptEta == "eta")
1467 // Reference cumulants:
1468 Double_t gfc2 = fReferenceFlowCumulants->GetBinContent(1); // reference 2nd order cumulant
1469 Double_t gfc4 = fReferenceFlowCumulants->GetBinContent(2); // reference 4th order cumulant
1470 Double_t gfc6 = fReferenceFlowCumulants->GetBinContent(3); // reference 6th order cumulant
1471 Double_t gfc8 = fReferenceFlowCumulants->GetBinContent(4); // reference 8th order cumulant
1473 Int_t nBins = fDiffFlowCumulants[rp][pe][0]->GetXaxis()->GetNbins();
1475 for(Int_t b=1;b<=nBins;b++)
1477 // Differential cumulants:
1478 Double_t gfd2 = fDiffFlowCumulants[rp][pe][0]->GetBinContent(b); // differential 2nd order cumulant
1479 Double_t gfd4 = fDiffFlowCumulants[rp][pe][1]->GetBinContent(b); // differential 4th order cumulant
1480 Double_t gfd6 = fDiffFlowCumulants[rp][pe][2]->GetBinContent(b); // differential 6th order cumulant
1481 Double_t gfd8 = fDiffFlowCumulants[rp][pe][3]->GetBinContent(b); // differential 8th order cumulant
1482 // Differential flow:
1483 Double_t v2 = 0.; // v'{2,GFC}
1484 Double_t v4 = 0.; // v'{4,GFC}
1485 Double_t v6 = 0.; // v'{6,GFC}
1486 Double_t v8 = 0.; // v'{8,GFC}
1490 v2 = gfd2/pow(gfc2,0.5);
1491 fDiffFlow[rp][pe][0]->SetBinContent(b,v2);
1496 v4 = -gfd4/pow(-gfc4,.75);
1497 fDiffFlow[rp][pe][1]->SetBinContent(b,v4);
1502 v6 = gfd6/(4.*pow((1./4.)*gfc6,(5./6.)));
1503 fDiffFlow[rp][pe][2]->SetBinContent(b,v6);
1508 v8 = -gfd8/(33.*pow(-(1./33.)*gfc8,(7./8.)));
1509 fDiffFlow[rp][pe][3]->SetBinContent(b,v8);
1511 } // end of for(Int_t b=1;b<=nBins;b++)
1513 } // end of void AliFlowAnalysisWithCumulants::CalculateDifferentialFlow(TString rpPoi,TString ptEta)
1515 //================================================================================================================
1517 void AliFlowAnalysisWithCumulants::CalculateDifferentialFlowErrors(TString rpPoi,TString ptEta)
1519 // Calculate errors of differential flow.
1521 Int_t rp = -1; // RP or POI
1522 Int_t pe = -1; // pt or eta
1527 } else if(rpPoi == "POI")
1534 } else if(ptEta == "eta")
1540 Double_t chi2 = fChi->GetBinContent(1);
1541 Double_t chi4 = fChi->GetBinContent(2);
1542 //Double_t chi6 = fChi->GetBinContent(3);
1543 //Double_t chi8 = fChi->GetBinContent(4);
1545 Int_t nBins = fNoOfParticlesInBin[rp][pe]->GetXaxis()->GetNbins();
1546 for(Int_t b=1;b<=nBins;b++)
1548 Int_t nParticles = (Int_t)fNoOfParticlesInBin[rp][pe]->GetBinEntries(b);
1549 // Error of 2nd order estimate:
1550 if(chi2>0. && nParticles>0.)
1552 Double_t v2Error = pow((1./(2.*nParticles))*((1.+pow(chi2,2.))/pow(chi2,2.)),0.5);
1553 fDiffFlow[rp][pe][0]->SetBinError(b,v2Error);
1555 // Error of 4th order estimate:
1556 if(chi4>0. && nParticles>0.)
1558 Double_t v4Error = pow((1./(2.*nParticles))*((2.+6.*pow(chi4,2.)+pow(chi4,4.)+pow(chi4,6.))/pow(chi4,6.)),0.5);
1559 fDiffFlow[rp][pe][1]->SetBinError(b,v4Error);
1561 // Error of 6th order estimate:
1562 //if(chi6>0. && nParticles>0.)
1564 // Double_t v6Error = ... // to be improved - yet to be calculated
1565 fDiffFlow[rp][pe][2]->SetBinError(b,0.);
1567 // Error of 8th order estimate:
1568 //if(chi8>0. && nParticles>0.)
1570 // Double_t v8Error = ... // to be improved - yet to be calculated
1571 fDiffFlow[rp][pe][3]->SetBinError(b,0.);
1573 } // end of for(Int_t b=1;b<=nBins;b++)
1575 } // end of void AliFlowAnalysisWithCumulants::CalculateDifferentialFlowErrors(TString rpPoi,TString ptEta)
1577 //================================================================================================================
1579 void AliFlowAnalysisWithCumulants::CalculateCumulantsForDiffFlow(TString rpPoi,TString ptEta)
1581 // Calculate cumulants for differential flow.
1583 Int_t rp = -1; // RP or POI
1584 Int_t pe = -1; // pt or eta
1589 } else if(rpPoi == "POI")
1596 } else if(ptEta == "eta")
1601 // [nBins][pMax][qMax]:
1602 Int_t nBins = fDiffFlowGenFun[0][rp][pe]->GetXaxis()->GetNbins();
1603 Int_t pMax = fDiffFlowGenFun[0][rp][pe]->GetYaxis()->GetNbins();
1604 Int_t qMax = fDiffFlowGenFun[0][rp][pe]->GetZaxis()->GetNbins();
1606 TMatrixD dAvG(pMax,qMax);
1608 for(Int_t p=0;p<pMax;p++)
1610 for(Int_t q=0;q<qMax;q++)
1612 dAvG(p,q) = fReferenceFlowGenFun->GetBinContent(fReferenceFlowGenFun->GetBin(p+1,q+1));
1615 // Loop over pt/eta bins and calculate differential cumulants:
1616 for(Int_t b=0;b<nBins;b++)
1618 Double_t gfc[5] = {0.}; // to be improved (hardwired 5)
1619 Double_t D[5] = {0.}; // D_{p} in Eq. (11) in Practical guide // to be improved (hardwired 5)
1620 // ptBinRPNoOfParticles[b]=fPtBinRPNoOfParticles->GetBinEntries(b+1);
1621 for(Int_t p=0;p<pMax;p++)
1623 Double_t tempSum = 0.;
1624 for(Int_t q=0;q<qMax;q++)
1626 if(TMath::Abs(dAvG(p,q))>1.e-44)
1628 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)
1629 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)
1630 tempSum += cos(fMultiple*2.*q*TMath::Pi()/qMax)*X
1631 + sin(fMultiple*2.*q*TMath::Pi()/qMax)*Y;
1634 D[p] = (pow(fR0*pow(p+1.0,0.5),fMultiple)/qMax)*tempSum;
1636 gfc[0] = (1./(fR0*fR0))*(5.*D[0]-5.*D[1]+(10./3.)*D[2]-(5./4.)*D[3]+(1./5.)*D[4]);
1637 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]);
1638 gfc[2] = (1./pow(fR0,6.))*((71./2.)*D[0]-59.*D[1]+49.*D[2]-(41./2.)*D[3]+(7./2.)*D[4]);
1639 gfc[3] = (1./pow(fR0,8.))*(-84.*D[0]+156.*D[1]-144.*D[2]+66.*D[3]-12.*D[4]);
1640 // 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?)
1642 for(Int_t co=0;co<4;co++)
1644 fDiffFlowCumulants[rp][pe][co]->SetBinContent(b+1,gfc[co]);
1648 } // end of void AliFlowAnalysisWithCumulants::CalculateCumulantsForDiffFlow(TString rpPoi, TString ptEta)
1650 //================================================================================================================
1652 void AliFlowAnalysisWithCumulants::PrintFinalResults(TString type)
1654 // Printing on the screen the final results for reference flow and for integrated flow of RPs and POIs.
1656 Int_t n = fHarmonic;
1658 Double_t dVn[4] = {0.}; // array to hold Vn{2}, Vn{4}, Vn{6} and Vn{8}
1659 Double_t dVnErr[4] = {0.}; // array to hold errors of Vn{2}, Vn{4}, Vn{6} and Vn{8}
1663 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinContent(1);
1664 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinError(1);
1665 dVn[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinContent(1);
1666 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinError(1);
1667 dVn[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinContent(1);
1668 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinError(1);
1669 dVn[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinContent(1);
1670 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinError(1);
1671 } else if(type == "RP")
1673 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinContent(1);
1674 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinError(1);
1675 dVn[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinContent(1);
1676 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinError(1);
1677 dVn[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinContent(1);
1678 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinError(1);
1679 dVn[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinContent(1);
1680 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinError(1);
1681 } else if(type == "POI")
1683 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinContent(1);
1684 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinError(1);
1685 dVn[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinContent(1);
1686 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinError(1);
1687 dVn[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinContent(1);
1688 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinError(1);
1689 dVn[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinContent(1);
1690 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinError(1);
1694 cout<<" WARNING: Impossible type (can be RF, RP or POI) !!!!"<<endl;
1695 cout<<" Results will not be printed on the screen."<<endl;
1700 TString title = " flow estimates from GF-cumulants";
1701 TString subtitle = " (";
1703 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
1705 subtitle.Append(type);
1706 subtitle.Append(", without weights)");
1709 subtitle.Append(type);
1710 subtitle.Append(", with weights)");
1714 cout<<"*************************************"<<endl;
1715 cout<<"*************************************"<<endl;
1716 cout<<title.Data()<<endl;
1717 cout<<subtitle.Data()<<endl;
1720 for(Int_t i=0;i<4;i++)
1722 cout<<" v_"<<n<<"{"<<2*(i+1)<<"} = "<<dVn[i]<<" +/- "<<dVnErr[i]<<endl;
1728 cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultRP()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultRP()->GetMean()<<endl;
1730 else if (type == "RP")
1732 cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultRP()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultRP()->GetMean()<<endl;
1734 else if (type == "POI")
1736 cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultPOI()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultPOI()->GetMean()<<endl;
1738 cout<<"*************************************"<<endl;
1739 cout<<"*************************************"<<endl;
1742 } // end of AliFlowAnalysisWithCumulants::PrintFinalResults(TString type);
1744 //================================================================================================================
1746 void AliFlowAnalysisWithCumulants::FillCommonHistResultsForReferenceFlow()
1748 // Fill in AliFlowCommonHistResults dedicated histograms for reference flow.
1751 Double_t v2 = fReferenceFlow->GetBinContent(1);
1752 Double_t v4 = fReferenceFlow->GetBinContent(2);
1753 Double_t v6 = fReferenceFlow->GetBinContent(3);
1754 Double_t v8 = fReferenceFlow->GetBinContent(4);
1756 Double_t v2Error = fReferenceFlow->GetBinError(1);
1757 Double_t v4Error = fReferenceFlow->GetBinError(2);
1758 Double_t v6Error = fReferenceFlow->GetBinError(3);
1759 Double_t v8Error = fReferenceFlow->GetBinError(4);
1760 // Fill results end errors in common hist results:
1761 fCommonHistsResults2nd->FillIntegratedFlow(v2,v2Error);
1762 fCommonHistsResults4th->FillIntegratedFlow(v4,v4Error);
1763 fCommonHistsResults6th->FillIntegratedFlow(v6,v6Error);
1764 fCommonHistsResults8th->FillIntegratedFlow(v8,v8Error);
1766 Double_t chi2 = fChi->GetBinContent(1);
1767 Double_t chi4 = fChi->GetBinContent(2);
1768 Double_t chi6 = fChi->GetBinContent(3);
1769 Double_t chi8 = fChi->GetBinContent(4);
1770 // Fill resolution chi in common hist results:
1771 fCommonHistsResults2nd->FillChi(chi2);
1772 fCommonHistsResults4th->FillChi(chi4);
1773 fCommonHistsResults6th->FillChi(chi6);
1774 fCommonHistsResults8th->FillChi(chi8);
1776 } // end of AliFlowAnalysisWithCumulants::FillCommonHistResultsForReferenceFlow()
1778 //================================================================================================================
1780 void AliFlowAnalysisWithCumulants::CalculateReferenceFlowError()
1782 // Calculate error of reference flow harmonics.
1784 // Generating Function Cumulants:
1785 Double_t gfc2 = fReferenceFlowCumulants->GetBinContent(1); // GFC{2}
1786 Double_t gfc4 = fReferenceFlowCumulants->GetBinContent(2); // GFC{4}
1787 Double_t gfc6 = fReferenceFlowCumulants->GetBinContent(3); // GFC{6}
1788 Double_t gfc8 = fReferenceFlowCumulants->GetBinContent(4); // GFC{8}
1789 // Reference flow estimates:
1790 Double_t v2 = fReferenceFlow->GetBinContent(1); // v{2,GFC}
1791 Double_t v4 = fReferenceFlow->GetBinContent(2); // v{4,GFC}
1792 Double_t v6 = fReferenceFlow->GetBinContent(3); // v{6,GFC}
1793 Double_t v8 = fReferenceFlow->GetBinContent(4); // v{8,GFC}
1794 // Statistical errors of reference flow estimates:
1795 Double_t v2Error = 0.; // statistical error of v{2,GFC}
1796 Double_t v4Error = 0.; // statistical error of v{4,GFC}
1797 Double_t v6Error = 0.; // statistical error of v{6,GFC}
1798 Double_t v8Error = 0.; // statistical error of v{8,GFC}
1804 // <Q-vector stuff>:
1805 Double_t dAvQx = fQvectorComponents->GetBinContent(1); // <Q_x>
1806 Double_t dAvQy = fQvectorComponents->GetBinContent(2); // <Q_y>
1807 Double_t dAvQ2x = fQvectorComponents->GetBinContent(3); // <(Q_x)^2>
1808 Double_t dAvQ2y = fQvectorComponents->GetBinContent(4); // <(Q_y)^2>
1810 Double_t dAvw2 = 1.;
1813 dAvw2 = fAverageOfSquaredWeight->GetBinContent(1);
1814 if(TMath::Abs(dAvw2)<1.e-44)
1817 cout<<" WARNING (GFC): Average of squared weight is 0 in GFC. Most probably one of the histograms"<<endl;
1818 cout<<" in the file \"weights.root\" was empty. Nothing will be calculated !!!!"<<endl;
1822 // Calculating statistical error of v{2,GFC}:
1823 if(fnEvts>0. && fAvM>0. && dAvw2>0. && gfc2>=0.)
1825 if((dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow(gfc2,(1./2.))*(fAvM/dAvw2),2.)>0.))
1827 chi2 = (fAvM*v2)/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(v2*fAvM/dAvw2,2.),0.5);
1829 if(TMath::Abs(chi2)>1.e-44)
1831 v2Error = pow(((1./(2.*fAvM*fnEvts))*((1.+2.*pow(chi2,2))/(2.*pow(chi2,2)))),0.5);
1834 // Calculating statistical error of v{4,GFC}:
1835 if(fnEvts>0 && fAvM>0 && dAvw2>0 && gfc4<=0.)
1837 if((dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow(-gfc4,(1./4.))*(fAvM/dAvw2),2.)>0.))
1839 chi4 = (fAvM*v4)/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(v4*fAvM/dAvw2,2.),0.5);
1841 if(TMath::Abs(chi4)>1.e-44)
1843 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);
1846 // Calculating statistical error of v{6,GFC}:
1847 if(fnEvts>0 && fAvM>0 && dAvw2>0 && gfc6>=0.)
1849 if((dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow((1./4.)*gfc6,(1./6.))*(fAvM/dAvw2),2.)>0.))
1851 chi6 = (fAvM*v6)/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(v6*fAvM/dAvw2,2.),0.5);
1853 if(TMath::Abs(chi6)>1.e-44)
1855 v6Error = (1./(pow(2.*fAvM*fnEvts,0.5)))*pow((3.+18.*pow(chi6,2)+9.*pow(chi6,4.)+28.*pow(chi6,6.)
1856 +12.*pow(chi6,8.)+24.*pow(chi6,10.))/(24.*pow(chi6,10.)),0.5);
1859 // Calculating statistical error of v{8,GFC}:
1860 if(fnEvts>0 && fAvM>0 && dAvw2>0 && gfc8<=0.)
1862 if((dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow(-(1./33.)*gfc8,(1./8.))*(fAvM/dAvw2),2.)>0.))
1864 chi8=(fAvM*v8)/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(v8*fAvM/dAvw2,2.),0.5);
1866 if(TMath::Abs(chi8)>1.e-44)
1868 v8Error = (1./(pow(2.*fAvM*fnEvts,0.5)))*pow((12.+96.*pow(chi8,2.)+72.*pow(chi8,4.)+304.*pow(chi8,6.)
1869 +257.*pow(chi8,8.)+804.*pow(chi8,10.)+363.*pow(chi8,12.)+726.*pow(chi8,14.))/(726.*pow(chi8,14.)),0.5);
1873 // Store errors for reference flow:
1874 fReferenceFlow->SetBinError(1,v2Error);
1875 fReferenceFlow->SetBinError(2,v4Error);
1876 fReferenceFlow->SetBinError(3,v6Error);
1877 fReferenceFlow->SetBinError(4,v8Error);
1878 // Store resolution chi:
1879 fChi->SetBinContent(1,chi2);
1880 fChi->SetBinContent(2,chi4);
1881 fChi->SetBinContent(3,chi6);
1882 fChi->SetBinContent(4,chi8);
1884 } // end of void AliFlowAnalysisWithCumulants::CalculateReferenceFlowError()
1886 //================================================================================================================
1888 void AliFlowAnalysisWithCumulants::CalculateReferenceFlow()
1890 // Calculate from isotropic cumulants reference flow.
1892 // Generating Function Cumulants:
1893 Double_t gfc2 = fReferenceFlowCumulants->GetBinContent(1); // GFC{2}
1894 Double_t gfc4 = fReferenceFlowCumulants->GetBinContent(2); // GFC{4}
1895 Double_t gfc6 = fReferenceFlowCumulants->GetBinContent(3); // GFC{6}
1896 Double_t gfc8 = fReferenceFlowCumulants->GetBinContent(4); // GFC{8}
1897 // Double_t gfc10 = fReferenceFlowCumulants->GetBinContent(5); // GFC{10} overflow
1898 // Reference flow estimates:
1899 Double_t v2 = 0.; // v{2,GFC}
1900 Double_t v4 = 0.; // v{4,GFC}
1901 Double_t v6 = 0.; // v{6,GFC}
1902 Double_t v8 = 0.; // v{8,GFC}
1903 // Double_t v10 = 0.; // v{10,GFC} overflow
1904 // Calculate reference flow estimates from Q-cumulants:
1905 if(gfc2>=0.) v2 = pow(gfc2,1./2.);
1906 if(gfc4<=0.) v4 = pow(-1.*gfc4,1./4.);
1907 if(gfc6>=0.) v6 = pow((1./4.)*gfc6,1./6.);
1908 if(gfc8<=0.) v8 = pow((-1./33.)*gfc8,1./8.);
1909 // if(gfc10>=0.) v10 = pow((1./456.)*gfc10,1./10.);
1910 // Store results for reference flow:
1911 fReferenceFlow->SetBinContent(1,v2);
1912 fReferenceFlow->SetBinContent(2,v4);
1913 fReferenceFlow->SetBinContent(3,v6);
1914 fReferenceFlow->SetBinContent(4,v8);
1915 // fReferenceFlow->SetBinContent(5,v10); // overflow
1917 } // end of void AliFlowAnalysisWithCumulants::CalculateReferenceFlow()
1919 //================================================================================================================
1921 void AliFlowAnalysisWithCumulants::CalculateCumulantsForReferenceFlow()
1923 // Calculate cumulants for reference flow.
1925 Int_t pMax = fReferenceFlowGenFun->GetXaxis()->GetNbins();
1926 Int_t qMax = fReferenceFlowGenFun->GetYaxis()->GetNbins();
1929 TMatrixD dAvG(pMax,qMax);
1931 Bool_t someAvGEntryIsNegative = kFALSE;
1932 for(Int_t p=0;p<pMax;p++)
1934 for(Int_t q=0;q<qMax;q++)
1936 dAvG(p,q) = fReferenceFlowGenFun->GetBinContent(fReferenceFlowGenFun->GetBin(p+1,q+1));
1939 someAvGEntryIsNegative = kTRUE;
1941 cout<<" WARNING: "<<Form("<G[%d][%d]> is negative !!!! GFC results are meaningless.",p,q)<<endl;
1947 // C[p][q] (generating function for the cumulants)
1948 TMatrixD dC(pMax,qMax);
1950 if(fAvM>0. && !someAvGEntryIsNegative)
1952 for(Int_t p=0;p<pMax;p++)
1954 for(Int_t q=0;q<qMax;q++)
1956 dC(p,q) = fAvM*(pow(dAvG(p,q),(1./fAvM))-1.);
1961 // Averaging the generating function for cumulants over azimuth
1962 // in order to eliminate detector effects.
1963 // <C[p][q]> (Remark: here <> stands for average over azimuth):
1964 TVectorD dAvC(pMax);
1966 for(Int_t p=0;p<pMax;p++)
1969 for(Int_t q=0;q<qMax;q++)
1973 dAvC[p] = temp/qMax;
1976 // Finally, the isotropic cumulants for reference flow:
1977 TVectorD cumulant(pMax);
1979 cumulant[0] = (-1./(60*fR0*fR0))*((-300.)*dAvC[0]+300.*dAvC[1]-200.*dAvC[2]+75.*dAvC[3]-12.*dAvC[4]);
1980 cumulant[1] = (-1./(6.*pow(fR0,4.)))*(154.*dAvC[0]-214.*dAvC[1]+156.*dAvC[2]-61.*dAvC[3]+10.*dAvC[4]);
1981 cumulant[2] = (3./(2.*pow(fR0,6.)))*(71.*dAvC[0]-118.*dAvC[1]+98.*dAvC[2]-41.*dAvC[3]+7.*dAvC[4]);
1982 cumulant[3] = (-24./pow(fR0,8.))*(14.*dAvC[0]-26.*dAvC[1]+24.*dAvC[2]-11.*dAvC[3]+2.*dAvC[4]);
1983 cumulant[4] = (120./pow(fR0,10.))*(5.*dAvC[0]-10.*dAvC[1]+10.*dAvC[2]-5.*dAvC[3]+1.*dAvC[4]);
1986 // Remark: the highest order cumulant is on purpose in the overflow.
1987 for(Int_t co=0;co<pMax;co++) // cumulant order
1989 fReferenceFlowCumulants->SetBinContent(co+1,cumulant[co]);
1992 } // end of void AliFlowAnalysisWithCumulants::CalculateCumulantsForReferenceFlow()
1994 //================================================================================================================
1996 void AliFlowAnalysisWithCumulants::GetAvMultAndNoOfEvts()
1998 // From relevant common control histogram get average multiplicity of RPs and number of events.
2000 fAvM = (Double_t)fCommonHists->GetHistMultRP()->GetMean();
2001 fnEvts = (Int_t)fCommonHists->GetHistMultRP()->GetEntries();
2003 } // end of void AliFlowAnalysisWithCumulants::GetAvMultAndNoOfEvts()
2005 //================================================================================================================
2007 void AliFlowAnalysisWithCumulants::InitializeArrays()
2009 // Initialize all arrays.
2011 for(Int_t ri=0;ri<2;ri++)
2013 for(Int_t rp=0;rp<2;rp++)
2015 for(Int_t pe=0;pe<2;pe++)
2017 fDiffFlowGenFun[ri][rp][pe] = NULL;
2021 for(Int_t rp=0;rp<2;rp++)
2023 for(Int_t pe=0;pe<2;pe++)
2025 fNoOfParticlesInBin[rp][pe] = NULL;
2028 for(Int_t rp=0;rp<2;rp++)
2030 for(Int_t pe=0;pe<2;pe++)
2032 for(Int_t co=0;co<4;co++)
2034 fDiffFlowCumulants[rp][pe][co] = NULL;
2035 fDiffFlow[rp][pe][co] = NULL;
2039 for(Int_t i=0;i<3;i++)
2041 fPrintFinalResults[i] = kTRUE;
2043 for(Int_t r=0;r<10;r++)
2046 for(Int_t pq=0;pq<5;pq++)
2048 fTuningGenFun[r][pq] = NULL;
2049 fTuningCumulants[r][pq] = NULL;
2050 fTuningFlow[r][pq] = NULL;
2054 } // end of void AliFlowAnalysisWithCumulants::InitializeArrays()
2056 //================================================================================================================
2058 void AliFlowAnalysisWithCumulants::CrossCheckSettings()
2060 // Cross-check the user settings before starting.
2062 // a) Cross check if the choice for multiplicity weight make sense.
2064 // a) Cross check if the choice for multiplicity weight make sense:
2065 if(strcmp(fMultiplicityWeight->Data(),"unit") &&
2066 strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2069 cout<<"WARNING (GFC): Multiplicity weight can be either \"unit\" or \"multiplicity\"."<<endl;
2070 cout<<" Certainly not \""<<fMultiplicityWeight->Data()<<"\"."<<endl;
2077 } // end of void AliFlowAnalysisWithCumulants::CrossCheckSettings()
2079 //================================================================================================================
2081 void AliFlowAnalysisWithCumulants::AccessConstants()
2083 // Access needed common constants from AliFlowCommonConstants.
2085 fnBinsPhi = AliFlowCommonConstants::GetMaster()->GetNbinsPhi();
2086 fPhiMin = AliFlowCommonConstants::GetMaster()->GetPhiMin();
2087 fPhiMax = AliFlowCommonConstants::GetMaster()->GetPhiMax();
2088 if(fnBinsPhi) fPhiBinWidth = (fPhiMax-fPhiMin)/fnBinsPhi;
2089 fnBinsPt = AliFlowCommonConstants::GetMaster()->GetNbinsPt();
2090 fPtMin = AliFlowCommonConstants::GetMaster()->GetPtMin();
2091 fPtMax = AliFlowCommonConstants::GetMaster()->GetPtMax();
2092 if(fnBinsPt) fPtBinWidth = (fPtMax-fPtMin)/fnBinsPt;
2093 fnBinsEta = AliFlowCommonConstants::GetMaster()->GetNbinsEta();
2094 fEtaMin = AliFlowCommonConstants::GetMaster()->GetEtaMin();
2095 fEtaMax = AliFlowCommonConstants::GetMaster()->GetEtaMax();
2096 if(fnBinsEta) fEtaBinWidth = (fEtaMax-fEtaMin)/fnBinsEta;
2098 } // end of void AliFlowAnalysisWithCumulants::AccessConstants()
2100 //================================================================================================================
2102 void AliFlowAnalysisWithCumulants::BookAndFillWeightsHistograms()
2104 // book and fill histograms which hold phi, pt and eta weights
2108 cout<<"WARNING (GFC): fWeightsList is NULL in AFAWGFC::BAFWH() !!!!"<<endl;
2112 TString fUseParticleWeightsName = "fUseParticleWeights";
2113 fUseParticleWeights = new TProfile(fUseParticleWeightsName.Data(),"0 = particle weight not used, 1 = particle weight used ",3,0,3);
2114 fUseParticleWeights->SetLabelSize(0.06);
2115 (fUseParticleWeights->GetXaxis())->SetBinLabel(1,"w_{#phi}");
2116 (fUseParticleWeights->GetXaxis())->SetBinLabel(2,"w_{p_{T}}");
2117 (fUseParticleWeights->GetXaxis())->SetBinLabel(3,"w_{#eta}");
2118 fUseParticleWeights->Fill(0.5,(Int_t)fUsePhiWeights);
2119 fUseParticleWeights->Fill(1.5,(Int_t)fUsePtWeights);
2120 fUseParticleWeights->Fill(2.5,(Int_t)fUseEtaWeights);
2121 fWeightsList->Add(fUseParticleWeights);
2124 if(fWeightsList->FindObject("phi_weights"))
2126 fPhiWeights = dynamic_cast<TH1F*>(fWeightsList->FindObject("phi_weights"));
2127 if(TMath::Abs(fPhiWeights->GetBinWidth(1)-fPhiBinWidth)>pow(10.,-6.))
2130 cout<<"WARNING (GFC): Inconsistent binning in histograms for phi-weights throughout the code."<<endl;
2137 cout<<"WARNING (GFC): fWeightsList->FindObject(\"phi_weights\") is NULL in AFAWGFC::BAFWH() !!!!"<<endl;
2141 } // end of if(fUsePhiWeights)
2145 if(fWeightsList->FindObject("pt_weights"))
2147 fPtWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("pt_weights"));
2148 if(TMath::Abs(fPtWeights->GetBinWidth(1)-fPtBinWidth)>pow(10.,-6.))
2151 cout<<"WARNING (GFC): Inconsistent binning in histograms for pt-weights throughout the code."<<endl;
2158 cout<<"WARNING (GFC): fWeightsList->FindObject(\"pt_weights\") is NULL in AFAWGFC::BAFWH() !!!!"<<endl;
2162 } // end of if(fUsePtWeights)
2166 if(fWeightsList->FindObject("eta_weights"))
2168 fEtaWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("eta_weights"));
2169 if(TMath::Abs(fEtaWeights->GetBinWidth(1)-fEtaBinWidth)>pow(10.,-6.))
2172 cout<<"WARNING (GFC): Inconsistent binning in histograms for eta-weights throughout the code."<<endl;
2179 cout<<"WARNING (GFC): fUseEtaWeights && fWeightsList->FindObject(\"eta_weights\") is NULL in AFAWGFC::BAFWH() !!!!"<<endl;
2183 } // end of if(fUseEtaWeights)
2185 } // end of AliFlowAnalysisWithCumulants::BookAndFillWeightsHistograms()
2187 //================================================================================================================
2189 void AliFlowAnalysisWithCumulants::BookEverythingForReferenceFlow()
2191 // Book all objects relevant for calculation of reference flow.
2193 // a) Define static constants for array's boundaries;
2194 // b) Book profile to hold all flags for reference flow;
2195 // c) Book all event-by-event quantities;
2196 // d) Book all profiles;
2197 // e) Book all histograms.
2199 // a) Define static constants for array's boundaries:
2200 static const Int_t pMax = 5;
2201 static const Int_t qMax = 11;
2203 // b) Book profile to hold all flags for reference flow:
2204 TString referenceFlowFlagsName = "fReferenceFlowFlags";
2205 fReferenceFlowFlags = new TProfile(referenceFlowFlagsName.Data(),"Flags for Reference Flow",2,0,2);
2206 fReferenceFlowFlags->SetTickLength(-0.01,"Y");
2207 fReferenceFlowFlags->SetMarkerStyle(25);
2208 fReferenceFlowFlags->SetLabelSize(0.05);
2209 fReferenceFlowFlags->SetLabelOffset(0.02,"Y");
2210 fReferenceFlowFlags->GetXaxis()->SetBinLabel(1,"Particle weights");
2211 fReferenceFlowFlags->GetXaxis()->SetBinLabel(2,"Event weights");
2212 fReferenceFlowList->Add(fReferenceFlowFlags);
2214 // c) Book all event-by-event quantities:
2215 fGEBE = new TMatrixD(pMax,qMax);
2217 // d) Book all profiles:
2218 // Average of the generating function for reference flow <G[p][q]>:
2219 fReferenceFlowGenFun = new TProfile2D("fReferenceFlowGenFun","#LTG[p][q]#GT",pMax,0.,(Double_t)pMax,qMax,0.,(Double_t)qMax);
2220 fReferenceFlowGenFun->SetXTitle("p");
2221 fReferenceFlowGenFun->SetYTitle("q");
2222 fReferenceFlowProfiles->Add(fReferenceFlowGenFun);
2223 // Averages of Q-vector components:
2224 fQvectorComponents = new TProfile("fQvectorComponents","Averages of Q-vector components",4,0.,4.);
2225 fQvectorComponents->SetLabelSize(0.06);
2226 fQvectorComponents->SetMarkerStyle(25);
2227 fQvectorComponents->GetXaxis()->SetBinLabel(1,"#LTQ_{x}#GT"); // Q_{x}
2228 fQvectorComponents->GetXaxis()->SetBinLabel(2,"#LTQ_{y}#GT"); // Q_{y}
2229 fQvectorComponents->GetXaxis()->SetBinLabel(3,"#LTQ_{x}^{2}#GT"); // Q_{x}^{2}
2230 fQvectorComponents->GetXaxis()->SetBinLabel(4,"#LTQ_{y}^{2}#GT"); // Q_{y}^{2}
2231 fReferenceFlowProfiles->Add(fQvectorComponents);
2232 // <<w^2>>, where w = wPhi*wPt*wEta:
2233 fAverageOfSquaredWeight = new TProfile("fAverageOfSquaredWeight","#LT#LTw^{2}#GT#GT",1,0,1);
2234 fAverageOfSquaredWeight->SetLabelSize(0.06);
2235 fAverageOfSquaredWeight->SetMarkerStyle(25);
2236 fAverageOfSquaredWeight->SetLabelOffset(0.01);
2237 fAverageOfSquaredWeight->GetXaxis()->SetBinLabel(1,"#LT#LTw^{2}#GT#GT");
2238 fReferenceFlowProfiles->Add(fAverageOfSquaredWeight);
2240 // e) Book all histograms:
2241 // Final results for isotropic cumulants for reference flow:
2242 TString referenceFlowCumulantsName = "fReferenceFlowCumulants";
2243 fReferenceFlowCumulants = new TH1D(referenceFlowCumulantsName.Data(),"Isotropic Generating Function Cumulants for reference flow",4,0,4); // to be improved (hw 4)
2244 fReferenceFlowCumulants->SetLabelSize(0.05);
2245 fReferenceFlowCumulants->SetMarkerStyle(25);
2246 fReferenceFlowCumulants->GetXaxis()->SetBinLabel(1,"GFC{2}");
2247 fReferenceFlowCumulants->GetXaxis()->SetBinLabel(2,"GFC{4}");
2248 fReferenceFlowCumulants->GetXaxis()->SetBinLabel(3,"GFC{6}");
2249 fReferenceFlowCumulants->GetXaxis()->SetBinLabel(4,"GFC{8}");
2250 fReferenceFlowResults->Add(fReferenceFlowCumulants);
2251 // Final results for reference flow:
2252 fReferenceFlow = new TH1D("fReferenceFlow","Reference flow",4,0,4); // to be improved (hardwired 4)
2253 fReferenceFlow->SetLabelSize(0.06);
2254 fReferenceFlow->SetMarkerStyle(25);
2255 fReferenceFlow->GetXaxis()->SetBinLabel(1,"v_{n}{2,GFC}");
2256 fReferenceFlow->GetXaxis()->SetBinLabel(2,"v_{n}{4,GFC}");
2257 fReferenceFlow->GetXaxis()->SetBinLabel(3,"v_{n}{6,GFC}");
2258 fReferenceFlow->GetXaxis()->SetBinLabel(4,"v_{n}{8,GFC}");
2259 fReferenceFlowResults->Add(fReferenceFlow);
2260 // Final results for resolution:
2261 fChi = new TH1D("fChi","Resolution",4,0,4); // to be improved (hardwired 4)
2262 fChi->SetLabelSize(0.06);
2263 fChi->SetMarkerStyle(25);
2264 fChi->GetXaxis()->SetBinLabel(1,"#chi_{2}");
2265 fChi->GetXaxis()->SetBinLabel(2,"#chi_{4}");
2266 fChi->GetXaxis()->SetBinLabel(3,"#chi_{6}");
2267 fChi->GetXaxis()->SetBinLabel(4,"#chi_{8}");
2268 fReferenceFlowResults->Add(fChi);
2270 } // end of void AliFlowAnalysisWithCumulants::BookEverythingForReferenceFlow()
2272 //================================================================================================================
2274 void AliFlowAnalysisWithCumulants::BookEverythingForTuning()
2276 // Book all objects relevant for tuning.
2278 // a) Define pMax's and qMax's:
2279 // b) Book profile to hold all tuning parameters and flags;
2280 // c) Book all profiles;
2281 // d) Book all histograms.
2283 // a) Define pMax's and qMax's:
2284 Int_t pMax[5] = {2,3,4,5,8};
2285 Int_t qMax[5] = {5,7,9,11,17};
2287 // b) Book profile to hold all tuning parameters and flags:
2288 TString tuningFlagsName = "fTuningFlags";
2289 fTuningFlags = new TProfile(tuningFlagsName.Data(),"Tuning parameters",10,0,10);
2290 // fTuningFlags->SetTickLength(-0.01,"Y");
2291 fTuningFlags->SetMarkerStyle(25);
2292 fTuningFlags->SetLabelSize(0.05);
2293 fTuningFlags->SetLabelOffset(0.02,"X");
2294 for(Int_t r=1;r<=10;r++)
2296 fTuningFlags->GetXaxis()->SetBinLabel(r,Form("r_{0,%d}",r-1));
2297 fTuningFlags->Fill(r-0.5,fTuningR0[r-1],1.);
2299 fTuningList->Add(fTuningFlags);
2301 // c) Book all profiles:
2302 // Average of the generating function for reference flow <G[p][q]> for different tuning parameters:
2303 for(Int_t r=0;r<10;r++)
2305 for(Int_t pq=0;pq<5;pq++)
2307 fTuningGenFun[r][pq] = new TProfile2D(Form("fTuningGenFun (r_{0,%i}, pq set %i)",r,pq),
2308 Form("#LTG[p][q]#GT for r_{0} = %f, p_{max} = %i, q_{max} = %i",fTuningR0[r],pMax[pq],qMax[pq]),
2309 pMax[pq],0.,(Double_t)pMax[pq],qMax[pq],0.,(Double_t)qMax[pq]);
2310 fTuningGenFun[r][pq]->SetXTitle("p");
2311 fTuningGenFun[r][pq]->SetYTitle("q");
2312 fTuningProfiles->Add(fTuningGenFun[r][pq]);
2316 // d) Book all histograms:
2317 // Final results for isotropic cumulants for reference flow for different tuning parameters:
2318 for(Int_t r=0;r<10;r++)
2320 for(Int_t pq=0;pq<5;pq++)
2322 fTuningCumulants[r][pq] = new TH1D(Form("fTuningCumulants (r_{0,%i}, pq set %i)",r,pq),
2323 Form("GFC for r_{0} = %f, p_{max} = %i, q_{max} = %i",fTuningR0[r],pMax[pq],qMax[pq]),
2324 pMax[pq],0,pMax[pq]);
2325 // fTuningCumulants[r][pq]->SetLabelSize(0.05);
2326 fTuningCumulants[r][pq]->SetMarkerStyle(25);
2327 for(Int_t b=1;b<=pMax[pq];b++)
2329 fTuningCumulants[r][pq]->GetXaxis()->SetBinLabel(b,Form("GFC{%i}",2*b));
2331 fTuningResults->Add(fTuningCumulants[r][pq]);
2334 // Final results for reference flow for different tuning parameters:
2335 for(Int_t r=0;r<10;r++)
2337 for(Int_t pq=0;pq<5;pq++)
2339 fTuningFlow[r][pq] = new TH1D(Form("fTuningFlow (r_{0,%i}, pq set %i)",r,pq),
2340 Form("Reference flow for r_{0} = %f, p_{max} = %i, q_{max} = %i",fTuningR0[r],pMax[pq],qMax[pq]),
2341 pMax[pq],0,pMax[pq]);
2342 // fTuningFlow[r][pq]->SetLabelSize(0.06);
2343 fTuningFlow[r][pq]->SetMarkerStyle(25);
2344 for(Int_t b=1;b<=pMax[pq];b++)
2346 fTuningFlow[r][pq]->GetXaxis()->SetBinLabel(b,Form("v{%i,GFC}",2*b));
2348 fTuningResults->Add(fTuningFlow[r][pq]);
2352 } // end of void AliFlowAnalysisWithCumulants::BookEverythingForTuning()
2354 //================================================================================================================
2356 void AliFlowAnalysisWithCumulants::BookEverythingForDiffFlow()
2358 // Book all objects relevant for calculation of differential flow.
2360 // a) Define static constants for array's boundaries;
2361 // b) Define local variables and local flags for booking;
2362 // c) Book profile to hold all flags for differential flow;
2363 // d) Book all event-by-event quantities;
2364 // e) Book all profiles;
2365 // f) Book all histograms.
2367 // a) Define static constants for array's boundaries:
2368 static const Int_t pMax = 5;
2369 static const Int_t qMax = 11;
2371 // b) Define local variables and local flags for booking:
2372 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
2373 Double_t minPtEta[2] = {fPtMin,fEtaMin};
2374 Double_t maxPtEta[2] = {fPtMax,fEtaMax};
2375 TString reIm[2] = {"Re","Im"};
2376 TString rpPoi[2] = {"RP","POI"};
2377 TString ptEta[2] = {"p_{t}","#eta"};
2378 TString order[4] = {"2nd order","4th order","6th order","8th order"};
2380 // c) Book profile to hold all flags for differential flow:
2381 TString diffFlowFlagsName = "fDiffFlowFlags";
2382 fDiffFlowFlags = new TProfile(diffFlowFlagsName.Data(),"Flags for Differential Flow",1,0,1);
2383 fDiffFlowFlags->SetTickLength(-0.01,"Y");
2384 fDiffFlowFlags->SetMarkerStyle(25);
2385 fDiffFlowFlags->SetLabelSize(0.05);
2386 fDiffFlowFlags->SetLabelOffset(0.02,"Y");
2387 fDiffFlowFlags->GetXaxis()->SetBinLabel(1,"...");
2388 fDiffFlowList->Add(fDiffFlowFlags);
2390 // d) Book all event-by-event quantities:
2391 // ... (to be improved - perhaps not needed)
2393 // e) Book all profiles:
2394 // Generating functions for differential flow:
2395 for(Int_t ri=0;ri<2;ri++)
2397 for(Int_t rp=0;rp<2;rp++)
2399 for(Int_t pe=0;pe<2;pe++)
2401 fDiffFlowGenFun[ri][rp][pe] = new TProfile3D(Form("fDiffFlowGenFun (%s, %s, %s)",reIm[ri].Data(),rpPoi[rp].Data(),ptEta[pe].Data()),
2402 Form("#LT%s[D[%s-bin][p][q]]#GT for %ss",reIm[ri].Data(),ptEta[pe].Data(),rpPoi[rp].Data()),
2403 nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe],pMax,0.,(Double_t)pMax,qMax,0.,(Double_t)qMax);
2404 fDiffFlowGenFun[ri][rp][pe]->SetXTitle(ptEta[pe].Data());
2405 fDiffFlowGenFun[ri][rp][pe]->SetYTitle("p");
2406 fDiffFlowGenFun[ri][rp][pe]->SetZTitle("q");
2407 fDiffFlowGenFun[ri][rp][pe]->SetTitleOffset(1.44,"X");
2408 fDiffFlowGenFun[ri][rp][pe]->SetTitleOffset(1.44,"Y");
2409 fDiffFlowProfiles->Add(fDiffFlowGenFun[ri][rp][pe]);
2410 // to be improved - alternative // nBinsPtEta[pe],(Double_t)(fPtMin/fPtBinWidth),(Double_t)(fPtMax/fPtBinWidth),pMax,0.,(Double_t)pMax,qMax,0.,(Double_t)qMax);
2414 // Number of particles in pt/eta bin for RPs/POIs:
2415 for(Int_t rp=0;rp<2;rp++)
2417 for(Int_t pe=0;pe<2;pe++)
2419 fNoOfParticlesInBin[rp][pe] = new TProfile(Form("fNoOfParticlesInBin (%s, %s)",rpPoi[rp].Data(),ptEta[pe].Data()),
2420 Form("Number of %ss per %s bin",rpPoi[rp].Data(),ptEta[pe].Data()),
2421 nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
2422 fNoOfParticlesInBin[rp][pe]->SetXTitle(ptEta[pe].Data());
2423 fDiffFlowProfiles->Add(fNoOfParticlesInBin[rp][pe]);
2426 // Differential cumulants per pt/eta bin for RPs/POIs:
2427 for(Int_t rp=0;rp<2;rp++)
2429 for(Int_t pe=0;pe<2;pe++)
2431 for(Int_t co=0;co<4;co++)
2433 fDiffFlowCumulants[rp][pe][co] = new TH1D(Form("fDiffFlowCumulants (%s, %s, %s)",rpPoi[rp].Data(),ptEta[pe].Data(),order[co].Data()),
2434 Form("Differential %s cumulant for %ss vs %s",order[co].Data(),rpPoi[rp].Data(),ptEta[pe].Data()),
2435 nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
2436 fDiffFlowCumulants[rp][pe][co]->SetXTitle(ptEta[pe].Data());
2437 fDiffFlowResults->Add(fDiffFlowCumulants[rp][pe][co]);
2441 // Differential flow per pt/eta bin for RPs/POIs:
2442 for(Int_t rp=0;rp<2;rp++)
2444 for(Int_t pe=0;pe<2;pe++)
2446 for(Int_t co=0;co<4;co++)
2448 fDiffFlow[rp][pe][co] = new TH1D(Form("fDiffFlow (%s, %s, %s)",rpPoi[rp].Data(),ptEta[pe].Data(),order[co].Data()),
2449 Form("Differential flow from %s cumulant for %ss vs %s",order[co].Data(),rpPoi[rp].Data(),ptEta[pe].Data()),
2450 nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
2451 fDiffFlow[rp][pe][co]->SetXTitle(ptEta[pe].Data());
2452 fDiffFlowResults->Add(fDiffFlow[rp][pe][co]);
2457 }// end of void AliFlowAnalysisWithCumulants::BookEverythingForDiffFlow()
2459 //================================================================================================================
2461 void AliFlowAnalysisWithCumulants::StoreReferenceFlowFlags()
2463 // Store all flags for reference flow in profile fReferenceFlowFlags.
2465 if(!fReferenceFlowFlags)
2468 cout<<"WARNING: !fReferenceFlowFlags is NULL in AFAWC::SRFF() !!!!"<<endl;
2473 // Particle weights used or not:
2474 fReferenceFlowFlags->Fill(0.5,(Double_t)fUsePhiWeights||fUsePtWeights||fUseEtaWeights);
2475 // Which event weight was used to weight generating function event-by-event:
2476 if(strcmp(fMultiplicityWeight->Data(),"unit"))
2478 fReferenceFlowFlags->Fill(1.5,0.); // 0 = "unit" (default)
2479 } else if(strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2481 fReferenceFlowFlags->Fill(1.5,1.); // 1 = "multiplicity"
2484 } // end of void AliFlowAnalysisWithCumulants::StoreReferenceFlowFlags()
2486 //================================================================================================================
2488 void AliFlowAnalysisWithCumulants::StoreDiffFlowFlags()
2490 // Store all flags for differential flow in profile fDiffFlowFlags.
2495 cout<<"WARNING: !fDiffFlowFlags is NULL in AFAWC::SRFF() !!!!"<<endl;
2500 // fDiffFlags->Fill(0.5,(Double_t) ... );
2502 } // end of void AliFlowAnalysisWithCumulants::StoreDiffFlowFlags()
2504 //================================================================================================================
2506 void AliFlowAnalysisWithCumulants::BookAndNestAllLists()
2508 // Book and nest all list in base list fHistList.
2510 // a) Book and nest lists for reference flow;
2511 // b) Book and nest lists for differential flow;
2512 // c) Book and nest lists for tuning.
2514 // a) Book and nest all lists for reference flow:
2515 fReferenceFlowList = new TList();
2516 fReferenceFlowList->SetName("Reference Flow");
2517 fReferenceFlowList->SetOwner(kTRUE);
2518 fHistList->Add(fReferenceFlowList);
2519 fReferenceFlowProfiles = new TList();
2520 fReferenceFlowProfiles->SetName("Profiles");
2521 fReferenceFlowProfiles->SetOwner(kTRUE);
2522 fReferenceFlowList->Add(fReferenceFlowProfiles);
2523 fReferenceFlowResults = new TList();
2524 fReferenceFlowResults->SetName("Results");
2525 fReferenceFlowResults->SetOwner(kTRUE);
2526 fReferenceFlowList->Add(fReferenceFlowResults);
2527 // b) Book and nest lists for differential flow:
2528 fDiffFlowList = new TList();
2529 fDiffFlowList->SetName("Differential Flow");
2530 fDiffFlowList->SetOwner(kTRUE);
2531 fHistList->Add(fDiffFlowList);
2532 fDiffFlowProfiles = new TList();
2533 fDiffFlowProfiles->SetName("Profiles");
2534 fDiffFlowProfiles->SetOwner(kTRUE);
2535 fDiffFlowList->Add(fDiffFlowProfiles);
2536 fDiffFlowResults = new TList();
2537 fDiffFlowResults->SetName("Results");
2538 fDiffFlowResults->SetOwner(kTRUE);
2539 fDiffFlowList->Add(fDiffFlowResults);
2540 // c) Book and nest lists for tuning:
2543 fTuningList = new TList();
2544 fTuningList->SetName("Tuning");
2545 fTuningList->SetOwner(kTRUE);
2546 fHistList->Add(fTuningList);
2547 fTuningProfiles = new TList();
2548 fTuningProfiles->SetName("Profiles");
2549 fTuningProfiles->SetOwner(kTRUE);
2550 fTuningList->Add(fTuningProfiles);
2551 fTuningResults = new TList();
2552 fTuningResults->SetName("Results");
2553 fTuningResults->SetOwner(kTRUE);
2554 fTuningList->Add(fTuningResults);
2557 } // end of void AliFlowAnalysisWithCumulants::BookAndNestAllLists()
2559 //================================================================================================================
2561 void AliFlowAnalysisWithCumulants::BookProfileHoldingSettings()
2563 // Book profile to hold all analysis settings.
2565 TString analysisSettingsName = "fAnalysisSettings";
2566 fAnalysisSettings = new TProfile(analysisSettingsName.Data(),"Settings for analysis with Generating Function Cumulants",6,0.,6.);
2567 fAnalysisSettings->GetXaxis()->SetLabelSize(0.035);
2568 fAnalysisSettings->GetXaxis()->SetBinLabel(1,"Harmonic");
2569 fAnalysisSettings->Fill(0.5,fHarmonic);
2570 fAnalysisSettings->GetXaxis()->SetBinLabel(2,"Multiple");
2571 fAnalysisSettings->Fill(1.5,fMultiple);
2572 fAnalysisSettings->GetXaxis()->SetBinLabel(3,"r_{0}");
2573 fAnalysisSettings->Fill(2.5,fR0);
2574 fAnalysisSettings->GetXaxis()->SetBinLabel(4,"Print RF results");
2575 fAnalysisSettings->Fill(3.5,fPrintFinalResults[0]);
2576 fAnalysisSettings->GetXaxis()->SetBinLabel(5,"Print RP results");
2577 fAnalysisSettings->Fill(4.5,fPrintFinalResults[1]);
2578 fAnalysisSettings->GetXaxis()->SetBinLabel(6,"Print POI results");
2579 fAnalysisSettings->Fill(5.5,fPrintFinalResults[2]);
2580 fHistList->Add(fAnalysisSettings);
2582 } // end of void AliFlowAnalysisWithCumulants::BookProfileHoldingSettings()
2584 //================================================================================================================
2586 void AliFlowAnalysisWithCumulants::BookCommonHistograms()
2588 // Book common control histograms and common histograms for final results.
2590 // Common control histogram:
2591 TString commonHistsName = "AliFlowCommonHistGFC";
2592 fCommonHists = new AliFlowCommonHist(commonHistsName.Data());
2593 fHistList->Add(fCommonHists);
2594 // Common histograms for final results from 2nd order GFC:
2595 TString commonHistResults2ndOrderName = "AliFlowCommonHistResults2ndOrderGFC";
2596 fCommonHistsResults2nd = new AliFlowCommonHistResults(commonHistResults2ndOrderName.Data());
2597 fHistList->Add(fCommonHistsResults2nd);
2598 // Common histograms for final results from 4th order GFC:
2599 TString commonHistResults4thOrderName = "AliFlowCommonHistResults4thOrderGFC";
2600 fCommonHistsResults4th = new AliFlowCommonHistResults(commonHistResults4thOrderName.Data());
2601 fHistList->Add(fCommonHistsResults4th);
2602 // Common histograms for final results from 6th order GFC:
2603 TString commonHistResults6thOrderName = "AliFlowCommonHistResults6thOrderGFC";
2604 fCommonHistsResults6th = new AliFlowCommonHistResults(commonHistResults6thOrderName.Data());
2605 fHistList->Add(fCommonHistsResults6th);
2606 // Common histograms for final results from 8th order GFC:
2607 TString commonHistResults8thOrderName = "AliFlowCommonHistResults8thOrderGFC";
2608 fCommonHistsResults8th = new AliFlowCommonHistResults(commonHistResults8thOrderName.Data());
2609 fHistList->Add(fCommonHistsResults8th);
2611 } // end of void AliFlowAnalysisWithCumulants::BookCommonHistograms()
2613 //================================================================================================================
2615 void AliFlowAnalysisWithCumulants::CheckPointersUsedInMake()
2617 // Check pointers used in method Make().
2622 cout<<" WARNING (GFC): !fCommonHists is NULL in CPUIM() !!!!"<<endl;
2626 if(fUsePhiWeights && !fPhiWeights)
2629 cout<<" WARNING (GFC): !fPhiWeights is NULL in CPUIM() !!!!"<<endl;
2633 if(fUsePtWeights && !fPtWeights)
2636 cout<<" WARNING (GFC): !fPtWeights is NULL in CPUIM() !!!!"<<endl;
2640 if(fUseEtaWeights && !fEtaWeights)
2643 cout<<" WARNING (GFC): !fEtaWeights is NULL in CPUIM() !!!!"<<endl;
2647 if(!fAverageOfSquaredWeight)
2650 cout<<" WARNING (GFC): !fAverageOfSquaredWeight is NULL in CPUIM() !!!!"<<endl;
2654 if(!fReferenceFlowGenFun)
2657 cout<<" WARNING (GFC): !fReferenceFlowGenFun is NULL in CPUIM() !!!!"<<endl;
2661 if(!fQvectorComponents)
2664 cout<<" WARNING (GFC): !fQvectorComponents is NULL in CPUIM() !!!!"<<endl;
2671 cout<<"WARNING (GFC): !fGEBE is NULL in CPUIM() !!!!"<<endl;
2676 } // end of void AliFlowAnalysisWithCumulants::CheckPointersUsedInMake()
2678 //================================================================================================================
2680 void AliFlowAnalysisWithCumulants::CheckPointersUsedInFinish()
2682 // Check pointers used in method Finish().
2684 if(!fAnalysisSettings)
2687 cout<<" WARNING (GFC): fAnalysisSettings is NULL in CPUIF() !!!!"<<endl;
2691 if(!(fCommonHists && fCommonHists->GetHistMultRP()))
2694 cout<<" WARNING (GFC): (fCommonHists && fCommonHists->GetHistMultRP) is NULL in CPUIF() !!!!"<<endl;
2698 if(!fReferenceFlowGenFun)
2701 cout<<" WARNING (GFC): fReferenceFlowGenFun is NULL in CPUIF() !!!!"<<endl;
2705 if(!fReferenceFlowCumulants)
2708 cout<<" WARNING (GFC): fReferenceFlowCumulants is NULL in CPUIF() !!!!"<<endl;
2712 if(!fQvectorComponents)
2715 cout<<" WARNING (GFC): fQvectorComponents is NULL in CPUIF() !!!!"<<endl;
2719 if(!fAverageOfSquaredWeight)
2722 cout<<" WARNING (GFC): fAverageOfSquaredWeight is NULL in CPUIF() !!!!"<<endl;
2726 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
2729 cout<<" WARNING (GFC): fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && "<<endl;
2730 cout<<" fCommonHistsResults8th is NULL in CPUIF() !!!!"<<endl;
2737 cout<<" WARNING (GFC): fReferenceFlow is NULL in CPUIF() !!!!"<<endl;
2744 cout<<" WARNING (GFC): fChi is NULL in CPUIF() !!!!"<<endl;
2748 for(Int_t ri=0;ri<2;ri++)
2750 for(Int_t rp=0;rp<2;rp++)
2752 for(Int_t pe=0;pe<2;pe++)
2754 if(!fDiffFlowGenFun[ri][rp][pe])
2757 cout<<" WARNING (GFC): "<<Form("fDiffFlowGenFun[%d][%d][%d]",ri,rp,pe)<<" is NULL in CPUIF() !!!!"<<endl;
2764 for(Int_t rp=0;rp<2;rp++)
2766 for(Int_t pe=0;pe<2;pe++)
2768 for(Int_t co=0;co<4;co++)
2770 if(!fDiffFlowCumulants[rp][pe][co])
2773 cout<<" WARNING (GFC): "<<Form("fDiffFlowCumulants[%d][%d][%d]",rp,pe,co)<<" is NULL in CPUIF() !!!!"<<endl;
2777 if(!fDiffFlow[rp][pe][co])
2780 cout<<" WARNING (GFC): "<<Form("fDiffFlow[%d][%d][%d]",rp,pe,co)<<" is NULL in CPUIF() !!!!"<<endl;
2787 for(Int_t rp=0;rp<2;rp++)
2789 for(Int_t pe=0;pe<2;pe++)
2791 if(!fNoOfParticlesInBin[rp][pe])
2794 cout<<" WARNING (GFC): "<<Form("fNoOfParticlesInBin[%d][%d]",rp,pe)<<" is NULL in CPUIF() !!!!"<<endl;
2801 } // end of void AliFlowAnalysisWithCumulants::CheckPointersUsedInFinish()
2803 //================================================================================================================
2805 void AliFlowAnalysisWithCumulants::AccessSettings()
2807 // Access the settings for analysis with Generating Function Cumulants.
2809 fHarmonic = (Int_t)fAnalysisSettings->GetBinContent(1);
2810 fMultiple = (Int_t)fAnalysisSettings->GetBinContent(2);
2811 fR0 = (Double_t)fAnalysisSettings->GetBinContent(3);
2812 fPrintFinalResults[0] = (Bool_t)fAnalysisSettings->GetBinContent(4);
2813 fPrintFinalResults[1] = (Bool_t)fAnalysisSettings->GetBinContent(5);
2814 fPrintFinalResults[2] = (Bool_t)fAnalysisSettings->GetBinContent(6);
2816 } // end of AliFlowAnalysisWithCumulants::AccessSettings()
2818 //================================================================================================================
2820 void AliFlowAnalysisWithCumulants::WriteHistograms(TString* outputFileName)
2822 // Store the final results in output .root file.
2824 TFile *output = new TFile(outputFileName->Data(),"RECREATE");
2825 //output->WriteObject(fHistList, "cobjGFC","SingleKey");
2826 fHistList->SetName("cobjGFC");
2827 fHistList->SetOwner(kTRUE);
2828 fHistList->Write(fHistList->GetName(), TObject::kSingleKey);
2831 } // end of void AliFlowAnalysisWithCumulants::WriteHistograms(TString* outputFileName)
2833 //================================================================================================================
2835 void AliFlowAnalysisWithCumulants::WriteHistograms(TString outputFileName)
2837 // Store the final results in output .root file.
2839 TFile *output = new TFile(outputFileName.Data(),"RECREATE");
2840 //output->WriteObject(fHistList, "cobjGFC","SingleKey");
2841 fHistList->SetName("cobjGFC");
2842 fHistList->SetOwner(kTRUE);
2843 fHistList->Write(fHistList->GetName(), TObject::kSingleKey);
2846 } // end of void AliFlowAnalysisWithCumulants::WriteHistograms(TString outputFileName)
2848 //================================================================================================================
2850 void AliFlowAnalysisWithCumulants::WriteHistograms(TDirectoryFile *outputFileName)
2852 // Store the final results in output .root file.
2854 fHistList->SetName("cobjGFC");
2855 fHistList->SetOwner(kTRUE);
2856 outputFileName->Add(fHistList);
2857 outputFileName->Write(outputFileName->GetName(), TObject::kSingleKey);
2859 } // end of void AliFlowAnalysisWithCumulants::WriteHistograms(TDirectoryFile *outputFileName)
2861 //================================================================================================================