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 fReferenceMultiplicityEBE(0.),
96 fReferenceFlowGenFun(NULL),
97 fQvectorComponents(NULL),
98 fAverageOfSquaredWeight(NULL),
99 fReferenceFlowGenFunVsM(NULL),
100 fQvectorComponentsVsM(NULL),
101 fAverageOfSquaredWeightVsM(NULL),
105 fReferenceFlowCumulants(NULL),
106 fReferenceFlow(NULL),
109 fDiffFlowProfiles(NULL),
110 fDiffFlowResults(NULL),
111 fDiffFlowFlags(NULL),
113 fTuningProfiles(NULL),
114 fTuningResults(NULL),
116 fTuneParameters(kFALSE),
121 // Base list to hold all output objects:
122 fHistList = new TList();
123 fHistListName = new TString("cobjGFC");
124 fHistList->SetName(fHistListName->Data());
125 fHistList->SetOwner(kTRUE);
127 // Multiplicity weight:
128 fMultiplicityWeight = new TString("unit");
130 // Initialize all arrays:
131 this->InitializeArrays();
133 } // end of AliFlowAnalysisWithCumulants::AliFlowAnalysisWithCumulants()
135 //================================================================================================================
137 AliFlowAnalysisWithCumulants::~AliFlowAnalysisWithCumulants()
143 } // end of AliFlowAnalysisWithCumulants::~AliFlowAnalysisWithCumulants()
145 //================================================================================================================
147 void AliFlowAnalysisWithCumulants::Init()
149 // Initialize and book all objects.
151 // a) Cross check if the user settings make sense before starting;
152 // b) Access all common constants;
153 // c) Book and fill weights histograms;
154 // d) Book and nest all lists in the base list fHistList;
155 // e) Book and fill profile holding analysis settings;
156 // f) Book common control and results histograms;
157 // g) Store flags for reference flow;
158 // h) Store flags for differential flow;
159 // i) Book all objects needed for tuning;
160 // j) Book all objects needed for calculation versus multiplicity.
162 //save old value and prevent histograms from being added to directory
163 //to avoid name clashes in case multiple analaysis objects are used
165 Bool_t oldHistAddStatus = TH1::AddDirectoryStatus();
166 TH1::AddDirectory(kFALSE);
168 this->CrossCheckSettings();
169 this->AccessConstants();
170 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights){this->BookAndFillWeightsHistograms();}
171 this->BookAndNestAllLists();
172 this->BookProfileHoldingSettings();
173 this->BookCommonHistograms();
174 this->BookEverythingForReferenceFlow();
175 this->BookEverythingForDiffFlow();
176 this->StoreReferenceFlowFlags();
177 this->StoreDiffFlowFlags();
178 if(fTuneParameters){this->BookEverythingForTuning();}
179 if(fCalculateVsMultiplicity){this->BookEverythingForCalculationVsMultiplicity();}
181 (fCommonHists->GetHarmonic())->Fill(0.5,fHarmonic); // to be improved (moved somewhere else?)
183 TH1::AddDirectory(oldHistAddStatus);
185 } // end of void AliFlowAnalysisWithCumulants::Init()
187 //================================================================================================================
189 void AliFlowAnalysisWithCumulants::Make(AliFlowEventSimple* anEvent)
191 // Running over data only in this method.
193 // a) Check all pointers used in this method;
194 // b) If tuning enabled, fill generating functions for different values of tuning parameters;
195 // c) For default values of tuning parameters (r0 = 2.2 and cutoff at 10th order):
196 // c1) Fill common control histograms;
197 // c2) Fill generating function for reference flow;
198 // c3) Fill profile holding average values of various Q-vector components;
199 // c4) Fill generating function for differential flow.
201 this->CheckPointersUsedInMake();
202 if(fTuneParameters) {this->FillGeneratingFunctionsForDifferentTuningParameters(anEvent);}
203 Int_t nRP = anEvent->GetEventNSelTracksRP(); // number of RPs (i.e. number of particles used to determine the reaction plane)
204 if(nRP<10) {return;} // generating function formalism make sense only for nRPs >= 10 for default settings
205 fReferenceMultiplicityEBE = anEvent->GetReferenceMultiplicity(); // reference multiplicity for current event
206 fCommonHists->FillControlHistograms(anEvent);
207 this->FillGeneratingFunctionForReferenceFlow(anEvent);
208 this->FillQvectorComponents(anEvent);
209 this->FillGeneratingFunctionForDiffFlow(anEvent);
211 } // end of void AliFlowAnalysisWithCumulants::Make()
213 //================================================================================================================
215 void AliFlowAnalysisWithCumulants::Finish()
217 // Calculate the final results.
219 // a) Check all pointers used in this method;
220 // b) Access settings for analysis with Generating Function Cumulants;
221 // c) From relevant common control histogram get average multiplicity of RPs and number of events;
222 // d) Calculate cumulants for reference flow;
223 // e) Calculate from isotropic cumulants reference flow;
224 // f) Calculate error for reference flow estimates;
225 // g) Store the final results for reference flow in common hist results;
226 // h) Print on the screen the final results for reference flow;
227 // i) Calculate cumulants for differential flow;
228 // j) Calculate differential flow for RPs/POIs vs pt/eta from cumulants;
229 // k) Calculate integrated flow of RPs and POIs;
230 // l) Print on the screen the final results for integrated flow of RPs and POIs;
231 // m) If tuning enabled, calculate results for different tuning parameters.
233 this->CheckPointersUsedInFinish();
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.
513 // Particle variables and weights:
514 Double_t dPhi = 0.; // azimuthal angle in the laboratory frame
515 Double_t dPt = 0.; // transverse momentum
516 Double_t dEta = 0.; // pseudorapidity
517 Double_t wPhi = 1.; // phi weight
518 Double_t wPt = 1.; // pt weight
519 Double_t wEta = 1.; // eta weight
521 Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = total number of primary tracks, i.e. nPrim = nRP + nPOI, where:
522 // nRP = # of particles used to determine the reaction plane;
523 // nPOI = # of particles of interest for a detailed flow analysis.
525 Int_t nRP = anEvent->GetEventNSelTracksRP(); // nRP = # of particles used to determine the reaction plane;
526 if(fCalculateVsMultiplicity){fAvMVsM->Fill(fReferenceMultiplicityEBE+0.5,nRP,1.);}
528 // Initializing the generating function G[p][q] for reference flow for current event:
529 Int_t pMax = fGEBE->GetNrows();
530 Int_t qMax = fGEBE->GetNcols();
531 for(Int_t p=0;p<pMax;p++)
533 for(Int_t q=0;q<qMax;q++)
539 // Cross-checking the number of RPs in current event:
540 Int_t crossCheckRP = 0;
542 // Looping over tracks:
543 for(Int_t i=0;i<nPrim;i++)
545 AliFlowTrackSimple *aftsTrack = anEvent->GetTrack(i);
546 if(aftsTrack && aftsTrack->InRPSelection())
549 // Access particle variables and weights:
550 dPhi = aftsTrack->Phi();
551 dPt = aftsTrack->Pt();
552 dEta = aftsTrack->Eta();
553 if(fUsePhiWeights && fnBinsPhi) // determine phi weight for this particle:
555 wPhi = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*fnBinsPhi/TMath::TwoPi())));
557 if(fUsePtWeights && fnBinsPt) // determine pt weight for this particle:
559 wPt = fPtWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/fPtBinWidth)));
561 if(fUseEtaWeights && fEtaBinWidth) // determine eta weight for this particle:
563 wEta = fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/fEtaBinWidth)));
565 // Fill the generating function:
566 for(Int_t p=0;p<pMax;p++)
568 for(Int_t q=0;q<qMax;q++)
570 (*fGEBE)(p,q) *= (1.+wPhi*wPt*wEta*(2.*fR0*sqrt(p+1.)/nRP)*cos(fHarmonic*dPhi-2.*q*TMath::Pi()/qMax));
573 // Fill the profile to calculate <<w^2>>:
574 fAverageOfSquaredWeight->Fill(0.5,pow(wPhi*wPt*wEta,2.),1.);
575 } // end of if(aftsTrack && aftsTrack->InRPSelection())
576 } // end of for(Int_t i=0;i<nPrim;i++)
578 // Cross check # of RPs:
579 if(anEvent && (crossCheckRP != anEvent->GetEventNSelTracksRP()))
582 cout<<"WARNING (GFC): crossCheckRP != nRP in GFC::Make(). Something is wrong with RP flagging !!!!"<<endl;
587 // Storing the value of G[p][q] in 2D profile in order to get eventually the avarage <G[p][q]>:
588 // Determine first the event weight for G[p][q]:
589 // (to be improved - this can be implemented much better, this shall be executed only once out of Make(), eventWeight should be a data member)
590 Double_t eventWeight = 0.;
591 if(!strcmp(fMultiplicityWeight->Data(),"unit"))
594 } else if(!strcmp(fMultiplicityWeight->Data(),"multiplicity"))
596 eventWeight = anEvent->GetEventNSelTracksRP();
598 // Store G[p][q] weighted appropriately:
599 for(Int_t p=0;p<pMax;p++)
601 for(Int_t q=0;q<qMax;q++)
603 fReferenceFlowGenFun->Fill((Double_t)p,(Double_t)q,(*fGEBE)(p,q),eventWeight);
604 if(fCalculateVsMultiplicity){fReferenceFlowGenFunVsM->Fill(fReferenceMultiplicityEBE+0.5,(Double_t)p,(Double_t)q,(*fGEBE)(p,q),eventWeight);}
608 } // end of void AliFlowAnalysisWithCumulants::FillGeneratingFunctionForReferenceFlow(AliFlowEventSimple* anEvent)
610 //================================================================================================================
612 void AliFlowAnalysisWithCumulants::FillQvectorComponents(AliFlowEventSimple* anEvent)
614 // Fill components of Q-vector for current event (needed for error calculation).
616 // Remark: Components are stored in profile fQvectorComponents whose binning is organized as follows:
626 Int_t n = 2; // to be removed
630 afv = anEvent->GetQ(1*n,fWeightsList,fUsePhiWeights,fUsePtWeights,fUseEtaWeights); // get the Q-vector for this event
631 fQvectorComponents->Fill(0.5,afv.X(),1.); // in the 1st bin fill Q_x
632 fQvectorComponents->Fill(1.5,afv.Y(),1.); // in the 2nd bin fill Q_y
633 fQvectorComponents->Fill(2.5,pow(afv.X(),2.),1.); // in the 3rd bin fill (Q_x)^2
634 fQvectorComponents->Fill(3.5,pow(afv.Y(),2.),1.); // in the 4th bin fill (Q_y)^2
637 } // end of void AliFlowAnalysisWithCumulants::FillQvectorComponents(AliFlowEventSimple* anEvent)
639 //================================================================================================================
641 void AliFlowAnalysisWithCumulants::FillGeneratingFunctionForDiffFlow(AliFlowEventSimple* anEvent)
643 // Fill generating function for differential flow for the current event.
645 // Remark 0: Generating function D[b][p][q] is a complex number => real and imaginary part are calculated separately
646 // (b denotes pt or eta bin);
647 // Remark 1: Note that bellow G[p][q] is needed, the value of generating function for reference flow for the CURRENT event.
648 // This values is obtained in method FillGeneratingFunctionForReferenceFlow() as TMatrixD fGEBE;
649 // 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
650 // automatically get <Re(D[b][p][q])> and <Im(D[b][p][q])> at the end of the day.
652 // Particle variables and weights:
653 Double_t dPhi = 0.; // azimuthal angle in the laboratory frame
654 Double_t dPt = 0.; // transverse momentum
655 Double_t dEta = 0.; // pseudorapidity
656 Double_t wPhi = 1.; // phi weight
657 Double_t wPt = 1.; // pt weight
658 Double_t wEta = 1.; // eta weight
661 Int_t pMax = fGEBE->GetNrows();
662 Int_t qMax = fGEBE->GetNcols();
664 Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = total number of primary tracks, i.e. nPrim = nRP + nPOI, where:
665 // nRP = # of particles used to determine the reaction plane;
666 // nPOI = # of particles of interest for a detailed flow analysis.
668 Int_t nRP = anEvent->GetEventNSelTracksRP(); // nRP = # of particles used to determine the reaction plane
670 // Start the second loop over event in order to evaluate the generating function D[b][p][q] for differential flow:
671 for(Int_t i=0;i<nPrim;i++)
673 AliFlowTrackSimple *aftsTrack = anEvent->GetTrack(i);
676 if(!(aftsTrack->InRPSelection() || aftsTrack->InPOISelection())) continue;
677 // Differential flow of POIs:
678 if(aftsTrack->InPOISelection())
680 // Get azimuthal angle, momentum and pseudorapidity of a particle:
681 dPhi = aftsTrack->Phi();
682 dPt = aftsTrack->Pt();
683 dEta = aftsTrack->Eta();
684 Double_t ptEta[2] = {dPt,dEta};
686 // Count number of POIs in pt/eta bin:
687 for(Int_t pe=0;pe<2;pe++)
689 fNoOfParticlesInBin[1][pe]->Fill(ptEta[pe],ptEta[pe],1.);
692 if(!(aftsTrack->InRPSelection())) // particle was flagged only as POI
694 // Fill generating function:
695 for(Int_t p=0;p<pMax;p++)
697 for(Int_t q=0;q<qMax;q++)
699 for(Int_t ri=0;ri<2;ri++)
701 for(Int_t pe=0;pe<2;pe++)
703 if(ri==0) // Real part (to be improved - this can be implemented better)
705 fDiffFlowGenFun[ri][1][pe]->Fill(ptEta[pe],(Double_t)p,(Double_t)q, // to be improved - hardwired weight 1. in the line bellow
706 (*fGEBE)(p,q)*cos(fMultiple*fHarmonic*dPhi),1.);
708 else if(ri==1) // Imaginary part (to be improved - this can be implemented better)
710 fDiffFlowGenFun[ri][1][pe]->Fill(ptEta[pe],(Double_t)p,(Double_t)q, // to be improved - hardwired weight 1. in the line bellow
711 (*fGEBE)(p,q)*sin(fMultiple*fHarmonic*dPhi),1.);
713 } // end of for(Int_t pe=0;pe<2;pe++)
714 } // end of for(Int_t ri=0;ri<2;ri++)
715 } // end of for(Int_t q=0;q<qMax;q++)
716 } // end of for(Int_t p=0;p<pMax;p++)
717 } // end of if(!(aftsTrack->InRPSelection())) // particle was flagged only as POI
718 else if(aftsTrack->InRPSelection()) // particle was flagged both as RP and POI
720 // If particle weights were used, get them:
721 if(fUsePhiWeights && fnBinsPhi) // determine phi weight for this particle:
723 wPhi = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*fnBinsPhi/TMath::TwoPi())));
725 if(fUsePtWeights && fnBinsPt) // determine pt weight for this particle:
727 wPt = fPtWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/fPtBinWidth)));
729 if(fUseEtaWeights && fEtaBinWidth) // determine eta weight for this particle:
731 wEta = fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/fEtaBinWidth)));
733 // Fill generating function:
734 for(Int_t p=0;p<pMax;p++)
736 for(Int_t q=0;q<qMax;q++)
738 for(Int_t ri=0;ri<2;ri++)
740 for(Int_t pe=0;pe<2;pe++)
742 if(ri==0) // Real part (to be improved - this can be implemented better)
744 fDiffFlowGenFun[ri][1][pe]->Fill(ptEta[pe],(Double_t)p,(Double_t)q, // to be improved - hardwired weight 1. in the line bellow
745 (*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.);
747 else if(ri==1) // Imaginary part (to be improved - this can be implemented better)
749 fDiffFlowGenFun[ri][1][pe]->Fill(ptEta[pe],(Double_t)p,(Double_t)q, // to be improved - hardwired weight 1. in the line bellow
750 (*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.);
752 } // end of for(Int_t pe=0;pe<2;pe++)
753 } // end of for(Int_t ri=0;ri<2;ri++)
754 } // end of for(Int_t q=0;q<qMax;q++)
755 } // end of for(Int_t p=0;p<pMax;p++)
756 } // end of else if (aftsTrack->InRPSelection()) // particle was flagged both as RP and POI
757 } // end of if(aftsTrack->InPOISelection())
758 // Differential flow of RPs:
759 if(aftsTrack->InRPSelection())
761 // Get azimuthal angle, momentum and pseudorapidity of a particle:
762 dPhi = aftsTrack->Phi();
763 dPt = aftsTrack->Pt();
764 dEta = aftsTrack->Eta();
765 Double_t ptEta[2] = {dPt,dEta};
767 // Count number of RPs in pt/eta bin:
768 for(Int_t pe=0;pe<2;pe++)
770 fNoOfParticlesInBin[0][pe]->Fill(ptEta[pe],ptEta[pe],1.);
773 // If particle weights were used, get them:
774 if(fUsePhiWeights && fnBinsPhi) // determine phi weight for this particle:
776 wPhi = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*fnBinsPhi/TMath::TwoPi())));
778 if(fUsePtWeights && fnBinsPt) // determine pt weight for this particle:
780 wPt = fPtWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/fPtBinWidth)));
782 if(fUseEtaWeights && fEtaBinWidth) // determine eta weight for this particle:
784 wEta = fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/fEtaBinWidth)));
786 // Fill generating function:
787 for(Int_t p=0;p<pMax;p++)
789 for(Int_t q=0;q<qMax;q++)
791 for(Int_t ri=0;ri<2;ri++)
793 for(Int_t pe=0;pe<2;pe++)
795 if(ri==0) // Real part (to be improved - this can be implemented better)
797 fDiffFlowGenFun[ri][0][pe]->Fill(ptEta[pe],(Double_t)p,(Double_t)q, // to be improved - hardwired weight 1. in the line bellow
798 (*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.);
800 else if(ri==1) // Imaginary part (to be improved - this can be implemented better)
802 fDiffFlowGenFun[ri][0][pe]->Fill(ptEta[pe],(Double_t)p,(Double_t)q, // to be improved - hardwired weight 1. in the line bellow
803 (*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.);
805 } // end of for(Int_t pe=0;pe<2;pe++)
806 } // end of for(Int_t ri=0;ri<2;ri++)
807 } // end of for(Int_t q=0;q<qMax;q++)
808 } // end of for(Int_t p=0;p<pMax;p++)
809 } // end of if(aftsTrack->InRPSelection())
810 } // end of if(aftsTrack)
811 } // end of for(Int_t i=0;i<nPrim;i++)
813 } // end of void AliFlowAnalysisWithCumulants::FillGeneratingFunctionForDiffFlow(AliFlowEventSimple* anEvent)
815 //================================================================================================================
817 void AliFlowAnalysisWithCumulants::GetOutputHistograms(TList *outputListHistos)
819 // Get pointers to all objects saved in the output file.
823 this->SetHistList(outputListHistos);
827 cout<<" WARNING (GFC): fHistList is NULL in AFAWGFC::GOH() !!!!"<<endl;
831 this->GetPointersForBaseHistograms();
832 this->AccessSettings();
833 this->GetPointersForCommonControlHistograms();
834 this->GetPointersForCommonResultsHistograms();
835 this->GetPointersForReferenceFlowObjects();
836 this->GetPointersForDiffFlowObjects();
837 if(fTuneParameters){this->GetPointersForTuningObjects();}
841 cout<<" WARNING (GFC): outputListHistos is NULL in AFAWGFC::GOH() !!!!"<<endl;
846 } // end of void AliFlowAnalysisWithCumulants::GetOutputHistograms(TList *outputListHistos)
848 //================================================================================================================
850 void AliFlowAnalysisWithCumulants::GetPointersForBaseHistograms()
852 // Get pointers to base histograms.
854 TString analysisSettingsName = "fAnalysisSettings";
855 TProfile *analysisSettings = dynamic_cast<TProfile*>(fHistList->FindObject(analysisSettingsName.Data()));
858 this->SetAnalysisSettings(analysisSettings);
862 cout<<" WARNING (GFC): analysisSettings is NULL in AFAWGFC::GPFBH() !!!!"<<endl;
867 } // end of void AliFlowAnalysisWithCumulants::GetPointersForBaseHistograms()
869 //================================================================================================================
871 void AliFlowAnalysisWithCumulants::GetPointersForCommonControlHistograms()
873 // Get pointers for common control histograms.
875 TString commonHistsName = "AliFlowCommonHistGFC";
876 AliFlowCommonHist *commonHist = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHistsName.Data()));
879 this->SetCommonHists(commonHist);
883 cout<<" WARNING (GFC): commonHist is NULL in AFAWGFC::GPFCH() !!!!"<<endl;
888 } // end of void AliFlowAnalysisWithCumulants::GetPointersForCommonControlHistograms()
890 //================================================================================================================
892 void AliFlowAnalysisWithCumulants::GetPointersForCommonResultsHistograms()
894 // Get pointers for common results histograms.
896 TString commonHistResults2ndOrderName = "AliFlowCommonHistResults2ndOrderGFC";
897 AliFlowCommonHistResults *commonHistRes2nd = dynamic_cast<AliFlowCommonHistResults*>
898 (fHistList->FindObject(commonHistResults2ndOrderName.Data()));
901 this->SetCommonHistsResults2nd(commonHistRes2nd);
905 cout<<" WARNING (GFC): commonHistRes2nd is NULL in AFAWGFC::GPFCRH() !!!!"<<endl;
909 TString commonHistResults4thOrderName = "AliFlowCommonHistResults4thOrderGFC";
910 AliFlowCommonHistResults *commonHistRes4th = dynamic_cast<AliFlowCommonHistResults*>
911 (fHistList->FindObject(commonHistResults4thOrderName.Data()));
914 this->SetCommonHistsResults4th(commonHistRes4th);
918 cout<<" WARNING (GFC): commonHistRes4th is NULL in AFAWGFC::GPFCRH() !!!!"<<endl;
922 TString commonHistResults6thOrderName = "AliFlowCommonHistResults6thOrderGFC";
923 AliFlowCommonHistResults *commonHistRes6th = dynamic_cast<AliFlowCommonHistResults*>
924 (fHistList->FindObject(commonHistResults6thOrderName.Data()));
927 this->SetCommonHistsResults6th(commonHistRes6th);
931 cout<<" WARNING (GFC): commonHistRes6th is NULL in AFAWGFC::GPFCRH() !!!!"<<endl;
935 TString commonHistResults8thOrderName = "AliFlowCommonHistResults8thOrderGFC";
936 AliFlowCommonHistResults *commonHistRes8th = dynamic_cast<AliFlowCommonHistResults*>
937 (fHistList->FindObject(commonHistResults8thOrderName.Data()));
940 this->SetCommonHistsResults8th(commonHistRes8th);
944 cout<<" WARNING (GFC): commonHistRes8th is NULL in AFAWGFC::GPFCRH() !!!!"<<endl;
949 } // end of void AliFlowAnalysisWithCumulants::GetPointersForCommonResultsHistograms()
951 //================================================================================================================
953 void AliFlowAnalysisWithCumulants::GetPointersForTuningObjects()
955 // Get pointers to all objects used for tuning.
957 // a) Get pointers to all lists relevant for tuning;
958 // b) Get pointer to profile holding flags for tuning;
959 // c) Get pointers to all objects in the list fTuningProfiles;
960 // d) Get pointers to all objects in the list fTuningResults.
962 // a) Get pointers to all lists relevant for tuning:
963 TList *tuningList = dynamic_cast<TList*>(fHistList->FindObject("Tuning"));
967 cout<<"WARNING (GFC): uningList is NULL in AFAWGFC::GPFTO() !!!!"<<endl;
971 TList *tuningProfiles = dynamic_cast<TList*>(tuningList->FindObject("Profiles"));
975 cout<<"WARNING (GFC): tuningProfiles is NULL in AFAWGFC::GPFTO() !!!!"<<endl;
979 TList *tuningResults = dynamic_cast<TList*>(tuningList->FindObject("Results"));
983 cout<<"WARNING (GFC): tuningResults is NULL in AFAWGFC::GPFTO() !!!!"<<endl;
988 // b) Get pointer to profile holding flags for tuning:
989 TString tuningFlagsName = "fTuningFlags";
990 TProfile *tuningFlags = dynamic_cast<TProfile*>(tuningList->FindObject(tuningFlagsName.Data()));
993 this->SetTuningFlags(tuningFlags);
997 cout<<"WARNING (GFC): tuningFlags is NULL in AFAWGFC::GPFTO() !!!!"<<endl;
1002 // c) Get pointers to all objects in the list fTuningProfiles:
1003 // Generating function for different tuning parameters:
1004 TProfile2D *tuningGenFun[10][5] = {{NULL}};
1005 for(Int_t r=0;r<10;r++)
1007 for(Int_t pq=0;pq<5;pq++)
1009 tuningGenFun[r][pq] = dynamic_cast<TProfile2D*>(tuningProfiles->FindObject(Form("fTuningGenFun (r_{0,%i}, pq set %i)",r,pq)));
1010 if(tuningGenFun[r][pq])
1012 this->SetTuningGenFun(tuningGenFun[r][pq],r,pq);
1016 cout<<"WARNING (GFC): "<<Form("tuningGenFun[%i][%i]",r,pq)<<" is NULL in AFAWGFC::GPFTO() !!!!"<<endl;
1020 } // end of for(Int_t pq=0;pq<5;pq++)
1021 } // end of for(Int_t r=0;r<10;r++)
1022 // Average multiplicities for events with nRPs >= cuttof
1023 TProfile *tuningAvM = dynamic_cast<TProfile*>(tuningProfiles->FindObject("fTuningAvM"));
1026 this->SetTuningAvM(tuningAvM);
1030 cout<<"WARNING (GFC): tuningAvM is NULL in AFAWGFC::GPFTO() !!!!"<<endl;
1035 // d) Get pointers to all objects in the list fTuningResults.
1036 // Cumulants for reference flow for 10 different r0s and 5 different sets of (pmax,qmax):
1037 TH1D *tuningCumulants[10][5] = {{NULL}};
1038 for(Int_t r=0;r<10;r++)
1040 for(Int_t pq=0;pq<5;pq++)
1042 tuningCumulants[r][pq] = dynamic_cast<TH1D*>(tuningResults->FindObject(Form("fTuningCumulants (r_{0,%i}, pq set %i)",r,pq)));
1043 if(tuningCumulants[r][pq])
1045 this->SetTuningCumulants(tuningCumulants[r][pq],r,pq);
1049 cout<<"WARNING (GFC): "<<Form("tuningCumulants[%i][%i]",r,pq)<<" is NULL in AFAWGFC::GPFTO() !!!!"<<endl;
1053 } // end of for(Int_t pq=0;pq<5;pq++)
1054 } // end of for(Int_t r=0;r<10;r++)
1055 // Reference flow for 10 different r0s and 5 different sets of (pmax,qmax):
1056 TH1D *tuningFlow[10][5] = {{NULL}};
1057 for(Int_t r=0;r<10;r++)
1059 for(Int_t pq=0;pq<5;pq++)
1061 tuningFlow[r][pq] = dynamic_cast<TH1D*>(tuningResults->FindObject(Form("fTuningFlow (r_{0,%i}, pq set %i)",r,pq)));
1062 if(tuningFlow[r][pq])
1064 this->SetTuningFlow(tuningFlow[r][pq],r,pq);
1068 cout<<"WARNING (GFC): "<<Form("tuningFlow[%i][%i]",r,pq)<<" is NULL in AFAWGFC::GPFTO() !!!!"<<endl;
1072 } // end of for(Int_t pq=0;pq<5;pq++)
1073 } // end of for(Int_t r=0;r<10;r++)
1075 } // end of void AliFlowAnalysisWithCumulants::GetPointersForTuningObjects()
1077 //================================================================================================================
1079 void AliFlowAnalysisWithCumulants::GetPointersForReferenceFlowObjects()
1081 // Get pointers for all objects relevant for calculation of reference flow.
1083 // a) Get pointers to all lists relevant for reference flow;
1084 // b) Get pointer to profile holding flags;
1085 // c) Get pointers to all objects in the list fReferenceFlowProfiles;
1086 // d) Get pointers to all objects in the list fReferenceFlowResults;
1087 // e) Get pointers for all objects relevant for calculation of reference flow versus multiplicity.
1089 // a) Get pointers to all lists relevant for reference flow:
1090 TList *referenceFlowList = dynamic_cast<TList*>(fHistList->FindObject("Reference Flow"));
1091 if(!referenceFlowList)
1094 cout<<"WARNING (GFC): referenceFlowList is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1098 TList *referenceFlowProfiles = dynamic_cast<TList*>(referenceFlowList->FindObject("Profiles"));
1099 if(!referenceFlowProfiles)
1102 cout<<"WARNING (GFC): referenceFlowProfiles is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1106 TList *referenceFlowResults = dynamic_cast<TList*>(referenceFlowList->FindObject("Results"));
1107 if(!referenceFlowResults)
1110 cout<<"WARNING (GFC): referenceFlowResults is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1115 // b) Get pointer to profile holding flags:
1116 TString referenceFlowFlagsName = "fReferenceFlowFlags";
1117 TProfile *referenceFlowFlags = dynamic_cast<TProfile*>(referenceFlowList->FindObject(referenceFlowFlagsName.Data()));
1118 if(referenceFlowFlags)
1120 this->SetReferenceFlowFlags(referenceFlowFlags);
1124 cout<<"WARNING (GFC): referenceFlowFlags is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1129 // c) Get pointers to all objects in the list fReferenceFlowProfiles:
1130 TString referenceFlowGenFunName = "fReferenceFlowGenFun";
1131 TProfile2D *referenceFlowGenFun = dynamic_cast<TProfile2D*>(referenceFlowProfiles->FindObject(referenceFlowGenFunName.Data()));
1132 if(referenceFlowGenFun)
1134 this->SetReferenceFlowGenFun(referenceFlowGenFun);
1138 cout<<"WARNING (GFC): referenceFlowGenFun is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1142 // Averages of various Q-vector components:
1143 TString qvectorComponentsName = "fQvectorComponents";
1144 TProfile *qvectorComponents = dynamic_cast<TProfile*>(referenceFlowProfiles->FindObject(qvectorComponentsName.Data()));
1145 if(qvectorComponents)
1147 this->SetQvectorComponents(qvectorComponents);
1151 cout<<"WARNING (GFC): qvectorComponents is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1155 // <<w^2>>, where w = wPhi*wPt*wEta:
1156 TString averageOfSquaredWeightName = "fAverageOfSquaredWeight";
1157 TProfile *averageOfSquaredWeight = dynamic_cast<TProfile*>(referenceFlowProfiles->FindObject(averageOfSquaredWeightName.Data()));
1158 if(averageOfSquaredWeight)
1160 this->SetAverageOfSquaredWeight(averageOfSquaredWeight);
1164 cout<<"WARNING (GFC): averageOfSquaredWeight is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1169 // d) Get pointers to all objects in the list fReferenceFlowResults:
1170 // Final results for isotropic cumulants for reference flow:
1171 TString referenceFlowCumulantsName = "fReferenceFlowCumulants";
1172 TH1D *referenceFlowCumulants = dynamic_cast<TH1D*>(referenceFlowResults->FindObject(referenceFlowCumulantsName.Data()));
1173 if(referenceFlowCumulants)
1175 this->SetReferenceFlowCumulants(referenceFlowCumulants);
1179 cout<<"WARNING (GFC): referenceFlowCumulants is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1183 // Final results for reference flow:
1184 TString referenceFlowName = "fReferenceFlow";
1185 TH1D *referenceFlow = dynamic_cast<TH1D*>(referenceFlowResults->FindObject(referenceFlowName.Data()));
1188 this->SetReferenceFlow(referenceFlow);
1192 cout<<"WARNING (GFC): referenceFlow is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1196 // Final results for resolution:
1197 TString chiName = "fChi";
1198 TH1D *chi = dynamic_cast<TH1D*>(referenceFlowResults->FindObject(chiName.Data()));
1205 cout<<"WARNING (GFC): chi is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1210 // e) Get pointers for all objects relevant for calculation of reference flow versus multiplicity:
1211 if(!fCalculateVsMultiplicity) {return;}
1212 // All-event average of the generating function used to calculate reference flow vs multiplicity:
1213 TString referenceFlowGenFunVsMName = "fReferenceFlowGenFunVsM";
1214 TProfile3D *referenceFlowGenFunVsM = dynamic_cast<TProfile3D*>(referenceFlowProfiles->FindObject(referenceFlowGenFunVsMName.Data()));
1215 if(referenceFlowGenFunVsM)
1217 this->SetReferenceFlowGenFunVsM(referenceFlowGenFunVsM);
1221 cout<<"WARNING (GFC): referenceFlowGenFunVsM is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1225 // Averages of various Q-vector components versus multiplicity:
1226 TString qvectorComponentsVsMName = "fQvectorComponentsVsM";
1227 TProfile2D *qvectorComponentsVsM = dynamic_cast<TProfile2D*>(referenceFlowProfiles->FindObject(qvectorComponentsVsMName.Data()));
1228 if(qvectorComponentsVsM)
1230 this->SetQvectorComponentsVsM(qvectorComponentsVsM);
1234 cout<<"WARNING (GFC): qvectorComponentsVsM is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1238 // <<w^2>>, where w = wPhi*wPt*wEta versus multiplicity:
1239 TString averageOfSquaredWeightVsMName = "fAverageOfSquaredWeightVsM";
1240 TProfile2D *averageOfSquaredWeightVsM = dynamic_cast<TProfile2D*>(referenceFlowProfiles->FindObject(averageOfSquaredWeightVsMName.Data()));
1241 if(averageOfSquaredWeightVsM)
1243 this->SetAverageOfSquaredWeightVsM(averageOfSquaredWeightVsM);
1247 cout<<"WARNING (GFC): averageOfSquaredWeightVsM is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1251 // Final results for reference GF-cumulants versus multiplicity:
1252 TString cumulantFlag[4] = {"GFC{2}","GFC{4}","GFC{6}","GFC{8}"};
1253 TString referenceFlowCumulantsVsMName = "fReferenceFlowCumulantsVsM";
1254 TH1D *referenceFlowCumulantsVsM[4] = {NULL};
1255 for(Int_t co=0;co<4;co++) // cumulant order
1257 referenceFlowCumulantsVsM[co] = dynamic_cast<TH1D*>(referenceFlowResults->FindObject(Form("%s, %s",referenceFlowCumulantsVsMName.Data(),cumulantFlag[co].Data())));
1258 if(referenceFlowCumulantsVsM[co])
1260 this->SetReferenceFlowCumulantsVsM(referenceFlowCumulantsVsM[co],co);
1264 cout<<"WARNING (GFC): "<<Form("referenceFlowCumulantsVsM[%i]",co)<<" is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1268 } // end of for(Int_t co=0;co<4;co++) // cumulant order
1269 // <M> vs multiplicity bin:
1270 TProfile *avMVsM = dynamic_cast<TProfile*>(referenceFlowProfiles->FindObject("fAvMVsM"));
1273 this->SetAvMVsM(avMVsM);
1277 cout<<"WARNING (GFC): avMVsM is NULL in AFAWGFC::GPFRFO() !!!!"<<endl;
1282 } // end of void AliFlowAnalysisWithCumulants::GetPointersForReferenceFlowObjects()
1284 //================================================================================================================
1286 void AliFlowAnalysisWithCumulants::GetPointersForDiffFlowObjects()
1288 // Get pointers to all objects relevant for differential flow.
1290 // a) Define flags locally (to be improved: should I promote flags to data members?);
1291 // b) Get pointer to base list for differential flow fDiffFlowList and nested lists fDiffFlowListProfiles and fDiffFlowListResults;
1292 // c) Get pointer to profile fDiffFlowFlags holding all flags for differential flow;
1293 // d) Get pointers to all profiles in the list fDiffFlowProfiles;
1294 // e) Get pointers to all profiles in the list fDiffFlowResults.
1296 // a) Define flags locally (to be improved: should I promote flags to data members?):
1297 TString reIm[2] = {"Re","Im"};
1298 TString rpPoi[2] = {"RP","POI"};
1299 TString ptEta[2] = {"p_{t}","#eta"};
1300 TString order[4] = {"2nd order","4th order","6th order","8th order"};
1301 //TString differentialFlowIndex[4] = {"v'{2}","v'{4}","v'{6}","v'{8}"};
1303 // b) Get pointer to base list for differential flow fDiffFlowList and nested lists fDiffFlowListProfiles and fDiffFlowListResults:
1304 TList *diffFlowList = dynamic_cast<TList*>(fHistList->FindObject("Differential Flow")); // to be improved (hardwired name)
1308 cout<<"WARNING: diffFlowList is NULL in AFAWC::GPFDFO() !!!!"<<endl;
1312 TList *diffFlowProfiles = dynamic_cast<TList*>(diffFlowList->FindObject("Profiles")); // to be improved (hardwired name)
1313 if(!diffFlowProfiles)
1316 cout<<"WARNING: diffFlowProfiles is NULL in AFAWC::GPFDFO() !!!!"<<endl;
1320 TList *diffFlowResults = dynamic_cast<TList*>(diffFlowList->FindObject("Results")); // to be improved (hardwired name)
1321 if(!diffFlowResults)
1324 cout<<"WARNING: diffFlowResults is NULL in AFAWC::GPFDFO() !!!!"<<endl;
1329 // c) Get pointer to profile holding flags:
1330 TString diffFlowFlagsName = "fDiffFlowFlags";
1331 TProfile *diffFlowFlags = dynamic_cast<TProfile*>(diffFlowList->FindObject(diffFlowFlagsName.Data()));
1334 this->SetDiffFlowFlags(diffFlowFlags);
1338 cout<<"WARNING (GFC): diffFlowFlags is NULL in AFAWGFC::GPFDFO() !!!!"<<endl;
1343 // d) Get pointers to all profiles in the list fDiffFlowListProfiles:
1344 // Generating functions for differential flow:
1345 TProfile3D *diffFlowGenFun[2][2][2] = {{{NULL}}};
1346 for(Int_t ri=0;ri<2;ri++)
1348 for(Int_t rp=0;rp<2;rp++)
1350 for(Int_t pe=0;pe<2;pe++)
1352 diffFlowGenFun[ri][rp][pe] = dynamic_cast<TProfile3D*> // to be improved - harwired name fDiffFlowGenFun in the line bellow
1353 (diffFlowProfiles->FindObject(Form("fDiffFlowGenFun (%s, %s, %s)",reIm[ri].Data(),rpPoi[rp].Data(),ptEta[pe].Data())));
1354 if(diffFlowGenFun[ri][rp][pe])
1356 this->SetDiffFlowGenFun(diffFlowGenFun[ri][rp][pe],ri,rp,pe);
1360 cout<<"WARNING (GFC): "<<Form("diffFlowGenFun[%d][%d][%d]",ri,rp,pe)<<" is NULL in AFAWGFC::GPFDFO() !!!!"<<endl;
1367 // Number of particles in pt/eta bin for RPs/POIs:
1368 TProfile *noOfParticlesInBin[2][2] = {{NULL}};
1369 for(Int_t rp=0;rp<2;rp++)
1371 for(Int_t pe=0;pe<2;pe++)
1373 noOfParticlesInBin[rp][pe] = dynamic_cast<TProfile*> // to be improved - harwired name fNoOfParticlesInBin in the line bellow
1374 (diffFlowProfiles->FindObject(Form("fNoOfParticlesInBin (%s, %s)",rpPoi[rp].Data(),ptEta[pe].Data())));
1375 if(noOfParticlesInBin[rp][pe])
1377 this->SetNoOfParticlesInBin(noOfParticlesInBin[rp][pe],rp,pe);
1381 cout<<"WARNING (GFC): "<<Form("noOfParticlesInBin[%d][%d]",rp,pe)<<" is NULL in AFAWGFC::GPFDFO() !!!!"<<endl;
1387 // Differential cumulants per pt/eta bin for RPs/POIs:
1388 TH1D *diffFlowCumulants[2][2][4] = {{{NULL}}};
1389 for(Int_t rp=0;rp<2;rp++)
1391 for(Int_t pe=0;pe<2;pe++)
1393 for(Int_t co=0;co<4;co++)
1395 diffFlowCumulants[rp][pe][co] = dynamic_cast<TH1D*> // to be improved - hardwired name fDiffFlowCumulants in the line bellow
1396 (diffFlowResults->FindObject(Form("fDiffFlowCumulants (%s, %s, %s)",rpPoi[rp].Data(),ptEta[pe].Data(),order[co].Data())));
1397 if(diffFlowCumulants[rp][pe][co])
1399 this->SetDiffFlowCumulants(diffFlowCumulants[rp][pe][co],rp,pe,co);
1403 cout<<"WARNING (GFC): "<<Form("diffFlowCumulants[%d][%d][%d]",rp,pe,co)<<" is NULL in AFAWGFC::GPFDFO() !!!!"<<endl;
1410 // Differential flow per pt/eta bin for RPs/POIs:
1411 TH1D *diffFlow[2][2][4] = {{{NULL}}};
1412 for(Int_t rp=0;rp<2;rp++)
1414 for(Int_t pe=0;pe<2;pe++)
1416 for(Int_t co=0;co<4;co++)
1418 diffFlow[rp][pe][co] = dynamic_cast<TH1D*> // to be improved - hardwired name fDiffFlow in the line bellow
1419 (diffFlowResults->FindObject(Form("fDiffFlow (%s, %s, %s)",rpPoi[rp].Data(),ptEta[pe].Data(),order[co].Data())));
1420 if(diffFlow[rp][pe][co])
1422 this->SetDiffFlow(diffFlow[rp][pe][co],rp,pe,co);
1426 cout<<"WARNING (GFC): "<<Form("diffFlow[%d][%d][%d]",rp,pe,co)<<" is NULL in AFAWGFC::GPFDFO() !!!!"<<endl;
1434 } // end of void AliFlowAnalysisWithCumulants::GetPointersForDiffFlowObjects()
1436 //================================================================================================================
1438 void AliFlowAnalysisWithCumulants::CalculateIntegratedFlow(TString rpPoi)
1440 // Calculate final results for integrated flow of RPs and POIs.
1441 // (to be improved - this method can be implemented much better)
1448 } else if(rpPoi == "POI")
1454 TH1F *yieldPt = NULL;
1458 yieldPt = (TH1F*)(fCommonHists->GetHistPtPOI())->Clone();
1459 } else if(rpPoi == "RP")
1461 yieldPt = (TH1F*)(fCommonHists->GetHistPtRP())->Clone();
1464 TH1D *flow2ndPt = (TH1D*)fDiffFlow[rp][0][0]->Clone();
1465 TH1D *flow4thPt = (TH1D*)fDiffFlow[rp][0][1]->Clone();
1466 TH1D *flow6thPt = (TH1D*)fDiffFlow[rp][0][2]->Clone();
1467 TH1D *flow8thPt = (TH1D*)fDiffFlow[rp][0][3]->Clone();
1468 Double_t dvn2nd = 0., dvn4th = 0., dvn6th = 0., dvn8th = 0.; // differential flow
1469 Double_t dErrvn2nd = 0., dErrvn4th = 0., dErrvn6th = 0., dErrvn8th = 0.; // error on differential flow
1470 Double_t dVn2nd = 0., dVn4th = 0., dVn6th = 0., dVn8th = 0.; // integrated flow
1471 Double_t dErrVn2nd = 0., dErrVn4th = 0., dErrVn6th = 0., dErrVn8th = 0.; // error on integrated flow
1472 Double_t dYield = 0.; // pt yield
1473 Double_t dSum2nd = 0., dSum4th = 0., dSum6th = 0., dSum8th = 0.; // needed for normalizing integrated flow
1474 fnBinsPt = flow2ndPt->GetXaxis()->GetNbins();
1475 // looping over pt bins:
1476 for(Int_t p=1;p<=fnBinsPt;p++)
1478 dvn2nd = flow2ndPt->GetBinContent(p);
1479 dvn4th = flow4thPt->GetBinContent(p);
1480 dvn6th = flow6thPt->GetBinContent(p);
1481 dvn8th = flow8thPt->GetBinContent(p);
1483 dErrvn2nd = flow2ndPt->GetBinError(p);
1484 dErrvn4th = flow4thPt->GetBinError(p);
1485 dErrvn6th = flow6thPt->GetBinError(p);
1486 dErrvn8th = flow8thPt->GetBinError(p);
1488 dYield = yieldPt->GetBinContent(p);
1490 dVn2nd += dvn2nd*dYield;
1491 dVn4th += dvn4th*dYield;
1492 dVn6th += dvn6th*dYield;
1493 dVn8th += dvn8th*dYield;
1500 dErrVn2nd += dYield*dYield*dErrvn2nd*dErrvn2nd;
1501 dErrVn4th += dYield*dYield*dErrvn4th*dErrvn4th;
1502 dErrVn6th += dYield*dYield*dErrvn6th*dErrvn6th;
1503 dErrVn8th += dYield*dYield*dErrvn8th*dErrvn8th;
1504 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
1506 // normalizing the results for integrated flow:
1510 dErrVn2nd /= (dSum2nd*dSum2nd);
1511 dErrVn2nd = TMath::Sqrt(dErrVn2nd);
1516 dErrVn4th /= (dSum4th*dSum4th);
1517 dErrVn4th = TMath::Sqrt(dErrVn4th);
1522 dErrVn6th /= (dSum6th*dSum6th);
1523 dErrVn6th = TMath::Sqrt(dErrVn6th);
1528 dErrVn8th /= (dSum8th*dSum8th);
1529 dErrVn8th = TMath::Sqrt(dErrVn8th);
1532 // storing the results for integrated flow in common hist results:
1535 fCommonHistsResults2nd->FillIntegratedFlowPOI(dVn2nd,dErrVn2nd);
1536 fCommonHistsResults4th->FillIntegratedFlowPOI(dVn4th,dErrVn4th);
1537 fCommonHistsResults6th->FillIntegratedFlowPOI(dVn6th,dErrVn6th);
1538 fCommonHistsResults8th->FillIntegratedFlowPOI(dVn8th,dErrVn8th);
1540 else if(rpPoi == "RP")
1542 fCommonHistsResults2nd->FillIntegratedFlowRP(dVn2nd,dErrVn2nd);
1543 fCommonHistsResults4th->FillIntegratedFlowRP(dVn4th,dErrVn4th);
1544 fCommonHistsResults6th->FillIntegratedFlowRP(dVn6th,dErrVn6th);
1545 fCommonHistsResults8th->FillIntegratedFlowRP(dVn8th,dErrVn8th);
1554 } // end of void AliFlowAnalysisWithCumulants::CalculateIntegratedFlow(TString rpPoi)
1556 //================================================================================================================
1558 void AliFlowAnalysisWithCumulants::FillCommonHistResultsForDifferentialFlow(TString rpPoi)
1560 // Fill common result histograms for differential flow.
1561 // (to be improved - this method can be implemented much better)
1568 } else if(rpPoi == "POI")
1574 for(Int_t p=1;p<=fnBinsPt;p++)
1577 Double_t v2 = fDiffFlow[rp][0][0]->GetBinContent(p);
1578 Double_t v4 = fDiffFlow[rp][0][1]->GetBinContent(p);
1579 Double_t v6 = fDiffFlow[rp][0][2]->GetBinContent(p);
1580 Double_t v8 = fDiffFlow[rp][0][3]->GetBinContent(p);
1582 Double_t v2Error = fDiffFlow[rp][0][0]->GetBinError(p);
1583 Double_t v4Error = fDiffFlow[rp][0][1]->GetBinError(p);
1584 Double_t v6Error = fDiffFlow[rp][0][2]->GetBinError(p);
1585 Double_t v8Error = fDiffFlow[rp][0][3]->GetBinError(p);
1586 // Fill common hist results:
1589 fCommonHistsResults2nd->FillDifferentialFlowPtRP(p,v2,v2Error);
1590 fCommonHistsResults4th->FillDifferentialFlowPtRP(p,v4,v4Error);
1591 fCommonHistsResults6th->FillDifferentialFlowPtRP(p,v6,v6Error);
1592 fCommonHistsResults8th->FillDifferentialFlowPtRP(p,v8,v8Error);
1593 } else if(rpPoi == "POI")
1595 fCommonHistsResults2nd->FillDifferentialFlowPtPOI(p,v2,v2Error);
1596 fCommonHistsResults4th->FillDifferentialFlowPtPOI(p,v4,v4Error);
1597 fCommonHistsResults6th->FillDifferentialFlowPtPOI(p,v6,v6Error);
1598 fCommonHistsResults8th->FillDifferentialFlowPtPOI(p,v8,v8Error);
1600 } // end of for(Int_t p=1;p<=fnBinsPt;p++)
1603 for(Int_t e=1;e<=fnBinsEta;e++)
1606 Double_t v2 = fDiffFlow[rp][1][0]->GetBinContent(e);
1607 Double_t v4 = fDiffFlow[rp][1][1]->GetBinContent(e);
1608 Double_t v6 = fDiffFlow[rp][1][2]->GetBinContent(e);
1609 Double_t v8 = fDiffFlow[rp][1][3]->GetBinContent(e);
1611 Double_t v2Error = fDiffFlow[rp][1][0]->GetBinError(e);
1612 Double_t v4Error = fDiffFlow[rp][1][1]->GetBinError(e);
1613 Double_t v6Error = fDiffFlow[rp][1][2]->GetBinError(e);
1614 Double_t v8Error = fDiffFlow[rp][1][3]->GetBinError(e);
1615 // Fill common hist results:
1618 fCommonHistsResults2nd->FillDifferentialFlowEtaRP(e,v2,v2Error);
1619 fCommonHistsResults4th->FillDifferentialFlowEtaRP(e,v4,v4Error);
1620 fCommonHistsResults6th->FillDifferentialFlowEtaRP(e,v6,v6Error);
1621 fCommonHistsResults8th->FillDifferentialFlowEtaRP(e,v8,v8Error);
1622 } else if(rpPoi == "POI")
1624 fCommonHistsResults2nd->FillDifferentialFlowEtaPOI(e,v2,v2Error);
1625 fCommonHistsResults4th->FillDifferentialFlowEtaPOI(e,v4,v4Error);
1626 fCommonHistsResults6th->FillDifferentialFlowEtaPOI(e,v6,v6Error);
1627 fCommonHistsResults8th->FillDifferentialFlowEtaPOI(e,v8,v8Error);
1629 } // end of for(Int_t e=1;e<=fnBinsEta;e++)
1631 } // end of void AliFlowAnalysisWithCumulants::FillCommonHistResultsForDifferentialFlow(TString rpPoi)
1633 //================================================================================================================
1635 void AliFlowAnalysisWithCumulants::CalculateDifferentialFlow(TString rpPoi, TString ptEta)
1637 // Calculate differential flow for RPs/POIs vs pt/eta from cumulants.
1639 Int_t rp = -1; // RP or POI
1640 Int_t pe = -1; // pt or eta
1645 } else if(rpPoi == "POI")
1652 } else if(ptEta == "eta")
1657 // Reference cumulants:
1658 Double_t gfc2 = fReferenceFlowCumulants->GetBinContent(1); // reference 2nd order cumulant
1659 Double_t gfc4 = fReferenceFlowCumulants->GetBinContent(2); // reference 4th order cumulant
1660 Double_t gfc6 = fReferenceFlowCumulants->GetBinContent(3); // reference 6th order cumulant
1661 Double_t gfc8 = fReferenceFlowCumulants->GetBinContent(4); // reference 8th order cumulant
1663 Int_t nBins = fDiffFlowCumulants[rp][pe][0]->GetXaxis()->GetNbins();
1665 for(Int_t b=1;b<=nBins;b++)
1667 // Differential cumulants:
1668 Double_t gfd2 = fDiffFlowCumulants[rp][pe][0]->GetBinContent(b); // differential 2nd order cumulant
1669 Double_t gfd4 = fDiffFlowCumulants[rp][pe][1]->GetBinContent(b); // differential 4th order cumulant
1670 Double_t gfd6 = fDiffFlowCumulants[rp][pe][2]->GetBinContent(b); // differential 6th order cumulant
1671 Double_t gfd8 = fDiffFlowCumulants[rp][pe][3]->GetBinContent(b); // differential 8th order cumulant
1672 // Differential flow:
1673 Double_t v2 = 0.; // v'{2,GFC}
1674 Double_t v4 = 0.; // v'{4,GFC}
1675 Double_t v6 = 0.; // v'{6,GFC}
1676 Double_t v8 = 0.; // v'{8,GFC}
1680 v2 = gfd2/pow(gfc2,0.5);
1681 fDiffFlow[rp][pe][0]->SetBinContent(b,v2);
1686 v4 = -gfd4/pow(-gfc4,.75);
1687 fDiffFlow[rp][pe][1]->SetBinContent(b,v4);
1692 v6 = gfd6/(4.*pow((1./4.)*gfc6,(5./6.)));
1693 fDiffFlow[rp][pe][2]->SetBinContent(b,v6);
1698 v8 = -gfd8/(33.*pow(-(1./33.)*gfc8,(7./8.)));
1699 fDiffFlow[rp][pe][3]->SetBinContent(b,v8);
1701 } // end of for(Int_t b=1;b<=nBins;b++)
1703 } // end of void AliFlowAnalysisWithCumulants::CalculateDifferentialFlow(TString rpPoi,TString ptEta)
1705 //================================================================================================================
1707 void AliFlowAnalysisWithCumulants::CalculateDifferentialFlowErrors(TString rpPoi,TString ptEta)
1709 // Calculate errors of differential flow.
1711 Int_t rp = -1; // RP or POI
1712 Int_t pe = -1; // pt or eta
1717 } else if(rpPoi == "POI")
1724 } else if(ptEta == "eta")
1730 Double_t chi2 = fChi->GetBinContent(1);
1731 Double_t chi4 = fChi->GetBinContent(2);
1732 //Double_t chi6 = fChi->GetBinContent(3);
1733 //Double_t chi8 = fChi->GetBinContent(4);
1735 Int_t nBins = fNoOfParticlesInBin[rp][pe]->GetXaxis()->GetNbins();
1736 for(Int_t b=1;b<=nBins;b++)
1738 Int_t nParticles = (Int_t)fNoOfParticlesInBin[rp][pe]->GetBinEntries(b);
1739 // Error of 2nd order estimate:
1740 if(chi2>0. && nParticles>0.)
1742 Double_t v2Error = pow((1./(2.*nParticles))*((1.+pow(chi2,2.))/pow(chi2,2.)),0.5);
1743 fDiffFlow[rp][pe][0]->SetBinError(b,v2Error);
1745 // Error of 4th order estimate:
1746 if(chi4>0. && nParticles>0.)
1748 Double_t v4Error = pow((1./(2.*nParticles))*((2.+6.*pow(chi4,2.)+pow(chi4,4.)+pow(chi4,6.))/pow(chi4,6.)),0.5);
1749 fDiffFlow[rp][pe][1]->SetBinError(b,v4Error);
1751 // Error of 6th order estimate:
1752 //if(chi6>0. && nParticles>0.)
1754 // Double_t v6Error = ... // to be improved - yet to be calculated
1755 fDiffFlow[rp][pe][2]->SetBinError(b,0.);
1757 // Error of 8th order estimate:
1758 //if(chi8>0. && nParticles>0.)
1760 // Double_t v8Error = ... // to be improved - yet to be calculated
1761 fDiffFlow[rp][pe][3]->SetBinError(b,0.);
1763 } // end of for(Int_t b=1;b<=nBins;b++)
1765 } // end of void AliFlowAnalysisWithCumulants::CalculateDifferentialFlowErrors(TString rpPoi,TString ptEta)
1767 //================================================================================================================
1769 void AliFlowAnalysisWithCumulants::CalculateCumulantsForDiffFlow(TString rpPoi,TString ptEta)
1771 // Calculate cumulants for differential flow.
1773 Int_t rp = -1; // RP or POI
1774 Int_t pe = -1; // pt or eta
1779 } else if(rpPoi == "POI")
1786 } else if(ptEta == "eta")
1791 // [nBins][pMax][qMax]:
1792 Int_t nBins = fDiffFlowGenFun[0][rp][pe]->GetXaxis()->GetNbins();
1793 Int_t pMax = fDiffFlowGenFun[0][rp][pe]->GetYaxis()->GetNbins();
1794 Int_t qMax = fDiffFlowGenFun[0][rp][pe]->GetZaxis()->GetNbins();
1796 TMatrixD dAvG(pMax,qMax);
1798 for(Int_t p=0;p<pMax;p++)
1800 for(Int_t q=0;q<qMax;q++)
1802 dAvG(p,q) = fReferenceFlowGenFun->GetBinContent(fReferenceFlowGenFun->GetBin(p+1,q+1));
1805 // Loop over pt/eta bins and calculate differential cumulants:
1806 for(Int_t b=0;b<nBins;b++)
1808 Double_t gfc[5] = {0.}; // to be improved (hardwired 5)
1809 Double_t D[5] = {0.}; // D_{p} in Eq. (11) in Practical guide // to be improved (hardwired 5)
1810 // ptBinRPNoOfParticles[b]=fPtBinRPNoOfParticles->GetBinEntries(b+1);
1811 for(Int_t p=0;p<pMax;p++)
1813 Double_t tempSum = 0.;
1814 for(Int_t q=0;q<qMax;q++)
1816 if(TMath::Abs(dAvG(p,q))>1.e-44)
1818 Double_t X = fDiffFlowGenFun[0][rp][pe]->GetBinContent(fDiffFlowGenFun[0][rp][pe]->GetBin(b+1,p+1,q+1))/dAvG(p,q); // see Ollitrault's Practical guide (Eq. 11)
1819 Double_t Y = fDiffFlowGenFun[1][rp][pe]->GetBinContent(fDiffFlowGenFun[0][rp][pe]->GetBin(b+1,p+1,q+1))/dAvG(p,q); // see Ollitrault's Practical guide (Eq. 11)
1820 tempSum += cos(fMultiple*2.*q*TMath::Pi()/qMax)*X
1821 + sin(fMultiple*2.*q*TMath::Pi()/qMax)*Y;
1824 D[p] = (pow(fR0*pow(p+1.0,0.5),fMultiple)/qMax)*tempSum;
1826 gfc[0] = (1./(fR0*fR0))*(5.*D[0]-5.*D[1]+(10./3.)*D[2]-(5./4.)*D[3]+(1./5.)*D[4]);
1827 gfc[1] = (1./pow(fR0,4.))*((-77./6.)*D[0]+(107./6.)*D[1]-(13./1.)*D[2]+(61./12.)*D[3]-(5./6.)*D[4]);
1828 gfc[2] = (1./pow(fR0,6.))*((71./2.)*D[0]-59.*D[1]+49.*D[2]-(41./2.)*D[3]+(7./2.)*D[4]);
1829 gfc[3] = (1./pow(fR0,8.))*(-84.*D[0]+156.*D[1]-144.*D[2]+66.*D[3]-12.*D[4]);
1830 // gfc[4] = (1./pow(fR0,10.))*(120.*D[0]-240.*D[1]+240.*D[2]-120.*D[3]+24.*D[4]); // 10th order cumulant (to be improved - where to store it?)
1832 for(Int_t co=0;co<4;co++)
1834 fDiffFlowCumulants[rp][pe][co]->SetBinContent(b+1,gfc[co]);
1838 } // end of void AliFlowAnalysisWithCumulants::CalculateCumulantsForDiffFlow(TString rpPoi, TString ptEta)
1840 //================================================================================================================
1842 void AliFlowAnalysisWithCumulants::PrintFinalResults(TString type)
1844 // Printing on the screen the final results for reference flow and for integrated flow of RPs and POIs.
1846 Int_t n = fHarmonic;
1848 Double_t dVn[4] = {0.}; // array to hold Vn{2}, Vn{4}, Vn{6} and Vn{8}
1849 Double_t dVnErr[4] = {0.}; // array to hold errors of Vn{2}, Vn{4}, Vn{6} and Vn{8}
1853 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinContent(1);
1854 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlow())->GetBinError(1);
1855 dVn[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinContent(1);
1856 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlow())->GetBinError(1);
1857 dVn[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinContent(1);
1858 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlow())->GetBinError(1);
1859 dVn[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinContent(1);
1860 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlow())->GetBinError(1);
1861 } else if(type == "RP")
1863 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinContent(1);
1864 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowRP())->GetBinError(1);
1865 dVn[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinContent(1);
1866 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowRP())->GetBinError(1);
1867 dVn[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinContent(1);
1868 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowRP())->GetBinError(1);
1869 dVn[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinContent(1);
1870 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowRP())->GetBinError(1);
1871 } else if(type == "POI")
1873 dVn[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinContent(1);
1874 dVnErr[0] = (fCommonHistsResults2nd->GetHistIntFlowPOI())->GetBinError(1);
1875 dVn[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinContent(1);
1876 dVnErr[1] = (fCommonHistsResults4th->GetHistIntFlowPOI())->GetBinError(1);
1877 dVn[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinContent(1);
1878 dVnErr[2] = (fCommonHistsResults6th->GetHistIntFlowPOI())->GetBinError(1);
1879 dVn[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinContent(1);
1880 dVnErr[3] = (fCommonHistsResults8th->GetHistIntFlowPOI())->GetBinError(1);
1884 cout<<" WARNING: Impossible type (can be RF, RP or POI) !!!!"<<endl;
1885 cout<<" Results will not be printed on the screen."<<endl;
1890 TString title = " flow estimates from GF-cumulants";
1891 TString subtitle = " (";
1893 if(!(fUsePhiWeights||fUsePtWeights||fUseEtaWeights))
1895 subtitle.Append(type);
1896 subtitle.Append(", without weights)");
1899 subtitle.Append(type);
1900 subtitle.Append(", with weights)");
1904 cout<<"*************************************"<<endl;
1905 cout<<"*************************************"<<endl;
1906 cout<<title.Data()<<endl;
1907 cout<<subtitle.Data()<<endl;
1910 for(Int_t i=0;i<4;i++)
1912 cout<<" v_"<<n<<"{"<<2*(i+1)<<"} = "<<dVn[i]<<" +/- "<<dVnErr[i]<<endl;
1918 cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultRP()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultRP()->GetMean()<<endl;
1920 else if (type == "RP")
1922 cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultRP()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultRP()->GetMean()<<endl;
1924 else if (type == "POI")
1926 cout<<" nEvts = "<<(Int_t)fCommonHists->GetHistMultPOI()->GetEntries()<<", <M> = "<<(Double_t)fCommonHists->GetHistMultPOI()->GetMean()<<endl;
1928 cout<<"*************************************"<<endl;
1929 cout<<"*************************************"<<endl;
1932 } // end of AliFlowAnalysisWithCumulants::PrintFinalResults(TString type);
1934 //================================================================================================================
1936 void AliFlowAnalysisWithCumulants::FillCommonHistResultsForReferenceFlow()
1938 // Fill in AliFlowCommonHistResults dedicated histograms for reference flow.
1941 Double_t v2 = fReferenceFlow->GetBinContent(1);
1942 Double_t v4 = fReferenceFlow->GetBinContent(2);
1943 Double_t v6 = fReferenceFlow->GetBinContent(3);
1944 Double_t v8 = fReferenceFlow->GetBinContent(4);
1946 Double_t v2Error = fReferenceFlow->GetBinError(1);
1947 Double_t v4Error = fReferenceFlow->GetBinError(2);
1948 Double_t v6Error = fReferenceFlow->GetBinError(3);
1949 Double_t v8Error = fReferenceFlow->GetBinError(4);
1950 // Fill results end errors in common hist results:
1951 fCommonHistsResults2nd->FillIntegratedFlow(v2,v2Error);
1952 fCommonHistsResults4th->FillIntegratedFlow(v4,v4Error);
1953 fCommonHistsResults6th->FillIntegratedFlow(v6,v6Error);
1954 fCommonHistsResults8th->FillIntegratedFlow(v8,v8Error);
1956 Double_t chi2 = fChi->GetBinContent(1);
1957 Double_t chi4 = fChi->GetBinContent(2);
1958 Double_t chi6 = fChi->GetBinContent(3);
1959 Double_t chi8 = fChi->GetBinContent(4);
1960 // Fill resolution chi in common hist results:
1961 fCommonHistsResults2nd->FillChi(chi2);
1962 fCommonHistsResults4th->FillChi(chi4);
1963 fCommonHistsResults6th->FillChi(chi6);
1964 fCommonHistsResults8th->FillChi(chi8);
1966 } // end of AliFlowAnalysisWithCumulants::FillCommonHistResultsForReferenceFlow()
1968 //================================================================================================================
1970 void AliFlowAnalysisWithCumulants::CalculateReferenceFlowError()
1972 // Calculate error of reference flow harmonics.
1974 // Generating Function Cumulants:
1975 Double_t gfc2 = fReferenceFlowCumulants->GetBinContent(1); // GFC{2}
1976 Double_t gfc4 = fReferenceFlowCumulants->GetBinContent(2); // GFC{4}
1977 Double_t gfc6 = fReferenceFlowCumulants->GetBinContent(3); // GFC{6}
1978 Double_t gfc8 = fReferenceFlowCumulants->GetBinContent(4); // GFC{8}
1979 // Reference flow estimates:
1980 Double_t v2 = fReferenceFlow->GetBinContent(1); // v{2,GFC}
1981 Double_t v4 = fReferenceFlow->GetBinContent(2); // v{4,GFC}
1982 Double_t v6 = fReferenceFlow->GetBinContent(3); // v{6,GFC}
1983 Double_t v8 = fReferenceFlow->GetBinContent(4); // v{8,GFC}
1984 // Statistical errors of reference flow estimates:
1985 Double_t v2Error = 0.; // statistical error of v{2,GFC}
1986 Double_t v4Error = 0.; // statistical error of v{4,GFC}
1987 Double_t v6Error = 0.; // statistical error of v{6,GFC}
1988 Double_t v8Error = 0.; // statistical error of v{8,GFC}
1994 // <Q-vector stuff>:
1995 Double_t dAvQx = fQvectorComponents->GetBinContent(1); // <Q_x>
1996 Double_t dAvQy = fQvectorComponents->GetBinContent(2); // <Q_y>
1997 Double_t dAvQ2x = fQvectorComponents->GetBinContent(3); // <(Q_x)^2>
1998 Double_t dAvQ2y = fQvectorComponents->GetBinContent(4); // <(Q_y)^2>
2000 Double_t dAvw2 = 1.;
2003 dAvw2 = fAverageOfSquaredWeight->GetBinContent(1);
2004 if(TMath::Abs(dAvw2)<1.e-44)
2007 cout<<" WARNING (GFC): Average of squared weight is 0 in GFC. Most probably one of the histograms"<<endl;
2008 cout<<" in the file \"weights.root\" was empty. Nothing will be calculated !!!!"<<endl;
2012 // Calculating statistical error of v{2,GFC}:
2013 if(fnEvts>0. && fAvM>0. && dAvw2>0. && gfc2>=0.)
2015 if((dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow(gfc2,(1./2.))*(fAvM/dAvw2),2.)>0.))
2017 chi2 = (fAvM*v2)/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(v2*fAvM/dAvw2,2.),0.5);
2019 if(TMath::Abs(chi2)>1.e-44)
2021 v2Error = pow(((1./(2.*fAvM*fnEvts))*((1.+2.*pow(chi2,2))/(2.*pow(chi2,2)))),0.5);
2024 // Calculating statistical error of v{4,GFC}:
2025 if(fnEvts>0 && fAvM>0 && dAvw2>0 && gfc4<=0.)
2027 if((dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow(-gfc4,(1./4.))*(fAvM/dAvw2),2.)>0.))
2029 chi4 = (fAvM*v4)/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(v4*fAvM/dAvw2,2.),0.5);
2031 if(TMath::Abs(chi4)>1.e-44)
2033 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);
2036 // Calculating statistical error of v{6,GFC}:
2037 if(fnEvts>0 && fAvM>0 && dAvw2>0 && gfc6>=0.)
2039 if((dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow((1./4.)*gfc6,(1./6.))*(fAvM/dAvw2),2.)>0.))
2041 chi6 = (fAvM*v6)/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(v6*fAvM/dAvw2,2.),0.5);
2043 if(TMath::Abs(chi6)>1.e-44)
2045 v6Error = (1./(pow(2.*fAvM*fnEvts,0.5)))*pow((3.+18.*pow(chi6,2)+9.*pow(chi6,4.)+28.*pow(chi6,6.)
2046 +12.*pow(chi6,8.)+24.*pow(chi6,10.))/(24.*pow(chi6,10.)),0.5);
2049 // Calculating statistical error of v{8,GFC}:
2050 if(fnEvts>0 && fAvM>0 && dAvw2>0 && gfc8<=0.)
2052 if((dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(pow(-(1./33.)*gfc8,(1./8.))*(fAvM/dAvw2),2.)>0.))
2054 chi8=(fAvM*v8)/pow(dAvQ2x+dAvQ2y-pow(dAvQx,2.)-pow(dAvQy,2.)-pow(v8*fAvM/dAvw2,2.),0.5);
2056 if(TMath::Abs(chi8)>1.e-44)
2058 v8Error = (1./(pow(2.*fAvM*fnEvts,0.5)))*pow((12.+96.*pow(chi8,2.)+72.*pow(chi8,4.)+304.*pow(chi8,6.)
2059 +257.*pow(chi8,8.)+804.*pow(chi8,10.)+363.*pow(chi8,12.)+726.*pow(chi8,14.))/(726.*pow(chi8,14.)),0.5);
2063 // Store errors for reference flow:
2064 fReferenceFlow->SetBinError(1,v2Error);
2065 fReferenceFlow->SetBinError(2,v4Error);
2066 fReferenceFlow->SetBinError(3,v6Error);
2067 fReferenceFlow->SetBinError(4,v8Error);
2068 // Store resolution chi:
2069 fChi->SetBinContent(1,chi2);
2070 fChi->SetBinContent(2,chi4);
2071 fChi->SetBinContent(3,chi6);
2072 fChi->SetBinContent(4,chi8);
2074 } // end of void AliFlowAnalysisWithCumulants::CalculateReferenceFlowError()
2076 //================================================================================================================
2078 void AliFlowAnalysisWithCumulants::CalculateReferenceFlow()
2080 // Calculate from isotropic cumulants reference flow.
2082 // Generating Function Cumulants:
2083 Double_t gfc2 = fReferenceFlowCumulants->GetBinContent(1); // GFC{2}
2084 Double_t gfc4 = fReferenceFlowCumulants->GetBinContent(2); // GFC{4}
2085 Double_t gfc6 = fReferenceFlowCumulants->GetBinContent(3); // GFC{6}
2086 Double_t gfc8 = fReferenceFlowCumulants->GetBinContent(4); // GFC{8}
2087 // Reference flow estimates:
2088 Double_t v2 = 0.; // v{2,GFC}
2089 Double_t v4 = 0.; // v{4,GFC}
2090 Double_t v6 = 0.; // v{6,GFC}
2091 Double_t v8 = 0.; // v{8,GFC}
2092 // Calculate reference flow estimates from Q-cumulants:
2093 if(gfc2>=0.) v2 = pow(gfc2,1./2.);
2094 if(gfc4<=0.) v4 = pow(-1.*gfc4,1./4.);
2095 if(gfc6>=0.) v6 = pow((1./4.)*gfc6,1./6.);
2096 if(gfc8<=0.) v8 = pow((-1./33.)*gfc8,1./8.);
2097 // Store results for reference flow:
2098 fReferenceFlow->SetBinContent(1,v2);
2099 fReferenceFlow->SetBinContent(2,v4);
2100 fReferenceFlow->SetBinContent(3,v6);
2101 fReferenceFlow->SetBinContent(4,v8);
2103 } // end of void AliFlowAnalysisWithCumulants::CalculateReferenceFlow()
2105 //================================================================================================================
2107 void AliFlowAnalysisWithCumulants::CalculateCumulantsForReferenceFlow()
2109 // Calculate cumulants for reference flow.
2111 Int_t pMax = fReferenceFlowGenFun->GetXaxis()->GetNbins();
2112 Int_t qMax = fReferenceFlowGenFun->GetYaxis()->GetNbins();
2115 TMatrixD dAvG(pMax,qMax);
2117 Bool_t someAvGEntryIsNegative = kFALSE;
2118 for(Int_t p=0;p<pMax;p++)
2120 for(Int_t q=0;q<qMax;q++)
2122 dAvG(p,q) = fReferenceFlowGenFun->GetBinContent(fReferenceFlowGenFun->GetBin(p+1,q+1));
2125 someAvGEntryIsNegative = kTRUE;
2127 cout<<" WARNING: "<<Form("<G[%d][%d]> is negative !!!! GFC results are meaningless.",p,q)<<endl;
2133 // C[p][q] (generating function for the cumulants)
2134 TMatrixD dC(pMax,qMax);
2136 if(fAvM>0. && !someAvGEntryIsNegative)
2138 for(Int_t p=0;p<pMax;p++)
2140 for(Int_t q=0;q<qMax;q++)
2142 dC(p,q) = fAvM*(pow(dAvG(p,q),(1./fAvM))-1.);
2147 // Averaging the generating function for cumulants over azimuth
2148 // in order to eliminate detector effects.
2149 // <C[p][q]> (Remark: here <> stands for average over azimuth):
2150 TVectorD dAvC(pMax);
2152 for(Int_t p=0;p<pMax;p++)
2155 for(Int_t q=0;q<qMax;q++)
2159 dAvC[p] = temp/qMax;
2162 // Finally, the isotropic cumulants for reference flow:
2163 TVectorD cumulant(pMax);
2165 cumulant[0] = (-1./(60*fR0*fR0))*((-300.)*dAvC[0]+300.*dAvC[1]-200.*dAvC[2]+75.*dAvC[3]-12.*dAvC[4]);
2166 cumulant[1] = (-1./(6.*pow(fR0,4.)))*(154.*dAvC[0]-214.*dAvC[1]+156.*dAvC[2]-61.*dAvC[3]+10.*dAvC[4]);
2167 cumulant[2] = (3./(2.*pow(fR0,6.)))*(71.*dAvC[0]-118.*dAvC[1]+98.*dAvC[2]-41.*dAvC[3]+7.*dAvC[4]);
2168 cumulant[3] = (-24./pow(fR0,8.))*(14.*dAvC[0]-26.*dAvC[1]+24.*dAvC[2]-11.*dAvC[3]+2.*dAvC[4]);
2169 cumulant[4] = (120./pow(fR0,10.))*(5.*dAvC[0]-10.*dAvC[1]+10.*dAvC[2]-5.*dAvC[3]+1.*dAvC[4]);
2172 // Remark: the highest order cumulant is on purpose in the overflow.
2173 for(Int_t co=0;co<pMax;co++) // cumulant order
2175 fReferenceFlowCumulants->SetBinContent(co+1,cumulant[co]);
2178 // Calculation versus multiplicity:
2179 if(!fCalculateVsMultiplicity){return;}
2180 for(Int_t b=0;b<fnBinsMult;b++)
2182 fAvM = fAvMVsM->GetBinContent(b+1);
2184 TMatrixD dAvGVsM(pMax,qMax);
2186 Bool_t someAvGEntryIsNegativeVsM = kFALSE;
2187 for(Int_t p=0;p<pMax;p++)
2189 for(Int_t q=0;q<qMax;q++)
2191 dAvGVsM(p,q) = fReferenceFlowGenFunVsM->GetBinContent(fReferenceFlowGenFunVsM->GetBin(b+1,p+1,q+1));
2194 someAvGEntryIsNegativeVsM = kTRUE;
2196 cout<<" WARNING: "<<Form("<G[%d][%d]> is negative !!!! GFC vs multiplicity results are meaningless.",p,q)<<endl;
2202 // C[p][q] (generating function for the cumulants)
2203 TMatrixD dCVsM(pMax,qMax);
2205 if(fAvM>0. && !someAvGEntryIsNegativeVsM)
2207 for(Int_t p=0;p<pMax;p++)
2209 for(Int_t q=0;q<qMax;q++)
2211 dCVsM(p,q) = fAvM*(pow(dAvGVsM(p,q),(1./fAvM))-1.);
2216 // Averaging the generating function for cumulants over azimuth
2217 // in order to eliminate detector effects.
2218 // <C[p][q]> (Remark: here <> stands for average over azimuth):
2219 TVectorD dAvCVsM(pMax);
2221 for(Int_t p=0;p<pMax;p++)
2223 Double_t tempVsM = 0.;
2224 for(Int_t q=0;q<qMax;q++)
2226 tempVsM += 1.*dCVsM(p,q);
2228 dAvCVsM[p] = tempVsM/qMax;
2231 // Finally, the isotropic cumulants for reference flow:
2232 TVectorD cumulantVsM(pMax);
2234 cumulantVsM[0] = (-1./(60*fR0*fR0))*((-300.)*dAvCVsM[0]+300.*dAvCVsM[1]-200.*dAvCVsM[2]+75.*dAvCVsM[3]-12.*dAvCVsM[4]);
2235 cumulantVsM[1] = (-1./(6.*pow(fR0,4.)))*(154.*dAvCVsM[0]-214.*dAvCVsM[1]+156.*dAvCVsM[2]-61.*dAvCVsM[3]+10.*dAvCVsM[4]);
2236 cumulantVsM[2] = (3./(2.*pow(fR0,6.)))*(71.*dAvCVsM[0]-118.*dAvCVsM[1]+98.*dAvCVsM[2]-41.*dAvCVsM[3]+7.*dAvCVsM[4]);
2237 cumulantVsM[3] = (-24./pow(fR0,8.))*(14.*dAvCVsM[0]-26.*dAvCVsM[1]+24.*dAvCVsM[2]-11.*dAvCVsM[3]+2.*dAvCVsM[4]);
2238 cumulantVsM[4] = (120./pow(fR0,10.))*(5.*dAvCVsM[0]-10.*dAvCVsM[1]+10.*dAvCVsM[2]-5.*dAvCVsM[3]+1.*dAvCVsM[4]);
2241 for(Int_t co=0;co<pMax-1;co++) // cumulant order
2243 fReferenceFlowCumulantsVsM[co]->SetBinContent(b+1,cumulantVsM[co]);
2245 } // end of for(Int_t b=0;b<fnBinsMult;b++)
2247 } // end of void AliFlowAnalysisWithCumulants::CalculateCumulantsForReferenceFlow()
2249 //================================================================================================================
2251 void AliFlowAnalysisWithCumulants::GetAvMultAndNoOfEvts()
2253 // From relevant common control histogram get average multiplicity of RPs and number of events.
2255 fAvM = (Double_t)fCommonHists->GetHistMultRP()->GetMean();
2256 fnEvts = (Int_t)fCommonHists->GetHistMultRP()->GetEntries();
2258 } // end of void AliFlowAnalysisWithCumulants::GetAvMultAndNoOfEvts()
2260 //================================================================================================================
2262 void AliFlowAnalysisWithCumulants::InitializeArrays()
2264 // Initialize all arrays.
2266 for(Int_t ri=0;ri<2;ri++)
2268 for(Int_t rp=0;rp<2;rp++)
2270 for(Int_t pe=0;pe<2;pe++)
2272 fDiffFlowGenFun[ri][rp][pe] = NULL;
2276 for(Int_t rp=0;rp<2;rp++)
2278 for(Int_t pe=0;pe<2;pe++)
2280 fNoOfParticlesInBin[rp][pe] = NULL;
2283 for(Int_t rp=0;rp<2;rp++)
2285 for(Int_t pe=0;pe<2;pe++)
2287 for(Int_t co=0;co<4;co++)
2289 fDiffFlowCumulants[rp][pe][co] = NULL;
2290 fDiffFlow[rp][pe][co] = NULL;
2294 for(Int_t i=0;i<3;i++)
2296 fPrintFinalResults[i] = kTRUE;
2298 for(Int_t r=0;r<10;r++)
2301 for(Int_t pq=0;pq<5;pq++)
2303 fTuningGenFun[r][pq] = NULL;
2304 fTuningCumulants[r][pq] = NULL;
2305 fTuningFlow[r][pq] = NULL;
2308 for(Int_t co=0;co<4;co++)
2310 fReferenceFlowCumulantsVsM[co] = NULL;
2313 } // end of void AliFlowAnalysisWithCumulants::InitializeArrays()
2315 //================================================================================================================
2317 void AliFlowAnalysisWithCumulants::CrossCheckSettings()
2319 // Cross-check the user settings before starting.
2321 // a) Cross check if the choice for multiplicity weight make sense.
2323 // a) Cross check if the choice for multiplicity weight make sense:
2324 if(strcmp(fMultiplicityWeight->Data(),"unit") &&
2325 strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2328 cout<<"WARNING (GFC): Multiplicity weight can be either \"unit\" or \"multiplicity\"."<<endl;
2329 cout<<" Certainly not \""<<fMultiplicityWeight->Data()<<"\"."<<endl;
2336 } // end of void AliFlowAnalysisWithCumulants::CrossCheckSettings()
2338 //================================================================================================================
2340 void AliFlowAnalysisWithCumulants::AccessConstants()
2342 // Access needed common constants from AliFlowCommonConstants.
2344 fnBinsPhi = AliFlowCommonConstants::GetMaster()->GetNbinsPhi();
2345 fPhiMin = AliFlowCommonConstants::GetMaster()->GetPhiMin();
2346 fPhiMax = AliFlowCommonConstants::GetMaster()->GetPhiMax();
2347 if(fnBinsPhi) fPhiBinWidth = (fPhiMax-fPhiMin)/fnBinsPhi;
2348 fnBinsPt = AliFlowCommonConstants::GetMaster()->GetNbinsPt();
2349 fPtMin = AliFlowCommonConstants::GetMaster()->GetPtMin();
2350 fPtMax = AliFlowCommonConstants::GetMaster()->GetPtMax();
2351 if(fnBinsPt) fPtBinWidth = (fPtMax-fPtMin)/fnBinsPt;
2352 fnBinsEta = AliFlowCommonConstants::GetMaster()->GetNbinsEta();
2353 fEtaMin = AliFlowCommonConstants::GetMaster()->GetEtaMin();
2354 fEtaMax = AliFlowCommonConstants::GetMaster()->GetEtaMax();
2355 if(fnBinsEta) fEtaBinWidth = (fEtaMax-fEtaMin)/fnBinsEta;
2357 } // end of void AliFlowAnalysisWithCumulants::AccessConstants()
2359 //================================================================================================================
2361 void AliFlowAnalysisWithCumulants::BookAndFillWeightsHistograms()
2363 // Book and fill histograms which hold phi, pt and eta weights.
2367 cout<<"WARNING (GFC): fWeightsList is NULL in AFAWGFC::BAFWH() !!!!"<<endl;
2373 if(fWeightsList->FindObject("phi_weights"))
2375 fPhiWeights = dynamic_cast<TH1F*>(fWeightsList->FindObject("phi_weights"));
2376 if(TMath::Abs(fPhiWeights->GetBinWidth(1)-fPhiBinWidth)>pow(10.,-6.))
2379 cout<<"WARNING (GFC): Inconsistent binning in histograms for phi-weights throughout the code."<<endl;
2386 cout<<"WARNING (GFC): fWeightsList->FindObject(\"phi_weights\") is NULL in AFAWGFC::BAFWH() !!!!"<<endl;
2390 } // end of if(fUsePhiWeights)
2394 if(fWeightsList->FindObject("pt_weights"))
2396 fPtWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("pt_weights"));
2397 if(TMath::Abs(fPtWeights->GetBinWidth(1)-fPtBinWidth)>pow(10.,-6.))
2400 cout<<"WARNING (GFC): Inconsistent binning in histograms for pt-weights throughout the code."<<endl;
2407 cout<<"WARNING (GFC): fWeightsList->FindObject(\"pt_weights\") is NULL in AFAWGFC::BAFWH() !!!!"<<endl;
2411 } // end of if(fUsePtWeights)
2415 if(fWeightsList->FindObject("eta_weights"))
2417 fEtaWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("eta_weights"));
2418 if(TMath::Abs(fEtaWeights->GetBinWidth(1)-fEtaBinWidth)>pow(10.,-6.))
2421 cout<<"WARNING (GFC): Inconsistent binning in histograms for eta-weights throughout the code."<<endl;
2428 cout<<"WARNING (GFC): fUseEtaWeights && fWeightsList->FindObject(\"eta_weights\") is NULL in AFAWGFC::BAFWH() !!!!"<<endl;
2432 } // end of if(fUseEtaWeights)
2434 } // end of AliFlowAnalysisWithCumulants::BookAndFillWeightsHistograms()
2436 //================================================================================================================
2438 void AliFlowAnalysisWithCumulants::BookEverythingForCalculationVsMultiplicity()
2440 // Book all objects relevant for flow analysis versus multiplicity.
2442 // a) Define constants;
2443 // b) Book all profiles;
2444 // c) Book all results.
2446 // a) Define constants and local flags:
2449 TString cumulantFlag[4] = {"GFC{2}","GFC{4}","GFC{6}","GFC{8}"};
2451 // b) Book all profiles:
2452 // Average of the generating function for reference flow <G[p][q]> versus multiplicity:
2453 fReferenceFlowGenFunVsM = new TProfile3D("fReferenceFlowGenFunVsM","#LTG[p][q]#GT vs M",fnBinsMult,fMinMult,fMaxMult,pMax,0.,(Double_t)pMax,qMax,0.,(Double_t)qMax);
2454 fReferenceFlowGenFunVsM->SetXTitle("M");
2455 fReferenceFlowGenFunVsM->SetYTitle("p");
2456 fReferenceFlowGenFunVsM->SetZTitle("q");
2457 fReferenceFlowProfiles->Add(fReferenceFlowGenFunVsM);
2458 // Averages of Q-vector components versus multiplicity:
2459 fQvectorComponentsVsM = new TProfile2D("fQvectorComponentsVsM","Averages of Q-vector components",fnBinsMult,fMinMult,fMaxMult,4,0.,4.);
2460 //fQvectorComponentsVsM->SetLabelSize(0.06);
2461 fQvectorComponentsVsM->SetMarkerStyle(25);
2462 fQvectorComponentsVsM->SetXTitle("M");
2463 fQvectorComponentsVsM->GetYaxis()->SetBinLabel(1,"#LTQ_{x}#GT"); // Q_{x}
2464 fQvectorComponentsVsM->GetYaxis()->SetBinLabel(2,"#LTQ_{y}#GT"); // Q_{y}
2465 fQvectorComponentsVsM->GetYaxis()->SetBinLabel(3,"#LTQ_{x}^{2}#GT"); // Q_{x}^{2}
2466 fQvectorComponentsVsM->GetYaxis()->SetBinLabel(4,"#LTQ_{y}^{2}#GT"); // Q_{y}^{2}
2467 fReferenceFlowProfiles->Add(fQvectorComponentsVsM);
2468 // <<w^2>>, where w = wPhi*wPt*wEta versus multiplicity:
2469 fAverageOfSquaredWeightVsM = new TProfile2D("fAverageOfSquaredWeightVsM","#LT#LTw^{2}#GT#GT",fnBinsMult,fMinMult,fMaxMult,1,0,1);
2470 fAverageOfSquaredWeightVsM->SetLabelSize(0.06);
2471 fAverageOfSquaredWeightVsM->SetMarkerStyle(25);
2472 fAverageOfSquaredWeightVsM->SetLabelOffset(0.01);
2473 fAverageOfSquaredWeightVsM->GetXaxis()->SetBinLabel(1,"#LT#LTw^{2}#GT#GT");
2474 fReferenceFlowProfiles->Add(fAverageOfSquaredWeightVsM);
2475 // <M> vs multiplicity bin:
2476 fAvMVsM = new TProfile("fAvMVsM","#LTM#GT vs M",fnBinsMult,fMinMult,fMaxMult);
2477 //fAvMVsM->SetLabelSize(0.06);
2478 fAvMVsM->SetMarkerStyle(25);
2479 fAvMVsM->SetLabelOffset(0.01);
2480 fAvMVsM->SetXTitle("M");
2481 fAvMVsM->SetYTitle("#LTM#GT");
2482 fReferenceFlowProfiles->Add(fAvMVsM);
2484 // c) Book all results:
2485 // Final results for reference GF-cumulants versus multiplicity:
2486 TString referenceFlowCumulantsVsMName = "fReferenceFlowCumulantsVsM";
2487 for(Int_t co=0;co<4;co++) // cumulant order
2489 fReferenceFlowCumulantsVsM[co] = new TH1D(Form("%s, %s",referenceFlowCumulantsVsMName.Data(),cumulantFlag[co].Data()),
2490 Form("%s vs multipicity",cumulantFlag[co].Data()),
2491 fnBinsMult,fMinMult,fMaxMult);
2492 fReferenceFlowCumulantsVsM[co]->SetMarkerStyle(25);
2493 fReferenceFlowCumulantsVsM[co]->GetXaxis()->SetTitle("M");
2494 fReferenceFlowCumulantsVsM[co]->GetYaxis()->SetTitle(cumulantFlag[co].Data());
2495 fReferenceFlowResults->Add(fReferenceFlowCumulantsVsM[co]);
2496 } // end of for(Int_t co=0;co<4;co++) // cumulant order
2498 } // end of void AliFlowAnalysisWithCumulants::BookEverythingForCalculationVsMultiplicity()
2500 //================================================================================================================
2502 void AliFlowAnalysisWithCumulants::BookEverythingForReferenceFlow()
2504 // Book all objects relevant for calculation of reference flow.
2506 // a) Define static constants for array's boundaries;
2507 // b) Book profile to hold all flags for reference flow;
2508 // c) Book all event-by-event quantities;
2509 // d) Book all profiles;
2510 // e) Book all histograms.
2512 // a) Define static constants for array's boundaries:
2513 static const Int_t pMax = 5;
2514 static const Int_t qMax = 11;
2516 // b) Book profile to hold all flags for reference flow:
2517 TString referenceFlowFlagsName = "fReferenceFlowFlags";
2518 fReferenceFlowFlags = new TProfile(referenceFlowFlagsName.Data(),"Flags for Reference Flow",2,0,2);
2519 fReferenceFlowFlags->SetTickLength(-0.01,"Y");
2520 fReferenceFlowFlags->SetMarkerStyle(25);
2521 fReferenceFlowFlags->SetLabelSize(0.05);
2522 fReferenceFlowFlags->SetLabelOffset(0.02,"Y");
2523 fReferenceFlowFlags->GetXaxis()->SetBinLabel(1,"Particle weights");
2524 fReferenceFlowFlags->GetXaxis()->SetBinLabel(2,"Event weights");
2525 fReferenceFlowList->Add(fReferenceFlowFlags);
2527 // c) Book all event-by-event quantities:
2528 fGEBE = new TMatrixD(pMax,qMax);
2530 // d) Book all profiles:
2531 // Average of the generating function for reference flow <G[p][q]>:
2532 fReferenceFlowGenFun = new TProfile2D("fReferenceFlowGenFun","#LTG[p][q]#GT",pMax,0.,(Double_t)pMax,qMax,0.,(Double_t)qMax);
2533 fReferenceFlowGenFun->SetXTitle("p");
2534 fReferenceFlowGenFun->SetYTitle("q");
2535 fReferenceFlowProfiles->Add(fReferenceFlowGenFun);
2536 // Averages of Q-vector components:
2537 fQvectorComponents = new TProfile("fQvectorComponents","Averages of Q-vector components",4,0.,4.);
2538 fQvectorComponents->SetLabelSize(0.06);
2539 fQvectorComponents->SetMarkerStyle(25);
2540 fQvectorComponents->GetXaxis()->SetBinLabel(1,"#LTQ_{x}#GT"); // Q_{x}
2541 fQvectorComponents->GetXaxis()->SetBinLabel(2,"#LTQ_{y}#GT"); // Q_{y}
2542 fQvectorComponents->GetXaxis()->SetBinLabel(3,"#LTQ_{x}^{2}#GT"); // Q_{x}^{2}
2543 fQvectorComponents->GetXaxis()->SetBinLabel(4,"#LTQ_{y}^{2}#GT"); // Q_{y}^{2}
2544 fReferenceFlowProfiles->Add(fQvectorComponents);
2545 // <<w^2>>, where w = wPhi*wPt*wEta:
2546 fAverageOfSquaredWeight = new TProfile("fAverageOfSquaredWeight","#LT#LTw^{2}#GT#GT",1,0,1);
2547 fAverageOfSquaredWeight->SetLabelSize(0.06);
2548 fAverageOfSquaredWeight->SetMarkerStyle(25);
2549 fAverageOfSquaredWeight->SetLabelOffset(0.01);
2550 fAverageOfSquaredWeight->GetXaxis()->SetBinLabel(1,"#LT#LTw^{2}#GT#GT");
2551 fReferenceFlowProfiles->Add(fAverageOfSquaredWeight);
2553 // e) Book all histograms:
2554 // Final results for isotropic cumulants for reference flow:
2555 TString referenceFlowCumulantsName = "fReferenceFlowCumulants";
2556 fReferenceFlowCumulants = new TH1D(referenceFlowCumulantsName.Data(),"Isotropic Generating Function Cumulants for reference flow",4,0,4); // to be improved (hw 4)
2557 fReferenceFlowCumulants->SetLabelSize(0.05);
2558 fReferenceFlowCumulants->SetMarkerStyle(25);
2559 fReferenceFlowCumulants->GetXaxis()->SetBinLabel(1,"GFC{2}");
2560 fReferenceFlowCumulants->GetXaxis()->SetBinLabel(2,"GFC{4}");
2561 fReferenceFlowCumulants->GetXaxis()->SetBinLabel(3,"GFC{6}");
2562 fReferenceFlowCumulants->GetXaxis()->SetBinLabel(4,"GFC{8}");
2563 fReferenceFlowResults->Add(fReferenceFlowCumulants);
2564 // Final results for reference flow:
2565 fReferenceFlow = new TH1D("fReferenceFlow","Reference flow",4,0,4); // to be improved (hardwired 4)
2566 fReferenceFlow->SetLabelSize(0.05);
2567 fReferenceFlow->SetMarkerStyle(25);
2568 fReferenceFlow->GetXaxis()->SetBinLabel(1,"v_{n}{2,GFC}");
2569 fReferenceFlow->GetXaxis()->SetBinLabel(2,"v_{n}{4,GFC}");
2570 fReferenceFlow->GetXaxis()->SetBinLabel(3,"v_{n}{6,GFC}");
2571 fReferenceFlow->GetXaxis()->SetBinLabel(4,"v_{n}{8,GFC}");
2572 fReferenceFlowResults->Add(fReferenceFlow);
2573 // Final results for resolution:
2574 fChi = new TH1D("fChi","Resolution",4,0,4); // to be improved (hardwired 4)
2575 fChi->SetLabelSize(0.06);
2576 fChi->SetMarkerStyle(25);
2577 fChi->GetXaxis()->SetBinLabel(1,"#chi_{2}");
2578 fChi->GetXaxis()->SetBinLabel(2,"#chi_{4}");
2579 fChi->GetXaxis()->SetBinLabel(3,"#chi_{6}");
2580 fChi->GetXaxis()->SetBinLabel(4,"#chi_{8}");
2581 fReferenceFlowResults->Add(fChi);
2583 } // end of void AliFlowAnalysisWithCumulants::BookEverythingForReferenceFlow()
2585 //================================================================================================================
2587 void AliFlowAnalysisWithCumulants::BookEverythingForTuning()
2589 // Book all objects relevant for tuning.
2591 // a) Define pMax's and qMax's:
2592 // b) Book profile to hold all tuning parameters and flags;
2593 // c) Book all profiles;
2594 // d) Book all histograms.
2596 // a) Define pMax's and qMax's:
2597 Int_t pMax[5] = {2,3,4,5,8};
2598 Int_t qMax[5] = {5,7,9,11,17};
2600 // b) Book profile to hold all tuning parameters and flags:
2601 TString tuningFlagsName = "fTuningFlags";
2602 fTuningFlags = new TProfile(tuningFlagsName.Data(),"Tuning parameters",10,0,10);
2603 // fTuningFlags->SetTickLength(-0.01,"Y");
2604 fTuningFlags->SetMarkerStyle(25);
2605 fTuningFlags->SetLabelSize(0.05);
2606 fTuningFlags->SetLabelOffset(0.02,"X");
2607 for(Int_t r=1;r<=10;r++)
2609 fTuningFlags->GetXaxis()->SetBinLabel(r,Form("r_{0,%d}",r-1));
2610 fTuningFlags->Fill(r-0.5,fTuningR0[r-1],1.);
2612 fTuningList->Add(fTuningFlags);
2614 // c) Book all profiles:
2615 // Average of the generating function for reference flow <G[p][q]> for different tuning parameters:
2616 for(Int_t r=0;r<10;r++)
2618 for(Int_t pq=0;pq<5;pq++)
2620 fTuningGenFun[r][pq] = new TProfile2D(Form("fTuningGenFun (r_{0,%i}, pq set %i)",r,pq),
2621 Form("#LTG[p][q]#GT for r_{0} = %f, p_{max} = %i, q_{max} = %i",fTuningR0[r],pMax[pq],qMax[pq]),
2622 pMax[pq],0.,(Double_t)pMax[pq],qMax[pq],0.,(Double_t)qMax[pq]);
2623 fTuningGenFun[r][pq]->SetXTitle("p");
2624 fTuningGenFun[r][pq]->SetYTitle("q");
2625 fTuningProfiles->Add(fTuningGenFun[r][pq]);
2628 // Average multiplicities for events with nRPs >= cuttof:
2629 fTuningAvM = new TProfile("fTuningAvM","Average multiplicity",5,0,5);
2630 fTuningAvM->SetMarkerStyle(25);
2631 for(Int_t b=1;b<=5;b++)
2633 fTuningAvM->GetXaxis()->SetBinLabel(b,Form("nRP #geq %i",2*pMax[b-1]));
2635 fTuningProfiles->Add(fTuningAvM);
2637 // d) Book all histograms:
2638 // Final results for isotropic cumulants for reference flow for different tuning parameters:
2639 for(Int_t r=0;r<10;r++)
2641 for(Int_t pq=0;pq<5;pq++)
2643 fTuningCumulants[r][pq] = new TH1D(Form("fTuningCumulants (r_{0,%i}, pq set %i)",r,pq),
2644 Form("GFC for r_{0} = %f, p_{max} = %i, q_{max} = %i",fTuningR0[r],pMax[pq],qMax[pq]),
2645 pMax[pq],0,pMax[pq]);
2646 // fTuningCumulants[r][pq]->SetLabelSize(0.05);
2647 fTuningCumulants[r][pq]->SetMarkerStyle(25);
2648 for(Int_t b=1;b<=pMax[pq];b++)
2650 fTuningCumulants[r][pq]->GetXaxis()->SetBinLabel(b,Form("GFC{%i}",2*b));
2652 fTuningResults->Add(fTuningCumulants[r][pq]);
2655 // Final results for reference flow for different tuning parameters:
2656 for(Int_t r=0;r<10;r++)
2658 for(Int_t pq=0;pq<5;pq++)
2660 fTuningFlow[r][pq] = new TH1D(Form("fTuningFlow (r_{0,%i}, pq set %i)",r,pq),
2661 Form("Reference flow for r_{0} = %f, p_{max} = %i, q_{max} = %i",fTuningR0[r],pMax[pq],qMax[pq]),
2662 pMax[pq],0,pMax[pq]);
2663 // fTuningFlow[r][pq]->SetLabelSize(0.06);
2664 fTuningFlow[r][pq]->SetMarkerStyle(25);
2665 for(Int_t b=1;b<=pMax[pq];b++)
2667 fTuningFlow[r][pq]->GetXaxis()->SetBinLabel(b,Form("v{%i,GFC}",2*b));
2669 fTuningResults->Add(fTuningFlow[r][pq]);
2673 } // end of void AliFlowAnalysisWithCumulants::BookEverythingForTuning()
2675 //================================================================================================================
2677 void AliFlowAnalysisWithCumulants::BookEverythingForDiffFlow()
2679 // Book all objects relevant for calculation of differential flow.
2681 // a) Define static constants for array's boundaries;
2682 // b) Define local variables and local flags for booking;
2683 // c) Book profile to hold all flags for differential flow;
2684 // d) Book all event-by-event quantities;
2685 // e) Book all profiles;
2686 // f) Book all histograms.
2688 // a) Define static constants for array's boundaries:
2689 static const Int_t pMax = 5;
2690 static const Int_t qMax = 11;
2692 // b) Define local variables and local flags for booking:
2693 Int_t nBinsPtEta[2] = {fnBinsPt,fnBinsEta};
2694 Double_t minPtEta[2] = {fPtMin,fEtaMin};
2695 Double_t maxPtEta[2] = {fPtMax,fEtaMax};
2696 TString reIm[2] = {"Re","Im"};
2697 TString rpPoi[2] = {"RP","POI"};
2698 TString ptEta[2] = {"p_{t}","#eta"};
2699 TString order[4] = {"2nd order","4th order","6th order","8th order"};
2701 // c) Book profile to hold all flags for differential flow:
2702 TString diffFlowFlagsName = "fDiffFlowFlags";
2703 fDiffFlowFlags = new TProfile(diffFlowFlagsName.Data(),"Flags for Differential Flow",1,0,1);
2704 fDiffFlowFlags->SetTickLength(-0.01,"Y");
2705 fDiffFlowFlags->SetMarkerStyle(25);
2706 fDiffFlowFlags->SetLabelSize(0.05);
2707 fDiffFlowFlags->SetLabelOffset(0.02,"Y");
2708 fDiffFlowFlags->GetXaxis()->SetBinLabel(1,"...");
2709 fDiffFlowList->Add(fDiffFlowFlags);
2711 // d) Book all event-by-event quantities:
2712 // ... (to be improved - perhaps not needed)
2714 // e) Book all profiles:
2715 // Generating functions for differential flow:
2716 for(Int_t ri=0;ri<2;ri++)
2718 for(Int_t rp=0;rp<2;rp++)
2720 for(Int_t pe=0;pe<2;pe++)
2722 fDiffFlowGenFun[ri][rp][pe] = new TProfile3D(Form("fDiffFlowGenFun (%s, %s, %s)",reIm[ri].Data(),rpPoi[rp].Data(),ptEta[pe].Data()),
2723 Form("#LT%s[D[%s-bin][p][q]]#GT for %ss",reIm[ri].Data(),ptEta[pe].Data(),rpPoi[rp].Data()),
2724 nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe],pMax,0.,(Double_t)pMax,qMax,0.,(Double_t)qMax);
2725 fDiffFlowGenFun[ri][rp][pe]->SetXTitle(ptEta[pe].Data());
2726 fDiffFlowGenFun[ri][rp][pe]->SetYTitle("p");
2727 fDiffFlowGenFun[ri][rp][pe]->SetZTitle("q");
2728 fDiffFlowGenFun[ri][rp][pe]->SetTitleOffset(1.44,"X");
2729 fDiffFlowGenFun[ri][rp][pe]->SetTitleOffset(1.44,"Y");
2730 fDiffFlowProfiles->Add(fDiffFlowGenFun[ri][rp][pe]);
2731 // to be improved - alternative // nBinsPtEta[pe],(Double_t)(fPtMin/fPtBinWidth),(Double_t)(fPtMax/fPtBinWidth),pMax,0.,(Double_t)pMax,qMax,0.,(Double_t)qMax);
2735 // Number of particles in pt/eta bin for RPs/POIs:
2736 for(Int_t rp=0;rp<2;rp++)
2738 for(Int_t pe=0;pe<2;pe++)
2740 fNoOfParticlesInBin[rp][pe] = new TProfile(Form("fNoOfParticlesInBin (%s, %s)",rpPoi[rp].Data(),ptEta[pe].Data()),
2741 Form("Number of %ss per %s bin",rpPoi[rp].Data(),ptEta[pe].Data()),
2742 nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
2743 fNoOfParticlesInBin[rp][pe]->SetXTitle(ptEta[pe].Data());
2744 fDiffFlowProfiles->Add(fNoOfParticlesInBin[rp][pe]);
2747 // Differential cumulants per pt/eta bin for RPs/POIs:
2748 for(Int_t rp=0;rp<2;rp++)
2750 for(Int_t pe=0;pe<2;pe++)
2752 for(Int_t co=0;co<4;co++)
2754 fDiffFlowCumulants[rp][pe][co] = new TH1D(Form("fDiffFlowCumulants (%s, %s, %s)",rpPoi[rp].Data(),ptEta[pe].Data(),order[co].Data()),
2755 Form("Differential %s cumulant for %ss vs %s",order[co].Data(),rpPoi[rp].Data(),ptEta[pe].Data()),
2756 nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
2757 fDiffFlowCumulants[rp][pe][co]->SetXTitle(ptEta[pe].Data());
2758 fDiffFlowResults->Add(fDiffFlowCumulants[rp][pe][co]);
2762 // Differential flow 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 fDiffFlow[rp][pe][co] = new TH1D(Form("fDiffFlow (%s, %s, %s)",rpPoi[rp].Data(),ptEta[pe].Data(),order[co].Data()),
2770 Form("Differential flow from %s cumulant for %ss vs %s",order[co].Data(),rpPoi[rp].Data(),ptEta[pe].Data()),
2771 nBinsPtEta[pe],minPtEta[pe],maxPtEta[pe]);
2772 fDiffFlow[rp][pe][co]->SetXTitle(ptEta[pe].Data());
2773 fDiffFlowResults->Add(fDiffFlow[rp][pe][co]);
2778 }// end of void AliFlowAnalysisWithCumulants::BookEverythingForDiffFlow()
2780 //================================================================================================================
2782 void AliFlowAnalysisWithCumulants::StoreReferenceFlowFlags()
2784 // Store all flags for reference flow in profile fReferenceFlowFlags.
2786 if(!fReferenceFlowFlags)
2789 cout<<"WARNING: !fReferenceFlowFlags is NULL in AFAWC::SRFF() !!!!"<<endl;
2794 // Particle weights used or not:
2795 fReferenceFlowFlags->Fill(0.5,(Double_t)fUsePhiWeights||fUsePtWeights||fUseEtaWeights);
2796 // Which event weight was used to weight generating function event-by-event:
2797 if(strcmp(fMultiplicityWeight->Data(),"unit"))
2799 fReferenceFlowFlags->Fill(1.5,0.); // 0 = "unit" (default)
2800 } else if(strcmp(fMultiplicityWeight->Data(),"multiplicity"))
2802 fReferenceFlowFlags->Fill(1.5,1.); // 1 = "multiplicity"
2804 fReferenceFlowFlags->Fill(2.5,fCalculateVsMultiplicity); // evaluate vs M?
2806 } // end of void AliFlowAnalysisWithCumulants::StoreReferenceFlowFlags()
2808 //================================================================================================================
2810 void AliFlowAnalysisWithCumulants::StoreDiffFlowFlags()
2812 // Store all flags for differential flow in profile fDiffFlowFlags.
2817 cout<<"WARNING: !fDiffFlowFlags is NULL in AFAWC::SRFF() !!!!"<<endl;
2822 // fDiffFlags->Fill(0.5,(Double_t) ... );
2824 } // end of void AliFlowAnalysisWithCumulants::StoreDiffFlowFlags()
2826 //================================================================================================================
2828 void AliFlowAnalysisWithCumulants::BookAndNestAllLists()
2830 // Book and nest all list in base list fHistList.
2832 // a) Book and nest lists for reference flow;
2833 // b) Book and nest lists for differential flow;
2834 // c) Book and nest lists for tuning;
2835 // d) If used, nest list for particle weights.
2837 // a) Book and nest all lists for reference flow:
2838 fReferenceFlowList = new TList();
2839 fReferenceFlowList->SetName("Reference Flow");
2840 fReferenceFlowList->SetOwner(kTRUE);
2841 fHistList->Add(fReferenceFlowList);
2842 fReferenceFlowProfiles = new TList();
2843 fReferenceFlowProfiles->SetName("Profiles");
2844 fReferenceFlowProfiles->SetOwner(kTRUE);
2845 fReferenceFlowList->Add(fReferenceFlowProfiles);
2846 fReferenceFlowResults = new TList();
2847 fReferenceFlowResults->SetName("Results");
2848 fReferenceFlowResults->SetOwner(kTRUE);
2849 fReferenceFlowList->Add(fReferenceFlowResults);
2850 // b) Book and nest lists for differential flow:
2851 fDiffFlowList = new TList();
2852 fDiffFlowList->SetName("Differential Flow");
2853 fDiffFlowList->SetOwner(kTRUE);
2854 fHistList->Add(fDiffFlowList);
2855 fDiffFlowProfiles = new TList();
2856 fDiffFlowProfiles->SetName("Profiles");
2857 fDiffFlowProfiles->SetOwner(kTRUE);
2858 fDiffFlowList->Add(fDiffFlowProfiles);
2859 fDiffFlowResults = new TList();
2860 fDiffFlowResults->SetName("Results");
2861 fDiffFlowResults->SetOwner(kTRUE);
2862 fDiffFlowList->Add(fDiffFlowResults);
2863 // c) Book and nest lists for tuning:
2866 fTuningList = new TList();
2867 fTuningList->SetName("Tuning");
2868 fTuningList->SetOwner(kTRUE);
2869 fHistList->Add(fTuningList);
2870 fTuningProfiles = new TList();
2871 fTuningProfiles->SetName("Profiles");
2872 fTuningProfiles->SetOwner(kTRUE);
2873 fTuningList->Add(fTuningProfiles);
2874 fTuningResults = new TList();
2875 fTuningResults->SetName("Results");
2876 fTuningResults->SetOwner(kTRUE);
2877 fTuningList->Add(fTuningResults);
2880 // d) If used, nest list for particle weights.
2881 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
2883 // Remark: pointer to this list is coming from the macro, no need to "new" it.
2884 fWeightsList->SetName("Weights");
2885 fWeightsList->SetOwner(kTRUE);
2886 fHistList->Add(fWeightsList);
2889 } // end of void AliFlowAnalysisWithCumulants::BookAndNestAllLists()
2891 //================================================================================================================
2893 void AliFlowAnalysisWithCumulants::BookProfileHoldingSettings()
2895 // Book profile to hold all analysis settings.
2897 TString analysisSettingsName = "fAnalysisSettings";
2898 fAnalysisSettings = new TProfile(analysisSettingsName.Data(),"Settings for analysis with Generating Function Cumulants",11,0.,11.);
2899 fAnalysisSettings->GetXaxis()->SetLabelSize(0.035);
2900 fAnalysisSettings->GetXaxis()->SetBinLabel(1,"Harmonic");
2901 fAnalysisSettings->Fill(0.5,fHarmonic);
2902 fAnalysisSettings->GetXaxis()->SetBinLabel(2,"Multiple");
2903 fAnalysisSettings->Fill(1.5,fMultiple);
2904 fAnalysisSettings->GetXaxis()->SetBinLabel(3,"r_{0}");
2905 fAnalysisSettings->Fill(2.5,fR0);
2906 fAnalysisSettings->GetXaxis()->SetBinLabel(4,"Use w_{#phi}?");
2907 fAnalysisSettings->Fill(3.5,fUsePhiWeights);
2908 fAnalysisSettings->GetXaxis()->SetBinLabel(5,"Use w_{p_{t}}?");
2909 fAnalysisSettings->Fill(4.5,fUsePtWeights);
2910 fAnalysisSettings->GetXaxis()->SetBinLabel(6,"Use w_{#eta}?");
2911 fAnalysisSettings->Fill(5.5,fUsePhiWeights);
2912 fAnalysisSettings->GetXaxis()->SetBinLabel(7,"Tune parameters?");
2913 fAnalysisSettings->Fill(6.5,fTuneParameters);
2914 fAnalysisSettings->GetXaxis()->SetBinLabel(8,"Print RF results");
2915 fAnalysisSettings->Fill(7.5,fPrintFinalResults[0]);
2916 fAnalysisSettings->GetXaxis()->SetBinLabel(9,"Print RP results");
2917 fAnalysisSettings->Fill(8.5,fPrintFinalResults[1]);
2918 fAnalysisSettings->GetXaxis()->SetBinLabel(10,"Print POI results");
2919 fAnalysisSettings->Fill(9.5,fPrintFinalResults[2]);
2920 fAnalysisSettings->GetXaxis()->SetBinLabel(11,"Evaluate vs M?");
2921 fAnalysisSettings->Fill(10.5,fCalculateVsMultiplicity);
2922 fHistList->Add(fAnalysisSettings);
2924 } // end of void AliFlowAnalysisWithCumulants::BookProfileHoldingSettings()
2926 //================================================================================================================
2928 void AliFlowAnalysisWithCumulants::BookCommonHistograms()
2930 // Book common control histograms and common histograms for final results.
2932 // Common control histogram:
2933 TString commonHistsName = "AliFlowCommonHistGFC";
2934 fCommonHists = new AliFlowCommonHist(commonHistsName.Data());
2935 fHistList->Add(fCommonHists);
2936 // Common histograms for final results from 2nd order GFC:
2937 TString commonHistResults2ndOrderName = "AliFlowCommonHistResults2ndOrderGFC";
2938 fCommonHistsResults2nd = new AliFlowCommonHistResults(commonHistResults2ndOrderName.Data());
2939 fHistList->Add(fCommonHistsResults2nd);
2940 // Common histograms for final results from 4th order GFC:
2941 TString commonHistResults4thOrderName = "AliFlowCommonHistResults4thOrderGFC";
2942 fCommonHistsResults4th = new AliFlowCommonHistResults(commonHistResults4thOrderName.Data());
2943 fHistList->Add(fCommonHistsResults4th);
2944 // Common histograms for final results from 6th order GFC:
2945 TString commonHistResults6thOrderName = "AliFlowCommonHistResults6thOrderGFC";
2946 fCommonHistsResults6th = new AliFlowCommonHistResults(commonHistResults6thOrderName.Data());
2947 fHistList->Add(fCommonHistsResults6th);
2948 // Common histograms for final results from 8th order GFC:
2949 TString commonHistResults8thOrderName = "AliFlowCommonHistResults8thOrderGFC";
2950 fCommonHistsResults8th = new AliFlowCommonHistResults(commonHistResults8thOrderName.Data());
2951 fHistList->Add(fCommonHistsResults8th);
2953 } // end of void AliFlowAnalysisWithCumulants::BookCommonHistograms()
2955 //================================================================================================================
2957 void AliFlowAnalysisWithCumulants::CheckPointersUsedInMake()
2959 // Check pointers used in method Make().
2964 cout<<" WARNING (GFC): fCommonHists is NULL in CPUIM() !!!!"<<endl;
2968 if(fUsePhiWeights && !fPhiWeights)
2971 cout<<" WARNING (GFC): fPhiWeights is NULL in CPUIM() !!!!"<<endl;
2975 if(fUsePtWeights && !fPtWeights)
2978 cout<<" WARNING (GFC): fPtWeights is NULL in CPUIM() !!!!"<<endl;
2982 if(fUseEtaWeights && !fEtaWeights)
2985 cout<<" WARNING (GFC): fEtaWeights is NULL in CPUIM() !!!!"<<endl;
2989 if(!fAverageOfSquaredWeight)
2992 cout<<" WARNING (GFC): fAverageOfSquaredWeight is NULL in CPUIM() !!!!"<<endl;
2996 if(!fReferenceFlowGenFun)
2999 cout<<" WARNING (GFC): fReferenceFlowGenFun is NULL in CPUIM() !!!!"<<endl;
3003 if(!fQvectorComponents)
3006 cout<<" WARNING (GFC): fQvectorComponents is NULL in CPUIM() !!!!"<<endl;
3013 cout<<"WARNING (GFC): fGEBE is NULL in CPUIM() !!!!"<<endl;
3017 // Checking pointers for vs multiplicity calculation:
3018 if(fCalculateVsMultiplicity)
3020 if(!fReferenceFlowGenFunVsM)
3023 cout<<"WARNING (GFC): fReferenceFlowGenFunVsM is NULL in CPUIM() !!!!"<<endl;
3027 if(!fQvectorComponentsVsM)
3030 cout<<"WARNING (GFC): fQvectorComponentsVsM is NULL in CPUIM() !!!!"<<endl;
3034 if(!fAverageOfSquaredWeightVsM)
3037 cout<<"WARNING (GFC): fAverageOfSquaredWeightVsM is NULL in CPUIM() !!!!"<<endl;
3044 cout<<"WARNING (GFC): fAvMVsM is NULL in CPUIM() !!!!"<<endl;
3048 } // end of if(fCalculateVsMultiplicity)
3050 } // end of void AliFlowAnalysisWithCumulants::CheckPointersUsedInMake()
3052 //================================================================================================================
3054 void AliFlowAnalysisWithCumulants::CheckPointersUsedInFinish()
3056 // Check pointers used in method Finish().
3058 if(!fAnalysisSettings)
3061 cout<<" WARNING (GFC): fAnalysisSettings is NULL in CPUIF() !!!!"<<endl;
3065 if(!(fCommonHists && fCommonHists->GetHistMultRP()))
3068 cout<<" WARNING (GFC): (fCommonHists && fCommonHists->GetHistMultRP) is NULL in CPUIF() !!!!"<<endl;
3072 if(!fReferenceFlowGenFun)
3075 cout<<" WARNING (GFC): fReferenceFlowGenFun is NULL in CPUIF() !!!!"<<endl;
3079 if(!fReferenceFlowCumulants)
3082 cout<<" WARNING (GFC): fReferenceFlowCumulants is NULL in CPUIF() !!!!"<<endl;
3086 if(!fQvectorComponents)
3089 cout<<" WARNING (GFC): fQvectorComponents is NULL in CPUIF() !!!!"<<endl;
3093 if(!fAverageOfSquaredWeight)
3096 cout<<" WARNING (GFC): fAverageOfSquaredWeight is NULL in CPUIF() !!!!"<<endl;
3100 if(!(fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && fCommonHistsResults8th))
3103 cout<<" WARNING (GFC): fCommonHistsResults2nd && fCommonHistsResults4th && fCommonHistsResults6th && "<<endl;
3104 cout<<" fCommonHistsResults8th is NULL in CPUIF() !!!!"<<endl;
3111 cout<<" WARNING (GFC): fReferenceFlow is NULL in CPUIF() !!!!"<<endl;
3118 cout<<" WARNING (GFC): fChi is NULL in CPUIF() !!!!"<<endl;
3122 for(Int_t ri=0;ri<2;ri++)
3124 for(Int_t rp=0;rp<2;rp++)
3126 for(Int_t pe=0;pe<2;pe++)
3128 if(!fDiffFlowGenFun[ri][rp][pe])
3131 cout<<" WARNING (GFC): "<<Form("fDiffFlowGenFun[%d][%d][%d]",ri,rp,pe)<<" is NULL in CPUIF() !!!!"<<endl;
3138 for(Int_t rp=0;rp<2;rp++)
3140 for(Int_t pe=0;pe<2;pe++)
3142 for(Int_t co=0;co<4;co++)
3144 if(!fDiffFlowCumulants[rp][pe][co])
3147 cout<<" WARNING (GFC): "<<Form("fDiffFlowCumulants[%d][%d][%d]",rp,pe,co)<<" is NULL in CPUIF() !!!!"<<endl;
3151 if(!fDiffFlow[rp][pe][co])
3154 cout<<" WARNING (GFC): "<<Form("fDiffFlow[%d][%d][%d]",rp,pe,co)<<" is NULL in CPUIF() !!!!"<<endl;
3161 for(Int_t rp=0;rp<2;rp++)
3163 for(Int_t pe=0;pe<2;pe++)
3165 if(!fNoOfParticlesInBin[rp][pe])
3168 cout<<" WARNING (GFC): "<<Form("fNoOfParticlesInBin[%d][%d]",rp,pe)<<" is NULL in CPUIF() !!!!"<<endl;
3174 // Checking pointers for vs multiplicity calculation:
3175 if(fCalculateVsMultiplicity)
3177 if(!fReferenceFlowGenFunVsM)
3180 cout<<"WARNING (GFC): fReferenceFlowGenFunVsM is NULL in CPUIF() !!!!"<<endl;
3184 if(!fQvectorComponentsVsM)
3187 cout<<"WARNING (GFC): fQvectorComponentsVsM is NULL in CPUIF() !!!!"<<endl;
3191 if(!fAverageOfSquaredWeightVsM)
3194 cout<<"WARNING (GFC): fAverageOfSquaredWeightVsM is NULL in CPUIF() !!!!"<<endl;
3201 cout<<"WARNING (GFC): fAvMVsM is NULL in CPUIF() !!!!"<<endl;
3205 } // end of if(fCalculateVsMultiplicity)
3207 } // end of void AliFlowAnalysisWithCumulants::CheckPointersUsedInFinish()
3209 //================================================================================================================
3211 void AliFlowAnalysisWithCumulants::AccessSettings()
3213 // Access the settings for analysis with Generating Function Cumulants.
3215 fHarmonic = (Int_t)fAnalysisSettings->GetBinContent(1);
3216 fMultiple = (Int_t)fAnalysisSettings->GetBinContent(2);
3217 fR0 = (Double_t)fAnalysisSettings->GetBinContent(3);
3218 fUsePhiWeights = (Bool_t)fAnalysisSettings->GetBinContent(4);
3219 fUsePtWeights = (Bool_t)fAnalysisSettings->GetBinContent(5);
3220 fUseEtaWeights = (Bool_t)fAnalysisSettings->GetBinContent(6);
3221 fTuneParameters = (Bool_t)fAnalysisSettings->GetBinContent(7);
3222 fPrintFinalResults[0] = (Bool_t)fAnalysisSettings->GetBinContent(8);
3223 fPrintFinalResults[1] = (Bool_t)fAnalysisSettings->GetBinContent(9);
3224 fPrintFinalResults[2] = (Bool_t)fAnalysisSettings->GetBinContent(10);
3225 fCalculateVsMultiplicity = (Bool_t)fAnalysisSettings->GetBinContent(11);
3227 } // end of AliFlowAnalysisWithCumulants::AccessSettings()
3229 //================================================================================================================
3231 void AliFlowAnalysisWithCumulants::WriteHistograms(TString* outputFileName)
3233 // Store the final results in output .root file.
3235 TFile *output = new TFile(outputFileName->Data(),"RECREATE");
3236 //output->WriteObject(fHistList, "cobjGFC","SingleKey");
3237 fHistList->SetName("cobjGFC");
3238 fHistList->SetOwner(kTRUE);
3239 fHistList->Write(fHistList->GetName(), TObject::kSingleKey);
3242 } // end of void AliFlowAnalysisWithCumulants::WriteHistograms(TString* outputFileName)
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(TDirectoryFile *outputFileName)
3263 // Store the final results in output .root file.
3265 fHistList->SetName("cobjGFC");
3266 fHistList->SetOwner(kTRUE);
3267 outputFileName->Add(fHistList);
3268 outputFileName->Write(outputFileName->GetName(), TObject::kSingleKey);
3270 } // end of void AliFlowAnalysisWithCumulants::WriteHistograms(TDirectoryFile *outputFileName)
3272 //================================================================================================================