AliPhysics  e59a9ba (e59a9ba)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TCustomBinning.h
Go to the documentation of this file.
1 #ifndef TCUSTOMBINNING_H
2 #define TCUSTOMBINNING_H
3 /* Copyright(c) 1998-2016, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice */
5 
6 class TArrayD;
7 
8 #include <Rtypes.h>
9 #include <TBinning.h>
10 #include <exception>
11 #include <map>
12 
52 class TCustomBinning : public TBinning {
53 public:
54 
65  class MinNotSetException : public std::exception {
66  public:
67 
72 
76  virtual ~MinNotSetException() throw() {}
77 
82  virtual const char *what() const throw() { return "Minimum of the binning not set"; }
83  };
84 
89 
93  virtual ~TCustomBinning() {}
94 
101  void SetMinimum(Double_t min) { fMinimum = min; fMinimumSet = true; }
102 
109  void AddStep(Double_t max, Double_t binwidth);
110 
117  virtual void CreateBinEdges(TArrayD &edges) const;
118 
119 private:
120  Double_t fMinimum;
121  Bool_t fMinimumSet;
122  std::map<double, double> fSteps;
123 };
124 
125 #endif /* TCUSTOMBINNING_H */
void AddStep(Double_t max, Double_t binwidth)
Interface for binnings used by the histogram handler.
Definition: TBinning.h:21
std::map< double, double > fSteps
List of ranges with common bin width.
Helper class creating user defined custom binning.
Double_t fMinimum
Minimum of the binning.
virtual void CreateBinEdges(TArrayD &edges) const
virtual const char * what() const
virtual ~TCustomBinning()
Exception thrown in case the minimum is not set.
void SetMinimum(Double_t min)
Bool_t fMinimumSet
Define whether minimum is set. Attention: Bin edges will not be created without minimum.