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 an Axis in a Flow "histogram" */
21 #ifndef ALIFMDFLOWAXIS_H
22 #define ALIFMDFLOWAXIS_H
26 // Axis object for the
27 // AliFMDFlowBinned1D and
29 // "histograms" of objects
30 // of class AliFMDFlowBin.
33 //______________________________________________________
34 /** @class AliFMDFlowAxis flow/AliFMDFlowAxis.h <flow/AliFMDFlowAxis.h>
35 @brief Axis object for the AliFMDFlowBinned1D and
36 AliFMDFlowBinned2D "histograms" of objects of class AliFMDFlowBin.
39 class AliFMDFlowAxis : public TObject
42 /** Default constructor - do not use */
43 AliFMDFlowAxis() : fN(0), fBins(0) {}
45 @param n Number of bins
46 @param bins Bin limits (@a n+1 entries) */
47 AliFMDFlowAxis(UShort_t n, Double_t* bins);
49 @param n Number of bins
52 AliFMDFlowAxis(UShort_t n, Double_t min, Double_t max);
54 @param other Object to copy from */
55 AliFMDFlowAxis(const AliFMDFlowAxis& other);
56 /** Assignement operator
57 @param other Object to assign from */
58 AliFMDFlowAxis& operator=(const AliFMDFlowAxis& other);
60 virtual ~AliFMDFlowAxis();
62 @param v Value to look for
63 @return bin number of @a v */
64 Int_t FindBin(Double_t v) const;
65 /** Get the width of the @a i th bin
66 @param i Bin to get width of */
67 Double_t BinWidth(UShort_t i) const;
68 /** Get the center of a bin
69 @param i Bin to get center of
70 @return Center of the @a i th bin */
71 Double_t BinCenter(UShort_t i) const;
72 /** Get the lower limit of a bin
73 @param i Bin to get the lower limit of
74 @return lower limit of bin @a i */
75 Double_t BinLower(UShort_t i) const;
76 /** Get the upper limit of a bin
77 @param i Bin to get the upper limit of
78 @return upper limit of bin @a i */
79 Double_t BinUpper(UShort_t i) const;
80 /** Get a pointer to the bins
81 @return pointer to the bins */
82 Double_t* Bins() const { return fBins; }
83 /** Get the number of bins */
84 UShort_t N() const { return fN-1; }
86 void Print(Option_t* option="") const; //*MENU*
89 Int_t fN; // Number of bins
90 /** Borders of the bins */
91 Double_t* fBins; //[fN] Bin boundaries
92 /** Define for ROOT I/O */
93 ClassDef(AliFMDFlowAxis,1);