ROOT logo
/*****************************************************************************
 * Project: RooFit                                                           *
 * Package: RooFitCore                                                       *
 *    File: $Id: RooAbsBinning.h,v 1.13 2007/05/11 09:11:30 verkerke Exp $
 * Authors:                                                                  *
 *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
 *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
 *                                                                           *
 * Copyright (c) 2000-2005, Regents of the University of California          *
 *                          and Stanford University. All rights reserved.    *
 *                                                                           *
 * Redistribution and use in source and binary forms,                        *
 * with or without modification, are permitted according to the terms        *
 * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
 *****************************************************************************/
#ifndef ROO_ABS_BINNING
#define ROO_ABS_BINNING

#include "Rtypes.h"
#include "RooPrintable.h"
#include "TNamed.h" 
class TIterator ;
class RooAbsRealLValue ;
class RooAbsReal ;

class RooAbsBinning : public TNamed, public RooPrintable {
public:

  RooAbsBinning(const char* name=0) ;
  RooAbsBinning(const RooAbsBinning& other, const char* name=0) : TNamed(name,name), RooPrintable(other) {
    // Copy constructor
  }
  virtual TObject* Clone(const char* newname=0) const { return clone(newname) ; }
  virtual RooAbsBinning* clone(const char* name=0) const = 0 ;
  virtual ~RooAbsBinning() ;

  Int_t numBins() const { 
    // Return number of bins 
    return numBoundaries()-1 ; 
  }
  virtual Int_t numBoundaries() const = 0 ;
  virtual Int_t binNumber(Double_t x) const = 0 ;
  virtual Int_t rawBinNumber(Double_t x) const { return binNumber(x) ; }
  virtual Double_t binCenter(Int_t bin) const = 0 ;
  virtual Double_t binWidth(Int_t bin) const = 0 ;
  virtual Double_t binLow(Int_t bin) const = 0 ;
  virtual Double_t binHigh(Int_t bin) const = 0 ;
  virtual Bool_t isUniform() const { return kFALSE ; }

  virtual void setRange(Double_t xlo, Double_t xhi) = 0 ;
  virtual void setMin(Double_t xlo) { 
    // Change lower bound to xlo
    setRange(xlo,highBound()) ; 
  }
  virtual void setMax(Double_t xhi) { 
    // Change upper bound to xhi
    setRange(lowBound(),xhi) ; 
  }

  virtual Double_t lowBound() const = 0 ;
  virtual Double_t highBound() const = 0 ;
  virtual Double_t averageBinWidth() const = 0 ;


  virtual Double_t* array() const = 0 ;

  inline virtual void Print(Option_t *options= 0) const {
    // Printing interface
    printStream(defaultPrintStream(),defaultPrintContents(options),defaultPrintStyle(options));
  }

  virtual void printName(std::ostream& os) const ;
  virtual void printTitle(std::ostream& os) const ;
  virtual void printClassName(std::ostream& os) const ;
  virtual void printArgs(std::ostream& os) const ;
  virtual void printValue(std::ostream& os) const ;
  

  virtual Bool_t isParameterized() const { 
    // Interface function. If true, min/max of binning is parameterized by external RooAbsReals
    return kFALSE ; 
  }
  virtual RooAbsReal* lowBoundFunc() const { 
    // Return pointer to RooAbsReal parameterized lower bound, if any
    return 0 ; 
  }
  virtual RooAbsReal* highBoundFunc() const { 
    // Return pointer to RooAbsReal parameterized upper bound, if any
    return 0 ; 
  }
  virtual Bool_t isShareable() const { 
    // If true (default) range definition can be shared across clones of a RooRealVar
    return kTRUE ; 
  }
  virtual void insertHook(RooAbsRealLValue&) const {
    // Hook interface function to execute code upon insertion into a RooAbsRealLValue
  } ;
  virtual void removeHook(RooAbsRealLValue&) const {
    // Hook interface functionto execute code upon removal from a RooAbsRealLValue
  } ;

protected:  

  ClassDef(RooAbsBinning,2) // Abstract base class for binning specification
};

#endif
 RooAbsBinning.h:1
 RooAbsBinning.h:2
 RooAbsBinning.h:3
 RooAbsBinning.h:4
 RooAbsBinning.h:5
 RooAbsBinning.h:6
 RooAbsBinning.h:7
 RooAbsBinning.h:8
 RooAbsBinning.h:9
 RooAbsBinning.h:10
 RooAbsBinning.h:11
 RooAbsBinning.h:12
 RooAbsBinning.h:13
 RooAbsBinning.h:14
 RooAbsBinning.h:15
 RooAbsBinning.h:16
 RooAbsBinning.h:17
 RooAbsBinning.h:18
 RooAbsBinning.h:19
 RooAbsBinning.h:20
 RooAbsBinning.h:21
 RooAbsBinning.h:22
 RooAbsBinning.h:23
 RooAbsBinning.h:24
 RooAbsBinning.h:25
 RooAbsBinning.h:26
 RooAbsBinning.h:27
 RooAbsBinning.h:28
 RooAbsBinning.h:29
 RooAbsBinning.h:30
 RooAbsBinning.h:31
 RooAbsBinning.h:32
 RooAbsBinning.h:33
 RooAbsBinning.h:34
 RooAbsBinning.h:35
 RooAbsBinning.h:36
 RooAbsBinning.h:37
 RooAbsBinning.h:38
 RooAbsBinning.h:39
 RooAbsBinning.h:40
 RooAbsBinning.h:41
 RooAbsBinning.h:42
 RooAbsBinning.h:43
 RooAbsBinning.h:44
 RooAbsBinning.h:45
 RooAbsBinning.h:46
 RooAbsBinning.h:47
 RooAbsBinning.h:48
 RooAbsBinning.h:49
 RooAbsBinning.h:50
 RooAbsBinning.h:51
 RooAbsBinning.h:52
 RooAbsBinning.h:53
 RooAbsBinning.h:54
 RooAbsBinning.h:55
 RooAbsBinning.h:56
 RooAbsBinning.h:57
 RooAbsBinning.h:58
 RooAbsBinning.h:59
 RooAbsBinning.h:60
 RooAbsBinning.h:61
 RooAbsBinning.h:62
 RooAbsBinning.h:63
 RooAbsBinning.h:64
 RooAbsBinning.h:65
 RooAbsBinning.h:66
 RooAbsBinning.h:67
 RooAbsBinning.h:68
 RooAbsBinning.h:69
 RooAbsBinning.h:70
 RooAbsBinning.h:71
 RooAbsBinning.h:72
 RooAbsBinning.h:73
 RooAbsBinning.h:74
 RooAbsBinning.h:75
 RooAbsBinning.h:76
 RooAbsBinning.h:77
 RooAbsBinning.h:78
 RooAbsBinning.h:79
 RooAbsBinning.h:80
 RooAbsBinning.h:81
 RooAbsBinning.h:82
 RooAbsBinning.h:83
 RooAbsBinning.h:84
 RooAbsBinning.h:85
 RooAbsBinning.h:86
 RooAbsBinning.h:87
 RooAbsBinning.h:88
 RooAbsBinning.h:89
 RooAbsBinning.h:90
 RooAbsBinning.h:91
 RooAbsBinning.h:92
 RooAbsBinning.h:93
 RooAbsBinning.h:94
 RooAbsBinning.h:95
 RooAbsBinning.h:96
 RooAbsBinning.h:97
 RooAbsBinning.h:98
 RooAbsBinning.h:99
 RooAbsBinning.h:100
 RooAbsBinning.h:101
 RooAbsBinning.h:102
 RooAbsBinning.h:103
 RooAbsBinning.h:104
 RooAbsBinning.h:105
 RooAbsBinning.h:106
 RooAbsBinning.h:107