File indexing completed on 2025-01-18 10:11:16
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef ROO_ABS_BINNING
0017 #define ROO_ABS_BINNING
0018
0019 #include "Rtypes.h"
0020 #include "RooPrintable.h"
0021 #include "TNamed.h"
0022 class RooAbsRealLValue ;
0023 class RooAbsReal ;
0024
0025 class RooAbsBinning : public TNamed, public RooPrintable {
0026 public:
0027
0028 RooAbsBinning(const char* name=nullptr) : TNamed{name, name} {}
0029 RooAbsBinning(const RooAbsBinning& other, const char* name=nullptr) : TNamed(name,name), RooPrintable(other) {
0030
0031 }
0032 TObject* Clone(const char* newname=nullptr) const override { return clone(newname) ; }
0033 virtual RooAbsBinning* clone(const char* name=nullptr) const = 0 ;
0034
0035
0036 Int_t numBins() const {
0037 return numBoundaries()-1 ;
0038 }
0039 virtual Int_t numBoundaries() const = 0 ;
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052 virtual void binNumbers(double const * x, int * bins, std::size_t n, int coef=1) const = 0 ;
0053
0054
0055
0056
0057
0058
0059
0060 inline int binNumber(double x) const {
0061 int out = 0.0;
0062 binNumbers(&x, &out, 1);
0063 return out;
0064 }
0065
0066 virtual double binCenter(Int_t bin) const = 0 ;
0067 virtual double binWidth(Int_t bin) const = 0 ;
0068 virtual double binLow(Int_t bin) const = 0 ;
0069 virtual double binHigh(Int_t bin) const = 0 ;
0070 virtual bool isUniform() const { return false ; }
0071
0072 virtual void setRange(double xlo, double xhi) = 0 ;
0073
0074 virtual void setMin(double xlo) {
0075 setRange(xlo,highBound()) ;
0076 }
0077
0078 virtual void setMax(double xhi) {
0079 setRange(lowBound(),xhi) ;
0080 }
0081
0082 virtual double lowBound() const = 0 ;
0083 virtual double highBound() const = 0 ;
0084 virtual double averageBinWidth() const = 0 ;
0085
0086
0087 virtual double* array() const = 0 ;
0088
0089 inline void Print(Option_t *options= nullptr) const override {
0090
0091 printStream(defaultPrintStream(),defaultPrintContents(options),defaultPrintStyle(options));
0092 }
0093
0094 void printName(std::ostream& os) const override ;
0095 void printTitle(std::ostream& os) const override ;
0096 void printClassName(std::ostream& os) const override ;
0097 void printArgs(std::ostream& os) const override ;
0098 void printValue(std::ostream& os) const override ;
0099
0100
0101
0102 virtual bool isParameterized() const {
0103 return false ;
0104 }
0105
0106 virtual RooAbsReal* lowBoundFunc() const {
0107 return nullptr ;
0108 }
0109
0110 virtual RooAbsReal* highBoundFunc() const {
0111 return nullptr ;
0112 }
0113
0114 virtual bool isShareable() const {
0115 return true ;
0116 }
0117
0118 virtual void insertHook(RooAbsRealLValue&) const { }
0119
0120 virtual void removeHook(RooAbsRealLValue&) const { }
0121
0122
0123 protected:
0124
0125 ClassDefOverride(RooAbsBinning,2)
0126 };
0127
0128 #endif