]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG/FLOW/Base/AliFlowAnalysisWithFittingQDistribution.h
add correlation coefficient equal to 1 in case of propagation of fully correlated...
[u/mrichter/AliRoot.git] / PWG / FLOW / Base / AliFlowAnalysisWithFittingQDistribution.h
1 /* 
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. 
3  * See cxx source for full Copyright notice 
4  * $Id$ 
5  */
6
7 /******************************** 
8  * estimating reference flow by *
9  *   fitting q-distribution     * 
10  *                              *
11  * author: Ante Bilandzic       * 
12  *       (abilandzic@gmail.com) *
13  *                              *  
14  *  based on the macro written  *
15  *     by Sergei Voloshin       *
16  *******************************/ 
17  
18 #ifndef ALIFLOWANALYSISWITHFITTINGQDISTRIBUTION_H
19 #define ALIFLOWANALYSISWITHFITTINGQDISTRIBUTION_H
20
21 #include "AliFlowCommonConstants.h"
22
23 class TObjArray;
24 class TList;
25 class TFile;
26 class TDirectoryFile;
27
28 class TH1F;
29 class TH1D;
30 class TH2D;
31 class TProfile;
32 class TF1;
33
34 class AliFlowEventSimple;
35 class AliFlowTrackSimple;
36 class AliFlowCommonHist;
37 class AliFlowCommonHistResults;
38 class AliFlowVector;
39
40 //================================================================================================================
41
42 class AliFlowAnalysisWithFittingQDistribution{
43  public:
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():
49   virtual void 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();
65   // 4.) other methods:
66   virtual void GetOutputHistograms(TList *outputListHistos); 
67   virtual void WriteHistograms(TString *outputFileName);
68   virtual void WriteHistograms(TString outputFileName);
69   virtual void WriteHistograms(TDirectoryFile *outputFileName);
70     
71   // **** SETTERS and GETTERS ****
72   
73   // 0.) base:                                                                                              
74   TList* GetHistList() const {return this->fHistList;} 
75   // 1.) common:
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;};
87   // 2.) weights:
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;};  
157   void SetExactNoRPs(Int_t const enr) {this->fExactNoRPs = enr;};
158   Int_t GetExactNoRPs() const {return this->fExactNoRPs;};
159   
160  private:
161   AliFlowAnalysisWithFittingQDistribution(const AliFlowAnalysisWithFittingQDistribution &afawfqd);
162   AliFlowAnalysisWithFittingQDistribution& operator=(const AliFlowAnalysisWithFittingQDistribution &afawfqd);           
163   // 0.) base:
164   TList *fHistList; // base list to hold all output object
165   // 1.) common:
166   Bool_t fBookOnlyBasicCCH; // book only basis common control histrograms (TRUE by default)  
167   AliFlowCommonHist *fCommonHists; // common control histograms 
168   AliFlowCommonHistResults *fCommonHistsResults; // final results in common histograms
169   Int_t fnBinsPhi; // number of phi bins
170   Double_t fPhiMin; // minimum phi   
171   Double_t fPhiMax; // maximum phi 
172   Double_t fPhiBinWidth; // bin width for phi histograms  
173   Int_t fnBinsPt; // number of pt bins
174   Double_t fPtMin; // minimum pt   
175   Double_t fPtMax; // maximum pt  
176   Double_t fPtBinWidth; // bin width for pt histograms  
177   Int_t fnBinsEta; // number of eta bins
178   Double_t fEtaMin; // minimum eta   
179   Double_t fEtaMax; // maximum eta
180   Double_t fEtaBinWidth; // bin width for eta histograms 
181   Int_t fHarmonic; // harmonic 
182   TString *fAnalysisLabel; // analysis label (all histograms and output file will have this label)
183   AliFlowCommonConstants::ERefMultSource fMultiplicityIs; // by default "kRP", see AliFlowCommonConstants to see the other options
184   // 2.) particle weights (abbreviated to 'pWeights' or even to 'pW' throughout the code):
185   TList *fWeightsList; // list to hold all histograms with particle weights: fUseParticleWeights, fPhiWeights, fPtWeights and fEtaWeights
186   Bool_t fUsePhiWeights; // use phi weights
187   Bool_t fUsePtWeights; // use pt weights
188   Bool_t fUseEtaWeights; // use eta weights
189   TProfile *fUseParticleWeights; // profile with three bins to hold values of fUsePhiWeights, fUsePtWeights and fUseEtaWeights
190   TH1F *fPhiWeights; // histogram holding phi weights
191   TH1D *fPtWeights; // histogram holding pt weights
192   TH1D *fEtaWeights; // histogram holding eta weights 
193   // 3.) distributions:
194   TH1D *fSumOfParticleWeights; // distribution of sum of particle weights (for unit weights this equals to multiplicity)
195   TH1D *fqDistribution; // distribution of Q/sqrt{M}
196   Double_t fqMin; // lower boundary of TH1D *fqDistribution
197   Double_t fqMax; // upper boundary of TH1D *fqDistribution
198   Int_t fqNbins; // number of bins of TH1D *fqDistribution
199   Bool_t fStoreqDistributionVsMult; // store q-distributions vs M 
200   TH2D *fqDistributionVsMult; // distribution of Q/sqrt{M} vs multiplicity
201   Double_t fMinMult; // minimum multiplicity
202   Double_t fMaxMult; // maximum multiplicity
203   Int_t fnBinsMult; // number of multiplicity bins
204   // 4.) final results of fitting:
205   TH1D *fIntFlow[2]; // final result for integrated flow [0=sigma^2 not fitted, 1=sigma^2 fitted]  
206   TH1D *fSigma2[2]; // final results for sigma^2 [0=sigma^2 not fitted, 1=sigma^2 fitted]
207   TH1D *fChi2[2]; // final results for chi^2 from Minuit [0=sigma^2 not fitted, 1=sigma^2 fitted]
208   TF1 *fFittingFunction[2]; // resulting fitting function of q-distribution [0=sigma^2 not fitted, 1=sigma^2 fitted]
209   // 5.) fitting parameters:
210   TProfile *fFittingParameters; // profile to hold all fitting parameters
211   Double_t fTreshold; // the first bin taken for the fitting is the first bin with nEntries >= fTreshold (analogously for the last bin)
212   Double_t fvStart; // fitting of v will start from this point
213   Double_t fvMin; // v range, lower boundary
214   Double_t fvMax; // v range, upper boundary
215   Double_t fSigma2Start; // fitting of sigma2 will start from this point
216   Double_t fSigma2Min; // sigma2 range, lower boundary (this should be kept above 0.5 according to theorists...)
217   Double_t fSigma2Max; // sigma2 range, upper boundary
218   Bool_t fFinalResultIsFromSigma2Fitted; // the result obtained with sigma^2 fitted or sigma^2 fixed is being stored
219   Bool_t fPrintOnTheScreen; // print or not the final results on the screen
220   Bool_t fDoFit; // do the final fit
221   Int_t fExactNoRPs; // when shuffled, select only this number of RPs for the analysis
222   
223   ClassDef(AliFlowAnalysisWithFittingQDistribution, 0);
224 };
225
226 //================================================================================================================
227
228 #endif
229
230
231
232
233