]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/flow/AliFMDFlowHarmonic.h
Added some fancy flow stuff and scripts
[u/mrichter/AliRoot.git] / FMD / flow / AliFMDFlowHarmonic.h
1 // -*- mode: C++ -*-
2 /* Copyright (C) 2007 Christian Holm Christensen <cholm@nbi.dk>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 2.1 of
7  * the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
17  * USA
18  */
19 /** @file 
20     @brief Declaration of a Harmonic class */
21 //____________________________________________________________________
22 //
23 // Calculate the nth order harmonic. 
24 // Input is the phis of the observations,
25 // and the resolution of the event plane. 
26 // The class derives from AliFMDFlowStat to easy calculating the mean
27 // and the square variance of the harmonic. 
28 #ifndef ALIFMDFLOWHARMONIC_H
29 #define ALIFMDFLOWHARMONIC_H
30 #include <flow/AliFMDFlowStat.h>
31 #include <TH2D.h>
32 class TBrowser;
33
34 /** @defgroup a_basic Basic classes for doing Flow analysis. 
35     @brief This group of class handles the low-level stuff to do
36     flow analysis. */
37 //______________________________________________________
38 /** @class AliFMDFlowHarmonic flow/AliFMDFlowHarmonic.h <flow/AliFMDFlowHarmonic.h>
39     @brief Calculate the @f$ n^{th}@f$ order harmonic
40     @ingroup a_basic 
41
42     Calculate the @f$ n^{th}@f$ order harmonic, given by 
43     @f{eqnarray*}
44     v_n       &=& \frac{v_n^{obs}}{R}\\
45     v_n^{obs} &=& \frac1M\sum_i^M\cos(n (\varphi_i - \Psi))
46     @f}
47     where @f$ R@f$ is the resolution, @f$ i@f$ runs over all @f$
48     M@f$ observations of @f$ \varphi_i@f$ in all events, and
49     @f$\Psi@f$ is the estimated event plane. 
50
51     The error on the corrected value is given by 
52     @f{eqnarray*} 
53     \delta^2v_n & = & \left(\frac{dv_n}{dv_n^{obs}}\right)^2\delta^2
54     v_n^{obs} + \left(\frac{dv_n}{dR}\right)^2\delta^2R \\ 
55     & = & \frac{\delta^2v_n^{obs} R^2 + \delta^2R (v_n^{obs})^2}
56     {R^4}
57     @f}
58 */    
59 class AliFMDFlowHarmonic : public AliFMDFlowStat
60 {
61 public:
62   /** Constructor 
63       @param n Order of the harmonic */
64   AliFMDFlowHarmonic(UShort_t n=0);
65   /** Destructor */ 
66   virtual ~AliFMDFlowHarmonic() {}
67   /** Copy constructor 
68       @param o Object to copy from. */
69   AliFMDFlowHarmonic(const AliFMDFlowHarmonic& o);
70   /** Assignment operator  
71       @param o Object to assign from
72       @return Reference to this object. */
73   AliFMDFlowHarmonic& operator=(const AliFMDFlowHarmonic& o);
74   
75   /** @{ 
76       @name Processing */
77   /** Add a data point 
78       @param phi    The absolute angle @f$ \varphi \in[0,2\pi]@f$ 
79       @param psi    The event plane angle @f$ \Psi \in[0,2\pi] @f$
80       @param weight The weight of the observation */
81   void Add(Double_t phi, Double_t psi, Double_t weight=1);
82   /** @} */
83
84   /** @{ 
85       @name Information */
86   /** Get the harmonic. 
87       @param r   Event plane resolution 
88       @param er2 Square error on event plane resolution 
89       @param e2  On return the square error 
90       @return The harmonic value */
91   Double_t Value(Double_t r, Double_t er2, Double_t& e2) const;
92   /** Get the order of the harmonic */
93   UShort_t Order() const { return fOrder; }
94   /** @} */
95
96   /** @{ 
97       @name Utility */
98   /** This is a folder */ 
99   Bool_t IsFolder() const { return kTRUE; }
100   /** Browse this object */ 
101   void Browse(TBrowser* b);
102   /** Print content */
103   void Print(Option_t* option="") const;
104   /** @} */
105
106   /** @{ 
107       @name histograms */ 
108   /** @return Contrib histogram */
109   const TH1& ContribHistogram() const { return fContrib; }
110   /** @return Phi histogram */
111   const TH1& PhiHistogram() const { return fPhi; }
112   /** @return Nphi histogram */
113   const TH1& NPhiHistogram() const { return fNPhi; }
114   /** @return Weight histogram */
115   const TH1& WeightHistogram() const { return fWeight; }
116   /** @} */
117 protected:
118   /** the order */ 
119   UShort_t fOrder; // Order 
120   /** Histogram of angles */ 
121   TH1D fPhi;
122   /** Histogram of angles */ 
123   TH1D fNPhi;
124   /** Histogram of weights */ 
125   TH1D fWeight;
126   /** cos(n(phi-psi)) vs (phi-psi) */
127   TH2D fContrib;
128   /** Define for ROOT I/O */ 
129   ClassDef(AliFMDFlowHarmonic,1);
130 };
131
132
133 #endif
134 //
135 // EOF
136 //
137