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