2 /* Copyright (C) 2007 Christian Holm Christensen <cholm@nbi.dk>
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.
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.
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
20 @brief Declaration of a 1-dimensional Flow "histogram" */
21 //____________________________________________________________________
23 // A histogram of flow bins. The axis can by anything
24 // (pseudo-rapidity, transvers momentum) - there's no assumption on
25 // what is the basis of the histogram. The method Event can be used
26 // to calculate everything in one go. Alternatively, one can use the
27 // methods AddToEventPlane and AddToHarmonic. See also the example
29 #ifndef ALIFMDFLOWBINNED1D_H
30 #define ALIFMDFLOWBINNED1D_H
31 #include <flow/AliFMDFlowAxis.h>
35 #include <TAttMarker.h>
37 // Forward declaration
39 class AliFMDFlowSplitter;
43 //______________________________________________________
44 /** @class AliFMDFlowBinned1D flow/AliFMDFlowBinned1D.h <flow/AliFMDFlowBinned1D.h>
45 @brief A 1 dimensional "histogram" of objects of class AliFMDFlowBin.
49 class AliFMDFlowBinned1D : public TNamed,
55 /** Default constructor */
58 @param order Order of the harmonic
59 @param nxbins Number of X bins.
60 @param xbins Borders of X bins (@a nxbins+1 entries)
61 @param splitter Event splitter (is adopted by this object) */
62 AliFMDFlowBinned1D(const char* name, const char* title,
63 UShort_t order, UShort_t k,
64 UShort_t nxbins, Double_t* xbins,
65 AliFMDFlowSplitter* splitter=0);
67 @param order Order of the harmonic
68 @param xaxis Axis object
69 @param splitter Event splitter (is adopted by this object) */
70 AliFMDFlowBinned1D(const char* name, const char* title,
71 UShort_t order, UShort_t k,
72 const AliFMDFlowAxis& xaxis,
73 AliFMDFlowSplitter* splitter=0);
74 /** Copy constructor */
75 AliFMDFlowBinned1D(const AliFMDFlowBinned1D& other);
76 /** Copy constructor */
77 AliFMDFlowBinned1D& operator=(const AliFMDFlowBinned1D& other);
79 virtual ~AliFMDFlowBinned1D();
83 /** Called at the beginning of an event */
85 /** Called at the end of an event */
87 /** Called to add a contribution to the event plane
88 @param x Bin to fill into
90 @param phi The angle @f$ \varphi@f$ in radians
91 @param a If true, add to sub-event A, otherwise sub-event B */
92 virtual Bool_t AddToEventPlane(Double_t x, Double_t phi,
93 Double_t w, Bool_t a);
94 /** Called to add a contribution to the harmonic
95 @param x Bin to fill into
96 @param phi The angle @f$ \varphi@f$ in radians
97 @param wp optional weight of event plane
98 @param wh optional weight of harmonic */
99 virtual Bool_t AddToHarmonic(Double_t x, Double_t phi,
100 Double_t wp=1, Double_t wh=1);
101 /** Process a full event.
102 @param phis List of @a n @f$ \varphi=[0,2\pi]@f$ angles
103 @param xs List of @a n @f$ x@f$ values.
104 @param wp Weights of event plane (0 or @a n long)
105 @param wh Weights of harmonic (0 or @a n long)
106 @param n Size of @a phis and @a xs */
107 virtual void Event(ULong_t n, Double_t* phis, Double_t* xs,
108 Double_t* ws=0, Double_t* wh=0);
109 /** Called at the end of a run */
110 virtual void Finish();
115 /** Get the bin at @a x
116 @param x The bin value to find a flow object for.
117 @return The flow object at @a x or 0 if out of range */
118 virtual AliFMDFlowBin* GetBin(Double_t x) const;
120 @param i The bin number to get
121 @return The flow object in bin @a i or 0 if out of range */
122 virtual AliFMDFlowBin* GetBin(UShort_t i) const;
127 /** Get the harmonic order
128 @return The harmonic order */
129 virtual UShort_t Order() const;
130 /** Get the harmonic order
131 @return The harmonic order */
132 virtual UShort_t PsiOrder() const;
137 /** Print to standard out */
138 virtual void Print(Option_t* option="s") const; //*MENU*
139 /** Make a histogram */
140 virtual TH1* MakeHistogram(UInt_t which, UInt_t what);
141 /** Draw as a histogram
142 @param option Option string.
143 - s Draw STAR method.
145 - n Draw Naive method
147 - r Draw resolution rather than harmonic.
149 virtual void Draw(Option_t* option="stnb"); //*MENU*
150 /** Whether this is to be considered a folder */
151 Bool_t IsFolder() const { return kTRUE; }
152 /** Browse this object */
153 void Browse(TBrowser* b);
157 AliFMDFlowAxis fXAxis; // Axis
158 /** Number of bins */
160 /** Array of the flow objects */
161 AliFMDFlowBin** fBins; //[fN] Bins
162 /** The event splitter used. */
163 AliFMDFlowSplitter* fSplitter;
164 /** Define for ROOT I/O */
165 ClassDef(AliFMDFlowBinned1D,1);