1 /*************************************************************************
2 * Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 /*************************************************
19 * Flow analysis with cumulants. In this class *
20 * cumulants are calculated by making use of the *
21 * formalism of generating functions proposed by *
24 * Author: Ante Bilandzic *
25 * (abilandzic@gmail.com) *
26 *************************************************/
28 #define AliFlowAnalysisWithCumulants_cxx
30 #include "Riostream.h"
35 #include "TProfile2D.h"
36 #include "TProfile3D.h"
42 #include "AliFlowCommonConstants.h"
43 #include "AliFlowCommonHist.h"
44 #include "AliFlowCommonHistResults.h"
45 #include "AliFlowEventSimple.h"
46 #include "AliFlowTrackSimple.h"
47 #include "AliFlowAnalysisWithCumulants.h"
48 #include "AliFlowVector.h"
50 //================================================================================================================
52 ClassImp(AliFlowAnalysisWithCumulants)
54 AliFlowAnalysisWithCumulants::AliFlowAnalysisWithCumulants():
57 fAnalysisSettings(NULL),
59 fCommonHistsResults2nd(NULL),
60 fCommonHistsResults4th(NULL),
61 fCommonHistsResults6th(NULL),
62 fCommonHistsResults8th(NULL),
79 fUsePhiWeights(kFALSE),
80 fUsePtWeights(kFALSE),
81 fUseEtaWeights(kFALSE),
85 fMultiplicityWeight(NULL),
86 fReferenceFlowList(NULL),
87 fReferenceFlowProfiles(NULL),
88 fReferenceFlowResults(NULL),
89 fReferenceFlowFlags(NULL),
90 fCalculateVsMultiplicity(kFALSE),
95 fReferenceFlowGenFun(NULL),
96 fQvectorComponents(NULL),
97 fAverageOfSquaredWeight(NULL),
98 fReferenceFlowGenFunVsM(NULL),
99 fQvectorComponentsVsM(NULL),
100 fAverageOfSquaredWeightVsM(NULL),
104 fReferenceFlowCumulants(NULL),
105 fReferenceFlow(NULL),
108 fDiffFlowProfiles(NULL),
109 fDiffFlowResults(NULL),
110 fDiffFlowFlags(NULL),
112 fTuningProfiles(NULL),
113 fTuningResults(NULL),
115 fTuneParameters(kFALSE),
120 // Base list to hold all output objects:
121 fHistList = new TList();
122 fHistListName = new TString("cobjGFC");
123 fHistList->SetName(fHistListName->Data());
124 fHistList->SetOwner(kTRUE);
126 // Multiplicity weight:
127 fMultiplicityWeight = new TString("unit");
129 // Initialize all arrays:
130 this->InitializeArrays();
132 } // end of AliFlowAnalysisWithCumulants::AliFlowAnalysisWithCumulants()
134 //================================================================================================================
136 AliFlowAnalysisWithCumulants::~AliFlowAnalysisWithCumulants()
142 } // end of AliFlowAnalysisWithCumulants::~AliFlowAnalysisWithCumulants()
144 //================================================================================================================
146 void AliFlowAnalysisWithCumulants::Init()
148 // Initialize and book all objects.
150 // a) Cross check if the user settings make sense before starting;
151 // b) Access all common constants;
152 // c) Book and fill weights histograms;
153 // d) Book and nest all lists in the base list fHistList;
154 // e) Book and fill profile holding analysis settings;
155 // f) Book common control and results histograms;
156 // g) Store flags for reference flow;
157 // h) Store flags for differential flow;
158 // i) Book all objects needed for tuning;
159 // j) Book all objects needed for calculation versus multiplicity.
161 //save old value and prevent histograms from being added to directory
162 //to avoid name clashes in case multiple analaysis objects are used
164 Bool_t oldHistAddStatus = TH1::AddDirectoryStatus();
165 TH1::AddDirectory(kFALSE);
167 this->CrossCheckSettings();
168 this->AccessConstants();
169 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights){this->BookAndFillWeightsHistograms();}
170 this->BookAndNestAllLists();
171 this->BookProfileHoldingSettings();
172 this->BookCommonHistograms();
173 this->BookEverythingForReferenceFlow();
174 this->BookEverythingForDiffFlow();
175 this->StoreReferenceFlowFlags();
176 this->StoreDiffFlowFlags();
177 if(fTuneParameters){this->BookEverythingForTuning();}
178 if(fCalculateVsMultiplicity){this->BookEverythingForCalculationVsMultiplicity();}
180 (fCommonHists->GetHarmonic())->Fill(0.5,fHarmonic); // to be improved (moved somewhere else?)
182 TH1::AddDirectory(oldHistAddStatus);
184 } // end of void AliFlowAnalysisWithCumulants::Init()
186 //================================================================================================================
188 void AliFlowAnalysisWithCumulants::Make(AliFlowEventSimple* anEvent)
190 // Running over data only in this method.
192 // a) Check all pointers used in this method;
193 // b) If tuning enabled, fill generating functions for different values of tuning parameters;
194 // c) For default values of tuning parameters (r0 = 2.2 and cutoff at 10th order):
195 // c1) Fill common control histograms;
196 // c2) Fill generating function for reference flow;
197 // c3) Fill profile holding average values of various Q-vector components;
198 // c4) Fill generating function for differential flow.
200 this->CheckPointersUsedInMake();
201 if(fTuneParameters) {this->FillGeneratingFunctionsForDifferentTuningParameters(anEvent);}
202 Int_t nRP = anEvent->GetEventNSelTracksRP(); // number of RPs (i.e. number of particles used to determine the reaction plane)
203 if(nRP<10) {return;} // generating function formalism make sense only for nRPs >= 10 for default settings
204 fCommonHists->FillControlHistograms(anEvent);
205 this->FillGeneratingFunctionForReferenceFlow(anEvent);
206 this->FillQvectorComponents(anEvent);
207 this->FillGeneratingFunctionForDiffFlow(anEvent);
209 } // end of void AliFlowAnalysisWithCumulants::Make()
211 //================================================================================================================
213 void AliFlowAnalysisWithCumulants::Finish()
215 // Calculate the final results.
217 // a) Check all pointers used in this method;
218 // b) Access all common constants;
219 // c) Access settings for analysis with Generating Function Cumulants;
220 // d) From relevant common control histogram get average multiplicity of RPs and number of events;
221 // e) Calculate cumulants for reference flow;
222 // f) Calculate from isotropic cumulants reference flow;
223 // g) Calculate error for reference flow estimates;
224 // h) Store the final results for reference flow in common hist results;
225 // i) Print on the screen the final results for reference flow;
226 // j) Calculate cumulants for differential flow;
227 // k) Calculate differential flow for RPs/POIs vs pt/eta from cumulants;
228 // l) Calculate integrated flow of RPs and POIs;
229 // m) Print on the screen the final results for integrated flow of RPs and POIs;
230 // n) If tuning enabled, calculate results for different tuning parameters.
232 this->CheckPointersUsedInFinish();
233 this->AccessConstants();
234 this->AccessSettings();
235 this->GetAvMultAndNoOfEvts();
236 this->CalculateCumulantsForReferenceFlow();
237 this->CalculateReferenceFlow();
238 this->CalculateReferenceFlowError();
239 this->FillCommonHistResultsForReferenceFlow();
240 if(fPrintFinalResults[0]){this->PrintFinalResults("RF");}
241 this->CalculateCumulantsForDiffFlow("RP","pt");
242 this->CalculateCumulantsForDiffFlow("RP","eta");
243 this->CalculateCumulantsForDiffFlow("POI","pt");
244 this->CalculateCumulantsForDiffFlow("POI","eta");
245 this->CalculateDifferentialFlow("RP","pt");
246 this->CalculateDifferentialFlow("RP","eta");
247 this->CalculateDifferentialFlow("POI","pt");
248 this->CalculateDifferentialFlow("POI","eta");
249 this->CalculateDifferentialFlowErrors("RP","pt");
250 this->CalculateDifferentialFlowErrors("RP","eta");
251 this->CalculateDifferentialFlowErrors("POI","pt");
252 this->CalculateDifferentialFlowErrors("POI","eta");
253 this->FillCommonHistResultsForDifferentialFlow("RP");
254 this->FillCommonHistResultsForDifferentialFlow("POI");
255 this->CalculateIntegratedFlow("RP");
256 this->CalculateIntegratedFlow("POI");
257 if(fPrintFinalResults[1]){this->PrintFinalResults("RP");}
258 if(fPrintFinalResults[2]){this->PrintFinalResults("POI");}
259 if(fTuneParameters){this->FinalizeTuning();}
261 } // end of void AliFlowAnalysisWithCumulants::Finish()
263 //================================================================================================================
265 void AliFlowAnalysisWithCumulants::FinalizeTuning()
267 // Finalize results with tuned inerpolating parameters.
269 for(Int_t r=0;r<10;r++)
271 if(TMath::Abs(fTuningR0[r])<1.e-10) continue; // protection against division by r0 bellow
272 for(Int_t pq=0;pq<5;pq++)
274 Int_t pMax = fTuningGenFun[r][pq]->GetXaxis()->GetNbins();
275 Int_t qMax = fTuningGenFun[r][pq]->GetYaxis()->GetNbins();
276 fAvM = fTuningAvM->GetBinContent(pq+1);
278 TMatrixD dAvG(pMax,qMax);
280 Bool_t someAvGEntryIsNegative = kFALSE;
281 for(Int_t p=0;p<pMax;p++)
283 for(Int_t q=0;q<qMax;q++)
285 dAvG(p,q) = fTuningGenFun[r][pq]->GetBinContent(fTuningGenFun[r][pq]->GetBin(p+1,q+1));
288 someAvGEntryIsNegative = kTRUE;
290 cout<<" WARNING: "<<Form("<G[%d][%d]> is negative !!!! GFC results are meaningless for r0 = %f, pq = %i.",p,q,fTuningR0[r],pq)<<endl;
295 // C[p][q] (generating function for the cumulants)
296 TMatrixD dC(pMax,qMax);
298 if(fAvM>0. && !someAvGEntryIsNegative)
300 for(Int_t p=0;p<pMax;p++)
302 for(Int_t q=0;q<qMax;q++)
304 dC(p,q) = fAvM*(pow(dAvG(p,q),(1./fAvM))-1.);
308 // Averaging the generating function for cumulants over azimuth
309 // in order to eliminate detector effects.
310 // <C[p][q]> (Remark: here <> stands for average over azimuth):
313 for(Int_t p=0;p<pMax;p++)
316 for(Int_t q=0;q<qMax;q++)
322 // Finally, the isotropic cumulants for reference flow and reference flow itself:
323 TVectorD cumulant(pMax);
329 cumulant[0]=(1./(fTuningR0[r]*fTuningR0[r]))*(2.*dAvC[0]-(1./2.)*dAvC[1]);
330 cumulant[1]=(2./pow(fTuningR0[r],4.))*((-2.)*dAvC[0]+1.*dAvC[1]);
331 if(cumulant[0]>=0.) {flow[0] = pow(cumulant[0],1./2.);}
332 if(cumulant[1]<=0.) {flow[1] = pow(-1.*cumulant[1],1./4.);}
336 cumulant[0] = (1./(fTuningR0[r]*fTuningR0[r]))*(3.*dAvC[0]-(3./2.)*dAvC[1]+(1./3.)*dAvC[2]);
337 cumulant[1] = (2./pow(fTuningR0[r],4.))*((-5.)*dAvC[0]+4.*dAvC[1]-1.*dAvC[2]);
338 cumulant[2] = (6./pow(fTuningR0[r],6.))*(3.*dAvC[0]-3.*dAvC[1]+1.*dAvC[2]);
339 if(cumulant[0]>=0.) {flow[0] = pow(cumulant[0],1./2.);}
340 if(cumulant[1]<=0.) {flow[1] = pow(-1.*cumulant[1],1./4.);}
341 if(cumulant[2]>=0.) {flow[2] = pow((1./4.)*cumulant[2],1./6.);}
345 cumulant[0] = (1./(fTuningR0[r]*fTuningR0[r]))*(4.*dAvC[0]-3.*dAvC[1]+(4./3.)*dAvC[2]-(1./4.)*dAvC[3]);
346 cumulant[1] = (1./pow(fTuningR0[r],4.))*((-52./3.)*dAvC[0]+19.*dAvC[1]-(28./3.)*dAvC[2]+(11./6.)*dAvC[3]);
347 cumulant[2] = (3./pow(fTuningR0[r],6.))*(18.*dAvC[0]-24.*dAvC[1]+14.*dAvC[2]-3.*dAvC[3]);
348 cumulant[3] = (24./pow(fTuningR0[r],8.))*((-4.)*dAvC[0]+6.*dAvC[1]-4.*dAvC[2]+1.*dAvC[3]);
349 if(cumulant[0]>=0.) {flow[0] = pow(cumulant[0],1./2.);}
350 if(cumulant[1]<=0.) {flow[1] = pow(-1.*cumulant[1],1./4.);}
351 if(cumulant[2]>=0.) {flow[2] = pow((1./4.)*cumulant[2],1./6.);}
352 if(cumulant[3]<=0.) {flow[3] = pow((-1./33.)*cumulant[3],1./8.);}
356 cumulant[0] = (-1./(60*fTuningR0[r]*fTuningR0[r]))*((-300.)*dAvC[0]+300.*dAvC[1]-200.*dAvC[2]+75.*dAvC[3]-12.*dAvC[4]);
357 cumulant[1] = (-1./(6.*pow(fTuningR0[r],4.)))*(154.*dAvC[0]-214.*dAvC[1]+156.*dAvC[2]-61.*dAvC[3]+10.*dAvC[4]);
358 cumulant[2] = (3./(2.*pow(fTuningR0[r],6.)))*(71.*dAvC[0]-118.*dAvC[1]+98.*dAvC[2]-41.*dAvC[3]+7.*dAvC[4]);
359 cumulant[3] = (-24./pow(fTuningR0[r],8.))*(14.*dAvC[0]-26.*dAvC[1]+24.*dAvC[2]-11.*dAvC[3]+2.*dAvC[4]);
360 cumulant[4] = (120./pow(fTuningR0[r],10.))*(5.*dAvC[0]-10.*dAvC[1]+10.*dAvC[2]-5.*dAvC[3]+1.*dAvC[4]);
361 if(cumulant[0]>=0.) {flow[0] = pow(cumulant[0],1./2.);}
362 if(cumulant[1]<=0.) {flow[1] = pow(-1.*cumulant[1],1./4.);}
363 if(cumulant[2]>=0.) {flow[2] = pow((1./4.)*cumulant[2],1./6.);}
364 if(cumulant[3]<=0.) {flow[3] = pow((-1./33.)*cumulant[3],1./8.);}
365 if(cumulant[4]>=0.) {flow[4] = pow((1./456.)*cumulant[4],1./10.);}
369 cumulant[0] = (1./(fTuningR0[r]*fTuningR0[r]))*(8.*dAvC[0]-14.*dAvC[1]+(56./3.)*dAvC[2]-(35./2.)*dAvC[3]
370 + (56./5.)*dAvC[4]-(14./3.)*dAvC[5]+(8./7.)*dAvC[6]-(1./8.)*dAvC[7]);
371 cumulant[1] = (1./pow(fTuningR0[r],4.))*((-1924./35.)*dAvC[0]+(621./5.)*dAvC[1]-(8012./45.)*dAvC[2]
372 + (691./4.)*dAvC[3]-(564./5.)*dAvC[4]+(2143./45.)*dAvC[5]-(412./35.)*dAvC[6]+(363./280.)*dAvC[7]);
373 cumulant[2] = (1./pow(fTuningR0[r],6.))*(349.*dAvC[0]-(18353./20.)*dAvC[1]+(7173./5.)*dAvC[2]
374 - 1457.*dAvC[3]+(4891./5.)*dAvC[4]-(1683./4.)*dAvC[5]+(527./5.)*dAvC[6]-(469./40.)*dAvC[7]);
375 cumulant[3] = (1./pow(fTuningR0[r],8.))*((-10528./5.)*dAvC[0]+(30578./5.)*dAvC[1]-(51456./5.)*dAvC[2]
376 + 10993.*dAvC[3]-(38176./5.)*dAvC[4]+(16818./5.)*dAvC[5]-(4288./5.)*dAvC[6]+(967./10.)*dAvC[7]);
377 cumulant[4] = (1./pow(fTuningR0[r],10.))*(11500.*dAvC[0]-35800.*dAvC[1]+63900.*dAvC[2]-71600.*dAvC[3]
378 + 51620.*dAvC[4]-23400.*dAvC[5]+6100.*dAvC[6]-700.*dAvC[7]);
379 cumulant[5] = (1./pow(fTuningR0[r],12.))*(-52560.*dAvC[0]+172080.*dAvC[1]-321840.*dAvC[2]+376200.*dAvC[3]
380 - 281520.*dAvC[4]+131760.*dAvC[5]-35280.*dAvC[6]+4140.*dAvC[7]);
381 cumulant[6] = (1./pow(fTuningR0[r],14.))*(176400.*dAvC[0]-599760.*dAvC[1]+1164240.*dAvC[2]-1411200.*dAvC[3]
382 + 1093680.*dAvC[4]-529200.*dAvC[5]+146160.*dAvC[6]-17640.*dAvC[7]);
383 cumulant[7] = (1./pow(fTuningR0[r],16.))*(-322560*dAvC[0]+1128960.*dAvC[1]-2257920.*dAvC[2]+2822400.*dAvC[3]
384 - 2257920.*dAvC[4]+1128960.*dAvC[5]-322560.*dAvC[6]+40320.*dAvC[7]);
385 if(cumulant[0]>=0.) {flow[0] = pow(cumulant[0],1./2.);}
386 if(cumulant[1]<=0.) {flow[1] = pow(-1.*cumulant[1],1./4.);}
387 if(cumulant[2]>=0.) {flow[2] = pow((1./4.)*cumulant[2],1./6.);}
388 if(cumulant[3]<=0.) {flow[3] = pow((-1./33.)*cumulant[3],1./8.);}
389 if(cumulant[4]>=0.) {flow[4] = pow((1./456.)*cumulant[4],1./10.);}
390 if(cumulant[5]<=0.) {flow[5] = pow((-1./9460.)*cumulant[5],1./12.);}
391 if(cumulant[6]>=0.) {flow[6] = pow((1./274800.)*cumulant[6],1./14.);}
392 if(cumulant[7]<=0.) {flow[7] = pow((-1./10643745.)*cumulant[7],1./16.);}
394 // Store cumulants and reference flow:
395 for(Int_t co=0;co<pMax;co++) // cumulant order
397 fTuningCumulants[r][pq]->SetBinContent(co+1,cumulant[co]);
398 fTuningFlow[r][pq]->SetBinContent(co+1,flow[co]);
400 } // end of for(Int_t pq=0;pq<5;pq++)
401 } // end of for(Int_t r=0;r<10;r++)
403 } // end of void AliFlowAnalysisWithCumulants::FinalizeTuning()
405 //================================================================================================================
407 void AliFlowAnalysisWithCumulants::FillGeneratingFunctionsForDifferentTuningParameters(AliFlowEventSimple *anEvent)
409 // Fill generating function for reference flow evaluated for different tuning parameters.
411 Int_t pMax[5] = {2,3,4,5,8};
412 Int_t qMax[5] = {5,7,9,11,17};
414 // Particle variables and weights:
415 Double_t dPhi = 0.; // azimuthal angle in the laboratory frame
416 Double_t dPt = 0.; // transverse momentum
417 Double_t dEta = 0.; // pseudorapidity
418 Double_t wPhi = 1.; // phi weight
419 Double_t wPt = 1.; // pt weight
420 Double_t wEta = 1.; // eta weight
422 Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = total number of primary tracks, i.e. nPrim = nRP + nPOI, where:
423 // nRP = # of particles used to determine the reaction plane;
424 // nPOI = # of particles of interest for a detailed flow analysis.
426 Int_t nRP = anEvent->GetEventNSelTracksRP(); // nRP = # of particles used to determine the reaction plane;
427 for(Int_t pq=0;pq<5;pq++)
429 if(nRP<2.*pMax[pq]) continue; // results doesn't make sense if nRP is smaller than serie's cutoff
430 fTuningAvM->Fill(pq+0.5,nRP,1.); // <M> for different classes of events }
433 Double_t tuningGenFunEBE[10][5][8][17] = {{{{0.}}}};
434 for(Int_t r=0;r<10;r++)
436 for(Int_t pq=0;pq<5;pq++)
438 for(Int_t p=0;p<pMax[pq];p++)
440 for(Int_t q=0;q<qMax[pq];q++)
442 tuningGenFunEBE[r][pq][p][q] = 1.;
448 // Looping over tracks:
449 for(Int_t i=0;i<nPrim;i++)
451 AliFlowTrackSimple *aftsTrack = anEvent->GetTrack(i);
452 if(aftsTrack && aftsTrack->InRPSelection())
454 // Access particle variables and weights:
455 dPhi = aftsTrack->Phi();
456 dPt = aftsTrack->Pt();
457 dEta = aftsTrack->Eta();
458 if(fUsePhiWeights && fnBinsPhi) // determine phi weight for this particle:
460 wPhi = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*fnBinsPhi/TMath::TwoPi())));
462 if(fUsePtWeights && fnBinsPt) // determine pt weight for this particle:
464 wPt = fPtWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/fPtBinWidth)));
466 if(fUseEtaWeights && fEtaBinWidth) // determine eta weight for this particle:
468 wEta = fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/fEtaBinWidth)));
470 // Fill the generating functions:
471 for(Int_t r=0;r<10;r++) // 10 different values for interpolating parameter r0
473 if(TMath::Abs(fTuningR0[r])<1.e-10) continue;
474 for(Int_t pq=0;pq<5;pq++) // 5 different values for set (pMax,qMax)
476 if(nRP<2.*pMax[pq]) continue; // results doesn't make sense if nRP is smaller than serie's cutoff
477 for(Int_t p=0;p<pMax[pq];p++)
479 for(Int_t q=0;q<qMax[pq];q++)
481 tuningGenFunEBE[r][pq][p][q] *= (1.+wPhi*wPt*wEta*(2.*fTuningR0[r]*sqrt(p+1.)/nRP)*cos(fHarmonic*dPhi-2.*q*TMath::Pi()/qMax[pq]));
482 } // end of for(Int_t q=0;q<qMax[pq];q++)
483 } // end of for(Int_t p=0;p<pMax[pq];p++)
484 } // end for(Int_t pq=0;pq<5;pq++) // 5 different values for set (pMax,qMax)
485 } // end of for(Int_t r=0;r<10;r++) // 10 different values for interpolating parameter r0
486 } // end of if(aftsTrack && aftsTrack->InRPSelection())
487 } // end of for(Int_t i=0;i<nPrim;i++)
490 for(Int_t r=0;r<10;r++)
492 for(Int_t pq=0;pq<5;pq++)
494 if(nRP<2.*pMax[pq]) continue; // results doesn't make sense if nRP is smaller than serie's cutoff
495 for(Int_t p=0;p<pMax[pq];p++)
497 for(Int_t q=0;q<qMax[pq];q++)
499 if(fTuningGenFun[r][pq]) {fTuningGenFun[r][pq]->Fill((Double_t)p,(Double_t)q,tuningGenFunEBE[r][pq][p][q],1.);}
505 } // end of void AliFlowAnalysisWithCumulants::FillGeneratingFunctionsForDifferentTuningParameters(AliFlowEventSimple *anEvent)
507 //================================================================================================================
509 void AliFlowAnalysisWithCumulants::FillGeneratingFunctionForReferenceFlow(AliFlowEventSimple *anEvent)
511 // Fill generating function for reference flow for current event.
515 printf(" WARNING (GFC): anEvent is NULL !!!!");
519 // Particle variables and weights:
520 Double_t dPhi = 0.; // azimuthal angle in the laboratory frame
521 Double_t dPt = 0.; // transverse momentum
522 Double_t dEta = 0.; // pseudorapidity
523 Double_t wPhi = 1.; // phi weight
524 Double_t wPt = 1.; // pt weight
525 Double_t wEta = 1.; // eta weight
527 Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = total number of primary tracks, i.e. nPrim = nRP + nPOI, where:
528 // nRP = # of particles used to determine the reaction plane;
529 // nPOI = # of particles of interest for a detailed flow analysis.
531 Int_t nRP = anEvent->GetEventNSelTracksRP(); // nRP = # of particles used to determine the reaction plane;
532 if(fCalculateVsMultiplicity){fAvMVsM->Fill(nRP+0.5,nRP,1.);}
534 // Initializing the generating function G[p][q] for reference flow for current event:
535 Int_t pMax = fGEBE->GetNrows();
536 Int_t qMax = fGEBE->GetNcols();
537 for(Int_t p=0;p<pMax;p++)
539 for(Int_t q=0;q<qMax;q++)
545 // Cross-checking the number of RPs in current event:
546 Int_t crossCheckRP = 0;
548 // Looping over tracks:
549 for(Int_t i=0;i<nPrim;i++)
551 AliFlowTrackSimple *aftsTrack = anEvent->GetTrack(i);
552 if(aftsTrack && aftsTrack->InRPSelection())
555 // Access particle variables and weights:
556 dPhi = aftsTrack->Phi();
557 dPt = aftsTrack->Pt();
558 dEta = aftsTrack->Eta();
559 if(fUsePhiWeights && fnBinsPhi) // determine phi weight for this particle:
561 wPhi = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*fnBinsPhi/TMath::TwoPi())));
563 if(fUsePtWeights && fnBinsPt) // determine pt weight for this particle:
565 wPt = fPtWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/fPtBinWidth)));
567 if(fUseEtaWeights && fEtaBinWidth) // determine eta weight for this particle:
569 wEta = fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/fEtaBinWidth)));
571 // Fill the generating function:
572 for(Int_t p=0;p<pMax;p++)
574 for(Int_t q=0;q<qMax;q++)
576 (*fGEBE)(p,q) *= (1.+wPhi*wPt*wEta*(2.*fR0*sqrt(p+1.)/nRP)*cos(fHarmonic*dPhi-2.*q*TMath::Pi()/qMax));
579 // Fill the profile to calculate <<w^2>>:
580 fAverageOfSquaredWeight->Fill(0.5,pow(wPhi*wPt*wEta,2.),1.);
581 } // end of if(aftsTrack && aftsTrack->InRPSelection())
582 } // end of for(Int_t i=0;i<nPrim;i++)
584 // Cross check # of RPs:
585 if(anEvent && (crossCheckRP != anEvent->GetEventNSelTracksRP()))
588 cout<<"WARNING (GFC): crossCheckRP != nRP in GFC::Make(). Something is wrong with RP flagging !!!!"<<endl;
593 // Storing the value of G[p][q] in 2D profile in order to get eventually the avarage <G[p][q]>:
594 // Determine first the event weight for G[p][q]:
595 // (to be improved - this can be implemented much better, this shall be executed only once out of Make(), eventWeight should be a data member)
596 Double_t eventWeight = 0.;
597 if(!strcmp(fMultiplicityWeight->Data(),"unit"))
600 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
602 eventWeight = anEvent->GetEventNSelTracksRP();
604 // Store G[p][q] weighted appropriately:
605 for(Int_t p=0;p<pMax;p++)
607 for(Int_t q=0;q<qMax;q++)
609 fReferenceFlowGenFun->Fill((Double_t)p,(Double_t)q,(*fGEBE)(p,q),eventWeight);
610 if(fCalculateVsMultiplicity){fReferenceFlowGenFunVsM->Fill(nRP+0.5,(Double_t)p,(Double_t)q,(*fGEBE)(p,q),eventWeight);}
614 } // end of void AliFlowAnalysisWithCumulants::FillGeneratingFunctionForReferenceFlow(AliFlowEventSimple* anEvent)
616 //================================================================================================================
618 void AliFlowAnalysisWithCumulants::FillQvectorComponents(AliFlowEventSimple* anEvent)
620 // Fill components of Q-vector for current event (needed for error calculation).
622 // Remark: Components are stored in profile fQvectorComponents whose binning is organized as follows:
632 Int_t n = 2; // to be removed
636 afv = anEvent->GetQ(1*n,fWeightsList,fUsePhiWeights,fUsePtWeights,fUseEtaWeights); // get the Q-vector for this event
637 fQvectorComponents->Fill(0.5,afv.X(),1.); // in the 1st bin fill Q_x
638 fQvectorComponents->Fill(1.5,afv.Y(),1.); // in the 2nd bin fill Q_y
639 fQvectorComponents->Fill(2.5,pow(afv.X(),2.),1.); // in the 3rd bin fill (Q_x)^2
640 fQvectorComponents->Fill(3.5,pow(afv.Y(),2.),1.); // in the 4th bin fill (Q_y)^2
643 } // end of void AliFlowAnalysisWithCumulants::FillQvectorComponents(AliFlowEventSimple* anEvent)
645 //================================================================================================================
647 void AliFlowAnalysisWithCumulants::FillGeneratingFunctionForDiffFlow(AliFlowEventSimple* anEvent)
649 // Fill generating function for differential flow for the current event.
651 // Remark 0: Generating function D[b][p][q] is a complex number => real and imaginary part are calculated separately
652 // (b denotes pt or eta bin);
653 // Remark 1: Note that bellow G[p][q] is needed, the value of generating function for reference flow for the CURRENT event.
654 // This values is obtained in method FillGeneratingFunctionForReferenceFlow() as TMatrixD fGEBE;
655 // Remark 2: Results for D[b][p][q] are stored in 3D profiles fDiffFlowGenFun[0=Re,1=Im][0=RP,1=POI][0=pt,1=eta] in order to
656 // automatically get <Re(D[b][p][q])> and <Im(D[b][p][q])> at the end of the day.
658 // Particle variables and weights:
659 Double_t dPhi = 0.; // azimuthal angle in the laboratory frame
660 Double_t dPt = 0.; // transverse momentum
661 Double_t dEta = 0.; // pseudorapidity
662 Double_t wPhi = 1.; // phi weight
663 Double_t wPt = 1.; // pt weight
664 Double_t wEta = 1.; // eta weight
667 Int_t pMax = fGEBE->GetNrows();
668 Int_t qMax = fGEBE->GetNcols();
670 Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = total number of primary tracks, i.e. nPrim = nRP + nPOI, where:
671 // nRP = # of particles used to determine the reaction plane;
672 // nPOI = # of particles of interest for a detailed flow analysis.
674 Int_t nRP = anEvent->GetEventNSelTracksRP(); // nRP = # of particles used to determine the reaction plane
676 // Start the second loop over event in order to evaluate the generating function D[b][p][q] for differential flow:
677 for(Int_t i=0;i<nPrim;i++)
679 AliFlowTrackSimple *aftsTrack = anEvent->GetTrack(i);
682 if(!(aftsTrack->InRPSelection() || aftsTrack->InPOISelection())) continue;
683 // Differential flow of POIs:
684 if(aftsTrack->InPOISelection())
686 // Get azimuthal angle, momentum and pseudorapidity of a particle:
687 dPhi = aftsTrack->Phi();
688 dPt = aftsTrack->Pt();
689 dEta = aftsTrack->Eta();
690 Double_t ptEta[2] = {dPt,dEta};
692 // Count number of POIs in pt/eta bin:
693 for(Int_t pe=0;pe<2;pe++)
695 fNoOfParticlesInBin[1][pe]->Fill(ptEta[pe],ptEta[pe],1.);
698 if(!(aftsTrack->InRPSelection())) // particle was flagged only as POI
700 // Fill generating function:
701 for(Int_t p=0;p<pMax;p++)
703 for(Int_t q=0;q<qMax;q++)
705 for(Int_t ri=0;ri<2;ri++)
707 for(Int_t pe=0;pe<2;pe++)
709 if(ri==0) // Real part (to be improved - this can be implemented better)
711 fDiffFlowGenFun[ri][1][pe]->Fill(ptEta[pe],(Double_t)p,(Double_t)q, // to be improved - hardwired weight 1. in the line bellow
712 (*fGEBE)(p,q)*cos(fMultiple*fHarmonic*dPhi),1.);
714 else if(ri==1) // Imaginary part (to be improved - this can be implemented better)
716 fDiffFlowGenFun[ri][1][pe]->Fill(ptEta[pe],(Double_t)p,(Double_t)q, // to be improved - hardwired weight 1. in the line bellow
717 (*fGEBE)(p,q)*sin(fMultiple*fHarmonic*dPhi),1.);
719 } // end of for(Int_t pe=0;pe<2;pe++)
720 } // end of for(Int_t ri=0;ri<2;ri++)
721 } // end of for(Int_t q=0;q<qMax;q++)
722 } // end of for(Int_t p=0;p<pMax;p++)
723 } // end of if(!(aftsTrack->InRPSelection())) // particle was flagged only as POI
724 else if(aftsTrack->InRPSelection()) // particle was flagged both as RP and POI
726 // If particle weights were used, get them:
727 if(fUsePhiWeights && fnBinsPhi) // determine phi weight for this particle:
729 wPhi = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*fnBinsPhi/TMath::TwoPi())));
731 if(fUsePtWeights && fnBinsPt) // determine pt weight for this particle:
733 wPt = fPtWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/fPtBinWidth)));
735 if(fUseEtaWeights && fEtaBinWidth) // determine eta weight for this particle:
737 wEta = fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/fEtaBinWidth)));
739 // Fill generating function:
740 for(Int_t p=0;p<pMax;p++)
742 for(Int_t q=0;q<qMax;q++)
744 for(Int_t ri=0;ri<2;ri++)
746 for(Int_t pe=0;pe<2;pe++)
748 if(ri==0) // Real part (to be improved - this can be implemented better)
750 fDiffFlowGenFun[ri][1][pe]->Fill(ptEta[pe],(Double_t)p,(Double_t)q, // to be improved - hardwired weight 1. in the line bellow
751 (*fGEBE)(p,q)*cos(fMultiple*fHarmonic*dPhi)/(1.+wPhi*wPt*wEta*(2.*fR0*sqrt(p+1.)/nRP)*cos(fHarmonic*dPhi-2.*q*TMath::Pi()/qMax)),1.);
753 else if(ri==1) // Imaginary part (to be improved - this can be implemented better)
755 fDiffFlowGenFun[ri][1][pe]->Fill(ptEta[pe],(Double_t)p,(Double_t)q, // to be improved - hardwired weight 1. in the line bellow
756 (*fGEBE)(p,q)*sin(fMultiple*fHarmonic*dPhi)/(1.+wPhi*wPt*wEta*(2.*fR0*sqrt(p+1.)/nRP)*cos(fHarmonic*dPhi-2.*q*TMath::Pi()/qMax)),1.);
758 } // end of for(Int_t pe=0;pe<2;pe++)
759 } // end of for(Int_t ri=0;ri<2;ri++)
760 } // end of for(Int_t q=0;q<qMax;q++)
761 } // end of for(Int_t p=0;p<pMax;p++)
762 } // end of else if (aftsTrack->InRPSelection()) // particle was flagged both as RP and POI
763 } // end of if(aftsTrack->InPOISelection())
764 // Differential flow of RPs:
765 if(aftsTrack->InRPSelection())
767 // Get azimuthal angle, momentum and pseudorapidity of a particle:
768 dPhi = aftsTrack->Phi();
769 dPt = aftsTrack->Pt();
770 dEta = aftsTrack->Eta();
771 Double_t ptEta[2] = {dPt,dEta};
773 // Count number of RPs in pt/eta bin:
774 for(Int_t pe=0;pe<2;pe++)
776 fNoOfParticlesInBin[0][pe]->Fill(ptEta[pe],ptEta[pe],1.);
779 // If particle weights were used, get them:
780 if(fUsePhiWeights && fnBinsPhi) // determine phi weight for this particle:
782 wPhi = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*fnBinsPhi/TMath::TwoPi())));
784 if(fUsePtWeights && fnBinsPt) // determine pt weight for this particle:
786 wPt = fPtWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/fPtBinWidth)));
788 if(fUseEtaWeights && fEtaBinWidth) // determine eta weight for this particle:
790 wEta = fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/fEtaBinWidth)));
792 // Fill generating function:
793 for(Int_t p=0;p<pMax;p++)
795 for(Int_t q=0;q<qMax;q++)
797 for(Int_t ri=0;ri<2;ri++)
799 for(Int_t pe=0;pe<2;pe++)
801 if(ri==0) // Real part (to be improved - this can be implemented better)
803 fDiffFlowGenFun[ri][0][pe]->Fill(ptEta[pe],(Double_t)p,(Double_t)q, // to be improved - hardwired weight 1. in the line bellow
804 (*fGEBE)(p,q)*cos(fMultiple*fHarmonic*dPhi)/(1.+wPhi*wPt*wEta*(2.*fR0*sqrt(p+1.)/nRP)*cos(fHarmonic*dPhi-2.*q*TMath::Pi()/qMax)),1.);
806 else if(ri==1) // Imaginary part (to be improved - this can be implemented better)
808 fDiffFlowGenFun[ri][0][pe]->Fill(ptEta[pe],(Double_t)p,(Double_t)q, // to be improved - hardwired weight 1. in the line bellow
809 (*fGEBE)(p,q)*sin(fMultiple*fHarmonic*dPhi)/(1.+wPhi*wPt*wEta*(2.*fR0*sqrt(p+1.)/nRP)*cos(fHarmonic*dPhi-2.*q*TMath::Pi()/qMax)),1.);
811 } // end of for(Int_t pe=0;pe<2;pe++)
812 } // end of for(Int_t ri=0;ri<2;ri++)
813 } // end of for(Int_t q=0;q<qMax;q++)
814 } // end of for(Int_t p=0;p<pMax;p++)
815 } // end of if(aftsTrack->InRPSelection())
816 } // end of if(aftsTrack)
817 } // end of for(Int_t i=0;i<nPrim;i++)
819 } // end of void AliFlowAnalysisWithCumulants::FillGeneratingFunctionForDiffFlow(AliFlowEventSimple* anEvent)
821 //================================================================================================================
823 void AliFlowAnalysisWithCumulants::GetOutputHistograms(TList *outputListHistos)
825 // Get pointers to all objects saved in the output file.
829 this->SetHistList(outputListHistos);
833 cout<<" WARNING (GFC): fHistList is NULL in AFAWGFC::GOH() !!!!"<<endl;
837 this->GetPointersForBaseHistograms();
838 this->AccessSettings();
839 this->GetPointersForCommonControlHistograms();
840 this->GetPointersForCommonResultsHistograms();
841 this->GetPointersForReferenceFlowObjects();
842 this->GetPointersForDiffFlowObjects();
843 if(fTuneParameters){this->GetPointersForTuningObjects();}
847 cout<<" WARNING (GFC): outputListHistos is NULL in AFAWGFC::GOH() !!!!"<<endl;
852 } // end of void AliFlowAnalysisWithCumulants::GetOutputHistograms(TList *outputListHistos)
854 //================================================================================================================
856 void AliFlowAnalysisWithCumulants::GetPointersForBaseHistograms()
858 // Get pointers to base histograms.
860 TString analysisSettingsName = "fAnalysisSettings";
861 TProfile *analysisSettings = dynamic_cast<TProfile*>(fHistList->FindObject(analysisSettingsName.Data()));
864 this->SetAnalysisSettings(analysisSettings);
868 cout<<" WARNING (GFC): analysisSettings is NULL in AFAWGFC::GPFBH() !!!!"<<endl;
873 } // end of void AliFlowAnalysisWithCumulants::GetPointersForBaseHistograms()
875 //================================================================================================================
877 void AliFlowAnalysisWithCumulants::GetPointersForCommonControlHistograms()
879 // Get pointers for common control histograms.
881 TString commonHistsName = "AliFlowCommonHistGFC";
882 AliFlowCommonHist *commonHist = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHistsName.Data()));
885 this->SetCommonHists(commonHist);
889 cout<<" WARNING (GFC): commonHist is NULL in AFAWGFC::GPFCH() !!!!"<<endl;
894 } // end of void AliFlowAnalysisWithCumulants::GetPointersForCommonControlHistograms()
896 //================================================================================================================
898 void AliFlowAnalysisWithCumulants::GetPointersForCommonResultsHistograms()
900 // Get pointers for common results histograms.
902 TString commonHistResults2ndOrderName = "AliFlowCommonHistResults2ndOrderGFC";
903 AliFlowCommonHistResults *commonHistRes2nd = dynamic_cast<AliFlowCommonHistResults*>
904 (fHistList->FindObject(commonHistResults2ndOrderName.Data()));
907 this->SetCommonHistsResults2nd(commonHistRes2nd);
911 cout<<" WARNING (GFC): commonHistRes2nd is NULL in AFAWGFC::GPFCRH() !!!!"<<endl;
915 TString commonHistResults4thOrderName = "AliFlowCommonHistResults4thOrderGFC";
916 AliFlowCommonHistResults *commonHistRes4th = dynamic_cast<AliFlowCommonHistResults*>
917 (fHistList->FindObject(commonHistResults4thOrderName.Data()));
920 this->SetCommonHistsResults4th(commonHistRes4th);
924 cout<<" WARNING (GFC): commonHistRes4th is NULL in AFAWGFC::GPFCRH() !!!!"<<endl;
928 TString commonHistResults6thOrderName = "AliFlowCommonHistResults6thOrderGFC";
929 AliFlowCommonHistResults *commonHistRes6th = dynamic_cast<AliFlowCommonHistResults*>
930 (fHistList->FindObject(commonHistResults6thOrderName.Data()));
933 this->SetCommonHistsResults6th(commonHistRes6th);
937 cout<<" WARNING (GFC): commonHistRes6th is NULL in AFAWGFC::GPFCRH() !!!!"<<endl;
941 TString commonHistResults8thOrderName = "AliFlowCommonHistResults8thOrderGFC";
942 AliFlowCommonHistResults *commonHistRes8th = dynamic_cast<AliFlowCommonHistResults*>
943 (fHistList->FindObject(commonHistResults8thOrderName.Data()));
946 this->SetCommonHistsResults8th(commonHistRes8th);
950 cout<<" WARNING (GFC): commonHistRes8th is NULL in AFAWGFC::GPFCRH() !!!!"<<endl;
955 } // end of void AliFlowAnalysisWithCumulants::GetPointersForCommonResultsHistograms()
957 //================================================================================================================
959 void AliFlowAnalysisWithCumulants::GetPointersForTuningObjects()
961 // Get pointers to all objects used for tuning.
963 // a) Get pointers to all lists relevant for tuning;
964 // b) Get pointer to profile holding flags for tuning;
965 // c) Get pointers to all objects in the list fTuningProfiles;
966 // d) Get pointers to all objects in the list fTuningResults.
968 // a) Get pointers to all lists relevant for tuning:
969 TList *tuningList = dynamic_cast<TList*>(fHistList->FindObject("Tuning"));
973 cout<<"WARNING (GFC): uningList is NULL in AFAWGFC::GPFTO() !!!!"<<endl;
977 TList *tuningProfiles = dynamic_cast<TList*>(tuningList->FindObject("Profiles"));
981 cout<<"WARNING (GFC): tuningProfiles is NULL in AFAWGFC::GPFTO() !!!!"<<endl;
985 TList *tuningResults = dynamic_cast<TList*>(tuningList->FindObject("Results"));
989 cout<<"WARNING (GFC): tuningResults is NULL in AFAWGFC::GPFTO() !!!!"<<endl;
994 // b) Get pointer to profile holding flags for tuning:
995 TString tuningFlagsName = "fTuningFlags";
996 TProfile *tuningFlags = dynamic_cast<TProfile*>(tuningList->FindObject(tuningFlagsName.Data()));
999 this->SetTuningFlags(tuningFlags);
1003 cout<<"WARNING (GFC): tuningFlags is NULL in AFAWGFC::GPFTO() !!!!"<<endl;
1008 // c) Get pointers to all objects in the list fTuningProfiles:
1009 // Generating function for different tuning parameters:
1010 TProfile2D *tuningGenFun[10][5] = {{NULL}};
1011 for(Int_t r=0;r<10;r++)
1013 for(Int_t pq=0;pq<5;pq++)
1015 tuningGenFun[r][pq] = dynamic_cast<TProfile2D*>(tuningProfiles->FindObject(Form("fTuningGenFun (r_{0,%i}, pq set %i)",r,pq)));
1016 if(tuningGenFun[r][pq])
1018 this->SetTuningGenFun(tuningGenFun[r][pq],r,pq);
1022 cout<<"WARNING (GFC): "<<Form("tuningGenFun[%i][%i]",r,pq)<<" is NULL in AFAWGFC::GPFTO() !!!!"<<endl;
1026 } // end of for(Int_t pq=0;pq<5;pq++)
1027 } // end of for(Int_t r=0;r<10;r++)
1028 // Average multiplicities for events with nRPs >= cuttof
1029 TProfile *tuningAvM = dynamic_cast<TProfile*>(tuningProfiles->FindObject("fTuningAvM"));
1032 this->SetTuningAvM(tuningAvM);
1036 cout<<"WARNING (GFC): tuningAvM is NULL in AFAWGFC::GPFTO() !!!!"<<endl;
1041 // d) Get pointers to all objects in the list fTuningResults.
1042 // Cumulants for reference flow for 10 different r0s and 5 different sets of (pmax,qmax):
1043 TH1D *tuningCumulants[10][5] = {{NULL}};
1044 for(Int_t r=0;r<10;r++)
1046 for(Int_t pq=0;pq<5;pq++)
1048 tuningCumulants[r][pq] = dynamic_cast<TH1D*>(tuningResults->FindObject(Form("fTuningCumulants (r_{0,%i}, pq set %i)",r,pq)));
1049 if(tuningCumulants[r][pq])
1051 this->SetTuningCumulants(tuningCumulants[r][pq],r,pq);
1055 cout<<"WARNING (GFC): "<<Form("tuningCumulants[%i][%i]",r,pq)<<" is NULL in AFAWGFC::GPFTO() !!!!"<<endl;
1059 } // end of for(Int_t pq=0;pq<5;pq++)
1060 } // end of for(Int_t r=0;r<10;r++)
1061 // Reference flow for 10 different r0s and 5 different sets of (pmax,qmax):
1062 TH1D *tuningFlow[10][5] = {{NULL}};
1063 for(Int_t r=0;r<10;r++)
1065 for(Int_t pq=0;pq<5;pq++)
1067 tuningFlow[r][pq] = dynamic_cast<TH1D*>(tuningResults->FindObject(Form("fTuningFlow (r_{0,%i}, pq set %i)",r,pq)));
1068 if(tuningFlow[r][pq])
1070 this->SetTuningFlow(tuningFlow[r][pq],r,pq);
1074 cout<<"WARNING (GFC): "<<Form("tuningFlow[%i][%i]",r,pq)<<" is NULL in AFAWGFC::GPFTO() !!!!"<<endl;
1078 } // end of for(Int_t pq=0;pq<5;pq++)
1079 } // end of for(Int_t r=0;r<10;r++)
1081 } // end of void AliFlowAnalysisWithCumulants::GetPointersForTuningObjects()
1083 //================================================================================================================
1085 void AliFlowAnalysisWithCumulants::GetPointersForReferenceFlowObjects()
1087 // Get pointers for all objects relevant for calculation of reference flow.
1089 // a) Get pointers to all lists relevant for reference flow;
1090 // b) Get pointer to profile holding flags;
1091 // c) Get pointers to all objects in the list fReferenceFlowProfiles;
1092 // d) Get pointers to all objects in the list fReferenceFlowResults;
1093 // e) Get pointers for all objects relevant for calculation of reference flow versus multiplicity.
1095 // a) Get pointers to all lists relevant for reference flow:
1096 TList *referenceFlowList = dynamic_cast<TList*>(fHistList->FindObject("Reference Flow"));
1097 if(!referenceFlowList)
1100 cout<<"WARNING (GFC): referenceFlowList is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1104 TList *referenceFlowProfiles = dynamic_cast<TList*>(referenceFlowList->FindObject("Profiles"));
1105 if(!referenceFlowProfiles)
1108 cout<<"WARNING (GFC): referenceFlowProfiles is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1112 TList *referenceFlowResults = dynamic_cast<TList*>(referenceFlowList->FindObject("Results"));
1113 if(!referenceFlowResults)
1116 cout<<"WARNING (GFC): referenceFlowResults is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1121 // b) Get pointer to profile holding flags:
1122 TString referenceFlowFlagsName = "fReferenceFlowFlags";
1123 TProfile *referenceFlowFlags = dynamic_cast<TProfile*>(referenceFlowList->FindObject(referenceFlowFlagsName.Data()));
1124 if(referenceFlowFlags)
1126 this->SetReferenceFlowFlags(referenceFlowFlags);
1130 cout<<"WARNING (GFC): referenceFlowFlags is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1135 // c) Get pointers to all objects in the list fReferenceFlowProfiles:
1136 TString referenceFlowGenFunName = "fReferenceFlowGenFun";
1137 TProfile2D *referenceFlowGenFun = dynamic_cast<TProfile2D*>(referenceFlowProfiles->FindObject(referenceFlowGenFunName.Data()));
1138 if(referenceFlowGenFun)
1140 this->SetReferenceFlowGenFun(referenceFlowGenFun);
1144 cout<<"WARNING (GFC): referenceFlowGenFun is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1148 // Averages of various Q-vector components:
1149 TString qvectorComponentsName = "fQvectorComponents";
1150 TProfile *qvectorComponents = dynamic_cast<TProfile*>(referenceFlowProfiles->FindObject(qvectorComponentsName.Data()));
1151 if(qvectorComponents)
1153 this->SetQvectorComponents(qvectorComponents);
1157 cout<<"WARNING (GFC): qvectorComponents is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1161 // <<w^2>>, where w = wPhi*wPt*wEta:
1162 TString averageOfSquaredWeightName = "fAverageOfSquaredWeight";
1163 TProfile *averageOfSquaredWeight = dynamic_cast<TProfile*>(referenceFlowProfiles->FindObject(averageOfSquaredWeightName.Data()));
1164 if(averageOfSquaredWeight)
1166 this->SetAverageOfSquaredWeight(averageOfSquaredWeight);
1170 cout<<"WARNING (GFC): averageOfSquaredWeight is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1175 // d) Get pointers to all objects in the list fReferenceFlowResults:
1176 // Final results for isotropic cumulants for reference flow:
1177 TString referenceFlowCumulantsName = "fReferenceFlowCumulants";
1178 TH1D *referenceFlowCumulants = dynamic_cast<TH1D*>(referenceFlowResults->FindObject(referenceFlowCumulantsName.Data()));
1179 if(referenceFlowCumulants)
1181 this->SetReferenceFlowCumulants(referenceFlowCumulants);
1185 cout<<"WARNING (GFC): referenceFlowCumulants is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1189 // Final results for reference flow:
1190 TString referenceFlowName = "fReferenceFlow";
1191 TH1D *referenceFlow = dynamic_cast<TH1D*>(referenceFlowResults->FindObject(referenceFlowName.Data()));
1194 this->SetReferenceFlow(referenceFlow);
1198 cout<<"WARNING (GFC): referenceFlow is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1202 // Final results for resolution:
1203 TString chiName = "fChi";
1204 TH1D *chi = dynamic_cast<TH1D*>(referenceFlowResults->FindObject(chiName.Data()));
1211 cout<<"WARNING (GFC): chi is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1216 // e) Get pointers for all objects relevant for calculation of reference flow versus multiplicity:
1217 if(!fCalculateVsMultiplicity) {return;}
1218 // All-event average of the generating function used to calculate reference flow vs multiplicity:
1219 TString referenceFlowGenFunVsMName = "fReferenceFlowGenFunVsM";
1220 TProfile3D *referenceFlowGenFunVsM = dynamic_cast<TProfile3D*>(referenceFlowProfiles->FindObject(referenceFlowGenFunVsMName.Data()));
1221 if(referenceFlowGenFunVsM)
1223 this->SetReferenceFlowGenFunVsM(referenceFlowGenFunVsM);
1227 cout<<"WARNING (GFC): referenceFlowGenFunVsM is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1231 // Averages of various Q-vector components versus multiplicity:
1232 TString qvectorComponentsVsMName = "fQvectorComponentsVsM";
1233 TProfile2D *qvectorComponentsVsM = dynamic_cast<TProfile2D*>(referenceFlowProfiles->FindObject(qvectorComponentsVsMName.Data()));
1234 if(qvectorComponentsVsM)
1236 this->SetQvectorComponentsVsM(qvectorComponentsVsM);
1240 cout<<"WARNING (GFC): qvectorComponentsVsM is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1244 // <<w^2>>, where w = wPhi*wPt*wEta versus multiplicity:
1245 TString averageOfSquaredWeightVsMName = "fAverageOfSquaredWeightVsM";
1246 TProfile2D *averageOfSquaredWeightVsM = dynamic_cast<TProfile2D*>(referenceFlowProfiles->FindObject(averageOfSquaredWeightVsMName.Data()));
1247 if(averageOfSquaredWeightVsM)
1249 this->SetAverageOfSquaredWeightVsM(averageOfSquaredWeightVsM);
1253 cout<<"WARNING (GFC): averageOfSquaredWeightVsM is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1257 // Final results for reference GF-cumulants versus multiplicity:
1258 TString cumulantFlag[4] = {"GFC{2}","GFC{4}","GFC{6}","GFC{8}"};
1259 TString referenceFlowCumulantsVsMName = "fReferenceFlowCumulantsVsM";
1260 TH1D *referenceFlowCumulantsVsM[4] = {NULL};
1261 for(Int_t co=0;co<4;co++) // cumulant order
1263 referenceFlowCumulantsVsM[co] = dynamic_cast<TH1D*>(referenceFlowResults->FindObject(Form("%s, %s",referenceFlowCumulantsVsMName.Data(),cumulantFlag[co].Data())));
1264 if(referenceFlowCumulantsVsM[co])
1266 this->SetReferenceFlowCumulantsVsM(referenceFlowCumulantsVsM[co],co);
1270 cout<<"WARNING (GFC): "<<Form("referenceFlowCumulantsVsM[%i]",co)<<" is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1274 } // end of for(Int_t co=0;co<4;co++) // cumulant order
1275 // <M> vs multiplicity bin:
1276 TProfile *avMVsM = dynamic_cast<TProfile*>(referenceFlowProfiles->FindObject("fAvMVsM"));
1279 this->SetAvMVsM(avMVsM);
1283 cout<<"WARNING (GFC): avMVsM is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1288 } // end of void AliFlowAnalysisWithCumulants::GetPointersForReferenceFlowObjects()
1290 //================================================================================================================
1292 void AliFlowAnalysisWithCumulants::GetPointersForDiffFlowObjects()
1294 // Get pointers to all objects relevant for differential flow.
1296 // a) Define flags locally (to be improved: should I promote flags to data members?);
1297 // b) Get pointer to base list for differential flow fDiffFlowList and nested lists fDiffFlowListProfiles and fDiffFlowListResults;
1298 // c) Get pointer to profile fDiffFlowFlags holding all flags for differential flow;
1299 // d) Get pointers to all profiles in the list fDiffFlowProfiles;
1300 // e) Get pointers to all profiles in the list fDiffFlowResults.
1302 // a) Define flags locally (to be improved: should I promote flags to data members?):
1303 TString reIm[2] = {"Re","Im"};
1304 TString rpPoi[2] = {"RP","POI"};
1305 TString ptEta[2] = {"p_{t}","#eta"};
1306 TString order[4] = {"2nd order","4th order","6th order","8th order"};
1307 //TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
1309 // b) Get pointer to base list for differential flow fDiffFlowList and nested lists fDiffFlowListProfiles and fDiffFlowListResults:
1310 TList *diffFlowList = dynamic_cast<TList*>(fHistList->FindObject("Differential Flow")); // to be improved (hardwired name)
1314 cout<<"WARNING: diffFlowList is NULL in AFAWC::GPFDFO() !!!!"<<endl;
1318 TList *diffFlowProfiles = dynamic_cast<TList*>(diffFlowList->FindObject("Profiles")); // to be improved (hardwired name)
1319 if(!diffFlowProfiles)
1322 cout<<"WARNING: diffFlowProfiles is NULL in AFAWC::GPFDFO() !!!!"<<endl;
1326 TList *diffFlowResults = dynamic_cast<TList*>(diffFlowList->FindObject("Results")); // to be improved (hardwired name)
1327 if(!diffFlowResults)
1330 cout<<"WARNING: diffFlowResults is NULL in AFAWC::GPFDFO() !!!!"<<endl;
1335 // c) Get pointer to profile holding flags:
1336 TString diffFlowFlagsName = "fDiffFlowFlags";
1337 TProfile *diffFlowFlags = dynamic_cast<TProfile*>(diffFlowList->FindObject(diffFlowFlagsName.Data()));
1340 this->SetDiffFlowFlags(diffFlowFlags);
1344 cout<<"WARNING (GFC): diffFlowFlags is NULL in AFAWGFC::GPFDFO() !!!!"<<endl;
1349 // d) Get pointers to all profiles in the list fDiffFlowListProfiles:
1350 // Generating functions for differential flow:
1351 TProfile3D *diffFlowGenFun[2][2][2] = {{{NULL}}};
1352 for(Int_t ri=0;ri<2;ri++)
1354 for(Int_t rp=0;rp<2;rp++)
1356 for(Int_t pe=0;pe<2;pe++)
1358 diffFlowGenFun[ri][rp][pe] = dynamic_cast<TProfile3D*> // to be improved - harwired name fDiffFlowGenFun in the line bellow
1359 (diffFlowProfiles->FindObject(Form("fDiffFlowGenFun (%s, %s, %s)",reIm[ri].Data(),rpPoi[rp].Data(),ptEta[pe].Data())));
1360 if(diffFlowGenFun[ri][rp][pe])
1362 this->SetDiffFlowGenFun(diffFlowGenFun[ri][rp][pe],ri,rp,pe);
1366 cout<<"WARNING (GFC): "<<Form("diffFlowGenFun[%d][%d][%d]",ri,rp,pe)<<" is NULL in AFAWGFC::GPFDFO() !!!!"<<endl;
1373 // Number of particles in pt/eta bin for RPs/POIs:
1374 TProfile *noOfParticlesInBin[2][2] = {{NULL}};
1375 for(Int_t rp=0;rp<2;rp++)
1377 for(Int_t pe=0;pe<2;pe++)
1379 noOfParticlesInBin[rp][pe] = dynamic_cast<TProfile*> // to be improved - harwired name fNoOfParticlesInBin in the line bellow
1380 (diffFlowProfiles->FindObject(Form("fNoOfParticlesInBin (%s, %s)",rpPoi[rp].Data(),ptEta[pe].Data())));
1381 if(noOfParticlesInBin[rp][pe])
1383 this->SetNoOfParticlesInBin(noOfParticlesInBin[rp][pe],rp,pe);
1387 cout<<"WARNING (GFC): "<<Form("noOfParticlesInBin[%d][%d]",rp,pe)<<" is NULL in AFAWGFC::GPFDFO() !!!!"<<endl;
1393 // Differential cumulants per pt/eta bin for RPs/POIs:
1394 TH1D *diffFlowCumulants[2][2][4] = {{{NULL}}};
1395 for(Int_t rp=0;rp<2;rp++)
1397 for(Int_t pe=0;pe<2;pe++)
1399 for(Int_t co=0;co<4;co++)
1401 diffFlowCumulants[rp][pe][co] = dynamic_cast<TH1D*> // to be improved - hardwired name fDiffFlowCumulants in the line bellow
1402 (diffFlowResults->FindObject(Form("fDiffFlowCumulants (%s, %s, %s)",rpPoi[rp].Data(),ptEta[pe].Data(),order[co].Data())));
1403 if(diffFlowCumulants[rp][pe][co])
1405 this->SetDiffFlowCumulants(diffFlowCumulants[rp][pe][co],rp,pe,co);
1409 cout<<"WARNING (GFC): "<<Form("diffFlowCumulants[%d][%d][%d]",rp,pe,co)<<" is NULL in AFAWGFC::GPFDFO() !!!!"<<endl;
1416 // Differential flow per pt/eta bin for RPs/POIs:
1417 TH1D *diffFlow[2][2][4] = {{{NULL}}};
1418 for(Int_t rp=0;rp<2;rp++)
1420 for(Int_t pe=0;pe<2;pe++)
1422 for(Int_t co=0;co<4;co++)
1424 diffFlow[rp][pe][co] = dynamic_cast<TH1D*> // to be improved - hardwired name fDiffFlow in the line bellow
1425 (diffFlowResults->FindObject(Form("fDiffFlow (%s, %s, %s)",rpPoi[rp].Data(),ptEta[pe].Data(),order[co].Data())));
1426 if(diffFlow[rp][pe][co])
1428 this->SetDiffFlow(diffFlow[rp][pe][co],rp,pe,co);
1432 cout<<"WARNING (GFC): "<<Form("diffFlow[%d][%d][%d]",rp,pe,co)<<" is NULL in AFAWGFC::GPFDFO() !!!!"<<endl;
1440 } // end of void AliFlowAnalysisWithCumulants::GetPointersForDiffFlowObjects()
1442 //================================================================================================================
1444 void AliFlowAnalysisWithCumulants::CalculateIntegratedFlow(TString rpPoi)
1446 // Calculate final results for integrated flow of RPs and POIs.
1447 // (to be improved - this method can be implemented much better)
1454 } else if(rpPoi == "POI")
1460 TH1F *yieldPt = NULL;
1464 yieldPt = (TH1F*)(fCommonHists->GetHistPtPOI())->Clone();
1465 } else if(rpPoi == "RP")
1467 yieldPt = (TH1F*)(fCommonHists->GetHistPtRP())->Clone();
1472 printf("\n WARNING (GFC): yieldPt is NULL in AFAWC::CIF() !!!!\n");
1476 TH1D *flow2ndPt = (TH1D*)fDiffFlow[rp][0][0]->Clone();
1477 TH1D *flow4thPt = (TH1D*)fDiffFlow[rp][0][1]->Clone();
1478 TH1D *flow6thPt = (TH1D*)fDiffFlow[rp][0][2]->Clone();
1479 TH1D *flow8thPt = (TH1D*)fDiffFlow[rp][0][3]->Clone();
1480 Double_t dvn2nd = 0., dvn4th = 0., dvn6th = 0., dvn8th = 0.; // differential flow
1481 Double_t dErrvn2nd = 0., dErrvn4th = 0., dErrvn6th = 0., dErrvn8th = 0.; // error on differential flow
1482 Double_t dVn2nd = 0., dVn4th = 0., dVn6th = 0., dVn8th = 0.; // integrated flow
1483 Double_t dErrVn2nd = 0., dErrVn4th = 0., dErrVn6th = 0., dErrVn8th = 0.; // error on integrated flow
1484 Double_t dYield = 0.; // pt yield
1485 Double_t dSum2nd = 0., dSum4th = 0., dSum6th = 0., dSum8th = 0.; // needed for normalizing integrated flow
1486 fnBinsPt = flow2ndPt->GetXaxis()->GetNbins();
1487 // looping over pt bins:
1488 for(Int_t p=1;p<=fnBinsPt;p++)
1490 dvn2nd = flow2ndPt->GetBinContent(p);
1491 dvn4th = flow4thPt->GetBinContent(p);
1492 dvn6th = flow6thPt->GetBinContent(p);
1493 dvn8th = flow8thPt->GetBinContent(p);
1495 dErrvn2nd = flow2ndPt->GetBinError(p);
1496 dErrvn4th = flow4thPt->GetBinError(p);
1497 dErrvn6th = flow6thPt->GetBinError(p);
1498 dErrvn8th = flow8thPt->GetBinError(p);
1500 dYield = yieldPt->GetBinContent(p);
1502 dVn2nd += dvn2nd*dYield;
1503 dVn4th += dvn4th*dYield;
1504 dVn6th += dvn6th*dYield;
1505 dVn8th += dvn8th*dYield;
1512 dErrVn2nd += dYield*dYield*dErrvn2nd*dErrvn2nd;
1513 dErrVn4th += dYield*dYield*dErrvn4th*dErrvn4th;
1514 dErrVn6th += dYield*dYield*dErrvn6th*dErrvn6th;
1515 dErrVn8th += dYield*dYield*dErrvn8th*dErrvn8th;
1516 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
1518 // normalizing the results for integrated flow:
1522 dErrVn2nd /= (dSum2nd*dSum2nd);
1523 dErrVn2nd = TMath::Sqrt(dErrVn2nd);
1528 dErrVn4th /= (dSum4th*dSum4th);
1529 dErrVn4th = TMath::Sqrt(dErrVn4th);
1534 dErrVn6th /= (dSum6th*dSum6th);
1535 dErrVn6th = TMath::Sqrt(dErrVn6th);
1540 dErrVn8th /= (dSum8th*dSum8th);
1541 dErrVn8th = TMath::Sqrt(dErrVn8th);
1544 // storing the results for integrated flow in common hist results:
1547 fCommonHistsResults2nd->FillIntegratedFlowPOI(dVn2nd,dErrVn2nd);
1548 fCommonHistsResults4th->FillIntegratedFlowPOI(dVn4th,dErrVn4th);
1549 fCommonHistsResults6th->FillIntegratedFlowPOI(dVn6th,dErrVn6th);
1550 fCommonHistsResults8th->FillIntegratedFlowPOI(dVn8th,dErrVn8th);
1552 else if(rpPoi == "RP")
1554 fCommonHistsResults2nd->FillIntegratedFlowRP(dVn2nd,dErrVn2nd);
1555 fCommonHistsResults4th->FillIntegratedFlowRP(dVn4th,dErrVn4th);
1556 fCommonHistsResults6th->FillIntegratedFlowRP(dVn6th,dErrVn6th);
1557 fCommonHistsResults8th->FillIntegratedFlowRP(dVn8th,dErrVn8th);
1566 } // end of void AliFlowAnalysisWithCumulants::CalculateIntegratedFlow(TString rpPoi)
1568 //================================================================================================================
1570 void AliFlowAnalysisWithCumulants::FillCommonHistResultsForDifferentialFlow(TString rpPoi)
1572 // Fill common result histograms for differential flow.
1573 // (to be improved - this method can be implemented much better)
1580 } else if(rpPoi == "POI")
1586 for(Int_t p=1;p<=fnBinsPt;p++)
1589 Double_t v2 = fDiffFlow[rp][0][0]->GetBinContent(p);
1590 Double_t v4 = fDiffFlow[rp][0][1]->GetBinContent(p);
1591 Double_t v6 = fDiffFlow[rp][0][2]->GetBinContent(p);
1592 Double_t v8 = fDiffFlow[rp][0][3]->GetBinContent(p);
1594 Double_t v2Error = fDiffFlow[rp][0][0]->GetBinError(p);
1595 Double_t v4Error = fDiffFlow[rp][0][1]->GetBinError(p);
1596 Double_t v6Error = fDiffFlow[rp][0][2]->GetBinError(p);
1597 Double_t v8Error = fDiffFlow[rp][0][3]->GetBinError(p);
1598 // Fill common hist results:
1601 fCommonHistsResults2nd->FillDifferentialFlowPtRP(p,v2,v2Error);
1602 fCommonHistsResults4th->FillDifferentialFlowPtRP(p,v4,v4Error);
1603 fCommonHistsResults6th->FillDifferentialFlowPtRP(p,v6,v6Error);
1604 fCommonHistsResults8th->FillDifferentialFlowPtRP(p,v8,v8Error);
1605 } else if(rpPoi == "POI")
1607 fCommonHistsResults2nd->FillDifferentialFlowPtPOI(p,v2,v2Error);
1608 fCommonHistsResults4th->FillDifferentialFlowPtPOI(p,v4,v4Error);
1609 fCommonHistsResults6th->FillDifferentialFlowPtPOI(p,v6,v6Error);
1610 fCommonHistsResults8th->FillDifferentialFlowPtPOI(p,v8,v8Error);
1612 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
1615 for(Int_t e=1;e<=fnBinsEta;e++)
1618 Double_t v2 = fDiffFlow[rp][1][0]->GetBinContent(e);
1619 Double_t v4 = fDiffFlow[rp][1][1]->GetBinContent(e);
1620 Double_t v6 = fDiffFlow[rp][1][2]->GetBinContent(e);
1621 Double_t v8 = fDiffFlow[rp][1][3]->GetBinContent(e);
1623 Double_t v2Error = fDiffFlow[rp][1][0]->GetBinError(e);
1624 Double_t v4Error = fDiffFlow[rp][1][1]->GetBinError(e);
1625 Double_t v6Error = fDiffFlow[rp][1][2]->GetBinError(e);
1626 Double_t v8Error = fDiffFlow[rp][1][3]->GetBinError(e);
1627 // Fill common hist results:
1630 fCommonHistsResults2nd->FillDifferentialFlowEtaRP(e,v2,v2Error);
1631 fCommonHistsResults4th->FillDifferentialFlowEtaRP(e,v4,v4Error);
1632 fCommonHistsResults6th->FillDifferentialFlowEtaRP(e,v6,v6Error);
1633 fCommonHistsResults8th->FillDifferentialFlowEtaRP(e,v8,v8Error);
1634 } else if(rpPoi == "POI")
1636 fCommonHistsResults2nd->FillDifferentialFlowEtaPOI(e,v2,v2Error);
1637 fCommonHistsResults4th->FillDifferentialFlowEtaPOI(e,v4,v4Error);
1638 fCommonHistsResults6th->FillDifferentialFlowEtaPOI(e,v6,v6Error);
1639 fCommonHistsResults8th->FillDifferentialFlowEtaPOI(e,v8,v8Error);
1641 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
1643 } // end of void AliFlowAnalysisWithCumulants::FillCommonHistResultsForDifferentialFlow(TString rpPoi)
1645 //================================================================================================================
1647 void AliFlowAnalysisWithCumulants::CalculateDifferentialFlow(TString rpPoi, TString ptEta)
1649 // Calculate differential flow for RPs/POIs vs pt/eta from cumulants.
1651 Int_t rp = 0; // RP or POI
1652 Int_t pe = 0; // pt or eta
1657 } else if(rpPoi == "POI")
1664 } else if(ptEta == "eta")
1669 // Reference cumulants:
1670 Double_t gfc2 = fReferenceFlowCumulants->GetBinContent(1); // reference 2nd order cumulant
1671 Double_t gfc4 = fReferenceFlowCumulants->GetBinContent(2); // reference 4th order cumulant
1672 Double_t gfc6 = fReferenceFlowCumulants->GetBinContent(3); // reference 6th order cumulant
1673 Double_t gfc8 = fReferenceFlowCumulants->GetBinContent(4); // reference 8th order cumulant
1675 Int_t nBins = fDiffFlowCumulants[rp][pe][0]->GetXaxis()->GetNbins();
1677 for(Int_t b=1;b<=nBins;b++)
1679 // Differential cumulants:
1680 Double_t gfd2 = fDiffFlowCumulants[rp][pe][0]->GetBinContent(b); // differential 2nd order cumulant
1681 Double_t gfd4 = fDiffFlowCumulants[rp][pe][1]->GetBinContent(b); // differential 4th order cumulant
1682 Double_t gfd6 = fDiffFlowCumulants[rp][pe][2]->GetBinContent(b); // differential 6th order cumulant
1683 Double_t gfd8 = fDiffFlowCumulants[rp][pe][3]->GetBinContent(b); // differential 8th order cumulant
1684 // Differential flow:
1685 Double_t v2 = 0.; // v'{2,GFC}
1686 Double_t v4 = 0.; // v'{4,GFC}
1687 Double_t v6 = 0.; // v'{6,GFC}
1688 Double_t v8 = 0.; // v'{8,GFC}
1692 v2 = gfd2/pow(gfc2,0.5);
1693 fDiffFlow[rp][pe][0]->SetBinContent(b,v2);
1698 v4 = -gfd4/pow(-gfc4,.75);
1699 fDiffFlow[rp][pe][1]->SetBinContent(b,v4);
1704 v6 = gfd6/(4.*pow((1./4.)*gfc6,(5./6.)));
1705 fDiffFlow[rp][pe][2]->SetBinContent(b,v6);
1710 v8 = -gfd8/(33.*pow(-(1./33.)*gfc8,(7./8.)));
1711 fDiffFlow[rp][pe][3]->SetBinContent(b,v8);
1713 } // end of for(Int_t b=1;b<=nBins;b++)
1715 } // end of void AliFlowAnalysisWithCumulants::CalculateDifferentialFlow(TString rpPoi,TString ptEta)
1717 //================================================================================================================
1719 void AliFlowAnalysisWithCumulants::CalculateDifferentialFlowErrors(TString rpPoi,TString ptEta)
1721 // Calculate errors of differential flow.
1723 Int_t rp = 0; // RP or POI
1724 Int_t pe = 0; // pt or eta
1729 } else if(rpPoi == "POI")
1736 } else if(ptEta == "eta")
1742 Double_t chi2 = fChi->GetBinContent(1);
1743 Double_t chi4 = fChi->GetBinContent(2);
1744 //Double_t chi6 = fChi->GetBinContent(3);
1745 //Double_t chi8 = fChi->GetBinContent(4);
1747 Int_t nBins = fNoOfParticlesInBin[rp][pe]->GetXaxis()->GetNbins();
1748 for(Int_t b=1;b<=nBins;b++)
1750 Int_t nParticles = (Int_t)fNoOfParticlesInBin[rp][pe]->GetBinEntries(b);
1751 // Error of 2nd order estimate:
1752 if(chi2>0. && nParticles>0.)
1754 Double_t v2Error = pow((1./(2.*nParticles))*((1.+pow(chi2,2.))/pow(chi2,2.)),0.5);
1755 fDiffFlow[rp][pe][0]->SetBinError(b,v2Error);
1757 // Error of 4th order estimate:
1758 if(chi4>0. && nParticles>0.)
1760 Double_t v4Error = pow((1./(2.*nParticles))*((2.+6.*pow(chi4,2.)+pow(chi4,4.)+pow(chi4,6.))/pow(chi4,6.)),0.5);
1761 fDiffFlow[rp][pe][1]->SetBinError(b,v4Error);
1763 // Error of 6th order estimate:
1764 //if(chi6>0. && nParticles>0.)
1766 // Double_t v6Error = ... // to be improved - yet to be calculated
1767 fDiffFlow[rp][pe][2]->SetBinError(b,0.);
1769 // Error of 8th order estimate:
1770 //if(chi8>0. && nParticles>0.)
1772 // Double_t v8Error = ... // to be improved - yet to be calculated
1773 fDiffFlow[rp][pe][3]->SetBinError(b,0.);
1775 } // end of for(Int_t b=1;b<=nBins;b++)
1777 } // end of void AliFlowAnalysisWithCumulants::CalculateDifferentialFlowErrors(TString rpPoi,TString ptEta)
1779 //================================================================================================================
1781 void AliFlowAnalysisWithCumulants::CalculateCumulantsForDiffFlow(TString rpPoi,TString ptEta)
1783 // Calculate cumulants for differential flow.
1785 Int_t rp = 0; // RP or POI
1786 Int_t pe = 0; // pt or eta
1791 } else if(rpPoi == "POI")
1798 } else if(ptEta == "eta")
1803 // [nBins][pMax][qMax]:
1804 Int_t nBins = fDiffFlowGenFun[0][rp][pe]->GetXaxis()->GetNbins();
1805 Int_t pMax = fDiffFlowGenFun[0][rp][pe]->GetYaxis()->GetNbins();
1806 Int_t qMax = fDiffFlowGenFun[0][rp][pe]->GetZaxis()->GetNbins();
1808 TMatrixD dAvG(pMax,qMax);
1810 for(Int_t p=0;p<pMax;p++)
1812 for(Int_t q=0;q<qMax;q++)
1814 dAvG(p,q) = fReferenceFlowGenFun->GetBinContent(fReferenceFlowGenFun->GetBin(p+1,q+1));
1817 // Loop over pt/eta bins and calculate differential cumulants:
1818 for(Int_t b=0;b<nBins;b++)
1820 Double_t gfc[5] = {0.}; // to be improved (hardwired 5)
1821 Double_t dD[5] = {0.}; // D_{p} in Eq. (11) in Practical guide // to be improved (hardwired 5)
1822 // ptBinRPNoOfParticles[b]=fPtBinRPNoOfParticles->GetBinEntries(b+1);
1823 for(Int_t p=0;p<pMax;p++)
1825 Double_t tempSum = 0.;
1826 for(Int_t q=0;q<qMax;q++)
1828 if(TMath::Abs(dAvG(p,q))>1.e-44)
1830 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)
1831 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)
1832 tempSum += cos(fMultiple*2.*q*TMath::Pi()/qMax)*dX
1833 + sin(fMultiple*2.*q*TMath::Pi()/qMax)*dY;
1836 dD[p] = (pow(fR0*pow(p+1.0,0.5),fMultiple)/qMax)*tempSum;
1838 gfc[0] = (1./(fR0*fR0))*(5.*dD[0]-5.*dD[1]+(10./3.)*dD[2]-(5./4.)*dD[3]+(1./5.)*dD[4]);
1839 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]);
1840 gfc[2] = (1./pow(fR0,6.))*((71./2.)*dD[0]-59.*dD[1]+49.*dD[2]-(41./2.)*dD[3]+(7./2.)*dD[4]);
1841 gfc[3] = (1./pow(fR0,8.))*(-84.*dD[0]+156.*dD[1]-144.*dD[2]+66.*dD[3]-12.*dD[4]);
1842 // 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?)
1844 for(Int_t co=0;co<4;co++)
1846 fDiffFlowCumulants[rp][pe][co]->SetBinContent(b+1,gfc[co]);
1850 } // end of void AliFlowAnalysisWithCumulants::CalculateCumulantsForDiffFlow(TString rpPoi, TString ptEta)
1852 //================================================================================================================
1854 void AliFlowAnalysisWithCumulants::PrintFinalResults(TString type)
1856 // Printing on the screen the final results for reference flow and for integrated flow of RPs and POIs.
1858 Int_t n = fHarmonic;
1860 Double_t dVn[4] = {0.}; // array to hold Vn{2}, Vn{4}, Vn{6} and Vn{8}
1861 Double_t dVnErr[4] = {0.}; // array to hold errors of Vn{2}, Vn{4}, Vn{6} and Vn{8}
1865 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinContent(1);
1866 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinError(1);
1867 dVn[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinContent(1);
1868 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinError(1);
1869 dVn[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinContent(1);
1870 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinError(1);
1871 dVn[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinContent(1);
1872 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinError(1);
1873 } else if(type == "RP")
1875 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinContent(1);
1876 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinError(1);
1877 dVn[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinContent(1);
1878 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinError(1);
1879 dVn[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinContent(1);
1880 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinError(1);
1881 dVn[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinContent(1);
1882 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinError(1);
1883 } else if(type == "POI")
1885 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinContent(1);
1886 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinError(1);
1887 dVn[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinContent(1);
1888 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinError(1);
1889 dVn[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinContent(1);
1890 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinError(1);
1891 dVn[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinContent(1);
1892 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinError(1);
1896 cout<<" WARNING: Impossible type (can be RF, RP or POI) !!!!"<<endl;
1897 cout<<" Results will not be printed on the screen."<<endl;
1902 TString title = " flow estimates from GF-cumulants";
1903 TString subtitle = " (";
1905 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
1907 subtitle.Append(type);
1908 subtitle.Append(", without weights)");
1911 subtitle.Append(type);
1912 subtitle.Append(", with weights)");
1916 cout<<"*************************************"<<endl;
1917 cout<<"*************************************"<<endl;
1918 cout<<title.Data()<<endl;
1919 cout<<subtitle.Data()<<endl;
1922 for(Int_t i=0;i<4;i++)
1924 cout<<" v_"<<n<<"{"<<2*(i+1)<<"} = "<<dVn[i]<<" +/- "<<dVnErr[i]<<endl;
1930 cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultRP()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultRP()->GetMean()<<endl;
1932 else if (type == "RP")
1934 cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultRP()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultRP()->GetMean()<<endl;
1936 else if (type == "POI")
1938 cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultPOI()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultPOI()->GetMean()<<endl;
1940 cout<<"*************************************"<<endl;
1941 cout<<"*************************************"<<endl;
1944 } // end of AliFlowAnalysisWithCumulants::PrintFinalResults(TString type);
1946 //================================================================================================================
1948 void AliFlowAnalysisWithCumulants::FillCommonHistResultsForReferenceFlow()
1950 // Fill in AliFlowCommonHistResults dedicated histograms for reference flow.
1953 Double_t v2 = fReferenceFlow->GetBinContent(1);
1954 Double_t v4 = fReferenceFlow->GetBinContent(2);
1955 Double_t v6 = fReferenceFlow->GetBinContent(3);
1956 Double_t v8 = fReferenceFlow->GetBinContent(4);
1958 Double_t v2Error = fReferenceFlow->GetBinError(1);
1959 Double_t v4Error = fReferenceFlow->GetBinError(2);
1960 Double_t v6Error = fReferenceFlow->GetBinError(3);
1961 Double_t v8Error = fReferenceFlow->GetBinError(4);
1962 // Fill results end errors in common hist results:
1963 fCommonHistsResults2nd->FillIntegratedFlow(v2,v2Error);
1964 fCommonHistsResults4th->FillIntegratedFlow(v4,v4Error);
1965 fCommonHistsResults6th->FillIntegratedFlow(v6,v6Error);
1966 fCommonHistsResults8th->FillIntegratedFlow(v8,v8Error);
1968 Double_t chi2 = fChi->GetBinContent(1);
1969 Double_t chi4 = fChi->GetBinContent(2);
1970 Double_t chi6 = fChi->GetBinContent(3);
1971 Double_t chi8 = fChi->GetBinContent(4);
1972 // Fill resolution chi in common hist results:
1973 fCommonHistsResults2nd->FillChi(chi2);
1974 fCommonHistsResults4th->FillChi(chi4);
1975 fCommonHistsResults6th->FillChi(chi6);
1976 fCommonHistsResults8th->FillChi(chi8);
1978 } // end of AliFlowAnalysisWithCumulants::FillCommonHistResultsForReferenceFlow()
1980 //================================================================================================================
1982 void AliFlowAnalysisWithCumulants::CalculateReferenceFlowError()
1984 // Calculate error of reference flow harmonics.
1986 // Generating Function Cumulants:
1987 Double_t gfc2 = fReferenceFlowCumulants->GetBinContent(1); // GFC{2}
1988 Double_t gfc4 = fReferenceFlowCumulants->GetBinContent(2); // GFC{4}
1989 Double_t gfc6 = fReferenceFlowCumulants->GetBinContent(3); // GFC{6}
1990 Double_t gfc8 = fReferenceFlowCumulants->GetBinContent(4); // GFC{8}
1991 // Reference flow estimates:
1992 Double_t v2 = fReferenceFlow->GetBinContent(1); // v{2,GFC}
1993 Double_t v4 = fReferenceFlow->GetBinContent(2); // v{4,GFC}
1994 Double_t v6 = fReferenceFlow->GetBinContent(3); // v{6,GFC}
1995 Double_t v8 = fReferenceFlow->GetBinContent(4); // v{8,GFC}
1996 // Statistical errors of reference flow estimates:
1997 Double_t v2Error = 0.; // statistical error of v{2,GFC}
1998 Double_t v4Error = 0.; // statistical error of v{4,GFC}
1999 Double_t v6Error = 0.; // statistical error of v{6,GFC}
2000 Double_t v8Error = 0.; // statistical error of v{8,GFC}
2006 // <Q-vector stuff>:
2007 Double_t dAvQx = fQvectorComponents->GetBinContent(1); // <Q_x>
2008 Double_t dAvQy = fQvectorComponents->GetBinContent(2); // <Q_y>
2009 Double_t dAvQ2x = fQvectorComponents->GetBinContent(3); // <(Q_x)^2>
2010 Double_t dAvQ2y = fQvectorComponents->GetBinContent(4); // <(Q_y)^2>
2012 Double_t dAvw2 = 1.;
2015 dAvw2 = fAverageOfSquaredWeight->GetBinContent(1);
2016 if(TMath::Abs(dAvw2)<1.e-44)
2019 cout<<" WARNING (GFC): Average of squared weight is 0 in GFC. Most probably one of the histograms"<<endl;
2020 cout<<" in the file \"weights.root\" was empty. Nothing will be calculated !!!!"<<endl;
2024 // Calculating statistical error of v{2,GFC}:
2025 if(fnEvts>0. && fAvM>0. && dAvw2>0. && gfc2>=0.)
2027 if((dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow(gfc2,(1./2.))*(fAvM/dAvw2),2.)>0.))
2029 chi2 = (fAvM*v2)/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(v2*fAvM/dAvw2,2.),0.5);
2031 if(TMath::Abs(chi2)>1.e-44)
2033 v2Error = pow(((1./(2.*fAvM*fnEvts))*((1.+2.*pow(chi2,2))/(2.*pow(chi2,2)))),0.5);
2036 // Calculating statistical error of v{4,GFC}:
2037 if(fnEvts>0 && fAvM>0 && dAvw2>0 && gfc4<=0.)
2039 if((dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow(-gfc4,(1./4.))*(fAvM/dAvw2),2.)>0.))
2041 chi4 = (fAvM*v4)/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(v4*fAvM/dAvw2,2.),0.5);
2043 if(TMath::Abs(chi4)>1.e-44)
2045 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);
2048 // Calculating statistical error of v{6,GFC}:
2049 if(fnEvts>0 && fAvM>0 && dAvw2>0 && gfc6>=0.)
2051 if((dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow((1./4.)*gfc6,(1./6.))*(fAvM/dAvw2),2.)>0.))
2053 chi6 = (fAvM*v6)/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(v6*fAvM/dAvw2,2.),0.5);
2055 if(TMath::Abs(chi6)>1.e-44)
2057 v6Error = (1./(pow(2.*fAvM*fnEvts,0.5)))*pow((3.+18.*pow(chi6,2)+9.*pow(chi6,4.)+28.*pow(chi6,6.)
2058 +12.*pow(chi6,8.)+24.*pow(chi6,10.))/(24.*pow(chi6,10.)),0.5);
2061 // Calculating statistical error of v{8,GFC}:
2062 if(fnEvts>0 && fAvM>0 && dAvw2>0 && gfc8<=0.)
2064 if((dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow(-(1./33.)*gfc8,(1./8.))*(fAvM/dAvw2),2.)>0.))
2066 chi8=(fAvM*v8)/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(v8*fAvM/dAvw2,2.),0.5);
2068 if(TMath::Abs(chi8)>1.e-44)
2070 v8Error = (1./(pow(2.*fAvM*fnEvts,0.5)))*pow((12.+96.*pow(chi8,2.)+72.*pow(chi8,4.)+304.*pow(chi8,6.)
2071 +257.*pow(chi8,8.)+804.*pow(chi8,10.)+363.*pow(chi8,12.)+726.*pow(chi8,14.))/(726.*pow(chi8,14.)),0.5);
2075 // Store errors for reference flow:
2076 fReferenceFlow->SetBinError(1,v2Error);
2077 fReferenceFlow->SetBinError(2,v4Error);
2078 fReferenceFlow->SetBinError(3,v6Error);
2079 fReferenceFlow->SetBinError(4,v8Error);
2080 // Store resolution chi:
2081 fChi->SetBinContent(1,chi2);
2082 fChi->SetBinContent(2,chi4);
2083 fChi->SetBinContent(3,chi6);
2084 fChi->SetBinContent(4,chi8);
2086 } // end of void AliFlowAnalysisWithCumulants::CalculateReferenceFlowError()
2088 //================================================================================================================
2090 void AliFlowAnalysisWithCumulants::CalculateReferenceFlow()
2092 // Calculate from isotropic cumulants reference flow.
2094 // Generating Function Cumulants:
2095 Double_t gfc2 = fReferenceFlowCumulants->GetBinContent(1); // GFC{2}
2096 Double_t gfc4 = fReferenceFlowCumulants->GetBinContent(2); // GFC{4}
2097 Double_t gfc6 = fReferenceFlowCumulants->GetBinContent(3); // GFC{6}
2098 Double_t gfc8 = fReferenceFlowCumulants->GetBinContent(4); // GFC{8}
2099 // Reference flow estimates:
2100 Double_t v2 = 0.; // v{2,GFC}
2101 Double_t v4 = 0.; // v{4,GFC}
2102 Double_t v6 = 0.; // v{6,GFC}
2103 Double_t v8 = 0.; // v{8,GFC}
2104 // Calculate reference flow estimates from Q-cumulants:
2105 if(gfc2>=0.) v2 = pow(gfc2,1./2.);
2106 if(gfc4<=0.) v4 = pow(-1.*gfc4,1./4.);
2107 if(gfc6>=0.) v6 = pow((1./4.)*gfc6,1./6.);
2108 if(gfc8<=0.) v8 = pow((-1./33.)*gfc8,1./8.);
2109 // Store results for reference flow:
2110 fReferenceFlow->SetBinContent(1,v2);
2111 fReferenceFlow->SetBinContent(2,v4);
2112 fReferenceFlow->SetBinContent(3,v6);
2113 fReferenceFlow->SetBinContent(4,v8);
2115 } // end of void AliFlowAnalysisWithCumulants::CalculateReferenceFlow()
2117 //================================================================================================================
2119 void AliFlowAnalysisWithCumulants::CalculateCumulantsForReferenceFlow()
2121 // Calculate cumulants for reference flow.
2123 Int_t pMax = fReferenceFlowGenFun->GetXaxis()->GetNbins();
2124 Int_t qMax = fReferenceFlowGenFun->GetYaxis()->GetNbins();
2127 TMatrixD dAvG(pMax,qMax);
2129 Bool_t someAvGEntryIsNegative = kFALSE;
2130 for(Int_t p=0;p<pMax;p++)
2132 for(Int_t q=0;q<qMax;q++)
2134 dAvG(p,q) = fReferenceFlowGenFun->GetBinContent(fReferenceFlowGenFun->GetBin(p+1,q+1));
2137 someAvGEntryIsNegative = kTRUE;
2139 cout<<" WARNING: "<<Form("<G[%d][%d]> is negative !!!! GFC results are meaningless.",p,q)<<endl;
2145 // C[p][q] (generating function for the cumulants)
2146 TMatrixD dC(pMax,qMax);
2148 if(fAvM>0. && !someAvGEntryIsNegative)
2150 for(Int_t p=0;p<pMax;p++)
2152 for(Int_t q=0;q<qMax;q++)
2154 dC(p,q) = fAvM*(pow(dAvG(p,q),(1./fAvM))-1.);
2159 // Averaging the generating function for cumulants over azimuth
2160 // in order to eliminate detector effects.
2161 // <C[p][q]> (Remark: here <> stands for average over azimuth):
2162 TVectorD dAvC(pMax);
2164 for(Int_t p=0;p<pMax;p++)
2167 for(Int_t q=0;q<qMax;q++)
2171 dAvC[p] = temp/qMax;
2174 // Finally, the isotropic cumulants for reference flow:
2175 TVectorD cumulant(pMax);
2177 cumulant[0] = (-1./(60*fR0*fR0))*((-300.)*dAvC[0]+300.*dAvC[1]-200.*dAvC[2]+75.*dAvC[3]-12.*dAvC[4]);
2178 cumulant[1] = (-1./(6.*pow(fR0,4.)))*(154.*dAvC[0]-214.*dAvC[1]+156.*dAvC[2]-61.*dAvC[3]+10.*dAvC[4]);
2179 cumulant[2] = (3./(2.*pow(fR0,6.)))*(71.*dAvC[0]-118.*dAvC[1]+98.*dAvC[2]-41.*dAvC[3]+7.*dAvC[4]);
2180 cumulant[3] = (-24./pow(fR0,8.))*(14.*dAvC[0]-26.*dAvC[1]+24.*dAvC[2]-11.*dAvC[3]+2.*dAvC[4]);
2181 cumulant[4] = (120./pow(fR0,10.))*(5.*dAvC[0]-10.*dAvC[1]+10.*dAvC[2]-5.*dAvC[3]+1.*dAvC[4]);
2184 // Remark: the highest order cumulant is on purpose in the overflow.
2185 for(Int_t co=0;co<pMax;co++) // cumulant order
2187 fReferenceFlowCumulants->SetBinContent(co+1,cumulant[co]);
2190 // Calculation versus multiplicity:
2191 if(!fCalculateVsMultiplicity){return;}
2192 for(Int_t b=0;b<fnBinsMult;b++)
2194 fAvM = fAvMVsM->GetBinContent(b+1);
2196 TMatrixD dAvGVsM(pMax,qMax);
2198 Bool_t someAvGEntryIsNegativeVsM = kFALSE;
2199 for(Int_t p=0;p<pMax;p++)
2201 for(Int_t q=0;q<qMax;q++)
2203 dAvGVsM(p,q) = fReferenceFlowGenFunVsM->GetBinContent(fReferenceFlowGenFunVsM->GetBin(b+1,p+1,q+1));
2206 someAvGEntryIsNegativeVsM = kTRUE;
2208 cout<<" WARNING: "<<Form("<G[%d][%d]> is negative !!!! GFC vs multiplicity results are meaningless.",p,q)<<endl;
2214 // C[p][q] (generating function for the cumulants)
2215 TMatrixD dCVsM(pMax,qMax);
2217 if(fAvM>0. && !someAvGEntryIsNegativeVsM)
2219 for(Int_t p=0;p<pMax;p++)
2221 for(Int_t q=0;q<qMax;q++)
2223 dCVsM(p,q) = fAvM*(pow(dAvGVsM(p,q),(1./fAvM))-1.);
2228 // Averaging the generating function for cumulants over azimuth
2229 // in order to eliminate detector effects.
2230 // <C[p][q]> (Remark: here <> stands for average over azimuth):
2231 TVectorD dAvCVsM(pMax);
2233 for(Int_t p=0;p<pMax;p++)
2235 Double_t tempVsM = 0.;
2236 for(Int_t q=0;q<qMax;q++)
2238 tempVsM += 1.*dCVsM(p,q);
2240 dAvCVsM[p] = tempVsM/qMax;
2243 // Finally, the isotropic cumulants for reference flow:
2244 TVectorD cumulantVsM(pMax);
2246 cumulantVsM[0] = (-1./(60*fR0*fR0))*((-300.)*dAvCVsM[0]+300.*dAvCVsM[1]-200.*dAvCVsM[2]+75.*dAvCVsM[3]-12.*dAvCVsM[4]);
2247 cumulantVsM[1] = (-1./(6.*pow(fR0,4.)))*(154.*dAvCVsM[0]-214.*dAvCVsM[1]+156.*dAvCVsM[2]-61.*dAvCVsM[3]+10.*dAvCVsM[4]);
2248 cumulantVsM[2] = (3./(2.*pow(fR0,6.)))*(71.*dAvCVsM[0]-118.*dAvCVsM[1]+98.*dAvCVsM[2]-41.*dAvCVsM[3]+7.*dAvCVsM[4]);
2249 cumulantVsM[3] = (-24./pow(fR0,8.))*(14.*dAvCVsM[0]-26.*dAvCVsM[1]+24.*dAvCVsM[2]-11.*dAvCVsM[3]+2.*dAvCVsM[4]);
2250 cumulantVsM[4] = (120./pow(fR0,10.))*(5.*dAvCVsM[0]-10.*dAvCVsM[1]+10.*dAvCVsM[2]-5.*dAvCVsM[3]+1.*dAvCVsM[4]);
2253 for(Int_t co=0;co<pMax-1;co++) // cumulant order
2255 fReferenceFlowCumulantsVsM[co]->SetBinContent(b+1,cumulantVsM[co]);
2257 } // end of for(Int_t b=0;b<fnBinsMult;b++)
2259 } // end of void AliFlowAnalysisWithCumulants::CalculateCumulantsForReferenceFlow()
2261 //================================================================================================================
2263 void AliFlowAnalysisWithCumulants::GetAvMultAndNoOfEvts()
2265 // From relevant common control histogram get average multiplicity of RPs and number of events.
2267 fAvM = (Double_t)fCommonHists->GetHistMultRP()->GetMean();
2268 fnEvts = (Int_t)fCommonHists->GetHistMultRP()->GetEntries();
2270 } // end of void AliFlowAnalysisWithCumulants::GetAvMultAndNoOfEvts()
2272 //================================================================================================================
2274 void AliFlowAnalysisWithCumulants::InitializeArrays()
2276 // Initialize all arrays.
2278 for(Int_t ri=0;ri<2;ri++)
2280 for(Int_t rp=0;rp<2;rp++)
2282 for(Int_t pe=0;pe<2;pe++)
2284 fDiffFlowGenFun[ri][rp][pe] = NULL;
2288 for(Int_t rp=0;rp<2;rp++)
2290 for(Int_t pe=0;pe<2;pe++)
2292 fNoOfParticlesInBin[rp][pe] = NULL;
2295 for(Int_t rp=0;rp<2;rp++)
2297 for(Int_t pe=0;pe<2;pe++)
2299 for(Int_t co=0;co<4;co++)
2301 fDiffFlowCumulants[rp][pe][co] = NULL;
2302 fDiffFlow[rp][pe][co] = NULL;
2306 for(Int_t i=0;i<3;i++)
2308 fPrintFinalResults[i] = kTRUE;
2310 for(Int_t r=0;r<10;r++)
2313 for(Int_t pq=0;pq<5;pq++)
2315 fTuningGenFun[r][pq] = NULL;
2316 fTuningCumulants[r][pq] = NULL;
2317 fTuningFlow[r][pq] = NULL;
2320 for(Int_t co=0;co<4;co++)
2322 fReferenceFlowCumulantsVsM[co] = NULL;
2325 } // end of void AliFlowAnalysisWithCumulants::InitializeArrays()
2327 //================================================================================================================
2329 void AliFlowAnalysisWithCumulants::CrossCheckSettings()
2331 // Cross-check the user settings before starting.
2333 // a) Cross check if the choice for multiplicity weight make sense.
2335 // a) Cross check if the choice for multiplicity weight make sense:
2336 if(strcmp(fMultiplicityWeight->Data(),"unit") &&
2337 strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2340 cout<<"WARNING (GFC): Multiplicity weight can be either \"unit\" or \"multiplicity\"."<<endl;
2341 cout<<" Certainly not \""<<fMultiplicityWeight->Data()<<"\"."<<endl;
2348 } // end of void AliFlowAnalysisWithCumulants::CrossCheckSettings()
2350 //================================================================================================================
2352 void AliFlowAnalysisWithCumulants::AccessConstants()
2354 // Access needed common constants from AliFlowCommonConstants.
2356 fnBinsPhi = AliFlowCommonConstants::GetMaster()->GetNbinsPhi();
2357 fPhiMin = AliFlowCommonConstants::GetMaster()->GetPhiMin();
2358 fPhiMax = AliFlowCommonConstants::GetMaster()->GetPhiMax();
2359 if(fnBinsPhi) fPhiBinWidth = (fPhiMax-fPhiMin)/fnBinsPhi;
2360 fnBinsPt = AliFlowCommonConstants::GetMaster()->GetNbinsPt();
2361 fPtMin = AliFlowCommonConstants::GetMaster()->GetPtMin();
2362 fPtMax = AliFlowCommonConstants::GetMaster()->GetPtMax();
2363 if(fnBinsPt) fPtBinWidth = (fPtMax-fPtMin)/fnBinsPt;
2364 fnBinsEta = AliFlowCommonConstants::GetMaster()->GetNbinsEta();
2365 fEtaMin = AliFlowCommonConstants::GetMaster()->GetEtaMin();
2366 fEtaMax = AliFlowCommonConstants::GetMaster()->GetEtaMax();
2367 if(fnBinsEta) fEtaBinWidth = (fEtaMax-fEtaMin)/fnBinsEta;
2369 } // end of void AliFlowAnalysisWithCumulants::AccessConstants()
2371 //================================================================================================================
2373 void AliFlowAnalysisWithCumulants::BookAndFillWeightsHistograms()
2375 // Book and fill histograms which hold phi, pt and eta weights.
2379 cout<<"WARNING (GFC): fWeightsList is NULL in AFAWGFC::BAFWH() !!!!"<<endl;
2385 if(fWeightsList->FindObject("phi_weights"))
2387 fPhiWeights = dynamic_cast<TH1F*>(fWeightsList->FindObject("phi_weights"));
2388 if(!fPhiWeights){printf("\n WARNING (GFC): !fPhiWeights !!!!\n");exit(0);}
2389 if(TMath::Abs(fPhiWeights->GetBinWidth(1)-fPhiBinWidth)>pow(10.,-6.))
2392 cout<<"WARNING (GFC): Inconsistent binning in histograms for phi-weights throughout the code."<<endl;
2399 cout<<"WARNING (GFC): fWeightsList->FindObject(\"phi_weights\") is NULL in AFAWGFC::BAFWH() !!!!"<<endl;
2403 } // end of if(fUsePhiWeights)
2407 if(fWeightsList->FindObject("pt_weights"))
2409 fPtWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("pt_weights"));
2410 if(!fPtWeights){printf("\n WARNING (GFC): !fPtWeights !!!!\n");exit(0);}
2411 if(TMath::Abs(fPtWeights->GetBinWidth(1)-fPtBinWidth)>pow(10.,-6.))
2414 cout<<"WARNING (GFC): Inconsistent binning in histograms for pt-weights throughout the code."<<endl;
2421 cout<<"WARNING (GFC): fWeightsList->FindObject(\"pt_weights\") is NULL in AFAWGFC::BAFWH() !!!!"<<endl;
2425 } // end of if(fUsePtWeights)
2429 if(fWeightsList->FindObject("eta_weights"))
2431 fEtaWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("eta_weights"));
2432 if(!fEtaWeights){printf("\n WARNING (GFC): !fEtaWeights !!!!\n");exit(0);}
2433 if(TMath::Abs(fEtaWeights->GetBinWidth(1)-fEtaBinWidth)>pow(10.,-6.))
2436 cout<<"WARNING (GFC): Inconsistent binning in histograms for eta-weights throughout the code."<<endl;
2443 cout<<"WARNING (GFC): fUseEtaWeights && fWeightsList->FindObject(\"eta_weights\") is NULL in AFAWGFC::BAFWH() !!!!"<<endl;
2447 } // end of if(fUseEtaWeights)
2449 } // end of AliFlowAnalysisWithCumulants::BookAndFillWeightsHistograms()
2451 //================================================================================================================
2453 void AliFlowAnalysisWithCumulants::BookEverythingForCalculationVsMultiplicity()
2455 // Book all objects relevant for flow analysis versus multiplicity.
2457 // a) Define constants;
2458 // b) Book all profiles;
2459 // c) Book all results.
2461 // a) Define constants and local flags:
2464 TString cumulantFlag[4] = {"GFC{2}","GFC{4}","GFC{6}","GFC{8}"};
2466 // b) Book all profiles:
2467 // Average of the generating function for reference flow <G[p][q]> versus multiplicity:
2468 fReferenceFlowGenFunVsM = new TProfile3D("fReferenceFlowGenFunVsM","#LTG[p][q]#GT vs M",fnBinsMult,fMinMult,fMaxMult,pMax,0.,(Double_t)pMax,qMax,0.,(Double_t)qMax);
2469 fReferenceFlowGenFunVsM->SetXTitle("M");
2470 fReferenceFlowGenFunVsM->SetYTitle("p");
2471 fReferenceFlowGenFunVsM->SetZTitle("q");
2472 fReferenceFlowProfiles->Add(fReferenceFlowGenFunVsM);
2473 // Averages of Q-vector components versus multiplicity:
2474 fQvectorComponentsVsM = new TProfile2D("fQvectorComponentsVsM","Averages of Q-vector components",fnBinsMult,fMinMult,fMaxMult,4,0.,4.);
2475 //fQvectorComponentsVsM->SetLabelSize(0.06);
2476 fQvectorComponentsVsM->SetMarkerStyle(25);
2477 fQvectorComponentsVsM->SetXTitle("M");
2478 fQvectorComponentsVsM->GetYaxis()->SetBinLabel(1,"#LTQ_{x}#GT"); // Q_{x}
2479 fQvectorComponentsVsM->GetYaxis()->SetBinLabel(2,"#LTQ_{y}#GT"); // Q_{y}
2480 fQvectorComponentsVsM->GetYaxis()->SetBinLabel(3,"#LTQ_{x}^{2}#GT"); // Q_{x}^{2}
2481 fQvectorComponentsVsM->GetYaxis()->SetBinLabel(4,"#LTQ_{y}^{2}#GT"); // Q_{y}^{2}
2482 fReferenceFlowProfiles->Add(fQvectorComponentsVsM);
2483 // <<w^2>>, where w = wPhi*wPt*wEta versus multiplicity:
2484 fAverageOfSquaredWeightVsM = new TProfile2D("fAverageOfSquaredWeightVsM","#LT#LTw^{2}#GT#GT",fnBinsMult,fMinMult,fMaxMult,1,0,1);
2485 fAverageOfSquaredWeightVsM->SetLabelSize(0.06);
2486 fAverageOfSquaredWeightVsM->SetMarkerStyle(25);
2487 fAverageOfSquaredWeightVsM->SetLabelOffset(0.01);
2488 fAverageOfSquaredWeightVsM->GetXaxis()->SetBinLabel(1,"#LT#LTw^{2}#GT#GT");
2489 fReferenceFlowProfiles->Add(fAverageOfSquaredWeightVsM);
2490 // <M> vs multiplicity bin:
2491 fAvMVsM = new TProfile("fAvMVsM","#LTM#GT vs M",fnBinsMult,fMinMult,fMaxMult);
2492 //fAvMVsM->SetLabelSize(0.06);
2493 fAvMVsM->SetMarkerStyle(25);
2494 fAvMVsM->SetLabelOffset(0.01);
2495 fAvMVsM->SetXTitle("M");
2496 fAvMVsM->SetYTitle("#LTM#GT");
2497 fReferenceFlowProfiles->Add(fAvMVsM);
2499 // c) Book all results:
2500 // Final results for reference GF-cumulants versus multiplicity:
2501 TString referenceFlowCumulantsVsMName = "fReferenceFlowCumulantsVsM";
2502 for(Int_t co=0;co<4;co++) // cumulant order
2504 fReferenceFlowCumulantsVsM[co] = new TH1D(Form("%s, %s",referenceFlowCumulantsVsMName.Data(),cumulantFlag[co].Data()),
2505 Form("%s vs multipicity",cumulantFlag[co].Data()),
2506 fnBinsMult,fMinMult,fMaxMult);
2507 fReferenceFlowCumulantsVsM[co]->SetMarkerStyle(25);
2508 fReferenceFlowCumulantsVsM[co]->GetXaxis()->SetTitle("M");
2509 fReferenceFlowCumulantsVsM[co]->GetYaxis()->SetTitle(cumulantFlag[co].Data());
2510 fReferenceFlowResults->Add(fReferenceFlowCumulantsVsM[co]);
2511 } // end of for(Int_t co=0;co<4;co++) // cumulant order
2513 } // end of void AliFlowAnalysisWithCumulants::BookEverythingForCalculationVsMultiplicity()
2515 //================================================================================================================
2517 void AliFlowAnalysisWithCumulants::BookEverythingForReferenceFlow()
2519 // Book all objects relevant for calculation of reference flow.
2521 // a) Define static constants for array's boundaries;
2522 // b) Book profile to hold all flags for reference flow;
2523 // c) Book all event-by-event quantities;
2524 // d) Book all profiles;
2525 // e) Book all histograms.
2527 // a) Define static constants for array's boundaries:
2528 static const Int_t pMax = 5;
2529 static const Int_t qMax = 11;
2531 // b) Book profile to hold all flags for reference flow:
2532 TString referenceFlowFlagsName = "fReferenceFlowFlags";
2533 fReferenceFlowFlags = new TProfile(referenceFlowFlagsName.Data(),"Flags for Reference Flow",2,0,2);
2534 fReferenceFlowFlags->SetTickLength(-0.01,"Y");
2535 fReferenceFlowFlags->SetMarkerStyle(25);
2536 fReferenceFlowFlags->SetLabelSize(0.05);
2537 fReferenceFlowFlags->SetLabelOffset(0.02,"Y");
2538 fReferenceFlowFlags->GetXaxis()->SetBinLabel(1,"Particle weights");
2539 fReferenceFlowFlags->GetXaxis()->SetBinLabel(2,"Event weights");
2540 fReferenceFlowList->Add(fReferenceFlowFlags);
2542 // c) Book all event-by-event quantities:
2543 fGEBE = new TMatrixD(pMax,qMax);
2545 // d) Book all profiles:
2546 // Average of the generating function for reference flow <G[p][q]>:
2547 fReferenceFlowGenFun = new TProfile2D("fReferenceFlowGenFun","#LTG[p][q]#GT",pMax,0.,(Double_t)pMax,qMax,0.,(Double_t)qMax);
2548 fReferenceFlowGenFun->SetXTitle("p");
2549 fReferenceFlowGenFun->SetYTitle("q");
2550 fReferenceFlowProfiles->Add(fReferenceFlowGenFun);
2551 // Averages of Q-vector components:
2552 fQvectorComponents = new TProfile("fQvectorComponents","Averages of Q-vector components",4,0.,4.);
2553 fQvectorComponents->SetLabelSize(0.06);
2554 fQvectorComponents->SetMarkerStyle(25);
2555 fQvectorComponents->GetXaxis()->SetBinLabel(1,"#LTQ_{x}#GT"); // Q_{x}
2556 fQvectorComponents->GetXaxis()->SetBinLabel(2,"#LTQ_{y}#GT"); // Q_{y}
2557 fQvectorComponents->GetXaxis()->SetBinLabel(3,"#LTQ_{x}^{2}#GT"); // Q_{x}^{2}
2558 fQvectorComponents->GetXaxis()->SetBinLabel(4,"#LTQ_{y}^{2}#GT"); // Q_{y}^{2}
2559 fReferenceFlowProfiles->Add(fQvectorComponents);
2560 // <<w^2>>, where w = wPhi*wPt*wEta:
2561 fAverageOfSquaredWeight = new TProfile("fAverageOfSquaredWeight","#LT#LTw^{2}#GT#GT",1,0,1);
2562 fAverageOfSquaredWeight->SetLabelSize(0.06);
2563 fAverageOfSquaredWeight->SetMarkerStyle(25);
2564 fAverageOfSquaredWeight->SetLabelOffset(0.01);
2565 fAverageOfSquaredWeight->GetXaxis()->SetBinLabel(1,"#LT#LTw^{2}#GT#GT");
2566 fReferenceFlowProfiles->Add(fAverageOfSquaredWeight);
2568 // e) Book all histograms:
2569 // Final results for isotropic cumulants for reference flow:
2570 TString referenceFlowCumulantsName = "fReferenceFlowCumulants";
2571 fReferenceFlowCumulants = new TH1D(referenceFlowCumulantsName.Data(),"Isotropic Generating Function Cumulants for reference flow",4,0,4); // to be improved (hw 4)
2572 fReferenceFlowCumulants->SetLabelSize(0.05);
2573 fReferenceFlowCumulants->SetMarkerStyle(25);
2574 fReferenceFlowCumulants->GetXaxis()->SetBinLabel(1,"GFC{2}");
2575 fReferenceFlowCumulants->GetXaxis()->SetBinLabel(2,"GFC{4}");
2576 fReferenceFlowCumulants->GetXaxis()->SetBinLabel(3,"GFC{6}");
2577 fReferenceFlowCumulants->GetXaxis()->SetBinLabel(4,"GFC{8}");
2578 fReferenceFlowResults->Add(fReferenceFlowCumulants);
2579 // Final results for reference flow:
2580 fReferenceFlow = new TH1D("fReferenceFlow","Reference flow",4,0,4); // to be improved (hardwired 4)
2581 fReferenceFlow->SetLabelSize(0.05);
2582 fReferenceFlow->SetMarkerStyle(25);
2583 fReferenceFlow->GetXaxis()->SetBinLabel(1,"v_{n}{2,GFC}");
2584 fReferenceFlow->GetXaxis()->SetBinLabel(2,"v_{n}{4,GFC}");
2585 fReferenceFlow->GetXaxis()->SetBinLabel(3,"v_{n}{6,GFC}");
2586 fReferenceFlow->GetXaxis()->SetBinLabel(4,"v_{n}{8,GFC}");
2587 fReferenceFlowResults->Add(fReferenceFlow);
2588 // Final results for resolution:
2589 fChi = new TH1D("fChi","Resolution",4,0,4); // to be improved (hardwired 4)
2590 fChi->SetLabelSize(0.06);
2591 fChi->SetMarkerStyle(25);
2592 fChi->GetXaxis()->SetBinLabel(1,"#chi_{2}");
2593 fChi->GetXaxis()->SetBinLabel(2,"#chi_{4}");
2594 fChi->GetXaxis()->SetBinLabel(3,"#chi_{6}");
2595 fChi->GetXaxis()->SetBinLabel(4,"#chi_{8}");
2596 fReferenceFlowResults->Add(fChi);
2598 } // end of void AliFlowAnalysisWithCumulants::BookEverythingForReferenceFlow()
2600 //================================================================================================================
2602 void AliFlowAnalysisWithCumulants::BookEverythingForTuning()
2604 // Book all objects relevant for tuning.
2606 // a) Define pMax's and qMax's:
2607 // b) Book profile to hold all tuning parameters and flags;
2608 // c) Book all profiles;
2609 // d) Book all histograms.
2611 // a) Define pMax's and qMax's:
2612 Int_t pMax[5] = {2,3,4,5,8};
2613 Int_t qMax[5] = {5,7,9,11,17};
2615 // b) Book profile to hold all tuning parameters and flags:
2616 TString tuningFlagsName = "fTuningFlags";
2617 fTuningFlags = new TProfile(tuningFlagsName.Data(),"Tuning parameters",10,0,10);
2618 // fTuningFlags->SetTickLength(-0.01,"Y");
2619 fTuningFlags->SetMarkerStyle(25);
2620 fTuningFlags->SetLabelSize(0.05);
2621 fTuningFlags->SetLabelOffset(0.02,"X");
2622 for(Int_t r=1;r<=10;r++)
2624 fTuningFlags->GetXaxis()->SetBinLabel(r,Form("r_{0,%d}",r-1));
2625 fTuningFlags->Fill(r-0.5,fTuningR0[r-1],1.);
2627 fTuningList->Add(fTuningFlags);
2629 // c) Book all profiles:
2630 // Average of the generating function for reference flow <G[p][q]> for different tuning parameters:
2631 for(Int_t r=0;r<10;r++)
2633 for(Int_t pq=0;pq<5;pq++)
2635 fTuningGenFun[r][pq] = new TProfile2D(Form("fTuningGenFun (r_{0,%i}, pq set %i)",r,pq),
2636 Form("#LTG[p][q]#GT for r_{0} = %f, p_{max} = %i, q_{max} = %i",fTuningR0[r],pMax[pq],qMax[pq]),
2637 pMax[pq],0.,(Double_t)pMax[pq],qMax[pq],0.,(Double_t)qMax[pq]);
2638 fTuningGenFun[r][pq]->SetXTitle("p");
2639 fTuningGenFun[r][pq]->SetYTitle("q");
2640 fTuningProfiles->Add(fTuningGenFun[r][pq]);
2643 // Average multiplicities for events with nRPs >= cuttof:
2644 fTuningAvM = new TProfile("fTuningAvM","Average multiplicity",5,0,5);
2645 fTuningAvM->SetMarkerStyle(25);
2646 for(Int_t b=1;b<=5;b++)
2648 fTuningAvM->GetXaxis()->SetBinLabel(b,Form("nRP #geq %i",2*pMax[b-1]));
2650 fTuningProfiles->Add(fTuningAvM);
2652 // d) Book all histograms:
2653 // Final results for isotropic cumulants for reference flow for different tuning parameters:
2654 for(Int_t r=0;r<10;r++)
2656 for(Int_t pq=0;pq<5;pq++)
2658 fTuningCumulants[r][pq] = new TH1D(Form("fTuningCumulants (r_{0,%i}, pq set %i)",r,pq),
2659 Form("GFC for r_{0} = %f, p_{max} = %i, q_{max} = %i",fTuningR0[r],pMax[pq],qMax[pq]),
2660 pMax[pq],0,pMax[pq]);
2661 // fTuningCumulants[r][pq]->SetLabelSize(0.05);
2662 fTuningCumulants[r][pq]->SetMarkerStyle(25);
2663 for(Int_t b=1;b<=pMax[pq];b++)
2665 fTuningCumulants[r][pq]->GetXaxis()->SetBinLabel(b,Form("GFC{%i}",2*b));
2667 fTuningResults->Add(fTuningCumulants[r][pq]);
2670 // Final results for reference flow for different tuning parameters:
2671 for(Int_t r=0;r<10;r++)
2673 for(Int_t pq=0;pq<5;pq++)
2675 fTuningFlow[r][pq] = new TH1D(Form("fTuningFlow (r_{0,%i}, pq set %i)",r,pq),
2676 Form("Reference flow for r_{0} = %f, p_{max} = %i, q_{max} = %i",fTuningR0[r],pMax[pq],qMax[pq]),
2677 pMax[pq],0,pMax[pq]);
2678 // fTuningFlow[r][pq]->SetLabelSize(0.06);
2679 fTuningFlow[r][pq]->SetMarkerStyle(25);
2680 for(Int_t b=1;b<=pMax[pq];b++)
2682 fTuningFlow[r][pq]->GetXaxis()->SetBinLabel(b,Form("v{%i,GFC}",2*b));
2684 fTuningResults->Add(fTuningFlow[r][pq]);
2688 } // end of void AliFlowAnalysisWithCumulants::BookEverythingForTuning()
2690 //================================================================================================================
2692 void AliFlowAnalysisWithCumulants::BookEverythingForDiffFlow()
2694 // Book all objects relevant for calculation of differential flow.
2696 // a) Define static constants for array's boundaries;
2697 // b) Define local variables and local flags for booking;
2698 // c) Book profile to hold all flags for differential flow;
2699 // d) Book all event-by-event quantities;
2700 // e) Book all profiles;
2701 // f) Book all histograms.
2703 // a) Define static constants for array's boundaries:
2704 static const Int_t pMax = 5;
2705 static const Int_t qMax = 11;
2707 // b) Define local variables and local flags for booking:
2708 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
2709 Double_t minPtEta[2] = {fPtMin,fEtaMin};
2710 Double_t maxPtEta[2] = {fPtMax,fEtaMax};
2711 TString reIm[2] = {"Re","Im"};
2712 TString rpPoi[2] = {"RP","POI"};
2713 TString ptEta[2] = {"p_{t}","#eta"};
2714 TString order[4] = {"2nd order","4th order","6th order","8th order"};
2716 // c) Book profile to hold all flags for differential flow:
2717 TString diffFlowFlagsName = "fDiffFlowFlags";
2718 fDiffFlowFlags = new TProfile(diffFlowFlagsName.Data(),"Flags for Differential Flow",1,0,1);
2719 fDiffFlowFlags->SetTickLength(-0.01,"Y");
2720 fDiffFlowFlags->SetMarkerStyle(25);
2721 fDiffFlowFlags->SetLabelSize(0.05);
2722 fDiffFlowFlags->SetLabelOffset(0.02,"Y");
2723 fDiffFlowFlags->GetXaxis()->SetBinLabel(1,"...");
2724 fDiffFlowList->Add(fDiffFlowFlags);
2726 // d) Book all event-by-event quantities:
2727 // ... (to be improved - perhaps not needed)
2729 // e) Book all profiles:
2730 // Generating functions for differential flow:
2731 for(Int_t ri=0;ri<2;ri++)
2733 for(Int_t rp=0;rp<2;rp++)
2735 for(Int_t pe=0;pe<2;pe++)
2737 fDiffFlowGenFun[ri][rp][pe] = new TProfile3D(Form("fDiffFlowGenFun (%s, %s, %s)",reIm[ri].Data(),rpPoi[rp].Data(),ptEta[pe].Data()),
2738 Form("#LT%s[D[%s-bin][p][q]]#GT for %ss",reIm[ri].Data(),ptEta[pe].Data(),rpPoi[rp].Data()),
2739 nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe],pMax,0.,(Double_t)pMax,qMax,0.,(Double_t)qMax);
2740 fDiffFlowGenFun[ri][rp][pe]->SetXTitle(ptEta[pe].Data());
2741 fDiffFlowGenFun[ri][rp][pe]->SetYTitle("p");
2742 fDiffFlowGenFun[ri][rp][pe]->SetZTitle("q");
2743 fDiffFlowGenFun[ri][rp][pe]->SetTitleOffset(1.44,"X");
2744 fDiffFlowGenFun[ri][rp][pe]->SetTitleOffset(1.44,"Y");
2745 fDiffFlowProfiles->Add(fDiffFlowGenFun[ri][rp][pe]);
2746 // to be improved - alternative // nBinsPtEta[pe],(Double_t)(fPtMin/fPtBinWidth),(Double_t)(fPtMax/fPtBinWidth),pMax,0.,(Double_t)pMax,qMax,0.,(Double_t)qMax);
2750 // Number of particles in pt/eta bin for RPs/POIs:
2751 for(Int_t rp=0;rp<2;rp++)
2753 for(Int_t pe=0;pe<2;pe++)
2755 fNoOfParticlesInBin[rp][pe] = new TProfile(Form("fNoOfParticlesInBin (%s, %s)",rpPoi[rp].Data(),ptEta[pe].Data()),
2756 Form("Number of %ss per %s bin",rpPoi[rp].Data(),ptEta[pe].Data()),
2757 nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
2758 fNoOfParticlesInBin[rp][pe]->SetXTitle(ptEta[pe].Data());
2759 fDiffFlowProfiles->Add(fNoOfParticlesInBin[rp][pe]);
2762 // Differential cumulants per pt/eta bin for RPs/POIs:
2763 for(Int_t rp=0;rp<2;rp++)
2765 for(Int_t pe=0;pe<2;pe++)
2767 for(Int_t co=0;co<4;co++)
2769 fDiffFlowCumulants[rp][pe][co] = new TH1D(Form("fDiffFlowCumulants (%s, %s, %s)",rpPoi[rp].Data(),ptEta[pe].Data(),order[co].Data()),
2770 Form("Differential %s cumulant for %ss vs %s",order[co].Data(),rpPoi[rp].Data(),ptEta[pe].Data()),
2771 nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
2772 fDiffFlowCumulants[rp][pe][co]->SetXTitle(ptEta[pe].Data());
2773 fDiffFlowResults->Add(fDiffFlowCumulants[rp][pe][co]);
2777 // Differential flow per pt/eta bin for RPs/POIs:
2778 for(Int_t rp=0;rp<2;rp++)
2780 for(Int_t pe=0;pe<2;pe++)
2782 for(Int_t co=0;co<4;co++)
2784 fDiffFlow[rp][pe][co] = new TH1D(Form("fDiffFlow (%s, %s, %s)",rpPoi[rp].Data(),ptEta[pe].Data(),order[co].Data()),
2785 Form("Differential flow from %s cumulant for %ss vs %s",order[co].Data(),rpPoi[rp].Data(),ptEta[pe].Data()),
2786 nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
2787 fDiffFlow[rp][pe][co]->SetXTitle(ptEta[pe].Data());
2788 fDiffFlowResults->Add(fDiffFlow[rp][pe][co]);
2793 }// end of void AliFlowAnalysisWithCumulants::BookEverythingForDiffFlow()
2795 //================================================================================================================
2797 void AliFlowAnalysisWithCumulants::StoreReferenceFlowFlags()
2799 // Store all flags for reference flow in profile fReferenceFlowFlags.
2801 if(!fReferenceFlowFlags)
2804 cout<<"WARNING: !fReferenceFlowFlags is NULL in AFAWC::SRFF() !!!!"<<endl;
2809 // Particle weights used or not:
2810 fReferenceFlowFlags->Fill(0.5,(Double_t)fUsePhiWeights||fUsePtWeights||fUseEtaWeights);
2811 // Which event weight was used to weight generating function event-by-event:
2812 if(strcmp(fMultiplicityWeight->Data(),"unit"))
2814 fReferenceFlowFlags->Fill(1.5,0.); // 0 = "unit" (default)
2815 } else if(strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2817 fReferenceFlowFlags->Fill(1.5,1.); // 1 = "multiplicity"
2819 fReferenceFlowFlags->Fill(2.5,fCalculateVsMultiplicity); // evaluate vs M?
2821 } // end of void AliFlowAnalysisWithCumulants::StoreReferenceFlowFlags()
2823 //================================================================================================================
2825 void AliFlowAnalysisWithCumulants::StoreDiffFlowFlags()
2827 // Store all flags for differential flow in profile fDiffFlowFlags.
2832 cout<<"WARNING: !fDiffFlowFlags is NULL in AFAWC::SRFF() !!!!"<<endl;
2837 // fDiffFlags->Fill(0.5,(Double_t) ... );
2839 } // end of void AliFlowAnalysisWithCumulants::StoreDiffFlowFlags()
2841 //================================================================================================================
2843 void AliFlowAnalysisWithCumulants::BookAndNestAllLists()
2845 // Book and nest all list in base list fHistList.
2847 // a) Book and nest lists for reference flow;
2848 // b) Book and nest lists for differential flow;
2849 // c) Book and nest lists for tuning;
2850 // d) If used, nest list for particle weights.
2852 // a) Book and nest all lists for reference flow:
2853 fReferenceFlowList = new TList();
2854 fReferenceFlowList->SetName("Reference Flow");
2855 fReferenceFlowList->SetOwner(kTRUE);
2856 fHistList->Add(fReferenceFlowList);
2857 fReferenceFlowProfiles = new TList();
2858 fReferenceFlowProfiles->SetName("Profiles");
2859 fReferenceFlowProfiles->SetOwner(kTRUE);
2860 fReferenceFlowList->Add(fReferenceFlowProfiles);
2861 fReferenceFlowResults = new TList();
2862 fReferenceFlowResults->SetName("Results");
2863 fReferenceFlowResults->SetOwner(kTRUE);
2864 fReferenceFlowList->Add(fReferenceFlowResults);
2865 // b) Book and nest lists for differential flow:
2866 fDiffFlowList = new TList();
2867 fDiffFlowList->SetName("Differential Flow");
2868 fDiffFlowList->SetOwner(kTRUE);
2869 fHistList->Add(fDiffFlowList);
2870 fDiffFlowProfiles = new TList();
2871 fDiffFlowProfiles->SetName("Profiles");
2872 fDiffFlowProfiles->SetOwner(kTRUE);
2873 fDiffFlowList->Add(fDiffFlowProfiles);
2874 fDiffFlowResults = new TList();
2875 fDiffFlowResults->SetName("Results");
2876 fDiffFlowResults->SetOwner(kTRUE);
2877 fDiffFlowList->Add(fDiffFlowResults);
2878 // c) Book and nest lists for tuning:
2881 fTuningList = new TList();
2882 fTuningList->SetName("Tuning");
2883 fTuningList->SetOwner(kTRUE);
2884 fHistList->Add(fTuningList);
2885 fTuningProfiles = new TList();
2886 fTuningProfiles->SetName("Profiles");
2887 fTuningProfiles->SetOwner(kTRUE);
2888 fTuningList->Add(fTuningProfiles);
2889 fTuningResults = new TList();
2890 fTuningResults->SetName("Results");
2891 fTuningResults->SetOwner(kTRUE);
2892 fTuningList->Add(fTuningResults);
2895 // d) If used, nest list for particle weights.
2896 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
2898 // Remark: pointer to this list is coming from the macro, no need to "new" it.
2899 fWeightsList->SetName("Weights");
2900 fWeightsList->SetOwner(kTRUE);
2901 fHistList->Add(fWeightsList);
2904 } // end of void AliFlowAnalysisWithCumulants::BookAndNestAllLists()
2906 //================================================================================================================
2908 void AliFlowAnalysisWithCumulants::BookProfileHoldingSettings()
2910 // Book profile to hold all analysis settings.
2912 TString analysisSettingsName = "fAnalysisSettings";
2913 fAnalysisSettings = new TProfile(analysisSettingsName.Data(),"Settings for analysis with Generating Function Cumulants",11,0.,11.);
2914 fAnalysisSettings->GetXaxis()->SetLabelSize(0.035);
2915 fAnalysisSettings->GetXaxis()->SetBinLabel(1,"Harmonic");
2916 fAnalysisSettings->Fill(0.5,fHarmonic);
2917 fAnalysisSettings->GetXaxis()->SetBinLabel(2,"Multiple");
2918 fAnalysisSettings->Fill(1.5,fMultiple);
2919 fAnalysisSettings->GetXaxis()->SetBinLabel(3,"r_{0}");
2920 fAnalysisSettings->Fill(2.5,fR0);
2921 fAnalysisSettings->GetXaxis()->SetBinLabel(4,"Use w_{#phi}?");
2922 fAnalysisSettings->Fill(3.5,fUsePhiWeights);
2923 fAnalysisSettings->GetXaxis()->SetBinLabel(5,"Use w_{p_{t}}?");
2924 fAnalysisSettings->Fill(4.5,fUsePtWeights);
2925 fAnalysisSettings->GetXaxis()->SetBinLabel(6,"Use w_{#eta}?");
2926 fAnalysisSettings->Fill(5.5,fUsePhiWeights);
2927 fAnalysisSettings->GetXaxis()->SetBinLabel(7,"Tune parameters?");
2928 fAnalysisSettings->Fill(6.5,fTuneParameters);
2929 fAnalysisSettings->GetXaxis()->SetBinLabel(8,"Print RF results");
2930 fAnalysisSettings->Fill(7.5,fPrintFinalResults[0]);
2931 fAnalysisSettings->GetXaxis()->SetBinLabel(9,"Print RP results");
2932 fAnalysisSettings->Fill(8.5,fPrintFinalResults[1]);
2933 fAnalysisSettings->GetXaxis()->SetBinLabel(10,"Print POI results");
2934 fAnalysisSettings->Fill(9.5,fPrintFinalResults[2]);
2935 fAnalysisSettings->GetXaxis()->SetBinLabel(11,"Evaluate vs M?");
2936 fAnalysisSettings->Fill(10.5,fCalculateVsMultiplicity);
2937 fHistList->Add(fAnalysisSettings);
2939 } // end of void AliFlowAnalysisWithCumulants::BookProfileHoldingSettings()
2941 //================================================================================================================
2943 void AliFlowAnalysisWithCumulants::BookCommonHistograms()
2945 // Book common control histograms and common histograms for final results.
2947 // Common control histogram:
2948 TString commonHistsName = "AliFlowCommonHistGFC";
2949 fCommonHists = new AliFlowCommonHist(commonHistsName.Data());
2950 fHistList->Add(fCommonHists);
2951 // Common histograms for final results from 2nd order GFC:
2952 TString commonHistResults2ndOrderName = "AliFlowCommonHistResults2ndOrderGFC";
2953 fCommonHistsResults2nd = new AliFlowCommonHistResults(commonHistResults2ndOrderName.Data(),"",fHarmonic);
2954 fHistList->Add(fCommonHistsResults2nd);
2955 // Common histograms for final results from 4th order GFC:
2956 TString commonHistResults4thOrderName = "AliFlowCommonHistResults4thOrderGFC";
2957 fCommonHistsResults4th = new AliFlowCommonHistResults(commonHistResults4thOrderName.Data(),"",fHarmonic);
2958 fHistList->Add(fCommonHistsResults4th);
2959 // Common histograms for final results from 6th order GFC:
2960 TString commonHistResults6thOrderName = "AliFlowCommonHistResults6thOrderGFC";
2961 fCommonHistsResults6th = new AliFlowCommonHistResults(commonHistResults6thOrderName.Data(),"",fHarmonic);
2962 fHistList->Add(fCommonHistsResults6th);
2963 // Common histograms for final results from 8th order GFC:
2964 TString commonHistResults8thOrderName = "AliFlowCommonHistResults8thOrderGFC";
2965 fCommonHistsResults8th = new AliFlowCommonHistResults(commonHistResults8thOrderName.Data(),"",fHarmonic);
2966 fHistList->Add(fCommonHistsResults8th);
2968 } // end of void AliFlowAnalysisWithCumulants::BookCommonHistograms()
2970 //================================================================================================================
2972 void AliFlowAnalysisWithCumulants::CheckPointersUsedInMake()
2974 // Check pointers used in method Make().
2979 cout<<" WARNING (GFC): fCommonHists is NULL in CPUIM() !!!!"<<endl;
2983 if(fUsePhiWeights && !fPhiWeights)
2986 cout<<" WARNING (GFC): fPhiWeights is NULL in CPUIM() !!!!"<<endl;
2990 if(fUsePtWeights && !fPtWeights)
2993 cout<<" WARNING (GFC): fPtWeights is NULL in CPUIM() !!!!"<<endl;
2997 if(fUseEtaWeights && !fEtaWeights)
3000 cout<<" WARNING (GFC): fEtaWeights is NULL in CPUIM() !!!!"<<endl;
3004 if(!fAverageOfSquaredWeight)
3007 cout<<" WARNING (GFC): fAverageOfSquaredWeight is NULL in CPUIM() !!!!"<<endl;
3011 if(!fReferenceFlowGenFun)
3014 cout<<" WARNING (GFC): fReferenceFlowGenFun is NULL in CPUIM() !!!!"<<endl;
3018 if(!fQvectorComponents)
3021 cout<<" WARNING (GFC): fQvectorComponents is NULL in CPUIM() !!!!"<<endl;
3028 cout<<"WARNING (GFC): fGEBE is NULL in CPUIM() !!!!"<<endl;
3032 // Checking pointers for vs multiplicity calculation:
3033 if(fCalculateVsMultiplicity)
3035 if(!fReferenceFlowGenFunVsM)
3038 cout<<"WARNING (GFC): fReferenceFlowGenFunVsM is NULL in CPUIM() !!!!"<<endl;
3042 if(!fQvectorComponentsVsM)
3045 cout<<"WARNING (GFC): fQvectorComponentsVsM is NULL in CPUIM() !!!!"<<endl;
3049 if(!fAverageOfSquaredWeightVsM)
3052 cout<<"WARNING (GFC): fAverageOfSquaredWeightVsM is NULL in CPUIM() !!!!"<<endl;
3059 cout<<"WARNING (GFC): fAvMVsM is NULL in CPUIM() !!!!"<<endl;
3063 } // end of if(fCalculateVsMultiplicity)
3065 } // end of void AliFlowAnalysisWithCumulants::CheckPointersUsedInMake()
3067 //================================================================================================================
3069 void AliFlowAnalysisWithCumulants::CheckPointersUsedInFinish()
3071 // Check pointers used in method Finish().
3073 if(!fAnalysisSettings)
3076 cout<<" WARNING (GFC): fAnalysisSettings is NULL in CPUIF() !!!!"<<endl;
3080 if(!(fCommonHists && fCommonHists->GetHistMultRP()))
3083 cout<<" WARNING (GFC): (fCommonHists && fCommonHists->GetHistMultRP) is NULL in CPUIF() !!!!"<<endl;
3087 if(!fReferenceFlowGenFun)
3090 cout<<" WARNING (GFC): fReferenceFlowGenFun is NULL in CPUIF() !!!!"<<endl;
3094 if(!fReferenceFlowCumulants)
3097 cout<<" WARNING (GFC): fReferenceFlowCumulants is NULL in CPUIF() !!!!"<<endl;
3101 if(!fQvectorComponents)
3104 cout<<" WARNING (GFC): fQvectorComponents is NULL in CPUIF() !!!!"<<endl;
3108 if(!fAverageOfSquaredWeight)
3111 cout<<" WARNING (GFC): fAverageOfSquaredWeight is NULL in CPUIF() !!!!"<<endl;
3115 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
3118 cout<<" WARNING (GFC): fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && "<<endl;
3119 cout<<" fCommonHistsResults8th is NULL in CPUIF() !!!!"<<endl;
3126 cout<<" WARNING (GFC): fReferenceFlow is NULL in CPUIF() !!!!"<<endl;
3133 cout<<" WARNING (GFC): fChi is NULL in CPUIF() !!!!"<<endl;
3137 for(Int_t ri=0;ri<2;ri++)
3139 for(Int_t rp=0;rp<2;rp++)
3141 for(Int_t pe=0;pe<2;pe++)
3143 if(!fDiffFlowGenFun[ri][rp][pe])
3146 cout<<" WARNING (GFC): "<<Form("fDiffFlowGenFun[%d][%d][%d]",ri,rp,pe)<<" is NULL in CPUIF() !!!!"<<endl;
3153 for(Int_t rp=0;rp<2;rp++)
3155 for(Int_t pe=0;pe<2;pe++)
3157 for(Int_t co=0;co<4;co++)
3159 if(!fDiffFlowCumulants[rp][pe][co])
3162 cout<<" WARNING (GFC): "<<Form("fDiffFlowCumulants[%d][%d][%d]",rp,pe,co)<<" is NULL in CPUIF() !!!!"<<endl;
3166 if(!fDiffFlow[rp][pe][co])
3169 cout<<" WARNING (GFC): "<<Form("fDiffFlow[%d][%d][%d]",rp,pe,co)<<" is NULL in CPUIF() !!!!"<<endl;
3176 for(Int_t rp=0;rp<2;rp++)
3178 for(Int_t pe=0;pe<2;pe++)
3180 if(!fNoOfParticlesInBin[rp][pe])
3183 cout<<" WARNING (GFC): "<<Form("fNoOfParticlesInBin[%d][%d]",rp,pe)<<" is NULL in CPUIF() !!!!"<<endl;
3189 // Checking pointers for vs multiplicity calculation:
3190 if(fCalculateVsMultiplicity)
3192 if(!fReferenceFlowGenFunVsM)
3195 cout<<"WARNING (GFC): fReferenceFlowGenFunVsM is NULL in CPUIF() !!!!"<<endl;
3199 if(!fQvectorComponentsVsM)
3202 cout<<"WARNING (GFC): fQvectorComponentsVsM is NULL in CPUIF() !!!!"<<endl;
3206 if(!fAverageOfSquaredWeightVsM)
3209 cout<<"WARNING (GFC): fAverageOfSquaredWeightVsM is NULL in CPUIF() !!!!"<<endl;
3216 cout<<"WARNING (GFC): fAvMVsM is NULL in CPUIF() !!!!"<<endl;
3220 } // end of if(fCalculateVsMultiplicity)
3222 } // end of void AliFlowAnalysisWithCumulants::CheckPointersUsedInFinish()
3224 //================================================================================================================
3226 void AliFlowAnalysisWithCumulants::AccessSettings()
3228 // Access the settings for analysis with Generating Function Cumulants.
3230 fHarmonic = (Int_t)fAnalysisSettings->GetBinContent(1);
3231 fMultiple = (Int_t)fAnalysisSettings->GetBinContent(2);
3232 fR0 = (Double_t)fAnalysisSettings->GetBinContent(3);
3233 fUsePhiWeights = (Bool_t)fAnalysisSettings->GetBinContent(4);
3234 fUsePtWeights = (Bool_t)fAnalysisSettings->GetBinContent(5);
3235 fUseEtaWeights = (Bool_t)fAnalysisSettings->GetBinContent(6);
3236 fTuneParameters = (Bool_t)fAnalysisSettings->GetBinContent(7);
3237 fPrintFinalResults[0] = (Bool_t)fAnalysisSettings->GetBinContent(8);
3238 fPrintFinalResults[1] = (Bool_t)fAnalysisSettings->GetBinContent(9);
3239 fPrintFinalResults[2] = (Bool_t)fAnalysisSettings->GetBinContent(10);
3240 fCalculateVsMultiplicity = (Bool_t)fAnalysisSettings->GetBinContent(11);
3242 } // end of AliFlowAnalysisWithCumulants::AccessSettings()
3244 //================================================================================================================
3246 void AliFlowAnalysisWithCumulants::WriteHistograms(TString* outputFileName)
3248 // Store the final results in output .root file.
3250 TFile *output = new TFile(outputFileName->Data(),"RECREATE");
3251 //output->WriteObject(fHistList, "cobjGFC","SingleKey");
3252 fHistList->SetName("cobjGFC");
3253 fHistList->SetOwner(kTRUE);
3254 fHistList->Write(fHistList->GetName(), TObject::kSingleKey);
3257 } // end of void AliFlowAnalysisWithCumulants::WriteHistograms(TString* outputFileName)
3259 //================================================================================================================
3261 void AliFlowAnalysisWithCumulants::WriteHistograms(TString outputFileName)
3263 // Store the final results in output .root file.
3265 TFile *output = new TFile(outputFileName.Data(),"RECREATE");
3266 //output->WriteObject(fHistList, "cobjGFC","SingleKey");
3267 fHistList->SetName("cobjGFC");
3268 fHistList->SetOwner(kTRUE);
3269 fHistList->Write(fHistList->GetName(), TObject::kSingleKey);
3272 } // end of void AliFlowAnalysisWithCumulants::WriteHistograms(TString outputFileName)
3274 //================================================================================================================
3276 void AliFlowAnalysisWithCumulants::WriteHistograms(TDirectoryFile *outputFileName)
3278 // Store the final results in output .root file.
3280 fHistList->SetName("cobjGFC");
3281 fHistList->SetOwner(kTRUE);
3282 outputFileName->Add(fHistList);
3283 outputFileName->Write(outputFileName->GetName(), TObject::kSingleKey);
3285 } // end of void AliFlowAnalysisWithCumulants::WriteHistograms(TDirectoryFile *outputFileName)
3287 //================================================================================================================