uncertainties back in, incase of weights still behaving funny
[u/mrichter/AliRoot.git] / PWG2 / FLOW / AliFlowCommon / AliFlowAnalysisWithCumulants.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  * flow analysis with cumulants * 
9  *                              * 
10  * author: Ante Bilandzic       * 
11  *          (anteb@nikhef.nl)   *
12  *******************************/ 
13
14 #ifndef ALIFLOWANALYSISWITHCUMULANTS_H
15 #define ALIFLOWANALYSISWITHCUMULANTS_H
16
17 #include "AliFlowCommonConstants.h"
18 #include "AliFlowCumuConstants.h"
19
20 class TObjArray;
21 class TList;
22 class TFile;
23
24 class TH1;
25 class TProfile;
26 class TProfile2D;
27 class TProfile3D;
28
29 class AliFlowEventSimple;
30 class AliFlowTrackSimple;
31 class AliFlowCommonHist;
32 class AliFlowCommonHistResults;
33 class AliFlowVector;
34
35 //================================================================================================================
36
37 class AliFlowAnalysisWithCumulants{
38  public:
39   AliFlowAnalysisWithCumulants();
40   virtual ~AliFlowAnalysisWithCumulants(); 
41   
42   virtual void Init();
43   virtual void Make(AliFlowEventSimple* anEvent);
44   virtual void Finish();
45   virtual void WriteHistograms(TString* outputFileName);
46   virtual void WriteHistograms(TString outputFileName);
47   
48 //----------------------------------------------------------------------------------------------------------------
49 //                                            setters and getters                                                 
50 //----------------------------------------------------------------------------------------------------------------
51   TList* GetHistList() const {return this->fHistList;}     
52   
53   void SetWeightsList(TList* wlist) {this->fWeightsList = wlist;}
54   TList* GetWeightsList() const {return this->fWeightsList;}
55   
56   void SetIntFlowResults(TH1D* const ifr)  {this->fIntFlowResultsGFC = ifr;};
57   TH1D* GetIntFlowResults() const    {return this->fIntFlowResultsGFC;};
58   
59   void SetDiffFlowResults2nd(TH1D* const diff2nd)  {this->fDiffFlowResults2ndOrderGFC = diff2nd;};
60   TH1D* GetDiffFlowResults2nd() const        {return this->fDiffFlowResults2ndOrderGFC;};
61   
62   void SetDiffFlowResults4th(TH1D* const diff4th)  {this->fDiffFlowResults4thOrderGFC = diff4th;};
63   TH1D* GetDiffFlowResults4th() const        {return this->fDiffFlowResults4thOrderGFC;};
64   
65   void SetDiffFlowResults6th(TH1D* const diff6th)  {this->fDiffFlowResults6thOrderGFC = diff6th;};
66   TH1D* GetDiffFlowResults6th() const        {return this->fDiffFlowResults6thOrderGFC;};
67   
68   void SetDiffFlowResults8th(TH1D* const diff8th)  {this->fDiffFlowResults8thOrderGFC = diff8th;};
69   TH1D* GetDiffFlowResults8th() const        {return this->fDiffFlowResults8thOrderGFC;};
70   
71   void SetCommonHistsResults2nd(AliFlowCommonHistResults* const chr2nd)  {this->fCommonHistsResults2nd = chr2nd;};
72   AliFlowCommonHistResults* GetCommonHistsResults2nd() const       {return this->fCommonHistsResults2nd;};
73   
74   void SetCommonHistsResults4th(AliFlowCommonHistResults* const chr4th)  {this->fCommonHistsResults4th = chr4th;};
75   AliFlowCommonHistResults* GetCommonHistsResults4th() const       {return this->fCommonHistsResults4th;};
76   
77   void SetCommonHistsResults6th(AliFlowCommonHistResults* const chr6th)  {this->fCommonHistsResults6th = chr6th;};
78   AliFlowCommonHistResults* GetCommonHistsResults6th() const       {return this->fCommonHistsResults6th;};
79   
80   void SetCommonHistsResults8th(AliFlowCommonHistResults* const chr8th)  {this->fCommonHistsResults8th = chr8th;};
81   AliFlowCommonHistResults* GetCommonHistsResults8th() const       {return this->fCommonHistsResults8th;};
82   
83   void SetIntFlowGenFun(TProfile2D* const ifgf)  {this->fIntFlowGenFun = ifgf;};
84   TProfile2D* GetIntFlowGenFun() const     {return this->fIntFlowGenFun;};
85
86   void SetIntFlowGenFun4(TProfile2D* const ifgf4)  {this->fIntFlowGenFun4 = ifgf4;}; //(only for other system of Eq.)
87   TProfile2D* GetIntFlowGenFun4() const      {return this->fIntFlowGenFun4;};  //(only for other system of Eq.)
88   
89   void SetIntFlowGenFun6(TProfile2D* const ifgf6)  {this->fIntFlowGenFun6 = ifgf6;}; //(only for other system of Eq.)
90   TProfile2D* GetIntFlowGenFun6() const      {return this->fIntFlowGenFun6;};  //(only for other system of Eq.)
91   
92   void SetIntFlowGenFun8(TProfile2D* const ifgf8)  {this->fIntFlowGenFun8 = ifgf8;}; //(only for other system of Eq.)
93   TProfile2D* GetIntFlowGenFun8() const      {return this->fIntFlowGenFun8;};  //(only for other system of Eq.)
94   
95   void SetIntFlowGenFun16(TProfile2D* const ifgf16)  {this->fIntFlowGenFun16 = ifgf16;}; //(only for other system of Eq.)
96   TProfile2D* GetIntFlowGenFun16() const       {return this->fIntFlowGenFun16;};   //(only for other system of Eq.)
97  
98   void SetAverageMultiplicity4(TProfile* const am4)     {this->fAvMultIntFlow4GFC = am4;};  //(only for other system of Eq.)
99   TProfile* GetAverageMultiplicity4() const       {return this->fAvMultIntFlow4GFC;}; //(only for other system of Eq.)
100   
101   void SetAverageMultiplicity6(TProfile* const am6)     {this->fAvMultIntFlow6GFC = am6;};  //(only for other system of Eq.)
102   TProfile* GetAverageMultiplicity6() const       {return this->fAvMultIntFlow6GFC;}; //(only for other system of Eq.)
103   
104   void SetAverageMultiplicity8(TProfile* const am8)     {this->fAvMultIntFlow8GFC = am8;};  //(only for other system of Eq.)
105   TProfile* GetAverageMultiplicity8() const       {return this->fAvMultIntFlow8GFC;}; //(only for other system of Eq.)
106   
107   void SetAverageMultiplicity16(TProfile* const am16)    {this->fAvMultIntFlow16GFC = am16;}; //(only for other system of Eq.)
108   TProfile* GetAverageMultiplicity16() const       {return this->fAvMultIntFlow16GFC;}; //(only for other system of Eq.)
109   
110   //----------------------------------------------------------------------------------------------------------
111   //RP = Reaction Plane (RP denotes particles used to determine the reaction plane)
112   void SetDiffFlowPtRPGenFunRe(TProfile3D* const dfRPPtgfRe)  {this->fDiffFlowPtRPGenFunRe = dfRPPtgfRe;};
113   TProfile3D* GetDiffFlowPtRPGenFunRe() const            {return this->fDiffFlowPtRPGenFunRe;};
114   
115   void SetDiffFlowPtRPGenFunIm(TProfile3D* const dfRPPtgfIm)  {this->fDiffFlowPtRPGenFunIm = dfRPPtgfIm;};
116   TProfile3D* GetDiffPtRPFlowGenFunIm() const            {return this->fDiffFlowPtRPGenFunIm;};
117   
118   void SetNumberOfParticlesPerPtBinRP(TProfile* const nopppbRP) {this->fPtBinRPNoOfParticles = nopppbRP;};
119   TProfile* GetNumberOfParticlesPerPtBinRP() const         {return this->fPtBinRPNoOfParticles;};  
120   
121   void SetDiffFlowEtaRPGenFunRe(TProfile3D* const dfEtaRPgfRe)   {this->fDiffFlowEtaRPGenFunRe = dfEtaRPgfRe;};
122   TProfile3D* GetDiffFlowEtaRPGenFunRe() const              {return this->fDiffFlowEtaRPGenFunRe;};
123   
124   void SetDiffFlowEtaRPGenFunIm(TProfile3D* const dfEtaRPgfIm)   {this->fDiffFlowEtaRPGenFunIm = dfEtaRPgfIm;};
125   TProfile3D* GetDiffFlowEtaRPGenFunIm() const              {return this->fDiffFlowEtaRPGenFunIm;};
126   
127   void SetNumberOfParticlesPerEtaBinRP(TProfile* const noppebRP)    {this->fEtaBinRPNoOfParticles = noppebRP;};
128   TProfile* GetNumberOfParticlesPerEtaBinRP() const            {return this->fEtaBinRPNoOfParticles;}; 
129   //----------------------------------------------------------------------------------------------------------
130    
131   //----------------------------------------------------------------------------------------------------------
132   //POI = Particles Of Interest (POI denotes particles of interest for the final physical results for int. and diff. flow)
133   void SetDiffFlowPtPOIGenFunRe(TProfile3D* const dfPOIPtgfRe)  {this->fDiffFlowPtPOIGenFunRe = dfPOIPtgfRe;};
134   TProfile3D* GetDiffFlowPtPOIGenFunRe() const            {return this->fDiffFlowPtPOIGenFunRe;};
135   
136   void SetDiffFlowPtPOIGenFunIm(TProfile3D* const dfPOIPtgfIm)  {this->fDiffFlowPtPOIGenFunIm = dfPOIPtgfIm;};
137   TProfile3D* GetDiffPtPOIFlowGenFunIm() const            {return this->fDiffFlowPtPOIGenFunIm;};
138   
139   void SetNumberOfParticlesPerPtBinPOI(TProfile* const nopppbPOI) {this->fPtBinPOINoOfParticles = nopppbPOI;};
140   TProfile* GetNumberOfParticlesPerPtBinPOI() const         {return this->fPtBinPOINoOfParticles;};  
141   
142   void SetDiffFlowEtaPOIGenFunRe(TProfile3D* const dfEtaPOIgfRe)   {this->fDiffFlowEtaPOIGenFunRe = dfEtaPOIgfRe;};
143   TProfile3D* GetDiffFlowEtaPOIGenFunRe() const              {return this->fDiffFlowEtaPOIGenFunRe;};
144   
145   void SetDiffFlowEtaPOIGenFunIm(TProfile3D* const dfEtaPOIgfIm)   {this->fDiffFlowEtaPOIGenFunIm = dfEtaPOIgfIm;};
146   TProfile3D* GetDiffFlowEtaPOIGenFunIm() const              {return this->fDiffFlowEtaPOIGenFunIm;};
147   
148   void SetNumberOfParticlesPerEtaBinPOI(TProfile* const noppebPOI)    {this->fEtaBinPOINoOfParticles = noppebPOI;};
149   TProfile* GetNumberOfParticlesPerEtaBinPOI() const            {return this->fEtaBinPOINoOfParticles;};  
150   //----------------------------------------------------------------------------------------------------------
151     
152   void SetAverageMultiplicity(TProfile* const am)      {this->fAvMultIntFlowGFC = am;};
153   TProfile* GetAverageMultiplicity() const       {return this->fAvMultIntFlowGFC;};
154   
155   void SetQVectorComponents(TProfile* const sqvc)    {this->fQVectorComponentsGFC = sqvc;};
156   TProfile* GetQVectorComponents() const       {return this->fQVectorComponentsGFC;};
157   
158   void SetCommonHists(AliFlowCommonHist* const ch)  {this->fCommonHists = ch;};
159   AliFlowCommonHist* GetCommonHists() const   {return this->fCommonHists;};
160   
161   void SetUsePhiWeights(Bool_t const uPhiW) {this->fUsePhiWeights = uPhiW;};
162   Bool_t GetUsePhiWeights() const {return this->fUsePhiWeights;};
163   
164   void SetUsePtWeights(Bool_t const uPtW) {this->fUsePtWeights = uPtW;};
165   Bool_t GetUsePtWeights() const {return this->fUsePtWeights;};
166   
167   void SetUseEtaWeights(Bool_t const uEtaW) {this->fUseEtaWeights = uEtaW;};
168   Bool_t GetUseEtaWeights() const {return this->fUseEtaWeights;};
169   
170   void SetAverageOfSquaredWeight(TProfile* const aosw) {this->fAverageOfSquaredWeight = aosw;};
171   TProfile* GetSumOfSquaredWeight() const {return this->fAverageOfSquaredWeight;}; 
172 //----------------------------------------------------------------------------------------------------------------
173  
174  private:
175   AliFlowAnalysisWithCumulants(const AliFlowAnalysisWithCumulants& afawc);
176   AliFlowAnalysisWithCumulants& operator=(const AliFlowAnalysisWithCumulants& afawc);
177   AliFlowTrackSimple* fTrack;                                   //track
178   static const Int_t fgkQmax = AliFlowCumuConstants::kQmax;     //needed for numerics
179   static const Int_t fgkPmax = AliFlowCumuConstants::kPmax;     //needed for numerics  
180   static const Int_t fgkQmax4 = AliFlowCumuConstants::kQmax4;   //needed for numerics (only for different system of Eq.)
181   static const Int_t fgkPmax4 = AliFlowCumuConstants::kPmax4;   //needed for numerics (only for different system of Eq.) 
182   static const Int_t fgkQmax6 = AliFlowCumuConstants::kQmax6;   //needed for numerics (only for different system of Eq.)
183   static const Int_t fgkPmax6 = AliFlowCumuConstants::kPmax6;   //needed for numerics (only for different system of Eq.) 
184   static const Int_t fgkQmax8 = AliFlowCumuConstants::kQmax8;   //needed for numerics (only for different system of Eq.)
185   static const Int_t fgkPmax8 = AliFlowCumuConstants::kPmax8;   //needed for numerics (only for different system of Eq.)  
186   static const Int_t fgkQmax16 = AliFlowCumuConstants::kQmax16; //needed for numerics (only for different system of Eq.)
187   static const Int_t fgkPmax16 = AliFlowCumuConstants::kPmax16; //needed for numerics (only for different system of Eq.)
188   static const Int_t fgkFlow = AliFlowCumuConstants::kFlow;     //integrated flow coefficient to be calculated
189   static const Int_t fgkMltpl = AliFlowCumuConstants::kMltpl;   //the multiple in p=m*n (diff. flow) 
190   TList* fHistList;                                             //list to hold all output histograms
191   TList* fWeightsList;                                          //list to hold all histograms with weights
192
193   Double_t fR0;         //needed for numerics
194   Double_t fPtMax;      //maximum pt
195   Double_t fPtMin;      //minimum pt
196   Double_t fBinWidthPt; //width of pt bin (in GeV)
197   Int_t    fgknBinsPt;  //number of pt bins
198   
199   Double_t fEtaMax;      //maximum pt
200   Double_t fEtaMin;      //minimum pt
201   Double_t fBinWidthEta; //width of pt bin (in GeV)
202   Int_t    fgknBinsEta;  //number of pt bins
203       
204   Double_t fAvQx;  //<Q_x>
205   Double_t fAvQy;  //<Q_y>
206   Double_t fAvQ2x; //<(Q_x)^2>
207   Double_t fAvQ2y; //<(Q_y)^2>
208
209   TProfile*          fAvMultIntFlowGFC; //average selected multiplicity
210  
211   TProfile*          fQVectorComponentsGFC; //averages of Q-vector components (1st bin: <Q_x>, 2nd bin: <Q_y>, 3rd bin: <(Q_x)^2>, 4th bin: <(Q_y)^2>)
212     
213   TH1D*              fIntFlowResultsGFC; //integrated flow final results
214   
215   TH1D*              fDiffFlowResults2ndOrderGFC; //differential flow final results (2nd order estimate) 
216   TH1D*              fDiffFlowResults4thOrderGFC; //differential flow final results (4th order estimate)
217   TH1D*              fDiffFlowResults6thOrderGFC; //differential flow final results (6th order estimate)
218   TH1D*              fDiffFlowResults8thOrderGFC; //differential flow final results (8th order estimate)
219   
220   AliFlowCommonHistResults*  fCommonHistsResults2nd; //final results for 2nd order int. and diff. flow stored in the common histograms 
221   AliFlowCommonHistResults*  fCommonHistsResults4th; //final results for 4th order int. and diff. flow stored in the common histograms 
222   AliFlowCommonHistResults*  fCommonHistsResults6th; //final results for 6th order int. and diff. flow stored in the common histograms
223   AliFlowCommonHistResults*  fCommonHistsResults8th; //final results for 8th order int. and diff. flow stored in the common histograms
224   
225   TProfile2D*        fIntFlowGenFun;   //avarage of the generating function for integrated flow 
226   
227   TProfile2D*        fIntFlowGenFun4;  //avarage of the generating function for integrated flow (only for different system of Eq.)
228   TProfile2D*        fIntFlowGenFun6;  //avarage of the generating function for integrated flow (only for different system of Eq.)
229   TProfile2D*        fIntFlowGenFun8;  //avarage of the generating function for integrated flow (only for different system of Eq.)
230   TProfile2D*        fIntFlowGenFun16; //avarage of the generating function for integrated flow (only for different system of Eq.)
231
232   TProfile*          fAvMultIntFlow4GFC;  //average selected multiplicity (only for different system of Eq.)
233   TProfile*          fAvMultIntFlow6GFC;  //average selected multiplicity (only for different system of Eq.) 
234   TProfile*          fAvMultIntFlow8GFC;  //average selected multiplicity (only for different system of Eq.)
235   TProfile*          fAvMultIntFlow16GFC; //average selected multiplicity (only for different system of Eq.)
236
237   //RP = Reaction Plane (RP denotes particles used to determine the reaction plane)                                                       
238   TProfile3D*        fDiffFlowPtRPGenFunRe; //avarage of the generating function for differential flow in Pt (real part)
239   TProfile3D*        fDiffFlowPtRPGenFunIm; //avarage of the generating function for differential flow in Pt (imaginary part)
240   TProfile*          fPtBinRPNoOfParticles; //number of particles per pt bin
241   TProfile3D*        fDiffFlowEtaRPGenFunRe; //avarage of the generating function for differential flow in Eta (real part)
242   TProfile3D*        fDiffFlowEtaRPGenFunIm; //avarage of the generating function for differential flow in Eta (imaginary part)
243   TProfile*          fEtaBinRPNoOfParticles; //number of particles per eta bin
244                                     
245   //POI = Particles Of Interest (POI denotes particles of interest for the final physical results for int. and diff. flow)                                                        
246   TProfile3D*        fDiffFlowPtPOIGenFunRe; //avarage of the generating function for differential flow in Pt (real part)
247   TProfile3D*        fDiffFlowPtPOIGenFunIm; //avarage of the generating function for differential flow in Pt (imaginary part)
248   TProfile*          fPtBinPOINoOfParticles; //number of particles per pt bin
249   TProfile3D*        fDiffFlowEtaPOIGenFunRe; //avarage of the generating function for differential flow in Eta (real part)
250   TProfile3D*        fDiffFlowEtaPOIGenFunIm; //avarage of the generating function for differential flow in Eta (imaginary part)
251   TProfile*          fEtaBinPOINoOfParticles; //number of particles per eta bin
252   
253   /*
254   TProfile2D *fDiffFlowGenFunRe0,*fDiffFlowGenFunRe1,*fDiffFlowGenFunRe2,*fDiffFlowGenFunRe3;//differential flow 
255   TProfile2D *fDiffFlowGenFunRe4,*fDiffFlowGenFunRe5,*fDiffFlowGenFunRe6,*fDiffFlowGenFunRe7;//differential flow
256   TProfile2D *fDiffFlowGenFunIm0,*fDiffFlowGenFunIm1,*fDiffFlowGenFunIm2,*fDiffFlowGenFunIm3;//differential flow
257   TProfile2D *fDiffFlowGenFunIm4,*fDiffFlowGenFunIm5,*fDiffFlowGenFunIm6,*fDiffFlowGenFunIm7;//differential flow
258   */
259  
260   AliFlowCommonHist* fCommonHists;      //common control histograms
261   
262   Bool_t fOtherEquations; //numerical equations for cumulants solved up to different highest order 
263   
264   Bool_t fUsePhiWeights;  //phi weights
265   Bool_t fUsePtWeights;   //v_2(pt) weights
266   Bool_t fUseEtaWeights;  //v_2(eta) weights
267   
268   TProfile* fAverageOfSquaredWeight; //<w^2>      
269   
270   ClassDef(AliFlowAnalysisWithCumulants, 0);
271 };
272
273 //================================================================================================================
274
275 #endif
276
277
278
279
280