]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/flow/AliFMDFlowBinned1D.h
Added drawing capabilities
[u/mrichter/AliRoot.git] / FMD / flow / AliFMDFlowBinned1D.h
1 // -*- mode: C++ -*-
2 /** @file 
3     @brief Declaration of a 1-dimensional Flow "histogram" */
4 #ifndef FLOW_BINNED1D_H
5 #define FLOW_BINNED1D_H
6 #include <flow/AliFMDFlowAxis.h>
7
8 // Forward declaration 
9 class AliFMDFlowBin;
10 class TBrowser;
11
12 //______________________________________________________
13 /** @class AliFMDFlowBinned1D flow/AliFMDFlowBinned1D.h <flow/AliFMDFlowBinned1D.h>
14     @brief A 1 dimensional "histogram" of objects of class AliFMDFlowBin. 
15     @ingroup c_binned 
16     @example test_flow.cxx 
17     @example ana_flow.cxx 
18 */
19 class AliFMDFlowBinned1D : public TObject
20 {
21 public:
22   /** Flags for print */
23   enum {
24     /** Show details */ 
25     details = 0x1, 
26     /** Show summary */ 
27     summary = 0x2
28   };
29   /** Constructor 
30       @param order    Order of the harmonic
31       @param nxbins   Number of X bins.
32       @param xbins    Borders of X bins (@a nxbins+1 entries) */
33   AliFMDFlowBinned1D(UShort_t order, UShort_t nxbins, Double_t* xbins);
34   /** Constructor 
35       @param order    Order of the harmonic
36       @param xaxis Axis object  */
37   AliFMDFlowBinned1D(UShort_t order, const AliFMDFlowAxis& xaxis);
38   /** Copy constructor */
39   AliFMDFlowBinned1D(const AliFMDFlowBinned1D& other);
40   /** Copy constructor */
41   AliFMDFlowBinned1D& operator=(const AliFMDFlowBinned1D& other);
42   /** Destructor */
43   virtual ~AliFMDFlowBinned1D();
44   
45   /** Called at the beginning of an event */
46   virtual void Begin();
47   /** Called at the end of an event */ 
48   virtual void End();
49   /** Called to add a contribution to the event plane 
50       @param x   Bin to fill into 
51       @param w   Weight
52       @param phi The angle @f$ \varphi@f$ in radians 
53       @param a   If true, add to sub-event A, otherwise sub-event B */ 
54   virtual Bool_t AddToEventPlane(Double_t x, Double_t phi, 
55                                  Double_t w, Bool_t a);
56   /** Called to add a contribution to the harmonic
57       @param x   Bin to fill into 
58       @param phi The angle @f$ \varphi@f$ in radians */
59   virtual Bool_t AddToHarmonic(Double_t x, Double_t phi);
60   /** Process a full event. 
61       @param phis List of @a n @f$ \varphi=[0,2\pi]@f$ angles 
62       @param xs   List of @a n @f$ x@f$ values. 
63       @param ws   Weights
64       @param n    Size of @a phis and @a xs */
65   virtual void Event(Double_t* phis, Double_t* xs, Double_t* ws, 
66                      ULong_t n);
67   /** Called at the end of a run */
68   virtual void Finish();
69   /** Get the bin at @a x 
70       @param x The bin value to find a flow object for. 
71       @return The flow object at @a x or 0 if out of range */ 
72   virtual AliFMDFlowBin* GetBin(Double_t x) const;
73   /** Get the bin @a i 
74       @param i The bin number to get
75       @return The flow object in bin @a i or 0 if out of range */ 
76   virtual AliFMDFlowBin* GetBin(UShort_t i) const;
77   /** Print to standard out */ 
78   virtual void Print(Option_t* option="s") const;  //*MENU*
79   /** Draw as a histogram
80       @param option Option string. 
81       - s  Draw STAR method. 
82       - t  Draw TDR method 
83       - n  Draw Naive method 
84       - b  Draw bare method 
85       - r  Draw resolution rather than harmonic. 
86   */
87   virtual void Draw(Option_t* option="stnb"); //*MENU*
88   /** Whether this is to be considered a folder */
89   Bool_t IsFolder() const { return kTRUE; }
90   /** Browse this object */ 
91   void Browse(TBrowser* b);
92 protected:
93   /** X axis */ 
94   AliFMDFlowAxis fXAxis;
95   /** Array of the flow objects */ 
96   AliFMDFlowBin** fBins;
97   /** Define for ROOT I/O */
98   ClassDef(AliFMDFlowBinned1D,1);
99 };
100
101 #endif
102 //
103 // EOF
104 //