coverity 15108 fixed
[u/mrichter/AliRoot.git] / FMD / flow / AliFMDFlowAxis.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 an Axis in a Flow "histogram" */
97e94238 21#ifndef ALIFMDFLOWAXIS_H
22#define ALIFMDFLOWAXIS_H
39eefe19 23#ifndef ROOT_TObject
24# include <TObject.h>
25#endif
97e94238 26// Axis object for the
27// AliFMDFlowBinned1D and
28// AliFMDFlowBinned2D
29// "histograms" of objects
30// of class AliFMDFlowBin.
31//
39eefe19 32
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.
37 @ingroup c_binned
38*/
39class AliFMDFlowAxis : public TObject
40{
41public:
9b98d361 42 /** Default constructor - do not use */
43 AliFMDFlowAxis() : fN(0), fBins(0) {}
39eefe19 44 /** Constructor
45 @param n Number of bins
46 @param bins Bin limits (@a n+1 entries) */
47 AliFMDFlowAxis(UShort_t n, Double_t* bins);
48 /** Constructor
49 @param n Number of bins
50 @param min Minimum
51 @param max Maximum */
52 AliFMDFlowAxis(UShort_t n, Double_t min, Double_t max);
53 /** Copy constructor
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);
59 /** Destructor */
60 virtual ~AliFMDFlowAxis();
61 /** Find a bin
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 */
9b98d361 84 UShort_t N() const { return fN-1; }
824e71c1 85 /** Print the axis */
86 void Print(Option_t* option="") const; //*MENU*
39eefe19 87protected:
88 /** Number of bins */
9b98d361 89 Int_t fN; // Number of bins
97e94238 90 /** Borders of the bins */
9b98d361 91 Double_t* fBins; //[fN] Bin boundaries
39eefe19 92 /** Define for ROOT I/O */
93 ClassDef(AliFMDFlowAxis,1);
94};
95
96
97#endif
98//
99// EOF
100//