]> git.uio.no Git - u/mrichter/AliRoot.git/blame - FMD/flow/AliFMDFlowBin.h
Added code to do flow analysis.
[u/mrichter/AliRoot.git] / FMD / flow / AliFMDFlowBin.h
CommitLineData
39eefe19 1// -*- mode: C++ -*-
2/** @file
3 @brief Declaration of a Bin in a Flow "histogram" */
4#ifndef FLOW_BIN_H
5#define FLOW_BIN_H
6#include <flow/AliFMDFlowEventPlane.h>
7#include <flow/AliFMDFlowHarmonic.h>
8#include <flow/AliFMDFlowResolution.h>
9#include <TObject.h>
10
11/** @defgroup c_binned Binned flow
12 @brief This group contains code for binned flow analysis. Two
13 kinds of "histograms" are defined - a 1 dimensional and a 2
14 dimensional set of binned objects of class AliFMDFlowBin.
15
16 Objects of class AliFMDFlowBin contains all the code needed to compute
17 flow in a given bin.
18
19 The class AliFMDFlowAxis encodes look-up of a object of class
20 AliFMDFlowBin in a flow "Histogram"
21*/
22//______________________________________________________
23/** @class AliFMDFlowBin flow/AliFMDFlowBin.h <flow/AliFMDFlowBin.h>
24 @brief A bin of flow.
25
26 This contains an of class AliFMDFlowHarmonic and an object of
27 class AliFMDFlowEventPlane to calculate @f$ v_n@f$ and
28 @f$\Psi_k@f$. It contain two objects of class
29 AliFMDFlowEventPlane to calculate the sub-event event planes
30 @f$\Psi_A, \Psi_B@f$. It also contain 3 objects of class
31 AliFMDFlowResolution to calculate the event plane angle
32 resolution.
33
34 @ingroup c_binned
35*/
36class AliFMDFlowBin : public TObject
37{
38public:
39 /** Correction type */
40 enum CorType {
41 /** No correction */
42 none,
43 /** Naive, using the formulas in Voloshins paper */
44 naive,
45 /** STARs way */
46 star,
47 /** The way used in the TDR */
48 tdr
49 };
50 /** Constructor */
51 AliFMDFlowBin(UShort_t order, UShort_t k=1)
52 : fPsi(order / k),
53 fPsiA(order / k),
54 fPsiB(order / k),
55 fRes(order / k),
56 fResStar(order / k),
57 fResTdr(order / k),
58 fHarmonic(order)
59 {}
60 /** Destructor */
61 virtual ~AliFMDFlowBin() {}
62 /** Should be called at the start of an event */
63 virtual void Begin();
64 /** Called to add a contribution to the event plane
65 @param phi The angle @f$ \varphi \in[0,2\pi]@f$
66 @param w Weight
67 @param a If true, add to sub-event A, otherwise to sub-event
68 B. */
69 virtual void AddToEventPlane(Double_t phi, Double_t w=1, Bool_t a=kTRUE);
70 /** Called to add a contribution to the harmonic.
71 @param phi The angle @f$ \varphi \in[0,2\pi]@f$
72 @param w Weight of @a phi (only used in the calculation of
73 the event plane). */
74 virtual void AddToHarmonic(Double_t phi, Double_t w=1);
75 /** Should be called at the end of an event */
76 virtual void End();
77 /** Analyse events
78 @param phis @f$ (\varphi_i, \ldots, \varphi_n)@f$
79 @param ws Weights (optional)
80 @param n Size of @a phis and possibly @a ws */
81 virtual void Event(Double_t* phis, Double_t* ws, UInt_t n);
82 /** Finish run */
83 virtual void Finish();
84 /** Get the value in this bin
85 @param t Which type of correction
86 @return the value of the harmonic */
87 virtual Double_t Value(CorType t=naive) const;
88 /** Get the value in this bin
89 @param t Which type of correction
90 @return the error on the value of the harmonic */
91 virtual Double_t EValue(CorType t=naive) const;
92 /** Get the value in this bin
93 @param e2 On return, the square error.
94 @param t Which type of correction
95 @return the value of the harmonic */
96 virtual Double_t Value(Double_t& e2, CorType t=naive) const;
97 /** Get the value in this bin
98 @param e2 On return, the square error.
99 @param t Which type of correction
100 @return the value of the harmonic */
101 virtual Double_t Correction(Double_t& e2, CorType t=naive) const;
102 /** Print summary to standard output */
103 virtual void Print(Option_t* option="") const;
104
105 /** Get the event plane angle */
106 virtual Double_t Psi() const { return fPsi.Psi(); }
107 /** Get the sub-event A plane angle */
108 virtual Double_t PsiA() const { return fPsiA.Psi(); }
109 /** Get the sub-event B plane angle */
110 virtual Double_t PsiB() const { return fPsiB.Psi(); }
111
112protected:
113 /** Major event plane */
114 AliFMDFlowEventPlane fPsi;
115 /** Sub-event A event plane */
116 AliFMDFlowEventPlane fPsiA;
117 /** Sub-event B event plane */
118 AliFMDFlowEventPlane fPsiB;
119 /** Resolution */
120 AliFMDFlowResolution fRes;
121 /** Resolution */
122 AliFMDFlowResolutionStar fResStar;
123 /** Resolution */
124 AliFMDFlowResolutionTDR fResTdr;
125 /** The harmonic */
126 AliFMDFlowHarmonic fHarmonic;
127 /** Define for ROOT I/O */
128 ClassDef(AliFMDFlowBin,1);
129};
130
131
132#endif
133//
134// EOF
135//