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 //================================================================================================================
54 ClassImp(AliFlowAnalysisWithCumulants)
56 AliFlowAnalysisWithCumulants::AliFlowAnalysisWithCumulants():
59 fAnalysisSettings(NULL),
61 fCommonHistsResults2nd(NULL),
62 fCommonHistsResults4th(NULL),
63 fCommonHistsResults6th(NULL),
64 fCommonHistsResults8th(NULL),
81 fUsePhiWeights(kFALSE),
82 fUsePtWeights(kFALSE),
83 fUseEtaWeights(kFALSE),
87 fMultiplicityWeight(NULL),
88 fReferenceFlowList(NULL),
89 fReferenceFlowProfiles(NULL),
90 fReferenceFlowResults(NULL),
91 fReferenceFlowFlags(NULL),
92 fCalculateVsMultiplicity(kFALSE),
97 fReferenceFlowGenFun(NULL),
98 fQvectorComponents(NULL),
99 fAverageOfSquaredWeight(NULL),
100 fReferenceFlowGenFunVsM(NULL),
101 fQvectorComponentsVsM(NULL),
102 fAverageOfSquaredWeightVsM(NULL),
106 fReferenceFlowCumulants(NULL),
107 fReferenceFlow(NULL),
110 fDiffFlowProfiles(NULL),
111 fDiffFlowResults(NULL),
112 fDiffFlowFlags(NULL),
114 fTuningProfiles(NULL),
115 fTuningResults(NULL),
117 fTuneParameters(kFALSE),
122 // Base list to hold all output objects:
123 fHistList = new TList();
124 fHistListName = new TString("cobjGFC");
125 fHistList->SetName(fHistListName->Data());
126 fHistList->SetOwner(kTRUE);
128 // Multiplicity weight:
129 fMultiplicityWeight = new TString("unit");
131 // Initialize all arrays:
132 this->InitializeArrays();
134 } // end of AliFlowAnalysisWithCumulants::AliFlowAnalysisWithCumulants()
136 //================================================================================================================
138 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;
161 // j) Book all objects needed for calculation versus multiplicity.
163 //save old value and prevent histograms from being added to directory
164 //to avoid name clashes in case multiple analaysis objects are used
166 Bool_t oldHistAddStatus = TH1::AddDirectoryStatus();
167 TH1::AddDirectory(kFALSE);
169 this->CrossCheckSettings();
170 this->AccessConstants();
171 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights){this->BookAndFillWeightsHistograms();}
172 this->BookAndNestAllLists();
173 this->BookProfileHoldingSettings();
174 this->BookCommonHistograms();
175 this->BookEverythingForReferenceFlow();
176 this->BookEverythingForDiffFlow();
177 this->StoreReferenceFlowFlags();
178 this->StoreDiffFlowFlags();
179 if(fTuneParameters){this->BookEverythingForTuning();}
180 if(fCalculateVsMultiplicity){this->BookEverythingForCalculationVsMultiplicity();}
182 (fCommonHists->GetHarmonic())->Fill(0.5,fHarmonic); // to be improved (moved somewhere else?)
184 TH1::AddDirectory(oldHistAddStatus);
186 } // end of void AliFlowAnalysisWithCumulants::Init()
188 //================================================================================================================
190 void AliFlowAnalysisWithCumulants::Make(AliFlowEventSimple* anEvent)
192 // Running over data only in this method.
194 // a) Check all pointers used in this method;
195 // b) If tuning enabled, fill generating functions for different values of tuning parameters;
196 // c) For default values of tuning parameters (r0 = 2.2 and cutoff at 10th order):
197 // c1) Fill common control histograms;
198 // c2) Fill generating function for reference flow;
199 // c3) Fill profile holding average values of various Q-vector components;
200 // c4) Fill generating function for differential flow.
202 this->CheckPointersUsedInMake();
203 if(fTuneParameters) {this->FillGeneratingFunctionsForDifferentTuningParameters(anEvent);}
204 Int_t nRP = anEvent->GetEventNSelTracksRP(); // number of RPs (i.e. number of particles used to determine the reaction plane)
205 if(nRP<10) {return;} // generating function formalism make sense only for nRPs >= 10 for default settings
206 fCommonHists->FillControlHistograms(anEvent);
207 this->FillGeneratingFunctionForReferenceFlow(anEvent);
208 this->FillQvectorComponents(anEvent);
209 this->FillGeneratingFunctionForDiffFlow(anEvent);
211 } // end of void AliFlowAnalysisWithCumulants::Make()
213 //================================================================================================================
215 void AliFlowAnalysisWithCumulants::Finish()
217 // Calculate the final results.
219 // a) Check all pointers used in this method;
220 // b) Access all common constants;
221 // c) Access settings for analysis with Generating Function Cumulants;
222 // d) From relevant common control histogram get average multiplicity of RPs and number of events;
223 // e) Calculate cumulants for reference flow;
224 // f) Calculate from isotropic cumulants reference flow;
225 // g) Calculate error for reference flow estimates;
226 // h) Store the final results for reference flow in common hist results;
227 // i) Print on the screen the final results for reference flow;
228 // j) Calculate cumulants for differential flow;
229 // k) Calculate differential flow for RPs/POIs vs pt/eta from cumulants;
230 // l) Calculate integrated flow of RPs and POIs;
231 // m) Print on the screen the final results for integrated flow of RPs and POIs;
232 // n) If tuning enabled, calculate results for different tuning parameters.
234 this->CheckPointersUsedInFinish();
235 this->AccessConstants();
236 this->AccessSettings();
237 this->GetAvMultAndNoOfEvts();
238 this->CalculateCumulantsForReferenceFlow();
239 this->CalculateReferenceFlow();
240 this->CalculateReferenceFlowError();
241 this->FillCommonHistResultsForReferenceFlow();
242 if(fPrintFinalResults[0]){this->PrintFinalResults("RF");}
243 this->CalculateCumulantsForDiffFlow("RP","pt");
244 this->CalculateCumulantsForDiffFlow("RP","eta");
245 this->CalculateCumulantsForDiffFlow("POI","pt");
246 this->CalculateCumulantsForDiffFlow("POI","eta");
247 this->CalculateDifferentialFlow("RP","pt");
248 this->CalculateDifferentialFlow("RP","eta");
249 this->CalculateDifferentialFlow("POI","pt");
250 this->CalculateDifferentialFlow("POI","eta");
251 this->CalculateDifferentialFlowErrors("RP","pt");
252 this->CalculateDifferentialFlowErrors("RP","eta");
253 this->CalculateDifferentialFlowErrors("POI","pt");
254 this->CalculateDifferentialFlowErrors("POI","eta");
255 this->FillCommonHistResultsForDifferentialFlow("RP");
256 this->FillCommonHistResultsForDifferentialFlow("POI");
257 this->CalculateIntegratedFlow("RP");
258 this->CalculateIntegratedFlow("POI");
259 if(fPrintFinalResults[1]){this->PrintFinalResults("RP");}
260 if(fPrintFinalResults[2]){this->PrintFinalResults("POI");}
261 if(fTuneParameters){this->FinalizeTuning();}
263 } // end of void AliFlowAnalysisWithCumulants::Finish()
265 //================================================================================================================
267 void AliFlowAnalysisWithCumulants::FinalizeTuning()
269 // Finalize results with tuned inerpolating parameters.
271 for(Int_t r=0;r<10;r++)
273 if(TMath::Abs(fTuningR0[r])<1.e-10) continue; // protection against division by r0 bellow
274 for(Int_t pq=0;pq<5;pq++)
276 Int_t pMax = fTuningGenFun[r][pq]->GetXaxis()->GetNbins();
277 Int_t qMax = fTuningGenFun[r][pq]->GetYaxis()->GetNbins();
278 fAvM = fTuningAvM->GetBinContent(pq+1);
280 TMatrixD dAvG(pMax,qMax);
282 Bool_t someAvGEntryIsNegative = kFALSE;
283 for(Int_t p=0;p<pMax;p++)
285 for(Int_t q=0;q<qMax;q++)
287 dAvG(p,q) = fTuningGenFun[r][pq]->GetBinContent(fTuningGenFun[r][pq]->GetBin(p+1,q+1));
290 someAvGEntryIsNegative = kTRUE;
292 cout<<" WARNING: "<<Form("<G[%d][%d]> is negative !!!! GFC results are meaningless for r0 = %f, pq = %i.",p,q,fTuningR0[r],pq)<<endl;
297 // C[p][q] (generating function for the cumulants)
298 TMatrixD dC(pMax,qMax);
300 if(fAvM>0. && !someAvGEntryIsNegative)
302 for(Int_t p=0;p<pMax;p++)
304 for(Int_t q=0;q<qMax;q++)
306 dC(p,q) = fAvM*(pow(dAvG(p,q),(1./fAvM))-1.);
310 // Averaging the generating function for cumulants over azimuth
311 // in order to eliminate detector effects.
312 // <C[p][q]> (Remark: here <> stands for average over azimuth):
315 for(Int_t p=0;p<pMax;p++)
318 for(Int_t q=0;q<qMax;q++)
324 // Finally, the isotropic cumulants for reference flow and reference flow itself:
325 TVectorD cumulant(pMax);
331 cumulant[0]=(1./(fTuningR0[r]*fTuningR0[r]))*(2.*dAvC[0]-(1./2.)*dAvC[1]);
332 cumulant[1]=(2./pow(fTuningR0[r],4.))*((-2.)*dAvC[0]+1.*dAvC[1]);
333 if(cumulant[0]>=0.) {flow[0] = pow(cumulant[0],1./2.);}
334 if(cumulant[1]<=0.) {flow[1] = pow(-1.*cumulant[1],1./4.);}
338 cumulant[0] = (1./(fTuningR0[r]*fTuningR0[r]))*(3.*dAvC[0]-(3./2.)*dAvC[1]+(1./3.)*dAvC[2]);
339 cumulant[1] = (2./pow(fTuningR0[r],4.))*((-5.)*dAvC[0]+4.*dAvC[1]-1.*dAvC[2]);
340 cumulant[2] = (6./pow(fTuningR0[r],6.))*(3.*dAvC[0]-3.*dAvC[1]+1.*dAvC[2]);
341 if(cumulant[0]>=0.) {flow[0] = pow(cumulant[0],1./2.);}
342 if(cumulant[1]<=0.) {flow[1] = pow(-1.*cumulant[1],1./4.);}
343 if(cumulant[2]>=0.) {flow[2] = pow((1./4.)*cumulant[2],1./6.);}
347 cumulant[0] = (1./(fTuningR0[r]*fTuningR0[r]))*(4.*dAvC[0]-3.*dAvC[1]+(4./3.)*dAvC[2]-(1./4.)*dAvC[3]);
348 cumulant[1] = (1./pow(fTuningR0[r],4.))*((-52./3.)*dAvC[0]+19.*dAvC[1]-(28./3.)*dAvC[2]+(11./6.)*dAvC[3]);
349 cumulant[2] = (3./pow(fTuningR0[r],6.))*(18.*dAvC[0]-24.*dAvC[1]+14.*dAvC[2]-3.*dAvC[3]);
350 cumulant[3] = (24./pow(fTuningR0[r],8.))*((-4.)*dAvC[0]+6.*dAvC[1]-4.*dAvC[2]+1.*dAvC[3]);
351 if(cumulant[0]>=0.) {flow[0] = pow(cumulant[0],1./2.);}
352 if(cumulant[1]<=0.) {flow[1] = pow(-1.*cumulant[1],1./4.);}
353 if(cumulant[2]>=0.) {flow[2] = pow((1./4.)*cumulant[2],1./6.);}
354 if(cumulant[3]<=0.) {flow[3] = pow((-1./33.)*cumulant[3],1./8.);}
358 cumulant[0] = (-1./(60*fTuningR0[r]*fTuningR0[r]))*((-300.)*dAvC[0]+300.*dAvC[1]-200.*dAvC[2]+75.*dAvC[3]-12.*dAvC[4]);
359 cumulant[1] = (-1./(6.*pow(fTuningR0[r],4.)))*(154.*dAvC[0]-214.*dAvC[1]+156.*dAvC[2]-61.*dAvC[3]+10.*dAvC[4]);
360 cumulant[2] = (3./(2.*pow(fTuningR0[r],6.)))*(71.*dAvC[0]-118.*dAvC[1]+98.*dAvC[2]-41.*dAvC[3]+7.*dAvC[4]);
361 cumulant[3] = (-24./pow(fTuningR0[r],8.))*(14.*dAvC[0]-26.*dAvC[1]+24.*dAvC[2]-11.*dAvC[3]+2.*dAvC[4]);
362 cumulant[4] = (120./pow(fTuningR0[r],10.))*(5.*dAvC[0]-10.*dAvC[1]+10.*dAvC[2]-5.*dAvC[3]+1.*dAvC[4]);
363 if(cumulant[0]>=0.) {flow[0] = pow(cumulant[0],1./2.);}
364 if(cumulant[1]<=0.) {flow[1] = pow(-1.*cumulant[1],1./4.);}
365 if(cumulant[2]>=0.) {flow[2] = pow((1./4.)*cumulant[2],1./6.);}
366 if(cumulant[3]<=0.) {flow[3] = pow((-1./33.)*cumulant[3],1./8.);}
367 if(cumulant[4]>=0.) {flow[4] = pow((1./456.)*cumulant[4],1./10.);}
371 cumulant[0] = (1./(fTuningR0[r]*fTuningR0[r]))*(8.*dAvC[0]-14.*dAvC[1]+(56./3.)*dAvC[2]-(35./2.)*dAvC[3]
372 + (56./5.)*dAvC[4]-(14./3.)*dAvC[5]+(8./7.)*dAvC[6]-(1./8.)*dAvC[7]);
373 cumulant[1] = (1./pow(fTuningR0[r],4.))*((-1924./35.)*dAvC[0]+(621./5.)*dAvC[1]-(8012./45.)*dAvC[2]
374 + (691./4.)*dAvC[3]-(564./5.)*dAvC[4]+(2143./45.)*dAvC[5]-(412./35.)*dAvC[6]+(363./280.)*dAvC[7]);
375 cumulant[2] = (1./pow(fTuningR0[r],6.))*(349.*dAvC[0]-(18353./20.)*dAvC[1]+(7173./5.)*dAvC[2]
376 - 1457.*dAvC[3]+(4891./5.)*dAvC[4]-(1683./4.)*dAvC[5]+(527./5.)*dAvC[6]-(469./40.)*dAvC[7]);
377 cumulant[3] = (1./pow(fTuningR0[r],8.))*((-10528./5.)*dAvC[0]+(30578./5.)*dAvC[1]-(51456./5.)*dAvC[2]
378 + 10993.*dAvC[3]-(38176./5.)*dAvC[4]+(16818./5.)*dAvC[5]-(4288./5.)*dAvC[6]+(967./10.)*dAvC[7]);
379 cumulant[4] = (1./pow(fTuningR0[r],10.))*(11500.*dAvC[0]-35800.*dAvC[1]+63900.*dAvC[2]-71600.*dAvC[3]
380 + 51620.*dAvC[4]-23400.*dAvC[5]+6100.*dAvC[6]-700.*dAvC[7]);
381 cumulant[5] = (1./pow(fTuningR0[r],12.))*(-52560.*dAvC[0]+172080.*dAvC[1]-321840.*dAvC[2]+376200.*dAvC[3]
382 - 281520.*dAvC[4]+131760.*dAvC[5]-35280.*dAvC[6]+4140.*dAvC[7]);
383 cumulant[6] = (1./pow(fTuningR0[r],14.))*(176400.*dAvC[0]-599760.*dAvC[1]+1164240.*dAvC[2]-1411200.*dAvC[3]
384 + 1093680.*dAvC[4]-529200.*dAvC[5]+146160.*dAvC[6]-17640.*dAvC[7]);
385 cumulant[7] = (1./pow(fTuningR0[r],16.))*(-322560*dAvC[0]+1128960.*dAvC[1]-2257920.*dAvC[2]+2822400.*dAvC[3]
386 - 2257920.*dAvC[4]+1128960.*dAvC[5]-322560.*dAvC[6]+40320.*dAvC[7]);
387 if(cumulant[0]>=0.) {flow[0] = pow(cumulant[0],1./2.);}
388 if(cumulant[1]<=0.) {flow[1] = pow(-1.*cumulant[1],1./4.);}
389 if(cumulant[2]>=0.) {flow[2] = pow((1./4.)*cumulant[2],1./6.);}
390 if(cumulant[3]<=0.) {flow[3] = pow((-1./33.)*cumulant[3],1./8.);}
391 if(cumulant[4]>=0.) {flow[4] = pow((1./456.)*cumulant[4],1./10.);}
392 if(cumulant[5]<=0.) {flow[5] = pow((-1./9460.)*cumulant[5],1./12.);}
393 if(cumulant[6]>=0.) {flow[6] = pow((1./274800.)*cumulant[6],1./14.);}
394 if(cumulant[7]<=0.) {flow[7] = pow((-1./10643745.)*cumulant[7],1./16.);}
396 // Store cumulants and reference flow:
397 for(Int_t co=0;co<pMax;co++) // cumulant order
399 fTuningCumulants[r][pq]->SetBinContent(co+1,cumulant[co]);
400 fTuningFlow[r][pq]->SetBinContent(co+1,flow[co]);
402 } // end of for(Int_t pq=0;pq<5;pq++)
403 } // end of for(Int_t r=0;r<10;r++)
405 } // end of void AliFlowAnalysisWithCumulants::FinalizeTuning()
407 //================================================================================================================
409 void AliFlowAnalysisWithCumulants::FillGeneratingFunctionsForDifferentTuningParameters(AliFlowEventSimple *anEvent)
411 // Fill generating function for reference flow evaluated for different tuning parameters.
413 Int_t pMax[5] = {2,3,4,5,8};
414 Int_t qMax[5] = {5,7,9,11,17};
416 // Particle variables and weights:
417 Double_t dPhi = 0.; // azimuthal angle in the laboratory frame
418 Double_t dPt = 0.; // transverse momentum
419 Double_t dEta = 0.; // pseudorapidity
420 Double_t wPhi = 1.; // phi weight
421 Double_t wPt = 1.; // pt weight
422 Double_t wEta = 1.; // eta weight
424 Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = total number of primary tracks, i.e. nPrim = nRP + nPOI, where:
425 // nRP = # of particles used to determine the reaction plane;
426 // nPOI = # of particles of interest for a detailed flow analysis.
428 Int_t nRP = anEvent->GetEventNSelTracksRP(); // nRP = # of particles used to determine the reaction plane;
429 for(Int_t pq=0;pq<5;pq++)
431 if(nRP<2.*pMax[pq]) continue; // results doesn't make sense if nRP is smaller than serie's cutoff
432 fTuningAvM->Fill(pq+0.5,nRP,1.); // <M> for different classes of events }
435 Double_t tuningGenFunEBE[10][5][8][17] = {{{{0.}}}};
436 for(Int_t r=0;r<10;r++)
438 for(Int_t pq=0;pq<5;pq++)
440 for(Int_t p=0;p<pMax[pq];p++)
442 for(Int_t q=0;q<qMax[pq];q++)
444 tuningGenFunEBE[r][pq][p][q] = 1.;
450 // Looping over tracks:
451 for(Int_t i=0;i<nPrim;i++)
453 AliFlowTrackSimple *aftsTrack = anEvent->GetTrack(i);
454 if(aftsTrack && aftsTrack->InRPSelection())
456 // Access particle variables and weights:
457 dPhi = aftsTrack->Phi();
458 dPt = aftsTrack->Pt();
459 dEta = aftsTrack->Eta();
460 if(fUsePhiWeights && fnBinsPhi) // determine phi weight for this particle:
462 wPhi = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*fnBinsPhi/TMath::TwoPi())));
464 if(fUsePtWeights && fnBinsPt) // determine pt weight for this particle:
466 wPt = fPtWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/fPtBinWidth)));
468 if(fUseEtaWeights && fEtaBinWidth) // determine eta weight for this particle:
470 wEta = fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/fEtaBinWidth)));
472 // Fill the generating functions:
473 for(Int_t r=0;r<10;r++) // 10 different values for interpolating parameter r0
475 if(TMath::Abs(fTuningR0[r])<1.e-10) continue;
476 for(Int_t pq=0;pq<5;pq++) // 5 different values for set (pMax,qMax)
478 if(nRP<2.*pMax[pq]) continue; // results doesn't make sense if nRP is smaller than serie's cutoff
479 for(Int_t p=0;p<pMax[pq];p++)
481 for(Int_t q=0;q<qMax[pq];q++)
483 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]));
484 } // end of for(Int_t q=0;q<qMax[pq];q++)
485 } // end of for(Int_t p=0;p<pMax[pq];p++)
486 } // end for(Int_t pq=0;pq<5;pq++) // 5 different values for set (pMax,qMax)
487 } // end of for(Int_t r=0;r<10;r++) // 10 different values for interpolating parameter r0
488 } // end of if(aftsTrack && aftsTrack->InRPSelection())
489 } // end of for(Int_t i=0;i<nPrim;i++)
492 for(Int_t r=0;r<10;r++)
494 for(Int_t pq=0;pq<5;pq++)
496 if(nRP<2.*pMax[pq]) continue; // results doesn't make sense if nRP is smaller than serie's cutoff
497 for(Int_t p=0;p<pMax[pq];p++)
499 for(Int_t q=0;q<qMax[pq];q++)
501 if(fTuningGenFun[r][pq]) {fTuningGenFun[r][pq]->Fill((Double_t)p,(Double_t)q,tuningGenFunEBE[r][pq][p][q],1.);}
507 } // end of void AliFlowAnalysisWithCumulants::FillGeneratingFunctionsForDifferentTuningParameters(AliFlowEventSimple *anEvent)
509 //================================================================================================================
511 void AliFlowAnalysisWithCumulants::FillGeneratingFunctionForReferenceFlow(AliFlowEventSimple *anEvent)
513 // Fill generating function for reference flow for current event.
517 printf(" WARNING (GFC): anEvent is NULL !!!!");
521 // Particle variables and weights:
522 Double_t dPhi = 0.; // azimuthal angle in the laboratory frame
523 Double_t dPt = 0.; // transverse momentum
524 Double_t dEta = 0.; // pseudorapidity
525 Double_t wPhi = 1.; // phi weight
526 Double_t wPt = 1.; // pt weight
527 Double_t wEta = 1.; // eta weight
529 Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = total number of primary tracks, i.e. nPrim = nRP + nPOI, where:
530 // nRP = # of particles used to determine the reaction plane;
531 // nPOI = # of particles of interest for a detailed flow analysis.
533 Int_t nRP = anEvent->GetEventNSelTracksRP(); // nRP = # of particles used to determine the reaction plane;
534 if(fCalculateVsMultiplicity){fAvMVsM->Fill(nRP+0.5,nRP,1.);}
536 // Initializing the generating function G[p][q] for reference flow for current event:
537 Int_t pMax = fGEBE->GetNrows();
538 Int_t qMax = fGEBE->GetNcols();
539 for(Int_t p=0;p<pMax;p++)
541 for(Int_t q=0;q<qMax;q++)
547 // Cross-checking the number of RPs in current event:
548 Int_t crossCheckRP = 0;
550 // Looping over tracks:
551 for(Int_t i=0;i<nPrim;i++)
553 AliFlowTrackSimple *aftsTrack = anEvent->GetTrack(i);
554 if(aftsTrack && aftsTrack->InRPSelection())
557 // Access particle variables and weights:
558 dPhi = aftsTrack->Phi();
559 dPt = aftsTrack->Pt();
560 dEta = aftsTrack->Eta();
561 if(fUsePhiWeights && fnBinsPhi) // determine phi weight for this particle:
563 wPhi = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*fnBinsPhi/TMath::TwoPi())));
565 if(fUsePtWeights && fnBinsPt) // determine pt weight for this particle:
567 wPt = fPtWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/fPtBinWidth)));
569 if(fUseEtaWeights && fEtaBinWidth) // determine eta weight for this particle:
571 wEta = fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/fEtaBinWidth)));
573 // Fill the generating function:
574 for(Int_t p=0;p<pMax;p++)
576 for(Int_t q=0;q<qMax;q++)
578 (*fGEBE)(p,q) *= (1.+wPhi*wPt*wEta*(2.*fR0*sqrt(p+1.)/nRP)*cos(fHarmonic*dPhi-2.*q*TMath::Pi()/qMax));
581 // Fill the profile to calculate <<w^2>>:
582 fAverageOfSquaredWeight->Fill(0.5,pow(wPhi*wPt*wEta,2.),1.);
583 } // end of if(aftsTrack && aftsTrack->InRPSelection())
584 } // end of for(Int_t i=0;i<nPrim;i++)
586 // Cross check # of RPs:
587 if(anEvent && (crossCheckRP != anEvent->GetEventNSelTracksRP()))
590 cout<<"WARNING (GFC): crossCheckRP != nRP in GFC::Make(). Something is wrong with RP flagging !!!!"<<endl;
595 // Storing the value of G[p][q] in 2D profile in order to get eventually the avarage <G[p][q]>:
596 // Determine first the event weight for G[p][q]:
597 // (to be improved - this can be implemented much better, this shall be executed only once out of Make(), eventWeight should be a data member)
598 Double_t eventWeight = 0.;
599 if(!strcmp(fMultiplicityWeight->Data(),"unit"))
602 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
604 eventWeight = anEvent->GetEventNSelTracksRP();
606 // Store G[p][q] weighted appropriately:
607 for(Int_t p=0;p<pMax;p++)
609 for(Int_t q=0;q<qMax;q++)
611 fReferenceFlowGenFun->Fill((Double_t)p,(Double_t)q,(*fGEBE)(p,q),eventWeight);
612 if(fCalculateVsMultiplicity){fReferenceFlowGenFunVsM->Fill(nRP+0.5,(Double_t)p,(Double_t)q,(*fGEBE)(p,q),eventWeight);}
616 } // end of void AliFlowAnalysisWithCumulants::FillGeneratingFunctionForReferenceFlow(AliFlowEventSimple* anEvent)
618 //================================================================================================================
620 void AliFlowAnalysisWithCumulants::FillQvectorComponents(AliFlowEventSimple* anEvent)
622 // Fill components of Q-vector for current event (needed for error calculation).
624 // Remark: Components are stored in profile fQvectorComponents whose binning is organized as follows:
634 Int_t n = 2; // to be removed
638 afv = anEvent->GetQ(1*n,fWeightsList,fUsePhiWeights,fUsePtWeights,fUseEtaWeights); // get the Q-vector for this event
639 fQvectorComponents->Fill(0.5,afv.X(),1.); // in the 1st bin fill Q_x
640 fQvectorComponents->Fill(1.5,afv.Y(),1.); // in the 2nd bin fill Q_y
641 fQvectorComponents->Fill(2.5,pow(afv.X(),2.),1.); // in the 3rd bin fill (Q_x)^2
642 fQvectorComponents->Fill(3.5,pow(afv.Y(),2.),1.); // in the 4th bin fill (Q_y)^2
645 } // end of void AliFlowAnalysisWithCumulants::FillQvectorComponents(AliFlowEventSimple* anEvent)
647 //================================================================================================================
649 void AliFlowAnalysisWithCumulants::FillGeneratingFunctionForDiffFlow(AliFlowEventSimple* anEvent)
651 // Fill generating function for differential flow for the current event.
653 // Remark 0: Generating function D[b][p][q] is a complex number => real and imaginary part are calculated separately
654 // (b denotes pt or eta bin);
655 // Remark 1: Note that bellow G[p][q] is needed, the value of generating function for reference flow for the CURRENT event.
656 // This values is obtained in method FillGeneratingFunctionForReferenceFlow() as TMatrixD fGEBE;
657 // 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
658 // automatically get <Re(D[b][p][q])> and <Im(D[b][p][q])> at the end of the day.
660 // Particle variables and weights:
661 Double_t dPhi = 0.; // azimuthal angle in the laboratory frame
662 Double_t dPt = 0.; // transverse momentum
663 Double_t dEta = 0.; // pseudorapidity
664 Double_t wPhi = 1.; // phi weight
665 Double_t wPt = 1.; // pt weight
666 Double_t wEta = 1.; // eta weight
669 Int_t pMax = fGEBE->GetNrows();
670 Int_t qMax = fGEBE->GetNcols();
672 Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = total number of primary tracks, i.e. nPrim = nRP + nPOI, where:
673 // nRP = # of particles used to determine the reaction plane;
674 // nPOI = # of particles of interest for a detailed flow analysis.
676 Int_t nRP = anEvent->GetEventNSelTracksRP(); // nRP = # of particles used to determine the reaction plane
678 // Start the second loop over event in order to evaluate the generating function D[b][p][q] for differential flow:
679 for(Int_t i=0;i<nPrim;i++)
681 AliFlowTrackSimple *aftsTrack = anEvent->GetTrack(i);
684 if(!(aftsTrack->InRPSelection() || aftsTrack->InPOISelection())) continue;
685 // Differential flow of POIs:
686 if(aftsTrack->InPOISelection())
688 // Get azimuthal angle, momentum and pseudorapidity of a particle:
689 dPhi = aftsTrack->Phi();
690 dPt = aftsTrack->Pt();
691 dEta = aftsTrack->Eta();
692 Double_t ptEta[2] = {dPt,dEta};
694 // Count number of POIs in pt/eta bin:
695 for(Int_t pe=0;pe<2;pe++)
697 fNoOfParticlesInBin[1][pe]->Fill(ptEta[pe],ptEta[pe],1.);
700 if(!(aftsTrack->InRPSelection())) // particle was flagged only as POI
702 // Fill generating function:
703 for(Int_t p=0;p<pMax;p++)
705 for(Int_t q=0;q<qMax;q++)
707 for(Int_t ri=0;ri<2;ri++)
709 for(Int_t pe=0;pe<2;pe++)
711 if(ri==0) // Real part (to be improved - this can be implemented better)
713 fDiffFlowGenFun[ri][1][pe]->Fill(ptEta[pe],(Double_t)p,(Double_t)q, // to be improved - hardwired weight 1. in the line bellow
714 (*fGEBE)(p,q)*cos(fMultiple*fHarmonic*dPhi),1.);
716 else if(ri==1) // Imaginary part (to be improved - this can be implemented better)
718 fDiffFlowGenFun[ri][1][pe]->Fill(ptEta[pe],(Double_t)p,(Double_t)q, // to be improved - hardwired weight 1. in the line bellow
719 (*fGEBE)(p,q)*sin(fMultiple*fHarmonic*dPhi),1.);
721 } // end of for(Int_t pe=0;pe<2;pe++)
722 } // end of for(Int_t ri=0;ri<2;ri++)
723 } // end of for(Int_t q=0;q<qMax;q++)
724 } // end of for(Int_t p=0;p<pMax;p++)
725 } // end of if(!(aftsTrack->InRPSelection())) // particle was flagged only as POI
726 else if(aftsTrack->InRPSelection()) // particle was flagged both as RP and POI
728 // If particle weights were used, get them:
729 if(fUsePhiWeights && fnBinsPhi) // determine phi weight for this particle:
731 wPhi = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*fnBinsPhi/TMath::TwoPi())));
733 if(fUsePtWeights && fnBinsPt) // determine pt weight for this particle:
735 wPt = fPtWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/fPtBinWidth)));
737 if(fUseEtaWeights && fEtaBinWidth) // determine eta weight for this particle:
739 wEta = fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/fEtaBinWidth)));
741 // Fill generating function:
742 for(Int_t p=0;p<pMax;p++)
744 for(Int_t q=0;q<qMax;q++)
746 for(Int_t ri=0;ri<2;ri++)
748 for(Int_t pe=0;pe<2;pe++)
750 if(ri==0) // Real part (to be improved - this can be implemented better)
752 fDiffFlowGenFun[ri][1][pe]->Fill(ptEta[pe],(Double_t)p,(Double_t)q, // to be improved - hardwired weight 1. in the line bellow
753 (*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.);
755 else if(ri==1) // Imaginary part (to be improved - this can be implemented better)
757 fDiffFlowGenFun[ri][1][pe]->Fill(ptEta[pe],(Double_t)p,(Double_t)q, // to be improved - hardwired weight 1. in the line bellow
758 (*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.);
760 } // end of for(Int_t pe=0;pe<2;pe++)
761 } // end of for(Int_t ri=0;ri<2;ri++)
762 } // end of for(Int_t q=0;q<qMax;q++)
763 } // end of for(Int_t p=0;p<pMax;p++)
764 } // end of else if (aftsTrack->InRPSelection()) // particle was flagged both as RP and POI
765 } // end of if(aftsTrack->InPOISelection())
766 // Differential flow of RPs:
767 if(aftsTrack->InRPSelection())
769 // Get azimuthal angle, momentum and pseudorapidity of a particle:
770 dPhi = aftsTrack->Phi();
771 dPt = aftsTrack->Pt();
772 dEta = aftsTrack->Eta();
773 Double_t ptEta[2] = {dPt,dEta};
775 // Count number of RPs in pt/eta bin:
776 for(Int_t pe=0;pe<2;pe++)
778 fNoOfParticlesInBin[0][pe]->Fill(ptEta[pe],ptEta[pe],1.);
781 // If particle weights were used, get them:
782 if(fUsePhiWeights && fnBinsPhi) // determine phi weight for this particle:
784 wPhi = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*fnBinsPhi/TMath::TwoPi())));
786 if(fUsePtWeights && fnBinsPt) // determine pt weight for this particle:
788 wPt = fPtWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/fPtBinWidth)));
790 if(fUseEtaWeights && fEtaBinWidth) // determine eta weight for this particle:
792 wEta = fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/fEtaBinWidth)));
794 // Fill generating function:
795 for(Int_t p=0;p<pMax;p++)
797 for(Int_t q=0;q<qMax;q++)
799 for(Int_t ri=0;ri<2;ri++)
801 for(Int_t pe=0;pe<2;pe++)
803 if(ri==0) // Real part (to be improved - this can be implemented better)
805 fDiffFlowGenFun[ri][0][pe]->Fill(ptEta[pe],(Double_t)p,(Double_t)q, // to be improved - hardwired weight 1. in the line bellow
806 (*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.);
808 else if(ri==1) // Imaginary part (to be improved - this can be implemented better)
810 fDiffFlowGenFun[ri][0][pe]->Fill(ptEta[pe],(Double_t)p,(Double_t)q, // to be improved - hardwired weight 1. in the line bellow
811 (*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.);
813 } // end of for(Int_t pe=0;pe<2;pe++)
814 } // end of for(Int_t ri=0;ri<2;ri++)
815 } // end of for(Int_t q=0;q<qMax;q++)
816 } // end of for(Int_t p=0;p<pMax;p++)
817 } // end of if(aftsTrack->InRPSelection())
818 } // end of if(aftsTrack)
819 } // end of for(Int_t i=0;i<nPrim;i++)
821 } // end of void AliFlowAnalysisWithCumulants::FillGeneratingFunctionForDiffFlow(AliFlowEventSimple* anEvent)
823 //================================================================================================================
825 void AliFlowAnalysisWithCumulants::GetOutputHistograms(TList *outputListHistos)
827 // Get pointers to all objects saved in the output file.
831 this->SetHistList(outputListHistos);
835 cout<<" WARNING (GFC): fHistList is NULL in AFAWGFC::GOH() !!!!"<<endl;
839 this->GetPointersForBaseHistograms();
840 this->AccessSettings();
841 this->GetPointersForCommonControlHistograms();
842 this->GetPointersForCommonResultsHistograms();
843 this->GetPointersForReferenceFlowObjects();
844 this->GetPointersForDiffFlowObjects();
845 if(fTuneParameters){this->GetPointersForTuningObjects();}
849 cout<<" WARNING (GFC): outputListHistos is NULL in AFAWGFC::GOH() !!!!"<<endl;
854 } // end of void AliFlowAnalysisWithCumulants::GetOutputHistograms(TList *outputListHistos)
856 //================================================================================================================
858 void AliFlowAnalysisWithCumulants::GetPointersForBaseHistograms()
860 // Get pointers to base histograms.
862 TString analysisSettingsName = "fAnalysisSettings";
863 TProfile *analysisSettings = dynamic_cast<TProfile*>(fHistList->FindObject(analysisSettingsName.Data()));
866 this->SetAnalysisSettings(analysisSettings);
870 cout<<" WARNING (GFC): analysisSettings is NULL in AFAWGFC::GPFBH() !!!!"<<endl;
875 } // end of void AliFlowAnalysisWithCumulants::GetPointersForBaseHistograms()
877 //================================================================================================================
879 void AliFlowAnalysisWithCumulants::GetPointersForCommonControlHistograms()
881 // Get pointers for common control histograms.
883 TString commonHistsName = "AliFlowCommonHistGFC";
884 AliFlowCommonHist *commonHist = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHistsName.Data()));
887 this->SetCommonHists(commonHist);
891 cout<<" WARNING (GFC): commonHist is NULL in AFAWGFC::GPFCH() !!!!"<<endl;
896 } // end of void AliFlowAnalysisWithCumulants::GetPointersForCommonControlHistograms()
898 //================================================================================================================
900 void AliFlowAnalysisWithCumulants::GetPointersForCommonResultsHistograms()
902 // Get pointers for common results histograms.
904 TString commonHistResults2ndOrderName = "AliFlowCommonHistResults2ndOrderGFC";
905 AliFlowCommonHistResults *commonHistRes2nd = dynamic_cast<AliFlowCommonHistResults*>
906 (fHistList->FindObject(commonHistResults2ndOrderName.Data()));
909 this->SetCommonHistsResults2nd(commonHistRes2nd);
913 cout<<" WARNING (GFC): commonHistRes2nd is NULL in AFAWGFC::GPFCRH() !!!!"<<endl;
917 TString commonHistResults4thOrderName = "AliFlowCommonHistResults4thOrderGFC";
918 AliFlowCommonHistResults *commonHistRes4th = dynamic_cast<AliFlowCommonHistResults*>
919 (fHistList->FindObject(commonHistResults4thOrderName.Data()));
922 this->SetCommonHistsResults4th(commonHistRes4th);
926 cout<<" WARNING (GFC): commonHistRes4th is NULL in AFAWGFC::GPFCRH() !!!!"<<endl;
930 TString commonHistResults6thOrderName = "AliFlowCommonHistResults6thOrderGFC";
931 AliFlowCommonHistResults *commonHistRes6th = dynamic_cast<AliFlowCommonHistResults*>
932 (fHistList->FindObject(commonHistResults6thOrderName.Data()));
935 this->SetCommonHistsResults6th(commonHistRes6th);
939 cout<<" WARNING (GFC): commonHistRes6th is NULL in AFAWGFC::GPFCRH() !!!!"<<endl;
943 TString commonHistResults8thOrderName = "AliFlowCommonHistResults8thOrderGFC";
944 AliFlowCommonHistResults *commonHistRes8th = dynamic_cast<AliFlowCommonHistResults*>
945 (fHistList->FindObject(commonHistResults8thOrderName.Data()));
948 this->SetCommonHistsResults8th(commonHistRes8th);
952 cout<<" WARNING (GFC): commonHistRes8th is NULL in AFAWGFC::GPFCRH() !!!!"<<endl;
957 } // end of void AliFlowAnalysisWithCumulants::GetPointersForCommonResultsHistograms()
959 //================================================================================================================
961 void AliFlowAnalysisWithCumulants::GetPointersForTuningObjects()
963 // Get pointers to all objects used for tuning.
965 // a) Get pointers to all lists relevant for tuning;
966 // b) Get pointer to profile holding flags for tuning;
967 // c) Get pointers to all objects in the list fTuningProfiles;
968 // d) Get pointers to all objects in the list fTuningResults.
970 // a) Get pointers to all lists relevant for tuning:
971 TList *tuningList = dynamic_cast<TList*>(fHistList->FindObject("Tuning"));
975 cout<<"WARNING (GFC): uningList is NULL in AFAWGFC::GPFTO() !!!!"<<endl;
979 TList *tuningProfiles = dynamic_cast<TList*>(tuningList->FindObject("Profiles"));
983 cout<<"WARNING (GFC): tuningProfiles is NULL in AFAWGFC::GPFTO() !!!!"<<endl;
987 TList *tuningResults = dynamic_cast<TList*>(tuningList->FindObject("Results"));
991 cout<<"WARNING (GFC): tuningResults is NULL in AFAWGFC::GPFTO() !!!!"<<endl;
996 // b) Get pointer to profile holding flags for tuning:
997 TString tuningFlagsName = "fTuningFlags";
998 TProfile *tuningFlags = dynamic_cast<TProfile*>(tuningList->FindObject(tuningFlagsName.Data()));
1001 this->SetTuningFlags(tuningFlags);
1005 cout<<"WARNING (GFC): tuningFlags is NULL in AFAWGFC::GPFTO() !!!!"<<endl;
1010 // c) Get pointers to all objects in the list fTuningProfiles:
1011 // Generating function for different tuning parameters:
1012 TProfile2D *tuningGenFun[10][5] = {{NULL}};
1013 for(Int_t r=0;r<10;r++)
1015 for(Int_t pq=0;pq<5;pq++)
1017 tuningGenFun[r][pq] = dynamic_cast<TProfile2D*>(tuningProfiles->FindObject(Form("fTuningGenFun (r_{0,%i}, pq set %i)",r,pq)));
1018 if(tuningGenFun[r][pq])
1020 this->SetTuningGenFun(tuningGenFun[r][pq],r,pq);
1024 cout<<"WARNING (GFC): "<<Form("tuningGenFun[%i][%i]",r,pq)<<" is NULL in AFAWGFC::GPFTO() !!!!"<<endl;
1028 } // end of for(Int_t pq=0;pq<5;pq++)
1029 } // end of for(Int_t r=0;r<10;r++)
1030 // Average multiplicities for events with nRPs >= cuttof
1031 TProfile *tuningAvM = dynamic_cast<TProfile*>(tuningProfiles->FindObject("fTuningAvM"));
1034 this->SetTuningAvM(tuningAvM);
1038 cout<<"WARNING (GFC): tuningAvM is NULL in AFAWGFC::GPFTO() !!!!"<<endl;
1043 // d) Get pointers to all objects in the list fTuningResults.
1044 // Cumulants for reference flow for 10 different r0s and 5 different sets of (pmax,qmax):
1045 TH1D *tuningCumulants[10][5] = {{NULL}};
1046 for(Int_t r=0;r<10;r++)
1048 for(Int_t pq=0;pq<5;pq++)
1050 tuningCumulants[r][pq] = dynamic_cast<TH1D*>(tuningResults->FindObject(Form("fTuningCumulants (r_{0,%i}, pq set %i)",r,pq)));
1051 if(tuningCumulants[r][pq])
1053 this->SetTuningCumulants(tuningCumulants[r][pq],r,pq);
1057 cout<<"WARNING (GFC): "<<Form("tuningCumulants[%i][%i]",r,pq)<<" is NULL in AFAWGFC::GPFTO() !!!!"<<endl;
1061 } // end of for(Int_t pq=0;pq<5;pq++)
1062 } // end of for(Int_t r=0;r<10;r++)
1063 // Reference flow for 10 different r0s and 5 different sets of (pmax,qmax):
1064 TH1D *tuningFlow[10][5] = {{NULL}};
1065 for(Int_t r=0;r<10;r++)
1067 for(Int_t pq=0;pq<5;pq++)
1069 tuningFlow[r][pq] = dynamic_cast<TH1D*>(tuningResults->FindObject(Form("fTuningFlow (r_{0,%i}, pq set %i)",r,pq)));
1070 if(tuningFlow[r][pq])
1072 this->SetTuningFlow(tuningFlow[r][pq],r,pq);
1076 cout<<"WARNING (GFC): "<<Form("tuningFlow[%i][%i]",r,pq)<<" is NULL in AFAWGFC::GPFTO() !!!!"<<endl;
1080 } // end of for(Int_t pq=0;pq<5;pq++)
1081 } // end of for(Int_t r=0;r<10;r++)
1083 } // end of void AliFlowAnalysisWithCumulants::GetPointersForTuningObjects()
1085 //================================================================================================================
1087 void AliFlowAnalysisWithCumulants::GetPointersForReferenceFlowObjects()
1089 // Get pointers for all objects relevant for calculation of reference flow.
1091 // a) Get pointers to all lists relevant for reference flow;
1092 // b) Get pointer to profile holding flags;
1093 // c) Get pointers to all objects in the list fReferenceFlowProfiles;
1094 // d) Get pointers to all objects in the list fReferenceFlowResults;
1095 // e) Get pointers for all objects relevant for calculation of reference flow versus multiplicity.
1097 // a) Get pointers to all lists relevant for reference flow:
1098 TList *referenceFlowList = dynamic_cast<TList*>(fHistList->FindObject("Reference Flow"));
1099 if(!referenceFlowList)
1102 cout<<"WARNING (GFC): referenceFlowList is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1106 TList *referenceFlowProfiles = dynamic_cast<TList*>(referenceFlowList->FindObject("Profiles"));
1107 if(!referenceFlowProfiles)
1110 cout<<"WARNING (GFC): referenceFlowProfiles is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1114 TList *referenceFlowResults = dynamic_cast<TList*>(referenceFlowList->FindObject("Results"));
1115 if(!referenceFlowResults)
1118 cout<<"WARNING (GFC): referenceFlowResults is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1123 // b) Get pointer to profile holding flags:
1124 TString referenceFlowFlagsName = "fReferenceFlowFlags";
1125 TProfile *referenceFlowFlags = dynamic_cast<TProfile*>(referenceFlowList->FindObject(referenceFlowFlagsName.Data()));
1126 if(referenceFlowFlags)
1128 this->SetReferenceFlowFlags(referenceFlowFlags);
1132 cout<<"WARNING (GFC): referenceFlowFlags is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1137 // c) Get pointers to all objects in the list fReferenceFlowProfiles:
1138 TString referenceFlowGenFunName = "fReferenceFlowGenFun";
1139 TProfile2D *referenceFlowGenFun = dynamic_cast<TProfile2D*>(referenceFlowProfiles->FindObject(referenceFlowGenFunName.Data()));
1140 if(referenceFlowGenFun)
1142 this->SetReferenceFlowGenFun(referenceFlowGenFun);
1146 cout<<"WARNING (GFC): referenceFlowGenFun is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1150 // Averages of various Q-vector components:
1151 TString qvectorComponentsName = "fQvectorComponents";
1152 TProfile *qvectorComponents = dynamic_cast<TProfile*>(referenceFlowProfiles->FindObject(qvectorComponentsName.Data()));
1153 if(qvectorComponents)
1155 this->SetQvectorComponents(qvectorComponents);
1159 cout<<"WARNING (GFC): qvectorComponents is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1163 // <<w^2>>, where w = wPhi*wPt*wEta:
1164 TString averageOfSquaredWeightName = "fAverageOfSquaredWeight";
1165 TProfile *averageOfSquaredWeight = dynamic_cast<TProfile*>(referenceFlowProfiles->FindObject(averageOfSquaredWeightName.Data()));
1166 if(averageOfSquaredWeight)
1168 this->SetAverageOfSquaredWeight(averageOfSquaredWeight);
1172 cout<<"WARNING (GFC): averageOfSquaredWeight is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1177 // d) Get pointers to all objects in the list fReferenceFlowResults:
1178 // Final results for isotropic cumulants for reference flow:
1179 TString referenceFlowCumulantsName = "fReferenceFlowCumulants";
1180 TH1D *referenceFlowCumulants = dynamic_cast<TH1D*>(referenceFlowResults->FindObject(referenceFlowCumulantsName.Data()));
1181 if(referenceFlowCumulants)
1183 this->SetReferenceFlowCumulants(referenceFlowCumulants);
1187 cout<<"WARNING (GFC): referenceFlowCumulants is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1191 // Final results for reference flow:
1192 TString referenceFlowName = "fReferenceFlow";
1193 TH1D *referenceFlow = dynamic_cast<TH1D*>(referenceFlowResults->FindObject(referenceFlowName.Data()));
1196 this->SetReferenceFlow(referenceFlow);
1200 cout<<"WARNING (GFC): referenceFlow is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1204 // Final results for resolution:
1205 TString chiName = "fChi";
1206 TH1D *chi = dynamic_cast<TH1D*>(referenceFlowResults->FindObject(chiName.Data()));
1213 cout<<"WARNING (GFC): chi is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1218 // e) Get pointers for all objects relevant for calculation of reference flow versus multiplicity:
1219 if(!fCalculateVsMultiplicity) {return;}
1220 // All-event average of the generating function used to calculate reference flow vs multiplicity:
1221 TString referenceFlowGenFunVsMName = "fReferenceFlowGenFunVsM";
1222 TProfile3D *referenceFlowGenFunVsM = dynamic_cast<TProfile3D*>(referenceFlowProfiles->FindObject(referenceFlowGenFunVsMName.Data()));
1223 if(referenceFlowGenFunVsM)
1225 this->SetReferenceFlowGenFunVsM(referenceFlowGenFunVsM);
1229 cout<<"WARNING (GFC): referenceFlowGenFunVsM is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1233 // Averages of various Q-vector components versus multiplicity:
1234 TString qvectorComponentsVsMName = "fQvectorComponentsVsM";
1235 TProfile2D *qvectorComponentsVsM = dynamic_cast<TProfile2D*>(referenceFlowProfiles->FindObject(qvectorComponentsVsMName.Data()));
1236 if(qvectorComponentsVsM)
1238 this->SetQvectorComponentsVsM(qvectorComponentsVsM);
1242 cout<<"WARNING (GFC): qvectorComponentsVsM is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1246 // <<w^2>>, where w = wPhi*wPt*wEta versus multiplicity:
1247 TString averageOfSquaredWeightVsMName = "fAverageOfSquaredWeightVsM";
1248 TProfile2D *averageOfSquaredWeightVsM = dynamic_cast<TProfile2D*>(referenceFlowProfiles->FindObject(averageOfSquaredWeightVsMName.Data()));
1249 if(averageOfSquaredWeightVsM)
1251 this->SetAverageOfSquaredWeightVsM(averageOfSquaredWeightVsM);
1255 cout<<"WARNING (GFC): averageOfSquaredWeightVsM is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1259 // Final results for reference GF-cumulants versus multiplicity:
1260 TString cumulantFlag[4] = {"GFC{2}","GFC{4}","GFC{6}","GFC{8}"};
1261 TString referenceFlowCumulantsVsMName = "fReferenceFlowCumulantsVsM";
1262 TH1D *referenceFlowCumulantsVsM[4] = {NULL};
1263 for(Int_t co=0;co<4;co++) // cumulant order
1265 referenceFlowCumulantsVsM[co] = dynamic_cast<TH1D*>(referenceFlowResults->FindObject(Form("%s, %s",referenceFlowCumulantsVsMName.Data(),cumulantFlag[co].Data())));
1266 if(referenceFlowCumulantsVsM[co])
1268 this->SetReferenceFlowCumulantsVsM(referenceFlowCumulantsVsM[co],co);
1272 cout<<"WARNING (GFC): "<<Form("referenceFlowCumulantsVsM[%i]",co)<<" is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1276 } // end of for(Int_t co=0;co<4;co++) // cumulant order
1277 // <M> vs multiplicity bin:
1278 TProfile *avMVsM = dynamic_cast<TProfile*>(referenceFlowProfiles->FindObject("fAvMVsM"));
1281 this->SetAvMVsM(avMVsM);
1285 cout<<"WARNING (GFC): avMVsM is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1290 } // end of void AliFlowAnalysisWithCumulants::GetPointersForReferenceFlowObjects()
1292 //================================================================================================================
1294 void AliFlowAnalysisWithCumulants::GetPointersForDiffFlowObjects()
1296 // Get pointers to all objects relevant for differential flow.
1298 // a) Define flags locally (to be improved: should I promote flags to data members?);
1299 // b) Get pointer to base list for differential flow fDiffFlowList and nested lists fDiffFlowListProfiles and fDiffFlowListResults;
1300 // c) Get pointer to profile fDiffFlowFlags holding all flags for differential flow;
1301 // d) Get pointers to all profiles in the list fDiffFlowProfiles;
1302 // e) Get pointers to all profiles in the list fDiffFlowResults.
1304 // a) Define flags locally (to be improved: should I promote flags to data members?):
1305 TString reIm[2] = {"Re","Im"};
1306 TString rpPoi[2] = {"RP","POI"};
1307 TString ptEta[2] = {"p_{t}","#eta"};
1308 TString order[4] = {"2nd order","4th order","6th order","8th order"};
1309 //TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
1311 // b) Get pointer to base list for differential flow fDiffFlowList and nested lists fDiffFlowListProfiles and fDiffFlowListResults:
1312 TList *diffFlowList = dynamic_cast<TList*>(fHistList->FindObject("Differential Flow")); // to be improved (hardwired name)
1316 cout<<"WARNING: diffFlowList is NULL in AFAWC::GPFDFO() !!!!"<<endl;
1320 TList *diffFlowProfiles = dynamic_cast<TList*>(diffFlowList->FindObject("Profiles")); // to be improved (hardwired name)
1321 if(!diffFlowProfiles)
1324 cout<<"WARNING: diffFlowProfiles is NULL in AFAWC::GPFDFO() !!!!"<<endl;
1328 TList *diffFlowResults = dynamic_cast<TList*>(diffFlowList->FindObject("Results")); // to be improved (hardwired name)
1329 if(!diffFlowResults)
1332 cout<<"WARNING: diffFlowResults is NULL in AFAWC::GPFDFO() !!!!"<<endl;
1337 // c) Get pointer to profile holding flags:
1338 TString diffFlowFlagsName = "fDiffFlowFlags";
1339 TProfile *diffFlowFlags = dynamic_cast<TProfile*>(diffFlowList->FindObject(diffFlowFlagsName.Data()));
1342 this->SetDiffFlowFlags(diffFlowFlags);
1346 cout<<"WARNING (GFC): diffFlowFlags is NULL in AFAWGFC::GPFDFO() !!!!"<<endl;
1351 // d) Get pointers to all profiles in the list fDiffFlowListProfiles:
1352 // Generating functions for differential flow:
1353 TProfile3D *diffFlowGenFun[2][2][2] = {{{NULL}}};
1354 for(Int_t ri=0;ri<2;ri++)
1356 for(Int_t rp=0;rp<2;rp++)
1358 for(Int_t pe=0;pe<2;pe++)
1360 diffFlowGenFun[ri][rp][pe] = dynamic_cast<TProfile3D*> // to be improved - harwired name fDiffFlowGenFun in the line bellow
1361 (diffFlowProfiles->FindObject(Form("fDiffFlowGenFun (%s, %s, %s)",reIm[ri].Data(),rpPoi[rp].Data(),ptEta[pe].Data())));
1362 if(diffFlowGenFun[ri][rp][pe])
1364 this->SetDiffFlowGenFun(diffFlowGenFun[ri][rp][pe],ri,rp,pe);
1368 cout<<"WARNING (GFC): "<<Form("diffFlowGenFun[%d][%d][%d]",ri,rp,pe)<<" is NULL in AFAWGFC::GPFDFO() !!!!"<<endl;
1375 // Number of particles in pt/eta bin for RPs/POIs:
1376 TProfile *noOfParticlesInBin[2][2] = {{NULL}};
1377 for(Int_t rp=0;rp<2;rp++)
1379 for(Int_t pe=0;pe<2;pe++)
1381 noOfParticlesInBin[rp][pe] = dynamic_cast<TProfile*> // to be improved - harwired name fNoOfParticlesInBin in the line bellow
1382 (diffFlowProfiles->FindObject(Form("fNoOfParticlesInBin (%s, %s)",rpPoi[rp].Data(),ptEta[pe].Data())));
1383 if(noOfParticlesInBin[rp][pe])
1385 this->SetNoOfParticlesInBin(noOfParticlesInBin[rp][pe],rp,pe);
1389 cout<<"WARNING (GFC): "<<Form("noOfParticlesInBin[%d][%d]",rp,pe)<<" is NULL in AFAWGFC::GPFDFO() !!!!"<<endl;
1395 // Differential cumulants per pt/eta bin for RPs/POIs:
1396 TH1D *diffFlowCumulants[2][2][4] = {{{NULL}}};
1397 for(Int_t rp=0;rp<2;rp++)
1399 for(Int_t pe=0;pe<2;pe++)
1401 for(Int_t co=0;co<4;co++)
1403 diffFlowCumulants[rp][pe][co] = dynamic_cast<TH1D*> // to be improved - hardwired name fDiffFlowCumulants in the line bellow
1404 (diffFlowResults->FindObject(Form("fDiffFlowCumulants (%s, %s, %s)",rpPoi[rp].Data(),ptEta[pe].Data(),order[co].Data())));
1405 if(diffFlowCumulants[rp][pe][co])
1407 this->SetDiffFlowCumulants(diffFlowCumulants[rp][pe][co],rp,pe,co);
1411 cout<<"WARNING (GFC): "<<Form("diffFlowCumulants[%d][%d][%d]",rp,pe,co)<<" is NULL in AFAWGFC::GPFDFO() !!!!"<<endl;
1418 // Differential flow per pt/eta bin for RPs/POIs:
1419 TH1D *diffFlow[2][2][4] = {{{NULL}}};
1420 for(Int_t rp=0;rp<2;rp++)
1422 for(Int_t pe=0;pe<2;pe++)
1424 for(Int_t co=0;co<4;co++)
1426 diffFlow[rp][pe][co] = dynamic_cast<TH1D*> // to be improved - hardwired name fDiffFlow in the line bellow
1427 (diffFlowResults->FindObject(Form("fDiffFlow (%s, %s, %s)",rpPoi[rp].Data(),ptEta[pe].Data(),order[co].Data())));
1428 if(diffFlow[rp][pe][co])
1430 this->SetDiffFlow(diffFlow[rp][pe][co],rp,pe,co);
1434 cout<<"WARNING (GFC): "<<Form("diffFlow[%d][%d][%d]",rp,pe,co)<<" is NULL in AFAWGFC::GPFDFO() !!!!"<<endl;
1442 } // end of void AliFlowAnalysisWithCumulants::GetPointersForDiffFlowObjects()
1444 //================================================================================================================
1446 void AliFlowAnalysisWithCumulants::CalculateIntegratedFlow(TString rpPoi)
1448 // Calculate final results for integrated flow of RPs and POIs.
1449 // (to be improved - this method can be implemented much better)
1456 } else if(rpPoi == "POI")
1462 TH1F *yieldPt = NULL;
1466 yieldPt = (TH1F*)(fCommonHists->GetHistPtPOI())->Clone();
1467 } else if(rpPoi == "RP")
1469 yieldPt = (TH1F*)(fCommonHists->GetHistPtRP())->Clone();
1474 printf("\n WARNING (GFC): yieldPt is NULL in AFAWC::CIF() !!!!\n");
1478 TH1D *flow2ndPt = (TH1D*)fDiffFlow[rp][0][0]->Clone();
1479 TH1D *flow4thPt = (TH1D*)fDiffFlow[rp][0][1]->Clone();
1480 TH1D *flow6thPt = (TH1D*)fDiffFlow[rp][0][2]->Clone();
1481 TH1D *flow8thPt = (TH1D*)fDiffFlow[rp][0][3]->Clone();
1482 Double_t dvn2nd = 0., dvn4th = 0., dvn6th = 0., dvn8th = 0.; // differential flow
1483 Double_t dErrvn2nd = 0., dErrvn4th = 0., dErrvn6th = 0., dErrvn8th = 0.; // error on differential flow
1484 Double_t dVn2nd = 0., dVn4th = 0., dVn6th = 0., dVn8th = 0.; // integrated flow
1485 Double_t dErrVn2nd = 0., dErrVn4th = 0., dErrVn6th = 0., dErrVn8th = 0.; // error on integrated flow
1486 Double_t dYield = 0.; // pt yield
1487 Double_t dSum2nd = 0., dSum4th = 0., dSum6th = 0., dSum8th = 0.; // needed for normalizing integrated flow
1488 fnBinsPt = flow2ndPt->GetXaxis()->GetNbins();
1489 // looping over pt bins:
1490 for(Int_t p=1;p<=fnBinsPt;p++)
1492 dvn2nd = flow2ndPt->GetBinContent(p);
1493 dvn4th = flow4thPt->GetBinContent(p);
1494 dvn6th = flow6thPt->GetBinContent(p);
1495 dvn8th = flow8thPt->GetBinContent(p);
1497 dErrvn2nd = flow2ndPt->GetBinError(p);
1498 dErrvn4th = flow4thPt->GetBinError(p);
1499 dErrvn6th = flow6thPt->GetBinError(p);
1500 dErrvn8th = flow8thPt->GetBinError(p);
1502 dYield = yieldPt->GetBinContent(p);
1504 dVn2nd += dvn2nd*dYield;
1505 dVn4th += dvn4th*dYield;
1506 dVn6th += dvn6th*dYield;
1507 dVn8th += dvn8th*dYield;
1514 dErrVn2nd += dYield*dYield*dErrvn2nd*dErrvn2nd;
1515 dErrVn4th += dYield*dYield*dErrvn4th*dErrvn4th;
1516 dErrVn6th += dYield*dYield*dErrvn6th*dErrvn6th;
1517 dErrVn8th += dYield*dYield*dErrvn8th*dErrvn8th;
1518 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
1520 // normalizing the results for integrated flow:
1524 dErrVn2nd /= (dSum2nd*dSum2nd);
1525 dErrVn2nd = TMath::Sqrt(dErrVn2nd);
1530 dErrVn4th /= (dSum4th*dSum4th);
1531 dErrVn4th = TMath::Sqrt(dErrVn4th);
1536 dErrVn6th /= (dSum6th*dSum6th);
1537 dErrVn6th = TMath::Sqrt(dErrVn6th);
1542 dErrVn8th /= (dSum8th*dSum8th);
1543 dErrVn8th = TMath::Sqrt(dErrVn8th);
1546 // storing the results for integrated flow in common hist results:
1549 fCommonHistsResults2nd->FillIntegratedFlowPOI(dVn2nd,dErrVn2nd);
1550 fCommonHistsResults4th->FillIntegratedFlowPOI(dVn4th,dErrVn4th);
1551 fCommonHistsResults6th->FillIntegratedFlowPOI(dVn6th,dErrVn6th);
1552 fCommonHistsResults8th->FillIntegratedFlowPOI(dVn8th,dErrVn8th);
1554 else if(rpPoi == "RP")
1556 fCommonHistsResults2nd->FillIntegratedFlowRP(dVn2nd,dErrVn2nd);
1557 fCommonHistsResults4th->FillIntegratedFlowRP(dVn4th,dErrVn4th);
1558 fCommonHistsResults6th->FillIntegratedFlowRP(dVn6th,dErrVn6th);
1559 fCommonHistsResults8th->FillIntegratedFlowRP(dVn8th,dErrVn8th);
1568 } // end of void AliFlowAnalysisWithCumulants::CalculateIntegratedFlow(TString rpPoi)
1570 //================================================================================================================
1572 void AliFlowAnalysisWithCumulants::FillCommonHistResultsForDifferentialFlow(TString rpPoi)
1574 // Fill common result histograms for differential flow.
1575 // (to be improved - this method can be implemented much better)
1582 } else if(rpPoi == "POI")
1588 for(Int_t p=1;p<=fnBinsPt;p++)
1591 Double_t v2 = fDiffFlow[rp][0][0]->GetBinContent(p);
1592 Double_t v4 = fDiffFlow[rp][0][1]->GetBinContent(p);
1593 Double_t v6 = fDiffFlow[rp][0][2]->GetBinContent(p);
1594 Double_t v8 = fDiffFlow[rp][0][3]->GetBinContent(p);
1596 Double_t v2Error = fDiffFlow[rp][0][0]->GetBinError(p);
1597 Double_t v4Error = fDiffFlow[rp][0][1]->GetBinError(p);
1598 Double_t v6Error = fDiffFlow[rp][0][2]->GetBinError(p);
1599 Double_t v8Error = fDiffFlow[rp][0][3]->GetBinError(p);
1600 // Fill common hist results:
1603 fCommonHistsResults2nd->FillDifferentialFlowPtRP(p,v2,v2Error);
1604 fCommonHistsResults4th->FillDifferentialFlowPtRP(p,v4,v4Error);
1605 fCommonHistsResults6th->FillDifferentialFlowPtRP(p,v6,v6Error);
1606 fCommonHistsResults8th->FillDifferentialFlowPtRP(p,v8,v8Error);
1607 } else if(rpPoi == "POI")
1609 fCommonHistsResults2nd->FillDifferentialFlowPtPOI(p,v2,v2Error);
1610 fCommonHistsResults4th->FillDifferentialFlowPtPOI(p,v4,v4Error);
1611 fCommonHistsResults6th->FillDifferentialFlowPtPOI(p,v6,v6Error);
1612 fCommonHistsResults8th->FillDifferentialFlowPtPOI(p,v8,v8Error);
1614 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
1617 for(Int_t e=1;e<=fnBinsEta;e++)
1620 Double_t v2 = fDiffFlow[rp][1][0]->GetBinContent(e);
1621 Double_t v4 = fDiffFlow[rp][1][1]->GetBinContent(e);
1622 Double_t v6 = fDiffFlow[rp][1][2]->GetBinContent(e);
1623 Double_t v8 = fDiffFlow[rp][1][3]->GetBinContent(e);
1625 Double_t v2Error = fDiffFlow[rp][1][0]->GetBinError(e);
1626 Double_t v4Error = fDiffFlow[rp][1][1]->GetBinError(e);
1627 Double_t v6Error = fDiffFlow[rp][1][2]->GetBinError(e);
1628 Double_t v8Error = fDiffFlow[rp][1][3]->GetBinError(e);
1629 // Fill common hist results:
1632 fCommonHistsResults2nd->FillDifferentialFlowEtaRP(e,v2,v2Error);
1633 fCommonHistsResults4th->FillDifferentialFlowEtaRP(e,v4,v4Error);
1634 fCommonHistsResults6th->FillDifferentialFlowEtaRP(e,v6,v6Error);
1635 fCommonHistsResults8th->FillDifferentialFlowEtaRP(e,v8,v8Error);
1636 } else if(rpPoi == "POI")
1638 fCommonHistsResults2nd->FillDifferentialFlowEtaPOI(e,v2,v2Error);
1639 fCommonHistsResults4th->FillDifferentialFlowEtaPOI(e,v4,v4Error);
1640 fCommonHistsResults6th->FillDifferentialFlowEtaPOI(e,v6,v6Error);
1641 fCommonHistsResults8th->FillDifferentialFlowEtaPOI(e,v8,v8Error);
1643 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
1645 } // end of void AliFlowAnalysisWithCumulants::FillCommonHistResultsForDifferentialFlow(TString rpPoi)
1647 //================================================================================================================
1649 void AliFlowAnalysisWithCumulants::CalculateDifferentialFlow(TString rpPoi, TString ptEta)
1651 // Calculate differential flow for RPs/POIs vs pt/eta from cumulants.
1653 Int_t rp = 0; // RP or POI
1654 Int_t pe = 0; // pt or eta
1659 } else if(rpPoi == "POI")
1666 } else if(ptEta == "eta")
1671 // Reference cumulants:
1672 Double_t gfc2 = fReferenceFlowCumulants->GetBinContent(1); // reference 2nd order cumulant
1673 Double_t gfc4 = fReferenceFlowCumulants->GetBinContent(2); // reference 4th order cumulant
1674 Double_t gfc6 = fReferenceFlowCumulants->GetBinContent(3); // reference 6th order cumulant
1675 Double_t gfc8 = fReferenceFlowCumulants->GetBinContent(4); // reference 8th order cumulant
1677 Int_t nBins = fDiffFlowCumulants[rp][pe][0]->GetXaxis()->GetNbins();
1679 for(Int_t b=1;b<=nBins;b++)
1681 // Differential cumulants:
1682 Double_t gfd2 = fDiffFlowCumulants[rp][pe][0]->GetBinContent(b); // differential 2nd order cumulant
1683 Double_t gfd4 = fDiffFlowCumulants[rp][pe][1]->GetBinContent(b); // differential 4th order cumulant
1684 Double_t gfd6 = fDiffFlowCumulants[rp][pe][2]->GetBinContent(b); // differential 6th order cumulant
1685 Double_t gfd8 = fDiffFlowCumulants[rp][pe][3]->GetBinContent(b); // differential 8th order cumulant
1686 // Differential flow:
1687 Double_t v2 = 0.; // v'{2,GFC}
1688 Double_t v4 = 0.; // v'{4,GFC}
1689 Double_t v6 = 0.; // v'{6,GFC}
1690 Double_t v8 = 0.; // v'{8,GFC}
1694 v2 = gfd2/pow(gfc2,0.5);
1695 fDiffFlow[rp][pe][0]->SetBinContent(b,v2);
1700 v4 = -gfd4/pow(-gfc4,.75);
1701 fDiffFlow[rp][pe][1]->SetBinContent(b,v4);
1706 v6 = gfd6/(4.*pow((1./4.)*gfc6,(5./6.)));
1707 fDiffFlow[rp][pe][2]->SetBinContent(b,v6);
1712 v8 = -gfd8/(33.*pow(-(1./33.)*gfc8,(7./8.)));
1713 fDiffFlow[rp][pe][3]->SetBinContent(b,v8);
1715 } // end of for(Int_t b=1;b<=nBins;b++)
1717 } // end of void AliFlowAnalysisWithCumulants::CalculateDifferentialFlow(TString rpPoi,TString ptEta)
1719 //================================================================================================================
1721 void AliFlowAnalysisWithCumulants::CalculateDifferentialFlowErrors(TString rpPoi,TString ptEta)
1723 // Calculate errors of differential flow.
1725 Int_t rp = 0; // RP or POI
1726 Int_t pe = 0; // pt or eta
1731 } else if(rpPoi == "POI")
1738 } else if(ptEta == "eta")
1744 Double_t chi2 = fChi->GetBinContent(1);
1745 Double_t chi4 = fChi->GetBinContent(2);
1746 //Double_t chi6 = fChi->GetBinContent(3);
1747 //Double_t chi8 = fChi->GetBinContent(4);
1749 Int_t nBins = fNoOfParticlesInBin[rp][pe]->GetXaxis()->GetNbins();
1750 for(Int_t b=1;b<=nBins;b++)
1752 Int_t nParticles = (Int_t)fNoOfParticlesInBin[rp][pe]->GetBinEntries(b);
1753 // Error of 2nd order estimate:
1754 if(chi2>0. && nParticles>0.)
1756 Double_t v2Error = pow((1./(2.*nParticles))*((1.+pow(chi2,2.))/pow(chi2,2.)),0.5);
1757 fDiffFlow[rp][pe][0]->SetBinError(b,v2Error);
1759 // Error of 4th order estimate:
1760 if(chi4>0. && nParticles>0.)
1762 Double_t v4Error = pow((1./(2.*nParticles))*((2.+6.*pow(chi4,2.)+pow(chi4,4.)+pow(chi4,6.))/pow(chi4,6.)),0.5);
1763 fDiffFlow[rp][pe][1]->SetBinError(b,v4Error);
1765 // Error of 6th order estimate:
1766 //if(chi6>0. && nParticles>0.)
1768 // Double_t v6Error = ... // to be improved - yet to be calculated
1769 fDiffFlow[rp][pe][2]->SetBinError(b,0.);
1771 // Error of 8th order estimate:
1772 //if(chi8>0. && nParticles>0.)
1774 // Double_t v8Error = ... // to be improved - yet to be calculated
1775 fDiffFlow[rp][pe][3]->SetBinError(b,0.);
1777 } // end of for(Int_t b=1;b<=nBins;b++)
1779 } // end of void AliFlowAnalysisWithCumulants::CalculateDifferentialFlowErrors(TString rpPoi,TString ptEta)
1781 //================================================================================================================
1783 void AliFlowAnalysisWithCumulants::CalculateCumulantsForDiffFlow(TString rpPoi,TString ptEta)
1785 // Calculate cumulants for differential flow.
1787 Int_t rp = 0; // RP or POI
1788 Int_t pe = 0; // pt or eta
1793 } else if(rpPoi == "POI")
1800 } else if(ptEta == "eta")
1805 // [nBins][pMax][qMax]:
1806 Int_t nBins = fDiffFlowGenFun[0][rp][pe]->GetXaxis()->GetNbins();
1807 Int_t pMax = fDiffFlowGenFun[0][rp][pe]->GetYaxis()->GetNbins();
1808 Int_t qMax = fDiffFlowGenFun[0][rp][pe]->GetZaxis()->GetNbins();
1810 TMatrixD dAvG(pMax,qMax);
1812 for(Int_t p=0;p<pMax;p++)
1814 for(Int_t q=0;q<qMax;q++)
1816 dAvG(p,q) = fReferenceFlowGenFun->GetBinContent(fReferenceFlowGenFun->GetBin(p+1,q+1));
1819 // Loop over pt/eta bins and calculate differential cumulants:
1820 for(Int_t b=0;b<nBins;b++)
1822 Double_t gfc[5] = {0.}; // to be improved (hardwired 5)
1823 Double_t dD[5] = {0.}; // D_{p} in Eq. (11) in Practical guide // to be improved (hardwired 5)
1824 // ptBinRPNoOfParticles[b]=fPtBinRPNoOfParticles->GetBinEntries(b+1);
1825 for(Int_t p=0;p<pMax;p++)
1827 Double_t tempSum = 0.;
1828 for(Int_t q=0;q<qMax;q++)
1830 if(TMath::Abs(dAvG(p,q))>1.e-44)
1832 Double_t dX = 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)
1833 Double_t dY = 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)
1834 tempSum += cos(fMultiple*2.*q*TMath::Pi()/qMax)*dX
1835 + sin(fMultiple*2.*q*TMath::Pi()/qMax)*dY;
1838 dD[p] = (pow(fR0*pow(p+1.0,0.5),fMultiple)/qMax)*tempSum;
1840 gfc[0] = (1./(fR0*fR0))*(5.*dD[0]-5.*dD[1]+(10./3.)*dD[2]-(5./4.)*dD[3]+(1./5.)*dD[4]);
1841 gfc[1] = (1./pow(fR0,4.))*((-77./6.)*dD[0]+(107./6.)*dD[1]-(13./1.)*dD[2]+(61./12.)*dD[3]-(5./6.)*dD[4]);
1842 gfc[2] = (1./pow(fR0,6.))*((71./2.)*dD[0]-59.*dD[1]+49.*dD[2]-(41./2.)*dD[3]+(7./2.)*dD[4]);
1843 gfc[3] = (1./pow(fR0,8.))*(-84.*dD[0]+156.*dD[1]-144.*dD[2]+66.*dD[3]-12.*dD[4]);
1844 // gfc[4] = (1./pow(fR0,10.))*(120.*dD[0]-240.*dD[1]+240.*dD[2]-120.*dD[3]+24.*dD[4]); // 10th order cumulant (to be improved - where to store it?)
1846 for(Int_t co=0;co<4;co++)
1848 fDiffFlowCumulants[rp][pe][co]->SetBinContent(b+1,gfc[co]);
1852 } // end of void AliFlowAnalysisWithCumulants::CalculateCumulantsForDiffFlow(TString rpPoi, TString ptEta)
1854 //================================================================================================================
1856 void AliFlowAnalysisWithCumulants::PrintFinalResults(TString type)
1858 // Printing on the screen the final results for reference flow and for integrated flow of RPs and POIs.
1860 Int_t n = fHarmonic;
1862 Double_t dVn[4] = {0.}; // array to hold Vn{2}, Vn{4}, Vn{6} and Vn{8}
1863 Double_t dVnErr[4] = {0.}; // array to hold errors of Vn{2}, Vn{4}, Vn{6} and Vn{8}
1867 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinContent(1);
1868 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinError(1);
1869 dVn[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinContent(1);
1870 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinError(1);
1871 dVn[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinContent(1);
1872 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinError(1);
1873 dVn[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinContent(1);
1874 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinError(1);
1875 } else if(type == "RP")
1877 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinContent(1);
1878 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinError(1);
1879 dVn[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinContent(1);
1880 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinError(1);
1881 dVn[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinContent(1);
1882 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinError(1);
1883 dVn[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinContent(1);
1884 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinError(1);
1885 } else if(type == "POI")
1887 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinContent(1);
1888 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinError(1);
1889 dVn[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinContent(1);
1890 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinError(1);
1891 dVn[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinContent(1);
1892 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinError(1);
1893 dVn[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinContent(1);
1894 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinError(1);
1898 cout<<" WARNING: Impossible type (can be RF, RP or POI) !!!!"<<endl;
1899 cout<<" Results will not be printed on the screen."<<endl;
1904 TString title = " flow estimates from GF-cumulants";
1905 TString subtitle = " (";
1907 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
1909 subtitle.Append(type);
1910 subtitle.Append(", without weights)");
1913 subtitle.Append(type);
1914 subtitle.Append(", with weights)");
1918 cout<<"*************************************"<<endl;
1919 cout<<"*************************************"<<endl;
1920 cout<<title.Data()<<endl;
1921 cout<<subtitle.Data()<<endl;
1924 for(Int_t i=0;i<4;i++)
1926 cout<<" v_"<<n<<"{"<<2*(i+1)<<"} = "<<dVn[i]<<" +/- "<<dVnErr[i]<<endl;
1932 cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultRP()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultRP()->GetMean()<<endl;
1934 else if (type == "RP")
1936 cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultRP()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultRP()->GetMean()<<endl;
1938 else if (type == "POI")
1940 cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultPOI()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultPOI()->GetMean()<<endl;
1942 cout<<"*************************************"<<endl;
1943 cout<<"*************************************"<<endl;
1946 } // end of AliFlowAnalysisWithCumulants::PrintFinalResults(TString type);
1948 //================================================================================================================
1950 void AliFlowAnalysisWithCumulants::FillCommonHistResultsForReferenceFlow()
1952 // Fill in AliFlowCommonHistResults dedicated histograms for reference flow.
1955 Double_t v2 = fReferenceFlow->GetBinContent(1);
1956 Double_t v4 = fReferenceFlow->GetBinContent(2);
1957 Double_t v6 = fReferenceFlow->GetBinContent(3);
1958 Double_t v8 = fReferenceFlow->GetBinContent(4);
1960 Double_t v2Error = fReferenceFlow->GetBinError(1);
1961 Double_t v4Error = fReferenceFlow->GetBinError(2);
1962 Double_t v6Error = fReferenceFlow->GetBinError(3);
1963 Double_t v8Error = fReferenceFlow->GetBinError(4);
1964 // Fill results end errors in common hist results:
1965 fCommonHistsResults2nd->FillIntegratedFlow(v2,v2Error);
1966 fCommonHistsResults4th->FillIntegratedFlow(v4,v4Error);
1967 fCommonHistsResults6th->FillIntegratedFlow(v6,v6Error);
1968 fCommonHistsResults8th->FillIntegratedFlow(v8,v8Error);
1970 Double_t chi2 = fChi->GetBinContent(1);
1971 Double_t chi4 = fChi->GetBinContent(2);
1972 Double_t chi6 = fChi->GetBinContent(3);
1973 Double_t chi8 = fChi->GetBinContent(4);
1974 // Fill resolution chi in common hist results:
1975 fCommonHistsResults2nd->FillChi(chi2);
1976 fCommonHistsResults4th->FillChi(chi4);
1977 fCommonHistsResults6th->FillChi(chi6);
1978 fCommonHistsResults8th->FillChi(chi8);
1980 } // end of AliFlowAnalysisWithCumulants::FillCommonHistResultsForReferenceFlow()
1982 //================================================================================================================
1984 void AliFlowAnalysisWithCumulants::CalculateReferenceFlowError()
1986 // Calculate error of reference flow harmonics.
1988 // Generating Function Cumulants:
1989 Double_t gfc2 = fReferenceFlowCumulants->GetBinContent(1); // GFC{2}
1990 Double_t gfc4 = fReferenceFlowCumulants->GetBinContent(2); // GFC{4}
1991 Double_t gfc6 = fReferenceFlowCumulants->GetBinContent(3); // GFC{6}
1992 Double_t gfc8 = fReferenceFlowCumulants->GetBinContent(4); // GFC{8}
1993 // Reference flow estimates:
1994 Double_t v2 = fReferenceFlow->GetBinContent(1); // v{2,GFC}
1995 Double_t v4 = fReferenceFlow->GetBinContent(2); // v{4,GFC}
1996 Double_t v6 = fReferenceFlow->GetBinContent(3); // v{6,GFC}
1997 Double_t v8 = fReferenceFlow->GetBinContent(4); // v{8,GFC}
1998 // Statistical errors of reference flow estimates:
1999 Double_t v2Error = 0.; // statistical error of v{2,GFC}
2000 Double_t v4Error = 0.; // statistical error of v{4,GFC}
2001 Double_t v6Error = 0.; // statistical error of v{6,GFC}
2002 Double_t v8Error = 0.; // statistical error of v{8,GFC}
2008 // <Q-vector stuff>:
2009 Double_t dAvQx = fQvectorComponents->GetBinContent(1); // <Q_x>
2010 Double_t dAvQy = fQvectorComponents->GetBinContent(2); // <Q_y>
2011 Double_t dAvQ2x = fQvectorComponents->GetBinContent(3); // <(Q_x)^2>
2012 Double_t dAvQ2y = fQvectorComponents->GetBinContent(4); // <(Q_y)^2>
2014 Double_t dAvw2 = 1.;
2017 dAvw2 = fAverageOfSquaredWeight->GetBinContent(1);
2018 if(TMath::Abs(dAvw2)<1.e-44)
2021 cout<<" WARNING (GFC): Average of squared weight is 0 in GFC. Most probably one of the histograms"<<endl;
2022 cout<<" in the file \"weights.root\" was empty. Nothing will be calculated !!!!"<<endl;
2026 // Calculating statistical error of v{2,GFC}:
2027 if(fnEvts>0. && fAvM>0. && dAvw2>0. && gfc2>=0.)
2029 if((dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow(gfc2,(1./2.))*(fAvM/dAvw2),2.)>0.))
2031 chi2 = (fAvM*v2)/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(v2*fAvM/dAvw2,2.),0.5);
2033 if(TMath::Abs(chi2)>1.e-44)
2035 v2Error = pow(((1./(2.*fAvM*fnEvts))*((1.+2.*pow(chi2,2))/(2.*pow(chi2,2)))),0.5);
2038 // Calculating statistical error of v{4,GFC}:
2039 if(fnEvts>0 && fAvM>0 && dAvw2>0 && gfc4<=0.)
2041 if((dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow(-gfc4,(1./4.))*(fAvM/dAvw2),2.)>0.))
2043 chi4 = (fAvM*v4)/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(v4*fAvM/dAvw2,2.),0.5);
2045 if(TMath::Abs(chi4)>1.e-44)
2047 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);
2050 // Calculating statistical error of v{6,GFC}:
2051 if(fnEvts>0 && fAvM>0 && dAvw2>0 && gfc6>=0.)
2053 if((dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow((1./4.)*gfc6,(1./6.))*(fAvM/dAvw2),2.)>0.))
2055 chi6 = (fAvM*v6)/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(v6*fAvM/dAvw2,2.),0.5);
2057 if(TMath::Abs(chi6)>1.e-44)
2059 v6Error = (1./(pow(2.*fAvM*fnEvts,0.5)))*pow((3.+18.*pow(chi6,2)+9.*pow(chi6,4.)+28.*pow(chi6,6.)
2060 +12.*pow(chi6,8.)+24.*pow(chi6,10.))/(24.*pow(chi6,10.)),0.5);
2063 // Calculating statistical error of v{8,GFC}:
2064 if(fnEvts>0 && fAvM>0 && dAvw2>0 && gfc8<=0.)
2066 if((dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow(-(1./33.)*gfc8,(1./8.))*(fAvM/dAvw2),2.)>0.))
2068 chi8=(fAvM*v8)/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(v8*fAvM/dAvw2,2.),0.5);
2070 if(TMath::Abs(chi8)>1.e-44)
2072 v8Error = (1./(pow(2.*fAvM*fnEvts,0.5)))*pow((12.+96.*pow(chi8,2.)+72.*pow(chi8,4.)+304.*pow(chi8,6.)
2073 +257.*pow(chi8,8.)+804.*pow(chi8,10.)+363.*pow(chi8,12.)+726.*pow(chi8,14.))/(726.*pow(chi8,14.)),0.5);
2077 // Store errors for reference flow:
2078 fReferenceFlow->SetBinError(1,v2Error);
2079 fReferenceFlow->SetBinError(2,v4Error);
2080 fReferenceFlow->SetBinError(3,v6Error);
2081 fReferenceFlow->SetBinError(4,v8Error);
2082 // Store resolution chi:
2083 fChi->SetBinContent(1,chi2);
2084 fChi->SetBinContent(2,chi4);
2085 fChi->SetBinContent(3,chi6);
2086 fChi->SetBinContent(4,chi8);
2088 } // end of void AliFlowAnalysisWithCumulants::CalculateReferenceFlowError()
2090 //================================================================================================================
2092 void AliFlowAnalysisWithCumulants::CalculateReferenceFlow()
2094 // Calculate from isotropic cumulants reference flow.
2096 // Generating Function Cumulants:
2097 Double_t gfc2 = fReferenceFlowCumulants->GetBinContent(1); // GFC{2}
2098 Double_t gfc4 = fReferenceFlowCumulants->GetBinContent(2); // GFC{4}
2099 Double_t gfc6 = fReferenceFlowCumulants->GetBinContent(3); // GFC{6}
2100 Double_t gfc8 = fReferenceFlowCumulants->GetBinContent(4); // GFC{8}
2101 // Reference flow estimates:
2102 Double_t v2 = 0.; // v{2,GFC}
2103 Double_t v4 = 0.; // v{4,GFC}
2104 Double_t v6 = 0.; // v{6,GFC}
2105 Double_t v8 = 0.; // v{8,GFC}
2106 // Calculate reference flow estimates from Q-cumulants:
2107 if(gfc2>=0.) v2 = pow(gfc2,1./2.);
2108 if(gfc4<=0.) v4 = pow(-1.*gfc4,1./4.);
2109 if(gfc6>=0.) v6 = pow((1./4.)*gfc6,1./6.);
2110 if(gfc8<=0.) v8 = pow((-1./33.)*gfc8,1./8.);
2111 // Store results for reference flow:
2112 fReferenceFlow->SetBinContent(1,v2);
2113 fReferenceFlow->SetBinContent(2,v4);
2114 fReferenceFlow->SetBinContent(3,v6);
2115 fReferenceFlow->SetBinContent(4,v8);
2117 } // end of void AliFlowAnalysisWithCumulants::CalculateReferenceFlow()
2119 //================================================================================================================
2121 void AliFlowAnalysisWithCumulants::CalculateCumulantsForReferenceFlow()
2123 // Calculate cumulants for reference flow.
2125 Int_t pMax = fReferenceFlowGenFun->GetXaxis()->GetNbins();
2126 Int_t qMax = fReferenceFlowGenFun->GetYaxis()->GetNbins();
2129 TMatrixD dAvG(pMax,qMax);
2131 Bool_t someAvGEntryIsNegative = kFALSE;
2132 for(Int_t p=0;p<pMax;p++)
2134 for(Int_t q=0;q<qMax;q++)
2136 dAvG(p,q) = fReferenceFlowGenFun->GetBinContent(fReferenceFlowGenFun->GetBin(p+1,q+1));
2139 someAvGEntryIsNegative = kTRUE;
2141 cout<<" WARNING: "<<Form("<G[%d][%d]> is negative !!!! GFC results are meaningless.",p,q)<<endl;
2147 // C[p][q] (generating function for the cumulants)
2148 TMatrixD dC(pMax,qMax);
2150 if(fAvM>0. && !someAvGEntryIsNegative)
2152 for(Int_t p=0;p<pMax;p++)
2154 for(Int_t q=0;q<qMax;q++)
2156 dC(p,q) = fAvM*(pow(dAvG(p,q),(1./fAvM))-1.);
2161 // Averaging the generating function for cumulants over azimuth
2162 // in order to eliminate detector effects.
2163 // <C[p][q]> (Remark: here <> stands for average over azimuth):
2164 TVectorD dAvC(pMax);
2166 for(Int_t p=0;p<pMax;p++)
2169 for(Int_t q=0;q<qMax;q++)
2173 dAvC[p] = temp/qMax;
2176 // Finally, the isotropic cumulants for reference flow:
2177 TVectorD cumulant(pMax);
2179 cumulant[0] = (-1./(60*fR0*fR0))*((-300.)*dAvC[0]+300.*dAvC[1]-200.*dAvC[2]+75.*dAvC[3]-12.*dAvC[4]);
2180 cumulant[1] = (-1./(6.*pow(fR0,4.)))*(154.*dAvC[0]-214.*dAvC[1]+156.*dAvC[2]-61.*dAvC[3]+10.*dAvC[4]);
2181 cumulant[2] = (3./(2.*pow(fR0,6.)))*(71.*dAvC[0]-118.*dAvC[1]+98.*dAvC[2]-41.*dAvC[3]+7.*dAvC[4]);
2182 cumulant[3] = (-24./pow(fR0,8.))*(14.*dAvC[0]-26.*dAvC[1]+24.*dAvC[2]-11.*dAvC[3]+2.*dAvC[4]);
2183 cumulant[4] = (120./pow(fR0,10.))*(5.*dAvC[0]-10.*dAvC[1]+10.*dAvC[2]-5.*dAvC[3]+1.*dAvC[4]);
2186 // Remark: the highest order cumulant is on purpose in the overflow.
2187 for(Int_t co=0;co<pMax;co++) // cumulant order
2189 fReferenceFlowCumulants->SetBinContent(co+1,cumulant[co]);
2192 // Calculation versus multiplicity:
2193 if(!fCalculateVsMultiplicity){return;}
2194 for(Int_t b=0;b<fnBinsMult;b++)
2196 fAvM = fAvMVsM->GetBinContent(b+1);
2198 TMatrixD dAvGVsM(pMax,qMax);
2200 Bool_t someAvGEntryIsNegativeVsM = kFALSE;
2201 for(Int_t p=0;p<pMax;p++)
2203 for(Int_t q=0;q<qMax;q++)
2205 dAvGVsM(p,q) = fReferenceFlowGenFunVsM->GetBinContent(fReferenceFlowGenFunVsM->GetBin(b+1,p+1,q+1));
2208 someAvGEntryIsNegativeVsM = kTRUE;
2210 cout<<" WARNING: "<<Form("<G[%d][%d]> is negative !!!! GFC vs multiplicity results are meaningless.",p,q)<<endl;
2216 // C[p][q] (generating function for the cumulants)
2217 TMatrixD dCVsM(pMax,qMax);
2219 if(fAvM>0. && !someAvGEntryIsNegativeVsM)
2221 for(Int_t p=0;p<pMax;p++)
2223 for(Int_t q=0;q<qMax;q++)
2225 dCVsM(p,q) = fAvM*(pow(dAvGVsM(p,q),(1./fAvM))-1.);
2230 // Averaging the generating function for cumulants over azimuth
2231 // in order to eliminate detector effects.
2232 // <C[p][q]> (Remark: here <> stands for average over azimuth):
2233 TVectorD dAvCVsM(pMax);
2235 for(Int_t p=0;p<pMax;p++)
2237 Double_t tempVsM = 0.;
2238 for(Int_t q=0;q<qMax;q++)
2240 tempVsM += 1.*dCVsM(p,q);
2242 dAvCVsM[p] = tempVsM/qMax;
2245 // Finally, the isotropic cumulants for reference flow:
2246 TVectorD cumulantVsM(pMax);
2248 cumulantVsM[0] = (-1./(60*fR0*fR0))*((-300.)*dAvCVsM[0]+300.*dAvCVsM[1]-200.*dAvCVsM[2]+75.*dAvCVsM[3]-12.*dAvCVsM[4]);
2249 cumulantVsM[1] = (-1./(6.*pow(fR0,4.)))*(154.*dAvCVsM[0]-214.*dAvCVsM[1]+156.*dAvCVsM[2]-61.*dAvCVsM[3]+10.*dAvCVsM[4]);
2250 cumulantVsM[2] = (3./(2.*pow(fR0,6.)))*(71.*dAvCVsM[0]-118.*dAvCVsM[1]+98.*dAvCVsM[2]-41.*dAvCVsM[3]+7.*dAvCVsM[4]);
2251 cumulantVsM[3] = (-24./pow(fR0,8.))*(14.*dAvCVsM[0]-26.*dAvCVsM[1]+24.*dAvCVsM[2]-11.*dAvCVsM[3]+2.*dAvCVsM[4]);
2252 cumulantVsM[4] = (120./pow(fR0,10.))*(5.*dAvCVsM[0]-10.*dAvCVsM[1]+10.*dAvCVsM[2]-5.*dAvCVsM[3]+1.*dAvCVsM[4]);
2255 for(Int_t co=0;co<pMax-1;co++) // cumulant order
2257 fReferenceFlowCumulantsVsM[co]->SetBinContent(b+1,cumulantVsM[co]);
2259 } // end of for(Int_t b=0;b<fnBinsMult;b++)
2261 } // end of void AliFlowAnalysisWithCumulants::CalculateCumulantsForReferenceFlow()
2263 //================================================================================================================
2265 void AliFlowAnalysisWithCumulants::GetAvMultAndNoOfEvts()
2267 // From relevant common control histogram get average multiplicity of RPs and number of events.
2269 fAvM = (Double_t)fCommonHists->GetHistMultRP()->GetMean();
2270 fnEvts = (Int_t)fCommonHists->GetHistMultRP()->GetEntries();
2272 } // end of void AliFlowAnalysisWithCumulants::GetAvMultAndNoOfEvts()
2274 //================================================================================================================
2276 void AliFlowAnalysisWithCumulants::InitializeArrays()
2278 // Initialize all arrays.
2280 for(Int_t ri=0;ri<2;ri++)
2282 for(Int_t rp=0;rp<2;rp++)
2284 for(Int_t pe=0;pe<2;pe++)
2286 fDiffFlowGenFun[ri][rp][pe] = NULL;
2290 for(Int_t rp=0;rp<2;rp++)
2292 for(Int_t pe=0;pe<2;pe++)
2294 fNoOfParticlesInBin[rp][pe] = NULL;
2297 for(Int_t rp=0;rp<2;rp++)
2299 for(Int_t pe=0;pe<2;pe++)
2301 for(Int_t co=0;co<4;co++)
2303 fDiffFlowCumulants[rp][pe][co] = NULL;
2304 fDiffFlow[rp][pe][co] = NULL;
2308 for(Int_t i=0;i<3;i++)
2310 fPrintFinalResults[i] = kTRUE;
2312 for(Int_t r=0;r<10;r++)
2315 for(Int_t pq=0;pq<5;pq++)
2317 fTuningGenFun[r][pq] = NULL;
2318 fTuningCumulants[r][pq] = NULL;
2319 fTuningFlow[r][pq] = NULL;
2322 for(Int_t co=0;co<4;co++)
2324 fReferenceFlowCumulantsVsM[co] = NULL;
2327 } // end of void AliFlowAnalysisWithCumulants::InitializeArrays()
2329 //================================================================================================================
2331 void AliFlowAnalysisWithCumulants::CrossCheckSettings()
2333 // Cross-check the user settings before starting.
2335 // a) Cross check if the choice for multiplicity weight make sense.
2337 // a) Cross check if the choice for multiplicity weight make sense:
2338 if(strcmp(fMultiplicityWeight->Data(),"unit") &&
2339 strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2342 cout<<"WARNING (GFC): Multiplicity weight can be either \"unit\" or \"multiplicity\"."<<endl;
2343 cout<<" Certainly not \""<<fMultiplicityWeight->Data()<<"\"."<<endl;
2350 } // end of void AliFlowAnalysisWithCumulants::CrossCheckSettings()
2352 //================================================================================================================
2354 void AliFlowAnalysisWithCumulants::AccessConstants()
2356 // Access needed common constants from AliFlowCommonConstants.
2358 fnBinsPhi = AliFlowCommonConstants::GetMaster()->GetNbinsPhi();
2359 fPhiMin = AliFlowCommonConstants::GetMaster()->GetPhiMin();
2360 fPhiMax = AliFlowCommonConstants::GetMaster()->GetPhiMax();
2361 if(fnBinsPhi) fPhiBinWidth = (fPhiMax-fPhiMin)/fnBinsPhi;
2362 fnBinsPt = AliFlowCommonConstants::GetMaster()->GetNbinsPt();
2363 fPtMin = AliFlowCommonConstants::GetMaster()->GetPtMin();
2364 fPtMax = AliFlowCommonConstants::GetMaster()->GetPtMax();
2365 if(fnBinsPt) fPtBinWidth = (fPtMax-fPtMin)/fnBinsPt;
2366 fnBinsEta = AliFlowCommonConstants::GetMaster()->GetNbinsEta();
2367 fEtaMin = AliFlowCommonConstants::GetMaster()->GetEtaMin();
2368 fEtaMax = AliFlowCommonConstants::GetMaster()->GetEtaMax();
2369 if(fnBinsEta) fEtaBinWidth = (fEtaMax-fEtaMin)/fnBinsEta;
2371 } // end of void AliFlowAnalysisWithCumulants::AccessConstants()
2373 //================================================================================================================
2375 void AliFlowAnalysisWithCumulants::BookAndFillWeightsHistograms()
2377 // Book and fill histograms which hold phi, pt and eta weights.
2381 cout<<"WARNING (GFC): fWeightsList is NULL in AFAWGFC::BAFWH() !!!!"<<endl;
2387 if(fWeightsList->FindObject("phi_weights"))
2389 fPhiWeights = dynamic_cast<TH1F*>(fWeightsList->FindObject("phi_weights"));
2390 if(!fPhiWeights){printf("\n WARNING (GFC): !fPhiWeights !!!!\n");exit(0);}
2391 if(TMath::Abs(fPhiWeights->GetBinWidth(1)-fPhiBinWidth)>pow(10.,-6.))
2394 cout<<"WARNING (GFC): Inconsistent binning in histograms for phi-weights throughout the code."<<endl;
2401 cout<<"WARNING (GFC): fWeightsList->FindObject(\"phi_weights\") is NULL in AFAWGFC::BAFWH() !!!!"<<endl;
2405 } // end of if(fUsePhiWeights)
2409 if(fWeightsList->FindObject("pt_weights"))
2411 fPtWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("pt_weights"));
2412 if(!fPtWeights){printf("\n WARNING (GFC): !fPtWeights !!!!\n");exit(0);}
2413 if(TMath::Abs(fPtWeights->GetBinWidth(1)-fPtBinWidth)>pow(10.,-6.))
2416 cout<<"WARNING (GFC): Inconsistent binning in histograms for pt-weights throughout the code."<<endl;
2423 cout<<"WARNING (GFC): fWeightsList->FindObject(\"pt_weights\") is NULL in AFAWGFC::BAFWH() !!!!"<<endl;
2427 } // end of if(fUsePtWeights)
2431 if(fWeightsList->FindObject("eta_weights"))
2433 fEtaWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("eta_weights"));
2434 if(!fEtaWeights){printf("\n WARNING (GFC): !fEtaWeights !!!!\n");exit(0);}
2435 if(TMath::Abs(fEtaWeights->GetBinWidth(1)-fEtaBinWidth)>pow(10.,-6.))
2438 cout<<"WARNING (GFC): Inconsistent binning in histograms for eta-weights throughout the code."<<endl;
2445 cout<<"WARNING (GFC): fUseEtaWeights && fWeightsList->FindObject(\"eta_weights\") is NULL in AFAWGFC::BAFWH() !!!!"<<endl;
2449 } // end of if(fUseEtaWeights)
2451 } // end of AliFlowAnalysisWithCumulants::BookAndFillWeightsHistograms()
2453 //================================================================================================================
2455 void AliFlowAnalysisWithCumulants::BookEverythingForCalculationVsMultiplicity()
2457 // Book all objects relevant for flow analysis versus multiplicity.
2459 // a) Define constants;
2460 // b) Book all profiles;
2461 // c) Book all results.
2463 // a) Define constants and local flags:
2466 TString cumulantFlag[4] = {"GFC{2}","GFC{4}","GFC{6}","GFC{8}"};
2468 // b) Book all profiles:
2469 // Average of the generating function for reference flow <G[p][q]> versus multiplicity:
2470 fReferenceFlowGenFunVsM = new TProfile3D("fReferenceFlowGenFunVsM","#LTG[p][q]#GT vs M",fnBinsMult,fMinMult,fMaxMult,pMax,0.,(Double_t)pMax,qMax,0.,(Double_t)qMax);
2471 fReferenceFlowGenFunVsM->SetXTitle("M");
2472 fReferenceFlowGenFunVsM->SetYTitle("p");
2473 fReferenceFlowGenFunVsM->SetZTitle("q");
2474 fReferenceFlowProfiles->Add(fReferenceFlowGenFunVsM);
2475 // Averages of Q-vector components versus multiplicity:
2476 fQvectorComponentsVsM = new TProfile2D("fQvectorComponentsVsM","Averages of Q-vector components",fnBinsMult,fMinMult,fMaxMult,4,0.,4.);
2477 //fQvectorComponentsVsM->SetLabelSize(0.06);
2478 fQvectorComponentsVsM->SetMarkerStyle(25);
2479 fQvectorComponentsVsM->SetXTitle("M");
2480 fQvectorComponentsVsM->GetYaxis()->SetBinLabel(1,"#LTQ_{x}#GT"); // Q_{x}
2481 fQvectorComponentsVsM->GetYaxis()->SetBinLabel(2,"#LTQ_{y}#GT"); // Q_{y}
2482 fQvectorComponentsVsM->GetYaxis()->SetBinLabel(3,"#LTQ_{x}^{2}#GT"); // Q_{x}^{2}
2483 fQvectorComponentsVsM->GetYaxis()->SetBinLabel(4,"#LTQ_{y}^{2}#GT"); // Q_{y}^{2}
2484 fReferenceFlowProfiles->Add(fQvectorComponentsVsM);
2485 // <<w^2>>, where w = wPhi*wPt*wEta versus multiplicity:
2486 fAverageOfSquaredWeightVsM = new TProfile2D("fAverageOfSquaredWeightVsM","#LT#LTw^{2}#GT#GT",fnBinsMult,fMinMult,fMaxMult,1,0,1);
2487 fAverageOfSquaredWeightVsM->SetLabelSize(0.06);
2488 fAverageOfSquaredWeightVsM->SetMarkerStyle(25);
2489 fAverageOfSquaredWeightVsM->SetLabelOffset(0.01);
2490 fAverageOfSquaredWeightVsM->GetXaxis()->SetBinLabel(1,"#LT#LTw^{2}#GT#GT");
2491 fReferenceFlowProfiles->Add(fAverageOfSquaredWeightVsM);
2492 // <M> vs multiplicity bin:
2493 fAvMVsM = new TProfile("fAvMVsM","#LTM#GT vs M",fnBinsMult,fMinMult,fMaxMult);
2494 //fAvMVsM->SetLabelSize(0.06);
2495 fAvMVsM->SetMarkerStyle(25);
2496 fAvMVsM->SetLabelOffset(0.01);
2497 fAvMVsM->SetXTitle("M");
2498 fAvMVsM->SetYTitle("#LTM#GT");
2499 fReferenceFlowProfiles->Add(fAvMVsM);
2501 // c) Book all results:
2502 // Final results for reference GF-cumulants versus multiplicity:
2503 TString referenceFlowCumulantsVsMName = "fReferenceFlowCumulantsVsM";
2504 for(Int_t co=0;co<4;co++) // cumulant order
2506 fReferenceFlowCumulantsVsM[co] = new TH1D(Form("%s, %s",referenceFlowCumulantsVsMName.Data(),cumulantFlag[co].Data()),
2507 Form("%s vs multipicity",cumulantFlag[co].Data()),
2508 fnBinsMult,fMinMult,fMaxMult);
2509 fReferenceFlowCumulantsVsM[co]->SetMarkerStyle(25);
2510 fReferenceFlowCumulantsVsM[co]->GetXaxis()->SetTitle("M");
2511 fReferenceFlowCumulantsVsM[co]->GetYaxis()->SetTitle(cumulantFlag[co].Data());
2512 fReferenceFlowResults->Add(fReferenceFlowCumulantsVsM[co]);
2513 } // end of for(Int_t co=0;co<4;co++) // cumulant order
2515 } // end of void AliFlowAnalysisWithCumulants::BookEverythingForCalculationVsMultiplicity()
2517 //================================================================================================================
2519 void AliFlowAnalysisWithCumulants::BookEverythingForReferenceFlow()
2521 // Book all objects relevant for calculation of reference flow.
2523 // a) Define static constants for array's boundaries;
2524 // b) Book profile to hold all flags for reference flow;
2525 // c) Book all event-by-event quantities;
2526 // d) Book all profiles;
2527 // e) Book all histograms.
2529 // a) Define static constants for array's boundaries:
2530 static const Int_t pMax = 5;
2531 static const Int_t qMax = 11;
2533 // b) Book profile to hold all flags for reference flow:
2534 TString referenceFlowFlagsName = "fReferenceFlowFlags";
2535 fReferenceFlowFlags = new TProfile(referenceFlowFlagsName.Data(),"Flags for Reference Flow",2,0,2);
2536 fReferenceFlowFlags->SetTickLength(-0.01,"Y");
2537 fReferenceFlowFlags->SetMarkerStyle(25);
2538 fReferenceFlowFlags->SetLabelSize(0.05);
2539 fReferenceFlowFlags->SetLabelOffset(0.02,"Y");
2540 fReferenceFlowFlags->GetXaxis()->SetBinLabel(1,"Particle weights");
2541 fReferenceFlowFlags->GetXaxis()->SetBinLabel(2,"Event weights");
2542 fReferenceFlowList->Add(fReferenceFlowFlags);
2544 // c) Book all event-by-event quantities:
2545 fGEBE = new TMatrixD(pMax,qMax);
2547 // d) Book all profiles:
2548 // Average of the generating function for reference flow <G[p][q]>:
2549 fReferenceFlowGenFun = new TProfile2D("fReferenceFlowGenFun","#LTG[p][q]#GT",pMax,0.,(Double_t)pMax,qMax,0.,(Double_t)qMax);
2550 fReferenceFlowGenFun->SetXTitle("p");
2551 fReferenceFlowGenFun->SetYTitle("q");
2552 fReferenceFlowProfiles->Add(fReferenceFlowGenFun);
2553 // Averages of Q-vector components:
2554 fQvectorComponents = new TProfile("fQvectorComponents","Averages of Q-vector components",4,0.,4.);
2555 fQvectorComponents->SetLabelSize(0.06);
2556 fQvectorComponents->SetMarkerStyle(25);
2557 fQvectorComponents->GetXaxis()->SetBinLabel(1,"#LTQ_{x}#GT"); // Q_{x}
2558 fQvectorComponents->GetXaxis()->SetBinLabel(2,"#LTQ_{y}#GT"); // Q_{y}
2559 fQvectorComponents->GetXaxis()->SetBinLabel(3,"#LTQ_{x}^{2}#GT"); // Q_{x}^{2}
2560 fQvectorComponents->GetXaxis()->SetBinLabel(4,"#LTQ_{y}^{2}#GT"); // Q_{y}^{2}
2561 fReferenceFlowProfiles->Add(fQvectorComponents);
2562 // <<w^2>>, where w = wPhi*wPt*wEta:
2563 fAverageOfSquaredWeight = new TProfile("fAverageOfSquaredWeight","#LT#LTw^{2}#GT#GT",1,0,1);
2564 fAverageOfSquaredWeight->SetLabelSize(0.06);
2565 fAverageOfSquaredWeight->SetMarkerStyle(25);
2566 fAverageOfSquaredWeight->SetLabelOffset(0.01);
2567 fAverageOfSquaredWeight->GetXaxis()->SetBinLabel(1,"#LT#LTw^{2}#GT#GT");
2568 fReferenceFlowProfiles->Add(fAverageOfSquaredWeight);
2570 // e) Book all histograms:
2571 // Final results for isotropic cumulants for reference flow:
2572 TString referenceFlowCumulantsName = "fReferenceFlowCumulants";
2573 fReferenceFlowCumulants = new TH1D(referenceFlowCumulantsName.Data(),"Isotropic Generating Function Cumulants for reference flow",4,0,4); // to be improved (hw 4)
2574 fReferenceFlowCumulants->SetLabelSize(0.05);
2575 fReferenceFlowCumulants->SetMarkerStyle(25);
2576 fReferenceFlowCumulants->GetXaxis()->SetBinLabel(1,"GFC{2}");
2577 fReferenceFlowCumulants->GetXaxis()->SetBinLabel(2,"GFC{4}");
2578 fReferenceFlowCumulants->GetXaxis()->SetBinLabel(3,"GFC{6}");
2579 fReferenceFlowCumulants->GetXaxis()->SetBinLabel(4,"GFC{8}");
2580 fReferenceFlowResults->Add(fReferenceFlowCumulants);
2581 // Final results for reference flow:
2582 fReferenceFlow = new TH1D("fReferenceFlow","Reference flow",4,0,4); // to be improved (hardwired 4)
2583 fReferenceFlow->SetLabelSize(0.05);
2584 fReferenceFlow->SetMarkerStyle(25);
2585 fReferenceFlow->GetXaxis()->SetBinLabel(1,"v_{n}{2,GFC}");
2586 fReferenceFlow->GetXaxis()->SetBinLabel(2,"v_{n}{4,GFC}");
2587 fReferenceFlow->GetXaxis()->SetBinLabel(3,"v_{n}{6,GFC}");
2588 fReferenceFlow->GetXaxis()->SetBinLabel(4,"v_{n}{8,GFC}");
2589 fReferenceFlowResults->Add(fReferenceFlow);
2590 // Final results for resolution:
2591 fChi = new TH1D("fChi","Resolution",4,0,4); // to be improved (hardwired 4)
2592 fChi->SetLabelSize(0.06);
2593 fChi->SetMarkerStyle(25);
2594 fChi->GetXaxis()->SetBinLabel(1,"#chi_{2}");
2595 fChi->GetXaxis()->SetBinLabel(2,"#chi_{4}");
2596 fChi->GetXaxis()->SetBinLabel(3,"#chi_{6}");
2597 fChi->GetXaxis()->SetBinLabel(4,"#chi_{8}");
2598 fReferenceFlowResults->Add(fChi);
2600 } // end of void AliFlowAnalysisWithCumulants::BookEverythingForReferenceFlow()
2602 //================================================================================================================
2604 void AliFlowAnalysisWithCumulants::BookEverythingForTuning()
2606 // Book all objects relevant for tuning.
2608 // a) Define pMax's and qMax's:
2609 // b) Book profile to hold all tuning parameters and flags;
2610 // c) Book all profiles;
2611 // d) Book all histograms.
2613 // a) Define pMax's and qMax's:
2614 Int_t pMax[5] = {2,3,4,5,8};
2615 Int_t qMax[5] = {5,7,9,11,17};
2617 // b) Book profile to hold all tuning parameters and flags:
2618 TString tuningFlagsName = "fTuningFlags";
2619 fTuningFlags = new TProfile(tuningFlagsName.Data(),"Tuning parameters",10,0,10);
2620 // fTuningFlags->SetTickLength(-0.01,"Y");
2621 fTuningFlags->SetMarkerStyle(25);
2622 fTuningFlags->SetLabelSize(0.05);
2623 fTuningFlags->SetLabelOffset(0.02,"X");
2624 for(Int_t r=1;r<=10;r++)
2626 fTuningFlags->GetXaxis()->SetBinLabel(r,Form("r_{0,%d}",r-1));
2627 fTuningFlags->Fill(r-0.5,fTuningR0[r-1],1.);
2629 fTuningList->Add(fTuningFlags);
2631 // c) Book all profiles:
2632 // Average of the generating function for reference flow <G[p][q]> for different tuning parameters:
2633 for(Int_t r=0;r<10;r++)
2635 for(Int_t pq=0;pq<5;pq++)
2637 fTuningGenFun[r][pq] = new TProfile2D(Form("fTuningGenFun (r_{0,%i}, pq set %i)",r,pq),
2638 Form("#LTG[p][q]#GT for r_{0} = %f, p_{max} = %i, q_{max} = %i",fTuningR0[r],pMax[pq],qMax[pq]),
2639 pMax[pq],0.,(Double_t)pMax[pq],qMax[pq],0.,(Double_t)qMax[pq]);
2640 fTuningGenFun[r][pq]->SetXTitle("p");
2641 fTuningGenFun[r][pq]->SetYTitle("q");
2642 fTuningProfiles->Add(fTuningGenFun[r][pq]);
2645 // Average multiplicities for events with nRPs >= cuttof:
2646 fTuningAvM = new TProfile("fTuningAvM","Average multiplicity",5,0,5);
2647 fTuningAvM->SetMarkerStyle(25);
2648 for(Int_t b=1;b<=5;b++)
2650 fTuningAvM->GetXaxis()->SetBinLabel(b,Form("nRP #geq %i",2*pMax[b-1]));
2652 fTuningProfiles->Add(fTuningAvM);
2654 // d) Book all histograms:
2655 // Final results for isotropic cumulants for reference flow for different tuning parameters:
2656 for(Int_t r=0;r<10;r++)
2658 for(Int_t pq=0;pq<5;pq++)
2660 fTuningCumulants[r][pq] = new TH1D(Form("fTuningCumulants (r_{0,%i}, pq set %i)",r,pq),
2661 Form("GFC for r_{0} = %f, p_{max} = %i, q_{max} = %i",fTuningR0[r],pMax[pq],qMax[pq]),
2662 pMax[pq],0,pMax[pq]);
2663 // fTuningCumulants[r][pq]->SetLabelSize(0.05);
2664 fTuningCumulants[r][pq]->SetMarkerStyle(25);
2665 for(Int_t b=1;b<=pMax[pq];b++)
2667 fTuningCumulants[r][pq]->GetXaxis()->SetBinLabel(b,Form("GFC{%i}",2*b));
2669 fTuningResults->Add(fTuningCumulants[r][pq]);
2672 // Final results for reference flow for different tuning parameters:
2673 for(Int_t r=0;r<10;r++)
2675 for(Int_t pq=0;pq<5;pq++)
2677 fTuningFlow[r][pq] = new TH1D(Form("fTuningFlow (r_{0,%i}, pq set %i)",r,pq),
2678 Form("Reference flow for r_{0} = %f, p_{max} = %i, q_{max} = %i",fTuningR0[r],pMax[pq],qMax[pq]),
2679 pMax[pq],0,pMax[pq]);
2680 // fTuningFlow[r][pq]->SetLabelSize(0.06);
2681 fTuningFlow[r][pq]->SetMarkerStyle(25);
2682 for(Int_t b=1;b<=pMax[pq];b++)
2684 fTuningFlow[r][pq]->GetXaxis()->SetBinLabel(b,Form("v{%i,GFC}",2*b));
2686 fTuningResults->Add(fTuningFlow[r][pq]);
2690 } // end of void AliFlowAnalysisWithCumulants::BookEverythingForTuning()
2692 //================================================================================================================
2694 void AliFlowAnalysisWithCumulants::BookEverythingForDiffFlow()
2696 // Book all objects relevant for calculation of differential flow.
2698 // a) Define static constants for array's boundaries;
2699 // b) Define local variables and local flags for booking;
2700 // c) Book profile to hold all flags for differential flow;
2701 // d) Book all event-by-event quantities;
2702 // e) Book all profiles;
2703 // f) Book all histograms.
2705 // a) Define static constants for array's boundaries:
2706 static const Int_t pMax = 5;
2707 static const Int_t qMax = 11;
2709 // b) Define local variables and local flags for booking:
2710 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
2711 Double_t minPtEta[2] = {fPtMin,fEtaMin};
2712 Double_t maxPtEta[2] = {fPtMax,fEtaMax};
2713 TString reIm[2] = {"Re","Im"};
2714 TString rpPoi[2] = {"RP","POI"};
2715 TString ptEta[2] = {"p_{t}","#eta"};
2716 TString order[4] = {"2nd order","4th order","6th order","8th order"};
2718 // c) Book profile to hold all flags for differential flow:
2719 TString diffFlowFlagsName = "fDiffFlowFlags";
2720 fDiffFlowFlags = new TProfile(diffFlowFlagsName.Data(),"Flags for Differential Flow",1,0,1);
2721 fDiffFlowFlags->SetTickLength(-0.01,"Y");
2722 fDiffFlowFlags->SetMarkerStyle(25);
2723 fDiffFlowFlags->SetLabelSize(0.05);
2724 fDiffFlowFlags->SetLabelOffset(0.02,"Y");
2725 fDiffFlowFlags->GetXaxis()->SetBinLabel(1,"...");
2726 fDiffFlowList->Add(fDiffFlowFlags);
2728 // d) Book all event-by-event quantities:
2729 // ... (to be improved - perhaps not needed)
2731 // e) Book all profiles:
2732 // Generating functions for differential flow:
2733 for(Int_t ri=0;ri<2;ri++)
2735 for(Int_t rp=0;rp<2;rp++)
2737 for(Int_t pe=0;pe<2;pe++)
2739 fDiffFlowGenFun[ri][rp][pe] = new TProfile3D(Form("fDiffFlowGenFun (%s, %s, %s)",reIm[ri].Data(),rpPoi[rp].Data(),ptEta[pe].Data()),
2740 Form("#LT%s[D[%s-bin][p][q]]#GT for %ss",reIm[ri].Data(),ptEta[pe].Data(),rpPoi[rp].Data()),
2741 nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe],pMax,0.,(Double_t)pMax,qMax,0.,(Double_t)qMax);
2742 fDiffFlowGenFun[ri][rp][pe]->SetXTitle(ptEta[pe].Data());
2743 fDiffFlowGenFun[ri][rp][pe]->SetYTitle("p");
2744 fDiffFlowGenFun[ri][rp][pe]->SetZTitle("q");
2745 fDiffFlowGenFun[ri][rp][pe]->SetTitleOffset(1.44,"X");
2746 fDiffFlowGenFun[ri][rp][pe]->SetTitleOffset(1.44,"Y");
2747 fDiffFlowProfiles->Add(fDiffFlowGenFun[ri][rp][pe]);
2748 // to be improved - alternative // nBinsPtEta[pe],(Double_t)(fPtMin/fPtBinWidth),(Double_t)(fPtMax/fPtBinWidth),pMax,0.,(Double_t)pMax,qMax,0.,(Double_t)qMax);
2752 // Number of particles in pt/eta bin for RPs/POIs:
2753 for(Int_t rp=0;rp<2;rp++)
2755 for(Int_t pe=0;pe<2;pe++)
2757 fNoOfParticlesInBin[rp][pe] = new TProfile(Form("fNoOfParticlesInBin (%s, %s)",rpPoi[rp].Data(),ptEta[pe].Data()),
2758 Form("Number of %ss per %s bin",rpPoi[rp].Data(),ptEta[pe].Data()),
2759 nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
2760 fNoOfParticlesInBin[rp][pe]->SetXTitle(ptEta[pe].Data());
2761 fDiffFlowProfiles->Add(fNoOfParticlesInBin[rp][pe]);
2764 // Differential cumulants per pt/eta bin for RPs/POIs:
2765 for(Int_t rp=0;rp<2;rp++)
2767 for(Int_t pe=0;pe<2;pe++)
2769 for(Int_t co=0;co<4;co++)
2771 fDiffFlowCumulants[rp][pe][co] = new TH1D(Form("fDiffFlowCumulants (%s, %s, %s)",rpPoi[rp].Data(),ptEta[pe].Data(),order[co].Data()),
2772 Form("Differential %s cumulant for %ss vs %s",order[co].Data(),rpPoi[rp].Data(),ptEta[pe].Data()),
2773 nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
2774 fDiffFlowCumulants[rp][pe][co]->SetXTitle(ptEta[pe].Data());
2775 fDiffFlowResults->Add(fDiffFlowCumulants[rp][pe][co]);
2779 // Differential flow per pt/eta bin for RPs/POIs:
2780 for(Int_t rp=0;rp<2;rp++)
2782 for(Int_t pe=0;pe<2;pe++)
2784 for(Int_t co=0;co<4;co++)
2786 fDiffFlow[rp][pe][co] = new TH1D(Form("fDiffFlow (%s, %s, %s)",rpPoi[rp].Data(),ptEta[pe].Data(),order[co].Data()),
2787 Form("Differential flow from %s cumulant for %ss vs %s",order[co].Data(),rpPoi[rp].Data(),ptEta[pe].Data()),
2788 nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
2789 fDiffFlow[rp][pe][co]->SetXTitle(ptEta[pe].Data());
2790 fDiffFlowResults->Add(fDiffFlow[rp][pe][co]);
2795 }// end of void AliFlowAnalysisWithCumulants::BookEverythingForDiffFlow()
2797 //================================================================================================================
2799 void AliFlowAnalysisWithCumulants::StoreReferenceFlowFlags()
2801 // Store all flags for reference flow in profile fReferenceFlowFlags.
2803 if(!fReferenceFlowFlags)
2806 cout<<"WARNING: !fReferenceFlowFlags is NULL in AFAWC::SRFF() !!!!"<<endl;
2811 // Particle weights used or not:
2812 fReferenceFlowFlags->Fill(0.5,(Double_t)fUsePhiWeights||fUsePtWeights||fUseEtaWeights);
2813 // Which event weight was used to weight generating function event-by-event:
2814 if(strcmp(fMultiplicityWeight->Data(),"unit"))
2816 fReferenceFlowFlags->Fill(1.5,0.); // 0 = "unit" (default)
2817 } else if(strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2819 fReferenceFlowFlags->Fill(1.5,1.); // 1 = "multiplicity"
2821 fReferenceFlowFlags->Fill(2.5,fCalculateVsMultiplicity); // evaluate vs M?
2823 } // end of void AliFlowAnalysisWithCumulants::StoreReferenceFlowFlags()
2825 //================================================================================================================
2827 void AliFlowAnalysisWithCumulants::StoreDiffFlowFlags()
2829 // Store all flags for differential flow in profile fDiffFlowFlags.
2834 cout<<"WARNING: !fDiffFlowFlags is NULL in AFAWC::SRFF() !!!!"<<endl;
2839 // fDiffFlags->Fill(0.5,(Double_t) ... );
2841 } // end of void AliFlowAnalysisWithCumulants::StoreDiffFlowFlags()
2843 //================================================================================================================
2845 void AliFlowAnalysisWithCumulants::BookAndNestAllLists()
2847 // Book and nest all list in base list fHistList.
2849 // a) Book and nest lists for reference flow;
2850 // b) Book and nest lists for differential flow;
2851 // c) Book and nest lists for tuning;
2852 // d) If used, nest list for particle weights.
2854 // a) Book and nest all lists for reference flow:
2855 fReferenceFlowList = new TList();
2856 fReferenceFlowList->SetName("Reference Flow");
2857 fReferenceFlowList->SetOwner(kTRUE);
2858 fHistList->Add(fReferenceFlowList);
2859 fReferenceFlowProfiles = new TList();
2860 fReferenceFlowProfiles->SetName("Profiles");
2861 fReferenceFlowProfiles->SetOwner(kTRUE);
2862 fReferenceFlowList->Add(fReferenceFlowProfiles);
2863 fReferenceFlowResults = new TList();
2864 fReferenceFlowResults->SetName("Results");
2865 fReferenceFlowResults->SetOwner(kTRUE);
2866 fReferenceFlowList->Add(fReferenceFlowResults);
2867 // b) Book and nest lists for differential flow:
2868 fDiffFlowList = new TList();
2869 fDiffFlowList->SetName("Differential Flow");
2870 fDiffFlowList->SetOwner(kTRUE);
2871 fHistList->Add(fDiffFlowList);
2872 fDiffFlowProfiles = new TList();
2873 fDiffFlowProfiles->SetName("Profiles");
2874 fDiffFlowProfiles->SetOwner(kTRUE);
2875 fDiffFlowList->Add(fDiffFlowProfiles);
2876 fDiffFlowResults = new TList();
2877 fDiffFlowResults->SetName("Results");
2878 fDiffFlowResults->SetOwner(kTRUE);
2879 fDiffFlowList->Add(fDiffFlowResults);
2880 // c) Book and nest lists for tuning:
2883 fTuningList = new TList();
2884 fTuningList->SetName("Tuning");
2885 fTuningList->SetOwner(kTRUE);
2886 fHistList->Add(fTuningList);
2887 fTuningProfiles = new TList();
2888 fTuningProfiles->SetName("Profiles");
2889 fTuningProfiles->SetOwner(kTRUE);
2890 fTuningList->Add(fTuningProfiles);
2891 fTuningResults = new TList();
2892 fTuningResults->SetName("Results");
2893 fTuningResults->SetOwner(kTRUE);
2894 fTuningList->Add(fTuningResults);
2897 // d) If used, nest list for particle weights.
2898 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
2900 // Remark: pointer to this list is coming from the macro, no need to "new" it.
2901 fWeightsList->SetName("Weights");
2902 fWeightsList->SetOwner(kTRUE);
2903 fHistList->Add(fWeightsList);
2906 } // end of void AliFlowAnalysisWithCumulants::BookAndNestAllLists()
2908 //================================================================================================================
2910 void AliFlowAnalysisWithCumulants::BookProfileHoldingSettings()
2912 // Book profile to hold all analysis settings.
2914 TString analysisSettingsName = "fAnalysisSettings";
2915 fAnalysisSettings = new TProfile(analysisSettingsName.Data(),"Settings for analysis with Generating Function Cumulants",11,0.,11.);
2916 fAnalysisSettings->GetXaxis()->SetLabelSize(0.035);
2917 fAnalysisSettings->GetXaxis()->SetBinLabel(1,"Harmonic");
2918 fAnalysisSettings->Fill(0.5,fHarmonic);
2919 fAnalysisSettings->GetXaxis()->SetBinLabel(2,"Multiple");
2920 fAnalysisSettings->Fill(1.5,fMultiple);
2921 fAnalysisSettings->GetXaxis()->SetBinLabel(3,"r_{0}");
2922 fAnalysisSettings->Fill(2.5,fR0);
2923 fAnalysisSettings->GetXaxis()->SetBinLabel(4,"Use w_{#phi}?");
2924 fAnalysisSettings->Fill(3.5,fUsePhiWeights);
2925 fAnalysisSettings->GetXaxis()->SetBinLabel(5,"Use w_{p_{t}}?");
2926 fAnalysisSettings->Fill(4.5,fUsePtWeights);
2927 fAnalysisSettings->GetXaxis()->SetBinLabel(6,"Use w_{#eta}?");
2928 fAnalysisSettings->Fill(5.5,fUsePhiWeights);
2929 fAnalysisSettings->GetXaxis()->SetBinLabel(7,"Tune parameters?");
2930 fAnalysisSettings->Fill(6.5,fTuneParameters);
2931 fAnalysisSettings->GetXaxis()->SetBinLabel(8,"Print RF results");
2932 fAnalysisSettings->Fill(7.5,fPrintFinalResults[0]);
2933 fAnalysisSettings->GetXaxis()->SetBinLabel(9,"Print RP results");
2934 fAnalysisSettings->Fill(8.5,fPrintFinalResults[1]);
2935 fAnalysisSettings->GetXaxis()->SetBinLabel(10,"Print POI results");
2936 fAnalysisSettings->Fill(9.5,fPrintFinalResults[2]);
2937 fAnalysisSettings->GetXaxis()->SetBinLabel(11,"Evaluate vs M?");
2938 fAnalysisSettings->Fill(10.5,fCalculateVsMultiplicity);
2939 fHistList->Add(fAnalysisSettings);
2941 } // end of void AliFlowAnalysisWithCumulants::BookProfileHoldingSettings()
2943 //================================================================================================================
2945 void AliFlowAnalysisWithCumulants::BookCommonHistograms()
2947 // Book common control histograms and common histograms for final results.
2949 // Common control histogram:
2950 TString commonHistsName = "AliFlowCommonHistGFC";
2951 fCommonHists = new AliFlowCommonHist(commonHistsName.Data());
2952 fHistList->Add(fCommonHists);
2953 // Common histograms for final results from 2nd order GFC:
2954 TString commonHistResults2ndOrderName = "AliFlowCommonHistResults2ndOrderGFC";
2955 fCommonHistsResults2nd = new AliFlowCommonHistResults(commonHistResults2ndOrderName.Data(),"",fHarmonic);
2956 fHistList->Add(fCommonHistsResults2nd);
2957 // Common histograms for final results from 4th order GFC:
2958 TString commonHistResults4thOrderName = "AliFlowCommonHistResults4thOrderGFC";
2959 fCommonHistsResults4th = new AliFlowCommonHistResults(commonHistResults4thOrderName.Data(),"",fHarmonic);
2960 fHistList->Add(fCommonHistsResults4th);
2961 // Common histograms for final results from 6th order GFC:
2962 TString commonHistResults6thOrderName = "AliFlowCommonHistResults6thOrderGFC";
2963 fCommonHistsResults6th = new AliFlowCommonHistResults(commonHistResults6thOrderName.Data(),"",fHarmonic);
2964 fHistList->Add(fCommonHistsResults6th);
2965 // Common histograms for final results from 8th order GFC:
2966 TString commonHistResults8thOrderName = "AliFlowCommonHistResults8thOrderGFC";
2967 fCommonHistsResults8th = new AliFlowCommonHistResults(commonHistResults8thOrderName.Data(),"",fHarmonic);
2968 fHistList->Add(fCommonHistsResults8th);
2970 } // end of void AliFlowAnalysisWithCumulants::BookCommonHistograms()
2972 //================================================================================================================
2974 void AliFlowAnalysisWithCumulants::CheckPointersUsedInMake()
2976 // Check pointers used in method Make().
2981 cout<<" WARNING (GFC): fCommonHists is NULL in CPUIM() !!!!"<<endl;
2985 if(fUsePhiWeights && !fPhiWeights)
2988 cout<<" WARNING (GFC): fPhiWeights is NULL in CPUIM() !!!!"<<endl;
2992 if(fUsePtWeights && !fPtWeights)
2995 cout<<" WARNING (GFC): fPtWeights is NULL in CPUIM() !!!!"<<endl;
2999 if(fUseEtaWeights && !fEtaWeights)
3002 cout<<" WARNING (GFC): fEtaWeights is NULL in CPUIM() !!!!"<<endl;
3006 if(!fAverageOfSquaredWeight)
3009 cout<<" WARNING (GFC): fAverageOfSquaredWeight is NULL in CPUIM() !!!!"<<endl;
3013 if(!fReferenceFlowGenFun)
3016 cout<<" WARNING (GFC): fReferenceFlowGenFun is NULL in CPUIM() !!!!"<<endl;
3020 if(!fQvectorComponents)
3023 cout<<" WARNING (GFC): fQvectorComponents is NULL in CPUIM() !!!!"<<endl;
3030 cout<<"WARNING (GFC): fGEBE is NULL in CPUIM() !!!!"<<endl;
3034 // Checking pointers for vs multiplicity calculation:
3035 if(fCalculateVsMultiplicity)
3037 if(!fReferenceFlowGenFunVsM)
3040 cout<<"WARNING (GFC): fReferenceFlowGenFunVsM is NULL in CPUIM() !!!!"<<endl;
3044 if(!fQvectorComponentsVsM)
3047 cout<<"WARNING (GFC): fQvectorComponentsVsM is NULL in CPUIM() !!!!"<<endl;
3051 if(!fAverageOfSquaredWeightVsM)
3054 cout<<"WARNING (GFC): fAverageOfSquaredWeightVsM is NULL in CPUIM() !!!!"<<endl;
3061 cout<<"WARNING (GFC): fAvMVsM is NULL in CPUIM() !!!!"<<endl;
3065 } // end of if(fCalculateVsMultiplicity)
3067 } // end of void AliFlowAnalysisWithCumulants::CheckPointersUsedInMake()
3069 //================================================================================================================
3071 void AliFlowAnalysisWithCumulants::CheckPointersUsedInFinish()
3073 // Check pointers used in method Finish().
3075 if(!fAnalysisSettings)
3078 cout<<" WARNING (GFC): fAnalysisSettings is NULL in CPUIF() !!!!"<<endl;
3082 if(!(fCommonHists && fCommonHists->GetHistMultRP()))
3085 cout<<" WARNING (GFC): (fCommonHists && fCommonHists->GetHistMultRP) is NULL in CPUIF() !!!!"<<endl;
3089 if(!fReferenceFlowGenFun)
3092 cout<<" WARNING (GFC): fReferenceFlowGenFun is NULL in CPUIF() !!!!"<<endl;
3096 if(!fReferenceFlowCumulants)
3099 cout<<" WARNING (GFC): fReferenceFlowCumulants is NULL in CPUIF() !!!!"<<endl;
3103 if(!fQvectorComponents)
3106 cout<<" WARNING (GFC): fQvectorComponents is NULL in CPUIF() !!!!"<<endl;
3110 if(!fAverageOfSquaredWeight)
3113 cout<<" WARNING (GFC): fAverageOfSquaredWeight is NULL in CPUIF() !!!!"<<endl;
3117 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
3120 cout<<" WARNING (GFC): fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && "<<endl;
3121 cout<<" fCommonHistsResults8th is NULL in CPUIF() !!!!"<<endl;
3128 cout<<" WARNING (GFC): fReferenceFlow is NULL in CPUIF() !!!!"<<endl;
3135 cout<<" WARNING (GFC): fChi is NULL in CPUIF() !!!!"<<endl;
3139 for(Int_t ri=0;ri<2;ri++)
3141 for(Int_t rp=0;rp<2;rp++)
3143 for(Int_t pe=0;pe<2;pe++)
3145 if(!fDiffFlowGenFun[ri][rp][pe])
3148 cout<<" WARNING (GFC): "<<Form("fDiffFlowGenFun[%d][%d][%d]",ri,rp,pe)<<" is NULL in CPUIF() !!!!"<<endl;
3155 for(Int_t rp=0;rp<2;rp++)
3157 for(Int_t pe=0;pe<2;pe++)
3159 for(Int_t co=0;co<4;co++)
3161 if(!fDiffFlowCumulants[rp][pe][co])
3164 cout<<" WARNING (GFC): "<<Form("fDiffFlowCumulants[%d][%d][%d]",rp,pe,co)<<" is NULL in CPUIF() !!!!"<<endl;
3168 if(!fDiffFlow[rp][pe][co])
3171 cout<<" WARNING (GFC): "<<Form("fDiffFlow[%d][%d][%d]",rp,pe,co)<<" is NULL in CPUIF() !!!!"<<endl;
3178 for(Int_t rp=0;rp<2;rp++)
3180 for(Int_t pe=0;pe<2;pe++)
3182 if(!fNoOfParticlesInBin[rp][pe])
3185 cout<<" WARNING (GFC): "<<Form("fNoOfParticlesInBin[%d][%d]",rp,pe)<<" is NULL in CPUIF() !!!!"<<endl;
3191 // Checking pointers for vs multiplicity calculation:
3192 if(fCalculateVsMultiplicity)
3194 if(!fReferenceFlowGenFunVsM)
3197 cout<<"WARNING (GFC): fReferenceFlowGenFunVsM is NULL in CPUIF() !!!!"<<endl;
3201 if(!fQvectorComponentsVsM)
3204 cout<<"WARNING (GFC): fQvectorComponentsVsM is NULL in CPUIF() !!!!"<<endl;
3208 if(!fAverageOfSquaredWeightVsM)
3211 cout<<"WARNING (GFC): fAverageOfSquaredWeightVsM is NULL in CPUIF() !!!!"<<endl;
3218 cout<<"WARNING (GFC): fAvMVsM is NULL in CPUIF() !!!!"<<endl;
3222 } // end of if(fCalculateVsMultiplicity)
3224 } // end of void AliFlowAnalysisWithCumulants::CheckPointersUsedInFinish()
3226 //================================================================================================================
3228 void AliFlowAnalysisWithCumulants::AccessSettings()
3230 // Access the settings for analysis with Generating Function Cumulants.
3232 fHarmonic = (Int_t)fAnalysisSettings->GetBinContent(1);
3233 fMultiple = (Int_t)fAnalysisSettings->GetBinContent(2);
3234 fR0 = (Double_t)fAnalysisSettings->GetBinContent(3);
3235 fUsePhiWeights = (Bool_t)fAnalysisSettings->GetBinContent(4);
3236 fUsePtWeights = (Bool_t)fAnalysisSettings->GetBinContent(5);
3237 fUseEtaWeights = (Bool_t)fAnalysisSettings->GetBinContent(6);
3238 fTuneParameters = (Bool_t)fAnalysisSettings->GetBinContent(7);
3239 fPrintFinalResults[0] = (Bool_t)fAnalysisSettings->GetBinContent(8);
3240 fPrintFinalResults[1] = (Bool_t)fAnalysisSettings->GetBinContent(9);
3241 fPrintFinalResults[2] = (Bool_t)fAnalysisSettings->GetBinContent(10);
3242 fCalculateVsMultiplicity = (Bool_t)fAnalysisSettings->GetBinContent(11);
3244 } // end of AliFlowAnalysisWithCumulants::AccessSettings()
3246 //================================================================================================================
3248 void AliFlowAnalysisWithCumulants::WriteHistograms(TString* outputFileName)
3250 // Store the final results in output .root file.
3252 TFile *output = new TFile(outputFileName->Data(),"RECREATE");
3253 //output->WriteObject(fHistList, "cobjGFC","SingleKey");
3254 fHistList->SetName("cobjGFC");
3255 fHistList->SetOwner(kTRUE);
3256 fHistList->Write(fHistList->GetName(), TObject::kSingleKey);
3259 } // end of void AliFlowAnalysisWithCumulants::WriteHistograms(TString* outputFileName)
3261 //================================================================================================================
3263 void AliFlowAnalysisWithCumulants::WriteHistograms(TString outputFileName)
3265 // Store the final results in output .root file.
3267 TFile *output = new TFile(outputFileName.Data(),"RECREATE");
3268 //output->WriteObject(fHistList, "cobjGFC","SingleKey");
3269 fHistList->SetName("cobjGFC");
3270 fHistList->SetOwner(kTRUE);
3271 fHistList->Write(fHistList->GetName(), TObject::kSingleKey);
3274 } // end of void AliFlowAnalysisWithCumulants::WriteHistograms(TString outputFileName)
3276 //================================================================================================================
3278 void AliFlowAnalysisWithCumulants::WriteHistograms(TDirectoryFile *outputFileName)
3280 // Store the final results in output .root file.
3282 fHistList->SetName("cobjGFC");
3283 fHistList->SetOwner(kTRUE);
3284 outputFileName->Add(fHistList);
3285 outputFileName->Write(outputFileName->GetName(), TObject::kSingleKey);
3287 } // end of void AliFlowAnalysisWithCumulants::WriteHistograms(TDirectoryFile *outputFileName)
3289 //================================================================================================================