File indexing completed on 2025-01-18 10:11:26
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef ROO_RANGE_BINNING
0017 #define ROO_RANGE_BINNING
0018
0019 #include "RooAbsBinning.h"
0020
0021 class RooRangeBinning : public RooAbsBinning {
0022 public:
0023
0024 RooRangeBinning(const char* name=nullptr) ;
0025 RooRangeBinning(double xmin, double xmax, const char* name=nullptr) ;
0026 RooRangeBinning(const RooRangeBinning&, const char* name=nullptr) ;
0027 RooAbsBinning* clone(const char* name=nullptr) const override { return new RooRangeBinning(*this,name?name:GetName()) ; }
0028
0029 Int_t numBoundaries() const override { return 2 ; }
0030 void binNumbers(double const * , int * , std::size_t , int ) const override {}
0031 double binCenter(Int_t) const override { return (_range[0] + _range[1]) / 2 ; }
0032 double binWidth(Int_t) const override { return (_range[1] - _range[0]) ; }
0033 double binLow(Int_t) const override { return _range[0] ; }
0034 double binHigh(Int_t) const override { return _range[1] ; }
0035
0036 void setRange(double xlo, double xhi) override ;
0037 void setMin(double xlo) override { setRange(xlo,highBound()) ; }
0038 void setMax(double xhi) override { setRange(lowBound(),xhi) ; }
0039
0040 double lowBound() const override { return _range[0] ; }
0041 double highBound() const override { return _range[1] ; }
0042 double averageBinWidth() const override { return binWidth(0) ; }
0043
0044 double* array() const override { return const_cast<double*>(_range) ; }
0045
0046 protected:
0047
0048 double _range[2] ;
0049
0050 ClassDefOverride(RooRangeBinning,1)
0051 };
0052
0053 #endif