Logo ROOT   6.16/01
Reference Guide
RooParamBinning.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id$
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_PARAM_BINNING
17#define ROO_PARAM_BINNING
18
19#include "Rtypes.h"
20#include "RooAbsBinning.h"
21#include "RooRealVar.h"
22#include "RooListProxy.h"
23class TIterator ;
24
26public:
27
28 RooParamBinning(const char* name=0) ;
29 RooParamBinning(RooAbsReal& xlo, RooAbsReal& xhi, Int_t nBins, const char* name=0) ;
30 RooParamBinning(const RooParamBinning& other, const char* name=0) ;
31 RooAbsBinning* clone(const char* name=0) const { return new RooParamBinning(*this,name?name:GetName()) ; }
32 virtual ~RooParamBinning() ;
33
34 virtual void setRange(Double_t xlo, Double_t xhi) ;
35
36 virtual Int_t numBoundaries() const { return _nbins + 1 ; }
37 virtual Int_t binNumber(Double_t x) const ;
38
39 virtual Double_t lowBound() const { return xlo()->getVal() ; }
40 virtual Double_t highBound() const { return xhi()->getVal() ; }
41
42 virtual Double_t binCenter(Int_t bin) const ;
43 virtual Double_t binWidth(Int_t bin) const ;
44 virtual Double_t binLow(Int_t bin) const ;
45 virtual Double_t binHigh(Int_t bin) const ;
46
47 virtual Double_t averageBinWidth() const { return _binw ; }
48 virtual Double_t* array() const ;
49
50 void printMultiline(std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
51
52 virtual void insertHook(RooAbsRealLValue&) const ;
53 virtual void removeHook(RooAbsRealLValue&) const ;
54
55 virtual Bool_t isShareable() const { return kFALSE ; } // parameterized binning cannot be shared across instances
56 virtual Bool_t isParameterized() const { return kTRUE ; } // binning is parameterized, range will need special handling in integration
57 virtual RooAbsReal* lowBoundFunc() const { return xlo() ; }
58 virtual RooAbsReal* highBoundFunc() const { return xhi() ; }
59
60protected:
61
62 mutable Double_t* _array ; //! do not persist
63 mutable RooAbsReal* _xlo ; //!
64 mutable RooAbsReal* _xhi ; //!
67 mutable RooListProxy* _lp ; //
68 mutable RooAbsArg* _owner ; //
69
70 RooAbsReal* xlo() const { return _lp ? ((RooAbsReal*)_lp->at(0)) : _xlo ; }
71 RooAbsReal* xhi() const { return _lp ? ((RooAbsReal*)_lp->at(1)) : _xhi ; }
72
73 ClassDef(RooParamBinning,2) // Binning specification with ranges parameterized by external RooAbsReal functions
74};
75
76#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
#define ClassDef(name, id)
Definition: Rtypes.h:324
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
Definition: RooAbsArg.h:66
RooAbsBinning is the abstract base class for RooRealVar binning definitions This class defines the in...
Definition: RooAbsBinning.h:26
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
Double_t getVal(const RooArgSet *set=0) const
Evaluate object. Returns either cached value or triggers a recalculation.
Definition: RooAbsReal.h:64
RooAbsArg * at(Int_t idx) const
Definition: RooArgList.h:84
RooListProxy is the concrete proxy for RooArgList objects.
Definition: RooListProxy.h:25
Class RooParamBinning is an implementation of RooAbsBinning that constructs a binning with a range de...
RooAbsReal * xhi() const
virtual Double_t lowBound() const
virtual Double_t binWidth(Int_t bin) const
Return average bin width.
RooListProxy * _lp
RooAbsArg * _owner
virtual ~RooParamBinning()
Destructor.
virtual RooAbsReal * lowBoundFunc() const
virtual Int_t binNumber(Double_t x) const
Return the fit bin index for the current value.
RooAbsReal * _xhi
RooParamBinning(const char *name=0)
Default constructor cout << "RooParamBinning(" << this << ") default ctor" << endl ;.
virtual Bool_t isShareable() const
void printMultiline(std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const
Print details of binning.
virtual Double_t binCenter(Int_t bin) const
Return the central value of the 'i'-th fit bin.
virtual Double_t highBound() const
virtual Double_t binLow(Int_t bin) const
Return the low edge of the 'i'-th fit bin.
virtual void removeHook(RooAbsRealLValue &) const
Hook function called by RooAbsRealLValue when this binning is removed as binning for into given owner...
RooAbsReal * _xlo
do not persist
virtual Int_t numBoundaries() const
virtual void setRange(Double_t xlo, Double_t xhi)
Adjust range by adjusting values of external RooAbsReal values Only functional when external represen...
virtual Double_t averageBinWidth() const
Double_t * _array
virtual Double_t * array() const
Return array of bin boundaries.
RooAbsReal * xlo() const
virtual RooAbsReal * highBoundFunc() const
virtual Double_t binHigh(Int_t bin) const
Return the high edge of the 'i'-th fit bin.
RooAbsBinning * clone(const char *name=0) const
virtual void insertHook(RooAbsRealLValue &) const
Hook function called by RooAbsRealLValue when this binning is inserted as binning for into given owne...
virtual Bool_t isParameterized() const
Iterator abstract base class.
Definition: TIterator.h:30
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
Basic string class.
Definition: TString.h:131
Double_t x[n]
Definition: legend1.C:17