AliPhysics  1168478 (1168478)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TVariableBinning.h
Go to the documentation of this file.
1 #ifndef TVARIABLEBINNING_H
2 #define TVARIABLEBINNING_H
3 /* Copyright(c) 1998-2016, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice */
5 
6 #include <exception>
7 #include <Rtypes.h>
8 #include <TArrayD.h>
9 #include <TBinning.h>
10 
60 class TVariableBinning : public TBinning{
61 public:
62 
72  class LimitsNotSetException : public std::exception{
73  public:
74 
79 
83  virtual ~LimitsNotSetException() throw() {}
84 
89  virtual const char *what() const throw() { return "Limits needed for the linear binning are not set."; }
90  };
91 
96 
102  TVariableBinning(Int_t nbins, const Double_t* binedges);
103 
108  TVariableBinning(const TArrayD &binedges);
109 
113  virtual ~TVariableBinning() {}
114 
119  virtual TBinning *MakeCopy() const;
120 
126  inline void Set(Int_t nbins, const Double_t *binedges);
127 
132  void Set(const TArrayD &binedges) { fBinEdges = binedges; }
133 
134 
139  virtual void CreateBinEdges(TArrayD &binedges) const;
140 
141 private:
143 };
144 
145 void TVariableBinning::Set(Int_t nbins, const Double_t *binedges){
146  fBinEdges.Set(nbins+1);
147  for(int i = 0; i < nbins + 1; i++) fBinEdges[i] = binedges[i];
148 }
149 
150 #endif /* TVARIABLEBINNING_H */
double Double_t
Definition: External.C:58
Class creating a variable binning, used in the histogram manager.
void Set(const TArrayD &binedges)
virtual ~TVariableBinning()
virtual const char * what() const
virtual TBinning * MakeCopy() const
Interface for binnings used by the histogram handler.
Definition: TBinning.h:21
int Int_t
Definition: External.C:63
virtual void CreateBinEdges(TArrayD &binedges) const
const Int_t nbins
void Set(Int_t nbins, const Double_t *binedges)
Exception indicating that the limits are not set.