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 2-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 ALIFMDFLOWBINNED2D_H
30 #define ALIFMDFLOWBINNED2D_H
34 #include <TAttMarker.h>
35 #include <flow/AliFMDFlowAxis.h>
37 // Forward declaration
39 class AliFMDFlowSplitter;
43 //______________________________________________________
44 /** @class AliFMDFlowBinned2D flow/AliFMDFlowBinned2D.h <flow/AliFMDFlowBinned2D.h>
45 @brief A 2 dimensional "histogram" of objects of class AliFMDFlowBin.
47 class AliFMDFlowBinned2D : public TNamed,
54 @param order Order of the harmonic
55 @param nxbins Number of X bins.
56 @param xbins Borders of X bins (@a nxbins+1 entries)
57 @param nybins Number of Y bins.
58 @param ybins Borders of Y bins (@a nybins+1 entries) */
59 AliFMDFlowBinned2D(const char* name, const char* title, UShort_t order,
60 UShort_t nxbins, Double_t* xbins,
61 UShort_t nybins, Double_t* ybins,
62 AliFMDFlowSplitter* splitter=0);
64 @param order Order of the harmonic
65 @param xaxis Axis object
66 @param yaxis Axis object */
67 AliFMDFlowBinned2D(const char* name, const char* title, UShort_t order,
68 const AliFMDFlowAxis& xaxis, const AliFMDFlowAxis& yaxis,
69 AliFMDFlowSplitter* splitter=0);
71 /** Copy constructor */
72 AliFMDFlowBinned2D(const AliFMDFlowBinned2D& other);
73 /** Copy constructor */
74 AliFMDFlowBinned2D& operator=(const AliFMDFlowBinned2D& other);
76 virtual ~AliFMDFlowBinned2D();
78 /** Called at the beginning of an event */
80 /** Called at the end of an event */
82 /** Called to add a contribution to the event plane
83 @param x Bin to fill into
84 @param y Bin to fill into
85 @param phi The angle @f$ \varphi@f$ in radians
87 @param a If true, add to sub-event A, otherwise sub-event B */
88 virtual Bool_t AddToEventPlane(Double_t x, Double_t y, Double_t phi,
89 Double_t w, Bool_t a);
90 /** Called to add a contribution to the harmonic
91 @param x Bin to fill into
92 @param y Bin to fill into
93 @param phi The angle @f$ \varphi@f$ in radians
94 @param wp The event plane angle weight
95 @param wh The harmonic weight */
96 virtual Bool_t AddToHarmonic(Double_t x, Double_t y, Double_t phi,
97 Double_t wp, Double_t wh);
98 /** Process a full event.
99 @param phis List of @a n @f$ \varphi=[0,2\pi]@f$ angles
100 @param xs List of @a n @f$ x@f$ values.
101 @param ys List of @a n @f$ y@f$ values.
102 @param wp Weights for event plane
103 @param wh Weights for harmonic
104 @param n Size of @a phis and @a xs */
105 virtual void Event(ULong_t n, Double_t* phis, Double_t* xs, Double_t* ys,
106 Double_t* wp=0, Double_t* wh=0);
107 /** Called at the end of a run */
108 virtual void Finish();
109 /** Get the bin at @a x
110 @param x The bin value to find a flow object for.
111 @param y The bin value to find a flow object for.
112 @return The flow object at @a x,y or 0 if out of range */
113 virtual AliFMDFlowBin* GetBin(Double_t x, Double_t y) const;
114 /** Get the bin at @a x
115 @param i The bin index to find a flow object for.
116 @param j The bin index to find a flow object for.
117 @return The flow object at @a i,j or 0 if out of range */
118 virtual AliFMDFlowBin* GetBin(UShort_t i, UShort_t j) const;
119 /** Whether this is to be considered a folder */
120 Bool_t IsFolder() const { return kTRUE; }
121 /** Browse this object */
122 void Browse(TBrowser* b);
125 AliFMDFlowAxis fXAxis; // X axis
127 AliFMDFlowAxis fYAxis; // Y axis
128 /** Array of the flow objects */
129 AliFMDFlowBin** fBins; // Bins
130 /** The event splitter used. */
131 AliFMDFlowSplitter* fSplitter;
132 /** Define for ROOT I/O */
133 ClassDef(AliFMDFlowBinned2D,1);