]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithFittingQDistribution.h
fix macro control plots npart eccentricity
[u/mrichter/AliRoot.git] / PWG2 / FLOW / AliFlowCommon / 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 TProfile;
31 class TF1;
32
33 class AliFlowEventSimple;
34 class AliFlowTrackSimple;
35 class AliFlowCommonHist;
36 class AliFlowCommonHistResults;
37 class AliFlowVector;
38
39 //================================================================================================================
40
41 class AliFlowAnalysisWithFittingQDistribution{
42  public:
43   AliFlowAnalysisWithFittingQDistribution();
44   virtual ~AliFlowAnalysisWithFittingQDistribution(); 
45   // 0.) methods called in the constructor:
46   virtual void InitializeArrays();
47   // 1.) method Init() and methods called within Init():
48   virtual void Init();
49    virtual void AccessConstants();
50    virtual void BookCommonHistograms();
51    virtual void BookAndFillWeightsHistograms();
52    virtual void BookEverythingForDistributions();
53    virtual void StoreFittingParameters();
54    virtual void AccessFittingParameters();
55   // 2.) method Make() and methods called within Make(): 
56   virtual void Make(AliFlowEventSimple* anEvent);
57    virtual void CheckPointersUsedInMake();
58   // 3.) method Finish() and methods called within Finish(): 
59   virtual void Finish(Bool_t doFit = kTRUE);
60    virtual void CheckPointersUsedInFinish();
61    virtual void DoFit(Bool_t sigma2Fitted);
62    virtual void FillCommonHistResults(Bool_t sigma2Fitted);
63    virtual void PrintOnTheScreen();
64   // 4.) other methods:
65   virtual void GetOutputHistograms(TList *outputListHistos); 
66   virtual void WriteHistograms(TString *outputFileName);
67   virtual void WriteHistograms(TString outputFileName);
68   virtual void WriteHistograms(TDirectoryFile *outputFileName);
69     
70   // **** SETTERS and GETTERS ****
71   
72   // 0.) base:                                                                                              
73   TList* GetHistList() const {return this->fHistList;} 
74   // 1.) common:
75   void SetCommonHists(AliFlowCommonHist* const ch) {this->fCommonHists = ch;};
76   AliFlowCommonHist* GetCommonHists() const {return this->fCommonHists;};
77   void SetCommonHistsResults(AliFlowCommonHistResults* const chr) {this->fCommonHistsResults = chr;};
78   AliFlowCommonHistResults* GetCommonHistsResults() const {return this->fCommonHistsResults;};
79   void SetHarmonic(Int_t const harmonic) {this->fHarmonic = harmonic;};
80   Int_t GetHarmonic() const {return this->fHarmonic;};
81   void SetAnalysisLabel(const char *aLabel) {this->fAnalysisLabel->Append(*aLabel);};
82   TString *GetAnalysisLabel() const {return this->fAnalysisLabel;};
83   // 2.) weights:
84   void SetWeightsList(TList* wlist) {this->fWeightsList = (TList*)wlist->Clone();};
85   TList* GetWeightsList() const {return this->fWeightsList;}  
86   void SetUsePhiWeights(Bool_t const uPhiW) {this->fUsePhiWeights = uPhiW;};
87   Bool_t GetUsePhiWeights() const {return this->fUsePhiWeights;};
88   void SetUsePtWeights(Bool_t const uPtW) {this->fUsePtWeights = uPtW;};
89   Bool_t GetUsePtWeights() const {return this->fUsePtWeights;};
90   void SetUseEtaWeights(Bool_t const uEtaW) {this->fUseEtaWeights = uEtaW;};
91   Bool_t GetUseEtaWeights() const {return this->fUseEtaWeights;};
92   void SetUseParticleWeights(TProfile* const uPW) {this->fUseParticleWeights = uPW;};
93   TProfile* GetUseParticleWeights() const {return this->fUseParticleWeights;};
94   void SetPhiWeights(TH1F* const histPhiWeights) {this->fPhiWeights = histPhiWeights;};
95   TH1F* GetPhiWeights() const {return this->fPhiWeights;};
96   void SetPtWeights(TH1D* const histPtWeights) {this->fPtWeights = histPtWeights;};
97   TH1D* GetPtWeights() const {return this->fPtWeights;};
98   void SetEtaWeights(TH1D* const histEtaWeights) {this->fEtaWeights = histEtaWeights;};
99   TH1D* GetEtaWeights() const {return this->fEtaWeights;};
100   // 3.) distributions:
101   void SetSumOfParticleWeights(TH1D* const sopW) {this->fSumOfParticleWeights = sopW;};
102   TH1D* GetSumOfParticleWeights() const {return this->fSumOfParticleWeights;};
103   void SetqDistribution(TH1D* const qd) {this->fqDistribution = qd;};
104   TH1D* GetqDistribution() const {return this->fqDistribution;};
105   void SetqMin(Double_t const qmin) {this->fqMin = qmin;};
106   Double_t GetqMin() const {return this->fqMin;};
107   void SetqMax(Double_t const qmax) {this->fqMax = qmax;};
108   Double_t GetqMax() const {return this->fqMax;};
109   void SetqNbins(Int_t const qNbins) {this->fqNbins = qNbins;};
110   Int_t GetqNbins() const {return this->fqNbins;};  
111   // 4.) final results of fitting:
112   void SetIntFlow(TH1D* const intFlow, Int_t sigmaFitted) {this->fIntFlow[sigmaFitted] = intFlow;};
113   TH1D* GetIntFlow(Int_t sigmaFitted) const {return this->fIntFlow[sigmaFitted];};
114   void SetSigma2(TH1D* const sigma2, Int_t sigmaFitted) {this->fSigma2[sigmaFitted] = sigma2;};
115   TH1D* GetSigma2(Int_t sigmaFitted) const {return this->fSigma2[sigmaFitted];};
116   void SetChi2(TH1D* const chi2, Int_t sigmaFitted) {this->fChi2[sigmaFitted] = chi2;};
117   TH1D* GetChi2(Int_t sigmaFitted) const {return this->fChi2[sigmaFitted];};
118   void SetFittingFunction(TF1* const ff, Int_t sigmaFitted) {this->fFittingFunction[sigmaFitted] = ff;};
119   TF1* GetFittingFunction(Int_t sigmaFitted) const {return this->fFittingFunction[sigmaFitted];};
120   // 5.) fitting parameters:
121   void SetFittingParameters(TProfile* const fp) {this->fFittingParameters = fp;};
122   TProfile* GetFittingParameters() const {return this->fFittingParameters;};
123   void SetTreshold(Double_t const treshold) {this->fTreshold = treshold;};
124   Double_t GetTreshold() const {return this->fTreshold;};
125   void SetvStart(Double_t const vStart) {this->fvStart = vStart;};
126   Double_t GetvStart() const {return this->fvStart;};
127   void SetvMin(Double_t const vMin) {this->fvMin = vMin;};
128   Double_t GetvMin() const {return this->fvMin;};
129   void SetvMax(Double_t const vMax) {this->fvMax = vMax;};
130   Double_t GetvMax() const {return this->fvMax;};
131   void SetSigma2Start(Double_t const Sigma2Start) {this->fSigma2Start = Sigma2Start;};
132   Double_t GetSigma2Start() const {return this->fSigma2Start;};
133   void SetSigma2Min(Double_t const Sigma2Min) {this->fSigma2Min = Sigma2Min;};
134   Double_t GetSigma2Min() const {return this->fSigma2Min;};
135   void SetSigma2Max(Double_t const Sigma2Max) {this->fSigma2Max = Sigma2Max;};
136   Double_t GetSigma2Max() const {return this->fSigma2Max;};
137   void SetFinalResultIsFromSigma2Fitted(Bool_t frifs2f) {this->fFinalResultIsFromSigma2Fitted = frifs2f;};
138   Bool_t GetFinalResultIsFromSigma2Fitted() const {return this->fFinalResultIsFromSigma2Fitted;};  
139   void SetPrintOnTheScreen(Bool_t pots) {this->fPrintOnTheScreen = pots;};
140   Bool_t GetPrintOnTheScreen() const {return this->fPrintOnTheScreen;};  
141   
142  private:
143   AliFlowAnalysisWithFittingQDistribution(const AliFlowAnalysisWithFittingQDistribution &afawfqd);
144   AliFlowAnalysisWithFittingQDistribution& operator=(const AliFlowAnalysisWithFittingQDistribution &afawfqd);           
145   // 0.) base:
146   TList *fHistList; // base list to hold all output object
147   // 1.) common:
148   AliFlowCommonHist *fCommonHists; // common control histograms 
149   AliFlowCommonHistResults *fCommonHistsResults; // final results in common histograms
150   Int_t fnBinsPhi; // number of phi bins
151   Double_t fPhiMin; // minimum phi   
152   Double_t fPhiMax; // maximum phi 
153   Double_t fPhiBinWidth; // bin width for phi histograms  
154   Int_t fnBinsPt; // number of pt bins
155   Double_t fPtMin; // minimum pt   
156   Double_t fPtMax; // maximum pt  
157   Double_t fPtBinWidth; // bin width for pt histograms  
158   Int_t fnBinsEta; // number of eta bins
159   Double_t fEtaMin; // minimum eta   
160   Double_t fEtaMax; // maximum eta
161   Double_t fEtaBinWidth; // bin width for eta histograms 
162   Int_t fHarmonic; // harmonic 
163   TString *fAnalysisLabel; // analysis label (all histograms and output file will have this label)
164   // 2.) particle weights (abbreviated to 'pWeights' or even to 'pW' throughout the code):
165   TList *fWeightsList; // list to hold all histograms with particle weights: fUseParticleWeights, fPhiWeights, fPtWeights and fEtaWeights
166   Bool_t fUsePhiWeights; // use phi weights
167   Bool_t fUsePtWeights; // use pt weights
168   Bool_t fUseEtaWeights; // use eta weights
169   TProfile *fUseParticleWeights; // profile with three bins to hold values of fUsePhiWeights, fUsePtWeights and fUseEtaWeights
170   TH1F *fPhiWeights; // histogram holding phi weights
171   TH1D *fPtWeights; // histogram holding pt weights
172   TH1D *fEtaWeights; // histogram holding eta weights 
173   // 3.) distributions:
174   TH1D *fSumOfParticleWeights; // distribution of sum of particle weights (for unit weights this equals to multiplicity)
175   TH1D *fqDistribution; // distribution of Q/sqrt{sum of phi weights}
176   Double_t fqMin; // lower boundary of TH1D *fqDistribution
177   Double_t fqMax; // upper boundary of TH1D *fqDistribution
178   Int_t fqNbins; // number of bins of TH1D *fqDistribution
179   // 4.) final results of fitting:
180   TH1D *fIntFlow[2]; // final result for integrated flow [0=sigma^2 not fitted, 1=sigma^2 fitted]  
181   TH1D *fSigma2[2]; // final results for sigma^2 [0=sigma^2 not fitted, 1=sigma^2 fitted]
182   TH1D *fChi2[2]; // final results for chi^2 from Minuit [0=sigma^2 not fitted, 1=sigma^2 fitted]
183   TF1 *fFittingFunction[2]; // resulting fitting function of q-distribution [0=sigma^2 not fitted, 1=sigma^2 fitted]
184   // 5.) fitting parameters:
185   TProfile *fFittingParameters; // profile to hold all fitting parameters
186   Double_t fTreshold; // the first bin taken for the fitting is the first bin with nEntries >= fTreshold (analogously for the last bin)
187   Double_t fvStart; // fitting of v will start from this point
188   Double_t fvMin; // v range, lower boundary
189   Double_t fvMax; // v range, upper boundary
190   Double_t fSigma2Start; // fitting of sigma2 will start from this point
191   Double_t fSigma2Min; // sigma2 range, lower boundary (this should be kept above 0.5 according to theorists...)
192   Double_t fSigma2Max; // sigma2 range, upper boundary
193   Bool_t fFinalResultIsFromSigma2Fitted; // the result obtained with sigma^2 fitted or sigma^2 fixed is being stored
194   Bool_t fPrintOnTheScreen; // print or not the final results on the screen
195   
196   ClassDef(AliFlowAnalysisWithFittingQDistribution, 0);
197 };
198
199 //================================================================================================================
200
201 #endif
202
203
204
205
206