]> git.uio.no Git - u/mrichter/AliRoot.git/blame - FMD/flow/AliFMDFlowBinned1D.h
Updates needed for full jet reconstruction (charged + emcal) [Magali Estienne]
[u/mrichter/AliRoot.git] / FMD / flow / AliFMDFlowBinned1D.h
CommitLineData
39eefe19 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 1-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 ALIFMDFLOWBINNED1D_H
30#define ALIFMDFLOWBINNED1D_H
39eefe19 31#include <flow/AliFMDFlowAxis.h>
9b98d361 32#include <TNamed.h>
33#include <TAttLine.h>
34#include <TAttFill.h>
35#include <TAttMarker.h>
39eefe19 36
37// Forward declaration
38class AliFMDFlowBin;
9b98d361 39class AliFMDFlowSplitter;
39eefe19 40class TBrowser;
9b98d361 41class TH1;
39eefe19 42
43//______________________________________________________
44/** @class AliFMDFlowBinned1D flow/AliFMDFlowBinned1D.h <flow/AliFMDFlowBinned1D.h>
45 @brief A 1 dimensional "histogram" of objects of class AliFMDFlowBin.
46 @ingroup c_binned
47 @example test_flow.cxx
48 @example ana_flow.cxx
49*/
9b98d361 50class AliFMDFlowBinned1D : public TNamed,
51 public TAttLine,
52 public TAttFill,
53 public TAttMarker
39eefe19 54{
55public:
9b98d361 56 /** Default constructor */
57 AliFMDFlowBinned1D();
39eefe19 58 /** Constructor
59 @param order Order of the harmonic
60 @param nxbins Number of X bins.
9b98d361 61 @param xbins Borders of X bins (@a nxbins+1 entries)
62 @param splitter Event splitter (is adopted by this object) */
63 AliFMDFlowBinned1D(const char* name, const char* title,
64 UShort_t order, UShort_t k,
65 UShort_t nxbins, Double_t* xbins,
66 AliFMDFlowSplitter* splitter=0);
39eefe19 67 /** Constructor
68 @param order Order of the harmonic
9b98d361 69 @param xaxis Axis object
70 @param splitter Event splitter (is adopted by this object) */
71 AliFMDFlowBinned1D(const char* name, const char* title,
72 UShort_t order, UShort_t k,
73 const AliFMDFlowAxis& xaxis,
74 AliFMDFlowSplitter* splitter=0);
39eefe19 75 /** Copy constructor */
76 AliFMDFlowBinned1D(const AliFMDFlowBinned1D& other);
77 /** Copy constructor */
78 AliFMDFlowBinned1D& operator=(const AliFMDFlowBinned1D& other);
79 /** Destructor */
80 virtual ~AliFMDFlowBinned1D();
9b98d361 81
82 /** @{
83 @name Processing */
39eefe19 84 /** Called at the beginning of an event */
85 virtual void Begin();
86 /** Called at the end of an event */
87 virtual void End();
88 /** Called to add a contribution to the event plane
89 @param x Bin to fill into
90 @param w Weight
91 @param phi The angle @f$ \varphi@f$ in radians
92 @param a If true, add to sub-event A, otherwise sub-event B */
93 virtual Bool_t AddToEventPlane(Double_t x, Double_t phi,
94 Double_t w, Bool_t a);
95 /** Called to add a contribution to the harmonic
96 @param x Bin to fill into
9b98d361 97 @param phi The angle @f$ \varphi@f$ in radians
98 @param wp optional weight of event plane
99 @param wh optional weight of harmonic */
100 virtual Bool_t AddToHarmonic(Double_t x, Double_t phi,
101 Double_t wp=1, Double_t wh=1);
39eefe19 102 /** Process a full event.
103 @param phis List of @a n @f$ \varphi=[0,2\pi]@f$ angles
104 @param xs List of @a n @f$ x@f$ values.
9b98d361 105 @param wp Weights of event plane (0 or @a n long)
106 @param wh Weights of harmonic (0 or @a n long)
39eefe19 107 @param n Size of @a phis and @a xs */
9b98d361 108 virtual void Event(ULong_t n, Double_t* phis, Double_t* xs,
109 Double_t* ws=0, Double_t* wh=0);
39eefe19 110 /** Called at the end of a run */
111 virtual void Finish();
9b98d361 112 /** @} */
113
114 /** @{
115 @name Bins */
39eefe19 116 /** Get the bin at @a x
117 @param x The bin value to find a flow object for.
118 @return The flow object at @a x or 0 if out of range */
119 virtual AliFMDFlowBin* GetBin(Double_t x) const;
120 /** Get the bin @a i
121 @param i The bin number to get
122 @return The flow object in bin @a i or 0 if out of range */
123 virtual AliFMDFlowBin* GetBin(UShort_t i) const;
9b98d361 124 /** @} */
125
126 /** @{
127 @name Orders */
128 /** Get the harmonic order
129 @return The harmonic order */
130 virtual UShort_t Order() const;
131 /** Get the harmonic order
132 @return The harmonic order */
133 virtual UShort_t PsiOrder() const;
134 /** @} */
135
136 /** @{
137 @name Information */
39eefe19 138 /** Print to standard out */
824e71c1 139 virtual void Print(Option_t* option="s") const; //*MENU*
9b98d361 140 /** Make a histogram */
141 virtual TH1* MakeHistogram(UInt_t which, UInt_t what);
824e71c1 142 /** Draw as a histogram
143 @param option Option string.
144 - s Draw STAR method.
145 - t Draw TDR method
146 - n Draw Naive method
147 - b Draw bare method
148 - r Draw resolution rather than harmonic.
149 */
150 virtual void Draw(Option_t* option="stnb"); //*MENU*
39eefe19 151 /** Whether this is to be considered a folder */
152 Bool_t IsFolder() const { return kTRUE; }
153 /** Browse this object */
154 void Browse(TBrowser* b);
9b98d361 155 /** @} */
39eefe19 156protected:
157 /** X axis */
97e94238 158 AliFMDFlowAxis fXAxis; // Axis
9b98d361 159 /** Number of bins */
160 Int_t fN;
39eefe19 161 /** Array of the flow objects */
9b98d361 162 AliFMDFlowBin** fBins; //[fN] Bins
163 /** The event splitter used. */
164 AliFMDFlowSplitter* fSplitter;
39eefe19 165 /** Define for ROOT I/O */
166 ClassDef(AliFMDFlowBinned1D,1);
167};
168
169#endif
170//
171// EOF
172//