AliPhysics  db95e02 (db95e02)
 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 
99  virtual TBinning *MakeCopy() const;
100 
107  void SetMinimum(Double_t min) { fMinimum = min; fMinimumSet = true; }
108 
115  void AddStep(Double_t max, Double_t binwidth);
116 
123  virtual void CreateBinEdges(TArrayD &edges) const;
124 
125 private:
128  std::map<double, double> fSteps;
129 };
130 
131 #endif /* TCUSTOMBINNING_H */
double Double_t
Definition: External.C:58
virtual TBinning * MakeCopy() const
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()
bool Bool_t
Definition: External.C:53
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.