Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
RooUniformBinning.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * File: $Id: RooUniformBinning.h,v 1.10 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_UNIFORM_BINNING
17 #define ROO_UNIFORM_BINNING
18 
19 #include "Rtypes.h"
20 #include "RooAbsBinning.h"
21 class TIterator ;
22 
23 class RooUniformBinning : public RooAbsBinning {
24 public:
25 
26  RooUniformBinning(const char* name=0) ;
27  RooUniformBinning(Double_t xlo, Double_t xhi, Int_t nBins, const char* name=0) ;
28  RooUniformBinning(const RooUniformBinning& other, const char* name=0) ;
29  RooAbsBinning* clone(const char* name=0) const { return new RooUniformBinning(*this,name?name:GetName()) ; }
30  virtual ~RooUniformBinning() ;
31 
32  virtual void setRange(Double_t xlo, Double_t xhi) ;
33 
34  virtual Int_t numBoundaries() const { return _nbins + 1 ; }
35  virtual Int_t binNumber(Double_t x) const ;
36  virtual Bool_t isUniform() const { return kTRUE ; }
37 
38  virtual Double_t lowBound() const { return _xlo ; }
39  virtual Double_t highBound() const { return _xhi ; }
40 
41  virtual Double_t binCenter(Int_t bin) const ;
42  virtual Double_t binWidth(Int_t bin) const ;
43  virtual Double_t binLow(Int_t bin) const ;
44  virtual Double_t binHigh(Int_t bin) const ;
45 
46  virtual Double_t averageBinWidth() const { return _binw ; }
47  virtual Double_t* array() const ;
48 
49 protected:
50 
51  mutable Double_t* _array ; //! do not persist
52  Double_t _xlo ;
53  Double_t _xhi ;
54  Int_t _nbins ;
55  Double_t _binw ;
56 
57 
58  ClassDef(RooUniformBinning,1) // Uniform binning specification
59 };
60 
61 #endif