]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithScalarProduct.h
added histograms
[u/mrichter/AliRoot.git] / PWG2 / FLOW / AliFlowCommon / AliFlowAnalysisWithScalarProduct.h
1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2  * See cxx source for full Copyright notice                               */
3
4 /* $Id$ */
5
6
7 #ifndef ALIFLOWANALYSISWITHSCALARPRODUCT_H
8 #define ALIFLOWANALYSISWITHSCALARPRODUCT_H
9
10 #include "TString.h"
11
12 class AliFlowTrackSimple;
13 class AliFlowEventSimple;
14 class AliFlowCommonHist;
15 class AliFlowCommonHistResults;
16
17 class TH1D;
18 class TH2D;
19 class TProfile;
20 class TList;
21 class TFile;
22 class Riostream;
23 class TDirectoryFile;
24
25 /////////////////////////////////////////////////////////////////////////////
26 // Description: Maker to analyze Flow from the Scalar Product method.
27 //               
28 // authors: N. van der Kolk (kolk@nikhef.nl), A. Bilandzic (anteb@nikhef.nl)              
29 /////////////////////////////////////////////////////////////////////////////
30  
31 class AliFlowAnalysisWithScalarProduct {
32
33  public:
34  
35    AliFlowAnalysisWithScalarProduct();            //default constructor
36    virtual  ~AliFlowAnalysisWithScalarProduct();  //destructor
37  
38    void    Init();                                          //defines variables and histograms
39    void    Make(AliFlowEventSimple* anEvent);               //calculates variables and fills histograms
40    void    GetOutputHistograms(TList *outputListHistos);    //get pointers to all output histograms (called before Finish()) 
41    void    Finish();                                        //saves histograms
42    void    WriteHistograms(TString* outputFileName);        //writes histograms locally
43    void    WriteHistograms(TString outputFileName);         //writes histograms locally
44    void    WriteHistograms(TDirectoryFile *outputFileName); //writes histograms locally
45     
46    Double_t CalculateStatisticalError(Int_t bin, 
47                                       Double_t aStatErrorQaQb,
48                                       TProfile* aHistProUQ, 
49                                       TProfile* aHistProUQQaQb, 
50                                       TH1D** aHistSumOfWeights);
51
52    void    SetDebug(Bool_t kt)   { this->fDebug = kt ; }
53    Bool_t  GetDebug() const      { return this->fDebug ; }
54
55
56    void     SetRelDiffMsub(Double_t diff) { this->fRelDiffMsub = diff; }
57    Double_t GetRelDiffMsub() const        { return this->fRelDiffMsub; }
58
59    //phi weights
60    void    SetWeightsList(TList* const aWeightsList)  {this->fWeightsList = (TList*)aWeightsList->Clone();}
61    TList*  GetWeightsList() const                     {return this->fWeightsList;}  
62    void    SetUsePhiWeights(Bool_t const aPhiW)       {this->fUsePhiWeights = aPhiW;}
63    Bool_t  GetUsePhiWeights() const                   {return this->fUsePhiWeights;}
64
65    // Output 
66    TList*    GetHistList() const    { return this->fHistList ; }     // Gets output histogram list
67    //histogram getters
68    TProfile* GetHistProUQetaRP() const  {return this->fHistProUQetaRP;} 
69    TProfile* GetHistProUQetaPOI() const {return this->fHistProUQetaPOI;}
70    TProfile* GetHistProUQPtRP() const   {return this->fHistProUQPtRP;} 
71    TProfile* GetHistProUQPtPOI() const  {return this->fHistProUQPtPOI;}
72    TProfile* GetHistProQaQb() const     {return this->fHistProQaQb;}
73    TProfile* GetHistProQaQbNorm() const {return this->fHistProQaQbNorm;}
74    TH1D*     GetHistSumOfLinearWeights() const    {return this->fHistSumOfLinearWeights;}
75    TH1D*     GetHistSumOfQuadraticWeights() const {return this->fHistSumOfQuadraticWeights;}
76
77    TProfile* GetHistProUQQaQbPtRP() const   {return this->fHistProUQQaQbPtRP;}   
78    TProfile* GetHistProUQQaQbEtaRP() const  {return this->fHistProUQQaQbEtaRP;}   
79    TProfile* GetHistProUQQaQbPtPOI() const  {return this->fHistProUQQaQbPtPOI;}   
80    TProfile* GetHistProUQQaQbEtaPOI() const {return this->fHistProUQQaQbEtaPOI;} 
81    TH1D*     GetHistSumOfWeightsPtRP(Int_t i) const    {return this->fHistSumOfWeightsPtRP[i];}
82    TH1D*     GetHistSumOfWeightsEtaRP(Int_t i) const   {return this->fHistSumOfWeightsEtaRP[i];}
83    TH1D*     GetHistSumOfWeightsPtPOI(Int_t i) const   {return this->fHistSumOfWeightsPtPOI[i];}
84    TH1D*     GetHistSumOfWeightsEtaPOI(Int_t i) const  {return this->fHistSumOfWeightsEtaPOI[i];}
85
86    AliFlowCommonHist*        GetCommonHists() const    {return this->fCommonHists; }
87    AliFlowCommonHistResults* GetCommonHistsRes() const {return this->fCommonHistsRes; }
88
89    TH1D* GetHistQaQb() const       {return this->fHistQaQb;}
90    TH1D* GetHistQaQbNorm() const   {return this->fHistQaQbNorm;}
91    TH1D* GetHistQaQbCos() const    {return this->fHistQaQbCos;}
92    TH1D* GetHistResolution() const {return this->fHistResolution;}
93    TH1D* GetHistQaNorm() const     {return this->fHistQaNorm;}
94    TH2D* GetHistQaNormvsMa() const {return this->fHistQaNormvsMa;}
95    TH1D* GetHistQbNorm() const     {return this->fHistQbNorm;}
96    TH2D* GetHistQbNormvsMb() const {return this->fHistQbNormvsMb;}
97    TH2D* GetMavsMb() const         {return this->fHistMavsMb;}
98
99    //histogram setters
100    void SetHistProUQetaRP(TProfile* const aHistProUQetaRP)   
101      {this->fHistProUQetaRP = aHistProUQetaRP;}
102    void SetHistProUQetaPOI(TProfile* const aHistProUQetaPOI) 
103      {this->fHistProUQetaPOI = aHistProUQetaPOI;}
104    void SetHistProUQPtRP(TProfile* const aHistProUQPtRP)     
105      {this->fHistProUQPtRP = aHistProUQPtRP;}
106    void SetHistProUQPtPOI(TProfile* const aHistProUQPtPOI)   
107      {this->fHistProUQPtPOI = aHistProUQPtPOI;}
108    void SetHistProQaQb(TProfile* const aHistProQaQb)         
109      {this->fHistProQaQb = aHistProQaQb;}
110    void SetHistProQaQbNorm(TProfile* const aHistProQaQbNorm)         
111      {this->fHistProQaQbNorm = aHistProQaQbNorm;}
112    void SetHistSumOfLinearWeights(TH1D* const aHistSumOfLinearWeights) 
113      {this->fHistSumOfLinearWeights = aHistSumOfLinearWeights;}
114    void SetHistSumOfQuadraticWeights(TH1D* const aHistSumOfQuadraticWeights) 
115      {this->fHistSumOfQuadraticWeights = aHistSumOfQuadraticWeights;}
116
117    void SetHistProUQQaQbPtRP(TProfile* const aHistProUQQaQbPtRP)     
118      {this->fHistProUQQaQbPtRP = aHistProUQQaQbPtRP;}   
119    void SetHistProUQQaQbEtaRP(TProfile* const aHistProUQQaQbEtaRP)   
120      {this->fHistProUQQaQbEtaRP = aHistProUQQaQbEtaRP;}   
121    void SetHistProUQQaQbPtPOI(TProfile* const aHistProUQQaQbPtPOI)   
122      {this->fHistProUQQaQbPtPOI = aHistProUQQaQbPtPOI;}   
123    void SetHistProUQQaQbEtaPOI(TProfile* const aHistProUQQaQbEtaPOI) 
124      {this->fHistProUQQaQbEtaPOI = aHistProUQQaQbEtaPOI;}
125    void SetHistSumOfWeightsPtRP(TH1D* const aHistSumOfWeightsPtRP, Int_t const i) 
126      {this->fHistSumOfWeightsPtRP[i] = aHistSumOfWeightsPtRP;}   
127    void SetHistSumOfWeightsEtaRP(TH1D* const aHistSumOfWeightsEtaRP, Int_t const i) 
128      {this->fHistSumOfWeightsEtaRP[i] = aHistSumOfWeightsEtaRP;}   
129    void SetHistSumOfWeightsPtPOI(TH1D* const aHistSumOfWeightsPtPOI, Int_t const i) 
130      {this->fHistSumOfWeightsPtPOI[i] = aHistSumOfWeightsPtPOI;}  
131    void SetHistSumOfWeightsEtaPOI(TH1D* const aHistSumOfWeightsEtaPOI, Int_t const i) 
132      {this->fHistSumOfWeightsEtaPOI[i] = aHistSumOfWeightsEtaPOI;}   
133
134    void SetCommonHists(AliFlowCommonHist* const someCommonHists)              
135      {this->fCommonHists = someCommonHists; }
136    void SetCommonHistsRes(AliFlowCommonHistResults* const someCommonHistsRes) 
137      {this->fCommonHistsRes = someCommonHistsRes; }
138
139    void SetHistQaQb(TH1D* const aHistQaQb)
140      {this->fHistQaQb = aHistQaQb;}
141    void SetHistQaQbNorm(TH1D* const aHistQaQbNorm)
142      {this->fHistQaQbNorm = aHistQaQbNorm;}
143    void SetHistQaQbCos(TH1D* const aHistQaQbCos)
144      {this->fHistQaQbCos = aHistQaQbCos;}
145    void SetHistResolution(TH1D* const aHistResolution)
146      {this->fHistResolution = aHistResolution;}
147    void SetHistQaNorm(TH1D* const aHistQaNorm)
148      {this->fHistQaNorm = aHistQaNorm;}
149    void SetHistQaNormvsMa(TH2D* const aHistQaNormvsMa)
150      {this->fHistQaNormvsMa = aHistQaNormvsMa;}
151    void SetHistQbNorm(TH1D* const aHistQbNorm)
152      {this->fHistQbNorm = aHistQbNorm;}
153    void SetHistQbNormvsMb(TH2D* const aHistQbNormvsMb)
154      {this->fHistQbNormvsMb = aHistQbNormvsMb;}
155    void SetHistMavsMb(TH2D* const aHistMavsMb)
156      {this->fHistMavsMb = aHistMavsMb;}
157    
158  private:
159    AliFlowAnalysisWithScalarProduct(const AliFlowAnalysisWithScalarProduct& anAnalysis);            //copy constructor
160    AliFlowAnalysisWithScalarProduct& operator=(const AliFlowAnalysisWithScalarProduct& anAnalysis); //assignment operator 
161       
162    Int_t      fEventNumber;      // event counter
163    Bool_t     fDebug ;           // flag for analysis: more print statements
164
165    Double_t   fRelDiffMsub;      // the relative difference the two subevent multiplicities can have
166
167    TList*     fWeightsList;      // list holding input histograms with phi weights
168    Bool_t     fUsePhiWeights;    // use phi weights
169    TH1F*      fPhiWeights;       // histogram holding phi weights
170
171    TList*     fHistList;         //list to hold all output histograms  
172
173    TProfile*  fHistProUQetaRP;   //uQ(eta) for RP
174    TProfile*  fHistProUQetaPOI;  //uQ(eta) for POI
175    TProfile*  fHistProUQPtRP;    //uQ(pt) for RP
176    TProfile*  fHistProUQPtPOI;   //uQ(pt) for POI
177    TProfile*  fHistProQaQb;      //average of QaQb 
178    TProfile*  fHistProQaQbNorm;  //average of QaQb/MaMb
179    TH1D*      fHistSumOfLinearWeights;     //holds sum of Ma*Mb
180    TH1D*      fHistSumOfQuadraticWeights;  //holds sum of (Ma*Mb)^2
181    
182    TProfile*  fHistProUQQaQbPtRP;         //holds weighted average of <QuQaQb>
183    TProfile*  fHistProUQQaQbEtaRP;        //holds weighted average of <QuQaQb>
184    TProfile*  fHistProUQQaQbPtPOI;        //holds weighted average of <QuQaQb>
185    TProfile*  fHistProUQQaQbEtaPOI;       //holds weighted average of <QuQaQb>
186    TH1D*      fHistSumOfWeightsPtRP[3];   //holds sums of 0: Mq-1, 1: (Mq-1)^2, 2: (Mq-1)*Ma*Mb for each bin
187    TH1D*      fHistSumOfWeightsEtaRP[3];  //holds sums of 0: Mq-1, 1: (Mq-1)^2, 2: (Mq-1)*Ma*Mb for each bin
188    TH1D*      fHistSumOfWeightsPtPOI[3];  //holds sums of 0: Mq-1, 1: (Mq-1)^2, 2: (Mq-1)*Ma*Mb for each bin
189    TH1D*      fHistSumOfWeightsEtaPOI[3]; //holds sums of 0: Mq-1, 1: (Mq-1)^2, 2: (Mq-1)*Ma*Mb for each bin
190    
191    AliFlowCommonHist*        fCommonHists;    //control histograms
192    AliFlowCommonHistResults* fCommonHistsRes; //results histograms
193    
194    TH1D*      fHistQaQb;         // distribution of QaQb
195    TH1D*      fHistQaQbNorm;     // distribution of QaQb/MaMb
196    TH1D*      fHistQaQbCos;      // distribution of the angle between Qa and Qb (from Acos (va*vb))
197    TH1D*      fHistResolution;   // distribution of cos(2(phi_a - phi_b))
198    TH1D*      fHistQaNorm;       // distribution of Qa/Ma
199    TH2D*      fHistQaNormvsMa;   // distribution of Qa/Ma vs Ma
200    TH1D*      fHistQbNorm;       // distribution of Qb/Mb
201    TH2D*      fHistQbNormvsMb;   // distribution of Qb/Mb vs Mb
202    TH2D*      fHistMavsMb;       // Ma vs Mb
203       
204    ClassDef(AliFlowAnalysisWithScalarProduct,0)  // macro for rootcint
205      };
206  
207
208 #endif