more for weigths
[u/mrichter/AliRoot.git] / PWG2 / FLOW / AliFlowAnalysisWithQCumulants.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 Q-cumulants * 
9  *                                * 
10  * author:  Ante Bilandzic        * 
11  *           (anteb@nikhef.nl)    *
12  *********************************/ 
13
14 #ifndef ALIFLOWANALYSISWITHQCUMULANTS_H
15 #define ALIFLOWANALYSISWITHQCUMULANTS_H
16
17 #include "AliFlowCommonConstants.h"//needed as include
18
19 class TObjArray;
20 class TList;
21 class TFile;
22 class TGraph;
23
24 class TH1;
25 class TProfile;
26
27 class AliFlowEventSimple;
28 class AliFlowTrackSimple;
29 class AliFlowVector;
30
31 class AliFlowCommonHist;
32 class AliFlowCommonHistResults;
33
34 //================================================================================================================
35
36 class AliFlowAnalysisWithQCumulants{
37  public:
38   AliFlowAnalysisWithQCumulants();
39   virtual ~AliFlowAnalysisWithQCumulants(); 
40   
41   virtual void Init();
42   virtual void Make(AliFlowEventSimple* anEvent);
43   virtual void Finish();
44   virtual void WriteHistograms(TString outputFileName);
45  
46 //----------------------------------------------------------------------------------------------------------------
47 //                                            setters and getters                                                 
48 //----------------------------------------------------------------------------------------------------------------
49   TList* GetHistList() const {return this->fHistList;} //output histogram list
50  
51   void SetIntFlowResults(TH1D* const ifr) {this->fIntFlowResultsQC = ifr;};
52   TH1D* GetIntFlowResults() const {return this->fIntFlowResultsQC;};
53   
54   void SetDiffFlowResults2nd(TH1D* const diff2nd) {this->fDiffFlowResults2ndOrderQC = diff2nd;};
55   TH1D* GetDiffFlowResults2nd() const {return this->fDiffFlowResults2ndOrderQC;};
56   
57   void SetDiffFlowResults4th(TH1D* const diff4th) {this->fDiffFlowResults4thOrderQC = diff4th;};
58   TH1D* GetDiffFlowResults4th() const {return this->fDiffFlowResults4thOrderQC;};
59   
60   void SetCovariances(TH1D* const cov) {this->fCovariances = cov;};
61   TH1D* GetCovariances() const {return this->fCovariances;};
62   
63   void SetCommonHists2nd(AliFlowCommonHist* const ch2nd) {this->fCommonHists2nd = ch2nd;};
64   AliFlowCommonHist* GetCommonHists2nd() const {return this->fCommonHists2nd;};
65   
66   void SetCommonHists4th(AliFlowCommonHist* const ch4th) {this->fCommonHists4th = ch4th;};
67   AliFlowCommonHist* GetCommonHists4th() const {return this->fCommonHists4th;};
68   
69   void SetCommonHists6th(AliFlowCommonHist* const ch6th) {this->fCommonHists6th = ch6th;};
70   AliFlowCommonHist* GetCommonHists6th() const {return this->fCommonHists6th;};
71   
72   void SetCommonHists8th(AliFlowCommonHist* const ch8th) {this->fCommonHists8th = ch8th;};
73   AliFlowCommonHist* GetCommonHists8th() const {return this->fCommonHists8th;};
74   
75   void SetCommonHistsResults2nd(AliFlowCommonHistResults* const chr2nd) {this->fCommonHistsResults2nd = chr2nd;};
76   AliFlowCommonHistResults* GetCommonHistsResults2nd() const {return this->fCommonHistsResults2nd;};
77   
78   void SetCommonHistsResults4th(AliFlowCommonHistResults* const chr4th) {this->fCommonHistsResults4th = chr4th;};
79   AliFlowCommonHistResults* GetCommonHistsResults4th() const {return this->fCommonHistsResults4th;};
80   
81   void SetCommonHistsResults6th(AliFlowCommonHistResults* const chr6th) {this->fCommonHistsResults6th = chr6th;};
82   AliFlowCommonHistResults* GetCommonHistsResults6th() const {return this->fCommonHistsResults6th;};
83   
84   void SetCommonHistsResults8th(AliFlowCommonHistResults* const chr8th) {this->fCommonHistsResults8th = chr8th;};
85   AliFlowCommonHistResults* GetCommonHistsResults8th() const {return this->fCommonHistsResults8th;};
86   
87   void SetAverageMultiplicity(TProfile* const am) {this->fAvMultIntFlowQC = am;};
88   TProfile* GetAverageMultiplicity() const {return this->fAvMultIntFlowQC;};
89   
90   void SetQvectorForEachEventX(TProfile* const qvfeex) {this->fQvectorForEachEventX = qvfeex;};
91   TProfile* GetQvectorForEachEventX() const {return this->fQvectorForEachEventX;};
92
93   void SetQvectorForEachEventY(TProfile* const qvfeey) {this->fQvectorForEachEventY = qvfeey;};
94   TProfile* GetQvectorForEachEventY() const {return this->fQvectorForEachEventY;};
95         
96   void SetQCorrelations(TProfile* const QCorr) {this->fQCorrelations = QCorr;};
97   TProfile* GetQCorrelations() const {return this->fQCorrelations;};
98   
99   void SetQProduct(TProfile* const qp) {this->fQProduct = qp;};
100   TProfile* GetQProduct() const {return this->fQProduct;};
101   
102   void SetQVectorComponents(TProfile* const qvc) {this->fQvectorComponents = qvc;};
103   TProfile* GetQVectorComponents() const {return this->fQvectorComponents;};
104   
105   void SetTwo1n1nPerPtBinRP(TProfile* const pb2PerPtBin1n1nRP) {this->f2PerPtBin1n1nRP = pb2PerPtBin1n1nRP;};
106   TProfile* GetTwo1n1nPerPtBinRP() const {return this->f2PerPtBin1n1nRP;};
107   
108   void SetTwo2n2nPerPtBinRP(TProfile* const pb2PerPtBin2n2nRP) {this->f2PerPtBin2n2nRP = pb2PerPtBin2n2nRP;};
109   TProfile* GetTwo2n2nPerPtBinRP() const {return this->f2PerPtBin2n2nRP;};
110   
111   void SetThree2n1n1nPerPtBinRP(TProfile* const pb3PerPtBin2n1n1nRP) {this->f3PerPtBin2n1n1nRP = pb3PerPtBin2n1n1nRP;};
112   TProfile* GetThree2n1n1nPerPtBinRP() const {return this->f3PerPtBin2n1n1nRP;};
113   
114   void SetThree1n1n2nPerPtBinRP(TProfile* const pb3PerPtBin1n1n2nRP) {this->f3PerPtBin1n1n2nRP = pb3PerPtBin1n1n2nRP;};
115   TProfile* GetThree1n1n2nPerPtBinRP() const {return this->f3PerPtBin1n1n2nRP;};
116   
117   void SetFour1n1n1n1nPerPtBinRP(TProfile* const pb4PerPtBin1n1n1n1nRP) {this->f4PerPtBin1n1n1n1nRP = pb4PerPtBin1n1n1n1nRP;};
118   TProfile* GetFour1n1n1n1nPerPtBinRP() const {return this->f4PerPtBin1n1n1n1nRP;}; 
119   
120   void SetTwo1n1nPerEtaBinRP(TProfile* const pb2PerEtaBin1n1nRP) {this->f2PerEtaBin1n1nRP = pb2PerEtaBin1n1nRP;};
121   TProfile* GetTwo1n1nPerEtaBinRP() const {return this->f2PerEtaBin1n1nRP;};
122   
123   void SetTwo2n2nPerEtaBinRP(TProfile* const pb2PerEtaBin2n2nRP) {this->f2PerEtaBin2n2nRP = pb2PerEtaBin2n2nRP;};
124   TProfile* GetTwo2n2nPerEtaBinRP() const {return this->f2PerEtaBin2n2nRP;};
125   
126   void SetThree2n1n1nPerEtaBinRP(TProfile* const pb3PerEtaBin2n1n1nRP) {this->f3PerEtaBin2n1n1nRP = pb3PerEtaBin2n1n1nRP;};
127   TProfile* GetThree2n1n1nPerEtaBinRP() const {return this->f3PerEtaBin2n1n1nRP;};
128   
129   void SetThree1n1n2nPerEtaBinRP(TProfile* const pb3PerEtaBin1n1n2nRP) {this->f3PerEtaBin1n1n2nRP = pb3PerEtaBin1n1n2nRP;};
130   TProfile* GetThree1n1n2nPerEtaBinRP() const {return this->f3PerEtaBin1n1n2nRP;};
131   
132   void SetFour1n1n1n1nPerEtaBinRP(TProfile* const pb4PerEtaBin1n1n1n1nRP) {this->f4PerEtaBin1n1n1n1nRP = pb4PerEtaBin1n1n1n1nRP;};
133   TProfile* GetFour1n1n1n1nPerEtaBinRP() const {return this->f4PerEtaBin1n1n1n1nRP;}; 
134   
135   void SetTwo1n1nPerPtBinPOI(TProfile* const pb2PerPtBin1n1nPOI) {this->f2PerPtBin1n1nPOI = pb2PerPtBin1n1nPOI;};
136   TProfile* GetTwo1n1nPerPtBinPOI() const {return this->f2PerPtBin1n1nPOI;};
137   
138   void SetTwo2n2nPerPtBinPOI(TProfile* const pb2PerPtBin2n2nPOI) {this->f2PerPtBin2n2nPOI = pb2PerPtBin2n2nPOI;};
139   TProfile* GetTwo2n2nPerPtBinPOI() const {return this->f2PerPtBin2n2nPOI;};
140   
141   void SetThree2n1n1nPerPtBinPOI(TProfile* const pb3PerPtBin2n1n1nPOI) {this->f3PerPtBin2n1n1nPOI = pb3PerPtBin2n1n1nPOI;};
142   TProfile* GetThree2n1n1nPerPtBinPOI() const {return this->f3PerPtBin2n1n1nPOI;};
143   
144   void SetThree1n1n2nPerPtBinPOI(TProfile* const pb3PerPtBin1n1n2nPOI) {this->f3PerPtBin1n1n2nPOI = pb3PerPtBin1n1n2nPOI;};
145   TProfile* GetThree1n1n2nPerPtBinPOI() const {return this->f3PerPtBin1n1n2nPOI;};
146   
147   void SetFour1n1n1n1nPerPtBinPOI(TProfile* const pb4PerPtBin1n1n1n1nPOI) {this->f4PerPtBin1n1n1n1nPOI = pb4PerPtBin1n1n1n1nPOI;};
148   TProfile* GetFour1n1n1n1nPerPtBinPOI() const {return this->f4PerPtBin1n1n1n1nPOI;}; 
149   
150   void SetTwo1n1nPerEtaBinPOI(TProfile* const pb2PerEtaBin1n1nPOI) {this->f2PerEtaBin1n1nPOI = pb2PerEtaBin1n1nPOI;};
151   TProfile* GetTwo1n1nPerEtaBinPOI() const {return this->f2PerEtaBin1n1nPOI;};
152   
153   void SetTwo2n2nPerEtaBinPOI(TProfile* const pb2PerEtaBin2n2nPOI) {this->f2PerEtaBin2n2nPOI = pb2PerEtaBin2n2nPOI;};
154   TProfile* GetTwo2n2nPerEtaBinPOI() const {return this->f2PerEtaBin2n2nPOI;};
155   
156   void SetThree2n1n1nPerEtaBinPOI(TProfile* const pb3PerEtaBin2n1n1nPOI) {this->f3PerEtaBin2n1n1nPOI = pb3PerEtaBin2n1n1nPOI;};
157   TProfile* GetThree2n1n1nPerEtaBinPOI() const {return this->f3PerEtaBin2n1n1nPOI;};
158   
159   void SetThree1n1n2nPerEtaBinPOI(TProfile* const pb3PerEtaBin1n1n2nPOI) {this->f3PerEtaBin1n1n2nPOI = pb3PerEtaBin1n1n2nPOI;};
160   TProfile* GetThree1n1n2nPerEtaBinPOI() const {return this->f3PerEtaBin1n1n2nPOI;};
161   
162   void SetFour1n1n1n1nPerEtaBinPOI(TProfile* const pb4PerEtaBin1n1n1n1nPOI) {this->f4PerEtaBin1n1n1n1nPOI = pb4PerEtaBin1n1n1n1nPOI;};
163   TProfile* GetFour1n1n1n1nPerEtaBinPOI() const {return this->f4PerEtaBin1n1n1n1nPOI;}; 
164   
165   void SetDirectCorrelations(TProfile* const dc) {this->fDirectCorrelations = dc;};
166   TProfile* GetDirectCorrelations() const {return this->fDirectCorrelations;};
167   
168   void SetPhiWeights(TH1F const phiW) { this->fPhiWeights = phiW; this->fUsePhiWeights = kTRUE;};
169   TH1F GetPhiWeights() const { return this->fPhiWeights;};
170   
171   void SetPtWeights(TH1D const ptW) { this->fPtWeights = ptW; ; this->fUsePtWeights = kTRUE;};
172   TH1D GetPtWeights() const { return this->fPtWeights;};
173   
174   void SetEtaWeights(TH1D const etaW) { this->fEtaWeights = etaW; ; this->fUseEtaWeights = kTRUE;};
175   TH1D GetEtaWeights() const { return this->fEtaWeights;};
176 //----------------------------------------------------------------------------------------------------------------
177  
178  private:
179   AliFlowAnalysisWithQCumulants(const AliFlowAnalysisWithQCumulants& afawQc);
180   AliFlowAnalysisWithQCumulants& operator=(const AliFlowAnalysisWithQCumulants& afawQc);
181   
182   AliFlowTrackSimple* fTrack;                           //track
183   TList*              fHistList;                        //list to hold all output histograms
184   TProfile*           fAvMultIntFlowQC;                 //average selected multiplicity (for int. flow)
185  
186   TProfile*           fQvectorComponents;               //averages of Q-vector components (1st bin: <Q_x>, 2nd bin: <Q_y>, ...)
187             
188   TH1D*               fIntFlowResultsQC;                //integrated flow results from Q-cumulants
189   TH1D*               fDiffFlowResults2ndOrderQC;       //differential flow results from 2nd order Q-cumulant
190   TH1D*               fDiffFlowResults4thOrderQC;       //differential flow results from 4th order Q-cumulant
191   TH1D*               fCovariances;                     //final results for covariances: 1st bin: <2*4>-<2>*<4>, 2nd bin: <2*6>-<2>*<6>, ...
192   
193   TProfile*                  fQvectorForEachEventX;     //profile containing the x-components of Q-vectors from all events (to be removed)  
194   TProfile*                  fQvectorForEachEventY;     //profile containing the y-components of Q-vectors from all events (to be removed)   
195   TProfile*                  fQCorrelations;            //multi-particle correlations calculated from Q-vectors 
196   TProfile*                  fQProduct;                 //average of products: 1st bin: <2*4>, 2nd bin: <2*6>, ...
197   
198   TProfile*                  fDirectCorrelations;       //multi-particle correlations calculated with nested loop  
199
200   //RP (Reaction Plane particles):  
201   TProfile*                  fPtReq1nRP;                //real part of q-vector evaluated in harmonic n for each pt-bin
202   TProfile*                  fPtImq1nRP;                //imaginary part of q-vector evaluated in harmonic n for each pt-bin
203   TProfile*                  fPtReq2nRP;                //real part of q-vector evaluated in harmonic 2n for each pt-bin
204   TProfile*                  fPtImq2nRP;                //imaginary part of q-vector evaluated in harmonic 2n for each pt-bin
205
206   TProfile*                  f2PerPtBin1n1nRP;          //<<2'>>_{n|n} per pt-bin
207   TProfile*                  f2PerPtBin2n2nRP;          //<<2'>>_{2n|2n} per pt-bin
208   TProfile*                  f3PerPtBin2n1n1nRP;        //<<3'>>_{2n|n,n} per pt-bin
209   TProfile*                  f3PerPtBin1n1n2nRP;        //<<3'>>_{n,n|2n} per pt-bin
210   TProfile*                  f4PerPtBin1n1n1n1nRP;      //<<4'>>_{n,n|n,n} per pt-bin
211   
212   TProfile*                  fEtaReq1nRP;               //real part of q-vector evaluated in harmonic n for each eta-bin
213   TProfile*                  fEtaImq1nRP;               //imaginary part of q-vector evaluated in harmonic n for each eta-bin
214   TProfile*                  fEtaReq2nRP;               //real part of q-vector evaluated in harmonic 2n for each eta-bin
215   TProfile*                  fEtaImq2nRP;               //imaginary part of q-vector evaluated in harmonic 2n for each eta-bin
216
217   TProfile*                  f2PerEtaBin1n1nRP;         //<<2'>>_{n|n} per eta-bin
218   TProfile*                  f2PerEtaBin2n2nRP;         //<<2'>>_{2n|2n} per eta-bin
219   TProfile*                  f3PerEtaBin2n1n1nRP;       //<<3'>>_{2n|n,n} per eta-bin
220   TProfile*                  f3PerEtaBin1n1n2nRP;       //<<3'>>_{n,n|2n} per eta-bin
221   TProfile*                  f4PerEtaBin1n1n1n1nRP;     //<<4'>>_{n,n|n,n} per eta-bin  
222
223   //POI (Particles Of Interest): 
224   TProfile*                  fPtReq1nPrimePOI;          //real part of q'-vector evaluated in harmonic n for each pt-bin
225   TProfile*                  fPtImq1nPrimePOI;          //imaginary part of q'-vector evaluated in harmonic n for each pt-bin
226   TProfile*                  fPtReq2nPrimePOI;          //real part of q'-vector evaluated in harmonic 2n for each pt-bin
227   TProfile*                  fPtImq2nPrimePOI;          //imaginary part of q'-vector evaluated in harmonic 2n for each pt-bin
228   TProfile*                  fmPrimePerPtBin;           //number of particles selected both as POI and not as RP per each pt-bin
229   
230   TProfile*                  fPtReq1nPrimePrimePOI;     //real part of q''-vector evaluated in harmonic n for each pt-bin
231   TProfile*                  fPtImq1nPrimePrimePOI;     //imaginary part of q''-vector evaluated in harmonic n for each pt-bin
232   TProfile*                  fPtReq2nPrimePrimePOI;     //real part of q''-vector evaluated in harmonic 2n for each pt-bin
233   TProfile*                  fPtImq2nPrimePrimePOI;     //imaginary part of q''-vector evaluated in harmonic 2n for each pt-bin
234   TProfile*                  fmPrimePrimePerPtBin;      //number of particles selected both as RP and POI per each pt-bin
235   
236   TProfile*                  fEtaReq1nPrimePOI;         //real part of q'-vector evaluated in harmonic n for each eta-bin
237   TProfile*                  fEtaImq1nPrimePOI;         //imaginary part of q'-vector evaluated in harmonic n for each eta-bin
238   TProfile*                  fEtaReq2nPrimePOI;         //real part of q'-vector evaluated in harmonic 2n for each eta-bin
239   TProfile*                  fEtaImq2nPrimePOI;         //imaginary part of q'-vector evaluated in harmonic 2n for each eta-bin
240   TProfile*                  fmPrimePerEtaBin;          //number of particles selected both as POI and not as RP per each eta-bin
241    
242   TProfile*                  fEtaReq1nPrimePrimePOI;    //real part of q''-vector evaluated in harmonic n for each eta-bin
243   TProfile*                  fEtaImq1nPrimePrimePOI;    //imaginary part of q''-vector evaluated in harmonic n for each eta-bin
244   TProfile*                  fEtaReq2nPrimePrimePOI;    //real part of q''-vector evaluated in harmonic 2n for each eta-bin
245   TProfile*                  fEtaImq2nPrimePrimePOI;    //imaginary part of q''-vector evaluated in harmonic 2n for each eta-bin
246   TProfile*                  fmPrimePrimePerEtaBin;     //number of particles selected both as RP and POI in each eta-bin
247  
248   TProfile*                  f2PerPtBin1n1nPOI;         //<<2'>>_{n|n} per pt-bin
249   TProfile*                  f2PerPtBin2n2nPOI;         //<<2'>>_{2n|2n} per pt-bin
250   TProfile*                  f3PerPtBin2n1n1nPOI;       //<<3'>>_{2n|n,n} per pt-bin
251   TProfile*                  f3PerPtBin1n1n2nPOI;       //<<3'>>_{n,n|2n} per pt-bin
252   TProfile*                  f4PerPtBin1n1n1n1nPOI;     //<<4'>>_{n,n|n,n} per pt-bin
253
254   TProfile*                  f2PerEtaBin1n1nPOI;        //<<2'>>_{n|n} per eta-bin
255   TProfile*                  f2PerEtaBin2n2nPOI;        //<<2'>>_{2n|2n} per eta-bin
256   TProfile*                  f3PerEtaBin2n1n1nPOI;      //<<3'>>_{2n|n,n} per eta-bin
257   TProfile*                  f3PerEtaBin1n1n2nPOI;      //<<3'>>_{n,n|2n} per eta-bin
258   TProfile*                  f4PerEtaBin1n1n1n1nPOI;    //<<4'>>_{n,n|n,n} per eta-bin  
259  
260   AliFlowCommonHist*         fCommonHists2nd;           //common control histograms (taking into account only the events with 2 and more particles) 
261   AliFlowCommonHist*         fCommonHists4th;           //common control histograms (taking into account only the events with 4 and more particles) 
262   AliFlowCommonHist*         fCommonHists6th;           //common control histograms (taking into account only the events with 6 and more particles) 
263   AliFlowCommonHist*         fCommonHists8th;           //common control histograms (taking into account only the events with 8 and more particles) 
264   
265   AliFlowCommonHistResults*  fCommonHistsResults2nd;    //final results for 2nd order int. and diff. flow stored in the common histograms 
266   AliFlowCommonHistResults*  fCommonHistsResults4th;    //final results for 4th order int. and diff. flow stored in the common histograms 
267   AliFlowCommonHistResults*  fCommonHistsResults6th;    //final results for 6th order int. and diff. flow stored in the common histograms
268   AliFlowCommonHistResults*  fCommonHistsResults8th;    //final results for 8th order int. and diff. flow stored in the common histograms
269       
270   TH1D*                      f2pDistribution;           //distribution of <2>_{n|n}
271   TH1D*                      f4pDistribution;           //distribution of <4>_{n,n|n,n}
272   TH1D*                      f6pDistribution;           //distribution of <6>_{n,n,n|n,n,n} 
273   TH1D*                      f8pDistribution;           //distribution of <8>_{n,n,n,n|n,n,n,n}
274  
275   Int_t                      fnBinsPt;                  //number of pt bins
276   Double_t                   fPtMin;                    //minimum pt   
277   Double_t                   fPtMax;                    //maximum pt    
278   
279   Int_t                      fnBinsEta;                 //number of eta bins
280   Double_t                   fEtaMin;                   //minimum eta   
281   Double_t                   fEtaMax;                   //maximum eta
282   Int_t                      fEventCounter;             //counting the number of events    
283    
284   Bool_t                     fUsePhiWeights;            // phi weights
285   Bool_t                     fUsePtWeights;             // v_2(pt) weights
286   Bool_t                     fUseEtaWeights;            // v_2(eta) weights
287   TH1F                       fPhiWeights;               // histogram with phi weights
288   TH1D                       fPtWeights;                // histogram with v_2(pt) weights   
289   TH1D                       fEtaWeights;               // histogram with v_2(eta) weights    
290                         
291   ClassDef(AliFlowAnalysisWithQCumulants, 0);
292 };
293
294 //================================================================================================================
295
296 #endif
297
298
299
300
301