RooAbsBinning.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Project: RooFit                                                           *
00003  * Package: RooFitCore                                                       *
00004  *    File: $Id: RooAbsBinning.h,v 1.13 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_ABS_BINNING
00017 #define ROO_ABS_BINNING
00018 
00019 #include "Rtypes.h"
00020 #include "RooPrintable.h"
00021 #include "TNamed.h" 
00022 class TIterator ;
00023 class RooAbsRealLValue ;
00024 class RooAbsReal ;
00025 
00026 class RooAbsBinning : public TNamed, public RooPrintable {
00027 public:
00028 
00029   RooAbsBinning(const char* name=0) ;
00030   RooAbsBinning(const RooAbsBinning& other, const char* name=0) : TNamed(name,name), RooPrintable(other) {
00031     // Copy constructor
00032   }
00033   virtual TObject* Clone(const char* newname=0) const { return clone(newname) ; }
00034   virtual RooAbsBinning* clone(const char* name=0) const = 0 ;
00035   virtual ~RooAbsBinning() ;
00036 
00037   Int_t numBins() const { 
00038     // Return number of bins 
00039     return numBoundaries()-1 ; 
00040   }
00041   virtual Int_t numBoundaries() const = 0 ;
00042   virtual Int_t binNumber(Double_t x) const = 0 ;
00043   virtual Int_t rawBinNumber(Double_t x) const { return binNumber(x) ; }
00044   virtual Double_t binCenter(Int_t bin) const = 0 ;
00045   virtual Double_t binWidth(Int_t bin) const = 0 ;
00046   virtual Double_t binLow(Int_t bin) const = 0 ;
00047   virtual Double_t binHigh(Int_t bin) const = 0 ;
00048   virtual Bool_t isUniform() const { return kFALSE ; }
00049 
00050   virtual void setRange(Double_t xlo, Double_t xhi) = 0 ;
00051   virtual void setMin(Double_t xlo) { 
00052     // Change lower bound to xlo
00053     setRange(xlo,highBound()) ; 
00054   }
00055   virtual void setMax(Double_t xhi) { 
00056     // Change upper bound to xhi
00057     setRange(lowBound(),xhi) ; 
00058   }
00059 
00060   virtual Double_t lowBound() const = 0 ;
00061   virtual Double_t highBound() const = 0 ;
00062   virtual Double_t averageBinWidth() const = 0 ;
00063 
00064 
00065   virtual Double_t* array() const = 0 ;
00066 
00067   inline virtual void Print(Option_t *options= 0) const {
00068     // Printing interface
00069     printStream(defaultPrintStream(),defaultPrintContents(options),defaultPrintStyle(options));
00070   }
00071 
00072   virtual void printName(ostream& os) const ;
00073   virtual void printTitle(ostream& os) const ;
00074   virtual void printClassName(ostream& os) const ;
00075   virtual void printArgs(ostream& os) const ;
00076   virtual void printValue(ostream& os) const ;
00077   
00078 
00079   virtual Bool_t isParameterized() const { 
00080     // Interface function. If true, min/max of binning is parameterized by external RooAbsReals
00081     return kFALSE ; 
00082   }
00083   virtual RooAbsReal* lowBoundFunc() const { 
00084     // Return pointer to RooAbsReal parameterized lower bound, if any
00085     return 0 ; 
00086   }
00087   virtual RooAbsReal* highBoundFunc() const { 
00088     // Return pointer to RooAbsReal parameterized upper bound, if any
00089     return 0 ; 
00090   }
00091   virtual Bool_t isShareable() const { 
00092     // If true (default) range definition can be shared across clones of a RooRealVar
00093     return kTRUE ; 
00094   }
00095   virtual void insertHook(RooAbsRealLValue&) const {
00096     // Hook interface function to execute code upon insertion into a RooAbsRealLValue
00097   } ;
00098   virtual void removeHook(RooAbsRealLValue&) const {
00099     // Hook interface functionto execute code upon removal from a RooAbsRealLValue
00100   } ;
00101 
00102 protected:  
00103 
00104   ClassDef(RooAbsBinning,2) // Abstract base class for binning specification
00105 };
00106 
00107 #endif

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