Logo ROOT   6.10/09
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 
22 public:
23 
24  RooRangeBinning(const char* name=0) ;
25  RooRangeBinning(Double_t xmin, Double_t xmax, const char* name=0) ;
26  RooRangeBinning(const RooRangeBinning&, const char* name=0) ;
27  virtual RooAbsBinning* clone(const char* name=0) const { return new RooRangeBinning(*this,name?name:GetName()) ; }
28  virtual ~RooRangeBinning() ;
29 
30  virtual Int_t numBoundaries() const { return 2 ; }
31  virtual Int_t binNumber(Double_t) const { return 0 ; }
32  virtual Double_t binCenter(Int_t) const { return (_range[0] + _range[1]) / 2 ; }
33  virtual Double_t binWidth(Int_t) const { return (_range[1] - _range[0]) ; }
34  virtual Double_t binLow(Int_t) const { return _range[0] ; }
35  virtual Double_t binHigh(Int_t) const { return _range[1] ; }
36 
37  virtual void setRange(Double_t xlo, Double_t xhi) ;
38  virtual void setMin(Double_t xlo) { setRange(xlo,highBound()) ; }
39  virtual void setMax(Double_t xhi) { setRange(lowBound(),xhi) ; }
40 
41  virtual Double_t lowBound() const { return _range[0] ; }
42  virtual Double_t highBound() const { return _range[1] ; }
43  virtual Double_t averageBinWidth() const { return binWidth(0) ; }
44 
45  virtual Double_t* array() const { return const_cast<Double_t*>(_range) ; }
46 
47 protected:
48 
50 
51  ClassDef(RooRangeBinning,1) // Binning that only defines the total range
52 };
53 
54 #endif
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
float xmin
Definition: THbookFile.cxx:93
virtual Double_t lowBound() const
virtual Double_t binWidth(Int_t) const
int Int_t
Definition: RtypesCore.h:41
virtual Double_t highBound() const
virtual Int_t binNumber(Double_t) const
Double_t _range[2]
virtual void setMax(Double_t xhi)
#define ClassDef(name, id)
Definition: Rtypes.h:297
virtual void setRange(Double_t xlo, Double_t xhi)
Change limits of the binning to [xlo,xhi].
virtual Double_t * array() const
float xmax
Definition: THbookFile.cxx:93
RooAbsBinning is the abstract base class for RooRealVar binning definitions This class defines the in...
Definition: RooAbsBinning.h:26
virtual Double_t binCenter(Int_t) const
double Double_t
Definition: RtypesCore.h:55
RooRangeBinning is binning/range definition that only defines a range but no binning.
virtual RooAbsBinning * clone(const char *name=0) const
virtual Double_t binHigh(Int_t) const
RooRangeBinning(const char *name=0)
Default constructor.
virtual ~RooRangeBinning()
Destructor.
virtual Int_t numBoundaries() const
virtual Double_t averageBinWidth() const
virtual void setMin(Double_t xlo)
virtual Double_t binLow(Int_t) const