Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooRangeBinning.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id: RooRangeBinning.h,v 1.4 2007/05/11 09:11:30 verkerke Exp $
5 * Authors: *
6 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8 * *
9 * Copyright (c) 2000-2005, Regents of the University of California *
10 * and Stanford University. All rights reserved. *
11 * *
12 * Redistribution and use in source and binary forms, *
13 * with or without modification, are permitted according to the terms *
14 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15 *****************************************************************************/
16#ifndef ROO_RANGE_BINNING
17#define ROO_RANGE_BINNING
18
19#include "RooAbsBinning.h"
20
22public:
23
24 RooRangeBinning(const char* name=nullptr) ;
25 RooRangeBinning(double xmin, double xmax, const char* name=nullptr) ;
26 RooRangeBinning(const RooRangeBinning&, const char* name=nullptr) ;
27 RooAbsBinning* clone(const char* name=nullptr) const override { return new RooRangeBinning(*this,name?name:GetName()) ; }
28
29 Int_t numBoundaries() const override { return 2 ; }
30 void binNumbers(double const * /*x*/, int * /*bins*/, std::size_t /*n*/, int /*coef*/) const override {}
31 double binCenter(Int_t) const override { return (_range[0] + _range[1]) / 2 ; }
32 double binWidth(Int_t) const override { return (_range[1] - _range[0]) ; }
33 double binLow(Int_t) const override { return _range[0] ; }
34 double binHigh(Int_t) const override { return _range[1] ; }
35
36 void setRange(double xlo, double xhi) override ;
37 void setMin(double xlo) override { setRange(xlo,highBound()) ; }
38 void setMax(double xhi) override { setRange(lowBound(),xhi) ; }
39
40 double lowBound() const override { return _range[0] ; }
41 double highBound() const override { return _range[1] ; }
42 double averageBinWidth() const override { return binWidth(0) ; }
43
44 double* array() const override { return const_cast<double*>(_range) ; }
45
46protected:
47
48 double _range[2] ;
49
50 ClassDefOverride(RooRangeBinning,1) // Binning that only defines the total range
51};
52
53#endif
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
char name[80]
Definition TGX11.cxx:110
float xmin
float xmax
Abstract base class for RooRealVar binning definitions.
Binning/range definition that only defines a range but no binning.
double * array() const override
double binWidth(Int_t) const override
void setMax(double xhi) override
Change upper bound to xhi.
double binLow(Int_t) const override
double lowBound() const override
double highBound() const override
void setMin(double xlo) override
Change lower bound to xlo.
Int_t numBoundaries() const override
RooAbsBinning * clone(const char *name=nullptr) const override
void binNumbers(double const *, int *, std::size_t, int) const override
Compute the bin indices for multiple values of x.
double binCenter(Int_t) const override
void setRange(double xlo, double xhi) override
Change limits of the binning to [xlo,xhi].
double averageBinWidth() const override
double binHigh(Int_t) const override
const char * GetName() const override
Returns name of object.
Definition TNamed.h:47