Logo ROOT  
Reference Guide
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=0) ;
25 RooRangeBinning(double xmin, double xmax, const char* name=0) ;
26 RooRangeBinning(const RooRangeBinning&, const char* name=0) ;
27 RooAbsBinning* clone(const char* name=0) const override { return new RooRangeBinning(*this,name?name:GetName()) ; }
28 ~RooRangeBinning() override ;
29
30 Int_t numBoundaries() const override { return 2 ; }
31 Int_t binNumber(double) const override { return 0 ; }
32 double binCenter(Int_t) const override { return (_range[0] + _range[1]) / 2 ; }
33 double binWidth(Int_t) const override { return (_range[1] - _range[0]) ; }
34 double binLow(Int_t) const override { return _range[0] ; }
35 double binHigh(Int_t) const override { return _range[1] ; }
36
37 void setRange(double xlo, double xhi) override ;
38 void setMin(double xlo) override { setRange(xlo,highBound()) ; }
39 void setMax(double xhi) override { setRange(lowBound(),xhi) ; }
40
41 double lowBound() const override { return _range[0] ; }
42 double highBound() const override { return _range[1] ; }
43 double averageBinWidth() const override { return binWidth(0) ; }
44
45 double* array() const override { return const_cast<double*>(_range) ; }
46
47protected:
48
49 double _range[2] ;
50
51 ClassDefOverride(RooRangeBinning,1) // Binning that only defines the total range
52};
53
54#endif
#define ClassDefOverride(name, id)
Definition: Rtypes.h:339
char name[80]
Definition: TGX11.cxx:110
float xmin
Definition: THbookFile.cxx:95
float xmax
Definition: THbookFile.cxx:95
RooAbsBinning is the abstract base class for RooRealVar binning definitions.
Definition: RooAbsBinning.h:26
RooRangeBinning is binning/range definition that only defines a range but no binning.
double * array() const override
~RooRangeBinning() override
Destructor.
double binWidth(Int_t) const override
void setMax(double xhi) override
Change upper bound to xhi.
RooAbsBinning * clone(const char *name=0) const override
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
Int_t binNumber(double) const override
RooRangeBinning(const char *name=0)
Default constructor.
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