2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved.
3 * See cxx source for full Copyright notice
7 /********************************
8 * estimating reference flow by *
9 * fitting q-distribution *
11 * author: Ante Bilandzic *
12 * (abilandzic@gmail.com) *
14 * based on the macro written *
15 * by Sergei Voloshin *
16 *******************************/
18 #ifndef ALIFLOWANALYSISWITHFITTINGQDISTRIBUTION_H
19 #define ALIFLOWANALYSISWITHFITTINGQDISTRIBUTION_H
21 #include "AliFlowCommonConstants.h"
34 class AliFlowEventSimple;
35 class AliFlowTrackSimple;
36 class AliFlowCommonHist;
37 class AliFlowCommonHistResults;
40 //================================================================================================================
42 class AliFlowAnalysisWithFittingQDistribution{
44 AliFlowAnalysisWithFittingQDistribution();
45 virtual ~AliFlowAnalysisWithFittingQDistribution();
46 // 0.) methods called in the constructor:
47 virtual void InitializeArrays();
48 // 1.) method Init() and methods called within Init():
50 virtual void AccessConstants();
51 virtual void BookCommonHistograms();
52 virtual void BookAndFillWeightsHistograms();
53 virtual void BookEverythingForDistributions();
54 virtual void StoreFittingParameters();
55 virtual void AccessFittingParameters();
56 // 2.) method Make() and methods called within Make():
57 virtual void Make(AliFlowEventSimple* anEvent);
58 virtual void CheckPointersUsedInMake();
59 // 3.) method Finish() and methods called within Finish():
60 virtual void Finish(Bool_t doFit = kTRUE);
61 virtual void CheckPointersUsedInFinish();
62 virtual void DoFit(Bool_t sigma2Fitted);
63 virtual void FillCommonHistResults(Bool_t sigma2Fitted);
64 virtual void PrintOnTheScreen();
66 virtual void GetOutputHistograms(TList *outputListHistos);
67 virtual void WriteHistograms(TString *outputFileName);
68 virtual void WriteHistograms(TString outputFileName);
69 virtual void WriteHistograms(TDirectoryFile *outputFileName);
71 // **** SETTERS and GETTERS ****
74 TList* GetHistList() const {return this->fHistList;}
76 void SetBookOnlyBasicCCH(Bool_t const bobcch) {this->fBookOnlyBasicCCH = bobcch;};
77 Bool_t GetBookOnlyBasicCCH() const {return this->fBookOnlyBasicCCH;};
78 void SetCommonHists(AliFlowCommonHist* const ch) {this->fCommonHists = ch;};
79 AliFlowCommonHist* GetCommonHists() const {return this->fCommonHists;};
80 void SetCommonHistsResults(AliFlowCommonHistResults* const chr) {this->fCommonHistsResults = chr;};
81 AliFlowCommonHistResults* GetCommonHistsResults() const {return this->fCommonHistsResults;};
82 void SetHarmonic(Int_t const harmonic) {this->fHarmonic = harmonic;};
83 Int_t GetHarmonic() const {return this->fHarmonic;};
84 void SetAnalysisLabel(const char *aLabel) {this->fAnalysisLabel->Append(*aLabel);};
85 TString *GetAnalysisLabel() const {return this->fAnalysisLabel;};
86 void SetMultiplicityIs(AliFlowCommonConstants::ERefMultSource mi) {this->fMultiplicityIs = mi;};
88 void SetWeightsList(TList* wlist) {this->fWeightsList = (TList*)wlist->Clone();};
89 TList* GetWeightsList() const {return this->fWeightsList;}
90 void SetUsePhiWeights(Bool_t const uPhiW) {this->fUsePhiWeights = uPhiW;};
91 Bool_t GetUsePhiWeights() const {return this->fUsePhiWeights;};
92 void SetUsePtWeights(Bool_t const uPtW) {this->fUsePtWeights = uPtW;};
93 Bool_t GetUsePtWeights() const {return this->fUsePtWeights;};
94 void SetUseEtaWeights(Bool_t const uEtaW) {this->fUseEtaWeights = uEtaW;};
95 Bool_t GetUseEtaWeights() const {return this->fUseEtaWeights;};
96 void SetUseParticleWeights(TProfile* const uPW) {this->fUseParticleWeights = uPW;};
97 TProfile* GetUseParticleWeights() const {return this->fUseParticleWeights;};
98 void SetPhiWeights(TH1F* const histPhiWeights) {this->fPhiWeights = histPhiWeights;};
99 TH1F* GetPhiWeights() const {return this->fPhiWeights;};
100 void SetPtWeights(TH1D* const histPtWeights) {this->fPtWeights = histPtWeights;};
101 TH1D* GetPtWeights() const {return this->fPtWeights;};
102 void SetEtaWeights(TH1D* const histEtaWeights) {this->fEtaWeights = histEtaWeights;};
103 TH1D* GetEtaWeights() const {return this->fEtaWeights;};
104 // 3.) distributions:
105 void SetSumOfParticleWeights(TH1D* const sopW) {this->fSumOfParticleWeights = sopW;};
106 TH1D* GetSumOfParticleWeights() const {return this->fSumOfParticleWeights;};
107 void SetqDistribution(TH1D* const qd) {this->fqDistribution = qd;};
108 TH1D* GetqDistribution() const {return this->fqDistribution;};
109 void SetqMin(Double_t const qmin) {this->fqMin = qmin;};
110 Double_t GetqMin() const {return this->fqMin;};
111 void SetqMax(Double_t const qmax) {this->fqMax = qmax;};
112 Double_t GetqMax() const {return this->fqMax;};
113 void SetqNbins(Int_t const qNbins) {this->fqNbins = qNbins;};
114 Int_t GetqNbins() const {return this->fqNbins;};
115 void SetStoreqDistributionVsMult(Bool_t const sqdvm) {this->fStoreqDistributionVsMult = sqdvm;};
116 Bool_t GetStoreqDistributionVsMult() const {return this->fStoreqDistributionVsMult;};
117 void SetqDistributionVsMult(TH2D* const qdvm) {this->fqDistributionVsMult = qdvm;};
118 TH2D* GetqDistributionVsMult() const {return this->fqDistributionVsMult;};
119 void SetMinMult(Double_t const minm) {this->fMinMult = minm;};
120 Double_t GetMinMult() const {return this->fMinMult;};
121 void SetMaxMult(Double_t const maxm) {this->fMaxMult = maxm;};
122 Double_t GetMaxMult() const {return this->fMaxMult;};
123 void SetnBinsMult(Int_t const nbm) {this->fnBinsMult = nbm;};
124 Int_t GetnBinsMult() const {return this->fnBinsMult;};
125 // 4.) final results of fitting:
126 void SetIntFlow(TH1D* const intFlow, Int_t sigmaFitted) {this->fIntFlow[sigmaFitted] = intFlow;};
127 TH1D* GetIntFlow(Int_t sigmaFitted) const {return this->fIntFlow[sigmaFitted];};
128 void SetSigma2(TH1D* const sigma2, Int_t sigmaFitted) {this->fSigma2[sigmaFitted] = sigma2;};
129 TH1D* GetSigma2(Int_t sigmaFitted) const {return this->fSigma2[sigmaFitted];};
130 void SetChi2(TH1D* const chi2, Int_t sigmaFitted) {this->fChi2[sigmaFitted] = chi2;};
131 TH1D* GetChi2(Int_t sigmaFitted) const {return this->fChi2[sigmaFitted];};
132 void SetFittingFunction(TF1* const ff, Int_t sigmaFitted) {this->fFittingFunction[sigmaFitted] = ff;};
133 TF1* GetFittingFunction(Int_t sigmaFitted) const {return this->fFittingFunction[sigmaFitted];};
134 // 5.) fitting parameters:
135 void SetFittingParameters(TProfile* const fp) {this->fFittingParameters = fp;};
136 TProfile* GetFittingParameters() const {return this->fFittingParameters;};
137 void SetTreshold(Double_t const treshold) {this->fTreshold = treshold;};
138 Double_t GetTreshold() const {return this->fTreshold;};
139 void SetvStart(Double_t const vStart) {this->fvStart = vStart;};
140 Double_t GetvStart() const {return this->fvStart;};
141 void SetvMin(Double_t const vMin) {this->fvMin = vMin;};
142 Double_t GetvMin() const {return this->fvMin;};
143 void SetvMax(Double_t const vMax) {this->fvMax = vMax;};
144 Double_t GetvMax() const {return this->fvMax;};
145 void SetSigma2Start(Double_t const Sigma2Start) {this->fSigma2Start = Sigma2Start;};
146 Double_t GetSigma2Start() const {return this->fSigma2Start;};
147 void SetSigma2Min(Double_t const Sigma2Min) {this->fSigma2Min = Sigma2Min;};
148 Double_t GetSigma2Min() const {return this->fSigma2Min;};
149 void SetSigma2Max(Double_t const Sigma2Max) {this->fSigma2Max = Sigma2Max;};
150 Double_t GetSigma2Max() const {return this->fSigma2Max;};
151 void SetFinalResultIsFromSigma2Fitted(Bool_t frifs2f) {this->fFinalResultIsFromSigma2Fitted = frifs2f;};
152 Bool_t GetFinalResultIsFromSigma2Fitted() const {return this->fFinalResultIsFromSigma2Fitted;};
153 void SetPrintOnTheScreen(Bool_t pots) {this->fPrintOnTheScreen = pots;};
154 Bool_t GetPrintOnTheScreen() const {return this->fPrintOnTheScreen;};
155 void SetDoFit(Bool_t df) {this->fDoFit = df;};
156 Bool_t GetDoFit() const {return this->fDoFit;};
159 AliFlowAnalysisWithFittingQDistribution(const AliFlowAnalysisWithFittingQDistribution &afawfqd);
160 AliFlowAnalysisWithFittingQDistribution& operator=(const AliFlowAnalysisWithFittingQDistribution &afawfqd);
162 TList *fHistList; // base list to hold all output object
164 Bool_t fBookOnlyBasicCCH; // book only basis common control histrograms (TRUE by default)
165 AliFlowCommonHist *fCommonHists; // common control histograms
166 AliFlowCommonHistResults *fCommonHistsResults; // final results in common histograms
167 Int_t fnBinsPhi; // number of phi bins
168 Double_t fPhiMin; // minimum phi
169 Double_t fPhiMax; // maximum phi
170 Double_t fPhiBinWidth; // bin width for phi histograms
171 Int_t fnBinsPt; // number of pt bins
172 Double_t fPtMin; // minimum pt
173 Double_t fPtMax; // maximum pt
174 Double_t fPtBinWidth; // bin width for pt histograms
175 Int_t fnBinsEta; // number of eta bins
176 Double_t fEtaMin; // minimum eta
177 Double_t fEtaMax; // maximum eta
178 Double_t fEtaBinWidth; // bin width for eta histograms
179 Int_t fHarmonic; // harmonic
180 TString *fAnalysisLabel; // analysis label (all histograms and output file will have this label)
181 AliFlowCommonConstants::ERefMultSource fMultiplicityIs; // by default "kRP", see AliFlowCommonConstants to see the other options
182 // 2.) particle weights (abbreviated to 'pWeights' or even to 'pW' throughout the code):
183 TList *fWeightsList; // list to hold all histograms with particle weights: fUseParticleWeights, fPhiWeights, fPtWeights and fEtaWeights
184 Bool_t fUsePhiWeights; // use phi weights
185 Bool_t fUsePtWeights; // use pt weights
186 Bool_t fUseEtaWeights; // use eta weights
187 TProfile *fUseParticleWeights; // profile with three bins to hold values of fUsePhiWeights, fUsePtWeights and fUseEtaWeights
188 TH1F *fPhiWeights; // histogram holding phi weights
189 TH1D *fPtWeights; // histogram holding pt weights
190 TH1D *fEtaWeights; // histogram holding eta weights
191 // 3.) distributions:
192 TH1D *fSumOfParticleWeights; // distribution of sum of particle weights (for unit weights this equals to multiplicity)
193 TH1D *fqDistribution; // distribution of Q/sqrt{M}
194 Double_t fqMin; // lower boundary of TH1D *fqDistribution
195 Double_t fqMax; // upper boundary of TH1D *fqDistribution
196 Int_t fqNbins; // number of bins of TH1D *fqDistribution
197 Bool_t fStoreqDistributionVsMult; // store q-distributions vs M
198 TH2D *fqDistributionVsMult; // distribution of Q/sqrt{M} vs multiplicity
199 Double_t fMinMult; // minimum multiplicity
200 Double_t fMaxMult; // maximum multiplicity
201 Int_t fnBinsMult; // number of multiplicity bins
202 // 4.) final results of fitting:
203 TH1D *fIntFlow[2]; // final result for integrated flow [0=sigma^2 not fitted, 1=sigma^2 fitted]
204 TH1D *fSigma2[2]; // final results for sigma^2 [0=sigma^2 not fitted, 1=sigma^2 fitted]
205 TH1D *fChi2[2]; // final results for chi^2 from Minuit [0=sigma^2 not fitted, 1=sigma^2 fitted]
206 TF1 *fFittingFunction[2]; // resulting fitting function of q-distribution [0=sigma^2 not fitted, 1=sigma^2 fitted]
207 // 5.) fitting parameters:
208 TProfile *fFittingParameters; // profile to hold all fitting parameters
209 Double_t fTreshold; // the first bin taken for the fitting is the first bin with nEntries >= fTreshold (analogously for the last bin)
210 Double_t fvStart; // fitting of v will start from this point
211 Double_t fvMin; // v range, lower boundary
212 Double_t fvMax; // v range, upper boundary
213 Double_t fSigma2Start; // fitting of sigma2 will start from this point
214 Double_t fSigma2Min; // sigma2 range, lower boundary (this should be kept above 0.5 according to theorists...)
215 Double_t fSigma2Max; // sigma2 range, upper boundary
216 Bool_t fFinalResultIsFromSigma2Fitted; // the result obtained with sigma^2 fitted or sigma^2 fixed is being stored
217 Bool_t fPrintOnTheScreen; // print or not the final results on the screen
218 Bool_t fDoFit; // do the final fit
220 ClassDef(AliFlowAnalysisWithFittingQDistribution, 0);
223 //================================================================================================================