Logo ROOT   6.16/01
Reference Guide
RooAbsBinning.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id: RooAbsBinning.h,v 1.13 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_ABS_BINNING
17#define ROO_ABS_BINNING
18
19#include "Rtypes.h"
20#include "RooPrintable.h"
21#include "TNamed.h"
22class TIterator ;
23class RooAbsRealLValue ;
24class RooAbsReal ;
25
26class RooAbsBinning : public TNamed, public RooPrintable {
27public:
28
29 RooAbsBinning(const char* name=0) ;
30 RooAbsBinning(const RooAbsBinning& other, const char* name=0) : TNamed(name,name), RooPrintable(other) {
31 // Copy constructor
32 }
33 virtual TObject* Clone(const char* newname=0) const { return clone(newname) ; }
34 virtual RooAbsBinning* clone(const char* name=0) const = 0 ;
35 virtual ~RooAbsBinning() ;
36
37 Int_t numBins() const {
38 // Return number of bins
39 return numBoundaries()-1 ;
40 }
41 virtual Int_t numBoundaries() const = 0 ;
42 virtual Int_t binNumber(Double_t x) const = 0 ;
43 virtual Int_t rawBinNumber(Double_t x) const { return binNumber(x) ; }
44 virtual Double_t binCenter(Int_t bin) const = 0 ;
45 virtual Double_t binWidth(Int_t bin) const = 0 ;
46 virtual Double_t binLow(Int_t bin) const = 0 ;
47 virtual Double_t binHigh(Int_t bin) const = 0 ;
48 virtual Bool_t isUniform() const { return kFALSE ; }
49
50 virtual void setRange(Double_t xlo, Double_t xhi) = 0 ;
51 virtual void setMin(Double_t xlo) {
52 // Change lower bound to xlo
53 setRange(xlo,highBound()) ;
54 }
55 virtual void setMax(Double_t xhi) {
56 // Change upper bound to xhi
57 setRange(lowBound(),xhi) ;
58 }
59
60 virtual Double_t lowBound() const = 0 ;
61 virtual Double_t highBound() const = 0 ;
62 virtual Double_t averageBinWidth() const = 0 ;
63
64
65 virtual Double_t* array() const = 0 ;
66
67 inline virtual void Print(Option_t *options= 0) const {
68 // Printing interface
70 }
71
72 virtual void printName(std::ostream& os) const ;
73 virtual void printTitle(std::ostream& os) const ;
74 virtual void printClassName(std::ostream& os) const ;
75 virtual void printArgs(std::ostream& os) const ;
76 virtual void printValue(std::ostream& os) const ;
77
78
79 virtual Bool_t isParameterized() const {
80 // Interface function. If true, min/max of binning is parameterized by external RooAbsReals
81 return kFALSE ;
82 }
83 virtual RooAbsReal* lowBoundFunc() const {
84 // Return pointer to RooAbsReal parameterized lower bound, if any
85 return 0 ;
86 }
87 virtual RooAbsReal* highBoundFunc() const {
88 // Return pointer to RooAbsReal parameterized upper bound, if any
89 return 0 ;
90 }
91 virtual Bool_t isShareable() const {
92 // If true (default) range definition can be shared across clones of a RooRealVar
93 return kTRUE ;
94 }
95 virtual void insertHook(RooAbsRealLValue&) const {
96 // Hook interface function to execute code upon insertion into a RooAbsRealLValue
97 } ;
98 virtual void removeHook(RooAbsRealLValue&) const {
99 // Hook interface functionto execute code upon removal from a RooAbsRealLValue
100 } ;
101
102protected:
103
104 ClassDef(RooAbsBinning,2) // Abstract base class for binning specification
105};
106
107#endif
int Int_t
Definition: RtypesCore.h:41
const Bool_t kFALSE
Definition: RtypesCore.h:88
bool Bool_t
Definition: RtypesCore.h:59
double Double_t
Definition: RtypesCore.h:55
const Bool_t kTRUE
Definition: RtypesCore.h:87
const char Option_t
Definition: RtypesCore.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:324
RooAbsBinning is the abstract base class for RooRealVar binning definitions This class defines the in...
Definition: RooAbsBinning.h:26
virtual void removeHook(RooAbsRealLValue &) const
Definition: RooAbsBinning.h:98
virtual RooAbsBinning * clone(const char *name=0) const =0
virtual Double_t binLow(Int_t bin) const =0
virtual Double_t * array() const =0
Int_t numBins() const
Definition: RooAbsBinning.h:37
virtual Bool_t isShareable() const
Definition: RooAbsBinning.h:91
RooAbsBinning(const RooAbsBinning &other, const char *name=0)
Definition: RooAbsBinning.h:30
virtual Bool_t isUniform() const
Definition: RooAbsBinning.h:48
virtual Int_t rawBinNumber(Double_t x) const
Definition: RooAbsBinning.h:43
virtual void printName(std::ostream &os) const
Print binning name.
virtual ~RooAbsBinning()
Destructor.
virtual void insertHook(RooAbsRealLValue &) const
Definition: RooAbsBinning.h:95
virtual Bool_t isParameterized() const
Definition: RooAbsBinning.h:79
virtual void printClassName(std::ostream &os) const
Print binning class name.
virtual Double_t binHigh(Int_t bin) const =0
virtual Double_t highBound() const =0
virtual void printArgs(std::ostream &os) const
Print binning arguments (the RooAbsReal objects represening the variable bin boundaries for parameter...
virtual void setMin(Double_t xlo)
Definition: RooAbsBinning.h:51
virtual void printValue(std::ostream &os) const
Print binning value, i.e the bin boundary positions.
virtual Double_t binCenter(Int_t bin) const =0
virtual RooAbsReal * highBoundFunc() const
Definition: RooAbsBinning.h:87
virtual Int_t numBoundaries() const =0
virtual void Print(Option_t *options=0) const
Print TNamed name and title.
Definition: RooAbsBinning.h:67
virtual Int_t binNumber(Double_t x) const =0
virtual Double_t lowBound() const =0
RooAbsBinning(const char *name=0)
Constructor.
virtual void setMax(Double_t xhi)
Definition: RooAbsBinning.h:55
virtual void printTitle(std::ostream &os) const
Print binning title.
virtual void setRange(Double_t xlo, Double_t xhi)=0
virtual RooAbsReal * lowBoundFunc() const
Definition: RooAbsBinning.h:83
virtual Double_t averageBinWidth() const =0
virtual TObject * Clone(const char *newname=0) const
Make a clone of an object using the Streamer facility.
Definition: RooAbsBinning.h:33
virtual Double_t binWidth(Int_t bin) const =0
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:53
RooPlotable is a 'mix-in' base class that define the standard RooFit plotting and printing methods.
Definition: RooPrintable.h:25
virtual StyleOption defaultPrintStyle(Option_t *opt) const
virtual Int_t defaultPrintContents(Option_t *opt) const
Default choice of contents to be printed (name and value)
static std::ostream & defaultPrintStream(std::ostream *os=0)
Return a reference to the current default stream to use in Print().
virtual void printStream(std::ostream &os, Int_t contents, StyleOption style, TString indent="") const
Print description of object on ostream, printing contents set by contents integer,...
Iterator abstract base class.
Definition: TIterator.h:30
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
Mother of all ROOT objects.
Definition: TObject.h:37
Double_t x[n]
Definition: legend1.C:17