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=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
47protected:
48
50
51 ClassDef(RooRangeBinning,1) // Binning that only defines the total range
52};
53
54#endif
double Double_t
Definition RtypesCore.h:59
#define ClassDef(name, id)
Definition Rtypes.h:325
char name[80]
Definition TGX11.cxx:110
float xmin
float xmax
RooAbsBinning is the abstract base class for RooRealVar binning definitions.
RooRangeBinning is binning/range definition that only defines a range but no binning.
virtual Double_t * array() const
Double_t _range[2]
virtual Double_t binHigh(Int_t) const
virtual void setRange(Double_t xlo, Double_t xhi)
Change limits of the binning to [xlo,xhi].
virtual RooAbsBinning * clone(const char *name=0) const
virtual ~RooRangeBinning()
Destructor.
virtual Double_t lowBound() const
virtual Double_t binLow(Int_t) const
virtual void setMax(Double_t xhi)
Change upper bound to xhi.
virtual Double_t binWidth(Int_t) const
virtual void setMin(Double_t xlo)
Change lower bound to xlo.
virtual Double_t binCenter(Int_t) const
virtual Double_t averageBinWidth() const
virtual Double_t highBound() const
virtual Int_t binNumber(Double_t) const
virtual Int_t numBoundaries() const
virtual const char * GetName() const
Returns name of object.
Definition TNamed.h:47