RooRangeBinning.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Project: RooFit                                                           *
00003  * Package: RooFitCore                                                       *
00004  *    File: $Id: RooRangeBinning.h,v 1.4 2007/05/11 09:11:30 verkerke Exp $
00005  * Authors:                                                                  *
00006  *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
00007  *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
00008  *                                                                           *
00009  * Copyright (c) 2000-2005, Regents of the University of California          *
00010  *                          and Stanford University. All rights reserved.    *
00011  *                                                                           *
00012  * Redistribution and use in source and binary forms,                        *
00013  * with or without modification, are permitted according to the terms        *
00014  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
00015  *****************************************************************************/
00016 #ifndef ROO_RANGE_BINNING
00017 #define ROO_RANGE_BINNING
00018 
00019 #include "RooAbsBinning.h"
00020 
00021 class RooRangeBinning : public RooAbsBinning {
00022 public:
00023 
00024   RooRangeBinning(const char* name=0) ;
00025   RooRangeBinning(Double_t xmin, Double_t xmax, const char* name=0) ;
00026   RooRangeBinning(const RooRangeBinning&, const char* name=0) ;
00027   virtual RooAbsBinning* clone(const char* name=0) const { return new RooRangeBinning(*this,name?name:GetName()) ; }
00028   virtual ~RooRangeBinning() ;
00029 
00030   virtual Int_t numBoundaries() const { return 2 ; }
00031   virtual Int_t binNumber(Double_t) const { return 0 ; }
00032   virtual Double_t binCenter(Int_t) const { return (_range[0] + _range[1]) / 2 ; }
00033   virtual Double_t binWidth(Int_t) const { return (_range[1] - _range[0]) ; }
00034   virtual Double_t binLow(Int_t) const { return _range[0] ; }
00035   virtual Double_t binHigh(Int_t) const { return _range[1] ; }
00036 
00037   virtual void setRange(Double_t xlo, Double_t xhi) ;
00038   virtual void setMin(Double_t xlo) { setRange(xlo,highBound()) ; }
00039   virtual void setMax(Double_t xhi) { setRange(lowBound(),xhi) ; }
00040 
00041   virtual Double_t lowBound() const { return _range[0] ; }
00042   virtual Double_t highBound() const { return _range[1] ; }
00043   virtual Double_t averageBinWidth() const { return binWidth(0) ; }
00044 
00045   virtual Double_t* array() const { return const_cast<Double_t*>(_range) ; }
00046 
00047 protected:
00048 
00049   Double_t _range[2] ;
00050     
00051   ClassDef(RooRangeBinning,1) // Binning that only defines the total range
00052 };
00053 
00054 #endif

Generated on Tue Jul 5 14:26:19 2011 for ROOT_528-00b_version by  doxygen 1.5.1