]>
Commit | Line | Data |
---|---|---|
2219d590 | 1 | // -*- mode: C++ -*- |
97e94238 | 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 | */ | |
39eefe19 | 19 | /** @file |
20 | @brief Declaration of a 2-dimensional Flow "histogram" */ | |
97e94238 | 21 | //____________________________________________________________________ |
22 | // | |
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 | |
28 | // TestFlow.C | |
29 | #ifndef ALIFMDFLOWBINNED2D_H | |
30 | #define ALIFMDFLOWBINNED2D_H | |
39eefe19 | 31 | #include <flow/AliFMDFlowAxis.h> |
32 | #include <TObject.h> | |
33 | ||
34 | // Forward declaration | |
35 | class AliFMDFlowBin; | |
36 | class TBrowser; | |
37 | ||
38 | //______________________________________________________ | |
39 | /** @class AliFMDFlowBinned2D flow/AliFMDFlowBinned2D.h <flow/AliFMDFlowBinned2D.h> | |
40 | @brief A 2 dimensional "histogram" of objects of class AliFMDFlowBin. | |
41 | @ingroup c_binned */ | |
42 | class AliFMDFlowBinned2D : public TObject | |
43 | { | |
44 | public: | |
45 | /** Constructor | |
46 | @param order Order of the harmonic | |
47 | @param nxbins Number of X bins. | |
48 | @param xbins Borders of X bins (@a nxbins+1 entries) | |
49 | @param nybins Number of Y bins. | |
50 | @param ybins Borders of Y bins (@a nybins+1 entries) */ | |
51 | AliFMDFlowBinned2D(UShort_t order, | |
52 | UShort_t nxbins, Double_t* xbins, | |
53 | UShort_t nybins, Double_t* ybins); | |
54 | /** Constructor | |
55 | @param order Order of the harmonic | |
56 | @param xaxis Axis object | |
57 | @param yaxis Axis object */ | |
58 | AliFMDFlowBinned2D(UShort_t order, const AliFMDFlowAxis& xaxis, | |
59 | const AliFMDFlowAxis& yaxis); | |
60 | ||
61 | /** Copy constructor */ | |
62 | AliFMDFlowBinned2D(const AliFMDFlowBinned2D& other); | |
63 | /** Copy constructor */ | |
64 | AliFMDFlowBinned2D& operator=(const AliFMDFlowBinned2D& other); | |
65 | /** Destructor */ | |
66 | virtual ~AliFMDFlowBinned2D(); | |
67 | ||
68 | /** Called at the beginning of an event */ | |
69 | virtual void Begin(); | |
70 | /** Called at the end of an event */ | |
71 | virtual void End(); | |
72 | /** Called to add a contribution to the event plane | |
73 | @param x Bin to fill into | |
74 | @param y Bin to fill into | |
75 | @param phi The angle @f$ \varphi@f$ in radians | |
76 | @param w Weight | |
77 | @param a If true, add to sub-event A, otherwise sub-event B */ | |
78 | virtual Bool_t AddToEventPlane(Double_t x, Double_t y, Double_t phi, | |
79 | Double_t w, Bool_t a); | |
80 | /** Called to add a contribution to the harmonic | |
81 | @param x Bin to fill into | |
82 | @param y Bin to fill into | |
83 | @param phi The angle @f$ \varphi@f$ in radians */ | |
84 | virtual Bool_t AddToHarmonic(Double_t x, Double_t y, Double_t phi); | |
85 | /** Process a full event. | |
86 | @param phis List of @a n @f$ \varphi=[0,2\pi]@f$ angles | |
87 | @param xs List of @a n @f$ x@f$ values. | |
88 | @param ys List of @a n @f$ y@f$ values. | |
89 | @param ws Weights | |
90 | @param n Size of @a phis and @a xs */ | |
91 | virtual void Event(Double_t* phis, Double_t* xs, Double_t* ys, | |
92 | Double_t* ws, ULong_t n); | |
93 | /** Called at the end of a run */ | |
94 | virtual void Finish(); | |
95 | /** Get the bin at @a x | |
96 | @param x The bin value to find a flow object for. | |
97 | @param y The bin value to find a flow object for. | |
98 | @return The flow object at @a x,y or 0 if out of range */ | |
99 | virtual AliFMDFlowBin* GetBin(Double_t x, Double_t y) const; | |
100 | /** Get the bin at @a x | |
101 | @param i The bin index to find a flow object for. | |
102 | @param j The bin index to find a flow object for. | |
103 | @return The flow object at @a i,j or 0 if out of range */ | |
104 | virtual AliFMDFlowBin* GetBin(UShort_t i, UShort_t j) const; | |
105 | /** Whether this is to be considered a folder */ | |
106 | Bool_t IsFolder() const { return kTRUE; } | |
107 | /** Browse this object */ | |
108 | void Browse(TBrowser* b); | |
109 | protected: | |
110 | /** X axis */ | |
97e94238 | 111 | AliFMDFlowAxis fXAxis; // X axis |
39eefe19 | 112 | /** Y axis */ |
97e94238 | 113 | AliFMDFlowAxis fYAxis; // Y axis |
39eefe19 | 114 | /** Array of the flow objects */ |
97e94238 | 115 | AliFMDFlowBin** fBins; // Bins |
39eefe19 | 116 | /** Define for ROOT I/O */ |
117 | ClassDef(AliFMDFlowBinned2D,1); | |
118 | }; | |
119 | ||
120 | ||
121 | #endif | |
122 | // | |
123 | // EOF | |
124 | // | |
125 |