small bug fix
[u/mrichter/AliRoot.git] / PWG2 / FLOW / AliFlowCommon / AliFlowAnalysisWithFittingQDistribution.cxx
CommitLineData
ce4a88f5 1/*************************************************************************
2* Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *
3* *
4* Author: The ALICE Off-line Project. *
5* Contributors are mentioned in the code where appropriate. *
6* *
7* Permission to use, copy, modify and distribute this software and its *
8* documentation strictly for non-commercial purposes is hereby granted *
9* without fee, provided that the above copyright notice appears in all *
10* copies and that both the copyright notice and this permission notice *
11* appear in the supporting documentation. The authors make no claims *
12* about the suitability of this software for any purpose. It is *
13* provided "as is" without express or implied warranty. *
14**************************************************************************/
15
16/********************************
17 * integrated flow estimate by *
18 * fitting q-distribution *
19 * *
20 * author: Ante Bilandzic *
21 * (anteb@nikhef.nl) *
22 * *
23 * based on the macro written *
24 * by Sergei Voloshin *
25 *******************************/
26
27#define AliFlowAnalysisWithFittingQDistribution_cxx
28
29#include "Riostream.h"
30#include "AliFlowCommonConstants.h"
31#include "AliFlowCommonHist.h"
32#include "AliFlowCommonHistResults.h"
33#include "TChain.h"
34#include "TFile.h"
35#include "TList.h"
36#include "TF1.h"
ee0860e8 37#include "TLegend.h"
ce4a88f5 38#include "TParticle.h"
39#include "TProfile.h"
40#include "AliFlowEventSimple.h"
41#include "AliFlowTrackSimple.h"
42#include "AliFlowAnalysisWithFittingQDistribution.h"
43
44class TH1;
45class TGraph;
46class TPave;
47class TLatex;
48class TMarker;
49class TObjArray;
50class TList;
ce4a88f5 51class TSystem;
52class TROOT;
53class AliFlowVector;
54class TVector;
55
56//================================================================================================================
57
58ClassImp(AliFlowAnalysisWithFittingQDistribution)
59
60AliFlowAnalysisWithFittingQDistribution::AliFlowAnalysisWithFittingQDistribution():
61 fHistList(NULL),
62 fCommonHists(NULL),
63 fCommonHistsResults(NULL),
64 fnBinsPhi(0),
65 fPhiMin(0),
66 fPhiMax(0),
67 fPhiBinWidth(0),
68 fnBinsPt(0),
69 fPtMin(0),
70 fPtMax(0),
71 fPtBinWidth(0),
72 fnBinsEta(0),
73 fEtaMin(0),
74 fEtaMax(0),
75 fEtaBinWidth(0),
76 fHarmonic(2),
77 fAnalysisLabel(NULL),
78 fWeightsList(NULL),
79 fUsePhiWeights(kFALSE),
80 fUsePtWeights(kFALSE),
81 fUseEtaWeights(kFALSE),
82 fUseParticleWeights(NULL),
83 fPhiWeights(NULL),
84 fPtWeights(NULL),
ee0860e8 85 fEtaWeights(NULL),
47426051 86 // fitting parameters with default values harwired here (use dedicated macro fqd.C to change them):
ee0860e8 87 fFittingParameters(NULL),
88 fTreshold(5),
89 fvStart(0.05),
90 fvMin(0.0),
91 fvMax(0.25),
92 fSigma2Start(0.75),
47426051 93 fSigma2Min(0.5),
ee0860e8 94 fSigma2Max(2.5),
95 fPlotResults(kFALSE),
96 // rest:
97 fLegend(NULL)
ce4a88f5 98 {
99 // constructor
100
101 // base list to hold all output objects:
102 fHistList = new TList();
103 fHistList->SetName("cobjFQD");
104 fHistList->SetOwner(kTRUE);
105
106 // analysis label;
107 fAnalysisLabel = new TString();
108
109 // list to hold histograms with phi, pt and eta weights:
110 fWeightsList = new TList();
111
112 // initialize all arrays:
113 this->InitializeArrays();
114
115 } // end of constructor
116
117
118//================================================================================================================
119
120
121AliFlowAnalysisWithFittingQDistribution::~AliFlowAnalysisWithFittingQDistribution()
122{
123 // desctructor
124 delete fHistList;
125}
126
127
128//================================================================================================================
129
130
131void AliFlowAnalysisWithFittingQDistribution::Init()
132{
133 // access constants and book everything
134
135 // access constants:
136 this->AccessConstants();
137
138 // booking:
139 this->BookCommonHistograms();
140 this->BookAndFillWeightsHistograms();
141 this->BookEverythingForDistributions();
142
ee0860e8 143 // store fitting parameters:
144 this->StoreFittingParameters();
145
ce4a88f5 146 // nest lists:
147 fWeightsList->SetName("Weights");
148 fWeightsList->SetOwner(kTRUE);
149 fHistList->Add(fWeightsList);
150
151 // set harmonic in common control histograms (to be improved (should I do this somewhere else?)):
152 (fCommonHists->GetHarmonic())->Fill(0.5,fHarmonic);
153
154} // end of void AliFlowAnalysisWithFittingQDistribution::Init()
155
156
157//================================================================================================================
158
159
160void AliFlowAnalysisWithFittingQDistribution::Make(AliFlowEventSimple* anEvent)
161{
162 // loop over data
163
47426051 164 // a) fill the common control histograms;
165 // b) loop over data and calculate non-weighted and weighted Q-vector and sum of particle weights;
166 // c) fill histograms for q-distribution;
167 // d) reset e-b-e quantities.
ce4a88f5 168
47426051 169 // a) fill the common control histograms:
ce4a88f5 170 fCommonHists->FillControlHistograms(anEvent);
171
172 Double_t dPhi = 0.; // azimuthal angle in the laboratory frame
173 Double_t dPt = 0.; // transverse momentum
174 Double_t dEta = 0.; // pseudorapidity
175
176 Double_t wPhi = 1.; // phi weight
177 Double_t wPt = 1.; // pt weight
178 Double_t wEta = 1.; // eta weight
179
180 Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = total number of primary tracks, i.e. nPrim = nRP + nPOI + rest, where:
181 // nRP = # of particles used to determine the reaction plane;
182 // nPOI = # of particles of interest for a detailed flow analysis;
183 // rest = # of particles which are not niether RPs nor POIs.
184
185 Int_t n = fHarmonic; // shortcut for the harmonic
186
187 Double_t dReQ[2] = {0.}; // real part of Q-vector [0=particle weights not used, 1=particle weights used]
188 Double_t dImQ[2] = {0.}; // imaginary part of Q-vector [0=particle weights not used, 1=particle weights used]
47426051 189 Double_t dSumOfParticleWeights[2] = {0.}; // [0=particle weights not used, 1=particle weights used]
ce4a88f5 190
191 AliFlowTrackSimple *aftsTrack = NULL;
47426051 192
193 // b) loop over data and calculate non-weighted and weighted Q-vector and sum of particle weights:
ce4a88f5 194 for(Int_t i=0;i<nPrim;i++)
195 {
196 aftsTrack=anEvent->GetTrack(i);
197 if(aftsTrack)
198 {
199 if(!(aftsTrack->InRPSelection())) continue; // consider only tracks which are RPs
200
201 dPhi = aftsTrack->Phi();
202 dPt = aftsTrack->Pt();
203 dEta = aftsTrack->Eta();
204
205 if(fUsePhiWeights && fPhiWeights && fnBinsPhi) // determine phi weight for this particle:
206 {
207 wPhi = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*fnBinsPhi/TMath::TwoPi())));
208 }
209 if(fUsePtWeights && fPtWeights && fnBinsPt) // determine pt weight for this particle:
210 {
211 wPt = fPtWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/fPtBinWidth)));
212 }
213 if(fUseEtaWeights && fEtaWeights && fEtaBinWidth) // determine eta weight for this particle:
214 {
215 wEta = fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/fEtaBinWidth)));
216 }
217
218 // calculate real and imaginary part of non-weighted and weighted Q-vector and sum of particle weights for this event:
47426051 219 for(Int_t pW=0;pW<1+(Int_t)(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);pW++) // particle weights not used (0) or used (1)
ce4a88f5 220 {
221 // Q-vector:
222 dReQ[pW]+=pow(wPhi*wPt*wEta,pW)*TMath::Cos(n*dPhi);
223 dImQ[pW]+=pow(wPhi*wPt*wEta,pW)*TMath::Sin(n*dPhi);
224 // sum of particle weights:
47426051 225 dSumOfParticleWeights[pW] += pow(wPhi*wPt*wEta,pW); // if pW = 0, this sum gives # of RPs, i.e. multiplicity
ce4a88f5 226 }
227
228 } // end of if(aftsTrack)
229 } // end of for(Int_t i=0;i<nPrim;i++)
230
47426051 231 // c) fill histograms for q-distribution:
232 // calculating first q = Q\sqrt{sum of particle weights} (Remark: if particle weights are unit than sum of particle weights = multiplicity)
ce4a88f5 233 Double_t q=0;
47426051 234 for(Int_t pW=0;pW<1+(Int_t)(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);pW++) // particle weights not used (0) or used (1)
ce4a88f5 235 {
236 if(dSumOfParticleWeights[pW])
237 {
238 q = pow(dReQ[pW]*dReQ[pW]+dImQ[pW]*dImQ[pW],0.5)/pow(dSumOfParticleWeights[pW],0.5);
239 // fill histograms:
240 fqDistribution[pW]->Fill(q,1.);
241 fSumOfParticleWeights[pW]->Fill(dSumOfParticleWeights[pW],1.);
242 }
243 }
244
47426051 245 // d) reset e-b-e quantities:
246 for(Int_t pW=0;pW<1+(Int_t)(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);pW++) // particle weights not used (0) or used (1)
ce4a88f5 247 {
248 dReQ[pW] = 0.;
249 dImQ[pW] = 0.;
250 dSumOfParticleWeights[pW] = 0.;
251 }
252
47426051 253} // end of Make()
254
255
256//================================================================================================================
257
258
259void AliFlowAnalysisWithFittingQDistribution::Finish(Bool_t doFit)
260{
261 // calculate the final results
262
263 // a) acces the constants and all fitting paremeters;
264 // b) access the flags for particle weights;
265 // c) do final fit;
266 // d) fill common hist results;
267 // e) print on the screen the final results.
268
269 // a) access the constants and all fitting paremeters:
270 this->AccessConstants();
271 this->AccessFittingParameters();
272
273 // b) access the flags for particle weights:
274 fUsePhiWeights = (Bool_t)fUseParticleWeights->GetBinContent(1);
275 fUsePtWeights = (Bool_t)fUseParticleWeights->GetBinContent(2);
276 fUseEtaWeights = (Bool_t)fUseParticleWeights->GetBinContent(3);
277
278 // to be improved (moved somewhere else):
279 if(fPlotResults)
280 {
281 fLegend = new TLegend(0.6,0.55,0.85,0.7);
282 }
283
284 // c) do final fit:
285 if(doFit)
286 {
287 // particle weights not used:
288 // 1) sigma^2 not fitted (fixed to 0.5):
289 this->DoFit(kFALSE,kFALSE);
290 // 2) sigma^2 fitted:
291 this->DoFit(kFALSE,kTRUE);
292 // particle weights used:
293 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
294 {
295 // 1) sigma^2 not fitted (fixed to 0.5):
296 this->DoFit(kTRUE,kFALSE);
297 // 2) sigma^2 fitted:
298 this->DoFit(kTRUE,kTRUE);
299 }
300
301 // d) fill common hist results (by default fill results obtained with sigma^2 fitted):
302 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
303 {
304 this->FillCommonHistResultsIntFlow(kTRUE,kTRUE);
305 } else
306 {
307 this->FillCommonHistResultsIntFlow(kFALSE,kTRUE);
308 }
309
310 // e) print on the screen the final results:
311 this->PrintFinalResultsForIntegratedFlow();
312
313 } // end of if(doFit)
314
315} // end of void AliFlowAnalysisWithFittingQDistribution::Finish(Bool_t doFit)
ce4a88f5 316
317
318//================================================================================================================
319
320
321void AliFlowAnalysisWithFittingQDistribution::GetOutputHistograms(TList *outputListHistos)
322{
323 // get pointers to all output histograms (called before Finish())
324
325 if(outputListHistos)
326 {
327 // 1.) common control histograms and common histograms for final results:
328 TString commonHistName = "AliFlowCommonHistFQD";
329 commonHistName += fAnalysisLabel->Data();
330 AliFlowCommonHist *commonHist = dynamic_cast<AliFlowCommonHist*>(outputListHistos->FindObject(commonHistName.Data()));
331 if(commonHist) this->SetCommonHists(commonHist);
332
333 TString commonHistResName = "AliFlowCommonHistResultsFQD";
334 commonHistResName += fAnalysisLabel->Data();
335 AliFlowCommonHistResults *commonHistRes = dynamic_cast<AliFlowCommonHistResults*>
336 (outputListHistos->FindObject(commonHistResName.Data()));
337 if(commonHistRes) this->SetCommonHistsResults(commonHistRes);
338
339 // 2.) weights:
340 TList *weightsList = dynamic_cast<TList*>(outputListHistos->FindObject("Weights"));
341 if(weightsList) this->SetWeightsList(weightsList);
342 Bool_t bUsePhiWeights = kFALSE;
343 Bool_t bUsePtWeights = kFALSE;
344 Bool_t bUseEtaWeights = kFALSE;
345 TString fUseParticleWeightsName = "fUseParticleWeightsFQD";
346 fUseParticleWeightsName += fAnalysisLabel->Data();
347 TProfile *useParticleWeights = dynamic_cast<TProfile*>(weightsList->FindObject(fUseParticleWeightsName.Data()));
348 if(useParticleWeights)
349 {
350 this->SetUseParticleWeights(useParticleWeights);
351 bUsePhiWeights = (Int_t)useParticleWeights->GetBinContent(1);
352 bUsePtWeights = (Int_t)useParticleWeights->GetBinContent(2);
353 bUseEtaWeights = (Int_t)useParticleWeights->GetBinContent(3);
354 }
355
356 // 3.) distributions and 4.) final results of fitting:
357 TString pWeightsFlag[2] = {"pWeights not used","pWeights used"};
97ab16dd 358 TString sigmaFlag[2] = {"#sigma^{2} not fitted","#sigma^{2} fitted"};
ce4a88f5 359
360 // q-distribution:
361 TString qDistributionName = "fqDistribution";
362 qDistributionName += fAnalysisLabel->Data();
363 // sum of particle weights:
364 TString sumOfParticleWeightsName = "fSumOfParticleWeightsName";
365 sumOfParticleWeightsName += fAnalysisLabel->Data();
366 // final results for integrated flow:
367 TString intFlowName = "fIntFlowFQD";
368 intFlowName += fAnalysisLabel->Data();
369 // sigma^2:
370 TString sigma2Name = "fSigma2";
371 sigma2Name += fAnalysisLabel->Data();
97ab16dd 372 // chi^2:
373 TString chi2Name = "fChi2";
374 chi2Name += fAnalysisLabel->Data();
ce4a88f5 375
376 TH1D *qDistribution[2] = {NULL};
377 TH1D *sumOfParticleWeights[2] = {NULL};
378 TH1D *intFlow[2][2] = {{NULL}};
379 TH1D *sigma2[2][2] = {{NULL}};
97ab16dd 380 TH1D *chi2[2][2] = {{NULL}};
ce4a88f5 381
382 for(Int_t pW=0;pW<1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights);pW++)
383 {
384 // q-distribution:
385 qDistribution[pW] = dynamic_cast<TH1D*>(outputListHistos->FindObject(Form("%s, %s",qDistributionName.Data(),pWeightsFlag[pW].Data())));
386 if(qDistribution[pW])
387 {
388 this->SetqDistribution(qDistribution[pW],pW);
389 } else
390 {
391 cout<<"WARNING: qDistribution[pW] is NULL in AFAWFQD::GOH() !!!!"<<endl;
392 cout<<"pW = "<<pW<<endl;
393 }
394 // sum of particle weights:
395 sumOfParticleWeights[pW] = dynamic_cast<TH1D*>(outputListHistos->FindObject(Form("%s, %s",sumOfParticleWeightsName.Data(),pWeightsFlag[pW].Data())));
396 if(sumOfParticleWeights[pW])
397 {
398 this->SetSumOfParticleWeights(sumOfParticleWeights[pW],pW);
399 } else
400 {
401 cout<<"WARNING: sumOfParticleWeights[pW] is NULL in AFAWFQD::GOH() !!!!"<<endl;
402 cout<<"pW = "<<pW<<endl;
403 }
404 // final results:
405 for(Int_t f=0;f<2;f++)
406 {
407 // final results for integrated flow:
408 intFlow[pW][f] = dynamic_cast<TH1D*>(outputListHistos->FindObject(Form("%s, %s, %s",intFlowName.Data(),pWeightsFlag[pW].Data(),sigmaFlag[f].Data())));
409 if(intFlow[pW][f])
410 {
411 this->SetIntFlow(intFlow[pW][f],pW,f);
412 } else
413 {
414 cout<<"WARNING: intFlow[pW][f] is NULL in AFAWFQD::GOH() !!!!"<<endl;
415 cout<<"pW = "<<pW<<endl;
416 cout<<"f = "<<f<<endl;
417 }
418 // sigma^2:
419 sigma2[pW][f] = dynamic_cast<TH1D*>(outputListHistos->FindObject(Form("%s, %s, %s",sigma2Name.Data(),pWeightsFlag[pW].Data(),sigmaFlag[f].Data())));
420 if(sigma2[pW][f])
421 {
422 this->SetSigma2(sigma2[pW][f],pW,f);
423 } else
424 {
425 cout<<"WARNING: sigma2[pW][f] is NULL in AFAWFQD::GOH() !!!!"<<endl;
426 cout<<"pW = "<<pW<<endl;
427 cout<<"f = "<<f<<endl;
428 }
97ab16dd 429 // chi^2:
430 chi2[pW][f] = dynamic_cast<TH1D*>(outputListHistos->FindObject(Form("%s, %s, %s",chi2Name.Data(),pWeightsFlag[pW].Data(),sigmaFlag[f].Data())));
431 if(chi2[pW][f])
432 {
433 this->SetChi2(chi2[pW][f],pW,f);
434 } else
435 {
436 cout<<"WARNING: chi2[pW][f] is NULL in AFAWFQD::GOH() !!!!"<<endl;
437 cout<<"pW = "<<pW<<endl;
438 cout<<"f = "<<f<<endl;
439 }
440
ce4a88f5 441 } // end of for(Int_t f=0;f<2;f++)
442 } // end of for(Int_t pW=0;pW<1+(Int_t)(bUsePhiWeights||bUsePtWeights||bUseEtaWeights);pW++)
ee0860e8 443
444 // 5.) fitting parameters:
445 // q-distribution:
446 TString fittingParametersName = "fFittingParameters";
447 fittingParametersName += fAnalysisLabel->Data();
448 TProfile *fittingParameters = NULL;
449 fittingParameters = dynamic_cast<TProfile*>(outputListHistos->FindObject(fittingParametersName.Data()));
450 if(fittingParameters)
451 {
452 this->SetFittingParameters(fittingParameters);
453 } else
454 {
455 cout<<"WARNING:fittingParameters is NULL in AFAWFQD::GOH() !!!!"<<endl;
456 }
457
ce4a88f5 458 } else // to if(outputListHistos)
459 {
460 cout<<"WARNING: outputListHistos is NULL in AFAWFQD::GOH() !!!!"<<endl;
461 exit(0);
462 }
ee0860e8 463
ce4a88f5 464
465} // end of void AliFlowAnalysisWithFittingQDistribution::GetOutputHistograms(TList *outputListHistos)
466
467
468//================================================================================================================
469
470
ce4a88f5 471void AliFlowAnalysisWithFittingQDistribution::WriteHistograms(TString* outputFileName)
472{
473 //store the final results in output .root file
474 TFile *output = new TFile(outputFileName->Data(),"RECREATE");
475 //output->WriteObject(fHistList, "cobjFQD","SingleKey");
476 fHistList->SetName("cobjFQD");
477 fHistList->SetOwner(kTRUE);
478 fHistList->Write(fHistList->GetName(), TObject::kSingleKey);
479 delete output;
480}
481
482//================================================================================================================
483
484void AliFlowAnalysisWithFittingQDistribution::WriteHistograms(TString outputFileName)
485{
486 //store the final results in output .root file
487 TFile *output = new TFile(outputFileName.Data(),"RECREATE");
488 //output->WriteObject(fHistList, "cobjFQD","SingleKey");
489 fHistList->SetName("cobjFQD");
490 fHistList->SetOwner(kTRUE);
491 fHistList->Write(fHistList->GetName(), TObject::kSingleKey);
492 delete output;
493}
494
495
496//================================================================================================================
497
498
499void AliFlowAnalysisWithFittingQDistribution::InitializeArrays()
500{
501 // initialize all arrays
502
47426051 503 for(Int_t pW=0;pW<2;pW++) // particle weights not used (0) or used (1)
ce4a88f5 504 {
505 fSumOfParticleWeights[pW] = NULL;
506 fqDistribution[pW] = NULL;
97ab16dd 507 for(Int_t f=0;f<2;f++) // sigma^2 not fitted (0) or fitted (1)
ce4a88f5 508 {
509 fIntFlow[pW][f] = NULL;
510 fSigma2[pW][f] = NULL;
97ab16dd 511 fChi2[pW][f] = NULL;
ce4a88f5 512 }
513 }
514
515} // end of void AliFlowAnalysisWithFittingQDistribution::InitializeArrays()
516
517
518//================================================================================================================
519
520
521void AliFlowAnalysisWithFittingQDistribution::BookCommonHistograms()
522{
523 // book common histograms
524
525 // common control histogram:
526 TString commonHistName = "AliFlowCommonHistFQD";
527 commonHistName += fAnalysisLabel->Data();
528 fCommonHists = new AliFlowCommonHist(commonHistName.Data());
529 fHistList->Add(fCommonHists);
530
531 // common histograms for final results:
532 TString commonHistResName = "AliFlowCommonHistResultsFQD";
533 commonHistResName += fAnalysisLabel->Data();
534 fCommonHistsResults = new AliFlowCommonHistResults(commonHistResName.Data());
535 fHistList->Add(fCommonHistsResults);
536
47426051 537} // end of void AliFlowAnalysisWithFittingQDistribution::BookCommonHistograms()
ce4a88f5 538
539
540//================================================================================================================
541
542
543void AliFlowAnalysisWithFittingQDistribution::BookAndFillWeightsHistograms()
544{
545 // book and fill histograms which hold phi, pt and eta weights
546
547 if(!fWeightsList)
548 {
549 cout<<"WARNING: fWeightsList is NULL in AFAWFQD::BAFWH() !!!!"<<endl;
550 exit(0);
551 }
552
553 TString fUseParticleWeightsName = "fUseParticleWeightsFQD";
554 fUseParticleWeightsName += fAnalysisLabel->Data();
555 fUseParticleWeights = new TProfile(fUseParticleWeightsName.Data(),"0 = particle weight not used, 1 = particle weight used ",3,0,3);
47426051 556 fUseParticleWeights->SetLabelSize(0.08);
ce4a88f5 557 (fUseParticleWeights->GetXaxis())->SetBinLabel(1,"w_{#phi}");
558 (fUseParticleWeights->GetXaxis())->SetBinLabel(2,"w_{p_{T}}");
559 (fUseParticleWeights->GetXaxis())->SetBinLabel(3,"w_{#eta}");
560 fUseParticleWeights->Fill(0.5,(Int_t)fUsePhiWeights);
561 fUseParticleWeights->Fill(1.5,(Int_t)fUsePtWeights);
562 fUseParticleWeights->Fill(2.5,(Int_t)fUseEtaWeights);
563 fWeightsList->Add(fUseParticleWeights);
564
565 if(fUsePhiWeights)
566 {
567 if(fWeightsList->FindObject("phi_weights"))
568 {
569 fPhiWeights = dynamic_cast<TH1F*>(fWeightsList->FindObject("phi_weights"));
570 if(fPhiWeights->GetBinWidth(1) != fPhiBinWidth)
571 {
572 cout<<"WARNING: fPhiWeights->GetBinWidth(1) != fPhiBinWidth in AFAWFQD::BAFWH() !!!! "<<endl;
573 cout<<" This indicates inconsistent binning in phi histograms throughout the code."<<endl;
574 exit(0);
575 }
576 } else
577 {
578 cout<<"WARNING: fWeightsList->FindObject(\"phi_weights\") is NULL in AFAWFQD::BAFWH() !!!!"<<endl;
579 exit(0);
580 }
581 } // end of if(fUsePhiWeights)
582
583 if(fUsePtWeights)
584 {
585 if(fWeightsList->FindObject("pt_weights"))
586 {
587 fPtWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("pt_weights"));
588 if(fPtWeights->GetBinWidth(1) != fPtBinWidth)
589 {
590 cout<<"WARNING: fPtWeights->GetBinWidth(1) != fPtBinWidth in AFAWFQD::BAFWH() !!!! "<<endl;
591 cout<<" This indicates insconsistent binning in pt histograms throughout the code."<<endl;
592 exit(0);
593 }
594 } else
595 {
596 cout<<"WARNING: fWeightsList->FindObject(\"pt_weights\") is NULL in AFAWFQD::BAFWH() !!!!"<<endl;
597 exit(0);
598 }
599 } // end of if(fUsePtWeights)
600
601 if(fUseEtaWeights)
602 {
603 if(fWeightsList->FindObject("eta_weights"))
604 {
605 fEtaWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("eta_weights"));
606 if(fEtaWeights->GetBinWidth(1) != fEtaBinWidth)
607 {
608 cout<<"WARNING: fEtaWeights->GetBinWidth(1) != fEtaBinWidth in AFAWFQD::BAFWH() !!!! "<<endl;
609 cout<<" This indicates insconsistent binning in eta histograms throughout the code."<<endl;
610 exit(0);
611 }
612 } else
613 {
614 cout<<"WARNING: fUseEtaWeights && fWeightsList->FindObject(\"eta_weights\") is NULL in AFAWFQD::BAFWH() !!!!"<<endl;
615 exit(0);
616 }
617 } // end of if(fUseEtaWeights)
618
619} // end of AliFlowAnalysisWithFittingQDistribution::BookAndFillWeightsHistograms()
620
621
622//================================================================================================================================
623
624
625void AliFlowAnalysisWithFittingQDistribution::AccessConstants()
626{
627 // access needed common constants from AliFlowCommonConstants
628
629 fnBinsPhi = AliFlowCommonConstants::GetNbinsPhi();
630 fPhiMin = AliFlowCommonConstants::GetPhiMin();
631 fPhiMax = AliFlowCommonConstants::GetPhiMax();
632 if(fnBinsPhi) fPhiBinWidth = (fPhiMax-fPhiMin)/fnBinsPhi;
633 fnBinsPt = AliFlowCommonConstants::GetNbinsPt();
634 fPtMin = AliFlowCommonConstants::GetPtMin();
635 fPtMax = AliFlowCommonConstants::GetPtMax();
636 if(fnBinsPt) fPtBinWidth = (fPtMax-fPtMin)/fnBinsPt;
637 fnBinsEta = AliFlowCommonConstants::GetNbinsEta();
638 fEtaMin = AliFlowCommonConstants::GetEtaMin();
639 fEtaMax = AliFlowCommonConstants::GetEtaMax();
640 if(fnBinsEta) fEtaBinWidth = (fEtaMax-fEtaMin)/fnBinsEta;
641
642} // end of void AliFlowAnalysisWithFittingQDistribution::AccessConstants()
643
644
645//================================================================================================================================
646
647
648void AliFlowAnalysisWithFittingQDistribution::BookEverythingForDistributions()
649{
650 // book histograms for distributions
651
652 TString pWeightsFlag[2] = {"pWeights not used","pWeights used"};
97ab16dd 653 TString sigmaFlag[2] = {"#sigma^{2} not fitted","#sigma^{2} fitted"};
ce4a88f5 654 // q-distribution:
655 TString fqDistributionName = "fqDistribution";
656 fqDistributionName += fAnalysisLabel->Data();
657 // sum of particle weights:
658 TString fSumOfParticleWeightsName = "fSumOfParticleWeightsName";
659 fSumOfParticleWeightsName += fAnalysisLabel->Data();
660 // final results for integrated flow:
661 TString fIntFlowName = "fIntFlowFQD";
662 fIntFlowName += fAnalysisLabel->Data();
663 // sigma^2:
664 TString fSigma2Name = "fSigma2";
665 fSigma2Name += fAnalysisLabel->Data();
97ab16dd 666 // chi^2:
667 TString fChi2Name = "fChi2";
668 fChi2Name += fAnalysisLabel->Data();
ce4a88f5 669
47426051 670 for(Int_t pW=0;pW<1+(Int_t)(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);pW++) // particle weights not used (0) or used (1)
ce4a88f5 671 {
672 // q-distribution:
673 fqDistribution[pW] = new TH1D(Form("%s, %s",fqDistributionName.Data(),pWeightsFlag[pW].Data()),"q-distribution",10000,0,1000);
674 fqDistribution[pW]->SetXTitle("q_{n}=Q_{n}/#sqrt{M}");
675 fqDistribution[pW]->SetYTitle("Counts");
676 fHistList->Add(fqDistribution[pW]);
677 // sum of particle weights:
47426051 678 fSumOfParticleWeights[pW] = new TH1D(Form("%s, %s",fSumOfParticleWeightsName.Data(),pWeightsFlag[pW].Data()),"Sum of particle weights",10000,0,10000);
ce4a88f5 679 fSumOfParticleWeights[pW]->SetXTitle("#sum_{i=1}^{N} w_{i}");
680 fSumOfParticleWeights[pW]->SetYTitle("Counts");
681 fHistList->Add(fSumOfParticleWeights[pW]);
682
97ab16dd 683 for(Int_t f=0;f<2;f++) // sigma^2 not fitted (0) or fitted (1)
ce4a88f5 684 {
685 // final results for integrated flow:
686 fIntFlow[pW][f] = new TH1D(Form("%s, %s, %s",fIntFlowName.Data(),pWeightsFlag[pW].Data(),sigmaFlag[f].Data()),"Integrated Flow",1,0,1);
687 fIntFlow[pW][f]->SetLabelSize(0.08);
688 (fIntFlow[pW][f]->GetXaxis())->SetBinLabel(1,"v_{n}");
689 fHistList->Add(fIntFlow[pW][f]);
690 // sigma^2:
691 fSigma2[pW][f] = new TH1D(Form("%s, %s, %s",fSigma2Name.Data(),pWeightsFlag[pW].Data(),sigmaFlag[f].Data()),"#sigma^{2}",1,0,1);
692 fSigma2[pW][f]->SetLabelSize(0.08);
693 (fSigma2[pW][f]->GetXaxis())->SetBinLabel(1,"#sigma^{2}");
694 fHistList->Add(fSigma2[pW][f]);
97ab16dd 695 // chi^2:
47426051 696 fChi2[pW][f] = new TH1D(Form("%s, %s, %s",fChi2Name.Data(),pWeightsFlag[pW].Data(),sigmaFlag[f].Data()),"#chi^{2} (Minuit)",1,0,1);
97ab16dd 697 fChi2[pW][f]->SetLabelSize(0.08);
698 (fChi2[pW][f]->GetXaxis())->SetLabelOffset(0.01);
699 (fChi2[pW][f]->GetXaxis())->SetBinLabel(1,"#chi^{2}");
700 fHistList->Add(fChi2[pW][f]);
47426051 701 } // end of for(Int_t f=0;f<2;f++) // sigma^2 not fitted or fitted
ce4a88f5 702
47426051 703 } // end of for(Int_t pW=0;pW<1+(Int_t)(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);pW++) // particle weights not used (0) or used (1)
ce4a88f5 704
47426051 705 // book profile fFittingParameters which will hold all fitting parameters:
ee0860e8 706 TString fFittingParametersName = "fFittingParameters";
707 fFittingParametersName += fAnalysisLabel->Data();
708 fFittingParameters = new TProfile(fFittingParametersName.Data(),"Parameters for fitting q-distribution",8,0,8);
709 fFittingParameters->SetLabelSize(0.05);
47426051 710 (fFittingParameters->GetXaxis())->SetBinLabel(1,"treshold");
ee0860e8 711 (fFittingParameters->GetXaxis())->SetBinLabel(2,"starting v_{n}");
712 (fFittingParameters->GetXaxis())->SetBinLabel(3,"min. v_{n}");
713 (fFittingParameters->GetXaxis())->SetBinLabel(4,"max. v_{n}");
714 (fFittingParameters->GetXaxis())->SetBinLabel(5,"starting #sigma^{2}");
715 (fFittingParameters->GetXaxis())->SetBinLabel(6,"min. #sigma^{2}");
716 (fFittingParameters->GetXaxis())->SetBinLabel(7,"max. #sigma^{2}");
717 (fFittingParameters->GetXaxis())->SetBinLabel(8,"plot or not?");
718 fHistList->Add(fFittingParameters);
719
ce4a88f5 720} // end of void AliFlowAnalysisWithFittingQDistribution::BookEverythingForDistributions()
721
722
723//================================================================================================================================
724
725
97ab16dd 726void AliFlowAnalysisWithFittingQDistribution::DoFit(Bool_t useParticleWeights, Bool_t sigma2Fitted)
ce4a88f5 727{
47426051 728 // do final fit for q-distribution
ce4a88f5 729
730 // shortcuts for flags:
731 Int_t pW = (Int_t)(useParticleWeights);
97ab16dd 732 Int_t s2F = (Int_t)(sigma2Fitted);
ce4a88f5 733
47426051 734 if(!(fqDistribution[pW] && fSumOfParticleWeights[pW] && fIntFlow[pW][s2F] && fSigma2[pW][s2F] && fChi2[pW][s2F]))
735 {
736 cout<<"WARNING: fqDistribution[pW] && fSumOfParticleWeights[pW] && fIntFlow[pW][s2F] && fSigma2[pW][s2F] && fChi2[pW][s2F] is NULL in AFAWFQD::DoFit() !!!!"<<endl;
737 cout<<"pW = "<<pW<<endl;
738 cout<<"s2F = "<<s2F<<endl;
739 exit(0);
ce4a88f5 740 }
741
742 // average multiplicity and number of events:
743 Double_t AvM = fSumOfParticleWeights[pW]->GetMean(1);
744 //Int_t nEvts = (Int_t)fSumOfParticleWeights[pW]->GetEntries();
745
47426051 746 // start fitting from the bin with at least fTreshold entries,
747 // finish fitting at the bin with at least fTreshold entries:
748 Int_t binMin = fqDistribution[pW]->FindFirstBinAbove(fTreshold);
749 Int_t binMax = fqDistribution[pW]->FindLastBinAbove(fTreshold);
ce4a88f5 750 Double_t binWidth = fqDistribution[pW]->GetBinWidth(4); // assuming that all bins have the same width
751 if(binWidth == 0)
752 {
753 cout<<"WARNING: binWidth == 0 in AFAWFQD::DoFit()"<<endl;
754 exit(0);
755 }
756 Double_t qmin = (binMin-1)*binWidth;
757 Double_t qmax = (binMax)*binWidth;
758 Double_t ent = 0.; // number of entries between binMin and binMax:
759 for(Int_t b=binMin;b<=binMax;b++)
760 {
761 ent += fqDistribution[pW]->GetBinContent(b);
762 }
763 Double_t norm = binWidth*ent; // norm (assuming that all bins have the same width)
764
765 // fitting function:
766 TF1 *fittingFun = new TF1("fittingFun","[2]*(x/[1])*exp(-(x*x+[0]*[0])/(2.*[1]))*TMath::BesselI0(x*[0]/[1])",qmin,qmax);
767
768 fittingFun->SetParNames("v*sqrt{sum of particle weights}","sigma^2","norm");
47426051 769 fittingFun->SetParameters(fvStart*pow(AvM,0.5),fSigma2Start,norm);
770 fittingFun->SetParLimits(0,fvMin*pow(AvM,0.5),fvMax*pow(AvM,0.5));
ee0860e8 771
97ab16dd 772 if(s2F == 0)
ce4a88f5 773 {
97ab16dd 774 fittingFun->FixParameter(1,0.5);
ce4a88f5 775 } else
776 {
47426051 777 fittingFun->SetParLimits(1,fSigma2Min,fSigma2Max);
ce4a88f5 778 }
779 fittingFun->FixParameter(2,norm);
780
781 // fitting (do it only if # of entries >50): // to be improved (this is only a pragmatics fix to avoid TMinuit crash)
782 if(ent > 50)
783 {
784 fqDistribution[pW]->Fit("fittingFun","NQ","",qmin,qmax);
785 }
786 // results:
787 Double_t v = 0.; // integrated flow
788 Double_t vError = 0.; // error of integrated flow
789 Double_t sigma2 = 0.; // sigma^2
790 Double_t sigma2Error = 0.; // error of sigma^2
97ab16dd 791 Double_t chi2 = 0; // chi^2 from Minuit
ce4a88f5 792
793 if(AvM)
794 {
47426051 795 // integrated flow:
ce4a88f5 796 v = fittingFun->GetParameter(0)/pow(AvM,0.5);
797 vError = fittingFun->GetParError(0)/pow(AvM,0.5);
47426051 798 fIntFlow[pW][s2F]->SetBinContent(1,v); // s2F is shortcut for "sigma^2 fitted"
799 fIntFlow[pW][s2F]->SetBinError(1,vError); // s2F is shortcut for "sigma^2 fitted"
ce4a88f5 800 }
97ab16dd 801
802 if(s2F == 0) // sigma^2 not fitted, but fixed to 0.5
ce4a88f5 803 {
97ab16dd 804 // sigma^2:
805 sigma2 = 0.5;
ce4a88f5 806 fSigma2[pW][0]->SetBinContent(1,sigma2);
97ab16dd 807 fSigma2[pW][0]->SetBinError(1,0.);
808 // chi^2:
809 chi2 = fittingFun->GetChisquare();
810 fChi2[pW][0]->SetBinContent(1,chi2);
47426051 811 //fChi2[pW][0]->SetBinError(1,0.);
97ab16dd 812 } else // sigma^2 fitted
ce4a88f5 813 {
97ab16dd 814 // sigma^2:
815 sigma2 = fittingFun->GetParameter(1);
816 sigma2Error = fittingFun->GetParError(1);
ee0860e8 817 fSigma2[pW][1]->SetBinContent(1,sigma2);
97ab16dd 818 fSigma2[pW][1]->SetBinError(1,sigma2Error);
819 // chi^2:
820 chi2 = fittingFun->GetChisquare();
821 fChi2[pW][1]->SetBinContent(1,chi2);
47426051 822 //fChi2[pW][1]->SetBinError(1,0.);
ce4a88f5 823 }
824
47426051 825 if(fPlotResults && !(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)) // to be improved (plot also the plot when particle weights are used)
ee0860e8 826 {
47426051 827 // set ranges: // to be improved (there is certainly a better way to implement this)
97ab16dd 828 Int_t firstNonEmptyBin = fqDistribution[pW]->FindFirstBinAbove(0);
829 Double_t lowRange = fqDistribution[pW]->GetBinLowEdge(firstNonEmptyBin);
830 Int_t lastNonEmptyBin = fqDistribution[pW]->FindLastBinAbove(0);
831 Double_t upperRange = fqDistribution[pW]->GetBinLowEdge(lastNonEmptyBin+10);
832 (fqDistribution[pW]->GetXaxis())->SetRangeUser(lowRange,upperRange);
833
834 if(s2F == 0)
ee0860e8 835 {
47426051 836 // to be improved (there is certainly a better way to implement this)
ee0860e8 837 fqDistribution[pW]->SetFillColor(16);
838 fqDistribution[pW]->SetTitle("Fitted q-distribution");
839 fqDistribution[pW]->Draw("");
97ab16dd 840 fLegend->AddEntry(fqDistribution[pW],"q-distribution","f");
841 TF1 *fittingFunTemp = (TF1*)fittingFun->Clone("fittingFunTemp");
842 fittingFunTemp->SetLineColor(4); // 4 = blue color
843 fittingFunTemp->Draw("SAME");
844 fLegend->AddEntry("fittingFunTemp","#sigma^{2} fixed","l");
845 fLegend->Draw("SAME");
ee0860e8 846 } else
97ab16dd 847 {
848 fittingFun->SetLineColor(2); // 2 = red color
849 fittingFun->Draw("SAME");
850 fLegend->AddEntry("fittingFun","#sigma^{2} fitted","l");
ee0860e8 851 }
852 } // end of if(fPlotResults)
853
ce4a88f5 854} // end of void AliFlowAnalysisWithFittingQDistribution::DoFit(Bool_t useParticleWeights)
855
856
857//================================================================================================================================
858
859
97ab16dd 860void AliFlowAnalysisWithFittingQDistribution::FillCommonHistResultsIntFlow(Bool_t useParticleWeights, Bool_t sigma2Fitted)
ce4a88f5 861{
862 // fill in AliFlowCommonHistResults histograms relevant for 'NONAME' integrated flow (to be improved (name))
863
864 // shortcuts for the flags:
47426051 865 Int_t pW = (Int_t)(useParticleWeights); // particle weights not used (0) or used (1)
97ab16dd 866 Int_t s2F = (Int_t)(sigma2Fitted); // 0 = sigma^2 not fitted (but fixed to 0.5), 1 = sigma^2 fitted
ce4a88f5 867
97ab16dd 868 if(!fIntFlow[pW][s2F])
ce4a88f5 869 {
97ab16dd 870 cout<<"WARNING: fIntFlow[pW][s2F] is NULL in AFAWFQD::FCHRIF() !!!!"<<endl;
871 cout<<"pW = "<<pW<<endl;
872 cout<<"s2F = "<<s2F<<endl;
ce4a88f5 873 exit(0);
874 }
875
ee0860e8 876 if(!fSumOfParticleWeights[pW])
877 {
878 cout<<"WARNING: fSumOfParticleWeights[pW] is NULL in AFAWFQD::FCHRIF() !!!!"<<endl;
879 cout<<"pW = "<<pW<<endl;
880 exit(0);
881 }
882
ce4a88f5 883 if(!(fCommonHistsResults))
884 {
885 cout<<"WARNING: fCommonHistsResults is NULL in AFAWFQD::FCHRIF() !!!!"<<endl;
886 exit(0);
887 }
888
ee0860e8 889 // fill integrated flow:
97ab16dd 890 Double_t v = fIntFlow[pW][s2F]->GetBinContent(1);
891 Double_t vError = fIntFlow[pW][s2F]->GetBinError(1);
ce4a88f5 892
893 fCommonHistsResults->FillIntegratedFlow(v,vError);
894
97ab16dd 895 // fill chi (this chi stands for resolution, not to be confused with chi2 used before):
ee0860e8 896 Double_t AvM = fSumOfParticleWeights[pW]->GetMean(1);
897 Double_t chi = AvM*pow(v,2);
898 if(chi>=0)
899 {
900 fCommonHistsResults->FillChi(pow(chi,0.5));
901 fCommonHistsResults->FillChiRP(pow(chi,0.5));
902 }
903
ce4a88f5 904} // end of void AliFlowAnalysisWithFittingQDistribution::FillCommonHistResultsIntFlow(Bool_t useParticleWeights, Bool_t sigma2NotFixed)
905
906
907//================================================================================================================================
908
909
910void AliFlowAnalysisWithFittingQDistribution::PrintFinalResultsForIntegratedFlow()
911{
912 // print the final results for integrated flow on the screen
913
97ab16dd 914 // shortcuts: pW = particle weights
915 // s2F = sigma^2 fitted
ce4a88f5 916
917 for(Int_t pW=0;pW<1+(Int_t)(fUsePhiWeights||fUsePtWeights||fUseEtaWeights);pW++)
918 {
919 if(!fSumOfParticleWeights[pW])
920 {
921 cout<<"WARNING: fSumOfParticleWeights[pW] is NULL in AFAWFQD::FCHRIF() !!!!"<<endl;
922 cout<<"pW = "<<pW<<endl;
923 exit(0);
924 }
97ab16dd 925 for(Int_t s2F=0;s2F<2;s2F++)
ce4a88f5 926 {
97ab16dd 927 if(!fIntFlow[pW][s2F])
ce4a88f5 928 {
97ab16dd 929 cout<<"WARNING: fIntFlow[pW][s2F] is NULL in AFAWFQD::FCHRIF() !!!!"<<endl;
930 cout<<"pW = "<<pW<<endl;
931 cout<<"s2F = "<<s2F<<endl;
ce4a88f5 932 exit(0);
933 }
934 }
935 }
936
937 if(!(fCommonHistsResults))
938 {
939 cout<<"WARNING: fCommonHistsResults is NULL in AFAWFQD::FCHRIF() !!!!"<<endl;
940 exit(0);
941 }
942
943 // shortcut for the harmonic:
944 Int_t n = (Int_t)(fCommonHists->GetHarmonic())->GetBinContent(1);
945
946 // printing:
947 cout<<" "<<endl;
948 cout<<"***************************************"<<endl;
949 cout<<"***************************************"<<endl;
950 cout<<" integrated flow by fitting "<<endl;
951 cout<<" q-distribution: "<<endl;
952 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
953 {
954 cout<<" (with weights) "<<endl;
955 } else
956 {
957 cout<<" (without weights) "<<endl;
958 }
959 cout<<endl;
960
961 if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights)
962 {
97ab16dd 963 cout<<"1.) sigma^2 not fitted: "<<endl;
964 cout<<" v_"<<n<<"{FQD} = "<<fIntFlow[1][0]->GetBinContent(1)<<" +/- "<<fIntFlow[1][0]->GetBinError(1)<<endl;
965 cout<<" sigma^2 = 0.5 +/- 0 "<<endl;
966 cout<<" chi^2 = "<<fChi2[1][0]->GetBinContent(1)<<" (Minuit)"<<endl;
967 cout<<" "<<endl;
968 cout<<"2.) sigma^2 fitted: "<<endl;
969 cout<<" v_"<<n<<"{FQD} = "<<fIntFlow[1][1]->GetBinContent(1)<<" +/- "<<fIntFlow[1][1]->GetBinError(1)<<endl;
970 cout<<" sigma^2 = "<<fSigma2[1][1]->GetBinContent(1)<<" +/- "<<fSigma2[1][1]->GetBinError(1)<<endl;
971 cout<<" chi^2 = "<<fChi2[1][1]->GetBinContent(1)<<" (Minuit)"<<endl;
ce4a88f5 972 cout<<" "<<endl;
973 cout<<" nEvts = "<<fSumOfParticleWeights[1]->GetEntries()<<", AvM = "<<fSumOfParticleWeights[1]->GetMean()<<endl;
974 cout<<" "<<endl;
975 } else
976 {
97ab16dd 977 cout<<"1.) sigma^2 not fitted: "<<endl;
978 cout<<endl;
979 cout<<" v_"<<n<<"{FQD} = "<<fIntFlow[0][0]->GetBinContent(1)<<" +/- "<<fIntFlow[0][0]->GetBinError(1)<<endl;
980 cout<<" sigma^2 = 0.5 +/- 0 "<<endl;
981 cout<<" chi^2 = "<<fChi2[0][0]->GetBinContent(1)<<" (Minuit)"<<endl;
982 cout<<" "<<endl;
983 cout<<"2.) sigma^2 fitted: "<<endl;
984 cout<<endl;
985 cout<<" v_"<<n<<"{FQD} = "<<fIntFlow[0][1]->GetBinContent(1)<<" +/- "<<fIntFlow[0][1]->GetBinError(1)<<endl;
986 cout<<" sigma^2 = "<<fSigma2[0][1]->GetBinContent(1)<<" +/- "<<fSigma2[0][1]->GetBinError(1)<<endl;
987 cout<<" chi^2 = "<<fChi2[0][1]->GetBinContent(1)<<" (Minuit)"<<endl;
ce4a88f5 988 cout<<" "<<endl;
989 cout<<" nEvts = "<<fSumOfParticleWeights[0]->GetEntries()<<", AvM = "<<fSumOfParticleWeights[0]->GetMean()<<endl;
990 cout<<" "<<endl;
991 }
992
993 cout<<"***************************************"<<endl;
994 cout<<"***************************************"<<endl;
97ab16dd 995 cout<<endl;
996
ce4a88f5 997} // end of void AliFlowAnalysisWithFittingQDistribution::PrintFinalResultsForIntegratedFlow()
998
999
1000//================================================================================================================================
ee0860e8 1001
1002
1003void AliFlowAnalysisWithFittingQDistribution::StoreFittingParameters()
1004{
1005 // store fitting parameters in profile fFittingParameters
1006
1007 // Binning of fFittingParameters is organized as follows:
1008 // 1st bin: fTreshold
1009 // 2nd bin: fvStart
1010 // 3rd bin: fvMin
1011 // 4th bin: fvMax
1012 // 5th bin: fSigma2Start
1013 // 6th bin: fSigma2Min
1014 // 7th bin: fSigma2Max
47426051 1015 // 8th bin: fPlotResults
ee0860e8 1016
1017 if(!fFittingParameters)
1018 {
1019 cout<<"WARNING: fFittingParameters is NULL in AFAWFQD::SFP() !!!!"<<endl;
1020 exit(0);
1021 }
1022
1023 fFittingParameters->Reset();
1024 fFittingParameters->Fill(0.5,fTreshold);
1025 fFittingParameters->Fill(1.5,fvStart);
1026 fFittingParameters->Fill(2.5,fvMin);
1027 fFittingParameters->Fill(3.5,fvMax);
1028 fFittingParameters->Fill(4.5,fSigma2Start);
1029 fFittingParameters->Fill(5.5,fSigma2Min);
1030 fFittingParameters->Fill(6.5,fSigma2Max);
47426051 1031 fFittingParameters->Fill(7.5,(Int_t)fPlotResults);
ee0860e8 1032
1033} // end of void AliFlowAnalysisWithFittingQDistribution::StoreFittingParameters()
1034
1035
1036//================================================================================================================================
1037
1038
1039void AliFlowAnalysisWithFittingQDistribution::AccessFittingParameters()
1040{
1041 // access fitting parameters:
1042
1043 if(!fFittingParameters)
1044 {
1045 cout<<"WARNING: fFittingParameters is NULL in AFAWFQD::AFP() !!!!"<<endl;
1046 exit(0);
1047 }
1048
1049 fTreshold = fFittingParameters->GetBinContent(1);
1050 fvStart = fFittingParameters->GetBinContent(2);
1051 fvMin = fFittingParameters->GetBinContent(3);
1052 fvMax = fFittingParameters->GetBinContent(4);
1053 fSigma2Start = fFittingParameters->GetBinContent(5);
1054 fSigma2Min = fFittingParameters->GetBinContent(6);
1055 fSigma2Max = fFittingParameters->GetBinContent(7);
1056 fPlotResults = (Bool_t) fFittingParameters->GetBinContent(8);
1057
1058} // end of void AliFlowAnalysisWithFittingQDistribution::AccessFittingParameters()